aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorSergey Lapin <slapin@ossfans.org>2009-08-05 17:14:29 +0400
committerSergey Lapin <slapin@ossfans.org>2009-08-05 17:14:29 +0400
commit5d87cec7a3e962afb7cfa621d172abc3effc085d (patch)
tree5e26142100749807b517588779120b73a83a30d2 /recipes
parentc91a54aef8a39e7cbb2571574f56f2cf12104ff1 (diff)
parent2880b3877d38bfaa4056af6df7f122a64e955292 (diff)
downloadopenembedded-5d87cec7a3e962afb7cfa621d172abc3effc085d.tar.gz
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'recipes')
-rw-r--r--recipes/0xFFFF/0xffff-native_0.1.bb2
-rw-r--r--recipes/0xFFFF/0xffff-native_0.2.bb2
-rw-r--r--recipes/alsa/alsa-utils_1.0.19.bb4
-rw-r--r--recipes/alsa/alsa-utils_1.0.20.bb66
-rw-r--r--recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch (renamed from recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch)0
-rw-r--r--recipes/angstrom/e-wm-config-angstrom.bb10
-rw-r--r--recipes/antlr/antlr-native_2.7.7.bb2
-rw-r--r--recipes/automake/automake.inc1
-rw-r--r--recipes/automake/automake_1.10.2.bb2
-rw-r--r--recipes/balsa/balsa-2.4.0/balsa-no-spell.patch53
-rw-r--r--recipes/balsa/balsa-2.4.0/balsa-touch.patch11
-rw-r--r--recipes/balsa/balsa_2.4.0.bb80
-rw-r--r--recipes/binutils/binutils-2.18/binutils-section-in-segment.patch30
-rw-r--r--recipes/binutils/binutils-2.18/parse-neon-vmov.diff41
-rw-r--r--recipes/binutils/binutils-cross-sdk_2.17.bb3
-rw-r--r--recipes/binutils/binutils_2.18.bb4
-rw-r--r--recipes/bluez/bluez-utils.inc2
-rw-r--r--recipes/bluez/bluez-utils3.inc2
-rw-r--r--recipes/bluez/bluez.inc2
-rw-r--r--recipes/bluez/bluez4.inc9
-rw-r--r--recipes/bluez/bluez4_4.31.bb6
-rw-r--r--recipes/bluez/bluez4_4.35.bb6
-rw-r--r--recipes/bluez/bluez4_4.37.bb6
-rw-r--r--recipes/bluez/bluez4_4.46.bb13
-rw-r--r--recipes/bluez/obexd_0.15.bb10
-rw-r--r--recipes/ccid/ccid_1.3.8.bb2
-rw-r--r--recipes/classpath/classpath-tools-native.bb6
-rw-r--r--recipes/classpath/classpath.inc5
-rw-r--r--recipes/classpath/classpath_0.95.bb2
-rw-r--r--recipes/classpath/classpath_0.96.1.bb2
-rw-r--r--recipes/classpath/classpath_0.97.2.bb2
-rw-r--r--recipes/classpath/classpath_0.98.bb3
-rw-r--r--recipes/classpath/files/fix-gmp.patch19
-rw-r--r--recipes/cwiid/cwiid_svn.bb34
-rw-r--r--recipes/devhelp/devhelp_0.23.bb16
-rw-r--r--recipes/devhelp/files/devhelp-includes.patch12
-rw-r--r--recipes/devhelp/files/devhelp-webkit.patch71
-rw-r--r--recipes/devmem2/devmem2.bb2
-rw-r--r--recipes/dfu-util/dfu-util-native_svn.bb2
-rw-r--r--recipes/dfu-util/dfu-util_svn.bb2
-rw-r--r--recipes/dhcp/dhcp_3.0.2.bb4
-rw-r--r--recipes/directfb/directfb-1.4.1/ts_lib_autotools.patch22
-rw-r--r--recipes/directfb/directfb_1.4.1.bb26
-rw-r--r--recipes/disko/disko_git.bb22
-rw-r--r--recipes/disko/files/header.patch13
-rw-r--r--recipes/disko/files/linkpath.patch22
-rw-r--r--recipes/disko/files/pkgconfig.patch117
-rw-r--r--recipes/dri/libdrm_2.4.11.bb16
-rw-r--r--recipes/dvsdk/gstreamer-ti/codec_combo_directory_fix.patch52
-rw-r--r--recipes/dvsdk/gstreamer-ti_svn.bb5
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs.inc14
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.33.bb1
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.34.bb2
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.35.bb4
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.39.bb2
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.2.bb6
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.5.bb6
-rw-r--r--recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.8.bb14
-rw-r--r--recipes/ecj/libecj-bootstrap_3.5.bb8
-rw-r--r--recipes/efl1/ecore.inc24
-rw-r--r--recipes/efl1/edje_svn.bb7
-rw-r--r--recipes/efl1/embryo_svn.bb11
-rw-r--r--recipes/efl1/emotion_svn.bb4
-rw-r--r--recipes/eglibc/eglibc-initial_2.10.bb6
-rw-r--r--recipes/eglibc/eglibc_2.10.bb99
-rw-r--r--recipes/eglibc/eglibc_2.9.bb3
-rw-r--r--recipes/eglibc/eglibc_svn.bb4
-rw-r--r--recipes/eglibc/files/eglibc_adjust_begin_insertion.patch13
-rw-r--r--recipes/ekiga/ekiga_3.2.5.bb18
-rw-r--r--recipes/ekiga/opal_3.6.4.bb29
-rw-r--r--recipes/ekiga/ptlib_2.6.4.bb36
-rw-r--r--recipes/emul/emul_1.0.5.bb2
-rw-r--r--recipes/ezx/ezx-boot-usb-native_svn.bb2
-rw-r--r--recipes/fakeroot/fakeroot-native_1.12.4.bb (renamed from recipes/fakeroot/fakeroot-native_1.12.1.bb)0
-rw-r--r--recipes/fakeroot/fakeroot_1.12.4.bb (renamed from recipes/fakeroot/fakeroot_1.12.1.bb)0
-rw-r--r--recipes/ffmpeg/ffmpeg.inc2
-rw-r--r--recipes/ffmpeg/ffmpeg_git.bb12
-rw-r--r--recipes/ffmpeg/omapfbplay-xv_git.bb29
-rw-r--r--recipes/gamin/gamin_0.1.10.bb13
-rw-r--r--recipes/gdb/gdb-6.8/gdb-6.8-fix-compile-karmic.patch22
-rw-r--r--recipes/gdb/gdb-cross-sdk_6.8.bb3
-rw-r--r--recipes/gdb/gdb_6.8.bb3
-rw-r--r--recipes/gdb/gdbserver_6.6.bb5
-rw-r--r--recipes/glib-2.0/glib-2.0-2.20.4/atomic-thumb.patch (renamed from recipes/glib-2.0/glib-2.0-2.20.0/atomic-thumb.patch)0
-rw-r--r--recipes/glib-2.0/glib-2.0-2.20.4/configure-libtool.patch (renamed from recipes/glib-2.0/glib-2.0-2.20.0/configure-libtool.patch)0
-rw-r--r--recipes/glib-2.0/glib-2.0-2.21.4/atomic-thumb.patch42
-rw-r--r--recipes/glib-2.0/glib-2.0-2.21.4/configure-libtool.patch34
-rw-r--r--recipes/glib-2.0/glib-2.0_2.20.4.bb (renamed from recipes/glib-2.0/glib-2.0_2.20.0.bb)0
-rw-r--r--recipes/glib-2.0/glib-2.0_2.21.4.bb11
-rw-r--r--recipes/glibc/files/tls_i486.patch14
-rw-r--r--recipes/glibc/glibc-initial.inc1
-rw-r--r--recipes/glibc/glibc-stage.inc10
-rw-r--r--recipes/glibc/glibc.inc3
-rw-r--r--recipes/glibc/glibc_2.2.5.bb2
-rw-r--r--recipes/glibc/glibc_2.3.2+cvs20040726.bb2
-rw-r--r--recipes/glibc/glibc_2.3.2.bb2
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20041128.bb2
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20050221.bb2
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20050420.bb2
-rw-r--r--recipes/glibc/glibc_2.3.3.bb2
-rw-r--r--recipes/glibc/glibc_2.3.5+cvs20050627.bb2
-rw-r--r--recipes/glibc/glibc_2.3.6.bb2
-rw-r--r--recipes/glibc/glibc_2.4.bb2
-rw-r--r--recipes/glibc/glibc_2.5.bb2
-rw-r--r--recipes/glibc/glibc_2.6.1.bb2
-rw-r--r--recipes/glibc/glibc_2.7.bb2
-rw-r--r--recipes/glibc/glibc_2.9.bb3
-rw-r--r--recipes/glibc/glibc_cvs.bb2
-rw-r--r--recipes/gmp/files/use-includedir.patch13
-rw-r--r--recipes/gmp/gmp-canadian_4.2.4.bb1
-rw-r--r--recipes/gmp/gmp-native_4.2.4.bb1
-rw-r--r--recipes/gmp/gmp_4.2.4.bb4
-rw-r--r--recipes/gnash/gnash_0.8.5.bb9
-rw-r--r--recipes/gnome/epiphany_2.21.92.bb4
-rw-r--r--recipes/gnome/epiphany_2.22.1.bb4
-rw-r--r--recipes/gnome/epiphany_2.24.0.bb3
-rw-r--r--recipes/gnome/epiphany_2.24.2.bb4
-rw-r--r--recipes/gnome/epiphany_2.27.1.bb3
-rw-r--r--recipes/gnome/epiphany_svn.bb4
-rw-r--r--recipes/gnome/gnome-bluetooth_git.bb11
-rw-r--r--recipes/gnome/gnome-power-manager_2.24.2.bb4
-rw-r--r--recipes/gnome/libgweather_2.26.0.bb6
-rw-r--r--recipes/gnome/libsoup-2.4_2.27.4.bb19
-rw-r--r--recipes/gnuradio/gnuradio.inc2
-rw-r--r--recipes/gnuradio/gnuradio/no-usrp2-svn.patch12
-rw-r--r--recipes/gnuradio/gnuradio_3.2.1.bb22
-rw-r--r--recipes/gnuradio/gnuradio_svn.bb10
-rw-r--r--recipes/gphoto2/libgphoto2_2.1.4.bb2
-rw-r--r--recipes/gphoto2/libgphoto2_2.1.5.bb3
-rw-r--r--recipes/gphoto2/libgphoto2_2.1.6.bb3
-rw-r--r--recipes/gphoto2/libgphoto2_2.4.2.bb2
-rw-r--r--recipes/gphoto2/libgphoto2_2.4.4.bb2
-rw-r--r--recipes/gpsbabel/gpsbabel_1.2.5.bb2
-rw-r--r--recipes/gpsbabel/gpsbabel_1.3.6.bb2
-rw-r--r--recipes/gqview/gqview-2.1.5/gqview-gimp.patch11
-rw-r--r--recipes/gqview/gqview-2.1.5/gqview-motion-hint.patch48
-rw-r--r--recipes/gqview/gqview-2.1.5/gqview-rc-quotes.patch26
-rw-r--r--recipes/gqview/gqview_2.1.5.bb7
-rw-r--r--recipes/gs/gs/0001_svn_snapshot.patch24362
-rw-r--r--recipes/gs/gs/0002_svn_snapshot_jbig2dec.patch17181
-rw-r--r--recipes/gs/gs/1001_install_cjk_examples.patch18
-rw-r--r--recipes/gs/gs/1002_ps2pdf_man_fix.patch126
-rw-r--r--recipes/gs/gs/1003_fix_autoconf_create_from_infiles.patch14
-rw-r--r--recipes/gs/gs/1004_CVE-2009-0792_CVE-2009-0584_CVE-2009-0583.patch1154
-rw-r--r--recipes/gs/gs/1006_system-jasper.patch28
-rw-r--r--recipes/gs/gs/1007_fix_pphs_script_not_lib.patch22
-rw-r--r--recipes/gs/gs/2001_docdir_fix_for_debian.patch16
-rw-r--r--recipes/gs/gs/2002_gs_man_fix_debian.patch40
-rw-r--r--recipes/gs/gs_8.64.bb54
-rw-r--r--recipes/gstreamer/gst-plugins-bad_0.10.12.bb11
-rw-r--r--recipes/gstreamer/gst-plugins-bad_0.10.9.bb14
-rw-r--r--recipes/gstreamer/gst-plugins-good/fix-unit-scale-asseration.patch33
-rw-r--r--recipes/gstreamer/gst-plugins-good_0.10.15.bb14
-rw-r--r--recipes/gstreamer/gstreamer_0.10.23.bb2
-rw-r--r--recipes/gtk+/gtk+-2.16.4/hardcoded_libtool.patch (renamed from recipes/gtk+/gtk+-2.16.0/hardcoded_libtool.patch)0
-rw-r--r--recipes/gtk+/gtk+-2.16.4/no-demos.patch (renamed from recipes/gtk+/gtk+-2.16.0/no-demos.patch)0
-rw-r--r--recipes/gtk+/gtk+-2.16.4/run-iconcache.patch (renamed from recipes/gtk+/gtk+-2.16.0/run-iconcache.patch)0
-rw-r--r--recipes/gtk+/gtk+-2.16.4/toggle-font.diff (renamed from recipes/gtk+/gtk+-2.16.0/toggle-font.diff)0
-rw-r--r--recipes/gtk+/gtk+_2.16.4.bb (renamed from recipes/gtk+/gtk+_2.16.0.bb)2
-rw-r--r--recipes/gtk-webcore/files/wscript-fix.patch14
-rw-r--r--recipes/gtk-webcore/midori_0.1.8.bb31
-rw-r--r--recipes/gtk-webcore/midori_git.bb5
-rw-r--r--recipes/gtksourceview/gtksourceview2_2.6.0.bb4
-rw-r--r--recipes/guile/guile-native_1.8.2.bb8
-rw-r--r--recipes/hal/hal.inc2
-rw-r--r--recipes/hal/hal_0.5.12.bb3
-rw-r--r--recipes/hal/hal_0.5.13.bb12
-rw-r--r--recipes/hal/hal_0.5.9.1.bb2
-rw-r--r--recipes/hal/hal_git.bb2
-rw-r--r--recipes/i2c-tools/read-edid_1.4.1.bb7
-rw-r--r--recipes/icecast/icecast_2.3.2.bb21
-rw-r--r--recipes/icon-slicer/icon-slicer-native_0.3.bb2
-rw-r--r--recipes/imagemagick/imagemagick_6.3.5-10.bb2
-rw-r--r--recipes/images/sugar-image.bb3
-rwxr-xr-xrecipes/initscripts/initscripts-1.0/checkroot18
-rw-r--r--recipes/irrlicht/files/irrlicht_beagle.diff865
-rw-r--r--recipes/irrlicht/irrlicht-examples-gles.bb42
-rw-r--r--recipes/julius/julius_4.1.2.bb63
-rw-r--r--recipes/kexecboot/kexecboot_git.bb8
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/0001-ASoC-Add-support-for-OMAP3-EVM.patch206
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/0001-This-merges-Steve-Kipisz-USB-EHCI-support.-He-star.patch146
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch90
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch287
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/0124-leds-gpio-broken-with-current-git.patch79
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/ads7846-detection.patch41
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/beagle-asoc.patch35
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/defconfig2741
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/ehci.patch131
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/logo_linux_clut224.ppm73147
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/tincantools-puppy.diff66
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/cache-display-fix.patch238
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch (renamed from recipes/linux/linux-omap-pm/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch (renamed from recipes/linux/linux-omap-pm/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch)23
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch (renamed from recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0004-DSS2-OMAP-framebuffer-driver.patch (renamed from recipes/linux/linux-omap-pm/dss2/0004-DSS2-OMAP-framebuffer-driver.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0005-DSS2-Add-panel-drivers.patch (renamed from recipes/linux/linux-omap-pm/dss2/0005-DSS2-Add-panel-drivers.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch (renamed from recipes/linux/linux-omap-pm/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch (renamed from recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch)24
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch (renamed from recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0009-DSS2-Add-acx565akm-panel.patch (renamed from recipes/linux/linux-omap-pm/dss2/0009-DSS2-Add-acx565akm-panel.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch (renamed from recipes/linux/linux-omap-pm/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch (renamed from recipes/linux/linux-omap-pm/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0012-DSS2-Fix-DMA-rotation.patch (renamed from recipes/linux/linux-omap-pm/dss2/0012-DSS2-Fix-DMA-rotation.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch (renamed from recipes/linux/linux-omap-pm/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch (renamed from recipes/linux/linux-omap-pm/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch (renamed from recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch (renamed from recipes/linux/linux-omap-pm/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch (renamed from recipes/linux/linux-omap-pm/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch (renamed from recipes/linux/linux-omap-pm/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch (renamed from recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch (renamed from recipes/linux/linux-omap-pm/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch (renamed from recipes/linux/linux-omap-pm/dss2/0021-DSS2-Add-venc-register-dump.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch (renamed from recipes/linux/linux-omap-pm/dss2/0022-DSS2-FB-remove-unused-var-warning.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch (renamed from recipes/linux/linux-omap-pm/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch (renamed from recipes/linux/linux-omap-pm/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch (renamed from recipes/linux/linux-omap-pm/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch (renamed from recipes/linux/linux-omap-pm/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch (renamed from recipes/linux/linux-omap-pm/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch (renamed from recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch (renamed from recipes/linux/linux-omap-pm/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch (renamed from recipes/linux/linux-omap-pm/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch (renamed from recipes/linux/linux-omap-pm/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch (renamed from recipes/linux/linux-omap-pm/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch (renamed from recipes/linux/linux-omap-pm/dss2/0033-DSS2-Prefer-3-tap-filter.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch (renamed from recipes/linux/linux-omap-pm/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch (renamed from recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch (renamed from recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch (renamed from recipes/linux/linux-omap-pm/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch (renamed from recipes/linux/linux-omap-pm/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch (renamed from recipes/linux/linux-omap-pm/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch (renamed from recipes/linux/linux-omap-pm/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch (renamed from recipes/linux/linux-omap-pm/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch (renamed from recipes/linux/linux-omap-pm/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch (renamed from recipes/linux/linux-omap-pm/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch (renamed from recipes/linux/linux-omap-pm/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch (renamed from recipes/linux/linux-omap-pm/dss2/0045-DSS2-Fixed-line-endings-from-to.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch (renamed from recipes/linux/linux-omap-pm/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch (renamed from recipes/linux/linux-omap-pm/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch (renamed from recipes/linux/linux-omap-pm/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch (renamed from recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch (renamed from recipes/linux/linux-omap-pm/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch (renamed from recipes/linux/linux-omap-pm/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch (renamed from recipes/linux/linux-omap-pm/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch (renamed from recipes/linux/linux-omap-pm/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0054-DSS2-DSI-more-error-handling.patch (renamed from recipes/linux/linux-omap-pm/dss2/0054-DSS2-DSI-more-error-handling.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0055-DSS2-Added-global-alpha-support.patch (renamed from recipes/linux/linux-omap-pm/dss2/0055-DSS2-Added-global-alpha-support.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch (renamed from recipes/linux/linux-omap-pm/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch (renamed from recipes/linux/linux-omap-pm/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch (renamed from recipes/linux/linux-omap-pm/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch (renamed from recipes/linux/linux-omap-pm/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch (renamed from recipes/linux/linux-omap-pm/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0061-DSS2-VRFB-save-restore-context.patch (renamed from recipes/linux/linux-omap-pm/dss2/0061-DSS2-VRFB-save-restore-context.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0062-DSS2-VRAM-Fix-indentation.patch (renamed from recipes/linux/linux-omap-pm/dss2/0062-DSS2-VRAM-Fix-indentation.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch (renamed from recipes/linux/linux-omap-pm/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0064-VRFB-fix-debug-messages.patch (renamed from recipes/linux/linux-omap-pm/dss2/0064-VRFB-fix-debug-messages.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0065-VRFB-add-suspend-resume-functionality.patch (renamed from recipes/linux/linux-omap-pm/dss2/0065-VRFB-add-suspend-resume-functionality.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch (renamed from recipes/linux/linux-omap-pm/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch (renamed from recipes/linux/linux-omap-pm/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch (renamed from recipes/linux/linux-omap-pm/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch (renamed from recipes/linux/linux-omap-pm/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0070-DSS2-fix-irq1.diff (renamed from recipes/linux/linux-omap-pm/dss2/0070-DSS2-fix-irq1.diff)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0071-DSS2-fix-irq2.diff (renamed from recipes/linux/linux-omap-pm/dss2/0071-DSS2-fix-irq2.diff)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/ehci.patch (renamed from recipes/uclibc/uclibc-svn/uClibc.config)0
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/evm-mcspi-ts.diff132
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/fix-audio-capture.patch16
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/fix-install.patch23
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/fix-unaligned-access.diff41
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0001-omap-iommu-tlb-and-pagetable-primitives.patch1226
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0002-omap-iommu-omap2-architecture-specific-functions.patch453
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0003-omap-iommu-omap3-iommu-device-registration.patch124
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0004-omap-iommu-simple-virtual-address-space-management.patch1083
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0005-omap-iommu-entries-for-Kconfig-and-Makefile.patch45
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0006-omap-iommu-Don-t-try-BUG_ON-in_interrupt.patch26
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0007-omap-iommu-We-support-chained-scatterlists-probabl.patch24
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0008-omap2-iommu-entries-for-Kconfig-and-Makefile.patch29
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0001-omap3isp-Add-ISP-main-driver-and-register-definitio.patch4625
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0002-omap3isp-Add-ISP-MMU-wrapper.patch209
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch696
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0004-omap3isp-Add-ISP-frontend-CCDC.patch1875
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0005-omap3isp-Add-ISP-backend-PRV-and-RSZ.patch3413
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0006-omap3isp-Add-statistics-collection-modules-H3A-and.patch2741
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch2384
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch4018
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch2249
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch (renamed from recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch)1163
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch (renamed from recipes/linux/linux-omap-2.6.29/isp/standalone/0002-Resizer-bug-fixes-on-top-of-1.0.2-release.patch)35
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch36
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0001-V4L2-Add-COLORFX-user-control.patch44
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0002-V4L-Int-if-v4l2_int_device_try_attach_all-requires.patch50
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch61
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0004-V4L-int-device-add-support-for-VIDIOC_QUERYMENU.patch33
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0005-V4L-Int-if-Add-vidioc_int_querycap.patch35
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/make-alignment-visible.diff26
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/mmctiming.patch16
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/modedb-hd720.patch13
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0001-USB-musb-only-turn-off-vbus-in-OTG-hosts.patch43
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch76
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0003-USB-musb-NAK-timeout-scheme-on-bulk-RX-endpoint.patch218
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0004-USB-musb-rewrite-host-periodic-endpoint-allocation.patch106
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0005-USB-TWL-disable-VUSB-regulators-when-cable-unplugg.patch181
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0006-USB-gadget-composite-device-level-suspend-resume-h.patch84
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0007-usb-gadget-fix-ethernet-link-reports-to-ethtool.patch47
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0008-usb-musb_host-minor-enqueue-locking-fix-v2.patch60
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0009-usb-musb_host-fix-ep0-fifo-flushing.patch93
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0010-musb-sanitize-clearing-TXCSR-DMA-bits-take-2.patch361
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0011-musb-fix-isochronous-TXDMA-take-2.patch417
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0012-musb-fix-possible-panic-while-resuming.patch56
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch91
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0014-musb_gadget-suppress-parasitic-TX-interrupts-with.patch32
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0015-musb_gadget-fix-unhandled-endpoint-0-IRQs.patch202
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0016-musb_host-factor-out-musb_ep_-get-set-_qh.patch146
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0017-musb_host-refactor-URB-giveback.patch132
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0018-musb-split-out-CPPI-interrupt-handler.patch167
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0019-musb_host-simplify-check-for-active-URB.patch158
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0020-musb_host-streamline-musb_cleanup_urb-calls.patch58
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch70
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0022-musb-use-dma-mode-1-for-TX-if-transfer-size-equals.patch38
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0023-musb-add-high-bandwidth-ISO-support.patch187
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0024-USB-otg-adding-nop-usb-transceiver.patch259
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch90
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0026-musb-proper-hookup-to-transceiver-drivers.patch1109
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0027-musb-otg-timer-cleanup.patch198
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0028-musb-make-initial-HNP-roleswitch-work-v2.patch133
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/musb/0029-musb-support-disconnect-after-HNP-roleswitch.patch145
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/no-cortex-deadlock.patch77
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/no-empty-flash-warnings.patch15
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/no-harry-potter.diff11
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap-2430-lcd.patch11
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap1710h3/defconfig1224
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap2420h4/defconfig1119
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap2430sdp/defconfig (renamed from recipes/linux/mx31ads-kernel/imx31ads_defconfig)1305
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap3-pandora/defconfig2186
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/defconfig2126
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-dss2.diff443
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-lcd-redtint.diff66
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omap5912osk/defconfig1098
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/omapzoom/defconfig1951
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/overo/defconfig2248
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/overo/ehci.patch113
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/read_die_ids.patch23
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/timer-suppression.patch43
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/touchscreen.patch22
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/usbttyfix.patch29
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/vfp/01-vfp-pm.patch128
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/vfp/02-vfp-ptrace.patch231
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/vfp/03-vfp-corruption.patch136
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/vfp/04-vfp-threads.patch98
-rw-r--r--recipes/kexecboot/linux-kexecboot-2.6.29/vfp/05-vfp-signal-handlers.patch148
-rw-r--r--recipes/kexecboot/linux-kexecboot_2.6.29.bb171
-rw-r--r--recipes/lcd4linux/lcd4linux_0.10.0.bb2
-rw-r--r--recipes/lcd4linux/lcd4linux_0.11.0-SVN.bb2
-rw-r--r--recipes/lcdproc/lcdproc5.inc2
-rw-r--r--recipes/libdbi/libdbi-drivers.inc47
-rw-r--r--recipes/libdbi/libdbi-drivers_0.7.1.bb40
-rw-r--r--recipes/libdbi/libdbi-drivers_0.8.3-1.bb2
-rw-r--r--recipes/libdbi/libdbi.inc22
-rw-r--r--recipes/libdbi/libdbi_0.7.2.bb23
-rw-r--r--recipes/libdbi/libdbi_0.8.3.bb1
-rw-r--r--recipes/libftdi/libftdi-native_0.13.bb2
-rw-r--r--recipes/libftdi/libftdi-native_0.9.bb2
-rw-r--r--recipes/libftdi/libftdi_0.13.bb2
-rw-r--r--recipes/libftdi/libftdi_0.9.bb2
-rw-r--r--recipes/libg15/libg15_1.2.1.bb2
-rw-r--r--recipes/libgmime/files/configure-cross.patch42
-rw-r--r--recipes/libgmime/files/iconv-detect.h5
-rw-r--r--recipes/libgmime/libgmime-2.4_2.4.7.bb15
-rw-r--r--recipes/libgmime/libgmime_2.2.23.bb20
-rw-r--r--recipes/libgpg-error/libgpg-error.inc2
-rw-r--r--recipes/libgpg-error/libgpg-error_0.6.bb2
-rw-r--r--recipes/libgpg-error/libgpg-error_0.7.bb2
-rw-r--r--recipes/libgpg-error/libgpg-error_1.0.bb2
-rw-r--r--recipes/libgpg-error/libgpg-error_1.3.bb2
-rw-r--r--recipes/libgpg-error/libgpg-error_1.4.bb2
-rw-r--r--recipes/libgphoto2/libgphoto2_2.4.0.bb2
-rw-r--r--recipes/libmrss/libmrss.inc15
-rw-r--r--recipes/libmrss/libmrss_0.17.2.bb15
-rw-r--r--recipes/libmrss/libmrss_0.19.2.bb7
-rw-r--r--recipes/libnxml/libnxml.inc15
-rw-r--r--recipes/libnxml/libnxml_0.16.bb14
-rw-r--r--recipes/libnxml/libnxml_0.18.3.bb4
-rw-r--r--recipes/libopie/libopie2_cvs.bb15
-rw-r--r--recipes/libqpe/libqpe-opie_cvs.bb4
-rw-r--r--recipes/librfid/librfid_svn.bb2
-rw-r--r--recipes/libsndfile/libsndfile1_1.0.20.bb11
-rw-r--r--recipes/libtool/libtool-2.2.6a/cross_compile.patch55
-rw-r--r--recipes/libtool/libtool-2.2.6a/prefix.patch103
-rw-r--r--recipes/libtool/libtool-cross_2.2.4.bb7
-rw-r--r--recipes/libtool/libtool-cross_2.2.6a.bb50
-rw-r--r--recipes/libtool/libtool-native_2.2.6a.bb46
-rw-r--r--recipes/libtool/libtool-sdk_2.2.4.bb7
-rw-r--r--recipes/libtool/libtool-sdk_2.2.6a.bb60
-rw-r--r--recipes/libtool/libtool_2.2.4.bb14
-rw-r--r--recipes/libtool/libtool_2.2.6a.bb36
-rw-r--r--recipes/libusb/libusb-0.1.10a/ARMfix.patch20
-rw-r--r--recipes/libusb/libusb-0.1.10a/debian-changes.patch407
-rw-r--r--recipes/libusb/libusb-0.1.8/amd64-fPIC.patch11
-rw-r--r--recipes/libusb/libusb-0.1.8/configure.patch99
-rw-r--r--recipes/libusb/libusb-0.1.8/pkgconfig.patch68
-rw-r--r--recipes/libusb/libusb-compat-0.0.9+0.1.0-beta2/0.1.0-beta1-gcc3.4-fix.patch13
-rw-r--r--recipes/libusb/libusb-compat-0.1.2/gcc-3-compatibility.patch (renamed from recipes/libusb/libusb-compat-0.1.0/gcc-3-compatibility.patch)14
-rw-r--r--recipes/libusb/libusb-compat_0.0.9+0.1.0-beta2.bb39
-rw-r--r--recipes/libusb/libusb-compat_0.1.0.bb37
-rw-r--r--recipes/libusb/libusb-compat_0.1.2.bb17
-rw-r--r--recipes/libusb/libusb-native_0.1.10a.bb4
-rw-r--r--recipes/libusb/libusb-native_0.1.12.bb2
-rw-r--r--recipes/libusb/libusb1-0.9.2/0.9.0-gcc3.4-compat-fix.patch13
-rw-r--r--recipes/libusb/libusb1-1.0.0/gcc-3-compatibility.patch22
-rw-r--r--recipes/libusb/libusb1-1.0.1/gcc-3-compatibility.patch33
-rw-r--r--recipes/libusb/libusb1_0.9.2.bb30
-rw-r--r--recipes/libusb/libusb1_1.0.0.bb31
-rw-r--r--recipes/libusb/libusb1_1.0.1.bb28
-rw-r--r--recipes/libusb/libusb1_1.0.2.bb12
-rw-r--r--recipes/libusb/libusb_0.0.0.bb27
-rw-r--r--recipes/libusb/libusb_0.1.10a.bb39
-rw-r--r--recipes/libusb/libusb_0.1.12.bb4
-rw-r--r--recipes/libxine/libxine-1.1.16/ffmpeg_headers.patch19
-rw-r--r--recipes/libxine/libxine_1.1.16.3.bb3
-rw-r--r--recipes/linux/linux-2.6.24/hipox/defconfig8
-rw-r--r--recipes/linux/linux-2.6.24/hipox/hipox-nand.patch2
-rw-r--r--recipes/linux/linux-2.6.27/mpc8315e-rdb/defconfig1766
-rw-r--r--recipes/linux/linux-2.6.27/mpc8315e-rdb/mpc8315erdb-add-msi-to-dts.patch29
-rw-r--r--recipes/linux/linux-2.6.28/at91sam9263ek/defconfig225
-rw-r--r--recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig (renamed from recipes/linux/linux-2.6.30/tx25/defconfig)348
-rw-r--r--recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch55110
-rw-r--r--recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-karo3.diff (renamed from recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff)11820
-rw-r--r--recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/stk5-baseboard_c_vesa640.patch40
-rw-r--r--recipes/linux/linux-2.6.29/stamp9g20evb/defconfig1277
-rw-r--r--recipes/linux/linux-2.6.29/stamp9g20evb/stamp9g20.patch1594
-rw-r--r--recipes/linux/linux-2.6.29/tqm8540/defconfig184
-rw-r--r--recipes/linux/linux-2.6.30/at91sam9263ek/defconfig1855
-rw-r--r--recipes/linux/linux-2.6.30/at91sam9263ek/hrw-linux-2.6.30-exp.patch1816
-rw-r--r--recipes/linux/linux-2.6.30/calamari/defconfig1854
-rw-r--r--recipes/linux/linux-davinci_2.6.30.bb34
-rw-r--r--recipes/linux/linux-davinci_git.bb4
-rw-r--r--recipes/linux/linux-mainstone/0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch15
-rw-r--r--recipes/linux/linux-mainstone_2.6.25.bb3
-rw-r--r--recipes/linux/linux-omap-2.6.29/beagleboard/defconfig58
-rw-r--r--recipes/linux/linux-omap-2.6.29/beagleboard/tincantools-puppy.diff66
-rw-r--r--recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch153
-rw-r--r--recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch1890
-rw-r--r--recipes/linux/linux-omap-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch729
-rw-r--r--recipes/linux/linux-omap-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch36
-rw-r--r--recipes/linux/linux-omap-2.6.29/vfp/01-vfp-pm.patch128
-rw-r--r--recipes/linux/linux-omap-2.6.29/vfp/02-vfp-ptrace.patch231
-rw-r--r--recipes/linux/linux-omap-2.6.29/vfp/03-vfp-corruption.patch136
-rw-r--r--recipes/linux/linux-omap-2.6.29/vfp/04-vfp-threads.patch98
-rw-r--r--recipes/linux/linux-omap-2.6.29/vfp/05-vfp-signal-handlers.patch148
-rw-r--r--recipes/linux/linux-omap-2.6.31/omapzoom2/defconfig1366
-rw-r--r--recipes/linux/linux-omap-pm-2.6.31/beagleboard/defconfig2765
-rw-r--r--recipes/linux/linux-omap-pm/beagle-writable-uboot.diff10
-rw-r--r--recipes/linux/linux-omap-pm/beagleboard/ehci.patch155
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch1297
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch14450
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP-framebuffer-driver.patch3403
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0004-DSS2-Add-panel-drivers.patch396
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0005-DSS2-HACK-Add-DSS2-support-for-N800.patch1079
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0006-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch5703
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-function-to-display-object-to-get-the-back.patch39
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-acx565akm-panel.patch778
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0009-DSS2-Small-VRFB-context-allocation-bug-fixed.patch28
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0010-DSS2-Allocated-memory-for-Color-Look-up-table.patch37
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0011-DSS2-Fix-DMA-rotation.patch65
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0012-DSS2-Verify-that-overlay-paddr-0.patch41
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0013-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch51
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0014-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch68
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-improve-packet-len-calculation.patch58
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0016-DSS2-Disable-video-planes-on-sync-lost-error.patch103
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0017-DSS2-check-for-ovl-paddr-only-when-enabling.patch40
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0018-DSS2-Check-fclk-limits-when-configuring-video-plane.patch183
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-scaling-limits-against-proper-values.patch79
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0020-DSS2-Add-venc-register-dump.patch96
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0021-DSS2-FB-remove-unused-var-warning.patch27
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0022-DSS2-pass-the-default-FB-color-format-through-board.patch214
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0023-DSS2-Beagle-Use-gpio_set_value.patch48
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0024-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch28
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0025-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch78
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0026-DSS2-VRFB-rotation-and-mirroring-implemented.patch324
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0027-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch236
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch61
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0029-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch29
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0030-DSS2-do-bootmem-reserve-for-exclusive-access.patch33
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0031-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch35
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0032-DSS2-Prefer-3-tap-filter.patch82
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0033-DSS2-VRAM-improve-omap_vram_add_region.patch135
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0034-DSS2-Added-the-function-pointer-for-getting-default.patch66
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-support-for-setting-and-querying-alpha-b.patch118
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-querying-color-keying.patch150
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0037-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch56
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0038-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch59
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0039-DSS2-Provided-proper-exclusion-for-destination-colo.patch97
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0040-DSS2-Disable-vertical-offset-with-fieldmode.patch71
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0041-DSS2-Don-t-enable-fieldmode-automatically.patch34
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0042-DSS2-Swap-field-0-and-field-1-registers.patch170
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0043-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch76
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0044-DSS2-Fixed-line-endings-from-to.patch48
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0045-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0046-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch44
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0047-DSS2-VRAM-clear-allocated-area-with-DMA.patch101
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0048-DSS2-OMAPFB-remove-fb-clearing-code.patch53
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-use-debugfs-not-procfs.patch170
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0050-DSS2-VRAM-fix-section-mismatch-warning.patch34
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0051-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch41
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0052-DSS2-DSI-more-error-handling.patch85
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0053-DSS2-Added-global-alpha-support.patch230
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0054-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch35
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0055-DSS2-Documentation-update-for-new-sysfs-entries-in.patch32
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0056-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch56
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0057-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch97
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0058-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch34
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0059-DSS2-VRFB-save-restore-context.patch106
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0060-DSS2-VRAM-Fix-indentation.patch65
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0061-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch82
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0062-VRFB-fix-debug-messages.patch35
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0063-VRFB-add-suspend-resume-functionality.patch216
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0064-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch92
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0065-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch29
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0066-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch65
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0067-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch125
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0068-DSS2-DSI-Improve-perf-measurement-output.patch127
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch110
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0070-DSS2-DSI-Fix-LP-clock.patch78
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0071-DSS2-Do-not-swap-xres-yres-or-change-rotation-in-ch.patch68
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0072-DSS2-Allow-independent-rotation-for-each-plane.patch277
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0073-DSS2-DISPC-fix-irq-handling-locking.patch225
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch39
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0075-DSS2-Add-WSS-support.patch172
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0076-DSS2-Fix-PAL-NTSC-timings.patch68
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0077-DSS2-Add-venc-debugfs-file.patch34
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0078-DSS2-Enable-replication-logic-feature.patch138
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0079-DSS2-support-for-querying-the-supported-overlay-col.patch180
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0080-DSS2-fix-uninitialized-var-in-OMAPFB_GET_CAPS-IOCTL.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0081-DSS2-Reset-WSS-data-only-when-changing-TV-standard.patch54
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch78
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0083-DSS2-DSI-reset-perf-frame-counter-when-starting-au.patch32
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0084-DSS2-DSI-Implement-DSI-bus-lock.patch265
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0085-DSS2-OMAPFB-omapfb_get_ovl_colormode-to-static.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0086-DSS2-VRFB-make-vrfb_hw_context-static.patch25
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0087-DSS2-new-device-driver-model.patch5336
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0088-DSS2-Board-file-changes-for-new-device-model.patch496
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0089-DSS2-Panel-driver-changes-for-new-device-model.patch400
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0090-DSS2-VENC-venc-uses-regulator-framework.patch74
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0091-DSS2-DSI-Use-regulator-framework.patch134
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0092-DSS2-SDP-regulators-for-VDAC-DSI.patch225
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0093-DSS2-Sharp-panel-use-regulator-fw.patch100
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0094-DSS2-Beagle-regulators-for-VDAC-DSI.patch52
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0095-DSS2-Fix-checkpatch-complaints.patch740
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch278
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0097-DSS2-implement-overlay_manager_info.patch649
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0098-DSS2-use-sysfs_streq-to-compare-display-names.patch43
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0099-DSS2-Implement-function-to-verify-lcd-timings.patch144
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0100-DSS2-Remove-non-existing-dsi-power-funcs-from-dss.h.patch25
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0101-DSS2-move-to_dss_driver-and-to_dss_device-to-pu.patch40
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0102-DSS2-CLK-change-omapfb-omapdss-in-clock-framewo.patch53
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0103-DSS2-Use-clkdev.patch122
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0104-DSS2-Fix-documentation.patch38
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0105-DSS2-OMAPFB-first-set-TE-then-update-mode.patch38
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0106-DSS2-OMAPFB-Disable-forced-display-update-on-fb-cl.patch48
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0107-DSS2-DSI-use-INIT_COMPLETION-not-init_completion.patch25
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0108-DSS2-DSI-Rewrite-of-the-DSI-update-and-cmd-queue.patch1860
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0109-DSS2-let-init_display-return-an-error-code.patch235
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0110-DSS2-isolate-the-SDI-pads-when-SDI-is-disabled.patch209
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0111-DSS2-Fix-bottom-field-initial-starting-line.patch210
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0112-DSS2-Correctly-determine-if-an-interlaced-display-i.patch50
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0113-DSS2-Fix-omapfb-framebuffer-name.patch115
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0114-DSS2-Overo-update-defconfig-to-lighter-one.patch1217
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0115-DSS2-SDI-make-sdi_pads-static.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0116-DSS2-Fix-default_color-sysfs-output.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0117-DSS2-Locking-for-VRFB.patch125
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0118-DSS2-DISPC-fix-locking-issue-with-irq-handling.patch54
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0119-DSS2-OMAPFB-remove-unneeded-locks.patch391
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0120-DSS2-DISPC-configuration-management.patch2006
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0121-DSS2-VRFB-clean-up-BUG-calls.patch70
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0122-DSS2-OMAPFB-don-t-fail-even-if-default-display-doe.patch139
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0123-DSS2-DSI-Fix-external-TE-wait.patch41
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0124-DSS2-DSI-Increase-framedone-timeout-to-1s.patch28
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0125-DSS2-VRAM-Add-function-to-get-free-vram-info.patch76
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch86
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0127-DSS2-DSI-increase-dsi-thread-priority.patch37
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0128-DSS2-DSI-check-bus_lock-in-send_bta.patch28
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0129-DSS2-DSI-export-dsi_vc_send_bta_sync.patch47
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0130-DSS2-DSI-clear-BTA-irq-before-enabling-it.patch26
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0131-DSS2-DSI-check-dsi_set_te-return-value.patch62
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0132-DSS2-DSI-use-only-1-VC.-Fixes-to-TE.patch406
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0133-DSS2-VRAM-Remove-unused-defines.patch41
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0134-DSS2-VENC-Add-invert_polarity-flag.patch65
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0135-DSS2-VRAM-Add-defines-for-VRAM-types.patch89
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0136-DSS2-VRAM-separate-VRAM-setup-from-the-old-fb-vram.patch311
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0137-DSS2-VRFB-Update-license-information.patch77
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0138-DSS2-VRAM-Update-license-information.patch86
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0139-DSS2-VRFB-use-pr_-instead-of-printk.patch43
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0140-DSS2-VRAM-Change-CONFIG_OMAP2_DSS_VRAM_SIZE-name.patch49
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0141-DSS2-VRAM-add-CONFIG_OMAP2_VRAM-flag.patch141
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0142-DSS2-VRFB-Add-CONFIG_OMAP2_VRFB-flag.patch61
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0143-DSS2-VRFB-VRAM-fix-checkpatch-warnings.patch41
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0144-DSS2-fixes-to-dss_omap_3430sdp_defconfig-to-make-it.patch1675
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0145-DSS2-BEAGLE-get-DSS2-working-again-on-beagle.patch724
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0146-DSS2-change-include-asm-.-to-linux-.-in-oma.patch29
-rw-r--r--recipes/linux/linux-omap-pm/fix-mtd.diff51
-rw-r--r--recipes/linux/linux-omap-pm/fix-musb-oops.diff60
-rw-r--r--recipes/linux/linux-omap-pm_git.bb236
-rw-r--r--recipes/linux/linux-omap-psp-2.6.29/fix-section-mismatch.diff11
-rw-r--r--recipes/linux/linux-omap-psp-2.6.29/fix-twl-merge-damage.diff19
-rw-r--r--recipes/linux/linux-omap-psp-2.6.29/no-3517-hack.diff16
-rw-r--r--recipes/linux/linux-omap-psp-2.6.29/omap3evm/defconfig2297
-rw-r--r--recipes/linux/linux-omap-psp_2.6.29.bb34
-rw-r--r--recipes/linux/linux-omap_2.6.29.bb20
-rw-r--r--recipes/linux/linux-omap_git.bb26
-rw-r--r--recipes/linux/linux-omapandroid/omapzoom2/defconfig1854
-rw-r--r--recipes/linux/linux-omapandroid_2.6.29.bb24
-rw-r--r--recipes/linux/linux.inc19
-rw-r--r--recipes/linux/linux/mx31ads/defconfig1202
-rw-r--r--recipes/linux/linux_2.6.25.bb1
-rw-r--r--recipes/linux/linux_2.6.28.bb2
-rw-r--r--recipes/linux/linux_2.6.29+2.6.30-rc4.bb8
-rw-r--r--recipes/linux/linux_2.6.29.bb8
-rw-r--r--recipes/linux/linux_2.6.30.bb11
-rw-r--r--recipes/linux/mx31ads-kernel_2.6.19rc6.bb48
-rw-r--r--recipes/lirc/lirc-modules_0.8.5.bb30
-rw-r--r--recipes/lirc/lirc_0.8.5.bb67
-rw-r--r--recipes/live555/live555_20090602.bb54
-rw-r--r--recipes/loudmouth/loudmouth_1.4.3.bb12
-rw-r--r--recipes/lowpan-tools/lowpan-tools_git.bb7
-rw-r--r--recipes/matchbox-terminal/matchbox-terminal_svn.bb11
-rw-r--r--recipes/mesa/mesa-dri_7.4.bb28
-rw-r--r--recipes/mesa/mesa_7.4.bb2
-rw-r--r--recipes/meta/meta-toolchain-qte.bb7
-rw-r--r--recipes/mono/mono-2.4.2.3/0001-remove-docs-dir-from-build.patch30
-rw-r--r--recipes/mono/mono-2.4.2.3/configure.patch44
-rw-r--r--recipes/mono/mono-2.4.2.3/mini-arm.patch11
-rw-r--r--recipes/mono/mono-mcs-intermediate_2.4.2.3.bb17
-rw-r--r--recipes/mono/mono-native_2.4.2.3.bb20
-rw-r--r--recipes/mono/mono_2.4.2.3.bb85
-rw-r--r--recipes/mono/mono_2.4.2.3.inc21
-rw-r--r--recipes/mono/mono_svn.bb4
-rw-r--r--recipes/mplayer/mplayer_svn.bb10
-rw-r--r--recipes/musicpd/mpd_0.15.bb45
-rw-r--r--recipes/mythtv/mythtv_0.21.bb2
-rw-r--r--recipes/mythtv/mythtv_svn.bb58
-rw-r--r--recipes/nandlogical/files/mtd-abi.h152
-rw-r--r--recipes/nandlogical/files/mtd-user.h21
-rw-r--r--recipes/nandlogical/nandlogical-klibc-static_1.0.0.bb23
-rw-r--r--recipes/net-tools/net-tools_1.60.bb3
-rw-r--r--recipes/nilfs-utils/nilfs-utils_2.0.13.bb (renamed from recipes/nilfs-utils/nilfs-utils_2.0.12.bb)2
-rw-r--r--recipes/ntfs-3g/ntfs-3g_2009.4.4.bb (renamed from recipes/ntfs-3g/ntfs-3g_2009.1.1.bb)1
-rw-r--r--recipes/ntp/files/ntp-4.2.4_p6-nano.patch17
-rw-r--r--recipes/ntp/ntp_4.2.2p3.bb3
-rw-r--r--recipes/nut/nut_2.2.1.bb2
-rw-r--r--recipes/obexftp/obexftp_0.22.bb2
-rw-r--r--recipes/obexftp/obexftp_0.23.bb2
-rw-r--r--recipes/openbmap/openbmap-logger_0.4.0.bb12
-rw-r--r--recipes/openbsc/openbsc_git.bb12
-rw-r--r--recipes/openldap/openldap-2.4.17/openldap-m4-pthread.patch20
-rw-r--r--recipes/openldap/openldap_2.3.11.bb4
-rw-r--r--recipes/openldap/openldap_2.4.17.bb290
-rw-r--r--recipes/openmax/libomxil-bellagio_0.9.1.bb15
-rw-r--r--recipes/openobex/openobex_1.2.bb2
-rw-r--r--recipes/openobex/openobex_1.3.bb2
-rw-r--r--recipes/openobex/openobex_1.5.bb2
-rw-r--r--recipes/opie-taskbar/opie-taskbar.inc1
-rw-r--r--recipes/opie-taskbar/opie-taskbar/server-pro-1.2.4.patch67
-rw-r--r--recipes/opie-taskbar/opie-taskbar/server-pro-cvs.patch68
-rw-r--r--recipes/opie-taskbar/opie-taskbar/server-pro-old.patch76
-rw-r--r--recipes/opie-taskbar/opie-taskbar/server.pro84
-rw-r--r--recipes/opie-taskbar/opie-taskbar_1.2.2.bb4
-rw-r--r--recipes/opie-taskbar/opie-taskbar_1.2.3.bb4
-rw-r--r--recipes/opie-taskbar/opie-taskbar_1.2.4.bb4
-rw-r--r--recipes/opie-taskbar/opie-taskbar_cvs.bb5
-rw-r--r--recipes/opkg/files/opkg-libdir.patch11
-rw-r--r--recipes/opkg/opkg-native_svn.bb2
-rw-r--r--recipes/owfs/owfs_2.7p21.bb2
-rw-r--r--recipes/pango/pango-1.24.4/no-tests.patch (renamed from recipes/pango/pango-1.24.2/no-tests.patch)0
-rw-r--r--recipes/pango/pango_1.24.4.bb (renamed from recipes/pango/pango_1.24.2.bb)0
-rw-r--r--recipes/pciutils/pciutils_3.1.2.bb18
-rw-r--r--recipes/perl/perl-native_5.8.8.bb3
-rw-r--r--recipes/php/php-5.3.0/acinclude-xml2-config.patch18
-rw-r--r--recipes/php/php-5.3.0/pear-makefile.patch11
-rw-r--r--recipes/php/php-native_5.3.0.bb3
-rw-r--r--recipes/pidgin/pidgin/purple-OE-branding.patch14
-rw-r--r--recipes/pidgin/pidgin_2.5.8.bb (renamed from recipes/pidgin/pidgin_2.5.3.bb)0
-rw-r--r--recipes/pmount/pmount-0.9.18/gettext.patch184
-rw-r--r--recipes/pmount/pmount-0.9.19/gettext.patch197
-rw-r--r--recipes/pmount/pmount-0.9.19/install.patch15
-rw-r--r--recipes/pmount/pmount_0.9.18.bb2
-rw-r--r--recipes/pmount/pmount_0.9.19.bb22
-rw-r--r--recipes/pointercal/files/omapzoom2/pointercalbin0 -> 50 bytes
-rw-r--r--recipes/pointercal/pointercal_0.0.bb2
-rw-r--r--recipes/policykit/policykit/PolicyKit.conf13
-rw-r--r--recipes/policykit/policykit_0.9.bb10
-rw-r--r--recipes/powertop/powertop_1.11.bb1
-rwxr-xr-xrecipes/powervr-drivers/libgles-omap3-3.00.00.09/rc.pvr54
-rw-r--r--recipes/powervr-drivers/libgles-omap3.inc16
-rw-r--r--recipes/powervr-drivers/libgles-omap3_3.00.00.08.bb1
-rw-r--r--recipes/powervr-drivers/libgles-omap3_3.00.00.09.bb28
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/0002-Compile-fixes-for-DSS2.patch11
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/build_es3.x_sgx.patch11
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/omap3-sgx-modules-1.3.13.1607.tar.bz2bin0 -> 178370 bytes
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/rotation-dss2.patch21
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1607.bb19
-rw-r--r--recipes/psplash/files/ronetix-pm9263/psplash-default2
-rw-r--r--recipes/pulseaudio/pulseaudio-0.9.15/fixbluezbuild.patch13
-rw-r--r--recipes/pulseaudio/pulseaudio-0.9.15/gettext.patch140
-rw-r--r--recipes/pulseaudio/pulseaudio-0.9.15/tls_m4.patch30
-rw-r--r--recipes/pulseaudio/pulseaudio_0.9.15.bb7
-rw-r--r--recipes/python/python-cjson_1.0.5.bb8
-rw-r--r--recipes/python/python-elementtree_1.2.7-20070827-preview.bb14
-rw-r--r--recipes/python/python-pygtksourceview_2.6.0.bb18
-rw-r--r--recipes/python/python-pyusb_0.4.1.bb2
-rw-r--r--recipes/qt4/files/fix-config-tests.patch34
-rw-r--r--recipes/qt4/qt4-embedded-4.5.2/0003-no-tools.patch (renamed from recipes/qt4/qt4-embedded-4.5.1/0003-no-tools.patch)0
-rw-r--r--recipes/qt4/qt4-embedded-4.5.2/0006-freetype-host-includes.patch (renamed from recipes/qt4/qt4-embedded-4.5.1/0006-freetype-host-includes.patch)0
-rw-r--r--recipes/qt4/qt4-embedded-4.5.2/0007-openssl-host-includes.patch (renamed from recipes/qt4/qt4-embedded-4.5.1/0007-openssl-host-includes.patch)0
-rw-r--r--recipes/qt4/qt4-embedded-4.5.2/0008-qt-lib-infix.patch (renamed from recipes/qt4/qt4-embedded-4.5.1/0008-qt-lib-infix.patch)0
-rw-r--r--recipes/qt4/qt4-embedded-4.5.2/0010-no-simpledecoration-example.patch (renamed from recipes/qt4/qt4-embedded-4.5.1/0010-no-simpledecoration-example.patch)0
-rw-r--r--recipes/qt4/qt4-embedded-gles-4.5.2/sgx-hack.patch18
-rw-r--r--recipes/qt4/qt4-embedded-gles_4.5.2.bb.disabled27
-rw-r--r--recipes/qt4/qt4-embedded.inc3
-rw-r--r--recipes/qt4/qt4-embedded_4.4.3.bb2
-rw-r--r--recipes/qt4/qt4-embedded_4.5.2.bb (renamed from recipes/qt4/qt4-embedded_4.5.1.bb)4
-rw-r--r--recipes/qt4/qt4-tools-native_4.5.2.bb (renamed from recipes/qt4/qt4-tools-native_4.5.1.bb)1
-rw-r--r--recipes/qt4/qt4-tools-sdk_4.5.2.bb (renamed from recipes/qt4/qt4-tools-sdk_4.5.1.bb)2
-rw-r--r--recipes/qt4/qt4-x11-free-gles/sgx-hack.patch20
-rw-r--r--recipes/qt4/qt4-x11-free-gles_4.5.2.bb27
-rw-r--r--recipes/qt4/qt4-x11-free-gles_git.bb.disabled40
-rw-r--r--recipes/qt4/qt4-x11-free.inc7
-rw-r--r--recipes/qt4/qt4-x11-free_4.4.3.bb2
-rw-r--r--recipes/qt4/qt4-x11-free_4.5.1.bb4
-rw-r--r--recipes/qt4/qt4-x11-free_4.5.2.bb4
-rw-r--r--recipes/qt4/qt4.inc52
-rw-r--r--recipes/rdesktop/rdesktop-1.6.0/audio-2008.patch22
-rw-r--r--recipes/rdesktop/rdesktop-1.6.0/rdesktop-addin.patch534
-rw-r--r--recipes/rdesktop/rdesktop.inc2
-rw-r--r--recipes/rdesktop/rdesktop_1.3.1.bb2
-rw-r--r--recipes/rdesktop/rdesktop_1.4.1.bb2
-rw-r--r--recipes/rdesktop/rdesktop_1.5.0.bb2
-rw-r--r--recipes/rdesktop/rdesktop_1.6.0.bb7
-rw-r--r--recipes/rdesktop/rdesktop_cvs.bb3
-rw-r--r--recipes/rsstail/rsstail_1.5.bb19
-rw-r--r--recipes/samsung-soc-utils/s3c2410-boot-usb-native_svn.bb2
-rw-r--r--recipes/sane/sane-backends_1.0.19.bb2
-rw-r--r--recipes/schroedinger/schroedinger_1.0.5.bb6
-rw-r--r--recipes/sdr/hamlib_1.2.9.bb2
-rw-r--r--recipes/skype/skype-static_2.0.0.72.bb4
-rw-r--r--recipes/skype/skype_2.0.0.72.bb20
-rw-r--r--recipes/sqlite/sqlite3.inc11
-rw-r--r--recipes/sugar/etoys_4.0.2212.bb24
-rw-r--r--recipes/sugar/sugar-artwork_0.84.1.bb28
-rw-r--r--recipes/sugar/sugar-base_0.83.2.bb6
-rw-r--r--recipes/sugar/sugar-base_0.84.1.bb53
-rw-r--r--recipes/sugar/sugar-datastore_0.84.0.bb21
-rw-r--r--recipes/sugar/sugar-presence-service_0.84.0.bb31
-rw-r--r--recipes/sugar/sugar-toolkit_0.84.4.bb22
-rw-r--r--recipes/sugar/sugar_0.84.6.bb26
-rw-r--r--recipes/taglib/taglib_1.5.bb4
-rw-r--r--recipes/tangogps/tangogps.inc2
-rw-r--r--recipes/tasks/task-beagleboard-demo.bb6
-rw-r--r--recipes/tasks/task-sugar-sucrose.bb10
-rw-r--r--recipes/tinylogin/tinylogin_1.4.bb3
-rw-r--r--recipes/transmission/transmission_1.73.bb34
-rw-r--r--recipes/tslib/tslib/tslib-nopressure.patch30
-rw-r--r--recipes/tslib/tslib_1.0.bb5
-rw-r--r--recipes/u-boot/u-boot-git/new-pinmux.patch71
-rw-r--r--recipes/u-boot/u-boot_git.bb6
-rw-r--r--recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine72
-rw-r--r--recipes/uclibc/uclibc-git/arm-linuxthreads.patch (renamed from recipes/uclibc/uclibc-svn/arm-linuxthreads.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/arm/uClibc.config (renamed from recipes/uclibc/uclibc-svn/arm/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/arm_fix_alignment.patch (renamed from recipes/uclibc/uclibc-svn/arm_fix_alignment.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/armeb/uClibc.config (renamed from recipes/uclibc/uclibc-svn/armeb/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/dht-walnut/uClibc.config (renamed from recipes/uclibc/uclibc-svn/dht-walnut/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/efika/uClibc.config (renamed from recipes/uclibc/uclibc-svn/efika/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/errno_values.h.patch (renamed from recipes/uclibc/uclibc-svn/errno_values.h.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/error_print_progname.patch (renamed from recipes/uclibc/uclibc-svn/error_print_progname.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/i386/uClibc.config (renamed from recipes/uclibc/uclibc-svn/i386/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/i486/uClibc.config (renamed from recipes/uclibc/uclibc-svn/i486/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/i586/uClibc.config (renamed from recipes/uclibc/uclibc-svn/i586/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/i686/uClibc.config (renamed from recipes/uclibc/uclibc-svn/i686/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/ixp4xx/uClibc.distro (renamed from recipes/uclibc/uclibc-svn/ixp4xx/uClibc.distro)0
-rw-r--r--recipes/uclibc/uclibc-git/ixp4xx/uClibc.machine (renamed from recipes/uclibc/uclibc-svn/ixp4xx/uClibc.machine)0
-rw-r--r--recipes/uclibc/uclibc-git/ldso_hash.patch (renamed from recipes/uclibc/uclibc-svn/ldso_hash.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/linuxthreads-changes.patch (renamed from recipes/uclibc/uclibc-svn/linuxthreads-changes.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/magicbox/uClibc.config (renamed from recipes/uclibc/uclibc-svn/magicbox/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/mipsel/uClibc.config (renamed from recipes/uclibc/uclibc-svn/mipsel/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/powerpc/uClibc.config (renamed from recipes/uclibc/uclibc-svn/powerpc/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/sh3/uClibc.config (renamed from recipes/uclibc/uclibc-svn/sh3/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/sh4/uClibc.config (renamed from recipes/uclibc/uclibc-svn/sh4/uClibc.config)0
-rw-r--r--recipes/uclibc/uclibc-git/thumb-asm-swi.patch (renamed from recipes/uclibc/uclibc-svn/thumb-asm-swi.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/thumb-defined-arm-or-thumb.patch (renamed from recipes/uclibc/uclibc-svn/thumb-defined-arm-or-thumb.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/thumb-mov-pc-bx.patch (renamed from recipes/uclibc/uclibc-svn/thumb-mov-pc-bx.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/uClibc.config (renamed from recipes/webkit/webkit-gtk/acinclude.m4)0
-rw-r--r--recipes/uclibc/uclibc-git/uClibc.distro (renamed from recipes/uclibc/uclibc-svn/uClibc.distro)0
-rw-r--r--recipes/uclibc/uclibc-git/uclibc_enable_log2_test.patch (renamed from recipes/uclibc/uclibc-svn/uclibc_enable_log2_test.patch)0
-rw-r--r--recipes/uclibc/uclibc-git/uclibc_mathc99.patch (renamed from recipes/uclibc/uclibc-svn/uclibc_mathc99.patch)0
-rw-r--r--recipes/uclibc/uclibc-initial_git.bb (renamed from recipes/uclibc/uclibc-initial_svn.bb)2
-rw-r--r--recipes/uclibc/uclibc.inc5
-rw-r--r--recipes/uclibc/uclibc_0.9.26.bb9
-rw-r--r--recipes/uclibc/uclibc_0.9.27.bb3
-rw-r--r--recipes/uclibc/uclibc_0.9.28.bb2
-rw-r--r--recipes/uclibc/uclibc_0.9.29.bb2
-rw-r--r--recipes/uclibc/uclibc_0.9.30.1.bb3
-rw-r--r--recipes/uclibc/uclibc_0.9.30.bb3
-rw-r--r--recipes/uclibc/uclibc_git.bb (renamed from recipes/uclibc/uclibc_svn.bb)12
-rw-r--r--recipes/uclibc/uclibc_nptl.bb21
-rw-r--r--recipes/udev/udev_118.bb1
-rw-r--r--recipes/unzip/unzip_552.bb3
-rw-r--r--recipes/usbpath/usbpath-native_svn.bb2
-rw-r--r--recipes/usbpath/usbpath_svn.bb2
-rw-r--r--recipes/usbutils/usbutils_0.70.bb2
-rw-r--r--recipes/usbutils/usbutils_0.73.bb2
-rw-r--r--recipes/usbutils/usbutils_0.82.bb2
-rw-r--r--recipes/usbutils/usbutils_cvs.bb2
-rw-r--r--recipes/usrp/usrp_0.12.bb2
-rw-r--r--recipes/util-linux-ng/files/uclibc-compile.patch25
-rw-r--r--recipes/util-linux-ng/util-linux-ng-2.16/tls.patch70
-rw-r--r--recipes/util-linux-ng/util-linux-ng-2.16/uclibc-compile.patch13
-rw-r--r--recipes/util-linux-ng/util-linux-ng.inc4
-rw-r--r--recipes/util-linux-ng/util-linux-ng_2.15.bb1
-rw-r--r--recipes/util-linux-ng/util-linux-ng_2.16.bb20
-rw-r--r--recipes/webkit/webkit-gtk/GNUmakefile.am22
-rw-r--r--recipes/webkit/webkit-gtk/WebKit.pri28
-rw-r--r--recipes/webkit/webkit-gtk/WebKit.pro7
-rw-r--r--recipes/webkit/webkit-gtk/configure.ac68
-rw-r--r--recipes/webkit/webkit-gtk/symbols.filter5
-rw-r--r--recipes/webkit/webkit-gtk/unicode-fixes.diff22
-rw-r--r--recipes/webkit/webkit-gtk/update-webkit.sh2
-rw-r--r--recipes/webkit/webkit-gtk_svn.bb6
-rw-r--r--recipes/xapian/xapian-core-native_1.0.13.bb6
-rw-r--r--recipes/xapian/xapian-core_1.0.13.bb16
-rw-r--r--recipes/xmms/xmms_1.2.10.bb11
-rw-r--r--recipes/xorg-driver/xf86-input-elographics_1.2.3.bb4
-rw-r--r--recipes/xorg-driver/xf86-video-intel_2.6.3.bb5
-rw-r--r--recipes/xorg-driver/xf86-video-sis_0.10.1.bb11
-rw-r--r--recipes/xorg-driver/xf86-video-vesa_2.2.0.bb9
-rw-r--r--recipes/xorg-lib/libx11-trim/makekeys-update.patch87
-rw-r--r--recipes/xorg-lib/libx11-trim_1.1.5.bb3
-rw-r--r--recipes/xorg-lib/libxext_1.0.5.bb2
-rw-r--r--recipes/xorg-lib/pixman_git.bb12
-rw-r--r--recipes/xorg-xserver/xserver-kdrive-1300_1.3.0.0.bb10
-rw-r--r--recipes/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf29
-rw-r--r--recipes/xorg-xserver/xserver-xorg-conf_0.1.bb4
-rw-r--r--recipes/xorg-xserver/xserver-xorg/dolt-fix.patch22
-rw-r--r--recipes/xorg-xserver/xserver-xorg_1.6.1.bb3
-rw-r--r--recipes/xserver-common/files/ts-handling-cleanup.diff66
-rw-r--r--recipes/xserver-common/files/xtscal-fix.patch16
-rw-r--r--recipes/xserver-common/xserver-common-1.30/0018-zaurus-fixed-machine-names.patch35
-rw-r--r--recipes/xserver-common/xserver-common-1.30/0019-keymap-fixed-machine-names.patch59
-rw-r--r--recipes/xserver-common/xserver-common-1.30/0020-keymap-fixed-machine-names-again.patch50
-rw-r--r--recipes/xserver-common/xserver-common-1.30/0021-xserver-introduced-MOUSE-variable-for-mouse-argument.patch63
-rw-r--r--recipes/xserver-common/xserver-common-1.30/0022-xserver-fix-syntax-error.patch27
-rw-r--r--recipes/xserver-common/xserver-common_1.25.bb6
-rw-r--r--recipes/xserver-common/xserver-common_1.30.bb26
-rw-r--r--recipes/zaurusd/files/avoid-rotated-server.patch7
850 files changed, 312820 insertions, 9718 deletions
diff --git a/recipes/0xFFFF/0xffff-native_0.1.bb b/recipes/0xFFFF/0xffff-native_0.1.bb
index 2530388d06..3e694eb883 100644
--- a/recipes/0xFFFF/0xffff-native_0.1.bb
+++ b/recipes/0xFFFF/0xffff-native_0.1.bb
@@ -1,6 +1,6 @@
require 0xffff.inc
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
inherit native
diff --git a/recipes/0xFFFF/0xffff-native_0.2.bb b/recipes/0xFFFF/0xffff-native_0.2.bb
index eb82cb468a..be15c8e900 100644
--- a/recipes/0xFFFF/0xffff-native_0.2.bb
+++ b/recipes/0xFFFF/0xffff-native_0.2.bb
@@ -1,6 +1,6 @@
require 0xffff.inc
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
inherit native
diff --git a/recipes/alsa/alsa-utils_1.0.19.bb b/recipes/alsa/alsa-utils_1.0.19.bb
index 9ff129f233..3e9bd86b7e 100644
--- a/recipes/alsa/alsa-utils_1.0.19.bb
+++ b/recipes/alsa/alsa-utils_1.0.19.bb
@@ -3,10 +3,10 @@ HOMEPAGE = "http://www.alsa-project.org"
SECTION = "console/utils"
LICENSE = "GPL"
DEPENDS = "alsa-lib ncurses"
-PR = "r0"
+PR = "r1"
SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
- file://alsa-utils-remove-xmlto.patch;patch=1 \
+ file://alsa-utils-remove-xmlto-1.0.19plus.patch;patch=1 \
"
diff --git a/recipes/alsa/alsa-utils_1.0.20.bb b/recipes/alsa/alsa-utils_1.0.20.bb
new file mode 100644
index 0000000000..7eeb46ca7d
--- /dev/null
+++ b/recipes/alsa/alsa-utils_1.0.20.bb
@@ -0,0 +1,66 @@
+DESCRIPTION = "ALSA Utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+SECTION = "console/utils"
+LICENSE = "GPL"
+DEPENDS = "alsa-lib ncurses"
+PR = "r0"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
+ file://alsa-utils-remove-xmlto-1.0.19plus.patch;patch=1 \
+ "
+
+
+inherit autotools
+
+# This are all packages that we need to make. Also, the now empty alsa-utils
+# ipk depend on them.
+
+
+do_configure_append() {
+ for i in $(find ${S} -name Makefile) ; do
+ sed -i -e s:/usr/include/ncurses:${STAGING_INCDIR}/ncurses:g $i
+ sed -i -e 's:-L/usr/lib -lncurses:-L${STAGING_LIBDIR} -lncurses:g' $i
+ done
+}
+
+PACKAGES += "\
+ alsa-utils-alsamixer \
+ alsa-utils-midi \
+ alsa-utils-aplay \
+ alsa-utils-amixer \
+ alsa-utils-aconnect \
+ alsa-utils-iecset \
+ alsa-utils-speakertest \
+ alsa-utils-aseqnet \
+ alsa-utils-aseqdump \
+ alsa-utils-alsaconf \
+ alsa-utils-alsactl "
+
+# We omit alsaconf, because
+# a) this is a bash script
+# b) it creates config files not suitable for OE-based distros
+
+FILES_${PN} = ""
+FILES_alsa-utils-aplay = "${bindir}/aplay ${bindir}/arecord"
+FILES_alsa-utils-amixer = "${bindir}/amixer"
+FILES_alsa-utils-alsamixer = "${bindir}/alsamixer"
+FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/"
+FILES_alsa-utils-midi = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
+FILES_alsa-utils-aconnect = "${bindir}/aconnect"
+FILES_alsa-utils-aseqnet = "${bindir}/aseqnet"
+FILES_alsa-utils-iecset = "${bindir}/iecset"
+FILES_alsa-utils-alsactl = "${sbindir}/alsactl"
+FILES_alsa-utils-aseqdump = "${bindir}/aseqdump"
+FILES_alsa-utils-alsaconf = "${sbindir}/alsaconf"
+
+DESCRIPTION_alsa-utils-aplay = "play (and record) sound files via ALSA"
+DESCRIPTION_alsa-utils-amixer = "command-line based control for ALSA mixer and settings"
+DESCRIPTION_alsa-utils-alsamixer = "ncurses based control for ALSA mixer and settings"
+DESCRIPTION_alsa-utils-speakertest = "ALSA surround speaker test utility"
+DESCRIPTION_alsa-utils-midi = "miscalleanous MIDI utilities for ALSA"
+DESCRIPTION_alsa-utils-aconnect = "ALSA sequencer connection manager"
+DESCRIPTION_alsa-utils-aseqnet = "network client/server on ALSA sequencer"
+DESCRIPTION_alsa-utils-alsactl = "saves/restores ALSA-settings in /etc/asound.state"
+DESCRIPTION_alsa-utils-alsaconf = "a bash script that creates ALSA configuration files"
+
+ALLOW_EMPTY_alsa-utils = "1"
diff --git a/recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch b/recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch
index 53ff95a886..53ff95a886 100644
--- a/recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch
+++ b/recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch
diff --git a/recipes/angstrom/e-wm-config-angstrom.bb b/recipes/angstrom/e-wm-config-angstrom.bb
index 5b3308811c..208ab99c9f 100644
--- a/recipes/angstrom/e-wm-config-angstrom.bb
+++ b/recipes/angstrom/e-wm-config-angstrom.bb
@@ -1,12 +1,10 @@
DESCRIPTION = "Enlightenment DR17 theme for Angstrom"
LICENSE = "MIT/BSD"
-DEPENDS = "edje-native eet-native"
-RDEPENDS = "e-wm"
-RRECOMMENDS = "places gnome-icon-theme"
+DEPENDS = "edje-native eet-native e-wm places gnome-icon-theme"
PACKAGES_DYNAMIC = "e-wm-config-angstrom*"
-PR = "r11"
+PR = "r13"
SRC_URI = " \
file://configs \
@@ -39,9 +37,11 @@ do_install() {
done
}
+RDEPENDS_${PN} = "e-wm places gnome-icon-theme"
+
python populate_packages_prepend () {
angstrom_e_dir = bb.data.expand('${datadir}/enlightenment/data/config', d)
- do_split_packages(d, angstrom_e_dir, '(.*)', 'e-wm-config-%s', 'E17 window manager %s config', extra_depends='', allow_links=True, allow_dirs=True)
+ do_split_packages(d, angstrom_e_dir, '(.*)', 'e-wm-config-%s', 'E17 window manager %s config', extra_depends='e-wm places gnome-icon-theme', allow_links=True, allow_dirs=True)
}
PACKAGE_ARCH = "all"
diff --git a/recipes/antlr/antlr-native_2.7.7.bb b/recipes/antlr/antlr-native_2.7.7.bb
index 871e620b93..3a2bd122eb 100644
--- a/recipes/antlr/antlr-native_2.7.7.bb
+++ b/recipes/antlr/antlr-native_2.7.7.bb
@@ -5,7 +5,7 @@ SRC_URI += "file://runantlr"
inherit java-native
do_configure() {
- sed -i -e"s|@JAR_FILE@|${STAGING_DATADIR_NATIVE}/java/antlr.jar|" ${WORKDIR}/runantlr
+ sed -i -e"s|@JAR_FILE@|${STAGING_DATADIR_JAVA_NATIVE}/antlr.jar|" ${WORKDIR}/runantlr
}
do_stage() {
diff --git a/recipes/automake/automake.inc b/recipes/automake/automake.inc
index fa59c1f5cc..a4cdbbb34a 100644
--- a/recipes/automake/automake.inc
+++ b/recipes/automake/automake.inc
@@ -12,6 +12,7 @@ RDEPENDS_automake += "\
perl-module-file-compare \
perl-module-file-copy \
perl-module-file-glob \
+ perl-module-file-path \
perl-module-file-spec-unix \
perl-module-file-stat \
perl-module-getopt-long \
diff --git a/recipes/automake/automake_1.10.2.bb b/recipes/automake/automake_1.10.2.bb
index a17fe7aabb..42e0d66d9e 100644
--- a/recipes/automake/automake_1.10.2.bb
+++ b/recipes/automake/automake_1.10.2.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "A tool for automatically generating Makefiles."
LICENSE = "GPL"
HOMEPAGE = "http://www.gnu.org/software/automake/"
SECTION = "devel"
-PR = "r0"
+PR = "r1"
SRC_URI = "\
${GNU_MIRROR}/automake/automake-${PV}.tar.bz2 \
diff --git a/recipes/balsa/balsa-2.4.0/balsa-no-spell.patch b/recipes/balsa/balsa-2.4.0/balsa-no-spell.patch
new file mode 100644
index 0000000000..52780040a9
--- /dev/null
+++ b/recipes/balsa/balsa-2.4.0/balsa-no-spell.patch
@@ -0,0 +1,53 @@
+WARNING! This patch is buggy!
+It fixes compilation without gtkspell and breaks compilation with gtkspell.
+Index: balsa-2.4.0/src/Makefile.am
+===================================================================
+--- balsa-2.4.0.orig/src/Makefile.am
++++ balsa-2.4.0/src/Makefile.am
+@@ -87,13 +87,13 @@ balsa_print_source = print-gtk.c \
+ balsa-print-object-text.h
+
+ if BUILD_WITH_GTKSPELL
+-balsa_gtkspell_extra =
+-balsa_gtkspell_extra_dist = \
++balsa_gtkspell_extra_dist =
++balsa_gtkspell_extra = \
+ spell-check.c \
+ spell-check.h
+ else
+-balsa_gtkspell_extra_dist =
+-balsa_gtkspell_extra = \
++balsa_gtkspell_extra =
++balsa_gtkspell_extra_dist = \
+ spell-check.c \
+ spell-check.h
+ endif
+Index: balsa-2.4.0/src/sendmsg-window.c
+===================================================================
+--- balsa-2.4.0.orig/src/sendmsg-window.c
++++ balsa-2.4.0/src/sendmsg-window.c
+@@ -366,7 +366,7 @@ static const GtkActionEntry entries[] =
+ NULL, G_CALLBACK(insert_signature_cb)},
+ {"QuoteMessages", NULL, N_("_Quote Message(s)"), NULL,
+ NULL, G_CALLBACK(quote_messages_cb)},
+-#if !HAVE_GTKSPELL
++#if HAVE_GTKSPELL
+ {"CheckSpelling", GTK_STOCK_SPELL_CHECK, N_("C_heck Spelling"), NULL,
+ N_("Check the spelling of the message"),
+ G_CALLBACK(spell_check_cb)},
+@@ -6559,7 +6559,6 @@ spell_check_menu_cb(GtkToggleAction * ac
+ sw_spell_detach(bsmsg);
+ }
+
+-#else /* HAVE_GTKSPELL */
+ /* spell_check_cb
+ *
+ * Start the spell check
+@@ -6605,6 +6604,7 @@ spell_check_cb(GtkAction * action, Balsa
+ balsa_spell_check_start(sc, GTK_WINDOW(bsmsg->window));
+ }
+
++#else /* HAVE_GTKSPELL */
+ static void
+ sw_spell_check_response(BalsaSpellCheck * spell_check, gint response,
+ BalsaSendmsg * bsmsg)
diff --git a/recipes/balsa/balsa-2.4.0/balsa-touch.patch b/recipes/balsa/balsa-2.4.0/balsa-touch.patch
new file mode 100644
index 0000000000..16b0a68eeb
--- /dev/null
+++ b/recipes/balsa/balsa-2.4.0/balsa-touch.patch
@@ -0,0 +1,11 @@
+--- balsa-2.4.0/src/main-window.c
++++ balsa-2.4.0/src/main-window.c
+@@ -375,7 +375,7 @@
+ G_CALLBACK(mailbox_conf_add_mbox_cb)},
+ {"NewMaildir", GTK_STOCK_ADD, N_("New \"Maildir\" mailbox..."), NULL,
+ N_("Add a new Maildir style mailbox"),
+- G_CALLBACK(bw_mailbox_conf_add_maildir_cb)},
++ G_CALLBACK(mailbox_conf_add_maildir_cb)},
+ {"NewMH", GTK_STOCK_ADD, N_("New \"MH\" mailbox..."), NULL,
+ N_("Add a new MH style mailbox"), G_CALLBACK(mailbox_conf_add_mh_cb)},
+ #endif /* ENABLE_TOUCH_UI */
diff --git a/recipes/balsa/balsa_2.4.0.bb b/recipes/balsa/balsa_2.4.0.bb
new file mode 100644
index 0000000000..9fc3736a66
--- /dev/null
+++ b/recipes/balsa/balsa_2.4.0.bb
@@ -0,0 +1,80 @@
+DESCRIPTION = "Robust and configurable e-mail client for GNOME"
+HOMEPAGE = "http://pawsa.fedorapeople.org/balsa/"
+SECTION = "x11/network"
+LICENSE = "GPL"
+SRC_URI = "http://pawsa.fedorapeople.org/balsa/${P}.tar.bz2 \
+ file://balsa-touch.patch;patch=1 \
+ file://balsa-no-spell.patch;patch=1"
+
+DEPENDS = "glib-2.0 libgmime-2.4 gtk+ intltool-native libesmtp libxml-parser-perl-native"
+# FIXME: It is possible to build several variants of balsa: lite (SSL, gqlite/GPE, maybe HTML),
+# standard (GNOME, spell checking, HTML), full (Kerberos, LDAP, PGP, Rubrica, X-Face)
+
+# Options for regular expressions are: NONE (POSIX) glib-2.0 (GRegex) libpcre (PCRE)
+DEPENDS += ""
+
+# Options for remote activation are: libbonobo libunique
+DEPENDS += "libunique"
+
+# Options for HTML view are: gtkhtml-2.0 gtkhtml-3.0 webkit-gtk NONE
+DEPENDS += "webkit-gtk"
+
+# Optional dependencies (missing in OE): Spell checking
+#DEPENDS += "gtkspell"
+
+# Optional dependencies: SSL support:
+DEPENDS += "openssl"
+
+# Optional dependencies: GPE addressbook:
+DEPENDS += "sqlite"
+
+# Optional dependencies: GNOME:
+DEPENDS += "gconf libgnome libgnomeui"
+#DEPENDS += "gnome-keyring"
+
+# Optional dependencies: PGP support:
+#DEPENDS += "gpgme"
+
+# Optional dependencies: view source:
+#DEPENDS += "gtksourceview2"
+
+# Optional dependencies: LDAP:
+#DEPENDS += "openldap"
+
+# Options for optional Kerberos 5: heimdal (not in OE) krb5
+#DEPENDS += "krb5"
+
+# Optional dependencies: Rubrica addressbook:
+#DEPENDS += "libxml2"
+
+# Optional dependencies (not yet in OE): X-Face support:
+#DEPENDS += "compface"
+
+# FIXME: doc build requires docbook4 and gnome-doc-utils
+
+inherit autotools
+
+EXTRA_OECONF="--with-ssl \
+ --without-gnome \
+ --enable-touch-ui \
+ --disable-scrollkeeper \
+ --enable-smime \
+ --with-sqlite \
+ --with-ssl \
+ --with-webkit \
+ --with-unique \
+# --without-gtkspell \
+"
+# Not enabled:
+# --with-gtkspell \
+# --with-gpgme \
+# --with-gtksourceview \
+# --with-rubrica \
+# --with-gss \
+# --with-ldap \
+# --with-compface \
+
+do_configure_prepend() {
+ # aclocal seems to insist on looking in here. Make sure it exists.
+ mkdir -p ${S}/m4
+}
diff --git a/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch b/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch
new file mode 100644
index 0000000000..7e95b0a6dd
--- /dev/null
+++ b/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch
@@ -0,0 +1,30 @@
+2007-11-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ Issue #2297
+ include/elf/
+ * internal.h (ELF_IS_SECTION_IN_SEGMENT): Adjust to cope with
+ segments at the end of memory.
+
+Index: include/elf/internal.h
+===================================================================
+--- include/elf/internal.h (revision 187336)
++++ include/elf/internal.h (working copy)
+@@ -280,11 +280,12 @@ struct elf_segment_map
+ || ((bfd_vma) sec_hdr->sh_offset >= segment->p_offset \
+ && (sec_hdr->sh_offset + ELF_SECTION_SIZE(sec_hdr, segment) \
+ <= segment->p_offset + segment->p_filesz))) \
+- /* SHF_ALLOC sections must have VMAs within the segment. */ \
++ /* SHF_ALLOC sections must have VMAs within the segment. Be \
++ careful about segments right at the end of memory. */ \
+ && ((sec_hdr->sh_flags & SHF_ALLOC) == 0 \
+ || (sec_hdr->sh_addr >= segment->p_vaddr \
+- && (sec_hdr->sh_addr + ELF_SECTION_SIZE(sec_hdr, segment) \
+- <= segment->p_vaddr + segment->p_memsz))))
++ && (sec_hdr->sh_addr - segment->p_vaddr \
++ + ELF_SECTION_SIZE(sec_hdr, segment) <= segment->p_memsz))))
+
+ /* Decide if the given sec_hdr is in the given segment in file. */
+ #define ELF_IS_SECTION_IN_SEGMENT_FILE(sec_hdr, segment) \
+
+--------------040206010003050401040204--
+
diff --git a/recipes/binutils/binutils-2.18/parse-neon-vmov.diff b/recipes/binutils/binutils-2.18/parse-neon-vmov.diff
new file mode 100644
index 0000000000..e14b2a70c4
--- /dev/null
+++ b/recipes/binutils/binutils-2.18/parse-neon-vmov.diff
@@ -0,0 +1,41 @@
+===================================================================
+RCS file: /cvs/src/src/gas/config/tc-arm.c,v
+retrieving revision 1.353
+retrieving revision 1.354
+diff -u -r1.353 -r1.354
+--- src/gas/config/tc-arm.c 2008/03/27 14:12:15 1.353
++++ src/gas/config/tc-arm.c 2008/03/28 18:13:52 1.354
+@@ -5209,16 +5209,6 @@
+ inst.operands[i].present = 1;
+ }
+ }
+- else if (parse_qfloat_immediate (&ptr, &inst.operands[i].imm) == SUCCESS)
+- /* Case 2: VMOV<c><q>.<dt> <Qd>, #<float-imm>
+- Case 3: VMOV<c><q>.<dt> <Dd>, #<float-imm>
+- Case 10: VMOV.F32 <Sd>, #<imm>
+- Case 11: VMOV.F64 <Dd>, #<imm> */
+- inst.operands[i].immisfloat = 1;
+- else if (parse_big_immediate (&ptr, i) == SUCCESS)
+- /* Case 2: VMOV<c><q>.<dt> <Qd>, #<imm>
+- Case 3: VMOV<c><q>.<dt> <Dd>, #<imm> */
+- ;
+ else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype,
+ &optype)) != FAIL)
+ {
+@@ -5258,6 +5248,16 @@
+ inst.operands[i++].present = 1;
+ }
+ }
++ else if (parse_qfloat_immediate (&ptr, &inst.operands[i].imm) == SUCCESS)
++ /* Case 2: VMOV<c><q>.<dt> <Qd>, #<float-imm>
++ Case 3: VMOV<c><q>.<dt> <Dd>, #<float-imm>
++ Case 10: VMOV.F32 <Sd>, #<imm>
++ Case 11: VMOV.F64 <Dd>, #<imm> */
++ inst.operands[i].immisfloat = 1;
++ else if (parse_big_immediate (&ptr, i) == SUCCESS)
++ /* Case 2: VMOV<c><q>.<dt> <Qd>, #<imm>
++ Case 3: VMOV<c><q>.<dt> <Dd>, #<imm> */
++ ;
+ else
+ {
+ first_error (_("expected <Rm> or <Dm> or <Qm> operand"));
diff --git a/recipes/binutils/binutils-cross-sdk_2.17.bb b/recipes/binutils/binutils-cross-sdk_2.17.bb
new file mode 100644
index 0000000000..2f13b264a1
--- /dev/null
+++ b/recipes/binutils/binutils-cross-sdk_2.17.bb
@@ -0,0 +1,3 @@
+require binutils_${PV}.bb
+require binutils-cross-sdk.inc
+PR = "${INC_PR}.1"
diff --git a/recipes/binutils/binutils_2.18.bb b/recipes/binutils/binutils_2.18.bb
index 87214644db..b1ae402e29 100644
--- a/recipes/binutils/binutils_2.18.bb
+++ b/recipes/binutils/binutils_2.18.bb
@@ -1,4 +1,4 @@
-INC_PR = "r6"
+INC_PR = "r8"
PR = "${INC_PR}.1"
require binutils.inc
@@ -15,6 +15,8 @@ SRC_URI = "\
file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
file://binutils-x86_64_i386_biarch.patch;patch=1 \
+ file://binutils-section-in-segment.patch;patch=1;pnum=0 \
+ file://parse-neon-vmov.diff;patch=1 \
"
# powerpc patches
diff --git a/recipes/bluez/bluez-utils.inc b/recipes/bluez/bluez-utils.inc
index 298650a080..7c84f4e1d5 100644
--- a/recipes/bluez/bluez-utils.inc
+++ b/recipes/bluez/bluez-utils.inc
@@ -1,7 +1,7 @@
DESCRIPTION = "Linux Bluetooth Stack Userland Utilities."
SECTION = "console"
PRIORITY = "optional"
-DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} libusb-compat dbus cups"
+DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} virtual/libusb0 dbus cups"
PROVIDES = "bluez-utils-dbus"
RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
RREPLACES = "bluez-utils-dbus"
diff --git a/recipes/bluez/bluez-utils3.inc b/recipes/bluez/bluez-utils3.inc
index 5fab6e72c6..df071b76d9 100644
--- a/recipes/bluez/bluez-utils3.inc
+++ b/recipes/bluez/bluez-utils3.inc
@@ -1,7 +1,7 @@
DESCRIPTION = "Linux Bluetooth Stack Userland Utilities."
SECTION = "console"
PRIORITY = "optional"
-DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} libusb-compat dbus glib-2.0"
+DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} virtual/libusb0 dbus glib-2.0"
PROVIDES = "bluez-utils-dbus"
RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
RREPLACES = "bluez-utils-dbus"
diff --git a/recipes/bluez/bluez.inc b/recipes/bluez/bluez.inc
index 711ac383be..e4202f3bd5 100644
--- a/recipes/bluez/bluez.inc
+++ b/recipes/bluez/bluez.inc
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.bluez.org"
LICENSE = "GPL"
PR = "r0"
-DEPENDS = "gstreamer gst-plugins-base libusb1 dbus glib-2.0"
+DEPENDS = "gstreamer gst-plugins-base dbus glib-2.0"
PROVIDES = "bluez-utils-dbus"
RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
RREPLACES = "bluez-utils-dbus"
diff --git a/recipes/bluez/bluez4.inc b/recipes/bluez/bluez4.inc
index f9a72a5345..7f69677345 100644
--- a/recipes/bluez/bluez4.inc
+++ b/recipes/bluez/bluez4.inc
@@ -1,13 +1,14 @@
DESCRIPTION = "Linux Bluetooth Stack Userland V4"
SECTION = "libs"
PRIORITY = "optional"
-DEPENDS = "gst-plugins-base alsa-lib libusb-compat dbus-glib"
+DEPENDS = "gst-plugins-base alsa-lib virtual/libusb0 dbus-glib"
HOMEPAGE = "http://www.bluez.org"
LICENSE = "GPL"
-INC_PR = "r1"
+INC_PR = "r3"
# For angstrom we want this to replace at least bluez-libs
-PROVIDES_append_angstrom = " bluez-utils bluez-libs"
+PROVIDES_append_angstrom = " bluez-utils-dbus bluez-utils bluez-libs"
+RPROVIDES_bluez4-dev_angstrom = "bluez-libs-dev"
SRC_URI = "\
http://www.kernel.org/pub/linux/bluetooth/bluez-${PV}.tar.gz \
@@ -30,7 +31,7 @@ EXTRA_OECONF = "\
--enable-hid2hci \
--enable-dfutool \
--enable-hidd \
- --enable-pandd \
+ --enable-pand \
--enable-dund \
--disable-cups \
--enable-test \
diff --git a/recipes/bluez/bluez4_4.31.bb b/recipes/bluez/bluez4_4.31.bb
index 8c2f6562eb..ede28578de 100644
--- a/recipes/bluez/bluez4_4.31.bb
+++ b/recipes/bluez/bluez4_4.31.bb
@@ -1,10 +1,10 @@
DESCRIPTION = "Linux Bluetooth Stack Userland V4"
SECTION = "libs"
PRIORITY = "optional"
-DEPENDS = "gst-plugins-base alsa-lib libusb-compat dbus-glib"
+DEPENDS = "gst-plugins-base alsa-lib virtual/libusb0 dbus-glib"
HOMEPAGE = "http://www.bluez.org"
LICENSE = "GPL"
-PR = "r6"
+PR = "r7"
SRC_URI = "\
http://www.kernel.org/pub/linux/bluetooth/bluez-${PV}.tar.gz \
@@ -30,7 +30,7 @@ EXTRA_OECONF = "\
--enable-hid2hci \
--enable-dfutool \
--enable-hidd \
- --enable-pandd \
+ --enable-pand \
--enable-dund \
--disable-cups \
--enable-test \
diff --git a/recipes/bluez/bluez4_4.35.bb b/recipes/bluez/bluez4_4.35.bb
index ce9c5a36ea..5a47b5c293 100644
--- a/recipes/bluez/bluez4_4.35.bb
+++ b/recipes/bluez/bluez4_4.35.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Linux Bluetooth Stack Userland V4"
SECTION = "libs"
PRIORITY = "optional"
-DEPENDS = "gst-plugins-base alsa-lib libusb-compat dbus-glib"
+DEPENDS = "gst-plugins-base alsa-lib virtual/libusb0 dbus-glib"
HOMEPAGE = "http://www.bluez.org"
LICENSE = "GPL"
@@ -9,7 +9,7 @@ LICENSE = "GPL"
PROVIDES_append_angstrom = " bluez-utils bluez-libs"
-PR = "r1"
+PR = "r2"
SRC_URI = "\
http://www.kernel.org/pub/linux/bluetooth/bluez-${PV}.tar.gz \
@@ -32,7 +32,7 @@ EXTRA_OECONF = "\
--enable-hid2hci \
--enable-dfutool \
--enable-hidd \
- --enable-pandd \
+ --enable-pand \
--enable-dund \
--disable-cups \
--enable-test \
diff --git a/recipes/bluez/bluez4_4.37.bb b/recipes/bluez/bluez4_4.37.bb
index c28f260761..d1cbc2cb70 100644
--- a/recipes/bluez/bluez4_4.37.bb
+++ b/recipes/bluez/bluez4_4.37.bb
@@ -1,13 +1,15 @@
DESCRIPTION = "Linux Bluetooth Stack Userland V4"
SECTION = "libs"
PRIORITY = "optional"
-DEPENDS = "gst-plugins-base alsa-lib libusb-compat dbus-glib"
+DEPENDS = "gst-plugins-base alsa-lib virtual/libusb0 dbus-glib"
HOMEPAGE = "http://www.bluez.org"
LICENSE = "GPL"
# For angstrom we want this to replace at least bluez-libs
PROVIDES_append_angstrom = " bluez-utils bluez-libs"
+PR = "r1"
+
SRC_URI = "\
http://www.kernel.org/pub/linux/bluetooth/bluez-${PV}.tar.gz \
file://fix-dfutool-usb-declaration-mismatch.patch;patch=1 \
@@ -29,7 +31,7 @@ EXTRA_OECONF = "\
--enable-hid2hci \
--enable-dfutool \
--enable-hidd \
- --enable-pandd \
+ --enable-pand \
--enable-dund \
--disable-cups \
--enable-test \
diff --git a/recipes/bluez/bluez4_4.46.bb b/recipes/bluez/bluez4_4.46.bb
new file mode 100644
index 0000000000..8f5c6e8f7c
--- /dev/null
+++ b/recipes/bluez/bluez4_4.46.bb
@@ -0,0 +1,13 @@
+require bluez4.inc
+
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_angstrom = "1"
+
+DEPENDS += "libsndfile1"
+PR = "${INC_PR}.1"
+
+# Not all distros have a recent enough udev
+BTUDEV = " --disable-udevrules"
+BTUDEV_angstrom = " --enable-udevrules"
+EXTRA_OECONF += "${BTUDEV}"
+
diff --git a/recipes/bluez/obexd_0.15.bb b/recipes/bluez/obexd_0.15.bb
new file mode 100644
index 0000000000..e1cc6ce8ff
--- /dev/null
+++ b/recipes/bluez/obexd_0.15.bb
@@ -0,0 +1,10 @@
+DESCRIPTION = "OBEX Server and Client"
+DEPENDS = "openobex glib-2.0 dbus bluez4"
+
+LICENSE = "GPLv2"
+
+SRC_URI = "http://www.kernel.org/pub/linux/bluetooth/obexd-${PV}.tar.gz"
+
+inherit autotools_stage
+
+FILES_${PN} += "${datadir}/dbus-1/"
diff --git a/recipes/ccid/ccid_1.3.8.bb b/recipes/ccid/ccid_1.3.8.bb
index c2ade3119a..af0303b427 100644
--- a/recipes/ccid/ccid_1.3.8.bb
+++ b/recipes/ccid/ccid_1.3.8.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://pcsclite.alioth.debian.org/ccid.html"
LICENSE = "GPL"
PR = "r0"
-DEPENDS = "libusb pcsc-lite"
+DEPENDS = "virtual/libusb0 pcsc-lite"
RDEPENDS = "pcsc-lite"
SRC_URI = "http://alioth.debian.org/download.php/2482/ccid-${PV}.tar.bz2"
diff --git a/recipes/classpath/classpath-tools-native.bb b/recipes/classpath/classpath-tools-native.bb
index df5df33407..685f0634d3 100644
--- a/recipes/classpath/classpath-tools-native.bb
+++ b/recipes/classpath/classpath-tools-native.bb
@@ -5,3 +5,9 @@
DESCRIPTION = "Provides working jar, javah etc. from the GNU Classpath project"
DEPENDS = "virtual/java-native classpath-native"
+
+inherit native
+
+do_stage () {
+ echo 1 /dev/null
+}
diff --git a/recipes/classpath/classpath.inc b/recipes/classpath/classpath.inc
index da3273bc97..ab47635d78 100644
--- a/recipes/classpath/classpath.inc
+++ b/recipes/classpath/classpath.inc
@@ -5,7 +5,7 @@ PRIORITY = "optional"
LICENSE = "Classpath"
PBN = "classpath"
-DEPENDS = "virtual/javac-native fastjar-native zip-native"
+DEPENDS = "virtual/javac-native fastjar-native zip-native gmp antlr-native"
RPROVIDES = ""
RDEPENDS_${PN} = "${PBN}-common (>= ${PV})"
@@ -30,9 +30,10 @@ EXTRA_OECONF = "\
--includedir=${includedir}/classpath \
--with-vm=java \
--disable-Werror \
+ --with-antlr-jar=${STAGING_DATADIR_JAVA_NATIVE}/antlr.jar \
"
-inherit autotools
+inherit autotools java
do_configure_prepend () {
diff --git a/recipes/classpath/classpath_0.95.bb b/recipes/classpath/classpath_0.95.bb
index 6952cda72f..ccc1ecee7e 100644
--- a/recipes/classpath/classpath_0.95.bb
+++ b/recipes/classpath/classpath_0.95.bb
@@ -6,7 +6,7 @@ SRC_URI += "\
file://javanet-local.patch;patch=1;pnum=0 \
"
-PR = "r6"
+PR = "r7"
DEPENDS += "gtk+ gconf libxtst"
diff --git a/recipes/classpath/classpath_0.96.1.bb b/recipes/classpath/classpath_0.96.1.bb
index cc3505a293..4e1288ff0b 100644
--- a/recipes/classpath/classpath_0.96.1.bb
+++ b/recipes/classpath/classpath_0.96.1.bb
@@ -6,7 +6,7 @@ SRC_URI += "\
file://javanet-local.patch;patch=1;pnum=0 \
"
-PR = "r8"
+PR = "r9"
DEPENDS += "gtk+ gconf libxtst"
diff --git a/recipes/classpath/classpath_0.97.2.bb b/recipes/classpath/classpath_0.97.2.bb
index 1daaa1aa2c..e3b22fb6c5 100644
--- a/recipes/classpath/classpath_0.97.2.bb
+++ b/recipes/classpath/classpath_0.97.2.bb
@@ -12,7 +12,7 @@ SRC_URI += "\
file://gtk-fix.patch;patch=1;pnum=0 \
"
-PR = "r8"
+PR = "r9"
DEPENDS += "gtk+ gconf libxtst"
diff --git a/recipes/classpath/classpath_0.98.bb b/recipes/classpath/classpath_0.98.bb
index 292c49ff1a..6dc1e9e28b 100644
--- a/recipes/classpath/classpath_0.98.bb
+++ b/recipes/classpath/classpath_0.98.bb
@@ -4,9 +4,10 @@ SRC_URI += "\
file://SimpleName.diff;patch=1;pnum=0 \
file://ecj_java_dir.patch;patch=1 \
file://autotools.patch;patch=1 \
+ file://fix-gmp.patch;patch=1 \
"
-PR = "r0"
+PR = "r2"
DEPENDS += "gtk+ gconf libxtst"
diff --git a/recipes/classpath/files/fix-gmp.patch b/recipes/classpath/files/fix-gmp.patch
new file mode 100644
index 0000000000..3f0dfbe084
--- /dev/null
+++ b/recipes/classpath/files/fix-gmp.patch
@@ -0,0 +1,19 @@
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- classpath-0.98.orig/configure.ac
++++ classpath-0.98/configure.ac
+@@ -766,11 +766,11 @@ if test "x${COMPILE_JNI}" = xyes; then
+ dnl __gmpz_mul_si for earlier versions (>= 3.1).
+ dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
+ dnl change the name of the corresponding ac_ variable on lines 860...
+ if test "x${COMPILE_GMP}" = xyes; then
+ AC_CHECK_LIB(gmp, __gmpz_mul_si,
+- [GMP_CFLAGS=-I/usr/include
++ [GMP_CFLAGS=
+ GMP_LIBS=-lgmp ],
+ [GMP_CFLAGS=
+ GMP_LIBS= ])
+ AC_SUBST(GMP_CFLAGS)
+ AC_SUBST(GMP_LIBS)
diff --git a/recipes/cwiid/cwiid_svn.bb b/recipes/cwiid/cwiid_svn.bb
new file mode 100644
index 0000000000..8d134f3f36
--- /dev/null
+++ b/recipes/cwiid/cwiid_svn.bb
@@ -0,0 +1,34 @@
+DESCRIPTION = "wiimote library + tools"
+LICENSE = "GPLv2"
+HOMEPAGE = "http://abstrakraft.org/cwiid/"
+
+SRCREV = "192"
+PV = "0.6.00+svnr${SRCREV}"
+
+inherit autotools
+inherit distutils-base
+
+export BUILD_SYS
+export HOST_SYS
+
+PARALLEL_MAKE = ""
+
+SRC_URI = "svn://abstrakraft.org/cwiid/svn/;module=trunk;proto=http"
+S = "${WORKDIR}/trunk"
+
+EXTRA_OECONF = "--disable-ldconfig"
+
+FILES_${PN} += "\
+ ${sysconfdir}/cwiid/ \
+"
+
+FILES_${PN}-dbg += "\
+ ${libdir}/cwiid/plugins/.debug \
+"
+
+do_configure_append() {
+ find ${S} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
+ find ${S} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
+}
+
+
diff --git a/recipes/devhelp/devhelp_0.23.bb b/recipes/devhelp/devhelp_0.23.bb
new file mode 100644
index 0000000000..4cfcecea01
--- /dev/null
+++ b/recipes/devhelp/devhelp_0.23.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "API documentation browser for GTK+ and GNOME"
+HOMEPAGE = "http://live.gnome.org/devhelp"
+DEPENDS = "gconf glib-2.0 gtk+ libwnck webkit-gtk zlib"
+PR = "r0"
+
+inherit gnome
+
+SRC_URI += "file://devhelp-includes.patch;patch=1 \
+ file://devhelp-webkit.patch;patch=1"
+
+PACKAGES += "gedit-plugin-${PN}"
+FILES_gedit-plugin-${PN} += "${libdir}/gedit-2"
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/devhelp/files/devhelp-includes.patch b/recipes/devhelp/files/devhelp-includes.patch
new file mode 100644
index 0000000000..154dd8dac9
--- /dev/null
+++ b/recipes/devhelp/files/devhelp-includes.patch
@@ -0,0 +1,12 @@
+g_mapped_file_free() is deprecated since glib-2.22.
+================================================================================
+--- devhelp-0.23/src/Makefile.am
++++ devhelp-0.23/src/Makefile.am
+@@ -6,7 +6,6 @@
+ -DLOCALEDIR=\""$(datadir)/locale"\" \
+ -DDATADIR=\""$(datadir)"\" \
+ -DG_LOG_DOMAIN=\"Devhelp\" \
+- -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED \
+ -DG_DISABLE_SINGLE_INCLUDES \
diff --git a/recipes/devhelp/files/devhelp-webkit.patch b/recipes/devhelp/files/devhelp-webkit.patch
new file mode 100644
index 0000000000..5ba3f3d5a8
--- /dev/null
+++ b/recipes/devhelp/files/devhelp-webkit.patch
@@ -0,0 +1,71 @@
+http://bugzilla.gnome.org/show_bug.cgi?id=586559
+Comment #6 from Daniel Macks (reporter, points: 15)
+2009-07-15 17:27 UTC [reply]
+
+Created an attachment (id=138458) [edit]
+Prepend file://
+
+Here's the patch we're using in fink. Not "complete" (only minimal change to
+work, not *every* use of webkit_web_view_open()) and doesn't resolve the
+inconsistent meaning of "uri", but also doesn't change anything in webkit lib
+API or behavior so no interface chaos (unlike webkit:)
+
+diff -Nurd -x'*~' devhelp-0.23.orig/src/dh-window.c devhelp-0.23/src/dh-window.c
+--- devhelp-0.23.orig/src/dh-window.c 2008-11-28 10:56:04.000000000 -0500
++++ devhelp-0.23/src/dh-window.c 2009-07-08 03:36:23.000000000 -0400
+@@ -133,6 +133,20 @@
+ #define GET_PRIVATE(instance) G_TYPE_INSTANCE_GET_PRIVATE \
+ (instance, DH_TYPE_WINDOW, DhWindowPriv);
+
++
++static void
++_webkit_web_view_open_compat (WebKitWebView *view,
++ const gchar *uri)
++{
++ gchar *real_uri;
++ if (g_path_is_absolute(uri))
++ real_uri = g_strdup_printf ("file://%s", uri);
++ else
++ real_uri = g_strdup (uri);
++ webkit_web_view_load_uri (view, real_uri);
++ g_free(real_uri);
++}
++
+ static void
+ window_activate_new_window (GtkAction *action,
+ DhWindow *window)
+@@ -803,7 +817,7 @@
+ window);
+
+ uri = dh_link_get_uri (link);
+- webkit_web_view_open (view, uri);
++ _webkit_web_view_open_compat (view, uri);
+ g_free (uri);
+
+ g_signal_handlers_unblock_by_func (view,
+@@ -827,7 +841,7 @@
+ view = window_get_active_web_view (window);
+
+ uri = dh_link_get_uri (link);
+- webkit_web_view_open (view, uri);
++ _webkit_web_view_open_compat (view, uri);
+ g_free (uri);
+
+ window_check_history (window, view);
+@@ -1093,7 +1107,7 @@
+ }
+
+ if (location) {
+- webkit_web_view_open (WEBKIT_WEB_VIEW (view), location);
++ _webkit_web_view_open_compat (WEBKIT_WEB_VIEW (view), location);
+ } else {
+ webkit_web_view_open (WEBKIT_WEB_VIEW (view), "about:blank");
+ }
+@@ -1357,6 +1371,6 @@
+ priv = window->priv;
+
+ web_view = window_get_active_web_view (window);
+- webkit_web_view_open (web_view, uri);
++ _webkit_web_view_open_compat (web_view, uri);
+ dh_book_tree_select_uri (DH_BOOK_TREE (priv->book_tree), uri);
+ }
diff --git a/recipes/devmem2/devmem2.bb b/recipes/devmem2/devmem2.bb
index 143883afea..5b72d1c31b 100644
--- a/recipes/devmem2/devmem2.bb
+++ b/recipes/devmem2/devmem2.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Simple program to read/write from/to any location in memory."
SRC_URI = "http://www.lartmaker.nl/lartware/port/devmem2.c"
LICENSE = "GPL"
-PR = "r1"
+PR = "r2"
S = "${WORKDIR}"
diff --git a/recipes/dfu-util/dfu-util-native_svn.bb b/recipes/dfu-util/dfu-util-native_svn.bb
index ad0bece8fa..6b1cf915ce 100644
--- a/recipes/dfu-util/dfu-util-native_svn.bb
+++ b/recipes/dfu-util/dfu-util-native_svn.bb
@@ -2,7 +2,7 @@ require dfu-util_${PV}.bb
inherit native
-DEPENDS = "libusb-native usbpath-native"
+DEPENDS = "virtual/libusb0-native usbpath-native"
do_stage() {
install -d ${STAGING_BINDIR_NATIVE}
diff --git a/recipes/dfu-util/dfu-util_svn.bb b/recipes/dfu-util/dfu-util_svn.bb
index 5cb95cbac8..17329b3cd4 100644
--- a/recipes/dfu-util/dfu-util_svn.bb
+++ b/recipes/dfu-util/dfu-util_svn.bb
@@ -5,7 +5,7 @@ LICENSE = "GPL"
PV = "0.1+svnr${SRCREV}"
PR = "r2"
-DEPENDS = "libusb usbpath"
+DEPENDS = "virtual/libusb0 usbpath"
SRC_URI = "svn://svn.openmoko.org/trunk/src/host/;module=dfu-util;proto=http"
S = "${WORKDIR}/dfu-util"
diff --git a/recipes/dhcp/dhcp_3.0.2.bb b/recipes/dhcp/dhcp_3.0.2.bb
index faf22b29cf..2ce808343f 100644
--- a/recipes/dhcp/dhcp_3.0.2.bb
+++ b/recipes/dhcp/dhcp_3.0.2.bb
@@ -2,7 +2,7 @@ SECTION = "console/network"
DESCRIPTION = "Internet Software Consortium DHCP package"
HOMEPAGE = "http://www.isc.org/"
LICENSE = "BSD"
-PR = "r8"
+PR = "r9"
SRC_URI = "ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history/dhcp-${PV}.tar.gz \
file://noattrmode.patch;patch=1 \
file://fixincludes.patch;patch=1 \
@@ -19,6 +19,8 @@ INITSCRIPT_PACKAGES = "dhcp-server"
INITSCRIPT_NAME_dhcp-server = dhcp-server
INITSCRIPT_PARAMS_dhcp-server = "start 30 2 3 4 5 . stop 30 0 1 6 ."
+TARGET_CC_ARCH += "${LDFLAGS}"
+
do_configure() {
./configure
}
diff --git a/recipes/directfb/directfb-1.4.1/ts_lib_autotools.patch b/recipes/directfb/directfb-1.4.1/ts_lib_autotools.patch
new file mode 100644
index 0000000000..414d48c2d6
--- /dev/null
+++ b/recipes/directfb/directfb-1.4.1/ts_lib_autotools.patch
@@ -0,0 +1,22 @@
+---
+ configure.in | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+Index: DirectFB-1.4.1/configure.in
+===================================================================
+--- DirectFB-1.4.1.orig/configure.in 2009-06-26 23:30:03.000000000 +0200
++++ DirectFB-1.4.1/configure.in 2009-07-13 00:23:19.558669631 +0200
+@@ -1334,8 +1334,11 @@
+
+ enable_tslib=no
+ if test "$checkfor_tslib" = "yes"; then
+- PKG_CHECK_MODULES([TSLIB], [tslib-0.0], enable_tslib=yes, enable_tslib=no
+- AC_MSG_WARN([*** no tslib -- tslib driver will not be built.]))
++ PKG_CHECK_MODULES([TSLIB], [tslib-1.0 >= 1.0.0], [enable_tslib=yes], [enable_tslib=no])
++ if test "$enable_tslib" = "no"; then
++ PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [enable_tslib=yes], [enable_tslib=no,
++ AC_MSG_WARN([*** no tslib -- tslib driver will not be built.])])
++ fi
+ fi
+
+ enable_ucb1x00_ts=no
diff --git a/recipes/directfb/directfb_1.4.1.bb b/recipes/directfb/directfb_1.4.1.bb
new file mode 100644
index 0000000000..1e15186cd3
--- /dev/null
+++ b/recipes/directfb/directfb_1.4.1.bb
@@ -0,0 +1,26 @@
+require directfb.inc
+
+RV = "1.4-0"
+
+DEPENDS += "sysfsutils"
+
+SRC_URI = " \
+ http://directfb.org/downloads/Core/DirectFB-1.4/DirectFB-${PV}.tar.gz \
+ file://directfb-1.2.x-fix-pkgconfig-cflags.patch;patch=1 \
+ file://mkdfiff.patch;patch=1 \
+ file://dont-use-linux-config.patch;patch=1 \
+ file://ts_lib_autotools.patch;patch=1 \
+"
+
+EXTRA_OECONF = "\
+ --enable-freetype=yes \
+ --enable-zlib \
+ --with-gfxdrivers=none \
+ --disable-sdl \
+ --disable-vnc \
+ --disable-x11 \
+"
+
+LDFLAGS_append = ""
+
+LEAD_SONAME = "libdirectfb-1.4.so.0"
diff --git a/recipes/disko/disko_git.bb b/recipes/disko/disko_git.bb
index 657fb40cec..a48ec15d39 100644
--- a/recipes/disko/disko_git.bb
+++ b/recipes/disko/disko_git.bb
@@ -7,10 +7,11 @@ DEPENDS = "sqlite3 libpng jpeg curl alsa-lib taglib directfb libxml2 virtual/lib
libxv libxxf86vm"
SRC_URI = "git://www.diskohq.org/disko.git;protocol=git \
- file://header.patch;patch=1 \
- file://pkgconfig.patch;patch=1 \
+ file://linkpath.patch;patch=1 \
+ file://pkgconfig.patch;patch=1 \
"
-SRCREV = "bf29da8c0060a2b4f0f9593524ca71aa1adfbc0c"
+
+SRCREV = "ed1d2905be5ae4fff37c498847c298fa501bbde1"
S = "${WORKDIR}/git"
@@ -20,3 +21,18 @@ do_compile() {
${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} graphics=all PREFIX=${prefix} prefix=${prefix} || \
oefatal "scons build execution failed."
}
+
+#workaround for disko which creates .pc inside install
+do_install_append () {
+
+for i in `find ${S}/ ${D}/${libdir}/pkgconfig -name "*.pc" -type f` ; do \
+ sed -i -e 's:${D}::g' $i
+ done
+}
+
+scons_do_stage_append () {
+ STAGE_PKG_SEARCHPATH="${S}/ ${@['','${WORKDIR}/staging-pkg/'][bb.data.inherits_class('packaged-staging',d)]}"
+ for i in `find ${STAGE_PKG_SEARCHPATH} -name "*.pc" -type f` ; do \
+ sed -i -e 's:${STAGING_DIR_HOST}::g' $i
+ done
+}
diff --git a/recipes/disko/files/header.patch b/recipes/disko/files/header.patch
deleted file mode 100644
index e60d5582e8..0000000000
--- a/recipes/disko/files/header.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: git/src/mmsconfig/mmsrcparser.cpp
-===================================================================
---- git.orig/src/mmsconfig/mmsrcparser.cpp 2009-03-25 01:29:20.822096657 +0100
-+++ git/src/mmsconfig/mmsrcparser.cpp 2009-03-25 01:29:34.320881340 +0100
-@@ -26,6 +26,8 @@
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-+#include <cstring>
-+
- #include "mmsconfig/mmsrcparser.h"
- #include "mmstools/tools.h"
-
diff --git a/recipes/disko/files/linkpath.patch b/recipes/disko/files/linkpath.patch
new file mode 100644
index 0000000000..c28540848e
--- /dev/null
+++ b/recipes/disko/files/linkpath.patch
@@ -0,0 +1,22 @@
+Index: git/SConstruct
+===================================================================
+--- git.orig/SConstruct 2009-07-14 20:45:56.924100368 +0200
++++ git/SConstruct 2009-07-14 20:46:27.553677127 +0200
+@@ -131,7 +131,7 @@
+ if os.environ.has_key('CXXFLAGS'):
+ env['CCFLAGS'] = [os.environ['CXXFLAGS'].split()]
+ if os.environ.has_key('LD'):
+- env['LINK'] = [os.environ['LD'].split()]
++ env['LINK'] = [os.environ['CXX'].split()]
+ if os.environ.has_key('LDFLAGS'):
+ env['LINKFLAGS'] = [os.environ['LDFLAGS'].split()]
+
+@@ -156,7 +156,7 @@
+ idir_data = idir_prefix + '/share/disko'
+
+ # link with -rpath
+-env['LINKFLAGS'].append('-Wl,-rpath=' + env['prefix'] + '/lib/disko')
++env['LINKFLAGS'].append('-Wl,-rpath-link=' + env['prefix'] + '/lib/disko')
+
+ # extra flags
+ if env['messages']:
diff --git a/recipes/disko/files/pkgconfig.patch b/recipes/disko/files/pkgconfig.patch
index a84106eb6c..4bf50dcfa4 100644
--- a/recipes/disko/files/pkgconfig.patch
+++ b/recipes/disko/files/pkgconfig.patch
@@ -1,26 +1,103 @@
-Index: git/Makefile
-===================================================================
---- git.orig/Makefile 2009-03-24 14:41:03.000000000 +0100
-+++ git/Makefile 2009-03-25 02:20:38.613872577 +0100
-@@ -59,7 +59,7 @@
- install-pkgconfig:
- @echo "writing pkgconfig information"
- @install -d "$(DESTDIR)$(libdir)/../pkgconfig"
-- @echo "prefix=$(prefix)" > $(DESTDIR)$(libdir)/../pkgconfig/$(PROJECTNAME).pc
-+ @echo "prefix=/usr" > $(DESTDIR)$(libdir)/../pkgconfig/$(PROJECTNAME).pc
- @echo "exec_prefix=\$${prefix}/bin" >> $(DESTDIR)$(libdir)/../pkgconfig/$(PROJECTNAME).pc
- @echo "libdir=\$${prefix}/lib/disko" >> $(DESTDIR)$(libdir)/../pkgconfig/$(PROJECTNAME).pc
- @echo "includedir=\$${prefix}/include/disko" >> $(DESTDIR)$(libdir)/../pkgconfig/$(PROJECTNAME).pc
Index: git/SConstruct
===================================================================
---- git.orig/SConstruct 2009-03-25 02:22:03.018024446 +0100
-+++ git/SConstruct 2009-03-25 02:22:41.668240834 +0100
-@@ -473,7 +473,7 @@
+--- git.orig/SConstruct 2009-07-14 23:53:04.460889326 +0200
++++ git/SConstruct 2009-07-14 23:56:23.408030317 +0200
+@@ -542,6 +542,7 @@
+ #######################################################################
+ # TODO: handle disko_pc_libs #
+ if 'install' in BUILD_TARGETS:
++ PKG_CCFLAGS = ''
+ disko_pc = open('disko.pc', 'w')
+ disko_pc_requires = 'libxml-2.0 >= 2.6, libcurl, sigc++-2.0, libpng >= 1.2, freetype2'
+ if env['LIBPATH']:
+@@ -559,31 +560,43 @@
+
+ if env.has_key('libiconv'):
+ disko_pc_libs += ' -liconv'
++ if('fbdev' in env['graphics']):
++ PKG_CCFLAGS += '-D__HAVE_FBDEV__ '
+
+ if 'dfb' in env['graphics']:
+ disko_pc_requires += ', directfb'
++ PKG_CCFLAGS += '-D__HAVE_DIRECTFB__ '
+
+ if 'x11' in env['graphics']:
+ disko_pc_requires += ', x11, xv, xxf86vm'
++ PKG_CCFLAGS += '-D__HAVE_XLIB__ '
++ PKG_CCFLAGS += '-D__ENABLE_MMSFB_X11_CORE__ '
++ PKG_CCFLAGS += '-D__ENABLE_MMSFBSURFACE_X11_CORE__ '
+
+ if env['media'] != 'none':
+ disko_pc_requires += ', alsa'
+ if not env['big_lib']:
+ disko_pc_libs += ' -lmmsmedia'
++ PKG_CCFLAGS += '-D__HAVE_MMSMEDIA__ -D__HAVE_MIXER__ '
+
+ if 'xine' in env['media']:
+ if('x11' in env['graphics']):
+ disko_pc_requires += ', libxine >= 1.1.15'
+ else:
+ disko_pc_requires += ', libxine'
++ PKG_CCFLAGS += '-D__HAVE_XINE__ '
++ if conf.checkXineBlDvb():
++ PKG_CCFLAGS += '-D__HAVE_XINE_BLDVB__ '
+
+ if 'gstreamer' in env['media']:
+ disko_pc_requires += ', gstreamer-0.10'
++ PKG_CCFLAGS += '-D__HAVE_GSTREAMER__ '
+
+ if env['enable_flash']:
+ disko_pc_requires += ', swfdec-0.8'
+ if not env['big_lib']:
+ disko_pc_libs += ' -lmmsflash'
++ PKG_CCFLAGS += '-D__HAVE_MMSFLASH__ '
+
+ if env['enable_sip']:
+ disko_pc_requires += ', libpj'
+@@ -591,18 +604,32 @@
+ disko_pc_libs += ' -lmmssip'
+ if('uuid' in env['LIBS']):
+ disko_pc_requires += ', uuid'
++ PKG_CCFLAGS += '-D__HAVE_MMSSIP__ '
+
+ if env['enable_mail']:
+ disko_pc_requires += ', vmime'
++ PKG_CCFLAGS += '-D__HAVE_VMIME__ '
+
+ if env['mmscrypt']:
+ disko_pc_requires += ', openssl'
++ PKG_CCFLAGS += '-D__HAVE_MMSCRYPT__ '
+
+ if 'sqlite3' in env['database']:
+ disko_pc_requires += ', sqlite3'
++ PKG_CCFLAGS += '-D__ENABLE_SQLITE__ '
+
if 'mysql' in env['database']:
disko_pc_requires += ', mysql'
++ PKG_CCFLAGS += '-D__ENABLE_MYSQL__ '
++
++ if 'odbc' in env['database']:
++ PKG_CCFLAGS += '-D__ENABLE_FREETDS__ '
++
++ if env['messages']:
++ PKG_CCFLAGS += '-D__ENABLE_LOG__ '
++
++ if env['debug']:
++ PKG_CCFLAGS += '-D__ENABLE_DEBUG__ '
-- disko_pc.write('prefix=' + env['prefix'] + '\n')
-+ disko_pc.write('prefix=/usr' + '\n')
+ disko_pc.write('prefix=' + env['prefix'] + '\n')
disko_pc.write('exec_prefix=${prefix}\n')
- disko_pc.write('libdir=${exec_prefix}/lib/disko\n')
- disko_pc.write('includedir=${exec_prefix}/include/disko\n\n')
+@@ -614,12 +641,7 @@
+ disko_pc.write('Requires: ' + disko_pc_requires + '\n')
+ disko_pc.write('Libs: -L${libdir} ' + disko_pc_libs + '\n')
+ disko_pc.write('Cflags: -I${includedir}/ ')
+- for ccflag in env['CCFLAGS']:
+- disko_pc.write(' ')
+- if(type(ccflag).__name__ == 'str'):
+- disko_pc.write(ccflag)
+- else:
+- disko_pc.write(' '.join(ccflag))
++ disko_pc.write(PKG_CCFLAGS)
+ disko_pc.write('\n')
+
+ disko_pc.close()
diff --git a/recipes/dri/libdrm_2.4.11.bb b/recipes/dri/libdrm_2.4.11.bb
new file mode 100644
index 0000000000..4f2af1ed73
--- /dev/null
+++ b/recipes/dri/libdrm_2.4.11.bb
@@ -0,0 +1,16 @@
+SECTION = "x11/base"
+DEPENDS = "libpthread-stubs"
+LICENSE = "MIT"
+SRC_URI = "http://dri.freedesktop.org/libdrm/libdrm-${PV}.tar.bz2"
+PROVIDES = "drm"
+PR = "r1"
+
+inherit autotools pkgconfig
+
+do_stage() {
+ autotools_stage_all
+}
+
+PACKAGES =+ "${PN}-intel"
+
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
diff --git a/recipes/dvsdk/gstreamer-ti/codec_combo_directory_fix.patch b/recipes/dvsdk/gstreamer-ti/codec_combo_directory_fix.patch
new file mode 100644
index 0000000000..72a0ab319f
--- /dev/null
+++ b/recipes/dvsdk/gstreamer-ti/codec_combo_directory_fix.patch
@@ -0,0 +1,52 @@
+From: Vishnudas P <vishnudas@gmail.com>
+
+Found the fix here.
+http://wiki.davincidsp.com/index.php?title=Configuring_Codec_Engine_in_Arm_apps_with_createFromServer
+In the section "Advanced: overwriting fields, creating multiple engines"
+
+Needed tor reverse the previous patch 263 and apply the attached patch.
+
+When you call createFromServer the path you give is relative to
+package, not the filesystem one. For that you need to set
+"engine.server" to the desired full filesystem path.
+This is what the attached patch does.
+
+--
+
+
+diff -Naur ticodecplugin.orig/src/gstticodecplugin_dm6446.cfg ticodecplugin/src/gstticodecplugin_dm6446.cfg
+--- ticodecplugin.orig/src/gstticodecplugin_dm6446.cfg 2009-07-21 12:55:32.000000000 -0700
++++ ticodecplugin/src/gstticodecplugin_dm6446.cfg 2009-07-21 12:55:26.000000000 -0700
+@@ -38,6 +38,8 @@
+ "./encodeCombo.x64P",
+ "ti.sdo.servers.encode"
+ );
++encodeEngine.server = "/usr/share/ti-codec-combos/encodeCombo.x64P";
++decodeEngine.server = "/usr/share/ti-codec-combos/decodeCombo.x64P";
+
+ /* Load support for the 'Davinci Multimedia Application Interface' modules */
+ var DMAI = xdc.loadPackage('ti.sdo.dmai');
+diff -Naur ticodecplugin.orig/src/gstticodecplugin_dm6467.cfg ticodecplugin/src/gstticodecplugin_dm6467.cfg
+--- ticodecplugin.orig/src/gstticodecplugin_dm6467.cfg 2009-07-21 12:55:32.000000000 -0700
++++ ticodecplugin/src/gstticodecplugin_dm6467.cfg 2009-07-21 12:55:26.000000000 -0700
+@@ -39,6 +39,8 @@
+ "./encodeCombo.x64P",
+ "ti.sdo.servers.encode"
+ );
++encodeEngine.server = "/usr/share/ti-codec-combos/encodeCombo.x64P";
++decodeEngine.server = "/usr/share/ti-codec-combos/decodeCombo.x64P";
+
+ /* Load support for the 'Davinci Multimedia Application Interface' modules */
+ var DMAI = xdc.loadPackage('ti.sdo.dmai');
+diff -Naur ticodecplugin.orig/src/gstticodecplugin_omap3530.cfg ticodecplugin/src/gstticodecplugin_omap3530.cfg
+--- ticodecplugin.orig/src/gstticodecplugin_omap3530.cfg 2009-07-21 12:55:32.000000000 -0700
++++ ticodecplugin/src/gstticodecplugin_omap3530.cfg 2009-07-21 12:55:26.000000000 -0700
+@@ -38,6 +38,8 @@
+ "./decodeCombo.x64P",
+ "ti.sdo.servers.decode"
+ );
++encEngine.server = "/usr/share/ti-codec-combos/encodeCombo.x64P";
++decEngine.server = "/usr/share/ti-codec-combos/decodeCombo.x64P";
+
+ /* Load support for the DMAI module */
+ var DMAI = xdc.loadPackage('ti.sdo.dmai');
diff --git a/recipes/dvsdk/gstreamer-ti_svn.bb b/recipes/dvsdk/gstreamer-ti_svn.bb
index 6eeffd0225..e1c4c1e2e9 100644
--- a/recipes/dvsdk/gstreamer-ti_svn.bb
+++ b/recipes/dvsdk/gstreamer-ti_svn.bb
@@ -5,12 +5,13 @@ inherit autotools
DEPENDS = "ti-dmai gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly"
# Fetch source from svn repo
-SRCREV = "285"
+SRCREV = "308"
SRC_URI = "svn://gforge.ti.com/svn/gstreamer_ti/trunk;module=gstreamer_ti;proto=https;user=anonymous;pswd='' \
+file://codec_combo_directory_fix.patch;patch=1 \
"
# Again, no '.' in PWD allowed :(
-PR = "r23"
+PR = "r24"
PV = "svnr${SRCREV}"
S = "${WORKDIR}/gstreamer_ti/ti_build/ticodecplugin"
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs.inc b/recipes/e2fsprogs-libs/e2fsprogs-libs.inc
index 5b82c11ca1..45618b008c 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs.inc
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs.inc
@@ -2,8 +2,9 @@ DESCRIPTION = "EXT2 Filesystem Utilities"
LICENSE = "GPL"
SECTION = "base"
PRIORITY = "optional"
+DEPENDS = "util-linux-ng"
-inherit autotools pkgconfig
+inherit autotools_stage gettext pkgconfig
SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
file://configure.patch;patch=1 \
@@ -13,6 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
S = "${WORKDIR}/e2fsprogs-libs-${PV}"
FILES_e2fsprogs-libs-dev_append = " ${datadir}/et ${datadir}/ss"
FILES_${PN} = "${bindir}"
+EXTRA_OECONF = "--disable-libblkid --disable-libuuid"
python populate_packages_prepend () {
e2fs_libdir = bb.data.expand('${libdir}', d)
@@ -24,18 +26,12 @@ python populate_packages_prepend () {
}
do_stage () {
- for i in libcom_err libss libuuid libblkid; do
+ for i in libcom_err libss; do
oe_libinstall -a -C lib $i ${STAGING_LIBDIR}
done
install -d ${STAGING_INCDIR}/et \
- ${STAGING_INCDIR}/ss \
- ${STAGING_INCDIR}/uuid \
- ${STAGING_INCDIR}/blkid
+ ${STAGING_INCDIR}/ss
install -m 0644 lib/et/com_err.h ${STAGING_INCDIR}/et/
install -m 0644 lib/ss/ss.h ${STAGING_INCDIR}/ss/
install -m 0644 lib/ss/ss_err.h ${STAGING_INCDIR}/ss/
- install -m 0644 lib/uuid/uuid.h ${STAGING_INCDIR}/uuid/
- install -m 0644 lib/uuid/uuid_types.h ${STAGING_INCDIR}/uuid/
- install -m 0644 lib/blkid/blkid.h ${STAGING_INCDIR}/blkid/
- install -m 0644 lib/blkid/blkid_types.h ${STAGING_INCDIR}/blkid/
}
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.33.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.33.bb
index 38449667fe..0ac8ac34d1 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.33.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.33.bb
@@ -1 +1,2 @@
+PR = "r1"
require e2fsprogs-libs.inc
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.34.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.34.bb
index 738d1ee206..6be92898d7 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.34.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.34.bb
@@ -1,5 +1,5 @@
require e2fsprogs-libs.inc
-
+PR = "r1"
SRC_URI += "file://ldflags.patch;patch=1"
do_compile_prepend () {
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.35.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.35.bb
index 0d7d25e2cc..fc3e85f2dc 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.35.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.35.bb
@@ -1,8 +1,10 @@
require e2fsprogs-libs.inc
+PR = "r1"
+
SRC_URI += "file://ldflags.patch;patch=1"
-EXTRA_OECONF=" --enable-elf-shlibs "
+EXTRA_OECONF += " --enable-elf-shlibs "
do_compile_prepend () {
find ./ -print|xargs chmod u=rwX
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.39.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.39.bb
index dfd83e3c1f..ccd5a3ce75 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.39.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.39.bb
@@ -5,7 +5,7 @@ PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
file://configure.patch;patch=1"
-EXTRA_OECONF=" --enable-elf-shlibs "
+EXTRA_OECONF += " --enable-elf-shlibs "
do_compile_prepend () {
find ./ -print|xargs chmod u=rwX
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.2.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.2.bb
index d9447ab616..bca87ced96 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.2.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.2.bb
@@ -1,14 +1,12 @@
require e2fsprogs-libs.inc
-PR = "r1"
+PR = "r2"
SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
file://mkinstalldirs.patch;patch=1 \
"
-DEPENDS = "gettext-native"
-
-EXTRA_OECONF=" --enable-elf-shlibs "
+EXTRA_OECONF += " --enable-elf-shlibs "
do_compile_prepend () {
find ./ -print|xargs chmod u=rwX
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.5.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.5.bb
index 25a6490c7c..999456550b 100644
--- a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.5.bb
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.5.bb
@@ -1,12 +1,10 @@
require e2fsprogs-libs.inc
-
+PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
file://mkinstalldirs.patch;patch=1 \
"
-DEPENDS = "gettext-native"
-
-EXTRA_OECONF=" --enable-elf-shlibs "
+EXTRA_OECONF += " --enable-elf-shlibs "
do_compile_prepend () {
find ./ -print|xargs chmod u=rwX
diff --git a/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.8.bb b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.8.bb
new file mode 100644
index 0000000000..1eca5f35f0
--- /dev/null
+++ b/recipes/e2fsprogs-libs/e2fsprogs-libs_1.41.8.bb
@@ -0,0 +1,14 @@
+require e2fsprogs-libs.inc
+SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
+ "
+
+EXTRA_OECONF += " --enable-elf-shlibs "
+
+do_configure() {
+ oe_runconf
+}
+
+do_compile_prepend () {
+ find ./ -print|xargs chmod u=rwX
+ ( cd util; ${BUILD_CC} subst.c -o subst )
+}
diff --git a/recipes/ecj/libecj-bootstrap_3.5.bb b/recipes/ecj/libecj-bootstrap_3.5.bb
new file mode 100644
index 0000000000..1665b337b6
--- /dev/null
+++ b/recipes/ecj/libecj-bootstrap_3.5.bb
@@ -0,0 +1,8 @@
+require libecj-bootstrap.inc
+
+PR = "r0"
+
+SRC_URI = " \
+ http://mirrors.ibiblio.org/pub/mirrors/eclipse/eclipse/downloads/drops/R-3.5-200906111540/ecjsrc-3.5.zip \
+ "
+
diff --git a/recipes/efl1/ecore.inc b/recipes/efl1/ecore.inc
index 1e639fc342..facd7a231a 100644
--- a/recipes/efl1/ecore.inc
+++ b/recipes/efl1/ecore.inc
@@ -27,6 +27,27 @@ PACKAGES =+ "\
${PN}-x \
${PN}-input \
"
+# Some upgrade path tweaking
+AUTO_LIBNAME_PKGS = ""
+
+RREPLACES_${PN} = "libecore-ver-pre-svn-00-0 libecore-ver-pre-svn-01-0"
+REPLACES_${PN}-tests = "libecore-ver-pre-svn-01-tests"
+RREPLACES_${PN}-con = "libecore-ver-pre-svn-01-con libecore-con-ver-pre-svn-01-0"
+RREPLACES_${PN}-config = "libecore-config-ver-pre-svn-01-0"
+RREPLACES_${PN}-desktop = "libecore-desktop-ver-pre-svn-01-0"
+RREPLACES_${PN}-directfb = "libecore-directfb-ver-pre-svn-01-0"
+RREPLACES_${PN}-sdl = "libecore-sdl-ver-pre-svn-01-0"
+RREPLACES_${PN}-evas = "libecore-evas-ver-pre-svn-01-0"
+RREPLACES_${PN}-fb = "libecore-fb-ver-pre-svn-01-0"
+RREPLACES_${PN}-file = "libecore-file-ver-pre-svn-01-0"
+RREPLACES_${PN}-imf-evas = "libecore-imf-evas-ver-pre-svn-01-0"
+RREPLACES_${PN}-imf = "libecore-imf-ver-pre-svn-01-0"
+RREPLACES_${PN}-ipc = "libecore-ipc-ver-pre-svn-01-0"
+RREPLACES_${PN}-job = "libecore-job-ver-pre-svn-01-0"
+RREPLACES_${PN}-txt = "libecore-txt-ver-pre-svn-01-0"
+RREPLACES_${PN}-x = "libecore-x-ver-pre-svn-01-0"
+RREPLACES_${PN}-input = "libecore-input-ver-pre-svn-01-0"
+
FILES_${PN} = "${libdir}/libecore*.so.*"
FILES_${PN}-con = "${libdir}/libecore_con*.so.*"
FILES_${PN}-config = "${libdir}/libecore_config*.so.*"
@@ -43,3 +64,6 @@ FILES_${PN}-job = "${libdir}/libecore_job*.so.*"
FILES_${PN}-txt = "${libdir}/libecore_txt*.so.*"
FILES_${PN}-x = "${libdir}/libecore_x*.so.*"
FILES_${PN}-input = "${libdir}/libecore_input*.so.*"
+
+
+
diff --git a/recipes/efl1/edje_svn.bb b/recipes/efl1/edje_svn.bb
index 2509c859c7..7f94b08256 100644
--- a/recipes/efl1/edje_svn.bb
+++ b/recipes/efl1/edje_svn.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Edje is the Enlightenment graphical design & layout library"
DEPENDS = "eet evas ecore embryo edje-native"
LICENSE = "MIT BSD"
PV = "0.9.92.060+svnr${SRCREV}"
-PR = "r3"
+PR = "r4"
inherit efl
@@ -20,6 +20,11 @@ RRECOMMENDS_${PN}-utils = "\
"
DEBIAN_NOAUTONAME_${PN}-utils = "1"
+# Some upgrade path tweaking
+AUTO_LIBNAME_PKGS = ""
+
+RREPLACES_${PN} = "libedje-ver-pre-svn-00-0 libedje-ver-pre-svn-01-0"
+
FILES_${PN}-utils = "\
${bindir}/edje_* \
${datadir}/edje/include/edje.inc \
diff --git a/recipes/efl1/embryo_svn.bb b/recipes/efl1/embryo_svn.bb
index aeceb5abe4..222d85a7cb 100644
--- a/recipes/efl1/embryo_svn.bb
+++ b/recipes/efl1/embryo_svn.bb
@@ -1,9 +1,14 @@
DESCRIPTION = "The Enlightenment C-like scripting language for Edje"
LICENSE = "MIT BSD"
PV = "0.9.9.060+svnr${SRCREV}"
-PR = "r1"
+PR = "r2"
inherit efl
-# HACK alert: When compiling for VFP embryo emits bugs -- maybe gcc bug
-#FULL_OPTIMIZATION_arm =+ "-O0"
+# Some upgrade path tweaking
+AUTO_LIBNAME_PKGS = ""
+
+RREPLACES_${PN} = "libembryo-ver-pre-svn-00-0 libembryo-ver-pre-svn-01-0"
+
+RREPLACES_${PN}-tests = "libembryo-ver-pre-svn-00-tests libembryo-ver-pre-svn-01-tests"
+
diff --git a/recipes/efl1/emotion_svn.bb b/recipes/efl1/emotion_svn.bb
index 455bc82b18..0f31e667cc 100644
--- a/recipes/efl1/emotion_svn.bb
+++ b/recipes/efl1/emotion_svn.bb
@@ -3,11 +3,11 @@ LICENSE = "MIT BSD"
# we no longer build the libxine backend, since the gstreamer backend seems more promising
DEPENDS = "eet evas ecore edje gstreamer gst-plugins-base"
PV = "0.1.0.042+svnr${SRCREV}"
-PR = "r1"
+PR = "r2"
inherit efl
-EXTRA_OECONF = "--disable-xine --enable-gstreamer"
+EXTRA_OECONF = "--disable-xine --enable-gstreamer --with-edje-cc=${STAGING_BINDIR_NATIVE}/edje_cc"
PACKAGES =+ "emotion-backend-gstreamer"
FILES_emotion-backend-gstreamer = "${libdir}/emotion/*.so"
diff --git a/recipes/eglibc/eglibc-initial_2.10.bb b/recipes/eglibc/eglibc-initial_2.10.bb
new file mode 100644
index 0000000000..787c762609
--- /dev/null
+++ b/recipes/eglibc/eglibc-initial_2.10.bb
@@ -0,0 +1,6 @@
+require eglibc_${PV}.bb
+require eglibc-initial.inc
+
+do_configure_prepend () {
+ unset CFLAGS
+}
diff --git a/recipes/eglibc/eglibc_2.10.bb b/recipes/eglibc/eglibc_2.10.bb
new file mode 100644
index 0000000000..414bb86842
--- /dev/null
+++ b/recipes/eglibc/eglibc_2.10.bb
@@ -0,0 +1,99 @@
+require eglibc.inc
+
+DEPENDS += "gperf-native"
+DEFAULT_PREFERENCE = "1"
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/eglibc-svn"
+PV = "2.10"
+PR = "${INC_PR}.1"
+SVN_REV="8632"
+EGLIBC_BRANCH="eglibc-2_10"
+SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_10;rev=${SVN_REV};proto=svn \
+ file://eglibc-svn-arm-lowlevellock-include-tls.patch;patch=1 \
+ file://etc/ld.so.conf \
+ file://generate-supported.mk"
+S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = "libc6*"
+RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
+PROVIDES_${PN}-dbg = "glibc-dbg"
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
+
+GLIBC_ADDONS ?= "ports,nptl,libidn"
+
+GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
+
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+ import bb, re
+ uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
+ if uc_os:
+ raise bb.parse.SkipPackage("incompatible with target %s" %
+ bb.data.getVar('TARGET_OS', d, 1))
+}
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+ --without-cvs --disable-profile --disable-debug --without-gd \
+ --enable-clocale=gnu \
+ --enable-add-ons=${GLIBC_ADDONS},ports \
+ --with-headers=${STAGING_INCDIR} \
+ --without-selinux \
+ ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
+
+do_unpack_append() {
+ bb.build.exec_func('do_move_ports', d)
+}
+
+do_move_ports() {
+ if test -d ${WORKDIR}/${EGLIBC_BRANCH}/ports ; then
+ rm -rf ${S}/ports
+ mv ${WORKDIR}/${EGLIBC_BRANCH}/ports ${S}/
+ fi
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+ if [ -z "`which rpcgen`" ]; then
+ echo "rpcgen not found. Install glibc-devel."
+ exit 1
+ fi
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+ yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+ rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+ # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+ unset LDFLAGS
+ base_do_compile
+ (
+ cd ${S}/sunrpc/rpcsvc
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
+ done
+ )
+}
+
+require eglibc-stage.inc
+
+require eglibc-package.bbclass
diff --git a/recipes/eglibc/eglibc_2.9.bb b/recipes/eglibc/eglibc_2.9.bb
index b3786d3c1d..7ab481580a 100644
--- a/recipes/eglibc/eglibc_2.9.bb
+++ b/recipes/eglibc/eglibc_2.9.bb
@@ -4,11 +4,12 @@ DEPENDS += "gperf-native"
DEFAULT_PREFERENCE = "1"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/eglibc-svn"
PV = "2.9"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
SVN_REV="7430"
EGLIBC_BRANCH="eglibc-2_9"
SRC_URI = "svn://svn.eglibc.org/branches;module=eglibc-2_9;rev=${SVN_REV};proto=svn \
file://eglibc-svn-arm-lowlevellock-include-tls.patch;patch=1 \
+ file://eglibc_adjust_begin_insertion.patch;patch=1 \
file://etc/ld.so.conf \
file://generate-supported.mk"
S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
diff --git a/recipes/eglibc/eglibc_svn.bb b/recipes/eglibc/eglibc_svn.bb
index 4202a7d5e5..3bbb40578d 100644
--- a/recipes/eglibc/eglibc_svn.bb
+++ b/recipes/eglibc/eglibc_svn.bb
@@ -1,10 +1,10 @@
require eglibc.inc
DEPENDS += "gperf-native"
-SRCREV = "7542"
+SRCREV = "8551"
# DEFAULT_PREFERENCE = "-1"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/eglibc-svn"
-PV = "2.9+svnr${SRCREV}"
+PV = "2.10+svnr${SRCREV}"
PR = "${INC_PR}.1"
EGLIBC_BRANCH="trunk"
SRC_URI = "svn://svn.eglibc.org;module=trunk \
diff --git a/recipes/eglibc/files/eglibc_adjust_begin_insertion.patch b/recipes/eglibc/files/eglibc_adjust_begin_insertion.patch
new file mode 100644
index 0000000000..8f05cc0cab
--- /dev/null
+++ b/recipes/eglibc/files/eglibc_adjust_begin_insertion.patch
@@ -0,0 +1,13 @@
+Index: libc/elf/Makefile
+===================================================================
+--- libc.orig/elf/Makefile 2009-07-15 14:37:34.000000000 -0700
++++ libc/elf/Makefile 2009-07-15 14:37:47.000000000 -0700
+@@ -305,7 +305,7 @@
+ $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
+ LC_ALL=C \
+ sed -e '/^=========/,/^=========/!d;/^=========/d' \
+- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
++ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
+ > $@.lds
+ $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
+ $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
diff --git a/recipes/ekiga/ekiga_3.2.5.bb b/recipes/ekiga/ekiga_3.2.5.bb
new file mode 100644
index 0000000000..3a63015d66
--- /dev/null
+++ b/recipes/ekiga/ekiga_3.2.5.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "Gnome videoconferencing application"
+LICENSE = "GPLv2"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit gnome
+DEPENDS += " avahi libnotify eds-dbus libgnome gtkmm libsigc++-2.0 gstreamer gst-plugins-good gst-plugins-base gst-plugins-bad opal ptlib gnome-doc-utils"
+RDEPENDS += "gst-plugin-app gst-plugin-video4linux2 opal ptlib"
+
+EXTRA_OECONF = "--enable-static-libs --disable-ldap --disable-gnome --enable-gstreamer --disable-gdu --disable-scrollkeeper "
+
+do_configure_append() {
+ find ${S} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
+ find ${S} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
+}
+
+FILES_${PN} += "${datadir}/dbus-1 ${datadir}/icons"
+
diff --git a/recipes/ekiga/opal_3.6.4.bb b/recipes/ekiga/opal_3.6.4.bb
new file mode 100644
index 0000000000..502c344b13
--- /dev/null
+++ b/recipes/ekiga/opal_3.6.4.bb
@@ -0,0 +1,29 @@
+DESCRIPTION = "Open Phone Abstraction Library, implementation of the ITU H.323 teleconferencing protocol, and successor of the openh323 library."
+LICENSE = "MPL"
+
+inherit gnome
+
+DEPENDS += " ffmpeg ptlib virtual/libsdl openldap"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/opalvoip/opal-${PV}.tar.bz2 \
+ file://configure.diff;patch=1 \
+ "
+
+EXTRA_OECONF = "--enable-localgsm --disable-spandsp "
+ARM_INSTRUCTION_SET = "arm"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_configure() {
+ libtoolize --force
+ gnu-configize
+ oe_runconf
+}
+
+FILES_${PN} += "${libdir}/opal-${PV}/*/*.so ${libdir}/opal-${PV}/*/*/*.so"
+FILES_${PN}-dbg += "${libdir}/opal-${PV}/*/.debug ${libdir}/opal-${PV}/*/*/.debug"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/ekiga/ptlib_2.6.4.bb b/recipes/ekiga/ptlib_2.6.4.bb
new file mode 100644
index 0000000000..41fda722df
--- /dev/null
+++ b/recipes/ekiga/ptlib_2.6.4.bb
@@ -0,0 +1,36 @@
+DESCRIPTION = "Portable Tools Libary"
+LICENSE = "MPL"
+
+PR = "r1"
+
+inherit gnome
+
+DEPENDS += "libgsm openldap openssl expat virtual/libsdl alsa-lib"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/opalvoip/ptlib-${PV}.tar.bz2"
+
+do_configure() {
+ libtoolize --force
+ gnu-configize
+ oe_runconf
+}
+
+do_compile_append() {
+ sed -i -e s:${STAGING_DIR_TARGET}::g \
+ -e s:/${TARGET_SYS}::g \
+ ptlib.pc
+}
+
+do_install_append() {
+ chmod +x ${D}${libdir}/*
+}
+
+FILES_${PN} += "${libdir}/ptlib-${PV}/*/*/*.so"
+
+do_stage() {
+ autotools_stage_all
+}
+
+
+
+
diff --git a/recipes/emul/emul_1.0.5.bb b/recipes/emul/emul_1.0.5.bb
index 261c604b91..6e1bf99616 100644
--- a/recipes/emul/emul_1.0.5.bb
+++ b/recipes/emul/emul_1.0.5.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "EarthMate Userland Library"
SECTION = "libs/network"
PRIORITY = "optional"
LICENSE = "GPL"
-DEPENDS = "libusb ncurses"
+DEPENDS = "virtual/libusb0 ncurses"
PR = "r1"
SRC_URI = "http://download.berlios.de/emul/emul-${PV}.tar.gz"
diff --git a/recipes/ezx/ezx-boot-usb-native_svn.bb b/recipes/ezx/ezx-boot-usb-native_svn.bb
index 426ad4a555..0615686c26 100644
--- a/recipes/ezx/ezx-boot-usb-native_svn.bb
+++ b/recipes/ezx/ezx-boot-usb-native_svn.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Boot a Motorola EZX device with a user supplied kernel"
-DEPENDS = "libusb-native virtual/kernel"
+DEPENDS = "virtual/libusb0-native virtual/kernel"
SECTION = "devel"
AUTHOR = "Team OpenEZX <openezx-devel@lists.openezx.org>"
LICENSE = "GPL"
diff --git a/recipes/fakeroot/fakeroot-native_1.12.1.bb b/recipes/fakeroot/fakeroot-native_1.12.4.bb
index 5215dc86ed..5215dc86ed 100644
--- a/recipes/fakeroot/fakeroot-native_1.12.1.bb
+++ b/recipes/fakeroot/fakeroot-native_1.12.4.bb
diff --git a/recipes/fakeroot/fakeroot_1.12.1.bb b/recipes/fakeroot/fakeroot_1.12.4.bb
index 4b61f252fb..4b61f252fb 100644
--- a/recipes/fakeroot/fakeroot_1.12.1.bb
+++ b/recipes/fakeroot/fakeroot_1.12.4.bb
diff --git a/recipes/ffmpeg/ffmpeg.inc b/recipes/ffmpeg/ffmpeg.inc
index 3f93765e45..7d7d957014 100644
--- a/recipes/ffmpeg/ffmpeg.inc
+++ b/recipes/ffmpeg/ffmpeg.inc
@@ -53,7 +53,7 @@ do_stage() {
for h in adler32.h avstring.h avutil.h base64.h bswap.h \
common.h crc.h fifo.h integer.h intfloat_readwrite.h \
- log.h lzo.h mathematics.h md5.h mem.h pixfmt.h random.h \
+ log.h lzo.h mathematics.h md5.h mem.h pixfmt.h random*.h \
rational.h sha1.h
do
install -m 0644 ${S}/libavutil/$h ${STAGING_INCDIR}/ffmpeg/$h
diff --git a/recipes/ffmpeg/ffmpeg_git.bb b/recipes/ffmpeg/ffmpeg_git.bb
index eaab7f5561..bc17596b77 100644
--- a/recipes/ffmpeg/ffmpeg_git.bb
+++ b/recipes/ffmpeg/ffmpeg_git.bb
@@ -3,17 +3,18 @@ require ffmpeg.inc
DEPENDS += "schroedinger libgsm"
PE = "1"
-PV = "0.4.9+${PR}+gitr${SRCREV}"
-PR = "r39"
+PV = "0.5.0+${PR}+gitr${SRCREV}"
+PR = "r0"
DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_armv7a = "1"
-FFBRANCH_arm = "arm"
+#FFBRANCH_arm = "arm"
FFBRANCH ?= "master"
# When bumping SRCREV make sure you bump PR here and in dependant recipes (gst-ffmpeg, gnash, omxil, etc) to account for SOVERSION changes
-SRCREV = "997df8779ce24088d0ebf77aa36f71280785a549"
-SRCREV_arm = "e4f37d7bc8ebd5e63ce57af157c2ebebfdf871fa"
+SRCREV = "d886804643d7427debfa70d824de7e53ae8e3e83"
+SRCREV_arm = "d886804643d7427debfa70d824de7e53ae8e3e83"
SRCREV_libswscale = "b2e1c8222eeef74b0ca8053b400957dd69e18e4d"
SRC_URI = "git://git.mansr.com/ffmpeg.mru;protocol=git;branch=${FFBRANCH} \
"
@@ -47,7 +48,6 @@ EXTRA_OECONF = " \
--enable-libschroedinger \
--enable-libtheora \
--enable-libvorbis \
- --enable-swscale \
--arch=${TARGET_ARCH} \
--enable-cross-compile \
--extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
diff --git a/recipes/ffmpeg/omapfbplay-xv_git.bb b/recipes/ffmpeg/omapfbplay-xv_git.bb
new file mode 100644
index 0000000000..3e676e92bb
--- /dev/null
+++ b/recipes/ffmpeg/omapfbplay-xv_git.bb
@@ -0,0 +1,29 @@
+DESCRIPTION = "Simple ffmpeg-based player that uses the omapfb overlays"
+DEPENDS = "libxv bzip2 lame ffmpeg virtual/kernel"
+LICENSE = "MIT"
+
+PR = "r1"
+PV = "0.0+${PR}+gitr${SRCREV}"
+
+SRCREV = "e66bf25df1f1ff085e6db102b282d90e7ceff4bf"
+SRC_URI = "git://git.mansr.com/omapfbplay;protocol=git \
+"
+
+S = "${WORKDIR}/git"
+
+# We want a kernel header for armv7a, but we don't want to make mplayer machine specific for that
+STAGING_KERNEL_DIR = "${STAGING_DIR}/${MACHINE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/kernel"
+
+CFLAGS += " -I. -I${STAGING_KERNEL_DIR}/include "
+
+do_compile() {
+ cp ${STAGING_KERNEL_DIR}/arch/arm/plat-omap/include/mach/omapfb.h ${S} || true
+ cp ${STAGING_KERNEL_DIR}/include/asm-arm/arch-omap/omapfb.h ${S} || true
+ cp ${STAGING_KERNEL_DIR}/include/linux/omapfb.h ${S} || true
+ oe_runmake OMAPFB=y XV=y NETSYNC=y -e
+}
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${S}/omapfbplay ${D}/${bindir}/omapfbplay-xv
+}
diff --git a/recipes/gamin/gamin_0.1.10.bb b/recipes/gamin/gamin_0.1.10.bb
new file mode 100644
index 0000000000..754f47dc9e
--- /dev/null
+++ b/recipes/gamin/gamin_0.1.10.bb
@@ -0,0 +1,13 @@
+DESCRIPTION = "Gamin is a file and directory monitoring system defined to be a subset of the FAM (File Alteration Monitor) system."
+LICENSE = "LGPL"
+
+SRC_URI = "http://www.gnome.org/~veillard/gamin/sources/gamin-${PV}.tar.gz \
+ file://no-abstract-sockets.patch;patch=1"
+
+EXTRA_OECONF = " --without-python "
+
+inherit autotools pkgconfig
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/gdb/gdb-6.8/gdb-6.8-fix-compile-karmic.patch b/recipes/gdb/gdb-6.8/gdb-6.8-fix-compile-karmic.patch
new file mode 100644
index 0000000000..1080b162aa
--- /dev/null
+++ b/recipes/gdb/gdb-6.8/gdb-6.8-fix-compile-karmic.patch
@@ -0,0 +1,22 @@
+fix this on karmic
+
+cc1: warnings being treated as errors
+/home/ich/build/arm/armv5t/tmp/work/i686-armv5te-sdk-oe-linux-gnueabi/gdb-cross-sdk-6.8-r2/gdb-6.8/gdb/eval.c: In function 'evaluate_subexp_standard':
+/home/ich/build/arm/armv5t/tmp/work/i686-armv5te-sdk-oe-linux-gnueabi/gdb-cross-sdk-6.8-r2/gdb-6.8/gdb/eval.c:1705: error: 'subscript_array' may be used uninitialized in this function
+/home/ich/build/arm/armv5t/tmp/work/i686-armv5te-sdk-oe-linux-gnueabi/gdb-cross-sdk-6.8-r2/gdb-6.8/gdb/eval.c:1644: note: 'subscript_array' was declared here
+
+
+
+Index: gdb-6.8/gdb/eval.c
+===================================================================
+--- gdb-6.8.orig/gdb/eval.c 2009-08-02 03:25:20.000000000 +0200
++++ gdb-6.8/gdb/eval.c 2009-08-02 03:53:39.000000000 +0200
+@@ -1656,6 +1656,8 @@
+ if (nargs != ndimensions)
+ error (_("Wrong number of subscripts"));
+
++ memset(&subscript_array, 0, sizeof(subscript_array));
++
+ /* Now that we know we have a legal array subscript expression
+ let us actually find out where this element exists in the array. */
+
diff --git a/recipes/gdb/gdb-cross-sdk_6.8.bb b/recipes/gdb/gdb-cross-sdk_6.8.bb
index 6aed03d639..66e1454779 100644
--- a/recipes/gdb/gdb-cross-sdk_6.8.bb
+++ b/recipes/gdb/gdb-cross-sdk_6.8.bb
@@ -1,6 +1,7 @@
require gdb-cross.inc
-SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0"
+SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \
+ file://gdb-6.8-fix-compile-karmic.patch;patch=1"
DEPENDS = "ncurses-sdk"
diff --git a/recipes/gdb/gdb_6.8.bb b/recipes/gdb/gdb_6.8.bb
index afa4286c2e..ff14c0f31f 100644
--- a/recipes/gdb/gdb_6.8.bb
+++ b/recipes/gdb/gdb_6.8.bb
@@ -1,6 +1,7 @@
require gdb.inc
LICENSE = "GPLv3"
-SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0"
+SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \
+ file://gdb-6.8-fix-compile-karmic.patch;patch=1"
PR = "r3"
diff --git a/recipes/gdb/gdbserver_6.6.bb b/recipes/gdb/gdbserver_6.6.bb
new file mode 100644
index 0000000000..bad9ae7158
--- /dev/null
+++ b/recipes/gdb/gdbserver_6.6.bb
@@ -0,0 +1,5 @@
+require gdbserver.inc
+
+LICENSE = "GPLv2"
+
+PR = "${INC_PR}.0"
diff --git a/recipes/glib-2.0/glib-2.0-2.20.0/atomic-thumb.patch b/recipes/glib-2.0/glib-2.0-2.20.4/atomic-thumb.patch
index d7aa08821f..d7aa08821f 100644
--- a/recipes/glib-2.0/glib-2.0-2.20.0/atomic-thumb.patch
+++ b/recipes/glib-2.0/glib-2.0-2.20.4/atomic-thumb.patch
diff --git a/recipes/glib-2.0/glib-2.0-2.20.0/configure-libtool.patch b/recipes/glib-2.0/glib-2.0-2.20.4/configure-libtool.patch
index 3ba79b8986..3ba79b8986 100644
--- a/recipes/glib-2.0/glib-2.0-2.20.0/configure-libtool.patch
+++ b/recipes/glib-2.0/glib-2.0-2.20.4/configure-libtool.patch
diff --git a/recipes/glib-2.0/glib-2.0-2.21.4/atomic-thumb.patch b/recipes/glib-2.0/glib-2.0-2.21.4/atomic-thumb.patch
new file mode 100644
index 0000000000..d7aa08821f
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.21.4/atomic-thumb.patch
@@ -0,0 +1,42 @@
+# gatomic.c uses SWP, which doesn't work in Thumb mode.
+# Put that source file into a separate convenience library which is always built as ARM.
+
+Index: glib-2.18.1/glib/Makefile.am
+===================================================================
+--- glib-2.18.1/glib/Makefile.am 2008-09-18 00:33:57.000000000 +0200
++++ glib-2.18.1/glib/Makefile.am 2008-11-08 10:13:27.000000000 +0100
+@@ -80,6 +80,7 @@
+ galiasdef.c
+
+ lib_LTLIBRARIES = libglib-2.0.la
++noinst_LTLIBRARIES = libgatomic.la
+
+ if OS_WIN32_AND_DLL_COMPILATION
+ if MS_LIB_AVAILABLE
+@@ -96,10 +97,14 @@
+ uninstall-ms-lib:
+ $(uninstall_ms_lib_cmd)
+
++libgatomic_la_CFLAGS = $(CFLAGS) -mno-thumb
++
++libgatomic_la_SOURCES = \
++ gatomic.c
++
+ libglib_2_0_la_SOURCES = \
+ garray.c \
+ gasyncqueue.c \
+- gatomic.c \
+ gbacktrace.c \
+ gbase64.c \
+ gbookmarkfile.c \
+@@ -286,8 +291,8 @@
+ pcre_inc =
+ endif
+
+-libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
+-libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
++libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) libgatomic.la
++libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def) libgatomic.la
+
+ libglib_2_0_la_LDFLAGS = \
+ $(glib_win32_res_ldflag) \
diff --git a/recipes/glib-2.0/glib-2.0-2.21.4/configure-libtool.patch b/recipes/glib-2.0/glib-2.0-2.21.4/configure-libtool.patch
new file mode 100644
index 0000000000..3ba79b8986
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.21.4/configure-libtool.patch
@@ -0,0 +1,34 @@
+# Poky renames libtool to $host_alias-libtool.
+# ./$host_alias-libtool isn't created until after configure runs with libtool >= 2.2.2
+# so we can't call # it at this point. We can safely assume a version is available
+# from PATH though
+
+--- 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/recipes/glib-2.0/glib-2.0_2.20.0.bb b/recipes/glib-2.0/glib-2.0_2.20.4.bb
index e0afd218f7..e0afd218f7 100644
--- a/recipes/glib-2.0/glib-2.0_2.20.0.bb
+++ b/recipes/glib-2.0/glib-2.0_2.20.4.bb
diff --git a/recipes/glib-2.0/glib-2.0_2.21.4.bb b/recipes/glib-2.0/glib-2.0_2.21.4.bb
new file mode 100644
index 0000000000..4be09494e5
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0_2.21.4.bb
@@ -0,0 +1,11 @@
+require glib.inc
+
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_angstrom = "1"
+
+SRC_URI = "\
+ http://ftp.gnome.org/pub/GNOME/sources/glib/2.21/glib-${PV}.tar.bz2 \
+ file://glibconfig-sysdefs.h \
+ file://configure-libtool.patch;patch=1 \
+"
+SRC_URI_append_arm = " file://atomic-thumb.patch;patch=1"
diff --git a/recipes/glibc/files/tls_i486.patch b/recipes/glibc/files/tls_i486.patch
new file mode 100644
index 0000000000..69a1fdf91d
--- /dev/null
+++ b/recipes/glibc/files/tls_i486.patch
@@ -0,0 +1,14 @@
+Index: glibc-2.9/sysdeps/i386/dl-tlsdesc.S
+===================================================================
+--- glibc-2.9.orig/sysdeps/i386/dl-tlsdesc.S 2009-07-07 23:21:11.647664128 +0200
++++ glibc-2.9/sysdeps/i386/dl-tlsdesc.S 2009-07-07 23:21:32.802555992 +0200
+@@ -128,8 +128,7 @@
+ .Lslow:
+ cfi_adjust_cfa_offset (28)
+ movl %ebx, 16(%esp)
+- call __i686.get_pc_thunk.bx
+- addl $_GLOBAL_OFFSET_TABLE_, %ebx
++ LOAD_PIC_REG (bx)
+ call ___tls_get_addr@PLT
+ movl 16(%esp), %ebx
+ jmp .Lret
diff --git a/recipes/glibc/glibc-initial.inc b/recipes/glibc/glibc-initial.inc
index cd65924047..6468f0df6d 100644
--- a/recipes/glibc/glibc-initial.inc
+++ b/recipes/glibc/glibc-initial.inc
@@ -1,7 +1,6 @@
SECTION = "libs"
DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers"
PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
-FILESPATHPKG =. "glibc-2.4:"
PACKAGES = ""
PACKAGES_DYNAMIC = ""
diff --git a/recipes/glibc/glibc-stage.inc b/recipes/glibc/glibc-stage.inc
index 2b7b303c14..cb9ab04e1f 100644
--- a/recipes/glibc/glibc-stage.inc
+++ b/recipes/glibc/glibc-stage.inc
@@ -5,12 +5,10 @@ do_stage() {
'${STAGING_DIR_HOST}${layout_base_libdir}/libc.so.6' \
install
- install -d ${STAGING_INCDIR}/gnu \
- ${STAGING_INCDIR}/bits \
- ${STAGING_INCDIR}/rpcsvc
- install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
- install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
- install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
+ # "make install" omits some (not all) RPC headers that other distros
+ # ship.
+ install -d ${STAGING_INCDIR}/rpcsvc
+
for r in ${rpcsvc}; do
h=`echo $r|sed -e's,\.x$,.h,'`
install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
diff --git a/recipes/glibc/glibc.inc b/recipes/glibc/glibc.inc
index c2ee5317bf..9a3942169a 100644
--- a/recipes/glibc/glibc.inc
+++ b/recipes/glibc/glibc.inc
@@ -10,6 +10,9 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
PROVIDES += "virtual/libintl virtual/libiconv"
+# INC_PR for glibc.inc, glibc-initial.inc and glibc-stage.inc
+INC_PR = "r32"
+
inherit autotools
LEAD_SONAME = "libc.so"
diff --git a/recipes/glibc/glibc_2.2.5.bb b/recipes/glibc/glibc_2.2.5.bb
index 49d3a355fd..f810477e73 100644
--- a/recipes/glibc/glibc_2.2.5.bb
+++ b/recipes/glibc/glibc_2.2.5.bb
@@ -1,7 +1,7 @@
require glibc.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "r21"
+PR = "${INC_PR}.0"
DEFAULT_PREFERENCE_sh3 = "-99"
diff --git a/recipes/glibc/glibc_2.3.2+cvs20040726.bb b/recipes/glibc/glibc_2.3.2+cvs20040726.bb
index 754c85fa27..0799676592 100644
--- a/recipes/glibc/glibc_2.3.2+cvs20040726.bb
+++ b/recipes/glibc/glibc_2.3.2+cvs20040726.bb
@@ -3,7 +3,7 @@ require glibc.inc
DEFAULT_PREFERENCE_sh3 = "-99"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "r31"
+PR = "${INC_PR}.0"
GLIBC_ADDONS ?= "linuxthreads"
diff --git a/recipes/glibc/glibc_2.3.2.bb b/recipes/glibc/glibc_2.3.2.bb
index 0ed7d3e723..1524420b3b 100644
--- a/recipes/glibc/glibc_2.3.2.bb
+++ b/recipes/glibc/glibc_2.3.2.bb
@@ -1,6 +1,6 @@
require glibc.inc
-PR = "r20"
+PR = "${INC_PR}.0"
DEFAULT_PREFERENCE_sh3 = "-99"
diff --git a/recipes/glibc/glibc_2.3.3+cvs20041128.bb b/recipes/glibc/glibc_2.3.3+cvs20041128.bb
index 02be256c98..d99bde7384 100644
--- a/recipes/glibc/glibc_2.3.3+cvs20041128.bb
+++ b/recipes/glibc/glibc_2.3.3+cvs20041128.bb
@@ -3,7 +3,7 @@ require glibc.inc
DEFAULT_PREFERENCE_sh3 = "-99"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "r16"
+PR = "${INC_PR}.0"
GLIBC_ADDONS ?= "linuxthreads"
diff --git a/recipes/glibc/glibc_2.3.3+cvs20050221.bb b/recipes/glibc/glibc_2.3.3+cvs20050221.bb
index 4eff27f26b..7ce4cce907 100644
--- a/recipes/glibc/glibc_2.3.3+cvs20050221.bb
+++ b/recipes/glibc/glibc_2.3.3+cvs20050221.bb
@@ -3,7 +3,7 @@ require glibc.inc
DEFAULT_PREFERENCE_sh3 = "-99"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "r16"
+PR = "${INC_PR}.0"
GLIBC_ADDONS ?= "linuxthreads"
diff --git a/recipes/glibc/glibc_2.3.3+cvs20050420.bb b/recipes/glibc/glibc_2.3.3+cvs20050420.bb
index 65654dc4b8..ea51f9e4e7 100644
--- a/recipes/glibc/glibc_2.3.3+cvs20050420.bb
+++ b/recipes/glibc/glibc_2.3.3+cvs20050420.bb
@@ -5,7 +5,7 @@ DEFAULT_PREFERENCE_i586 = "0"
DEFAULT_PREFERENCE_sh3 = "-99"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "r14"
+PR = "${INC_PR}.0"
GLIBC_ADDONS ?= "linuxthreads"
diff --git a/recipes/glibc/glibc_2.3.3.bb b/recipes/glibc/glibc_2.3.3.bb
index dada4bb2fb..83ef019037 100644
--- a/recipes/glibc/glibc_2.3.3.bb
+++ b/recipes/glibc/glibc_2.3.3.bb
@@ -1,6 +1,6 @@
require glibc.inc
-PR = "r17"
+PR = "${INC_PR}.0"
DEFAULT_PREFERENCE_sh3 = "-99"
diff --git a/recipes/glibc/glibc_2.3.5+cvs20050627.bb b/recipes/glibc/glibc_2.3.5+cvs20050627.bb
index 1d4dd0d393..04231d1901 100644
--- a/recipes/glibc/glibc_2.3.5+cvs20050627.bb
+++ b/recipes/glibc/glibc_2.3.5+cvs20050627.bb
@@ -2,7 +2,7 @@ require glibc.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
SRCDATE = "20050627"
-PR = "r23"
+PR = "${INC_PR}.0"
#Doesnt build for sh3
DEFAULT_PREFERENCE_sh3="-1"
diff --git a/recipes/glibc/glibc_2.3.6.bb b/recipes/glibc/glibc_2.3.6.bb
index 8d645409dd..9277dd1a54 100644
--- a/recipes/glibc/glibc_2.3.6.bb
+++ b/recipes/glibc/glibc_2.3.6.bb
@@ -1,6 +1,6 @@
require glibc.inc
-PR = "r5"
+PR = "${INC_PR}.0"
GLIBC_ADDONS ?= "linuxthreads"
diff --git a/recipes/glibc/glibc_2.4.bb b/recipes/glibc/glibc_2.4.bb
index 54fe487bbc..ca6afe284a 100644
--- a/recipes/glibc/glibc_2.4.bb
+++ b/recipes/glibc/glibc_2.4.bb
@@ -1,6 +1,6 @@
require glibc.inc
-PR = "r21"
+PR = "${INC_PR}.0"
#add the hosts that are confirmed to be working to COMPATIBLE_HOSTi
COMPATIBLE_HOST = '(i.86.*-linux|sh.*-linux)'
diff --git a/recipes/glibc/glibc_2.5.bb b/recipes/glibc/glibc_2.5.bb
index 6e2295904b..02cfeaef2b 100644
--- a/recipes/glibc/glibc_2.5.bb
+++ b/recipes/glibc/glibc_2.5.bb
@@ -1,5 +1,5 @@
require glibc.inc
-PR = "r18"
+PR = "${INC_PR}.0"
ARM_INSTRUCTION_SET = "arm"
diff --git a/recipes/glibc/glibc_2.6.1.bb b/recipes/glibc/glibc_2.6.1.bb
index 0a8708c1e3..5cbd8b693c 100644
--- a/recipes/glibc/glibc_2.6.1.bb
+++ b/recipes/glibc/glibc_2.6.1.bb
@@ -1,5 +1,5 @@
require glibc.inc
-PR = "r17"
+PR = "${INC_PR}.0"
PACKAGES_DYNAMIC = "libc6*"
RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
diff --git a/recipes/glibc/glibc_2.7.bb b/recipes/glibc/glibc_2.7.bb
index 447a6956ec..f152756367 100644
--- a/recipes/glibc/glibc_2.7.bb
+++ b/recipes/glibc/glibc_2.7.bb
@@ -5,7 +5,7 @@ ARM_INSTRUCTION_SET = "arm"
PACKAGES_DYNAMIC = "libc6*"
RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
-PR = "r10"
+PR = "${INC_PR}.0"
# the -isystem in bitbake.conf screws up glibc do_stage
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
diff --git a/recipes/glibc/glibc_2.9.bb b/recipes/glibc/glibc_2.9.bb
index be66e2b727..6e323aa61b 100644
--- a/recipes/glibc/glibc_2.9.bb
+++ b/recipes/glibc/glibc_2.9.bb
@@ -5,7 +5,7 @@ ARM_INSTRUCTION_SET = "arm"
PACKAGES_DYNAMIC = "libc6*"
RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
-PR = "r1"
+PR = "${INC_PR}.0"
# the -isystem in bitbake.conf screws up glibc do_stage
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
@@ -64,6 +64,7 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
file://etc/ld.so.conf \
file://generate-supported.mk \
file://march-i686.patch;patch=1;pnum=0 \
+ file://tls_i486.patch;patch=1 \
"
diff --git a/recipes/glibc/glibc_cvs.bb b/recipes/glibc/glibc_cvs.bb
index 26d29f0390..4d093de722 100644
--- a/recipes/glibc/glibc_cvs.bb
+++ b/recipes/glibc/glibc_cvs.bb
@@ -1,7 +1,7 @@
require glibc.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
-PR = "r12"
+PR = "${INC_PR}.0"
PV = "2.3.5+cvs${SRCDATE}"
GLIBC_ADDONS ?= "ports,linuxthreads"
diff --git a/recipes/gmp/files/use-includedir.patch b/recipes/gmp/files/use-includedir.patch
new file mode 100644
index 0000000000..ee3891f807
--- /dev/null
+++ b/recipes/gmp/files/use-includedir.patch
@@ -0,0 +1,13 @@
+Index: gmp-4.2.4/Makefile.am
+===================================================================
+--- gmp-4.2.4.orig/Makefile.am 2008-09-10 19:31:27.000000000 +0000
++++ gmp-4.2.4/Makefile.am 2009-07-06 20:19:19.000000000 +0000
+@@ -106,7 +106,7 @@
+ # but anyone knowledgable enough to be playing with exec_prefix will be able
+ # to address that.
+ #
+-includeexecdir = $(exec_prefix)/include
++includeexecdir = $(includedir)
+ include_HEADERS = $(GMPXX_HEADERS_OPTION)
+ nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION)
+ lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)
diff --git a/recipes/gmp/gmp-canadian_4.2.4.bb b/recipes/gmp/gmp-canadian_4.2.4.bb
index 27d179a569..63f62ace5e 100644
--- a/recipes/gmp/gmp-canadian_4.2.4.bb
+++ b/recipes/gmp/gmp-canadian_4.2.4.bb
@@ -1,5 +1,6 @@
PV = "4.2.4"
require gmp_${PV}.bb
+PR = "${INC_PR}.1"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gmp-${PV}"
S = "${WORKDIR}/gmp-${PV}"
diff --git a/recipes/gmp/gmp-native_4.2.4.bb b/recipes/gmp/gmp-native_4.2.4.bb
index 1e0ffb4bed..aa927b6854 100644
--- a/recipes/gmp/gmp-native_4.2.4.bb
+++ b/recipes/gmp/gmp-native_4.2.4.bb
@@ -1,2 +1,3 @@
PV = "4.2.4"
require gmp-native.inc
+PR = "${INC_PR}.1"
diff --git a/recipes/gmp/gmp_4.2.4.bb b/recipes/gmp/gmp_4.2.4.bb
index a7aa712ddc..a9c14e6a3f 100644
--- a/recipes/gmp/gmp_4.2.4.bb
+++ b/recipes/gmp/gmp_4.2.4.bb
@@ -1,6 +1,8 @@
-PR = "r0"
+INC_PR = "r0"
+PR = "${INC_PR}.1"
SRC_URI_append += "file://sh4-asmfix.patch;patch=1 \
+ file://use-includedir.patch;patch=1 \
"
require gmp.inc
LICENSE = "GPLv3 LGPLv3"
diff --git a/recipes/gnash/gnash_0.8.5.bb b/recipes/gnash/gnash_0.8.5.bb
index fa9b3230e3..30478cb81e 100644
--- a/recipes/gnash/gnash_0.8.5.bb
+++ b/recipes/gnash/gnash_0.8.5.bb
@@ -1,10 +1,11 @@
require gnash.inc
-DEPENDS += "gst-plugins-base"
+DEPENDS += "gst-plugins-base cairo"
acpaths = " -Imacros"
DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_angstrom = "1"
# Boost lacks defines for lots of archs
TARGET_CC_ARCH_append = " -I${STAGING_INCDIR}/libxml2 -DHAVE_POLL_H ${@[' -D_BIG_ENDIAN', ' -D_LITTLE_ENDIAN'][bb.data.getVar('SITEINFO_ENDIANESS', d, 1) == 'le']}"
@@ -33,6 +34,10 @@ EXTRA_OECONF += " --without-included-ltdl \
--enable-png \
--with-png-incl=${STAGING_INCDIR} \
--with-png-lib=${STAGING_LIBDIR} \
+ --with-cairo-incl=${STAGING_DIR_HOST}/usr/include/cairo \
+ --with-cairo-lib=${STAGING_DIR_HOST}/usr/lib \
--enable-media=gst \
- "
+ --disable-speex \
+ --disable-speexdsp \
+ "
diff --git a/recipes/gnome/epiphany_2.21.92.bb b/recipes/gnome/epiphany_2.21.92.bb
index c13d8ea050..2cdc4ba027 100644
--- a/recipes/gnome/epiphany_2.21.92.bb
+++ b/recipes/gnome/epiphany_2.21.92.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
-PR ="r1"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
+PR ="r2"
inherit gnome
diff --git a/recipes/gnome/epiphany_2.22.1.bb b/recipes/gnome/epiphany_2.22.1.bb
index 0324cb7a65..531544d515 100644
--- a/recipes/gnome/epiphany_2.22.1.bb
+++ b/recipes/gnome/epiphany_2.22.1.bb
@@ -1,8 +1,8 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "libsoup-2.4 gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
-PR = "r1"
+PR = "r2"
inherit gnome
diff --git a/recipes/gnome/epiphany_2.24.0.bb b/recipes/gnome/epiphany_2.24.0.bb
index d2d45475b7..9ae253df4c 100644
--- a/recipes/gnome/epiphany_2.24.0.bb
+++ b/recipes/gnome/epiphany_2.24.0.bb
@@ -1,6 +1,7 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "libsoup-2.4 gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
+PR = "r1"
inherit gnome
diff --git a/recipes/gnome/epiphany_2.24.2.bb b/recipes/gnome/epiphany_2.24.2.bb
index a5ad6bef22..54bd3e389a 100644
--- a/recipes/gnome/epiphany_2.24.2.bb
+++ b/recipes/gnome/epiphany_2.24.2.bb
@@ -1,10 +1,10 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "libsoup-2.4 gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
inherit gnome
-PR = "r1"
+PR = "r2"
EXTRA_OECONF = "--with-engine=webkit --with-distributor-name=${DISTRO}"
diff --git a/recipes/gnome/epiphany_2.27.1.bb b/recipes/gnome/epiphany_2.27.1.bb
index 0c3327d679..200a7bccd1 100644
--- a/recipes/gnome/epiphany_2.27.1.bb
+++ b/recipes/gnome/epiphany_2.27.1.bb
@@ -1,6 +1,7 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "libsoup-2.4 gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
+PR = "r1"
inherit gnome
diff --git a/recipes/gnome/epiphany_svn.bb b/recipes/gnome/epiphany_svn.bb
index 97fd82b653..0c9f974f82 100644
--- a/recipes/gnome/epiphany_svn.bb
+++ b/recipes/gnome/epiphany_svn.bb
@@ -1,9 +1,9 @@
DESCRIPTION = "GNOME default webbrowser"
DEPENDS = "gnome-desktop gnome-vfs libgnomeui webkit-gtk iso-codes startup-notification"
-RDEPENDS = "gnome-vfs-plugin-http"
+RDEPENDS = "gnome-vfs-plugin-http iso-codes"
PV = "2.20.1+svnr${SRCREV}"
-PR = "r0"
+PR = "r1"
inherit gnome
diff --git a/recipes/gnome/gnome-bluetooth_git.bb b/recipes/gnome/gnome-bluetooth_git.bb
index 23c4ca92ac..29c98139ea 100644
--- a/recipes/gnome/gnome-bluetooth_git.bb
+++ b/recipes/gnome/gnome-bluetooth_git.bb
@@ -11,12 +11,12 @@ SRC_URI = "git://git.gnome.org/gnome-bluetooth;protocol=git \
S = "${WORKDIR}/git"
-SRCREV = "93fd8de2cc717b96ad719ab2fb5ed38b8a0fc707"
-PV = "2.27.5"
-PR = "r2"
+SRCREV = "59efa1c06153cd5bdaff64f7efca791c11c77f2f"
+PV = "2.27.8"
+PR = "r0"
PR_append = "+gitr${SRCREV}"
-DEPENDS = "obexd gconf-dbus gtk+ dbus-glib libunique libnotify hal bluez4 gnome-keyring"
+DEPENDS = "geoclue obexd gconf-dbus gtk+ dbus-glib libunique libnotify hal bluez4 gnome-keyring"
RRECOMMENDS_${PN} += "obexd"
RCONFLICTS_${PN} = "bluez-gnome"
@@ -26,3 +26,6 @@ do_configure_prepend() {
echo "EXTRA_DIST = version.xml" > gnome-doc-utils.make
}
+# Todo: automagic plugin splitting
+
+FILES_${PN}-dbg += "${libdir}/gnome-bluetooth/plugins/.debug"
diff --git a/recipes/gnome/gnome-power-manager_2.24.2.bb b/recipes/gnome/gnome-power-manager_2.24.2.bb
index 904cd39364..59e1f6f484 100644
--- a/recipes/gnome/gnome-power-manager_2.24.2.bb
+++ b/recipes/gnome/gnome-power-manager_2.24.2.bb
@@ -31,6 +31,6 @@ FILES_${PN} += "${datadir}/icons \
${datadir}/gnome/autostart \
"
-FILE_{PN}-doc += "${datadir}/omf \
- ${datadir}/gnome/help "
+FILES_${PN}-doc += "${datadir}/omf \
+ ${datadir}/gnome/help "
diff --git a/recipes/gnome/libgweather_2.26.0.bb b/recipes/gnome/libgweather_2.26.0.bb
index f36dbbdec7..3493e7d344 100644
--- a/recipes/gnome/libgweather_2.26.0.bb
+++ b/recipes/gnome/libgweather_2.26.0.bb
@@ -1,6 +1,8 @@
LICENSE = "LGPL"
DEPENDS = "libgnome libsoup-2.4 gtk+"
+PR = "r1"
+
inherit gnome
do_configure_prepend() {
@@ -20,6 +22,10 @@ do_configure_prepend() {
EXTRA_OEMAKE = "ORBIT_IDL=${STAGING_BINDIR_NATIVE}/orbit-idl-2"
+# A hundred meg of xml files is a bit much...
+PACKAGES =+ "${PN}-locationdata"
+FILES_${PN}-locationdata = "${datadir}/libgweather/Locations*"
+
do_stage() {
autotools_stage_all
}
diff --git a/recipes/gnome/libsoup-2.4_2.27.4.bb b/recipes/gnome/libsoup-2.4_2.27.4.bb
new file mode 100644
index 0000000000..ae503065c0
--- /dev/null
+++ b/recipes/gnome/libsoup-2.4_2.27.4.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "An HTTP library implementation in C"
+SECTION = "x11/gnome/libs"
+LICENSE = "GPL"
+DEPENDS = "libproxy glib-2.0 gnutls libxml2 sqlite3"
+
+inherit gnome
+
+SRC_URI = "${GNOME_MIRROR}/libsoup/${@gnome_verdir("${PV}")}/libsoup-${PV}.tar.bz2"
+S = "${WORKDIR}/libsoup-${PV}"
+
+do_stage() {
+ autotools_stage_all
+}
+
+PACKAGES =+ "libsoup-gnome"
+FILES_libsoup-gnome = "${libdir}/libsoup-gnome*.so.*"
+FILES_${PN} = "${libdir}/libsoup-2*.so.*"
+FILES_${PN}-dev = "${includedir}/ ${libdir}/"
+FILES_${PN}-doc = "${datadir}/"
diff --git a/recipes/gnuradio/gnuradio.inc b/recipes/gnuradio/gnuradio.inc
index 80536e7f86..8a0ca54726 100644
--- a/recipes/gnuradio/gnuradio.inc
+++ b/recipes/gnuradio/gnuradio.inc
@@ -2,7 +2,7 @@ DESCRIPTION = "GNU Radio"
SECTION = "apps"
PRIORITY = "optional"
LICENSE = "GPLv3"
-DEPENDS = "libusb guile-native fftwf python virtual/libsdl alsa-lib jack boost cppunit sdcc-native swig-native python-numpy"
+DEPENDS = "virtual/libusb0 guile-native fftwf python virtual/libsdl alsa-lib jack boost cppunit sdcc-native swig-native python-numpy"
INC_PR = "r7"
inherit distutils-base autotools autotools_stage pkgconfig
diff --git a/recipes/gnuradio/gnuradio/no-usrp2-svn.patch b/recipes/gnuradio/gnuradio/no-usrp2-svn.patch
new file mode 100644
index 0000000000..d79b419c1a
--- /dev/null
+++ b/recipes/gnuradio/gnuradio/no-usrp2-svn.patch
@@ -0,0 +1,12 @@
+--- gnuradio-trunk-work/configure.ac.orig 2008-10-06 13:38:45.000000000 -0400
++++ gnuradio-trunk-work/configure.ac 2008-10-06 13:39:02.000000000 -0400
+@@ -317,9 +317,7 @@
+ GRC_PMT
+ GRC_MBLOCK dnl this must come after GRC_PMT
+ GRC_USRP
+-GRC_USRP2
+ GRC_GR_USRP dnl this must come after GRC_USRP
+-GRC_GR_USRP2
+ GRC_GR_GCELL dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE
+ GRC_GR_MSDD6000
+ GRC_GR_AUDIO_ALSA
diff --git a/recipes/gnuradio/gnuradio_3.2.1.bb b/recipes/gnuradio/gnuradio_3.2.1.bb
new file mode 100644
index 0000000000..649df09e0a
--- /dev/null
+++ b/recipes/gnuradio/gnuradio_3.2.1.bb
@@ -0,0 +1,22 @@
+require gnuradio.inc
+
+DEPENDS += " gsl "
+
+PR = "${INC_PR}.1"
+
+S = "${WORKDIR}/gnuradio-3.2.1"
+
+EXTRA_OECONF += "--with-boost=${STAGING_DIR_TARGET}/usr CXXFLAGS=-DBOOST_SP_USE_PTHREADS --disable--usrp2"
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-3.2.1.tar.gz \
+ file://no-usrp2.patch;patch=1 \
+ file://gnuradio-neon.patch;patch=1;pnum=0 \
+ ${SOURCEFORGE_MIRROR}/libusb/libusb-0.1.12.tar.gz \
+"
+
+do_compile_append() {
+ sed -i -e s:${STAGING_DIR_TARGET}::g \
+ -e s:/${TARGET_SYS}::g \
+ gnuradio-core/gnuradio-core.pc
+}
+
diff --git a/recipes/gnuradio/gnuradio_svn.bb b/recipes/gnuradio/gnuradio_svn.bb
index dc693b78de..d063e90088 100644
--- a/recipes/gnuradio/gnuradio_svn.bb
+++ b/recipes/gnuradio/gnuradio_svn.bb
@@ -4,24 +4,18 @@ DEFAULT_PREFERENCE = "-1"
DEPENDS += " gsl "
-PV = "3.2.0+svnr${SRCREV}"
+PV = "3.2.1+svnr${SRCREV}"
PR = "${INC_PR}.1"
EXTRA_OECONF += "--with-boost=${STAGING_DIR_TARGET}/usr CXXFLAGS=-DBOOST_SP_USE_PTHREADS --disable--usrp2"
SRC_URI = "svn://gnuradio.org/svn/gnuradio/;module=trunk;proto=http \
- file://no-usrp2.patch;patch=1 \
- file://gnuradio-neon.patch;patch=1;pnum=0 \
+ file://no-usrp2-svn.patch;patch=1 \
${SOURCEFORGE_MIRROR}/libusb/libusb-0.1.12.tar.gz \
"
S="${WORKDIR}/trunk"
-#do_configure() {
-# ./bootstrap
-# oe_runconf
-#}
-
do_compile_append() {
sed -i -e s:${STAGING_DIR_TARGET}::g \
-e s:/${TARGET_SYS}::g \
diff --git a/recipes/gphoto2/libgphoto2_2.1.4.bb b/recipes/gphoto2/libgphoto2_2.1.4.bb
index fed7c41e40..8b1d2f2af4 100644
--- a/recipes/gphoto2/libgphoto2_2.1.4.bb
+++ b/recipes/gphoto2/libgphoto2_2.1.4.bb
@@ -1,5 +1,5 @@
SECTION = "libs"
-DEPENDS = "jpeg libusb libexif"
+DEPENDS = "jpeg virtual/libusb0 libexif"
DESCRIPTION = "libgphoto2 allows you to access digital cameras"
SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/libgphoto2-${PV}.tar.bz2"
diff --git a/recipes/gphoto2/libgphoto2_2.1.5.bb b/recipes/gphoto2/libgphoto2_2.1.5.bb
index 67efc38785..0407039282 100644
--- a/recipes/gphoto2/libgphoto2_2.1.5.bb
+++ b/recipes/gphoto2/libgphoto2_2.1.5.bb
@@ -1,6 +1,5 @@
SECTION = "libs"
-DEPENDS = "jpeg libusb libexif"
-RPEDENDS = "libusb"
+DEPENDS = "jpeg virtual/libusb0 libexif"
DESCRIPTION = "libgphoto2 allows you to access digital cameras"
PR = "r3"
diff --git a/recipes/gphoto2/libgphoto2_2.1.6.bb b/recipes/gphoto2/libgphoto2_2.1.6.bb
index ad57ba8cf1..e7df749940 100644
--- a/recipes/gphoto2/libgphoto2_2.1.6.bb
+++ b/recipes/gphoto2/libgphoto2_2.1.6.bb
@@ -1,6 +1,5 @@
SECTION = "libs"
-DEPENDS = "jpeg libusb libexif"
-RPEDENDS = "libusb"
+DEPENDS = "jpeg virtual/libusb0 libexif"
DESCRIPTION = "libgphoto2 allows you to access digital cameras"
PR = "r6"
diff --git a/recipes/gphoto2/libgphoto2_2.4.2.bb b/recipes/gphoto2/libgphoto2_2.4.2.bb
index 991f3ec759..c5e54f5a5b 100644
--- a/recipes/gphoto2/libgphoto2_2.4.2.bb
+++ b/recipes/gphoto2/libgphoto2_2.4.2.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "libgphoto2 allows you to access digital cameras"
SECTION = "libs"
LICENSE = "GPL"
-DEPENDS = "libtool jpeg libusb libexif"
+DEPENDS = "libtool jpeg virtual/libusb0 libexif"
PR = "r0"
diff --git a/recipes/gphoto2/libgphoto2_2.4.4.bb b/recipes/gphoto2/libgphoto2_2.4.4.bb
index d5eb039cac..7c93d52a12 100644
--- a/recipes/gphoto2/libgphoto2_2.4.4.bb
+++ b/recipes/gphoto2/libgphoto2_2.4.4.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "libgphoto2 allows you to access digital cameras"
SECTION = "libs"
LICENSE = "GPL"
-DEPENDS = "libtool jpeg libusb libexif"
+DEPENDS = "libtool jpeg virtual/libusb0 libexif"
PR = "r0"
diff --git a/recipes/gpsbabel/gpsbabel_1.2.5.bb b/recipes/gpsbabel/gpsbabel_1.2.5.bb
index 987b000f10..625ecc608c 100644
--- a/recipes/gpsbabel/gpsbabel_1.2.5.bb
+++ b/recipes/gpsbabel/gpsbabel_1.2.5.bb
@@ -1,6 +1,6 @@
SECTION = "console/utils"
DESCRIPTION = "GPS data converter"
-DEPENDS = "expat libusb"
+DEPENDS = "expat virtual/libusb0"
HOMEPAGE = "http://gpsbabel.sf.net"
LICENSE = "GPL"
diff --git a/recipes/gpsbabel/gpsbabel_1.3.6.bb b/recipes/gpsbabel/gpsbabel_1.3.6.bb
index e0888b5993..dd4e768dc5 100644
--- a/recipes/gpsbabel/gpsbabel_1.3.6.bb
+++ b/recipes/gpsbabel/gpsbabel_1.3.6.bb
@@ -1,6 +1,6 @@
SECTION = "console/utils"
DESCRIPTION = "GPS data converter"
-DEPENDS = "expat libusb-compat"
+DEPENDS = "expat virtual/libusb0"
HOMEPAGE = "http://www.gpsbabel.org/"
LICENSE = "GPL"
diff --git a/recipes/gqview/gqview-2.1.5/gqview-gimp.patch b/recipes/gqview/gqview-2.1.5/gqview-gimp.patch
new file mode 100644
index 0000000000..50cb89d868
--- /dev/null
+++ b/recipes/gqview/gqview-2.1.5/gqview-gimp.patch
@@ -0,0 +1,11 @@
+--- src/editors.c
++++ src/editors.c
+@@ -47,7 +47,7 @@
+
+
+ static gchar *editor_slot_defaults[] = {
+- N_("The Gimp"), "gimp-remote -n %f",
++ N_("The Gimp"), "gimp %f",
+ N_("XV"), "xv %f",
+ N_("Xpaint"), "xpaint %f",
+ NULL, NULL,
diff --git a/recipes/gqview/gqview-2.1.5/gqview-motion-hint.patch b/recipes/gqview/gqview-2.1.5/gqview-motion-hint.patch
new file mode 100644
index 0000000000..6904c04f85
--- /dev/null
+++ b/recipes/gqview/gqview-2.1.5/gqview-motion-hint.patch
@@ -0,0 +1,48 @@
+Use motion hints for smooth panning of image on slow machines.
+================================================================================
+--- src/pixbuf-renderer.c
++++ src/pixbuf-renderer.c
+@@ -2968,6 +2968,13 @@
+ PixbufRenderer *pr;
+ gint accel;
+
++ /* This is a hack, but work far the best, at least for single pointer systems.
++ * See http://bugzilla.gnome.org/show_bug.cgi?id=587714 for more. */
++ gint x, y;
++ gdk_window_get_pointer (bevent->window, &x, &y, NULL);
++ bevent->x = x;
++ bevent->y = y;
++
+ pr = PIXBUF_RENDERER(widget);
+
+ if (pr->scroller_id != -1)
+@@ -3003,6 +3010,11 @@
+ pr->drag_last_x = bevent->x;
+ pr->drag_last_y = bevent->y;
+
++ /* This is recommended by the GTK+ documentation, but does not work properly.
++ * Use deprecated way until GTK+ gets a solution for correct motion hint handling:
++ * http://bugzilla.gnome.org/show_bug.cgi?id=587714
++ */
++ /* gdk_event_request_motions (bevent); */
+ return FALSE;
+ }
+
+@@ -3023,7 +3035,7 @@
+ pr->drag_last_y = bevent->y;
+ pr->drag_moved = 0;
+ gdk_pointer_grab(widget->window, FALSE,
+- GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK,
+ NULL, NULL, bevent->time);
+ gtk_grab_add(widget);
+ break;
+@@ -3119,7 +3131,7 @@
+ g_signal_connect(G_OBJECT(pr), "leave_notify_event",
+ G_CALLBACK(pr_mouse_leave_cb), pr);
+
+- gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK |
++ gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
+ GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK |
+ GDK_LEAVE_NOTIFY_MASK);
+
diff --git a/recipes/gqview/gqview-2.1.5/gqview-rc-quotes.patch b/recipes/gqview/gqview-2.1.5/gqview-rc-quotes.patch
new file mode 100644
index 0000000000..9e8f94f9f2
--- /dev/null
+++ b/recipes/gqview/gqview-2.1.5/gqview-rc-quotes.patch
@@ -0,0 +1,26 @@
+--- src/rcfile.c
++++ src/rcfile.c
+@@ -390,7 +390,7 @@
+ gchar option[1024];
+ gchar value[1024];
+ gchar value_all[1024];
+- gint c,l,i;
++ gint c,l,i,inside_quotes;
+
+ rc_path = g_strconcat(homedir(), "/", GQVIEW_RC_DIR, "/", RC_FILE_NAME, NULL);
+
+@@ -416,7 +416,13 @@
+ while ((s_buf[c] == ' ' || s_buf[c] == 8) && c < l) c++;
+ s_buf_ptr = s_buf + c;
+ strncpy(value_all, s_buf_ptr, sizeof(value_all));
+- while (s_buf[c] != 8 && s_buf[c] != ' ' && s_buf[c] != '\n' && c < l) c++;
++ inside_quotes = 0;
++ while (s_buf[c] != 8 && ( s_buf[c] != ' ' || inside_quotes) && s_buf[c] != '\n' && c < l)
++ {
++ /* this is an ugly hack, which does not sanitize value inside quotes */
++ if (s_buf[c] == '"') inside_quotes = !inside_quotes;
++ c++;
++ }
+ s_buf[c] = '\0';
+ strncpy(option, s_buf, sizeof(option));
+ strncpy(value, s_buf_ptr, sizeof(value));
diff --git a/recipes/gqview/gqview_2.1.5.bb b/recipes/gqview/gqview_2.1.5.bb
index 60f74c4b4e..5fb5659c10 100644
--- a/recipes/gqview/gqview_2.1.5.bb
+++ b/recipes/gqview/gqview_2.1.5.bb
@@ -4,9 +4,12 @@ DEPENDS = "gtk+"
LICENSE = "GPL"
HOMEPAGE = "http://gqview.sourceforge.net/"
RRECOMMENDS = "gdk-pixbuf-loader-jpeg gdk-pixbuf-loader-png gdk-pixbuf-loader-gif"
-PR = "r1"
+PR = "r2"
SRC_URI = "${SOURCEFORGE_MIRROR}/gqview/gqview-2.1.5.tar.gz \
- file://include-path-fix.patch;patch=1"
+ file://include-path-fix.patch;patch=1 \
+ file://gqview-rc-quotes.patch;patch=1;pnum=0 \
+ file://gqview-motion-hint.patch;patch=1;pnum=0 \
+ file://gqview-gimp.patch;patch=1;pnum=0"
inherit autotools
diff --git a/recipes/gs/gs/0001_svn_snapshot.patch b/recipes/gs/gs/0001_svn_snapshot.patch
new file mode 100644
index 0000000000..4650b11e73
--- /dev/null
+++ b/recipes/gs/gs/0001_svn_snapshot.patch
@@ -0,0 +1,24362 @@
+Description: /jbig2dec changes r9437 → r9781 (release 8.64 → 2009-06-08)
+ - subdirs /jasper, /libpng and /jbig2dec skipped
+ - version bump skipped
+ - some $Id$ changes suppressed or fuzzy
+Author: Jonas Smedegaard <dr@jones.dk>
+diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
+--- a/Resource/Init/gs_init.ps
++++ b/Resource/Init/gs_init.ps
+@@ -209,7 +209,7 @@ currentdict /DEVICE known not
+ % during initialization.
+ /MaxDictStack 500
+ /MaxExecStack 5000
+- /MaxOpStack 65414
++ /MaxOpStack 100000
+ .dicttomark .setuserparams
+ } if
+
+diff --git a/Resource/Init/gs_pdfwr.ps b/Resource/Init/gs_pdfwr.ps
+--- a/Resource/Init/gs_pdfwr.ps
++++ b/Resource/Init/gs_pdfwr.ps
+@@ -665,18 +665,28 @@ currentdict /.pdf_hook_DSC_Creator undef
+ /MonoImageResolution { }
+ % Font embedding parameters
+ /AlwaysEmbed
+- { dup length 0 gt
+- { dup 0 get false eq
++ { dup length 0 gt
++ { dup 0 get type /booleantype eq } { false } ifelse
++ { dup 0 get
++ { dup length 1 sub 1 exch getinterval
++ }
+ { dup length 1 sub 1 exch getinterval exch pop /~AlwaysEmbed exch
+- } if
+- } if
++ } ifelse
++ }
++ { exch pop /.AlwaysEmbed exch
++ } ifelse
+ }
+ /NeverEmbed
+- { dup length 0 gt
+- { dup 0 get false eq
+- { dup length 1 sub 1 exch getinterval exch pop /~NeverEmbed exch
+- } if
+- } if
++ { dup length 0 gt
++ { dup 0 get type /booleantype eq } { false } ifelse
++ { dup 0 get
++ { dup length 1 sub 1 exch getinterval
++ }
++ { dup length 1 sub 1 exch getinterval exch pop /~NeverEmbed exch
++ } ifelse
++ }
++ { exch pop /.NeverEmbed exch
++ } ifelse
+ }
+ /CannotEmbedFontPolicy { }
+ /EmbedAllFonts { }
+diff --git a/Resource/Init/gs_res.ps b/Resource/Init/gs_res.ps
+--- a/Resource/Init/gs_res.ps
++++ b/Resource/Init/gs_res.ps
+@@ -349,6 +349,15 @@ ne {
+ } if
+ pop pop
+
++pssystemparams dup /GenericResourceDir get exch /GenericResourcePathSep get
++(Init) exch (gs_init.ps) concatstrings concatstrings concatstrings
++status {
++ pop pop pop pop
++} {
++ (\n*** Warning: GenericResourceDir doesn't point to a valid resource directory.) =
++ ( the -sGenericResourceDir=... option can be used to set this.\n) =
++} ifelse
++
+ % Define the generic algorithm for computing resource file names.
+ /.rfnstring 8192 string def
+ /.genericrfn % <key> <scratch> <prefix> .genericrfn <filename>
+diff --git a/Resource/Init/gs_setpd.ps b/Resource/Init/gs_setpd.ps
+--- a/Resource/Init/gs_setpd.ps
++++ b/Resource/Init/gs_setpd.ps
+@@ -171,13 +171,8 @@ level2dict begin
+ % the default policy to "7" (impose) to avoid numerous problems with
+ % printing within CUPS...
+ %
+- NOMEDIAATTRS {
+- /PolicyNotFound 7
+- /PageSize 7
+- } {
+- /PolicyNotFound 1
+- /PageSize 0
+- } ifelse
++ /PageSize NOMEDIAATTRS { 7 } { 0 } ifelse
++ /PolicyNotFound 1
+ /PolicyReport {
+ dup /.LockSafetyParams known {
+ % Only possible error is invalidaccess
+@@ -810,20 +805,17 @@ SETPDDEBUG { (Installing.) = pstack flush } if
+ % NB: This shoud be the only use of the .setuseciecolor
+ % operator anywhere.
+ %
+- % If UseCIEColor is transitioned to false, set some
+- % color space other than /DeviceGray, to insure that
+- % initgraphics will actually perform a setcolorspace
++ % Set some color space other than /DeviceGray, to insure
++ % that initgraphics will actually perform a setcolorspace
+ % operation (there is an optimization in setcolorspace
+ % that does nothing if the operand and current color
+- % spaces are the same, and UseCIEColor is false).
++ % spaces are the same)
+
+ /.setuseciecolor where
+ {
+ pop 1 index /UseCIEColor .knownget
+ {
+- dup .setuseciecolor not
+- { /DeviceRGB setcolorspace }
+- if
++ .setuseciecolor /DeviceRGB setcolorspace
+ }
+ if
+ }
+diff --git a/Resource/Init/gs_statd.ps b/Resource/Init/gs_statd.ps
+--- a/Resource/Init/gs_statd.ps
++++ b/Resource/Init/gs_statd.ps
+@@ -109,6 +109,8 @@ STRICT { (%END SIZES) .skipeof } if
+ /halfletter {396 612 //.setpagesize exec} bind def
+ % minimum of a4 and letter (a4 width, letter length)
+ /pa4 {595 792 //.setpagesize exec} bind def
++ % Japanese postcard size, 100mm x 148mm
++ /hagaki {283 420 //.setpagesize exec} bind def
+ % /tabloid {792 1224 //.setpagesize exec} bind def % 11x17 portrait
+ % /csheet {1224 1584 //.setpagesize exec} bind def % ANSI C 17x22
+ % /dsheet {1584 2448 //.setpagesize exec} bind def % ANSI D 22x34
+@@ -134,7 +136,7 @@ STRICT { (%END SIZES) .skipeof } if
+ /flsa /flse /halfletter
+ /isob0 /isob1 /isob2 /isob3 /isob4 /isob5 /isob6
+ /jisb0 /jisb1 /jisb2 /jisb3 /jisb4 /jisb5 /jisb6
+- /pa4
++ /pa4 /hagaki
+ %END SIZES
+ ] cvlit readonly def
+
+diff --git a/Resource/Init/gs_ttf.ps b/Resource/Init/gs_ttf.ps
+--- a/Resource/Init/gs_ttf.ps
++++ b/Resource/Init/gs_ttf.ps
+@@ -827,7 +827,8 @@ end readonly def % .loadttfontdict
+ } if
+ /ttc_offset 0 def
+ } ifelse
+- /tables f offsets 4 getu16 16 mul string readstring pop def
++ % Peek because table counter may be incorrect.
++ /tables f offsets 4 getu16 16 mul string .peekstring pop def
+ /tabdict tables length 16 idiv dict def
+ % tabs = tables we want to keep, sorted by file position.
+ /tabs [ 0 16 tables length 1 sub {
+@@ -868,7 +869,7 @@ mark
+ % Read data. Updates offsets, tabs; stores data in tabdict.
+ /.readttdata {
+ /file_table_pos 10 dict def
+- /fpos offsets length tables length add ttc_offset add def
++ /fpos offsets length ttc_offset add def
+ /sfpos offsets length tabs length 16 mul add def
+ offsets 4 tabs length putu16
+ tabs {
+diff --git a/Resource/Init/gs_typ32.ps b/Resource/Init/gs_typ32.ps
+--- a/Resource/Init/gs_typ32.ps
++++ b/Resource/Init/gs_typ32.ps
+@@ -37,7 +37,8 @@ systemdict /.makeglyph32 .undef
+ % Define a string large enough to hold the metrics,
+ % an uncompressed bitmap (worst case = 5x expansion),
+ % and the 2 RTC codes (3 bytes).
+- dup length 4 index length 5 mul add 10 add string
++ dup length 4 index length 5 mul add 10 add
++ 65535 .min string
+ % Stack: metrics bitmap cid font metstr buffer
+ dup 0 3 index putinterval
+ dup 2 index length 1 index length 1 index sub getinterval
+diff --git a/Resource/Init/opdfread.ps b/Resource/Init/opdfread.ps
+--- a/Resource/Init/opdfread.ps
++++ b/Resource/Init/opdfread.ps
+@@ -152,6 +152,7 @@ end % A dictionary for local binding
+ /TTFDEBUG DefaultSwitch
+ /RotatePages DefaultSwitch
+ /FitPages DefaultSwitch
++/CenterPages DefaultSwitch
+ /SetPageSize DefaultSwitch
+
+ /error % mark <object> .... error -
+@@ -167,10 +168,16 @@ end % A dictionary for local binding
+ } bind def
+
+ //SetPageSize {
+- //RotatePages //FitPages or {
+- mark (/RotatePages, /FitPages are not allowed with /SetPageSize) //error exec
++ //RotatePages //FitPages or //CenterPages or{
++ mark (/RotatePages, /FitPages and CenterPages are not allowed with /SetPageSize) //error exec
+ } if
+-} if
++}
++{
++ //FitPages //CenterPages and {
++ mark (CenterPages is not allowed with /FitPages) //error exec
++ } if
++}
++ifelse
+
+ % ===================== Utilities =========================================
+
+@@ -851,23 +858,43 @@ currentdict end readonly def
+ } {
+ false
+ } ifelse
+- { //FitPages {
+- 1 index 5 index div 1 index 7 index div % bw bh px0 py0 pw ph sx sy
+- 2 copy gt {
+- exch
++ { //CenterPages {
++ //PDFR_DEBUG {
++ (Rotating page, and then centering it) ==
++ } if
++ 90 rotate
++ 0 5 index neg translate
++ 5 index 1 index exch sub 2 div
++ 2 index 6 index sub 2 div neg % bw bh px0 py0 pw ph lm bm
++ translate
++ } {
++ //FitPages {
++ 1 index 5 index div 1 index 7 index div % bw bh px0 py0 pw ph sx sy
++ 2 copy gt {
++ exch
++ } if
++ pop dup scale % bw bh px0 py0 pw ph
+ } if
+- pop dup scale % bw bh px0 py0 pw ph
+- } if
+- 90 rotate
+- 0 5 index neg translate
++ 90 rotate
++ 0 5 index neg translate
++ } ifelse
+ } {
+- //FitPages {
+- 1 index 6 index div 1 index 6 index div % bw bh px0 py0 pw ph sx sy
+- 2 copy gt {
+- exch
++ //CenterPages {
++ //PDFR_DEBUG {
++ (Ccentering page) ==
++ } if
++ 1 index 6 index sub 2 div
++ 1 index 6 index sub 2 div % bw bh px0 py0 pw ph lm bm
++ translate
++ } {
++ //FitPages {
++ 1 index 6 index div 1 index 6 index div % bw bh px0 py0 pw ph sx sy
++ 2 copy gt {
++ exch
++ } if
++ pop dup scale % bw bh px0 py0 pw ph
+ } if
+- pop dup scale % bw bh px0 py0 pw ph
+- } if
++ } ifelse
+ } ifelse
+ pop pop % bw bh px0 py0
+ translate % bw bh
+diff --git a/Resource/Init/pdf_base.ps b/Resource/Init/pdf_base.ps
+--- a/Resource/Init/pdf_base.ps
++++ b/Resource/Init/pdf_base.ps
+@@ -720,6 +720,10 @@ currentdict /no_debug_dict undef
+ ( **** Operator 'endobj' is misspelled as 'endjobj'.\n) pdfformaterror
+ endobj exit
+ } bind
++ /enbobj { % Bug 690397.
++ ( **** Operator 'endobj' is misspelled as 'enbobj'.\n) pdfformaterror
++ endobj exit
++ } bind
+ % OmniForm generates PDF file with endobj missing in some
+ % objects. AR ignores this. So we have to do it too.
+ /obj { pop pop endobj exit } bind
+diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
+--- a/Resource/Init/pdf_draw.ps
++++ b/Resource/Init/pdf_draw.ps
+@@ -397,16 +397,20 @@ end
+ % Stack: mark ... smaskdict
+ dup /BC knownoget {
+ dup /Background exch 4 2 roll
+- gsave
++ gsave //nodict begin
+ 1 index /G oget /Group oget /CS knownoget {
+ resolvecolorspace dup setgcolorspace csput
+ } if
+ aload pop setcolor [ currentgray ]
+- grestore
++ end grestore
+ /GrayBackground exch 3 2 roll
+ } if
+ dup /TR knownoget {
+- resolveidfnproc /TransferFunction exch 3 2 roll
++ dup /Identity eq {
++ pop
++ } {
++ resolvefnproc /TransferFunction exch 3 2 roll
++ } ifelse
+ } if
+ dup /G oget dup /BBox oget /BBox exch 4 2 roll
+ /.execmaskgroup cvx 2 packedarray cvx /Draw exch 3 2 roll
+@@ -414,16 +418,44 @@ end
+ } ifelse SMask
+ } bdef
+
++% Functions specific to the Device* colorspaces to force the switch to
++% the Device* colorspace so that the SMask will not get a CIEBased* colorspace
++% in the case when UseCIEColor changes the Device* colorspace to something else.
++% Also see the logic in pdf_main.ps:pdfopen that similarly defines these resources.
++/forceDefaultCS <<
++ {
++ currentcolorspace setcolorspace % this will switch to Device colorspace
++ } bind
++ /DeviceGray exch
++ /DeviceRGB 1 index
++ /DeviceCMYK 1 index
++>>
++def
++
+ % This procedure is called to actually render the soft mask.
+ /.execmaskgroup { % <masknum> <paramdict> <formdict> .execmaskgroup -
+- % Save our place in PDFfile, and do a gsave to avoid resetting
+- % the color space.
+- currentcolorspace 4 1 roll
++ % Save our place in PDFfile. Do not use gsave-grestore when creating
++ % a soft mask with .begintransparencygroup because high level devices
++ % need to modify the graphic state by storing the soft mask ID.
++ % Save the ExtGState (//nodict begin) BEFORE changing the colorspace
++ mark currentcolor counttomark dup 4 add exch roll pop
++ currentcolorspace 4 1 roll .getuseciecolor 4 1 roll //nodict begin
+ PDFfile fileposition 4 1 roll
+ % We have to select the group's color space so that the
+ % background color will be interpreted correctly.
+- dup /Group oget /CS knownoget { resolvecolorspace dup setgcolorspace csput } if
+- exch dup /BBox get aload pop .begintransparencymaskgroup {
++ % [save/restore]DefaultCS make sure that the SMask logic sees
++ % the Device* spaces, not CIEBased* that UseCIEColor may have
++ % established.
++ false .setuseciecolor % SMask gets processed without UseCIEColor
++ dup /Group oget /CS knownoget {
++ resolvecolorspace dup setgcolorspace csput
++ //true % use currentcolorspace
++ } {
++ % inheriting the colorspace -- make sure Device* spaces are not CIEBased
++ forceDefaultCS currentcolorspace 0 get .knownget { exec } if
++ //false % no defined colorspace
++ } ifelse
++ 3 -1 roll dup /BBox get aload pop .begintransparencymaskgroup {
+ dup /Resources knownoget { oforce } { 0 dict } ifelse
+ exch false resolvestream
+ .execgroup .endtransparencymask
+@@ -431,12 +463,12 @@ end
+ .discardtransparencymask stop
+ } if
+ PDFfile exch setfileposition
+- setcolorspace
++ .setuseciecolor setcolorspace setcolor end % restore colorspace, color and ExtGState (end)
+ } bdef
+ % Paint a Form+Group XObject, either for a transparency mask or for a Do.
+ /.execgroup { % <resdict> <stream> .execgroup -
+ gsave //nodict begin
+- null SMask
++ newpath null SMask
+ 1 .setopacityalpha 1 .setshapealpha
+ /Compatible .setblendmode
+ % Execute the body of the Form, similar to DoForm.
+@@ -773,7 +805,7 @@ currentdict end readonly def
+ exch //false resolvestream pdfopdict .pdfruncontext
+
+ countdictstack exch sub dup 0 gt {
+- ( **** Warning: Pattern stream has imbalanced q/Q operators (too many q's)\n)
++ ( **** Warning: Pattern stream has unbalanced q/Q operators \(too many q's\)\n)
+ pdfformaterror
+ { Q } repeat
+ } {
+@@ -796,16 +828,18 @@ currentdict end readonly def
+ 1 index /File get dup fileposition 3 1 roll
+ % Stack: dict savepos pos file
+ dup 3 -1 roll setfileposition
+- dup 3 index /Length oget
+-
+- dup 65535 le {
+- dup 0 eq {
+- pop pop ()
++ dup 3 index /Length knownoget {
++ dup 65535 le {
++ dup 0 eq {
++ pop pop ()
++ } {
++ string readstring pop
++ } ifelse
+ } {
+- string readstring pop
++ () /SubFileDecode filter /ReusableStreamDecode filter
+ } ifelse
+ } {
+- () /SubFileDecode filter /ReusableStreamDecode filter
++ 0 (endstream) /SubFileDecode filter /ReusableStreamDecode filter
+ } ifelse
+ % Stack: dict savepos file string
+ 3 1 roll exch setfileposition
+@@ -820,6 +854,7 @@ currentdict end readonly def
+ 2 index /Resources knownoget { oforce } { 0 dict } ifelse
+ /.pdfpaintproc cvx
+ ] cvx put
++ dup /.pattern_uses_transparency 1 index patternusestransparency put
+ PDFDEBUG { pdfdict /PDFSTEPcount .knownget { 1 le } { true } ifelse { (%Pattern: ) print dup === flush } if } if
+ } bdef
+
+@@ -1108,24 +1143,41 @@ end
+ } bdef
+
+ /doimagesmask { % <imagemask> doimagesmask -
+- PDFusingtransparency { currentdict /SMask knownoget } { false } ifelse {
+- .begintransparencymaskimage
+- PDFfile fileposition exch
+- gsave //nodict begin
+- null /SoftMask gput
+- 1 .setopacityalpha 1 .setshapealpha
+- /Compatible .setblendmode
+- DoImage
+- end grestore
+- PDFfile exch setfileposition
+- 0 .endtransparencymask
++ PDFusingtransparency {
++ currentdict /SMask knownoget
++ } {
++ false
++ } ifelse
++ { % We are doing transparency and SMask is present in the image
++ % stack: <imagemask> <SMask>
++ currentdevice .devicename /pdfwrite eq {
++ pop % pdfwrite will process SMask directly during 'doimage'
++ } {
++ .begintransparencymaskimage
++ PDFfile fileposition exch
++ gsave //nodict begin
++ null /SoftMask gput
++ 1 .setopacityalpha 1 .setshapealpha
++ /Compatible .setblendmode
++ DoImage
++ end grestore
++ PDFfile exch setfileposition
++ 0 .endtransparencymask
++ } ifelse
+ << /Subtype /Group /Isolated true
+ /.image_with_SMask true % pdfwrite needs : see gs/src/ztrans.c, gs/src/gdevpdft.c
+ >> 0 0 1 1 .begintransparencygroup
+ doimage
+ .endtransparencygroup
+ } {
+- doimage
++ SoftMask //null ne {
++ % the image doesn't have an SMask, but the ExtGState does, force a group.
++ << /Subtype /Group /Isolated true >> 0 0 1 1 .begintransparencygroup
++ doimage
++ .endtransparencygroup
++ }
++ { doimage }
++ ifelse
+ } ifelse
+ } bdef
+
+@@ -1164,9 +1216,7 @@ end
+ % which is done under a rush of 8.63 release.
+ % The purpose is to disable a conversion of an image with soft mask
+ % into a Type 103 image, which currently allocates a full mask buffer
+- % before writing clist. Note that imagemask installs
+- % the transparency mask anyway (likely another bug),
+- % so the image is still masked.
++ % before writing clist.
+ % With this workaround the Matte color is not working (ignored).
+ is_big_mask not
+ } {
+@@ -1226,11 +1276,17 @@ end
+ /.paintform cvx
+ ] cvx /PaintProc exch put
+ % Adjust pdfemptycount since we have an extra dictionary on the stack
+- pdfemptycount exch
+- /pdfemptycount where pop count 2 sub /pdfemptycount exch put
+- q execform Q % gsave / grestore around the Form
++ pdfemptycount countdictstack 3 -1 roll
++ /pdfemptycount count 1 sub store
++ q execform % gsave / grestore around the Form
+ % Restore pdfemptycount
+- /pdfemptycount where pop exch /pdfemptycount exch put
++ countdictstack exch sub
++ dup 1 gt {
++ ( **** Warning: Pattern stream has unbalanced q/Q operators \(too many q's\)\n)
++ pdfformaterror
++ } if
++ { Q } repeat
++ /pdfemptycount exch store
+ } bdef
+
+ /_dops_save 1 array def
+@@ -1298,6 +1354,8 @@ end
+ oforce //unabbrevtypedict 1 index type .knownget { exec } if
+ } bdef
+
++/is_space_dict << 0 0 9 9 10 10 12 12 13 13 32 32 >> readonly def
++
+ drawopdict begin
+ /BI { mark } bdef
+ /ID {
+@@ -1314,23 +1372,34 @@ drawopdict begin
+ % between the last byte of valid data and an EOL.
+ % Some files (PDFOUT v3.8d by GenText) have EI immediately following
+ % the stream. Some have no EOL and garbage bytes.
+- % Therefore, we skip all bytes before EI or EOL
+- 0
+- { PDFsource read not { //true exit } if
+- dup 10 eq 1 index 13 eq or
+- { pop PDFsource token pop /EI ne exit
+- }
+- if
+- exch 69 eq 1 index 73 eq and { //false exit } if % 'EI'
+- }
+- loop
+- exch pop
+- { /ID cvx /syntaxerror signalerror
+- }
+- if
++ % Sometimes (bug 690300) CCITTDecode filter consumes 'E' in 'EI'.
++ % Therefore, we search for <start>I<sp|end> or <start|sp>EI<sp|end>
++ PDFsource read not {
++ /ID cvx /syntaxerror signalerror
++ } if
++ dup 73 eq {
++ pop 10 69 73 % Seed to: <sp>EI
++ } {
++ 10 10 3 -1 roll % Seed to: <sp><sp><any>
++ } ifelse
++ { PDFsource read not dup { 10 exch } if
++ //is_space_dict 2 index known
++ 3 index 73 eq and 4 index 69 eq and
++ //is_space_dict 6 index known and {
++ pop pop pop pop pop exit
++ } {
++ {
++ pop pop pop /ID cvx /syntaxerror signalerror
++ } {
++ 4 -1 roll pop
++ } ifelse
++ } ifelse
++ } loop
+ } bdef
+ end
+
++currentdict /is_space_dict undef
++
+ % ================================ Text ================================ %
+
+ drawopdict begin
+@@ -1401,38 +1470,42 @@ end
+ /drawborder { % <annot> drawborder -
+ gsave
+ dup /BS known 1 index /Border known or {
+- dup /BS knownoget {
++ dup /BS knownoget {
+ dup type /dicttype ne % <annot> <border> <bad?>
+ } {
+ dup /Border oget
+- dup type /arraytype ne % <annot> [border] <bad?>
+- } ifelse
+- {
+- ( **** Warning: Wrong type of annotation border object.\n)
++ dup type /arraytype eq {
++ dup length 3 lt
++ } {
++ //true
++ } ifelse % <annot> [border] <bad?>
++ } ifelse {
++ ( **** Warning: Wrong annotation border object, no border is drawn.\n)
+ pdfformaterror
++ pop { 0 0 0 }
+ } if
+ dup type /dicttype eq {
+- dup /W knownoget not { 1 } if
++ dup /W knownoget not { 1 } if
+ % Per PDF1.6 Reference table 8.13, /W in the border style dictionary is
+ % expressed in points (an absolute unit), so compensate here for any
+ % scaling of the PostScript user space done due to /UserUnit.
+ % Scaling due to -dPDFFitPage is not undone, to keep the correct border width
+ % compared to the size of the surrounding marks.
+- //systemdict /NoUserUnit .knownget not { false } if not
++ //systemdict /NoUserUnit .knownget not { //false } if not
+ //systemdict /PDFFitPage known not and { % UserUnit is ignored if -dPDFFitPage
+ Page /UserUnit knownoget { div } if
+ } if
+- [] 2 index /S knownoget {
+- /D eq { 2 index /D knownoget not { [3] } if exch pop } if
+- } if 3 -1 roll pop strokeborder
+- } {
++ {} 2 index /S knownoget {
++ /D eq { 2 index /D knownoget not { {3} } if exch pop } if
++ } if 3 -1 roll pop strokeborder
++ } {
+ dup 2 get
+- exch dup length 3 gt { 3 get } { pop [] } ifelse
++ exch dup length 3 gt { 3 get } { pop {} } ifelse
+ strokeborder
+ } ifelse
+- } {
+- 1 [] strokeborder
+- } ifelse
++ } {
++ 1 {} strokeborder
++ } ifelse
+ grestore
+ } bdef
+
+diff --git a/Resource/Init/pdf_font.ps b/Resource/Init/pdf_font.ps
+--- a/Resource/Init/pdf_font.ps
++++ b/Resource/Init/pdf_font.ps
+@@ -652,6 +652,11 @@ setglobal
+ % Yet another case of broken PDF's that Adobe Reader accepts.
+ 1 index dup /FontName known {
+ /FontName oget
++ dup type /nametype ne {
++ ( **** /FontName attribute in FontDescriptor is not a name.\n)
++ pdfformaterror
++ cvn
++ } if
+ } {
+ ( **** FontDescriptor missing required /FontName key. BaseFont name used.\n)
+ pdfformaterror
+@@ -735,9 +740,43 @@ setglobal
+ % The whole type1 stream can be executed directly. There's no need to process
+ % Length1, 2, 3 keys.
+
+-/readtype1dict 5 dict dup begin
++/readtype1dict 10 dict dup begin
+ /definefont {
+ exch pop
++
++ /topFontDict where {
++ { /FontType % in PLRM order
++ /FontMatrix
++ /FontName
++ /FontInfo
++ /WMode
++ /Encoding
++ /FontBBox
++ /UniqueID
++ /XUID
++ /PaintType
++ /StrokeWidth
++ /Metrics
++ /Metrics2
++ /CDevProc
++ /CharStrings
++ /Private
++ /WeightVector
++ } {
++ 2 copy .knownget {
++ % Stack: font topFontDict /key val
++ 3 index 3 1 roll put
++ dup /MisplacedKey 0 put
++ } {
++ pop
++ } ifelse
++ } forall
++ /MisplacedKey known {
++ ( **** Warning: Type 1 font defines some of the keys in the external scope.\n)
++ pdfformaterror
++ } if
++ } if
++
+ dup /UniqueID .knownget {
+ dup dup 0 lt exch 16#ffffff gt or {
+ ( **** Warning: Ignoring invalid /UniqueID = ) exch =string cvs
+@@ -793,10 +832,31 @@ setglobal
+ pdfformaterror
+ } ifelse } .bind def
+
+- currentdict dup dup
+- /undef_proc_warning undef
+- /missing-type1-procs undef
+- /readonly-op-dict undef
++ /prev_get /get load def
++
++ /get {
++ dup /FontName eq {
++ % No warning, probably FontName is defined elsewhere; see definefont above.
++ .knownget not { /Missing } if
++ } {
++ dup /UniqueID eq {
++ % We don't want fonts to check /UniqueID and do 'restore'.
++ pop pop 16#FEDCBA98 % Arbitrary and invalid value
++ } {
++ prev_get
++ } ifelse
++ } ifelse
++ } bdef
++
++ /prev_begin /begin load def
++
++ /begin {
++ dup //systemdict eq { pop 0 dict } if
++ prev_begin
++ } bdef
++
++ { /undef_proc_warning /missing-type1-procs /readonly-op-dict }
++ { currentdict exch undef } forall
+
+ end readonly def
+
+@@ -1348,8 +1408,8 @@ currentdict /eexec_pdf_param_dict .undef
+ concatstrings concatstrings
+ cvn
+ QUIET not {
+- (Substituting CID font resource ) print dup ==only
+- ( for ) print 1 index ==only (.\n) print
++ (Substituting CID font ) print dup ==only
++ ( for ) print 1 index ==only (, see doc/Use.htm#CIDFontSubstitution.) =
+ } if
+ exch pop
+ dup /CIDFont resourcestatus {
+@@ -1579,11 +1639,11 @@ currentdict /eexec_pdf_param_dict .undef
+ } 2 bndef
+
+ <01000401> <01000402> <01000403> <01000404> % Type 1C
+- <01000C02>
++ <01000C02> <01000C03>
+ { exch pop
+ dup /Subtype get
+ fontloadprocs exch get exec
+- } 5 bndef
++ } 6 bndef
+
+ <00010000> (true) (typ1) (ttcf) % TrueType OpenType
+ { exch pop readtruetype
+@@ -1627,9 +1687,15 @@ currentdict /bndef undef
+ % /key res res desc stream
+ dup //null ne {
+ PDFfile fileposition
+- 1 index //true resolvestream dup
+- 4 string readstring pop
+- exch closefile
++ mark {
++ 2 index //true resolvestream dup
++ 4 string readstring pop
++ exch closefile
++ } stopped {
++ cleartomark /bad_stream
++ } {
++ exch pop
++ } ifelse
+ PDFfile 3 -1 roll setfileposition
+ dup length 4 lt { pop /bad_stream } if
+ } {
+diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
+--- a/Resource/Init/pdf_main.ps
++++ b/Resource/Init/pdf_main.ps
+@@ -955,15 +955,22 @@ pdfdict begin
+ { Trailer /Root oget /Pages oget
+ dup /Count knownoget {
+ dup 0 le {
+- pop ( **** Warning: Invalid Page count.\n) pdfformaterror
+- % find the last page and use that as the Count
+- 1 1 999999999 {
+- dup pdffindpage?
+- exch pop
+- //null eq { exit } { pop } ifelse
+- } for
+- 1 sub % decrement to last page that we were able to find
+- 2 copy /Count exch put
++ pop
++ dup /Kids knownoget {
++ pop
++ ( **** Warning: Invalid Page count.\n) pdfformaterror
++ % find the last page and use that as the Count
++ 1 1 999999999 {
++ dup pdffindpage?
++ exch pop
++ //null eq { exit } { pop } ifelse
++ } for
++ 1 sub % decrement to last page that we were able to find
++ 2 copy /Count exch put
++ } {
++ 0 % return 0 and keep 0 page count.
++ ( **** Warning: PDF document has no pages.\n) pdfformaterror
++ } ifelse
+ } if
+ exch pop
+ } {
+@@ -1215,9 +1222,18 @@ end readonly def
+ /Link {
+ mark exch
+ dup /C knownoget { /Color exch 3 -1 roll } if
+- { /Rect /Border }
+- { 2 copy knownoget { 3 -1 roll } { pop } ifelse }
+- forall dup /A knownoget {
++ dup /Rect knownoget { /Rect exch 3 -1 roll } if
++ dup /Border knownoget {
++ dup type /arraytype eq {
++ dup length 3 lt
++ } {
++ //true
++ } ifelse {
++ pop [ 0 0 0 ] % Following AR5 use invisible border.
++ } if
++ /Border exch 3 -1 roll
++ } if
++ dup /A knownoget {
+ dup /URI known {
+ /A mark 3 2 roll % <<>> /A [ <<action>>
+ { oforce } forall
+@@ -1539,7 +1555,7 @@ currentdict /PDF2PS_matrix_key undef
+ % Some PDF files don't have matching q/Q (gsave/grestore) so we need
+ % to clean up any left over dicts from the dictstack
+ countdictstack PDFdictstackcount sub dup 0 ne {
+- ( **** Warning: File has imbalanced q/Q operators \(too many q's\)\n)
++ ( **** Warning: File has unbalanced q/Q operators \(too many q's\)\n)
+ pdfformaterror
+ { end } repeat
+ } {
+@@ -1626,17 +1642,27 @@ currentdict /PDF2PS_matrix_key undef
+ /extgstateusestransparency { % <gstate dict> extgstateusestransparency <bool>
+ //false exch % Assume no transparency
+ { % establish loop context
+- exch pop oforce
+ dup /BM knownoget { dup /Normal ne exch /Compatible ne and
+ { pop not exit } if
+ } if
+ dup /ca knownoget { 1 ne { pop not exit } if } if
+ dup /CA knownoget { 1 ne { pop not exit } if } if
+ dup /SMask knownoget { /None ne { pop not exit } if } if
+- pop
+- } forall
++ pop exit
++ } loop
+ } bind def
+
++% Check if transparency is used in a Pattern
++/patternusestransparency { % <Pattern dict> patternusestransparency <bool>
++ //false exch % Assume no transparency
++ {
++ 4 dict 1 index resourceusestransparency { pop not exit } if
++ dup /ExtGState knownoget { extgstateusestransparency { pop not exit } if } if
++ pop exit
++ } loop
++} bind def
++
++
+ % Check the Resources of a page or Form. Check for loops in the resource chain.
+ /resourceusestransparency { % <dict> <dict> resourceusestransparency <bool>
+ { % Use loop to provide an exitable context.
+@@ -1651,19 +1677,33 @@ currentdict /PDF2PS_matrix_key undef
+ } if
+ 2 copy //true put % In the current chain.
+ dup /ExtGState knownoget {
+- extgstateusestransparency
++ //false exch
++ { exch pop oforce extgstateusestransparency { pop //true exit } if
++ } forall
++ { pop //true exit } if
++ } if
++ dup /Pattern knownoget {
++ //false exch
++ { exch pop oforce patternusestransparency { pop //true exit } if
++ } forall
+ { pop //true exit } if
+ } if
+ dup /XObject knownoget {
+- //false exch {
+- exch pop oforce dup /Subtype get
+- dup /Image eq { 1 index /SMask known { pop pop not exit } if } if
+- /Form eq {
+- 3 index exch resourceusestransparency { not exit } if
+- } {
+- pop
+- } ifelse
+- } forall { pop //true exit } if
++ dup type /dicttype eq {
++ //false exch {
++ exch pop oforce dup /Subtype get
++ dup /Image eq { 1 index /SMask known { pop pop not exit } if } if
++ /Form eq {
++ 3 index exch resourceusestransparency { not exit } if
++ } {
++ pop
++ } ifelse
++ } forall { pop //true exit } if
++ } {
++ ( **** Ignoring non-dictionary /XObject attribute.\n)
++ pdfformaterror
++ pop
++ } ifelse
+ } if
+ 2 copy //false put % Visited but not in the current chain.
+ pop //false exit
+@@ -1748,9 +1788,13 @@ currentdict /PDF2PS_matrix_key undef
+ { exch pop oforce /ColorSpace oget 3 index colorspacespotcolors } forall
+ } if
+ /XObject knownoget {
+- { exch pop oforce dup
+- /Subtype get /Form eq { resourcespotcolors } { pop } ifelse
+- } forall
++ dup type /dicttype eq {
++ { exch pop oforce dup
++ /Subtype get /Form eq { resourcespotcolors } { pop } ifelse
++ } forall
++ } {
++ pop % Just ignore here, already reported by resourceusestransparency.
++ } ifelse
+ } if
+ exit
+ } loop
+diff --git a/Resource/Init/pdf_ops.ps b/Resource/Init/pdf_ops.ps
+--- a/Resource/Init/pdf_ops.ps
++++ b/Resource/Init/pdf_ops.ps
+@@ -115,7 +115,7 @@ nodict readonly pop
+ } {
+ //true % formaterror -- not a gsave dict
+ } ifelse
+- { (\n **** File has imbalanced q/Q operators \(too many Q's\) ****\n)
++ { (\n **** File has unbalanced q/Q operators \(too many Q's\) ****\n)
+ pdfformaterror
+ } if
+ } bdef
+@@ -371,10 +371,16 @@ end def
+ } bdef
+ /fsexec % <fillop|strokeop> fsexec -
+ { % Preserve the current point, if any.
++ SoftMask //null ne {
++ mark /Subtype /Group /Isolated true .dicttomark pathbbox .begintransparencygroup
++ } if
+ { currentpoint } stopped
+ { $error /newerror false put cvx exec }
+ { 3 -1 roll cvx exec moveto }
+ ifelse
++ SoftMask //null ne {
++ .endtransparencygroup
++ } if
+ } bdef
+
+ % ---------------- Path painting and clipping ---------------- %
+diff --git a/Resource/Init/pdf_sec.ps b/Resource/Init/pdf_sec.ps
+--- a/Resource/Init/pdf_sec.ps
++++ b/Resource/Init/pdf_sec.ps
+@@ -328,16 +328,17 @@ def
+ pop
+ % this step is for the AES cipher only
+ Trailer /Encrypt oget
+- dup /StmF known
+- {
+- dup /StmF oget
+- exch /CF oget exch oget /CFM oget
+- /AESV2 eq {
+- (sAlT) concatstrings
+- } if
+- }
+- { pop }
+- ifelse
++ dup /StmF knownoget {
++ exch /CF knownoget {
++ exch oget /CFM oget /AESV2 eq {
++ (sAlT) concatstrings
++ } if
++ } {
++ pop
++ } ifelse
++ } {
++ pop
++ } ifelse
+ md5 0 FileKey length 5 add 2 index length .min getinterval
+ } bind def
+
+@@ -397,12 +398,15 @@ def
+ { % If StrF is present ...
+ dup /Identity eq not % Check if StrF != Identity
+ { /StdCF eq
+- { Trailer /Encryption oget /StdCF oget /CFM oget
+- /AESV2 eq
+- % Decrypt string
+- { 1 index aesdecode }
+- { 1 index arc4decode }
+- ifelse
++ { Trailer /Encrypt oget /CF knownoget {
++ /StdCF oget /CFM oget /AESV2 eq
++ } {
++ //false
++ } ifelse { % Decrypt string
++ 1 index aesdecode
++ } {
++ 1 index arc4decode
++ } ifelse
+ }
+ { 1 index arc4decode }
+ ifelse % If StrF != StdCF
+@@ -477,8 +481,10 @@ currentdict /PDFScanRules_null undef
+ } if
+ % Check if the stream encryption handler (StmF) == Identity.
+ PDFDEBUG {
+- Trailer /Encrypt oget /CF get /StdCF get /CFM get
+- (Encrypt StmF is StdCF with CFM ) print =
++ Trailer /Encrypt oget /CF knownoget {
++ /StdCF oget /CFM oget
++ (Encrypt StmF is StdCF with CFM ) print =
++ } if
+ } if
+ /StmF knownoget % Get StmF (if present)
+ not { /Identity } if % If StmF not present default = Identity
+@@ -504,13 +510,13 @@ currentdict /PDFScanRules_null undef
+ exch
+ % Stack: readdata? dict parms filternames file/string
+ 3 index /StreamKey get
+- Trailer /Encrypt oget dup /StmF
+- known
+- {
+- dup /StmF oget % stack: key Encrypt StmF
+- exch /CF oget
+- exch oget /CFM oget % stack: key StmF-CFM
+- /AESV2 eq
++ Trailer /Encrypt oget
++ dup /StmF knownoget
++ { % stack: key Encrypt StmF
++ exch /CF knownoget {
++ exch oget /CFM oget % stack: key StmF-CFM
++ /AESV2 eq
++ } { pop //false } ifelse
+ { aesdecodefilter } % install the requested filter
+ { arc4decodefilter }
+ ifelse
+diff --git a/base/Makefile.in b/base/Makefile.in
+--- a/base/Makefile.in
++++ b/base/Makefile.in
+@@ -82,6 +82,7 @@ CUPSLIBDIRS=@CUPSLIBDIRS@
+ CUPSSERVERBIN=@CUPSSERVERBIN@
+ CUPSSERVERROOT=@CUPSSERVERROOT@
+ CUPSDATA=@CUPSDATA@
++CUPSPDFTORASTER=@CUPSPDFTORASTER@
+
+ # Define the default directory/ies for the runtime
+ # initialization and font files. Separate multiple directories with a :.
+@@ -180,11 +181,14 @@ JBIG2_LIB=jbig2dec
+ SHARE_JBIG2=@SHARE_JBIG2@
+ JBIG2SRCDIR=@JBIG2DIR@
+
+-# uncomment the following to compile in the Luratech ldf_jb2 codec
++# uncomment the following three lines and one of the last two to
++# compile in the Luratech ldf_jb2 codec
+ #JBIG2_LIB=luratech
+ #SHARE_JBIG2=0
+ #JBIG2SRCDIR=ldf_jb2
+-#JBIG2_CFLAGS=-DUSE_LDF_JB2
++#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DLINUX
++#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DMAC -DMAC_OS_X_BUILD
++
+
+ # Choose the library to use for (JPXDecode support)
+ # whether to link to an external build or compile in from source
+@@ -194,11 +198,13 @@ SHARE_JPX=@SHARE_JASPER@
+ JPXSRCDIR=@JASPERDIR@
+ JPX_CFLAGS=-DJAS_CONFIGURE
+
+-# uncomment the following to compile in the Luratech lwf_jp2 codec
++# uncomment the following three lines and one of the last two to
++# compile in the Luratech lwf_jp2 codec
+ #JPX_LIB=luratech
+ #SHARE_JPX=0
+ #JPXSRCDIR=lwf_jp2
+ #JPX_CFLAGS=-DUSE_LWF_JP2 -DLINUX
++#JPX_CFLAGS=-DUSE_LWF_JP2 -DMAC -DMAC_OS_X_BUILD
+
+ # Define the directory where the icclib source are stored.
+ # See icclib.mak for more information
+@@ -506,7 +512,7 @@ include $(GLSRCDIR)/unixinst.mak
+ # Clean up after the autotools scripts
+ # configure.ac and Makefile.in are symlinks from a subdir
+ # (created by autogen.sh) and so are safe to remove
+-distclean : clean config-clean
++distclean : clean config-clean soclean debugclean
+ -$(RM_) -r $(BINDIR) $(GLOBJDIR) $(PSOBJDIR)
+ -$(RM_) -r autom4te.cache
+ -$(RM_) config.log config.status
+diff --git a/base/configure.ac b/base/configure.ac
+--- a/base/configure.ac
++++ b/base/configure.ac
+@@ -420,6 +420,9 @@ dnl look for CUPS...
+ AC_ARG_ENABLE([cups], AC_HELP_STRING([--disable-cups],
+ [Don't include CUPS support]))
+
++AC_ARG_WITH([pdftoraster], AC_HELP_STRING([--without-pdftoraster],
++ [Don't include CUPS' pdftoraster filter]))
++
+ CUPSDEV=""
+ CUPSINCLUDE=""
+ CUPSCFLAGS=""
+@@ -429,6 +432,8 @@ CUPSCONFIG="${CUPSCONFIG:=}"
+ CUPSSERVERBIN=""
+ CUPSSERVERROOT=""
+ CUPSDATA=""
++CUPSVERSION="0"
++CUPSPDFTORASTER="0"
+
+ if ( test -d cups ); then
+ if test x$enable_cups != xno; then
+@@ -446,6 +451,12 @@ if ( test -d cups ); then
+ CUPSDATA="`$CUPSCONFIG --datadir`"
+ CUPSINCLUDE="include cups/cups.mak"
+ CUPSDEV="\$(DD)cups.dev"
++ CUPSVERSION="`$CUPSCONFIG --version`"
++ if ( test x$with_pdftoraster != xno ); then
++ if test "$CUPSVERSION" ">" "1.2"; then
++ CUPSPDFTORASTER="1"
++ fi
++ fi
+ fi
+ fi
+ fi
+@@ -458,6 +469,7 @@ AC_SUBST(CUPSINCLUDE)
+ AC_SUBST(CUPSSERVERBIN)
+ AC_SUBST(CUPSSERVERROOT)
+ AC_SUBST(CUPSDATA)
++AC_SUBST(CUPSPDFTORASTER)
+
+
+ dnl look for IJS implementation
+@@ -781,7 +793,7 @@ P_DEVS=""
+ F_DEVS=""
+
+ dnl Known printers
+-HP_DEVS="cdj500 djet500 djet500c dnj650c cljet5pr deskjet laserjet ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d lj4dith lj5mono lj5gray cdeskjet cdjcolor cdjmono cdj550 pj pjxl pjxl300 lp2563 paintjet pjetxl cljet5 cljet5c pxlmono pxlcolor cdj670 cdj850 cdj880 cdj890 cdj970 cdj1600 chp2200 pcl3 hpdjplus hpdjportable hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c hpdj850c hpdj855c hpdj870c hpdj890c hpdj1120c lj3100sw"
++HP_DEVS="cdj500 djet500 djet500c dnj650c cljet5pr deskjet laserjet ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d lj4dith lj5mono lj5gray cdeskjet cdjcolor cdjmono cdj550 pj pjxl pjxl300 lp2563 paintjet pjetxl cljet5 cljet5c pxlmono pxlcolor cdj670 cdj850 cdj880 cdj890 cdj970 cdj1600 cdnj500 chp2200 pcl3 hpdjplus hpdjportable hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c hpdj850c hpdj855c hpdj870c hpdj890c hpdj1120c lj3100sw"
+ PCLXL_DEVS="pxlmono pxlcolor"
+ EPSON_DEVS="eps9high eps9mid epson epsonc escp lp8000 lq850 photoex st800 stcolor alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 lp3000c lp8000c lp8200c lp8300c lp8500c lp8800c lp9000c lp9200c lp9500c lp9800c lps6500 epl2050 epl2050p epl2120 epl2500 epl2750 epl5800 epl5900 epl6100 epl6200 lp1800 lp1900 lp2200 lp2400 lp2500 lp7500 lp7700 lp7900 lp8100 lp8300f lp8400f lp8600 lp8600f lp8700 lp8900 lp9000b lp9100 lp9200b lp9300 lp9400 lp9600 lp9600s lps4500"
+ CANON_DEVS="bj10e bj200 bjc600 bjc800 lbp8 lips3 bjcmono bjcgray bjccmyk bjccolor"
+diff --git a/base/contrib.mak b/base/contrib.mak
+--- a/base/contrib.mak
++++ b/base/contrib.mak
+@@ -782,7 +782,7 @@ $(DD)inferno.dev : $(inferno_) $(DD)page.dev
+ $(SETPDEV) $(DD)inferno $(inferno_)
+
+ $(GLOBJ)gdevifno.$(OBJ) : $(GLSRC)gdevifno.c $(PDEVH)\
+- $(gsparam_h) $(gxlum_h)
++ $(gsparam_h)
+ $(GLCC) $(GLO_)gdevifno.$(OBJ) $(C_) $(GLSRC)gdevifno.c
+
+ ### --------------------------- MGR devices ---------------------------- ###
+diff --git a/base/devs.mak b/base/devs.mak
+--- a/base/devs.mak
++++ b/base/devs.mak
+@@ -418,12 +418,10 @@ $(GLOBJ)gdevvglb.$(OBJ) : $(GLSRC)gdevvglb.c $(GDEV) $(gdevpccm_h) $(gsparam_h)
+ ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
+
+ $(GLOBJ)lvga256.so : $(lvga256_)
+- $(CCLD) -shared -Wl,'-solvga256.so' $(lvga256_) -lvga -lvgagl
+- mv lvga256.so $(GLOBJ)lvga256.so
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)lvga256.so $(lvga256_) -lvga -lvgagl
+
+ $(GLOBJ)vgalib.so : $(vgalib_)
+- $(CCLD) -shared -Wl,'-sovgalib.so' $(vgalib_) -lvga -lvgagl
+- mv vgalib.so $(GLOBJ)vgalib.so
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)vgalib.so $(vgalib_) -lvga -lvgagl
+
+ ### -------------------------- The X11 device -------------------------- ###
+
+@@ -526,8 +524,7 @@ $(GLOBJ)gdevxalt.$(OBJ) : $(GLSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\
+ ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
+
+ $(GLOBJ)X11.so : $(x11alt_) $(x11_)
+- $(CCLD) -shared -Wl,'-soX11.so' $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
+- mv X11.so $(GLOBJ)X11.so
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)X11.so $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
+
+ ###### --------------- Memory-buffered printer devices --------------- ######
+
+diff --git a/base/dmmain.c b/base/dmmain.c
+--- a/base/dmmain.c
++++ /dev/null
+@@ -1,997 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-/* $Id: dmmain.c 8022 2007-06-05 22:23:38Z giles $ */
+-
+-/* Ghostscript shlib example wrapper for Macintosh (Classic/Carbon) contributed
+- by Nigel Hathaway. Uses the Metrowerks CodeWarrior SIOUX command-line library.
+- */
+-
+-#if __ide_target("Ghostscript PPC (Debug)") || __ide_target("Ghostscript PPC (Release)")
+-#define TARGET_API_MAC_CARBON 0
+-#define TARGET_API_MAC_OS8 1
+-#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
+-#endif
+-
+-#include <Carbon.h>
+-
+-#include <stdlib.h>
+-#include <string.h>
+-#include <stdio.h>
+-#include <console.h>
+-#include <SIOUX.h>
+-#include <SIOUXGlobals.h>
+-#include <SIOUXMenus.h>
+-
+-#include "gscdefs.h"
+-#define GSREVISION gs_revision
+-#include "ierrors.h"
+-#include "iapi.h"
+-
+-#if DEBUG
+-#include "vdtrace.h"
+-#endif
+-
+-#include "gdevdsp.h"
+-
+-#define kScrollBarWidth 15
+-#define MAX_ARGS 25
+-
+-Boolean gRunningOnX = false;
+-Boolean gDone;
+-ControlActionUPP gActionFunctionScrollUPP;
+-
+-const char start_string[] = "systemdict /start get exec\n";
+-void *instance;
+-
+-const unsigned int display_format = DISPLAY_COLORS_RGB | DISPLAY_UNUSED_FIRST |
+- DISPLAY_DEPTH_8 | DISPLAY_BIGENDIAN |
+- DISPLAY_TOPFIRST;
+-typedef struct IMAGE_S IMAGE;
+-struct IMAGE_S {
+- void *handle;
+- void *device;
+- WindowRef windowRef;
+- ControlRef scrollbarVertRef;
+- ControlRef scrollbarHorizRef;
+- PixMapHandle pixmapHdl;
+- UInt64 update_time;
+- int update_interval;
+- IMAGE *next;
+-};
+-
+-IMAGE *first_image;
+-
+-static IMAGE *image_find(void *handle, void *device);
+-
+-static int GSDLLCALL gsdll_stdin(void *instance, char *buf, int len);
+-static int GSDLLCALL gsdll_stdout(void *instance, const char *str, int len);
+-static int GSDLLCALL gsdll_stderr(void *instance, const char *str, int len);
+-static int GSDLLCALL gsdll_poll(void *handle);
+-
+-static int display_open(void *handle, void *device);
+-static int display_preclose(void *handle, void *device);
+-static int display_close(void *handle, void *device);
+-static int display_presize(void *handle, void *device, int width, int height,
+- int raster, unsigned int format);
+-static int display_size(void *handle, void *device, int width, int height,
+- int raster, unsigned int format, unsigned char *pimage);
+-static int display_sync(void *handle, void *device);
+-static int display_page(void *handle, void *device, int copies, int flush);
+-static int display_update(void *handle, void *device,
+- int x, int y, int w, int h);
+-
+-static size_t get_input(void *ptr, size_t size);
+-
+-static void window_create (IMAGE *img);
+-static void window_invalidate (WindowRef windowRef);
+-static void window_adjust_scrollbars (WindowRef windowRef);
+-
+-void main (void);
+-OSErr quitAppEventHandler (AppleEvent *,AppleEvent *,SInt32);
+-void doEvents (EventRecord *);
+-void doMouseDown (EventRecord *);
+-void doUpdate (EventRecord *);
+-void doUpdateWindow (EventRecord *);
+-void doOSEvent (EventRecord *);
+-void doInContent (EventRecord *,WindowRef);
+-pascal void actionFunctionScroll (ControlRef,ControlPartCode);
+-
+-/*********************************************************************/
+-/* stdio functions */
+-static int GSDLLCALL
+-gsdll_stdin(void *instance, char *buf, int len)
+-{
+- if (isatty(fileno(stdin)))
+- return get_input(buf, len);
+- else
+- return fread(buf, 1, len, stdin);
+-}
+-
+-static int GSDLLCALL
+-gsdll_stdout(void *instance, const char *str, int len)
+-{
+- int n = fwrite(str, 1, len, stdout);
+- fflush(stdout);
+- return n;
+-}
+-
+-static int GSDLLCALL
+-gsdll_stderr(void *instance, const char *str, int len)
+-{
+- return gsdll_stdout(instance, str, len);
+-}
+-
+-/* Poll the caller for cooperative multitasking. */
+-/* If this function is NULL, polling is not needed */
+-static int GSDLLCALL gsdll_poll(void *handle)
+-{
+- EventRecord eventStructure;
+-
+- while (WaitNextEvent(everyEvent, &eventStructure, 0, NULL))
+- doEvents(&eventStructure);
+-
+- return (gDone ? e_Fatal : 0);
+-}
+-/*********************************************************************/
+-
+-/* new dll display device */
+-
+-/* New device has been opened */
+-/* This is the first event from this device. */
+-static int display_open(void *handle, void *device)
+-{
+- IMAGE *img = (IMAGE *)malloc(sizeof(IMAGE));
+- if (img == NULL)
+- return -1;
+- memset(img, 0, sizeof(IMAGE));
+-
+- /* add to list */
+- if (first_image)
+- img->next = first_image;
+- first_image = img;
+-
+- /* remember device and handle */
+- img->handle = handle;
+- img->device = device;
+-
+- /* create window */
+- window_create(img);
+-
+- gsdll_poll(handle);
+- return 0;
+-}
+-
+-/* Device is about to be closed. */
+-/* Device will not be closed until this function returns. */
+-static int display_preclose(void *handle, void *device)
+-{
+- /* do nothing - no thread synchonisation needed */
+- return 0;
+-}
+-
+-/* Device has been closed. */
+-/* This is the last event from this device. */
+-static int display_close(void *handle, void *device)
+-{
+- IMAGE *img = image_find(handle, device);
+- if (img == NULL)
+- return -1;
+-
+- gsdll_poll(handle);
+-
+- /* remove from list */
+- if (img == first_image)
+- first_image = img->next;
+- else
+- {
+- IMAGE *tmp;
+- for (tmp = first_image; tmp!=0; tmp=tmp->next)
+- {
+- if (img == tmp->next)
+- tmp->next = img->next;
+- }
+- }
+-
+- DisposePixMap(img->pixmapHdl); // need to go in doCloseWindow()
+- DisposeWindow(img->windowRef);
+-
+- free(img);
+-
+- return 0;
+-}
+-
+-/* Device is about to be resized. */
+-/* Resize will only occur if this function returns 0. */
+-static int display_presize(void *handle, void *device, int width, int height,
+- int raster, unsigned int format)
+-{
+- /* Check for correct format (32-bit RGB), fatal error if not */
+- if (format != display_format)
+- {
+- printf("DisplayFormat has been set to an incompatible value.\n");
+- fflush(stdout);
+- return e_rangecheck;
+- }
+-
+- return 0;
+-}
+-
+-/* Device has been resized. */
+-/* New pointer to raster returned in pimage */
+-static int display_size(void *handle, void *device, int width, int height,
+- int raster, unsigned int format, unsigned char *pimage)
+-{
+- PixMapPtr pixmap;
+- IMAGE *img = image_find(handle, device);
+- if (img == NULL)
+- return -1;
+-
+- /* Check that image is within allowable bounds */
+- if (raster > 0x3fff)
+- {
+- printf("QuickDraw can't cope with an image this big.\n");
+- fflush(stdout);
+- if (img->pixmapHdl)
+- {
+- DisposePixMap(img->pixmapHdl);
+- img->pixmapHdl = NULL;
+- }
+- return e_rangecheck;
+- }
+-
+- /* Create the PixMap */
+- if (!img->pixmapHdl)
+- img->pixmapHdl = NewPixMap();
+-
+- pixmap = *(img->pixmapHdl);
+- pixmap->baseAddr = (char*)pimage;
+- pixmap->rowBytes = (((SInt16)raster) & 0x3fff) | 0x8000;
+- pixmap->bounds.right = width;
+- pixmap->bounds.bottom = height;
+- pixmap->packType = 0;
+- pixmap->packSize = 0;
+- pixmap->pixelType = RGBDirect;
+- pixmap->pixelSize = 32;
+- pixmap->cmpCount = 3;
+- pixmap->cmpSize = 8;
+-
+- /* Update the display window */
+- window_adjust_scrollbars(img->windowRef);
+- window_invalidate(img->windowRef);
+- return gsdll_poll(handle);
+-}
+-
+-/* flushpage */
+-static int display_sync(void *handle, void *device)
+-{
+- IMAGE *img = image_find(handle, device);
+- if (img == NULL)
+- return -1;
+-
+- window_invalidate(img->windowRef);
+- gsdll_poll(handle);
+-
+- return 0;
+-}
+-
+-/* showpage */
+-/* If you want to pause on showpage, then don't return immediately */
+-static int display_page(void *handle, void *device, int copies, int flush)
+-{
+- return display_sync(handle, device);
+-}
+-
+-/* Poll the caller for cooperative multitasking. */
+-/* If this function is NULL, polling is not needed */
+-static int display_update(void *handle, void *device,
+- int x, int y, int w, int h)
+-{
+- UInt64 t1;
+- UInt64 t2;
+- int delta;
+- IMAGE *img = image_find(handle, device);
+- if (img == NULL)
+- return -1;
+-
+- Microseconds((UnsignedWide*)&t1);
+- delta = (t1 - img->update_time) / 1000000L;
+- if (img->update_interval < 1)
+- img->update_interval = 1; /* seconds */
+- if (delta < 0)
+- img->update_time = t1;
+- else if (delta > img->update_interval)
+- {
+- /* redraw window */
+- window_invalidate(img->windowRef);
+-
+- /* Make sure the update interval is at least 10 times
+- * what it takes to paint the window
+- */
+- Microseconds((UnsignedWide*)&t2);
+- delta = (t2 - t1) / 1000;
+- if (delta < 0)
+- delta += 60000; /* delta = time to redraw */
+- if (delta > img->update_interval * 100)
+- img->update_interval = delta/100;
+- img->update_time = t2;
+- }
+-
+- return gsdll_poll(handle);
+-}
+-
+-display_callback display = {
+- sizeof(display_callback),
+- DISPLAY_VERSION_MAJOR,
+- DISPLAY_VERSION_MINOR,
+- display_open,
+- display_preclose,
+- display_close,
+- display_presize,
+- display_size,
+- display_sync,
+- display_page,
+- display_update,
+- NULL, /* memalloc */
+- NULL, /* memfree */
+- NULL /* display_separation */
+-};
+-
+-static IMAGE * image_find(void *handle, void *device)
+-{
+- IMAGE *img;
+- for (img = first_image; img!=0; img=img->next) {
+- if ((img->handle == handle) && (img->device == device))
+- return img;
+- }
+- return NULL;
+-}
+-
+-/*********************************************************************/
+-
+-static char *stdin_buf = NULL;
+-static size_t stdin_bufpos = 0;
+-static size_t stdin_bufsize = 0;
+-
+-/* This function is a fudge which allows the SIOUX window to be waiting for
+- input and not be modal at the same time. (Why didn't MetroWerks think of that?)
+- It is based on the SIOUX function ReadCharsFromConsole(), and contains an
+- event loop which allows other windows to be active.
+- It collects characters up to when the user presses ENTER, stores the complete
+- buffer and gives as much to the calling function as it wants until it runs
+- out, at which point it gets another line (or set of lines if pasting from the
+- clipboard) from the user.
+-*/
+-static size_t get_input(void *ptr, size_t size)
+-{
+- EventRecord eventStructure;
+- long charswaiting, old_charswaiting = 0;
+- char *text;
+-
+-#if SIOUX_USE_WASTE
+- Handle textHandle;
+-#endif
+-
+- /* If needing more input, set edit start position */
+- if (!stdin_buf)
+-#if SIOUX_USE_WASTE
+- SIOUXselstart = WEGetTextLength(SIOUXTextWindow->edit);
+-#else
+- SIOUXselstart = (*SIOUXTextWindow->edit)->teLength;
+-#endif
+-
+- /* Wait until user presses exit (or quits) */
+- while(!gDone && !stdin_buf)
+- {
+-#if SIOUX_USE_WASTE
+- charswaiting = WEGetTextLength(SIOUXTextWindow->edit) - SIOUXselstart;
+-#else
+- if ((*SIOUXTextWindow->edit)->teLength > 0)
+- charswaiting = (*SIOUXTextWindow->edit)->teLength - SIOUXselstart;
+- else
+- charswaiting = ((unsigned short) (*SIOUXTextWindow->edit)->teLength) - SIOUXselstart;
+-#endif
+-
+- /* If something has happened, see if we need to do anything */
+- if (charswaiting != old_charswaiting)
+- {
+-#if SIOUX_USE_WASTE
+- textHandle = WEGetText(SIOUXTextWindow->edit);
+- HLock(textHandle);
+- text = *textHandle + SIOUXselstart;
+-#else
+- text = (*(*SIOUXTextWindow->edit)->hText) + SIOUXselstart;
+-#endif
+- /* If user has pressed enter, gather up the buffer ready for returning */
+- if (text[charswaiting-1] == '\r')
+- {
+- stdin_buf = malloc(charswaiting);
+- if (!stdin_buf)
+- return -1;
+- stdin_bufsize = charswaiting;
+- memcpy(stdin_buf, text, stdin_bufsize);
+- SIOUXselstart += charswaiting;
+-
+- text = stdin_buf;
+- while (text = memchr(text, '\r', charswaiting - (text - stdin_buf)))
+- *text = '\n';
+- }
+-#if SIOUX_USE_WASTE
+- HUnlock(textHandle);
+-#endif
+- old_charswaiting = charswaiting;
+-
+- if (stdin_buf)
+- break;
+- }
+-
+- /* Wait for next event and process it */
+- SIOUXState = SCANFING;
+-
+- if(WaitNextEvent(everyEvent, &eventStructure, SIOUXSettings.sleep ,NULL))
+- doEvents(&eventStructure);
+- else
+- SIOUXHandleOneEvent(&eventStructure);
+-
+- SIOUXState = IDLE;
+- }
+-
+- /* If data has been entered, return as much as has been requested */
+- if (stdin_buf && !gDone)
+- {
+- if (size >= stdin_bufsize - stdin_bufpos)
+- {
+- size = stdin_bufsize - stdin_bufpos;
+- memcpy (ptr, stdin_buf + stdin_bufpos, size);
+- free(stdin_buf);
+- stdin_buf = NULL;
+- stdin_bufpos = 0;
+- stdin_bufsize = 0;
+- }
+- else
+- {
+- memcpy (ptr, stdin_buf + stdin_bufpos, size);
+- stdin_bufpos += size;
+- }
+- return size;
+- }
+- else if (stdin_buf)
+- {
+- free(stdin_buf);
+- stdin_buf = NULL;
+- stdin_bufpos = 0;
+- stdin_bufsize = 0;
+- }
+-
+- return 0;
+-}
+-
+-/*********************************************************************/
+-
+-static void window_create(IMAGE *img)
+-{
+- WindowRef windowRef;
+- Str255 windowTitle = "\pGhostscript Image";
+- Rect windowRect = {20,4,580,420};//, portRect;
+- Rect scrollbarRect = {0,0,0,0};
+-
+-#if TARGET_API_MAC_CARBON
+- GetAvailableWindowPositioningBounds(GetMainDevice(),&windowRect);
+-#endif
+-
+- /* Create a new suitablty positioned window */
+- windowRect.top = windowRect.top * 2 + 2;
+- windowRect.bottom -= 10;
+- windowRect.left += 4;
+- windowRect.right = ((windowRect.bottom - windowRect.top) * 3) / 4 + windowRect.left;
+-
+- if(!(windowRef = NewCWindow(NULL, &windowRect, windowTitle, true,
+- zoomDocProc, (WindowRef) -1, false, 0)))
+- ExitToShell();
+-
+- img->windowRef = windowRef;
+-
+- SetWRefCon(img->windowRef, (SInt32)img);
+-
+- /* Create the window's scrollbars */
+-#if TARGET_API_MAC_CARBON
+- if(gRunningOnX)
+- ChangeWindowAttributes(windowRef,kWindowLiveResizeAttribute,0);
+-
+- CreateScrollBarControl(windowRef, &scrollbarRect, 0, 0, 0, 0,
+- true, gActionFunctionScrollUPP, &(img->scrollbarVertRef));
+-
+- CreateScrollBarControl(windowRef, &scrollbarRect, 0, 0, 0, 0,
+- true, gActionFunctionScrollUPP, &(img->scrollbarHorizRef));
+-#else
+- img->scrollbarVertRef = NewControl(windowRef,&scrollbarRect,"\p",false,0,0,0,scrollBarProc,0);
+- img->scrollbarHorizRef = NewControl(windowRef,&scrollbarRect,"\p",false,0,0,0,scrollBarProc,0);
+-#endif
+-
+- window_adjust_scrollbars(windowRef);
+-}
+-
+-static void window_invalidate(WindowRef windowRef)
+-{
+- Rect portRect;
+-
+- GetWindowPortBounds(windowRef, &portRect);
+- InvalWindowRect(windowRef, &portRect);
+-}
+-
+-static void window_adjust_scrollbars(WindowRef windowRef)
+-{
+- IMAGE *img;
+- Rect portRect;
+-
+- img = (IMAGE*)GetWRefCon(windowRef);
+- GetWindowPortBounds(windowRef,&portRect);
+-
+- /* Move the crollbars to the edges of the window */
+- HideControl(img->scrollbarVertRef);
+- HideControl(img->scrollbarHorizRef);
+-
+- MoveControl(img->scrollbarVertRef,portRect.right - kScrollBarWidth,
+- portRect.top - 1);
+- MoveControl(img->scrollbarHorizRef,portRect.left - 1,
+- portRect.bottom - kScrollBarWidth);
+-
+- SizeControl(img->scrollbarVertRef,kScrollBarWidth + 1,
+- portRect.bottom - portRect.top - kScrollBarWidth + 1);
+- SizeControl(img->scrollbarHorizRef, portRect.right - portRect.left - kScrollBarWidth + 1,
+- kScrollBarWidth + 1);
+-
+- /* Adjust the scroll position showing */
+- if (img->pixmapHdl)
+- {
+- PixMap *pixmap = *(img->pixmapHdl);
+- int visibleHeight = portRect.bottom - portRect.top - kScrollBarWidth;
+- int visibleWidth = portRect.right - portRect.left - kScrollBarWidth;
+-
+- if (pixmap->bounds.bottom > visibleHeight)
+- {
+- SetControl32BitMaximum(img->scrollbarVertRef,
+- pixmap->bounds.bottom - visibleHeight);
+- SetControlViewSize(img->scrollbarVertRef,visibleHeight);
+- }
+- else
+- SetControlMaximum(img->scrollbarVertRef, 0);
+-
+- if (pixmap->bounds.right > visibleWidth)
+- {
+- SetControl32BitMaximum(img->scrollbarHorizRef,
+- pixmap->bounds.right - visibleWidth);
+- SetControlViewSize(img->scrollbarHorizRef, visibleWidth);
+- }
+- else
+- SetControlMaximum(img->scrollbarHorizRef, 0);
+- }
+-
+- ShowControl(img->scrollbarVertRef);
+- ShowControl(img->scrollbarHorizRef);
+-}
+-
+-/*********************************************************************/
+-void main(void)
+-{
+- int code;
+- int exit_code;
+- int argc;
+- char **argv;
+- char dformat[64], ddevice[32];
+- SInt32 response;
+-
+- /* Initialize operating environment */
+-#if TARGET_API_MAC_CARBON
+- MoreMasterPointers(224);
+-#else
+- MoreMasters();
+-#endif
+- InitCursor();
+- FlushEvents(everyEvent,0);
+-
+- if (AEInstallEventHandler(kCoreEventClass,kAEQuitApplication,
+- NewAEEventHandlerUPP((AEEventHandlerProcPtr) quitAppEventHandler),
+- 0L,false) != noErr)
+- ExitToShell();
+-
+- gActionFunctionScrollUPP = NewControlActionUPP(&actionFunctionScroll);
+-
+- Gestalt(gestaltMenuMgrAttr,&response);
+- if(response & gestaltMenuMgrAquaLayoutMask)
+- gRunningOnX = true;
+-
+- /* Initialize SIOUX */
+- SIOUXSettings.initializeTB = false;
+- SIOUXSettings.standalone = false;
+- SIOUXSettings.asktosaveonclose = false;
+- SIOUXSettings.sleep = GetCaretTime();
+- SIOUXSettings.userwindowtitle = "\pGhostscript";
+-
+- /* Get arguments from user */
+- argc = ccommand(&argv);
+-
+- /* Show command line window */
+- if (InstallConsole(0))
+- ExitToShell();
+-
+- /* Part of fudge to make SIOUX accept characters without becoming modal */
+- SelectWindow(SIOUXTextWindow->window);
+- PostEvent(keyDown, 0x4c00); // Enter
+- ReadCharsFromConsole(dformat, 0x7FFF);
+- clrscr();
+-
+- /* Add in the display format as the first command line argument */
+- if (argc >= MAX_ARGS - 1)
+- {
+- printf("Too many command line arguments\n");
+- return;
+- }
+-
+- memmove(&argv[3], &argv[1], (argc-1) * sizeof(char**));
+- argc += 2;
+- argv[1] = ddevice;
+- argv[2] = dformat;
+-
+- sprintf(ddevice, "-sDEVICE=display");
+- sprintf(dformat, "-dDisplayFormat=%d", display_format);
+-
+- /* Run Ghostscript */
+- if (gsapi_new_instance(&instance, NULL) < 0)
+- {
+- printf("Can't create Ghostscript instance\n");
+- return;
+- }
+-
+-#ifdef DEBUG
+- visual_tracer_init();
+- set_visual_tracer(&visual_tracer);
+-#endif
+-
+- gsapi_set_stdio(instance, gsdll_stdin, gsdll_stdout, gsdll_stderr);
+- gsapi_set_poll(instance, gsdll_poll);
+- gsapi_set_display_callback(instance, &display);
+-
+- code = gsapi_init_with_args(instance, argc, argv);
+- if (code == 0)
+- code = gsapi_run_string(instance, start_string, 0, &exit_code);
+- else
+- {
+- printf("Failed to initialize. Error %d.\n", code);
+- fflush(stdout);
+- }
+- code = gsapi_exit(instance);
+- if (code != 0)
+- {
+- printf("Failed to terminate. Error %d.\n", code);
+- fflush(stdout);
+- }
+-
+- gsapi_delete_instance(instance);
+-
+-#ifdef DEBUG
+- visual_tracer_close();
+-#endif
+-
+- /* Ghostscript has finished - let user see output before quitting */
+- WriteCharsToConsole("\r[Finished - hit any key to quit]", 33);
+- fflush(stdout);
+-
+- /* Process events until a key is hit or user quits from menu */
+- while(!gDone)
+- {
+- EventRecord eventStructure;
+-
+- if(WaitNextEvent(everyEvent,&eventStructure,SIOUXSettings.sleep,NULL))
+- {
+- if (eventStructure.what == keyDown)
+- gDone = true;
+-
+- doEvents(&eventStructure);
+- }
+- else
+- SIOUXHandleOneEvent(&eventStructure);
+- }
+-}
+-
+-/*********************************************************************/
+-
+-void doEvents(EventRecord *eventStrucPtr)
+-{
+- WindowRef windowRef;
+-
+- if (eventStrucPtr->what == mouseDown &&
+- FindWindow(eventStrucPtr->where,&windowRef) == inMenuBar)
+- SelectWindow(SIOUXTextWindow->window);
+-
+- SIOUXSettings.standalone = true;
+- if (SIOUXHandleOneEvent(eventStrucPtr))
+- {
+- if (SIOUXQuitting)
+- gDone = true;
+- SIOUXSettings.standalone = false;
+- return;
+- }
+- SIOUXSettings.standalone = false;
+-
+- switch(eventStrucPtr->what)
+- {
+- case kHighLevelEvent:
+- AEProcessAppleEvent(eventStrucPtr);
+- break;
+-
+- case mouseDown:
+- doMouseDown(eventStrucPtr);
+- break;
+-
+- case keyDown:
+- case autoKey:
+- break;
+-
+- case updateEvt:
+- doUpdate(eventStrucPtr);
+- break;
+-
+- case activateEvt:
+- DrawGrowIcon(windowRef);
+- break;
+-
+- case osEvt:
+- doOSEvent(eventStrucPtr);
+- break;
+- }
+-}
+-
+-void doMouseDown(EventRecord *eventStrucPtr)
+-{
+- WindowRef windowRef;
+- WindowPartCode partCode, zoomPart;
+- BitMap screenBits;
+- Rect constraintRect, mainScreenRect;
+- Point standardStateHeightAndWidth;
+- long newSize;
+-
+- partCode = FindWindow(eventStrucPtr->where,&windowRef);
+-
+- switch(partCode)
+- {
+- case inMenuBar:
+- break;
+-
+- case inContent:
+- if(windowRef != FrontWindow())
+- SelectWindow(windowRef);
+- else
+- doInContent(eventStrucPtr,windowRef);
+- break;
+-
+- case inDrag:
+- DragWindow(windowRef,eventStrucPtr->where,NULL);
+- break;
+-
+- case inGoAway:
+- break;
+-
+- case inGrow:
+- constraintRect.top = 75;
+- constraintRect.left = 250;
+- constraintRect.bottom = constraintRect.right = 32767;
+- newSize = GrowWindow(windowRef,eventStrucPtr->where,&constraintRect);
+- if (newSize != 0)
+- SizeWindow(windowRef,LoWord(newSize),HiWord(newSize),true);
+- window_adjust_scrollbars(windowRef);
+- window_invalidate(windowRef);
+- break;
+-
+- case inZoomIn:
+- case inZoomOut:
+- mainScreenRect = GetQDGlobalsScreenBits(&screenBits)->bounds;
+- standardStateHeightAndWidth.v = mainScreenRect.bottom;
+- standardStateHeightAndWidth.h = mainScreenRect.right;
+-
+- if(IsWindowInStandardState(windowRef,&standardStateHeightAndWidth,NULL))
+- zoomPart = inZoomIn;
+- else
+- zoomPart = inZoomOut;
+-
+- if(TrackBox(windowRef,eventStrucPtr->where,partCode))
+- {
+- ZoomWindowIdeal(windowRef,zoomPart,&standardStateHeightAndWidth);
+- window_adjust_scrollbars(windowRef);
+- }
+- break;
+- }
+-}
+-
+-void doUpdate(EventRecord *eventStrucPtr)
+-{
+- WindowRef windowRef;
+-
+- windowRef = (WindowRef) eventStrucPtr->message;
+-
+- window_adjust_scrollbars(windowRef);
+-
+- BeginUpdate(windowRef);
+-
+- SetPortWindowPort(windowRef);
+- doUpdateWindow(eventStrucPtr);
+-
+- EndUpdate(windowRef);
+-}
+-
+-void doUpdateWindow(EventRecord *eventStrucPtr)
+-{
+- IMAGE *img;
+- WindowRef windowRef;
+- Rect srcRect, destRect, fillRect;
+- PixMapHandle srcPixmapHdl, destPixmapHdl;
+- RGBColor grayColour = { 0xC000,0xC000,0xC000 };
+- SInt32 hScroll, vScroll;
+-
+- windowRef = (WindowRef) eventStrucPtr->message;
+- img = (IMAGE*)GetWRefCon(windowRef);
+- srcPixmapHdl = img->pixmapHdl;
+- destPixmapHdl = GetPortPixMap(GetWindowPort(windowRef));
+- hScroll = GetControl32BitValue(img->scrollbarHorizRef);
+- vScroll = GetControl32BitValue(img->scrollbarVertRef);
+-
+- if (srcPixmapHdl)
+- {
+- PixMap *pixmap = *srcPixmapHdl;
+- PixPatHandle hdlPixPat = NewPixPat();
+- MakeRGBPat(hdlPixPat, &grayColour);
+-
+- GetWindowPortBounds(windowRef,&destRect);
+- destRect.right -= kScrollBarWidth;
+- destRect.bottom -= kScrollBarWidth;
+-
+- if (destRect.right > pixmap->bounds.right)
+- {
+- fillRect.top = destRect.top;
+- fillRect.bottom = destRect.bottom;
+- fillRect.left = pixmap->bounds.right;
+- fillRect.right = destRect.right;
+- FillCRect(&fillRect, hdlPixPat);
+- destRect.right = pixmap->bounds.right;
+- }
+- if (destRect.bottom > pixmap->bounds.bottom)
+- {
+- fillRect.top = pixmap->bounds.bottom;
+- fillRect.bottom = destRect.bottom;
+- fillRect.left = destRect.left;
+- fillRect.right = destRect.right;
+- FillCRect(&fillRect, hdlPixPat);
+- destRect.bottom = pixmap->bounds.bottom;
+- }
+- DisposePixPat(hdlPixPat);
+-
+- srcRect = destRect;
+- srcRect.left += hScroll;
+- srcRect.right += hScroll;
+- srcRect.top += vScroll;
+- srcRect.bottom += vScroll;
+-
+- CopyBits((BitMap*)*srcPixmapHdl, (BitMap*)*destPixmapHdl,
+- &srcRect, &destRect, srcCopy, NULL);
+- }
+-
+- DrawGrowIcon(windowRef);
+-}
+-
+-void doOSEvent(EventRecord *eventStrucPtr)
+-{
+- switch((eventStrucPtr->message >> 24) & 0x000000FF)
+- {
+- case suspendResumeMessage:
+- if((eventStrucPtr->message & resumeFlag) == 1)
+- SetThemeCursor(kThemeArrowCursor);
+- break;
+- }
+-}
+-
+-void doInContent(EventRecord *eventStrucPtr,WindowRef windowRef)
+-{
+- ControlPartCode controlPartCode;
+- ControlRef controlRef;
+-
+- SetPortWindowPort(windowRef);
+- GlobalToLocal(&eventStrucPtr->where);
+-
+- if(controlRef = FindControlUnderMouse(eventStrucPtr->where,windowRef,&controlPartCode))
+- {
+-#if TARGET_API_MAC_CARBON
+- TrackControl(controlRef,eventStrucPtr->where,(ControlActionUPP) -1);
+-#else
+- if (controlPartCode == kControlIndicatorPart)
+- TrackControl(controlRef,eventStrucPtr->where,NULL);
+- else
+- TrackControl(controlRef,eventStrucPtr->where,gActionFunctionScrollUPP);
+-#endif
+-
+- window_invalidate(windowRef);
+- }
+-}
+-
+-pascal void actionFunctionScroll(ControlRef controlRef,ControlPartCode controlPartCode)
+-{
+- SInt32 scrollDistance, controlValue, oldControlValue, controlMax;
+-
+- if(controlPartCode != kControlNoPart)
+- {
+- if(controlPartCode != kControlIndicatorPart)
+- {
+- switch(controlPartCode)
+- {
+- case kControlUpButtonPart:
+- case kControlDownButtonPart:
+- scrollDistance = 10;
+- break;
+-
+- case kControlPageUpPart:
+- case kControlPageDownPart:
+- scrollDistance = 100;
+- break;
+-
+- default:
+- scrollDistance = 0;
+- break;
+- }
+-
+- if (scrollDistance)
+- {
+- if((controlPartCode == kControlDownButtonPart) ||
+- (controlPartCode == kControlPageDownPart))
+- scrollDistance = -scrollDistance;
+-
+- controlValue = GetControl32BitValue(controlRef);
+-
+- if(((controlValue == GetControl32BitMaximum(controlRef)) && scrollDistance < 0) ||
+- ((controlValue == GetControl32BitMinimum(controlRef)) && scrollDistance > 0))
+- return;
+-
+- oldControlValue = controlValue;
+- controlMax = GetControl32BitMaximum(controlRef);
+- controlValue = oldControlValue - scrollDistance;
+-
+- if(controlValue < 0)
+- controlValue = 0;
+- else if(controlValue > controlMax)
+- controlValue = controlMax;
+-
+- SetControl32BitValue(controlRef,controlValue);
+- }
+- }
+- }
+-}
+-
+-OSErr quitAppEventHandler(AppleEvent *appEvent,AppleEvent *reply,SInt32 handlerRefcon)
+-{
+- OSErr osError;
+- DescType returnedType;
+- Size actualSize;
+-
+- osError = AEGetAttributePtr(appEvent,keyMissedKeywordAttr,typeWildCard,&returnedType,NULL,0,
+- &actualSize);
+-
+- if(osError == errAEDescNotFound)
+- {
+- gDone = true;
+- osError = noErr;
+- }
+- else if(osError == noErr)
+- osError = errAEParamMissed;
+-
+- return osError;
+-}
+-
+-/*********************************************************************/
+-
+diff --git a/base/dmmain.r b/base/dmmain.r
+--- a/base/dmmain.r
++++ /dev/null
+@@ -1,2537 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-/* $Id: dmmain.r 8022 2007-06-05 22:23:38Z giles $ */
+-
+-/* Resource data (Rez format) for the MacOS Ghostscript shlib example wrapper
+- contributed by Nigel Hathaway. See dmmain.c for rest of this code.
+- */
+-
+-#include "Types.r"
+-
+-resource 'BNDL' (128) {
+- 'MCGS',
+- 0,
+- { /* array TypeArray: 2 elements */
+- /* [1] */
+- 'ICN#',
+- { /* array IDArray: 1 elements */
+- /* [1] */
+- 0, 128
+- },
+- /* [2] */
+- 'FREF',
+- { /* array IDArray: 2 elements */
+- /* [1] */
+- 0, 128,
+- /* [2] */
+- 1, 129
+- }
+- }
+-};
+-
+-resource 'FREF' (128) {
+- 'APPL',
+- 0,
+- ""
+-};
+-
+-resource 'FREF' (129) {
+- '****',
+- 1,
+- ""
+-};
+-
+-data 'MWBB' (1008) {
+- $"0001 0000" /* .... */
+-};
+-
+-data 'MPSR' (1005) {
+- $"0009 4D6F 6E61 636F 0000 0000 0000 0000" /* .ÆMonaco........ */
+- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+- $"0000 0003 0004 0030 0004 01CA 027B 0030" /* .......0...Ê.{.0 */
+- $"0004 01CA 027B BA5E B2EF 0000 0000 0000" /* ...Ê.{º^²ï...... */
+- $"0000 0000 0000 0100" /* ........ */
+-};
+-
+-resource 'ICN#' (128, "Application Icon") {
+- { /* array: 2 elements */
+- /* [1] */
+- $"0000 0000 0000 0800 0000 0A00 000B F200"
+- $"007F 4200 00FC 0700 01F0 1F80 03E0 1F80"
+- $"03E5 3FC0 03E0 1FC0 03E0 0FC0 03F0 0780"
+- $"01F8 8300 00FC 4600 003C 0800 00F4 0000"
+- $"03E0 0000 07E0 0000 07FF 6000 07FF FF00"
+- $"07FF FFC0 01FF FFE0 007F FFF0 0000 17F0"
+- $"0780 01F8 0F04 00F0 0E08 03E0 0F07 FFD0"
+- $"0780 D820 03F0 0380 007F FC00 0005 40",
+- /* [2] */
+- $"0000 1800 0000 1E00 0000 1E00 001F FF00"
+- $"00FF FF00 01FF FF00 03FF FF80 03FF FFC0"
+- $"07FF FFC0 07FF FFC0 07FF FFC0 03FF FFC0"
+- $"03FF FF80 01FF FF00 007F FE00 03FF F000"
+- $"07FF F800 07FF FE00 0FFF FF80 0FFF FFE0"
+- $"07FF FFF0 03FF FFF8 01FF FFF8 027F FFFC"
+- $"1FFF FFFC 1FFF FFFC 1FFF FFF8 1FFF FFF8"
+- $"1FFF FFF0 07FF FFC0 01FF FF00 007F FC"
+- }
+-};
+-
+-resource 'ics#' (128, "Application Icon") {
+- { /* array: 2 elements */
+- /* [1] */
+- $"0000 00A0 0F10 1C78 1878 1C18 0E20 0600"
+- $"1800 3FD0 1FF8 057C 300C 3358 18A8 0340",
+- /* [2] */
+- $"0070 07F0 1FF0 1FF8 3FF8 3FF8 1FF8 1FF0"
+- $"3FF0 3FFC 3FFE 1FFE 7FFE 7FFE 7FFC 1FF0"
+- }
+-};
+-
+-resource 'icl8' (128, "Application Icon") {
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 F600 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 5656 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00F6 FCF8 F900 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F6 56F9 FCAC"
+- $"FCFC ACFE F600 FFF6 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F5FA FDFF FFFF FFFF"
+- $"FD81 F800 00F7 FFF7 0000 0000 0000 0000"
+- $"0000 0000 0000 00F6 E0FF FFFF FFFD F92B"
+- $"0000 0000 F6AC FFFA 0000 0000 0000 0000"
+- $"0000 0000 0000 2BFF EAFF FFFE F700 0000"
+- $"0000 0056 FFFF FFFF 8100 0000 0000 0000"
+- $"0000 0000 0000 FCFF FFFF FF56 0000 00F5"
+- $"F500 FAFF FFFF FFFF FFF8 0000 0000 0000"
+- $"0000 0000 00F6 FFFF FFFF FE00 0079 0055"
+- $"F600 FBFF FFFF FFFF FFFD 0000 0000 0000"
+- $"0000 0000 002B FFFF FFFF FC00 007A F6F5"
+- $"4F00 00AC FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 00F6 FFFF FFFF FFF5 0000 F500"
+- $"0000 00F5 ACFF FFFF FFFC 0000 0000 0000"
+- $"0000 0000 0000 FCFF FFFF FF81 0000 0024"
+- $"F600 0000 F5FD FFFF FF2B 0000 0000 0000"
+- $"0000 0000 0000 F5FF FFFF FFFF 8100 0000"
+- $"7A7A 0000 00FA FFFF F800 0000 0000 0000"
+- $"0000 0000 0000 00F6 FDFF FFFF FFFB 0000"
+- $"F579 0000 00FB F4F8 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0056 FFFF FFFF F800"
+- $"0000 00F6 8181 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00F8 81FE FFFF FDFA F500"
+- $"0000 2BF7 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00F5 FCFF FFFF FBF6 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00AC FFFF FFFF FC2B 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 2BFF FFFF FFFF FFFF E0FC FC81"
+- $"FAF9 FAF7 2B00 0000 0000 0000 0000 0000"
+- $"0000 0000 F6FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF ACF9 F600 0000 0000 0000"
+- $"0000 0000 00FC FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF81 F600 0000 0000"
+- $"0000 0000 0000 FAFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FE2B 0000 0000"
+- $"0000 0000 0000 0000 F8FB FCFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFD 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00F5 F7F7"
+- $"2BF7 F8FA FAFD FFFF FFFF FFFF F900 0000"
+- $"0000 0000 F7AC FFFF FCF6 0000 0000 0000"
+- $"0000 0000 0000 F5FE FFFF FFFF F900 0000"
+- $"0000 00F6 FFFF FFFB 0000 0000 2B81 F700"
+- $"0000 0000 0000 00F9 FFFF FFFF 0000 0000"
+- $"0000 002B FFFF FF2B 0000 0000 FAFB 0000"
+- $"0000 0000 00F5 F8FF FFFF FEF6 F500 0000"
+- $"0000 00F5 FEFF FFFC 0000 0000 F5FC FDFC"
+- $"ACFC ACFC FDFF FFFF FF81 F556 F500 0000"
+- $"0000 0000 F8FF FFFF FBF5 0000 0000 F6FA"
+- $"81AC FCFC FCFA 562B F5F8 FCF5 0000 0000"
+- $"0000 0000 002B FCFF FFFE FCF9 F82B 0000"
+- $"0000 0000 2BF7 FAFC FD56 0000 0000 0000"
+- $"0000 0000 0000 00F7 FAFE FFFF FFFF FFFF"
+- $"FFFF FFFF FFAC 812B 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 F52B F9F9 FAF9"
+- $"FAF8 F72B F6"
+-};
+-
+-resource 'icl4' (128, "Application Icon") {
+- $"0000 0000 0000 0000 0000 C000 0000 0000"
+- $"0000 0000 0000 0000 0000 CD00 0000 0000"
+- $"0000 0000 0000 0000 000C ECD0 0000 0000"
+- $"0000 0000 000C DDEE EEEE C0FC 0000 0000"
+- $"0000 0000 0DFF FFFF AEC0 0CFC 0000 0000"
+- $"0000 000C FFFF FEDC 0000 CEFD 0000 0000"
+- $"0000 00CA FFFA C000 000D AFFF D000 0000"
+- $"0000 00EF FFFD 000C 00DF FFFF FD00 0000"
+- $"0000 0CFF FFF0 0D0C C0EF FFFF FE00 0000"
+- $"0000 0CFF FFE0 07C0 C00E FFFF FF00 0000"
+- $"0000 00FF FFF0 0000 0000 EFFF FE00 0000"
+- $"0000 00EF FFFE 0000 C000 CAFF FC00 0000"
+- $"0000 000F FFFF D000 7D00 0DFF C000 0000"
+- $"0000 000C EFFF FE00 0D00 0EFD 0000 0000"
+- $"0000 0000 0DFF FFD0 000C DD00 0000 0000"
+- $"0000 000C EEFF AD00 00CC 0000 0000 0000"
+- $"0000 00EF FFE0 0000 0000 0000 0000 0000"
+- $"0000 0EFF FFEC 0000 0000 0000 0000 0000"
+- $"0000 CFFF FFFF FEED DDDC C000 0000 0000"
+- $"0000 CFFF FFFF FFFF FFFF FFED C000 0000"
+- $"0000 0EFF FFFF FFFF FFFF FFFF FDC0 0000"
+- $"0000 00DF FFFF FFFF FFFF FFFF FFAC 0000"
+- $"0000 0000 CEEF FFFF FFFF FFFF FFFE 0000"
+- $"0000 0000 0000 00CC CCDD DAFF FFFF D000"
+- $"0000 CEFF EC00 0000 0000 000F FFFF D000"
+- $"000C FFFE 0000 CEC0 0000 000D FFFF 0000"
+- $"000C FFFC 0000 DD00 0000 00DF FFF0 C000"
+- $"0000 FFFE 0000 0EFE EEEE FFFF FD0D 0000"
+- $"0000 CFFF E000 00CD DEEE EDDC 0DE0 0000"
+- $"0000 0CEF FFED CC00 0000 CCDD FC00 0000"
+- $"0000 000C DAFF FFFF FFFF FEEC 0000 0000"
+- $"0000 0000 000C DDDD DDCC"
+-};
+-
+-resource 'ics8' (128, "Application Icon") {
+- $"0000 0000 0000 0000 0000 2B00 0000 0000"
+- $"0000 0000 0000 2B56 F8F9 F856 0000 0000"
+- $"0000 0000 FBFF FFFB 56F5 F7FC 0000 0000"
+- $"0000 00FC FFFD F500 00F9 FFFF F900 0000"
+- $"0000 F5FF FF56 2B2A F6FB FFFF FF00 0000"
+- $"0000 00FE FFFB 00F5 0000 FBFF FC00 0000"
+- $"0000 00F8 FFFF FA00 7900 F7FD F500 0000"
+- $"0000 00F5 F9FF FDF6 00F6 F800 0000 0000"
+- $"0000 2BEA FF56 0000 0000 0000 0000 0000"
+- $"0000 81FF FFFF FEFD FCFC FAF8 0000 0000"
+- $"0000 F6FE FFFF FFFF FFFF FFFF FEF7 0000"
+- $"0000 0000 2B56 FA81 81FC FDFF FFFF F600"
+- $"0000 ACFE 2B00 2BF5 0000 00F8 FFFF F500"
+- $"00F5 FFFC 0000 FA56 56F8 F9FD FE56 F500"
+- $"0000 56E0 FBF7 F6F6 F856 56F9 56F6 0000"
+- $"0000 0000 F881 FCAC FC81 FA2B"
+-};
+-
+-resource 'ics4' (128, "Application Icon") {
+- $"0000 0000 00C0 0000 0000 00CD CDCD 0000"
+- $"0000 EFFD D0CE 0000 000E FA00 0DFF D000"
+- $"000F FDCC 0EFF F000 000F FE00 00EF E000"
+- $"000C FFD0 D0CE 0000 0000 DFF0 0CC0 0000"
+- $"00CF FD00 0000 0000 00DF FFFA EEDD 0000"
+- $"00CA FFFF FFFF FC00 0000 CDDE DEEF FFC0"
+- $"00EF C0C0 000C FF00 00FE 00DD CDDF AD00"
+- $"00DF DCC0 DCDD D000 0000 DDEE EDDC"
+-};
+-
+-resource 'icm8' (128, "Application Icon") {
+- $"0000 0000 0000 0000 0000 F800 0000 0000"
+- $"0000 0000 2BFA FBAC 8156 F681 0000 0000"
+- $"0000 00FA FFFD F7F5 0056 FDFF F800 0000"
+- $"0000 F5FF FF56 2B2A F556 FFFF FF00 0000"
+- $"0000 00FB FFFE F600 4F00 56FF F800 0000"
+- $"0000 00F5 81EA FEF5 00F6 F8F6 0000 0000"
+- $"0000 F8FF FFFA 2BF6 F600 0000 0000 0000"
+- $"0000 56FF FFFF FFFF FFFF E0FC F9F5 0000"
+- $"0000 00F6 F981 FBFC FCAC FDFF FFFD F500"
+- $"0000 FDFD F600 F700 0000 0056 FFFE F500"
+- $"0000 ACFE 2B00 F7F9 8181 FBFB 81F7 0000"
+- $"0000 00F7 FAFB FBFA FAF9 56F8 F6"
+-};
+-
+-resource 'icm4' (128, "Application Icon") {
+- $"0000 0000 00C0 0000 0000 CDEE ECCE 0000"
+- $"000D FAC0 0DEF C000 000F FD0C 0DFF F000"
+- $"000E FFC0 C0DF C000 0000 DFEC 00CC 0000"
+- $"00CF FDC0 C000 0000 00DF FFFF FFFE D000"
+- $"000C DDEE EEFF FF00 00AE C0C0 000D FEC0"
+- $"00FE C0CD DEDE DC00 000C DDED DDDC C0"
+-};
+-
+-resource 'icm#' (128, "Application Icon") {
+- { /* array: 2 elements */
+- /* [1] */
+- $"0000 0350 1C30 1C78 1C10 0620 1900 3FF8"
+- $"0B7C 300C 31B0 0720",
+- /* [2] */
+- $"0070 0FF0 1FF8 3FF8 3FF8 1FF0 3FF8 3FFC"
+- $"1FFE 7FFE 7FFE 3FF8"
+- }
+-};
+-
+-resource 'icns' (128, "Application Icon") {
+- { /* array elementArray: 20 elements */
+- /* [1] */
+- 'ICN#',
+- $"0000 0000 0000 0800 0000 0A00 000B F200"
+- $"007F 4200 00FC 0700 01F0 1F80 03E0 1F80"
+- $"03E5 3FC0 03E0 1FC0 03E0 0FC0 03F0 0780"
+- $"01F8 8300 00FC 4600 003C 0800 00F4 0000"
+- $"03E0 0000 07E0 0000 07FF 6000 07FF FF00"
+- $"07FF FFC0 01FF FFE0 007F FFF0 0000 17F0"
+- $"0780 01F8 0F04 00F0 0E08 03E0 0F07 FFD0"
+- $"0780 D820 03F0 0380 007F FC00 0005 4000"
+- $"0000 1800 0000 1E00 0000 1E00 001F FF00"
+- $"00FF FF00 01FF FF00 03FF FF80 03FF FFC0"
+- $"07FF FFC0 07FF FFC0 07FF FFC0 03FF FFC0"
+- $"03FF FF80 01FF FF00 007F FE00 03FF F000"
+- $"07FF F800 07FF FE00 0FFF FF80 0FFF FFE0"
+- $"07FF FFF0 03FF FFF8 01FF FFF8 027F FFFC"
+- $"1FFF FFFC 1FFF FFFC 1FFF FFF8 1FFF FFF8"
+- $"1FFF FFF0 07FF FFC0 01FF FF00 007F FC00",
+- /* [2] */
+- 'icl4',
+- $"0000 0000 0000 0000 0000 C000 0000 0000"
+- $"0000 0000 0000 0000 0000 CD00 0000 0000"
+- $"0000 0000 0000 0000 000C ECD0 0000 0000"
+- $"0000 0000 000C DDEE EEEE C0FC 0000 0000"
+- $"0000 0000 0DFF FFFF AEC0 0CFC 0000 0000"
+- $"0000 000C FFFF FEDC 0000 CEFD 0000 0000"
+- $"0000 00CA FFFA C000 000D AFFF D000 0000"
+- $"0000 00EF FFFD 000C 00DF FFFF FD00 0000"
+- $"0000 0CFF FFF0 0D0C C0EF FFFF FE00 0000"
+- $"0000 0CFF FFE0 07C0 C00E FFFF FF00 0000"
+- $"0000 00FF FFF0 0000 0000 EFFF FE00 0000"
+- $"0000 00EF FFFE 0000 C000 CAFF FC00 0000"
+- $"0000 000F FFFF D000 7D00 0DFF C000 0000"
+- $"0000 000C EFFF FE00 0D00 0EFD 0000 0000"
+- $"0000 0000 0DFF FFD0 000C DD00 0000 0000"
+- $"0000 000C EEFF AD00 00CC 0000 0000 0000"
+- $"0000 00EF FFE0 0000 0000 0000 0000 0000"
+- $"0000 0EFF FFEC 0000 0000 0000 0000 0000"
+- $"0000 CFFF FFFF FEED DDDC C000 0000 0000"
+- $"0000 CFFF FFFF FFFF FFFF FFED C000 0000"
+- $"0000 0EFF FFFF FFFF FFFF FFFF FDC0 0000"
+- $"0000 00DF FFFF FFFF FFFF FFFF FFAC 0000"
+- $"0000 0000 CEEF FFFF FFFF FFFF FFFE 0000"
+- $"0000 0000 0000 00CC CCDD DAFF FFFF D000"
+- $"0000 CEFF EC00 0000 0000 000F FFFF D000"
+- $"000C FFFE 0000 CEC0 0000 000D FFFF 0000"
+- $"000C FFFC 0000 DD00 0000 00DF FFF0 C000"
+- $"0000 FFFE 0000 0EFE EEEE FFFF FD0D 0000"
+- $"0000 CFFF E000 00CD DEEE EDDC 0DE0 0000"
+- $"0000 0CEF FFED CC00 0000 CCDD FC00 0000"
+- $"0000 000C DAFF FFFF FFFF FEEC 0000 0000"
+- $"0000 0000 000C DDDD DDCC 0000 0000 0000",
+- /* [3] */
+- 'icl8',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 F600 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 5656 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00F6 FCF8 F900 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F6 56F9 FCAC"
+- $"FCFC ACFE F600 FFF6 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F5FA FDFF FFFF FFFF"
+- $"FD81 F800 00F7 FFF7 0000 0000 0000 0000"
+- $"0000 0000 0000 00F6 E0FF FFFF FFFD F92B"
+- $"0000 0000 F6AC FFFA 0000 0000 0000 0000"
+- $"0000 0000 0000 2BFF EAFF FFFE F700 0000"
+- $"0000 0056 FFFF FFFF 8100 0000 0000 0000"
+- $"0000 0000 0000 FCFF FFFF FF56 0000 00F5"
+- $"F500 FAFF FFFF FFFF FFF8 0000 0000 0000"
+- $"0000 0000 00F6 FFFF FFFF FE00 0079 0055"
+- $"F600 FBFF FFFF FFFF FFFD 0000 0000 0000"
+- $"0000 0000 002B FFFF FFFF FC00 007A F6F5"
+- $"4F00 00AC FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 00F6 FFFF FFFF FFF5 0000 F500"
+- $"0000 00F5 ACFF FFFF FFFC 0000 0000 0000"
+- $"0000 0000 0000 FCFF FFFF FF81 0000 0024"
+- $"F600 0000 F5FD FFFF FF2B 0000 0000 0000"
+- $"0000 0000 0000 F5FF FFFF FFFF 8100 0000"
+- $"7A7A 0000 00FA FFFF F800 0000 0000 0000"
+- $"0000 0000 0000 00F6 FDFF FFFF FFFB 0000"
+- $"F579 0000 00FB F4F8 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0056 FFFF FFFF F800"
+- $"0000 00F6 8181 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00F8 81FE FFFF FDFA F500"
+- $"0000 2BF7 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00F5 FCFF FFFF FBF6 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00AC FFFF FFFF FC2B 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 2BFF FFFF FFFF FFFF E0FC FC81"
+- $"FAF9 FAF7 2B00 0000 0000 0000 0000 0000"
+- $"0000 0000 F6FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF ACF9 F600 0000 0000 0000"
+- $"0000 0000 00FC FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF81 F600 0000 0000"
+- $"0000 0000 0000 FAFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FE2B 0000 0000"
+- $"0000 0000 0000 0000 F8FB FCFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFD 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00F5 F7F7"
+- $"2BF7 F8FA FAFD FFFF FFFF FFFF F900 0000"
+- $"0000 0000 F7AC FFFF FCF6 0000 0000 0000"
+- $"0000 0000 0000 F5FE FFFF FFFF F900 0000"
+- $"0000 00F6 FFFF FFFB 0000 0000 2B81 F700"
+- $"0000 0000 0000 00F9 FFFF FFFF 0000 0000"
+- $"0000 002B FFFF FF2B 0000 0000 FAFB 0000"
+- $"0000 0000 00F5 F8FF FFFF FEF6 F500 0000"
+- $"0000 00F5 FEFF FFFC 0000 0000 F5FC FDFC"
+- $"ACFC ACFC FDFF FFFF FF81 F556 F500 0000"
+- $"0000 0000 F8FF FFFF FBF5 0000 0000 F6FA"
+- $"81AC FCFC FCFA 562B F5F8 FCF5 0000 0000"
+- $"0000 0000 002B FCFF FFFE FCF9 F82B 0000"
+- $"0000 0000 2BF7 FAFC FD56 0000 0000 0000"
+- $"0000 0000 0000 00F7 FAFE FFFF FFFF FFFF"
+- $"FFFF FFFF FFAC 812B 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 F52B F9F9 FAF9"
+- $"FAF8 F72B F600 0000 0000 0000 0000 0000",
+- /* [4] */
+- 'il32',
+- $"91FF 00DF 9CFF 01A0 909A FF03 D350 AF80"
+- $"91FF 02CF A080 8140 0538 24D5 FF00 DF8D"
+- $"FF02 EF80 2081 0008 0420 60A2 FFFF BF00"
+- $"BF8C FF01 CF10 8100 022C 86BF 81FF 03DF"
+- $"3000 728B FF01 CF10 8000 0110 B083 FF01"
+- $"9410 8000 0066 8AFF 0040 8100 00A2 80FF"
+- $"03E5 E3FF 7C83 0000 A088 FF00 DF81 0008"
+- $"10FF FF82 FF91 C7FF 6083 0000 3088 FF00"
+- $"BF81 0009 40FF FF66 E3D5 BAFF F330 8300"
+- $"88FF 00DF 8200 03EF FFF1 E381 FF01 EF30"
+- $"8100 0044 89FF 004C 8100 006C 80FF 01F1"
+- $"C780 FF05 EF20 0000 04C5 89FF 01DF 1081"
+- $"0000 6C80 FF01 7458 80FF 0380 0000 A08B"
+- $"FF01 D120 8100 0460 FFFF E382 80FF 0254"
+- $"10A2 8EFF 0192 0280 0000 A081 FF03 DB64"
+- $"60EF 8DFF 07AF 6412 0204 2080 EF80 FF01"
+- $"CFBB 8EFF 01EF 4480 0001 50CF 96FF 0040"
+- $"8100 0150 CF95 FF00 CF84 0003 1040 4268"
+- $"8080 01BF D18C FF01 CF02 8D00 0238 92DF"
+- $"89FF 0044 8F00 0204 62DF 88FF 0070 9000"
+- $"0110 CF89 FF02 A060 408D 0001 22EF 8DFF"
+- $"00DF 81BF 04A0 8070 2002 8200 0090 84FF"
+- $"05B4 3600 0046 DB89 FF01 DF20 8100 0090"
+- $"83FF 00DF 8000 0058 81FF 02CF 68BF 85FF"
+- $"0080 8000 0110 EF83 FF00 BF80 0000 BF81"
+- $"FF01 705A 84FF 07EF A410 0000 10CF EF83"
+- $"FF04 EF10 0000 5281 FF02 EF42 2082 4000"
+- $"2681 0003 68E7 96EF 84FF 05A2 0200 0052"
+- $"EF81 FF02 D380 6080 4007 4480 90BF EFA4"
+- $"54EF 86FF 08C3 4000 0010 5080 AFCF 83FF"
+- $"05CF AF80 4C24 A28A FF02 BF70 2086 0004"
+- $"0400 3260 C38F FF02 EFBF 9081 8003 A0BF"
+- $"C7DF 88FF 91FF 00DE 9BFF 02FE A090 9AFF"
+- $"03D3 50AF 8091 FF02 CFA0 8081 4005 3824"
+- $"D4FF 00DF 8DFF 02EF 8020 8100 0804 2060"
+- $"A2FF FFBF 00BF 8CFF 01CF 1081 0002 2C85"
+- $"BF81 FF03 DF30 0072 8BFF 01CF 1080 0001"
+- $"10B0 83FF 0194 1080 0000 668A FF00 4081"
+- $"0000 A280 FF03 ECEB FF7C 8300 00A0 88FF"
+- $"00DF 8100 0810 FFFF A6FF B1D7 FF60 8300"
+- $"002F 88FF 00BF 8100 0940 FFFF 92EB E1CE"
+- $"FFF2 3083 0088 FF00 DE82 0003 EFFF F5EB"
+- $"81FF 01EF 3081 0000 4489 FF00 4C81 0000"
+- $"6B80 FF01 F5D7 80FF 05EF 2000 0004 C589"
+- $"FF01 DF10 8100 006B 80FF 019C 8780 FF03"
+- $"8000 00A0 8BFF 01D1 2081 0004 60FF FFEB"
+- $"A680 FF02 5410 A28E FF01 9202 8000 00A0"
+- $"81FF 03DB 6360 EF8D FF07 AF64 1202 0420"
+- $"80EF 80FF 01CF BB8E FF01 EF44 8000 0150"
+- $"CF96 FF00 3F81 0001 50CF 95FF 00CF 8400"
+- $"0310 4042 6880 8001 BFD1 8CFF 01CF 028D"
+- $"0002 3892 DF89 FF00 448F 0002 0462 DF88"
+- $"FF00 7090 0001 10CF 89FF 02A0 6040 8D00"
+- $"0122 EF8D FF00 DF81 BF04 9F80 7020 0282"
+- $"0000 9084 FF05 B336 0000 46DB 89FF 01DF"
+- $"2081 0000 9083 FF00 DF80 0000 5881 FF04"
+- $"CF68 BFFE FE83 FF00 8080 0001 10EF 83FF"
+- $"00BF 8000 00BF 81FF 0170 5A84 FF07 EFA4"
+- $"1000 0010 CFEE 83FF 04EF 1000 0052 81FF"
+- $"08EF 4220 4040 3F3F 4026 8100 0368 E795"
+- $"EF84 FF05 A102 0000 52EF 81FF 0DD3 8060"
+- $"403F 3F43 8090 BFEF A354 EF86 FF08 C340"
+- $"0000 1050 80AF CF82 FF06 FECF AF7F 4C24"
+- $"A28A FF02 BF70 2086 0004 0400 3260 C38F"
+- $"FF02 EFBF 9081 8003 A0BF C7DF 88FF 90FF"
+- $"01FE DC9B FF03 FCA0 90FE 99FF 03D3 50AF"
+- $"8091 FF02 CFA0 7F81 4005 3C24 D8FF 00DF"
+- $"8DFF 02ED 8020 8100 0804 1E60 A4FF FFBF"
+- $"00BF 8CFF 01CF 0F81 0003 2C80 BEFD 80FF"
+- $"03DF 3000 748B FF01 CF10 8000 0110 B082"
+- $"FF02 FE94 1080 0000 6C8A FF00 4081 0000"
+- $"A480 FF03 F0EF FF7C 8300 00A0 88FF 00DE"
+- $"8100 0810 FFFF B8FF C2DF FF5F 8300 002E"
+- $"88FF 00BF 8100 0940 FFFF A7ED E7D8 FFF0"
+- $"2F83 0088 FF00 DC82 0003 EFFF F6EE 81FF"
+- $"01EE 3081 0000 4489 FF00 4C81 000E 6AFD"
+- $"FFFF F6DE FDFF FFEF 2000 0008 C589 FF01"
+- $"DE10 8100 056A FFFF FEAF 9E80 FF03 8000"
+- $"00A0 8BFF 01D2 2081 0004 60FF FFEF B880"
+- $"FF02 5410 A48E FF01 9404 8000 00A0 81FF"
+- $"03DB 645F EF8C FF08 FDAF 6414 0404 1F80"
+- $"EE80 FF01 CEBB 8EFF 01EF 4680 0002 50CE"
+- $"FE95 FF00 3E81 0001 4ECE 95FF 00CD 8400"
+- $"0310 4044 6880 8001 BFD2 8CFF 01CF 048D"
+- $"0002 3894 DF89 FF00 478F 0002 0464 DF88"
+- $"FF00 6F90 0001 10CF 88FF 03FE A060 408D"
+- $"0001 23ED 86FF 00FE 83FF 00DF 81BF 049C"
+- $"8070 2004 8200 0090 83FF 07FE B23C 0000"
+- $"48DA FD88 FF01 DF20 8100 0090 83FF 00DF"
+- $"8000 0057 81FF 04CF 70BF FCFC 82FF 01FE"
+- $"8080 0001 10ED 83FF 00BF 8000 00BF 81FF"
+- $"0270 58FD 83FF 07EF A410 0000 10CF EC83"
+- $"FF04 EF10 0000 5481 FF08 ED44 2040 403D"
+- $"3D40 2881 0003 68E7 9AEF 83FF 06FE A304"
+- $"0000 53EF 81FF 0DD2 8060 3E3C 3C45 8090"
+- $"BEEE A357 EF86 FF14 C240 0000 1050 80AF"
+- $"CFFF FDFF FFFE FCCF AF7A 4C24 A48A FF02"
+- $"BE70 1E86 0004 0800 3460 C78E FF03 FDEF"
+- $"BF90 8180 04A0 BFCA DFFD 87FF",
+- /* [5] */
+- 'l8mk',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0005 FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0005 FFFF 0500 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 05FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0005 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0500 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 0005 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0005 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
+- $"FFFF FFFF FF05 0000 0000 0000 0000 0000",
+- /* [6] */
+- 'ich#',
+- $"0000 0000 0000 0000 0001 0000 0000 0002"
+- $"8000 0000 0002 4000 0000 000C 4000 0000"
+- $"1FFC 6000 0001 FFE0 6000 0007 FF00 E000"
+- $"000F F801 F000 003F E003 F800 003F 800F"
+- $"FC00 007F 800F FC00 007F 091F FE00 007F"
+- $"010F FE00 00FF 0887 FE00 007F 8003 FE00"
+- $"007F 8001 FC00 003F C000 FC00 003F E0C0"
+- $"F000 001F F020 7000 000F F840 C000 0001"
+- $"F801 8000 0003 FC0E 0000 000F F000 0000"
+- $"007F 0000 0000 007E 0000 0000 00FF 8000"
+- $"0000 01FF F690 0000 01FF FFFF 0000 01FF"
+- $"FFFF F000 00FF FFFF FC00 007F FFFF FF00"
+- $"003F FFFF FF80 0007 FFFF FFC0 0000 5FFF"
+- $"FFC0 0000 0001 FFE0 01FC 0000 1FE0 03F0"
+- $"0000 1FC0 03E0 1800 1FC0 03E0 3000 1F80"
+- $"07E0 1801 FF00 03F0 0FFF FC40 01F8 02FF"
+- $"4100 00FC 0000 0E00 007F C000 F800 000F"
+- $"FFFF C000 0001 FFFE 0000 0000 0480 0000"
+- $"0000 0006 0000 0000 0007 4000 0000 0007"
+- $"8000 0000 0007 C000 0000 100F E000 0000"
+- $"7FFF E000 0003 FFFF E000 000F FFFF E000"
+- $"001F FFFF F000 003F FFFF F800 007F FFFF"
+- $"FC00 007F FFFF FE00 00FF FFFF FE00 00FF"
+- $"FFFF FE00 00FF FFFF FE00 00FF FFFF FE00"
+- $"00FF FFFF FE00 007F FFFF FC00 007F FFFF"
+- $"F800 001F FFFF F000 001F FFFF F000 0007"
+- $"FFFF C000 0003 FFFE 0000 007F FFFC 0000"
+- $"007F FFFE 0000 00FF FFFF 8000 01FF FFFF"
+- $"C000 03FF FFFF F800 01FF FFFF FC00 01FF"
+- $"FFFF FF00 01FF FFFF FF80 00FF FFFF FFC0"
+- $"007F FFFF FFE0 001F FFFF FFF0 0000 FFFF"
+- $"FFF0 0043 FFFF FFF0 03FF FFFF FFF0 07FF"
+- $"FFFF FFF0 07FF FFFF FFF0 07FF FFFF FFE0"
+- $"07FF FFFF FFE0 03FF FFFF FFC0 07FF FFFF"
+- $"FF80 01FF FFFF FF00 01FF FFFF FE00 001F"
+- $"FFFF F000 0007 FFFF 8000 0000 3FE4 0000",
+- /* [7] */
+- 'ich4',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00CE 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00DC"
+- $"D000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00F0 DD00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 DAE0"
+- $"CFC0 0000 0000 0000 0000 0000 0000 0000"
+- $"0CDE EFFF FFFF FE00 0FA0 0000 0000 0000"
+- $"0000 0000 0000 00DE FFFF FFFF FFED C000"
+- $"CFF0 0000 0000 0000 0000 0000 0000 CFFF"
+- $"FFFF FFFF C000 0000 EFF0 0000 0000 0000"
+- $"0000 0000 000C FFFF FFFF ECC0 0000 000D"
+- $"FFFD 0000 0000 0000 0000 0000 00DF FFFF"
+- $"FFD0 0000 0000 0CFF FFFF E000 0000 0000"
+- $"0000 0000 0CFF FFFF FD00 0000 0000 EFFF"
+- $"FFFF FE00 0000 0000 0000 0000 0AFF FFFF"
+- $"F000 0000 C00D FFFF FFFF FFC0 0000 0000"
+- $"0000 0000 CFFF FFFF D000 D00D C00D FFFF"
+- $"FFFF FFE0 0000 0000 0000 0000 CFFF FFFF"
+- $"0000 9007 C00C FFFF FFFF FFF0 0000 0000"
+- $"0000 0000 CFFF FFFF 0000 7C00 C000 CAFF"
+- $"FFFF FFF0 0000 0000 0000 0000 CFFF FFFF"
+- $"D000 0C00 0000 00FF FFFF FFE0 0000 0000"
+- $"0000 0000 0FFF FFFF F000 0000 0000 000F"
+- $"FFFF FFC0 0000 0000 0000 0000 0DFF FFFF"
+- $"FD00 0000 CC00 000C FFFF FE00 0000 0000"
+- $"0000 0000 00AF FFFF FFD0 0000 7DD0 0000"
+- $"EFFF E000 0000 0000 0000 0000 000E FFFF"
+- $"FFFE 0000 0690 0000 DFFE 0000 0000 0000"
+- $"0000 0000 000C EFFF FFFF E000 0CC0 000C"
+- $"FFDC 0000 0000 0000 0000 0000 0000 0CDF"
+- $"FFFF FD00 0000 00DF E000 0000 0000 0000"
+- $"0000 0000 0000 00EF FFFF FD00 0000 DED0"
+- $"0000 0000 0000 0000 0000 0000 00CD EFFF"
+- $"FFAE C000 000C C000 0000 0000 0000 0000"
+- $"0000 0000 0DFF FFFE DC00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 DFFF FFFD"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 000C FFFF FFFE DC00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 000E FFFF FFFF"
+- $"FFFE EDED CCDC C000 0000 0000 0000 0000"
+- $"0000 000F FFFF FFFF FFFF FFFF FFFF FFFD"
+- $"DC00 0000 0000 0000 0000 000E FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFED C000 0000 0000"
+- $"0000 000C FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FED0 0000 0000 0000 0000 CFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFA 0000 0000"
+- $"0000 0000 0CAF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF EC00 0000 0000 0000 0000 DEAF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FE00 0000"
+- $"0000 0000 0000 0000 CDDD EFFF FFFF FFFF"
+- $"FFFF FFFF FFC0 0000 0000 0000 0000 0000"
+- $"0000 0000 000C CCDD FFFF FFFF FFE0 0000"
+- $"0000 00CD EFFF FDC0 0000 0000 0000 0000"
+- $"00DF FFFF FFE0 0000 0000 00EF FFFF C000"
+- $"0000 0000 0000 0000 000A FFFF FFC0 0000"
+- $"0000 0CFF FFFC 0000 000F ECC0 0000 0000"
+- $"000E FFFF FF00 0000 0000 0CFF FFF0 0000"
+- $"00DF D000 0000 0000 0CDF FFFF A000 0000"
+- $"0000 0DFF FFFC 0000 00CF AC00 0000 00CD"
+- $"EAFF FFFE 0CC0 0000 0000 00AF FFFE 0000"
+- $"0000 EFFF FFFF FFFF FFFF FED0 CD00 0000"
+- $"0000 00CF FFFF E000 0000 0CDE EFFF FFFE"
+- $"EDDC 00CE D000 0000 0000 000C FFFF FFC0"
+- $"0000 0000 0000 0000 000C DFFC 0000 0000"
+- $"0000 0000 0DFF FFFF EEDC C000 0000 00CC"
+- $"DEEA FD00 0000 0000 0000 0000 000C EFFF"
+- $"FFFF FFFF FFFF FFFF FFDC 0000 0000 0000"
+- $"0000 0000 0000 00CD FFFF FFFF FFFF FEFD"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00CC CCDC CD00 0000 0000 0000 0000 0000",
+- /* [8] */
+- 'ich8',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 F6AC"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 81F6"
+- $"FA00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00F5 FF00"
+- $"5681 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 FAAC 8100"
+- $"2BFF 2B00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00F8 F9FB FBFF FFFF FFFF FFFE FFAC F500"
+- $"00FF FD00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 F9AC"
+- $"FFFF FFFF FFFF FFFF FFFF ACFA F600 0000"
+- $"2BFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 F8FF FFFF"
+- $"FFFF FFFF FFFF FFFF F800 0000 0000 0000"
+- $"FBFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F8 FFFF FFFF"
+- $"FFFF FFFF FBF7 F600 0000 0000 0000 F5FA"
+- $"FFFF FFFA 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 F9FF FFFF FFFF"
+- $"FFFF FA00 0000 0000 0000 0000 00F8 FEFF"
+- $"FFFF FFFF 8100 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00F8 FFFF FFFF FFFF"
+- $"FFF9 0000 0000 0000 0000 0000 FCFF FFFF"
+- $"FFFF FFFF FFFC 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00AC FFFF FFFF FFFF"
+- $"FFF6 0000 0000 00F6 F600 00F9 FFFF FFFF"
+- $"FFFF FFFF FFFF 2B00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F5FF FFFF FFFF FFFF"
+- $"F900 0000 7A00 007A 4F00 00FA FFFF FFFF"
+- $"FFFF FFFF FFFF FB00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
+- $"0000 0000 C800 0079 2B00 00F6 FEFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
+- $"0000 0000 A5F6 00F5 5500 0000 F6FE FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 2BFF FFFF FFFF FFFF"
+- $"FA00 0000 F52A 0000 0000 0000 00F5 FEFF"
+- $"FFFF FFFF FFFF FC00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 F6FF"
+- $"FFFF FFFF FFFF F800 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00F9 FFFF FFFF FFFF"
+- $"FF81 0000 0000 00F5 4FF5 0000 0000 00F6"
+- $"FFFF FFFF FFFC 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FDFF FFFF FFFF"
+- $"FFFF 8100 0000 0000 55C9 5500 0000 0000"
+- $"FBFF FFFF FB00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00AC FFFF FFFF"
+- $"FFFF FFAC 0000 0000 25A4 C900 0000 0000"
+- $"FBFF FFFD 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F5 ACFF FFFF"
+- $"FFFF FFFF FB00 0000 0055 2B00 0000 00F6"
+- $"FEFF 81F5 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00F6 FAFF"
+- $"FFFF FFFF FFF9 0000 0000 0000 0000 F9FF"
+- $"ACF5 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 FBFE"
+- $"FFFF FFFF FFF9 0000 0000 0000 FAFC F900"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 2B56 ACFF FFFF"
+- $"FFFF FEFB 2B00 0000 0000 00F6 F800 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FA FFFF FFFF FFFD"
+- $"F92B 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FAFF FFFF FFFF FFF8"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00F6 FFFF FFFF FFFF FFFE"
+- $"F92B 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FD FFFF FFFF FFFF FFFF"
+- $"FFFF FFFB FBFB FB56 F8F8 F8F8 F600 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFF9"
+- $"FAF6 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00AC FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF AC81 2B00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00F6 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFAC 5600 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFD 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00F8 FDFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FDF5 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 56FB FEFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFAC 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"2BFA F9FA FDFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF F800 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F5 F8F8 F8FB"
+- $"FDFF FFFF FFFF FFFF FFFF FB00 0000 0000"
+- $"0000 0000 0000 F5FA FCFF FFFF FFFA F500"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00F5 FAFF FFFF FFFF FFFF FB00 0000 0000"
+- $"0000 0000 0000 ACFF FFFF FFFF F600 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FD FFFF FFFF FFFF F800 0000 0000"
+- $"0000 0000 002B FFFF FFFF FF56 0000 0000"
+- $"0000 F5FD FCF8 F600 0000 0000 0000 0000"
+- $"0000 00FB FFFF FFFF FFFE 0000 0000 0000"
+- $"0000 0000 00F8 FFFF FFFF FF00 0000 0000"
+- $"0000 F9FF 5600 0000 0000 0000 0000 0000"
+- $"00F6 F9FF FFFF FFFF FDF5 0000 0000 0000"
+- $"0000 0000 00F8 FFFF FFFF FFF6 0000 0000"
+- $"0000 F6FF FFF8 0000 0000 0000 0000 F6F9"
+- $"FBFF FFFF FFFF FFFC 00F6 F800 0000 0000"
+- $"0000 0000 0000 FEFF FFFF FFFB 0000 0000"
+- $"0000 00F6 FCFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFD 5600 F6FA 0000 0000 0000"
+- $"0000 0000 0000 F7FF FFFF FFFF FBF6 0000"
+- $"0000 0000 002B FAFB ACFF FFFF FFFF FFAC"
+- $"FBFB F8F8 0000 F6AC FA00 0000 0000 0000"
+- $"0000 0000 0000 002B FFFF FFFF FFFF F800"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00F6 F9FF FFF8 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 F581 FFFF FFFF FFFF"
+- $"FBFB F9F8 2B00 0000 0000 0000 0000 2BF8"
+- $"F9FB FBFF FDF9 F500 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00F9 FBFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFE 812B 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 F8FA"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFD FDF9"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 2BF8 F8F8 F8F8 F8F8 F500 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000",
+- /* [9] */
+- 'ih32',
+- $"CBFF 01D5 40AB FF02 71D5 71A9 FF04 E300"
+- $"FF8E 71A7 FF06 8035 60FF D500 C09B FF03"
+- $"AA8E 5555 8300 070E 0B39 E6FF FF00 2B98"
+- $"FF01 8E39 8700 0239 75D5 80FF 02C6 0000"
+- $"96FF 00AA 8700 010B AA84 FF02 5500 0095"
+- $"FF00 AA85 0002 4EB5 D584 FF01 E380 8000"
+- $"0075 93FF 0080 8400 0071 87FF 01AA 1C82"
+- $"0000 6091 FF00 AA84 0000 8087 FF00 5085"
+- $"0000 4090 FF00 3983 0001 06E3 82FF 04D0"
+- $"CDFF FF87 8700 00C6 8EFF 00E3 8400 0080"
+- $"80FF 076A FFFF 6DB5 FFFF 7187 0000 558E"
+- $"FF00 AA84 0081 FF08 20FF FF6A B5FF FFD5"
+- $"1087 008E FF00 AA84 0081 FF04 39CD FFE6"
+- $"9C80 FF01 D51C 8600 8EFF 00C6 8400 0080"
+- $"80FF 01E6 CE84 FF01 E31C 8400 0040 8FFF"
+- $"000B 8400 8AFF 00D5 8400 00AA 8FFF 007F"
+- $"8400 006A 82FF 02E6 B5DA 82FF 00D5 8200"
+- $"0045 91FF 002B 8400 006A 82FF 0283 2083"
+- $"82FF 0055 8000 0055 93FF 002B 8400 0040"
+- $"81FF 02DA 2020 82FF 0355 0000 2B94 FF01"
+- $"E639 8400 0055 81FF 0190 B581 FF04 D523"
+- $"005B E396 FF01 D571 8300 008E 85FF 0391"
+- $"0639 E399 FF01 600B 8200 0080 83FF 0280"
+- $"4080 98FF 02D5 8E40 8100 0307 1C55 C683"
+- $"FF01 E3AA 99FF 0079 8200 021C 80C6 A3FF"
+- $"0080 8300 00AA A4FF 00D5 8400 021C 80C6"
+- $"A2FF 002B 8800 8055 015B 9C81 AA00 D597"
+- $"FF94 0003 0580 80D5 92FF 0030 9600 0307"
+- $"3575 C68F FF01 DA04 9900 0135 918E FF00"
+- $"AA9B 0000 2B8E FF01 AA2B 9A00 012B E38F"
+- $"FF02 8E55 1C97 0000 3C93 FF00 C080 8000"
+- $"2B92 0000 AA9D FF00 E380 AA02 551C 0485"
+- $"0000 5588 FF02 E380 4380 0002 0B6B EA8F"
+- $"FF01 E380 8400 0055 88FF 0035 8200 00D5"
+- $"93FF 002B 8300 00AA 87FF 00C6 8200 009C"
+- $"83FF 04E3 2B47 AAD5 89FF 0055 8200 001C"
+- $"88FF 00AA 8200 84FF 028E 0098 89FF 01E3"
+- $"8082 0001 2BE3 88FF 00AA 8200 00DA 83FF"
+- $"03D5 000B AA85 FF03 DF88 550B 8200 0340"
+- $"FFD5 AA88 FF00 1C81 0000 5584 FF01 D53C"
+- $"8D00 042B 9CFF DA78 89FF 00AE 8200 0155"
+- $"DA84 FF03 CD80 5539 8300 0935 5555 AAAA"
+- $"FFFF CD40 808B FF01 C80B 8200 00AA 91FF"
+- $"04DF 8000 05AA 8DFF 01E3 7183 0004 5555"
+- $"8EAA C686 FF08 C6AA 8E55 550E 2380 E391"
+- $"FF01 8E55 9000 0304 1C60 C697 FF01 AA80"
+- $"8A00 0220 2B80 9FFF 00C6 84AA 00E3 92FF"
+- $"CAFF 04FE D340 FFFE A9FF 0271 D571 A9FF"
+- $"04E3 00FF 8E71 9EFF 00FE 85FF 0680 355F"
+- $"FFD5 00C0 9BFF 03AA 8E55 5583 0007 0E0B"
+- $"39E5 FFFF 002B 98FF 018E 3987 0002 3975"
+- $"D580 FF02 C600 0096 FF00 A887 0002 0BA9"
+- $"FD83 FF02 5500 0095 FF00 AA85 0002 4EB3"
+- $"D484 FF01 E380 8000 0075 93FF 0080 8400"
+- $"0071 87FF 01AA 1C82 0000 6091 FF00 AA84"
+- $"0000 8087 FF00 4F85 0000 4090 FF00 3983"
+- $"0001 06E3 82FF 04DC DCFF FF87 8700 00C6"
+- $"8EFF 00E2 8400 0080 80FF 0795 FFFF 97CA"
+- $"FFFF 7187 0000 548E FF00 AA84 0081 FF08"
+- $"60FE FF95 CAFF FFD3 1087 008E FF00 AA84"
+- $"0081 FF09 72DC FFED B8FF FFFE D41C 8600"
+- $"8EFF 00C6 8400 0080 80FF 01ED DB84 FF01"
+- $"E31C 8400 0040 8EFF 01FE 0B84 008A FF00"
+- $"D584 0000 A98F FF00 7F84 0001 69FE 81FF"
+- $"03ED C9E5 FE81 FF00 D582 0000 4591 FF00"
+- $"2B84 0000 6982 FF02 A660 A682 FF00 5580"
+- $"0000 5593 FF00 2B84 0000 4081 FF02 E560"
+- $"6082 FF03 5500 002B 94FF 01E6 3984 0000"
+- $"5581 FF01 B0CA 81FF 04D5 2300 5BE3 96FF"
+- $"01D5 7183 0000 8E85 FF03 8F06 38E3 99FF"
+- $"0160 0B82 0000 8083 FF02 8040 8097 FF03"
+- $"FED4 8E40 8100 0307 1C55 C683 FF01 E2AA"
+- $"99FF 0077 8200 021C 7FC6 A3FF 0080 8300"
+- $"00AA A4FF 00D3 8400 021C 7FC6 A2FF 002A"
+- $"8800 8055 015B 9C81 AA02 D5FF FE95 FF94"
+- $"0003 0580 80D5 92FF 0030 9600 0307 3575"
+- $"C68F FF01 D904 9900 0135 918E FF00 AA9B"
+- $"0000 2B8E FF01 AA2B 9A00 012B E38F FF02"
+- $"8E55 1C97 0000 3C93 FF00 C080 8000 2B92"
+- $"0000 A99D FF00 E180 AA02 551C 0485 0000"
+- $"5588 FF02 E280 4380 0003 0B6B E9FE 8EFF"
+- $"01E3 8084 0000 5587 FF01 FE35 8200 00D5"
+- $"87FF 01FE FE87 FF00 2B83 0000 AA87 FF00"
+- $"C682 0000 9C83 FF06 E32B 47AA D5FE FE87"
+- $"FF00 5582 0001 1CFE 87FF 00AA 8200 84FF"
+- $"028E 0098 89FF 01E3 8082 0002 2BE3 FE87"
+- $"FF00 AA82 0000 DA83 FF03 D500 0BAA 81FF"
+- $"07FD FDFF FFDF 8855 0B82 0003 40FF D5AA"
+- $"88FF 001C 8100 0055 83FF 02FE D53C 8D00"
+- $"042B 9CFF D978 89FF 00AD 8200 0155 D984"
+- $"FF03 CD7F 5539 8300 0935 5555 AAAA FFFF"
+- $"CD40 808B FF01 C70B 8200 00AA 88FF 00FE"
+- $"81FD 08FF FFFE FEDF 8000 05AA 8DFF 01E3"
+- $"7183 0007 5555 8EAA C6FF FFFE 81FF 0AFE"
+- $"FEC6 AA8E 5455 0E23 80E3 91FF 018D 5590"
+- $"0003 041C 60C6 96FF 02FD A980 8A00 0320"
+- $"2B7F FE9E FF00 C684 AA03 E3FF FFFE 8FFF"
+- $"9AFF 01FD FDAB FF04 FAD0 40FF FDA8 FF03"
+- $"FD71 D571 A9FF 04E3 00FF 8E71 9EFF 00FC"
+- $"85FF 0680 3568 FFD5 00C0 9BFF 03AA 8E55"
+- $"5583 0007 150B 39E5 FFFF 002B 98FF 018E"
+- $"3987 0002 3978 D580 FF02 C600 0096 FF00"
+- $"A387 0002 0BA5 F883 FF02 5500 0095 FF00"
+- $"AA85 0003 4EAA D2FD 83FF 01E3 8080 0000"
+- $"7893 FF00 8084 0000 7187 FF01 AA1C 8200"
+- $"006A 91FF 00AA 8400 0080 87FF 004C 8500"
+- $"0040 90FF 0039 8300 010B E382 FF04 E4E3"
+- $"FFFF 8787 0000 C68E FF00 DF84 0000 8080"
+- $"FF07 AAFF FFAE D5FF FF70 8700 0052 8EFF"
+- $"00AA 8400 81FF 0880 FAFF AAD5 FFFF D010"
+- $"8700 8EFF 00AA 8400 80FF 0AFD 8EE3 FFEF"
+- $"C6FF FFFC D21C 8600 8EFF 00C3 8400 0080"
+- $"80FF 01EF E183 FF02 FDE3 1C84 0000 408E"
+- $"FF01 FA0B 8400 8AFF 00D5 8400 00A8 8FFF"
+- $"007F 8400 0167 FC81 FF03 EFD2 EAFC 81FF"
+- $"00D5 8200 0053 90FF 01FD 2B84 0000 6781"
+- $"FF03 FDB7 80B5 82FF 0055 8000 0055 93FF"
+- $"002B 8400 0040 81FF 02EA 8080 82FF 0355"
+- $"0000 2B94 FF01 E839 8400 0055 81FF 01C0"
+- $"D581 FF04 D523 0060 E396 FF01 D571 8300"
+- $"008E 85FF 038E 0B37 E399 FF01 6B15 8200"
+- $"0080 83FF 0280 4080 97FF 03FC D28E 4081"
+- $"0004 071C 53C6 FD82 FF02 E1AA FD98 FF00"
+- $"7C82 0004 1C7D C6FF FDA1 FF00 8083 0000"
+- $"AAA4 FF00 D084 0002 1B7D C5A1 FF01 FD28"
+- $"8800 8055 0160 9C81 AA02 D5FF FC95 FF94"
+- $"0003 0B80 80D5 92FF 0035 9600 0307 3578"
+- $"C68F FF01 DD07 9900 0135 958E FF00 AA9B"
+- $"0000 2B8E FF01 A82B 9A00 012B E38E FF03"
+- $"FD8E 551C 9700 013E FD92 FF00 C080 8000"
+- $"2B92 0000 A88B FF00 FD8E FF00 DC80 AA02"
+- $"551C 0785 0000 5588 FF02 E180 4E80 0003"
+- $"0E6B E6FC 8EFF 01E3 8084 0000 5587 FF01"
+- $"FD33 8200 00D5 87FF 01FD FD87 FF00 2B83"
+- $"0000 AA87 FF00 C682 0000 9A83 FF06 E32B"
+- $"55AA D5FC FC85 FF02 FDFF 5582 0001 1CFC"
+- $"87FF 00AA 8200 84FF 038E 0095 FD88 FF01"
+- $"E380 8200 022B E3FA 87FF 00AA 8200 00DF"
+- $"83FF 03D5 000B A881 FF07 F8F8 FFFF DF90"
+- $"550B 8200 0340 FFD5 AA88 FF00 1C81 0000"
+- $"5583 FF02 FCD5 408D 0004 2B9C FFDD 7E88"
+- $"FF01 FDAF 8200 0155 DD84 FF03 CD7D 5539"
+- $"8300 0940 5555 A8AA FDFD CD47 808B FF01"
+- $"CC0B 8200 00AA 88FF 00FA 81F8 08FF FFFA"
+- $"FCDF 8000 0BA8 8CFF 02FD E371 8300 0755"
+- $"558E AAC6 FFFF FC81 FF0A FAFC C6AA 8E52"
+- $"530E 2380 E391 FF01 8C55 9000 0307 1C6B"
+- $"C696 FF02 F8A5 808A 0003 352B 7CFD 9EFF"
+- $"00C6 84AA 03E3 FFFF FC8F FF",
+- /* [10] */
+- 'h8mk',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 0500"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 FFFF"
+- $"0005 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0005 0000 0000 0000 0000 FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 05FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00DB FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF05 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 05FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 0000 0000 0005 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0005 0000 0000 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0005 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0005 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0005 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"0500 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FF00 0005 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000",
+- /* [11] */
+- 'ics#',
+- $"0000 00A0 0F10 1C78 1878 1C18 0E20 0600"
+- $"1800 3FD0 1FF8 057C 300C 3358 18A8 0340"
+- $"0070 07F0 1FF0 1FF8 3FF8 3FF8 1FF8 1FF0"
+- $"3FF0 3FFC 3FFE 1FFE 7FFE 7FFE 7FFC 1FF0",
+- /* [12] */
+- 'ics4',
+- $"0000 0000 00C0 0000 0000 00CD CDCD 0000"
+- $"0000 EFFD D0CE 0000 000E FA00 0DFF D000"
+- $"000F FDCC 0EFF F000 000F FE00 00EF E000"
+- $"000C FFD0 D0CE 0000 0000 DFF0 0CC0 0000"
+- $"00CF FD00 0000 0000 00DF FFFA EEDD 0000"
+- $"00CA FFFF FFFF FC00 0000 CDDE DEEF FFC0"
+- $"00EF C0C0 000C FF00 00FE 00DD CDDF AD00"
+- $"00DF DCC0 DCDD D000 0000 DDEE EDDC 0000",
+- /* [13] */
+- 'ics8',
+- $"0000 0000 0000 0000 0000 2B00 0000 0000"
+- $"0000 0000 0000 2B56 F8F9 F856 0000 0000"
+- $"0000 0000 FBFF FFFB 56F5 F7FC 0000 0000"
+- $"0000 00FC FFFD F500 00F9 FFFF F900 0000"
+- $"0000 F5FF FF56 2B2A F6FB FFFF FF00 0000"
+- $"0000 00FE FFFB 00F5 0000 FBFF FC00 0000"
+- $"0000 00F8 FFFF FA00 7900 F7FD F500 0000"
+- $"0000 00F5 F9FF FDF6 00F6 F800 0000 0000"
+- $"0000 2BEA FF56 0000 0000 0000 0000 0000"
+- $"0000 81FF FFFF FEFD FCFC FAF8 0000 0000"
+- $"0000 F6FE FFFF FFFF FFFF FFFF FEF7 0000"
+- $"0000 0000 2B56 FA81 81FC FDFF FFFF F600"
+- $"0000 ACFE 2B00 2BF5 0000 00F8 FFFF F500"
+- $"00F5 FFFC 0000 FA56 56F8 F9FD FE56 F500"
+- $"0000 56E0 FBF7 F6F6 F856 56F9 56F6 0000"
+- $"0000 0000 F881 FCAC FC81 FA2B 0000 0000",
+- /* [14] */
+- 'is32',
+- $"87FF 00C3 87FF 06F3 C79F 9F8C B598 84FF"
+- $"08F3 6008 0B53 9FE8 B34C 84FF 0948 002C"
+- $"EBF8 F884 0400 8182 FF0A E700 0093 B9D2"
+- $"E061 0000 0C82 FF0A F713 0057 FCF5 F1FB"
+- $"5000 4383 FF09 B008 0073 FF8C FFB4 2DE7"
+- $"83FF 08EB 8202 28E3 FFD9 B0FB 83FF 03CB"
+- $"1100 9089 FF00 6880 0006 142B 4050 75B2"
+- $"F782 FF01 D01C 8500 011A AF83 FF13 BF90"
+- $"7860 6048 2401 0009 DFFF FFF7 3B16 C8FF"
+- $"CDEF 80FF 139F 0004 DFFF FFEB 0444 FFFF"
+- $"7F97 9F9F 852D 1A97 F780 FF0B 9A10 54B3"
+- $"DFD4 A79F 9187 96D0 82FF 08EF A36C 4440"
+- $"4863 84C8 81FF 87FF 00C3 87FF 06F3 C79F"
+- $"9F8C B598 84FF 08F3 6008 0B52 9FE8 B34C"
+- $"84FF 0948 002C EBFA FA84 0400 8182 FF0A"
+- $"E700 0093 CDDF E960 0000 0C82 FF0A F713"
+- $"0057 FCF8 F5FB 5000 4383 FF09 B008 0072"
+- $"FFAD FFB4 2DE7 83FF 08EB 8202 28E3 FFD9"
+- $"B0FB 83FF 03CB 1100 8F89 FF00 6880 0006"
+- $"142B 4050 74B2 F782 FF01 D01C 8500 011A"
+- $"AF83 FF13 BF90 7860 6048 2401 0008 DFFF"
+- $"FFF7 3A16 C8FF CDEF 80FF 139F 0004 DFFF"
+- $"FFEB 0444 FFFF 7F97 9F9F 852D 1A97 F780"
+- $"FF0B 9910 54B3 DFD4 A79F 9086 96D0 82FF"
+- $"08EF A36C 4440 4863 84C8 81FF 86FF 01FE"
+- $"C287 FF06 F3C7 9F9F 8DB6 9884 FF08 F35F"
+- $"080B 519F E8B3 4D84 FF09 4800 2DEB FBFB"
+- $"8304 0083 82FF 0AE7 0000 93D7 E5ED 5F00"
+- $"000C 82FF 0AF6 1300 56FC F9F6 FB50 0044"
+- $"83FF 09B0 0800 72FF BDFF B42D E783 FF08"
+- $"EA83 0328 E3FF D9B0 FB83 FF03 CB12 008F"
+- $"89FF 0068 8000 0614 2B40 5075 B2F7 82FF"
+- $"01D1 1C85 0001 1AAF 83FF 2ABF 9078 6060"
+- $"4724 0100 09DF FFFF F73C 16C8 FFCF EEFE"
+- $"FFFF 9F00 04DF FFFF EB04 45FF FF7E 979F"
+- $"9F86 2D1A 98F6 80FF 0B9A 1055 B3DF D3A7"
+- $"9D91 8596 D182 FF08 EFA3 6C44 4048 6584"
+- $"C981 FF",
+- /* [15] */
+- 's8mk',
+- $"0000 0000 0000 0000 0005 FF05 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0005 FFFF FFFF FFFF FFFF FFFF FF00"
+- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0005 FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000",
+- /* [16] */
+- 'icm#',
+- $"0000 0350 1C30 1C78 1C10 0620 1900 3FF8"
+- $"0B7C 300C 31B0 0720 0070 0FF0 1FF8 3FF8"
+- $"3FF8 1FF0 3FF8 3FFC 1FFE 7FFE 7FFE 3FF8",
+- /* [17] */
+- 'icm4',
+- $"0000 0000 00C0 0000 0000 CDEE ECCE 0000"
+- $"000D FAC0 0DEF C000 000F FD0C 0DFF F000"
+- $"000E FFC0 C0DF C000 0000 DFEC 00CC 0000"
+- $"00CF FDC0 C000 0000 00DF FFFF FFFE D000"
+- $"000C DDEE EEFF FF00 00AE C0C0 000D FEC0"
+- $"00FE C0CD DEDE DC00 000C DDED DDDC C000",
+- /* [18] */
+- 'icm8',
+- $"0000 0000 0000 0000 0000 F800 0000 0000"
+- $"0000 0000 2BFA FBAC 8156 F681 0000 0000"
+- $"0000 00FA FFFD F7F5 0056 FDFF F800 0000"
+- $"0000 F5FF FF56 2B2A F556 FFFF FF00 0000"
+- $"0000 00FB FFFE F600 4F00 56FF F800 0000"
+- $"0000 00F5 81EA FEF5 00F6 F8F6 0000 0000"
+- $"0000 F8FF FFFA 2BF6 F600 0000 0000 0000"
+- $"0000 56FF FFFF FFFF FFFF E0FC F9F5 0000"
+- $"0000 00F6 F981 FBFC FCAC FDFF FFFD F500"
+- $"0000 FDFD F600 F700 0000 0056 FFFE F500"
+- $"0000 ACFE 2B00 F7F9 8181 FBFB 81F7 0000"
+- $"0000 00F7 FAFB FBFA FAF9 56F8 F600 0000",
+- /* [19] */
+- 'it32',
+- $"0000 0000 FFFF FFFF FFFF C9FF 0100 00FC"
+- $"FF01 0000 F8FF 0000 80FF 0100 00F7 FF01"
+- $"0000 80FF 0100 00F6 FF01 0000 81FF 0100"
+- $"00F5 FF80 0080 FF80 00F4 FF80 0081 FF80"
+- $"00F2 FF81 0081 FF80 00F1 FF00 4080 0082"
+- $"FF81 00ED FF82 0001 2020 83FF 8100 D9FF"
+- $"8D00 0240 2020 8200 0020 84FF 8100 D3FF"
+- $"9B00 85FF 8200 CDFF 9C00 0140 0087 FF82"
+- $"00CA FF9F 0089 FF82 00C7 FF9E 0001 2000"
+- $"8AFF 8300 C5FF 9E00 8EFF 8300 C3FF 9800"
+- $"0040 8000 91FF 8400 C1FF 9C00 93FF 8400"
+- $"C0FF 9700 0160 0096 FF85 00BF FF93 0002"
+- $"4040 0099 FF88 00BC FF94 0000 4099 FF89"
+- $"0001 2000 BAFF 9300 9BFF 8C00 0020 B8FF"
+- $"9300 9AFF 9000 B6FF 9200 9BFF 9000 0120"
+- $"20B4 FF92 009A FF00 4094 00B3 FF91 009A"
+- $"FF97 00B1 FF92 0099 FF00 4097 00B1 FF91"
+- $"0090 FF00 2085 FF01 4040 9800 AFFF 9100"
+- $"0020 8EFF 023A 2020 85FF 9A00 AFFF 9100"
+- $"88FF 0020 83FF 8020 85FF 9B00 AEFF 9100"
+- $"87FF 0120 2083 FF80 2085 FF9B 00AD FF92"
+- $"0086 FF80 2083 FF02 203A 2086 FF9A 00AD"
+- $"FF91 0087 FF80 2083 FF80 2086 FF9B 00AC"
+- $"FF91 0087 FF80 2083 FF80 2087 FF00 4099"
+- $"00AC FF91 0087 FF80 2084 FF80 2087 FF99"
+- $"00AC FF91 0087 FF81 2084 FF01 2020 88FF"
+- $"9800 ACFF 9100 88FF 8020 92FF 9700 ACFF"
+- $"9200 88FF 8020 92FF 9600 ACFF 9200 A1FF"
+- $"9200 0140 00AE FF91 00A2 FF93 00AE FF92"
+- $"00A2 FF91 00AF FF00 4091 00A3 FF90 00B0"
+- $"FF92 00A3 FF8D 0000 60B1 FF01 4040 9000"
+- $"0040 A3FF 8B00 0120 00B2 FF91 0001 4040"
+- $"8CFF 8220 8EFF 8B00 0020 B4FF 9300 8DFF"
+- $"8220 8DFF 8A00 B5FF 9300 0040 8CFF 8320"
+- $"8CFF 8900 B7FF 9200 0140 408C FF82 208C"
+- $"FF88 00B9 FF94 008B FF83 208B FF87 00BB"
+- $"FF94 008B FF82 208B FF86 00BD FF00 2093"
+- $"008A FF81 208C FF85 00BF FF94 008A FF01"
+- $"2020 8CFF 0040 8300 0020 C2FF 9300 99FF"
+- $"8400 C6FF 9200 97FF 8300 CAFF 9000 96FF"
+- $"8300 CDFF 8F00 93FF 0500 2000 2000 00CE"
+- $"FF01 2020 8E00 90FF 8040 8000 CFFF 0300"
+- $"0020 208D 008F FF01 0000 8040 CFFF 0040"
+- $"9100 90FF 8000 CFFF 9300 E4FF 8E00 0040"
+- $"8100 E6FF 9100 E7FF 0120 208E 00E9 FF8F"
+- $"00EA FF8F 00EA FF90 00E9 FF92 00E8 FF94"
+- $"00E5 FF98 00E2 FF9C 00DD FFA8 00D2 FFA5"
+- $"0004 2000 0040 4089 00C4 FFBC 0000 20BD"
+- $"FFC3 00B7 FFC4 0001 4040 B4FF C800 0020"
+- $"B2FF 0020 CA00 AFFF 0020 CB00 0040 AEFF"
+- $"CD00 0020 ACFF 0020 CF00 ABFF D100 ABFF"
+- $"D000 ABFF D000 ABFF D000 ACFF CF00 AFFF"
+- $"CB00 0020 B0FF CA00 B4FF C700 B9FF C200"
+- $"C2FF B800 D6FF A500 DEFF 9C00 E1FF 0200"
+- $"0020 9600 A2FF 0020 8900 0140 40B1 FF95"
+- $"009F FF03 0000 2020 8900 0040 B4FF 9300"
+- $"9DFF 8D00 0060 B7FF 9200 9CFF 0040 8C00"
+- $"B9FF 9100 9CFF 8D00 BBFF 9000 9CFF 8C00"
+- $"92FF 0200 2020 8200 9FFF 8F00 9CFF 8B00"
+- $"0020 92FF 0400 0020 2000 A3FF 8F00 9CFF"
+- $"8B00 0060 91FF 8100 A5FF 8E00 9DFF 8B00"
+- $"92FF 8100 A4FF 8E00 9EFF 8B00 91FF 8100"
+- $"0060 A3FF 8E00 9FFF 8B00 92FF 8200 A0FF"
+- $"8F00 A0FF 8B00 92FF 8200 0040 9CFF 0100"
+- $"408F 0082 FF00 009B FF8B 0000 2092 FF84"
+- $"0095 FF01 4020 9100 0140 4082 FF01 0000"
+- $"9CFF 8B00 93FF AE00 0240 4000 83FF 0100"
+- $"009D FF8C 0093 FF01 0020 AC00 84FF 0120"
+- $"009F FF8C 0094 FFAA 0085 FF01 2020 A0FF"
+- $"0020 8C00 95FF 0100 40A2 0087 FF80 00A2"
+- $"FF8D 0097 FF94 0000 2084 008A FF03 0000"
+- $"2000 A4FF 8D00 0020 9BFF 8E00 0020 8FFF"
+- $"0400 4000 0020 A6FF 0020 8D00 BBFF 8400"
+- $"A8FF 0040 8E00 B5FF 0040 8300 0120 00AC"
+- $"FF91 00AF FF02 0040 4083 00B0 FF95 00A3"
+- $"FF8A 00B4 FF99 0097 FF8C 0001 4000 B8FF"
+- $"BC00 0220 0000 BDFF BA00 0020 C3FF B000"
+- $"0020 8000 C9FF A400 0120 2083 00D3 FF9F"
+- $"0004 2020 4000 00DC FF92 00FF FFFF FFB3"
+- $"FFFF FFCA FF00 FBFD FF00 FBFC FF03 FBFB"
+- $"0000 F6FF 01FB FB81 FF01 0000 80FF 00FB"
+- $"F4FF 0000 80FF 0100 00F7 FF01 0000 80FF"
+- $"0100 00F5 FF02 FB00 0081 FF01 0000 F5FF"
+- $"8000 80FF 8000 F4FF 8000 81FF 8000 F2FF"
+- $"8100 81FF 8000 F1FF 0040 8000 82FF 8100"
+- $"D6FF 00FB 93FF 8200 0220 20FB 82FF 8100"
+- $"D9FF 8D00 0240 2020 8200 0220 FFFB 82FF"
+- $"8100 D3FF 9B00 01FB FB83 FF82 00CD FF9C"
+- $"0001 4000 87FF 8200 CAFF 9F00 89FF 8200"
+- $"C7FF 9E00 0120 008A FF83 00C5 FF9E 008E"
+- $"FF83 00C0 FF02 FBFB FF98 0000 4080 0001"
+- $"FBFB 8FFF 8400 C0FF 00FB 9C00 03FF FFFB"
+- $"FB8F FF84 00C0 FF97 0003 6000 FBFB 94FF"
+- $"8500 BFFF 9300 0440 4000 FBFB 97FF 8800"
+- $"BCFF 9400 0440 FFFF FBFB 95FF 8900 0120"
+- $"00BA FF93 009B FF8C 0000 20B8 FF93 009A"
+- $"FF90 00B6 FF92 009B FF90 0001 2020 B4FF"
+- $"9200 99FF 01FB 4094 00B3 FF91 009A FF97"
+- $"00B1 FF92 008D FF00 FB88 FF00 4097 00B1"
+- $"FF91 008E FF02 FBFF 6085 FF01 4040 9800"
+- $"AFFF 9100 0020 8EFF 026E 6060 85FF 9A00"
+- $"ADFF 01FB FF91 0088 FF00 6083 FF80 6085"
+- $"FF9B 0000 FBAB FF01 FBFF 9100 87FF 0160"
+- $"6083 FF80 6085 FF9B 0000 FBAC FF92 0086"
+- $"FF80 6083 FF02 606E 6084 FF01 FBFF 9A00"
+- $"ADFF 9100 87FF 8060 83FF 8060 86FF 9B00"
+- $"ACFF 9100 87FF 8060 01FB FB81 FF80 6085"
+- $"FF02 FBFB 4099 00AC FF91 0087 FF80 6084"
+- $"FF80 6084 FF02 FBFB FF99 00AC FF91 0086"
+- $"FF00 FB81 6082 FF03 FBFF 6060 88FF 9800"
+- $"ACFF 9100 88FF 8060 90FF 01FB FF97 00AC"
+- $"FF92 0088 FF80 608F FF02 FBFF FF96 00AC"
+- $"FF92 0088 FF03 FBFF FFFB 92FF 9200 0140"
+- $"00AC FF01 FBFB 9100 A2FF 9300 ACFF 01FB"
+- $"FB92 00A2 FF91 00AF FF00 4091 00A3 FF90"
+- $"0000 FBAF FF92 0001 FBFB 8CFF 80FB 8FFF"
+- $"8D00 0060 B1FF 0140 4090 0002 40FF FB91"
+- $"FF00 FB8C FF8B 0001 2000 B2FF 9100 0240"
+- $"40FB 8BFF 8260 01FF FB8C FF8B 0001 20FB"
+- $"B1FF 01FB FF93 0001 FBFB 89FF 01FB FF82"
+- $"6001 FBFB 8BFF 8A00 B5FF 9300 0040 8CFF"
+- $"8360 8CFF 8900 B7FF 9200 0140 408B FF00"
+- $"FB82 608C FF88 00B9 FF94 008B FF83 608B"
+- $"FF87 00BB FF94 008B FF82 608B FF86 00BD"
+- $"FF00 2093 008A FF81 608C FF85 00BE FF00"
+- $"FB94 008A FF01 6060 8CFF 0040 8300 0020"
+- $"C2FF 9300 99FF 8400 C6FF 9200 94FF 02FB"
+- $"FBFF 8300 CAFF 9000 94FF 01FB FB83 00CD"
+- $"FF8F 0093 FF06 0020 0020 0000 FBCD FF01"
+- $"2020 8E00 90FF 8040 8000 CFFF 0300 0020"
+- $"208D 008F FF01 0000 8040 CFFF 0040 9100"
+- $"80FF 00FB 8AFF 01FB FF80 0001 FFFB CAFF"
+- $"02FB FFFF 9300 E1FF 02FB FBFF 8E00 0040"
+- $"8100 01FF FBE2 FF01 FBFB 9100 81FF 00FB"
+- $"E2FF 0120 208E 0000 FBE8 FF8F 00EA FF8F"
+- $"00EA FF90 00E8 FF00 FB92 0001 FBFB E5FF"
+- $"00FB 9400 E5FF 9800 00FB DFFF 01FB FB9C"
+- $"00DD FFA8 008F FF01 FBFB BEFF A500 0420"
+- $"0000 4040 8900 C4FF BC00 0020 BDFF C300"
+- $"B7FF C400 0140 40B4 FFC8 0000 20B2 FF00"
+- $"20CA 00AF FF00 20CB 0000 40AE FFCD 0000"
+- $"20AB FF01 FB20 CF00 ABFF D100 ABFF D000"
+- $"ABFF D000 ABFF D000 A8FF 00FB 80FF CF00"
+- $"AFFF CB00 0220 FBFB AEFF CA00 ABFF 00FB"
+- $"85FF C700 B9FF C200 00FB C1FF B800 D4FF"
+- $"01FB FBA5 00D3 FF01 FBFB 86FF 9C00 A3FF"
+- $"00FB BAFF 0200 0020 9600 A2FF 0020 8900"
+- $"0440 40FF FBFB AEFF 9500 9FFF 0300 0020"
+- $"2089 0004 40FF FFFB FBB0 FF93 009C FF00"
+- $"FB8D 0000 60B7 FF92 009A FF02 FBFB 408C"
+- $"00B9 FF91 009C FF8D 009C FF01 FBFB 9AFF"
+- $"9000 9CFF 8C00 92FF 0200 2020 8200 80FF"
+- $"01FB FB9A FF8F 009C FF8B 0002 20FF FB90"
+- $"FF04 0000 2020 0084 FF01 FBFB 9AFF 8F00"
+- $"00FB 9BFF 8B00 0060 91FF 8100 A1FF 00FB"
+- $"80FF 8E00 80FF 00FB 99FF 8B00 92FF 8100"
+- $"A4FF 8E00 81FF 00FB 99FF 8B00 91FF 8100"
+- $"0060 A3FF 8E00 81FF 01FB FB99 FF8B 0092"
+- $"FF82 0080 FF00 FB9C FF8F 00A0 FF8B 0092"
+- $"FF82 0003 40FF FFFB 99FF 0100 408F 0082"
+- $"FF00 009B FF8B 0000 2092 FF84 0088 FF83"
+- $"FB84 FF01 4020 9100 0140 4082 FF01 0000"
+- $"9CFF 8B00 90FF 02FB FBFF AE00 0240 4000"
+- $"81FF 03FB FB00 009D FF8C 0093 FF01 0020"
+- $"AC00 84FF 0120 009F FF8C 0094 FFAA 0085"
+- $"FF01 2020 9EFF 02FB FB20 8C00 02FF FFFB"
+- $"92FF 0100 40A2 0002 FFFF FB84 FF80 00A2"
+- $"FF8D 0096 FF00 FB94 0000 2084 0001 FFFB"
+- $"84FF 00FB 80FF 0300 0020 00A4 FF8D 0000"
+- $"209B FF8E 0000 208F FF04 0040 0000 20A6"
+- $"FF00 208D 009E FF8A FB8D FF84 0000 FBA6"
+- $"FF01 FB40 8E00 AFFF 80FB 80FF 0040 8300"
+- $"0120 00A9 FF02 FBFF FF91 00AB FF80 FB03"
+- $"FF00 4040 8300 B0FF 9500 89FF 01FB FB89"
+- $"FF81 FB85 FF8A 00B4 FF99 0097 FF8C 0001"
+- $"4000 B8FF BC00 0220 0000 BDFF BA00 0020"
+- $"BFFF 00FB 80FF B000 0020 8000 C7FF 01FB"
+- $"FBA4 0001 2020 8300 CCFF 01FB FB82 FF9F"
+- $"0008 2020 4000 00FF FFFB FBD8 FF92 0084"
+- $"FF01 FBFB FFFF FFFF AAFF FFFF CAFF 00F0"
+- $"FDFF 00F0 FCFF 03F0 F000 00F6 FF01 F0F0"
+- $"81FF 0100 0080 FF00 F0F4 FF00 0080 FF01"
+- $"0000 F7FF 0100 0080 FF01 0000 F5FF 02F0"
+- $"0000 81FF 0100 00F5 FF80 0080 FF80 00F4"
+- $"FF80 0081 FF80 00F2 FF81 0081 FF80 00F1"
+- $"FF00 4080 0082 FF81 00D6 FF00 F093 FF82"
+- $"0002 4040 F082 FF81 00D9 FF8D 0080 4082"
+- $"0002 40FF F082 FF81 00D3 FF9B 0001 F0F0"
+- $"83FF 8200 CDFF 9C00 0140 0087 FF82 00CA"
+- $"FF9F 0089 FF82 00C7 FF9E 0001 4000 8AFF"
+- $"8300 C5FF 9E00 8EFF 8300 C0FF 02F0 F0FF"
+- $"9800 0040 8000 01F0 F08F FF84 00C0 FF00"
+- $"F09C 0003 FFFF F0F0 8FFF 8400 C0FF 9700"
+- $"0340 00F0 F094 FF85 00BF FF93 0004 4040"
+- $"00F0 F097 FF88 00BC FF94 0004 40FF FFF0"
+- $"F095 FF89 0001 4000 BAFF 9300 9BFF 8C00"
+- $"0040 B8FF 9300 9AFF 9000 B6FF 9200 9BFF"
+- $"9000 0140 40B4 FF92 0099 FF01 F040 9400"
+- $"B3FF 9100 9AFF 9700 B1FF 9200 8DFF 00F0"
+- $"88FF 0040 9700 B1FF 9100 8EFF 02F0 FF80"
+- $"85FF 0140 4098 00AF FF91 0000 408E FF02"
+- $"A580 8085 FF9A 00AD FF01 F0FF 9100 88FF"
+- $"0080 83FF 8080 85FF 9B00 00F0 ABFF 01F0"
+- $"FF91 0087 FF01 8080 83FF 8080 85FF 9B00"
+- $"00F0 ACFF 9200 86FF 8080 83FF 0280 A580"
+- $"84FF 01F0 FF9A 00AD FF91 0087 FF80 8083"
+- $"FF80 8086 FF9B 00AC FF91 0087 FF80 8001"
+- $"F0F0 81FF 8080 85FF 02F0 F040 9900 ACFF"
+- $"9100 87FF 8080 84FF 8080 84FF 02F0 F0FF"
+- $"9900 ACFF 9100 86FF 00F0 8180 82FF 03F0"
+- $"FF80 8088 FF98 00AC FF91 0088 FF80 8090"
+- $"FF01 F0FF 9700 ACFF 9200 88FF 8080 8FFF"
+- $"02F0 FFFF 9600 ACFF 9200 88FF 03F0 FFFF"
+- $"F092 FF92 0001 4000 ACFF 01F0 F091 00A2"
+- $"FF93 00AC FF01 F0F0 9200 A2FF 9100 AFFF"
+- $"0040 9100 A3FF 9000 00F0 AFFF 9200 01F0"
+- $"F08C FF80 F08F FF8D 0000 80B1 FF01 4040"
+- $"9000 0240 FFF0 91FF 00F0 8CFF 8B00 0140"
+- $"00B2 FF91 0002 4040 F08B FF82 8001 FFF0"
+- $"8CFF 8B00 0140 F0B1 FF01 F0FF 9300 01F0"
+- $"F089 FF01 F0FF 8280 01F0 F08B FF8A 00B5"
+- $"FF93 0000 408C FF83 808C FF89 00B7 FF92"
+- $"0001 4040 8BFF 00F0 8280 8CFF 8800 B9FF"
+- $"9400 8BFF 8380 8BFF 8700 BBFF 9400 8BFF"
+- $"8280 8BFF 8600 BDFF 0040 9300 8AFF 8180"
+- $"8CFF 8500 BEFF 00F0 9400 8AFF 0180 808C"
+- $"FF00 4083 0000 40C2 FF93 0099 FF84 00C6"
+- $"FF92 0094 FF02 F0F0 FF83 00CA FF90 0094"
+- $"FF01 F0F0 8300 CDFF 8F00 93FF 0600 4000"
+- $"4000 00F0 CDFF 0140 408E 0090 FF80 4080"
+- $"00CF FF03 0000 4040 8D00 8FFF 0100 0080"
+- $"40CF FF00 4091 0080 FF00 F08A FF01 F0FF"
+- $"8000 01FF F0CA FF02 F0FF FF93 00E1 FF02"
+- $"F0F0 FF8E 0000 4081 0001 FFF0 E2FF 01F0"
+- $"F091 0081 FF00 F0E2 FF01 4040 8E00 00F0"
+- $"E8FF 8F00 EAFF 8F00 EAFF 9000 E8FF 00F0"
+- $"9200 01F0 F0E5 FF00 F094 00E5 FF98 0000"
+- $"F0DF FF01 F0F0 9C00 DDFF A800 8FFF 01F0"
+- $"F0BE FFA5 0004 4000 0040 4089 00C4 FFBC"
+- $"0000 40BD FFC3 00B7 FFC4 0001 4040 B4FF"
+- $"C800 0040 B2FF 0040 CA00 AFFF 0040 CB00"
+- $"0040 AEFF CD00 0040 ABFF 01F0 40CF 00AB"
+- $"FFD1 00AB FFD0 00AB FFD0 00AB FFD0 00A8"
+- $"FF00 F080 FFCF 00AF FFCB 0002 40F0 F0AE"
+- $"FFCA 00AB FF00 F085 FFC7 00B9 FFC2 0000"
+- $"F0C1 FFB8 00D4 FF01 F0F0 A500 D3FF 01F0"
+- $"F086 FF9C 00A3 FF00 F0BA FF02 0000 4096"
+- $"00A2 FF00 4089 0004 4040 FFF0 F0AE FF95"
+- $"009F FF03 0000 4040 8900 0440 FFFF F0F0"
+- $"B0FF 9300 9CFF 00F0 8D00 0080 B7FF 9200"
+- $"9AFF 02F0 F040 8C00 B9FF 9100 9CFF 8D00"
+- $"9CFF 01F0 F09A FF90 009C FF8C 0092 FF02"
+- $"0040 4082 0080 FF01 F0F0 9AFF 8F00 9CFF"
+- $"8B00 0240 FFF0 90FF 0400 0040 4000 84FF"
+- $"01F0 F09A FF8F 0000 F09B FF8B 0000 4091"
+- $"FF81 00A1 FF00 F080 FF8E 0080 FF00 F099"
+- $"FF8B 0092 FF81 00A4 FF8E 0081 FF00 F099"
+- $"FF8B 0091 FF81 0000 40A3 FF8E 0081 FF01"
+- $"F0F0 99FF 8B00 92FF 8200 80FF 00F0 9CFF"
+- $"8F00 A0FF 8B00 92FF 8200 0340 FFFF F099"
+- $"FF01 0040 8F00 82FF 0000 9BFF 8B00 0040"
+- $"92FF 8400 88FF 83F0 84FF 0140 4091 0001"
+- $"4040 82FF 0100 009C FF8B 0090 FF02 F0F0"
+- $"FFAE 0002 4040 0081 FF03 F0F0 0000 9DFF"
+- $"8C00 93FF 0100 40AC 0084 FF01 4000 9FFF"
+- $"8C00 94FF AA00 85FF 0140 409E FF02 F0F0"
+- $"408C 0002 FFFF F092 FF01 0040 A200 02FF"
+- $"FFF0 84FF 8000 A2FF 8D00 96FF 00F0 9400"
+- $"0040 8400 01FF F084 FF00 F080 FF03 0000"
+- $"4000 A4FF 8D00 0040 9BFF 8E00 0040 8FFF"
+- $"0400 4000 0040 A6FF 0040 8D00 9EFF 8AF0"
+- $"8DFF 8400 00F0 A6FF 01F0 408E 00AF FF80"
+- $"F080 FF00 4083 0001 4000 A9FF 02F0 FFFF"
+- $"9100 ABFF 80F0 03FF 0040 4083 00B0 FF95"
+- $"0089 FF01 F0F0 89FF 81F0 85FF 8A00 B4FF"
+- $"9900 97FF 8C00 0140 00B8 FFBC 0002 4000"
+- $"00BD FFBA 0000 40BF FF00 F080 FFB0 0000"
+- $"4080 00C7 FF01 F0F0 A400 0140 4083 00CC"
+- $"FF01 F0F0 82FF 9F00 8040 0500 00FF FFF0"
+- $"F0D8 FF92 0084 FF01 F0F0 FFFF FFFF AAFF",
+- /* [20] */
+- 't8mk',
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0500 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0505 FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 0500"
+- $"00FF FFFF FF00 0000 0500 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 BFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0500 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"DBFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF BFDB DBFF FFFF FFFF"
+- $"DBFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF BFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0505 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF BFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"05FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF DBFF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"DB00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFDB DB00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0500 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF05 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0500 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF05 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFBF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0505 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0505 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 BFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0500 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 9B00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00BF BFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFDB FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFDB 0500 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFBF BFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00DB"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFBF FFFF FFFF FFFF DB00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFDB FFDB FFFF 0500 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00DB DBFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF BFBF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFDB DBFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFBF BFBF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 BFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0500"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0500 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 0500 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0005 05FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00DB DBFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 05FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 05FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0505 FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFBF FFFF FFFF"
+- $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 05DB FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0500 0000 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0005 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0500 0000 0000 0000"
+- $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF BFBF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 FFFF DBDB FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF BFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0005 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"05BF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FF00 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FF00 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFBF BFFF FFFF FFFF FFFF FFFF"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"05DB FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF DBFF 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFBF FFFF DB00 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF 0500 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 05BF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFBF"
+- $"FFFF FFFF FFFF DBFF 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0500 00FF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFBF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"BFFF 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 00FF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF DBFF FF00"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 00FF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF DB00 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0005"
+- $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF DBFF FFFF 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0505 FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB DBFF"
+- $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0505 0000 0000 00FF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB DBBF"
+- $"FFFF 0000 0505 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+- $"FFFF FFFF FFFF 0000 0000 0000 0005 0500"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- $"0000 0000 0000 0000 0000 0000 0000 0000"
+- }
+-};
+diff --git a/base/gdevbit.c b/base/gdevbit.c
+--- a/base/gdevbit.c
++++ b/base/gdevbit.c
+@@ -653,7 +653,7 @@ bit_put_params(gx_device * pdev, gs_param_list * plist)
+ pdev->color_info.depth == 32 ? cmyk_8bit_map_cmyk_color :
+ bit_map_cmyk_color);
+ }
+- /* Reset the sparable and linear shift, masks, bits. */
++ /* Reset the separable and linear shift, masks, bits. */
+ set_linear_color_bits_mask_shift(pdev);
+ pdev->color_info.separable_and_linear = GX_CINFO_SEP_LIN;
+ ((gx_device_bit *)pdev)->FirstLine = FirstLine;
+@@ -671,16 +671,18 @@ bit_print_page(gx_device_printer * pdev, FILE * prn_stream)
+ byte *in = gs_alloc_bytes(pdev->memory, line_size, "bit_print_page(in)");
+ byte *data;
+ int nul = !strcmp(pdev->fname, "nul") || !strcmp(pdev->fname, "/dev/null");
+- int lnum = ((gx_device_bit *)pdev)->FirstLine;
+- int bottom = ((gx_device_bit *)pdev)->LastLine;
++ int lnum = ((gx_device_bit *)pdev)->FirstLine >= pdev->height ? pdev->height - 1 :
++ ((gx_device_bit *)pdev)->FirstLine;
++ int bottom = ((gx_device_bit *)pdev)->LastLine >= pdev->height ? pdev->height - 1 :
++ ((gx_device_bit *)pdev)->LastLine;
+ int line_count = any_abs(bottom - lnum);
+ int i, step = lnum > bottom ? -1 : 1;
+
+ if (in == 0)
+ return_error(gs_error_VMerror);
+ if ((lnum == 0) && (bottom == 0))
+- bottom = pdev->height - 1;
+- for (i = 0; i < line_count; i++, lnum += step) {
++ line_count = pdev->height - 1; /* default when LastLine == 0, FirstLine == 0 */
++ for (i = 0; i <= line_count; i++, lnum += step) {
+ gdev_prn_get_bits(pdev, lnum, in, &data);
+ if (!nul)
+ fwrite(data, 1, line_size, prn_stream);
+diff --git a/base/gdevdevn.c b/base/gdevdevn.c
+--- a/base/gdevdevn.c
++++ b/base/gdevdevn.c
+@@ -216,7 +216,7 @@ devn_get_color_comp_index(gx_device * dev, gs_devn_params * pdevn_params,
+ {
+ int num_order = pdevn_params->num_separation_order_names;
+ int color_component_number = 0;
+- int max_spot_colors = GX_DEVICE_MAX_SEPARATIONS;
++ int max_spot_colors = GX_DEVICE_MAX_SEPARATIONS - MAX_DEVICE_PROCESS_COLORS;
+
+ /*
+ * Check if the component is in either the process color model list
+@@ -470,8 +470,9 @@ devn_put_params(gx_device * pdev, gs_param_list * plist,
+ case 0:
+ if (page_spot_colors < -1)
+ return_error(gs_error_rangecheck);
+- if (page_spot_colors > GX_DEVICE_COLOR_MAX_COMPONENTS)
+- page_spot_colors = GX_DEVICE_COLOR_MAX_COMPONENTS;
++ if (page_spot_colors > GX_DEVICE_COLOR_MAX_COMPONENTS - MAX_DEVICE_PROCESS_COLORS)
++ page_spot_colors = GX_DEVICE_COLOR_MAX_COMPONENTS - MAX_DEVICE_PROCESS_COLORS;
++ /* Need to leave room for the process colors in GX_DEVICE_COLOR_MAX_COMPONENTS */
+ }
+ /*
+ * The DeviceN device can have zero components if nothing has been
+diff --git a/base/gdevifno.c b/base/gdevifno.c
+--- a/base/gdevifno.c
++++ b/base/gdevifno.c
+@@ -22,14 +22,12 @@
+
+ #include "gdevprn.h"
+ #include "gsparam.h"
+-#include "gxlum.h"
+-#include <stdlib.h>
+
+ #define nil ((void*)0)
+
+ /*
+- * ERROR
+- * is used to go up the stack and
++ * ERROR
++ * is used to go up the stack and
+ * eventually return_error(gs_error_Fatal) to gs.
+ */
+ #define ERROR (-2)
+@@ -49,11 +47,13 @@ struct Rectangle {
+ };
+ static Point ZP = { 0, 0 };
+
+-static WImage* initwriteimage(FILE *f, Rectangle r, int ldepth);
+-static int writeimageblock(WImage *w, uchar *data, int ndata);
++static WImage* initwriteimage(FILE *f, Rectangle r, int ldepth, gs_memory_t *mem);
++static int writeimageblock(WImage *w, uchar *data, int ndata, gs_memory_t *mem);
+ static int bytesperline(Rectangle, int);
+ static int rgb2cmap(int, int, int);
+-static long cmap2rgb(int);
++/* static long cmap2rgb(int); */ /* not currently used */
++
++void init_p9color(ulong *p9color);
+
+ #define X_DPI 100
+ #define Y_DPI 100
+@@ -72,8 +72,16 @@ typedef struct inferno_device_s {
+ int color, gray;
+ int cmapcall;
+ int nbits;
++ ulong *p9color; /* index blue most sig, red least sig */
+ } inferno_device;
+
++/* structure descriptor for the garbage collector */
++/* we must use the final version because gx_device_common requires
++ a finalisation call, but such procedures aren't inherited. */
++gs_private_st_suffix_add1_final(st_inferno_device, inferno_device,
++ "inferno_device", inferno_device_enum_ptrs, inferno_device_reloc_ptrs,
++ gx_device_finalize, st_device_printer, p9color);
++
+ static const gx_device_procs inferno_procs =
+ prn_color_params_procs(inferno_open, gdev_prn_output_page, inferno_close,
+ inferno_rgb2cmap, inferno_cmap2rgb,
+@@ -81,7 +89,8 @@ static const gx_device_procs inferno_procs =
+
+
+ inferno_device far_data gs_inferno_device =
+-{ prn_device_body(inferno_device, inferno_procs, "inferno",
++{ prn_device_stype_body(inferno_device, inferno_procs, "inferno",
++ &st_inferno_device,
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0,0,0,0, /* margins */
+@@ -98,7 +107,7 @@ inferno_device far_data gs_inferno_device =
+ * ghostscript asks us how to convert between
+ * rgb and color map entries
+ */
+-static gx_color_index
++static gx_color_index
+ inferno_rgb2cmap(gx_device *dev, const gx_color_value cv[]) {
+ int shift;
+ inferno_device *bdev = (inferno_device*) dev;
+@@ -128,7 +137,7 @@ inferno_rgb2cmap(gx_device *dev, const gx_color_value cv[]) {
+ /*
+ * we keep track of what ldepth bitmap this is by watching
+ * what colors gs asks for.
+- *
++ *
+ * one catch: sometimes print_page gets called more than one
+ * per page (for multiple copies) without cmap calls inbetween.
+ * if bdev->cmapcall is 0 when print_page gets called, it uses
+@@ -149,7 +158,7 @@ inferno_rgb2cmap(gx_device *dev, const gx_color_value cv[]) {
+ return ((((blue<<4)|green)<<4)|red);
+ }
+
+-static int
++static int
+ inferno_cmap2rgb(gx_device *dev, gx_color_index color,
+ gx_color_value rgb[3]) {
+ int shift, i;
+@@ -186,13 +195,12 @@ inferno_cmap2rgb(gx_device *dev, gx_color_index color,
+ #define Glevs 16
+ #define Blevs 16
+ #define Mlevs 16
+-#define Rfactor 1 /* multiple of red level in p9color[] index */
++#define Rfactor 1 /* multiple of red level in e cp9color[] index */
+ #define Gfactor Rlevs
+ #define Bfactor (Rlevs*Glevs)
+-
+-ulong p9color[Rlevs*Glevs*Blevs]; /* index blue most sig, red least sig */
++#define p9color_size (sizeof(ulong)*Rlevs*Glevs*Blevs)
+
+-void init_p9color(void) /* init at run time since p9color[] is so big */
++void init_p9color(ulong *p9color) /* init at run time since p9color[] is so big */
+ {
+ int r, g, b, o;
+ ulong* cur = p9color;
+@@ -232,18 +240,25 @@ inferno_open(gx_device *dev)
+ bdev->ldepth = 3;
+ bdev->nbits = 4; /* 4 bits per color per pixel (12 bpp, then we dither) */
+ /* if you change this, change the entry in gs_inferno_device */
+- init_p9color();
++ bdev->p9color = (ulong *)gs_alloc_bytes(bdev->memory, p9color_size, "plan 9 colour cube");
++ if (bdev->p9color == NULL)
++ return_error(gs_error_VMerror);
++ init_p9color(bdev->p9color);
+ return gdev_prn_open(dev);
+ }
+
+-/*
++/*
+ * inferno_close() is called at the end, once everything
+ * is finished. we have nothing to do.
+ */
+ static int
+ inferno_close(gx_device *dev)
+ {
++ inferno_device *bdev = (inferno_device*) dev;
+ int code;
++
++ gs_free_object(dev->memory, bdev->p9color, "plan 9 colour cube");
++
+ code = gdev_prn_close(dev);
+ if(code < 0)
+ return_error(code);
+@@ -258,7 +273,7 @@ inferno_close(gx_device *dev)
+ static int
+ inferno_print_page(gx_device_printer *pdev, FILE *f)
+ {
+- uchar buf[16384]; /* == 8192 dots across */
++ uchar *buf;
+ uchar *p;
+ WImage *w;
+ int bpl, y;
+@@ -274,7 +289,7 @@ inferno_print_page(gx_device_printer *pdev, FILE *f)
+ Rectangle r;
+
+ gsbpl = gdev_prn_raster(pdev);
+- if(gsbpl > sizeof(buf)) {
++ if(gsbpl > 16384) { /* == 8192 dots across */
+ errprintf("bitmap far too wide for inferno\n");
+ return_error(gs_error_Fatal);
+ }
+@@ -290,12 +305,18 @@ inferno_print_page(gx_device_printer *pdev, FILE *f)
+ r.max.x = pdev->width;
+ r.max.y = pdev->height;
+ bpl = bytesperline(r, ldepth);
+- w = initwriteimage(f, r, ldepth);
++ w = initwriteimage(f, r, ldepth, bdev->memory);
+ if(w == nil) {
+ errprintf("initwriteimage failed\n");
+ return_error(gs_error_Fatal);
+ }
+
++ buf = gs_alloc_bytes(bdev->memory, gsbpl, "inferno line buffer");
++ if(buf == NULL) {
++ errprintf("couldn't allocate line buffer\n");
++ return_error(gs_error_VMerror);
++ }
++
+ /*
+ * i wonder if it is faster to put the switch around the for loops
+ * to save all the ldepth lookups.
+@@ -314,10 +335,10 @@ inferno_print_page(gx_device_printer *pdev, FILE *f)
+ r<<=4;
+ g<<=4;
+ b<<=4;
+- p[x] = rgb2cmap(r,g,b);
++ p[x] = rgb2cmap(r,g,b);
+ }
+ if(1){
+- u = p9color[us];
++ u = bdev->p9color[us];
+ /* the ulong in p9color is a 2x2 matrix. pull the entry
+ * u[x%2][y%2], more or less.
+ */
+@@ -345,19 +366,25 @@ inferno_print_page(gx_device_printer *pdev, FILE *f)
+ xmod = pdev->width % ppb[ldepth];
+ if(xmod)
+ p[(x-1)/ppb[ldepth]] <<= ((ppb[ldepth]-xmod)*bpp[ldepth]);
+- if(writeimageblock(w, p, bpl) == ERROR)
++ if(writeimageblock(w, p, bpl, bdev->memory) == ERROR) {
++ gs_free_object(bdev->memory, buf, "inferno line buffer");
++ /* w leaks here */
+ return_error(gs_error_Fatal);
++ }
+ }
+- if(writeimageblock(w, nil, 0) == ERROR)
++ gs_free_object(bdev->memory, buf, "inferno line buffer");
++ if(writeimageblock(w, nil, 0, bdev->memory) == ERROR) {
+ return_error(gs_error_Fatal);
++ }
+
+ return 0;
+ }
+
+ /*
+ * this is a modified version of the image compressor
+- * from fb/bit2enc. it is modified only in that it
++ * from fb/bit2enc. it is modified only in that it
+ * now compiles as part of gs.
++ * some updates have been made to use dynamic memory.
+ */
+
+ /*
+@@ -402,7 +429,7 @@ struct WImage {
+ /*
+ * ibase is the pointer to where the beginning of
+ * the input "is" in memory. whenever we "slide" the
+- * buffer N bytes, what we are actually doing is
++ * buffer N bytes, what we are actually doing is
+ * decrementing ibase by N.
+ * the ulongs in the Hlist structures are just
+ * pointers relative to ibase.
+@@ -537,7 +564,7 @@ gobbleline(WImage *w)
+ /* hash table lookup */
+ for(hp=w->hash[w->h].next;hp;hp=hp->next){
+ /*
+- * the next block is an optimization of
++ * the next block is an optimization of
+ * for(s=p, t=w->ibase+hp->p; s<es && *s == *t; s++, t++)
+ * ;
+ */
+@@ -563,7 +590,7 @@ gobbleline(WImage *w)
+ }
+
+ /*
+- * if we didn't find a long enough run, append to
++ * if we didn't find a long enough run, append to
+ * the raw dump buffer
+ */
+ if(runlen<NMATCH){
+@@ -636,7 +663,7 @@ shiftwindow(WImage *w, uchar *data, uchar *edata)
+ }
+
+ static WImage*
+-initwriteimage(FILE *f, Rectangle r, int ldepth)
++initwriteimage(FILE *f, Rectangle r, int ldepth, gs_memory_t *mem)
+ {
+ WImage *w;
+ int n, bpl;
+@@ -648,7 +675,7 @@ initwriteimage(FILE *f, Rectangle r, int ldepth)
+ }
+
+ n = NMEM+NMATCH+NRUN+bpl*2;
+- w = malloc(n+sizeof(*w));
++ w = (WImage*)gs_alloc_bytes(mem, n+sizeof(*w), "inferno image");
+ if(w == nil)
+ return nil;
+ w->inbuf = (uchar*) &w[1];
+@@ -673,7 +700,7 @@ initwriteimage(FILE *f, Rectangle r, int ldepth)
+ }
+
+ static int
+-writeimageblock(WImage *w, uchar *data, int ndata)
++writeimageblock(WImage *w, uchar *data, int ndata, gs_memory_t *mem)
+ {
+ uchar *edata;
+
+@@ -685,7 +712,7 @@ writeimageblock(WImage *w, uchar *data, int ndata)
+ if(w->r.min.y != w->origr.max.y) {
+ errprintf("not enough data supplied to writeimage\n");
+ }
+- free(w);
++ gs_free_object(mem, w, "inferno image");
+ return 0;
+ }
+
+@@ -704,7 +731,7 @@ writeimageblock(WImage *w, uchar *data, int ndata)
+ }
+
+ /*
+- * functions from the Plan9/Brazil drawing libraries
++ * functions from the Plan9/Brazil drawing libraries
+ */
+ static int
+ bytesperline(Rectangle r, int ld)
+diff --git a/base/gdevm24.c b/base/gdevm24.c
+--- a/base/gdevm24.c
++++ b/base/gdevm24.c
+@@ -24,11 +24,10 @@
+ /*
+ * Define whether to use the library's memset.
+ */
+-/*#define USE_MEMSET*/
++#define USE_MEMSET
++
+ /*
+- * Define whether to use memcpy for very wide fills. We thought this
+- * made a big difference, but it turned out to be an artifact of the
+- * profiler.
++ * Define whether to use memcpy for very wide fills.
+ */
+ /*#define USE_MEMCPY*/
+
+diff --git a/base/gdevmem.c b/base/gdevmem.c
+--- a/base/gdevmem.c
++++ b/base/gdevmem.c
+@@ -168,9 +168,11 @@ gs_make_mem_device(gx_device_memory * dev, const gx_device_memory * mdproto,
+ dev->cached_colors = target->cached_colors;
+ }
+ if (dev->color_info.depth == 1) {
+- gdev_mem_mono_set_inverted(dev,
+- (target == 0 ||
+- dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE));
++ gx_color_value cv[3];
++
++ cv[0] = cv[1] = cv[2] = 0;
++ gdev_mem_mono_set_inverted(dev, (target == 0 ||
++ (*dev_proc(dev, map_rgb_color))((gx_device *)dev, cv) != 0));
+ }
+ check_device_separable((gx_device *)dev);
+ gx_device_fill_in_procs((gx_device *)dev);
+diff --git a/base/gdevp14.c b/base/gdevp14.c
+--- a/base/gdevp14.c
++++ b/base/gdevp14.c
+@@ -43,6 +43,8 @@
+ #include "gxclpath.h"
+ #include "gxdcconv.h"
+ #include "vdtrace.h"
++#include "gscolorbuffer.h"
++#include "gsptype2.h"
+
+ /* Visual trace options : set one to 1. */
+ #define VD_PAINT_MASK 0
+@@ -50,7 +52,8 @@
+ #define VD_PAINT_ALPHA 1
+
+ #if RAW_DUMP
+-unsigned char global_index = 0;
++unsigned int global_index = 0;
++unsigned int clist_band_count = 0;
+ #endif
+
+ /*
+@@ -82,6 +85,9 @@ gs_private_st_ptrs2(st_pdf14_ctx, pdf14_ctx, "pdf14_ctx",
+ pdf14_ctx_enum_ptrs, pdf14_ctx_reloc_ptrs,
+ stack, maskbuf);
+
++gs_private_st_ptrs1(st_pdf14_clr, pdf14_parent_color_t, "pdf14_clr",
++ pdf14_clr_enum_ptrs, pdf14_clr_reloc_ptrs,
++ previous);
+
+ /* ------ The device descriptors ------ */
+
+@@ -120,6 +126,8 @@ static int pdf14_clist_get_param_compressed_color_list(pdf14_device * p14dev);
+
+ static const gx_color_map_procs *
+ pdf14_get_cmap_procs(const gs_imager_state *, const gx_device *);
++static const gx_color_map_procs *
++ pdf14_get_cmap_procs_group(const gs_imager_state *, const gx_device *);
+
+ #define XSIZE (int)(8.5 * X_DPI) /* 8.5 x 11 inch page, by default */
+ #define YSIZE (int)(11 * Y_DPI)
+@@ -228,6 +236,27 @@ static int pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis,
+ static int pdf14_custom_put_image(gx_device * dev, gs_imager_state * pis,
+ gx_device * target);
+
++/* Used to alter device color mapping procs based upon group or softmask color space */
++static int pdf14_update_device_color_procs(gx_device *dev,
++ gs_transparency_color_t group_color,
++ gs_imager_state *pis);
++
++
++/* Used to alter device color mapping procs based upon group or softmask color space */
++/* Uses color procs stack so that it can be used with clist writer */
++static int
++pdf14_update_device_color_procs_push_c(gx_device *dev,
++ gs_transparency_color_t group_color,
++ gs_imager_state *pis);
++
++static int
++pdf14_update_device_color_procs_pop_c(gx_device *dev,
++ gs_imager_state *pis);
++
++
++static void pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis);
++static void pdf14_pop_parent_color(gx_device *dev, const gs_imager_state *pis);
++
+ static const pdf14_procs_t gray_pdf14_procs = {
+ pdf14_unpack_additive,
+ pdf14_put_image
+@@ -274,9 +303,10 @@ static const pdf14_nonseparable_blending_procs_t custom_blending_procs = {
+ };
+
+ const pdf14_device gs_pdf14_Gray_device = {
+- std_device_color_stype_body(pdf14_device, &pdf14_Gray_procs, "pdf14gray",
++ std_device_std_color_full_body_type(pdf14_device, &pdf14_Gray_procs, "pdf14gray",
+ &st_pdf14_device,
+- XSIZE, YSIZE, X_DPI, Y_DPI, 8, 255, 256),
++ XSIZE, YSIZE, X_DPI, Y_DPI, 8,
++ 0, 0, 0, 0, 0, 0),
+ { 0 }, /* Procs */
+ NULL, /* target */
+ { 0 }, /* devn_params - not used */
+@@ -365,7 +395,7 @@ const pdf14_device gs_pdf14_custom_device = {
+ static
+ ENUM_PTRS_WITH(pdf14_device_enum_ptrs, pdf14_device *pdev)
+ {
+- index -= 3;
++ index -= 4;
+ if (index < pdev->devn_params.separations.num_separations)
+ ENUM_RETURN(pdev->devn_params.separations.names[index].data);
+ index -= pdev->devn_params.separations.num_separations;
+@@ -374,10 +404,13 @@ ENUM_PTRS_WITH(pdf14_device_enum_ptrs, pdf14_device *pdev)
+ return 0;
+ }
+ case 0: return ENUM_OBJ(pdev->ctx);
+-case 1: ENUM_RETURN(gx_device_enum_ptr(pdev->target));
+-case 2: ENUM_RETURN(pdev->devn_params.compressed_color_list);
++case 1: return ENUM_OBJ(pdev->trans_group_parent_cmap_procs);
++case 2: ENUM_RETURN(gx_device_enum_ptr(pdev->target));
++case 3: ENUM_RETURN(pdev->devn_params.compressed_color_list);
+ ENUM_PTRS_END
+
++
++
+ static RELOC_PTRS_WITH(pdf14_device_reloc_ptrs, pdf14_device *pdev)
+ {
+ {
+@@ -389,6 +422,7 @@ static RELOC_PTRS_WITH(pdf14_device_reloc_ptrs, pdf14_device *pdev)
+ }
+ RELOC_PTR(pdf14_device, devn_params.compressed_color_list);
+ RELOC_VAR(pdev->ctx);
++ RELOC_VAR(pdev->trans_group_parent_cmap_procs);
+ pdev->target = gx_device_reloc_ptr(pdev->target, gcst);
+ }
+ RELOC_PTRS_END
+@@ -406,6 +440,12 @@ pdf14_buf_new(gs_int_rect *rect, bool has_alpha_g, bool has_shape, bool idle,
+ int n_chan,
+ gs_memory_t *memory)
+ {
++
++ /* Note that alpha_g is the alpha for the GROUP */
++ /* This is distinct from the alpha that may also exist */
++ /* for the objects within the group. Hence it can introduce */
++ /* yet another plane */
++
+ pdf14_buf *result;
+ int rowstride = (rect->q.x - rect->p.x + 3) & -4;
+ int height = (rect->q.y - rect->p.y);
+@@ -421,6 +461,7 @@ pdf14_buf_new(gs_int_rect *rect, bool has_alpha_g, bool has_shape, bool idle,
+ if (result == NULL)
+ return result;
+
++ result->saved = NULL;
+ result->isolated = false;
+ result->knockout = false;
+ result->has_alpha_g = has_alpha_g;
+@@ -433,6 +474,9 @@ pdf14_buf_new(gs_int_rect *rect, bool has_alpha_g, bool has_shape, bool idle,
+ result->maskbuf = NULL;
+ result->idle = idle;
+ result->mask_id = 0;
++ result->parent_color_info_procs.get_cmap_procs = NULL;
++ result->parent_color_info_procs.parent_color_mapping_procs = NULL;
++ result->parent_color_info_procs.parent_color_comp_index = NULL;
+
+ if (height <= 0 || idle) {
+ /* Empty clipping - will skip all drawings. */
+@@ -479,7 +523,8 @@ pdf14_ctx_new(gs_int_rect *rect, int n_chan, bool additive, gs_memory_t *memory)
+ if (result == NULL)
+ return result;
+
+- buf = pdf14_buf_new(rect, false, false, false, n_chan, memory);
++ /* Note: buffer creation expects alpha to be in number of channels */
++ buf = pdf14_buf_new(rect, false, false, false, n_chan+1, memory);
+ if (buf == NULL) {
+ gs_free_object(memory, result, "pdf14_ctx_new");
+ return NULL;
+@@ -541,7 +586,7 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect,
+ bool isolated, bool knockout,
+ byte alpha, byte shape,
+ gs_blend_mode_t blend_mode, bool idle,
+- uint mask_id)
++ uint mask_id, int numcomps)
+ {
+ pdf14_buf *tos = ctx->stack;
+ pdf14_buf *buf, *backdrop;
+@@ -559,8 +604,18 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect,
+
+ has_shape = tos->has_shape || tos->knockout;
+
+- buf = pdf14_buf_new(rect, !isolated, has_shape, idle, ctx->n_chan, ctx->memory);
+- if_debug3('v', "[v]push buf: %d x %d, %d channels\n", buf->rect.p.x, buf->rect.p.y, buf->n_chan);
++ /* We need to create this based upon the size of
++ the color space + an alpha channel. NOT the device size
++ or the previous ctx size. */
++
++ /* The second parameter in pdf14_buf_new decides if we should
++ add a GROUP alpha channel to the buffer. If it is NOT isolated, then this
++ buffer will be added. If it is isolated, then the buffer will not be added.
++ I question the redundancy here of the alpha and the group alpha channel, but
++ that will need to be looked at later. */
++
++ buf = pdf14_buf_new(rect, !isolated, has_shape, idle, numcomps+1, ctx->memory);
++ if_debug3('v', "[v]push buf: %d x %d, %d channels\n", buf->rect.q.x - buf->rect.p.x, buf->rect.q.y - buf->rect.p.y, buf->n_chan);
+ if (buf == NULL)
+ return_error(gs_error_VMerror);
+ buf->isolated = isolated;
+@@ -589,17 +644,36 @@ pdf14_push_transparency_group(pdf14_ctx *ctx, gs_int_rect *rect,
+ (buf->has_shape ? 1 : 0)));
+ else
+ pdf14_preserve_backdrop(buf, tos, has_shape);
++
++
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ dump_raw_buffer(ctx->stack->rect.q.y-ctx->stack->rect.p.y,
++ ctx->stack->rowstride, ctx->stack->n_planes,
++ ctx->stack->planestride, ctx->stack->rowstride,
++ "TransGroupPush",ctx->stack->data);
++
++ global_index++;
++
++
++#endif
++
+ return 0;
++
+ }
+
+ static int
+ pdf14_pop_transparency_group(pdf14_ctx *ctx,
+- const pdf14_nonseparable_blending_procs_t * pblend_procs)
++ const pdf14_nonseparable_blending_procs_t * pblend_procs, int curr_num_color_comp)
+ {
+ pdf14_buf *tos = ctx->stack;
+ pdf14_buf *nos = tos->saved;
+ pdf14_buf *maskbuf = tos->maskbuf;
+ int x0, x1, y0, y1;
++ byte *new_data_buf;
++ int num_noncolor_planes, new_num_planes;
+
+ if (nos == NULL)
+ return_error(gs_error_rangecheck);
+@@ -637,9 +711,94 @@ pdf14_pop_transparency_group(pdf14_ctx *ctx,
+ x0 = max(x0, maskbuf->rect.p.x);
+ x1 = min(x1, maskbuf->rect.q.x);
+ }
+- if (x0 < x1 && y0 < y1)
+- pdf14_compose_group(tos, nos, maskbuf, x0, x1, y0, y1,
+- ctx->n_chan, ctx->additive, pblend_procs);
++
++
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ dump_raw_buffer(ctx->stack->rect.q.y-ctx->stack->rect.p.y,
++ ctx->stack->rowstride, ctx->stack->n_planes,
++ ctx->stack->planestride, ctx->stack->rowstride,
++ "Trans_Group_Pop",ctx->stack->data);
++
++
++#endif
++
++
++ /* If the color spaces are different and we actually did do a swap of the procs for color */
++ if(nos->parent_color_info_procs.num_components != curr_num_color_comp && nos->parent_color_info_procs.parent_color_mapping_procs != NULL){
++
++ if (x0 < x1 && y0 < y1) {
++
++ /* The NOS blending color space is different than that of the
++ TOS. It is necessary to transform the TOS buffer data to the
++ color space of the NOS prior to doing the pdf14_compose_group
++ operation. For now we are going to do very generic transformations.
++ This will be replaced when we bring in the updated color flow. */
++
++ /* Allocate the new buffer. If the number of channels in the the new
++ color space was less than or equal to the previous one, we could
++ reuse. Save that for a later optimization. */
++
++ num_noncolor_planes = tos->n_planes - curr_num_color_comp;
++ new_num_planes = num_noncolor_planes + nos->parent_color_info_procs.num_components;
++ new_data_buf = gs_alloc_bytes(ctx->memory, tos->planestride*new_num_planes,
++ "pdf14_buf_new");
++ if (new_data_buf == NULL)
++ return_error(gs_error_VMerror);
++
++ /* Initialize with 0. Need to double check about this...
++ may need to do some adjustments for the shape etc plane */
++ /* i.e. copy over those planes that exist beyond the count
++ of the number of color components */
++
++ memset(new_data_buf, 0, tos->planestride*new_num_planes);
++
++ /* Go ahead and do the conversion on the buffer */
++
++ /* later this will be replaced by gscms_transform_color_buffer */
++ /* This simple function is for planar data only. */
++
++ gs_transform_color_buffer_generic(tos->data,tos->rowstride,tos->planestride,
++ curr_num_color_comp,tos->rect,new_data_buf,nos->parent_color_info_procs.num_components,num_noncolor_planes);
++
++ /* Free the old object */
++
++ gs_free_object(ctx->memory, tos->data, "pdf14_buf_free");
++ tos->data = new_data_buf;
++
++ /* Adjust the plane and channel size now */
++
++ tos->n_chan = nos->n_chan;
++ tos->n_planes = nos->n_planes;
++
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ dump_raw_buffer(ctx->stack->rect.q.y-ctx->stack->rect.p.y,
++ ctx->stack->rowstride, ctx->stack->n_planes,
++ ctx->stack->planestride, ctx->stack->rowstride,
++ "Trans_Group_ColorConv",ctx->stack->data);
++
++#endif
++
++ /* compose */
++
++ pdf14_compose_group(tos, nos, maskbuf, x0, x1, y0, y1, nos->n_chan,
++ nos->parent_color_info_procs.isadditive,
++ nos->parent_color_info_procs.parent_blending_procs);
++
++ }
++
++
++ } else {
++
++ if (x0 < x1 && y0 < y1)
++ pdf14_compose_group(tos, nos, maskbuf, x0, x1, y0, y1,nos->n_chan, ctx->additive, pblend_procs);
++
++ }
+
+ exit:
+ ctx->stack = nos;
+@@ -651,6 +810,7 @@ exit:
+ */
+ ctx->maskbuf = (maskbuf != NULL ? maskbuf->maskbuf : NULL);
+ }
++
+ if_debug1('v', "[v]pop buf, idle=%d\n", tos->idle);
+ pdf14_buf_free(tos, ctx->memory);
+ if (maskbuf != NULL) {
+@@ -669,10 +829,13 @@ exit:
+ static int
+ pdf14_push_transparency_mask(pdf14_ctx *ctx, gs_int_rect *rect, byte bg_alpha,
+ byte *transfer_fn, bool idle, bool replacing,
+- uint mask_id)
++ uint mask_id, gs_transparency_mask_subtype_t subtype,
++ bool SMask_is_CIE, int numcomps)
+ {
+- pdf14_buf *buf;
+
++
++ pdf14_buf *buf;
++
+ if_debug2('v', "[v]pdf14_push_transparency_mask, idle=%d, replacing=%d\n", idle, replacing);
+ if (replacing && ctx->maskbuf != NULL) {
+ if (ctx->maskbuf->maskbuf != NULL) {
+@@ -688,7 +851,15 @@ pdf14_push_transparency_mask(pdf14_ctx *ctx, gs_int_rect *rect, byte bg_alpha,
+ pdf14_buf_free(ctx->maskbuf, ctx->memory);
+ ctx->maskbuf = NULL;
+ }
+- buf = pdf14_buf_new(rect, false, false, idle, ctx->n_chan, ctx->memory);
++
++ /* An optimization to consider is that if the SubType is Alpha
++ then we really should only be allocating the alpha band and
++ only draw with that channel. Current architecture makes that
++ a bit tricky. We need to create this based upon the size of
++ the color space + an alpha channel. NOT the device size
++ or the previous ctx size */
++
++ buf = pdf14_buf_new(rect, false, false, idle, numcomps+1, ctx->memory);
+ if (buf == NULL)
+ return_error(gs_error_VMerror);
+
+@@ -708,8 +879,32 @@ pdf14_push_transparency_mask(pdf14_ctx *ctx, gs_int_rect *rect, byte bg_alpha,
+ buf->maskbuf = ctx->maskbuf;
+ }
+
++
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ if (ctx->stack->planestride > 0 ){
++ dump_raw_buffer(ctx->stack->rect.q.y-ctx->stack->rect.p.y,
++ ctx->stack->rowstride, ctx->stack->n_planes,
++ ctx->stack->planestride, ctx->stack->rowstride,
++ "Raw_Buf_PreSmask",ctx->stack->data);
++
++ global_index++;
++ }
++
++
++#endif
++
+ buf->saved = ctx->stack;
+ ctx->stack = buf;
++
++ /* Soft Mask related information so we know how to
++ compute luminosity when we pop the soft mask */
++
++ buf->SMask_is_CIE = SMask_is_CIE;
++ buf->SMask_SubType = subtype;
++
+ if (buf->data != NULL)
+ memset(buf->data, 0, buf->planestride * buf->n_chan);
+ return 0;
+@@ -719,15 +914,78 @@ static int
+ pdf14_pop_transparency_mask(pdf14_ctx *ctx)
+ {
+ pdf14_buf *tos = ctx->stack;
++ byte *new_data_buf;
+
+ if_debug1('v', "[v]pdf14_pop_transparency_mask, idle=%d\n", tos->idle);
+ ctx->stack = tos->saved;
++ tos->saved = NULL; /* To avoid issues with GC */
++
+ if (tos->maskbuf) {
+ /* The maskbuf of the ctx->maskbuf entry is never used, free it now */
++ /* In other words, the Smask will not have an Smask */
+ pdf14_buf_free(tos->maskbuf, ctx->memory);
+ tos->maskbuf = NULL;
+ }
+- ctx->maskbuf = tos;
++
++ if (tos->data == NULL) {
++
++ /* This can occur in clist rendering if the soft mask does
++ not intersect the current band. It would be nice to
++ catch this earlier and just avoid creating the structure
++ to begin with. For now we need to delete the structure
++ that was created. */
++
++ pdf14_buf_free(tos, ctx->memory);
++ ctx->maskbuf = NULL;
++
++ } else {
++
++ /* Lets get this to a monochrome buffer and map it to a luminance only value */
++ /* This will reduce our memory. We won't reuse the existing one, due */
++ /* Due to the fact that on certain systems we may have issues recovering */
++ /* the data after a resize */
++
++ new_data_buf = gs_alloc_bytes(ctx->memory, tos->planestride,
++ "pdf14_buf_new");
++ if (new_data_buf == NULL)
++ return_error(gs_error_VMerror);
++
++ /* Initialize with 0. Need to do this since in Smask_Luminosity_Mapping
++ we won't be filling everything during the remap if it had not been
++ written into by the PDF14 fill rect */
++
++ memset(new_data_buf, 0, tos->planestride);
++
++ Smask_Luminosity_Mapping(tos->rect.q.y - tos->rect.p.y ,tos->rect.q.x - tos->rect.p.x,tos->n_chan,
++ tos->rowstride, tos->planestride, new_data_buf, tos->data, ctx->additive,
++ tos->SMask_is_CIE, tos->SMask_SubType);
++
++ /* Free the old object, NULL test was above */
++
++ gs_free_object(ctx->memory, tos->data, "pdf14_buf_free");
++ tos->data = new_data_buf;
++
++ /* Data is single channel now */
++
++ tos->n_chan = 1;
++ tos->n_planes = 1;
++
++ /* If we were CIE based, clean up the joint cache we created.
++ see comments in gs_begin_transparency_mask */
++
++ /* if ( tos->SMask_is_CIE ){
++
++ gs_free_object(mem, pis->cie_joint_caches,
++ "gx_cie_to_xyz_free(joint caches)");
++
++ } */
++
++ /* Assign as mask buffer */
++
++ ctx->maskbuf = tos;
++
++ }
++
+ return 0;
+ }
+
+@@ -744,7 +1002,7 @@ pdf14_open(gx_device *dev)
+ rect.p.y = 0;
+ rect.q.x = dev->width;
+ rect.q.y = dev->height;
+- pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components + 1,
++ pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components,
+ pdev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, dev->memory);
+ if (pdev->ctx == NULL)
+ return_error(gs_error_VMerror);
+@@ -852,6 +1110,21 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target)
+ return code;
+ }
+
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ dump_raw_buffer(pdev->ctx->stack->rect.q.y-pdev->ctx->stack->rect.p.y,
++ pdev->ctx->stack->rect.q.x-pdev->ctx->stack->rect.p.x,
++ pdev->ctx->stack->n_planes,
++ pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride,
++ "PDF14_PUTIMAGE",pdev->ctx->stack->data);
++
++ global_index++;
++ clist_band_count++;
++
++#endif
++
+ linebuf = gs_alloc_bytes(pdev->memory, width * num_comp, "pdf14_put_image");
+ for (y = 0; y < height; y++) {
+ gx_image_plane_t planes;
+@@ -898,7 +1171,6 @@ pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis, gx_device * tar
+ pdf14_device * pdev = (pdf14_device *)dev;
+ pdf14_buf *buf = pdev->ctx->stack;
+ gs_int_rect rect = buf->rect;
+- int x0 = rect.p.x, y0 = rect.p.y;
+ int x1, y1, width, height;
+ gs_devn_params * pdevn_params = &pdev->devn_params;
+ gs_separations * pseparations = &pdevn_params->separations;
+@@ -930,6 +1202,7 @@ pdf14_cmykspot_put_image(gx_device * dev, gs_imager_state * pis, gx_device * tar
+ "CMYK_SPOT_PUTIMAGE",pdev->ctx->stack->data);
+
+ global_index++;
++ clist_band_count++;
+
+
+ #endif
+@@ -1112,6 +1385,24 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
+ const gx_clip_path *pcpath)
+ {
+ gs_imager_state new_is = *pis;
++ int code;
++ gs_pattern2_instance_t *pinst = NULL;
++
++
++ if (pdcolor != NULL && gx_dc_is_pattern2_color(pdcolor)) {
++
++ pinst =
++ (gs_pattern2_instance_t *)pdcolor->ccolor.pattern;
++ pinst->saved->has_transparency = true;
++
++ /* The transparency color space operations are driven
++ by the pdf14 clist writer device. */
++
++ pinst->saved->trans_device = dev;
++
++ }
++
++
+
+ /*
+ * The blend operations are not idempotent. Force non-idempotent
+@@ -1119,7 +1410,20 @@ pdf14_fill_path(gx_device *dev, const gs_imager_state *pis,
+ */
+ new_is.log_op |= lop_pdf14;
+ pdf14_set_marking_params(dev, pis);
+- return gx_default_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
++
++ new_is.trans_device = dev;
++ new_is.has_transparency = true;
++
++ code = gx_default_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
++
++ new_is.trans_device = NULL;
++ new_is.has_transparency = false;
++
++ if (pinst != NULL){
++ pinst->saved->trans_device = NULL;
++ }
++
++ return code;
+ }
+
+ static int
+@@ -1258,13 +1562,18 @@ static pdf14_default_colorspace_t
+ pdf14_determine_default_blend_cs(gx_device * pdev)
+ {
+ if (pdev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
++
+ /*
+ * Note: We do not allow the SeparationOrder device parameter for
+ * additive devices. Thus we always have 1 colorant for DeviceGray
+- * and 3 colorants for DeviceRGB. We do not currently support
+- * blending in a DeviceGray color space. Thus we oniy use DeviceRGB.
++ * and 3 colorants for DeviceRGB.
+ */
+- return PDF14_DeviceRGB;
++
++ if (pdev->color_info.num_components == 1)
++ return PDF14_DeviceGray;
++ else
++ return PDF14_DeviceRGB;
++
+ else {
+ /*
+ * Check if the device is CMYK only or CMYK plus spot colors.
+@@ -1332,6 +1641,22 @@ get_pdf14_device_proto(gx_device * dev, pdf14_device ** pdevproto,
+ switch (dev_cs) {
+ case PDF14_DeviceGray:
+ *pdevproto = (pdf14_device *)&gs_pdf14_Gray_device;
++
++ /* We want gray to be single channel. Low level
++ initialization of gray device prototype is
++ peculiar in that in dci_std_color_num_components
++ the comment is
++ "A device is monochrome only if it is bi-level"
++
++ Here we want monochrome anytime we have a gray device.
++ To avoid breaking things elsewhere, we will overide
++ the prototype intialization here */
++
++ *ptempdevproto = **pdevproto;
++ ptempdevproto->color_info.max_components = 1;
++ ptempdevproto->color_info.num_components = ptempdevproto->color_info.max_components;
++ *pdevproto = ptempdevproto;
++
+ break;
+ case PDF14_DeviceRGB:
+ *pdevproto = (pdf14_device *)&gs_pdf14_RGB_device;
+@@ -1438,12 +1763,14 @@ gx_update_pdf14_compositor(gx_device * pdev, gs_imager_state * pis,
+ pis->get_cmap_procs = p14dev->save_get_cmap_procs;
+ gx_set_cmap_procs(pis, p14dev->target);
+ /* Send image out raster data to output device */
+- { /* hack: Reset lop_pdf14, which could be set by
+- pdf14_fill_path, pdf14_stroke_path
+- to prevent a failure ingx_image_enum_begin. */
++ {
++ /* Make a copy so we can change the ROP */
+ gs_imager_state new_is = *pis;
+
+- new_is.log_op &= ~lop_pdf14;
++ /* We don't use the imager state log_op since this is for the */
++ /* clist playback. Putting the image (band in the case of the */
++ /* clist) only needs to use the default ROP to copy the data */
++ new_is.log_op = rop3_default;
+ p14dev->pdf14_procs->put_image(pdev, &new_is, p14dev->target);
+ }
+ pdf14_disable_device(pdev);
+@@ -1529,11 +1856,12 @@ pdf14_create_compositor(gx_device * dev, gx_device * * pcdev,
+ if (op_pct->params.retain_any_comps && !op_pct->params.retain_spot_comps)
+ {
+
+- p14dev->drawn_comps = op_pct->params.drawn_comps;
++ p14dev->drawn_comps = op_pct->params.drawn_comps;
+
+ } else {
+
+- p14dev->drawn_comps = (1 << p14dev->color_info.num_components) - 1;
++ /* Draw everything. If this parameter was not set, clist does not fill it in. */
++ p14dev->drawn_comps = ( (gx_color_index) 1 << (p14dev->color_info.num_components)) - (gx_color_index) 1;
+ }
+
+ *pcdev = dev;
+@@ -1698,18 +2026,99 @@ pdf14_begin_transparency_group(gx_device *dev,
+ double alpha = pis->opacity.alpha * pis->shape.alpha;
+ gs_int_rect rect;
+ int code;
++ bool isolated;
++ bool sep_target = (strcmp(pdev->dname, "PDF14cmykspot") == 0);
++ int group_color_numcomps;
++ gs_transparency_color_t group_color;
++
++ /* If the target device supports separations, then
++ we should should NOT create the group. The exception to this
++ rule would be if we just popped a transparency mask */
+
+ code = compute_group_device_int_rect(pdev, &rect, pbbox, pis);
++
+ if (code < 0)
+ return code;
+ if_debug4('v', "[v]pdf14_begin_transparency_group, I = %d, K = %d, alpha = %g, bm = %d\n",
+ ptgp->Isolated, ptgp->Knockout, alpha, pis->blend_mode);
++
++ /* If the group color is unknown, then we must use the previous group color
++ space or the device process color space */
++
++ if (ptgp->group_color == UNKNOWN){
++
++ if (pdev->ctx->stack){
++ /* Use previous group color space */
++ group_color_numcomps = pdev->ctx->stack->n_chan-1; /* Remove alpha */
++ } else {
++ /* Use process color space */
++ group_color_numcomps = pdev->color_info.num_components;
++ }
++
++ switch (group_color_numcomps) {
++ case 1:
++ group_color = GRAY_SCALE;
++ break;
++ case 3:
++ group_color = DEVICE_RGB;
++ break;
++ case 4:
++ group_color = DEVICE_CMYK;
++ break;
++ default:
++
++ /* We can end up here if we are in
++ a deviceN color space and
++ we have a sep output device */
++
++ group_color = DEVICEN;
++
++ break;
++
++ }
++
++ } else {
++
++ group_color_numcomps = ptgp->group_color_numcomps;
++ group_color = ptgp->group_color;
++
++ }
++
++ /* If needed, update the color mapping procs. But only if we dont have a sep device.
++ The exception would be if we are in doing the group for a soft mask */
++
++ if (!sep_target) {
++ code = pdf14_update_device_color_procs(dev,group_color,pis);
++ } else {
++ code = 0;
++ group_color_numcomps = pdev->color_info.num_components;
++ }
++
++ /* Note that our initial device buffer may have had a different color space
++ than the first transparency group. In such a case, we really should force
++ this first group to be isolated, anytime that the parent color space is
++ different than its child group, it should be isolated, per the PDF spec */
++
++ if (code == 1){
++
++ isolated = true;
++ if_debug0('v', "[v]Transparency group color space change\n");
++
++ } else {
++
++ isolated = ptgp->Isolated;
++
++ }
++
++ if (code < 0)
++ return code;
++
+ code = pdf14_push_transparency_group(pdev->ctx, &rect,
+- ptgp->Isolated, ptgp->Knockout,
++ isolated, ptgp->Knockout,
+ (byte)floor (255 * alpha + 0.5),
+ (byte)floor (255 * pis->shape.alpha + 0.5),
+ pis->blend_mode, ptgp->idle,
+- ptgp->mask_id);
++ ptgp->mask_id,group_color_numcomps);
+ return code;
+ }
+
+@@ -1720,6 +2129,7 @@ pdf14_end_transparency_group(gx_device *dev,
+ {
+ pdf14_device *pdev = (pdf14_device *)dev;
+ int code;
++ pdf14_parent_color_t *parent_color;
+
+ if_debug0('v', "[v]pdf14_end_transparency_group\n");
+ vd_get_dc('c');
+@@ -1727,11 +2137,437 @@ pdf14_end_transparency_group(gx_device *dev,
+ vd_set_scale(0.01);
+ vd_set_origin(0, 0);
+ vd_erase(RGB(192, 192, 192));
+- code = pdf14_pop_transparency_group(pdev->ctx, pdev->blend_procs);
++ code = pdf14_pop_transparency_group(pdev->ctx, pdev->blend_procs,pdev->color_info.num_components);
++
++
++ /* May need to reset some color stuff related
++ * to a mismatch between the parents color space
++ * and the group blending space */
++
++ parent_color = &(pdev->ctx->stack->parent_color_info_procs);
++
++ if (!(parent_color->parent_color_mapping_procs == NULL &&
++ parent_color->parent_color_comp_index == NULL)) {
++
++ pis->get_cmap_procs = parent_color->get_cmap_procs;
++ gx_set_cmap_procs(pis, dev);
++
++ pdev->procs.get_color_mapping_procs = parent_color->parent_color_mapping_procs;
++ pdev->procs.get_color_comp_index = parent_color->parent_color_comp_index;
++ pdev->color_info.polarity = parent_color->polarity;
++ pdev->color_info.num_components = parent_color->num_components;
++ pdev->blend_procs = parent_color->parent_blending_procs;
++ pdev->ctx->additive = parent_color->isadditive;
++ pdev->pdf14_procs = parent_color->unpack_procs;
++ pdev->color_info.depth = parent_color->depth;
++
++ parent_color->get_cmap_procs = NULL;
++ parent_color->parent_color_comp_index = NULL;
++ parent_color->parent_color_mapping_procs = NULL;
++ }
++
++
++
++
++
++
++
++
++
+ vd_release_dc;
+ return code;
+ }
+
++
++static int
++pdf14_update_device_color_procs(gx_device *dev,
++ gs_transparency_color_t group_color,
++ gs_imager_state *pis)
++{
++
++ pdf14_device *pdevproto;
++ pdf14_device *pdev = (pdf14_device *)dev;
++ const pdf14_procs_t *new_14procs;
++ pdf14_parent_color_t *parent_color_info = &(pdev->ctx->stack->parent_color_info_procs);
++ gx_color_polarity_t new_polarity;
++ int new_num_comps;
++ bool new_additive;
++ byte new_depth;
++
++ if_debug0('v', "[v]pdf14_update_device_color_procs\n");
++
++
++ /* Update the device procs at this
++ stage. Many of the procs are based upon the color
++ space of the device. We want to remain in
++ the color space defined by the color space of
++ the soft mask or transparency group as opposed to the
++ device color space.
++ Later, when we pop the softmask we will collapse it
++ to a single band and then compose with it
++ to the device color space (or the parent layer
++ space). In the case where we pop an isolated transparency
++ group, we will do the blending in the proper color
++ space and then transform the data when we pop the group.
++ Remember that only isolated groups can have color spaces
++ that are different than their parent. */
++
++ parent_color_info->get_cmap_procs = NULL;
++ parent_color_info->parent_color_mapping_procs = NULL;
++ parent_color_info->parent_color_comp_index = NULL;
++
++ switch (group_color) {
++
++ case GRAY_SCALE:
++
++ new_polarity = GX_CINFO_POLARITY_ADDITIVE;
++ new_num_comps = 1;
++ pdevproto = (pdf14_device *)&gs_pdf14_Gray_device;
++ new_additive = true;
++ new_14procs = &gray_pdf14_procs;
++ new_depth = 8;
++
++
++ break;
++
++ case DEVICE_RGB:
++ case CIE_XYZ:
++
++ new_polarity = GX_CINFO_POLARITY_ADDITIVE;
++ new_num_comps = 3;
++ pdevproto = (pdf14_device *)&gs_pdf14_RGB_device;
++ new_additive = true;
++ new_14procs = &rgb_pdf14_procs;
++ new_depth = 24;
++
++ break;
++
++ case DEVICE_CMYK:
++
++ new_polarity = GX_CINFO_POLARITY_SUBTRACTIVE;
++ new_num_comps = 4;
++ pdevproto = (pdf14_device *)&gs_pdf14_CMYK_device;
++ new_additive = false;
++ new_14procs = &cmyk_pdf14_procs;
++ new_depth = 32;
++
++ break;
++
++ default:
++ return_error(gs_error_rangecheck);
++ break;
++
++ }
++
++ if_debug2('v', "[v]pdf14_update_device_color_procs,num_components_old = %d num_components_new = %d\n",
++ pdev->color_info.num_components,new_num_comps);
++
++ /* Save the old information */
++
++ parent_color_info->get_cmap_procs = pis->get_cmap_procs;
++ parent_color_info->parent_color_mapping_procs =
++ pdev->procs.get_color_mapping_procs;
++ parent_color_info->parent_color_comp_index =
++ pdev->procs.get_color_comp_index;
++ parent_color_info->parent_blending_procs = pdev->blend_procs;
++ parent_color_info->polarity = pdev->color_info.polarity;
++ parent_color_info->num_components = pdev->color_info.num_components;
++ parent_color_info->isadditive = pdev->ctx->additive;
++ parent_color_info->unpack_procs = pdev->pdf14_procs;
++ parent_color_info->depth = pdev->color_info.depth;
++
++ /* Set new information */
++
++ pis->get_cmap_procs = pdf14_get_cmap_procs_group;
++ gx_set_cmap_procs(pis, dev);
++ pdev->procs.get_color_mapping_procs =
++ pdevproto->static_procs->get_color_mapping_procs;
++ pdev->procs.get_color_comp_index =
++ pdevproto->static_procs->get_color_comp_index;
++ pdev->blend_procs = pdevproto->blend_procs;
++ pdev->color_info.polarity = new_polarity;
++ pdev->color_info.num_components = new_num_comps;
++ pdev->ctx->additive = new_additive;
++ pdev->pdf14_procs = new_14procs;
++ pdev->color_info.depth = new_depth;
++
++ return(1); /* Lets us detect that we did do an update */
++
++}
++
++
++/* A new version that works with the color_procs stack
++ for transparency groups */
++
++static int
++pdf14_update_device_color_procs_push_c(gx_device *dev,
++ gs_transparency_color_t group_color,
++ gs_imager_state *pis)
++{
++
++ pdf14_device *pdevproto;
++ pdf14_device *pdev = (pdf14_device *)dev;
++ gx_device_clist_writer * cldev = (gx_device_clist_writer *)pdev->pclist_device;
++ const pdf14_procs_t *new_14procs;
++ bool update_color_info;
++ gx_color_polarity_t new_polarity;
++ int new_num_comps;
++ bool new_additive;
++ byte new_depth;
++
++ if_debug0('v', "[v]pdf14_update_device_color_procs_push_c\n");
++
++ /* Check if we need to alter the device procs at this
++ stage. Many of the procs are based upon the color
++ space of the device. We want to remain in
++ the color space defined by the color space of
++ the soft mask or transparency group as opposed to the
++ device color space.
++ Later, when we pop the softmask we will collapse it
++ to a single band and then compose with it
++ to the device color space (or the parent layer
++ space). In the case where we pop an isolated transparency
++ group, we will do the blending in the proper color
++ space and then transform the data when we pop the group.
++ Remember that only isolated groups can have color spaces
++ that are different than their parent. */
++
++ update_color_info = false;
++
++ switch (group_color) {
++
++ case GRAY_SCALE:
++
++ if (pdev->color_info.num_components != 1){
++
++ update_color_info = true;
++ new_polarity = GX_CINFO_POLARITY_ADDITIVE;
++ new_num_comps = 1;
++ pdevproto = (pdf14_device *)&gs_pdf14_Gray_device;
++ new_additive = true;
++ new_14procs = &gray_pdf14_procs;
++ new_depth = 8;
++
++ }
++
++ break;
++
++ case DEVICE_RGB:
++ case CIE_XYZ:
++
++ if (pdev->color_info.num_components != 3){
++
++ update_color_info = true;
++ new_polarity = GX_CINFO_POLARITY_ADDITIVE;
++ new_num_comps = 3;
++ pdevproto = (pdf14_device *)&gs_pdf14_RGB_device;
++ new_additive = true;
++ new_14procs = &rgb_pdf14_procs;
++ new_depth = 24;
++ }
++
++ break;
++
++ case DEVICE_CMYK:
++
++ if (pdev->color_info.num_components != 4){
++
++ update_color_info = true;
++ new_polarity = GX_CINFO_POLARITY_SUBTRACTIVE;
++ new_num_comps = 4;
++ pdevproto = (pdf14_device *)&gs_pdf14_CMYK_device;
++ new_additive = false;
++ new_14procs = &cmyk_pdf14_procs;
++ new_depth = 32;
++
++ }
++
++ break;
++
++ default:
++ return_error(gs_error_rangecheck);
++ break;
++
++ }
++
++ if (update_color_info){
++
++ if_debug2('v', "[v]pdf14_update_device_color_procs_push_c,num_components_old = %d num_components_new = %d\n",
++ pdev->color_info.num_components,new_num_comps);
++
++ /* Set new information in the device */
++
++ pis->get_cmap_procs = pdf14_get_cmap_procs_group;
++ gx_set_cmap_procs(pis, dev);
++ pdev->procs.get_color_mapping_procs =
++ pdevproto->static_procs->get_color_mapping_procs;
++ pdev->procs.get_color_comp_index =
++ pdevproto->static_procs->get_color_comp_index;
++ pdev->blend_procs = pdevproto->blend_procs;
++ pdev->color_info.polarity = new_polarity;
++ pdev->color_info.num_components = new_num_comps;
++ pdev->pdf14_procs = new_14procs;
++ pdev->color_info.depth = new_depth;
++
++ cldev->clist_color_info.depth = pdev->color_info.depth;
++ cldev->clist_color_info.polarity = pdev->color_info.polarity;
++ cldev->clist_color_info.num_components = pdev->color_info.num_components;
++
++
++
++ if (pdev->ctx)
++ {
++ pdev->ctx->additive = new_additive;
++ }
++
++ return(1); /* Lets us detect that we did do an update */
++
++ }
++
++ if_debug0('v', "[v]procs not updated\n");
++
++ return 0;
++}
++
++
++static int
++pdf14_update_device_color_procs_pop_c(gx_device *dev,gs_imager_state *pis)
++{
++
++ pdf14_device *pdev = (pdf14_device *)dev;
++ pdf14_parent_color_t *parent_color = pdev->trans_group_parent_cmap_procs;
++ gx_device_clist_writer * cldev = (gx_device_clist_writer *)pdev->pclist_device;
++
++
++ if_debug0('v', "[v]pdf14_update_device_color_procs_pop_c\n");
++
++ /* The color procs are always pushed. Simply restore them. */
++
++ if (!(parent_color->parent_color_mapping_procs == NULL &&
++ parent_color->parent_color_comp_index == NULL)) {
++
++ if_debug2('v', "[v]pdf14_update_device_color_procs_pop_c,num_components_old = %d num_components_new = %d\n",
++ pdev->color_info.num_components,parent_color->num_components);
++
++ pis->get_cmap_procs = parent_color->get_cmap_procs;
++ gx_set_cmap_procs(pis, dev);
++
++ pdev->procs.get_color_mapping_procs = parent_color->parent_color_mapping_procs;
++ pdev->procs.get_color_comp_index = parent_color->parent_color_comp_index;
++ pdev->color_info.polarity = parent_color->polarity;
++ pdev->color_info.depth = parent_color->depth;
++ pdev->color_info.num_components = parent_color->num_components;
++ pdev->blend_procs = parent_color->parent_blending_procs;
++ pdev->pdf14_procs = parent_color->unpack_procs;
++
++ /* clist writer fill rect has no access to imager state */
++ /* and it forwards the target device. this information */
++ /* is passed along to use in this case */
++
++ cldev->clist_color_info.depth = pdev->color_info.depth;
++ cldev->clist_color_info.polarity = pdev->color_info.polarity;
++ cldev->clist_color_info.num_components = pdev->color_info.num_components;
++
++ if (pdev->ctx){
++ pdev->ctx->additive = parent_color->isadditive;
++ }
++
++ if_debug0('v', "[v]procs updated\n");
++
++ } else {
++
++ if_debug0('v', "[v]pdf14_update_device_color_procs_pop_c ERROR \n");
++
++ }
++
++ return 0;
++}
++
++
++
++
++
++
++
++
++ /* When a transparency group is pushed, the parent colorprocs
++ are initialized. Since the color mapping procs are
++ all based upon the device, we must have a nested list
++ based upon the transparency group color space. This
++ nesting must be outside the nested ctx structures
++ to allow the nesting for the clist writer */
++
++static void
++pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis)
++{
++
++ pdf14_device *pdev = (pdf14_device *)dev;
++ pdf14_parent_color_t *new_parent_color;
++
++ if_debug0('v', "[v]pdf14_push_parent_color\n");
++
++ /* Allocate a new one */
++
++ new_parent_color = gs_alloc_struct(dev->memory, pdf14_parent_color_t,&st_pdf14_clr,
++ "pdf14_clr_new");
++
++ /* Link to old one */
++
++ new_parent_color->previous = pdev->trans_group_parent_cmap_procs;
++
++ /* Reassign new one to dev */
++
++ pdev->trans_group_parent_cmap_procs = new_parent_color;
++
++ /* Initialize with values */
++
++ new_parent_color->get_cmap_procs = pis->get_cmap_procs;
++ new_parent_color->parent_color_mapping_procs =
++ pdev->procs.get_color_mapping_procs;
++ new_parent_color->parent_color_comp_index =
++ pdev->procs.get_color_comp_index;
++ new_parent_color->parent_blending_procs = pdev->blend_procs;
++ new_parent_color->polarity = pdev->color_info.polarity;
++ new_parent_color->num_components = pdev->color_info.num_components;
++ new_parent_color->unpack_procs = pdev->pdf14_procs;
++ new_parent_color->depth = pdev->color_info.depth;
++
++ /* isadditive is only used in ctx */
++ if (pdev->ctx)
++ {
++ new_parent_color->isadditive = pdev->ctx->additive;
++ }
++
++}
++
++ /* When a transparency group is popped, the parent colorprocs
++ must be restored. Since the color mapping procs are
++ all based upon the device, we must have a nested list
++ based upon the transparency group color space. This
++ nesting must be outside the nested ctx structures
++ to allow the nesting for the clist writer */
++
++static void
++pdf14_pop_parent_color(gx_device *dev, const gs_imager_state *pis)
++{
++
++ pdf14_device *pdev = (pdf14_device *)dev;
++ pdf14_parent_color_t *old_parent_color_info = pdev->trans_group_parent_cmap_procs;
++
++ if_debug0('v', "[v]pdf14_pop_parent_color\n");
++
++ /* Update the link */
++
++ pdev->trans_group_parent_cmap_procs = old_parent_color_info->previous;
++
++ /* Free the old one */
++
++ gs_free_object(dev->memory, old_parent_color_info, "pdf14_clr_free");
++
++
++}
++
++
+ static int
+ pdf14_begin_transparency_mask(gx_device *dev,
+ const gx_transparency_mask_params_t *ptmp,
+@@ -1746,6 +2582,8 @@ pdf14_begin_transparency_mask(gx_device *dev,
+ "pdf14_begin_transparency_mask");
+ gs_int_rect rect;
+ int code;
++ int group_color_numcomps;
++ gs_transparency_color_t group_color;
+
+ if (transfer_fn == NULL)
+ return_error(gs_error_VMerror);
+@@ -1756,19 +2594,105 @@ pdf14_begin_transparency_mask(gx_device *dev,
+ bg_alpha = (int)(255 * ptmp->GrayBackground + 0.5);
+ if_debug1('v', "pdf14_begin_transparency_mask, bg_alpha = %d\n", bg_alpha);
+ memcpy(transfer_fn, ptmp->transfer_fn, size_of(ptmp->transfer_fn));
++
++ /* If the group color is unknown, then we must use the previous group color
++ space or the device process color space */
++
++ if (ptmp->group_color == UNKNOWN){
++
++ if (pdev->ctx->stack){
++ /* Use previous group color space */
++ group_color_numcomps = pdev->ctx->stack->n_chan-1; /* Remove alpha */
++ } else {
++ /* Use process color space */
++ group_color_numcomps = pdev->color_info.num_components;
++ }
++
++ switch (group_color_numcomps) {
++ case 1:
++ group_color = GRAY_SCALE;
++ break;
++ case 3:
++ group_color = DEVICE_RGB;
++ break;
++ case 4:
++ group_color = DEVICE_CMYK;
++ break;
++ default:
++
++ /* We can end up here if we are in
++ a deviceN color space and
++ we have a sep output device */
++
++ group_color = DEVICEN;
++
++ break;
++
++ }
++
++ } else {
++
++ group_color = ptmp->group_color;
++ group_color_numcomps = ptmp->group_color_numcomps;
++
++ }
++
++
++ /* Always update the color mapping procs. Otherwise we end up
++ fowarding to the target device. */
++ code = pdf14_update_device_color_procs(dev,group_color,pis);
++ if (code < 0)
++ return code;
++
++ /* Note that the soft mask always follows the group color requirements even
++ when we have a separable device */
++
+ return pdf14_push_transparency_mask(pdev->ctx, &rect, bg_alpha,
+ transfer_fn, ptmp->idle, ptmp->replacing,
+- ptmp->mask_id);
++ ptmp->mask_id, ptmp->subtype,
++ ptmp->SMask_is_CIE, group_color_numcomps);
+ }
+
+ static int
+-pdf14_end_transparency_mask(gx_device *dev,
++pdf14_end_transparency_mask(gx_device *dev, gs_imager_state *pis,
+ gs_transparency_mask_t **pptm)
+ {
+ pdf14_device *pdev = (pdf14_device *)dev;
++ pdf14_parent_color_t *parent_color;
++ int ok;
+
+ if_debug0('v', "pdf14_end_transparency_mask\n");
+- return pdf14_pop_transparency_mask(pdev->ctx);
++
++ ok = pdf14_pop_transparency_mask(pdev->ctx);
++
++ /* May need to reset some color stuff related
++ * to a mismatch between the Smask color space
++ * and the Smask blending space */
++
++ if (pdev->ctx->stack != NULL ) {
++
++ parent_color = &(pdev->ctx->stack->parent_color_info_procs);
++
++ if (!(parent_color->parent_color_mapping_procs == NULL &&
++ parent_color->parent_color_comp_index == NULL)) {
++
++ pis->get_cmap_procs = parent_color->get_cmap_procs;;
++ gx_set_cmap_procs(pis, dev);
++ pdev->procs.get_color_mapping_procs = parent_color->parent_color_mapping_procs;
++ pdev->procs.get_color_comp_index = parent_color->parent_color_comp_index;
++ pdev->color_info.polarity = parent_color->polarity;
++ pdev->color_info.num_components = parent_color->num_components;
++ pdev->color_info.depth = parent_color->depth;
++ pdev->blend_procs = parent_color->parent_blending_procs;
++ pdev->ctx->additive = parent_color->isadditive;
++ pdev->pdf14_procs = parent_color->unpack_procs;
++ parent_color->get_cmap_procs = NULL;
++ parent_color->parent_color_comp_index = NULL;
++ parent_color->parent_color_mapping_procs = NULL;
++ }
++ }
++
++ return ok;
+ }
+
+ static int
+@@ -1793,7 +2717,6 @@ pdf14_mark_fill_rectangle(gx_device * dev,
+ int alpha_g_off = shape_off + (has_shape ? planestride : 0);
+ bool overprint = pdev->overprint;
+ gx_color_index drawn_comps = pdev->drawn_comps;
+- bool overprint_mode = pdev->overprint_mode;
+ gx_color_index comps;
+ byte shape = 0; /* Quiet compiler. */
+ byte src_alpha;
+@@ -1879,8 +2802,8 @@ pdf14_mark_fill_rectangle(gx_device * dev,
+ }
+ line += rowstride;
+ }
+-
+-#if RAW_DUMP
++#if 0
++/* #if RAW_DUMP */
+
+ /* Dump the current buffer to see what we have. */
+
+@@ -1993,6 +2916,9 @@ pdf14_mark_fill_rectangle_ko_simple(gx_device * dev,
+ static cmap_proc_gray(pdf14_cmap_gray_direct);
+ static cmap_proc_rgb(pdf14_cmap_rgb_direct);
+ static cmap_proc_cmyk(pdf14_cmap_cmyk_direct);
++static cmap_proc_gray(pdf14_cmap_gray_direct_group);
++static cmap_proc_rgb(pdf14_cmap_rgb_direct_group);
++static cmap_proc_cmyk(pdf14_cmap_cmyk_direct_group);
+ static cmap_proc_rgb_alpha(pdf14_cmap_rgb_alpha_direct);
+ static cmap_proc_separation(pdf14_cmap_separation_direct);
+ static cmap_proc_devicen(pdf14_cmap_devicen_direct);
+@@ -2008,6 +2934,16 @@ static const gx_color_map_procs pdf14_cmap_many = {
+ pdf14_cmap_is_halftoned
+ };
+
++static const gx_color_map_procs pdf14_cmap_many_group = {
++ pdf14_cmap_gray_direct_group,
++ pdf14_cmap_rgb_direct_group,
++ pdf14_cmap_cmyk_direct_group,
++ pdf14_cmap_rgb_alpha_direct,
++ pdf14_cmap_separation_direct,
++ pdf14_cmap_devicen_direct,
++ pdf14_cmap_is_halftoned
++ };
++
+ /**
+ * Note: copied from gxcmap.c because it's inlined.
+ **/
+@@ -2098,17 +3034,232 @@ pdf14_cmap_cmyk_direct(frac c, frac m, frac y, frac k, gx_device_color * pdc,
+ color_set_pure(pdc, color);
+ }
+
++/* color mapping for when we have an smask or a isolated transparency group with another color space */
++static void
++pdf14_cmap_gray_direct_group(frac gray, gx_device_color * pdc, const gs_imager_state * pis,
++ gx_device * dev, gs_color_select_t select)
++{
++ int i, ncomps = dev->color_info.num_components;
++ frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_index color;
++ gx_device *trans_device;
++
++ /* We may be coming from the clist writer
++ which often forwards us the target device.
++ If this occurs we actually need to get to
++ the color space defined by the transparency group
++ and we use the operators defined by the transparency device
++ to do the job.
++ */
++
++ if (pis->trans_device != NULL){
++
++ trans_device = pis->trans_device;
++
++ } else {
++
++ trans_device = dev;
++ }
++
++ ncomps = trans_device->color_info.num_components;
++
++ /* If we are doing concretization of colors in an SMask or isolated group
++ then just return the color as is */
++
++ if (ncomps == 1 ){
++
++ cv[0] = frac2cv(gray);
++
++ /* encode as a color index */
++ color = pdf14_encode_smask_color(trans_device,cv,1);
++
++ /* check if the encoding was successful; we presume failure is rare */
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ } else {
++
++ /* map to the color model */
++ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_gray(trans_device, gray, cm_comps);
++
++ for (i = 0; i < ncomps; i++)
++ cv[i] = frac2cv(cm_comps[i]);
++
++ /* encode as a color index */
++ color = dev_proc(trans_device, encode_color)(trans_device, cv);
++
++ /* check if the encoding was successful; we presume failure is rare */
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ }
++
++}
++
++/* color mapping for when we have an smask or a isolated transparency group with another color space */
++static void
++pdf14_cmap_rgb_direct_group(frac r, frac g, frac b, gx_device_color * pdc,
++ const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
++{
++ int i, ncomps = dev->color_info.num_components;
++ frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_index color;
++ gx_device *trans_device;
++
++ /* We may be coming from the clist writer
++ which often forwards us the target device.
++ If this occurs we actually need to get to
++ the color space defined by the transparency group
++ and we use the operators defined by the transparency device
++ to do the job.
++ */
++
++ if (pis->trans_device != NULL){
++
++ trans_device = pis->trans_device;
++
++ } else {
++
++ trans_device = dev;
++ }
++
++ ncomps = trans_device->color_info.num_components;
++
++ if ( ncomps == 3 ){
++
++ cv[0] = frac2cv(r);
++ cv[1] = frac2cv(g);
++ cv[2] = frac2cv(b);
++
++ /* encode as a color index */
++ color = pdf14_encode_smask_color(trans_device,cv,3);
++
++ /* check if the encoding was successful; we presume failure is rare */
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ } else {
++
++ /* map to the device color model */
++ /* We can end up here, if for example we had a DeviceN
++ color space with a CIE based alternate space and
++ a output device that was RGB but a blending
++ space that was CMYK. The proper way to solve this
++ is to introduce another color space for the graphic
++ state that has its own Joint CIE Cache between the
++ source and a CMYK CRD (the transparency color space).
++ The problem is that we can
++ only have one CRD, which is defined by the output
++ device. We will fix these issues with the
++ new ICC base color architecture. */
++
++ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pis, r, g, b, cm_comps);
++
++ for (i = 0; i < ncomps; i++)
++ cv[i] = frac2cv(cm_comps[i]);
++
++ /* encode as a color index */
++ color = dev_proc(trans_device, encode_color)(trans_device, cv);
++
++ /* check if the encoding was successful; we presume failure is rare */
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ }
++}
++
++/* color mapping for when we have an smask or a isolated transparency group with another color space */
++static void
++pdf14_cmap_cmyk_direct_group(frac c, frac m, frac y, frac k, gx_device_color * pdc,
++ const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
++{
++ int i, ncomps = dev->color_info.num_components;
++ frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_index color;
++ gx_device *trans_device;
++
++ /* We may be coming from the clist writer
++ which often forwards us the target device.
++ If this occurs we actually need to get to
++ the color space defined by the transparency group
++ and we use the operators defined by the transparency device
++ to do the job.
++ */
++
++ if (pis->trans_device != NULL){
++
++ trans_device = pis->trans_device;
++
++ } else {
++
++ trans_device = dev;
++ }
++
++ ncomps = trans_device->color_info.num_components;
++
++ if (ncomps == 4 ){
++
++ cv[0] = frac2cv(c);
++ cv[1] = frac2cv(m);
++ cv[2] = frac2cv(y);
++ cv[3] = frac2cv(k);
++
++ /* encode as a color index */
++ color = pdf14_encode_smask_color(trans_device,cv,4);
++
++ /* check if the encoding was successful; we presume failure is rare */
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ } else {
++
++ /* map to the color model */
++ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_cmyk(trans_device, c, m, y, k, cm_comps);
++
++ for (i = 0; i < ncomps; i++)
++ cv[i] = frac2cv(cm_comps[i]);
++
++ color = dev_proc(trans_device, encode_color)(trans_device, cv);
++ if (color != gx_no_color_index)
++ color_set_pure(pdc, color);
++
++ }
++}
++
+ static void
+ pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color * pdc,
+ const gs_imager_state * pis, gx_device * dev, gs_color_select_t select)
+ {
+- int i, ncomps = dev->color_info.num_components;
++ int i, ncomps;
+ frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
+- gx_color_value cv_alpha, cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ gx_color_index color;
++ gx_device *trans_device;
++
++ /* We may be coming from the clist writer
++ which often forwards us the target device.
++ If this occurs we actually need to get to
++ the color space defined by the transparency group
++ and we use the operators defined by the transparency device
++ to do the job.
++ */
++
++ if (pis->trans_device != NULL){
++
++ trans_device = pis->trans_device;
++
++ } else {
++
++ trans_device = dev;
++ }
++
++ ncomps = trans_device->color_info.num_components;
+
+ /* map to the color model */
+- dev_proc(dev, get_color_mapping_procs)(dev)->map_rgb(dev, pis, r, g, b, cm_comps);
++ dev_proc(trans_device, get_color_mapping_procs)(trans_device)->map_rgb(trans_device, pis, r, g, b, cm_comps);
+
+ /* pre-multiply to account for the alpha weighting */
+ if (alpha != frac_1) {
+@@ -2126,11 +3277,13 @@ pdf14_cmap_rgb_alpha_direct(frac r, frac g, frac b, frac alpha, gx_device_color
+ cv[i] = frac2cv(cm_comps[i]);
+
+ /* encode as a color index */
+- if (dev_proc(dev, map_rgb_alpha_color) != gx_default_map_rgb_alpha_color &&
++ /* if (dev_proc(dev, map_rgb_alpha_color) != gx_default_map_rgb_alpha_color &&
+ (cv_alpha = frac2cv(alpha)) != gx_max_color_value)
+- color = dev_proc(dev, map_rgb_alpha_color)(dev, cv[0], cv[1], cv[2], cv_alpha);
+ else
+- color = dev_proc(dev, encode_color)(dev, cv);
++ color = dev_proc(dev, encode_color)(dev, cv); */
++
++ color = dev_proc(trans_device, encode_color)(trans_device, cv);
++
+
+ /* check if the encoding was successful; we presume failure is rare */
+ if (color != gx_no_color_index)
+@@ -2185,7 +3338,6 @@ pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_st
+ color_set_pure(pdc, color);
+ }
+
+-
+ static void
+ pdf14_cmap_devicen_direct(const frac * pcc,
+ gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
+@@ -2195,12 +3347,32 @@ pdf14_cmap_devicen_direct(const frac * pcc,
+ frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ gx_color_value cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ gx_color_index color;
++ gx_device *trans_device;
++
++ /* We may be coming from the clist writer
++ which often forwards us the target device.
++ If this occurs we actually need to get to
++ the color space defined by the transparency group
++ and we use the operators defined by the transparency device
++ to do the job.
++ */
++
++ if (pis->trans_device != NULL){
++
++ trans_device = pis->trans_device;
++
++ } else {
++
++ trans_device = dev;
++ }
++
++ ncomps = trans_device->color_info.num_components;
+
+ /* map to the color model */
+ map_components_to_colorants(pcc, &(pis->color_component_map), cm_comps);;
+
+ /* apply the transfer function(s); convert to color values */
+- if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
++ if (trans_device->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
+ for (i = 0; i < ncomps; i++)
+ cv[i] = frac2cv(gx_map_color_frac(pis,
+ cm_comps[i], effective_transfer[i]));
+@@ -2210,7 +3382,7 @@ pdf14_cmap_devicen_direct(const frac * pcc,
+ (frac)(frac_1 - cm_comps[i]), effective_transfer[i]));
+
+ /* encode as a color index */
+- color = dev_proc(dev, encode_color)(dev, cv);
++ color = dev_proc(trans_device, encode_color)(trans_device, cv);
+
+ /* check if the encoding was successful; we presume failure is rare */
+ if (color != gx_no_color_index)
+@@ -2230,6 +3402,14 @@ pdf14_get_cmap_procs(const gs_imager_state *pis, const gx_device * dev)
+ return &pdf14_cmap_many;
+ }
+
++static const gx_color_map_procs *
++pdf14_get_cmap_procs_group(const gs_imager_state *pis, const gx_device * dev)
++{
++ /* The pdf14 marking device itself is always continuous tone. */
++ return &pdf14_cmap_many_group;
++}
++
++
+ static int
+ pdf14_pattern_manage(gx_device *pdev, gx_bitmap_id id,
+ gs_pattern1_instance_t *pinst, pattern_manage_t function)
+@@ -2271,6 +3451,23 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis,
+ code = dev_proc((gx_device *) p14dev, open_device) ((gx_device *) p14dev);
+ *pdev = (gx_device *) p14dev;
+ pdf14_set_marking_params((gx_device *)p14dev, pis);
++
++ p14dev->trans_group_parent_cmap_procs = NULL;
++
++#if RAW_DUMP
++
++ /* Dump the current buffer to see what we have. */
++
++ dump_raw_buffer(p14dev->ctx->stack->rect.q.y-p14dev->ctx->stack->rect.p.y,
++ p14dev->ctx->stack->rect.q.x-p14dev->ctx->stack->rect.p.x,
++ p14dev->ctx->stack->n_planes,
++ p14dev->ctx->stack->planestride, p14dev->ctx->stack->rowstride,
++ "Device_Push",p14dev->ctx->stack->data);
++
++ global_index++;
++
++
++#endif
+ return code;
+ }
+
+@@ -2370,6 +3567,8 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize, gx_dev
+ return code;
+ *pbuf++ = (pparams->Isolated & 1) + ((pparams->Knockout & 1) << 1);
+ *pbuf++ = pparams->blend_mode;
++ *pbuf++ = pparams->group_color;
++ put_value(pbuf, pparams->group_color_numcomps);
+ put_value(pbuf, pparams->opacity.alpha);
+ put_value(pbuf, pparams->shape.alpha);
+ put_value(pbuf, pparams->bbox);
+@@ -2381,6 +3580,8 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize, gx_dev
+ if (code < 0)
+ return code;
+ put_value(pbuf, pparams->subtype);
++ *pbuf++ = pparams->group_color;
++ put_value(pbuf, pparams->group_color_numcomps);
+ *pbuf++ = pparams->replacing;
+ *pbuf++ = pparams->function_is_identity;
+ *pbuf++ = pparams->Background_components;
+@@ -2498,6 +3699,8 @@ c_pdf14trans_read(gs_composite_t * * ppct, const byte * data,
+ params.Isolated = (*data) & 1;
+ params.Knockout = (*data++ >> 1) & 1;
+ params.blend_mode = *data++;
++ params.group_color = *data++; /* Trans group color */
++ read_value(data,params.group_color_numcomps); /* color group size */
+ read_value(data, params.opacity.alpha);
+ read_value(data, params.shape.alpha);
+ read_value(data, params.bbox);
+@@ -2518,6 +3721,8 @@ c_pdf14trans_read(gs_composite_t * * ppct, const byte * data,
+ */
+ data = cmd_read_matrix(&params.ctm, data);
+ read_value(data, params.subtype);
++ params.group_color = *data++;
++ read_value(data, params.group_color_numcomps);
+ params.replacing = *data++;
+ params.function_is_identity = *data++;
+ params.Background_components = *data++;
+@@ -2958,19 +4163,19 @@ static dev_proc_begin_typed_image(pdf14_clist_begin_typed_image);
+ static const gx_device_procs pdf14_clist_Gray_procs =
+ pdf14_clist_procs(gx_default_DevGray_get_color_mapping_procs,
+ gx_default_DevGray_get_color_comp_index,
+- gx_default_8bit_map_gray_color,
+- gx_default_8bit_map_color_gray);
++ pdf14_encode_color,
++ pdf14_decode_color);
+
+ static const gx_device_procs pdf14_clist_RGB_procs =
+ pdf14_clist_procs(gx_default_DevRGB_get_color_mapping_procs,
+ gx_default_DevRGB_get_color_comp_index,
+- gx_default_rgb_map_rgb_color,
+- gx_default_rgb_map_color_rgb);
++ pdf14_encode_color,
++ pdf14_decode_color);
+
+ static const gx_device_procs pdf14_clist_CMYK_procs =
+ pdf14_clist_procs(gx_default_DevCMYK_get_color_mapping_procs,
+ gx_default_DevCMYK_get_color_comp_index,
+- cmyk_8bit_map_cmyk_color, cmyk_8bit_map_color_cmyk);
++ pdf14_encode_color, pdf14_decode_color);
+
+ static const gx_device_procs pdf14_clist_CMYKspot_procs =
+ pdf14_clist_procs(pdf14_cmykspot_get_color_mapping_procs,
+@@ -3080,6 +4285,22 @@ get_pdf14_clist_device_proto(gx_device * dev, pdf14_clist_device ** pdevproto,
+ switch (dev_cs) {
+ case PDF14_DeviceGray:
+ *pdevproto = (pdf14_clist_device *)&pdf14_clist_Gray_device;
++
++ /* We want gray to be single channel. Low level
++ initialization of gray device prototype is
++ peculiar in that in dci_std_color_num_components
++ the comment is
++ "A device is monochrome only if it is bi-level"
++
++ Here we want monochrome anytime we have a gray device.
++ To avoid breaking things elsewhere, we will overide
++ the prototype intialization here */
++
++ *ptempdevproto = **pdevproto;
++ ptempdevproto->color_info.max_components = 1;
++ ptempdevproto->color_info.num_components = ptempdevproto->color_info.max_components;
++ *pdevproto = ptempdevproto;
++
+ break;
+ case PDF14_DeviceRGB:
+ *pdevproto = (pdf14_clist_device *)&pdf14_clist_RGB_device;
+@@ -3596,6 +4817,7 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
+ {
+ pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
+ int code;
++ bool sep_target;
+
+ /* We only handle a few PDF 1.4 transparency operations 4 */
+ if (gs_is_pdf14trans_compositor(pct)) {
+@@ -3672,8 +4894,92 @@ pdf14_clist_create_compositor(gx_device * dev, gx_device ** pcdev,
+ if (pdf14pct->params.Background_components != 0 &&
+ pdf14pct->params.Background_components != pdev->color_info.num_components)
+ return_error(gs_error_rangecheck);
++
++ /* We need to update the clist writer device procs based upon the
++ the group color space. For simplicity, the list item is created even if the
++ color space did not change */
++
++ /* First store the current ones */
++
++ pdf14_push_parent_color(dev, pis);
++
++ /* Now update the device procs. Not
++ if we have a sep target though */
++
++ sep_target = (strcmp(pdev->dname, "PDF14clistcustom") == 0) || (strcmp(pdev->dname, "PDF14clistcmykspot") == 0);
++
++ if (!sep_target)
++ code = pdf14_update_device_color_procs_push_c(dev,
++ pdf14pct->params.group_color,pis);
++
++ /* Note that our initial device buffer may have had a different color space
++ than the first transparency group. In such a case, we really should force
++ this first group to be isolated, anytime that the parent color space is
++ different than its child group, it should be isolated, per the PDF spec */
++ /* MJV */
++ /* if (code == 1){
++
++ isolated = true;
++ if_debug0('v', "[v]Transparency group color space change\n");
++
++ } else {
++
++ isolated = ptgp->Isolated;
++
++ } */
++
+ break;
+- default:
++
++ case PDF14_BEGIN_TRANS_MASK:
++
++ /* We need to update the clist writer device procs based upon the
++ the group color space. For simplicity, the list item is created even if the
++ color space did not change */
++
++ /* First store the current ones */
++
++ pdf14_push_parent_color(dev, pis);
++
++ /* Now update the device procs */
++
++ code = pdf14_update_device_color_procs_push_c(dev,
++ pdf14pct->params.group_color,pis);
++
++ break;
++
++
++ /* When we get a trans group pop, we need to update the color mapping procs */
++ case PDF14_END_TRANS_GROUP:
++
++ /* We need to update the clist writer device procs based upon the
++ the group color space. */
++
++ /* First restore our procs */
++
++ code = pdf14_update_device_color_procs_pop_c(dev,pis);
++
++ /* Now pop the old one */
++
++ pdf14_pop_parent_color(dev, pis);
++
++ break;
++
++ case PDF14_END_TRANS_MASK:
++
++ /* We need to update the clist writer device procs based upon the
++ the group color space. */
++
++ /* First restore our procs */
++
++ code = pdf14_update_device_color_procs_pop_c(dev,pis);
++
++ /* Now pop the old one */
++
++ pdf14_pop_parent_color(dev, pis);
++
++ break;
++
++ default:
+ break; /* Pass remaining ops to target */
+ }
+ }
+@@ -3772,6 +5078,7 @@ pdf14_clist_update_params(pdf14_clist_device * pdev, const gs_imager_state * pis
+ return code;
+ }
+
++
+ /*
+ * fill_path routine for the PDF 1.4 transaprency compositor device for
+ * writing the clist.
+@@ -3785,6 +5092,7 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
+ pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
+ gs_imager_state new_is = *pis;
+ int code;
++ gs_pattern2_instance_t *pinst = NULL;
+
+ /*
+ * Ensure that that the PDF 1.4 reading compositor will have the current
+@@ -3795,12 +5103,47 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis,
+ code = pdf14_clist_update_params(pdev, pis);
+ if (code < 0)
+ return code;
++
++ /* If we are doing a shading fill and we are in a tranparency
++ group of a different color space, then we do not want to
++ do the shading in the device color space. It must occur in
++ the source space. To handle it in the device space would
++ require knowing all the nested transparency group color spaces
++ as well as the transparency. Some of the shading code
++ ignores this, so we have to pass on the clist_writer device
++ to enable proper mapping to the transparency group color space. */
++
++ if (pdcolor != NULL && gx_dc_is_pattern2_color(pdcolor) && pdev->trans_group_parent_cmap_procs != NULL) {
++
++ pinst =
++ (gs_pattern2_instance_t *)pdcolor->ccolor.pattern;
++ pinst->saved->has_transparency = true;
++
++ /* The transparency color space operations are driven
++ by the pdf14 clist writer device. */
++
++ pinst->saved->trans_device = dev;
++
++ }
++
+ /*
+ * The blend operations are not idempotent. Force non-idempotent
+ * filling and stroking operations.
+ */
+ new_is.log_op |= lop_pdf14;
+- return gx_forward_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
++ new_is.trans_device = dev;
++ new_is.has_transparency = true;
++
++ code = gx_forward_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
++
++ new_is.trans_device = NULL;
++ new_is.has_transparency = false;
++
++ if (pinst != NULL){
++ pinst->saved->trans_device = NULL;
++ }
++
++ return code;
+ }
+
+ /*
+@@ -3887,9 +5230,19 @@ pdf14_clist_begin_image(gx_device * dev,
+ code = pdf14_clist_update_params(pdev, pis);
+ if (code < 0)
+ return code;
++
+ /* Pass image to the target */
+- return gx_forward_begin_image(dev, pis, pim, format, prect,
++ code = gx_forward_begin_image(dev, pis, pim, format, prect,
+ pdcolor, pcpath, memory, pinfo);
++
++ if (code < 0)
++ return gx_default_begin_image(dev, pis, pim, format, prect,
++ pdcolor, pcpath, memory, pinfo);
++ else return code;
++
++
++
++
+ }
+
+ static int
+@@ -3902,6 +5255,7 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+ {
+ pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
+ int code;
++ gs_imager_state * pis_noconst = pis; /* Break 'const'. */
+
+ /*
+ * Ensure that that the PDF 1.4 reading compositor will have the current
+@@ -3909,12 +5263,39 @@ pdf14_clist_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
+ * do not have access to the imager state. Thus we have to pass any
+ * changes explictly.
+ */
++
+ code = pdf14_clist_update_params(pdev, pis);
+ if (code < 0)
+ return code;
++
+ /* Pass image to the target */
+- return gx_forward_begin_typed_image(dev, pis, pmat,
+- pic, prect, pdcolor, pcpath, mem, pinfo);
++
++ /* Do a quick change to the imager state
++ so that if we can return with -1 in
++ case the clist writer cannot handle
++ this image itself. In such a case,
++ we want to make sure we dont use the
++ target device. I don't necc. like
++ doing it this way. Probably need to
++ go back and do something a bit
++ more elegant. */
++
++ pis_noconst->has_transparency = true;
++ code = gx_forward_begin_typed_image(dev, pis, pmat,
++ pic, prect, pdcolor, pcpath, mem, pinfo);
++ if (code < 0){
++
++ code = gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
++ pdcolor, pcpath, mem, pinfo);
++ pis_noconst->has_transparency = false;
++ return code;
++
++ } else {
++
++ pis_noconst->has_transparency = false;
++ return code;
++
++ }
+ }
+
+ /*
+@@ -3934,6 +5315,9 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
+ pdf14_clist_device * p14dev;
+ int code = 0;
+
++ p14dev = (pdf14_clist_device *)(*pcdev);
++
++
+ /* We only handle the push/pop operations */
+ switch (pdf14pct->params.pdf14_op) {
+ case PDF14_PUSH_DEVICE:
+@@ -3947,6 +5331,15 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
+ * transfer functions will be applied at the end after we have done
+ * our PDF 1.4 blend operations.
+ */
++
++ /* Also if the bit depth is not 8 per channel we need to adjust
++ as all the pdf14 compositing code is for 8 bits per channel. The
++ clist writer device uses this information to make sure the proper
++ bit depth is written */
++
++ if (cdev->clist_color_info.num_components * 8 != cdev->clist_color_info.depth)
++ cdev->clist_color_info.depth = cdev->clist_color_info.num_components * 8;
++
+ p14dev = (pdf14_clist_device *)(*pcdev);
+ p14dev->saved_target_color_info = dev->color_info;
+ dev->color_info = (*pcdev)->color_info;
+diff --git a/base/gdevp14.h b/base/gdevp14.h
+--- a/base/gdevp14.h
++++ b/base/gdevp14.h
+@@ -31,6 +31,58 @@ typedef enum {
+ typedef struct pdf14_buf_s pdf14_buf;
+ #endif
+
++/*
++ * This structure contains procedures for processing routine which differ
++ * between the different blending color spaces.
++ */
++typedef struct {
++ /*
++ * Unpack a device color. This routine is similar to the device's
++ * decode_color procedure except for two things. The procedure produces
++ * 1 byte values instead of gx_color_values (2 bytes) and the output
++ * values are inverted for subtractive color spaces (like CMYK).
++ * A separate procedure is used instead of the decode_color to minimize
++ * execution time.
++ */
++ void (* unpack_color)(int num_comp, gx_color_index color,
++ pdf14_device * p14dev, byte * out);
++ /*
++ * This procedure sends the final rasterized transparency data to the
++ * output device as an image.
++ */
++ int (* put_image)(gx_device * dev,
++ gs_imager_state * pis, gx_device * target);
++} pdf14_procs_s;
++
++typedef pdf14_procs_s pdf14_procs_t;
++
++/* A structure to hold information
++ * about the parent color related
++ * procs and other information.
++ * These may change depending upon
++ * if the blending space is different
++ * than the base space. The structure
++ * is a list that is updated upon
++ * every transparency group push and pop */
++
++typedef struct pdf14_parent_color_s pdf14_parent_color_t;
++
++struct pdf14_parent_color_s {
++
++ int num_components;
++ bool isadditive;
++ gx_color_polarity_t polarity;
++ byte depth; /* used in clist writer cmd_put_color */
++ const gx_color_map_procs *(*get_cmap_procs)(const gs_imager_state *,
++ const gx_device *);
++ const gx_cm_color_map_procs *(*parent_color_mapping_procs)(const gx_device *);
++ int (*parent_color_comp_index)(gx_device *, const char *, int, int);
++ const pdf14_procs_t * unpack_procs;
++ const pdf14_nonseparable_blending_procs_t * parent_blending_procs;
++ pdf14_parent_color_t *previous;
++
++};
++
+ typedef struct pdf14_ctx_s pdf14_ctx;
+
+ struct pdf14_buf_s {
+@@ -60,7 +112,14 @@ struct pdf14_buf_s {
+ gs_int_rect bbox;
+ pdf14_buf *maskbuf; /* Save pdf14_ctx_s::maksbuf. */
+ bool idle;
++
++ bool SMask_is_CIE;
++ gs_transparency_mask_subtype_t SMask_SubType;
++
+ uint mask_id;
++ pdf14_parent_color_t parent_color_info_procs;
++
++ gs_transparency_color_t color_space; /* Different groups can have different spaces for blending */
+ };
+
+ struct pdf14_ctx_s {
+@@ -97,30 +156,7 @@ typedef struct gs_pdf14trans_params_s gs_pdf14trans_params_t;
+ typedef struct pdf14_device_s pdf14_device;
+ #endif
+
+-/*
+- * This structure contains procedures for processing routine which differ
+- * between the different blending color spaces.
+- */
+-typedef struct {
+- /*
+- * Unpack a device color. This routine is similar to the device's
+- * decode_color procedure except for two things. The procedure produces
+- * 1 byte values instead of gx_color_values (2 bytes) and the output
+- * values are inverted for subtractive color spaces (like CMYK).
+- * A separate procedure is used instead of the decode_color to minimize
+- * execution time.
+- */
+- void (* unpack_color)(int num_comp, gx_color_index color,
+- pdf14_device * p14dev, byte * out);
+- /*
+- * This procedure sends the final rasterized transparency data to the
+- * output device as an image.
+- */
+- int (* put_image)(gx_device * dev,
+- gs_imager_state * pis, gx_device * target);
+-} pdf14_procs_s;
+
+-typedef pdf14_procs_s pdf14_procs_t;
+
+ /*
+ * Define the default post-clist (clist reader) PDF 1.4 compositing device.
+@@ -155,6 +191,9 @@ typedef struct pdf14_device_s {
+ dev_proc_decode_color(*my_decode_color);
+ dev_proc_get_color_mapping_procs(*my_get_color_mapping_procs);
+ dev_proc_get_color_comp_index(*my_get_color_comp_index);
++
++ pdf14_parent_color_t *trans_group_parent_cmap_procs;
++
+ } pdf14_device_t;
+
+ /*
+diff --git a/base/gdevpbm.c b/base/gdevpbm.c
+--- a/base/gdevpbm.c
++++ b/base/gdevpbm.c
+@@ -682,6 +682,13 @@ pbm_print_page_loop(gx_device_printer * pdev, char magic, FILE * pstream,
+ case '7': /* pam */
+ case '9': /* plan9bm */
+ break;
++ case '3': /* pkm */
++ case '6': /* pkmraw */
++ if (fprintf(pstream, "%d\n", 255) < 0) {
++ code = gs_note_error(gs_error_ioerror);
++ goto punt;
++ }
++ break;
+ default:
+ if (fprintf(pstream, "%d\n", pdev->color_info.max_gray) < 0) {
+ code = gs_note_error(gs_error_ioerror);
+@@ -992,9 +999,9 @@ pkm_print_row_4(gx_device_printer * pdev, byte * data, int depth,
+ gx_color_value rgb[3];
+
+ cmyk_1bit_map_color_rgb((gx_device *)pdev, (gx_color_index)i, rgb);
+- rv[i] = rgb[0] / gx_max_color_value;
+- gv[i] = rgb[1] / gx_max_color_value;
+- bv[i] = rgb[2] / gx_max_color_value;
++ rv[i] = rgb[0] / gx_max_color_value * 0xff;
++ gv[i] = rgb[1] / gx_max_color_value * 0xff;
++ bv[i] = rgb[2] / gx_max_color_value * 0xff;
+ }
+ /*
+ * Contrary to what the documentation implies, gcc compiles putc
+diff --git a/base/gdevpdf.c b/base/gdevpdf.c
+--- a/base/gdevpdf.c
++++ b/base/gdevpdf.c
+@@ -15,7 +15,6 @@
+ /* PDF-writing driver */
+ #include "fcntl_.h"
+ #include "memory_.h"
+-#include "string_.h"
+ #include "time_.h"
+ #include "unistd_.h"
+ #include "gx.h"
+@@ -211,6 +210,9 @@ pdf_open_temp_file(gx_device_pdf *pdev, pdf_temp_file_t *ptf)
+ {
+ char fmode[4];
+
++ if (strlen(gp_fmode_binary_suffix) > 2)
++ return_error(gs_error_invalidfileaccess);
++
+ strcpy(fmode, "w+");
+ strcat(fmode, gp_fmode_binary_suffix);
+ ptf->file =
+@@ -784,11 +786,11 @@ pdf_print_orientation(gx_device_pdf * pdev, pdf_page_t *page)
+
+ /* Close the current page. */
+ static int
+-pdf_close_page(gx_device_pdf * pdev)
++pdf_close_page(gx_device_pdf * pdev, int num_copies)
+ {
+- int page_num = ++(pdev->next_page);
++ int page_num;
+ pdf_page_t *page;
+- int code;
++ int code, i;
+
+ /*
+ * If the very first page is blank, we need to open the document
+@@ -806,89 +808,99 @@ pdf_close_page(gx_device_pdf * pdev)
+ }
+ pdf_close_contents(pdev, true);
+
+- /*
+- * We can't write the page object or the annotations array yet, because
+- * later pdfmarks might add elements to them. Write the other objects
+- * that the page references, and record what we'll need later.
+- *
+- * Start by making sure the pages array element exists.
+- */
+-
+- pdf_page_id(pdev, page_num);
+- page = &pdev->pages[page_num - 1];
+- page->MediaBox.x = pdev->MediaSize[0];
+- page->MediaBox.y = pdev->MediaSize[1];
+- page->contents_id = pdev->contents_id;
+- page->NumCopies_set = pdev->NumCopies_set;
+- page->NumCopies = pdev->NumCopies;
+- /* pdf_store_page_resources sets procsets, resource_ids[]. */
+- code = pdf_store_page_resources(pdev, page);
+- if (code < 0)
+- return code;
+-
+- /* Write the Functions. */
+-
+- code = pdf_write_resource_objects(pdev, resourceFunction);
+- if (code < 0)
+- return code;
+-
+- /* Save viewer's memory with cleaning resources. */
+-
+- if (pdev->MaxViewerMemorySize < 10000000) {
+- /* fixme: the condition above and the cleaning algorithm
+- may be improved with counting stored resource size
+- and creating multiple streams per page. */
+-
+- if (pdev->ForOPDFRead) {
+- pdf_resource_t *pres = pdf_find_resource_by_resource_id(pdev, resourcePage, pdev->contents_id);
++ if (!pdev->DoNumCopies)
++ num_copies = 1;
++
++ for(i=0;i<num_copies;i++) {
++ bool clear_resource_use = i < num_copies - 1 ? 0 : 1;
++
++ page_num = ++(pdev->next_page);
++ /*
++ * We can't write the page object or the annotations array yet, because
++ * later pdfmarks might add elements to them. Write the other objects
++ * that the page references, and record what we'll need later.
++ *
++ * Start by making sure the pages array element exists.
++ */
++
++ pdf_page_id(pdev, page_num);
++ page = &pdev->pages[page_num - 1];
++ page->MediaBox.x = pdev->MediaSize[0];
++ page->MediaBox.y = pdev->MediaSize[1];
++ page->contents_id = pdev->contents_id;
++ page->NumCopies_set = pdev->NumCopies_set;
++ page->NumCopies = pdev->NumCopies;
++ /* pdf_store_page_resources sets procsets, resource_ids[]. */
++ code = pdf_store_page_resources(pdev, page, clear_resource_use);
++ if (code < 0)
++ return code;
++
++ /* Write the Functions. */
++
++ code = pdf_write_resource_objects(pdev, resourceFunction);
++ if (code < 0)
++ return code;
++
++ /* Save viewer's memory with cleaning resources. */
++
++ if (pdev->MaxViewerMemorySize < 10000000) {
++ /* fixme: the condition above and the cleaning algorithm
++ may be improved with counting stored resource size
++ and creating multiple streams per page. */
++
++ if (pdev->ForOPDFRead) {
++ pdf_resource_t *pres = pdf_find_resource_by_resource_id(pdev, resourcePage, pdev->contents_id);
+
+- if (pres != NULL) {
+- code = cos_dict_put_c_strings((cos_dict_t *)pres->object, "/.CleanResources", "/All");
+- if (code < 0)
+- return code;
++ if (pres != NULL) {
++ code = cos_dict_put_c_strings((cos_dict_t *)pres->object, "/.CleanResources", "/All");
++ if (code < 0)
++ return code;
++ }
+ }
++ code = pdf_close_text_document(pdev);
++ if (code < 0)
++ return code;
++ code = pdf_write_and_free_all_resource_objects(pdev);
++ if (code < 0)
++ return code;
+ }
+- code = pdf_close_text_document(pdev);
+- if (code < 0)
+- return code;
+- code = pdf_write_and_free_all_resource_objects(pdev);
+- if (code < 0)
+- return code;
+- }
+
+- /* Close use of text on the page. */
++ /* Close use of text on the page. */
+
+- pdf_close_text_page(pdev);
++ pdf_close_text_page(pdev);
+
+- /* Accumulate text rotation. */
++ /* Accumulate text rotation. */
+
+- page->text_rotation.Rotate =
+- (pdev->params.AutoRotatePages == arp_PageByPage ?
+- pdf_dominant_rotation(&page->text_rotation) : -1);
+- {
+- int i;
++ page->text_rotation.Rotate =
++ (pdev->params.AutoRotatePages == arp_PageByPage ?
++ pdf_dominant_rotation(&page->text_rotation) : -1);
++ {
++ int i;
+
+- for (i = 0; i < countof(page->text_rotation.counts); ++i)
+- pdev->text_rotation.counts[i] += page->text_rotation.counts[i];
+- }
++ for (i = 0; i < countof(page->text_rotation.counts); ++i)
++ pdev->text_rotation.counts[i] += page->text_rotation.counts[i];
++ }
+
+- /* Record information from DSC comments. */
++ /* Record information from DSC comments. */
+
+- page->dsc_info = pdev->page_dsc_info;
+- if (page->dsc_info.orientation < 0)
+- page->dsc_info.orientation = pdev->doc_dsc_info.orientation;
++ page->dsc_info = pdev->page_dsc_info;
++ if (page->dsc_info.orientation < 0)
++ page->dsc_info.orientation = pdev->doc_dsc_info.orientation;
+ #ifdef Bug688793
+- if (page->dsc_info.viewing_orientation < 0)
+- page->dsc_info.viewing_orientation =
++ if (page->dsc_info.viewing_orientation < 0)
++ page->dsc_info.viewing_orientation =
+ pdev->doc_dsc_info.viewing_orientation;
+ #endif
+- if (page->dsc_info.bounding_box.p.x >= page->dsc_info.bounding_box.q.x ||
+- page->dsc_info.bounding_box.p.y >= page->dsc_info.bounding_box.q.y
+- )
+- page->dsc_info.bounding_box = pdev->doc_dsc_info.bounding_box;
++ if (page->dsc_info.bounding_box.p.x >= page->dsc_info.bounding_box.q.x ||
++ page->dsc_info.bounding_box.p.y >= page->dsc_info.bounding_box.q.y
++ )
++ page->dsc_info.bounding_box = pdev->doc_dsc_info.bounding_box;
+
+- /* Finish up. */
++ /* Finish up. */
+
++ if(pdf_ferror(pdev))
++ return(gs_note_error(gs_error_ioerror));
++ }
+ pdf_reset_page(pdev);
+ return (pdf_ferror(pdev) ? gs_note_error(gs_error_ioerror) : 0);
+ }
+@@ -1030,7 +1042,7 @@ static int
+ pdf_output_page(gx_device * dev, int num_copies, int flush)
+ {
+ gx_device_pdf *const pdev = (gx_device_pdf *) dev;
+- int code = pdf_close_page(pdev);
++ int code = pdf_close_page(pdev, num_copies);
+
+ return (code < 0 ? code :
+ pdf_ferror(pdev) ? gs_note_error(gs_error_ioerror) :
+@@ -1067,7 +1079,7 @@ pdf_close(gx_device * dev)
+ return code;
+ }
+ if (pdev->contents_id != 0)
+- pdf_close_page(pdev);
++ pdf_close_page(pdev, 1);
+
+ /* Write the page objects. */
+
+@@ -1122,7 +1134,6 @@ pdf_close(gx_device * dev)
+ if (code >= 0)
+ code = code1;
+
+-
+ /* Create the Pages tree. */
+
+ pdf_open_obj(pdev, Pages_id);
+@@ -1134,7 +1145,7 @@ pdf_close(gx_device * dev)
+ {
+ int i;
+
+- for (i = 0; i < pdev->next_page; ++i)
++ for (i = 0; i < pdev->next_page; ++i)
+ pprintld1(s, "%ld 0 R\n", pdev->pages[i].Page->id);
+ }
+ pprintd1(s, "] /Count %d\n", pdev->next_page);
+diff --git a/base/gdevpdfb.c b/base/gdevpdfb.c
+--- a/base/gdevpdfb.c
++++ b/base/gdevpdfb.c
+@@ -260,8 +260,8 @@ pdf_copy_mono(gx_device_pdf *pdev,
+ * We don't have to worry about color space scaling: the color
+ * space is always a Device space.
+ */
+- code = pdf_color_space(pdev, &cs_value, NULL, pcs,
+- &writer.pin->color_spaces, in_line);
++ code = pdf_color_space_named(pdev, &cs_value, NULL, pcs,
++ &writer.pin->color_spaces, in_line, NULL, 0);
+ if (code < 0)
+ return code;
+ pcsvalue = &cs_value;
+@@ -410,8 +410,8 @@ pdf_copy_color_data(gx_device_pdf * pdev, const byte * base, int sourcex,
+ pdf_image_writer_init(piw);
+ pdev->ParamCompatibilityLevel = pdev->CompatibilityLevel;
+ if ((code = pdf_begin_write_image(pdev, piw, id, w, h, NULL, in_line)) < 0 ||
+- (code = pdf_color_space(pdev, &cs_value, NULL, pcs,
+- &piw->pin->color_spaces, in_line)) < 0 ||
++ (code = pdf_color_space_named(pdev, &cs_value, NULL, pcs,
++ &piw->pin->color_spaces, in_line, NULL, 0)) < 0 ||
+ (for_pattern < 2 || nbytes < 512000 ?
+ (code = psdf_setup_lossless_filters((gx_device_psdf *) pdev,
+ &piw->binary[0], (gs_pixel_image_t *)pim, false)) :
+diff --git a/base/gdevpdfc.c b/base/gdevpdfc.c
+--- a/base/gdevpdfc.c
++++ b/base/gdevpdfc.c
+@@ -345,7 +345,7 @@ pdf_separation_color_space(gx_device_pdf *pdev,
+
+ if ((code = cos_array_add(pca, cos_c_string_value(&v, csname))) < 0 ||
+ (code = cos_array_add_no_copy(pca, snames)) < 0 ||
+- (code = pdf_color_space(pdev, &v, &ranges, alt_space, pcsn, false)) < 0 ||
++ (code = pdf_color_space_named(pdev, &v, &ranges, alt_space, pcsn, false, NULL, 0)) < 0 ||
+ (code = cos_array_add(pca, &v)) < 0 ||
+ (code = pdf_function_scaled(pdev, pfn, ranges, &v)) < 0 ||
+ (code = cos_array_add(pca, &v)) < 0 ||
+@@ -472,8 +472,8 @@ pdf_indexed_color_space(gx_device_pdf *pdev, cos_value_t *pvalue,
+ * in PDF, unlike PostScript, the values from the lookup table are
+ * scaled automatically.
+ */
+- if ((code = pdf_color_space(pdev, pvalue, NULL, base_space,
+- &pdf_color_space_names, false)) < 0 ||
++ if ((code = pdf_color_space_named(pdev, pvalue, NULL, base_space,
++ &pdf_color_space_names, false, NULL, 0)) < 0 ||
+ (code = cos_array_add(pca,
+ cos_c_string_value(&v,
+ pdf_color_space_names.Indexed
+@@ -571,9 +571,9 @@ pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
+ ) {
+ if (res_name != NULL)
+ return 0; /* Ignore .includecolorspace */
+- return pdf_color_space( pdev, pvalue, ppranges,
++ return pdf_color_space_named( pdev, pvalue, ppranges,
+ pcs->base_space,
+- pcsn, by_name);
++ pcsn, by_name, NULL, 0);
+ }
+ break;
+ default:
+@@ -832,7 +832,7 @@ pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
+ csa->colorant_name, &name_string, &name_string_length);
+ if (code < 0)
+ return code;
+- code = pdf_color_space(pdev, &v_separation, NULL, csa->cspace, pcsn, false);
++ code = pdf_color_space_named(pdev, &v_separation, NULL, csa->cspace, pcsn, false, NULL, 0);
+ if (code < 0)
+ return code;
+ code = pdf_string_to_cos_name(pdev, name_string, name_string_length, &v_colorant_name);
+@@ -878,9 +878,9 @@ pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
+ break;
+
+ case gs_color_space_index_Pattern:
+- if ((code = pdf_color_space(pdev, pvalue, ppranges,
++ if ((code = pdf_color_space_named(pdev, pvalue, ppranges,
+ pcs->base_space,
+- &pdf_color_space_names, false)) < 0 ||
++ &pdf_color_space_names, false, NULL, 0)) < 0 ||
+ (code = cos_array_add(pca,
+ cos_c_string_value(&v, "/Pattern"))) < 0 ||
+ (code = cos_array_add(pca, pvalue)) < 0
+@@ -957,16 +957,6 @@ pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
+ return 0;
+ }
+
+-int
+-pdf_color_space(gx_device_pdf *pdev, cos_value_t *pvalue,
+- const gs_range_t **ppranges,
+- const gs_color_space *pcs,
+- const pdf_color_space_names_t *pcsn,
+- bool by_name)
+-{
+- return pdf_color_space_named(pdev, pvalue, ppranges, pcs, pcsn, by_name, NULL, 0);
+-}
+-
+ /* ---------------- Miscellaneous ---------------- */
+
+ /* Create colored and uncolored Pattern color spaces. */
+@@ -1018,7 +1008,7 @@ pdf_cs_Pattern_uncolored_hl(gx_device_pdf *pdev,
+ const gs_color_space *pcs, cos_value_t *pvalue)
+ {
+ /* Only for high level colors. */
+- return pdf_color_space(pdev, pvalue, NULL, pcs, &pdf_color_space_names, true);
++ return pdf_color_space_named(pdev, pvalue, NULL, pcs, &pdf_color_space_names, true, NULL, 0);
+ }
+
+ /* Set the ProcSets bits corresponding to an image color space. */
+diff --git a/base/gdevpdfe.c b/base/gdevpdfe.c
+--- a/base/gdevpdfe.c
++++ b/base/gdevpdfe.c
+@@ -24,7 +24,6 @@
+ #include "gdevpdfx.h"
+ #include "gdevpdfg.h"
+ #include "gdevpdfo.h"
+-#include "gdevpdtf.h"
+ #include "ConvertUTF.h"
+
+
+@@ -730,204 +729,12 @@ pdf_document_metadata(gx_device_pdf *pdev)
+ if (code < 0)
+ return code;
+ sprintf(buf, "%ld 0 R", pres->object->id);
+- cos_dict_put_c_key_object(pdev->Catalog, "/Metadata", pres->object);
++ code = cos_dict_put_c_key_object(pdev->Catalog, "/Metadata", pres->object);
++ if (code < 0)
++ return code;
+ }
+ return 0;
+ }
+
+ /* -------------------------------------------- */
+
+-/* Write Font metadata */
+-static int
+-pdf_write_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
+- const byte *digest, int digest_length)
+-{
+- char instance_uuid[40];
+- int code;
+- stream *s = pdev->strm;
+- gs_font_info_t info;
+- gs_font_base *pfont = pbfont->complete;
+-
+- if (pfont == NULL)
+- pfont = pbfont->copied;
+- /* Fixme: For True Type fonts need to get Coipyright, Owner from the TT data. */
+- pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, instance_uuid, sizeof(instance_uuid));
+- code = pfont->procs.font_info((gs_font *)pfont, NULL,
+- (FONT_INFO_COPYRIGHT | FONT_INFO_NOTICE |
+- FONT_INFO_FAMILY_NAME | FONT_INFO_FULL_NAME),
+- &info);
+- if (code < 0)
+- return code;
+- pdf_xml_ins_beg(s, "xpacket");
+- pdf_xml_attribute_name(s, "begin");
+- pdf_xml_copy(s, dd);
+- pdf_xml_attribute_name(s, "id");
+- pdf_xml_attribute_value(s, "W5M0MpCehiHzreSzNTczkc9d");
+- pdf_xml_ins_end(s);
+- pdf_xml_newline(s);
+-
+- pdf_xml_copy(s, "<?adobe-xap-filters esc=\"CRLF\"?>\n");
+- pdf_xml_copy(s, "<x:xmpmeta xmlns:x='adobe:ns:meta/'"
+- " x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>\n");
+- {
+- pdf_xml_copy(s, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
+- "xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n");
+- {
+-
+- pdf_xml_tag_open_beg(s, "rdf:Description");
+- pdf_xml_attribute_name(s, "rdf:about");
+- pdf_xml_attribute_value(s, instance_uuid);
+- pdf_xml_attribute_name(s, "xmlns:xmp");
+- pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_tag_open_beg(s, "xmp:Title");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_tag_open(s, "rdf:Alt");
+- {
+- pdf_xml_tag_open_beg(s, "rdf:li");
+- pdf_xml_attribute_name(s, "xml:lang");
+- pdf_xml_attribute_value(s, "x-default");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_data_write(s, pbfont->font_name.data, pbfont->font_name.size);
+- }
+- pdf_xml_tag_close(s, "rdf:li");
+- }
+- pdf_xml_tag_close(s, "rdf:Alt");
+- }
+- pdf_xml_tag_close(s, "xmp:Title");
+- }
+- pdf_xml_tag_close(s, "rdf:Description");
+- pdf_xml_newline(s);
+-
+-
+- pdf_xml_tag_open_beg(s, "rdf:Description");
+- pdf_xml_attribute_name(s, "rdf:about");
+- pdf_xml_attribute_value(s, instance_uuid);
+- pdf_xml_attribute_name(s, "xmlns:xmpRights");
+- pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/rights/");
+- pdf_xml_tag_end(s);
+- if (info.members & FONT_INFO_COPYRIGHT) {
+- pdf_xml_tag_open_beg(s, "xmpRights:Copyright");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_tag_open(s, "rdf:Alt");
+- {
+- pdf_xml_tag_open_beg(s, "rdf:li");
+- pdf_xml_attribute_name(s, "xml:lang");
+- pdf_xml_attribute_value(s, "x-default");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
+- }
+- pdf_xml_tag_close(s, "rdf:li");
+- }
+- pdf_xml_tag_close(s, "rdf:Alt");
+- }
+- pdf_xml_tag_close(s, "xmpRights:Copyright");
+-
+- /* Don't have an Owner, write Copyright instead. */
+- pdf_xml_tag_open_beg(s, "xmpRights:Owner");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_tag_open(s, "rdf:Alt");
+- {
+- pdf_xml_tag_open_beg(s, "rdf:li");
+- pdf_xml_attribute_name(s, "xml:lang");
+- pdf_xml_attribute_value(s, "x-default");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
+- }
+- pdf_xml_tag_close(s, "rdf:li");
+- }
+- pdf_xml_tag_close(s, "rdf:Alt");
+- }
+- pdf_xml_tag_close(s, "xmpRights:Owner");
+- }
+- {
+- pdf_xml_tag_open_beg(s, "xmpRights:Marked");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_string_write(s, "True");
+- }
+- pdf_xml_tag_close(s, "xmpRights:Marked");
+- }
+- if (info.members & FONT_INFO_NOTICE) {
+- pdf_xml_tag_open_beg(s, "xmpRights:UsageTerms");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_tag_open(s, "rdf:Alt");
+- {
+- pdf_xml_tag_open_beg(s, "rdf:li");
+- pdf_xml_attribute_name(s, "xml:lang");
+- pdf_xml_attribute_value(s, "x-default");
+- pdf_xml_tag_end(s);
+- {
+- pdf_xml_data_write(s, info.Notice.data, info.Notice.size);
+- }
+- pdf_xml_tag_close(s, "rdf:li");
+- }
+- pdf_xml_tag_close(s, "rdf:Alt");
+- }
+- pdf_xml_tag_close(s, "xmpRights:UsageTerms");
+- }
+- pdf_xml_tag_close(s, "rdf:Description");
+- pdf_xml_newline(s);
+- }
+- pdf_xml_copy(s, "</rdf:RDF>\n");
+- }
+- pdf_xml_copy(s, "</x:xmpmeta>\n");
+-
+- pdf_xml_copy(s, " \n");
+- pdf_xml_copy(s, " \n");
+- pdf_xml_copy(s, "<?xpacket end='w'?>");
+- return 0;
+-}
+-
+-int
+-pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
+- const byte *digest, int digest_length, gs_id *metadata_object_id)
+-{
+- /* Acrobat Distiller does not create font Metadata, and the ISO spec says
+- * only that files 'should' contain font Metadata. Attempts to include
+- * font metadata cause Acrobat to complain about XMP schemas (because
+- * the ISO spec uses non-existent tags).
+- * For now we disable writing of font Metadata
+- */
+- return 0;
+-
+- *metadata_object_id = gs_no_id;
+- if (pdev->CompatibilityLevel < 1.4)
+- return 0;
+- /* The PDF/A specification redss about
+- "embedded Type 0, Type 1, or TrueType font programs",
+- but we believe that "embedded Type 0 font programs"
+- do not exist.
+- We create Metadata for Type 1,2,42,9,11.
+- */
+- if (pdev->PDFA) {
+- pdf_resource_t *pres;
+- int code;
+- int options = DATA_STREAM_NOT_BINARY;
+-
+- if (pdev->EncryptMetadata)
+- options |= DATA_STREAM_ENCRYPT;
+- code = pdf_open_aside(pdev, resourceOther, gs_no_id, &pres, true, options);
+- if (code < 0)
+- return code;
+- code = pdf_write_font_metadata(pdev, pbfont, digest, digest_length);
+- if (code < 0)
+- return code;
+- code = pdf_close_aside(pdev);
+- if (code < 0)
+- return code;
+- code = COS_WRITE_OBJECT(pres->object, pdev);
+- if (code < 0)
+- return code;
+- *metadata_object_id = pres->object->id;
+- }
+- return 0;
+-}
+diff --git a/base/gdevpdfg.c b/base/gdevpdfg.c
+--- a/base/gdevpdfg.c
++++ b/base/gdevpdfg.c
+@@ -187,6 +187,8 @@ pdf_viewer_state_from_imager_state(gx_device_pdf * pdev,
+ pdf_viewer_state_from_imager_state_aux(&vs, pis);
+ gx_hld_save_color(pis, pdevc, &vs.saved_fill_color);
+ gx_hld_save_color(pis, pdevc, &vs.saved_stroke_color);
++ vs.fill_used_process_color = 0;
++ vs.stroke_used_process_color = 0;
+ pdf_load_viewer_state(pdev, &vs);
+ }
+
+@@ -376,8 +378,8 @@ pdf_reset_color(gx_device_pdf * pdev, const gs_imager_state * pis,
+ scn:
+ command = ppscc->setcolorn;
+ if (!gx_hld_saved_color_same_cspace(&temp, psc)) {
+- code = pdf_color_space(pdev, &cs_value, NULL, pcs,
+- &pdf_color_space_names, true);
++ code = pdf_color_space_named(pdev, &cs_value, NULL, pcs,
++ &pdf_color_space_names, true, NULL, 0);
+ /* fixme : creates redundant PDF objects. */
+ if (code == gs_error_rangecheck) {
+ /* The color space can't write to PDF. */
+@@ -812,6 +814,7 @@ pdf_write_spot_function(gx_device_pdf *pdev, const gx_ht_order *porder,
+ uint i;
+ int code = 0;
+
++ params.array_size = 0;
+ params.m = 2;
+ params.Domain = domain_spot;
+ params.n = 1;
+diff --git a/base/gdevpdfg.h b/base/gdevpdfg.h
+--- a/base/gdevpdfg.h
++++ b/base/gdevpdfg.h
+@@ -87,11 +87,6 @@ int pdf_cspace_init_Device(gs_memory_t *mem, gs_color_space **ppcs, int num_comp
+ * to be scaled (to convert a CIEBased space to ICCBased), store a pointer
+ * to the ranges in *ppranges, otherwise set *ppranges to 0.
+ */
+-int pdf_color_space(gx_device_pdf *pdev, cos_value_t *pvalue,
+- const gs_range_t **ppranges,
+- const gs_color_space *pcs,
+- const pdf_color_space_names_t *pcsn,
+- bool by_name);
+ int pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
+ const gs_range_t **ppranges,
+ const gs_color_space *pcs,
+@@ -346,5 +341,3 @@ int pdf_copy_color_data(gx_device_pdf * pdev, const byte * base, int sourcex,
+
+ /* Write metadata */
+ int pdf_document_metadata(gx_device_pdf *pdev);
+-int pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
+- const byte *digest, int digest_length, gs_id *metadata_object_id);
+diff --git a/base/gdevpdfi.c b/base/gdevpdfi.c
+--- a/base/gdevpdfi.c
++++ b/base/gdevpdfi.c
+@@ -369,8 +369,11 @@ pdf_begin_typed_image_impl(gx_device_pdf *pdev, const gs_imager_state * pis,
+ )
+ goto nyi;
+ }
+- in_line = context == PDF_IMAGE_DEFAULT &&
+- can_write_image_in_line(pdev, pim1);
++ /* If image is not type 3X and we can write in-line then make it so */
++
++ in_line = context == PDF_IMAGE_DEFAULT &&
++ can_write_image_in_line(pdev, pim1);
++
+ image[0].type1 = *pim1;
+ break;
+ }
+@@ -653,9 +656,9 @@ pdf_begin_typed_image_impl(gx_device_pdf *pdev, const gs_imager_state * pis,
+ */
+ cos_c_string_value(&cs_value, names->DeviceRGB);
+ } else {
+- code = pdf_color_space(pdev, &cs_value, &pranges,
++ code = pdf_color_space_named(pdev, &cs_value, &pranges,
+ pcs,
+- names, in_line);
++ names, in_line, NULL, 0);
+ if (code < 0)
+ convert_to_process_colors = true;
+ }
+@@ -1326,8 +1329,11 @@ pdf_image3x_make_mcde(gx_device *dev, const gs_imager_state *pis,
+ if (code < 0)
+ return code;
+ }
+- return cos_dict_put_c_key_object(cos_stream_dict(pmcs), "/SMask",
+- pmie->writer.pres->object);
++/* Don't put SMask here because pmie->writer.pres->object may be substituted
++ * after the image stream is accummulated. pdf_end_and_do_image will set
++ * SMask with the right value. Bug 690345.
++ */
++ return 0;
+ }
+
+ pdf_resource_t *pdf_substitute_pattern(pdf_resource_t *pres)
+diff --git a/base/gdevpdfj.c b/base/gdevpdfj.c
+--- a/base/gdevpdfj.c
++++ b/base/gdevpdfj.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Image-writing utilities for pdfwrite driver */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gdevpdfx.h"
+@@ -24,6 +23,7 @@
+ #include "gsiparm4.h"
+ #include "gdevpsds.h"
+ #include "spngpx.h"
++#include <stdlib.h> /* for atoi */
+
+ #define CHECK(expr)\
+ BEGIN if ((code = (expr)) < 0) return code; END
+@@ -445,9 +445,32 @@ pdf_end_image_binary(gx_device_pdf *pdev, pdf_image_writer *piw, int data_h)
+ else
+ code = psdf_end_binary(&piw->binary[0]);
+ /* If the image ended prematurely, update the Height. */
+- if (data_h != piw->height)
+- code1 = cos_dict_put_c_key_int(cos_stream_dict(piw->data),
++ if (data_h != piw->height) {
++ char data[255];
++ int OutHeight;
++ cos_value_t *value;
++ value = (cos_value_t *)cos_dict_find(cos_stream_dict(piw->data),
++ (const byte *)piw->pin->Height, strlen(piw->pin->Height));
++ if (!value || value->contents.chars.size > 255)
++ return(gs_error_rangecheck);
++ strncpy((char *)&data, (const char *)value->contents.chars.data, value->contents.chars.size);
++ data[value->contents.chars.size] = 0x00;
++ OutHeight = atoi(data);
++ if (OutHeight != piw->height) {
++ /* Looks like we are downsampling, so we can't use the number
++ * of rows of data actually received, we must divide those by
++ * the sampling factor.
++ */
++ float factor = (float)OutHeight / piw->height;
++ OutHeight = (int)(factor * data_h);
++ code1 = cos_dict_put_c_key_int(cos_stream_dict(piw->data),
++ piw->pin->Height, OutHeight);
++ } else {
++
++ code1 = cos_dict_put_c_key_int(cos_stream_dict(piw->data),
+ piw->pin->Height, data_h);
++ }
++ }
+ return code < 0 ? code : code1;
+ }
+
+diff --git a/base/gdevpdfk.c b/base/gdevpdfk.c
+--- a/base/gdevpdfk.c
++++ b/base/gdevpdfk.c
+@@ -255,8 +255,8 @@ pdf_make_iccbased(gx_device_pdf *pdev, cos_array_t *pca, int ncomps,
+ case gs_color_space_index_DeviceCMYK:
+ break; /* implicit (default) */
+ default:
+- if ((code = pdf_color_space(pdev, &v, NULL, pcs_alt,
+- &pdf_color_space_names, false)) < 0 ||
++ if ((code = pdf_color_space_named(pdev, &v, NULL, pcs_alt,
++ &pdf_color_space_names, false, NULL, 0)) < 0 ||
+ (code = cos_dict_put_c_key(cos_stream_dict(pcstrm), "/Alternate",
+ &v)) < 0
+ )
+diff --git a/base/gdevpdfm.c b/base/gdevpdfm.c
+--- a/base/gdevpdfm.c
++++ b/base/gdevpdfm.c
+@@ -15,7 +15,6 @@
+ /* pdfmark processing for PDF-writing driver */
+ #include "math_.h"
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsutil.h" /* for bytes_compare */
+@@ -108,7 +107,8 @@ pdfmark_page_number(gx_device_pdf * pdev, const gs_param_string * pnstr)
+ {
+ int page = pdev->next_page + 1;
+
+- if (pnstr->data == 0);
++ if (pnstr->data == 0)
++ page -= 1;
+ else if (pdf_key_eq(pnstr, "/Next"))
+ ++page;
+ else if (pdf_key_eq(pnstr, "/Prev"))
+diff --git a/base/gdevpdfo.c b/base/gdevpdfo.c
+--- a/base/gdevpdfo.c
++++ b/base/gdevpdfo.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Cos object support */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsparam.h"
+diff --git a/base/gdevpdfp.c b/base/gdevpdfp.c
+--- a/base/gdevpdfp.c
++++ b/base/gdevpdfp.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Get/put parameters for PDF-writing driver */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gdevpdfx.h"
+@@ -109,6 +108,8 @@ static const gs_param_item_t pdf_param_items[] = {
+ pi("SetPageSize", gs_param_type_bool, SetPageSize),
+ pi("RotatePages", gs_param_type_bool, RotatePages),
+ pi("FitPages", gs_param_type_bool, FitPages),
++ pi("CenterPages", gs_param_type_bool, CenterPages),
++ pi("DoNumCopies", gs_param_type_bool, DoNumCopies),
+ #undef pi
+ gs_param_item_end
+ };
+@@ -194,12 +195,10 @@ gdev_pdf_get_params(gx_device * dev, gs_param_list * plist)
+ float cl = (float)pdev->CompatibilityLevel;
+ int code;
+ int cdv = CoreDistVersion;
+- int EmbedFontObjects = 1;
+
+ pdev->ParamCompatibilityLevel = cl;
+ code = gdev_psdf_get_params(dev, plist);
+ if (code < 0 ||
+- (code = param_write_int(plist, ".EmbedFontObjects", &EmbedFontObjects)) < 0 ||
+ (code = param_write_int(plist, "CoreDistVersion", &cdv)) < 0 ||
+ (code = param_write_float(plist, "CompatibilityLevel", &cl)) < 0 ||
+ (pdev->is_ps2write && (code = param_write_string(plist, "OPDFReadProcsetPath", &pdev->OPDFReadProcsetPath)) < 0) ||
+diff --git a/base/gdevpdfr.c b/base/gdevpdfr.c
+--- a/base/gdevpdfr.c
++++ b/base/gdevpdfr.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Named object pdfmark processing */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsutil.h" /* for bytes_compare */
+diff --git a/base/gdevpdft.c b/base/gdevpdft.c
+--- a/base/gdevpdft.c
++++ b/base/gdevpdft.c
+@@ -103,8 +103,8 @@ pdf_make_group_dict(gx_device_pdf * pdev, const gs_pdf14trans_params_t * pparams
+ if (gstate != NULL) {
+ const gs_color_space *cs = gstate->color_space;
+
+- code = pdf_color_space(pdev, &cs_value, NULL, cs,
+- &pdf_color_space_names, false);
++ code = pdf_color_space_named(pdev, &cs_value, NULL, cs,
++ &pdf_color_space_names, false, NULL, 0);
+ if (code < 0)
+ return code;
+ code = cos_dict_put_c_key(group_dict, "/CS", &cs_value);
+@@ -211,6 +211,8 @@ pdf_end_transparency_group(gs_imager_state * pis, gx_device_pdf * pdev)
+ {
+ int bottom = (pdev->ResourcesBeforeUsage ? 1 : 0);
+
++ if (!is_in_page(pdev))
++ return 0; /* corresponds to check in pdf_begin_transparency_group */
+ if (pdev->image_with_SMask) {
+ /* An internal group for the image implementation.
+ See pdf_begin_transparency_group. */
+@@ -396,6 +398,7 @@ gdev_pdf_begin_transparency_mask(gx_device *dev,
+
+ int
+ gdev_pdf_end_transparency_mask(gx_device *dev,
++ gs_imager_state *pis,
+ gs_transparency_mask_t **pptm)
+ {
+ return 0;
+diff --git a/base/gdevpdfu.c b/base/gdevpdfu.c
+--- a/base/gdevpdfu.c
++++ b/base/gdevpdfu.c
+@@ -15,7 +15,6 @@
+ /* Output utilities for PDF-writing driver */
+ #include "memory_.h"
+ #include "jpeglib_.h" /* for sdct.h */
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gscdefs.h"
+@@ -304,7 +303,7 @@ pdf_open_document(gx_device_pdf * pdev)
+ int width = (int)(pdev->width * 72.0 / pdev->HWResolution[0] + 0.5);
+ int height = (int)(pdev->height * 72.0 / pdev->HWResolution[1] + 0.5);
+
+- stream_write(s, (byte *)"%!PS-Adobe-2.0\r", 15);
++ stream_write(s, (byte *)"%!\r", 3);
+ sprintf(BBox, "%%%%BoundingBox: 0 0 %d %d\r", width, height);
+ stream_write(s, (byte *)BBox, strlen(BBox));
+ if(pdev->SetPageSize)
+@@ -313,6 +312,8 @@ pdf_open_document(gx_device_pdf * pdev)
+ stream_puts(s, "/RotatePages true def\n");
+ if(pdev->FitPages)
+ stream_puts(s, "/FitPages true def\n");
++ if(pdev->CenterPages)
++ stream_puts(s, "/CenterPages true def\n");
+ if (pdev->params.CompressPages || pdev->CompressEntireFile) {
+ /* When CompressEntireFile is true and ASCII85EncodePages is false,
+ the ASCII85Encode filter is applied, rather one may expect the opposite.
+@@ -975,7 +976,10 @@ pdf_print_resource_statistics(gx_device_pdf * pdev)
+ long
+ pdf_open_separate(gx_device_pdf * pdev, long id)
+ {
+- pdf_open_document(pdev);
++ int code;
++ code = pdf_open_document(pdev);
++ if (code < 0)
++ return code;
+ pdev->asides.save_strm = pdev->strm;
+ pdev->strm = pdev->asides.strm;
+ return pdf_open_obj(pdev, id);
+@@ -1214,7 +1218,7 @@ pdf_write_and_free_all_resource_objects(gx_device_pdf *pdev)
+ * Sets page->{procsets, resource_ids[]}.
+ */
+ int
+-pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page)
++pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page, bool clear_usage)
+ {
+ int i;
+
+@@ -1243,7 +1247,8 @@ pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page)
+ }
+ pprints1(s, "/%s\n", pres->rname);
+ pprintld1(s, "%ld 0 R", id);
+- pres->where_used -= pdev->used_mask;
++ if (clear_usage)
++ pres->where_used -= pdev->used_mask;
+ }
+ }
+ }
+@@ -1418,8 +1423,10 @@ pdf_unclip(gx_device_pdf * pdev)
+ void
+ pdf_store_default_Producer(char buf[PDF_MAX_PRODUCER])
+ {
+- sprintf(buf, ((gs_revision % 100) == 0 ? "(%s %1.1f)" : "(%s %1.2f)"),
+- gs_product, gs_revision / 100.0);
++ if ((gs_revision % 100) == 0)
++ sprintf(buf, "(%s %1.1f)", gs_product, gs_revision / 100.0);
++ else
++ sprintf(buf, "(%s %1.2f)", gs_product, gs_revision / 100.0);
+ }
+
+ /* Write matrix values. */
+diff --git a/base/gdevpdfv.c b/base/gdevpdfv.c
+--- a/base/gdevpdfv.c
++++ b/base/gdevpdfv.c
+@@ -426,8 +426,8 @@ pdf_put_colored_pattern(gx_device_pdf *pdev, const gx_drawing_color *pdc,
+ * We don't have to worry about color space scaling: the color
+ * space is always a Device space.
+ */
+- code = pdf_color_space(pdev, &cs_value, NULL, pcs_Device,
+- &pdf_color_space_names, true);
++ code = pdf_color_space_named(pdev, &cs_value, NULL, pcs_Device,
++ &pdf_color_space_names, true, NULL, 0);
+ if (code < 0)
+ return code;
+ if (!have_pattern_streams) {
+@@ -494,8 +494,8 @@ pdf_put_shading_common(cos_dict_t *pscd, const gs_shading_t *psh,
+ if (code < 0 ||
+ (psh->params.AntiAlias &&
+ (code = cos_dict_put_c_strings(pscd, "/AntiAlias", "true")) < 0) ||
+- (code = pdf_color_space(pscd->pdev, &cs_value, ppranges, pcs,
+- &pdf_color_space_names, false)) < 0 ||
++ (code = pdf_color_space_named(pscd->pdev, &cs_value, ppranges, pcs,
++ &pdf_color_space_names, false, NULL, 0)) < 0 ||
+ (code = cos_dict_put_c_key(pscd, "/ColorSpace", &cs_value)) < 0
+ )
+ return code;
+diff --git a/base/gdevpdfx.h b/base/gdevpdfx.h
+--- a/base/gdevpdfx.h
++++ b/base/gdevpdfx.h
+@@ -653,6 +653,8 @@ struct gx_device_pdf_s {
+ bool SetPageSize;
+ bool RotatePages;
+ bool FitPages;
++ bool CenterPages;
++ bool DoNumCopies;
+ };
+
+ #define is_in_page(pdev)\
+@@ -887,7 +889,7 @@ int pdf_write_and_free_all_resource_objects(gx_device_pdf *pdev);
+ * Store the resource sets for a content stream (page or XObject).
+ * Sets page->{procsets, resource_ids[], fonts_id}.
+ */
+-int pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page);
++int pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page, bool clear_usage);
+
+ /* Copy data from a temporary file to a stream. */
+ void pdf_copy_data(stream *s, FILE *file, long count, stream_arcfour_state *ss);
+diff --git a/base/gdevpdtb.c b/base/gdevpdtb.c
+--- a/base/gdevpdtb.c
++++ b/base/gdevpdtb.c
+@@ -15,7 +15,6 @@
+ /* BaseFont implementation for pdfwrite */
+ #include "memory_.h"
+ #include "ctype_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsutil.h" /* for bytes_compare */
+@@ -27,7 +26,6 @@
+ #include "gdevpdfx.h"
+ #include "gdevpdfo.h"
+ #include "gdevpdtb.h"
+-#include "gdevpdfg.h"
+ #include "gdevpdtf.h"
+ #include "smd5.h"
+
+@@ -38,7 +36,7 @@
+ * TrueType are subsetted. We do the latter, except that we always
+ * subset large TrueType fonts.
+ */
+-#define MAX_NO_SUBSET_GLYPHS 500 /* arbitrary */
++#define MAX_NO_SUBSET_GLYPHS 4096 /* arbitrary */
+
+ /* ---------------- Private ---------------- */
+
+@@ -632,17 +630,6 @@ pdf_write_embedded_font(gx_device_pdf *pdev, pdf_base_font_t *pbfont, font_type
+ return code;
+ }
+ code = pdf_end_fontfile(pdev, &writer);
+- if (pdev->PDFA && code >= 0) {
+- gs_id metadata_object_id;
+-
+- code = pdf_font_metadata(pdev, pbfont, digest, sizeof(digest), &metadata_object_id);
+- if (metadata_object_id && code >= 0) {
+- char buf[20];
+-
+- sprintf(buf, "%ld 0 R", metadata_object_id);
+- code = cos_dict_put_string_copy(*ppcd, "/Metadata", buf);
+- }
+- }
+ break;
+
+ default:
+diff --git a/base/gdevpdtc.c b/base/gdevpdtc.c
+--- a/base/gdevpdtc.c
++++ b/base/gdevpdtc.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Composite and CID-based text processing for pdfwrite. */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gxfcmap.h"
+@@ -254,6 +253,10 @@ attach_cmap_resource(gx_device_pdf *pdev, pdf_font_resource_t *pdfont,
+ pdf_resource_t *pcmres = 0; /* CMap */
+ int code;
+
++ /* Make sure cmap names is properly initialised. Silences Coverity warning */
++ if (!pcmn)
++ return_error(gs_error_unknownerror);
++
+ /*
+ * If the CMap isn't standard, write it out if necessary.
+ */
+@@ -324,6 +327,12 @@ attach_cmap_resource(gx_device_pdf *pdev, pdf_font_resource_t *pdfont,
+ pdfont->u.type0.CMapName.data = chars;
+ pdfont->u.type0.CMapName.size = size;
+ } else {
++ if (!*pcmn)
++ /* Should not be possible, if *pcmn is NULL then either
++ * is_identity is true or we create pcmres.
++ */
++ return_error(gs_error_invalidfont);
++
+ sprintf(pdfont->u.type0.Encoding_name, "/%s", *pcmn);
+ pdfont->u.type0.CMapName.data = (const byte *)*pcmn;
+ pdfont->u.type0.CMapName.size = strlen(*pcmn);
+@@ -626,6 +635,10 @@ scan_cmap_text(pdf_text_enum_t *pte, void *vbuf)
+ pte->text.operation = save_op;
+ }
+ pte->current_font = subfont0;
++ if (!subfont0 || !pdsubf0)
++ /* This should be impossible */
++ return_error(gs_error_invalidfont);
++
+ code = gs_matrix_multiply(&subfont0->FontMatrix, &font->FontMatrix, &m3);
+ /* We thought that it should be gs_matrix_multiply(&font->FontMatrix, &subfont0->FontMatrix, &m3); */
+ if (code < 0)
+diff --git a/base/gdevpdte.c b/base/gdevpdte.c
+--- a/base/gdevpdte.c
++++ b/base/gdevpdte.c
+@@ -16,7 +16,6 @@
+
+ #include "math_.h"
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsutil.h"
+diff --git a/base/gdevpdtf.c b/base/gdevpdtf.c
+--- a/base/gdevpdtf.c
++++ b/base/gdevpdtf.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Font and CMap resource implementation for pdfwrite text */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+ #include "gsutil.h" /* for bytes_compare */
+diff --git a/base/gdevpdti.c b/base/gdevpdti.c
+--- a/base/gdevpdti.c
++++ b/base/gdevpdti.c
+@@ -14,7 +14,6 @@
+ /* $Id$ */
+ /* Bitmap font implementation for pdfwrite */
+ #include "memory_.h"
+-#include "string_.h"
+ #include "gx.h"
+ #include "gxpath.h"
+ #include "gserrors.h"
+diff --git a/base/gdevpdtt.c b/base/gdevpdtt.c
+--- a/base/gdevpdtt.c
++++ b/base/gdevpdtt.c
+@@ -328,13 +328,19 @@ gdev_pdf_text_begin(gx_device * dev, gs_imager_state * pis,
+ /* Track the dominant text rotation. */
+ {
+ gs_matrix tmat;
++ gs_point p;
+ int i;
+
+- gs_matrix_multiply(&font->FontMatrix, &ctm_only(pis), &tmat);
+- if (is_xxyy(&tmat))
+- i = (tmat.xx >= 0 ? 0 : 2);
+- else if (is_xyyx(&tmat))
+- i = (tmat.xy >= 0 ? 1 : 3);
++ gs_matrix_multiply(&font->FontMatrix, &ctm_only(pis), &tmat);
++ gs_distance_transform(1, 0, &tmat, &p);
++ if (p.x > fabs(p.y))
++ i = 0;
++ else if (p.x < -fabs(p.y))
++ i = 2;
++ else if (p.y > fabs(p.x))
++ i = 1;
++ else if (p.y < -fabs(p.x))
++ i = 3;
+ else
+ i = 4;
+ pdf_current_page(pdev)->text_rotation.counts[i] += text->size;
+@@ -734,7 +740,7 @@ pdf_check_encoding_compatibility(const pdf_font_resource_t *pdfont,
+ }
+
+ /*
+- * Check öðóåðóê the Encoding has listed glyphs.
++ * Check whether the Encoding has listed glyphs.
+ */
+ static bool
+ pdf_check_encoding_has_glyphs(const pdf_font_resource_t *pdfont,
+@@ -945,7 +951,9 @@ pdf_obtain_cidfont_resource(gx_device_pdf *pdev, gs_font *subfont,
+ {
+ int code = 0;
+
+- pdf_attached_font_resource(pdev, subfont, ppdsubf, NULL, NULL, NULL, NULL);
++ code = pdf_attached_font_resource(pdev, subfont, ppdsubf, NULL, NULL, NULL, NULL);
++ if (code < 0)
++ return code;
+ if (*ppdsubf != NULL) {
+ const gs_font_base *cfont = pdf_font_resource_font(*ppdsubf, false);
+
+@@ -1636,7 +1644,9 @@ pdf_obtain_font_resource_encoded(gx_device_pdf *pdev, gs_font *font,
+ same_encoding = ((base_font->procs.same_font(base_font, font,
+ FONT_SAME_ENCODING) & FONT_SAME_ENCODING) != 0);
+ /* Find or make font resource. */
+- pdf_attached_font_resource(pdev, base_font, ppdfont, NULL, NULL, NULL, NULL);
++ code = pdf_attached_font_resource(pdev, base_font, ppdfont, NULL, NULL, NULL, NULL);
++ if (code < 0)
++ return code;
+ if (*ppdfont != NULL && base_font != font) {
+ if (pdfont_not_allowed == *ppdfont)
+ *ppdfont = NULL;
+diff --git a/base/gdevpdtw.c b/base/gdevpdtw.c
+--- a/base/gdevpdtw.c
++++ b/base/gdevpdtw.c
+@@ -510,6 +510,12 @@ pdf_write_contents_cid2(gx_device_pdf *pdev, pdf_font_resource_t *pdfont)
+ }
+ }
+
++ if (map_id == 0 && pdev->PDFA) {
++ code = stream_puts(pdev->strm, "/CIDToGIDMap /Identity\n");
++ if (code < 0)
++ return code;
++ }
++
+ code = write_contents_cid_common(pdev, pdfont, 2);
+ if (code < 0)
+ return code;
+diff --git a/base/gdevprn.c b/base/gdevprn.c
+--- a/base/gdevprn.c
++++ b/base/gdevprn.c
+@@ -973,9 +973,7 @@ gdev_prn_colors_used(gx_device *dev, int y, int height,
+ gx_device_clist_writer *cldev;
+
+ /* If this isn't a banded device, return default values. */
+- if (dev_proc(dev, get_bits_rectangle) !=
+- gs_clist_device_procs.get_bits_rectangle
+- ) {
++ if (dev_proc(dev, open_device) != gs_clist_device_procs.open_device) {
+ *range_start = 0;
+ colors_used->or = ((gx_color_index)1 << dev->color_info.depth) - 1;
+ return dev->height;
+diff --git a/base/gdevprn.h b/base/gdevprn.h
+--- a/base/gdevprn.h
++++ b/base/gdevprn.h
+@@ -406,10 +406,24 @@ extern const gx_device_procs prn_std_procs;
+ (float)((rm) * 72.0), (float)((tm) * 72.0)\
+ ),\
+ prn_device_body_rest_(print_page)
++#define prn_device_margins_stype_body(dtype, procs, dname, stype, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
++ std_device_full_body_type(dtype, &procs, dname, stype,\
++ (int)((float)(w10) * (xdpi) / 10 + 0.5),\
++ (int)((float)(h10) * (ydpi) / 10 + 0.5),\
++ xdpi, ydpi,\
++ ncomp, depth, mg, mc, dg, dc,\
++ (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
++ (float)((lm) * 72.0), (float)((bm) * 72.0),\
++ (float)((rm) * 72.0), (float)((tm) * 72.0)\
++ ),\
++ prn_device_body_rest_(print_page)
+
+ #define prn_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
+ prn_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi,\
+ lm, tm, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)
++#define prn_device_stype_body(dtype, procs, dname, stype, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
++ prn_device_margins_stype_body(dtype, procs, dname, stype, w10, h10, xdpi, ydpi,\
++ lm, tm, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)
+
+ #define prn_device_margins_body_extended(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn, print_page)\
+ std_device_full_body_type_extended(dtype, &procs, dname, &st_device_printer,\
+diff --git a/base/gdevps.c b/base/gdevps.c
+--- a/base/gdevps.c
++++ b/base/gdevps.c
+@@ -15,7 +15,6 @@
+ /* PostScript-writing driver */
+ #include "math_.h"
+ #include "memory_.h"
+-#include "string_.h"
+ #include "time_.h"
+ #include "gx.h"
+ #include "gserrors.h"
+diff --git a/base/gdevpsdi.c b/base/gdevpsdi.c
+--- a/base/gdevpsdi.c
++++ b/base/gdevpsdi.c
+@@ -132,50 +132,52 @@ choose_DCT_params(gx_device *pdev, const gs_color_space *pcs,
+ set_linear_color_bits_mask_shift((gx_device *)&mdev);
+ mdev.color_info.separable_and_linear = GX_CINFO_SEP_LIN;
+
+- /* Check for an RGB-like color space.
+- To recognize that we make a matrix as it were a linear operator,
+- suppress an ununiformity by subtracting the image of {0,0,0},
+- and then check for giagonal domination. */
+- cc.paint.values[0] = cc.paint.values[1] = cc.paint.values[2] = MIN_FLOAT;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[3]);
+- cc.paint.values[0] = MAX_FLOAT; cc.paint.values[1] = MIN_FLOAT; cc.paint.values[2] = MIN_FLOAT;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[0]);
+- cc.paint.values[0] = MIN_FLOAT; cc.paint.values[1] = MAX_FLOAT; cc.paint.values[2] = MIN_FLOAT;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[1]);
+- cc.paint.values[0] = MIN_FLOAT; cc.paint.values[1] = MIN_FLOAT; cc.paint.values[2] = MAX_FLOAT;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[2]);
+- c[0][0] -= c[3][0]; c[0][1] -= c[3][1]; c[0][2] -= c[3][2];
+- c[1][0] -= c[3][0]; c[1][1] -= c[3][1]; c[1][2] -= c[3][2];
+- c[2][0] -= c[3][0]; c[2][1] -= c[3][1]; c[2][2] -= c[3][2];
+- c[0][0] = any_abs(c[0][0]); c[0][1] = any_abs(c[0][1]); c[0][2] = any_abs(c[0][2]);
+- c[1][0] = any_abs(c[1][0]); c[1][1] = any_abs(c[1][1]); c[1][2] = any_abs(c[1][2]);
+- c[2][0] = any_abs(c[2][0]); c[2][1] = any_abs(c[2][1]); c[2][2] = any_abs(c[2][2]);
+- if (c[0][0] * domination > c[0][1] && c[0][0] * domination > c[0][2] &&
+- c[1][1] * domination > c[1][0] && c[1][1] * domination > c[1][2] &&
+- c[2][2] * domination > c[2][0] && c[2][2] * domination > c[2][1]) {
+- /* Yes, it looks like an RGB color space.
+- Replace ColorTransform with 1. */
+- code = param_write_int((gs_param_list *)list, "ColorTransform", &one);
+- if (code < 0)
+- return code;
+- goto done;
+- }
++ if (pis) {
++ /* Check for an RGB-like color space.
++ To recognize that we make a matrix as it were a linear operator,
++ suppress an ununiformity by subtracting the image of {0,0,0},
++ and then check for giagonal domination. */
++ cc.paint.values[0] = cc.paint.values[1] = cc.paint.values[2] = MIN_FLOAT;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[3]);
++ cc.paint.values[0] = MAX_FLOAT; cc.paint.values[1] = MIN_FLOAT; cc.paint.values[2] = MIN_FLOAT;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[0]);
++ cc.paint.values[0] = MIN_FLOAT; cc.paint.values[1] = MAX_FLOAT; cc.paint.values[2] = MIN_FLOAT;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[1]);
++ cc.paint.values[0] = MIN_FLOAT; cc.paint.values[1] = MIN_FLOAT; cc.paint.values[2] = MAX_FLOAT;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[2]);
++ c[0][0] -= c[3][0]; c[0][1] -= c[3][1]; c[0][2] -= c[3][2];
++ c[1][0] -= c[3][0]; c[1][1] -= c[3][1]; c[1][2] -= c[3][2];
++ c[2][0] -= c[3][0]; c[2][1] -= c[3][1]; c[2][2] -= c[3][2];
++ c[0][0] = any_abs(c[0][0]); c[0][1] = any_abs(c[0][1]); c[0][2] = any_abs(c[0][2]);
++ c[1][0] = any_abs(c[1][0]); c[1][1] = any_abs(c[1][1]); c[1][2] = any_abs(c[1][2]);
++ c[2][0] = any_abs(c[2][0]); c[2][1] = any_abs(c[2][1]); c[2][2] = any_abs(c[2][2]);
++ if (c[0][0] * domination > c[0][1] && c[0][0] * domination > c[0][2] &&
++ c[1][1] * domination > c[1][0] && c[1][1] * domination > c[1][2] &&
++ c[2][2] * domination > c[2][0] && c[2][2] * domination > c[2][1]) {
++ /* Yes, it looks like an RGB color space.
++ Replace ColorTransform with 1. */
++ code = param_write_int((gs_param_list *)list, "ColorTransform", &one);
++ if (code < 0)
++ return code;
++ goto done;
++ }
+
+- /* Check for a Lab-like color space.
+- Colors {v,0,0} should map to grays. */
+- cc.paint.values[0] = MAX_FLOAT; cc.paint.values[1] = cc.paint.values[2] = 0;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[0]);
+- cc.paint.values[0] /= 2;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[1]);
+- cc.paint.values[0] /= 2;
+- convert_color((gx_device *)&mdev, pcs, pis, &cc, c[2]);
+- c[0][1] -= c[0][0]; c[0][2] -= c[0][0];
+- c[1][1] -= c[1][0]; c[1][2] -= c[1][0];
+- c[2][1] -= c[2][0]; c[2][2] -= c[2][0];
+- c[0][1] = any_abs(c[0][1]); c[0][2] = any_abs(c[0][2]);
+- c[1][1] = any_abs(c[1][1]); c[1][2] = any_abs(c[1][2]);
+- c[2][1] = any_abs(c[2][1]); c[2][2] = any_abs(c[2][2]);
+- if (c[0][0] * domination > c[0][1] && c[0][0] * domination > c[0][2] &&
++ /* Check for a Lab-like color space.
++ Colors {v,0,0} should map to grays. */
++ cc.paint.values[0] = MAX_FLOAT; cc.paint.values[1] = cc.paint.values[2] = 0;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[0]);
++ cc.paint.values[0] /= 2;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[1]);
++ cc.paint.values[0] /= 2;
++ convert_color((gx_device *)&mdev, pcs, pis, &cc, c[2]);
++ c[0][1] -= c[0][0]; c[0][2] -= c[0][0];
++ c[1][1] -= c[1][0]; c[1][2] -= c[1][0];
++ c[2][1] -= c[2][0]; c[2][2] -= c[2][0];
++ c[0][1] = any_abs(c[0][1]); c[0][2] = any_abs(c[0][2]);
++ c[1][1] = any_abs(c[1][1]); c[1][2] = any_abs(c[1][2]);
++ c[2][1] = any_abs(c[2][1]); c[2][2] = any_abs(c[2][2]);
++ }
++ if (pis && c[0][0] * domination > c[0][1] && c[0][0] * domination > c[0][2] &&
+ c[1][0] * domination > c[1][1] && c[1][0] * domination > c[1][2] &&
+ c[2][0] * domination > c[2][1] && c[2][0] * domination > c[2][2]) {
+ /* Yes, it looks like an Lab color space.
+diff --git a/base/gdevpsdp.c b/base/gdevpsdp.c
+--- a/base/gdevpsdp.c
++++ b/base/gdevpsdp.c
+@@ -487,22 +487,22 @@ psdf_DCT_put_params(gs_param_list * plist, stream_state * st)
+ }
+
+ /* Put [~](Always|Never)Embed parameters. */
++/* Returns 0 = OK, 1 = no paramewter specified, <0 = error. */
+ static int
+ param_read_embed_array(gs_param_list * plist, gs_param_name pname,
+- gs_param_string_array * psa, int ecode)
++ gs_param_string_array * psa)
+ {
+ int code;
+
+ psa->data = 0, psa->size = 0;
+ switch (code = param_read_name_array(plist, pname, psa)) {
+ default:
+- ecode = code;
+- param_signal_error(plist, pname, ecode);
++ param_signal_error(plist, pname, code);
+ case 0:
+ case 1:
+ break;
+ }
+- return ecode;
++ return code;
+ }
+ static bool
+ param_string_eq(const gs_param_string *ps1, const gs_param_string *ps2)
+@@ -563,88 +563,83 @@ delete_embed(gs_param_string_array *prsa, const gs_param_string_array *pnsa,
+ }
+ prsa->size = count;
+ }
++static int merge_embed(gs_param_string_array * psa, gs_param_string_array * asa,
++ gs_memory_t *mem)
++{
++ gs_param_string_array rsa;
++ gs_param_string *rdata;
++ int code;
++
++ rdata = gs_alloc_struct_array(mem, psa->size + asa->size,
++ gs_param_string,
++ &st_param_string_element,
++ "psdf_put_embed_param(update)");
++ if (rdata == 0)
++ return_error(gs_error_VMerror);
++ memcpy(rdata, psa->data, psa->size * sizeof(*psa->data));
++ rsa.data = rdata;
++ rsa.size = psa->size;
++ rsa.persistent = false;
++ code = add_embed(&rsa, asa, mem);
++ if (code < 0) {
++ gs_free_object(mem, rdata, "psdf_put_embed_param(update)");
++ return code;
++ }
++ gs_free_const_object(mem, psa->data, "psdf_put_embed_param(free)");
++ *psa = rsa;
++ return 0;
++}
++
+ static int
+ psdf_put_embed_param(gs_param_list * plist, gs_param_name notpname,
+- gs_param_name allpname, gs_param_string_array * psa,
++ gs_param_name pname, gs_param_string_array * psa,
+ gs_memory_t *mem, int ecode)
+ {
+- gs_param_name pname = notpname + 1;
++ gs_param_name allpname = pname + 1;
+ gs_param_string_array sa, nsa, asa;
+- bool replace;
+- gs_param_string *rdata;
+- gs_param_string_array rsa;
+- int code = 0;
++ int code;
+
+ mem = gs_memory_stable(mem);
+- ecode = param_read_embed_array(plist, pname, &sa, ecode);
+- ecode = param_read_embed_array(plist, notpname, &nsa, ecode);
+- ecode = param_read_embed_array(plist, allpname, &asa, ecode);
+- if (ecode < 0)
+- return ecode;
+- /*
+- * Figure out whether we're replacing (sa == asa or asa and no sa,
+- * no nsa) or updating (all other cases).
+- */
+- if (asa.data == 0 || nsa.data != 0)
+- replace = false;
+- else if (sa.data == 0)
+- replace = true;
+- else if (sa.size != asa.size)
+- replace = false;
+- else {
+- /* Test whether sa == asa. */
+- uint i;
++ code = param_read_embed_array(plist, pname, &sa);
++ if (code < 0)
++ return code;
++ if (code == 0) {
++ /* Optimize for sa == *psa. */
++ int i;
+
+- replace = true;
+- for (i = 0; i < sa.size; ++i)
+- if (!param_string_eq(&sa.data[i], &asa.data[i])) {
+- replace = false;
+- break;
+- }
+- if (replace)
+- return 0; /* no-op */
+- }
+- if (replace) {
+- /* Wholesale replacement, only asa is relevant. */
+- rdata = gs_alloc_struct_array(mem, asa.size, gs_param_string,
+- &st_param_string_element,
+- "psdf_put_embed_param(replace)");
+- if (rdata == 0)
+- return_error(gs_error_VMerror);
+- rsa.data = rdata;
+- rsa.size = 0;
+- if ((code = add_embed(&rsa, &asa, mem)) < 0) {
+- gs_free_object(mem, rdata, "psdf_put_embed_param(replace)");
+- ecode = code;
++ if (sa.size == psa->size) {
++ for (i = 0; i < sa.size; ++i) {
++ if (!param_string_eq(&sa.data[i], &psa->data[i]))
++ break;
++ }
+ } else
+- delete_embed(psa, psa, mem);
+- } else if (sa.data || nsa.data) {
+- /* Incremental update, sa and nsa are relevant, asa is not. */
+- rdata = gs_alloc_struct_array(mem, psa->size + sa.size,
+- gs_param_string,
+- &st_param_string_element,
+- "psdf_put_embed_param(update)");
+- if (rdata == 0)
+- return_error(gs_error_VMerror);
+- memcpy(rdata, psa->data, psa->size * sizeof(*psa->data));
+- rsa.data = rdata;
+- rsa.size = psa->size;
+- if ((code = add_embed(&rsa, &sa, mem)) < 0) {
+- gs_free_object(mem, rdata, "psdf_put_embed_param(update)");
+- ecode = code;
++ i = -1;
++ if (i == sa.size) {
++ /* equal, no-op. */
+ } else {
+- delete_embed(&rsa, &nsa, mem);
+- rsa.data = gs_resize_object(mem, rdata, rsa.size,
++ delete_embed(psa, psa, mem);
++ code = merge_embed(psa, &sa, mem);
++ if (code < 0)
++ return code;
++ }
++ }
++ code = param_read_embed_array(plist, notpname, &nsa);
++ if (code < 0)
++ return code;
++ if (nsa.data != 0)
++ delete_embed(psa, &nsa, mem);
++ code = param_read_embed_array(plist, allpname, &asa);
++ if (code < 0)
++ return code;
++ if (asa.data != 0) {
++ code = merge_embed(psa, &asa, mem);
++ if (code < 0)
++ return code;
++ }
++ if (psa->data)
++ psa->data = gs_resize_object(mem, (gs_param_string *)psa->data, psa->size,
+ "psdf_put_embed_param(resize)");
+- }
+- } else
+- return 0; /* no-op */
+- if (code >= 0) {
+- gs_free_const_object(mem, psa->data, "psdf_put_embed_param(free)");
+- rsa.persistent = false;
+- *psa = rsa;
+- }
+- return ecode;
++ return 0;
+ }
+
+ /* Put an image Dict parameter. */
+diff --git a/base/gdevpsf2.c b/base/gdevpsf2.c
+--- a/base/gdevpsf2.c
++++ b/base/gdevpsf2.c
+@@ -28,7 +28,6 @@
+ #include "gxfont1.h"
+ #include "gxfcid.h"
+ #include "stream.h"
+-#include "sfilter.h"
+ #include "gdevpsf.h"
+
+ /* Define additional opcodes used in Dicts, but not in CharStrings. */
+@@ -1534,15 +1533,15 @@ psf_write_cid0_font(stream *s, gs_font_cid0 *pfont, int options,
+ */
+ uint
+ Top_size = 0x7fffff,
+- GSubrs_offset = 0x7fffff,
+- charset_offset = 0x7fffff,
+- FDSelect_offset = 0x7fffff,
+- CharStrings_offset = 0x7fffff,
+- Font_offset = 0x7fffff,
++ GSubrs_offset = 0x1ffffff,
++ charset_offset = 0x1ffffff,
++ FDSelect_offset = 0x1ffffff,
++ CharStrings_offset = 0x1ffffff,
++ Font_offset = 0x1ffffff,
+ FDArray_offsets[257],
+ Private_offsets[257],
+ Subrs_offsets[257],
+- End_offset = 0x7fffff;
++ End_offset = 0x1ffffff;
+ int j;
+ psf_glyph_enum_t genum;
+ gs_font_info_t info;
+@@ -1639,8 +1638,11 @@ psf_write_cid0_font(stream *s, gs_font_cid0 *pfont, int options,
+ fdselect_size = cff_FDSelect_size(&writer, &genum, &fdselect_format);
+
+ /* Compute the size of the CharStrings Index. */
+- charstrings_size =
+- cff_write_CharStrings_offsets(&writer, &genum, &charstrings_count);
++ /* Compute the size of the CharStrings Index. */
++ code = cff_write_CharStrings_offsets(&writer, &genum, &charstrings_count);
++ if (code < 0)
++ return code;
++ charstrings_size = (uint)code;
+
+ /* Compute the size of the (local) Subrs Indexes. */
+ for (j = 0; j < num_fonts; ++j) {
+diff --git a/base/gdevpsfm.c b/base/gdevpsfm.c
+--- a/base/gdevpsfm.c
++++ b/base/gdevpsfm.c
+@@ -20,7 +20,6 @@
+ #include "spprint.h"
+ #include "spsdf.h"
+ #include "gdevpsf.h"
+-#include "memory_.h"
+
+ /* ---------------- Utilities ---------------- */
+
+diff --git a/base/gdevpsft.c b/base/gdevpsft.c
+--- a/base/gdevpsft.c
++++ b/base/gdevpsft.c
+@@ -711,6 +711,30 @@ write_post(stream *s, gs_font *font, post_t *post)
+ return 0;
+ }
+
++static inline bool check_position(int pos1, int pos2)
++{
++ if (pos1 == pos2)
++ return false;
++ eprintf2("Actual TT subtable offset %d differs from one in the TT header %d.\n", pos1, pos2);
++ return true;
++}
++
++void remove_table(byte *tables, char *tag, uint *numTables)
++{
++ /* Not a high performance implementation because it is called seldom. */
++ int i;
++
++ for (i = 0; i < *numTables;) {
++ byte *tab = tables + i * 16;
++
++ if (!memcmp(tab, tag, 4)) {
++ memmove(tab, tab + 16, 16 * (*numTables - i - 1));
++ --*numTables;
++ } else
++ ++i;
++ }
++}
++
+ /* ---------------- Main program ---------------- */
+
+ /* Write the definition of a TrueType font. */
+@@ -758,8 +782,15 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ uint cmap_length = 0;
+ ulong OS_2_start = 0;
+ uint OS_2_length = OS_2_LENGTH1;
++ ulong maxp_start = 0;
++ uint maxp_length = 0;
++ struct { int glyf, loca, cmap, name, os_2, mtx[2], post, head;
++ } subtable_positions;
++ int start_position = stell(s);
++ int enlarged_numGlyphs = 0;
+ int code;
+
++ memset(&subtable_positions, 0, sizeof(subtable_positions));
+ have_hvhea[0] = have_hvhea[1] = 0;
+ if (alt_font_name)
+ font_name = *alt_font_name;
+@@ -814,6 +845,8 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ case W('m','a','x','p'):
+ READ_SFNTS(pfont, start, length, data);
+ numGlyphs = U16(data + 4);
++ maxp_start = start;
++ maxp_length = length;
+ break;
+ case W('n','a','m','e'):
+ if (writing_cid)
+@@ -849,6 +882,10 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ case W('k','e','r','n'):
+ case W('p','r','e','p'):
+ break; /* always copy these if present */
++ case W('E','B','D','T'):
++ case W('E','B','L','C'):
++ case W('E','B','S','C'):
++ continue;
+ default:
+ if (writing_cid)
+ continue;
+@@ -888,19 +925,30 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ gs_glyph_data_free(&glyph_data, "psf_write_truetype_data");
+ }
+ }
+- /*
+- * For subset fonts, we should trim the loca table so that it only
+- * contains entries through max_glyph. Unfortunately, this would
+- * require changing numGlyphs in maxp, which in turn would affect hdmx,
+- * hhea, hmtx, vdmx, vhea, vmtx, and possibly other tables. This is way
+- * more work than we want to do right now.
+- */
+ if (writing_stripped) {
+ glyf_length = 0;
+ loca_length = 0;
+ } else {
+- /*loca_length = (max_glyph + 2) << 2;*/
+- loca_length = (numGlyphs + 1) << 2;
++ if (max_glyph + 1 > numGlyphs) {
++ /* Either original font is wrong,
++ or we added glyphs to it due to font merge.
++ Need to adjust maxp, hmtx, vmtx, vdmx, hdmx,
++ assuming that the merge doesn't change hhea
++ and other tables.
++ Since changing hdmx, vdmx is too difficult,
++ and since they're not required for PDF,
++ we'll simply skip them.
++ */
++ enlarged_numGlyphs = max_glyph + 1;
++ if (enlarged_numGlyphs > 0xFFFF) {
++ eprintf1("The number of glyphs %d exceeds capability of True Type format.\n", enlarged_numGlyphs);
++ return_error(gs_error_unregistered);
++ }
++ loca_length = (enlarged_numGlyphs + 1) << 2;
++ remove_table(tables, "hdmx", &numTables);
++ remove_table(tables, "vdmx", &numTables);
++ } else
++ loca_length = (numGlyphs + 1) << 2;
+ indexToLocFormat = (glyf_length > 0x1fffc);
+ if (!indexToLocFormat)
+ loca_length >>= 1;
+@@ -962,10 +1010,11 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ byte *tab = &tables[numTables * 16];
+
+ if (!writing_stripped) {
++ subtable_positions.glyf = offset;
+ offset = put_table(tab, "glyf", glyf_checksum,
+ offset, glyf_length);
+ tab += 16;
+-
++ subtable_positions.loca = offset;
+ offset = put_table(tab, "loca", loca_checksum[indexToLocFormat],
+ offset, loca_length);
+ tab += 16;
+@@ -974,18 +1023,21 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ if (!have_cmap) {
+ cmap_length = size_cmap(font, TT_BIAS, 256,
+ GS_MIN_GLYPH_INDEX + max_glyph, options);
++ subtable_positions.cmap = offset;
+ offset = put_table(tab, "cmap", 0L /****** NO CHECKSUM ******/,
+ offset, cmap_length);
+ tab += 16;
+ }
+
+ if (!have_name) {
++ subtable_positions.name = offset;
+ offset = put_table(tab, "name", 0L /****** NO CHECKSUM ******/,
+ offset, size_name(&font_name));
+ tab += 16;
+ }
+
+ if (!no_generate) {
++ subtable_positions.os_2 = offset;
+ offset = put_table(tab, "OS/2", 0L /****** NO CHECKSUM ******/,
+ offset, OS_2_length);
+ tab += 16;
+@@ -994,6 +1046,7 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ if (generate_mtx)
+ for (i = 0; i < 2; ++i)
+ if (have_hvhea[i]) {
++ subtable_positions.mtx[i] = offset;
+ offset = put_table(tab, (i ? "vmtx" : "hmtx"),
+ 0L /****** NO CHECKSUM ******/,
+ offset,
+@@ -1002,6 +1055,7 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ }
+
+ if (!have_post) {
++ subtable_positions.post = offset;
+ offset = put_table(tab, "post", 0L /****** NO CHECKSUM ******/,
+ offset, post.length);
+ tab += 16;
+@@ -1011,6 +1065,7 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ * Note that the 'head' table must have length 54, even though
+ * it occupies 56 bytes on the file.
+ */
++ subtable_positions.head = offset;
+ offset = put_table(tab, "head", head_checksum, offset, 54);
+ tab += 16;
+ }
+@@ -1082,6 +1137,19 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ put_pad(s, OS_2_length);
+ }
+ break;
++ case W('m','a','x','p'):
++ if (enlarged_numGlyphs) {
++ /* Must keep the table size. */
++ byte buf[6];
++
++ READ_SFNTS(pfont, maxp_start, sizeof(buf), buf);
++ put_u16(buf + 4, enlarged_numGlyphs);
++ stream_write(s, buf, min(length, sizeof(buf)));
++ if (length > sizeof(buf)) /* Paranoid Safety */
++ write_range(s, pfont, start + sizeof(buf), length - sizeof(buf));
++ } else
++ write_range(s, pfont, start, length);
++ break;
+ case W('h','h','e','a'):
+ case W('v','h','e','a'):
+ if (generate_mtx) {
+@@ -1098,9 +1166,12 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ }
+
+ if (!writing_stripped) {
++ int n = max(numGlyphs, enlarged_numGlyphs) + 1;
+
+ /* Write glyf. */
+
++ if (check_position(subtable_positions.glyf + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ psf_enumerate_glyphs_reset(penum);
+ for (offset = 0; psf_enumerate_glyphs_next(penum, &glyph) != 1; ) {
+ gs_glyph_data_t glyph_data;
+@@ -1131,6 +1202,8 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+
+ /* Write loca. */
+
++ if (check_position(subtable_positions.loca + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ psf_enumerate_glyphs_reset(penum);
+ glyph_prev = 0;
+ for (offset = 0; psf_enumerate_glyphs_next(penum, &glyph) != 1; ) {
+@@ -1153,25 +1226,36 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+
+ }
+ /* Pad to numGlyphs + 1 entries (including the trailing entry). */
+- for (; glyph_prev <= numGlyphs; ++glyph_prev)
++ for (; glyph_prev < n; ++glyph_prev)
+ put_loca(s, offset, indexToLocFormat);
+ put_pad(s, loca_length);
+
+ /* If necessary, write cmap, name, and OS/2. */
+
+- if (!have_cmap)
++ if (!have_cmap) {
++ if (check_position(subtable_positions.cmap + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ write_cmap(s, font, TT_BIAS, 256, GS_MIN_GLYPH_INDEX + max_glyph,
+ options, cmap_length);
+- if (!have_name)
++ }
++ if (!have_name) {
++ if (check_position(subtable_positions.name + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ write_name(s, &font_name);
+- if (!have_OS_2)
++ }
++ if (!have_OS_2) {
++ if (check_position(subtable_positions.os_2 + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ write_OS_2(s, font, TT_BIAS, 256);
++ }
+
+ /* If necessary, write [hv]mtx. */
+
+ if (generate_mtx)
+ for (i = 0; i < 2; ++i)
+ if (have_hvhea[i]) {
++ if (check_position(subtable_positions.mtx[i] + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ write_mtx(s, pfont, &mtx[i], i);
+ put_pad(s, mtx[i].length);
+ }
+@@ -1179,6 +1263,8 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ /* If necessary, write post. */
+
+ if (!have_post) {
++ if (check_position(subtable_positions.post + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ if (options & WRITE_TRUETYPE_POST) {
+ code = write_post(s, font, &post);
+ if (code < 0)
+@@ -1207,6 +1293,8 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
+ #endif
+ put_u32(head + 8, HEAD_MAGIC - file_checksum); /* per spec */
+ #undef HEAD_MAGIC
++ if (check_position(subtable_positions.head + start_position, stell(s)))
++ return_error(gs_error_unregistered);
+ stream_write(s, head, 56);
+
+ return 0;
+diff --git a/base/gdevpsfx.c b/base/gdevpsfx.c
+--- a/base/gdevpsfx.c
++++ b/base/gdevpsfx.c
+@@ -464,8 +464,8 @@ psf_convert_type1_to_type2(stream *s, const gs_glyph_data_t *pgd,
+ END
+ fixed mx0 = 0, my0 = 0; /* See ce1_setcurrentpoint. */
+
+- /* Quiet a Coverity uninitialsed variable warning */
+- cis.lsb.y = 0;
++ /* In case we do not get an sbw or hsbw op */
++ cis.lsb.x = cis.lsb.y = cis.width.x = cis.width.y = fixed_0;
+
+ /*
+ * Do a first pass to collect hints. Note that we must also process
+@@ -508,6 +508,8 @@ psf_convert_type1_to_type2(stream *s, const gs_glyph_data_t *pgd,
+ case ce1_callothersubr:
+ if (*csp == int2fixed(3))
+ replace_hints = true;
++ if (*csp == int2fixed(12) || *csp == int2fixed(13))
++ cis.os_count -= fixed2int(csp[-1]);
+ cis.os_count -= 2;
+ continue;
+ case CE_OFFSET + ce1_dotsection:
+diff --git a/base/gdevpsu.c b/base/gdevpsu.c
+--- a/base/gdevpsu.c
++++ b/base/gdevpsu.c
+@@ -288,7 +288,7 @@ psw_write_page_header(stream *s, const gx_device *dev,
+ if (!pdpc->ProduceEPS)
+ pprintld2(s, "%%%%PageBoundingBox: 0 0 %ld %ld\n", width, height);
+
+- stream_puts(s, "%%%%BeginPageSetup\n");
++ stream_puts(s, "%%BeginPageSetup\n");
+ /*
+ * Adobe's documentation says that page setup must be placed outside the
+ * save/restore that encapsulates the page contents, and that the
+@@ -307,7 +307,7 @@ psw_write_page_header(stream *s, const gx_device *dev,
+ } page_size;
+ static const page_size sizes[] = {
+ {"/11x17", 792, 1224},
+- {"/a3", 842, 1190},
++ {"/a3", 842, 1191},
+ {"/a4", 595, 842},
+ {"/b5", 501, 709},
+ {"/ledger", 1224, 792},
+@@ -317,9 +317,16 @@ psw_write_page_header(stream *s, const gx_device *dev,
+ };
+ const page_size *p = sizes;
+
+- while (p->size_name[0] == '/' &&
+- (p->width != width || p->height != height))
+- ++p;
++ while (p->size_name[0] == '/') {
++ if((p->width - 5) <= width && (p->width + 5) >= width) {
++ if((p->height - 5) <= height && (p->height + 5) >= height) {
++ break;
++ } else
++ ++p;
++ }
++ else
++ ++p;
++ }
+ pprintd2(s, "%d %d ", width, height);
+ pprints1(s, "%s setpagesize\n", p->size_name);
+ }
+diff --git a/base/gdevpxen.h b/base/gdevpxen.h
+--- a/base/gdevpxen.h
++++ b/base/gdevpxen.h
+@@ -198,6 +198,7 @@ typedef enum {
+ * The arguments are:
+ * media size code, resolution for width/height, width, height.
+ */
++
+ #define px_enumerate_media(m)\
+ m(eDefaultPaperSize, -1, -1, -1)\
+ m(eLetterPaper, 300, 2550, 3300)\
+@@ -210,18 +211,18 @@ typedef enum {
+ m(eMonarchEnvelope, 300, 1162, 2250)\
+ m(eC5Envelope, 300, 1913, 2704)\
+ m(eDLEnvelope, 300, 1299, 2598)\
+- m(eJB4Paper, -1, -1, -1)\
++ m(eJB4Paper, 300, 3035, 4299)\
+ m(eJB5Paper, 300, 2150, 3035)\
+ m(eB5Envelope, 300, 2078, 2952)\
+ m(eB5Paper, 300, 2150, 3035)\
+- m(eJPostcard, 300, 1181, 1748)\
+- m(eJDoublePostcard, -1, -1, -1)\
++ m(eJPostcard, 300, 1181, 1748)\
++ m(eJDoublePostcard, 300, 2362, 1748)\
+ m(eA5Paper,300,1748, 2480)\
+- m(eA6Paper,-1, -1, -1)\
+- m(eJB6Paper,-1, -1, -1)\
+- m(eJIS8K, -1, -1, -1)\
+- m(eJIS16K, -1, -1, -1)\
+- m(eJISExec, -1, -1, -1)
++ m(eA6Paper,300, 1240, 1748)\
++ m(eJB6Paper,300, 1512, 2150)\
++ m(eJIS8K, 300, 3154, 4606)\
++ m(eJIS16K, 300, 2303, 3154)\
++ m(eJISExec, 300, 2551, 3898)
+
+ typedef enum {
+ eDefaultSource = 0,
+diff --git a/base/gdevsgi.c b/base/gdevsgi.c
+--- a/base/gdevsgi.c
++++ b/base/gdevsgi.c
+@@ -65,18 +65,77 @@ typedef struct sgi_cursor_s {
+ int lnum;
+ } sgi_cursor;
+
++/* write a short int to disk as big-endean */
++static int putshort(unsigned int val, FILE *outf)
++{
++ unsigned char buf[2];
++
++ buf[0] = (val>>8);
++ buf[1] = val;
++ return fwrite(buf,2,1,outf);
++}
++
++/* write an int to disk as big-endean */
++static int putint(unsigned int val, FILE *outf)
++{
++ unsigned char buf[4];
++
++ buf[0] = (val>>24);
++ buf[1] = (val>>16);
++ buf[2] = (val>>8);
++ buf[3] = val;
++ return fwrite(buf,4,1,outf);
++}
++
++/* write the header field by field in big-endian */
++static void putheader(IMAGE *header, FILE *outf)
++{
++ int i;
++ char filler= '\0';
++
++ putshort(header->imagic, outf);
++ fputc(1, outf); /* RLE */
++ fputc(1, outf); /* bpp */
++ putshort(header->dim, outf);
++ putshort(header->xsize, outf);
++ putshort(header->ysize, outf);
++ putshort(header->zsize, outf);
++
++ putint(header->min_color, outf);
++ putint(header->max_color, outf);
++ putint(header->wastebytes, outf);
++
++ fwrite(header->name,80,1,outf);
++
++ putint(header->colormap, outf);
++
++ /* put the filler for the rest */
++ for (i=0; i<404; i++)
++ fputc(filler,outf);
++ }
++
+ static int
+ sgi_begin_page(gx_device_printer *bdev, FILE *pstream, sgi_cursor *pcur)
+ {
+- uint line_size = gdev_mem_bytes_per_scan_line((gx_device_printer*)bdev);
+- byte *data = (byte*)gs_malloc(bdev->memory, line_size, 1, "sgi_begin_page");
+- IMAGE *header= (IMAGE*)gs_malloc(bdev->memory, sizeof(IMAGE),1,"sgi_begin_page");
+- char filler= '\0';
+- int i;
++ uint line_size;
++ byte *data;
++ IMAGE *header;
+
+- if ((data == (byte*)0)||(header == (IMAGE*)0)) return -1;
++ if (bdev->PageCount >= 1 && !bdev->file_is_new) { /* support single page only */
++ eprintf("sgi rgb format only supports one page per file.\n"
++ "Please use the '%%d' OutputFile option to create one file for each page.\n");
++ return_error(gs_error_rangecheck);
++ }
++ line_size = gdev_mem_bytes_per_scan_line((gx_device_printer*)bdev);
++ data = (byte*)gs_malloc(bdev->memory, line_size, 1, "sgi_begin_page");
++ header= (IMAGE*)gs_malloc(bdev->memory, sizeof(IMAGE),1,"sgi_begin_page");
+
+- bzero(header,sizeof(IMAGE));
++ if ((data == (byte*)0)||(header == (IMAGE*)0)) {
++ gs_free(bdev->memory, data, line_size, 1, "sgi_begin_page");
++ gs_free(bdev->memory, header, sizeof(IMAGE),1,"sgi_begin_page");
++ return_error(gs_error_VMerror);
++ }
++ memset(header,0, sizeof(IMAGE));
+ header->imagic = IMAGIC;
+ header->type = RLE(1);
+ header->dim = 3;
+@@ -89,8 +148,7 @@ sgi_begin_page(gx_device_printer *bdev, FILE *pstream, sgi_cursor *pcur)
+ strncpy(header->name,"gs picture",80);
+ header->colormap = CM_NORMAL;
+ header->dorev=0;
+- fwrite(header,sizeof(IMAGE),1,pstream);
+- for (i=0; i<512-sizeof(IMAGE); i++) fputc(filler,pstream);
++ putheader(header,pstream);
+ pcur->dev = bdev;
+ pcur->bpp = bdev->color_info.depth;
+ pcur->line_size = line_size;
+@@ -115,16 +173,24 @@ sgi_print_page(gx_device_printer *pdev, FILE *pstream)
+ int code = sgi_begin_page(bdev, pstream, &cur);
+ uint bpe, mask;
+ int separation;
+- long *rowsizes=(long*)gs_malloc(pdev->memory, 4,3*bdev->height,"sgi_print_page");
++ int *rowsizes;
+ byte *edata ;
+ long lastval;
+ int rownumber;
+-#define aref2(a,b) a*bdev->height+b
++
++ if (pdev->PageCount >= 1 && !pdev->file_is_new)
++ return_error(gs_error_rangecheck); /* support single page only, can't happen */
++
++#define aref2(a,b) (a)*bdev->height+(b)
++ rowsizes=(int*)gs_malloc(pdev->memory, sizeof(int),3*bdev->height,"sgi_print_page");
+ edata = (byte*)gs_malloc(pdev->memory, cur.line_size, 1, "sgi_begin_page");
+- if((code<0)||(rowsizes==(long*)NULL)||(edata==(byte*)NULL)) return(-1);
+- fwrite(rowsizes,sizeof(long),3*bdev->height,pstream); /* rowstarts */
+- fwrite(rowsizes,sizeof(long),3*bdev->height,pstream); /* rowsizes */
+- lastval = 512+sizeof(long)*6*bdev->height;
++
++ if((code<0)||(rowsizes==(int*)NULL)||(edata==(byte*)NULL)) {
++ code = gs_note_error(gs_error_VMerror);
++ goto free_mem;
++ }
++
++ lastval = 512+4*6*bdev->height; /* skip offset table */
+ fseek(pstream,lastval,0);
+ for (separation=0; separation < 3; separation++)
+ {
+@@ -144,11 +210,11 @@ sgi_print_page(gx_device_printer *pdev, FILE *pstream)
+ for (bp = cur.data, x=0, shift = 8 - cur.bpp;
+ x < bdev->width;
+ )
+- { ulong pixel = 0;
++ { uint pixel = 0;
+ uint r, g, b;
+ switch (cur.bpp >> 3)
+ {
+- case 3: pixel = (ulong)*bp << 16; bp++;
++ case 3: pixel = (uint)*bp << 16; bp++;
+ case 2: pixel += (uint)*bp << 8; bp++;
+ case 1: pixel += *bp; bp++; break;
+ case 0: pixel = *bp >> shift;
+@@ -197,24 +263,22 @@ sgi_print_page(gx_device_printer *pdev, FILE *pstream)
+ }
+ *optr++ = 0;
+ rowsizes[aref2(separation,rownumber++)] = optr-startcol;
+- fwrite(startcol,1,optr-startcol,pstream);
++ if (fwrite(startcol,1,optr-startcol,pstream) != optr-startcol) {
++ code = gs_note_error(gs_error_ioerror);
++ goto free_mem;
++ }
+ }
+ }
+ fseek(pstream,512L,0);
+ for(separation=0; separation<3; separation++)
+ for(rownumber=0; rownumber<bdev->height; rownumber++)
+- {fputc((char)(lastval>>24),pstream);
+- fputc((char)(lastval>>16),pstream);
+- fputc((char)(lastval>>8),pstream);
+- fputc((char)(lastval),pstream);
++ {putint(lastval,pstream);
+ lastval+=rowsizes[aref2(separation,rownumber)];}
+ for(separation=0; separation<3; separation++)
+ for(rownumber=0; rownumber<bdev->height; rownumber++)
+ {lastval=rowsizes[aref2(separation,rownumber)];
+- fputc((char)(lastval>>24),pstream);
+- fputc((char)(lastval>>16),pstream);
+- fputc((char)(lastval>>8),pstream);
+- fputc((char)(lastval),pstream);}
++ putint(lastval,pstream);}
++ free_mem:
+ gs_free(pdev->memory, (char*)cur.data, cur.line_size, 1,
+ "sgi_print_page(done)");
+ gs_free(pdev->memory, (char*)edata, cur.line_size, 1, "sgi_print_page(done)");
+diff --git a/base/gdevsgi.h b/base/gdevsgi.h
+--- a/base/gdevsgi.h
++++ b/base/gdevsgi.h
+@@ -46,11 +46,11 @@ typedef struct {
+ unsigned short xsize;
+ unsigned short ysize;
+ unsigned short zsize;
+- unsigned long min_color;
+- unsigned long max_color;
+- unsigned long wastebytes;
++ unsigned int min_color;
++ unsigned int max_color;
++ unsigned int wastebytes;
+ char name[80];
+- unsigned long colormap;
++ unsigned int colormap;
+
+ long file; /* stuff used in core only */
+ unsigned short flags;
+diff --git a/base/gdevtfax.c b/base/gdevtfax.c
+--- a/base/gdevtfax.c
++++ b/base/gdevtfax.c
+@@ -38,6 +38,7 @@ struct gx_device_tfax_s {
+ long MaxStripSize; /* 0 = no limit, other is UNCOMPRESSED limit */
+ /* The type and range of FillOrder follows TIFF 6 spec */
+ int FillOrder; /* 1 = lowest column in the high-order bit, 2 = reverse */
++ bool BigEndian; /* true = big endian; false = little endian*/
+ gdev_tiff_state tiff; /* for TIFF output only */
+ };
+ typedef struct gx_device_tfax_s gx_device_tfax;
+@@ -51,7 +52,8 @@ static const gx_device_procs gdev_tfax_std_procs =
+ {\
+ FAX_DEVICE_BODY(gx_device_tfax, gdev_tfax_std_procs, dname, print_page),\
+ 0 /* unlimited strip size byte count */,\
+- 1 /* lowest column in the high-order bit */\
++ 1 /* lowest column in the high-order bit */,\
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/\
+ }
+
+ const gx_device_tfax gs_tiffcrle_device =
+@@ -78,6 +80,8 @@ tfax_get_params(gx_device * dev, gs_param_list * plist)
+ ecode = code;
+ if ((code = param_write_int(plist, "FillOrder", &tfdev->FillOrder)) < 0)
+ ecode = code;
++ if ((code = param_write_bool(plist, "BigEndian", &tfdev->BigEndian)) < 0)
++ ecode = code;
+ return ecode;
+ }
+ static int
+@@ -89,6 +93,7 @@ tfax_put_params(gx_device * dev, gs_param_list * plist)
+ long mss = tfdev->MaxStripSize;
+ int fill_order = tfdev->FillOrder;
+ const char *param_name;
++ bool big_endian = tfdev->BigEndian;
+
+ switch (code = param_read_long(plist, (param_name = "MaxStripSize"), &mss)) {
+ case 0:
+@@ -119,6 +124,16 @@ tfax_put_params(gx_device * dev, gs_param_list * plist)
+ case 1:
+ break;
+ }
++
++ /* Read BigEndian option as bool */
++ switch (code = param_read_bool(plist, (param_name = "BigEndian"), &big_endian)) {
++ default:
++ ecode = code;
++ param_signal_error(plist, param_name, ecode);
++ case 0:
++ case 1:
++ break;
++ }
+
+ if (ecode < 0)
+ return ecode;
+@@ -128,6 +143,7 @@ tfax_put_params(gx_device * dev, gs_param_list * plist)
+
+ tfdev->MaxStripSize = mss;
+ tfdev->FillOrder = fill_order;
++ tfdev->BigEndian = big_endian;
+ return code;
+ }
+
+@@ -195,19 +211,27 @@ static dev_proc_print_page(tifflzw_print_page);
+ static dev_proc_print_page(tiffpack_print_page);
+
+ const gx_device_tfax gs_tifflzw_device = {
+- prn_device_std_body(gx_device_tfax, prn_std_procs, "tifflzw",
++ prn_device_std_body(gx_device_tfax, gdev_tfax_std_procs, "tifflzw",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0, /* margins */
+- 1, tifflzw_print_page)
++ 1, tifflzw_print_page),
++ 1 /* AdjustWidth, not used */,
++ 0 /* unlimited strip size byte count */,
++ 1 /* lowest column in the high-order bit, not used */,
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+ const gx_device_tfax gs_tiffpack_device = {
+- prn_device_std_body(gx_device_tfax, prn_std_procs, "tiffpack",
++ prn_device_std_body(gx_device_tfax, gdev_tfax_std_procs, "tiffpack",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0, /* margins */
+- 1, tiffpack_print_page)
++ 1, tiffpack_print_page),
++ 1 /* AdjustWidth, not used */,
++ 0 /* unlimited strip size byte count */,
++ 1 /* lowest column in the high-order bit, not used */,
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+ /* Define the TIFF directory we use, beyond the standard entries. */
+@@ -249,7 +273,7 @@ tifff_print_page(gx_device_printer * dev, FILE * prn_stream,
+ tfax_begin_page(tfdev, prn_stream, pdir, pstate->Columns);
+ pstate->FirstBitLowOrder = tfdev->FillOrder == 2;
+ code = gdev_fax_print_page_stripped(dev, prn_stream, pstate, tfdev->tiff.rows);
+- gdev_tiff_end_page(&tfdev->tiff, prn_stream);
++ gdev_tiff_end_page(&tfdev->tiff, prn_stream, tfdev->BigEndian != arch_is_big_endian);
+ return code;
+ }
+ static int
+@@ -332,7 +356,7 @@ tifflzw_print_page(gx_device_printer * dev, FILE * prn_stream)
+ state.EarlyChange = 1; /* PLRM is sort of confusing, but this is correct */
+ code = gdev_stream_print_page(dev, prn_stream, &s_LZWE_template,
+ (stream_state *) & state);
+- gdev_tiff_end_page(&tfdev->tiff, prn_stream);
++ gdev_tiff_end_page(&tfdev->tiff, prn_stream, tfdev->BigEndian != arch_is_big_endian);
+ return code;
+ }
+
+@@ -353,7 +377,7 @@ tiffpack_print_page(gx_device_printer * dev, FILE * prn_stream)
+ state.record_size = gdev_mem_bytes_per_scan_line((gx_device *) dev);
+ code = gdev_stream_print_page(dev, prn_stream, &s_RLE_template,
+ (stream_state *) & state);
+- gdev_tiff_end_page(&tfdev->tiff, prn_stream);
++ gdev_tiff_end_page(&tfdev->tiff, prn_stream, tfdev->BigEndian != arch_is_big_endian);
+ return code;
+ }
+
+@@ -371,7 +395,7 @@ tfax_begin_page(gx_device_tfax * tfdev, FILE * fp,
+ &tfdev->tiff, fp,
+ (const TIFF_dir_entry *)pdir,
+ sizeof(*pdir) / sizeof(TIFF_dir_entry),
+- NULL, 0, tfdev->MaxStripSize);
++ NULL, 0, tfdev->MaxStripSize, tfdev->BigEndian != arch_is_big_endian);
+ tfdev->width = save_width;
+ return code;
+ }
+diff --git a/base/gdevtfnx.c b/base/gdevtfnx.c
+--- a/base/gdevtfnx.c
++++ b/base/gdevtfnx.c
+@@ -27,36 +27,34 @@
+ #define X_DPI 72
+ #define Y_DPI 72
+
+-typedef struct gx_device_tiff_s {
+- gx_device_common;
+- gx_prn_device_common;
+- gdev_tiff_state tiff;
+-} gx_device_tiff;
+-
+ static dev_proc_print_page(tiff12_print_page);
+ static dev_proc_print_page(tiff24_print_page);
+
+ static const gx_device_procs tiff12_procs =
+-prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
+- gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb);
++prn_color_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
++ gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
++ tiff_get_params, tiff_put_params);
+ static const gx_device_procs tiff24_procs =
+-prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
+- gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb);
++prn_color_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
++ gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
++ tiff_get_params, tiff_put_params);
+
+-const gx_device_printer gs_tiff12nc_device = {
++const gx_device_tiff gs_tiff12nc_device = {
+ prn_device_std_body(gx_device_tiff, tiff12_procs, "tiff12nc",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0,
+- 24, tiff12_print_page)
++ 24, tiff12_print_page),
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+-const gx_device_printer gs_tiff24nc_device = {
++const gx_device_tiff gs_tiff24nc_device = {
+ prn_device_std_body(gx_device_tiff, tiff24_procs, "tiff24nc",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0,
+- 24, tiff24_print_page)
++ 24, tiff24_print_page),
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+ /* ------ Private definitions ------ */
+@@ -97,14 +95,21 @@ static int
+ tiff12_print_page(gx_device_printer * pdev, FILE * file)
+ {
+ gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
+- int code;
+-
++ int code, i;
++ bool swap_bytes = tfdev->BigEndian != arch_is_big_endian;
++ tiff_rgb_values val_12_swapped = val_12_template;
++ if (swap_bytes)
++ {
++ for (i=0; i<3; i++)
++ SWAP_SHORT(val_12_swapped.bps[i]);
++ }
++
+ /* Write the page directory. */
+ code = gdev_tiff_begin_page(pdev, &tfdev->tiff, file,
+ (const TIFF_dir_entry *)&dir_rgb_template,
+- sizeof(dir_rgb_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_12_template,
+- sizeof(val_12_template), 0);
++ sizeof(dir_rgb_template) / sizeof(TIFF_dir_entry),
++ (const byte *)&val_12_swapped,
++ sizeof(val_12_swapped), 0, swap_bytes);
+ if (code < 0)
+ return code;
+
+@@ -138,7 +143,7 @@ tiff12_print_page(gx_device_printer * pdev, FILE * file)
+ }
+
+ gdev_tiff_end_strip(&tfdev->tiff, file);
+- gdev_tiff_end_page(&tfdev->tiff, file);
++ gdev_tiff_end_page(&tfdev->tiff, file, swap_bytes);
+ gs_free_object(pdev->memory, line, "tiff12_print_page");
+ }
+
+@@ -149,14 +154,21 @@ static int
+ tiff24_print_page(gx_device_printer * pdev, FILE * file)
+ {
+ gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
+- int code;
++ int code, i;
++ bool swap_bytes = tfdev->BigEndian != arch_is_big_endian;
++ tiff_rgb_values val_24_swapped = val_24_template;
++ if (swap_bytes)
++ {
++ for (i=0; i<3; i++)
++ SWAP_SHORT(val_24_swapped.bps[i]);
++ }
+
+ /* Write the page directory. */
+ code = gdev_tiff_begin_page(pdev, &tfdev->tiff, file,
+ (const TIFF_dir_entry *)&dir_rgb_template,
+- sizeof(dir_rgb_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_24_template,
+- sizeof(val_24_template), 0);
++ sizeof(dir_rgb_template) / sizeof(TIFF_dir_entry),
++ (const byte *)&val_24_swapped,
++ sizeof(val_24_swapped), 0, swap_bytes);
+ if (code < 0)
+ return code;
+
+@@ -176,7 +188,7 @@ tiff24_print_page(gx_device_printer * pdev, FILE * file)
+ fwrite((char *)row, raster, 1, file);
+ }
+ gdev_tiff_end_strip(&tfdev->tiff, file);
+- gdev_tiff_end_page(&tfdev->tiff, file);
++ gdev_tiff_end_page(&tfdev->tiff, file, swap_bytes);
+ gs_free_object(pdev->memory, line, "tiff24_print_page");
+ }
+
+diff --git a/base/gdevtifs.c b/base/gdevtifs.c
+--- a/base/gdevtifs.c
++++ b/base/gdevtifs.c
+@@ -80,8 +80,49 @@ static const TIFF_std_directory_values std_values_initial =
+ {0, 0}
+ };
+
++/* Get/put the BigEndian parameter. */
++int
++tiff_get_params(gx_device * dev, gs_param_list * plist)
++{
++ gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
++ int code = gdev_prn_get_params(dev, plist);
++ int ecode = code;
++
++ if ((code = param_write_bool(plist, "BigEndian", &tfdev->BigEndian)) < 0)
++ ecode = code;
++ return ecode;
++}
++
++int
++tiff_put_params(gx_device * dev, gs_param_list * plist)
++{
++ gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
++ int ecode = 0;
++ int code;
++ const char *param_name;
++ bool big_endian = tfdev->BigEndian;
++
++ /* Read BigEndian option as bool */
++ switch (code = param_read_bool(plist, (param_name = "BigEndian"), &big_endian)) {
++ default:
++ ecode = code;
++ param_signal_error(plist, param_name, ecode);
++ case 0:
++ case 1:
++ break;
++ }
++
++ if (ecode < 0)
++ return ecode;
++ code = gdev_prn_put_params(dev, plist);
++ if (code < 0)
++ return code;
++
++ tfdev->BigEndian = big_endian;
++ return code;
++}
++
+ /* Fix up tag values on big-endian machines if necessary. */
+-#if arch_is_big_endian
+ static void
+ tiff_fixup_tag(TIFF_dir_entry * dp)
+ {
+@@ -97,16 +138,55 @@ tiff_fixup_tag(TIFF_dir_entry * dp)
+ break;
+ }
+ }
+-#else
+-# define tiff_fixup_tag(dp) DO_NOTHING
+-#endif
++
++static size_t fwrite_short(TIFF_ushort nVal, FILE *stream, bool swap_bytes)
++{
++ TIFF_ushort v;
++
++ if (swap_bytes)
++ v = nVal << 8 | nVal >> 8;
++ else
++ v = nVal;
++ return fwrite(&v, sizeof(v), 1, stream);
++}
++
++static size_t fwrite_long(TIFF_ulong nVal, FILE *stream, bool swap_bytes)
++{
++ TIFF_ulong v;
++
++ if (swap_bytes)
++ v = nVal << 24 | nVal >> 24 | (nVal & 0xff0000) >> 8 | (nVal & 0xff00) << 8;
++ else
++ v = nVal;
++ return fwrite(&v, sizeof(v), 1, stream);
++ }
++
++static void fwrite_entry(TIFF_dir_entry *entry, FILE *stream, bool swap_bytes)
++{
++ fwrite_short(entry->tag, stream, swap_bytes);
++ fwrite_short(entry->type, stream, swap_bytes);
++ fwrite_long(entry->count, stream, swap_bytes);
++ fwrite_long(entry->value, stream, swap_bytes);
++}
++
++static void fwrite_std_values(TIFF_std_directory_values *std_values, FILE *stream, bool swap_bytes)
++{
++ fwrite_long(std_values->diroff, stream, swap_bytes);
++ fwrite_long(std_values->xresValue[0], stream, swap_bytes);
++ fwrite_long(std_values->xresValue[1], stream, swap_bytes);
++ fwrite_long(std_values->yresValue[0], stream, swap_bytes);
++ fwrite_long(std_values->yresValue[1], stream, swap_bytes);
++ fwrite(std_values->softwareValue, 1, maxSoftware, stream);
++ fwrite(std_values->dateTimeValue, 1, 20, stream);
++}
+
+ /* Begin a TIFF page. */
+ int
+ gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ FILE * fp,
+ const TIFF_dir_entry * entries, int entry_count,
+- const byte * values, int value_size, long max_strip_size)
++ const byte * values, int value_size, long max_strip_size,
++ bool swap_bytes)
+ {
+ gs_memory_t *mem = pdev->memory;
+ TIFF_std_directory_entries std_entries;
+@@ -117,29 +197,26 @@ gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ (sizeof(TIFF_std_directory_entries) / sizeof(TIFF_dir_entry))
+ int nse, nce, ntags;
+ TIFF_std_directory_values std_values;
++ bool big_endian = arch_is_big_endian ^ swap_bytes;
+
+ #define std_value_size sizeof(TIFF_std_directory_values)
+
+ tifs->mem = mem;
+ if (gdev_prn_file_is_new(pdev)) {
+ /* This is a new file; write the TIFF header. */
+- static const TIFF_header hdr = {
+-#if arch_is_big_endian
+- TIFF_magic_big_endian,
+-#else
+- TIFF_magic_little_endian,
+-#endif
+- TIFF_version_value,
+- sizeof(TIFF_header)
+- };
+-
+- fwrite((const char *)&hdr, sizeof(hdr), 1, fp);
++ TIFF_header hdr;
++ hdr.magic = big_endian ? TIFF_magic_big_endian : TIFF_magic_little_endian;
++ hdr.version = TIFF_version_value;
++ hdr.diroff = sizeof(TIFF_header);
++ fwrite((char *)&hdr.magic, sizeof(hdr.magic), 1, fp);
++ fwrite_short(hdr.version, fp, swap_bytes);
++ fwrite_long(hdr.diroff, fp, swap_bytes);
+ tifs->prev_dir = 0;
+ } else { /* Patch pointer to this directory from previous. */
+ TIFF_ulong offset = (TIFF_ulong) tifs->dir_off;
+
+ fseek(fp, tifs->prev_dir, SEEK_SET);
+- fwrite((char *)&offset, sizeof(offset), 1, fp);
++ fwrite_long(offset, fp, swap_bytes);
+ fseek(fp, tifs->dir_off, SEEK_SET);
+ }
+
+@@ -163,8 +240,7 @@ gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ /* Write count of tags in directory. */
+ {
+ TIFF_short dircount = ntags;
+-
+- fwrite((char *)&dircount, sizeof(dircount), 1, fp);
++ fwrite_short(dircount, fp, swap_bytes);
+ }
+ tifs->dir_off = ftell(fp);
+
+@@ -254,7 +330,8 @@ gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ offset_of(TIFF_dir_entry, value);
+ }
+ }
+- tiff_fixup_tag(&entry); /* don't fix up indirects */
++ if (big_endian)
++ tiff_fixup_tag(&entry); /* don't fix up indirects */
+ if (entry.type & TIFF_INDIRECT) {
+ /* Fix up the offset for an indirect value. */
+ entry.type -= TIFF_INDIRECT;
+@@ -262,12 +339,13 @@ gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ tifs->dir_off + ntags * sizeof(TIFF_dir_entry) +
+ (std ? 0 : std_value_size);
+ }
+- fwrite((char *)&entry, sizeof(entry), 1, fp);
++ fwrite_entry(&entry, fp, swap_bytes);
+ }
+
+ /* Write the indirect values. */
+- fwrite((const char *)&std_values, sizeof(std_values), 1, fp);
+- fwrite((const char *)values, value_size, 1, fp);
++ fwrite_std_values(&std_values, fp, swap_bytes);
++ if (values)
++ fwrite((const char *)values, value_size, 1, fp);
+ /* Write placeholders for the strip offsets. */
+ fwrite(tifs->StripOffsets, sizeof(TIFF_ulong), 2 * tifs->strip_count, fp);
+ tifs->strip_index = 0;
+@@ -299,21 +377,23 @@ gdev_tiff_end_strip(gdev_tiff_state * tifs, FILE * fp)
+
+ /* End a TIFF page. */
+ int
+-gdev_tiff_end_page(gdev_tiff_state * tifs, FILE * fp)
++gdev_tiff_end_page(gdev_tiff_state * tifs, FILE * fp, bool swap_bytes)
+ {
+ gs_memory_t *mem = tifs->mem;
+ long dir_off = tifs->dir_off;
+- int tags_size = tifs->ntags * sizeof(TIFF_dir_entry);
+-
++ int tags_size = tifs->ntags * sizeof(TIFF_dir_entry), i;
++
+ tifs->prev_dir =
+ dir_off + tags_size + offset_of(TIFF_std_directory_values, diroff);
+ tifs->dir_off = ftell(fp);
+ /* Patch strip byte counts and offsets values. */
+ /* The offset in the file was determined at begin_page and may be indirect */
+ fseek(fp, tifs->offset_StripOffsets, SEEK_SET);
+- fwrite(tifs->StripOffsets, sizeof(TIFF_ulong), tifs->strip_count, fp);
++ for (i=0; i<tifs->strip_count; i++)
++ fwrite_long(tifs->StripOffsets[i], fp, swap_bytes);
+ fseek(fp, tifs->offset_StripByteCounts, SEEK_SET);
+- fwrite(tifs->StripByteCounts, sizeof(TIFF_ulong), tifs->strip_count, fp);
++ for (i=0; i<tifs->strip_count; i++)
++ fwrite_long(tifs->StripByteCounts[i], fp, swap_bytes);
+ gs_free_object(mem, tifs->StripOffsets, "gdev_tiff_begin_page(StripOffsets)");
+ return 0;
+ }
+diff --git a/base/gdevtifs.h b/base/gdevtifs.h
+--- a/base/gdevtifs.h
++++ b/base/gdevtifs.h
+@@ -43,6 +43,9 @@ typedef unsigned long TIFF_ulong;
+ # endif
+ #endif
+
++#define SWAP_SHORT(x)\
++ x = x << 8 | x >> 8\
++
+ /*
+ * Define the TIFF file header.
+ */
+@@ -197,6 +200,16 @@ typedef struct gdev_tiff_state_s {
+ TIFF_ulong *StripByteCounts;
+ } gdev_tiff_state;
+
++typedef struct gx_device_tiff_s {
++ gx_device_common;
++ gx_prn_device_common;
++ bool BigEndian; /* true = big endian; false = little endian*/
++ gdev_tiff_state tiff;
++} gx_device_tiff;
++
++dev_proc_get_params(tiff_get_params);
++dev_proc_put_params(tiff_put_params);
++
+ /*
+ * Begin writing a TIFF page. This procedure supplies a standard set of
+ * tags; the client can provide additional tags (pre-sorted) and
+@@ -206,7 +219,7 @@ int gdev_tiff_begin_page(gx_device_printer * pdev, gdev_tiff_state * tifs,
+ FILE * fp,
+ const TIFF_dir_entry * entries, int entry_count,
+ const byte * values, int value_size,
+- long max_strip_size);
++ long max_strip_size, bool swap_bytes);
+
+ /*
+ * Finish writing a TIFF strip. All data written since begin or last
+@@ -218,6 +231,6 @@ int gdev_tiff_end_strip(gdev_tiff_state * tifs, FILE * fp);
+ * Finish writing a TIFF page. StripOffsets and StripByteCounts are
+ * patched into the file.
+ */
+-int gdev_tiff_end_page(gdev_tiff_state * tifs, FILE * fp);
++int gdev_tiff_end_page(gdev_tiff_state * tifs, FILE * fp, bool swap_bytes);
+
+ #endif /* gdevtifs_INCLUDED */
+diff --git a/base/gdevtrac.c b/base/gdevtrac.c
+--- a/base/gdevtrac.c
++++ b/base/gdevtrac.c
+@@ -318,7 +318,6 @@ trace_stroke_path(gx_device * dev, const gs_imager_state * pis,
+
+ typedef struct trace_image_enum_s {
+ gx_image_enum_common;
+- gs_memory_t *memory;
+ int rows_left;
+ } trace_image_enum_t;
+ gs_private_st_suffix_add0(st_trace_image_enum, trace_image_enum_t,
+diff --git a/base/gdevtsep.c b/base/gdevtsep.c
+--- a/base/gdevtsep.c
++++ b/base/gdevtsep.c
+@@ -38,24 +38,20 @@
+
+ /* ------ The tiffgray device ------ */
+
+-typedef struct gx_device_tiff_s {
+- gx_device_common;
+- gx_prn_device_common;
+- gdev_tiff_state tiff;
+-} gx_device_tiff;
+-
+ static dev_proc_print_page(tiffgray_print_page);
+
+ static const gx_device_procs tiffgray_procs =
+-prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
+- gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb);
++prn_color_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
++ gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb,
++ tiff_get_params, tiff_put_params);
+
+-const gx_device_printer gs_tiffgray_device = {
++const gx_device_tiff gs_tiffgray_device = {
+ prn_device_body(gx_device_tiff, tiffgray_procs, "tiffgray",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0, /* Margins */
+- 1, 8, 255, 0, 256, 0, tiffgray_print_page)
++ 1, 8, 255, 0, 256, 0, tiffgray_print_page),
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+ /* ------ Private definitions ------ */
+@@ -93,15 +89,19 @@ tiffgray_print_page(gx_device_printer * pdev, FILE * file)
+ {
+ gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
+ int code;
++ bool swap_bytes = tfdev->BigEndian != arch_is_big_endian;
++ tiff_gray_values val_gray_swapped = val_gray_template;
++ if (swap_bytes)
++ SWAP_SHORT(val_gray_swapped.bps[0]);
+
+ if (pdev->height > (max_long - ftell(file))/(pdev->width)) /* note width is never 0 in print_page */
+ return_error(gs_error_rangecheck); /* this will overflow max_long */
+ /* Write the page directory. */
+ code = gdev_tiff_begin_page(pdev, &tfdev->tiff, file,
+ (const TIFF_dir_entry *)&dir_gray_template,
+- sizeof(dir_gray_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_gray_template,
+- sizeof(val_gray_template), 0);
++ sizeof(dir_gray_template) / sizeof(TIFF_dir_entry),
++ (const byte *)&val_gray_swapped,
++ sizeof(val_gray_swapped), 0, swap_bytes);
+ if (code < 0)
+ return code;
+
+@@ -121,7 +121,7 @@ tiffgray_print_page(gx_device_printer * pdev, FILE * file)
+ fwrite((char *)row, raster, 1, file);
+ }
+ gdev_tiff_end_strip(&tfdev->tiff, file);
+- gdev_tiff_end_page(&tfdev->tiff, file);
++ gdev_tiff_end_page(&tfdev->tiff, file, swap_bytes);
+ gs_free_object(pdev->memory, line, "tiffgray_print_page");
+ }
+
+@@ -135,7 +135,7 @@ static dev_proc_print_page(tiff32nc_print_page);
+ #define cmyk_procs(p_map_color_rgb, p_map_cmyk_color)\
+ gdev_prn_open, NULL, NULL, gdev_prn_output_page, gdev_prn_close,\
+ NULL, p_map_color_rgb, NULL, NULL, NULL, NULL, NULL, NULL,\
+- gdev_prn_get_params, gdev_prn_put_params,\
++ tiff_get_params, tiff_put_params,\
+ p_map_cmyk_color, NULL, NULL, NULL, gx_page_device_get_page_device
+
+ /* 8-bit-per-plane separated CMYK color. */
+@@ -144,12 +144,13 @@ static const gx_device_procs tiff32nc_procs = {
+ cmyk_procs(cmyk_8bit_map_color_cmyk, cmyk_8bit_map_cmyk_color)
+ };
+
+-const gx_device_printer gs_tiff32nc_device = {
++const gx_device_tiff gs_tiff32nc_device = {
+ prn_device_body(gx_device_tiff, tiff32nc_procs, "tiff32nc",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0, /* Margins */
+- 4, 32, 255, 255, 256, 256, tiff32nc_print_page)
++ 4, 32, 255, 255, 256, 256, tiff32nc_print_page),
++ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/
+ };
+
+ /* ------ Private definitions ------ */
+@@ -189,15 +190,23 @@ tiff32nc_print_page(gx_device_printer * pdev, FILE * file)
+ gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
+ int code;
+ ulong cur_size = gdev_prn_file_is_new(pdev) ? 0 : tfdev->tiff.dir_off;
++ tiff_cmyk_values val_cmyk_swapped = val_cmyk_template;
++ bool swap_bytes = tfdev->BigEndian != arch_is_big_endian;
++ if (swap_bytes)
++ {
++ int i;
++ for (i=0; i<4; i++)
++ SWAP_SHORT(val_cmyk_swapped.bps[i]);
++ }
+
+ if (pdev->height > (max_long - cur_size)/(pdev->width*4)) /* note width is never 0 in print_page */
+ return_error(gs_error_rangecheck); /* this will overflow max_long */
+ /* Write the page directory. */
+ code = gdev_tiff_begin_page(pdev, &tfdev->tiff, file,
+ (const TIFF_dir_entry *)&dir_cmyk_template,
+- sizeof(dir_cmyk_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_cmyk_template,
+- sizeof(val_cmyk_template), 0);
++ sizeof(dir_cmyk_template) / sizeof(TIFF_dir_entry),
++ (const byte *)&val_cmyk_swapped,
++ sizeof(val_cmyk_swapped), 0, swap_bytes);
+ if (code < 0)
+ return code;
+
+@@ -217,7 +226,7 @@ tiff32nc_print_page(gx_device_printer * pdev, FILE * file)
+ fwrite((char *)row, raster, 1, file);
+ }
+ gdev_tiff_end_strip(&tfdev->tiff, file);
+- gdev_tiff_end_page(&tfdev->tiff, file);
++ gdev_tiff_end_page(&tfdev->tiff, file, swap_bytes);
+ gs_free_object(pdev->memory, line, "tiff32nc_print_page");
+ }
+
+@@ -259,6 +268,7 @@ typedef struct tiffsep_device_s {
+ /* tiff state for separation files */
+ gdev_tiff_state tiff[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ FILE * sep_file[GX_DEVICE_COLOR_MAX_COMPONENTS];
++ bool BigEndian; /* true = big endian; false = little endian */
+ gs_devn_params devn_params; /* DeviceN generated parameters */
+ equivalent_cmyk_color_params equiv_cmyk_colors;
+ } tiffsep_device;
+@@ -392,7 +402,8 @@ gs_private_st_composite_final(st_tiffsep_device, tiffsep_device,
+ prn_device_body_rest_(tiffsep_print_page),\
+ { 0 }, /* tiff state for comp file */\
+ {{ 0 }}, /* tiff state for separation files */\
+- { 0 } /* separation files */
++ { 0 }, /* separation files */\
++ arch_is_big_endian /* true = big endian; false = little endian */
+
+ /*
+ * Select the default number of components based upon the number of bits
+@@ -579,12 +590,16 @@ static int
+ tiffsep_get_params(gx_device * pdev, gs_param_list * plist)
+ {
+ int code = gdev_prn_get_params(pdev, plist);
+-
+ if (code < 0)
+ return code;
+- return devn_get_params(pdev, plist,
++
++ code = devn_get_params(pdev, plist,
+ &(((tiffsep_device *)pdev)->devn_params),
+ &(((tiffsep_device *)pdev)->equiv_cmyk_colors));
++ if (code < 0)
++ return code;
++
++ return param_write_bool(plist, "BigEndian", &((tiffsep_device *)pdev)->BigEndian);
+ }
+
+ /* Set parameters. We allow setting the number of bits per component. */
+@@ -592,7 +607,19 @@ static int
+ tiffsep_put_params(gx_device * pdev, gs_param_list * plist)
+ {
+ tiffsep_device * const pdevn = (tiffsep_device *) pdev;
+-
++ int code;
++ const char *param_name;
++
++ /* Read BigEndian option as bool */
++ switch (code = param_read_bool(plist, (param_name = "BigEndian"), &pdevn->BigEndian)) {
++ default:
++ param_signal_error(plist, param_name, code);
++ return code;
++ case 0:
++ case 1:
++ break;
++ }
++
+ return devn_printer_put_params(pdev, plist,
+ &(pdevn->devn_params), &(pdevn->equiv_cmyk_colors));
+ }
+@@ -770,11 +797,18 @@ number_output_separations(int num_dev_comp, int num_std_colorants,
+ static void
+ build_comp_to_sep_map(tiffsep_device * pdev, short * map_comp_to_sep)
+ {
+- int num_sep = pdev->devn_params.separations.num_separations;
++ int num_sep = pdev->devn_params.page_spot_colors;
+ int num_std_colorants = pdev->devn_params.num_std_colorant_names;
+ int sep_num;
++ int num_channels;
+
+- for (sep_num = 0; sep_num < num_std_colorants + num_sep; sep_num++) {
++ /* since both proc colors and spot colors are packed in same encoded value we
++ need to have this limit */
++
++ num_channels =
++ ( (num_std_colorants + num_sep) < (GX_DEVICE_COLOR_MAX_COMPONENTS) ? (num_std_colorants + num_sep) : (GX_DEVICE_COLOR_MAX_COMPONENTS) );
++
++ for (sep_num = 0; sep_num < num_channels; sep_num++) {
+ int comp_num = pdev->devn_params.separation_order_map[sep_num];
+
+ if (comp_num >= 0 && comp_num < GX_DEVICE_COLOR_MAX_COMPONENTS)
+@@ -949,6 +983,14 @@ tiffsep_print_page(gx_device_printer * pdev, FILE * file)
+ const char *fmt;
+ gs_parsed_file_name_t parsed;
+ int non_encodable_count = 0;
++ tiff_cmyk_values val_cmyk_swapped = val_cmyk_template;
++ bool swap_bytes = tfdev->BigEndian != arch_is_big_endian;
++ if (swap_bytes)
++ {
++ int i;
++ for (i=0; i<4; i++)
++ SWAP_SHORT(val_cmyk_swapped.bps[i]);
++ }
+
+ build_comp_to_sep_map(tfdev, map_comp_to_sep);
+
+@@ -972,9 +1014,9 @@ tiffsep_print_page(gx_device_printer * pdev, FILE * file)
+ return_error(gs_error_rangecheck); /* this will overflow max_long */
+ code = gdev_tiff_begin_page(pdev, &tfdev->tiff_comp, file,
+ (const TIFF_dir_entry *)&dir_cmyk_template,
+- sizeof(dir_cmyk_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_cmyk_template,
+- sizeof(val_cmyk_template), 0);
++ sizeof(dir_cmyk_template) / sizeof(TIFF_dir_entry),
++ (const byte *)&val_cmyk_swapped,
++ sizeof(val_cmyk_swapped), 0, swap_bytes);
+ pdev->color_info.depth = save_depth;
+ if (code < 0)
+ return code;
+@@ -1016,8 +1058,8 @@ tiffsep_print_page(gx_device_printer * pdev, FILE * file)
+ tfdev->sep_file[comp_num],
+ (const TIFF_dir_entry *)&dir_gray_template,
+ sizeof(dir_gray_template) / sizeof(TIFF_dir_entry),
+- (const byte *)&val_gray_template,
+- sizeof(val_gray_template), 0);
++ (const byte *)&val_cmyk_swapped,
++ sizeof(val_cmyk_swapped), 0, swap_bytes);
+ pdev->color_info.depth = save_depth;
+ if (code < 0)
+ return code;
+@@ -1069,12 +1111,12 @@ tiffsep_print_page(gx_device_printer * pdev, FILE * file)
+ }
+ /* Update the strip data */
+ gdev_tiff_end_strip(&(tfdev->tiff_comp), file);
+- gdev_tiff_end_page(&(tfdev->tiff_comp), file);
++ gdev_tiff_end_page(&(tfdev->tiff_comp), file, swap_bytes);
+ for (comp_num = 0; comp_num < num_comp; comp_num++ ) {
+ gdev_tiff_end_strip(&(tfdev->tiff[comp_num]),
+ tfdev->sep_file[comp_num]);
+ gdev_tiff_end_page(&(tfdev->tiff[comp_num]),
+- tfdev->sep_file[comp_num]);
++ tfdev->sep_file[comp_num], swap_bytes);
+ }
+ gs_free_object(pdev->memory, line, "tiffsep_print_page");
+ gs_free_object(pdev->memory, sep_line, "tiffsep_print_page");
+diff --git a/base/gdevvec.c b/base/gdevvec.c
+--- a/base/gdevvec.c
++++ b/base/gdevvec.c
+@@ -247,7 +247,7 @@ void
+ gdev_vector_reset(gx_device_vector * vdev)
+ {
+ static const gs_imager_state state_initial =
+- {gs_imager_state_initial(1)};
++ {gs_imager_state_initial(1, false)};
+
+ vdev->state = state_initial;
+ gx_hld_saved_color_init(&vdev->saved_fill_color);
+diff --git a/base/gsalloc.c b/base/gsalloc.c
+--- a/base/gsalloc.c
++++ b/base/gsalloc.c
+@@ -202,7 +202,7 @@ ialloc_alloc_state(gs_memory_t * parent, uint chunk_size)
+ iimem->large_size = ((chunk_size / 4) & -obj_align_mod) + 1;
+ iimem->is_controlled = false;
+ iimem->gc_status.vm_threshold = chunk_size * 3L;
+- iimem->gc_status.max_vm = max_long;
++ iimem->gc_status.max_vm = 0x7fffffff;
+ iimem->gc_status.psignal = NULL;
+ iimem->gc_status.signal_value = 0;
+ iimem->gc_status.enabled = false;
+diff --git a/base/gsccolor.h b/base/gsccolor.h
+--- a/base/gsccolor.h
++++ b/base/gsccolor.h
+@@ -64,4 +64,19 @@ extern_st(st_client_color);
+ client_color_enum_ptrs, client_color_reloc_ptrs, pattern)
+ #define st_client_color_max_ptrs 1
+
++/* Define the color space for a transparency */
++/* Used to keep track of parent versus child */
++/* color space changes with Smask and for */
++/* blending */
++typedef enum {
++ GRAY_SCALE,
++ DEVICE_RGB,
++ DEVICE_CMYK,
++ CIE_XYZ,
++ DEVICEN,
++ UNKNOWN,
++ OTHER
++} gs_transparency_color_t;
++
++
+ #endif /* gsccolor_INCLUDED */
+diff --git a/base/gscdef.c b/base/gscdef.c
+--- a/base/gscdef.c
++++ b/base/gscdef.c
+@@ -43,7 +43,7 @@ const char *const gs_productfamily = GS_PRODUCTFAMILY;
+
+ #ifndef GS_PRODUCT
+ # define GS_PRODUCT\
+- GS_PRODUCTFAMILY ""
++ GS_PRODUCTFAMILY " SVN PRE-RELEASE"
+ #endif
+ const char *const gs_product = GS_PRODUCT;
+
+diff --git a/base/gscolor2.c b/base/gscolor2.c
+--- a/base/gscolor2.c
++++ b/base/gscolor2.c
+@@ -239,20 +239,10 @@ gx_final_Indexed(const gs_color_space * pcs)
+ rc_adjust_const(pcs->params.indexed.lookup.map, -1,
+ "gx_adjust_Indexed");
+ } else {
+- /* Bug 689822 "Memory leaks during rendering clist."
+- */
+-#if 0 /* Disabled due to bug 689990 "pcl6.exe crash with gs revision 8928".
+- Rather this automatic freeing of pcs->params.indexed.lookup.table.data
+- complies to a fundamental change of Revision 7765 "Non-backwards compatible change:
+- use consistent reference count allocation discipline for color spaces.",
+- some interpreters still don't fully comply to the discipline.
+- It caused a crash in memory management due to dual attempt to free the string.
+- */
+ byte *data = (byte *)pcs->params.indexed.lookup.table.data; /* Break 'const'. */
+
+ gs_free_string(pcs->rc.memory, data,
+ pcs->params.indexed.lookup.table.size, "gx_final_Indexed");
+-#endif
+ }
+ }
+
+diff --git a/base/gscolorbuffer.c b/base/gscolorbuffer.c
+new file mode 100644
+--- /dev/null
++++ b/base/gscolorbuffer.c
+@@ -0,0 +1,270 @@
++/* Copyright (C) 2001-2009 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++
++/* Simple operators and place holding support for doing conversions on buffers
++ of data. These functions perform device (non CIE or ICC color conversions)
++ on buffers of data. Eventually these will be replaced with functions for
++ using the ICC based linked mappings with the external CMS. This is far from
++ efficient at this point, but gets the job done */
++
++#include "string_.h"
++#include "stdpre.h"
++#include "gstypes.h"
++#include "gsmemory.h"
++#include "gxblend.h"
++#include "gscolorbuffer.h"
++
++#define float_color_to_byte_color(float_color) ( \
++ (0.0 < (float_color) && (float_color) < 1.0) ? \
++ ((unsigned char) ((float_color) * 255.0)) : \
++ (((float_color) <= 0.0) ? 0x00 : 0xFF) \
++ )
++
++/* We could use the conversions that are defined in gxdcconv.c,
++ however for now we will use something even easier. This is
++ temporary until we get the proper ICC flows in place */
++
++static void
++rgb_to_cmyk(byte rgb[],byte cmyk[])
++{
++
++ /* Real sleazy min black generation */
++
++ cmyk[0] = 255 - rgb[0];
++ cmyk[1] = 255 - rgb[1];
++ cmyk[2] = 255 - rgb[2];
++
++ cmyk[3] = (cmyk[0] < cmyk[1]) ?
++ min(cmyk[0], cmyk[2]) : min(cmyk[1], cmyk[2]);
++
++}
++
++static void
++rgb_to_gray(byte rgb[], byte gray[])
++{
++
++ float temp_value;
++
++ /* compute a luminance component */
++ temp_value = rgb[0]*0.3 + rgb[1]*0.59 + rgb[2]*0.11;
++ temp_value = temp_value * (1.0 / 255.0 ); /* May need to be optimized */
++ gray[0] = float_color_to_byte_color(temp_value);
++
++}
++
++static void
++cmyk_to_rgb(byte cmyk[], byte rgb[])
++{
++
++ /* real ugly, but temporary */
++
++ rgb[0] = 255 - min(cmyk[0] + cmyk[3],255);
++ rgb[1] = 255 - min(cmyk[1] + cmyk[3],255);
++ rgb[2] = 255 - min(cmyk[2] + cmyk[3],255);
++
++}
++
++static void
++cmyk_to_gray(byte cmyk[], byte gray[])
++{
++
++ float temp_value;
++
++ temp_value = ((255 - cmyk[0])*0.3 +
++ (255 - cmyk[1])*0.59 +
++ (255 - cmyk[2]) * 0.11) * (255 - cmyk[3]);
++ temp_value = temp_value * (1.0 / 65025.0 );
++
++ gray[0] = float_color_to_byte_color(temp_value);
++
++}
++
++static void
++gray_to_cmyk(byte gray[], byte cmyk[])
++{
++
++ /* Just do black. */
++ cmyk[0] = 0;
++ cmyk[1] = 0;
++ cmyk[2] = 0;
++ cmyk[3] = 255 - gray[0];
++
++}
++
++static void
++gray_to_rgb(byte gray[], byte rgb[])
++{
++
++ rgb[0] = gray[0];
++ rgb[1] = gray[0];
++ rgb[2] = gray[0];
++
++}
++
++
++void
++gs_transform_color_buffer_generic(byte *inputbuffer,
++ int row_stride, int plane_stride,
++ int input_num_color, gs_int_rect rect, byte *outputbuffer,
++ int output_num_color, int num_noncolor_planes)
++
++{
++ int num_rows, num_cols, x, y, z;
++ void (* color_remap)(byte input[],byte output[]) = NULL;
++ byte input_vector[4],output_vector[4];
++ int plane_offset[PDF14_MAX_PLANES],alpha_offset_in,max_num_channels;
++
++ num_rows = rect.q.y - rect.p.y;
++ num_cols = rect.q.x - rect.p.x;
++
++ /* Check for spot + cmyk case */
++
++ if (output_num_color > 4)
++ {
++
++ /* To CMYK always */
++ switch (input_num_color) {
++
++ case 1:
++ color_remap = gray_to_cmyk;
++ break;
++
++ case 3:
++ color_remap = rgb_to_cmyk;
++ break;
++
++ case 4:
++ color_remap = NULL; /* Copy data */
++ break;
++
++ default:
++
++ /* Should never be here. Groups must
++ be gray, rgb or CMYK. Exception
++ may be ICC with XPS */
++
++ break;
++
++ }
++
++ } else {
++
++ /* Pick the mapping to use */
++
++ switch (input_num_color) {
++
++ case 1:
++ if (output_num_color == 3)
++ color_remap = gray_to_rgb;
++ else
++ color_remap = gray_to_cmyk;
++ break;
++
++ case 3:
++ if (output_num_color == 1)
++ color_remap = rgb_to_gray;
++ else
++ color_remap = rgb_to_cmyk;
++ break;
++
++ case 4:
++ if (output_num_color == 1)
++ color_remap = cmyk_to_gray;
++ else
++ color_remap = cmyk_to_rgb;
++ break;
++
++ default:
++
++ /* Should never be here. Groups must
++ be gray, rgb or CMYK. Until we
++ have ICC working here with XPS */
++
++ break;
++
++ }
++
++ }
++
++ /* data is planar */
++
++ max_num_channels = max(input_num_color, output_num_color) +
++ num_noncolor_planes;
++
++ for (z = 0; z < max_num_channels; z++)
++ plane_offset[z] = z * plane_stride;
++
++ if (color_remap == NULL) {
++
++ /* Blending group was CMYK, output is CMYK + spot */
++
++ memcpy(outputbuffer, inputbuffer, 4*plane_stride);
++
++ /* Add any data that are beyond the standard color data (e.g. alpha) */
++
++ if (num_noncolor_planes > 0)
++ memcpy(&(outputbuffer[plane_offset[output_num_color]]),
++ &(inputbuffer[plane_offset[input_num_color]]),
++ num_noncolor_planes*plane_stride);
++
++ } else {
++
++ /* Have to remap */
++
++ alpha_offset_in = input_num_color*plane_stride;
++
++ for (y = 0; y < num_rows; y++) {
++
++ for (x = 0; x < num_cols; x++) {
++
++ /* If the source alpha is transparent, then move on */
++
++ if (inputbuffer[x + alpha_offset_in] != 0x00) {
++
++ /* grab the input */
++
++ for (z = 0; z<input_num_color; z++)
++ input_vector[z] = inputbuffer[x+plane_offset[z]];
++
++ /* convert */
++
++ color_remap(input_vector,output_vector);
++
++ /* store the output */
++
++ for (z = 0; z < output_num_color; z++)
++ outputbuffer[x+plane_offset[z]] = output_vector[z];
++
++ /* Add any that are beyond the standard color data */
++
++ for(z = 0; z < num_noncolor_planes; z++)
++ outputbuffer[x + plane_offset[output_num_color+z]] =
++ inputbuffer[x + plane_offset[input_num_color+z]];
++
++ }
++
++ }
++
++ /* update our positions */
++
++ for (z = 0; z < max_num_channels; z++)
++ plane_offset[z] += row_stride;
++
++ alpha_offset_in += row_stride;
++
++ }
++
++ }
++
++}
+diff --git a/base/gscolorbuffer.h b/base/gscolorbuffer.h
+new file mode 100644
+--- /dev/null
++++ b/base/gscolorbuffer.h
+@@ -0,0 +1,25 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* Client color structure definition */
++
++/* Simple operators and place holding support for doing conversions on buffers
++ of data. These functions perform device (non CIE or ICC color conversions)
++ on buffers of data. Eventually these will be replaced with functions for
++ using the ICC based linked mappings with the external CMS. */
++
++/* This just does planar data for now */
++void gs_transform_color_buffer_generic(byte *inputbuffer,
++ int rowstride, int planestride,
++ int input_num_color, gs_int_rect rect,byte *outputbuffer,
++ int output_num_color,int num_noncolor_planes);
+diff --git a/base/gscspace.c b/base/gscspace.c
+--- a/base/gscspace.c
++++ b/base/gscspace.c
+@@ -193,6 +193,12 @@ bool gs_color_space_is_CIE(const gs_color_space * pcs)
+
+ }
+
++/* See if the space is ICC based */
++bool gs_color_space_is_ICC(const gs_color_space * pcs)
++{
++ return(gs_color_space_get_index(pcs) == gs_color_space_index_CIEICC);
++}
++
+
+ /* Get the number of components in a color space. */
+ int
+diff --git a/base/gscspace.h b/base/gscspace.h
+--- a/base/gscspace.h
++++ b/base/gscspace.h
+@@ -289,8 +289,9 @@ gs_color_space *gs_cspace_new_DeviceCMYK(gs_memory_t *mem);
+ /* Get the index of a color space. */
+ gs_color_space_index gs_color_space_get_index(const gs_color_space *);
+
+-/* Tell if the space is CIE based */
++/* Tell if the space is CIE or ICC based */
+ bool gs_color_space_is_CIE(const gs_color_space * pcs);
++bool gs_color_space_is_ICC(const gs_color_space * pcs);
+
+ /* Get the number of components in a color space. */
+ int gs_color_space_num_components(const gs_color_space *);
+diff --git a/base/gserror.h b/base/gserror.h
+--- a/base/gserror.h
++++ b/base/gserror.h
+@@ -60,7 +60,7 @@ int gs_throw_imp(const char *func, const char *file, int line,
+ /* Use throw at origin of error
+ */
+ #define gs_throw_code(code) \
+- gs_throw((code), gs_errstr((code)))
++ gs_throw1((code), "%s", gs_errstr((code)))
+
+ #define gs_throw(code, fmt) \
+ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt)
+@@ -87,7 +87,7 @@ int gs_throw_imp(const char *func, const char *file, int line,
+ /* Bubble the code up the stack
+ */
+ #define gs_rethrow_code(code) \
+- gs_rethrow((code), gs_errstr((code)))
++ gs_rethrow1((code), "%s", gs_errstr((code)))
+
+ #define gs_rethrow(code, fmt) \
+ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt)
+diff --git a/base/gsfont.c b/base/gsfont.c
+--- a/base/gsfont.c
++++ b/base/gsfont.c
+@@ -269,6 +269,7 @@ gs_font_dir_alloc2_limits(gs_memory_t * struct_mem, gs_memory_t * bits_mem,
+ pdir->san = 0;
+ pdir->global_glyph_code = NULL;
+ pdir->text_enum_id = 0;
++ pdir->hash = 42; /* initialize the hash to a randomly picked number */
+ return pdir;
+ }
+
+diff --git a/base/gsht1.c b/base/gsht1.c
+--- a/base/gsht1.c
++++ b/base/gsht1.c
+@@ -344,8 +344,10 @@ process_transfer(gx_ht_order * porder, gs_state * pgs,
+ pmap->proc = proc; /* 0 => use closure */
+ pmap->closure = *pmc;
+ pmap->id = gs_next_ids(mem, 1);
+- load_transfer_map(pgs, pmap, 0.0);
+ porder->transfer = pmap;
++ if (proc == gs_mapped_transfer)
++ return 0; /* nothing to load, the source is uninitialzed */
++ load_transfer_map(pgs, pmap, 0.0);
+ return 0;
+ }
+
+diff --git a/base/gsicc.c b/base/gsicc.c
+--- a/base/gsicc.c
++++ b/base/gsicc.c
+@@ -1,6 +1,6 @@
+ /* Copyright (C) 2001-2006 Artifex Software, Inc.
+ All Rights Reserved.
+-
++
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+@@ -95,7 +95,7 @@ RELOC_PTRS_END
+ * Color space methods for ICCBased color spaces.
+ *
+ * As documented, ICCBased color spaces may be used as both base and
+- * alternative color spaces. Futhermore,, they can themselves contain paint
++ * alternative color spaces. Futhermore, they can themselves contain paint
+ * color spaces as alternative color space. In this implementation we allow
+ * them to be used as base and alternative color spaces, but only to contain
+ * "small" base color spaces (CIEBased or smaller). This arrangement avoids
+@@ -104,9 +104,9 @@ RELOC_PTRS_END
+ *
+ * Several of the methods used by ICCBased color space apply as well to
+ * DeviceN color spaces, in that they are generic to color spaces having
+- * a variable number of components. We have elected not to attempt to
++ * a variable number of components. We have elected not to attempt to
+ * extract and combine these operations, because this would save only a
+- * small amount of code, and much more could be saved by intorducing certain
++ * small amount of code, and much more could be saved by introducing certain
+ * common elements (ranges, number of components, etc.) into the color space
+ * root class.
+ */
+@@ -141,7 +141,7 @@ static const gs_color_space_type gs_color_space_type_CIEICC = {
+ gx_spot_colors_set_overprint, /* set_overprint */
+ gx_final_CIEICC, /* final */
+ gx_no_adjust_color_count, /* adjust_color_count */
+- gx_serialize_CIEICC, /* serialize */
++ gx_serialize_CIEICC, /* serialize */
+ gx_cspace_is_linear_default
+ };
+
+@@ -192,11 +192,11 @@ gx_restrict_CIEICC(gs_client_color * pcc, const gs_color_space * pcs)
+ }
+
+ /*
+- * Return the conrecte space to which this color space will map. If the
++ * Return the concrete space to which this color space will map. If the
+ * ICCBased color space is being used in native mode, the concrete space
+ * will be dependent on the current color rendering dictionary, as it is
+ * for all CIE bases. If the alternate color space is being used, then
+- * this question is passed on the the appropriate method of that space.
++ * this question is passed on to the appropriate method of that space.
+ */
+ static const gs_color_space *
+ gx_concrete_space_CIEICC(const gs_color_space * pcs, const gs_imager_state * pis)
+@@ -253,8 +253,9 @@ gx_concretize_CIEICC(
+ gx_restrict_CIEICC(&lcc, pcs);
+ for (i = 0; i < ncomps; i++)
+ inv[i] = lcc.paint.values[i];
+-
+- /* Since the original limits were wrong for this case, We need to adjust things a bit different */
++
++ /* Since the original limits were wrong for this case,
++ we need to adjust things a bit different */
+
+ /* For input Lab color space massage the values into Lab range */
+
+@@ -262,7 +263,7 @@ gx_concretize_CIEICC(
+
+ inv[0] *= 100;
+ inv[1] = inv[1]*255 - 128;
+- inv[2] = inv[2]*255 - 128;
++ inv[2] = inv[2]*255 - 128;
+
+ } */
+
+@@ -441,7 +442,7 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ FILE *fid;
+
+ #endif
+-
++
+ /* verify that the file is legitimate */
+ if (picc_info->file_id != (instrp->read_id | instrp->write_id))
+ return_error(gs_error_ioerror);
+@@ -449,7 +450,7 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ * Load the top-level ICC profile.
+ *
+ * If an ICC profile fails to load, generate an error.
+- *
++ *
+ * Testing demonstrates, however, Acrobat Reader silently
+ * ignores the error and uses the alternate color space.
+ * This behaviour is implemented by catching the error using
+@@ -467,7 +468,7 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ gs_vector3 * ppt;
+
+ pfile = gx_wrap_icc_stream (instrp);
+-
++
+ if ((picc->read(picc, pfile, 0)) != 0)
+ goto return_rangecheck;
+
+@@ -483,8 +484,8 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ free(iccbuffer);
+
+ #endif
+-
+-
++
++
+ /* verify the profile type */
+ profile_class = picc->header->deviceClass;
+ if ( profile_class != icSigInputClass &&
+@@ -540,7 +541,7 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ * If absolute colorimetry is employed, the XYZ or L*a*b* values
+ * generated will be absolute in the chromatic sense (they are
+ * not literally "absolute", as we still must have overall
+- * intensity information inorder to determine weighted spectral
++ * intensity information in order to determine weighted spectral
+ * power levels). To achieve relative colorimetry for the output,
+ * these colors must be evaluated relative to the source white
+ * and black points. Hence, in this case, the appropriate white
+@@ -575,7 +576,7 @@ gx_load_icc_profile(gs_cie_icc *picc_info)
+ if (plu == NULL)
+ goto return_rangecheck;
+
+- /*
++ /*
+ * Get the appropriate white and black points. See the note on
+ * rendering intent above for a discussion of why we are using
+ * the profile space illuminant and pure black. (Pure black need
+@@ -673,7 +674,7 @@ gs_cspace_build_CIEICC(
+ * valid WhitepPoint since PostScript always requires this, but ICC
+ * assumes a D50 WhitePoint as a default
+ */
+- picc_info->common.points.WhitePoint.u = (float)0.9642; /* Profile illuminant - D50 */
++ picc_info->common.points.WhitePoint.u = (float)0.9642; /* Profile illuminant - D50 */
+ picc_info->common.points.WhitePoint.v = 1.0000;
+ picc_info->common.points.WhitePoint.w = (float)0.8249;
+ picc_info->common.install_cspace = gx_install_CIEICC;
+@@ -692,7 +693,7 @@ gs_cspace_build_CIEICC(
+
+ /* ---------------- Serialization. -------------------------------- */
+
+-static int
++static int
+ gx_serialize_CIEICC(const gs_color_space * pcs, stream * s)
+ {
+ const gs_icc_params * p = &pcs->params.icc;
+diff --git a/base/gsiodev.c b/base/gsiodev.c
+--- a/base/gsiodev.c
++++ b/base/gsiodev.c
+@@ -20,6 +20,7 @@
+ #include "gserrors.h"
+ #include "gp.h"
+ #include "gscdefs.h"
++#include "gsfname.h"
+ #include "gsparam.h"
+ #include "gsstruct.h"
+ #include "gxiodev.h"
+@@ -351,3 +352,84 @@ gs_fopen_errno_to_code(int eno)
+ return_error(gs_error_ioerror);
+ }
+ }
++
++/* Generic interface for filesystem enumeration given a path that may */
++/* include a %iodev% prefix */
++
++typedef struct gs_file_enum_s gs_file_enum;
++struct gs_file_enum_s {
++ gs_memory_t *memory;
++ gx_io_device *piodev; /* iodev's are static, so don't need GC tracing */
++ file_enum *pfile_enum;
++ int prepend_iodev_name;
++};
++
++gs_private_st_ptrs1(st_gs_file_enum, gs_file_enum, "gs_file_enum",
++ gs_file_enum_enum_ptrs, gs_file_enum_reloc_ptrs, pfile_enum);
++
++file_enum *
++gs_enumerate_files_init(const char *pat, uint patlen, gs_memory_t * mem)
++{
++ file_enum *pfen;
++ gs_file_enum *pgs_file_enum;
++ gx_io_device *iodev = NULL;
++ gs_parsed_file_name_t pfn;
++ int code = 0;
++
++ /* Get the iodevice */
++ code = gs_parse_file_name(&pfn, pat, patlen);
++ if (code < 0)
++ return NULL;
++ iodev = (pfn.iodev == NULL) ? iodev_default : pfn.iodev;
++
++ /* Check for several conditions that just cause us to return success */
++ if (pfn.len == 0 || iodev->procs.enumerate_files == iodev_no_enumerate_files) {
++ return NULL; /* no pattern, or device not found -- just return */
++ }
++ pfen = iodev->procs.enumerate_files(iodev, (const char *)pfn.fname,
++ pfn.len, mem);
++ if (pfen == 0)
++ return NULL;
++ pgs_file_enum = gs_alloc_struct(mem, gs_file_enum, &st_gs_file_enum,
++ "gs_enumerate_files_init");
++ if (pgs_file_enum == 0)
++ return NULL;
++ pgs_file_enum->memory = mem;
++ pgs_file_enum->piodev = iodev;
++ pgs_file_enum->pfile_enum = pfen;
++ pgs_file_enum->prepend_iodev_name = (pfn.iodev != NULL);
++ return (file_enum *)pgs_file_enum;
++}
++
++uint
++gs_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
++{
++ gs_file_enum *pgs_file_enum = (gs_file_enum *)pfen;
++ int iodev_name_len = pgs_file_enum->prepend_iodev_name ?
++ strlen(pgs_file_enum->piodev->dname) : 0;
++ uint return_len;
++
++ if (iodev_name_len > maxlen)
++ return maxlen + 1; /* signal overflow error */
++ if (iodev_name_len > 0)
++ memcpy(ptr, pgs_file_enum->piodev->dname, iodev_name_len);
++ return_len = pgs_file_enum->piodev->procs.enumerate_next(pgs_file_enum->pfile_enum,
++ ptr + iodev_name_len, maxlen - iodev_name_len);
++ if (return_len == ~0) {
++ gs_memory_t *mem = pgs_file_enum->memory;
++
++ gs_free_object(mem, pgs_file_enum, "gs_enumerate_files_close");
++ return ~0;
++ }
++ return return_len+iodev_name_len;
++}
++
++void
++gs_enumerate_files_close(file_enum * pfen)
++{
++ gs_file_enum *pgs_file_enum = (gs_file_enum *)pfen;
++ gs_memory_t *mem = pgs_file_enum->memory;
++
++ pgs_file_enum->piodev->procs.enumerate_close(pgs_file_enum->pfile_enum);
++ gs_free_object(mem, pgs_file_enum, "gs_enumerate_files_close");
++}
+diff --git a/base/gsiorom.c b/base/gsiorom.c
+--- a/base/gsiorom.c
++++ b/base/gsiorom.c
+@@ -148,6 +148,7 @@ s_block_read_seek(register stream * s, long pos)
+ s->position = pos - offset;
+ pw.ptr = s->cbuf - 1;
+ pw.limit = pw.ptr + s->cbsize;
++ s->srptr = s->srlimit = s->cbuf - 1;
+ if ((s->end_status = s_block_read_process((stream_state *)s, NULL, &pw, 0)) == ERRC)
+ return ERRC;
+ if (s->end_status == 1)
+@@ -181,41 +182,58 @@ s_block_read_process(stream_state * st, stream_cursor_read * ignore_pr,
+ int status = 1;
+ int compression = ((get_u32_big_endian(node) & 0x80000000) != 0) ? 1 : 0;
+ uint32_t filelen = get_u32_big_endian(node) & 0x7fffffff; /* ignore compression bit */
+- uint32_t blocks = (filelen+ROMFS_BLOCKSIZE-1)/ ROMFS_BLOCKSIZE;
+- int iblock = (s->position + s->file_offset + pw->ptr + 1 - s->cbuf) / ROMFS_BLOCKSIZE;
+- unsigned long block_length = get_u32_big_endian(node+1+(2*iblock));
+- unsigned const long block_offset = get_u32_big_endian(node+2+(2*iblock));
++ uint32_t blocks = (filelen+ROMFS_BLOCKSIZE-1) / ROMFS_BLOCKSIZE;
++ uint32_t iblock = (s->position + s->file_offset + (s->srlimit + 1 - s->cbuf)) / ROMFS_BLOCKSIZE;
++ uint32_t block_length = get_u32_big_endian(node+1+(2*iblock));
++ uint32_t block_offset = get_u32_big_endian(node+2+(2*iblock));
+ unsigned const char *block_data = ((unsigned char *)node) + block_offset;
+ int count = iblock < (blocks - 1) ? ROMFS_BLOCKSIZE : filelen - (ROMFS_BLOCKSIZE * iblock);
+
+- if (count > max_count) {
+- return ERRC; /* should not happen */
+- }
+- if (block_data == NULL) {
+- return EOFC;
+- }
++ if (s->position == filelen || block_data == NULL)
++ return EOFC; /* at EOF */
+ if (s->file_limit < max_long) {
+- long limit_count = s->file_offset + s->file_limit - s->position;
++ /* Adjust count for subfile limit */
++ uint32_t limit_count = s->file_offset + s->file_limit - s->position;
+
+ if (count > limit_count)
+ count = limit_count;
+ }
+-
+- if (count < ROMFS_BLOCKSIZE || iblock == (blocks - 1))
+- status = EOFC; /* at EOF when not filling entire buffer */
+ /* get the block into the buffer */
+ if (compression) {
+ unsigned long buflen = ROMFS_BLOCKSIZE;
++ const byte *dest = (pw->ptr + 1); /* destination for unpack */
++ int need_copy = false;
+
++ /* If the dest is not in our buffer, we can only use it if there */
++ /* is enough space in it */
++ if ((dest < s->cbuf) || (dest >= (s->cbuf + s->cbsize))) {
++ /* the destination is _not_ in our buffer. If the area isn't */
++ /* big enough we need to ucompress to our buffer, then copy */
++ /* the data afterward. INVARIANT: if the buffer is outside */
++ /* the cbuf, then the cbuf must be empty. */
++ if (max_count < count) {
++#ifdef DEBUG
++ if ((sbufptr(s)) != s->srlimit)
++ eprintf("cbuf not empty as expected\n.");
++#endif
++ dest = s->cbuf;
++ need_copy = true;
++ }
++ }
+ /* Decompress the data into this block */
+- code = uncompress (pw->ptr+1, &buflen, block_data, block_length);
+- if (count != buflen) {
++ code = uncompress (dest, &buflen, block_data, block_length);
++ if (count != buflen)
+ return ERRC;
++ if (need_copy) {
++ memcpy(pw->ptr+1, dest, max_count);
++ count = max_count;
+ }
+ } else {
+ /* not compressed -- just copy it */
+- memcpy(pw->ptr+1, block_data, block_length);
+ count = block_length;
++ if (count > max_count)
++ count = max_count;
++ memcpy(pw->ptr+1, block_data, count);
+ }
+ if (count < 0)
+ count = 0;
+@@ -353,7 +371,7 @@ romfs_enumerate_next(file_enum *pfen, char *ptr, uint maxlen)
+ while (gs_romfs[penum->list_index] != 0) {
+ const uint32_t *node = gs_romfs[penum->list_index];
+ uint32_t filelen = get_u32_big_endian(node) & 0x7fffffff; /* ignore compression bit */
+- long blocks = (filelen+ROMFS_BLOCKSIZE-1)/ ROMFS_BLOCKSIZE;
++ uint32_t blocks = (filelen+ROMFS_BLOCKSIZE-1)/ ROMFS_BLOCKSIZE;
+ char *filename = (char *)(&(node[1+(2*blocks)]));
+
+ penum->list_index++; /* bump to next unconditionally */
+diff --git a/base/gsistate.c b/base/gsistate.c
+--- a/base/gsistate.c
++++ b/base/gsistate.c
+@@ -63,7 +63,8 @@ ENUM_PTRS_BEGIN(imager_state_enum_ptrs)
+ ENUM_SUPER(gs_imager_state, st_line_params, line_params, st_imager_state_num_ptrs - st_line_params_num_ptrs);
+ ENUM_PTR(0, gs_imager_state, client_data);
+ ENUM_PTR(1, gs_imager_state, transparency_stack);
+-#define E1(i,elt) ENUM_PTR(i+2,gs_imager_state,elt);
++ ENUM_PTR(2, gs_imager_state, trans_device);
++#define E1(i,elt) ENUM_PTR(i+3,gs_imager_state,elt);
+ gs_cr_state_do_ptrs(E1)
+ #undef E1
+ ENUM_PTRS_END
+@@ -72,6 +73,7 @@ static RELOC_PTRS_BEGIN(imager_state_reloc_ptrs)
+ RELOC_SUPER(gs_imager_state, st_line_params, line_params);
+ RELOC_PTR(gs_imager_state, client_data);
+ RELOC_PTR(gs_imager_state, transparency_stack);
++ RELOC_PTR(gs_imager_state, trans_device);
+ #define R1(i,elt) RELOC_PTR(gs_imager_state,elt);
+ gs_cr_state_do_ptrs(R1)
+ #undef R1
+@@ -93,6 +95,7 @@ gs_imager_state_initialize(gs_imager_state * pis, gs_memory_t * mem)
+ pis->memory = mem;
+ pis->client_data = 0;
+ pis->transparency_stack = 0;
++ pis->trans_device = 0;
+ /* Color rendering state */
+ pis->halftone = 0;
+ {
+diff --git a/base/gsmchunk.c b/base/gsmchunk.c
+--- a/base/gsmchunk.c
++++ b/base/gsmchunk.c
+@@ -362,8 +362,13 @@ chunk_obj_alloc(gs_memory_t *mem, uint size, gs_memory_type_ptr_t type, client_n
+ }
+ if (current == NULL) {
+ /* No chunks with enough space, allocate one */
+- if (chunk_mem_node_add(cmem, newsize, &current) < 0)
++ if (chunk_mem_node_add(cmem, newsize, &current) < 0) {
++#ifdef DEBUG
++ if (gs_debug_c('a'))
++ dlprintf1("[a+]chunk_obj_alloc(chunk_mem_node_add)(%u) Failed.\n", size);
++#endif
+ return NULL;
++ }
+ }
+ /* Find the first free area in the current chunk that is big enough */
+ /* LATER: might be better to find the 'best fit' */
+@@ -423,6 +428,11 @@ chunk_obj_alloc(gs_memory_t *mem, uint size, gs_memory_type_ptr_t type, client_n
+ }
+
+ /* return the client area of the object we allocated */
++#ifdef DEBUG
++ if (gs_debug_c('A'))
++ dlprintf3("[a+]chunk_obj_alloc (%s)(%u) = 0x%lx: OK.\n",
++ client_name_string(cname), size, (ulong) newobj);
++#endif
+ return (byte *)(newobj) + sizeof(chunk_obj_node_t);
+ }
+
+@@ -484,13 +494,21 @@ chunk_alloc_struct_array(gs_memory_t * mem, uint num_elements,
+ static void *
+ chunk_resize_object(gs_memory_t * mem, void *ptr, uint new_num_elements, client_name_t cname)
+ {
+- /* get the type from the old object */
+- chunk_obj_node_t *obj = ((chunk_obj_node_t *)ptr) - 1;
+- uint new_size = (obj->type->ssize * new_num_elements);
+-
+ /* This isn't particularly efficient, but it is rarely used */
++ chunk_obj_node_t *obj = ((chunk_obj_node_t *)ptr) - 1;
++ ulong new_size = (obj->type->ssize * new_num_elements);
++ ulong old_size = obj->size;
++ /* get the type from the old object */
++ gs_memory_type_ptr_t type = obj->type;
++ void *new_ptr;
++
++ if (new_size == old_size)
++ return ptr;
++ if ((new_ptr = chunk_obj_alloc(mem, new_size, type, cname)) == 0)
++ return 0;
++ memcpy(new_ptr, ptr, min(old_size, new_size));
+ chunk_free_object(mem, ptr, cname);
+- return chunk_obj_alloc(mem, new_size, obj->type, cname);
++ return new_ptr;
+ }
+
+ static void
+@@ -542,6 +560,9 @@ chunk_free_object(gs_memory_t * mem, void *ptr, client_name_t cname)
+ else
+ prev_obj->next = obj->next;
+
++ if_debug3('A', "[a-]chunk_free_object(%s) 0x%lx(%u)\n",
++ client_name_string(cname), (ulong) ptr, obj->size);
++
+ /* Add this object's space (including the header) to the free list */
+
+ /* Scan free list to find where this element goes */
+diff --git a/base/gsovrc.c b/base/gsovrc.c
+--- a/base/gsovrc.c
++++ b/base/gsovrc.c
+@@ -82,7 +82,8 @@ read_color_index(gx_color_index * pcindex, const byte * data, uint size)
+ if (++nbytes > size)
+ return_error(gs_error_rangecheck);
+ else {
+- int c = *data;
++ unsigned char byte = *data;
++ gx_color_index c = byte;
+
+ cindex += (c & 0x7f) << shift;
+ if ((c & 0x80) == 0)
+diff --git a/base/gsparam2.c b/base/gsparam2.c
+--- a/base/gsparam2.c
++++ b/base/gsparam2.c
+@@ -373,7 +373,7 @@ sget_bytes(stream *src, byte *data, uint size)
+
+ int status = sgets(src, data, size, &ignore_count);
+
+- if (status < 0 && status != EOFC)
++ if (status < 0 && status != EOFC) {
+ return_error(gs_error_ioerror);
+ };
+
+diff --git a/base/gsptype1.c b/base/gsptype1.c
+--- a/base/gsptype1.c
++++ b/base/gsptype1.c
+@@ -111,6 +111,7 @@ void
+ gs_pattern1_init(gs_pattern1_template_t * ppat)
+ {
+ gs_pattern_common_init((gs_pattern_template_t *)ppat, &gs_pattern1_type);
++ ppat->uses_transparency = 0; /* false */
+ }
+
+ /* Make an instance of a PatternType 1 pattern. */
+@@ -169,8 +170,8 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
+ if_debug6('t', "[t]step_matrix=[%g %g %g %g %g %g]\n",
+ inst.step_matrix.xx, inst.step_matrix.xy, inst.step_matrix.yx,
+ inst.step_matrix.yy, inst.step_matrix.tx, inst.step_matrix.ty);
+- if_debug4('t', "[t]bbox=(%g,%g),(%g,%g)\n",
+- bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y);
++ if_debug5('t', "[t]bbox=(%g,%g),(%g,%g), uses_transparency=%d\n",
++ bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y, inst.template.uses_transparency);
+ {
+ float bbw = bbox.q.x - bbox.p.x;
+ float bbh = bbox.q.y - bbox.p.y;
+@@ -1471,7 +1472,7 @@ gx_dc_pattern_read_raster(gx_color_tile *ptile, const gx_dc_serialized_tile_t *b
+ dp += l;
+ }
+ if (left == 0)
+- return 0;
++ return size; /* we've consumed it all */
+ if (offset1 <= sizeof(gx_dc_serialized_tile_t) + size_b) {
+ int l = min(sizeof(gx_dc_serialized_tile_t) + size_b - offset1, left);
+
+@@ -1495,7 +1496,7 @@ gx_dc_pattern_read_raster(gx_color_tile *ptile, const gx_dc_serialized_tile_t *b
+ dp += l;
+ }
+ if (left == 0)
+- return 0;
++ return size;
+ if (offset1 <= sizeof(gx_dc_serialized_tile_t) + size_b + size_c) {
+ int l = min(sizeof(gx_dc_serialized_tile_t) + size_b + size_c - offset1, left);
+
+diff --git a/base/gsptype1.h b/base/gsptype1.h
+--- a/base/gsptype1.h
++++ b/base/gsptype1.h
+@@ -41,6 +41,7 @@ typedef struct gs_pattern1_template_s {
+ gs_pattern_template_common;
+ int PaintType;
+ int TilingType;
++ bool uses_transparency;
+ gs_rect BBox;
+ float XStep;
+ float YStep;
+diff --git a/base/gsshade.c b/base/gsshade.c
+--- a/base/gsshade.c
++++ b/base/gsshade.c
+@@ -306,8 +306,6 @@ gs_shading_FfGt_init(gs_shading_t ** ppsh,
+ return code;
+ if (bpf < 0)
+ return bpf;
+- if (params->Decode != 0 && params->Decode[0] == params->Decode[1])
+- return_error(gs_error_rangecheck);
+ ALLOC_SHADING(&st_shading_FfGt, shading_type_Free_form_Gouraud_triangle,
+ shading_FfGt_procs, "gs_shading_FfGt_init");
+ psh->params.BitsPerFlag = bpf;
+diff --git a/base/gsstate.c b/base/gsstate.c
+--- a/base/gsstate.c
++++ b/base/gsstate.c
+@@ -192,7 +192,7 @@ gstate_copy_client_data(gs_state * pgs, void *dto, void *dfrom,
+
+ /* Define the initial value of the graphics state. */
+ static const gs_imager_state gstate_initial = {
+- gs_imager_state_initial(1.0)
++ gs_imager_state_initial(1.0, true) /* is_gstate == true */
+ };
+
+ /*
+@@ -218,7 +218,7 @@ gs_state_alloc(gs_memory_t * mem)
+ if (pgs == 0)
+ return 0;
+ pgs->saved = 0;
+- *(gs_imager_state *)pgs = gstate_initial;
++ *(gs_imager_state *)pgs = gstate_initial; /* this sets is_gstate == true */
+
+ /*
+ * Just enough of the state is initialized at this point
+diff --git a/base/gstparam.h b/base/gstparam.h
+--- a/base/gstparam.h
++++ b/base/gstparam.h
+@@ -85,6 +85,8 @@ typedef struct gs_transparency_group_params_s {
+ bool image_with_SMask;
+ bool idle;
+ uint mask_id;
++ int group_color_numcomps;
++ gs_transparency_color_t group_color;
+ } gs_transparency_group_params_t;
+
+ /* Define the parameter structure for a transparency mask. */
+@@ -99,6 +101,7 @@ typedef enum {
+ /* See the gx_transparency_mask_params_t type below */
+ /* (Update gs_trans_mask_params_init if these change.) */
+ typedef struct gs_transparency_mask_params_s {
++ const gs_color_space *ColorSpace;
+ gs_transparency_mask_subtype_t subtype;
+ int Background_components;
+ float Background[GS_CLIENT_COLOR_MAX_COMPONENTS];
+@@ -113,6 +116,9 @@ typedef struct gs_transparency_mask_params_s {
+ /* The post clist version of transparency mask parameters */
+ typedef struct gx_transparency_mask_params_s {
+ gs_transparency_mask_subtype_t subtype;
++ bool SMask_is_CIE;
++ int group_color_numcomps;
++ gs_transparency_color_t group_color;
+ int Background_components;
+ float Background[GS_CLIENT_COLOR_MAX_COMPONENTS];
+ float GrayBackground;
+diff --git a/base/gstrans.c b/base/gstrans.c
+--- a/base/gstrans.c
++++ b/base/gstrans.c
+@@ -24,6 +24,7 @@
+ #include "gdevdevn.h"
+ #include "gxblend.h"
+ #include "gdevp14.h"
++#include "gscspace.h"
+
+ #define PUSH_TS 0
+
+@@ -183,24 +184,10 @@ gs_begin_transparency_group(gs_state *pgs,
+ const gs_rect *pbbox)
+ {
+ gs_pdf14trans_params_t params = { 0 };
++ const gs_color_space *blend_color_space;
++ gs_imager_state * pis = (gs_imager_state *)pgs;
+
+-#ifdef DEBUG
+- if (gs_debug_c('v')) {
+- static const char *const cs_names[] = {
+- GS_COLOR_SPACE_TYPE_NAMES
+- };
+
+- dlprintf5("[v](0x%lx)begin_transparency_group [%g %g %g %g]\n",
+- (ulong)pgs, pbbox->p.x, pbbox->p.y, pbbox->q.x, pbbox->q.y);
+- if (ptgp->ColorSpace)
+- dprintf1(" CS = %s",
+- cs_names[(int)gs_color_space_get_index(ptgp->ColorSpace)]);
+- else
+- dputs(" (no CS)");
+- dprintf2(" Isolated = %d Knockout = %d\n",
+- ptgp->Isolated, ptgp->Knockout);
+- }
+-#endif
+ /*
+ * Put parameters into a compositor parameter and then call the
+ * create_compositor. This will pass the data to the PDF 1.4
+@@ -213,11 +200,98 @@ gs_begin_transparency_group(gs_state *pgs,
+ params.opacity = pgs->opacity;
+ params.shape = pgs->shape;
+ params.blend_mode = pgs->blend_mode;
+- /*
+- * We are currently doing nothing with the colorspace. Currently
+- * the blending colorspace is based upon the processs color model
+- * of the output device.
+- */
++
++ /* The blending procs must be based upon the current color space */
++ /* Note: This function is called during the c-list writer side.
++ Store some information so that we know what the color space is
++ so that we can adjust according later during the clist reader */
++
++ /* Note that we currently will use the concrete space for any space other than a
++ device space. However, if the device is a sep device it will blend
++ in DeviceN color space as required. */
++
++ if (gs_color_space_get_index(pgs->color_space) <= gs_color_space_index_DeviceCMYK) {
++
++ blend_color_space = pgs->color_space;
++
++ } else {
++
++ /* ICC and CIE based color space. Problem right now is that the
++ current code does a concretization to the color space
++ defined by the CRD. This is not the space that we want
++ to blend in. Instead we want all colors to be mapped TO
++ the ICC color space. Then when the group is popped they
++ should be converted to the parent space.
++ That I will need to fix another day with the color changes.
++ For now we will punt and set our blending space as the
++ concrete space for the ICC space, which is defined by
++ the output (or default) CRD. */
++
++ blend_color_space = cs_concrete_space(pgs->color_space, pis);
++
++ }
++
++ /* Note that if the /CS parameter was not present in the push
++ of the transparency group, then we must actually inherent
++ the previous group color space, or the color space of the
++ target device (process color model). Note here we just want
++ to set it as a unknown type for clist writing, as we . We will later
++ during clist reading
++ */
++
++ if (ptgp->ColorSpace == NULL) {
++
++ params.group_color = UNKNOWN;
++ params.group_color_numcomps = 0;
++
++ } else {
++
++ switch (cs_num_components(blend_color_space)) {
++ case 1:
++ params.group_color = GRAY_SCALE;
++ params.group_color_numcomps = 1; /* Need to check */
++ break;
++ case 3:
++ params.group_color = DEVICE_RGB;
++ params.group_color_numcomps = 3;
++ break;
++ case 4:
++ params.group_color = DEVICE_CMYK;
++ params.group_color_numcomps = 4;
++ break;
++ default:
++
++ /* We can end up here if we are in
++ a deviceN color space and
++ we have a sep output device */
++
++ params.group_color = DEVICEN;
++ params.group_color_numcomps = cs_num_components(blend_color_space);
++
++ break;
++
++ }
++
++ }
++
++#ifdef DEBUG
++ if (gs_debug_c('v')) {
++ static const char *const cs_names[] = {
++ GS_COLOR_SPACE_TYPE_NAMES
++ };
++
++ dlprintf6("[v](0x%lx)begin_transparency_group [%g %g %g %g] Num_grp_clr_comp = %d\n",
++ (ulong)pgs, pbbox->p.x, pbbox->p.y, pbbox->q.x, pbbox->q.y,params.group_color_numcomps);
++ if (ptgp->ColorSpace)
++ dprintf1(" CS = %s",
++ cs_names[(int)gs_color_space_get_index(ptgp->ColorSpace)]);
++ else
++ dputs(" (no CS)");
++ dprintf2(" Isolated = %d Knockout = %d\n",
++ ptgp->Isolated, ptgp->Knockout);
++ }
++#endif
++
+ params.bbox = *pbbox;
+ return gs_state_update_pdf14trans(pgs, &params);
+ }
+@@ -236,6 +310,11 @@ gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
+ tgp.Knockout = pparams->Knockout;
+ tgp.idle = pparams->idle;
+ tgp.mask_id = pparams->mask_id;
++
++ /* Needed so that we do proper blending */
++ tgp.group_color = pparams->group_color;
++ tgp.group_color_numcomps = pparams->group_color_numcomps;
++
+ pis->opacity.alpha = pparams->opacity.alpha;
+ pis->shape.alpha = pparams->shape.alpha;
+ pis->blend_mode = pparams->blend_mode;
+@@ -246,8 +325,8 @@ gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
+ GS_COLOR_SPACE_TYPE_NAMES
+ };
+
+- dlprintf5("[v](0x%lx)gx_begin_transparency_group [%g %g %g %g]\n",
+- (ulong)pis, bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y);
++ dlprintf6("[v](0x%lx)gx_begin_transparency_group [%g %g %g %g] Num_grp_clr_comp = %d\n",
++ (ulong)pis, bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y,pparams->group_color_numcomps);
+ if (tgp.ColorSpace)
+ dprintf1(" CS = %s",
+ cs_names[(int)gs_color_space_get_index(tgp.ColorSpace)]);
+@@ -298,6 +377,7 @@ void
+ gs_trans_mask_params_init(gs_transparency_mask_params_t *ptmp,
+ gs_transparency_mask_subtype_t subtype)
+ {
++ ptmp->ColorSpace = 0;
+ ptmp->subtype = subtype;
+ ptmp->Background_components = 0;
+ ptmp->TransferFunction = mask_transfer_identity;
+@@ -313,16 +393,14 @@ gs_begin_transparency_mask(gs_state * pgs,
+ gs_pdf14trans_params_t params = { 0 };
+ const int l = sizeof(params.Background[0]) * ptmp->Background_components;
+ int i;
++ const gs_color_space *blend_color_space;
++ gs_imager_state * pis = (gs_imager_state *)pgs;
+
+- if_debug8('v', "[v](0x%lx)gs_begin_transparency_mask [%g %g %g %g]\n\
+- subtype = %d Background_components = %d %s\n",
+- (ulong)pgs, pbbox->p.x, pbbox->p.y, pbbox->q.x, pbbox->q.y,
+- (int)ptmp->subtype, ptmp->Background_components,
+- (ptmp->TransferFunction == mask_transfer_identity ? "no TR" :
+- "has TR"));
+ params.pdf14_op = PDF14_BEGIN_TRANS_MASK;
+ params.bbox = *pbbox;
+ params.subtype = ptmp->subtype;
++ /* params.SMask_is_CIE = gs_color_space_is_CIE(pgs->color_space); */ /* See comments in gs_begin_transparency_mask */
++ params.SMask_is_CIE = false;
+ params.Background_components = ptmp->Background_components;
+ memcpy(params.Background, ptmp->Background, l);
+ params.GrayBackground = ptmp->GrayBackground;
+@@ -331,6 +409,18 @@ gs_begin_transparency_mask(gs_state * pgs,
+ (ptmp->TransferFunction == mask_transfer_identity);
+ params.mask_is_image = mask_is_image;
+ params.replacing = ptmp->replacing;
++ /* Note that the SMask buffer may have a different
++ numcomps than the device buffer */
++ params.group_color_numcomps = cs_num_components(pgs->color_space);
++
++ if_debug9('v', "[v](0x%lx)gs_begin_transparency_mask [%g %g %g %g]\n\
++ subtype = %d Background_components = %d Num_grp_clr_comp = %d %s\n",
++ (ulong)pgs, pbbox->p.x, pbbox->p.y, pbbox->q.x, pbbox->q.y,
++ (int)ptmp->subtype, ptmp->Background_components,
++ params.group_color_numcomps,
++ (ptmp->TransferFunction == mask_transfer_identity ? "no TR" :
++ "has TR"));
++
+ /* Sample the transfer function */
+ for (i = 0; i < MASK_TRANSFER_FUNCTION_SIZE; i++) {
+ float in = (float)(i * (1.0 / (MASK_TRANSFER_FUNCTION_SIZE - 1)));
+@@ -339,9 +429,115 @@ gs_begin_transparency_mask(gs_state * pgs,
+ ptmp->TransferFunction(in, &out, ptmp->TransferFunction_data);
+ params.transfer_fn[i] = (byte)floor((double)(out * 255 + 0.5));
+ }
++
++ /* If we have a CIE space & a luminosity subtype
++ we will need to do our concretization
++ to CIEXYZ so that we can obtain the proper
++ luminance value. This is what SHOULD happen
++ according to the spec. However AR does not
++ follow this. It always seems to do the soft mask
++ creation in the device space. For this reason
++ we will do that too. SMask_is_CIE is always false for now */
++
++ /* The blending procs are currently based upon the device type.
++ We need to have them based upon the current color space */
++
++ /* Note: This function is called during the c-list writer side. */
++
++
++ if ( params.SMask_is_CIE && params.subtype == TRANSPARENCY_MASK_Luminosity ){
++
++ /* Install Color Space to go to CIEXYZ */
++
++ /* int ok;
++ ok = gx_cie_to_xyz_alloc2(pgs->color_space,pgs); */ /* quite compiler */
++ params.group_color_numcomps = 3; /* CIEXYZ */
++
++ /* Mark the proper spaces so that we make
++ * the appropriate changes in the device */
++
++ params.group_color = CIE_XYZ;
++
++ } else {
++
++ /* Set the group color type, which may be
++ * different than the device type. Note
++ we want to check the concrete space due
++ to the fact that things are done
++ in device space always. */
++
++
++ if(!gs_color_space_is_CIE(pgs->color_space)){
++
++ blend_color_space = pgs->color_space;
++
++ } else {
++
++ /* ICC or CIE based color space. Problem right now is that the
++ current code does a concretization to the color space
++ defined by the CRD. This is not the space that we want
++ to blend in. Instead we want all colors to be mapped TO
++ the ICC color space. Then when the group is popped they
++ should be converted to the parent space.
++ That I will need to fix another day with the color changes.
++ For now we will punt and set our blending space as the
++ concrete space for the ICC space, which is defined by
++ the output (or default) CRD. */
++
++ blend_color_space = cs_concrete_space(pgs->color_space, pis);
++
++ }
++
++
++ /* Note that if the /CS parameter was not present in the push
++ of the transparency group, then we must actually inherent
++ the previous group color space, or the color space of the
++ target device (process color model). Note here we just want
++ to set it as a unknown type for clist writing, as we . We will later
++ during clist reading
++ */
++
++ if (ptmp->ColorSpace == NULL) {
++
++ params.group_color = UNKNOWN;
++ params.group_color_numcomps = 0;
++
++ } else {
++
++
++ switch (cs_num_components(blend_color_space)) {
++
++ case 1:
++ params.group_color = GRAY_SCALE;
++ params.group_color_numcomps = 1; /* Need to check */
++ break;
++ case 3:
++ params.group_color = DEVICE_RGB;
++ params.group_color_numcomps = 3;
++ break;
++ case 4:
++ params.group_color = DEVICE_CMYK;
++ params.group_color_numcomps = 4;
++ break;
++ default:
++ /* Transparency soft mask spot
++ colors are NEVER available.
++ We must use the alternate tint
++ transform */
++ return_error(gs_error_rangecheck);
++ break;
++
++ }
++
++ }
++
++ }
++
+ return gs_state_update_pdf14trans(pgs, &params);
+ }
+
++/* This occurs on the c-list reader side */
++
+ int
+ gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+ const gs_pdf14trans_params_t * pparams)
+@@ -349,7 +545,10 @@ gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+ gx_transparency_mask_params_t tmp;
+ const int l = sizeof(pparams->Background[0]) * pparams->Background_components;
+
++ tmp.group_color = pparams->group_color;
+ tmp.subtype = pparams->subtype;
++ tmp.SMask_is_CIE = pparams->SMask_is_CIE;
++ tmp.group_color_numcomps = pparams->group_color_numcomps;
+ tmp.Background_components = pparams->Background_components;
+ memcpy(tmp.Background, pparams->Background, l);
+ tmp.GrayBackground = pparams->GrayBackground;
+@@ -358,11 +557,12 @@ gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+ tmp.replacing = pparams->replacing;
+ tmp.mask_id = pparams->mask_id;
+ memcpy(tmp.transfer_fn, pparams->transfer_fn, size_of(tmp.transfer_fn));
+- if_debug8('v', "[v](0x%lx)gx_begin_transparency_mask [%g %g %g %g]\n\
+- subtype = %d Background_components = %d %s\n",
++ if_debug9('v', "[v](0x%lx)gx_begin_transparency_mask [%g %g %g %g]\n\
++ subtype = %d Background_components = %d Num_grp_clr_comp = %d %s\n",
+ (ulong)pis, pparams->bbox.p.x, pparams->bbox.p.y,
+ pparams->bbox.q.x, pparams->bbox.q.y,
+ (int)tmp.subtype, tmp.Background_components,
++ tmp.group_color_numcomps,
+ (tmp.function_is_identity ? "no TR" :
+ "has TR"));
+ if (dev_proc(pdev, begin_transparency_mask) != 0)
+@@ -392,8 +592,9 @@ gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
+ {
+ if_debug2('v', "[v](0x%lx)gx_end_transparency_mask(%d)\n", (ulong)pis,
+ (int)pparams->csel);
++
+ if (dev_proc(pdev, end_transparency_mask) != 0)
+- return (*dev_proc(pdev, end_transparency_mask)) (pdev, NULL);
++ return (*dev_proc(pdev, end_transparency_mask)) (pdev, pis, NULL);
+ else
+ return 0;
+ }
+diff --git a/base/gstrans.h b/base/gstrans.h
+--- a/base/gstrans.h
++++ b/base/gstrans.h
+@@ -20,6 +20,7 @@
+ #include "gstparam.h"
+ #include "gxcomp.h"
+ #include "gsmatrix.h"
++#include "gxblend.h"
+
+ /*
+ * Define the operations for the PDF 1.4 transparency compositor.
+@@ -95,6 +96,9 @@ struct gs_pdf14trans_params_s {
+ bool overprint_mode;
+ bool idle; /* For clist reader.*/
+ uint mask_id; /* For clist reader.*/
++ bool SMask_is_CIE;
++ int group_color_numcomps;
++ gs_transparency_color_t group_color;
+ };
+
+ #ifndef gs_pdf14trans_params_DEFINED
+diff --git a/base/gstype1.c b/base/gstype1.c
+--- a/base/gstype1.c
++++ b/base/gstype1.c
+@@ -283,6 +283,19 @@ gs_type1_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
+ goto cc;
+ case cx_endchar:
+ if (pcis->seac_accent < 0) {
++ if(!pcis->sb_set && !pcis->width_set) {
++ /* No sbw/hsbw op, error condition but Adobe interpreters ignore it.
++ Rewind the data pointer to the beginning of the glyph, re-initialise
++ the hinter, execute a '0' sbw op, and then carry on as if we had
++ actually received one. */
++ cip = pgd->bits.data;
++ t1_hinter__init(h, pcis->path);
++ code = t1_hinter__sbw(h, fixed_0, fixed_0, fixed_0, fixed_0);
++ if (code < 0)
++ return code;
++ gs_type1_sbw(pcis, fixed_0, fixed_0, fixed_0, fixed_0);
++ goto rsbw;
++ }
+ code = t1_hinter__endglyph(h);
+ if (code < 0)
+ return code;
+diff --git a/base/gstype42.c b/base/gstype42.c
+--- a/base/gstype42.c
++++ b/base/gstype42.c
+@@ -258,8 +258,23 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
+ the bug 688467 fails otherwise.
+ */
+ /* pfont->key_name.chars is ASCIIZ due to copy_font_name. */
++ char buf[gs_font_name_max + 2];
++
++ if (pfont->key_name.size) {
++ int l = min(sizeof(buf) - 1, pfont->key_name.size);
++
++ memcpy(buf, pfont->key_name.chars, l);
++ buf[l] = 0;
++ } else if (pfont->font_name.size) {
++ int l = min(sizeof(buf) - 1, pfont->font_name.size);
++
++ memcpy(buf, pfont->font_name.chars, l);
++ buf[l] = 0;
++ } else
++ buf[0] = 0;
++
+ eprintf3("Warning: 'loca' length %d is greater than numGlyphs %d in the font %s.\n",
+- pfont->data.numGlyphs + 1, pfont->data.trueNumGlyphs, pfont->key_name.chars);
++ pfont->data.numGlyphs + 1, pfont->data.trueNumGlyphs, buf);
+ if (loca_size > pfont->data.trueNumGlyphs + 1) {
+ /* Bug 689516 demonstrates a font, in which numGlyps is smaller than loca size,
+ and there are useful glyphs behind maxp.numGlyphs. */
+diff --git a/base/gxblend.c b/base/gxblend.c
+--- a/base/gxblend.c
++++ b/base/gxblend.c
+@@ -17,13 +17,203 @@
+ #include "gx.h"
+ #include "gstparam.h"
+ #include "gxblend.h"
++#include "gxcolor2.h"
+
+ typedef int art_s32;
+
+ #if RAW_DUMP
+-extern unsigned char global_index;
++extern unsigned int global_index;
++extern unsigned int clist_band_count;
+ #endif
+
++/* This function is used for mapping the SMask source to a
++ monochrome luminosity value which basically is the alpha value
++ Note, that separation colors are not allowed here. Everything
++ must be in CMYK, RGB or monochrome. */
++
++/* Note, data is planar */
++
++void
++Smask_Luminosity_Mapping(int num_rows, int num_cols, int n_chan, int row_stride,
++ int plane_stride, byte *dst, const byte *src, bool isadditive,
++ bool SMask_is_CIE, gs_transparency_mask_subtype_t SMask_SubType)
++{
++
++ int x,y;
++ int mask_alpha_offset,mask_C_offset,mask_M_offset,mask_Y_offset,mask_K_offset;
++ int mask_R_offset,mask_G_offset,mask_B_offset;
++ byte *dstptr;
++
++#if RAW_DUMP
++
++ dump_raw_buffer(num_rows, row_stride, n_chan,
++ plane_stride, row_stride,
++ "Raw_Mask", src);
++
++ global_index++;
++
++#endif
++
++ dstptr = dst;
++
++ /* If we are CIE AND subtype is Luminosity then we should just grab the Y channel */
++
++ if ( SMask_is_CIE && SMask_SubType == TRANSPARENCY_MASK_Luminosity ){
++
++
++ memcpy(dst, &(src[plane_stride]), plane_stride);
++ return;
++
++ }
++
++ /* If we are alpha type, then just grab that */
++ /* We need to optimize this so that we are only drawing alpha in the rect fills */
++
++ if ( SMask_SubType == TRANSPARENCY_MASK_Alpha ){
++
++ mask_alpha_offset = (n_chan - 1) * plane_stride;
++ memcpy(dst, &(src[mask_alpha_offset]), plane_stride);
++ return;
++
++ }
++
++ /* To avoid the if statement inside this loop,
++ decide on additive or subractive now */
++
++ if (isadditive || n_chan == 2)
++ {
++
++ /* Now we need to split Gray from RGB */
++
++ if( n_chan == 2 )
++ {
++ /* Gray Scale case */
++
++ mask_alpha_offset = (n_chan - 1) * plane_stride;
++ mask_R_offset = 0;
++
++ for ( y = 0; y < num_rows; y++ )
++ {
++
++ for ( x = 0; x < num_cols; x++ ){
++
++ /* With the current design this will indicate if
++ we ever did a fill at this pixel. if not then move on.
++ This could have some serious optimization */
++
++ if (src[x + mask_alpha_offset] != 0x00) {
++
++ dstptr[x] = src[x + mask_R_offset];
++
++ }
++
++ }
++
++ dstptr += row_stride;
++ mask_alpha_offset += row_stride;
++ mask_R_offset += row_stride;
++
++ }
++
++ } else {
++
++
++
++ /* RGB case */
++
++ mask_R_offset = 0;
++ mask_G_offset = plane_stride;
++ mask_B_offset = 2 * plane_stride;
++ mask_alpha_offset = (n_chan - 1) * plane_stride;
++
++ for ( y = 0; y < num_rows; y++ )
++ {
++
++ for ( x = 0; x < num_cols; x++ ){
++
++ /* With the current design this will indicate if
++ we ever did a fill at this pixel. if not then move on */
++
++ if (src[x + mask_alpha_offset] != 0x00) {
++
++ /* Get luminosity of Device RGB value */
++
++ float temp;
++
++ temp = ( 0.30 * src[x + mask_R_offset] +
++ 0.59 * src[x + mask_G_offset] +
++ 0.11 * src[x + mask_B_offset] );
++
++ temp = temp * (1.0 / 255.0 ); /* May need to be optimized */
++ dstptr[x] = float_color_to_byte_color(temp);
++
++ }
++
++ }
++
++ dstptr += row_stride;
++ mask_alpha_offset += row_stride;
++ mask_R_offset += row_stride;
++ mask_G_offset += row_stride;
++ mask_B_offset += row_stride;
++
++ }
++
++ }
++
++ } else {
++
++ /* CMYK case */
++
++ mask_alpha_offset = (n_chan - 1) * plane_stride;
++ mask_C_offset = 0;
++ mask_M_offset = plane_stride;
++ mask_Y_offset = 2 * plane_stride;
++ mask_K_offset = 3 * plane_stride;
++
++ for ( y = 0; y < num_rows; y++ ){
++
++ for ( x = 0; x < num_cols; x++ ){
++
++ /* With the current design this will indicate if
++ we ever did a fill at this pixel. if not then move on */
++
++ if (src[x + mask_alpha_offset] != 0x00){
++
++ /* PDF spec says to use Y = 0.30 (1 - C)(1 - K) +
++ 0.59 (1 - M)(1 - K) + 0.11 (1 - Y)(1 - K) */
++ /* For device CMYK */
++
++ float temp;
++
++ temp = ( 0.30 * ( 0xff - src[x + mask_C_offset]) +
++ 0.59 * ( 0xff - src[x + mask_M_offset]) +
++ 0.11 * ( 0xff - src[x + mask_Y_offset]) ) *
++ ( 0xff - src[x + mask_K_offset]);
++
++ temp = temp * (1.0 / 65025.0 ); /* May need to be optimized */
++
++ dstptr[x] = float_color_to_byte_color(temp);
++
++ }
++
++ }
++
++ dstptr += row_stride;
++ mask_alpha_offset += row_stride;
++ mask_C_offset += row_stride;
++ mask_M_offset += row_stride;
++ mask_Y_offset += row_stride;
++ mask_K_offset += row_stride;
++
++ }
++
++
++ }
++
++
++}
++
+ void
+ art_blend_luminosity_rgb_8(int n_chan, byte *dst, const byte *backdrop,
+ const byte *src)
+@@ -1236,13 +1426,20 @@ dump_raw_buffer(int num_rows, int width, int n_chan,
+ FILE *fid;
+ int z,y;
+ byte *buff_ptr;
++ int max_bands;
++
++ /* clist_band_count is incremented at every pdf14putimage */
++ /* Useful for catching this thing and only dumping */
++ /* during a particular band if we have a large file */
++ /* if (clist_band_count != 80) return; */
+
+ buff_ptr = Buffer;
+
+- sprintf(full_file_name,"%d)%s_%dx%dx%d.raw",global_index,filename,width,num_rows,n_chan);
++ max_bands = ( n_chan < 57 ? n_chan : 56); /* Photoshop handles at most 56 bands */
++ sprintf(full_file_name,"%d)%s_%dx%dx%d.raw",global_index,filename,width,num_rows,max_bands);
+ fid = fopen(full_file_name,"wb");
+
+- for (z = 0; z < n_chan; ++z) {
++ for (z = 0; z < max_bands; ++z) {
+
+ /* grab pointer to the next plane */
+
+diff --git a/base/gxblend.h b/base/gxblend.h
+--- a/base/gxblend.h
++++ b/base/gxblend.h
+@@ -19,12 +19,13 @@
+ #include "gxcindex.h"
+ #include "gxcvalue.h"
+ #include "gxfrac.h"
++#include "gxdevcli.h"
+
+ #define RAW_DUMP 0
+
+ /* #define DUMP_TO_PNG */
+
+-#define PDF14_MAX_PLANES (GX_DEVICE_COLOR_MAX_COMPONENTS + 1) /* one extra for alpha channel */
++#define PDF14_MAX_PLANES GX_DEVICE_COLOR_MAX_COMPONENTS+3 /* Needed for alpha channel, shape, group alpha */
+
+ typedef bits16 ArtPixMaxDepth;
+
+@@ -75,6 +76,27 @@ typedef struct {
+ typedef pdf14_nonseparable_blending_procs_s
+ pdf14_nonseparable_blending_procs_t;
+
++
++/* This is used to so that we can change procedures based
++ * upon the Smask color space. previously we always
++ * went to the device space */
++
++typedef struct {
++
++ pdf14_nonseparable_blending_procs_t device_procs;
++ gx_device_procs color_mapping_procs;
++
++} pdf14_parent_cs_params_s;
++
++typedef pdf14_parent_cs_params_s pdf14_parent_cs_params_t;
++
++/* This function is used for mapping Smask CMYK or RGB data to a monochrome alpha buffer */
++
++void Smask_Luminosity_Mapping(int num_rows, int num_cols, int n_chan, int row_stride,
++ int plane_stride, byte *dst, const byte *src, bool isadditive,
++ bool SMask_is_CIE, gs_transparency_mask_subtype_t SMask_SubType);
++
++
+ /**
+ * art_blend_pixel: Compute PDF 1.4 blending function.
+ * @dst: Where to store resulting pixel.
+@@ -340,6 +362,12 @@ void pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ int x0, int x1, int y0, int y1, int n_chan, bool additive,
+ const pdf14_nonseparable_blending_procs_t * pblend_procs);
+
++gx_color_index pdf14_encode_smask_color(gx_device *dev,
++ const gx_color_value colors[], int ncomp);
++
++int pdf14_decode_smask_color(gx_device * dev, gx_color_index color,
++ gx_color_value * out, int ncomp);
++
+
+ gx_color_index pdf14_encode_color(gx_device *dev, const gx_color_value colors[]);
+
+diff --git a/base/gxblend1.c b/base/gxblend1.c
+--- a/base/gxblend1.c
++++ b/base/gxblend1.c
+@@ -24,6 +24,7 @@
+ #include "gdevdevn.h"
+ #include "gdevp14.h"
+ #include "vdtrace.h"
++#include "gxdcconv.h"
+
+ #ifdef DUMP_TO_PNG
+ #include "png_.h"
+@@ -32,8 +33,7 @@
+ /*
+ * Unpack a device color. This routine is similar to the device's
+ * decode_color procedure except for two things. The procedure produces 1
+- * byte values instead of gx_color_values (2 bytes) and the output values
+- * are inverted for subtractive color spaces (like CMYK). A separate
++ * byte values instead of gx_color_values (2 bytes). A separate
+ * procedure is used instead of the decode_color to minimize execution time.
+ */
+ void
+@@ -138,11 +138,14 @@ pdf14_unpack_custom(int num_comp, gx_color_index color,
+ out[i] = 0xff - gx_color_value_to_byte(cm_values[i]);
+ }
+
+-
++#if RAW_DUMP
++extern unsigned int global_index;
++#endif
+
+ void
+ pdf14_preserve_backdrop(pdf14_buf *buf, pdf14_buf *tos, bool has_shape)
+ {
++
+ /* make copy of backdrop for compositing */
+ int x0 = max(buf->rect.p.x, tos->rect.p.x);
+ int x1 = min(buf->rect.q.x, tos->rect.q.x);
+@@ -154,7 +157,8 @@ pdf14_preserve_backdrop(pdf14_buf *buf, pdf14_buf *tos, bool has_shape)
+ byte *buf_plane = buf->data + x0 - buf->rect.p.x + (y0 - buf->rect.p.y) * buf->rowstride;
+ byte *tos_plane = tos->data + x0 - tos->rect.p.x + (y0 - tos->rect.p.y) * tos->rowstride;
+ int i;
+- int n_chan_copy = buf->n_chan + (tos->has_shape ? 1 : 0);
++ /*int n_chan_copy = buf->n_chan + (tos->has_shape ? 1 : 0);*/
++ int n_chan_copy = tos->n_chan + (tos->has_shape ? 1 : 0);
+
+ for (i = 0; i < n_chan_copy; i++) {
+ byte *buf_ptr = buf_plane;
+@@ -172,8 +176,29 @@ pdf14_preserve_backdrop(pdf14_buf *buf, pdf14_buf *tos, bool has_shape)
+ if (has_shape && !tos->has_shape)
+ memset (buf_plane, 0, buf->planestride);
+ }
++
++
++#if RAW_DUMP
++
++ if (x0 < x1 && y0 < y1) {
++
++ byte *buf_plane = buf->data + x0 - buf->rect.p.x +
++ (y0 - buf->rect.p.y) * buf->rowstride;
++
++ dump_raw_buffer(y1-y0, x1 - x0, buf->n_planes,
++ buf->planestride, buf->rowstride,
++ "BackDropInit",buf_plane);
++
++ global_index++;
++
++ }
++
++#endif
++
+ }
+
++
++
+ void
+ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ int x0, int x1, int y0, int y1, int n_chan, bool additive,
+@@ -206,6 +231,9 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ int nos_shape_offset = n_chan * nos_planestride;
+ bool nos_has_shape = nos->has_shape;
+ byte *mask_tr_fn = NULL; /* Quiet compiler. */
++#if RAW_DUMP
++ byte *composed_ptr = NULL;
++#endif
+
+ rect_merge(nos->bbox, tos->bbox);
+
+@@ -224,6 +252,28 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ mask_tr_fn = maskbuf->transfer_fn;
+ }
+
++#if RAW_DUMP
++
++ composed_ptr = nos_ptr;
++
++ dump_raw_buffer(y1-y0, width, tos->n_planes,
++ tos_planestride, tos->rowstride,
++ "ImageTOS",tos_ptr);
++
++ dump_raw_buffer(y1-y0, width, nos->n_planes,
++ nos_planestride, nos->rowstride,
++ "ImageNOS",nos_ptr);
++
++ if(maskbuf != NULL){
++
++ dump_raw_buffer(y1-y0, width, maskbuf->n_planes,
++ maskbuf->planestride, maskbuf->rowstride,
++ "Mask",mask_ptr);
++ }
++
++#endif
++
++
+ for (y = y0; y < y1; ++y) {
+ for (x = 0; x < width; ++x) {
+ byte pix_alpha = alpha;
+@@ -244,28 +294,9 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ }
+
+ if (mask_ptr != NULL) {
+- int mask_alpha = mask_ptr[x + num_comp * mask_planestride];
++
++ byte mask = mask_ptr[x];
+ int tmp;
+- byte mask;
+-
+- /*
+- * The mask data is really monochrome. Thus for additive (RGB)
+- * we use the R channel for alpha since R = G = B. For
+- * subtractive (CMYK) we use the K channel.
+- */
+- if (mask_alpha == 255) {
+- /* todo: rgba->mask */
+- mask = additive ? mask_ptr[x]
+- : 255 - mask_ptr[x + 3 * mask_planestride];
+- } else if (mask_alpha == 0)
+- mask = mask_bg_alpha;
+- else {
+- int t2 = additive ? mask_ptr[x]
+- : 255 - mask_ptr[x + 3 * mask_planestride];
+-
+- t2 = (t2 - mask_bg_alpha) * mask_alpha + 0x80;
+- mask = mask_bg_alpha + ((t2 + (t2 >> 8)) >> 8);
+- }
+ mask = mask_tr_fn[mask];
+ tmp = pix_alpha * mask + 0x80;
+ pix_alpha = (tmp + (tmp >> 8)) >> 8;
+@@ -332,9 +363,62 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf,
+ if (mask_ptr != NULL)
+ mask_ptr += maskbuf->rowstride;
+ }
++
++
++ /* Lets look at composed result */
++
++
++#if RAW_DUMP
++
++ /* The group alpha should disappear */
++ dump_raw_buffer(y1-y0, width, tos->n_planes - tos->has_alpha_g,
++ nos_planestride, nos->rowstride,
++ "Composed",composed_ptr);
++
++ global_index++;
++
++
++#endif
++
+ }
+
+ /*
++ * Encode a list of smask colorant values into a gx_color_index_value.
++ * This has its own encoder as it may have a different number of colorants
++ * compared to the actual device.
++ */
++gx_color_index
++pdf14_encode_smask_color(gx_device *dev, const gx_color_value colors[],int ncomp)
++{
++ int drop = sizeof(gx_color_value) * 8 - 8;
++ gx_color_index color = 0;
++ int i;
++
++ for (i = 0; i < ncomp; i++) {
++ color <<= 8;
++ color |= (colors[i] >> drop);
++ }
++ return (color == gx_no_color_index ? color ^ 1 : color);
++}
++
++/*
++ * Decode a gx_color_index value back to a list of colorant values.
++ * This has its own decoder as it may have a different number of colorants
++ * compared to the actual device.*/
++int
++pdf14_decode_smask_color(gx_device * dev, gx_color_index color, gx_color_value * out, int ncomp)
++{
++ int i;
++
++ for (i = 0; i < ncomp; i++) {
++ out[ncomp - i - 1] = (gx_color_value) ((color & 0xff) * 0x101);
++ color >>= 8;
++ }
++ return 0;
++}
++
++
++/*
+ * Encode a list of colorant values into a gx_color_index_value.
+ */
+ gx_color_index
+diff --git a/base/gxccman.c b/base/gxccman.c
+--- a/base/gxccman.c
++++ b/base/gxccman.c
+@@ -333,9 +333,8 @@ gx_add_fm_pair(register gs_font_dir * dir, gs_font * font, const gs_uid * puid,
+ return code;
+ }
+ pair->FontType = font->FontType;
+- /* The OSF/1 compiler doesn't like casting a pointer to */
+- /* a shorter int.... */
+- pair->hash = (uint) (ulong) pair % 549; /* scramble bits */
++ pair->hash = (uint) (dir->hash % 549); /* scramble bits */
++ dir->hash += 371;
+ pair->mxx = mxx, pair->mxy = mxy;
+ pair->myx = myx, pair->myy = myy;
+ pair->num_chars = 0;
+diff --git a/base/gxchar.c b/base/gxchar.c
+--- a/base/gxchar.c
++++ b/base/gxchar.c
+@@ -33,10 +33,6 @@
+ #include "gzpath.h"
+ #include "gxfcid.h"
+
+-/* Define whether or not to cache characters rotated by angles other than */
+-/* multiples of 90 degrees. */
+-static const bool CACHE_ROTATED_CHARS = true;
+-
+ /* Define the maximum size of a full temporary bitmap when rasterizing, */
+ /* in bits (not bytes). */
+ static const uint MAX_TEMP_BITMAP_BITS = 80000;
+@@ -1429,22 +1425,6 @@ gs_show_current_font(const gs_show_enum * penum)
+
+ /* ------ Internal routines ------ */
+
+-static inline bool
+-is_matrix_good_for_caching(const gs_matrix_fixed *m)
+-{
+- /* Skewing or non-rectangular rotation are not supported,
+- but we ignore a small noise skew. */
+- const float axx = any_abs(m->xx), axy = any_abs(m->xy);
+- const float ayx = any_abs(m->yx), ayy = any_abs(m->yy);
+- const float thr = 5000; /* examples/alphabet.ps */
+-
+- if (ayx * thr < axx || axy * thr < ayy)
+- return true;
+- if (axx * thr < ayx || ayy * thr < axy)
+- return true;
+- return false;
+-}
+-
+ /* Initialize the gstate-derived parts of a show enumerator. */
+ /* We do this both when starting the show operation, */
+ /* and when returning from the kshow callout. */
+@@ -1476,9 +1456,6 @@ show_state_setup(gs_show_enum * penum)
+ gs_setcharmatrix(pgs, &mat);
+ }
+ penum->current_font = pfont;
+- /* Skewing or non-rectangular rotation are not supported. */
+- if (!CACHE_ROTATED_CHARS && is_matrix_good_for_caching(&pgs->char_tm))
+- penum->can_cache = 0;
+ if (penum->can_cache >= 0 &&
+ gx_effective_clip_path(pgs, &pcpath) >= 0
+ ) {
+@@ -1532,10 +1509,8 @@ show_set_scale(const gs_show_enum * penum, gs_log2_scale_point *log2_scale)
+
+ if ((penum->charpath_flag == cpm_show ||
+ penum->charpath_flag == cpm_charwidth) &&
+- SHOW_USES_OUTLINE(penum) &&
+- /* gx_path_is_void_inline(pgs->path) && */
+- /* Oversampling rotated characters doesn't work well. */
+- is_matrix_good_for_caching(&pgs->char_tm)
++ SHOW_USES_OUTLINE(penum)
++ /* && gx_path_is_void_inline(pgs->path) */
+ ) {
+ const gs_font_base *pfont = (const gs_font_base *)penum->current_font;
+ gs_fixed_point extent;
+diff --git a/base/gxcie.h b/base/gxcie.h
+--- a/base/gxcie.h
++++ b/base/gxcie.h
+@@ -52,6 +52,10 @@ extern int gx_cie_to_xyz_alloc(gs_imager_state **,
+ const gs_color_space *, gs_memory_t *);
+ extern void gx_cie_to_xyz_free(gs_imager_state *);
+
++
++extern int gx_cie_to_xyz_alloc2(gs_color_space * pcs, gs_state * pgs);
++
++
+ /* Defined in gsciemap.c */
+
+ /*
+diff --git a/base/gxclimag.c b/base/gxclimag.c
+--- a/base/gxclimag.c
++++ b/base/gxclimag.c
+@@ -475,7 +475,7 @@ clist_begin_typed_image(gx_device * dev,
+ * worthwhile.
+ */
+ gx_color_index all =
+- ((gx_color_index)1 << dev->color_info.depth) - 1;
++ ((gx_color_index)1 << cdev->clist_color_info.depth) - 1;
+
+ if (bits_per_pixel > 4 || pim->Interpolate || num_components > 1)
+ colors_used = all;
+@@ -536,13 +536,22 @@ clist_begin_typed_image(gx_device * dev,
+ return 0;
+
+ /*
+- * We couldn't handle the image. Use the default algorithms, which
++ * We couldn't handle the image. It is up to the caller to
++ * use the default algorithms, which
+ * break the image up into rectangles or small pixmaps.
++ * If we are doing the PDF14 transparency device
++ * then we want to make sure we do NOT use the target
++ * device. In this case we return -1.
+ */
+ use_default:
+ gs_free_object(mem, pie, "clist_begin_typed_image");
+- return gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
+- pdcolor, pcpath, mem, pinfo);
++
++ if (pis->has_transparency){
++ return -1;
++ } else {
++ return gx_default_begin_typed_image(dev, pis, pmat, pic, prect,
++ pdcolor, pcpath, mem, pinfo);
++ }
+ }
+
+ /* Error cleanup for clist_image_plane_data. */
+@@ -1488,7 +1497,7 @@ cmd_image_plane_data(gx_device_clist_writer * cldev, gx_clist_state * pcls,
+ code = cmd_put_set_data_x(cldev, pcls, data_x);
+ if (code < 0)
+ return code;
+- offset = ((data_x & ~7) * cldev->color_info.depth) >> 3;
++ offset = ((data_x & ~7) * cldev->clist_color_info.depth) >> 3;
+ }
+ code = set_cmd_put_op(dp, cldev, pcls, cmd_opv_image_data, len);
+ if (code < 0)
+diff --git a/base/gxclist.c b/base/gxclist.c
+--- a/base/gxclist.c
++++ b/base/gxclist.c
+@@ -190,7 +190,7 @@ clist_init_io_procs(gx_device_clist *pclist_dev, bool in_memory)
+ /* Initialization for imager state. */
+ /* The initial scale is arbitrary. */
+ const gs_imager_state clist_imager_state_initial =
+-{gs_imager_state_initial(300.0 / 72.0)};
++{gs_imager_state_initial(300.0 / 72.0, false)};
+
+ /*
+ * The buffer area (data, data_size) holds a bitmap cache when both writing
+@@ -358,6 +358,16 @@ clist_init_data(gx_device * dev, byte * init_data, uint data_size)
+ gx_device *pbdev = (gx_device *)&bdev;
+ int code;
+
++ /* the clist writer has its own color info that depends upon the
++ transparency group color space (if transparency exists). The data that is
++ used in the clist writing. Here it is initialized with
++ the target device color info. The values will be pushed and popped
++ in a stack if we have changing color spaces in the transparency groups. */
++
++ cdev->clist_color_info.depth = dev->color_info.depth;
++ cdev->clist_color_info.polarity = dev->color_info.polarity;
++ cdev->clist_color_info.num_components = dev->color_info.num_components;
++
+ /* Call create_buf_device to get the memory planarity set up. */
+ cdev->buf_procs.create_buf_device(&pbdev, target, 0, NULL, NULL, clist_get_band_complexity(0, 0));
+ /* HACK - if the buffer device can't do copy_alpha, disallow */
+diff --git a/base/gxclist.h b/base/gxclist.h
+--- a/base/gxclist.h
++++ b/base/gxclist.h
+@@ -281,6 +281,14 @@ struct gx_device_clist_writer_s {
+ uint mask_id;
+ uint temp_mask_id; /* Mask id of a mask of an image with SMask. */
+ bool is_fillpage;
++ gx_device_color_info clist_color_info; /* color information to be used during clist writing.
++ It may be different than the target device if we
++ are in a transparency group. Since the fill rect
++ commands use the forward procs and we have no
++ access to the graphic state information in those
++ routines, this is the logical place to put this
++ information */
++
+ };
+ #ifndef gx_device_clist_writer_DEFINED
+ #define gx_device_clist_writer_DEFINED
+diff --git a/base/gxclpath.c b/base/gxclpath.c
+--- a/base/gxclpath.c
++++ b/base/gxclpath.c
+@@ -55,7 +55,7 @@ colored_halftone_colors_used(gx_device_clist_writer *cldev,
+ * standard CMYK color mapping function.
+ */
+ if (dev_proc(cldev, map_cmyk_color) != cmyk_1bit_map_cmyk_color)
+- return ((gx_color_index)1 << cldev->color_info.depth) - 1;
++ return ((gx_color_index)1 << cldev->color_info.depth) - 1; /* What about tranparency? Need to check this */
+ /*
+ * Note that c_base[0], and the low-order bit of plane_mask,
+ * correspond to cyan: this requires reversing the bit order of
+@@ -186,7 +186,7 @@ cmd_put_drawing_color(gx_device_clist_writer * cldev, gx_clist_state * pcls,
+ }
+ }
+
+- while (left) {
++ do {
+ prefix_size = 2 + 1 + (offset > 0 ? enc_u_sizew(offset) : 0);
+ req_size = left + prefix_size + enc_u_sizew(left);
+ code = cmd_get_buffer_space(cldev, pcls, req_size);
+@@ -223,10 +223,10 @@ cmd_put_drawing_color(gx_device_clist_writer * cldev, gx_clist_state * pcls,
+ }
+ offset += portion_size;
+ left -= portion_size;
+- }
++ } while (left);
+
+ /* should properly calculate colors_used, but for now just punt */
+- pcls->colors_used.or = ((gx_color_index)1 << cldev->color_info.depth) - 1;
++ pcls->colors_used.or = ((gx_color_index)1 << cldev->clist_color_info.depth) - 1;
+
+ /* Here we can't know whether a pattern paints colors besides
+ black and white, so assume that it does.
+@@ -273,7 +273,7 @@ cmd_drawing_colors_used(gx_device_clist_writer *cldev,
+ else if (gx_dc_is_colored_halftone(pdcolor))
+ return colored_halftone_colors_used(cldev, pdcolor);
+ else
+- return ((gx_color_index)1 << cldev->color_info.depth) - 1;
++ return ((gx_color_index)1 << cldev->clist_color_info.depth) - 1;
+ }
+
+
+diff --git a/base/gxclrast.c b/base/gxclrast.c
+--- a/base/gxclrast.c
++++ b/base/gxclrast.c
+@@ -172,6 +172,12 @@ top_up_cbuf(command_buf_t *pcb, const byte **pcbp)
+ pcb->end_status = sgets(pcb->s, cb_top, nread, &nread);
+ if ( nread == 0 ) {
+ /* No data for this band at all. */
++ if (cb_top >= pcb->end) {
++ /* should not happen */
++ *pcbp = pcb->data;
++ pcb->data[0] = cmd_opv_end_run;
++ return_error(gs_error_ioerror);
++ }
+ *cb_top = cmd_opv_end_run;
+ nread = 1;
+ }
+@@ -619,7 +625,7 @@ in: /* Initialize for a new page. */
+ /* Make sure the buffer contains a full command. */
+ if (cbp >= cbuf.limit) {
+ if (cbuf.end_status < 0) { /* End of file or error. */
+- if (cbp == cbuf.end) {
++ if (cbp >= cbuf.end) {
+ code = (cbuf.end_status == EOFC ? 0 :
+ gs_note_error(gs_error_ioerror));
+ break;
+diff --git a/base/gxclrect.c b/base/gxclrect.c
+--- a/base/gxclrect.c
++++ b/base/gxclrect.c
+@@ -166,7 +166,7 @@ cmd_write_page_rect_cmd(gx_device_clist_writer * cldev, int op)
+ static inline byte *
+ cmd_put_frac31_color(gx_device_clist_writer * cldev, const frac31 *c, byte *dp)
+ {
+- int num_components = cldev->color_info.num_components;
++ int num_components = cldev->clist_color_info.num_components;
+ int j;
+
+ for (j = 0; j < num_components; j++)
+@@ -178,7 +178,7 @@ static inline int
+ cmd_size_frac31_color(gx_device_clist_writer * cldev, const frac31 *c)
+ {
+ int j, s = 0;
+- int num_components = cldev->color_info.num_components;
++ int num_components = cldev->clist_color_info.num_components;
+
+ for (j = 0; j < num_components; j++)
+ s += cmd_size_frac31(c[j]);
+@@ -494,7 +494,7 @@ clist_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tile,
+ &((gx_device_clist *)dev)->writer;
+ int depth =
+ (color1 == gx_no_color_index && color0 == gx_no_color_index ?
+- dev->color_info.depth : 1);
++ cdev->clist_color_info.depth : 1);
+ gx_color_index colors_used =
+ (color1 == gx_no_color_index && color0 == gx_no_color_index ?
+ /* We can't know what colors will be used: assume the worst. */
+@@ -695,7 +695,8 @@ clist_copy_color(gx_device * dev,
+ {
+ gx_device_clist_writer * const cdev =
+ &((gx_device_clist *)dev)->writer;
+- int depth = dev->color_info.depth;
++ int depth = cdev->clist_color_info.depth; /* Could be different than target
++ if 1.4 device */
+ int y0;
+ int data_x_bit;
+ /* We can't know what colors will be used: assume the worst. */
+@@ -946,8 +947,8 @@ clist_strip_copy_rop(gx_device * dev,
+ const gx_strip_bitmap *tiles = textures;
+ int y0;
+ /* Compute the set of possible colors that this operation can generate. */
+- gx_color_index all = ((gx_color_index)1 << dev->color_info.depth) - 1;
+- bool subtractive = dev->color_info.num_components == 4; /****** HACK ******/
++ gx_color_index all = ((gx_color_index)1 << cdev->clist_color_info.depth) - 1;
++ bool subtractive = dev->color_info.num_components >= 4; /****** HACK ******/
+ gx_color_index S =
+ (scolors ? scolors[0] | scolors[1] : sdata ? all : 0);
+ gx_color_index T =
+@@ -1017,7 +1018,7 @@ clist_strip_copy_rop(gx_device * dev,
+ do {
+ code = clist_change_tile(cdev, re.pcls, tiles,
+ (tcolors != 0 ? 1 :
+- dev->color_info.depth));
++ cdev->clist_color_info.depth));
+ } while (RECT_RECOVER(code));
+ if (code < 0 && !(code == gs_error_limitcheck) && SET_BAND_CODE(code))
+ goto error_in_rect;
+@@ -1062,7 +1063,7 @@ clist_strip_copy_rop(gx_device * dev,
+ when tile_space_phase < rep_width && tile_space_phase + rwidth > rep_width,
+ each line to be converted into 2 ones.
+ */
+- int depth = dev->color_info.depth;
++ int depth = cdev->clist_color_info.depth;
+
+ # if 0
+ /* Align bitmap data : */
+diff --git a/base/gxclutil.c b/base/gxclutil.c
+--- a/base/gxclutil.c
++++ b/base/gxclutil.c
+@@ -500,7 +500,8 @@ cmd_put_color(gx_device_clist_writer * cldev, gx_clist_state * pcls,
+ return code;
+ } else {
+ /* Check if the "delta" mode command can be used. */
+- int num_bytes = (cldev->color_info.depth + 7) >> 3;
++ int num_bytes = (cldev->clist_color_info.depth + 7) >> 3; /* clist_color_info may be different than target device
++ due to transparency group during clist writing phase */
+ int delta_bytes = (num_bytes + 1) / 2;
+ gx_color_index delta_offset = cmd_delta_offsets[num_bytes];
+ gx_color_index delta_mask = cmd_delta_masks[num_bytes];
+diff --git a/base/gxcpath.c b/base/gxcpath.c
+--- a/base/gxcpath.c
++++ b/base/gxcpath.c
+@@ -782,6 +782,7 @@ gx_cpath_enum_init(gs_cpath_enum * penum, const gx_clip_path * pcpath)
+ if ((penum->using_path = pcpath->path_valid)) {
+ gx_path_enum_init(&penum->path_enum, &pcpath->path);
+ penum->rp = penum->visit = 0;
++ penum->first_visit = visit_left;
+ } else {
+ gx_path empty_path;
+ gx_clip_list *clp = gx_cpath_list_private(pcpath);
+@@ -791,6 +792,7 @@ gx_cpath_enum_init(gs_cpath_enum * penum, const gx_clip_path * pcpath)
+ /* Initialize the pointers in the path_enum properly. */
+ gx_path_init_local(&empty_path, pcpath->path.memory);
+ gx_path_enum_init(&penum->path_enum, &empty_path);
++ penum->first_visit = visit_left;
+ penum->visit = head;
+ for (rp = head; rp != 0; rp = rp->next)
+ rp->to_visit =
+diff --git a/base/gxdcolor.c b/base/gxdcolor.c
+--- a/base/gxdcolor.c
++++ b/base/gxdcolor.c
+@@ -717,11 +717,14 @@ gx_dc_write_color(
+ uint * psize )
+ {
+ int depth = dev->color_info.depth;
+- int num_bytes = (depth + 8) >> 3; /* NB: +8, not +7 */
++ int num_bytes; /* NB: +8, not +7 */
+
+ /* gx_no_color_index is encoded as a single byte */
+- if (color == gx_no_color_index)
++ if (color == gx_no_color_index) {
+ num_bytes = 1;
++ } else {
++ num_bytes = sizeof(gx_color_index) + 1;
++ }
+
+ /* check for adequate space */
+ if (*psize < num_bytes) {
+@@ -735,8 +738,6 @@ gx_dc_write_color(
+ *psize = 1;
+ *pdata = 0xff;
+ } else {
+- if (depth < 8 * arch_sizeof_color_index)
+- color &= ((gx_color_index)1 << depth) - 1;
+ while (--num_bytes >= 0) {
+ pdata[num_bytes] = color & 0xff;
+ color >>= 8;
+@@ -763,6 +764,7 @@ gx_dc_write_color(
+ *
+ * Returns: # of bytes read, or < 0 in the event of an error
+ */
++
+ int
+ gx_dc_read_color(
+ gx_color_index * pcolor,
+@@ -771,21 +773,22 @@ gx_dc_read_color(
+ int size )
+ {
+ gx_color_index color = 0;
+- int depth = dev->color_info.depth;
+- int i, num_bytes = (depth + 8) >> 3; /* NB: +8, not +7 */
++ int i, num_bytes;
+
+ /* check that enough data has been provided */
+- if (size < 1 || (pdata[0] != 0xff && size < num_bytes))
++ if (size < 1 || (pdata[0] != 0xff && size < sizeof(gx_color_index)))
+ return_error(gs_error_rangecheck);
+
+ /* check of gx_no_color_index */
+ if (pdata[0] == 0xff) {
+ *pcolor = gx_no_color_index;
+ return 1;
++ } else {
++ num_bytes = sizeof(gx_color_index) + 1;
+ }
+
+ /* num_bytes > arch_sizeof_color_index, discard first byte */
+- for (i = (num_bytes >= arch_sizeof_color_index ? 1 : 0); i < num_bytes; i++)
++ for (i = 0; i < num_bytes; i++)
+ color = (color << 8) | pdata[i];
+ *pcolor = color;
+ return num_bytes;
+diff --git a/base/gxdevcli.h b/base/gxdevcli.h
+--- a/base/gxdevcli.h
++++ b/base/gxdevcli.h
+@@ -1198,6 +1198,7 @@ typedef struct gs_param_list_s gs_param_list;
+ */
+ #define dev_t_proc_end_transparency_mask(proc, dev_t)\
+ int proc(gx_device *dev,\
++ gs_imager_state *pis,\
+ gs_transparency_mask_t **pptm)
+ #define dev_proc_end_transparency_mask(proc)\
+ dev_t_proc_end_transparency_mask(proc, gx_device)
+diff --git a/base/gxfapiu.c b/base/gxfapiu.c
+--- a/base/gxfapiu.c
++++ b/base/gxfapiu.c
+@@ -31,7 +31,7 @@
+
+ /* -------------------- UFST callback dispatcher ------------- */
+
+-/* This code provides dispatching UFST callbacks to the PDL */
++/* This code provides dispatching UFST callbacks to the PDL */
+
+ struct IF_STATE;
+
+diff --git a/base/gxfapiu.h b/base/gxfapiu.h
+--- a/base/gxfapiu.h
++++ b/base/gxfapiu.h
+@@ -20,7 +20,7 @@
+ #include "gp.h"
+
+ /* Set UFST callbacks. */
+-/* Warning : the language switch progect doesn't guarantee
++/* Warning : the language switch project doesn't guarantee
+ that this function is called when switching
+ to another interpreter. Therefore each interpreter must take
+ care for its own callback methods before they
+@@ -29,7 +29,7 @@
+ /* Warning : this function may cause a reentrancy problem
+ due to a modification of static variables.
+ Nevertheless this problem isn't important in a
+- sngle interpreter build because the values
++ single interpreter build because the values
+ really change on the first demand only.
+ See also a comment in gs_fapiufst_finit.
+ */
+diff --git a/base/gxfcache.h b/base/gxfcache.h
+--- a/base/gxfcache.h
++++ b/base/gxfcache.h
+@@ -300,6 +300,8 @@ struct gs_font_dir_s {
+ uint enum_index; /* index (N) */
+ uint enum_offset; /* ccache.table[offset] is N'th non-zero entry */
+
++ uint hash;
++
+ /* User parameter AlignToPixels. */
+ bool align_to_pixels;
+
+diff --git a/base/gxfcopy.c b/base/gxfcopy.c
+--- a/base/gxfcopy.c
++++ b/base/gxfcopy.c
+@@ -1976,7 +1976,11 @@ gs_copy_font(gs_font *font, const gs_matrix *orig_matrix, gs_memory_t *mem, gs_f
+ memset(&info, 0, sizeof(info));
+ info.Flags_requested = ~0;
+ code = font->procs.font_info(font, NULL, ~0, &info);
+- if (code < 0)
++
++ /* We can ignore a lack of FontInfo for TrueType fonts which
++ * are descendants of CID fonts
++ */
++ if (code < 0 && !(font->FontType == ft_CID_TrueType))
+ return code;
+
+ /* Allocate the generic copied information. */
+diff --git a/base/gxfixed.h b/base/gxfixed.h
+--- a/base/gxfixed.h
++++ b/base/gxfixed.h
+@@ -22,12 +22,23 @@
+ * quantities: integers lose accuracy in crucial places,
+ * and floating point arithmetic is slow.
+ */
++#if ARCH_SIZEOF_INT == 4
++typedef int fixed;
++typedef uint ufixed; /* only used in a very few places */
++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_INT
++# define max_fixed max_int
++# define min_fixed min_int
++#else
++# if ARCH_SIZEOF_LONG == 4
+ typedef long fixed;
+ typedef ulong ufixed; /* only used in a very few places */
+-#define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG
++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG
++# define max_fixed max_long
++# define min_fixed min_long
++# endif
++#endif
++
+
+-#define max_fixed max_long
+-#define min_fixed min_long
+ #define fixed_0 0L
+ #define fixed_epsilon 1L
+ /*
+@@ -119,13 +130,9 @@ typedef ulong ufixed; /* only used in a very few places */
+ #define fixed_truncated(x) ((x) < 0 ? fixed_ceiling(x) : fixed_floor(x))
+
+ /* Define the largest and smallest integer values that fit in a fixed. */
+-#if arch_sizeof_int == arch_sizeof_long
+-# define max_int_in_fixed fixed2int(max_fixed)
+-# define min_int_in_fixed fixed2int(min_fixed)
+-#else
+-# define max_int_in_fixed max_int
+-# define min_int_in_fixed min_int
+-#endif
++#define max_int_in_fixed fixed2int(max_fixed)
++#define min_int_in_fixed fixed2int(min_fixed)
++
+ /*
+ * Define a macro for checking for overflow of the sum of two fixed values
+ * and and setting the result to the sum if no overflow.
+diff --git a/base/gxhldevc.c b/base/gxhldevc.c
+--- a/base/gxhldevc.c
++++ b/base/gxhldevc.c
+@@ -44,10 +44,9 @@ void gx_hld_saved_color_init(gx_hl_saved_color * psc)
+ */
+ const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis)
+ {
+- extern_st(st_gs_state); /* only for testing */
+
+- /* Check to verify the structure type is really st_gs_state */
+- if (pis == NULL || gs_object_type(pis->memory, pis) != &st_gs_state)
++ /* Check to verify the structure type is really (gs_state *) */
++ if (pis == NULL || pis->is_gstate == false)
+ return NULL;
+
+ return (const gs_state *) pis;
+diff --git a/base/gximag3x.c b/base/gximag3x.c
+--- a/base/gximag3x.c
++++ b/base/gximag3x.c
+@@ -599,8 +599,20 @@ gx_image3x_plane_data(gx_image_enum_common_t * info,
+ h = min(height, h1);
+ /* Initialized rows_used in case we get an error. */
+ *rows_used = 0;
++
++/* FIX_ME. In the soft mask branch
++ the file associated with bug 689290
++ gets into an endless loop. This
++ is related to the size mismatch of the
++ soft mask which is 1x1 and the
++ image size */
++
+ if (h <= 0)
++#ifdef ENDLESS_LOOP
+ return 0;
++#else
++ return 1;
++#endif
+
+ /* Handle masks from separate sources. */
+ for (i = 0; i < NUM_MASKS; ++i)
+diff --git a/base/gxiodev.h b/base/gxiodev.h
+--- a/base/gxiodev.h
++++ b/base/gxiodev.h
+@@ -175,6 +175,12 @@ int gs_putdevparams(gx_io_device *, gs_param_list *);
+ /* if opening a file fails. */
+ int gs_fopen_errno_to_code(int);
+
++/* Interface functions for clients that want iodev independent access to */
++/* the gp_enumerate functions */
++file_enum *gs_enumerate_files_init(const char *pat, uint patlen, gs_memory_t * mem);
++uint gs_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen);
++void gs_enumerate_files_close(file_enum * pfen);
++
+ /* Test whether a string is equal to a character. */
+ /* (This is used for access testing in file_open procedures.) */
+ #define streq1(str, chr)\
+diff --git a/base/gxistate.h b/base/gxistate.h
+--- a/base/gxistate.h
++++ b/base/gxistate.h
+@@ -215,6 +215,7 @@ typedef struct gs_devicen_color_map_s {
+ * than &pis->ctm.
+ */
+ #define gs_imager_state_common\
++ bool is_gstate; /* is this imager state part of gstate ? */\
+ gs_memory_t *memory;\
+ void *client_data;\
+ gx_line_params line_params;\
+@@ -231,6 +232,8 @@ typedef struct gs_devicen_color_map_s {
+ bool text_knockout;\
+ uint text_rendering_mode;\
+ gs_transparency_state_t *transparency_stack;\
++ bool has_transparency; /* used to keep from doing shading fills in device color space */\
++ gx_device *trans_device; /* trans device has all mappings to group color space */\
+ bool overprint;\
+ int overprint_mode;\
+ int effective_overprint_mode;\
+@@ -246,7 +249,7 @@ typedef struct gs_devicen_color_map_s {
+ (*get_cmap_procs)(const gs_imager_state *, const gx_device *);\
+ gs_color_rendering_state_common
+ #define st_imager_state_num_ptrs\
+- (st_line_params_num_ptrs + st_cr_state_num_ptrs + 2)
++ (st_line_params_num_ptrs + st_cr_state_num_ptrs + 3)
+ /* Access macros */
+ #define ctm_only(pis) (*(const gs_matrix *)&(pis)->ctm)
+ #define ctm_only_writable(pis) (*(gs_matrix *)&(pis)->ctm)
+@@ -267,12 +270,12 @@ struct gs_imager_state_s {
+ };
+
+ /* Initialization for gs_imager_state */
+-#define gs_imager_state_initial(scale)\
+- 0, 0, { gx_line_params_initial },\
++#define gs_imager_state_initial(scale, is_gstate)\
++ is_gstate, 0, 0, { gx_line_params_initial },\
+ { (float)(scale), 0.0, 0.0, (float)(-(scale)), 0.0, 0.0 },\
+ false, {0, 0}, {0, 0}, false, \
+ lop_default, gx_max_color_value, BLEND_MODE_Compatible,\
+- { 1.0 }, { 1.0 }, 0, 0/*false*/, 0, 0, 0/*false*/, 0, 0, 1.0, \
++ { 1.0 }, { 1.0 }, 0, 0/*false*/, 0, 0, 0, 0, 0/*false*/, 0, 0, 1.0, \
+ { fixed_half, fixed_half }, 0/*false*/, 0/*false*/, 0/*false*/, 1.0,\
+ 1, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \
+ gx_default_get_cmap_procs
+diff --git a/base/gxpcmap.c b/base/gxpcmap.c
+--- a/base/gxpcmap.c
++++ b/base/gxpcmap.c
+@@ -886,13 +886,24 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis,
+ if (saved->pattern_cache == 0)
+ saved->pattern_cache = pis->pattern_cache;
+ gs_setdevice_no_init(saved, (gx_device *)adev);
++ if (pinst->template.uses_transparency) {
++ /* This should not occur from PS or PDF, but is provided for other clients (XPS) */
++ if_debug0('v', "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n");
++ if ((code = gs_push_pdf14trans_device(saved)) < 0)
++ return code;
++ }
+ code = (*pinst->template.PaintProc)(&pdc->ccolor, saved);
+ if (code < 0) {
+ dev_proc(adev, close_device)((gx_device *)adev);
+- /* Freeing the state will free the device. */
++ /* Freeing the state will free the device and the pdf14 compositor (if any). */
+ gs_state_free(saved);
+ return code;
+ }
++ if (pinst->template.uses_transparency) {
++ if_debug0('v', "gx_pattern_load: popping the pdf14 compositor device from this graphics state\n");
++ if ((code = gs_pop_pdf14trans_device(saved)) < 0)
++ return code;
++ }
+ /* We REALLY don't like the following cast.... */
+ code = gx_pattern_cache_add_entry((gs_imager_state *)pis,
+ adev, &ctile);
+diff --git a/base/gxshade6.c b/base/gxshade6.c
+--- a/base/gxshade6.c
++++ b/base/gxshade6.c
+@@ -190,6 +190,8 @@ is_linear_color_applicable(const patch_fill_state_t *pfs)
+ return false;
+ if (pfs->dev->color_info.separable_and_linear != GX_CINFO_SEP_LIN)
+ return false;
++ if (pfs->pis->has_transparency == true)
++ return false; /* set in pdf14 dev if we are in a trans group */
+ if (gx_get_cmap_procs(pfs->pis, pfs->dev)->is_halftoned(pfs->pis, pfs->dev))
+ return false;
+ return true;
+diff --git a/base/gxtype1.c b/base/gxtype1.c
+--- a/base/gxtype1.c
++++ b/base/gxtype1.c
+@@ -573,7 +573,12 @@ gs_type1_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat,
+ code = pdata->interpret(&cis, &gdata, &value);
+ switch (code) {
+ case 0: /* done with no [h]sbw, error */
+- code = gs_note_error(gs_error_invalidfont);
++ /* Adobe interpreters ignore the error! */
++ info->width[wmode].x = 0;
++ info->width[wmode].y = 0;
++ info->v.x = 0;
++ info->v.y = 0;
++ break;
+ default: /* code < 0, error */
+ return code;
+ case type1_result_callothersubr: /* unknown OtherSubr */
+diff --git a/base/lib.mak b/base/lib.mak
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -450,6 +450,7 @@ gxpcolor_h=$(GLSRC)gxpcolor.h\
+ gscolor_h=$(GLSRC)gscolor.h $(gxtmap_h)
+ gsstate_h=$(GLSRC)gsstate.h\
+ $(gscolor_h) $(gscpm_h) $(gscsel_h) $(gsdevice_h) $(gsht_h) $(gsline_h)
++gscolorbuffer_h=$(GLSRC)gscolorbuffer.h
+
+ gzacpath_h=$(GLSRC)gzacpath.h $(GLSRC)gxcpath.h
+ gzcpath_h=$(GLSRC)gzcpath.h $(gxcpath_h) $(gzpath_h)
+@@ -1314,7 +1315,7 @@ $(GLOBJ)sdcte.$(OBJ) : $(GLSRC)sdcte.c $(AK)\
+ $(GLOBJ)sjpege.$(OBJ) : $(GLSRC)sjpege.c $(AK)\
+ $(stdio__h) $(string__h) $(gx_h)\
+ $(jerror__h) $(jpeglib__h)\
+- $(gserrors_h) $(sjpeg_h) $(sdct_h) $(strimpl_h)
++ $(sjpeg_h) $(sdct_h) $(strimpl_h)
+ $(GLJCC) $(GLO_)sjpege.$(OBJ) $(C_) $(GLSRC)sjpege.c
+
+ # sdeparam is used by the filter operator and the PS/PDF writer.
+@@ -1344,7 +1345,7 @@ $(GLOBJ)sdctd.$(OBJ) : $(GLSRC)sdctd.c $(AK)\
+ $(GLOBJ)sjpegd.$(OBJ) : $(GLSRC)sjpegd.c $(AK)\
+ $(stdio__h) $(string__h) $(gx_h)\
+ $(jerror__h) $(jpeglib__h)\
+- $(gserrors_h) $(sjpeg_h) $(sdct_h) $(strimpl_h)
++ $(sjpeg_h) $(sdct_h) $(strimpl_h)
+ $(GLJCC) $(GLO_)sjpegd.$(OBJ) $(C_) $(GLSRC)sjpegd.c
+
+ # sddparam is used by the filter operator.
+@@ -1471,7 +1472,7 @@ $(GLD)sjpx_jasper.dev : $(LIB_MAK) $(ECHOGS_XE) \
+ # jasper.dev is created in jasper.mak
+
+ $(GLOBJ)sjpx.$(OBJ) : $(GLSRC)sjpx.c $(AK) \
+- $(memory__h) $(gsmalloc_h) $(gserror_h) $(gserrors_h) \
++ $(memory__h) $(gsmalloc_h) $(gserror_h) \
+ $(gdebug_h) $(strimpl_h) $(sjpx_h)
+ $(GLJASCC) $(GLO_)sjpx.$(OBJ) $(C_) $(GLSRC)sjpx.c
+
+@@ -2477,6 +2478,12 @@ $(GLOBJ)gsncdummy.$(OBJ) : $(GLSRC)gsncdummy.c $(GXERR) $(math__h)\
+ $(memory__h) $(gscdefs_h) $(gscspace_h) $(gscie_h) $(gsicc_h)\
+ $(gxdevice_h) $(gzstate_h) $(gsutil_h) $(gxcie_h) $(gsncdummy_h)
+ $(GLCC) $(GLO_)gsncdummy.$(OBJ) $(C_) $(GLSRC)gsncdummy.c
++
++# ---------------- Color Buffer Proc. Support Used In Trans. ---------------- #
++
++$(GLOBJ)gscolorbuffer.$(OBJ) : $(GLSRC)gscolorbuffer.c $(GXERR)\
++ $(stdpre_h) $(gstypes_h) $(gsmemory_h) $(gxblend_h)
++ $(GLCC) $(GLO_)gscolorbuffer.$(OBJ) $(C_) $(GLSRC)gscolorbuffer.c
+
+ # ================ Display Postscript extensions ================ #
+
+@@ -2560,15 +2567,15 @@ $(GLD)traplib.dev : $(LIB_MAK) $(ECHOGS_XE) $(traplib_)
+
+ # ---------------- Transparency ---------------- #
+
+-gstrans_h=$(GLSRC)gstrans.h $(gstparam_h) $(gxcomp_h) $(gsmatrix_h)
++gstrans_h=$(GLSRC)gstrans.h $(gstparam_h) $(gxcomp_h) $(gsmatrix_h) $(gxblend_h)
+ gsipar3x_h=$(GLSRC)gsipar3x.h $(gsiparam_h) $(gsiparm3_h)
+ gximag3x_h=$(GLSRC)gximag3x.h $(gsipar3x_h) $(gxiparam_h)
+-gxblend_h=$(GLSRC)gxblend.h $(gxcindex_h) $(gxcvalue_h) $(gxxfrac_h)
++gxblend_h=$(GLSRC)gxblend.h $(gxcindex_h) $(gxcvalue_h) $(gxxfrac_h) $(gxdevcli_h)
+ gdevp14_h=$(GLSRC)gdevp14.h $(GLSRC)gxcmap.h
+
+ $(GLOBJ)gstrans.$(OBJ) : $(GLSRC)gstrans.c $(GXERR)\
+- $(math__h) $(memory__h) $(gdevp14_h)\
+- $(gstrans_h) $(gsutil_h) $(gxdevcli_h) $(gzstate_h)
++ $(math__h) $(memory__h) $(gdevp14_h) $(gstrans_h)\
++ $(gsutil_h) $(gxdevcli_h) $(gzstate_h) $(gscspace_h)
+ $(GLCC) $(GLO_)gstrans.$(OBJ) $(C_) $(GLSRC)gstrans.c
+
+ $(GLOBJ)gximag3x.$(OBJ) : $(GLSRC)gximag3x.c $(GXERR) $(math__h) $(memory__h)\
+@@ -2578,24 +2585,25 @@ $(GLOBJ)gximag3x.$(OBJ) : $(GLSRC)gximag3x.c $(GXERR) $(math__h) $(memory__h)\
+ $(GLCC) $(GLO_)gximag3x.$(OBJ) $(C_) $(GLSRC)gximag3x.c
+
+ $(GLOBJ)gxblend.$(OBJ) : $(GLSRC)gxblend.c $(GX) $(memory__h)\
+- $(gstparam_h) $(gxblend_h)
++ $(gstparam_h) $(gxblend_h) $(gxcolor2_h)
+ $(GLCC) $(GLO_)gxblend.$(OBJ) $(C_) $(GLSRC)gxblend.c
+
+ $(GLOBJ)gxblend1.$(OBJ) : $(GLSRC)gxblend1.c $(GX) $(memory__h)\
+ $(gstparam_h) $(gxrect_h) $(gxdcconv_h) $(gxblend_h) $(gxdevcli_h) $(gxistate_h)\
+- $(gdevdevn_h) $(gdevp14_h) $(vdtrace_h)
++ $(gdevdevn_h) $(gdevp14_h) $(vdtrace_h) $(gxdcconv_h)
+ $(GLCC) $(GLO_)gxblend1.$(OBJ) $(C_) $(GLSRC)gxblend1.c
+
+ $(GLOBJ)gdevp14.$(OBJ) : $(GLSRC)gdevp14.c $(GXERR) $(math__h) $(memory__h)\
+ $(gscdefs_h) $(gxdevice_h) $(gsdevice_h) $(gsstruct_h) $(gscoord_h) $(gxistate_h) $(gxdcolor_h)\
+ $(gxiparam_h) $(gstparam_h) $(gxblend_h) $(gxtext_h) $(gsdfilt_h) $(gsimage_h)\
+ $(gsrect_h) $(gzstate_h) $(gdevdevn_h) $(gdevp14_h) $(gsovrc_h) $(gxcmap_h) $(gscolor1_h)\
+- $(gstrans_h) $(gsutil_h) $(gxcldev_h) $(gxclpath_h) $(gxdcconv_h) $(vdtrace_h)
++ $(gstrans_h) $(gsutil_h) $(gxcldev_h) $(gxclpath_h) $(gxdcconv_h) $(vdtrace_h)\
++ $(gscolorbuffer_h) $(gsptype2_h)
+ $(GLCC) $(GLO_)gdevp14.$(OBJ) $(C_) $(GLSRC)gdevp14.c
+
+ translib_=$(GLOBJ)gstrans.$(OBJ) $(GLOBJ)gximag3x.$(OBJ)\
+ $(GLOBJ)gxblend.$(OBJ) $(GLOBJ)gxblend1.$(OBJ) $(GLOBJ)gdevp14.$(OBJ) $(GLOBJ)gdevdevn.$(OBJ)\
+- $(GLOBJ)gdevdcrd.$(OBJ)
++ $(GLOBJ)gdevdcrd.$(OBJ) $(GLOBJ)gscolorbuffer.$(OBJ)
+ $(GLD)translib.dev : $(LIB_MAK) $(ECHOGS_XE) $(translib_)\
+ $(GLD)cspixlib.dev $(GLD)bboxutil.dev $(GLD)cielib.dev
+ $(SETMOD) $(GLD)translib $(translib_)
+diff --git a/base/lwf_jp2.mak b/base/lwf_jp2.mak
+--- a/base/lwf_jp2.mak
++++ b/base/lwf_jp2.mak
+@@ -171,7 +171,6 @@ lwf_jp2_HDRS = \
+ $(LWF_JP2_SRC)jp2t_memory.h \
+ $(LWF_JP2_SRC)jp2t_progression.h \
+ $(LWF_JP2_SRC)jp2t_transcoder.h \
+- $(LWF_JP2_SRC)lwf_jp2_geo.h \
+ $(LWF_JP2_SRC)lwf_jp2.h
+
+ # switch in the selected library .dev
+diff --git a/base/saes.h b/base/saes.h
+--- a/base/saes.h
++++ b/base/saes.h
+@@ -47,8 +47,9 @@ int s_aes_set_key(stream_aes_state * state,
+ /* state declaration macro;
+ should be updated for the aes_context finalization */
+ #define private_st_aes_state() \
+- gs_private_st_simple(st_aes_state, stream_aes_state,\
+- "aes filter state")
++ gs_private_st_ptrs1(st_aes_state, stream_aes_state, "aes filter state",\
++ aes_state_enum_ptrs, aes_state_reloc_ptrs, ctx)
++
+ extern const stream_template s_aes_template;
+
+ /* (de)crypt a section of text in a buffer -- the procedure is the same
+diff --git a/base/sfxcommon.c b/base/sfxcommon.c
+--- a/base/sfxcommon.c
++++ b/base/sfxcommon.c
+@@ -75,8 +75,13 @@ file_open_stream(const char *fname, uint len, const char *file_access,
+ return 0; /* so this is the same as len == 0, so return NULL */
+ code = (*fopen_proc)(iodev, (char *)(*ps)->cbuf, fmode, &file,
+ (char *)(*ps)->cbuf, (*ps)->bsize);
+- if (code < 0)
++ if (code < 0) {
++ /* discard the stuff we allocated to keep from accumulating stuff needing GC */
++ gs_free_object(mem, (*ps)->cbuf, "file_close(buffer)");
++ gs_free_object(mem, *ps, "file_prepare_stream(stream)");
++ *ps = NULL;
+ return code;
++ }
+ file_init_stream(*ps, file, fmode, (*ps)->cbuf, (*ps)->bsize);
+ return 0;
+ }
+@@ -181,6 +186,7 @@ file_prepare_stream(const char *fname, uint len, const char *file_access,
+ buffer[0] = 0; /* safety */
+ s->cbuf = buffer;
+ s->bsize = s->cbsize = buffer_size;
++ s->save_close = 0; /* in case this stream gets disabled before init finishes */
+ *ps = s;
+ return 0;
+ }
+diff --git a/base/sjpegd.c b/base/sjpegd.c
+--- a/base/sjpegd.c
++++ b/base/sjpegd.c
+@@ -18,7 +18,6 @@
+ #include "jpeglib_.h"
+ #include "jerror_.h"
+ #include "gx.h"
+-#include "gserrors.h"
+ #include "strimpl.h"
+ #include "sdct.h"
+ #include "sjpeg.h"
+diff --git a/base/sjpege.c b/base/sjpege.c
+--- a/base/sjpege.c
++++ b/base/sjpege.c
+@@ -18,7 +18,6 @@
+ #include "jpeglib_.h"
+ #include "jerror_.h"
+ #include "gx.h"
+-#include "gserrors.h"
+ #include "strimpl.h"
+ #include "sdct.h"
+ #include "sjpeg.h"
+diff --git a/base/sjpx.c b/base/sjpx.c
+--- a/base/sjpx.c
++++ b/base/sjpx.c
+@@ -15,7 +15,6 @@
+ /* JPXDecode filter implementation -- hooks in libjasper */
+
+ #include "memory_.h"
+-#include "gserrors.h"
+ #include "gserror.h"
+ #include "gdebug.h"
+ #include "strimpl.h"
+diff --git a/base/stream.c b/base/stream.c
+--- a/base/stream.c
++++ b/base/stream.c
+@@ -1259,9 +1259,9 @@ s_close_disable(stream *s)
+ int
+ file_close_disable(stream * s)
+ {
+- int code = (*s->save_close)(s);
+-
+- if (code)
++ int code;
++
++ if ((*s->save_close != NULL) && ((code = (*s->save_close)(s)) != 0))
+ return code;
+ s_close_disable(s);
+ return file_close_finish(s);
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -1836,6 +1836,10 @@ static int nInstrCount=0;
+ {
+ CUR.IP += (Int)(args[0]);
+ CUR.step_ins = FALSE;
++
++ /* See JMPR below */
++ if(CUR.code[CUR.IP] != 0x2D && CUR.code[CUR.IP - 1] == 0x2D)
++ CUR.IP -= 1;
+ }
+ }
+
+@@ -1848,6 +1852,16 @@ static int nInstrCount=0;
+ {
+ CUR.IP += (Int)(args[0]);
+ CUR.step_ins = FALSE;
++
++ if(CUR.code[CUR.IP] != 0x2D && CUR.code[CUR.IP - 1] == 0x2D)
++ /* The JPMR is meant to stop at the ENDF instruction to finish
++ * the function. However the programmer made a mistake, and ended
++ * up one byte too far. I suspect that some TT interpreters handle this
++ * by detecting that the IP has gone off the end of the function. We can
++ * allow for simple cases here by just checking the preceding byte.
++ * Fonts with this problem are not uncommon.
++ */
++ CUR.IP -= 1;
+ }
+
+
+@@ -1861,6 +1875,10 @@ static int nInstrCount=0;
+ {
+ CUR.IP += (Int)(args[0]);
+ CUR.step_ins = FALSE;
++
++ /* See JMPR above */
++ if(CUR.code[CUR.IP] != 0x2D && CUR.code[CUR.IP - 1] == 0x2D)
++ CUR.IP -= 1;
+ }
+ }
+
+@@ -3856,7 +3874,11 @@ static int nInstrCount=0;
+ if ( BOUNDS( args[0], CUR.zp0.n_points ) ||
+ BOUNDS( args[1], CUR.cvtSize ) )
+ {
+- CUR.error = TT_Err_Invalid_Reference;
++ /* Ignore these errors, abort the instruction
++ * and continue. This restores the FreeType
++ * behaviour when pedantic_hinting is false. For bug
++ * #689471, see also Ins_SHC above and bug #688501.
++ */
+ return;
+ }
+
+diff --git a/base/winlib.mak b/base/winlib.mak
+--- a/base/winlib.mak
++++ b/base/winlib.mak
+@@ -80,7 +80,11 @@ UFST_LIB_EXT=.lib
+ # Define conditinal name for FreeType bridge :
+ !ifdef FT_ROOT
+ FT_BRIDGE = 1
+-FT_LIB_EXT=.lib
++FT_CFLAGS=$(I_)$(FT_ROOT)$(D)include$(_I)
++!ifndef FT_LIB
++FT_LIB = freetype238MT_D
++!endif
++FT_LIBS=$(FT_ROOT)$(D)objs$(D)$(FT_LIB).lib
+ !endif
+
+ # Define the files to be removed by `make clean'.
+diff --git a/base/wrfont.c b/base/wrfont.c
+--- a/base/wrfont.c
++++ /dev/null
+@@ -1,78 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: wrfont.c 8022 2007-06-05 22:23:38Z giles $ */
+-/*
+-Support functions to serialize fonts as PostScript code that can
+-then be passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 9th August 2002.
+-*/
+-
+-#include "wrfont.h"
+-#include "stdio_.h"
+-
+-#define EEXEC_KEY 55665
+-#define EEXEC_FACTOR 52845
+-#define EEXEC_OFFSET 22719
+-
+-void WRF_init(WRF_output* a_output,unsigned char* a_buffer,long a_buffer_size)
+- {
+- a_output->m_pos = a_buffer;
+- a_output->m_limit = a_buffer_size;
+- a_output->m_count = 0;
+- a_output->m_encrypt = false;
+- a_output->m_key = EEXEC_KEY;
+- }
+-
+-void WRF_wbyte(WRF_output* a_output,unsigned char a_byte)
+- {
+- if (a_output->m_count < a_output->m_limit)
+- {
+- if (a_output->m_encrypt)
+- {
+- a_byte ^= (a_output->m_key >> 8);
+- a_output->m_key = (unsigned short)((a_output->m_key + a_byte) * EEXEC_FACTOR + EEXEC_OFFSET);
+- }
+- *a_output->m_pos++ = a_byte;
+- }
+- a_output->m_count++;
+- }
+-
+-void WRF_wtext(WRF_output* a_output,const unsigned char* a_string,long a_length)
+- {
+- while (a_length > 0)
+- {
+- WRF_wbyte(a_output,*a_string++);
+- a_length--;
+- }
+- }
+-
+-void WRF_wstring(WRF_output* a_output,const char* a_string)
+- {
+- while (*a_string)
+- WRF_wbyte(a_output,*a_string++);
+- }
+-
+-void WRF_wfloat(WRF_output* a_output,double a_float)
+- {
+- char buffer[32];
+- sprintf(buffer,"%f",a_float);
+- WRF_wstring(a_output,buffer);
+- }
+-
+-void WRF_wint(WRF_output* a_output,long a_int)
+- {
+- char buffer[32];
+- sprintf(buffer,"%ld",a_int);
+- WRF_wstring(a_output,buffer);
+- }
+diff --git a/base/wrfont.h b/base/wrfont.h
+--- a/base/wrfont.h
++++ /dev/null
+@@ -1,42 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: wrfont.h 8022 2007-06-05 22:23:38Z giles $ */
+-/*
+-Header for support functions to serialize fonts as PostScript code that can
+-then be passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 9th August 2002.
+-*/
+-
+-#ifndef wrfont_INCLUDED
+-#define wrfont_INCLUDED
+-
+-#include "stdpre.h"
+-
+-typedef struct WRF_output_
+- {
+- unsigned char* m_pos;
+- long m_limit;
+- long m_count;
+- bool m_encrypt;
+- unsigned short m_key;
+- } WRF_output;
+-
+-void WRF_init(WRF_output* a_output,unsigned char* a_buffer,long a_buffer_size);
+-void WRF_wbyte(WRF_output* a_output,unsigned char a_byte);
+-void WRF_wtext(WRF_output* a_output,const unsigned char* a_string,long a_length);
+-void WRF_wstring(WRF_output* a_output,const char* a_string);
+-void WRF_wfloat(WRF_output* a_output,double a_float);
+-void WRF_wint(WRF_output* a_output,long a_int);
+-
+-#endif
+diff --git a/base/write_t1.c b/base/write_t1.c
+--- a/base/write_t1.c
++++ /dev/null
+@@ -1,193 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: write_t1.c 8022 2007-06-05 22:23:38Z giles $ */
+-
+-/*
+-Functions to serialize a type 1 font as PostScript code that can then be
+-passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 26th July 2002.
+-*/
+-
+-#include "wrfont.h"
+-#include "write_t1.h"
+-
+-/*
+-Public structures and functions in this file are prefixed with FF_ because they are part of
+-the FAPI FreeType implementation.
+-*/
+-
+-static void write_word_entry(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_divisor)
+- {
+- short x;
+- WRF_wbyte(a_output,'/');
+- WRF_wstring(a_output,a_name);
+- WRF_wbyte(a_output,' ');
+- /* Get the value and convert it from unsigned to signed by assigning it to a short. */
+- x = a_fapi_font->get_word(a_fapi_font,a_index,0);
+- /* Divide by the divisor to bring it back to font units. */
+- x = (short)(x / a_divisor);
+- WRF_wint(a_output,x);
+- WRF_wstring(a_output," def\n");
+- }
+-
+-static void write_array_entry_with_count(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_count,int a_divisor)
+- {
+- int i;
+-
+- if (a_count <= 0)
+- return;
+-
+- WRF_wbyte(a_output,'/');
+- WRF_wstring(a_output,a_name);
+- WRF_wstring(a_output," [");
+- for (i = 0; i < a_count; i++)
+- {
+- /* Get the value and convert it from unsigned to signed by assigning it to a short. */
+- short x = a_fapi_font->get_word(a_fapi_font,a_index,i);
+- /* Divide by the divisor to bring it back to font units. */
+- x = (short)(x / a_divisor);
+- WRF_wint(a_output,x);
+- WRF_wbyte(a_output,(byte)(i == a_count - 1 ? ']' : ' '));
+- }
+- WRF_wstring(a_output," def\n");
+- }
+-
+-
+-static void write_array_entry(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_divisor)
+- {
+- /* NOTE that the feature index must be preceded by the count index for this to work. */
+- int count = a_fapi_font->get_word(a_fapi_font,a_index - 1,0);
+- write_array_entry_with_count(a_fapi_font,a_output,a_name,a_index,count,a_divisor);
+- }
+-
+-static void write_subrs(FAPI_font* a_fapi_font,WRF_output* a_output)
+- {
+- int i;
+- int count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_Subrs_count,0);
+- if (count <= 0)
+- return;
+-
+- WRF_wstring(a_output,"/Subrs ");
+- WRF_wint(a_output,count);
+- WRF_wstring(a_output," array\n");
+-
+- for (i = 0; i < count; i++)
+- {
+- long length = a_fapi_font->get_subr(a_fapi_font,i,0,0);
+- long buffer_size;
+- WRF_wstring(a_output,"dup ");
+- WRF_wint(a_output,i);
+- WRF_wbyte(a_output,' ');
+- WRF_wint(a_output,length);
+- WRF_wstring(a_output," RD ");
+-
+- /* Get the subroutine into the buffer and encrypt it in place. */
+- buffer_size = a_output->m_limit - a_output->m_count;
+- if (buffer_size >= length)
+- {
+- a_fapi_font->get_subr(a_fapi_font,i,a_output->m_pos,(ushort)length);
+- WRF_wtext(a_output,a_output->m_pos,length);
+- }
+- else
+- a_output->m_count += length;
+-
+- WRF_wstring(a_output," NP\n");
+- }
+-
+- WRF_wstring(a_output,"ND\n");
+- }
+-
+-static void write_private_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output)
+- {
+- a_output->m_encrypt = true;
+-
+- /* Write 4 bytes that must encrypt to at least one character that cannot be a valid hexadecimal character. */
+- WRF_wstring(a_output,"XXXX");
+-
+- /*+ to do: correct size of dictionary from 8. */
+- WRF_wstring(a_output,"dup /Private 8 dict dup begin\n");
+-
+- WRF_wstring(a_output,"/MinFeature {16 16} def\n");
+- WRF_wstring(a_output,"/password 5839 def\n");
+- WRF_wstring(a_output,"/lenIV -1 def\n"); /* indicate that /subrs are not encoded. */
+- write_word_entry(a_fapi_font,a_output,"BlueFuzz",FAPI_FONT_FEATURE_BlueFuzz,16);
+-
+- WRF_wstring(a_output,"/BlueScale ");
+- WRF_wfloat(a_output,a_fapi_font->get_long(a_fapi_font,FAPI_FONT_FEATURE_BlueScale,0) / 65536.0);
+- WRF_wstring(a_output," def\n");
+-
+- write_word_entry(a_fapi_font,a_output,"BlueShift",FAPI_FONT_FEATURE_BlueShift,16);
+- write_array_entry(a_fapi_font,a_output,"BlueValues",FAPI_FONT_FEATURE_BlueValues,16);
+- write_array_entry(a_fapi_font,a_output,"OtherBlues",FAPI_FONT_FEATURE_OtherBlues,16);
+- write_array_entry(a_fapi_font,a_output,"FamilyBlues",FAPI_FONT_FEATURE_FamilyBlues,16);
+- write_array_entry(a_fapi_font,a_output,"FamilyOtherBlues",FAPI_FONT_FEATURE_FamilyOtherBlues,16);
+- write_word_entry(a_fapi_font,a_output,"ForceBold",FAPI_FONT_FEATURE_ForceBold,1);
+- write_array_entry_with_count(a_fapi_font,a_output,"StdHW",FAPI_FONT_FEATURE_StdHW,1,16);
+- write_array_entry_with_count(a_fapi_font,a_output,"StdVW",FAPI_FONT_FEATURE_StdVW,1,16);
+- write_array_entry(a_fapi_font,a_output,"StemSnapH",FAPI_FONT_FEATURE_StemSnapH,16);
+- write_array_entry(a_fapi_font,a_output,"StemSnapV",FAPI_FONT_FEATURE_StemSnapV,16);
+-
+- write_subrs(a_fapi_font,a_output);
+- }
+-
+-static void write_main_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output)
+- {
+- int i;
+- WRF_wstring(a_output,"5 dict begin\n");
+-
+- WRF_wstring(a_output,"/FontType 1 def\n");
+-
+- WRF_wstring(a_output,"/FontMatrix [");
+- for (i = 0; i < 6; i++)
+- {
+- WRF_wfloat(a_output,a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_FontMatrix,i));
+- WRF_wbyte(a_output,(byte)(i == 5 ? ']' : ' '));
+- }
+- WRF_wbyte(a_output,'\n');
+-
+- /* For now, specify standard encoding - I think GS will pass glyph indices so doesn't matter. */
+- WRF_wstring(a_output,"/Encoding StandardEncoding def\n");
+-
+- WRF_wstring(a_output,"/FontBBox {");
+- for (i = 0; i < 4; i++)
+- {
+- short x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_FontBBox,i);
+- WRF_wint(a_output,x);
+- WRF_wbyte(a_output,(byte)(i == 3 ? '}' : ' '));
+- }
+- WRF_wbyte(a_output,'\n');
+- WRF_wstring(a_output,"currentdict end\ncurrentfile eexec\n");
+- write_private_dictionary(a_fapi_font,a_output);
+- }
+-
+-/**
+-Write a Type 1 font in textual format and return its length in bytes.
+-If a_buffer_size is less than the total length, only a_buffer_size bytes are written, but the total
+-length is returned correctly.
+-
+-The PostScript is non-standard. The main dictionary contains no /Charstrings dictionary. This
+-is supplied to FreeType using the incremental interface, There is also no /PaintType entry. This is required
+-by PostScript but FreeType doesn't use it.
+-*/
+-long FF_serialize_type1_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size)
+- {
+- WRF_output output;
+- WRF_init(&output,a_buffer,a_buffer_size);
+-
+- /* Leading comment identifying a Type 1 font. */
+- WRF_wstring(&output,"%!PS-AdobeFont-1\n");
+-
+- write_main_dictionary(a_fapi_font,&output);
+- return output.m_count;
+- }
+diff --git a/base/write_t1.h b/base/write_t1.h
+--- a/base/write_t1.h
++++ /dev/null
+@@ -1,28 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: write_t1.h 8022 2007-06-05 22:23:38Z giles $ */
+-/*
+-Header for functions to serialize a type 1 font as PostScript code that can
+-then be passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 26th July 2002.
+-*/
+-
+-#ifndef write_t1_INCLUDED
+-#define write_t1_INCLUDED
+-
+-#include "ifapi.h"
+-
+-long FF_serialize_type1_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size);
+-
+-#endif
+diff --git a/base/write_t2.c b/base/write_t2.c
+--- a/base/write_t2.c
++++ /dev/null
+@@ -1,378 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: write_t2.c 8022 2007-06-05 22:23:38Z giles $ */
+-
+-/*
+-Functions to serialize a type 1 font so that it can then be
+-passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 9th August 2002.
+-*/
+-
+-#include "wrfont.h"
+-#include "write_t2.h"
+-#include "ghost.h"
+-#include "gxfont.h"
+-#include "gxfont1.h"
+-
+-/*
+-Public structures and functions in this file are prefixed with FF_ because they are part of
+-the FAPI FreeType implementation.
+-*/
+-
+-static void write_4_byte_int(unsigned char* a_output,long a_int)
+- {
+- a_output[0] = (unsigned char)(a_int >> 24);
+- a_output[1] = (unsigned char)(a_int >> 16);
+- a_output[2] = (unsigned char)(a_int >> 8);
+- a_output[3] = (unsigned char)(a_int & 0xFF);
+- }
+-
+-static void write_type2_int(WRF_output* a_output,long a_int)
+- {
+- if (a_int >= -107 && a_int <= 107)
+- WRF_wbyte(a_output,(unsigned char)(a_int + 139));
+- else if (a_int >= -32768 && a_int <= 32767)
+- {
+- if (a_int >= 108 && a_int <= 1131)
+- a_int += 63124;
+- else if (a_int >= -1131 && a_int <= -108)
+- a_int = -a_int + 64148;
+- else
+- WRF_wbyte(a_output,28);
+- WRF_wbyte(a_output,(unsigned char)(a_int >> 8));
+- WRF_wbyte(a_output,(unsigned char)(a_int & 0xFF));
+- }
+- else
+- {
+- unsigned char buffer[4];
+- WRF_wbyte(a_output,29);
+- write_4_byte_int(buffer,a_int);
+- WRF_wtext(a_output,buffer,4);
+- }
+- }
+-
+-static void write_type2_float(WRF_output* a_output,double a_float)
+- {
+- char buffer[32];
+- const char* p = buffer;
+- int high = true;
+- char c = 0;
+- sprintf(buffer,"%f",a_float);
+- WRF_wbyte(a_output,30);
+- for (;;)
+- {
+- char n = 0;
+- if (*p >= '0' && *p <= '9')
+- n = (char)(*p - '0');
+- else if (*p == '.')
+- n = 0xA;
+- else if (*p == 'e' || *p == 'E')
+- {
+- if (p[1] == '-')
+- {
+- p++;
+- n = 0xC;
+- }
+- else
+- n = 0xB;
+- }
+- else if (*p == '-')
+- n = 0xE;
+- else if (*p == 0)
+- n = 0xF;
+- if (high)
+- {
+- if (*p == 0)
+- WRF_wbyte(a_output,0xFF);
+- else
+- c = (char)(n << 4);
+- }
+- else
+- {
+- c |= n;
+- WRF_wbyte(a_output,c);
+- }
+-
+- if (*p == 0)
+- break;
+-
+- high = !high;
+- p++;
+- }
+- }
+-
+-static void write_header(WRF_output* a_output)
+- {
+- WRF_wtext(a_output,(const unsigned char*)"\x1\x0\x4\x1",4);
+- }
+-
+-static void write_name_index(WRF_output* a_output)
+- {
+- /* Write a dummy name of 'x'. */
+- WRF_wtext(a_output,(const unsigned char*)"\x0\x1\x1\x1\x2""x",6);
+- }
+-
+-static void write_word_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,
+- int a_feature_count,bool a_two_byte_op,int a_op,int a_divisor)
+- {
+- if (a_feature_count > 0)
+- {
+- int i;
+- for (i = 0; i < a_feature_count; i++)
+- {
+- /* Get the value and convert it from unsigned to signed. */
+- short x = a_fapi_font->get_word(a_fapi_font,a_feature_id,i);
+- /* Divide by the divisor to bring it back to font units. */
+- x = (short)(x / a_divisor);
+- write_type2_int(a_output,x);
+- }
+- if (a_two_byte_op)
+- WRF_wbyte(a_output,12);
+- WRF_wbyte(a_output,(unsigned char)a_op);
+- }
+- }
+-
+-static void write_delta_array_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,
+- bool a_two_byte_op,int a_op,int a_divisor)
+- {
+- int i;
+- /* NOTE that the feature index (a_feature_id) must be preceded by the count index for this to work. */
+- int count = a_fapi_font->get_word(a_fapi_font,a_feature_id - 1,0);
+- if (count > 0)
+- {
+- short prev_value = 0;
+- for (i = 0; i < count; i++)
+- {
+- /* Get the value and convert it from unsigned to signed. */
+- short value = a_fapi_font->get_word(a_fapi_font,a_feature_id,i);
+- /* Divide by the divisor to bring it back to font units. */
+- value = (short)(value / a_divisor);
+- write_type2_int(a_output,value - prev_value);
+- prev_value = value;
+- }
+- if (a_two_byte_op)
+- WRF_wbyte(a_output,12);
+- WRF_wbyte(a_output,(unsigned char)a_op);
+- }
+- }
+-
+-static void write_float_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,int a_feature_count,bool a_two_byte_op,int a_op)
+- {
+- if (a_feature_count > 0)
+- {
+- int i;
+- for (i = 0; i < a_feature_count; i++)
+- {
+- double x = a_fapi_font->get_float(a_fapi_font,a_feature_id,i);
+- write_type2_float(a_output,x);
+- }
+- if (a_two_byte_op)
+- WRF_wbyte(a_output,12);
+- WRF_wbyte(a_output,(unsigned char)a_op);
+- }
+- }
+-
+-static void write_font_dict_index(FAPI_font* a_fapi_font,WRF_output* a_output,
+- unsigned char** a_charset_offset_ptr,
+- unsigned char** a_charstrings_offset_ptr,
+- unsigned char** a_private_dict_length_ptr)
+- {
+- unsigned char* data_start = 0;
+- WRF_wtext(a_output,(const unsigned char *)"\x0\x1\x2\x0\x1\x0\x0",7); /* count = 1, offset size = 2, first offset = 1, last offset = 0 (to be filled in later). */
+- if (a_output->m_pos)
+- data_start = a_output->m_pos;
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FontBBox,4,false,5,1);
+- write_float_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FontMatrix,6,true,7);
+- write_type2_int(a_output,0); /* 0 = Standard Encoding. */
+- WRF_wbyte(a_output,16); /* 16 = opcode for 'encoding'. */
+- *a_charset_offset_ptr = a_output->m_pos;
+- WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx",5); /* placeholder for the offset to the charset, which will be a 5-byte integer. */
+- WRF_wbyte(a_output,15); /* opcode for 'charset' */
+- *a_charstrings_offset_ptr = a_output->m_pos;
+- WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx",5); /* placeholder for the offset to the Charstrings index, which will be a 5-byte integer. */
+- WRF_wbyte(a_output,17); /* opcode for 'Charstrings' */
+- *a_private_dict_length_ptr = a_output->m_pos;
+- WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx\x1d""yyyy",10); /* placeholder for size and offset of Private dictionary, which will be 5-byte integers. */
+- WRF_wbyte(a_output,18); /* opcode for 'Private' */
+- if (a_output->m_pos)
+- {
+- int last_offset = a_output->m_pos - data_start + 1;
+- data_start[-2] = (unsigned char)(last_offset >> 8);
+- data_start[-1] = (unsigned char)(last_offset & 0xFF);
+- }
+- }
+-
+-/**
+-Write the character set. Return the number of characters.
+-For the moment this is always 1. The number cannot be obtained
+-via the FAPI interface, and FreeType doesn't need to know anything more
+-than the fact that there is at least one character.
+-*/
+-static int write_charset(WRF_output* a_output,unsigned char* a_charset_offset_ptr)
+- {
+- const int characters = 1;
+- int i = 0;
+-
+- /* Write the offset to the start of the charset to the top dictionary. */
+- if (a_output->m_pos)
+- write_4_byte_int(a_charset_offset_ptr + 1,a_output->m_count);
+-
+- /*
+- Write the charset. Write one less than the number of characters,
+- because the first one is assumed to be .notdef. For the moment
+- write all the others as .notdef (SID = 0) because we don't actually
+- need the charset at the moment.
+- */
+- WRF_wbyte(a_output,0); /* format = 0 */
+- for (i = 1; i < characters; i++)
+- {
+- WRF_wbyte(a_output,0);
+- WRF_wbyte(a_output,0);
+- }
+-
+- return characters;
+- }
+-
+-/**
+-Write a set of empty charstrings. The only reason for the existence of the charstrings index is to tell
+-FreeType how many glyphs there are.
+-*/
+-static void write_charstrings_index(WRF_output* a_output,int a_characters,unsigned char* a_charstrings_offset_ptr)
+- {
+- /* Write the offset to the charstrings index to the top dictionary. */
+- if (a_output->m_pos)
+- write_4_byte_int(a_charstrings_offset_ptr + 1,a_output->m_count);
+-
+- /* Write the index. */
+- WRF_wbyte(a_output,(unsigned char)(a_characters >> 8));
+- WRF_wbyte(a_output,(unsigned char)(a_characters & 0xFF));
+- WRF_wbyte(a_output,1); /* offset size = 1. */
+- while (a_characters-- >= 0)
+- WRF_wbyte(a_output,1); /* offset = 1 */
+- }
+-
+-static void write_subrs_index(FAPI_font* a_fapi_font,WRF_output* a_output)
+- {
+- unsigned char* cur_offset = 0;
+- unsigned char* data_start = 0;
+- int i;
+- int count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_Subrs_count,0);
+-
+- WRF_wbyte(a_output,(unsigned char)(count >> 8));
+- WRF_wbyte(a_output,(unsigned char)(count & 0xFF));
+-
+- if (count <= 0)
+- return;
+-
+- WRF_wbyte(a_output,4); /* offset size = 4 bytes */
+- WRF_wtext(a_output,(const unsigned char *)"\x0\x0\x0\x1",4); /* first offset = 1 */
+-
+- if (a_output->m_pos)
+- cur_offset = a_output->m_pos;
+-
+- /* Write dummy bytes for the offsets at the end of each data item. */
+- for (i = 0; i < count; i++)
+- WRF_wtext(a_output,(const unsigned char *)"xxxx",4);
+-
+- if (a_output->m_pos)
+- data_start = a_output->m_pos;
+-
+- for (i = 0; i < count; i++)
+- {
+- long buffer_size = a_output->m_limit - a_output->m_count;
+- long length = a_fapi_font->get_subr(a_fapi_font,i,a_output->m_pos,(ushort)buffer_size);
+- if (a_output->m_pos)
+- WRF_wtext(a_output,a_output->m_pos,length);
+- else
+- a_output->m_count += length;
+- if (cur_offset)
+- {
+- long pos = a_output->m_pos - data_start + 1;
+- write_4_byte_int(cur_offset,pos);
+- cur_offset += 4;
+- }
+- }
+- }
+-
+-static void write_private_dict(FAPI_font* a_fapi_font,WRF_output* a_output,unsigned char* a_private_dict_length_ptr)
+- {
+- /* Write the offset to the start of the private dictionary to the top dictionary. */
+- unsigned char* start = a_output->m_pos;
+- if (a_output->m_pos)
+- write_4_byte_int(a_private_dict_length_ptr + 6,a_output->m_count);
+-
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueFuzz,1,true,11,16);
+-
+- write_type2_float(a_output,a_fapi_font->get_long(a_fapi_font,FAPI_FONT_FEATURE_BlueScale,0) / 65536.0);
+- WRF_wbyte(a_output,12);
+- WRF_wbyte(a_output,9);
+-
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueShift,1,true,10,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueValues,false,6,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_OtherBlues,false,7,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FamilyBlues,false,8,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FamilyOtherBlues,false,9,16);
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_ForceBold,1,true,14,1);
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StdHW,1,false,10,16);
+- write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StdVW,1,false,11,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StemSnapH,true,12,16);
+- write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StemSnapV,true,13,16);
+-
+- /*
+- Write the default width and the nominal width. These values are not available via
+- the FAPI interface so we have to get a pointer to the Type 1 font structure and
+- extract them directly.
+- */
+- {
+- gs_font_type1* t1 = (gs_font_type1*)a_fapi_font->client_font_data;
+- write_type2_float(a_output,fixed2float(t1->data.defaultWidthX));
+- WRF_wbyte(a_output,20);
+- write_type2_float(a_output,fixed2float(t1->data.nominalWidthX));
+- WRF_wbyte(a_output,21);
+- }
+-
+- /* Write the length in bytes of the private dictionary to the top dictionary. */
+- if (a_output->m_pos)
+- write_4_byte_int(a_private_dict_length_ptr + 1,a_output->m_pos - start);
+- }
+-
+-/**
+-Write a Type 2 font in binary format and return its length in bytes.
+-If a_buffer_size is less than the total length, only a_buffer_size bytes are written, but the total
+-length is returned correctly.
+-*/
+-long FF_serialize_type2_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size)
+- {
+- unsigned char* charset_offset_ptr = NULL;
+- unsigned char* charstrings_offset_ptr = NULL;
+- unsigned char* private_dict_length_ptr = NULL;
+- int characters = 0;
+-
+- WRF_output output;
+- WRF_init(&output,a_buffer,a_buffer_size);
+-
+- write_header(&output);
+- write_name_index(&output);
+- write_font_dict_index(a_fapi_font,&output,&charset_offset_ptr,&charstrings_offset_ptr,&private_dict_length_ptr);
+-
+- /* Write an empty string index. */
+- WRF_wtext(&output,(const unsigned char *)"\x0\x0",2);
+-
+- write_subrs_index(a_fapi_font,&output);
+- characters = write_charset(&output,charset_offset_ptr);
+- write_charstrings_index(&output,characters,charstrings_offset_ptr);
+- write_private_dict(a_fapi_font,&output,private_dict_length_ptr);
+-
+- return output.m_count;
+- }
+diff --git a/base/write_t2.h b/base/write_t2.h
+--- a/base/write_t2.h
++++ /dev/null
+@@ -1,28 +0,0 @@
+-/* Copyright (C) 2001-2006 Artifex Software, Inc.
+- All Rights Reserved.
+-
+- This software is provided AS-IS with no warranty, either express or
+- implied.
+-
+- This software is distributed under license and may not be copied, modified
+- or distributed except as expressly authorized under the terms of that
+- license. Refer to licensing information at http://www.artifex.com/
+- or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+-*/
+-
+-/* $Id: write_t2.h 8022 2007-06-05 22:23:38Z giles $ */
+-/*
+-Header for functions to serialize a type 2 (CFF) font so that it can
+-then be passed to FreeType via the FAPI FreeType bridge.
+-Started by Graham Asher, 9th August 2002.
+-*/
+-
+-#ifndef write_t2_INCLUDED
+-#define write_t2_INCLUDED
+-
+-#include "ifapi.h"
+-
+-long FF_serialize_type2_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size);
+-
+-#endif
+diff --git a/contrib/contrib.mak b/contrib/contrib.mak
+--- a/contrib/contrib.mak
++++ b/contrib/contrib.mak
+@@ -50,6 +50,7 @@ CONTRIBSRC=$(CONTRIBDIR)$(D)
+ # cdj880 HP DeskJet 880
+ # cdj890 HP DeskJet 890
+ # cdj970 HP DeskJet 970
++# cdnj500 HP DesignJet 500
+ # chp2200 HP Business Inkjet 2200
+ # dl2100 DEC DL2100
+ # dmprt dot matrix printer driver for Ghostscript (it can use
+@@ -232,6 +233,14 @@ $(GLOBJ)gdevdj9.$(OBJ) : $(CONTRIBSRC)gdevdj9.c $(PDEVH) $(math__h) $(string__h)
+ $(GLCC) $(GLO_)gdevdj9.$(OBJ) $(C_) $(CONTRIBSRC)gdevdj9.c
+
+
++### -------------- cdnj500 - HP DesignJet 500 ------------- ###
++
++### NOTE: Same as chp2200 (some PJL and CRD changes).
++
++$(DD)cdnj500.dev : $(cdeskjet8_) $(DD)page.dev
++ $(SETPDEV2) $(DD)cdnj500 $(cdeskjet8_)
++
++
+ ### -------------- chp2200 - HP Business Inkjet 2200 ------------- ###
+
+ ### NOTE: Depends on the presence of the cdj850 section.
+diff --git a/contrib/gdevcd8.c b/contrib/gdevcd8.c
+--- a/contrib/gdevcd8.c
++++ b/contrib/gdevcd8.c
+@@ -34,6 +34,7 @@
+
+ A printer driver for the HP670, HP690, HP850, HP855
+ HP870, HP890, HP1100, HP1600 and HP2200 color printers.
++ Also work with HP DesignJet 500 large-format color printer.
+ To be used with the Ghostscript printing system.
+
+ CREDITS: Much of the driver is based on ideas derived
+@@ -44,6 +45,8 @@
+
+ The support for the hp2200 was added by Siow-Kiat Tan.
+
++ The support for the dnj500 was added by Timur Maximov.
++
+ -------------------------------------------------------------------*/
+
+ /* Note: Depending on how you transfered the files,
+@@ -459,7 +462,7 @@ typedef enum {
+
+ /* Printer types */
+ typedef enum {
+- DJ670C, DJ850C, DJ880C, DJ890C, DJ1600C, HP2200C
++ DJ670C, DJ850C, DJ880C, DJ890C, DJ1600C, HP2200C, DNJ500C
+ } cdj_printer_type_t;
+
+
+@@ -492,6 +495,7 @@ static dev_proc_put_params(cdj850_put_params);
+
+ static dev_proc_print_page(cdj850_print_page);
+ static dev_proc_print_page(chp2200_print_page);
++static dev_proc_print_page(cdnj500_print_page);
+
+ /* The device descriptors */
+
+@@ -636,7 +640,7 @@ typedef struct {
+ (bpp > 8 ? 5 : 2), (bpp > 8 ? 5 : bpp > 1 ? 2 : 0),\
+ print_page, -1 /* cmyk */, correct)
+
+-/* The prn_rgb_color_device is used by the HP2200 */
++/* The prn_rgb_color_device is used by the HP2200 and DNJ500 */
+ #define prn_rgb_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
+ prn_colour_device_body(dtype, procs, dev_name,\
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
+@@ -683,7 +687,7 @@ typedef struct {
+ terminate_page\
+ }
+
+-/* HP2200 is a RGB printer */
++/* HP2200 and DNJ500 is a RGB printer */
+ #define chp_2200_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction, quality, papertype, intensities,ptype,compression,mastergamma,gammavalc,gammavalm,gammavaly,gammavalk,blackcorrect,start_raster_mode,print_non_blank_line,terminate_page)\
+ { prn_rgb_colour_device(gx_device_cdj850, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction),\
+ quality,\
+@@ -783,6 +787,14 @@ static void
+ static void
+ chp2200_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
+
++/* Functions for the DNJ500C */
++static void
++ cdnj500_start_raster_mode(gx_device_printer * pdev,
++ int papersize, FILE * prn_stream);
++
++static void
++ cdnj500_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
++
+
+ static const gx_device_procs cdj670_procs =
+ cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
+@@ -804,7 +816,7 @@ static const gx_device_procs cdj1600_procs =
+ cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
+ gdev_pcl_map_rgb_color, gdev_pcl_map_color_rgb, NULL);
+
+-/* HP2200 is a RGB printer */
++/* HP2200 and DNJ500 is a RGB printer */
+ static const gx_device_procs chp2200_procs =
+ cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
+ gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, NULL);
+@@ -853,6 +865,14 @@ chp_2200_device(chp2200_procs, "chp2200", 300, 300, 24, chp2200_print_page, 0,
+ chp2200_start_raster_mode, NULL /*unused*/,
+ chp2200_terminate_page);
+
++/* DNJ500 does not need color matching and halftoning parameters */
++const gx_device_cdj850 gs_cdnj500_device =
++chp_2200_device(chp2200_procs, "cdnj500", 300, 300, 24, cdnj500_print_page, 0,
++ NORMAL, PLAIN_PAPER, 0 /*unused*/, DNJ500C, 10,
++ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, /*all unused*/
++ cdnj500_start_raster_mode, NULL /*unused*/,
++ cdnj500_terminate_page);
++
+ /* Forward references */
+ static int cdj_put_param_int(gs_param_list *, gs_param_name,
+ int *, int, int, int);
+@@ -892,6 +912,11 @@ hp_colour_open(gx_device * pdev)
+ 0.25, 0.46, 0.25, 0.08
+ };
+
++ /* margins for DNJ500C */
++ static const float cdnj500[4] = {
++ 0.00, 0.00, 0.00, 0.00
++ };
++
+ const float *m = (float *)0;
+
+ /* Set up colour params if put_params has not already done so */
+@@ -1011,6 +1036,20 @@ hp_colour_open(gx_device * pdev)
+ }
+ m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? chp2200_a4 : chp2200_letter);
+ break;
++ /* DNJ500 supports 300dpi and 600dpi with any combinations */
++ case DNJ500C:
++ cdj850->xscal = 0; /* unused */
++ cdj850->yscal = 0; /* unused */
++ cdj850->intensities = 0; /* unused */
++ if (cdj850->quality == DRAFT) {
++ gx_device_set_resolution(pdev, 300.0, 300.0);
++ } else if (cdj850->quality == NORMAL) {
++ gx_device_set_resolution(pdev, 600.0, 600.0);
++ } else { /* quality == PRESENTATION */
++ gx_device_set_resolution(pdev, 600.0, 600.0);
++ }
++ m = cdnj500;
++ break;
+ default:
+ assert(0);
+ }
+@@ -1205,6 +1244,14 @@ chp2200_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
+ fputs("\033%-12345X@PJL EOJ\012\033%-12345X", prn_stream); /* Send the PJL EOJ */
+ }
+
++/* DNJ500 terminate page routine */
++static void
++cdnj500_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
++{
++ fputs("\033*rC", prn_stream); /* End graphics */
++ fputs("\033%-12345X@PJL EOJ \n", prn_stream); /* Send the PJL EOJ */
++}
++
+ /* Here comes the hp850 output routine -------------------- */
+ static int
+ cdj850_print_page(gx_device_printer * pdev, FILE * prn_stream)
+@@ -1781,6 +1828,149 @@ chp2200_print_page(gx_device_printer * pdev, FILE * prn_stream)
+ return 0;
+ }
+
++#define HIBYTE(w) ((byte)(((unsigned int) (w) >> 8) & 0xFF))
++#define LOBYTE(w) ((byte)(w))
++
++/* DNJ500 output routine -------------------- */
++static int
++cdnj500_print_page(gx_device_printer * pdev, FILE * prn_stream)
++{
++ byte CRD_SeqC[] = {0x1b, 0x2a, 0x67, 0x31, 0x32, 0x57, 0x06, 0x1F, 0x00, 0x01,
++ /* Esc * |g |# of bytes |W |frmt |SP |# of cmpnts*/
++ 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x20, 0x01};
++ /* |Horz Res |Vert Rez |compr|orien|bits |planes*/
++
++ /* x,y resolution for color planes, assume x=y */
++ int xres = cdj850->x_pixels_per_inch;
++ int yres = cdj850->y_pixels_per_inch;
++
++ gs_memory_t *mem = pdev->memory;
++ int width_in_pixels = pdev->width;
++ int width_in_bytes = width_in_pixels * 3; /* assume 24 bits (3 bytes per pixel) */
++ byte *lbuf = gs_alloc_bytes(mem, width_in_bytes,
++ "(input)cdnj500_print_page");
++ byte *lseedbuf = gs_alloc_bytes(mem, width_in_bytes,
++ "(seed)cdnj500_print_page");
++ /* allocate twice the input size for worse case compressed output*/
++ byte *loutputbuf = gs_alloc_bytes(mem, width_in_bytes*2,
++ "(output)cdnj500_print_page");
++
++ int lnum = 0;
++ int iEmptyRows = 0;
++ int iBlock = 0;
++ bool begin = true;
++ byte *data = lbuf;
++
++ if ((lbuf == 0) || (lseedbuf == 0) || (loutputbuf == 0))
++ return_error(gs_error_VMerror);
++
++ /* Start Raster mode */
++ (*cdj850->start_raster_mode) (pdev,
++ gdev_pcl_paper_size((gx_device *)pdev),
++ prn_stream);
++
++ /* This will configure the raster-mode */
++ CRD_SeqC[10] = HIBYTE(xres);
++ CRD_SeqC[11] = LOBYTE(xres);
++ CRD_SeqC[12] = HIBYTE(yres);
++ CRD_SeqC[13] = LOBYTE(yres);
++
++ for (lnum = 0; lnum < pdev->height; ++lnum)
++ {
++ int result = -1;
++
++ /*gdev_prn_get_bits(pdev, lnum, lbuf, &data);*/
++ result = gdev_prn_copy_scan_lines(pdev, lnum, data, width_in_bytes);
++
++ if ((result == 1) && IsScanlineDirty(data, width_in_bytes))
++ {
++ unsigned int OutputLen = 0;
++
++ /*
++ * Printers with low memory (64 MB or less) can run out of memory during decompressing
++ * the image data and will abort the job. To prevent this, restart raster command.
++ * Raghu (hpijs)
++ */
++ if (iBlock == 448) /* from DesignJet 500 winNT driver */
++ {
++ /* terminate the scanline */
++ fputs("0Y", prn_stream);
++
++ /* End graphics */
++ fputs("\033*rC", prn_stream);
++
++ /* Reset in block lines counter */
++ iBlock = 0;
++ }
++ if (iBlock == 0)
++ {
++ /* Send CRD */
++ fwrite(CRD_SeqC, sizeof(byte), sizeof(CRD_SeqC), prn_stream);
++
++ /* Raster mode */
++ fputs("\033*r1A", prn_stream);
++
++ /* start the scanline */
++ fputs("\033*b", prn_stream);
++
++ /* reset seed buffer */
++ INIT_WHITE(lseedbuf, width_in_bytes);
++ }
++ iBlock++;
++
++ if (iEmptyRows)
++ {
++ /* send vertical Y move */
++ fprintf(prn_stream, "%dy", iEmptyRows);
++
++ /* reset empty row count */
++ iEmptyRows = 0;
++
++ /* reset seed buffer */
++ INIT_WHITE(lseedbuf, width_in_bytes);
++ }
++
++ OutputLen = Mode10(width_in_pixels,
++ data,
++ lseedbuf,
++ loutputbuf);
++
++ if (OutputLen)
++ {
++ fprintf(prn_stream, "%dw", OutputLen);
++ fwrite(loutputbuf, sizeof(byte), OutputLen, prn_stream);
++
++ /* save the current scanline as the seed for the next scanline*/
++ memcpy((void*)lseedbuf, (const void*)data, width_in_bytes);
++ }
++ else
++ {
++ fputs("0w", prn_stream);
++ }
++
++ /* Content printing already started */
++ begin = false;
++ }
++ else
++ {
++ /* Skip empty area on top page */
++ if (begin == false) iEmptyRows++;
++ }
++ }
++
++ /* terminate the scanline */
++ fputs("0Y", prn_stream);
++
++ /* terminate page and eject paper */
++ (*cdj850->terminate_page) (pdev, prn_stream);
++
++ gs_free_object(mem, lbuf, "(input)cdnj500_print_page");
++ gs_free_object(mem, lseedbuf, "(seed)cdnj500_print_page");
++ gs_free_object(mem, loutputbuf, "(output)cdnj500_print_page");
++
++ return 0;
++}
++
+
+ #define odd(i) ((i & 01) != 0)
+
+@@ -3084,9 +3274,6 @@ cdj880_start_raster_mode(gx_device_printer * pdev, int paper_size,
+ return;
+ } /* end configure raster-mode */
+
+-#define HIBYTE(w) ((byte)(((unsigned int) (w) >> 8) & 0xFF))
+-#define LOBYTE(w) ((byte)(w))
+-
+ /* Start Raster mode for HP2200 */
+ static void
+ chp2200_start_raster_mode(gx_device_printer * pdev, int paper_size,
+@@ -3153,6 +3340,70 @@ chp2200_start_raster_mode(gx_device_printer * pdev, int paper_size,
+ return;
+ } /* end configure raster-mode */
+
++/* Start Raster mode for DNJ500 */
++static void
++cdnj500_start_raster_mode(gx_device_printer * pdev, int paper_size,
++ FILE * prn_stream)
++{
++ /* x,y resolution for color planes, assume x=y */
++ int xres = cdj850->x_pixels_per_inch;
++ int yres = cdj850->y_pixels_per_inch;
++ float x = pdev->width / pdev->x_pixels_per_inch * 10;
++ float y = pdev->height / pdev->y_pixels_per_inch * 10;
++
++ /* Exit from any previous language */
++ fprintf(prn_stream, "\033%%-12345X");
++
++ /* send @PJL JOB NAME before entering the language
++ * this will be matched by a @PJL EOJ after leaving the language
++ */
++ fprintf(prn_stream, "@PJL JOB NAME=\"GS %.2fx%.2f\" \n", x * 2.54, y * 2.54);
++
++ /* Color use */
++ fprintf(prn_stream, "@PJL SET RENDERMODE = COLOR \n");
++// fprintf(prn_stream, "@PJL SET RENDERMODE = TRUEBLACK \n");
++
++ /* Color correction */
++ fprintf(prn_stream, "@PJL SET COLORSPACE = SRGB \n");
++// fprintf(prn_stream, "@PJL SET COLORSPACE = DEVICERGB \n");
++
++ /* Predef qual set (TODO: need add options) */
++ if (cdj850->quality == DRAFT) {
++ fprintf(prn_stream, "@PJL SET RENDERINTENT = PERCEPTUAL \n");
++ fprintf(prn_stream, "@PJL SET RET = ON \n");
++ fprintf(prn_stream, "@PJL SET MAXDETAIL = OFF \n");
++ } else if (cdj850->quality == NORMAL) {
++ fprintf(prn_stream, "@PJL SET RENDERINTENT = PERCEPTUAL \n");
++ fprintf(prn_stream, "@PJL SET RET = ON \n");
++ fprintf(prn_stream, "@PJL SET MAXDETAIL = ON \n");
++ } else { /* quality == PRESENTATION */
++ fprintf(prn_stream, "@PJL SET RENDERINTENT = SATURATION \n");
++ fprintf(prn_stream, "@PJL SET RET = OFF \n");
++ fprintf(prn_stream, "@PJL SET MAXDETAIL = ON \n");
++ }
++
++ /* Set "remove margins between pages" (need not separated pages) */
++// fprintf(prn_stream, "@PJL SET NESTMODE = OFF \n");
++
++ /* Disable automatic cutter */
++// fprintf(prn_stream, "@PJL SET CUTTER = OFF \n");
++
++ /* Set page size (useful for standart format cutting) */
++// fprintf(prn_stream, "@PJL SET PAPERLENGTH = %d \n", (int)(y * 72.0));
++// fprintf(prn_stream, "@PJL SET PAPERWIDTH = %d \n" , (int)(x * 72.0));
++
++ /* Set the language to PCL3 enhanced */
++ fprintf(prn_stream, "@PJL ENTER LANGUAGE=PCL3GUI \n");
++
++ /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
++ fprintf(prn_stream, "\033*o%dM", cdj850->quality);
++
++ /* Unit of Measure*/
++ fprintf(prn_stream, "\033&u%dD", (int)xres);
++
++ return;
++} /* end configure raster-mode */
++
+ static int near
+ cdj_put_param_int(gs_param_list * plist, gs_param_name pname, int *pvalue,
+ int minval, int maxval, int ecode)
+diff --git a/contrib/pcl3/eprn/gdeveprn.c b/contrib/pcl3/eprn/gdeveprn.c
+--- a/contrib/pcl3/eprn/gdeveprn.c
++++ b/contrib/pcl3/eprn/gdeveprn.c
+@@ -314,7 +314,7 @@ static void print_flags(ms_MediaCode flags, const ms_Flag *user_flags)
+ if (user_flags != NULL) {
+ while (user_flags->code != ms_none) {
+ if (user_flags->code & flags) {
+- errprintf(user_flags->name);
++ errprintf("%s", user_flags->name);
+ flags &= ~user_flags->code;
+ }
+ user_flags++;
+diff --git a/contrib/pcl3/src/gdevpcl3.c b/contrib/pcl3/src/gdevpcl3.c
+--- a/contrib/pcl3/src/gdevpcl3.c
++++ b/contrib/pcl3/src/gdevpcl3.c
+@@ -1315,7 +1315,7 @@ static int pcl3_open_device(gx_device *device)
+ "%s page setup requested by the document as being for `",
+ epref, epref);
+ if (ms_find_name_from_code(buffer, sizeof(buffer),
+- dev->eprn.code, flag_description) == 0) eprintf(buffer);
++ dev->eprn.code, flag_description) == 0) eprintf1("%s", buffer);
+ else eprintf("UNKNOWN"); /* should never happen */
+ eprintf3("' (%.0f x %.0f bp).\n"
+ "%s The driver does not know how to do this in PCL.\n",
+diff --git a/cups/cups.mak b/cups/cups.mak
+--- a/cups/cups.mak
++++ b/cups/cups.mak
+@@ -33,6 +33,7 @@ cups_= $(GLOBJ)gdevcups.$(OBJ)
+ # CUPSSERVERBIN=`cups-config --serverbin`
+ # CUPSSERVERROOT=`cups-config --serverroot`
+ # CUPSDATA=`cups-config --datadir`
++# CUPSPDFTORASTER= 1 if CUPS is new enough (cups-config --version)
+
+ $(DD)cups.dev : $(CUPS_MAK) $(cups_) $(GLD)page.dev
+ $(SETPDEV2) $(DD)cups $(cups_)
+@@ -49,18 +50,24 @@ pdftoraster: $(PDFTORASTER_XE)
+ pdftoraster_=cups/pdftoraster.c
+
+ $(PDFTORASTER_XE): $(pdftoraster_)
+- $(GLCC) `cups-config --image --libs` -DBINDIR='"$(bindir)"' -DGS='"$(GS)"' -o $@ $(pdftoraster_)
++ if [ "$(CUPSPDFTORASTER)" = "1" ]; then \
++ $(GLCC) $(LDFLAGS) -DBINDIR='"$(bindir)"' -DGS='"$(GS)"' -o $@ $(pdftoraster_) `cups-config --image --libs`; \
++ fi
+
+ install: install-cups
+
+ install-cups: cups
+ -mkdir -p $(DESTDIR)$(CUPSSERVERBIN)/filter
+ $(INSTALL_PROGRAM) cups/pstoraster $(DESTDIR)$(CUPSSERVERBIN)/filter
+- $(INSTALL_PROGRAM) $(PDFTORASTER_XE) $(DESTDIR)$(CUPSSERVERBIN)/filter
++ if [ "$(CUPSPDFTORASTER)" = "1" ]; then \
++ $(INSTALL_PROGRAM) $(PDFTORASTER_XE) $(DESTDIR)$(CUPSSERVERBIN)/filter; \
++ fi
+ $(INSTALL_PROGRAM) cups/pstopxl $(DESTDIR)$(CUPSSERVERBIN)/filter
+ -mkdir -p $(DESTDIR)$(CUPSSERVERROOT)
+ $(INSTALL_DATA) cups/pstoraster.convs $(DESTDIR)$(CUPSSERVERROOT)
+- $(INSTALL_DATA) cups/pdftoraster.convs $(DESTDIR)$(CUPSSERVERROOT)
++ if [ "$(CUPSPDFTORASTER)" = "1" ]; then \
++ $(INSTALL_DATA) cups/pdftoraster.convs $(DESTDIR)$(CUPSSERVERROOT); \
++ fi
+ -mkdir -p $(DESTDIR)$(CUPSDATA)/model
+ $(INSTALL_DATA) cups/pxlcolor.ppd $(DESTDIR)$(CUPSDATA)/model
+ $(INSTALL_DATA) cups/pxlmono.ppd $(DESTDIR)$(CUPSDATA)/model
+diff --git a/cups/gdevcups.c b/cups/gdevcups.c
+--- a/cups/gdevcups.c
++++ b/cups/gdevcups.c
+@@ -252,9 +252,7 @@ private gx_device_procs cups_procs =
+ NULL, /* image_data */
+ NULL, /* end_image */
+ NULL, /* strip_tile_rectangle */
+- NULL /* strip_copy_rop */
+-#ifdef dev_t_proc_encode_color
+- ,
++ NULL, /* strip_copy_rop */
+ NULL, /* get_clipping_box */
+ NULL, /* begin_typed_image */
+ NULL, /* get_bits_rectangle */
+@@ -268,11 +266,26 @@ private gx_device_procs cups_procs =
+ NULL, /* begin_transparency_mask */
+ NULL, /* end_transparency_mask */
+ NULL, /* discard_transparency_layer */
++#ifdef dev_t_proc_encode_color
+ cups_get_color_mapping_procs,
+- NULL, /* get_color_comp_index */
++ gx_error_get_color_comp_index, /* Dummy to avoid segfault */
+ cups_encode_color,
+- cups_decode_color
++ cups_decode_color,
++#else
++ NULL, /* get_color_mapping_procs */
++ NULL, /* get_color_comp_index */
++ NULL, /* encode_color */
++ NULL, /* decode_color */
+ #endif /* dev_t_proc_encode_color */
++ NULL, /* pattern_manage */
++ NULL, /* fill_rectangle_hl_color */
++ NULL, /* include_color_space */
++ NULL, /* fill_linear_color_scanline */
++ NULL, /* fill_linear_color_trapezoid */
++ NULL, /* fill_linear_color_triangle */
++ NULL, /* update_spot_equivalent_colors */
++ NULL, /* ret_devn_params */
++ NULL /* fillpage */
+ };
+
+ #define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
+@@ -365,9 +378,10 @@ gx_device_cups gs_cups_device =
+ /* cupsString */
+ "", /* cupsMarkerType */
+ "", /* cupsRenderingIntent */
+- "Letter" /* cupsPageSizeName */
++ "" /* cupsPageSizeName */
+ #endif /* CUPS_RASTER_SYNCv1 */
+- }
++ },
++ 0 /* landscape */
+ };
+
+ /*
+@@ -414,7 +428,6 @@ static unsigned char cupsRevLower1[16] =
+ 0x20, 0x60, 0xa0, 0xe0, 0x30, 0x70, 0xb0, 0xf0
+ };
+
+-
+ /*
+ * Local functions...
+ */
+@@ -592,6 +605,8 @@ private void
+ cups_get_matrix(gx_device *pdev, /* I - Device info */
+ gs_matrix *pmat) /* O - Physical transform matrix */
+ {
++ ppd_attr_t *backside = NULL;
++
+ dprintf2("DEBUG2: cups_get_matrix(%p, %p)\n", pdev, pmat);
+
+ /*
+@@ -610,7 +625,12 @@ cups_get_matrix(gx_device *pdev, /* I - Device info */
+
+ if (cupsPPD)
+ {
++ backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL);
+ dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD);
++ if (backside) {
++ dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value);
++ cupsPPD->flip_duplex = 0;
++ }
+ dprintf1("DEBUG2: cupsPPD->flip_duplex = %d\n", cupsPPD->flip_duplex);
+ }
+
+@@ -620,36 +640,96 @@ cups_get_matrix(gx_device *pdev, /* I - Device info */
+ * Do landscape orientation...
+ */
+
+- if (cups->header.Duplex && !cups->header.Tumble &&
+- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
++ if (cups->header.Duplex && cupsPPD &&
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
+ {
+ pmat->xx = 0.0;
+- pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
+- pmat->yx = -(float)cups->header.HWResolution[1] / 72.0;
++ pmat->xy = (float)cups->header.HWResolution[1] / 72.0;
++ pmat->yx = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->yy = 0.0;
+- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[1] / 72.0;
++ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[0] / 72.0;
++ }
++ else if (cups->header.Duplex && cupsPPD &&
++ (!cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
++ {
++ pmat->xx = 0.0;
++ pmat->xy = -(float)cups->header.HWResolution[1] / 72.0;
++ pmat->yx = (float)cups->header.HWResolution[0] / 72.0;
++ pmat->yy = 0.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[1] / 72.0;
++ pmat->ty = (float)cups->header.HWResolution[1] *
++ ((float)cups->header.PageSize[0] - pdev->HWMargins[2]) / 72.0;
++ }
++ else if (cups->header.Duplex && cupsPPD &&
++ ((!cups->header.Tumble &&
++ (cupsPPD->flip_duplex ||
++ (backside && !strcasecmp(backside->value, "Rotated")))) ||
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "ManualTumble")))) &&
++ !(cups->page & 1))
++ {
++ pmat->xx = 0.0;
++ pmat->xy = -(float)cups->header.HWResolution[1] / 72.0;
++ pmat->yx = (float)cups->header.HWResolution[0] / 72.0;
++ pmat->yy = 0.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[1] / 72.0;
+ pmat->ty = (float)cups->header.HWResolution[1] *
+- ((float)cups->header.PageSize[0] - pdev->HWMargins[3]) / 72.0;
++ ((float)cups->header.PageSize[0] - pdev->HWMargins[2]) / 72.0;
+ }
+ else
+ {
+ pmat->xx = 0.0;
+- pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
+- pmat->yx = (float)cups->header.HWResolution[1] / 72.0;
++ pmat->xy = (float)cups->header.HWResolution[1] / 72.0;
++ pmat->yx = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->yy = 0.0;
+- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
+- pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[1] / 72.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[1] / 72.0;
++ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[0] / 72.0;
+ }
+ }
+- else if (cups->header.Duplex && !cups->header.Tumble &&
+- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
++ else if (cups->header.Duplex && cupsPPD &&
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
++ {
++ pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
++ pmat->xy = 0.0;
++ pmat->yx = 0.0;
++ pmat->yy = -(float)cups->header.HWResolution[1] / 72.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
++ pmat->ty = (float)cups->header.HWResolution[1] *
++ ((float)cups->header.PageSize[1] - pdev->HWMargins[3]) / 72.0;
++ }
++ else if (cups->header.Duplex && cupsPPD &&
++ (!cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
++ {
++ pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
++ pmat->xy = 0.0;
++ pmat->yx = 0.0;
++ pmat->yy = (float)cups->header.HWResolution[1] / 72.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
++ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[1] / 72.0;
++ }
++ else if (cups->header.Duplex && cupsPPD &&
++ ((!cups->header.Tumble &&
++ (cupsPPD->flip_duplex ||
++ (backside && !strcasecmp(backside->value, "Rotated")))) ||
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "ManualTumble")))) &&
++ !(cups->page & 1))
+ {
+ pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->xy = 0.0;
+ pmat->yx = 0.0;
+ pmat->yy = (float)cups->header.HWResolution[1] / 72.0;
+- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
+- pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[3] / 72.0;
++ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
++ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[1] / 72.0;
+ }
+ else
+ {
+@@ -1556,14 +1636,16 @@ cups_map_rgb(gx_device *pdev,
+ private gx_color_index /* O - Color index */
+ cups_map_cmyk_color(gx_device *pdev,
+ /* I - Device info */
+- gx_color_value c, /* I - Cyan value */
+- gx_color_value m, /* I - Magenta value */
+- gx_color_value y, /* I - Yellow value */
+- gx_color_value k) /* I - Black value */
++ const gx_color_value cv[4])/* I - CMYK color values */
+ {
+ gx_color_index i; /* Temporary index */
++ gx_color_value c, m, y, k;
+ gx_color_value ic, im, iy, ik; /* Integral CMYK values */
+
++ c = cv[0];
++ m = cv[1];
++ y = cv[2];
++ k = cv[3];
+
+ #ifdef DEBUG
+ dprintf5("DEBUG2: cups_map_cmyk_color(%p, %d, %d, %d, %d)\n", pdev,
+@@ -1722,7 +1804,7 @@ cups_map_color_rgb(gx_device *pdev,/* I - Device info */
+ /* O - RGB values */
+ {
+ unsigned char c0, c1, c2, c3; /* Color index components */
+- gx_color_value k, divk; /* Black & divisor */
++ gx_color_value c, m, y, k, divk; /* Colors, Black & divisor */
+
+
+ #ifdef DEBUG
+@@ -1966,11 +2048,10 @@ cups_map_color_rgb(gx_device *pdev,/* I - Device info */
+
+ private gx_color_index /* O - Color index */
+ cups_map_rgb_color(gx_device *pdev,/* I - Device info */
+- gx_color_value r, /* I - Red value */
+- gx_color_value g, /* I - Green value */
+- gx_color_value b) /* I - Blue value */
++ const gx_color_value cv[3])/* I - RGB color values */
+ {
+ gx_color_index i; /* Temporary index */
++ gx_color_value r, g, b;
+ gx_color_value ic, im, iy, ik; /* Integral CMYK values */
+ gx_color_value mk; /* Maximum K value */
+ int tc, tm, ty; /* Temporary color values */
+@@ -1981,6 +2062,9 @@ cups_map_rgb_color(gx_device *pdev,/* I - Device info */
+ ciel, ciea, cieb;
+ /* CIE Lab colors */
+
++ r = cv[0];
++ g = cv[1];
++ b = cv[2];
+
+ #ifdef DEBUG
+ dprintf4("DEBUG2: cups_map_rgb_color(%p, %d, %d, %d)\n", pdev, r, g, b);
+@@ -2709,7 +2793,12 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ gdev_prn_space_params sp; /* Space parameter data */
+ int width, /* New width of page */
+ height; /* New height of page */
+-
++ ppd_attr_t *backside = NULL,
++ *backsiderequiresflippedmargins = NULL;
++ float swap;
++ int xflip = 0,
++ yflip = 0;
++ int found = 0;
+
+ dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist);
+
+@@ -2921,6 +3010,87 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+
+ if (cupsPPD != NULL)
+ {
++ dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
++ dprintf1("DEBUG2: cups->page = %d\n", cups->page);
++ dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD);
++
++ backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL);
++ if (backside) {
++ dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value);
++ cupsPPD->flip_duplex = 0;
++ }
++ dprintf1("DEBUG2: cupsPPD->flip_duplex = %d\n", cupsPPD->flip_duplex);
++
++ backsiderequiresflippedmargins =
++ ppdFindAttr(cupsPPD, "APDuplexRequiresFlippedMargin", NULL);
++ if (backsiderequiresflippedmargins)
++ dprintf1("DEBUG2: APDuplexRequiresFlippedMargin = %s\n",
++ backsiderequiresflippedmargins->value);
++
++ if (cups->header.Duplex &&
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
++ {
++ xflip = 1;
++ if (backsiderequiresflippedmargins &&
++ !strcasecmp(backsiderequiresflippedmargins->value, "False"))
++ yflip = 0;
++ else
++ yflip = 1;
++ }
++ else if (cups->header.Duplex &&
++ (!cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "Flipped"))) &&
++ !(cups->page & 1))
++ {
++ xflip = 0;
++ if (backsiderequiresflippedmargins &&
++ !strcasecmp(backsiderequiresflippedmargins->value, "False"))
++ yflip = 1;
++ else
++ yflip = 0;
++ }
++ else if (cups->header.Duplex &&
++ ((!cups->header.Tumble &&
++ (cupsPPD->flip_duplex ||
++ (backside && !strcasecmp(backside->value, "Rotated")))) ||
++ (cups->header.Tumble &&
++ (backside && !strcasecmp(backside->value, "ManualTumble")))) &&
++ !(cups->page & 1))
++ {
++ xflip = 1;
++ if (backsiderequiresflippedmargins &&
++ !strcasecmp(backsiderequiresflippedmargins->value, "True"))
++ yflip = 0;
++ else
++ yflip = 1;
++ }
++ else
++ {
++ xflip = 0;
++ yflip = 0;
++ }
++
++#ifdef CUPS_RASTER_SYNCv1
++ /*
++ * Chack whether cupsPageSizeName has a valid value
++ */
++
++ if (strlen(cups->header.cupsPageSizeName) != 0) {
++ found = 0;
++ for (i = cupsPPD->num_sizes, size = cupsPPD->sizes;
++ i > 0;
++ i --, size ++)
++ if (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0) {
++ found = 1;
++ break;
++ }
++ if (found == 0) cups->header.cupsPageSizeName[0] = '\0';
++ }
++ dprintf1("DEBUG2: cups->header.cupsPageSizeName = %s\n", cups->header.cupsPageSizeName);
++#endif
++
+ /*
+ * Find the matching page size...
+ */
+@@ -2930,6 +3100,10 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ i --, size ++)
+ if (fabs(cups->MediaSize[1] - size->length) < 5.0 &&
+ fabs(cups->MediaSize[0] - size->width) < 5.0 &&
++#ifdef CUPS_RASTER_SYNCv1
++ ((strlen(cups->header.cupsPageSizeName) == 0) ||
++ (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0)) &&
++#endif
+ (!margins_set ||
+ (fabs(cups->HWMargins[0] - size->left) < 1.0 &&
+ fabs(cups->HWMargins[1] - size->bottom) < 1.0)))
+@@ -2949,6 +3123,14 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ margins[1] = size->bottom / 72.0;
+ margins[2] = (size->width - size->right) / 72.0;
+ margins[3] = (size->length - size->top) / 72.0;
++ if (xflip == 1)
++ {
++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap;
++ }
++ if (yflip == 1)
++ {
++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap;
++ }
+ }
+ else
+ {
+@@ -2962,6 +3144,10 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ i --, size ++)
+ if (fabs(cups->MediaSize[0] - size->length) < 5.0 &&
+ fabs(cups->MediaSize[1] - size->width) < 5.0 &&
++#ifdef CUPS_RASTER_SYNCv1
++ ((strlen(cups->header.cupsPageSizeName) == 0) ||
++ (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0)) &&
++#endif
+ (!margins_set ||
+ (fabs(cups->HWMargins[0] - size->left) < 1.0 &&
+ fabs(cups->HWMargins[1] - size->bottom) < 1.0)))
+@@ -2979,10 +3165,18 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+
+ cups->landscape = 1;
+
+- margins[0] = size->left / 72.0;
+- margins[1] = size->bottom / 72.0;
+- margins[2] = (size->width - size->right) / 72.0;
+- margins[3] = (size->length - size->top) / 72.0;
++ margins[0] = (size->length - size->top) / 72.0;
++ margins[1] = size->left / 72.0;
++ margins[2] = size->bottom / 72.0;
++ margins[3] = (size->width - size->right) / 72.0;
++ if (xflip == 1)
++ {
++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap;
++ }
++ if (yflip == 1)
++ {
++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap;
++ }
+ }
+ else
+ {
+@@ -2994,6 +3188,14 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+
+ for (i = 0; i < 4; i ++)
+ margins[i] = cupsPPD->custom_margins[i] / 72.0;
++ if (xflip == 1)
++ {
++ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap;
++ }
++ if (yflip == 1)
++ {
++ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap;
++ }
+ }
+ }
+
+@@ -3020,9 +3222,9 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ cups->header.cupsPageSize[1] = pdev->MediaSize[1];
+
+ cups->header.cupsImagingBBox[0] = pdev->HWMargins[0];
+- cups->header.cupsImagingBBox[1] = pdev->HWMargins[3];
++ cups->header.cupsImagingBBox[1] = pdev->HWMargins[1];
+ cups->header.cupsImagingBBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2];
+- cups->header.cupsImagingBBox[3] = pdev->MediaSize[1] - pdev->HWMargins[1];
++ cups->header.cupsImagingBBox[3] = pdev->MediaSize[1] - pdev->HWMargins[3];
+
+ if ((sf = cups->header.cupsBorderlessScalingFactor) < 1.0)
+ sf = 1.0;
+@@ -3034,11 +3236,11 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ cups->header.PageSize[1] = pdev->MediaSize[1] * sf;
+
+ cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0] * sf;
+- cups->header.ImagingBoundingBox[1] = pdev->HWMargins[3] * sf;
++ cups->header.ImagingBoundingBox[1] = pdev->HWMargins[1] * sf;
+ cups->header.ImagingBoundingBox[2] = (pdev->MediaSize[0] -
+ pdev->HWMargins[2]) * sf;
+ cups->header.ImagingBoundingBox[3] = (pdev->MediaSize[1] -
+- pdev->HWMargins[1]) * sf;
++ pdev->HWMargins[3]) * sf;
+ #else
+ cups->header.Margins[0] = pdev->HWMargins[0];
+ cups->header.Margins[1] = pdev->HWMargins[1];
+@@ -3065,9 +3267,9 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+
+ if (cups->landscape)
+ {
+- width = (pdev->MediaSize[1] - pdev->HWMargins[0] - pdev->HWMargins[2]) *
++ width = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
+ pdev->HWResolution[0] / 72.0f + 0.499f;
+- height = (pdev->MediaSize[0] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
++ height = (pdev->MediaSize[0] - pdev->HWMargins[0] - pdev->HWMargins[2]) *
+ pdev->HWResolution[1] / 72.0f + 0.499f;
+ }
+ else
+@@ -3568,10 +3770,21 @@ cups_print_chunked(gx_device_printer *pdev,
+ *dstptr; /* Pointer to bits */
+ int count; /* Count for loop */
+ int flip; /* Flip scanline? */
++ ppd_attr_t *backside = NULL;
+
+-
+- if (cups->header.Duplex && !cups->header.Tumble &&
+- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
++ if (cupsPPD) {
++ backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL);
++ if (backside)
++ cupsPPD->flip_duplex = 0;
++ }
++ if (cups->header.Duplex && cupsPPD &&
++ ((!cups->header.Tumble &&
++ (cupsPPD->flip_duplex ||
++ (backside && !strcasecmp(backside->value, "Rotated")))) ||
++ (cups->header.Tumble &&
++ (backside && (!strcasecmp(backside->value, "Flipped") ||
++ !strcasecmp(backside->value, "ManualTumble"))))) &&
++ !(cups->page & 1))
+ flip = 1;
+ else
+ flip = 0;
+@@ -3751,10 +3964,21 @@ cups_print_banded(gx_device_printer *pdev,
+ unsigned char *cptr, *mptr, *yptr, /* Pointer to components */
+ *kptr, *lcptr, *lmptr; /* ... */
+ int flip; /* Flip scanline? */
++ ppd_attr_t *backside = NULL;
+
+-
+- if (cups->header.Duplex && !cups->header.Tumble &&
+- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
++ if (cupsPPD) {
++ backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL);
++ if (backside)
++ cupsPPD->flip_duplex = 0;
++ }
++ if (cups->header.Duplex && cupsPPD &&
++ ((!cups->header.Tumble &&
++ (cupsPPD->flip_duplex ||
++ (backside && !strcasecmp(backside->value, "Rotated")))) ||
++ (cups->header.Tumble &&
++ (backside && (!strcasecmp(backside->value, "Flipped") ||
++ !strcasecmp(backside->value, "ManualTumble"))))) &&
++ !(cups->page & 1))
+ flip = 1;
+ else
+ flip = 0;
+diff --git a/cups/pstoraster.in b/cups/pstoraster.in
+--- a/cups/pstoraster.in
++++ b/cups/pstoraster.in
+@@ -52,10 +52,10 @@ else
+ fi
+
+ echo INFO: Starting GPL Ghostscript `$bindir/@GS@ --version`... 1>&2
+-echo DEBUG: Running $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile" 1>&2
++echo DEBUG: Running $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c "$profile" -f "$ifile" 1>&2
+
+ # Now run Ghostscript...
+-exec $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile"
++exec $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c "$profile" -f "$ifile"
+
+ #
+ # End of "$Id$".
+diff --git a/doc/C-style.htm b/doc/C-style.htm
+--- a/doc/C-style.htm
++++ b/doc/C-style.htm
+@@ -661,8 +661,7 @@ indent&nbsp;-bad&nbsp;-nbap&nbsp;-nsob&nbsp;-br&nbsp;-ce&nbsp;-cli4&nbsp;-npcs&n
+ <p>
+ does a 98% accurate job of producing our preferred style. Unfortunately,
+ there are bugs in all versions of GNU <code>indent</code>, requiring
+-both pre- and post-processing of the code. The <code>gsindent</code>
+-script in the Ghostscript fileset contains the necessary workarounds.
++both pre- and post-processing of the code.
+
+ <p>
+ Put indentation points every 4 spaces, with 8 spaces = 1 tab stop.
+diff --git a/doc/Develop.htm b/doc/Develop.htm
+--- a/doc/Develop.htm
++++ b/doc/Develop.htm
+@@ -4666,8 +4666,8 @@ Macintosh files:
+ <a href="../base/macos_carbon_d_pre.h">base/macos_carbon_d_pre.h</a>,
+ <a href="../base/macos_classic_d_pre.h">base/macos_classic_d_pre.h</a>,
+
+-<a href="../base/dmmain.c">base/dmmain.c</a>,
+-<a href="../base/dmmain.r">base/dmmain.r</a>.
++<a href="../psi/dmmain.c">psi/dmmain.c</a>,
++<a href="../psi/dmmain.r">psi/dmmain.r</a>.
+
+ <dt>
+ VMS files:
+diff --git a/doc/Language.htm b/doc/Language.htm
+--- a/doc/Language.htm
++++ b/doc/Language.htm
+@@ -1227,10 +1227,25 @@ at the beginning of the procedure.
+
+ <dl>
+ <dt><code>&lt;string&gt; &lt;boolean&gt; .setdebug -</code>
+-<dd>If the Ghostscript interpreter was built with the <code>DEBUG</code>
+-flag set, sets or resets any subset of the debugging flags normally
+-controlled by <code>-Z</code> in the command line. Has no effect
+-otherwise.
++<dd>Sets or clears any subset of the debugging flags included in
++<code>&lt;string&gt;</code> based on the value of
++<code>&lt;boolean&gt;</code>. These correspond to the debug
++flags set by <code>-Z</code> on the command line and enable
++debug and tracing output from various internal modules.
++
++<p>Note that most tracing output is only produced if the Ghostscript
++interpreter was built with the <code>DEBUG</code> preprocessor
++symbol defined.
++
++<p>The <code>zsetdebug()</code> C function, which implements this
++operator, is a useful breakpoint for debuggers.
++Inserting '<code>() true .setdebug</code>' in the interpreted code will
++trigger a breakpoint at that location without side effects. The
++current flag state is available in C as the <code>gs_debug[]</code>
++array, indexed by character value. The <code>zsetdebug</code> function will
++be entered, and <code>gs_debug[]</code> updated, whether or not Ghostscript
++is built with the <code>DEBUG</code> preprocessor symbol defined, so this
++is useful even with release builds.
+ </dl>
+
+ <dl>
+diff --git a/doc/Make.htm b/doc/Make.htm
+--- a/doc/Make.htm
++++ b/doc/Make.htm
+@@ -112,7 +112,7 @@
+ <li><a href="#QNX">QNX</a>
+ </ul>
+ <li><a href="#UFST_build">How to build Ghostscript with UFST</a>
+-<li><a href="#FT_build">How to build Ghostscript with Free Type</a>
++<li><a href="#FT_build">How to build Ghostscript with FreeType</a>
+ </ul></blockquote>
+
+ <!-- [1.2 end table of contents] =========================================== -->
+@@ -662,31 +662,38 @@ memory requirements, and may be essential if you are planning on putting
+ Ghostscript into ROM.
+
+ <p>
+-To compile the initialization files (<code>lib/gs_init.ps</code>, etc.)
+-into the executable, change the <code>0</code> to a <b><tt>1</tt></b> in
+-the line
++By default, most top level make files now default to compiling the initialization
++files (<code>lib/gs_init.ps</code>, etc.) into the executable. To disable this,
++change the <code>1</code> to a <b><tt>0</tt></b> in the line
+
+ <blockquote><code>
+-COMPILE_INITS=0
++COMPILE_INITS=1
+ </code></blockquote>
+
+ <p>
+-Compiled initialization includes the default font map.
+-It is used only if Ghostscript cannot find or open the default font
+-map file at run time.
++Files are now compiled into the executable as a %rom% file system that can
++be searched, opened, etc. as with the normal (%os%) file system. The data
++is (mostly) compressed. The set of files built into the %rom% file system
++is specified in the <code>psi/psromfs.mak</code> file. Refer to the file
++<code>base/mkromfs.c</code> for a description of the parameters that
++control source and destination pathnames, file enumeration exclusion,
++compression, etc.
+
+ <p>
+-To compile fonts into the executable, see <a
+-href="Fonts.htm#Precompiling">Precompiling fonts</a>.
++While fonts normally are compiled into the executable using <code>mkromfs</code>
++(above) from the Resource/Font/ directory, it is possible to compile Type 1 fonts
++into the executable using an older method that converts Type 1 fonts into C code.
++See <a href="Fonts.htm#Precompiling">Precompiling fonts</a>.
+
+ <p>
+-To compile threshold-array halftones into the executable, see the "Compiled
+-halftone" section of <code>int.mak</code> for a sample makefile fragment,
+-<code>genht.c</code> for the syntax of halftone data files, and
+-<code>lib/ht_ccsto.ps</code> for a sample data file. Note that even
+-though the data files use PostScript syntax, compiled halftones do not
+-require the PostScript interpreter and may be used with the graphics library
+-alone.
++Similarly, Halftone resources can be compiled into the executable using
++<code>mkromfs</code>, but also threshold-array halftones can be compiled
++into the executable. See the "Compiled halftone" section of <code>int.mak</code>
++for a sample makefile fragment, <code>genht.c</code> for the syntax of
++halftone data files, and <code>lib/ht_ccsto.ps</code> for a sample data file.
++ Note that even though the data files use PostScript syntax, compiled halftones
++do not require the PostScript interpreter and may be used with the graphics
++library alone.
+
+ <h4><a name="GNU_readline"></a>GNU readline</h4>
+
+@@ -2764,46 +2771,64 @@ msvc32.mak sets the other options automatically.
+
+ <p>
+
+-<h2><a name="FT_build"></a>How to build Ghostscript with Free Type</h2>
++<h2><a name="FT_build"></a>How to build Ghostscript with FreeType</h2>
+
+ <p>
+-<em>Note: This section is only for users who wish to use Ghostscript with Free Type font renderer.
++<em>Note: This section is only for users who wish to use Ghostscript with FreeType font renderer.
+ Other users please skip this section.
+ </em>
+
+ <p>
+-Ghostscript sources do not include Free Type sources. You need to obtain them from Free Type group.
+-Ghostscript includes only some source modules that provide a bridge to Free Type.
++Ghostscript sources do not include a copy of the FreeType sources.
++You need to obtain them from the
++<a href="http://freetype.org/">FreeType Project</a>.
++Ghostscript includes only some source modules that provide a
++bridge to FreeType.
+
+ <p>
+-Ghostscript makefiles do not include any script for building Free Type libraries.
+-Refer to Free Type manual how to build them. Free Type object libraries must be built
+-before building Ghostscript with the Free Type bridge.
++Ghostscript makefiles do not include any script for building FreeType
++libraries. Refer to FreeType manual how to build them. FreeType object
++libraries must be built before building Ghostscript with the FreeType
++bridge.
+
+ <p>
+-To build Ghostscript with Free Type, specify additional options for "make":
++Note that Ghostscript requires FreeType to be built with the optional
++incremental font support. Check that FT_CONFIG_OPTION_INCREMENTAL is
++defined in the headers for your FreeType build.
++<p>
++To build Ghostscript with FreeType, specify these additional options for
++"make" either on the command line, or in the top-level makefile:
+
+ <dl>
+ <dt><code>FT_BRIDGE=1</code>
+-<dd>forces the Free Type bridge to build.
++<dd>Enables the FreeType bridge.
+
+-<dt><code>FT_ROOT=path</code>
+-<dd>specifies the path to Free Type root directory or folder.
++<dt><code>FT_CFLAGS=<i>options</i></code>
++<dd>Specifies C compiler include directives and options for FreeType
++library. Refer to the FreeType manual for information about them.
+
+-<dt><code>FT_CFLAGS=options</code>
+-<dd>specifies C compiler options for Free Type library. Refer to Free Type manual for information about them.
+-
+-<dt><code>FT_LIB_EXT=extension</code>
+-<dd>sets the file name extension for object libraries. You must use the appropriate one for your platform and linker.
++<dt><code>FT_LIBS=<i>link-options</i></code>
++<dd>Specifies the path the the object library or options for linking
++with FreeType. You must use the appropriate one for your platform and
++linker.
+ </dl>
+
+ <p>An example for Unix/GCC :
+ <blockquote>
+-<tt>FT_BRIDGE=1 FT_ROOT=../FreeType FT_CFLAGS=-DGCCx86 FT_LIB_EXT=.a</tt>
++<tt>make FT_BRIDGE=1 FT_CFLAGS=-Ifreetype/include FT_LIBS=freetype/objs/libfreetype.a</tt>
++</blockquote>
++or
++<blockquote>
++<tt>make FT_BRIDGE=1 FT_CFLAGS=`pkg-config --cflags freetype2` FT_LIBS=`pkg-config --libs freetype2`</tt>
+ </blockquote>
+
+-<p>For Windows/MSVC you need only specify FT_ROOT.
+-msvc32.mak sets the other options automatically.
++<p>For Windows/MSVC you need only specify FT_ROOT to be the path to the
++top level source directory of your FreeType build.
++msvc32.mak sets the other options automatically. However,
++because the freetype project files for MSVC embed the version and build
++type in the library filename, it may be necessary to override the default
++library name, by passing for example FT_LIB=freetype241MT. FT_LIB only
++has an effect on the MSVC build, unlike FT_LIBS which is used by all the builds.
+
+ <p>
+
+diff --git a/doc/News.htm b/doc/News.htm
+--- a/doc/News.htm
++++ b/doc/News.htm
+@@ -55,35 +55,10 @@ overview</a>.
+
+ <!-- [2.0 begin contents] ================================================== -->
+
+-<h3><a name="Version8.64"></a>Version 8.64 (2009-02-03)</h3>
++<h3><a name="Version8.64"></a>Version 8.65 (SVN PRE-RELEASE)</h3>
+
+ <p>
+-This is the fifth scheduled release in the stable Ghostscript 8.6x
+-series.
+-
+-<p>
+-Approximately 100 bugs have been fixed since the 8.63 release.
+-
+-<p>
+-Of particular note in this release are improvements to overprint and
+-spot color support in documents with transparency, improvements to PDF
+-and PS output, proper handling of PDF-specific text rendering modes and
+-support for reading AES-encrypted PDF documents.
+-
+-<p>
+-Also improved is handling of CJK text, especially in vertical writing
+-modes, memory footprint processing some files at high resolution and
+-support for using the system's default paper size on unix.
+-
+-<p>
+-The interpreter's handling of color spaces has been moved from
+-PostScript code to C.
+-
+-<p>
+-A number of the included printer drivers and cups wrappers have been
+-updated to support a PDF-based workflow. Also fixed are several
+-long-standing bugs in the pcl drivers with respect to duplex, resolution
+-and paper tray selection.
++This is an unreleased development snapshot.
+
+ <p> The following <a href="http://bugs.ghostscript.com/">bugs</a> were
+ open at the time of the last release: <blockquote>
+@@ -556,17 +531,7 @@ open at the time of the last release: <blockquote>
+ <h3><a name="8.64_Incompatible_changes"></a>Incompatible changes</h3>
+
+ <p>
+-In this release the C source files have been split into two new
+-directories. Interpreter source files are now in <tt>psi</tt> and the
+-graphics library and output devices are now in <tt>base</tt>. Previously
+-everything was in <tt>src</tt>. This may cause problems with existing
+-references in external build files or when applying patches generated
+-against an older version.
+-
+-<p>
+-The compiled in font set in Resource/Fonts has been updated to the
+-version from the 8.11 release. This is the same set which was
+-recommended prior to the 8.63.
++No incompatible changes have been recorded.
+
+ <h3><a name="8.64_changelog"></a>Changelog</h3>
+
+@@ -593,7 +558,7 @@ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+
+ <p>
+-<small>Ghostscript version 8.64, 3 February 2009
++<small>Ghostscript version 8.64, 4 February 2009
+
+ <!-- [3.0 end visible trailer] ============================================= -->
+
+diff --git a/doc/Ps2pdf.htm b/doc/Ps2pdf.htm
+--- a/doc/Ps2pdf.htm
++++ b/doc/Ps2pdf.htm
+@@ -59,12 +59,7 @@ to Portable Document Format (PDF) files.
+ <p>
+ <code>ps2pdf</code> is implemented as a very small command script (batch
+ file) that invokes Ghostscript, selecting a special "output device" called
+-<code>pdfwrite</code>. In order to use <b><tt>ps2pdf</tt></b>, the
+-<code>pdfwrite</code> device must be included in the makefile when
+-Ghostscript was compiled; see the <a
+-href="Make.htm#Features_and_devices">documentation on building
+-Ghostscript</a> for details: this is currently the case on all platforms, in
+-Ghostscript as we distribute it.
++<code>pdfwrite</code>.
+
+ <hr>
+
+@@ -245,6 +240,14 @@ wide variety of uses, possibly at the expense of a larger output file.
+
+ </ul>
+
++<dt><code>-dNumCopies</code>
++<dd>When present, causes pdfwrite to use the #copies or /NumCopies entry in the page
++device dictionary to duplicate each page in the output PDF file as many times as
++the 'copies' value. This is intended for use by workflow applications like CUPS
++and should not be used for generating general purpose PDF files. In particular any
++pdfmark operations which rely on page numbers, such as Link or Outline annotations
++will not work correctly with this flag.
++
+ </dl>
+
+ <p>
+diff --git a/doc/Ps2ps2.htm b/doc/Ps2ps2.htm
+--- a/doc/Ps2ps2.htm
++++ b/doc/Ps2ps2.htm
+@@ -193,12 +193,17 @@ especially for fonts which Ghostscript had converted into bitmaps
+ See <a href="#Options">Options</a> about the <code>PageSize</code> entry of the <b><tt>Policies</tt></b>
+ dictionary while the conversion step).
+ Default value : <em>false</em>.
+-Must be <em>false</em> if <code>-dSetPageSize=true</code>.
++Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dCenterPages=true</code>.
++
++<dt><code>-dCenterPages=</code><em>boolean</em>.
++<dd>The printer will center the page image on the selected media. Compatible with <code>-dRotatePages=true</code>, which may rotate the image on the media if it fits better, and then center it.
++Default value : <em>false</em>.
++Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dFitPages=true</code>.
+
+ <dt><code>-dSetPageSize=</code><em>boolean</em>.
+ <dd>The printer will try to set page size from the job.
+ Only use with printers which can handle random <em>PageSize</em>.
+-Must be <em>false</em> if <code>-dRotatePages=true</code> or <b><tt>-dFitPages=true</tt></b>.
++Must be <em>false</em> if <code>-dRotatePages=true</code>, <code>-dCenterPages=true</code> or <code>-dFitPages=true</code>.
+
+ </dl>
+
+diff --git a/doc/Psfiles.htm b/doc/Psfiles.htm
+--- a/doc/Psfiles.htm
++++ b/doc/Psfiles.htm
+@@ -833,6 +833,11 @@ information.
+ </dl>
+
+ <dl>
++<dt><a href="../lib/viewrgb.ps"><tt>viewrgb.ps</tt></a>
++<dd>A utility for displaying files created by -sDEVICE=bitrgb.
++</dl>
++
++<dl>
+ <dt><a href="../lib/waterfal.ps"><tt>waterfal.ps</tt></a>
+ <dd>A utility to print a "waterfall" of fonts at different sizes.
+ </dl>
+diff --git a/doc/Use.htm b/doc/Use.htm
+--- a/doc/Use.htm
++++ b/doc/Use.htm
+@@ -521,9 +521,6 @@ program by using the special file name '<code>-</code>' which is interpreted as
+ </blockquote>
+
+ <p>
+-<em>Ghostscript cannot read PDF files from standard input or a pipe because the PDF language inherently requires random access to the file. Thus '<tt>-</tt>' only works with PostScript documents.</em>
+-
+-<p>
+ When Ghostscript finishes reading from the pipe, it quits rather than
+ going into interactive mode. Because of this, options and files after the '<tt>-</tt>' in the command line will be ignored.
+
+@@ -834,9 +831,12 @@ switches</a> in the command line, if any;
+ <li>The directories specified by the <code>GS_LIB</code>
+ environment variable, if any;
+
+-<li>The directories specified by the
+-<code>GS_LIB_DEFAULT</code> macro (if any) in the makefile
+-when this executable was built.
++<li>If built with COMPILE_INITS=1 (currently the default build) the files in the
++<code>%rom%Resource/Init/</code> and <code>%rom%lib/</code> file system built
++into the executable ;
++
++<li>The directories specified by the <code>GS_LIB_DEFAULT</code> macro
++(if any) in the makefile when this executable was built.
+ </ol>
+
+ <p>
+@@ -856,11 +856,9 @@ in the current directory first by using the
+
+ <p>
+ Note that Ghostscript does not use this file searching algorithm for the
+-<code>run</code> or <b><tt>file</tt></b>
+-operators: for these operators, it simply opens the file with the name
+-given. To run a file using the searching algorithm, use
+-<code>runlibfile</code> instead of
+-<code>run</code>.
++<b><tt>run</tt></b> or <b><tt>file</tt></b> operators: for these operators, it
++simply opens the file with the name given. To run a file using the searching
++algorithm, use <code>runlibfile</code> instead of <code>run</code>.
+
+ <h3><a name="PS_resources"></a>Finding PostScript Level 2 resources</h3>
+
+@@ -877,12 +875,16 @@ specifies an absolute path. The user may set it as explained in
+
+ <p>
+ If the user doesn't set the system parameter <code>GenericResourceDir</code>,
+-Ghostscript creates a default value for it with
+-attaching the string <code>../Resource</code>
+-to directory paths explained in
+-<a href="#Finding_files">How Ghostscript finds files</a>,
+-except the current directory.
+-The first successful combination is used.
++or use the <code>-sGenericResourceDir=</code> command line option, Ghostscript
++creates a default value for it by looking on the directory paths explained in
++<a href="#Finding_files">How Ghostscript finds files</a>, excluding the current directory.
++The first path with <code>Resource</code> in it is used, including any prefix
++up to the path separator character following the string <code>Resource</code>.
++For example, when COMPILE_INITS=1 (the current default build), if the first path
++is <code>%rom%Resource/Init/</code>, then the <code>GenericResourceDir</code>
++systemparam will be set to <code>%rom%Resource/</code> by default.
++
++
+
+ <p>
+ If the value of the system parameter <code>GenericResourceDir</code>
+@@ -2509,9 +2511,8 @@ another program is "driving" Ghostscript.
+ <dl>
+ <dt><code>-dNOPROMPT</code>
+ <dd>Disables the prompt printed by Ghostscript when it expects interactive
+-input, as well as the end-of-page prompt (<code>-dNOPAGEPROMPT</code>);
+-also disables the implicit <code>flushpage</code> that normally occurs
+-each time Ghostscript asks for more input. This allows piping input
++input, as well as the end-of-page prompt (<code>-dNOPAGEPROMPT</code>).
++This allows piping input
+ directly into Ghostscript, as long as the data doesn't refer to
+ <code>currentfile</code>.
+ </dl>
+@@ -3244,6 +3245,8 @@ guide to international paper sizes can be found at
+ <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>13.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>330<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>936<td>&nbsp;<td>European foolscap
+ <tr> <td>halfletter
+ <td>&nbsp;<td align=right>5.5<td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>140<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>396<td>&nbsp;<td align=right>612<td>&nbsp;<td>&nbsp;
++<tr> <td>hagaki
++ <td>&nbsp;<td align=right>3.9<td>&nbsp;<td align=right>5.8<td>&nbsp;<td align=right>100<td>&nbsp;<td align=right>148<td>&nbsp;<td align=right>283<td>&nbsp;<td align=right>420<td>&nbsp;<td>Japanese postcard
+ </table>
+
+ <p>
+diff --git a/lib/cat.ps b/lib/cat.ps
+new file mode 100644
+--- /dev/null
++++ b/lib/cat.ps
+@@ -0,0 +1,74 @@
++% Copyright (C) 1996-2003 Artifex Software, Inc. All rights reserved.
++%
++% This software is provided AS-IS with no warranty, either express or
++% implied.
++%
++% This software is distributed under license and may not be copied,
++% modified or distributed except as expressly authorized under the terms
++% of the license contained in the file LICENSE in this distribution.
++%
++% For more information about licensing, please refer to
++% http://www.ghostscript.com/licensing/. For information on
++% commercial licensing, go to http://www.artifex.com/licensing/ or
++% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
++% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
++%
++% $Id: cat.ps 8331 2008-02-05 11:07:00Z kens $
++%
++% Appends one file to another. Primarily used to overcome the
++% 'copy' limitation of Windows command shell for ps2epsi
++%
++% the files to be appended are given by the environament
++% variables %infile% and %outfile%. %infile% is appended to
++% %outfile%
++%
++
++/datastring 1024 string def
++
++{
++ (outfile) getenv
++ {
++ /outfilename exch def
++ (infile) getenv
++ {
++ /infilename exch def
++
++ infilename status
++ {
++ pop pop pop pop outfilename status
++ {
++ pop pop pop pop
++ infilename (r) file /infile exch def
++ outfilename (a+) file /outfile exch def
++ {
++ infile datastring readstring
++ {
++ outfile exch writestring
++ }
++ {
++ dup length 0 gt
++ {outfile exch writestring} {pop} ifelse
++ exit
++ } ifelse
++ } loop
++ infile closefile
++ outfile closefile
++ }
++ {
++ (Failed to find file ) print outfilename ==
++ } ifelse
++ }
++ {
++ (Failed to find file ) print infilename ==
++ } ifelse
++ }
++ {
++ (Couldn't find %infile% environment variable) ==
++ } ifelse
++ }
++ {
++ (Couldn't find %outfile% environment variable) ==
++ }
++ ifelse
++} bind
++exec
+diff --git a/lib/ps2ai.ps b/lib/ps2ai.ps
+--- a/lib/ps2ai.ps
++++ b/lib/ps2ai.ps
+@@ -25,7 +25,7 @@
+ % redefine it. This can be used by other programs to overwrite
+ % some settings from externally
+ %
+-/cdef { 1 index where { pop pop pop } { def } ifelse } def
++/cdef { 1 index where { pop pop pop } { def } ifelse } bind def
+ %
+ %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ %
+@@ -131,18 +131,19 @@
+ % Nothing of Interest below here
+ %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ matrix identmatrix setmatrix % make ctm [1 0 0 1 0 0]
++/bdef {bind def} bind def
+ /oldgsave {} def /oldgrestore {} def
+ /initgraphics {} def /initmatrix {} def
+ % undefine PPD PageSizes to be more printer independant
+ /letter {} def /legal {} def /a4 {} def /b5 {} def /lettersmall {} def
+-/setpagedevice { pop } def % for level 2 PPD PageSizes
++/setpagedevice { pop } bdef % for level 2 PPD PageSizes
+ /Courier findfont 12 scalefont setfont % handle no setfont
+ /initclip {0 0 moveto 0 792 lineto 612 792 lineto 612 0 lineto closepath
+- clip newpath } def
+-/xdef {exch def} def
+-/trx {transform exch} def
+-/cbdef {cvx bind def} def
+-/jltz {dup abs 0.0001 lt {pop 0} if} def % get rid of scientific notation bug
++ clip newpath } bdef
++/xdef {exch def} bdef
++/trx {transform exch} bdef
++/cbdef {cvx bind def} bdef
++/jltz {dup abs 0.0001 lt {pop 0} if} bdef % get rid of scientific notation bug
+ /clstate false def % closepath state
+ /dpth false def % destroy path (ie newpath)
+ /fclp false def % first paint after clip
+@@ -165,7 +166,7 @@ matrix identmatrix setmatrix % make ctm [1 0 0 1 0 0]
+ /green {1 mag blk ccomp sub} def
+ /blue {1 yel blk ccomp sub} def
+ red green blue setrgbcolor
+- } def
++ } bdef
+ } ifelse
+ /currentcmykcolor where {pop}
+ {/currentcmykcolor {
+@@ -180,7 +181,7 @@ matrix identmatrix setmatrix % make ctm [1 0 0 1 0 0]
+ /yel rawY blk sub def
+ /blk blk def
+ cyan mag yel blk
+- } def
++ } bdef
+ } ifelse
+ % If using Mac Ghostscript
+ jMacGS {
+@@ -193,10 +194,9 @@ jout {joutput (w) file /joutput xdef} if
+ %
+ % Output
+ %
+-jout {/jp { joutput exch writestring } bind def }{/jp {print}bind def} ifelse
+-/jpnum {jltz ( ) jp =string cvs jp } bind def
+-/jpmat { dup /jarry exch def length 1 sub /j_num exch def
+- (\[) jp 0 1 j_num {jarry exch get jpnum} for (\]) jp } def
++jout {/jp { joutput exch writestring } bdef }{/jp {print} bdef} ifelse
++/jpnum {jltz ( ) jp =string cvs jp } bdef
++/jpmat { (\[) jp { jpnum } forall (\]) jp } bdef
+ %
+ % Stack to Paths converters
+ %
+@@ -207,20 +207,20 @@ jout {/jp { joutput exch writestring } bind def }{/jp {print}bind def} ifelse
+ spth 1 eq {clstate {(s\n) jp }{(S\n) jp } ifelse} if
+ spth 2 eq {clstate {(f\n) jp }{(F\n) jp } ifelse} if
+ } if
+-} def
++} bdef
+ /jpm {
+ ckpnt
+ /dpth true def
+- transform 2 copy /yst xdef /xst xdef exch jpnum jpnum ( m\n) jp } bind def
+-/jpl { trx jpnum jpnum ( l\n) jp } bind def
++ transform 2 copy /yst xdef /xst xdef exch jpnum jpnum ( m\n) jp } bdef
++/jpl { trx jpnum jpnum ( l\n) jp } bdef
+ /jpc { 6 4 roll trx jpnum jpnum 4 2 roll trx jpnum jpnum trx
+- jpnum jpnum ( c\n) jp } bind def
+-/jpp {xst jpnum yst jpnum ( l\n) jp /clstate true def} def
++ jpnum jpnum ( c\n) jp } bdef
++/jpp {xst jpnum yst jpnum ( l\n) jp /clstate true def} bdef
+ /cntpaths { % count paths on stack
+ oldgsave
+ {pop pop /jnump jnump 1 add def} {pop pop} {6 {pop} repeat}{} pathforall
+ oldgrestore
+-} def
++} bdef
+ /ppforall {
+ cntpaths % find out how many paths are on the stack
+ jnump 1 gt { (*u\n) jp } if
+@@ -229,34 +229,34 @@ jout {/jp { joutput exch writestring } bind def }{/jp {print}bind def} ifelse
+ jnump 1 gt { (*U\n) jp } if
+ /jnump 0 def /clstate false def /dpth false def /fclp false def
+ oldnewpath
+-} bind def
++} bdef
+ %
+ % Painting Operators
+ %
+ /oldnewpath [/newpath load] cbdef
+-/newpath { (\n) jp /spth 0 def ppforall} def
+-/stroke { (\n) jp /spth 1 def ppforall } def
+-/fill {(\n) jp /spth 2 def ppforall } def
+-/eofill {(1 D\n) jp fill (0 D\n) jp} def
++/newpath { (\n) jp /spth 0 def ppforall} bdef
++/stroke { (\n) jp /spth 1 def ppforall } bdef
++/fill {(\n) jp /spth 2 def ppforall } bdef
++/eofill {(1 D\n) jp fill (0 D\n) jp} bdef
+ /clip {clarry gcnt get {(Q\nq\n) jp}{(q\n) jp} ifelse
+- /fclp true def clarry gcnt true put} def
+-/eoclip {(1 D\n) jp clip (0 D\n) jp} def
++ /fclp true def clarry gcnt true put} bdef
++/eoclip {(1 D\n) jp clip (0 D\n) jp} bdef
+ %
+ % Text Operators
+ %
+ /oldshow [/show load] cbdef
+-/curpt {stringwidth pop jx add jy} def
++/curpt {stringwidth pop jx add jy} bdef
+ /jNN {dup 0 eq {pop oldgsave currentfont /FontMatrix get setmatrix kscl
+ oldgrestore} if
+-} def
++} bdef
+ /curftmatrix {
+ currentfont /FontMatrix get dup 0 get jNN abs /norm exch def
+ dup 0 get norm div exch dup
+ 1 get norm div exch dup 2 get norm div exch dup 3 get norm div exch dup
+ 4 get exch 5 get 6 array astore matrix currentmatrix matrix concatmatrix
+-} def
++} bdef
+ % AI does not support negitive font sizes
+-/curftsize {currentfont /FontMatrix get 0 get jNN abs 1000 mul} def
++/curftsize {currentfont /FontMatrix get 0 get jNN abs 1000 mul} bdef
+ /hstr (X) def
+ /vbar (|) 0 get def /undsc (_) 0 get def
+ /ftnamefix { % handle font names with |,_ (previously encoded)
+@@ -268,10 +268,10 @@ jstr cvs
+ } ifelse
+ } ifelse
+ } forall flush
+-} bind def
+-%/curftname {currentfont /FontName get ftnamefix}def
++} bdef
++%/curftname {currentfont /FontName get ftnamefix} bdef
+ /curftname { currentfont /FontName known {currentfont /FontName get}
+- { (Times-Roman)} ifelse ftnamefix } def
++ { (Times-Roman)} ifelse ftnamefix } bdef
+ /lftpar (\() 0 get def
+ /rhtpar (\)) 0 get def
+ /bckslsh (\\) 0 get def
+@@ -286,11 +286,11 @@ jstr cvs
+ } ifelse
+ } ifelse
+ } forall (\)) jp flush
+-} bind def
++} bdef
+ % AI 3 text format pieces
+ jtxt3 {
+ /j3txt { j3ftxt {(0 Ts 100 Tz 0 Tt 0 TA 0 0 5 TC 100 100 200 TW 0 0 0 Ti\n) jp
+- (0 Ta 0 Tq 0 0 TI 0 Tc 0 Tw\n) jp} if } def
++ (0 Ta 0 Tq 0 0 TI 0 Tc 0 Tw\n) jp} if } bdef
+ /show {oldgsave (0 To\n) jp
+ currentpoint 2 copy /jy exch def /jx exch def translate
+ curftmatrix /jitm exch def
+@@ -299,8 +299,8 @@ jtxt3 {
+ (0) jp j_ax curftsize div 100 mul jpnum ( 100 TC\n) jp % percent(?)
+ dup curpt moveto mark exch handft ( Tx\n) jp (TO\n) jp /j3ftxt false def
+ cleartomark currentpoint oldgrestore moveto
+-} def
+-/ashow {exch pop exch /j_ax exch def show /j_ax {0} def } def
++} bdef
++/ashow {exch pop exch /j_ax exch def show /j_ax {0} def } bdef
+ }
+ {
+ /show {oldgsave (u\n) jp currentpoint 2 copy /jy exch def /jx exch def translate
+@@ -308,19 +308,19 @@ jtxt3 {
+ curftsize dup jpnum jpnum ( 0 0 z\n) jp
+ curftmatrix jpmat ( e\n) jp
+ dup curpt moveto mark exch handft ( t T U\n) jp
+- cleartomark currentpoint oldgrestore moveto} def
++ cleartomark currentpoint oldgrestore moveto} bdef
+ /ashow {oldgsave (u\n) jp currentpoint translate (\/) jp curftname jstr cvs jp
+ curftsize dup jpnum jpnum exch kscl mul jpnum ( 0 z\n) jp
+ curftmatrix jpmat ( e\n) jp dup curpt moveto mark exch handft
+- ( t T U\n) jp cleartomark currentpoint oldgrestore moveto} def
++ ( t T U\n) jp cleartomark currentpoint oldgrestore moveto} bdef
+ } ifelse
+-/widthshow { show pop pop pop} def
+-/awidthshow {ashow pop pop pop} def
+-/kshow {show pop} def
+-%/show {true charpath fill} bind def % get outline of charactor
++/widthshow { show pop pop pop} bdef
++/awidthshow {ashow pop pop pop} bdef
++/kshow {show pop} bdef
++%/show {true charpath fill} bdef % get outline of charactor
+ joutln {/show { true charpath currentpoint
+- /jy exch def /jx exch def fill jx jy moveto} bind def} if
+-%/show {oldshow} def % do nothing different
++ /jy exch def /jx exch def fill jx jy moveto} bdef} if
++%/show {oldshow} bdef % do nothing different
+ %
+ % Color Operators
+ %
+@@ -328,11 +328,11 @@ joutln {/show { true charpath currentpoint
+ /setcmykcolor {oldsetcmykcolor
+ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( k\n) jp
+ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
+- } def
++ } bdef
+ /oldsetgray [/setgray load] cbdef
+-/setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} def
++/setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} bdef
+ /oldsethsbcolor [/sethsbcolor load] cbdef
+-/sethsbcolor {oldsethsbcolor currentcmykcolor setcmykcolor} def
++/sethsbcolor {oldsethsbcolor currentcmykcolor setcmykcolor} bdef
+ /oldsetrgbcolor [/setrgbcolor load] cbdef
+ /setrgbcolor {oldsetrgbcolor currentrgbcolor /bval xdef /gval xdef /rval xdef
+ /rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
+@@ -344,24 +344,24 @@ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
+ /mag rawM blk sub def
+ /yel rawY blk sub def
+ /blk blk def
+- cyan mag yel blk setcmykcolor } def
++ cyan mag yel blk setcmykcolor } bdef
+ %
+ % State Operators
+ %
+ /oldsetlinewidth [/setlinewidth load] cbdef
+ /setlinewidth {kscl abs mul jltz oldsetlinewidth
+- currentlinewidth jpnum ( w\n) jp } def
++ currentlinewidth jpnum ( w\n) jp } bdef
+ /oldsetlinecap [/setlinecap load] cbdef
+-/setlinecap {dup oldsetlinecap jpnum ( J\n) jp} def
++/setlinecap {dup oldsetlinecap jpnum ( J\n) jp} bdef
+ /oldsetlinejoin [/setlinejoin load] cbdef
+-/setlinejoin {dup oldsetlinejoin jpnum ( j\n) jp} def
++/setlinejoin {dup oldsetlinejoin jpnum ( j\n) jp} bdef
+ /oldsetmiterlimit [/setmiterlimit load] cbdef
+-/setmiterlimit {dup oldsetmiterlimit jpnum ( M\n) jp}def
++/setmiterlimit {dup oldsetmiterlimit jpnum ( M\n) jp}bdef
+ /oldsetdash [/setdash load] cbdef
+ /setdash {exch [ exch {kscl abs mul} forall ] exch kscl abs mul oldsetdash
+- currentdash exch jpmat jpnum ( d\n) jp } def
++ currentdash exch jpmat jpnum ( d\n) jp } bdef
+ /oldsetflat [/setflat load] cbdef
+-/setflat {dup oldsetflat jpnum ( i\n) jp } def
++/setflat {dup oldsetflat jpnum ( i\n) jp } bdef
+ %
+ % More State Operators
+ %
+@@ -372,12 +372,12 @@ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
+ 1 0 moveto currentpoint transform
+ dup mul exch dup mul add sqrt 10000 mul round 10000 div
+ oldgrestore
+-} def
++} bdef
+ /currentstate {currentcmykcolor setcmykcolor
+ currentflat jpnum ( i) jp currentlinecap jpnum ( J) jp
+ currentlinejoin jpnum ( j) jp currentlinewidth jpnum ( w) jp
+ currentmiterlimit jpnum ( M ) jp currentdash exch jpmat jpnum ( d\n) jp
+-} def
++} bdef
+ /jdifG {
+ currentcmykcolor /jok xdef /joy xdef /jom xdef /joc xdef
+ currentflat /jof xdef currentlinecap /jolc xdef currentlinejoin /jolj xdef
+@@ -394,18 +394,18 @@ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
+ false joad {true exit} forall {pop pop true}{false} ifelse
+ false jnad {true exit} forall {pop pop true}{false} ifelse ne
+ jood jnod ne 10 {or} repeat {currentstate} if
+-} def
++} bdef
+ /oldgsave [/gsave load] cbdef
+-/gsave {oldgsave /gcnt gcnt 1 add def } def % clarry gcnt false put} def
+-% (%%Note:gsave ) jp gcnt jpnum (\n) jp} def
++/gsave {oldgsave /gcnt gcnt 1 add def } bdef % clarry gcnt false put} bdef
++% (%%Note:gsave ) jp gcnt jpnum (\n) jp} bdef
+ /oldgrestore [/grestore load] cbdef
+ /grestore {dpth {newpath} if clarry gcnt get {(Q\n) jp clarry gcnt false put} if
+- jdifG /gcnt gcnt 1 sub def } def
+-% oldgrestore currentstate } def
+-% (%%Note:grestore ) jp gcnt 1 add jpnum (\n) jp} def
++ jdifG /gcnt gcnt 1 sub def } bdef
++% oldgrestore currentstate } bdef
++% (%%Note:grestore ) jp gcnt 1 add jpnum (\n) jp} bdef
+ /oldrestore [/restore load] cbdef
+ % a kludgy way of saving the clipping path status information
+-/restore {clarry aload pop 11 -1 roll oldrestore clarry astore pop} def
++/restore {clarry aload pop 11 -1 roll oldrestore clarry astore pop} bdef
+ /showpage { 0 1 9 {clarry exch get {(Q\n) jp} if } for
+ (%%Note: If Error, make sure there are matched pairs of 'q's and 'Q's\n) jp
+ (%%Note: in the file. Add 'Q's before '%%Trailer' until equal\n) jp
+@@ -424,7 +424,7 @@ currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
+ (Adobe_packedarray /terminate get exec\n) jp
+ } ifelse
+ ( showpage\n%EOF\n%%EndDocument\n) jp
+- jout {joutput closefile} if jMacGS not {quit} if /j3ftxt true def } def
++ jout {joutput closefile} if jMacGS not {quit} if /j3ftxt true def } bdef
+ %
+ % Error handling
+ %
+@@ -432,13 +432,13 @@ errordict begin
+ % Attempt to handle the error caused by bitmap fonts (TeX,Windows.ps,etc)
+ % this is a big-time kludge
+ jbiterr {
+- /undefined {pop pop (Times-Roman)} def
+- /typecheck {pop pop} def
++ /undefined {pop pop (Times-Roman)} bdef
++ /typecheck {pop pop} bdef
+ } if
+ jerr {
+ /handleerror {
+ (%%Note: ps2ai error, aborting rest of conversion\n) jp showpage
+- } def
++ } bdef
+ } if
+ end
+ %
+@@ -447,22 +447,22 @@ end
+ /jmacimp { % stroked line instead of thin filled boxes
+ /@a { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
+ 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll exch sub exch lineto
+- abs setlinewidth stroke pop pop} def
++ abs setlinewidth stroke pop pop} bdef
+ /@b { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
+ pop
+ 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch lineto
+- abs setlinewidth stroke} def
+- /endp {showpage pm restore} def % because the restore stops clean up
+-} def
++ abs setlinewidth stroke} bdef
++ /endp {showpage pm restore} bdef % because the restore stops clean up
++} bdef
+ %
+ % Handle (some) PS Level 2
+ %
+ /rectstroke { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
+- closepath stroke} def
++ closepath stroke} bdef
+ /rectfill { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
+- fill } def
++ fill } bdef
+ /rectclip { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
+- closepath clip newpath jMacfix {jmacimp} if } def
++ closepath clip newpath jMacfix {jmacimp} if } bdef
+ %
+ % Add a header prolog to the output file so it is still view/print-able
+ %
+diff --git a/lib/ps2epsi b/lib/ps2epsi
+--- a/lib/ps2epsi
++++ b/lib/ps2epsi
+@@ -50,6 +50,8 @@ else
+ outfile=$2
+ fi
+
++"$GS_EXECUTABLE" -q -dBATCH -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=/dev/null "${infile}" 2>${outfile}
++
+ ls -l "${infile}" |
+ awk 'F==1 {
+ cd="%%CreationDate: " $6 " " $7 " " $8;
+@@ -70,12 +72,27 @@ awk 'F==1 {
+ print "/epsicreator (" c "\\n) def";
+ print "/epsicrdt (" cd "\\n) def";
+ print "/epsifor (" f "\\n) def";
+- print "end";
+ exit(0);
+ }
+ ' U="$USERNAME$LOGNAME" F=1 - F=2 "${infile}" >"$tmpfile"
+
+-"$GS_EXECUTABLE" -q -sPAPERSIZE=a0 -dNOPAUSE -dSAFER -dDELAYSAFER -r72 -sDEVICE=bit -sOutputFile=/dev/null "$tmpfile" ps2epsi.ps "$tmpfile" <"${infile}" 1>&2
++ls -l "${outfile}" |
++awk 'F==1 {
++ b="%%BoundingBox: 0 0 0 0\\n";
++ }
++ /^%%BoundingBox:/ {b=$0; next;}
++ /^%%HiResBoundingBox:/ {
++ hb=$0;
++ print "ps2edict where {pop} {/ps2edict 30 dict def} ifelse";
++ print "ps2edict begin";
++ print "/BBoxString (" b "\\n) def";
++ print "/HiresBBoxString (" hb "\\n) def";
++ print "end";
++ exit(0);
++ }
++ ' F=1 - F=2 "${outfile}" >>"$tmpfile"
++
++"$GS_EXECUTABLE" -q -dNOPAUSE -dSAFER -dDELAYSAFER -r72 -sDEVICE=bit -sOutputFile=/dev/null "$tmpfile" ps2epsi.ps "$tmpfile" <"${infile}" 1>&2
+ rm -f "$tmpfile"
+ rm -rf "$tmpdir"
+
+diff --git a/lib/ps2epsi.bat b/lib/ps2epsi.bat
+--- a/lib/ps2epsi.bat
++++ b/lib/ps2epsi.bat
+@@ -8,6 +8,10 @@ call gssetgs.bat
+ set infile=%1
+ set outfile=%2
+
++rem First we need to determine the bounding box. ps2epsi.ps below will pick
++rem the result up from %outfile%
++%GSC% -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=NUL %infile% 2> %outfile%
++
+ rem Ghostscript uses %outfile% to define the output file
+ %GSC% -q -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile%
+
+@@ -18,7 +22,9 @@ echo /InitDictCount countdictstack def gsave save mark newpath >> %outfile%
+ echo userdict /setpagedevice /pop load put >> %outfile%
+
+ rem Append the original onto the preview header
+-copy %outfile% + %infile%
++rem cat.ps uses the %infile% and %outfile% environment variables for the filenames
++%GSC% -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL cat.ps
++
+
+ echo %%%%EndDocument >> %outfile%
+ echo countdictstack InitDictCount sub { end } repeat >> %outfile%
+diff --git a/lib/ps2epsi.cmd b/lib/ps2epsi.cmd
+--- a/lib/ps2epsi.cmd
++++ b/lib/ps2epsi.cmd
+@@ -11,6 +11,10 @@ if %2/==/ goto usage
+ set infile=%1
+ set outfile=%2
+
++rem First we need to determine the bounding box. ps2epsi.ps below will pick
++rem the result up from %outfile%
++gsos2 -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=NUL %infile% 2> %outfile%
++
+ rem Ghostscript uses %outfile% to define the output file
+ gsos2 -q -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile%
+
+diff --git a/lib/ps2epsi.ps b/lib/ps2epsi.ps
+--- a/lib/ps2epsi.ps
++++ b/lib/ps2epsi.ps
+@@ -1,3 +1,4 @@
++
+ % Copyright (C) 1990, 2000 Aladdin Enterprises. All rights reserved.
+ %
+ % This software is provided AS-IS with no warranty, either express or
+@@ -53,7 +54,13 @@ ps2edict begin
+
+ % The main procedure
+ /ps2epsi
+- { % Open the file
++ {
++ % bbox written to outfile by bbox device from ps2epsi command file
++ outfile (r) file /epsifile exch def
++ /BBoxString epsifile 256 string readline pop def
++ /HiresBBoxString epsifile 256 string readline pop def
++ epsifile closefile
++ % Open the file
+ outfile (w) file /epsifile exch def
+ % Get the device parameters
+ currentdevice getdeviceprops .dicttomark
+@@ -160,18 +167,9 @@ ps2edict begin
+ dup rm gt
+ % If the new index is greater, we save index and element
+ { /rm exch def } { pop } ifelse
+- } {
+- pop
+- } ifelse
++ } if
+ } for
+
+- % Calculate the bounding box values.
+- % Note that these must be corrected to produce closed-open intervals.
+- /llx lm def
+- /lly devheight bm sub 1 sub def
+- /urx rm 1 add def
+- /ury devheight tm sub def
+-
+ % Write out the magic string and bounding box information
+ epsifile (%!PS-Adobe-2.0 EPSF-1.2\n) writestring
+ /epsititle where { pop epsifile epsititle writestring } if
+@@ -195,11 +193,8 @@ ps2edict begin
+ epsifile (\n) writestring
+ epsifile flushfile
+
+- epsifile (%%BoundingBox: ) writestring
+- epsifile llx write==only epsifile ( ) writestring
+- epsifile lly write==only epsifile ( ) writestring
+- epsifile urx write==only epsifile ( ) writestring
+- epsifile ury write==
++ epsifile BBoxString writestring epsifile (\r) writestring
++ epsifile HiresBBoxString writestring epsifile (\r) writestring
+
+ % Define character and bit widths for the output line buffer:
+ /cwidth rm lm sub 1 add def
+diff --git a/lib/viewrgb.ps b/lib/viewrgb.ps
+new file mode 100755
+--- /dev/null
++++ b/lib/viewrgb.ps
+@@ -0,0 +1,146 @@
++% Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
++%
++% This software is provided AS-IS with no warranty, either express or
++% implied.
++%
++% This software is distributed under license and may not be copied, modified
++% or distributed except as expressly authorized under the terms of that
++% license. Refer to licensing information at http://www.artifex.com/
++% or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++% San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++
++% $Id$
++
++% viewrgb.ps
++% Display a raw RGB file created by -sDEVICE=bitrgb.
++% If SCALE is defined, maps input pixels to output pixels with that scale;
++% if SCALE is undefined, scales the image to fit the page.
++% If BITS is defined, it is the number of bits per sample (1,2,8,12).
++% NB: BITS=1 (corresponding to -dGrayValues=16) is not supported.
++% if BITS is undefined, its default value is 1.
++
++/viewrgb { % <filename> <width> viewrgb -
++ 20 dict begin
++ /w exch def
++ /fname exch def
++ /bpc /BITS where { pop BITS } { 1 } ifelse def
++ /f fname (r) file def
++ mark fname status pop pop pop /flen exch def cleartomark
++ /h flen
++ w [ 0 4 8 0 0 0 0 0 24 ] bpc get
++ dup 0 eq {
++ (*** -dBITS=) print bpc =print ( is not supported. ***) = flush
++ quit
++ } if
++ mul 7 add 8 idiv idiv def
++ QUIET not { (Dimensions: ) print [w h] == flush } if
++ % Set up scaling.
++ /SCALE where {
++ pop
++ % Map pixels SCALE-for-1. Assume orthogonal transformation.
++ SCALE 1 0 dtransform add abs div
++ SCALE 0 1 dtransform add abs div
++ } {
++ % Scale the image (uniformly) to fit the page.
++ clippath pathbbox pop pop translate
++ pathbbox 3 -1 roll sub h div
++ 3 1 roll exch sub w div .min dup
++ } ifelse scale
++ bpc 1 eq {
++ [ /Indexed /DeviceRGB 15 <
++ 000000
++ 0000FF
++ 00FF00
++ 00FFFF
++ FF0000
++ FF00FF
++ FFFF00
++ FFFFFF
++ 000000
++ 0000FF
++ 00FF00
++ 00FFFF
++ FF0000
++ FF00FF
++ FFFF00
++ FFFFFF
++ >
++ ] setcolorspace
++ /BPC 4 def % change to 4 bit indexed
++ } {
++ bpc 2 eq {
++ [ /Indexed /DeviceRGB 255 <
++ 000000 000055 0000AA 0000FF
++ 005500 005555 0055AA 0055FF
++ 00AA00 00AA55 00AAAA 00AAFF
++ 00FF00 00FF55 00FFAA 00FFFF
++ 550000 550055 5500AA 5500FF
++ 555500 555555 5555AA 5555FF
++ 55AA00 55AA55 55AAAA 55AAFF
++ 55FF00 55FF55 55FFAA 55FFFF
++ AA0000 AA0055 AA00AA AA00FF
++ AA5500 AA5555 AA55AA AA55FF
++ AAAA00 AAAA55 AAAAAA AAAAFF
++ AAFF00 AAFF55 AAFFAA AAFFFF
++ FF0000 FF0055 FF00AA FF00FF
++ FF5500 FF5555 FF55AA FF55FF
++ FFAA00 FFAA55 FFAAAA FFAAFF
++ FFFF00 FFFF55 FFFFAA FFFFFF
++
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
++ >
++ ] setcolorspace
++ /BPC 8 def % change to 4 bit indexed
++ } {
++ /DeviceRGB setcolorspace
++ /BPC bpc def
++ }
++ ifelse
++ }
++ ifelse
++ << /ImageType 1
++ /Width w
++ /Height h
++ /BitsPerComponent BPC
++ /ImageMatrix [1 0 0 -1 0 h]
++ /DataSource f
++ /MultipleDataSources false
++ bpc 4 lt { /Decode [ 0 [ 0 15 255 ] bpc get ] } { /Decode [ 0 1 0 1 0 1 ] } ifelse
++ >> image
++ showpage
++ f closefile
++ end
++} bind def
++
++% If the program was invoked from the command line, run it now.
++[ shellarguments {
++ counttomark 2 eq {
++ cvi viewrgb
++ } {
++ cleartomark
++ (\nUsage: gs -- viewrgb.ps filename.rgb width\n) print
++ ( e.g.: gs -- viewrgb.ps my.rgb 2550\n) print flush
++ ( -dSCALE=### sets specific scaling \(default = 1.0\)) = flush
++ ( -dBITS=# sets the BitsPerComponent \(1, 2, 8, 12] \(default = 1\)) = flush
++ } ifelse
++} {
++ pop
++} ifelse
+diff --git a/psi/dmmain.c b/psi/dmmain.c
+new file mode 100644
+--- /dev/null
++++ b/psi/dmmain.c
+@@ -0,0 +1,997 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++/* $Id$ */
++
++/* Ghostscript shlib example wrapper for Macintosh (Classic/Carbon) contributed
++ by Nigel Hathaway. Uses the Metrowerks CodeWarrior SIOUX command-line library.
++ */
++
++#if __ide_target("Ghostscript PPC (Debug)") || __ide_target("Ghostscript PPC (Release)")
++#define TARGET_API_MAC_CARBON 0
++#define TARGET_API_MAC_OS8 1
++#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
++#endif
++
++#include <Carbon.h>
++
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <console.h>
++#include <SIOUX.h>
++#include <SIOUXGlobals.h>
++#include <SIOUXMenus.h>
++
++#include "gscdefs.h"
++#define GSREVISION gs_revision
++#include "ierrors.h"
++#include "iapi.h"
++
++#if DEBUG
++#include "vdtrace.h"
++#endif
++
++#include "gdevdsp.h"
++
++#define kScrollBarWidth 15
++#define MAX_ARGS 25
++
++Boolean gRunningOnX = false;
++Boolean gDone;
++ControlActionUPP gActionFunctionScrollUPP;
++
++const char start_string[] = "systemdict /start get exec\n";
++void *instance;
++
++const unsigned int display_format = DISPLAY_COLORS_RGB | DISPLAY_UNUSED_FIRST |
++ DISPLAY_DEPTH_8 | DISPLAY_BIGENDIAN |
++ DISPLAY_TOPFIRST;
++typedef struct IMAGE_S IMAGE;
++struct IMAGE_S {
++ void *handle;
++ void *device;
++ WindowRef windowRef;
++ ControlRef scrollbarVertRef;
++ ControlRef scrollbarHorizRef;
++ PixMapHandle pixmapHdl;
++ UInt64 update_time;
++ int update_interval;
++ IMAGE *next;
++};
++
++IMAGE *first_image;
++
++static IMAGE *image_find(void *handle, void *device);
++
++static int GSDLLCALL gsdll_stdin(void *instance, char *buf, int len);
++static int GSDLLCALL gsdll_stdout(void *instance, const char *str, int len);
++static int GSDLLCALL gsdll_stderr(void *instance, const char *str, int len);
++static int GSDLLCALL gsdll_poll(void *handle);
++
++static int display_open(void *handle, void *device);
++static int display_preclose(void *handle, void *device);
++static int display_close(void *handle, void *device);
++static int display_presize(void *handle, void *device, int width, int height,
++ int raster, unsigned int format);
++static int display_size(void *handle, void *device, int width, int height,
++ int raster, unsigned int format, unsigned char *pimage);
++static int display_sync(void *handle, void *device);
++static int display_page(void *handle, void *device, int copies, int flush);
++static int display_update(void *handle, void *device,
++ int x, int y, int w, int h);
++
++static size_t get_input(void *ptr, size_t size);
++
++static void window_create (IMAGE *img);
++static void window_invalidate (WindowRef windowRef);
++static void window_adjust_scrollbars (WindowRef windowRef);
++
++void main (void);
++OSErr quitAppEventHandler (AppleEvent *,AppleEvent *,SInt32);
++void doEvents (EventRecord *);
++void doMouseDown (EventRecord *);
++void doUpdate (EventRecord *);
++void doUpdateWindow (EventRecord *);
++void doOSEvent (EventRecord *);
++void doInContent (EventRecord *,WindowRef);
++pascal void actionFunctionScroll (ControlRef,ControlPartCode);
++
++/*********************************************************************/
++/* stdio functions */
++static int GSDLLCALL
++gsdll_stdin(void *instance, char *buf, int len)
++{
++ if (isatty(fileno(stdin)))
++ return get_input(buf, len);
++ else
++ return fread(buf, 1, len, stdin);
++}
++
++static int GSDLLCALL
++gsdll_stdout(void *instance, const char *str, int len)
++{
++ int n = fwrite(str, 1, len, stdout);
++ fflush(stdout);
++ return n;
++}
++
++static int GSDLLCALL
++gsdll_stderr(void *instance, const char *str, int len)
++{
++ return gsdll_stdout(instance, str, len);
++}
++
++/* Poll the caller for cooperative multitasking. */
++/* If this function is NULL, polling is not needed */
++static int GSDLLCALL gsdll_poll(void *handle)
++{
++ EventRecord eventStructure;
++
++ while (WaitNextEvent(everyEvent, &eventStructure, 0, NULL))
++ doEvents(&eventStructure);
++
++ return (gDone ? e_Fatal : 0);
++}
++/*********************************************************************/
++
++/* new dll display device */
++
++/* New device has been opened */
++/* This is the first event from this device. */
++static int display_open(void *handle, void *device)
++{
++ IMAGE *img = (IMAGE *)malloc(sizeof(IMAGE));
++ if (img == NULL)
++ return -1;
++ memset(img, 0, sizeof(IMAGE));
++
++ /* add to list */
++ if (first_image)
++ img->next = first_image;
++ first_image = img;
++
++ /* remember device and handle */
++ img->handle = handle;
++ img->device = device;
++
++ /* create window */
++ window_create(img);
++
++ gsdll_poll(handle);
++ return 0;
++}
++
++/* Device is about to be closed. */
++/* Device will not be closed until this function returns. */
++static int display_preclose(void *handle, void *device)
++{
++ /* do nothing - no thread synchonisation needed */
++ return 0;
++}
++
++/* Device has been closed. */
++/* This is the last event from this device. */
++static int display_close(void *handle, void *device)
++{
++ IMAGE *img = image_find(handle, device);
++ if (img == NULL)
++ return -1;
++
++ gsdll_poll(handle);
++
++ /* remove from list */
++ if (img == first_image)
++ first_image = img->next;
++ else
++ {
++ IMAGE *tmp;
++ for (tmp = first_image; tmp!=0; tmp=tmp->next)
++ {
++ if (img == tmp->next)
++ tmp->next = img->next;
++ }
++ }
++
++ DisposePixMap(img->pixmapHdl); // need to go in doCloseWindow()
++ DisposeWindow(img->windowRef);
++
++ free(img);
++
++ return 0;
++}
++
++/* Device is about to be resized. */
++/* Resize will only occur if this function returns 0. */
++static int display_presize(void *handle, void *device, int width, int height,
++ int raster, unsigned int format)
++{
++ /* Check for correct format (32-bit RGB), fatal error if not */
++ if (format != display_format)
++ {
++ printf("DisplayFormat has been set to an incompatible value.\n");
++ fflush(stdout);
++ return e_rangecheck;
++ }
++
++ return 0;
++}
++
++/* Device has been resized. */
++/* New pointer to raster returned in pimage */
++static int display_size(void *handle, void *device, int width, int height,
++ int raster, unsigned int format, unsigned char *pimage)
++{
++ PixMapPtr pixmap;
++ IMAGE *img = image_find(handle, device);
++ if (img == NULL)
++ return -1;
++
++ /* Check that image is within allowable bounds */
++ if (raster > 0x3fff)
++ {
++ printf("QuickDraw can't cope with an image this big.\n");
++ fflush(stdout);
++ if (img->pixmapHdl)
++ {
++ DisposePixMap(img->pixmapHdl);
++ img->pixmapHdl = NULL;
++ }
++ return e_rangecheck;
++ }
++
++ /* Create the PixMap */
++ if (!img->pixmapHdl)
++ img->pixmapHdl = NewPixMap();
++
++ pixmap = *(img->pixmapHdl);
++ pixmap->baseAddr = (char*)pimage;
++ pixmap->rowBytes = (((SInt16)raster) & 0x3fff) | 0x8000;
++ pixmap->bounds.right = width;
++ pixmap->bounds.bottom = height;
++ pixmap->packType = 0;
++ pixmap->packSize = 0;
++ pixmap->pixelType = RGBDirect;
++ pixmap->pixelSize = 32;
++ pixmap->cmpCount = 3;
++ pixmap->cmpSize = 8;
++
++ /* Update the display window */
++ window_adjust_scrollbars(img->windowRef);
++ window_invalidate(img->windowRef);
++ return gsdll_poll(handle);
++}
++
++/* flushpage */
++static int display_sync(void *handle, void *device)
++{
++ IMAGE *img = image_find(handle, device);
++ if (img == NULL)
++ return -1;
++
++ window_invalidate(img->windowRef);
++ gsdll_poll(handle);
++
++ return 0;
++}
++
++/* showpage */
++/* If you want to pause on showpage, then don't return immediately */
++static int display_page(void *handle, void *device, int copies, int flush)
++{
++ return display_sync(handle, device);
++}
++
++/* Poll the caller for cooperative multitasking. */
++/* If this function is NULL, polling is not needed */
++static int display_update(void *handle, void *device,
++ int x, int y, int w, int h)
++{
++ UInt64 t1;
++ UInt64 t2;
++ int delta;
++ IMAGE *img = image_find(handle, device);
++ if (img == NULL)
++ return -1;
++
++ Microseconds((UnsignedWide*)&t1);
++ delta = (t1 - img->update_time) / 1000000L;
++ if (img->update_interval < 1)
++ img->update_interval = 1; /* seconds */
++ if (delta < 0)
++ img->update_time = t1;
++ else if (delta > img->update_interval)
++ {
++ /* redraw window */
++ window_invalidate(img->windowRef);
++
++ /* Make sure the update interval is at least 10 times
++ * what it takes to paint the window
++ */
++ Microseconds((UnsignedWide*)&t2);
++ delta = (t2 - t1) / 1000;
++ if (delta < 0)
++ delta += 60000; /* delta = time to redraw */
++ if (delta > img->update_interval * 100)
++ img->update_interval = delta/100;
++ img->update_time = t2;
++ }
++
++ return gsdll_poll(handle);
++}
++
++display_callback display = {
++ sizeof(display_callback),
++ DISPLAY_VERSION_MAJOR,
++ DISPLAY_VERSION_MINOR,
++ display_open,
++ display_preclose,
++ display_close,
++ display_presize,
++ display_size,
++ display_sync,
++ display_page,
++ display_update,
++ NULL, /* memalloc */
++ NULL, /* memfree */
++ NULL /* display_separation */
++};
++
++static IMAGE * image_find(void *handle, void *device)
++{
++ IMAGE *img;
++ for (img = first_image; img!=0; img=img->next) {
++ if ((img->handle == handle) && (img->device == device))
++ return img;
++ }
++ return NULL;
++}
++
++/*********************************************************************/
++
++static char *stdin_buf = NULL;
++static size_t stdin_bufpos = 0;
++static size_t stdin_bufsize = 0;
++
++/* This function is a fudge which allows the SIOUX window to be waiting for
++ input and not be modal at the same time. (Why didn't MetroWerks think of that?)
++ It is based on the SIOUX function ReadCharsFromConsole(), and contains an
++ event loop which allows other windows to be active.
++ It collects characters up to when the user presses ENTER, stores the complete
++ buffer and gives as much to the calling function as it wants until it runs
++ out, at which point it gets another line (or set of lines if pasting from the
++ clipboard) from the user.
++*/
++static size_t get_input(void *ptr, size_t size)
++{
++ EventRecord eventStructure;
++ long charswaiting, old_charswaiting = 0;
++ char *text;
++
++#if SIOUX_USE_WASTE
++ Handle textHandle;
++#endif
++
++ /* If needing more input, set edit start position */
++ if (!stdin_buf)
++#if SIOUX_USE_WASTE
++ SIOUXselstart = WEGetTextLength(SIOUXTextWindow->edit);
++#else
++ SIOUXselstart = (*SIOUXTextWindow->edit)->teLength;
++#endif
++
++ /* Wait until user presses exit (or quits) */
++ while(!gDone && !stdin_buf)
++ {
++#if SIOUX_USE_WASTE
++ charswaiting = WEGetTextLength(SIOUXTextWindow->edit) - SIOUXselstart;
++#else
++ if ((*SIOUXTextWindow->edit)->teLength > 0)
++ charswaiting = (*SIOUXTextWindow->edit)->teLength - SIOUXselstart;
++ else
++ charswaiting = ((unsigned short) (*SIOUXTextWindow->edit)->teLength) - SIOUXselstart;
++#endif
++
++ /* If something has happened, see if we need to do anything */
++ if (charswaiting != old_charswaiting)
++ {
++#if SIOUX_USE_WASTE
++ textHandle = WEGetText(SIOUXTextWindow->edit);
++ HLock(textHandle);
++ text = *textHandle + SIOUXselstart;
++#else
++ text = (*(*SIOUXTextWindow->edit)->hText) + SIOUXselstart;
++#endif
++ /* If user has pressed enter, gather up the buffer ready for returning */
++ if (text[charswaiting-1] == '\r')
++ {
++ stdin_buf = malloc(charswaiting);
++ if (!stdin_buf)
++ return -1;
++ stdin_bufsize = charswaiting;
++ memcpy(stdin_buf, text, stdin_bufsize);
++ SIOUXselstart += charswaiting;
++
++ text = stdin_buf;
++ while (text = memchr(text, '\r', charswaiting - (text - stdin_buf)))
++ *text = '\n';
++ }
++#if SIOUX_USE_WASTE
++ HUnlock(textHandle);
++#endif
++ old_charswaiting = charswaiting;
++
++ if (stdin_buf)
++ break;
++ }
++
++ /* Wait for next event and process it */
++ SIOUXState = SCANFING;
++
++ if(WaitNextEvent(everyEvent, &eventStructure, SIOUXSettings.sleep ,NULL))
++ doEvents(&eventStructure);
++ else
++ SIOUXHandleOneEvent(&eventStructure);
++
++ SIOUXState = IDLE;
++ }
++
++ /* If data has been entered, return as much as has been requested */
++ if (stdin_buf && !gDone)
++ {
++ if (size >= stdin_bufsize - stdin_bufpos)
++ {
++ size = stdin_bufsize - stdin_bufpos;
++ memcpy (ptr, stdin_buf + stdin_bufpos, size);
++ free(stdin_buf);
++ stdin_buf = NULL;
++ stdin_bufpos = 0;
++ stdin_bufsize = 0;
++ }
++ else
++ {
++ memcpy (ptr, stdin_buf + stdin_bufpos, size);
++ stdin_bufpos += size;
++ }
++ return size;
++ }
++ else if (stdin_buf)
++ {
++ free(stdin_buf);
++ stdin_buf = NULL;
++ stdin_bufpos = 0;
++ stdin_bufsize = 0;
++ }
++
++ return 0;
++}
++
++/*********************************************************************/
++
++static void window_create(IMAGE *img)
++{
++ WindowRef windowRef;
++ Str255 windowTitle = "\pGhostscript Image";
++ Rect windowRect = {20,4,580,420};//, portRect;
++ Rect scrollbarRect = {0,0,0,0};
++
++#if TARGET_API_MAC_CARBON
++ GetAvailableWindowPositioningBounds(GetMainDevice(),&windowRect);
++#endif
++
++ /* Create a new suitablty positioned window */
++ windowRect.top = windowRect.top * 2 + 2;
++ windowRect.bottom -= 10;
++ windowRect.left += 4;
++ windowRect.right = ((windowRect.bottom - windowRect.top) * 3) / 4 + windowRect.left;
++
++ if(!(windowRef = NewCWindow(NULL, &windowRect, windowTitle, true,
++ zoomDocProc, (WindowRef) -1, false, 0)))
++ ExitToShell();
++
++ img->windowRef = windowRef;
++
++ SetWRefCon(img->windowRef, (SInt32)img);
++
++ /* Create the window's scrollbars */
++#if TARGET_API_MAC_CARBON
++ if(gRunningOnX)
++ ChangeWindowAttributes(windowRef,kWindowLiveResizeAttribute,0);
++
++ CreateScrollBarControl(windowRef, &scrollbarRect, 0, 0, 0, 0,
++ true, gActionFunctionScrollUPP, &(img->scrollbarVertRef));
++
++ CreateScrollBarControl(windowRef, &scrollbarRect, 0, 0, 0, 0,
++ true, gActionFunctionScrollUPP, &(img->scrollbarHorizRef));
++#else
++ img->scrollbarVertRef = NewControl(windowRef,&scrollbarRect,"\p",false,0,0,0,scrollBarProc,0);
++ img->scrollbarHorizRef = NewControl(windowRef,&scrollbarRect,"\p",false,0,0,0,scrollBarProc,0);
++#endif
++
++ window_adjust_scrollbars(windowRef);
++}
++
++static void window_invalidate(WindowRef windowRef)
++{
++ Rect portRect;
++
++ GetWindowPortBounds(windowRef, &portRect);
++ InvalWindowRect(windowRef, &portRect);
++}
++
++static void window_adjust_scrollbars(WindowRef windowRef)
++{
++ IMAGE *img;
++ Rect portRect;
++
++ img = (IMAGE*)GetWRefCon(windowRef);
++ GetWindowPortBounds(windowRef,&portRect);
++
++ /* Move the crollbars to the edges of the window */
++ HideControl(img->scrollbarVertRef);
++ HideControl(img->scrollbarHorizRef);
++
++ MoveControl(img->scrollbarVertRef,portRect.right - kScrollBarWidth,
++ portRect.top - 1);
++ MoveControl(img->scrollbarHorizRef,portRect.left - 1,
++ portRect.bottom - kScrollBarWidth);
++
++ SizeControl(img->scrollbarVertRef,kScrollBarWidth + 1,
++ portRect.bottom - portRect.top - kScrollBarWidth + 1);
++ SizeControl(img->scrollbarHorizRef, portRect.right - portRect.left - kScrollBarWidth + 1,
++ kScrollBarWidth + 1);
++
++ /* Adjust the scroll position showing */
++ if (img->pixmapHdl)
++ {
++ PixMap *pixmap = *(img->pixmapHdl);
++ int visibleHeight = portRect.bottom - portRect.top - kScrollBarWidth;
++ int visibleWidth = portRect.right - portRect.left - kScrollBarWidth;
++
++ if (pixmap->bounds.bottom > visibleHeight)
++ {
++ SetControl32BitMaximum(img->scrollbarVertRef,
++ pixmap->bounds.bottom - visibleHeight);
++ SetControlViewSize(img->scrollbarVertRef,visibleHeight);
++ }
++ else
++ SetControlMaximum(img->scrollbarVertRef, 0);
++
++ if (pixmap->bounds.right > visibleWidth)
++ {
++ SetControl32BitMaximum(img->scrollbarHorizRef,
++ pixmap->bounds.right - visibleWidth);
++ SetControlViewSize(img->scrollbarHorizRef, visibleWidth);
++ }
++ else
++ SetControlMaximum(img->scrollbarHorizRef, 0);
++ }
++
++ ShowControl(img->scrollbarVertRef);
++ ShowControl(img->scrollbarHorizRef);
++}
++
++/*********************************************************************/
++void main(void)
++{
++ int code;
++ int exit_code;
++ int argc;
++ char **argv;
++ char dformat[64], ddevice[32];
++ SInt32 response;
++
++ /* Initialize operating environment */
++#if TARGET_API_MAC_CARBON
++ MoreMasterPointers(224);
++#else
++ MoreMasters();
++#endif
++ InitCursor();
++ FlushEvents(everyEvent,0);
++
++ if (AEInstallEventHandler(kCoreEventClass,kAEQuitApplication,
++ NewAEEventHandlerUPP((AEEventHandlerProcPtr) quitAppEventHandler),
++ 0L,false) != noErr)
++ ExitToShell();
++
++ gActionFunctionScrollUPP = NewControlActionUPP(&actionFunctionScroll);
++
++ Gestalt(gestaltMenuMgrAttr,&response);
++ if(response & gestaltMenuMgrAquaLayoutMask)
++ gRunningOnX = true;
++
++ /* Initialize SIOUX */
++ SIOUXSettings.initializeTB = false;
++ SIOUXSettings.standalone = false;
++ SIOUXSettings.asktosaveonclose = false;
++ SIOUXSettings.sleep = GetCaretTime();
++ SIOUXSettings.userwindowtitle = "\pGhostscript";
++
++ /* Get arguments from user */
++ argc = ccommand(&argv);
++
++ /* Show command line window */
++ if (InstallConsole(0))
++ ExitToShell();
++
++ /* Part of fudge to make SIOUX accept characters without becoming modal */
++ SelectWindow(SIOUXTextWindow->window);
++ PostEvent(keyDown, 0x4c00); // Enter
++ ReadCharsFromConsole(dformat, 0x7FFF);
++ clrscr();
++
++ /* Add in the display format as the first command line argument */
++ if (argc >= MAX_ARGS - 1)
++ {
++ printf("Too many command line arguments\n");
++ return;
++ }
++
++ memmove(&argv[3], &argv[1], (argc-1) * sizeof(char**));
++ argc += 2;
++ argv[1] = ddevice;
++ argv[2] = dformat;
++
++ sprintf(ddevice, "-sDEVICE=display");
++ sprintf(dformat, "-dDisplayFormat=%d", display_format);
++
++ /* Run Ghostscript */
++ if (gsapi_new_instance(&instance, NULL) < 0)
++ {
++ printf("Can't create Ghostscript instance\n");
++ return;
++ }
++
++#ifdef DEBUG
++ visual_tracer_init();
++ set_visual_tracer(&visual_tracer);
++#endif
++
++ gsapi_set_stdio(instance, gsdll_stdin, gsdll_stdout, gsdll_stderr);
++ gsapi_set_poll(instance, gsdll_poll);
++ gsapi_set_display_callback(instance, &display);
++
++ code = gsapi_init_with_args(instance, argc, argv);
++ if (code == 0)
++ code = gsapi_run_string(instance, start_string, 0, &exit_code);
++ else
++ {
++ printf("Failed to initialize. Error %d.\n", code);
++ fflush(stdout);
++ }
++ code = gsapi_exit(instance);
++ if (code != 0)
++ {
++ printf("Failed to terminate. Error %d.\n", code);
++ fflush(stdout);
++ }
++
++ gsapi_delete_instance(instance);
++
++#ifdef DEBUG
++ visual_tracer_close();
++#endif
++
++ /* Ghostscript has finished - let user see output before quitting */
++ WriteCharsToConsole("\r[Finished - hit any key to quit]", 33);
++ fflush(stdout);
++
++ /* Process events until a key is hit or user quits from menu */
++ while(!gDone)
++ {
++ EventRecord eventStructure;
++
++ if(WaitNextEvent(everyEvent,&eventStructure,SIOUXSettings.sleep,NULL))
++ {
++ if (eventStructure.what == keyDown)
++ gDone = true;
++
++ doEvents(&eventStructure);
++ }
++ else
++ SIOUXHandleOneEvent(&eventStructure);
++ }
++}
++
++/*********************************************************************/
++
++void doEvents(EventRecord *eventStrucPtr)
++{
++ WindowRef windowRef;
++
++ if (eventStrucPtr->what == mouseDown &&
++ FindWindow(eventStrucPtr->where,&windowRef) == inMenuBar)
++ SelectWindow(SIOUXTextWindow->window);
++
++ SIOUXSettings.standalone = true;
++ if (SIOUXHandleOneEvent(eventStrucPtr))
++ {
++ if (SIOUXQuitting)
++ gDone = true;
++ SIOUXSettings.standalone = false;
++ return;
++ }
++ SIOUXSettings.standalone = false;
++
++ switch(eventStrucPtr->what)
++ {
++ case kHighLevelEvent:
++ AEProcessAppleEvent(eventStrucPtr);
++ break;
++
++ case mouseDown:
++ doMouseDown(eventStrucPtr);
++ break;
++
++ case keyDown:
++ case autoKey:
++ break;
++
++ case updateEvt:
++ doUpdate(eventStrucPtr);
++ break;
++
++ case activateEvt:
++ DrawGrowIcon(windowRef);
++ break;
++
++ case osEvt:
++ doOSEvent(eventStrucPtr);
++ break;
++ }
++}
++
++void doMouseDown(EventRecord *eventStrucPtr)
++{
++ WindowRef windowRef;
++ WindowPartCode partCode, zoomPart;
++ BitMap screenBits;
++ Rect constraintRect, mainScreenRect;
++ Point standardStateHeightAndWidth;
++ long newSize;
++
++ partCode = FindWindow(eventStrucPtr->where,&windowRef);
++
++ switch(partCode)
++ {
++ case inMenuBar:
++ break;
++
++ case inContent:
++ if(windowRef != FrontWindow())
++ SelectWindow(windowRef);
++ else
++ doInContent(eventStrucPtr,windowRef);
++ break;
++
++ case inDrag:
++ DragWindow(windowRef,eventStrucPtr->where,NULL);
++ break;
++
++ case inGoAway:
++ break;
++
++ case inGrow:
++ constraintRect.top = 75;
++ constraintRect.left = 250;
++ constraintRect.bottom = constraintRect.right = 32767;
++ newSize = GrowWindow(windowRef,eventStrucPtr->where,&constraintRect);
++ if (newSize != 0)
++ SizeWindow(windowRef,LoWord(newSize),HiWord(newSize),true);
++ window_adjust_scrollbars(windowRef);
++ window_invalidate(windowRef);
++ break;
++
++ case inZoomIn:
++ case inZoomOut:
++ mainScreenRect = GetQDGlobalsScreenBits(&screenBits)->bounds;
++ standardStateHeightAndWidth.v = mainScreenRect.bottom;
++ standardStateHeightAndWidth.h = mainScreenRect.right;
++
++ if(IsWindowInStandardState(windowRef,&standardStateHeightAndWidth,NULL))
++ zoomPart = inZoomIn;
++ else
++ zoomPart = inZoomOut;
++
++ if(TrackBox(windowRef,eventStrucPtr->where,partCode))
++ {
++ ZoomWindowIdeal(windowRef,zoomPart,&standardStateHeightAndWidth);
++ window_adjust_scrollbars(windowRef);
++ }
++ break;
++ }
++}
++
++void doUpdate(EventRecord *eventStrucPtr)
++{
++ WindowRef windowRef;
++
++ windowRef = (WindowRef) eventStrucPtr->message;
++
++ window_adjust_scrollbars(windowRef);
++
++ BeginUpdate(windowRef);
++
++ SetPortWindowPort(windowRef);
++ doUpdateWindow(eventStrucPtr);
++
++ EndUpdate(windowRef);
++}
++
++void doUpdateWindow(EventRecord *eventStrucPtr)
++{
++ IMAGE *img;
++ WindowRef windowRef;
++ Rect srcRect, destRect, fillRect;
++ PixMapHandle srcPixmapHdl, destPixmapHdl;
++ RGBColor grayColour = { 0xC000,0xC000,0xC000 };
++ SInt32 hScroll, vScroll;
++
++ windowRef = (WindowRef) eventStrucPtr->message;
++ img = (IMAGE*)GetWRefCon(windowRef);
++ srcPixmapHdl = img->pixmapHdl;
++ destPixmapHdl = GetPortPixMap(GetWindowPort(windowRef));
++ hScroll = GetControl32BitValue(img->scrollbarHorizRef);
++ vScroll = GetControl32BitValue(img->scrollbarVertRef);
++
++ if (srcPixmapHdl)
++ {
++ PixMap *pixmap = *srcPixmapHdl;
++ PixPatHandle hdlPixPat = NewPixPat();
++ MakeRGBPat(hdlPixPat, &grayColour);
++
++ GetWindowPortBounds(windowRef,&destRect);
++ destRect.right -= kScrollBarWidth;
++ destRect.bottom -= kScrollBarWidth;
++
++ if (destRect.right > pixmap->bounds.right)
++ {
++ fillRect.top = destRect.top;
++ fillRect.bottom = destRect.bottom;
++ fillRect.left = pixmap->bounds.right;
++ fillRect.right = destRect.right;
++ FillCRect(&fillRect, hdlPixPat);
++ destRect.right = pixmap->bounds.right;
++ }
++ if (destRect.bottom > pixmap->bounds.bottom)
++ {
++ fillRect.top = pixmap->bounds.bottom;
++ fillRect.bottom = destRect.bottom;
++ fillRect.left = destRect.left;
++ fillRect.right = destRect.right;
++ FillCRect(&fillRect, hdlPixPat);
++ destRect.bottom = pixmap->bounds.bottom;
++ }
++ DisposePixPat(hdlPixPat);
++
++ srcRect = destRect;
++ srcRect.left += hScroll;
++ srcRect.right += hScroll;
++ srcRect.top += vScroll;
++ srcRect.bottom += vScroll;
++
++ CopyBits((BitMap*)*srcPixmapHdl, (BitMap*)*destPixmapHdl,
++ &srcRect, &destRect, srcCopy, NULL);
++ }
++
++ DrawGrowIcon(windowRef);
++}
++
++void doOSEvent(EventRecord *eventStrucPtr)
++{
++ switch((eventStrucPtr->message >> 24) & 0x000000FF)
++ {
++ case suspendResumeMessage:
++ if((eventStrucPtr->message & resumeFlag) == 1)
++ SetThemeCursor(kThemeArrowCursor);
++ break;
++ }
++}
++
++void doInContent(EventRecord *eventStrucPtr,WindowRef windowRef)
++{
++ ControlPartCode controlPartCode;
++ ControlRef controlRef;
++
++ SetPortWindowPort(windowRef);
++ GlobalToLocal(&eventStrucPtr->where);
++
++ if(controlRef = FindControlUnderMouse(eventStrucPtr->where,windowRef,&controlPartCode))
++ {
++#if TARGET_API_MAC_CARBON
++ TrackControl(controlRef,eventStrucPtr->where,(ControlActionUPP) -1);
++#else
++ if (controlPartCode == kControlIndicatorPart)
++ TrackControl(controlRef,eventStrucPtr->where,NULL);
++ else
++ TrackControl(controlRef,eventStrucPtr->where,gActionFunctionScrollUPP);
++#endif
++
++ window_invalidate(windowRef);
++ }
++}
++
++pascal void actionFunctionScroll(ControlRef controlRef,ControlPartCode controlPartCode)
++{
++ SInt32 scrollDistance, controlValue, oldControlValue, controlMax;
++
++ if(controlPartCode != kControlNoPart)
++ {
++ if(controlPartCode != kControlIndicatorPart)
++ {
++ switch(controlPartCode)
++ {
++ case kControlUpButtonPart:
++ case kControlDownButtonPart:
++ scrollDistance = 10;
++ break;
++
++ case kControlPageUpPart:
++ case kControlPageDownPart:
++ scrollDistance = 100;
++ break;
++
++ default:
++ scrollDistance = 0;
++ break;
++ }
++
++ if (scrollDistance)
++ {
++ if((controlPartCode == kControlDownButtonPart) ||
++ (controlPartCode == kControlPageDownPart))
++ scrollDistance = -scrollDistance;
++
++ controlValue = GetControl32BitValue(controlRef);
++
++ if(((controlValue == GetControl32BitMaximum(controlRef)) && scrollDistance < 0) ||
++ ((controlValue == GetControl32BitMinimum(controlRef)) && scrollDistance > 0))
++ return;
++
++ oldControlValue = controlValue;
++ controlMax = GetControl32BitMaximum(controlRef);
++ controlValue = oldControlValue - scrollDistance;
++
++ if(controlValue < 0)
++ controlValue = 0;
++ else if(controlValue > controlMax)
++ controlValue = controlMax;
++
++ SetControl32BitValue(controlRef,controlValue);
++ }
++ }
++ }
++}
++
++OSErr quitAppEventHandler(AppleEvent *appEvent,AppleEvent *reply,SInt32 handlerRefcon)
++{
++ OSErr osError;
++ DescType returnedType;
++ Size actualSize;
++
++ osError = AEGetAttributePtr(appEvent,keyMissedKeywordAttr,typeWildCard,&returnedType,NULL,0,
++ &actualSize);
++
++ if(osError == errAEDescNotFound)
++ {
++ gDone = true;
++ osError = noErr;
++ }
++ else if(osError == noErr)
++ osError = errAEParamMissed;
++
++ return osError;
++}
++
++/*********************************************************************/
++
+diff --git a/psi/dmmain.r b/psi/dmmain.r
+new file mode 100644
+--- /dev/null
++++ b/psi/dmmain.r
+@@ -0,0 +1,2537 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++/* $Id$ */
++
++/* Resource data (Rez format) for the MacOS Ghostscript shlib example wrapper
++ contributed by Nigel Hathaway. See dmmain.c for rest of this code.
++ */
++
++#include "Types.r"
++
++resource 'BNDL' (128) {
++ 'MCGS',
++ 0,
++ { /* array TypeArray: 2 elements */
++ /* [1] */
++ 'ICN#',
++ { /* array IDArray: 1 elements */
++ /* [1] */
++ 0, 128
++ },
++ /* [2] */
++ 'FREF',
++ { /* array IDArray: 2 elements */
++ /* [1] */
++ 0, 128,
++ /* [2] */
++ 1, 129
++ }
++ }
++};
++
++resource 'FREF' (128) {
++ 'APPL',
++ 0,
++ ""
++};
++
++resource 'FREF' (129) {
++ '****',
++ 1,
++ ""
++};
++
++data 'MWBB' (1008) {
++ $"0001 0000" /* .... */
++};
++
++data 'MPSR' (1005) {
++ $"0009 4D6F 6E61 636F 0000 0000 0000 0000" /* .ÆMonaco........ */
++ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
++ $"0000 0003 0004 0030 0004 01CA 027B 0030" /* .......0...Ê.{.0 */
++ $"0004 01CA 027B BA5E B2EF 0000 0000 0000" /* ...Ê.{º^²ï...... */
++ $"0000 0000 0000 0100" /* ........ */
++};
++
++resource 'ICN#' (128, "Application Icon") {
++ { /* array: 2 elements */
++ /* [1] */
++ $"0000 0000 0000 0800 0000 0A00 000B F200"
++ $"007F 4200 00FC 0700 01F0 1F80 03E0 1F80"
++ $"03E5 3FC0 03E0 1FC0 03E0 0FC0 03F0 0780"
++ $"01F8 8300 00FC 4600 003C 0800 00F4 0000"
++ $"03E0 0000 07E0 0000 07FF 6000 07FF FF00"
++ $"07FF FFC0 01FF FFE0 007F FFF0 0000 17F0"
++ $"0780 01F8 0F04 00F0 0E08 03E0 0F07 FFD0"
++ $"0780 D820 03F0 0380 007F FC00 0005 40",
++ /* [2] */
++ $"0000 1800 0000 1E00 0000 1E00 001F FF00"
++ $"00FF FF00 01FF FF00 03FF FF80 03FF FFC0"
++ $"07FF FFC0 07FF FFC0 07FF FFC0 03FF FFC0"
++ $"03FF FF80 01FF FF00 007F FE00 03FF F000"
++ $"07FF F800 07FF FE00 0FFF FF80 0FFF FFE0"
++ $"07FF FFF0 03FF FFF8 01FF FFF8 027F FFFC"
++ $"1FFF FFFC 1FFF FFFC 1FFF FFF8 1FFF FFF8"
++ $"1FFF FFF0 07FF FFC0 01FF FF00 007F FC"
++ }
++};
++
++resource 'ics#' (128, "Application Icon") {
++ { /* array: 2 elements */
++ /* [1] */
++ $"0000 00A0 0F10 1C78 1878 1C18 0E20 0600"
++ $"1800 3FD0 1FF8 057C 300C 3358 18A8 0340",
++ /* [2] */
++ $"0070 07F0 1FF0 1FF8 3FF8 3FF8 1FF8 1FF0"
++ $"3FF0 3FFC 3FFE 1FFE 7FFE 7FFE 7FFC 1FF0"
++ }
++};
++
++resource 'icl8' (128, "Application Icon") {
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 F600 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 5656 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00F6 FCF8 F900 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F6 56F9 FCAC"
++ $"FCFC ACFE F600 FFF6 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F5FA FDFF FFFF FFFF"
++ $"FD81 F800 00F7 FFF7 0000 0000 0000 0000"
++ $"0000 0000 0000 00F6 E0FF FFFF FFFD F92B"
++ $"0000 0000 F6AC FFFA 0000 0000 0000 0000"
++ $"0000 0000 0000 2BFF EAFF FFFE F700 0000"
++ $"0000 0056 FFFF FFFF 8100 0000 0000 0000"
++ $"0000 0000 0000 FCFF FFFF FF56 0000 00F5"
++ $"F500 FAFF FFFF FFFF FFF8 0000 0000 0000"
++ $"0000 0000 00F6 FFFF FFFF FE00 0079 0055"
++ $"F600 FBFF FFFF FFFF FFFD 0000 0000 0000"
++ $"0000 0000 002B FFFF FFFF FC00 007A F6F5"
++ $"4F00 00AC FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 00F6 FFFF FFFF FFF5 0000 F500"
++ $"0000 00F5 ACFF FFFF FFFC 0000 0000 0000"
++ $"0000 0000 0000 FCFF FFFF FF81 0000 0024"
++ $"F600 0000 F5FD FFFF FF2B 0000 0000 0000"
++ $"0000 0000 0000 F5FF FFFF FFFF 8100 0000"
++ $"7A7A 0000 00FA FFFF F800 0000 0000 0000"
++ $"0000 0000 0000 00F6 FDFF FFFF FFFB 0000"
++ $"F579 0000 00FB F4F8 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0056 FFFF FFFF F800"
++ $"0000 00F6 8181 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00F8 81FE FFFF FDFA F500"
++ $"0000 2BF7 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00F5 FCFF FFFF FBF6 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00AC FFFF FFFF FC2B 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 2BFF FFFF FFFF FFFF E0FC FC81"
++ $"FAF9 FAF7 2B00 0000 0000 0000 0000 0000"
++ $"0000 0000 F6FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF ACF9 F600 0000 0000 0000"
++ $"0000 0000 00FC FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF81 F600 0000 0000"
++ $"0000 0000 0000 FAFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FE2B 0000 0000"
++ $"0000 0000 0000 0000 F8FB FCFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFD 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00F5 F7F7"
++ $"2BF7 F8FA FAFD FFFF FFFF FFFF F900 0000"
++ $"0000 0000 F7AC FFFF FCF6 0000 0000 0000"
++ $"0000 0000 0000 F5FE FFFF FFFF F900 0000"
++ $"0000 00F6 FFFF FFFB 0000 0000 2B81 F700"
++ $"0000 0000 0000 00F9 FFFF FFFF 0000 0000"
++ $"0000 002B FFFF FF2B 0000 0000 FAFB 0000"
++ $"0000 0000 00F5 F8FF FFFF FEF6 F500 0000"
++ $"0000 00F5 FEFF FFFC 0000 0000 F5FC FDFC"
++ $"ACFC ACFC FDFF FFFF FF81 F556 F500 0000"
++ $"0000 0000 F8FF FFFF FBF5 0000 0000 F6FA"
++ $"81AC FCFC FCFA 562B F5F8 FCF5 0000 0000"
++ $"0000 0000 002B FCFF FFFE FCF9 F82B 0000"
++ $"0000 0000 2BF7 FAFC FD56 0000 0000 0000"
++ $"0000 0000 0000 00F7 FAFE FFFF FFFF FFFF"
++ $"FFFF FFFF FFAC 812B 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 F52B F9F9 FAF9"
++ $"FAF8 F72B F6"
++};
++
++resource 'icl4' (128, "Application Icon") {
++ $"0000 0000 0000 0000 0000 C000 0000 0000"
++ $"0000 0000 0000 0000 0000 CD00 0000 0000"
++ $"0000 0000 0000 0000 000C ECD0 0000 0000"
++ $"0000 0000 000C DDEE EEEE C0FC 0000 0000"
++ $"0000 0000 0DFF FFFF AEC0 0CFC 0000 0000"
++ $"0000 000C FFFF FEDC 0000 CEFD 0000 0000"
++ $"0000 00CA FFFA C000 000D AFFF D000 0000"
++ $"0000 00EF FFFD 000C 00DF FFFF FD00 0000"
++ $"0000 0CFF FFF0 0D0C C0EF FFFF FE00 0000"
++ $"0000 0CFF FFE0 07C0 C00E FFFF FF00 0000"
++ $"0000 00FF FFF0 0000 0000 EFFF FE00 0000"
++ $"0000 00EF FFFE 0000 C000 CAFF FC00 0000"
++ $"0000 000F FFFF D000 7D00 0DFF C000 0000"
++ $"0000 000C EFFF FE00 0D00 0EFD 0000 0000"
++ $"0000 0000 0DFF FFD0 000C DD00 0000 0000"
++ $"0000 000C EEFF AD00 00CC 0000 0000 0000"
++ $"0000 00EF FFE0 0000 0000 0000 0000 0000"
++ $"0000 0EFF FFEC 0000 0000 0000 0000 0000"
++ $"0000 CFFF FFFF FEED DDDC C000 0000 0000"
++ $"0000 CFFF FFFF FFFF FFFF FFED C000 0000"
++ $"0000 0EFF FFFF FFFF FFFF FFFF FDC0 0000"
++ $"0000 00DF FFFF FFFF FFFF FFFF FFAC 0000"
++ $"0000 0000 CEEF FFFF FFFF FFFF FFFE 0000"
++ $"0000 0000 0000 00CC CCDD DAFF FFFF D000"
++ $"0000 CEFF EC00 0000 0000 000F FFFF D000"
++ $"000C FFFE 0000 CEC0 0000 000D FFFF 0000"
++ $"000C FFFC 0000 DD00 0000 00DF FFF0 C000"
++ $"0000 FFFE 0000 0EFE EEEE FFFF FD0D 0000"
++ $"0000 CFFF E000 00CD DEEE EDDC 0DE0 0000"
++ $"0000 0CEF FFED CC00 0000 CCDD FC00 0000"
++ $"0000 000C DAFF FFFF FFFF FEEC 0000 0000"
++ $"0000 0000 000C DDDD DDCC"
++};
++
++resource 'ics8' (128, "Application Icon") {
++ $"0000 0000 0000 0000 0000 2B00 0000 0000"
++ $"0000 0000 0000 2B56 F8F9 F856 0000 0000"
++ $"0000 0000 FBFF FFFB 56F5 F7FC 0000 0000"
++ $"0000 00FC FFFD F500 00F9 FFFF F900 0000"
++ $"0000 F5FF FF56 2B2A F6FB FFFF FF00 0000"
++ $"0000 00FE FFFB 00F5 0000 FBFF FC00 0000"
++ $"0000 00F8 FFFF FA00 7900 F7FD F500 0000"
++ $"0000 00F5 F9FF FDF6 00F6 F800 0000 0000"
++ $"0000 2BEA FF56 0000 0000 0000 0000 0000"
++ $"0000 81FF FFFF FEFD FCFC FAF8 0000 0000"
++ $"0000 F6FE FFFF FFFF FFFF FFFF FEF7 0000"
++ $"0000 0000 2B56 FA81 81FC FDFF FFFF F600"
++ $"0000 ACFE 2B00 2BF5 0000 00F8 FFFF F500"
++ $"00F5 FFFC 0000 FA56 56F8 F9FD FE56 F500"
++ $"0000 56E0 FBF7 F6F6 F856 56F9 56F6 0000"
++ $"0000 0000 F881 FCAC FC81 FA2B"
++};
++
++resource 'ics4' (128, "Application Icon") {
++ $"0000 0000 00C0 0000 0000 00CD CDCD 0000"
++ $"0000 EFFD D0CE 0000 000E FA00 0DFF D000"
++ $"000F FDCC 0EFF F000 000F FE00 00EF E000"
++ $"000C FFD0 D0CE 0000 0000 DFF0 0CC0 0000"
++ $"00CF FD00 0000 0000 00DF FFFA EEDD 0000"
++ $"00CA FFFF FFFF FC00 0000 CDDE DEEF FFC0"
++ $"00EF C0C0 000C FF00 00FE 00DD CDDF AD00"
++ $"00DF DCC0 DCDD D000 0000 DDEE EDDC"
++};
++
++resource 'icm8' (128, "Application Icon") {
++ $"0000 0000 0000 0000 0000 F800 0000 0000"
++ $"0000 0000 2BFA FBAC 8156 F681 0000 0000"
++ $"0000 00FA FFFD F7F5 0056 FDFF F800 0000"
++ $"0000 F5FF FF56 2B2A F556 FFFF FF00 0000"
++ $"0000 00FB FFFE F600 4F00 56FF F800 0000"
++ $"0000 00F5 81EA FEF5 00F6 F8F6 0000 0000"
++ $"0000 F8FF FFFA 2BF6 F600 0000 0000 0000"
++ $"0000 56FF FFFF FFFF FFFF E0FC F9F5 0000"
++ $"0000 00F6 F981 FBFC FCAC FDFF FFFD F500"
++ $"0000 FDFD F600 F700 0000 0056 FFFE F500"
++ $"0000 ACFE 2B00 F7F9 8181 FBFB 81F7 0000"
++ $"0000 00F7 FAFB FBFA FAF9 56F8 F6"
++};
++
++resource 'icm4' (128, "Application Icon") {
++ $"0000 0000 00C0 0000 0000 CDEE ECCE 0000"
++ $"000D FAC0 0DEF C000 000F FD0C 0DFF F000"
++ $"000E FFC0 C0DF C000 0000 DFEC 00CC 0000"
++ $"00CF FDC0 C000 0000 00DF FFFF FFFE D000"
++ $"000C DDEE EEFF FF00 00AE C0C0 000D FEC0"
++ $"00FE C0CD DEDE DC00 000C DDED DDDC C0"
++};
++
++resource 'icm#' (128, "Application Icon") {
++ { /* array: 2 elements */
++ /* [1] */
++ $"0000 0350 1C30 1C78 1C10 0620 1900 3FF8"
++ $"0B7C 300C 31B0 0720",
++ /* [2] */
++ $"0070 0FF0 1FF8 3FF8 3FF8 1FF0 3FF8 3FFC"
++ $"1FFE 7FFE 7FFE 3FF8"
++ }
++};
++
++resource 'icns' (128, "Application Icon") {
++ { /* array elementArray: 20 elements */
++ /* [1] */
++ 'ICN#',
++ $"0000 0000 0000 0800 0000 0A00 000B F200"
++ $"007F 4200 00FC 0700 01F0 1F80 03E0 1F80"
++ $"03E5 3FC0 03E0 1FC0 03E0 0FC0 03F0 0780"
++ $"01F8 8300 00FC 4600 003C 0800 00F4 0000"
++ $"03E0 0000 07E0 0000 07FF 6000 07FF FF00"
++ $"07FF FFC0 01FF FFE0 007F FFF0 0000 17F0"
++ $"0780 01F8 0F04 00F0 0E08 03E0 0F07 FFD0"
++ $"0780 D820 03F0 0380 007F FC00 0005 4000"
++ $"0000 1800 0000 1E00 0000 1E00 001F FF00"
++ $"00FF FF00 01FF FF00 03FF FF80 03FF FFC0"
++ $"07FF FFC0 07FF FFC0 07FF FFC0 03FF FFC0"
++ $"03FF FF80 01FF FF00 007F FE00 03FF F000"
++ $"07FF F800 07FF FE00 0FFF FF80 0FFF FFE0"
++ $"07FF FFF0 03FF FFF8 01FF FFF8 027F FFFC"
++ $"1FFF FFFC 1FFF FFFC 1FFF FFF8 1FFF FFF8"
++ $"1FFF FFF0 07FF FFC0 01FF FF00 007F FC00",
++ /* [2] */
++ 'icl4',
++ $"0000 0000 0000 0000 0000 C000 0000 0000"
++ $"0000 0000 0000 0000 0000 CD00 0000 0000"
++ $"0000 0000 0000 0000 000C ECD0 0000 0000"
++ $"0000 0000 000C DDEE EEEE C0FC 0000 0000"
++ $"0000 0000 0DFF FFFF AEC0 0CFC 0000 0000"
++ $"0000 000C FFFF FEDC 0000 CEFD 0000 0000"
++ $"0000 00CA FFFA C000 000D AFFF D000 0000"
++ $"0000 00EF FFFD 000C 00DF FFFF FD00 0000"
++ $"0000 0CFF FFF0 0D0C C0EF FFFF FE00 0000"
++ $"0000 0CFF FFE0 07C0 C00E FFFF FF00 0000"
++ $"0000 00FF FFF0 0000 0000 EFFF FE00 0000"
++ $"0000 00EF FFFE 0000 C000 CAFF FC00 0000"
++ $"0000 000F FFFF D000 7D00 0DFF C000 0000"
++ $"0000 000C EFFF FE00 0D00 0EFD 0000 0000"
++ $"0000 0000 0DFF FFD0 000C DD00 0000 0000"
++ $"0000 000C EEFF AD00 00CC 0000 0000 0000"
++ $"0000 00EF FFE0 0000 0000 0000 0000 0000"
++ $"0000 0EFF FFEC 0000 0000 0000 0000 0000"
++ $"0000 CFFF FFFF FEED DDDC C000 0000 0000"
++ $"0000 CFFF FFFF FFFF FFFF FFED C000 0000"
++ $"0000 0EFF FFFF FFFF FFFF FFFF FDC0 0000"
++ $"0000 00DF FFFF FFFF FFFF FFFF FFAC 0000"
++ $"0000 0000 CEEF FFFF FFFF FFFF FFFE 0000"
++ $"0000 0000 0000 00CC CCDD DAFF FFFF D000"
++ $"0000 CEFF EC00 0000 0000 000F FFFF D000"
++ $"000C FFFE 0000 CEC0 0000 000D FFFF 0000"
++ $"000C FFFC 0000 DD00 0000 00DF FFF0 C000"
++ $"0000 FFFE 0000 0EFE EEEE FFFF FD0D 0000"
++ $"0000 CFFF E000 00CD DEEE EDDC 0DE0 0000"
++ $"0000 0CEF FFED CC00 0000 CCDD FC00 0000"
++ $"0000 000C DAFF FFFF FFFF FEEC 0000 0000"
++ $"0000 0000 000C DDDD DDCC 0000 0000 0000",
++ /* [3] */
++ 'icl8',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 F600 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 5656 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00F6 FCF8 F900 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F6 56F9 FCAC"
++ $"FCFC ACFE F600 FFF6 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F5FA FDFF FFFF FFFF"
++ $"FD81 F800 00F7 FFF7 0000 0000 0000 0000"
++ $"0000 0000 0000 00F6 E0FF FFFF FFFD F92B"
++ $"0000 0000 F6AC FFFA 0000 0000 0000 0000"
++ $"0000 0000 0000 2BFF EAFF FFFE F700 0000"
++ $"0000 0056 FFFF FFFF 8100 0000 0000 0000"
++ $"0000 0000 0000 FCFF FFFF FF56 0000 00F5"
++ $"F500 FAFF FFFF FFFF FFF8 0000 0000 0000"
++ $"0000 0000 00F6 FFFF FFFF FE00 0079 0055"
++ $"F600 FBFF FFFF FFFF FFFD 0000 0000 0000"
++ $"0000 0000 002B FFFF FFFF FC00 007A F6F5"
++ $"4F00 00AC FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 00F6 FFFF FFFF FFF5 0000 F500"
++ $"0000 00F5 ACFF FFFF FFFC 0000 0000 0000"
++ $"0000 0000 0000 FCFF FFFF FF81 0000 0024"
++ $"F600 0000 F5FD FFFF FF2B 0000 0000 0000"
++ $"0000 0000 0000 F5FF FFFF FFFF 8100 0000"
++ $"7A7A 0000 00FA FFFF F800 0000 0000 0000"
++ $"0000 0000 0000 00F6 FDFF FFFF FFFB 0000"
++ $"F579 0000 00FB F4F8 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0056 FFFF FFFF F800"
++ $"0000 00F6 8181 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00F8 81FE FFFF FDFA F500"
++ $"0000 2BF7 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00F5 FCFF FFFF FBF6 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00AC FFFF FFFF FC2B 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 2BFF FFFF FFFF FFFF E0FC FC81"
++ $"FAF9 FAF7 2B00 0000 0000 0000 0000 0000"
++ $"0000 0000 F6FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF ACF9 F600 0000 0000 0000"
++ $"0000 0000 00FC FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF81 F600 0000 0000"
++ $"0000 0000 0000 FAFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FE2B 0000 0000"
++ $"0000 0000 0000 0000 F8FB FCFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFD 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00F5 F7F7"
++ $"2BF7 F8FA FAFD FFFF FFFF FFFF F900 0000"
++ $"0000 0000 F7AC FFFF FCF6 0000 0000 0000"
++ $"0000 0000 0000 F5FE FFFF FFFF F900 0000"
++ $"0000 00F6 FFFF FFFB 0000 0000 2B81 F700"
++ $"0000 0000 0000 00F9 FFFF FFFF 0000 0000"
++ $"0000 002B FFFF FF2B 0000 0000 FAFB 0000"
++ $"0000 0000 00F5 F8FF FFFF FEF6 F500 0000"
++ $"0000 00F5 FEFF FFFC 0000 0000 F5FC FDFC"
++ $"ACFC ACFC FDFF FFFF FF81 F556 F500 0000"
++ $"0000 0000 F8FF FFFF FBF5 0000 0000 F6FA"
++ $"81AC FCFC FCFA 562B F5F8 FCF5 0000 0000"
++ $"0000 0000 002B FCFF FFFE FCF9 F82B 0000"
++ $"0000 0000 2BF7 FAFC FD56 0000 0000 0000"
++ $"0000 0000 0000 00F7 FAFE FFFF FFFF FFFF"
++ $"FFFF FFFF FFAC 812B 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 F52B F9F9 FAF9"
++ $"FAF8 F72B F600 0000 0000 0000 0000 0000",
++ /* [4] */
++ 'il32',
++ $"91FF 00DF 9CFF 01A0 909A FF03 D350 AF80"
++ $"91FF 02CF A080 8140 0538 24D5 FF00 DF8D"
++ $"FF02 EF80 2081 0008 0420 60A2 FFFF BF00"
++ $"BF8C FF01 CF10 8100 022C 86BF 81FF 03DF"
++ $"3000 728B FF01 CF10 8000 0110 B083 FF01"
++ $"9410 8000 0066 8AFF 0040 8100 00A2 80FF"
++ $"03E5 E3FF 7C83 0000 A088 FF00 DF81 0008"
++ $"10FF FF82 FF91 C7FF 6083 0000 3088 FF00"
++ $"BF81 0009 40FF FF66 E3D5 BAFF F330 8300"
++ $"88FF 00DF 8200 03EF FFF1 E381 FF01 EF30"
++ $"8100 0044 89FF 004C 8100 006C 80FF 01F1"
++ $"C780 FF05 EF20 0000 04C5 89FF 01DF 1081"
++ $"0000 6C80 FF01 7458 80FF 0380 0000 A08B"
++ $"FF01 D120 8100 0460 FFFF E382 80FF 0254"
++ $"10A2 8EFF 0192 0280 0000 A081 FF03 DB64"
++ $"60EF 8DFF 07AF 6412 0204 2080 EF80 FF01"
++ $"CFBB 8EFF 01EF 4480 0001 50CF 96FF 0040"
++ $"8100 0150 CF95 FF00 CF84 0003 1040 4268"
++ $"8080 01BF D18C FF01 CF02 8D00 0238 92DF"
++ $"89FF 0044 8F00 0204 62DF 88FF 0070 9000"
++ $"0110 CF89 FF02 A060 408D 0001 22EF 8DFF"
++ $"00DF 81BF 04A0 8070 2002 8200 0090 84FF"
++ $"05B4 3600 0046 DB89 FF01 DF20 8100 0090"
++ $"83FF 00DF 8000 0058 81FF 02CF 68BF 85FF"
++ $"0080 8000 0110 EF83 FF00 BF80 0000 BF81"
++ $"FF01 705A 84FF 07EF A410 0000 10CF EF83"
++ $"FF04 EF10 0000 5281 FF02 EF42 2082 4000"
++ $"2681 0003 68E7 96EF 84FF 05A2 0200 0052"
++ $"EF81 FF02 D380 6080 4007 4480 90BF EFA4"
++ $"54EF 86FF 08C3 4000 0010 5080 AFCF 83FF"
++ $"05CF AF80 4C24 A28A FF02 BF70 2086 0004"
++ $"0400 3260 C38F FF02 EFBF 9081 8003 A0BF"
++ $"C7DF 88FF 91FF 00DE 9BFF 02FE A090 9AFF"
++ $"03D3 50AF 8091 FF02 CFA0 8081 4005 3824"
++ $"D4FF 00DF 8DFF 02EF 8020 8100 0804 2060"
++ $"A2FF FFBF 00BF 8CFF 01CF 1081 0002 2C85"
++ $"BF81 FF03 DF30 0072 8BFF 01CF 1080 0001"
++ $"10B0 83FF 0194 1080 0000 668A FF00 4081"
++ $"0000 A280 FF03 ECEB FF7C 8300 00A0 88FF"
++ $"00DF 8100 0810 FFFF A6FF B1D7 FF60 8300"
++ $"002F 88FF 00BF 8100 0940 FFFF 92EB E1CE"
++ $"FFF2 3083 0088 FF00 DE82 0003 EFFF F5EB"
++ $"81FF 01EF 3081 0000 4489 FF00 4C81 0000"
++ $"6B80 FF01 F5D7 80FF 05EF 2000 0004 C589"
++ $"FF01 DF10 8100 006B 80FF 019C 8780 FF03"
++ $"8000 00A0 8BFF 01D1 2081 0004 60FF FFEB"
++ $"A680 FF02 5410 A28E FF01 9202 8000 00A0"
++ $"81FF 03DB 6360 EF8D FF07 AF64 1202 0420"
++ $"80EF 80FF 01CF BB8E FF01 EF44 8000 0150"
++ $"CF96 FF00 3F81 0001 50CF 95FF 00CF 8400"
++ $"0310 4042 6880 8001 BFD1 8CFF 01CF 028D"
++ $"0002 3892 DF89 FF00 448F 0002 0462 DF88"
++ $"FF00 7090 0001 10CF 89FF 02A0 6040 8D00"
++ $"0122 EF8D FF00 DF81 BF04 9F80 7020 0282"
++ $"0000 9084 FF05 B336 0000 46DB 89FF 01DF"
++ $"2081 0000 9083 FF00 DF80 0000 5881 FF04"
++ $"CF68 BFFE FE83 FF00 8080 0001 10EF 83FF"
++ $"00BF 8000 00BF 81FF 0170 5A84 FF07 EFA4"
++ $"1000 0010 CFEE 83FF 04EF 1000 0052 81FF"
++ $"08EF 4220 4040 3F3F 4026 8100 0368 E795"
++ $"EF84 FF05 A102 0000 52EF 81FF 0DD3 8060"
++ $"403F 3F43 8090 BFEF A354 EF86 FF08 C340"
++ $"0000 1050 80AF CF82 FF06 FECF AF7F 4C24"
++ $"A28A FF02 BF70 2086 0004 0400 3260 C38F"
++ $"FF02 EFBF 9081 8003 A0BF C7DF 88FF 90FF"
++ $"01FE DC9B FF03 FCA0 90FE 99FF 03D3 50AF"
++ $"8091 FF02 CFA0 7F81 4005 3C24 D8FF 00DF"
++ $"8DFF 02ED 8020 8100 0804 1E60 A4FF FFBF"
++ $"00BF 8CFF 01CF 0F81 0003 2C80 BEFD 80FF"
++ $"03DF 3000 748B FF01 CF10 8000 0110 B082"
++ $"FF02 FE94 1080 0000 6C8A FF00 4081 0000"
++ $"A480 FF03 F0EF FF7C 8300 00A0 88FF 00DE"
++ $"8100 0810 FFFF B8FF C2DF FF5F 8300 002E"
++ $"88FF 00BF 8100 0940 FFFF A7ED E7D8 FFF0"
++ $"2F83 0088 FF00 DC82 0003 EFFF F6EE 81FF"
++ $"01EE 3081 0000 4489 FF00 4C81 000E 6AFD"
++ $"FFFF F6DE FDFF FFEF 2000 0008 C589 FF01"
++ $"DE10 8100 056A FFFF FEAF 9E80 FF03 8000"
++ $"00A0 8BFF 01D2 2081 0004 60FF FFEF B880"
++ $"FF02 5410 A48E FF01 9404 8000 00A0 81FF"
++ $"03DB 645F EF8C FF08 FDAF 6414 0404 1F80"
++ $"EE80 FF01 CEBB 8EFF 01EF 4680 0002 50CE"
++ $"FE95 FF00 3E81 0001 4ECE 95FF 00CD 8400"
++ $"0310 4044 6880 8001 BFD2 8CFF 01CF 048D"
++ $"0002 3894 DF89 FF00 478F 0002 0464 DF88"
++ $"FF00 6F90 0001 10CF 88FF 03FE A060 408D"
++ $"0001 23ED 86FF 00FE 83FF 00DF 81BF 049C"
++ $"8070 2004 8200 0090 83FF 07FE B23C 0000"
++ $"48DA FD88 FF01 DF20 8100 0090 83FF 00DF"
++ $"8000 0057 81FF 04CF 70BF FCFC 82FF 01FE"
++ $"8080 0001 10ED 83FF 00BF 8000 00BF 81FF"
++ $"0270 58FD 83FF 07EF A410 0000 10CF EC83"
++ $"FF04 EF10 0000 5481 FF08 ED44 2040 403D"
++ $"3D40 2881 0003 68E7 9AEF 83FF 06FE A304"
++ $"0000 53EF 81FF 0DD2 8060 3E3C 3C45 8090"
++ $"BEEE A357 EF86 FF14 C240 0000 1050 80AF"
++ $"CFFF FDFF FFFE FCCF AF7A 4C24 A48A FF02"
++ $"BE70 1E86 0004 0800 3460 C78E FF03 FDEF"
++ $"BF90 8180 04A0 BFCA DFFD 87FF",
++ /* [5] */
++ 'l8mk',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0005 FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0005 FFFF 0500 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 05FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0005 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0500 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 0005 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0005 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
++ $"FFFF FFFF FF05 0000 0000 0000 0000 0000",
++ /* [6] */
++ 'ich#',
++ $"0000 0000 0000 0000 0001 0000 0000 0002"
++ $"8000 0000 0002 4000 0000 000C 4000 0000"
++ $"1FFC 6000 0001 FFE0 6000 0007 FF00 E000"
++ $"000F F801 F000 003F E003 F800 003F 800F"
++ $"FC00 007F 800F FC00 007F 091F FE00 007F"
++ $"010F FE00 00FF 0887 FE00 007F 8003 FE00"
++ $"007F 8001 FC00 003F C000 FC00 003F E0C0"
++ $"F000 001F F020 7000 000F F840 C000 0001"
++ $"F801 8000 0003 FC0E 0000 000F F000 0000"
++ $"007F 0000 0000 007E 0000 0000 00FF 8000"
++ $"0000 01FF F690 0000 01FF FFFF 0000 01FF"
++ $"FFFF F000 00FF FFFF FC00 007F FFFF FF00"
++ $"003F FFFF FF80 0007 FFFF FFC0 0000 5FFF"
++ $"FFC0 0000 0001 FFE0 01FC 0000 1FE0 03F0"
++ $"0000 1FC0 03E0 1800 1FC0 03E0 3000 1F80"
++ $"07E0 1801 FF00 03F0 0FFF FC40 01F8 02FF"
++ $"4100 00FC 0000 0E00 007F C000 F800 000F"
++ $"FFFF C000 0001 FFFE 0000 0000 0480 0000"
++ $"0000 0006 0000 0000 0007 4000 0000 0007"
++ $"8000 0000 0007 C000 0000 100F E000 0000"
++ $"7FFF E000 0003 FFFF E000 000F FFFF E000"
++ $"001F FFFF F000 003F FFFF F800 007F FFFF"
++ $"FC00 007F FFFF FE00 00FF FFFF FE00 00FF"
++ $"FFFF FE00 00FF FFFF FE00 00FF FFFF FE00"
++ $"00FF FFFF FE00 007F FFFF FC00 007F FFFF"
++ $"F800 001F FFFF F000 001F FFFF F000 0007"
++ $"FFFF C000 0003 FFFE 0000 007F FFFC 0000"
++ $"007F FFFE 0000 00FF FFFF 8000 01FF FFFF"
++ $"C000 03FF FFFF F800 01FF FFFF FC00 01FF"
++ $"FFFF FF00 01FF FFFF FF80 00FF FFFF FFC0"
++ $"007F FFFF FFE0 001F FFFF FFF0 0000 FFFF"
++ $"FFF0 0043 FFFF FFF0 03FF FFFF FFF0 07FF"
++ $"FFFF FFF0 07FF FFFF FFF0 07FF FFFF FFE0"
++ $"07FF FFFF FFE0 03FF FFFF FFC0 07FF FFFF"
++ $"FF80 01FF FFFF FF00 01FF FFFF FE00 001F"
++ $"FFFF F000 0007 FFFF 8000 0000 3FE4 0000",
++ /* [7] */
++ 'ich4',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00CE 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00DC"
++ $"D000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00F0 DD00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 DAE0"
++ $"CFC0 0000 0000 0000 0000 0000 0000 0000"
++ $"0CDE EFFF FFFF FE00 0FA0 0000 0000 0000"
++ $"0000 0000 0000 00DE FFFF FFFF FFED C000"
++ $"CFF0 0000 0000 0000 0000 0000 0000 CFFF"
++ $"FFFF FFFF C000 0000 EFF0 0000 0000 0000"
++ $"0000 0000 000C FFFF FFFF ECC0 0000 000D"
++ $"FFFD 0000 0000 0000 0000 0000 00DF FFFF"
++ $"FFD0 0000 0000 0CFF FFFF E000 0000 0000"
++ $"0000 0000 0CFF FFFF FD00 0000 0000 EFFF"
++ $"FFFF FE00 0000 0000 0000 0000 0AFF FFFF"
++ $"F000 0000 C00D FFFF FFFF FFC0 0000 0000"
++ $"0000 0000 CFFF FFFF D000 D00D C00D FFFF"
++ $"FFFF FFE0 0000 0000 0000 0000 CFFF FFFF"
++ $"0000 9007 C00C FFFF FFFF FFF0 0000 0000"
++ $"0000 0000 CFFF FFFF 0000 7C00 C000 CAFF"
++ $"FFFF FFF0 0000 0000 0000 0000 CFFF FFFF"
++ $"D000 0C00 0000 00FF FFFF FFE0 0000 0000"
++ $"0000 0000 0FFF FFFF F000 0000 0000 000F"
++ $"FFFF FFC0 0000 0000 0000 0000 0DFF FFFF"
++ $"FD00 0000 CC00 000C FFFF FE00 0000 0000"
++ $"0000 0000 00AF FFFF FFD0 0000 7DD0 0000"
++ $"EFFF E000 0000 0000 0000 0000 000E FFFF"
++ $"FFFE 0000 0690 0000 DFFE 0000 0000 0000"
++ $"0000 0000 000C EFFF FFFF E000 0CC0 000C"
++ $"FFDC 0000 0000 0000 0000 0000 0000 0CDF"
++ $"FFFF FD00 0000 00DF E000 0000 0000 0000"
++ $"0000 0000 0000 00EF FFFF FD00 0000 DED0"
++ $"0000 0000 0000 0000 0000 0000 00CD EFFF"
++ $"FFAE C000 000C C000 0000 0000 0000 0000"
++ $"0000 0000 0DFF FFFE DC00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 DFFF FFFD"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 000C FFFF FFFE DC00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 000E FFFF FFFF"
++ $"FFFE EDED CCDC C000 0000 0000 0000 0000"
++ $"0000 000F FFFF FFFF FFFF FFFF FFFF FFFD"
++ $"DC00 0000 0000 0000 0000 000E FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFED C000 0000 0000"
++ $"0000 000C FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FED0 0000 0000 0000 0000 CFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFA 0000 0000"
++ $"0000 0000 0CAF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF EC00 0000 0000 0000 0000 DEAF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FE00 0000"
++ $"0000 0000 0000 0000 CDDD EFFF FFFF FFFF"
++ $"FFFF FFFF FFC0 0000 0000 0000 0000 0000"
++ $"0000 0000 000C CCDD FFFF FFFF FFE0 0000"
++ $"0000 00CD EFFF FDC0 0000 0000 0000 0000"
++ $"00DF FFFF FFE0 0000 0000 00EF FFFF C000"
++ $"0000 0000 0000 0000 000A FFFF FFC0 0000"
++ $"0000 0CFF FFFC 0000 000F ECC0 0000 0000"
++ $"000E FFFF FF00 0000 0000 0CFF FFF0 0000"
++ $"00DF D000 0000 0000 0CDF FFFF A000 0000"
++ $"0000 0DFF FFFC 0000 00CF AC00 0000 00CD"
++ $"EAFF FFFE 0CC0 0000 0000 00AF FFFE 0000"
++ $"0000 EFFF FFFF FFFF FFFF FED0 CD00 0000"
++ $"0000 00CF FFFF E000 0000 0CDE EFFF FFFE"
++ $"EDDC 00CE D000 0000 0000 000C FFFF FFC0"
++ $"0000 0000 0000 0000 000C DFFC 0000 0000"
++ $"0000 0000 0DFF FFFF EEDC C000 0000 00CC"
++ $"DEEA FD00 0000 0000 0000 0000 000C EFFF"
++ $"FFFF FFFF FFFF FFFF FFDC 0000 0000 0000"
++ $"0000 0000 0000 00CD FFFF FFFF FFFF FEFD"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00CC CCDC CD00 0000 0000 0000 0000 0000",
++ /* [8] */
++ 'ich8',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 F6AC"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 81F6"
++ $"FA00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00F5 FF00"
++ $"5681 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 FAAC 8100"
++ $"2BFF 2B00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00F8 F9FB FBFF FFFF FFFF FFFE FFAC F500"
++ $"00FF FD00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 F9AC"
++ $"FFFF FFFF FFFF FFFF FFFF ACFA F600 0000"
++ $"2BFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 F8FF FFFF"
++ $"FFFF FFFF FFFF FFFF F800 0000 0000 0000"
++ $"FBFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F8 FFFF FFFF"
++ $"FFFF FFFF FBF7 F600 0000 0000 0000 F5FA"
++ $"FFFF FFFA 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 F9FF FFFF FFFF"
++ $"FFFF FA00 0000 0000 0000 0000 00F8 FEFF"
++ $"FFFF FFFF 8100 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00F8 FFFF FFFF FFFF"
++ $"FFF9 0000 0000 0000 0000 0000 FCFF FFFF"
++ $"FFFF FFFF FFFC 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00AC FFFF FFFF FFFF"
++ $"FFF6 0000 0000 00F6 F600 00F9 FFFF FFFF"
++ $"FFFF FFFF FFFF 2B00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F5FF FFFF FFFF FFFF"
++ $"F900 0000 7A00 007A 4F00 00FA FFFF FFFF"
++ $"FFFF FFFF FFFF FB00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
++ $"0000 0000 C800 0079 2B00 00F6 FEFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
++ $"0000 0000 A5F6 00F5 5500 0000 F6FE FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 2BFF FFFF FFFF FFFF"
++ $"FA00 0000 F52A 0000 0000 0000 00F5 FEFF"
++ $"FFFF FFFF FFFF FC00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 F6FF"
++ $"FFFF FFFF FFFF F800 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00F9 FFFF FFFF FFFF"
++ $"FF81 0000 0000 00F5 4FF5 0000 0000 00F6"
++ $"FFFF FFFF FFFC 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FDFF FFFF FFFF"
++ $"FFFF 8100 0000 0000 55C9 5500 0000 0000"
++ $"FBFF FFFF FB00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00AC FFFF FFFF"
++ $"FFFF FFAC 0000 0000 25A4 C900 0000 0000"
++ $"FBFF FFFD 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F5 ACFF FFFF"
++ $"FFFF FFFF FB00 0000 0055 2B00 0000 00F6"
++ $"FEFF 81F5 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00F6 FAFF"
++ $"FFFF FFFF FFF9 0000 0000 0000 0000 F9FF"
++ $"ACF5 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 FBFE"
++ $"FFFF FFFF FFF9 0000 0000 0000 FAFC F900"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 2B56 ACFF FFFF"
++ $"FFFF FEFB 2B00 0000 0000 00F6 F800 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FA FFFF FFFF FFFD"
++ $"F92B 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FAFF FFFF FFFF FFF8"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00F6 FFFF FFFF FFFF FFFE"
++ $"F92B 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FD FFFF FFFF FFFF FFFF"
++ $"FFFF FFFB FBFB FB56 F8F8 F8F8 F600 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFF9"
++ $"FAF6 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00AC FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF AC81 2B00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00F6 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFAC 5600 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F8FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFD 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00F8 FDFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FDF5 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 56FB FEFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFAC 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"2BFA F9FA FDFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF F800 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F5 F8F8 F8FB"
++ $"FDFF FFFF FFFF FFFF FFFF FB00 0000 0000"
++ $"0000 0000 0000 F5FA FCFF FFFF FFFA F500"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00F5 FAFF FFFF FFFF FFFF FB00 0000 0000"
++ $"0000 0000 0000 ACFF FFFF FFFF F600 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FD FFFF FFFF FFFF F800 0000 0000"
++ $"0000 0000 002B FFFF FFFF FF56 0000 0000"
++ $"0000 F5FD FCF8 F600 0000 0000 0000 0000"
++ $"0000 00FB FFFF FFFF FFFE 0000 0000 0000"
++ $"0000 0000 00F8 FFFF FFFF FF00 0000 0000"
++ $"0000 F9FF 5600 0000 0000 0000 0000 0000"
++ $"00F6 F9FF FFFF FFFF FDF5 0000 0000 0000"
++ $"0000 0000 00F8 FFFF FFFF FFF6 0000 0000"
++ $"0000 F6FF FFF8 0000 0000 0000 0000 F6F9"
++ $"FBFF FFFF FFFF FFFC 00F6 F800 0000 0000"
++ $"0000 0000 0000 FEFF FFFF FFFB 0000 0000"
++ $"0000 00F6 FCFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFD 5600 F6FA 0000 0000 0000"
++ $"0000 0000 0000 F7FF FFFF FFFF FBF6 0000"
++ $"0000 0000 002B FAFB ACFF FFFF FFFF FFAC"
++ $"FBFB F8F8 0000 F6AC FA00 0000 0000 0000"
++ $"0000 0000 0000 002B FFFF FFFF FFFF F800"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00F6 F9FF FFF8 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 F581 FFFF FFFF FFFF"
++ $"FBFB F9F8 2B00 0000 0000 0000 0000 2BF8"
++ $"F9FB FBFF FDF9 F500 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00F9 FBFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFE 812B 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 F8FA"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFD FDF9"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 2BF8 F8F8 F8F8 F8F8 F500 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000",
++ /* [9] */
++ 'ih32',
++ $"CBFF 01D5 40AB FF02 71D5 71A9 FF04 E300"
++ $"FF8E 71A7 FF06 8035 60FF D500 C09B FF03"
++ $"AA8E 5555 8300 070E 0B39 E6FF FF00 2B98"
++ $"FF01 8E39 8700 0239 75D5 80FF 02C6 0000"
++ $"96FF 00AA 8700 010B AA84 FF02 5500 0095"
++ $"FF00 AA85 0002 4EB5 D584 FF01 E380 8000"
++ $"0075 93FF 0080 8400 0071 87FF 01AA 1C82"
++ $"0000 6091 FF00 AA84 0000 8087 FF00 5085"
++ $"0000 4090 FF00 3983 0001 06E3 82FF 04D0"
++ $"CDFF FF87 8700 00C6 8EFF 00E3 8400 0080"
++ $"80FF 076A FFFF 6DB5 FFFF 7187 0000 558E"
++ $"FF00 AA84 0081 FF08 20FF FF6A B5FF FFD5"
++ $"1087 008E FF00 AA84 0081 FF04 39CD FFE6"
++ $"9C80 FF01 D51C 8600 8EFF 00C6 8400 0080"
++ $"80FF 01E6 CE84 FF01 E31C 8400 0040 8FFF"
++ $"000B 8400 8AFF 00D5 8400 00AA 8FFF 007F"
++ $"8400 006A 82FF 02E6 B5DA 82FF 00D5 8200"
++ $"0045 91FF 002B 8400 006A 82FF 0283 2083"
++ $"82FF 0055 8000 0055 93FF 002B 8400 0040"
++ $"81FF 02DA 2020 82FF 0355 0000 2B94 FF01"
++ $"E639 8400 0055 81FF 0190 B581 FF04 D523"
++ $"005B E396 FF01 D571 8300 008E 85FF 0391"
++ $"0639 E399 FF01 600B 8200 0080 83FF 0280"
++ $"4080 98FF 02D5 8E40 8100 0307 1C55 C683"
++ $"FF01 E3AA 99FF 0079 8200 021C 80C6 A3FF"
++ $"0080 8300 00AA A4FF 00D5 8400 021C 80C6"
++ $"A2FF 002B 8800 8055 015B 9C81 AA00 D597"
++ $"FF94 0003 0580 80D5 92FF 0030 9600 0307"
++ $"3575 C68F FF01 DA04 9900 0135 918E FF00"
++ $"AA9B 0000 2B8E FF01 AA2B 9A00 012B E38F"
++ $"FF02 8E55 1C97 0000 3C93 FF00 C080 8000"
++ $"2B92 0000 AA9D FF00 E380 AA02 551C 0485"
++ $"0000 5588 FF02 E380 4380 0002 0B6B EA8F"
++ $"FF01 E380 8400 0055 88FF 0035 8200 00D5"
++ $"93FF 002B 8300 00AA 87FF 00C6 8200 009C"
++ $"83FF 04E3 2B47 AAD5 89FF 0055 8200 001C"
++ $"88FF 00AA 8200 84FF 028E 0098 89FF 01E3"
++ $"8082 0001 2BE3 88FF 00AA 8200 00DA 83FF"
++ $"03D5 000B AA85 FF03 DF88 550B 8200 0340"
++ $"FFD5 AA88 FF00 1C81 0000 5584 FF01 D53C"
++ $"8D00 042B 9CFF DA78 89FF 00AE 8200 0155"
++ $"DA84 FF03 CD80 5539 8300 0935 5555 AAAA"
++ $"FFFF CD40 808B FF01 C80B 8200 00AA 91FF"
++ $"04DF 8000 05AA 8DFF 01E3 7183 0004 5555"
++ $"8EAA C686 FF08 C6AA 8E55 550E 2380 E391"
++ $"FF01 8E55 9000 0304 1C60 C697 FF01 AA80"
++ $"8A00 0220 2B80 9FFF 00C6 84AA 00E3 92FF"
++ $"CAFF 04FE D340 FFFE A9FF 0271 D571 A9FF"
++ $"04E3 00FF 8E71 9EFF 00FE 85FF 0680 355F"
++ $"FFD5 00C0 9BFF 03AA 8E55 5583 0007 0E0B"
++ $"39E5 FFFF 002B 98FF 018E 3987 0002 3975"
++ $"D580 FF02 C600 0096 FF00 A887 0002 0BA9"
++ $"FD83 FF02 5500 0095 FF00 AA85 0002 4EB3"
++ $"D484 FF01 E380 8000 0075 93FF 0080 8400"
++ $"0071 87FF 01AA 1C82 0000 6091 FF00 AA84"
++ $"0000 8087 FF00 4F85 0000 4090 FF00 3983"
++ $"0001 06E3 82FF 04DC DCFF FF87 8700 00C6"
++ $"8EFF 00E2 8400 0080 80FF 0795 FFFF 97CA"
++ $"FFFF 7187 0000 548E FF00 AA84 0081 FF08"
++ $"60FE FF95 CAFF FFD3 1087 008E FF00 AA84"
++ $"0081 FF09 72DC FFED B8FF FFFE D41C 8600"
++ $"8EFF 00C6 8400 0080 80FF 01ED DB84 FF01"
++ $"E31C 8400 0040 8EFF 01FE 0B84 008A FF00"
++ $"D584 0000 A98F FF00 7F84 0001 69FE 81FF"
++ $"03ED C9E5 FE81 FF00 D582 0000 4591 FF00"
++ $"2B84 0000 6982 FF02 A660 A682 FF00 5580"
++ $"0000 5593 FF00 2B84 0000 4081 FF02 E560"
++ $"6082 FF03 5500 002B 94FF 01E6 3984 0000"
++ $"5581 FF01 B0CA 81FF 04D5 2300 5BE3 96FF"
++ $"01D5 7183 0000 8E85 FF03 8F06 38E3 99FF"
++ $"0160 0B82 0000 8083 FF02 8040 8097 FF03"
++ $"FED4 8E40 8100 0307 1C55 C683 FF01 E2AA"
++ $"99FF 0077 8200 021C 7FC6 A3FF 0080 8300"
++ $"00AA A4FF 00D3 8400 021C 7FC6 A2FF 002A"
++ $"8800 8055 015B 9C81 AA02 D5FF FE95 FF94"
++ $"0003 0580 80D5 92FF 0030 9600 0307 3575"
++ $"C68F FF01 D904 9900 0135 918E FF00 AA9B"
++ $"0000 2B8E FF01 AA2B 9A00 012B E38F FF02"
++ $"8E55 1C97 0000 3C93 FF00 C080 8000 2B92"
++ $"0000 A99D FF00 E180 AA02 551C 0485 0000"
++ $"5588 FF02 E280 4380 0003 0B6B E9FE 8EFF"
++ $"01E3 8084 0000 5587 FF01 FE35 8200 00D5"
++ $"87FF 01FE FE87 FF00 2B83 0000 AA87 FF00"
++ $"C682 0000 9C83 FF06 E32B 47AA D5FE FE87"
++ $"FF00 5582 0001 1CFE 87FF 00AA 8200 84FF"
++ $"028E 0098 89FF 01E3 8082 0002 2BE3 FE87"
++ $"FF00 AA82 0000 DA83 FF03 D500 0BAA 81FF"
++ $"07FD FDFF FFDF 8855 0B82 0003 40FF D5AA"
++ $"88FF 001C 8100 0055 83FF 02FE D53C 8D00"
++ $"042B 9CFF D978 89FF 00AD 8200 0155 D984"
++ $"FF03 CD7F 5539 8300 0935 5555 AAAA FFFF"
++ $"CD40 808B FF01 C70B 8200 00AA 88FF 00FE"
++ $"81FD 08FF FFFE FEDF 8000 05AA 8DFF 01E3"
++ $"7183 0007 5555 8EAA C6FF FFFE 81FF 0AFE"
++ $"FEC6 AA8E 5455 0E23 80E3 91FF 018D 5590"
++ $"0003 041C 60C6 96FF 02FD A980 8A00 0320"
++ $"2B7F FE9E FF00 C684 AA03 E3FF FFFE 8FFF"
++ $"9AFF 01FD FDAB FF04 FAD0 40FF FDA8 FF03"
++ $"FD71 D571 A9FF 04E3 00FF 8E71 9EFF 00FC"
++ $"85FF 0680 3568 FFD5 00C0 9BFF 03AA 8E55"
++ $"5583 0007 150B 39E5 FFFF 002B 98FF 018E"
++ $"3987 0002 3978 D580 FF02 C600 0096 FF00"
++ $"A387 0002 0BA5 F883 FF02 5500 0095 FF00"
++ $"AA85 0003 4EAA D2FD 83FF 01E3 8080 0000"
++ $"7893 FF00 8084 0000 7187 FF01 AA1C 8200"
++ $"006A 91FF 00AA 8400 0080 87FF 004C 8500"
++ $"0040 90FF 0039 8300 010B E382 FF04 E4E3"
++ $"FFFF 8787 0000 C68E FF00 DF84 0000 8080"
++ $"FF07 AAFF FFAE D5FF FF70 8700 0052 8EFF"
++ $"00AA 8400 81FF 0880 FAFF AAD5 FFFF D010"
++ $"8700 8EFF 00AA 8400 80FF 0AFD 8EE3 FFEF"
++ $"C6FF FFFC D21C 8600 8EFF 00C3 8400 0080"
++ $"80FF 01EF E183 FF02 FDE3 1C84 0000 408E"
++ $"FF01 FA0B 8400 8AFF 00D5 8400 00A8 8FFF"
++ $"007F 8400 0167 FC81 FF03 EFD2 EAFC 81FF"
++ $"00D5 8200 0053 90FF 01FD 2B84 0000 6781"
++ $"FF03 FDB7 80B5 82FF 0055 8000 0055 93FF"
++ $"002B 8400 0040 81FF 02EA 8080 82FF 0355"
++ $"0000 2B94 FF01 E839 8400 0055 81FF 01C0"
++ $"D581 FF04 D523 0060 E396 FF01 D571 8300"
++ $"008E 85FF 038E 0B37 E399 FF01 6B15 8200"
++ $"0080 83FF 0280 4080 97FF 03FC D28E 4081"
++ $"0004 071C 53C6 FD82 FF02 E1AA FD98 FF00"
++ $"7C82 0004 1C7D C6FF FDA1 FF00 8083 0000"
++ $"AAA4 FF00 D084 0002 1B7D C5A1 FF01 FD28"
++ $"8800 8055 0160 9C81 AA02 D5FF FC95 FF94"
++ $"0003 0B80 80D5 92FF 0035 9600 0307 3578"
++ $"C68F FF01 DD07 9900 0135 958E FF00 AA9B"
++ $"0000 2B8E FF01 A82B 9A00 012B E38E FF03"
++ $"FD8E 551C 9700 013E FD92 FF00 C080 8000"
++ $"2B92 0000 A88B FF00 FD8E FF00 DC80 AA02"
++ $"551C 0785 0000 5588 FF02 E180 4E80 0003"
++ $"0E6B E6FC 8EFF 01E3 8084 0000 5587 FF01"
++ $"FD33 8200 00D5 87FF 01FD FD87 FF00 2B83"
++ $"0000 AA87 FF00 C682 0000 9A83 FF06 E32B"
++ $"55AA D5FC FC85 FF02 FDFF 5582 0001 1CFC"
++ $"87FF 00AA 8200 84FF 038E 0095 FD88 FF01"
++ $"E380 8200 022B E3FA 87FF 00AA 8200 00DF"
++ $"83FF 03D5 000B A881 FF07 F8F8 FFFF DF90"
++ $"550B 8200 0340 FFD5 AA88 FF00 1C81 0000"
++ $"5583 FF02 FCD5 408D 0004 2B9C FFDD 7E88"
++ $"FF01 FDAF 8200 0155 DD84 FF03 CD7D 5539"
++ $"8300 0940 5555 A8AA FDFD CD47 808B FF01"
++ $"CC0B 8200 00AA 88FF 00FA 81F8 08FF FFFA"
++ $"FCDF 8000 0BA8 8CFF 02FD E371 8300 0755"
++ $"558E AAC6 FFFF FC81 FF0A FAFC C6AA 8E52"
++ $"530E 2380 E391 FF01 8C55 9000 0307 1C6B"
++ $"C696 FF02 F8A5 808A 0003 352B 7CFD 9EFF"
++ $"00C6 84AA 03E3 FFFF FC8F FF",
++ /* [10] */
++ 'h8mk',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 0500"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 FFFF"
++ $"0005 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0005 0000 0000 0000 0000 FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 05FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00DB FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF05 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 05FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 0000 0000 0005 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0005 0000 0000 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0005 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0005 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0005 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"0500 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FF00 0005 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000",
++ /* [11] */
++ 'ics#',
++ $"0000 00A0 0F10 1C78 1878 1C18 0E20 0600"
++ $"1800 3FD0 1FF8 057C 300C 3358 18A8 0340"
++ $"0070 07F0 1FF0 1FF8 3FF8 3FF8 1FF8 1FF0"
++ $"3FF0 3FFC 3FFE 1FFE 7FFE 7FFE 7FFC 1FF0",
++ /* [12] */
++ 'ics4',
++ $"0000 0000 00C0 0000 0000 00CD CDCD 0000"
++ $"0000 EFFD D0CE 0000 000E FA00 0DFF D000"
++ $"000F FDCC 0EFF F000 000F FE00 00EF E000"
++ $"000C FFD0 D0CE 0000 0000 DFF0 0CC0 0000"
++ $"00CF FD00 0000 0000 00DF FFFA EEDD 0000"
++ $"00CA FFFF FFFF FC00 0000 CDDE DEEF FFC0"
++ $"00EF C0C0 000C FF00 00FE 00DD CDDF AD00"
++ $"00DF DCC0 DCDD D000 0000 DDEE EDDC 0000",
++ /* [13] */
++ 'ics8',
++ $"0000 0000 0000 0000 0000 2B00 0000 0000"
++ $"0000 0000 0000 2B56 F8F9 F856 0000 0000"
++ $"0000 0000 FBFF FFFB 56F5 F7FC 0000 0000"
++ $"0000 00FC FFFD F500 00F9 FFFF F900 0000"
++ $"0000 F5FF FF56 2B2A F6FB FFFF FF00 0000"
++ $"0000 00FE FFFB 00F5 0000 FBFF FC00 0000"
++ $"0000 00F8 FFFF FA00 7900 F7FD F500 0000"
++ $"0000 00F5 F9FF FDF6 00F6 F800 0000 0000"
++ $"0000 2BEA FF56 0000 0000 0000 0000 0000"
++ $"0000 81FF FFFF FEFD FCFC FAF8 0000 0000"
++ $"0000 F6FE FFFF FFFF FFFF FFFF FEF7 0000"
++ $"0000 0000 2B56 FA81 81FC FDFF FFFF F600"
++ $"0000 ACFE 2B00 2BF5 0000 00F8 FFFF F500"
++ $"00F5 FFFC 0000 FA56 56F8 F9FD FE56 F500"
++ $"0000 56E0 FBF7 F6F6 F856 56F9 56F6 0000"
++ $"0000 0000 F881 FCAC FC81 FA2B 0000 0000",
++ /* [14] */
++ 'is32',
++ $"87FF 00C3 87FF 06F3 C79F 9F8C B598 84FF"
++ $"08F3 6008 0B53 9FE8 B34C 84FF 0948 002C"
++ $"EBF8 F884 0400 8182 FF0A E700 0093 B9D2"
++ $"E061 0000 0C82 FF0A F713 0057 FCF5 F1FB"
++ $"5000 4383 FF09 B008 0073 FF8C FFB4 2DE7"
++ $"83FF 08EB 8202 28E3 FFD9 B0FB 83FF 03CB"
++ $"1100 9089 FF00 6880 0006 142B 4050 75B2"
++ $"F782 FF01 D01C 8500 011A AF83 FF13 BF90"
++ $"7860 6048 2401 0009 DFFF FFF7 3B16 C8FF"
++ $"CDEF 80FF 139F 0004 DFFF FFEB 0444 FFFF"
++ $"7F97 9F9F 852D 1A97 F780 FF0B 9A10 54B3"
++ $"DFD4 A79F 9187 96D0 82FF 08EF A36C 4440"
++ $"4863 84C8 81FF 87FF 00C3 87FF 06F3 C79F"
++ $"9F8C B598 84FF 08F3 6008 0B52 9FE8 B34C"
++ $"84FF 0948 002C EBFA FA84 0400 8182 FF0A"
++ $"E700 0093 CDDF E960 0000 0C82 FF0A F713"
++ $"0057 FCF8 F5FB 5000 4383 FF09 B008 0072"
++ $"FFAD FFB4 2DE7 83FF 08EB 8202 28E3 FFD9"
++ $"B0FB 83FF 03CB 1100 8F89 FF00 6880 0006"
++ $"142B 4050 74B2 F782 FF01 D01C 8500 011A"
++ $"AF83 FF13 BF90 7860 6048 2401 0008 DFFF"
++ $"FFF7 3A16 C8FF CDEF 80FF 139F 0004 DFFF"
++ $"FFEB 0444 FFFF 7F97 9F9F 852D 1A97 F780"
++ $"FF0B 9910 54B3 DFD4 A79F 9086 96D0 82FF"
++ $"08EF A36C 4440 4863 84C8 81FF 86FF 01FE"
++ $"C287 FF06 F3C7 9F9F 8DB6 9884 FF08 F35F"
++ $"080B 519F E8B3 4D84 FF09 4800 2DEB FBFB"
++ $"8304 0083 82FF 0AE7 0000 93D7 E5ED 5F00"
++ $"000C 82FF 0AF6 1300 56FC F9F6 FB50 0044"
++ $"83FF 09B0 0800 72FF BDFF B42D E783 FF08"
++ $"EA83 0328 E3FF D9B0 FB83 FF03 CB12 008F"
++ $"89FF 0068 8000 0614 2B40 5075 B2F7 82FF"
++ $"01D1 1C85 0001 1AAF 83FF 2ABF 9078 6060"
++ $"4724 0100 09DF FFFF F73C 16C8 FFCF EEFE"
++ $"FFFF 9F00 04DF FFFF EB04 45FF FF7E 979F"
++ $"9F86 2D1A 98F6 80FF 0B9A 1055 B3DF D3A7"
++ $"9D91 8596 D182 FF08 EFA3 6C44 4048 6584"
++ $"C981 FF",
++ /* [15] */
++ 's8mk',
++ $"0000 0000 0000 0000 0005 FF05 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0005 FFFF FFFF FFFF FFFF FFFF FF00"
++ $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0005 FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF 0000 0000",
++ /* [16] */
++ 'icm#',
++ $"0000 0350 1C30 1C78 1C10 0620 1900 3FF8"
++ $"0B7C 300C 31B0 0720 0070 0FF0 1FF8 3FF8"
++ $"3FF8 1FF0 3FF8 3FFC 1FFE 7FFE 7FFE 3FF8",
++ /* [17] */
++ 'icm4',
++ $"0000 0000 00C0 0000 0000 CDEE ECCE 0000"
++ $"000D FAC0 0DEF C000 000F FD0C 0DFF F000"
++ $"000E FFC0 C0DF C000 0000 DFEC 00CC 0000"
++ $"00CF FDC0 C000 0000 00DF FFFF FFFE D000"
++ $"000C DDEE EEFF FF00 00AE C0C0 000D FEC0"
++ $"00FE C0CD DEDE DC00 000C DDED DDDC C000",
++ /* [18] */
++ 'icm8',
++ $"0000 0000 0000 0000 0000 F800 0000 0000"
++ $"0000 0000 2BFA FBAC 8156 F681 0000 0000"
++ $"0000 00FA FFFD F7F5 0056 FDFF F800 0000"
++ $"0000 F5FF FF56 2B2A F556 FFFF FF00 0000"
++ $"0000 00FB FFFE F600 4F00 56FF F800 0000"
++ $"0000 00F5 81EA FEF5 00F6 F8F6 0000 0000"
++ $"0000 F8FF FFFA 2BF6 F600 0000 0000 0000"
++ $"0000 56FF FFFF FFFF FFFF E0FC F9F5 0000"
++ $"0000 00F6 F981 FBFC FCAC FDFF FFFD F500"
++ $"0000 FDFD F600 F700 0000 0056 FFFE F500"
++ $"0000 ACFE 2B00 F7F9 8181 FBFB 81F7 0000"
++ $"0000 00F7 FAFB FBFA FAF9 56F8 F600 0000",
++ /* [19] */
++ 'it32',
++ $"0000 0000 FFFF FFFF FFFF C9FF 0100 00FC"
++ $"FF01 0000 F8FF 0000 80FF 0100 00F7 FF01"
++ $"0000 80FF 0100 00F6 FF01 0000 81FF 0100"
++ $"00F5 FF80 0080 FF80 00F4 FF80 0081 FF80"
++ $"00F2 FF81 0081 FF80 00F1 FF00 4080 0082"
++ $"FF81 00ED FF82 0001 2020 83FF 8100 D9FF"
++ $"8D00 0240 2020 8200 0020 84FF 8100 D3FF"
++ $"9B00 85FF 8200 CDFF 9C00 0140 0087 FF82"
++ $"00CA FF9F 0089 FF82 00C7 FF9E 0001 2000"
++ $"8AFF 8300 C5FF 9E00 8EFF 8300 C3FF 9800"
++ $"0040 8000 91FF 8400 C1FF 9C00 93FF 8400"
++ $"C0FF 9700 0160 0096 FF85 00BF FF93 0002"
++ $"4040 0099 FF88 00BC FF94 0000 4099 FF89"
++ $"0001 2000 BAFF 9300 9BFF 8C00 0020 B8FF"
++ $"9300 9AFF 9000 B6FF 9200 9BFF 9000 0120"
++ $"20B4 FF92 009A FF00 4094 00B3 FF91 009A"
++ $"FF97 00B1 FF92 0099 FF00 4097 00B1 FF91"
++ $"0090 FF00 2085 FF01 4040 9800 AFFF 9100"
++ $"0020 8EFF 023A 2020 85FF 9A00 AFFF 9100"
++ $"88FF 0020 83FF 8020 85FF 9B00 AEFF 9100"
++ $"87FF 0120 2083 FF80 2085 FF9B 00AD FF92"
++ $"0086 FF80 2083 FF02 203A 2086 FF9A 00AD"
++ $"FF91 0087 FF80 2083 FF80 2086 FF9B 00AC"
++ $"FF91 0087 FF80 2083 FF80 2087 FF00 4099"
++ $"00AC FF91 0087 FF80 2084 FF80 2087 FF99"
++ $"00AC FF91 0087 FF81 2084 FF01 2020 88FF"
++ $"9800 ACFF 9100 88FF 8020 92FF 9700 ACFF"
++ $"9200 88FF 8020 92FF 9600 ACFF 9200 A1FF"
++ $"9200 0140 00AE FF91 00A2 FF93 00AE FF92"
++ $"00A2 FF91 00AF FF00 4091 00A3 FF90 00B0"
++ $"FF92 00A3 FF8D 0000 60B1 FF01 4040 9000"
++ $"0040 A3FF 8B00 0120 00B2 FF91 0001 4040"
++ $"8CFF 8220 8EFF 8B00 0020 B4FF 9300 8DFF"
++ $"8220 8DFF 8A00 B5FF 9300 0040 8CFF 8320"
++ $"8CFF 8900 B7FF 9200 0140 408C FF82 208C"
++ $"FF88 00B9 FF94 008B FF83 208B FF87 00BB"
++ $"FF94 008B FF82 208B FF86 00BD FF00 2093"
++ $"008A FF81 208C FF85 00BF FF94 008A FF01"
++ $"2020 8CFF 0040 8300 0020 C2FF 9300 99FF"
++ $"8400 C6FF 9200 97FF 8300 CAFF 9000 96FF"
++ $"8300 CDFF 8F00 93FF 0500 2000 2000 00CE"
++ $"FF01 2020 8E00 90FF 8040 8000 CFFF 0300"
++ $"0020 208D 008F FF01 0000 8040 CFFF 0040"
++ $"9100 90FF 8000 CFFF 9300 E4FF 8E00 0040"
++ $"8100 E6FF 9100 E7FF 0120 208E 00E9 FF8F"
++ $"00EA FF8F 00EA FF90 00E9 FF92 00E8 FF94"
++ $"00E5 FF98 00E2 FF9C 00DD FFA8 00D2 FFA5"
++ $"0004 2000 0040 4089 00C4 FFBC 0000 20BD"
++ $"FFC3 00B7 FFC4 0001 4040 B4FF C800 0020"
++ $"B2FF 0020 CA00 AFFF 0020 CB00 0040 AEFF"
++ $"CD00 0020 ACFF 0020 CF00 ABFF D100 ABFF"
++ $"D000 ABFF D000 ABFF D000 ACFF CF00 AFFF"
++ $"CB00 0020 B0FF CA00 B4FF C700 B9FF C200"
++ $"C2FF B800 D6FF A500 DEFF 9C00 E1FF 0200"
++ $"0020 9600 A2FF 0020 8900 0140 40B1 FF95"
++ $"009F FF03 0000 2020 8900 0040 B4FF 9300"
++ $"9DFF 8D00 0060 B7FF 9200 9CFF 0040 8C00"
++ $"B9FF 9100 9CFF 8D00 BBFF 9000 9CFF 8C00"
++ $"92FF 0200 2020 8200 9FFF 8F00 9CFF 8B00"
++ $"0020 92FF 0400 0020 2000 A3FF 8F00 9CFF"
++ $"8B00 0060 91FF 8100 A5FF 8E00 9DFF 8B00"
++ $"92FF 8100 A4FF 8E00 9EFF 8B00 91FF 8100"
++ $"0060 A3FF 8E00 9FFF 8B00 92FF 8200 A0FF"
++ $"8F00 A0FF 8B00 92FF 8200 0040 9CFF 0100"
++ $"408F 0082 FF00 009B FF8B 0000 2092 FF84"
++ $"0095 FF01 4020 9100 0140 4082 FF01 0000"
++ $"9CFF 8B00 93FF AE00 0240 4000 83FF 0100"
++ $"009D FF8C 0093 FF01 0020 AC00 84FF 0120"
++ $"009F FF8C 0094 FFAA 0085 FF01 2020 A0FF"
++ $"0020 8C00 95FF 0100 40A2 0087 FF80 00A2"
++ $"FF8D 0097 FF94 0000 2084 008A FF03 0000"
++ $"2000 A4FF 8D00 0020 9BFF 8E00 0020 8FFF"
++ $"0400 4000 0020 A6FF 0020 8D00 BBFF 8400"
++ $"A8FF 0040 8E00 B5FF 0040 8300 0120 00AC"
++ $"FF91 00AF FF02 0040 4083 00B0 FF95 00A3"
++ $"FF8A 00B4 FF99 0097 FF8C 0001 4000 B8FF"
++ $"BC00 0220 0000 BDFF BA00 0020 C3FF B000"
++ $"0020 8000 C9FF A400 0120 2083 00D3 FF9F"
++ $"0004 2020 4000 00DC FF92 00FF FFFF FFB3"
++ $"FFFF FFCA FF00 FBFD FF00 FBFC FF03 FBFB"
++ $"0000 F6FF 01FB FB81 FF01 0000 80FF 00FB"
++ $"F4FF 0000 80FF 0100 00F7 FF01 0000 80FF"
++ $"0100 00F5 FF02 FB00 0081 FF01 0000 F5FF"
++ $"8000 80FF 8000 F4FF 8000 81FF 8000 F2FF"
++ $"8100 81FF 8000 F1FF 0040 8000 82FF 8100"
++ $"D6FF 00FB 93FF 8200 0220 20FB 82FF 8100"
++ $"D9FF 8D00 0240 2020 8200 0220 FFFB 82FF"
++ $"8100 D3FF 9B00 01FB FB83 FF82 00CD FF9C"
++ $"0001 4000 87FF 8200 CAFF 9F00 89FF 8200"
++ $"C7FF 9E00 0120 008A FF83 00C5 FF9E 008E"
++ $"FF83 00C0 FF02 FBFB FF98 0000 4080 0001"
++ $"FBFB 8FFF 8400 C0FF 00FB 9C00 03FF FFFB"
++ $"FB8F FF84 00C0 FF97 0003 6000 FBFB 94FF"
++ $"8500 BFFF 9300 0440 4000 FBFB 97FF 8800"
++ $"BCFF 9400 0440 FFFF FBFB 95FF 8900 0120"
++ $"00BA FF93 009B FF8C 0000 20B8 FF93 009A"
++ $"FF90 00B6 FF92 009B FF90 0001 2020 B4FF"
++ $"9200 99FF 01FB 4094 00B3 FF91 009A FF97"
++ $"00B1 FF92 008D FF00 FB88 FF00 4097 00B1"
++ $"FF91 008E FF02 FBFF 6085 FF01 4040 9800"
++ $"AFFF 9100 0020 8EFF 026E 6060 85FF 9A00"
++ $"ADFF 01FB FF91 0088 FF00 6083 FF80 6085"
++ $"FF9B 0000 FBAB FF01 FBFF 9100 87FF 0160"
++ $"6083 FF80 6085 FF9B 0000 FBAC FF92 0086"
++ $"FF80 6083 FF02 606E 6084 FF01 FBFF 9A00"
++ $"ADFF 9100 87FF 8060 83FF 8060 86FF 9B00"
++ $"ACFF 9100 87FF 8060 01FB FB81 FF80 6085"
++ $"FF02 FBFB 4099 00AC FF91 0087 FF80 6084"
++ $"FF80 6084 FF02 FBFB FF99 00AC FF91 0086"
++ $"FF00 FB81 6082 FF03 FBFF 6060 88FF 9800"
++ $"ACFF 9100 88FF 8060 90FF 01FB FF97 00AC"
++ $"FF92 0088 FF80 608F FF02 FBFF FF96 00AC"
++ $"FF92 0088 FF03 FBFF FFFB 92FF 9200 0140"
++ $"00AC FF01 FBFB 9100 A2FF 9300 ACFF 01FB"
++ $"FB92 00A2 FF91 00AF FF00 4091 00A3 FF90"
++ $"0000 FBAF FF92 0001 FBFB 8CFF 80FB 8FFF"
++ $"8D00 0060 B1FF 0140 4090 0002 40FF FB91"
++ $"FF00 FB8C FF8B 0001 2000 B2FF 9100 0240"
++ $"40FB 8BFF 8260 01FF FB8C FF8B 0001 20FB"
++ $"B1FF 01FB FF93 0001 FBFB 89FF 01FB FF82"
++ $"6001 FBFB 8BFF 8A00 B5FF 9300 0040 8CFF"
++ $"8360 8CFF 8900 B7FF 9200 0140 408B FF00"
++ $"FB82 608C FF88 00B9 FF94 008B FF83 608B"
++ $"FF87 00BB FF94 008B FF82 608B FF86 00BD"
++ $"FF00 2093 008A FF81 608C FF85 00BE FF00"
++ $"FB94 008A FF01 6060 8CFF 0040 8300 0020"
++ $"C2FF 9300 99FF 8400 C6FF 9200 94FF 02FB"
++ $"FBFF 8300 CAFF 9000 94FF 01FB FB83 00CD"
++ $"FF8F 0093 FF06 0020 0020 0000 FBCD FF01"
++ $"2020 8E00 90FF 8040 8000 CFFF 0300 0020"
++ $"208D 008F FF01 0000 8040 CFFF 0040 9100"
++ $"80FF 00FB 8AFF 01FB FF80 0001 FFFB CAFF"
++ $"02FB FFFF 9300 E1FF 02FB FBFF 8E00 0040"
++ $"8100 01FF FBE2 FF01 FBFB 9100 81FF 00FB"
++ $"E2FF 0120 208E 0000 FBE8 FF8F 00EA FF8F"
++ $"00EA FF90 00E8 FF00 FB92 0001 FBFB E5FF"
++ $"00FB 9400 E5FF 9800 00FB DFFF 01FB FB9C"
++ $"00DD FFA8 008F FF01 FBFB BEFF A500 0420"
++ $"0000 4040 8900 C4FF BC00 0020 BDFF C300"
++ $"B7FF C400 0140 40B4 FFC8 0000 20B2 FF00"
++ $"20CA 00AF FF00 20CB 0000 40AE FFCD 0000"
++ $"20AB FF01 FB20 CF00 ABFF D100 ABFF D000"
++ $"ABFF D000 ABFF D000 A8FF 00FB 80FF CF00"
++ $"AFFF CB00 0220 FBFB AEFF CA00 ABFF 00FB"
++ $"85FF C700 B9FF C200 00FB C1FF B800 D4FF"
++ $"01FB FBA5 00D3 FF01 FBFB 86FF 9C00 A3FF"
++ $"00FB BAFF 0200 0020 9600 A2FF 0020 8900"
++ $"0440 40FF FBFB AEFF 9500 9FFF 0300 0020"
++ $"2089 0004 40FF FFFB FBB0 FF93 009C FF00"
++ $"FB8D 0000 60B7 FF92 009A FF02 FBFB 408C"
++ $"00B9 FF91 009C FF8D 009C FF01 FBFB 9AFF"
++ $"9000 9CFF 8C00 92FF 0200 2020 8200 80FF"
++ $"01FB FB9A FF8F 009C FF8B 0002 20FF FB90"
++ $"FF04 0000 2020 0084 FF01 FBFB 9AFF 8F00"
++ $"00FB 9BFF 8B00 0060 91FF 8100 A1FF 00FB"
++ $"80FF 8E00 80FF 00FB 99FF 8B00 92FF 8100"
++ $"A4FF 8E00 81FF 00FB 99FF 8B00 91FF 8100"
++ $"0060 A3FF 8E00 81FF 01FB FB99 FF8B 0092"
++ $"FF82 0080 FF00 FB9C FF8F 00A0 FF8B 0092"
++ $"FF82 0003 40FF FFFB 99FF 0100 408F 0082"
++ $"FF00 009B FF8B 0000 2092 FF84 0088 FF83"
++ $"FB84 FF01 4020 9100 0140 4082 FF01 0000"
++ $"9CFF 8B00 90FF 02FB FBFF AE00 0240 4000"
++ $"81FF 03FB FB00 009D FF8C 0093 FF01 0020"
++ $"AC00 84FF 0120 009F FF8C 0094 FFAA 0085"
++ $"FF01 2020 9EFF 02FB FB20 8C00 02FF FFFB"
++ $"92FF 0100 40A2 0002 FFFF FB84 FF80 00A2"
++ $"FF8D 0096 FF00 FB94 0000 2084 0001 FFFB"
++ $"84FF 00FB 80FF 0300 0020 00A4 FF8D 0000"
++ $"209B FF8E 0000 208F FF04 0040 0000 20A6"
++ $"FF00 208D 009E FF8A FB8D FF84 0000 FBA6"
++ $"FF01 FB40 8E00 AFFF 80FB 80FF 0040 8300"
++ $"0120 00A9 FF02 FBFF FF91 00AB FF80 FB03"
++ $"FF00 4040 8300 B0FF 9500 89FF 01FB FB89"
++ $"FF81 FB85 FF8A 00B4 FF99 0097 FF8C 0001"
++ $"4000 B8FF BC00 0220 0000 BDFF BA00 0020"
++ $"BFFF 00FB 80FF B000 0020 8000 C7FF 01FB"
++ $"FBA4 0001 2020 8300 CCFF 01FB FB82 FF9F"
++ $"0008 2020 4000 00FF FFFB FBD8 FF92 0084"
++ $"FF01 FBFB FFFF FFFF AAFF FFFF CAFF 00F0"
++ $"FDFF 00F0 FCFF 03F0 F000 00F6 FF01 F0F0"
++ $"81FF 0100 0080 FF00 F0F4 FF00 0080 FF01"
++ $"0000 F7FF 0100 0080 FF01 0000 F5FF 02F0"
++ $"0000 81FF 0100 00F5 FF80 0080 FF80 00F4"
++ $"FF80 0081 FF80 00F2 FF81 0081 FF80 00F1"
++ $"FF00 4080 0082 FF81 00D6 FF00 F093 FF82"
++ $"0002 4040 F082 FF81 00D9 FF8D 0080 4082"
++ $"0002 40FF F082 FF81 00D3 FF9B 0001 F0F0"
++ $"83FF 8200 CDFF 9C00 0140 0087 FF82 00CA"
++ $"FF9F 0089 FF82 00C7 FF9E 0001 4000 8AFF"
++ $"8300 C5FF 9E00 8EFF 8300 C0FF 02F0 F0FF"
++ $"9800 0040 8000 01F0 F08F FF84 00C0 FF00"
++ $"F09C 0003 FFFF F0F0 8FFF 8400 C0FF 9700"
++ $"0340 00F0 F094 FF85 00BF FF93 0004 4040"
++ $"00F0 F097 FF88 00BC FF94 0004 40FF FFF0"
++ $"F095 FF89 0001 4000 BAFF 9300 9BFF 8C00"
++ $"0040 B8FF 9300 9AFF 9000 B6FF 9200 9BFF"
++ $"9000 0140 40B4 FF92 0099 FF01 F040 9400"
++ $"B3FF 9100 9AFF 9700 B1FF 9200 8DFF 00F0"
++ $"88FF 0040 9700 B1FF 9100 8EFF 02F0 FF80"
++ $"85FF 0140 4098 00AF FF91 0000 408E FF02"
++ $"A580 8085 FF9A 00AD FF01 F0FF 9100 88FF"
++ $"0080 83FF 8080 85FF 9B00 00F0 ABFF 01F0"
++ $"FF91 0087 FF01 8080 83FF 8080 85FF 9B00"
++ $"00F0 ACFF 9200 86FF 8080 83FF 0280 A580"
++ $"84FF 01F0 FF9A 00AD FF91 0087 FF80 8083"
++ $"FF80 8086 FF9B 00AC FF91 0087 FF80 8001"
++ $"F0F0 81FF 8080 85FF 02F0 F040 9900 ACFF"
++ $"9100 87FF 8080 84FF 8080 84FF 02F0 F0FF"
++ $"9900 ACFF 9100 86FF 00F0 8180 82FF 03F0"
++ $"FF80 8088 FF98 00AC FF91 0088 FF80 8090"
++ $"FF01 F0FF 9700 ACFF 9200 88FF 8080 8FFF"
++ $"02F0 FFFF 9600 ACFF 9200 88FF 03F0 FFFF"
++ $"F092 FF92 0001 4000 ACFF 01F0 F091 00A2"
++ $"FF93 00AC FF01 F0F0 9200 A2FF 9100 AFFF"
++ $"0040 9100 A3FF 9000 00F0 AFFF 9200 01F0"
++ $"F08C FF80 F08F FF8D 0000 80B1 FF01 4040"
++ $"9000 0240 FFF0 91FF 00F0 8CFF 8B00 0140"
++ $"00B2 FF91 0002 4040 F08B FF82 8001 FFF0"
++ $"8CFF 8B00 0140 F0B1 FF01 F0FF 9300 01F0"
++ $"F089 FF01 F0FF 8280 01F0 F08B FF8A 00B5"
++ $"FF93 0000 408C FF83 808C FF89 00B7 FF92"
++ $"0001 4040 8BFF 00F0 8280 8CFF 8800 B9FF"
++ $"9400 8BFF 8380 8BFF 8700 BBFF 9400 8BFF"
++ $"8280 8BFF 8600 BDFF 0040 9300 8AFF 8180"
++ $"8CFF 8500 BEFF 00F0 9400 8AFF 0180 808C"
++ $"FF00 4083 0000 40C2 FF93 0099 FF84 00C6"
++ $"FF92 0094 FF02 F0F0 FF83 00CA FF90 0094"
++ $"FF01 F0F0 8300 CDFF 8F00 93FF 0600 4000"
++ $"4000 00F0 CDFF 0140 408E 0090 FF80 4080"
++ $"00CF FF03 0000 4040 8D00 8FFF 0100 0080"
++ $"40CF FF00 4091 0080 FF00 F08A FF01 F0FF"
++ $"8000 01FF F0CA FF02 F0FF FF93 00E1 FF02"
++ $"F0F0 FF8E 0000 4081 0001 FFF0 E2FF 01F0"
++ $"F091 0081 FF00 F0E2 FF01 4040 8E00 00F0"
++ $"E8FF 8F00 EAFF 8F00 EAFF 9000 E8FF 00F0"
++ $"9200 01F0 F0E5 FF00 F094 00E5 FF98 0000"
++ $"F0DF FF01 F0F0 9C00 DDFF A800 8FFF 01F0"
++ $"F0BE FFA5 0004 4000 0040 4089 00C4 FFBC"
++ $"0000 40BD FFC3 00B7 FFC4 0001 4040 B4FF"
++ $"C800 0040 B2FF 0040 CA00 AFFF 0040 CB00"
++ $"0040 AEFF CD00 0040 ABFF 01F0 40CF 00AB"
++ $"FFD1 00AB FFD0 00AB FFD0 00AB FFD0 00A8"
++ $"FF00 F080 FFCF 00AF FFCB 0002 40F0 F0AE"
++ $"FFCA 00AB FF00 F085 FFC7 00B9 FFC2 0000"
++ $"F0C1 FFB8 00D4 FF01 F0F0 A500 D3FF 01F0"
++ $"F086 FF9C 00A3 FF00 F0BA FF02 0000 4096"
++ $"00A2 FF00 4089 0004 4040 FFF0 F0AE FF95"
++ $"009F FF03 0000 4040 8900 0440 FFFF F0F0"
++ $"B0FF 9300 9CFF 00F0 8D00 0080 B7FF 9200"
++ $"9AFF 02F0 F040 8C00 B9FF 9100 9CFF 8D00"
++ $"9CFF 01F0 F09A FF90 009C FF8C 0092 FF02"
++ $"0040 4082 0080 FF01 F0F0 9AFF 8F00 9CFF"
++ $"8B00 0240 FFF0 90FF 0400 0040 4000 84FF"
++ $"01F0 F09A FF8F 0000 F09B FF8B 0000 4091"
++ $"FF81 00A1 FF00 F080 FF8E 0080 FF00 F099"
++ $"FF8B 0092 FF81 00A4 FF8E 0081 FF00 F099"
++ $"FF8B 0091 FF81 0000 40A3 FF8E 0081 FF01"
++ $"F0F0 99FF 8B00 92FF 8200 80FF 00F0 9CFF"
++ $"8F00 A0FF 8B00 92FF 8200 0340 FFFF F099"
++ $"FF01 0040 8F00 82FF 0000 9BFF 8B00 0040"
++ $"92FF 8400 88FF 83F0 84FF 0140 4091 0001"
++ $"4040 82FF 0100 009C FF8B 0090 FF02 F0F0"
++ $"FFAE 0002 4040 0081 FF03 F0F0 0000 9DFF"
++ $"8C00 93FF 0100 40AC 0084 FF01 4000 9FFF"
++ $"8C00 94FF AA00 85FF 0140 409E FF02 F0F0"
++ $"408C 0002 FFFF F092 FF01 0040 A200 02FF"
++ $"FFF0 84FF 8000 A2FF 8D00 96FF 00F0 9400"
++ $"0040 8400 01FF F084 FF00 F080 FF03 0000"
++ $"4000 A4FF 8D00 0040 9BFF 8E00 0040 8FFF"
++ $"0400 4000 0040 A6FF 0040 8D00 9EFF 8AF0"
++ $"8DFF 8400 00F0 A6FF 01F0 408E 00AF FF80"
++ $"F080 FF00 4083 0001 4000 A9FF 02F0 FFFF"
++ $"9100 ABFF 80F0 03FF 0040 4083 00B0 FF95"
++ $"0089 FF01 F0F0 89FF 81F0 85FF 8A00 B4FF"
++ $"9900 97FF 8C00 0140 00B8 FFBC 0002 4000"
++ $"00BD FFBA 0000 40BF FF00 F080 FFB0 0000"
++ $"4080 00C7 FF01 F0F0 A400 0140 4083 00CC"
++ $"FF01 F0F0 82FF 9F00 8040 0500 00FF FFF0"
++ $"F0D8 FF92 0084 FF01 F0F0 FFFF FFFF AAFF",
++ /* [20] */
++ 't8mk',
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0500 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0505 FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 0500"
++ $"00FF FFFF FF00 0000 0500 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 BFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0500 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"DBFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF BFDB DBFF FFFF FFFF"
++ $"DBFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF BFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0505 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF BFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"05FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF DBFF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"DB00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFDB DB00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0500 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF05 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0500 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF05 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFBF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0505 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0505 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 BFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0500 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 9B00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00BF BFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFDB FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFDB 0500 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFBF BFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00DB"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFBF FFFF FFFF FFFF DB00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFDB FFDB FFFF 0500 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00DB DBFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF BFBF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFDB DBFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFBF BFBF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 BFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0500"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0500 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 0500 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0005 05FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00DB DBFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 05FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 05FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FF00 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0505 FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFBF FFFF FFFF"
++ $"FFFF FFFF FFFF FF00 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 05DB FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0500 0000 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0005 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0500 0000 0000 0000"
++ $"0000 0000 0000 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 00DB FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF BFBF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 FFFF DBDB FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF BFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0005 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"05BF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FF00 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FF00 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFBF BFFF FFFF FFFF FFFF FFFF"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"05DB FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF DBFF 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFBF FFFF DB00 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 DBFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF 0500 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 05BF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFBF"
++ $"FFFF FFFF FFFF DBFF 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0500 00FF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFBF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 00FF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"BFFF 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 00FF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF DBFF FF00"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 00FF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF DB00 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0005"
++ $"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF DBFF FFFF 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0505 FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB DBFF"
++ $"FFFF FFFF FF00 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0505 0000 0000 00FF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF FFFF FFFF FFFF FFDB DBBF"
++ $"FFFF 0000 0505 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
++ $"FFFF FFFF FFFF 0000 0000 0000 0005 0500"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ $"0000 0000 0000 0000 0000 0000 0000 0000"
++ }
++};
+diff --git a/psi/dwimg.c b/psi/dwimg.c
+--- a/psi/dwimg.c
++++ b/psi/dwimg.c
+@@ -1437,25 +1437,33 @@ WndImg2Proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+ if (img->hwndtext)
+ SendMessage(img->hwndtext, message, wParam, lParam);
+ else {
+- char szFile[256];
++ char *szFile;
+ int i, cFiles;
++ unsigned int Len, error;
+ const char *p;
+ const char *szDragPre = "\r(";
+ const char *szDragPost = ") run\r";
+ HDROP hdrop = (HDROP)wParam;
+ cFiles = DragQueryFile(hdrop, (UINT)(-1), (LPSTR)NULL, 0);
+ for (i=0; i<cFiles; i++) {
+- DragQueryFile(hdrop, i, szFile, 80);
+- for (p=szDragPre; *p; p++)
+- SendMessage(hwnd,WM_CHAR,*p,1L);
+- for (p=szFile; *p; p++) {
+- if (*p == '\\')
+- SendMessage(hwnd,WM_CHAR,'/',1L);
+- else
+- SendMessage(hwnd,WM_CHAR,*p,1L);
++ Len = DragQueryFile(hdrop, i, NULL, 0);
++ szFile = malloc(Len+1);
++ if (szFile != 0) {
++ error = DragQueryFile(hdrop, i, szFile, Len+1);
++ if (error != 0) {
++ for (p=szDragPre; *p; p++)
++ SendMessage(hwnd,WM_CHAR,*p,1L);
++ for (p=szFile; *p; p++) {
++ if (*p == '\\')
++ SendMessage(hwnd,WM_CHAR,'/',1L);
++ else
++ SendMessage(hwnd,WM_CHAR,*p,1L);
++ }
++ for (p=szDragPost; *p; p++)
++ SendMessage(hwnd,WM_CHAR,*p,1L);
++ }
++ free(szFile);
+ }
+- for (p=szDragPost; *p; p++)
+- SendMessage(hwnd,WM_CHAR,*p,1L);
+ }
+ DragFinish(hdrop);
+ }
+diff --git a/psi/dwtext.c b/psi/dwtext.c
+--- a/psi/dwtext.c
++++ b/psi/dwtext.c
+@@ -652,25 +652,33 @@ int ch;
+ void
+ text_drag_drop(TW *tw, HDROP hdrop)
+ {
+- char szFile[256];
++ char *szFile;
+ int i, cFiles;
++ unsigned int Len, error;
+ const char *p;
+ if ( (tw->DragPre==NULL) || (tw->DragPost==NULL) )
+ return;
+
+ cFiles = DragQueryFile(hdrop, (UINT)(-1), (LPSTR)NULL, 0);
+ for (i=0; i<cFiles; i++) {
+- DragQueryFile(hdrop, i, szFile, 80);
+- for (p=tw->DragPre; *p; p++)
+- SendMessage(tw->hwnd,WM_CHAR,*p,1L);
+- for (p=szFile; *p; p++) {
+- if (*p == '\\')
+- SendMessage(tw->hwnd,WM_CHAR,'/',1L);
+- else
+- SendMessage(tw->hwnd,WM_CHAR,*p,1L);
++ Len = DragQueryFile(hdrop, i, NULL, 0);
++ szFile = (char *)malloc(Len+1);
++ if (szFile != 0) {
++ error = DragQueryFile(hdrop, i, szFile, Len+1);
++ if (error != 0) {
++ for (p=tw->DragPre; *p; p++)
++ SendMessage(tw->hwnd,WM_CHAR,*p,1L);
++ for (p=szFile; *p; p++) {
++ if (*p == '\\')
++ SendMessage(tw->hwnd,WM_CHAR,'/',1L);
++ else
++ SendMessage(tw->hwnd,WM_CHAR,*p,1L);
++ }
++ for (p=tw->DragPost; *p; p++)
++ SendMessage(tw->hwnd,WM_CHAR,*p,1L);
++ }
++ free(szFile);
+ }
+- for (p=tw->DragPost; *p; p++)
+- SendMessage(tw->hwnd,WM_CHAR,*p,1L);
+ }
+ DragFinish(hdrop);
+ }
+diff --git a/psi/fapi_ft.c b/psi/fapi_ft.c
+--- a/psi/fapi_ft.c
++++ b/psi/fapi_ft.c
+@@ -26,826 +26,868 @@ Started by Graham Asher, 6th June 2002.
+ #include "write_t2.h"
+ #include "math_.h"
+ #include "gserror.h"
++#include "gxfixed.h"
+
+ /* FreeType headers */
+-#include "freetype/freetype.h"
+-#include "freetype/ftincrem.h"
+-#include "freetype/ftglyph.h"
+-#include "freetype/ftoutln.h"
+-#include "freetype/fttrigon.h"
++#include <ft2build.h>
++#include FT_FREETYPE_H
++#include FT_INCREMENTAL_H
++#include FT_GLYPH_H
+
+ /* Note: structure definitions here start with FF_, which stands for 'FAPI FreeType". */
+
+-typedef struct FF_server_
+- {
+- FAPI_server m_fapi_server;
+- FT_Library m_freetype_library;
+- FT_OutlineGlyph m_outline_glyph;
+- FT_BitmapGlyph m_bitmap_glyph;
+- } FF_server;
++typedef struct FF_server_s
++{
++ FAPI_server fapi_server;
++ FT_Library freetype_library;
++ FT_OutlineGlyph outline_glyph;
++ FT_BitmapGlyph bitmap_glyph;
++} FF_server;
+
+-typedef struct FF_face_
+- {
+- FT_Face m_ft_face; /* The FreeType typeface object. */
+- FT_Incremental_InterfaceRec* m_ft_inc_int; /* If non-null, the incremental interface object passed to FreeType. */
+- unsigned char* m_font_data; /* Non-null if font data is owned by this object. */
+- } FF_face;
++typedef struct FF_face_s
++{
++ FT_Face ft_face;
+
+-/*
+-This structure has to have the tag FT_IncrementalRec to be compatible with
+-the functions defined in FT_Incremental_FuncsRec.
+-*/
++ /* If non-null, the incremental interface object passed to FreeType. */
++ FT_Incremental_InterfaceRec *ft_inc_int;
++
++ /* Non-null if font data is owned by this object. */
++ unsigned char *font_data;
++} FF_face;
++
++/* Here we define the struct FT_Incremental that is used as an opaque type
++ * inside FreeType. This structure has to have the tag FT_IncrementalRec_
++ * to be compatible with the functions defined in FT_Incremental_FuncsRec.
++ */
+ typedef struct FT_IncrementalRec_
+- {
+- FAPI_font* m_fapi_font; /* The font. */
+- unsigned char* m_glyph_data; /* A one-shot buffer for glyph data. */
+- /* If it is already in use glyph data is allocated on the heap. */
+- size_t m_glyph_data_length; /* Length in bytes of m_glyph_data. */
+- bool m_glyph_data_in_use; /* True if m_glyph_data is already in use. */
+- FT_Incremental_MetricsRec m_glyph_metrics; /* Incremental glyph metrics supplied by GhostScript. */
+- unsigned long m_glyph_metrics_index; /* m_glyph_metrics contains data for this glyph index unless it is 0xFFFFFFFF. */
+- FAPI_metrics_type m_metrics_type; /* The metrics type determines whether metrics are replaced, added, etc. */
+- } FT_IncrementalRec;
++{
++ FAPI_font *fapi_font; /* The font. */
++
++ /* If it is already in use glyph data is allocated on the heap. */
++ unsigned char *glyph_data; /* A one-shot buffer for glyph data. */
++ size_t glyph_data_length; /* Length in bytes of glyph_data. */
++ bool glyph_data_in_use; /* True if glyph_data is already in use. */
++
++ FT_Incremental_MetricsRec glyph_metrics; /* Incremental glyph metrics supplied by Ghostscript. */
++ unsigned long glyph_metrics_index; /* contains data for this glyph index unless it is 0xFFFFFFFF. */
++ FAPI_metrics_type metrics_type; /* determines whether metrics are replaced, added, etc. */
++} FT_IncrementalRec;
+
+-static FF_face* new_face(FT_Face a_ft_face,FT_Incremental_InterfaceRec* a_ft_inc_int,
+- unsigned char* a_font_data)
++static FF_face *
++new_face(FT_Face a_ft_face, FT_Incremental_InterfaceRec *a_ft_inc_int, unsigned char *a_font_data)
++{
++ FF_face *face = (FF_face *)malloc(sizeof(FF_face));
++ if (face)
+ {
+- FF_face* face = (FF_face *)malloc(sizeof(FF_face));
+- if (face)
+- {
+- face->m_ft_face = a_ft_face;
+- face->m_ft_inc_int = a_ft_inc_int;
+- face->m_font_data = a_font_data;
+- }
++ face->ft_face = a_ft_face;
++ face->ft_inc_int = a_ft_inc_int;
++ face->font_data = a_font_data;
++ }
+ return face;
+- }
++}
+
+-static void delete_face(FF_face* a_face)
+- {
++static void
++delete_face(FF_face *a_face)
++{
+ if (a_face)
+- {
+- FT_Done_Face(a_face->m_ft_face);
+- free(a_face->m_ft_inc_int);
+- free(a_face->m_font_data);
+- free(a_face);
+- }
++ {
++ FT_Done_Face(a_face->ft_face);
++ free(a_face->ft_inc_int);
++ free(a_face->font_data);
++ free(a_face);
+ }
++}
+
+-static FT_IncrementalRec* new_inc_int_info(FAPI_font* a_fapi_font)
+- {
+- FT_IncrementalRec* info = (FT_IncrementalRec*)malloc(sizeof(FT_IncrementalRec));
+- if (info)
+- {
+- info->m_fapi_font = a_fapi_font;
+- info->m_glyph_data = NULL;
+- info->m_glyph_data_length = 0;
+- info->m_glyph_data_in_use = false;
+- info->m_glyph_metrics_index = 0xFFFFFFFF;
+- info->m_metrics_type = FAPI_METRICS_NOTDEF;
+- }
+- return info;
+- }
++static FT_IncrementalRec *
++new_inc_int_info(FAPI_font *a_fapi_font)
++{
++ FT_IncrementalRec *info = (FT_IncrementalRec*)malloc(sizeof(FT_IncrementalRec));
++ if (info)
++ {
++ info->fapi_font = a_fapi_font;
++ info->glyph_data = NULL;
++ info->glyph_data_length = 0;
++ info->glyph_data_in_use = false;
++ info->glyph_metrics_index = 0xFFFFFFFF;
++ info->metrics_type = FAPI_METRICS_NOTDEF;
++ }
++ return info;
++}
+
+-static void delete_inc_int_info(FT_IncrementalRec* a_inc_int_info)
+- {
+- if (a_inc_int_info)
+- {
+- free(a_inc_int_info->m_glyph_data);
+- free(a_inc_int_info);
+- }
+- }
++static void
++delete_inc_int_info(FT_IncrementalRec *a_inc_int_info)
++{
++ if (a_inc_int_info)
++ {
++ free(a_inc_int_info->glyph_data);
++ free(a_inc_int_info);
++ }
++}
+
+-static FT_Error get_fapi_glyph_data(FT_Incremental a_info,FT_UInt a_index,FT_Data* a_data)
+- {
+- FAPI_font* ff = a_info->m_fapi_font;
+- ushort length = 0;
++static FT_Error
++get_fapi_glyph_data(FT_Incremental a_info, FT_UInt a_index, FT_Data *a_data)
++{
++ FAPI_font *ff = a_info->fapi_font;
++ ushort length = 0;
+
+- /* Tell the FAPI interface that we need to decrypt the glyph data. */
+- ff->need_decrypt = true;
++ /* Tell the FAPI interface that we need to decrypt the glyph data. */
++ ff->need_decrypt = true;
+
+- /* If m_glyph_data is already in use (as will happen for composite glyphs) create a new buffer on the heap. */
+- if (a_info->m_glyph_data_in_use)
+- {
+- unsigned char* buffer = NULL;
+- length = ff->get_glyph(ff,a_index,NULL,0);
+- buffer = malloc(length);
+- if (!buffer)
+- return FT_Err_Out_Of_Memory;
+- ff->get_glyph(ff,a_index,buffer,length);
+- a_data->pointer = buffer;
+- }
+- else
+- {
+- /*
+- Save ff->char_data, which is set to null by FAPI_FF_get_glyph as part of a hack to
+- make the deprecated Type 2 endchar ('seac') work, so that it can be restored
+- if we need to try again with a longer buffer.
+- */
+- const void* saved_char_data = ff->char_data;
++ /* If glyph_data is already in use (as will happen for composite glyphs)
++ * create a new buffer on the heap.
++ */
++ if (a_info->glyph_data_in_use)
++ {
++ unsigned char *buffer = NULL;
++ length = ff->get_glyph(ff, a_index, NULL, 0);
++ buffer = malloc(length);
++ if (!buffer)
++ return FT_Err_Out_Of_Memory;
++ ff->get_glyph(ff, a_index, buffer, length);
++ a_data->pointer = buffer;
++ }
++ else
++ {
++ /* Save ff->char_data, which is set to null by FAPI_FF_get_glyph as part of a hack to
++ * make the deprecated Type 2 endchar ('seac') work, so that it can be restored
++ * if we need to try again with a longer buffer.
++ */
++ const void *saved_char_data = ff->char_data;
+
+- /* Get as much of the glyph data as possible into the buffer */
+- length = ff->get_glyph(ff,a_index,a_info->m_glyph_data,(ushort)a_info->m_glyph_data_length);
++ /* Get as much of the glyph data as possible into the buffer */
++ length = ff->get_glyph(ff, a_index, a_info->glyph_data, (ushort)a_info->glyph_data_length);
+
+- /* If the buffer was too small enlarge it and try again. */
+- if (length > a_info->m_glyph_data_length)
+- {
+- a_info->m_glyph_data = realloc(a_info->m_glyph_data,length);
+- if (!a_info->m_glyph_data)
+- {
+- a_info->m_glyph_data_length = 0;
+- return FT_Err_Out_Of_Memory;
+- }
+- a_info->m_glyph_data_length = length;
+- ff->char_data = saved_char_data;
+- ff->get_glyph(ff,a_index,a_info->m_glyph_data,length);
+- }
++ /* If the buffer was too small enlarge it and try again. */
++ if (length > a_info->glyph_data_length)
++ {
++ a_info->glyph_data = realloc(a_info->glyph_data, length);
++ if (!a_info->glyph_data)
++ {
++ a_info->glyph_data_length = 0;
++ return FT_Err_Out_Of_Memory;
++ }
++ a_info->glyph_data_length = length;
++ ff->char_data = saved_char_data;
++ ff->get_glyph(ff, a_index, a_info->glyph_data, length);
++ }
+
+- /* Set the returned pointer and length. */
+- a_data->pointer = a_info->m_glyph_data;
++ /* Set the returned pointer and length. */
++ a_data->pointer = a_info->glyph_data;
+
+- a_info->m_glyph_data_in_use = true;
+- }
++ a_info->glyph_data_in_use = true;
++ }
+
+- a_data->length = length;
+- return 0;
+- }
++ a_data->length = length;
++ return 0;
++}
+
+-static void free_fapi_glyph_data(FT_Incremental a_info,FT_Data* a_data)
+- {
+- if (a_data->pointer == (const FT_Byte*)a_info->m_glyph_data)
+- a_info->m_glyph_data_in_use = false;
+- else
+- free((FT_Byte*)a_data->pointer);
+- }
++static void
++free_fapi_glyph_data(FT_Incremental a_info, FT_Data *a_data)
++{
++ if (a_data->pointer == (const FT_Byte*)a_info->glyph_data)
++ a_info->glyph_data_in_use = false;
++ else
++ free((FT_Byte*)a_data->pointer);
++}
+
+-static FT_Error get_fapi_glyph_metrics(FT_Incremental a_info,FT_UInt a_glyph_index,
+- FT_Bool bVertical, FT_Incremental_MetricsRec* a_metrics)
++static FT_Error
++get_fapi_glyph_metrics(FT_Incremental a_info, FT_UInt a_glyph_index,
++ FT_Bool bVertical, FT_Incremental_MetricsRec *a_metrics)
++{
++ /* fixme : bVertical is not implemented. */
++ if (a_info->glyph_metrics_index == a_glyph_index)
++ {
++ switch (a_info->metrics_type)
+ {
+- /* fixme : bVertical is not implemented. */
+- if (a_info->m_glyph_metrics_index == a_glyph_index)
+- {
+- switch (a_info->m_metrics_type)
+- {
+- case FAPI_METRICS_ADD:
+- a_metrics->advance += a_info->m_glyph_metrics.advance;
+- break;
+- case FAPI_METRICS_REPLACE_WIDTH:
+- a_metrics->advance = a_info->m_glyph_metrics.advance;
+- break;
+- case FAPI_METRICS_REPLACE:
+- *a_metrics = a_info->m_glyph_metrics;
+- break;
+- default:
+- /* This can't happen. */
+- return FT_Err_Invalid_Argument;
+- }
+- }
+- return 0;
++ case FAPI_METRICS_ADD:
++ a_metrics->advance += a_info->glyph_metrics.advance;
++ break;
++ case FAPI_METRICS_REPLACE_WIDTH:
++ a_metrics->advance = a_info->glyph_metrics.advance;
++ break;
++ case FAPI_METRICS_REPLACE:
++ *a_metrics = a_info->glyph_metrics;
++ break;
++ default:
++ /* This can't happen. */
++ return FT_Err_Invalid_Argument;
+ }
++ }
++ return 0;
++}
+
+-static const FT_Incremental_FuncsRec TheFAPIIncrementalInterfaceFuncs =
+- {
++static const
++FT_Incremental_FuncsRec TheFAPIIncrementalInterfaceFuncs =
++{
+ get_fapi_glyph_data,
+- free_fapi_glyph_data,
++ free_fapi_glyph_data,
+ get_fapi_glyph_metrics
+- };
++};
+
+-static FT_Incremental_InterfaceRec* new_inc_int(FAPI_font* a_fapi_font)
+- {
+- FT_Incremental_InterfaceRec* i = (FT_Incremental_InterfaceRec*)malloc(sizeof(FT_Incremental_InterfaceRec));
+- if (i)
+- {
+- i->object = (FT_Incremental)new_inc_int_info(a_fapi_font);
+- i->funcs = &TheFAPIIncrementalInterfaceFuncs;
+- }
+- if (!i->object)
+- {
+- free(i);
+- i = NULL;
+- }
+- return i;
+- }
+-
+-static void delete_inc_int(FT_Incremental_InterfaceRec* a_inc_int)
+- {
+- if (a_inc_int)
+- {
+- delete_inc_int_info(a_inc_int->object);
+- free(a_inc_int);
+- }
+- }
++static FT_Incremental_InterfaceRec *
++new_inc_int(FAPI_font *a_fapi_font)
++{
++ FT_Incremental_InterfaceRec *i =
++ (FT_Incremental_InterfaceRec*) malloc(sizeof(FT_Incremental_InterfaceRec)); /* malloc!? /Tor */
++ if (i)
++ {
++ i->object = (FT_Incremental)new_inc_int_info(a_fapi_font);
++ i->funcs = &TheFAPIIncrementalInterfaceFuncs;
++ }
++ if (!i->object)
++ {
++ free(i);
++ i = NULL;
++ }
++ return i;
++}
+
+-/*
+-Convert FreeType error codes to GhostScript ones.
+-Very rudimentary because most don't correspond.
+-*/
+-static int ft_to_gs_error(FT_Error a_error)
++static void
++delete_inc_int(FT_Incremental_InterfaceRec *a_inc_int)
++{
++ if (a_inc_int)
+ {
++ delete_inc_int_info(a_inc_int->object);
++ free(a_inc_int);
++ }
++}
++
++/* Convert FreeType error codes to GhostScript ones.
++ * Very rudimentary because most don't correspond.
++ */
++static int
++ft_to_gs_error(FT_Error a_error)
++{
+ if (a_error)
+- {
+- if (a_error == FT_Err_Out_Of_Memory)
+- return e_VMerror;
+- else
+- return e_unknownerror;
+- }
+- return 0;
++ {
++ if (a_error == FT_Err_Out_Of_Memory)
++ return e_VMerror;
++ else
++ return e_unknownerror;
+ }
++ return 0;
++}
+
+-/*
+-Load a glyph and optionally rasterize it. Return its metrics in a_metrics.
+-If a_bitmap is true convert the glyph to a bitmap.
+-*/
+-static FAPI_retcode load_glyph(FAPI_font* a_fapi_font,const FAPI_char_ref *a_char_ref,
+- FAPI_metrics* a_metrics,FT_Glyph* a_glyph,bool a_bitmap)
+- {
++/* Load a glyph and optionally rasterize it. Return its metrics in a_metrics.
++ * If a_bitmap is true convert the glyph to a bitmap.
++ */
++static FAPI_retcode
++load_glyph(FAPI_font *a_fapi_font, const FAPI_char_ref *a_char_ref,
++ FAPI_metrics *a_metrics, FT_Glyph *a_glyph, bool a_bitmap)
++{
+ FT_Error ft_error = 0;
+- FF_face* face = (FF_face*)a_fapi_font->server_font_data;
+- FT_Face ft_face = face->m_ft_face;
++ FF_face *face = (FF_face*)a_fapi_font->server_font_data;
++ FT_Face ft_face = face->ft_face;
+ int index = a_char_ref->char_code;
+
+- /*
+- Save a_fapi_font->char_data, which is set to null by FAPI_FF_get_glyph as part of a hack to
+- make the deprecated Type 2 endchar ('seac') work, so that it can be restored
+- after the first call to FT_Load_Glyph.
+- */
+- const void* saved_char_data = a_fapi_font->char_data;
++ /* Save a_fapi_font->char_data, which is set to null by FAPI_FF_get_glyph as part of a hack to
++ * make the deprecated Type 2 endchar ('seac') work, so that it can be restored
++ * after the first call to FT_Load_Glyph.
++ */
++ const void *saved_char_data = a_fapi_font->char_data;
+
+ if (!a_char_ref->is_glyph_index)
+- {
+- if (ft_face->num_charmaps)
+- index = FT_Get_Char_Index(ft_face,index);
+- else
+- /*
+- If there are no character maps and no glyph index, loading the glyph will still work
+- properly if both glyph data and metrics are supplied by the incremental interface.
+- In that case we use a dummy glyph index which will be passed
+- back to FAPI_FF_get_glyph by get_fapi_glyph_data.
++ {
++ if (ft_face->num_charmaps)
++ index = FT_Get_Char_Index(ft_face, index);
++ else
++ {
++ /* If there are no character maps and no glyph index, loading the glyph will still work
++ * properly if both glyph data and metrics are supplied by the incremental interface.
++ * In that case we use a dummy glyph index which will be passed
++ * back to FAPI_FF_get_glyph by get_fapi_glyph_data.
++ *
++ * Type 1 fonts don't use the code and can appear to FreeType to have only one glyph,
++ * so we have to set the index to 0.
++ *
++ * For other font types, FAPI_FF_get_glyph requires the character code
++ * when getting data.
++ */
++ if (a_fapi_font->is_type1)
++ index = 0;
++ else
++ index = a_char_ref->char_code;
++ }
++ }
+
+- */
+- {
+- /*
+- Type 1 fonts don't use the code and can appear to FreeType to have only one glyph,
+- so we have to set the index to 0.
+- */
+- if (a_fapi_font->is_type1)
+- index = 0;
+- /*
+- For other font types, FAPI_FF_get_glyph requires the character code when getting
+- data.
+- */
+- else
+- index = a_char_ref->char_code;
+- }
+- }
++ /* Refresh the pointer to the FAPI_font held by the incremental interface. */
++ if (face->ft_inc_int)
++ face->ft_inc_int->object->fapi_font = a_fapi_font;
+
+- /* Refresh the pointer to the FAPI_font held by the incremental interface. */
+- if (face->m_ft_inc_int)
+- face->m_ft_inc_int->object->m_fapi_font = a_fapi_font;
++ /* Store the overriding metrics if they have been supplied. */
++ if (face->ft_inc_int && a_char_ref->metrics_type != FAPI_METRICS_NOTDEF)
++ {
++ FT_Incremental_MetricsRec *m = &face->ft_inc_int->object->glyph_metrics;
++ m->bearing_x = a_char_ref->sb_x >> 16;
++ m->bearing_y = a_char_ref->sb_y >> 16;
++ m->advance = a_char_ref->aw_x >> 16;
++ face->ft_inc_int->object->glyph_metrics_index = index;
++ face->ft_inc_int->object->metrics_type = a_char_ref->metrics_type;
++ }
+
+- /* Store the overriding metrics if they have been supplied. */
+- if (face->m_ft_inc_int && a_char_ref->metrics_type != FAPI_METRICS_NOTDEF)
+- {
+- FT_Incremental_MetricsRec* m = &face->m_ft_inc_int->object->m_glyph_metrics;
+- m->bearing_x = a_char_ref->sb_x >> 16;
+- m->bearing_y = a_char_ref->sb_y >> 16;
+- m->advance = a_char_ref->aw_x >> 16;
+- face->m_ft_inc_int->object->m_glyph_metrics_index = index;
+- face->m_ft_inc_int->object->m_metrics_type = a_char_ref->metrics_type;
+- }
+-
+- ft_error = FT_Load_Glyph(ft_face,index,FT_LOAD_MONOCHROME | FT_LOAD_NO_SCALE);
++ ft_error = FT_Load_Glyph(ft_face, index, FT_LOAD_MONOCHROME | FT_LOAD_NO_SCALE);
+ if (!ft_error && a_metrics)
+- {
+- a_metrics->bbox_x0 = ft_face->glyph->metrics.horiBearingX;
+- a_metrics->bbox_y0 = ft_face->glyph->metrics.horiBearingY - ft_face->glyph->metrics.height;
+- a_metrics->bbox_x1 = a_metrics->bbox_x0 + ft_face->glyph->metrics.width;
+- a_metrics->bbox_y1 = a_metrics->bbox_y0 + ft_face->glyph->metrics.height;
+- a_metrics->escapement = ft_face->glyph->metrics.horiAdvance;
+- a_metrics->em_x = ft_face->units_per_EM;
+- a_metrics->em_y = ft_face->units_per_EM;
+- }
++ {
++ a_metrics->bbox_x0 = ft_face->glyph->metrics.horiBearingX;
++ a_metrics->bbox_y0 = ft_face->glyph->metrics.horiBearingY - ft_face->glyph->metrics.height;
++ a_metrics->bbox_x1 = a_metrics->bbox_x0 + ft_face->glyph->metrics.width;
++ a_metrics->bbox_y1 = a_metrics->bbox_y0 + ft_face->glyph->metrics.height;
++ a_metrics->escapement = ft_face->glyph->metrics.horiAdvance;
++ a_metrics->em_x = ft_face->units_per_EM;
++ a_metrics->em_y = ft_face->units_per_EM;
++ }
+
+ /* We have to load the glyph again, scale it correctly, and render it if we need a bitmap. */
+ if (!ft_error)
+- {
+- a_fapi_font->char_data = saved_char_data;
+- ft_error = FT_Load_Glyph(ft_face,index,a_bitmap ? FT_LOAD_MONOCHROME | FT_LOAD_RENDER: FT_LOAD_MONOCHROME);
+- }
++ {
++ a_fapi_font->char_data = saved_char_data;
++ ft_error = FT_Load_Glyph(ft_face, index, a_bitmap ? FT_LOAD_MONOCHROME | FT_LOAD_RENDER: FT_LOAD_MONOCHROME);
++ }
+ if (!ft_error && a_glyph)
+- ft_error = FT_Get_Glyph(ft_face->glyph,a_glyph);
++ ft_error = FT_Get_Glyph(ft_face->glyph, a_glyph);
+ return ft_to_gs_error(ft_error);
+- }
+-
+-/**
+-Ensure that the rasterizer is open.
+-
+-In the case of FreeType this means creating the FreeType library object.
+-*/
+-static FAPI_retcode ensure_open(FAPI_server* a_server, const byte *server_param, int server_param_size)
+- {
+- FF_server* s = (FF_server*)a_server;
+- if (!s->m_freetype_library)
+- {
+- FT_Error ft_error = FT_Init_FreeType(&s->m_freetype_library);
+- if (ft_error)
+- return ft_to_gs_error(ft_error);
+- }
++}
++
++/*
++ * Ensure that the rasterizer is open.
++ *
++ * In the case of FreeType this means creating the FreeType library object.
++ */
++static FAPI_retcode
++ensure_open(FAPI_server *a_server, const byte *server_param, int server_param_size)
++{
++ FF_server *s = (FF_server*)a_server;
++ if (!s->freetype_library)
++ {
++ FT_Error ft_error = FT_Init_FreeType(&s->freetype_library);
++ if (ft_error)
++ return ft_to_gs_error(ft_error);
++ }
++ return 0;
++}
++
++static void
++transform_concat(FT_Matrix *a_A, const FT_Matrix *a_B)
++{
++ FT_Matrix result = *a_B;
++ FT_Matrix_Multiply(a_A, &result);
++ *a_A = result;
++}
++
++/* Create a transform representing an angle defined as a vector. */
++static void
++make_rotation(FT_Matrix *a_transform, const FT_Vector *a_vector)
++{
++ FT_Fixed length, cos, sin;
++ if (a_vector->x >= 0 && a_vector->y == 0)
++ {
++ a_transform->xx = a_transform->yy = 65536;
++ a_transform->xy = a_transform->yx = 0;
++ return;
++ }
++
++ length = FT_Vector_Length((FT_Vector*)a_vector);
++ cos = FT_DivFix(a_vector->x, length);
++ sin = FT_DivFix(a_vector->y, length);
++ a_transform->xx = a_transform->yy = cos;
++ a_transform->xy = -sin;
++ a_transform->yx = sin;
++}
++
++/* Divide a transformation into a scaling part and a rotation-and-shear part.
++ * The scaling part is used for setting the pixel size for hinting.
++ */
++static void
++transform_decompose(FT_Matrix *a_transform, FT_Fixed *a_x_scale, FT_Fixed *a_y_scale)
++{
++ float a = a_transform->xx / 65536.0;
++ float b = a_transform->xy / 65536.0;
++ float c = a_transform->yx / 65536.0;
++ float d = a_transform->yy / 65536.0;
++
++ float scale = sqrt(fabs(a * d - b * c));
++
++ a_transform->xx = a / scale * 65536.0;
++ a_transform->xy = b / scale * 65536.0;
++ a_transform->yx = c / scale * 65536.0;
++ a_transform->yy = d / scale * 65536.0;
++
++ *a_x_scale = scale * 65536.0;
++ *a_y_scale = scale * 65536.0;
++}
++
++/*
++ * Open a font and set its size.
++ */
++static FAPI_retcode
++get_scaled_font(FAPI_server *a_server, FAPI_font *a_font,
++ const FAPI_font_scale *a_font_scale,
++ const char *a_map,
++ FAPI_descendant_code a_descendant_code)
++{
++ FF_server *s = (FF_server*)a_server;
++ FF_face *face = (FF_face*)a_font->server_font_data;
++ FT_Error ft_error = 0;
++
++ /* dpf("get_scaled_font enter: is_type1=%d is_cid=%d font_file_path='%s' a_descendant_code=%d\n",
++ a_font->is_type1, a_font->is_cid, a_font->font_file_path ? a_font->font_file_path : "", a_descendant_code); */
++
++ /* If this font is the top level font of an embedded CID type 0 font (font type 9)
++ * do nothing. See the comment in FAPI_prepare_font. The descendant fonts are
++ * passed in individually.
++ */
++ if (a_font->is_cid && a_font->is_type1 && a_font->font_file_path == NULL &&
++ (a_descendant_code == FAPI_TOPLEVEL_BEGIN ||
++ a_descendant_code == FAPI_TOPLEVEL_COMPLETE))
++ {
++ /* dpf("get_scaled_font return 0\n"); */
+ return 0;
+- }
++ }
+
+-static void transform_concat(FT_Matrix* a_A,const FT_Matrix* a_B)
+- {
+- FT_Matrix result = *a_B;
+- FT_Matrix_Multiply(a_A,&result);
+- *a_A = result;
+- }
++ /* Create the face if it doesn't already exist. */
++ if (!face)
++ {
++ FT_Face ft_face = NULL;
++ FT_Parameter ft_param;
++ FT_Incremental_InterfaceRec *ft_inc_int = NULL;
++ unsigned char *own_font_data = NULL;
+
+-/** Create a transform representing an angle defined as a vector. */
+-static void make_rotation(FT_Matrix* a_transform,const FT_Vector* a_vector)
+- {
+- FT_Fixed length, cos, sin;
+- if (a_vector->x >= 0 && a_vector->y == 0)
+- {
+- a_transform->xx = a_transform->yy = 65536;
+- a_transform->xy = a_transform->yx = 0;
+- return;
+- }
++ /* dpf("get_scaled_font creating face\n"); */
+
+- length = FT_Vector_Length((FT_Vector*)a_vector);
+- cos = FT_DivFix(a_vector->x,length);
+- sin = FT_DivFix(a_vector->y,length);
+- a_transform->xx = a_transform->yy = cos;
+- a_transform->xy = -sin;
+- a_transform->yx = sin;
++ /* Load a typeface from a file. */
++ if (a_font->font_file_path)
++ {
++ ft_error = FT_New_Face(s->freetype_library, a_font->font_file_path, a_font->subfont, &ft_face);
++ if (!ft_error && ft_face)
++ ft_error = FT_Select_Charmap(ft_face, ft_encoding_unicode);
+ }
+
+-/**
+-Divide a transformation into a scaling part and a rotation-and-shear part.
+-The scaling part is used for setting the pixel size for hinting.
+-*/
+-static void transform_decompose(FT_Matrix* a_transform,
+- FT_Fixed* a_x_scale,FT_Fixed* a_y_scale)
++ /* Load a typeface from a representation in GhostScript's memory. */
++ else
+ {
+- FT_Matrix rotation;
+- bool have_rotation = false;
+- FT_Vector v;
+-
+- /*
+- Set v to the result of applying the matrix to the (1,0) vector
+- and reverse the direction of rotation by negating the y coordinate.
+- */
+- v.x = a_transform->xx;
+- v.y = -a_transform->yx;
+- if (v.y || v.x < 0)
+- {
+- have_rotation = true;
++ FT_Open_Args open_args;
++ open_args.flags = FT_OPEN_MEMORY;
+
+- /* Get the inverse of the rotation. */
+- make_rotation(&rotation,&v);
++ if (a_font->is_type1)
++ {
++ long length;
++ int type = a_font->get_word(a_font, FAPI_FONT_FEATURE_FontType, 0);
+
+- /* Remove the rotation. */
+- transform_concat(a_transform,&rotation);
+- }
++ /* Tell the FAPI interface that we need to decrypt the /Subrs data. */
++ a_font->need_decrypt = true;
+
+- /* Separate the scales from the transform. */
+- *a_x_scale = a_transform->xx;
+- if (*a_x_scale < 0)
+- {
+- *a_x_scale = -*a_x_scale;
+- a_transform->xx = -65536;
+- }
+- else
+- a_transform->xx = 65536;
+- *a_y_scale = a_transform->yy;
+- if (*a_y_scale < 0)
+- {
+- *a_y_scale = -*a_y_scale;
+- a_transform->yy = -65536;
+- }
+- else
+- a_transform->yy = 65536;
+- a_transform->yx = FT_DivFix(a_transform->yx,*a_x_scale);
+- a_transform->xy = FT_DivFix(a_transform->xy,*a_y_scale);
+-
+- if (have_rotation)
+- {
+- /* Add back the rotation. */
+- rotation.xy = -rotation.xy;
+- rotation.yx = -rotation.yx;
+- transform_concat(a_transform,&rotation);
+- }
+- }
+-
+-/**
+-Open a font and set its size.
+-*/
+-static FAPI_retcode get_scaled_font(FAPI_server* a_server,FAPI_font* a_font,
+- const FAPI_font_scale* a_font_scale,
+- const char* a_map,
+- FAPI_descendant_code a_descendant_code)
+- {
+- FF_server* s = (FF_server*)a_server;
+- FF_face* face = (FF_face*)a_font->server_font_data;
+- FT_Error ft_error = 0;
+-
+- /* dpf("get_scaled_font enter: is_type1=%d is_cid=%d font_file_path='%s' a_descendant_code=%d\n",
+- a_font->is_type1,a_font->is_cid,a_font->font_file_path ? a_font->font_file_path : "",a_descendant_code); */
+-
+- /*
+- If this font is the top level font of an embedded CID type 0 font (font type 9)
+- do nothing. See the comment in FAPI_prepare_font. The descendant fonts are
+- passed in individually.
+- */
+- if (a_font->is_cid && a_font->is_type1 && a_font->font_file_path == NULL &&
+- (a_descendant_code == FAPI_TOPLEVEL_BEGIN ||
+- a_descendant_code == FAPI_TOPLEVEL_COMPLETE))
+- {
+- /* dpf("get_scaled_font return 0\n"); */
+- return 0;
+- }
+-
+- /* Create the face if it doesn't already exist. */
+- if (!face)
+- {
+- FT_Face ft_face = NULL;
+- FT_Parameter ft_param;
+- FT_Incremental_InterfaceRec* ft_inc_int = NULL;
+- unsigned char* own_font_data = NULL;
+-
+- /* dpf("get_scaled_font creating face\n"); */
+-
+- /* Load a typeface from a file. */
+- if (a_font->font_file_path)
+- {
+- ft_error = FT_New_Face(s->m_freetype_library,a_font->font_file_path,a_font->subfont,&ft_face);
+- if (!ft_error && ft_face)
+- ft_error = FT_Select_Charmap(ft_face,ft_encoding_unicode);
+- }
+-
+- /* Load a typeface from a representation in GhostScript's memory. */
++ /*
++ Serialise a type 1 font in PostScript source form, or
++ a Type 2 font in binary form, so that FreeType can read it.
++ */
++ if (type == 1)
++ length = FF_serialize_type1_font(a_font, NULL, 0);
+ else
+- {
+- FT_Open_Args open_args;
+- open_args.flags = FT_OPEN_MEMORY;
+-
+- if (a_font->is_type1)
+- {
+- long length;
+- int type = a_font->get_word(a_font,FAPI_FONT_FEATURE_FontType,0);
+-
+- /* Tell the FAPI interface that we need to decrypt the /Subrs data. */
+- a_font->need_decrypt = true;
+-
+- /*
+- Serialise a type 1 font in PostScript source form, or
+- a Type 2 font in binary form, so that FreeType can read it.
+- */
+- if (type == 1)
+- length = FF_serialize_type1_font(a_font,NULL,0);
+- else
+- length = FF_serialize_type2_font(a_font,NULL,0);
+- open_args.memory_base = own_font_data = malloc(length);
+- if (!open_args.memory_base)
+- return e_VMerror;
+- if (type == 1)
+- open_args.memory_size = FF_serialize_type1_font(a_font,own_font_data,length);
+- else
+- open_args.memory_size = FF_serialize_type2_font(a_font,own_font_data,length);
+- if (open_args.memory_size != length)
+- return_error(e_unregistered); /* Must not happen. */
+- ft_inc_int = new_inc_int(a_font);
+- if (!ft_inc_int)
+- {
+- free(own_font_data);
+- return e_VMerror;
+- }
+- }
+-
+- /* It must be type 42 (see code in FAPI_FF_get_glyph in zfapi.c). */
+- else
+- {
+- /* Get the length of the TrueType data. */
+- open_args.memory_size = a_font->get_long(a_font,FAPI_FONT_FEATURE_TT_size,0);
+- if (open_args.memory_size == 0)
+- return e_invalidfont;
+-
+- /* Load the TrueType data into a single buffer. */
+- open_args.memory_base = own_font_data = malloc(open_args.memory_size);
+- if (!own_font_data)
+- return e_VMerror;
+- if (a_font->serialize_tt_font(a_font,own_font_data,open_args.memory_size))
+- return e_invalidfont;
+-
+- /* We always load incrementally. */
+- ft_inc_int = new_inc_int(a_font);
+- if (!ft_inc_int)
+- {
+- free(own_font_data);
+- return e_VMerror;
+- }
+- }
+-
+- if (ft_inc_int)
+- {
+- open_args.flags = (FT_UInt)(open_args.flags | FT_OPEN_PARAMS);
+- ft_param.tag = FT_PARAM_TAG_INCREMENTAL;
+- ft_param.data = ft_inc_int;
+- open_args.num_params = 1;
+- open_args.params = &ft_param;
+- }
+- ft_error = FT_Open_Face(s->m_freetype_library,&open_args,a_font->subfont,&ft_face);
+- }
+-
+- if (ft_face)
+- {
+- face = new_face(ft_face,ft_inc_int,own_font_data);
+- if (!face)
+- {
+- free(own_font_data);
+- FT_Done_Face(ft_face);
+- delete_inc_int(ft_inc_int);
+- return e_VMerror;
+- }
+- a_font->server_font_data = face;
+- }
++ length = FF_serialize_type2_font(a_font, NULL, 0);
++ open_args.memory_base = own_font_data = malloc(length);
++ if (!open_args.memory_base)
++ return e_VMerror;
++ if (type == 1)
++ open_args.memory_size = FF_serialize_type1_font(a_font, own_font_data, length);
+ else
+- a_font->server_font_data = NULL;
++ open_args.memory_size = FF_serialize_type2_font(a_font, own_font_data, length);
++ if (open_args.memory_size != length)
++ return_error(e_unregistered); /* Must not happen. */
++ ft_inc_int = new_inc_int(a_font);
++ if (!ft_inc_int)
++ {
++ free(own_font_data);
++ return e_VMerror;
+ }
+-
+- /*
+- Set the point size and transformation.
+- The matrix is scaled by the shift specified in the server, 16,
+- so we divide by 65536 when converting to a gs_matrix.
+- */
+- if (face)
++ }
++
++ /* It must be type 42 (see code in FAPI_FF_get_glyph in zfapi.c). */
++ else
++ {
++ /* Get the length of the TrueType data. */
++ open_args.memory_size = a_font->get_long(a_font, FAPI_FONT_FEATURE_TT_size, 0);
++ if (open_args.memory_size == 0)
++ return e_invalidfont;
++
++ /* Load the TrueType data into a single buffer. */
++ open_args.memory_base = own_font_data = malloc(open_args.memory_size);
++ if (!own_font_data)
++ return e_VMerror;
++ if (a_font->serialize_tt_font(a_font, own_font_data, open_args.memory_size))
++ return e_invalidfont;
++
++ /* We always load incrementally. */
++ ft_inc_int = new_inc_int(a_font);
++ if (!ft_inc_int)
+ {
+- static const FT_Matrix ft_reflection = { 65536, 0, 0, -65536 };
+- FT_Matrix ft_transform;
+- FT_F26Dot6 width, height;
+-
+- /*
+- Convert the GS transform into an FT transform.
+- Ignore the translation elements because they contain very large values
+- derived from the current transformation matrix and so are of no use.
+- */
+- ft_transform.xx = a_font_scale->matrix[0];
+- ft_transform.xy = a_font_scale->matrix[1];
+- ft_transform.yx = -a_font_scale->matrix[2];
+- ft_transform.yy = -a_font_scale->matrix[3];
+-
+- /*
+- Split the transform into scale factors and a rotation-and-shear
+- transform.
+- */
+- transform_decompose(&ft_transform,&width,&height);
+-
+- /* Convert width and height to 64ths of pixels and set the FreeType sizes. */
+- width >>= 10;
+- height >>= 10;
+- ft_error = FT_Set_Char_Size(face->m_ft_face,width,height,
+- a_font_scale->HWResolution[0] >> 16,
+- a_font_scale->HWResolution[1] >> 16);
+- if (ft_error)
+- {
+- delete_face(face);
+- a_font->server_font_data = NULL;
+- return ft_to_gs_error(ft_error);
+- }
+-
+- /*
+- Concatenate the transform to a reflection around (y=0) so that it
+- produces a glyph that is upside down in FreeType terms, with its
+- first row at the bottom. That is what GhostScript needs.
+- */
+- FT_Matrix_Multiply(&ft_reflection,&ft_transform);
+-
+- FT_Set_Transform(face->m_ft_face,&ft_transform,NULL);
++ free(own_font_data);
++ return e_VMerror;
+ }
+-
+- /* dpf("get_scaled_font return %d\n",a_font->server_font_data ? 0 : -1); */
+- return a_font->server_font_data ? 0 : -1;
+- }
+-
+-/**
+-Return the name of a resource which maps names to character codes. Do this by setting a_decoding_id
+-to point to a null-terminated string. The resource is in the 'decoding' directory in the directory named by
+-/GenericResourceDir in \lib\gs_res.ps.
+-*/
+-static FAPI_retcode get_decodingID(FAPI_server* a_server,FAPI_font* a_font,const char** a_decoding_id)
+- {
+- *a_decoding_id = "Unicode";
+- return 0;
++ }
++
++ if (ft_inc_int)
++ {
++ open_args.flags = (FT_UInt)(open_args.flags | FT_OPEN_PARAMS);
++ ft_param.tag = FT_PARAM_TAG_INCREMENTAL;
++ ft_param.data = ft_inc_int;
++ open_args.num_params = 1;
++ open_args.params = &ft_param;
++ }
++ ft_error = FT_Open_Face(s->freetype_library, &open_args, a_font->subfont, &ft_face);
+ }
+
+-/**
+-Get the font bounding box in font units.
+-*/
+-static FAPI_retcode get_font_bbox(FAPI_server* a_server,FAPI_font* a_font,int a_box[4])
++ if (ft_face)
+ {
+- FF_face* face = (FF_face*)a_font->server_font_data;
+- a_box[0] = face->m_ft_face->bbox.xMin;
+- a_box[1] = face->m_ft_face->bbox.yMin;
+- a_box[2] = face->m_ft_face->bbox.xMax;
+- a_box[3] = face->m_ft_face->bbox.yMax;
+- return 0;
+- }
+-
+-/**
+-Return a boolean value in a_proportional stating whether the font is proportional
+-or fixed-width.
+-*/
+-static FAPI_retcode get_font_proportional_feature(FAPI_server* a_server,FAPI_font* a_font,bool* a_proportional)
+- {
+- *a_proportional = true;
+- return 0;
++ face = new_face(ft_face, ft_inc_int, own_font_data);
++ if (!face)
++ {
++ free(own_font_data);
++ FT_Done_Face(ft_face);
++ delete_inc_int(ft_inc_int);
++ return e_VMerror;
++ }
++ a_font->server_font_data = face;
+ }
+-
+-/**
+-Convert the character name in a_char_ref.char_name to a character code or glyph index and put it in a_char_ref.char_code,
+-setting a_char_ref.is_glyph_index as appropriate. If this is possible set a_result to true, otherwise set it to false.
+-The return value is a standard error return code.
+-*/
+-static FAPI_retcode can_retrieve_char_by_name(FAPI_server* a_server,FAPI_font* a_font,FAPI_char_ref* a_char_ref,
+- bool* a_result)
+- {
+- FF_face* face = (FF_face*)a_font->server_font_data;
+- char name[128];
+- if (FT_HAS_GLYPH_NAMES(face->m_ft_face) && a_char_ref->char_name_length < sizeof(name))
+- {
+- memcpy(name,a_char_ref->char_name,a_char_ref->char_name_length);
+- name[a_char_ref->char_name_length] = 0;
+- a_char_ref->char_code = FT_Get_Name_Index(face->m_ft_face,name);
+- *a_result = a_char_ref->char_code != 0;
+- if (*a_result)
+- a_char_ref->is_glyph_index = true;
+- }
+ else
+- *a_result = false;
+- return 0;
++ a_font->server_font_data = NULL;
++ }
++
++ /* Set the point size and transformation.
++ * The matrix is scaled by the shift specified in the server, 16,
++ * so we divide by 65536 when converting to a gs_matrix.
++ */
++ if (face)
++ {
++ static const FT_Matrix ft_reflection = { 65536, 0, 0, -65536 };
++ FT_Matrix ft_transform;
++ FT_F26Dot6 width, height;
++
++ /* Convert the GS transform into an FT transform.
++ * Ignore the translation elements because they contain very large values
++ * derived from the current transformation matrix and so are of no use.
++ */
++ ft_transform.xx = a_font_scale->matrix[0];
++ ft_transform.xy = a_font_scale->matrix[2];
++ ft_transform.yx = a_font_scale->matrix[1];
++ ft_transform.yy = a_font_scale->matrix[3];
++
++ /* Split the transform into scale factors and a rotation-and-shear
++ * transform.
++ */
++ transform_decompose(&ft_transform, &width, &height);
++
++ /* Convert width and height to 64ths of pixels and set the FreeType sizes. */
++ width >>= 10;
++ height >>= 10;
++ ft_error = FT_Set_Char_Size(face->ft_face, width, height,
++ a_font_scale->HWResolution[0] >> 16,
++ a_font_scale->HWResolution[1] >> 16);
++ if (ft_error)
++ {
++ delete_face(face);
++ a_font->server_font_data = NULL;
++ return ft_to_gs_error(ft_error);
+ }
+
+-/**
+-Return non-zero if the metrics can be replaced.
+-*/
+-static FAPI_retcode can_replace_metrics(FAPI_server *a_server,FAPI_font *a_font,FAPI_char_ref *a_char_ref,int *a_result)
+- {
+- /* Replace metrics only if the metrics are supplied in font units. */
++ /* Concatenate the transform to a reflection around (y=0) so that it
++ * produces a glyph that is upside down in FreeType terms, with its
++ * first row at the bottom. That is what GhostScript needs.
++ */
++
++ FT_Set_Transform(face->ft_face, &ft_transform, NULL);
++ }
++
++ /* dpf("get_scaled_font return %d\n", a_font->server_font_data ? 0 : -1); */
++ return a_font->server_font_data ? 0 : -1;
++}
++
++/*
++ * Return the name of a resource which maps names to character codes. Do this
++ * by setting a_decoding_id to point to a null-terminated string. The resource
++ * is in the 'decoding' directory in the directory named by /GenericResourceDir
++ * in lib/gs_res.ps.
++ */
++static FAPI_retcode
++get_decodingID(FAPI_server *a_server, FAPI_font *a_font, const char** a_decoding_id)
++{
++ *a_decoding_id = "Unicode";
++ return 0;
++}
++
++/*
++ * Get the font bounding box in font units.
++ */
++static FAPI_retcode
++get_font_bbox(FAPI_server *a_server, FAPI_font *a_font, int a_box[4])
++{
++ FF_face *face = (FF_face*)a_font->server_font_data;
++ a_box[0] = face->ft_face->bbox.xMin;
++ a_box[1] = face->ft_face->bbox.yMin;
++ a_box[2] = face->ft_face->bbox.xMax;
++ a_box[3] = face->ft_face->bbox.yMax;
++ return 0;
++}
++
++/*
++ * Return a boolean value in a_proportional stating whether the font is proportional
++ * or fixed-width.
++ */
++static FAPI_retcode
++get_font_proportional_feature(FAPI_server *a_server, FAPI_font *a_font, bool *a_proportional)
++{
++ *a_proportional = true;
++ return 0;
++}
++
++/* Convert the character name in a_char_ref.char_name to a character code or
++ * glyph index and put it in a_char_ref.char_code, setting
++ * a_char_ref.is_glyph_index as appropriate. If this is possible set a_result
++ * to true, otherwise set it to false. The return value is a standard error
++ * return code.
++ */
++static FAPI_retcode
++can_retrieve_char_by_name(FAPI_server *a_server, FAPI_font *a_font, FAPI_char_ref *a_char_ref, bool *a_result)
++{
++ FF_face *face = (FF_face*)a_font->server_font_data;
++ char name[128];
++ if (FT_HAS_GLYPH_NAMES(face->ft_face) && a_char_ref->char_name_length < sizeof(name))
++ {
++ memcpy(name, a_char_ref->char_name, a_char_ref->char_name_length);
++ name[a_char_ref->char_name_length] = 0;
++ a_char_ref->char_code = FT_Get_Name_Index(face->ft_face, name);
++ *a_result = a_char_ref->char_code != 0;
++ if (*a_result)
++ a_char_ref->is_glyph_index = true;
++ }
++ else
++ *a_result = false;
++ return 0;
++}
++
++/*
++ * Return non-zero if the metrics can be replaced.
++ */
++static FAPI_retcode
++can_replace_metrics(FAPI_server *a_server, FAPI_font *a_font, FAPI_char_ref *a_char_ref, int *a_result)
++{
++ /* Replace metrics only if the metrics are supplied in font units. */
+ *a_result = a_char_ref->metrics_scale == 0;
+ return 0;
+- }
+-
+-/**
+-Retrieve the metrics of a_char_ref and put them in a_metrics.
+-*/
+-static FAPI_retcode get_char_width(FAPI_server *a_server,FAPI_font *a_font,FAPI_char_ref *a_char_ref,
+- FAPI_metrics *a_metrics)
+- {
+- return load_glyph(a_font,a_char_ref,a_metrics,NULL,false);
+- }
+-
+-/**
+-Rasterize the character a_char and return its metrics. Do not return the bitmap but store this. It can be retrieved by
+-a subsequent call to get_char_raster.
+-*/
+-static FAPI_retcode get_char_raster_metrics(FAPI_server* a_server,FAPI_font* a_font,FAPI_char_ref* a_char_ref,
+- FAPI_metrics* a_metrics)
+- {
+- FF_server* s = (FF_server*)a_server;
+- FAPI_retcode error = load_glyph(a_font,a_char_ref,a_metrics,(FT_Glyph*)&s->m_bitmap_glyph,true);
+- return error;
+- }
+-
+-/**
+-Return the bitmap created by the last call to get_char_raster_metrics.
+-*/
+-static FAPI_retcode get_char_raster(FAPI_server *a_server,FAPI_raster *a_raster)
+- {
+- FF_server* s = (FF_server*)a_server;
+- if (!s->m_bitmap_glyph)
+- return_error(e_unregistered); /* Must not happen. */
+- a_raster->p = s->m_bitmap_glyph->bitmap.buffer;
+- a_raster->width = s->m_bitmap_glyph->bitmap.width;
+- a_raster->height = s->m_bitmap_glyph->bitmap.rows;
+- a_raster->line_step = s->m_bitmap_glyph->bitmap.pitch;
+- a_raster->orig_x = s->m_bitmap_glyph->left * 16;
+- a_raster->orig_y = s->m_bitmap_glyph->top * 16;
+- return 0;
+- }
+-
+-/**
+-Create an outline for the character a_char and return its metrics. Do not return the outline but store this.
+-It can be retrieved by a subsequent call to get_char_outline.
+-*/
+-static FAPI_retcode get_char_outline_metrics(FAPI_server *a_server,FAPI_font *a_font,FAPI_char_ref *a_char_ref,
+- FAPI_metrics *a_metrics)
+- {
+- FF_server* s = (FF_server*)a_server;
+- return load_glyph(a_font,a_char_ref,a_metrics,(FT_Glyph*)&s->m_outline_glyph,false);
+- }
+-
+-typedef struct FF_path_info_
+- {
+- FAPI_path* m_path;
+- FracInt m_x;
+- FracInt m_y;
+- } FF_path_info;
+-
+-static int move_to(FT_Vector* aTo,void* aObject)
+- {
+- FF_path_info* p = (FF_path_info*)aObject;
+- p->m_x = aTo->x;
+- p->m_y = aTo->y;
+- return p->m_path->moveto(p->m_path,aTo->x,aTo->y) ? -1 : 0;
+- }
+-
+-static int line_to(FT_Vector* aTo,void* aObject)
+- {
+- FF_path_info* p = (FF_path_info*)aObject;
+- p->m_x = aTo->x;
+- p->m_y = aTo->y;
+- return p->m_path->lineto(p->m_path,aTo->x,aTo->y) ? -1 : 0;
+- }
+-
+-static int conic_to(FT_Vector* aControl,FT_Vector* aTo,void* aObject)
+- {
+- FF_path_info* p = (FF_path_info*)aObject;
+- p->m_x = aTo->x;
+- p->m_y = aTo->y;
+- /*
+- Convert a quadratic spline to a cubic. Do this by changing the three points
+- A, B and C to A, 1/3(B,A), 1/3(B,C), C - that is, the two cubic control points are
+- a third of the way from the single quadratic control point to the end points. This
+- gives the same curve as the original quadratic.
+- */
+- return p->m_path->curveto(p->m_path,(p->m_x + aControl->x * 2) / 3,
+- (p->m_y + aControl->y * 2) / 3,
+- (aTo->x + aControl->x * 2) / 3,
+- (aTo->y + aControl->y * 2) / 3,
+- aTo->x,aTo->y) ? -1 : 0;
+- }
+-
+-static int cubic_to(FT_Vector* aControl1,FT_Vector* aControl2,FT_Vector* aTo,void* aObject)
+- {
+- FF_path_info* p = (FF_path_info*)aObject;
+- p->m_x = aTo->x;
+- p->m_y = aTo->y;
+- return p->m_path->curveto(p->m_path,aControl1->x,aControl1->y,aControl2->x,aControl2->y,aTo->x,aTo->y) ? -1 : 0;
+- }
++}
++
++/*
++ * Retrieve the metrics of a_char_ref and put them in a_metrics.
++ */
++static FAPI_retcode
++get_char_width(FAPI_server *a_server, FAPI_font *a_font, FAPI_char_ref *a_char_ref, FAPI_metrics *a_metrics)
++{
++ return load_glyph(a_font, a_char_ref, a_metrics, NULL, false);
++}
++
++/*
++ * Rasterize the character a_char and return its metrics. Do not return the
++ * bitmap but store this. It can be retrieved by a subsequent call to
++ * get_char_raster.
++ */
++static FAPI_retcode
++get_char_raster_metrics(FAPI_server *a_server, FAPI_font *a_font,
++ FAPI_char_ref *a_char_ref, FAPI_metrics *a_metrics)
++{
++ FF_server *s = (FF_server*)a_server;
++ FAPI_retcode error = load_glyph(a_font, a_char_ref, a_metrics, (FT_Glyph*)&s->bitmap_glyph, true);
++ return error;
++}
++
++/*
++ * Return the bitmap created by the last call to get_char_raster_metrics.
++ */
++static FAPI_retcode
++get_char_raster(FAPI_server *a_server, FAPI_raster *a_raster)
++{
++ FF_server *s = (FF_server*)a_server;
++ if (!s->bitmap_glyph)
++ return_error(e_unregistered); /* Must not happen. */
++ a_raster->p = s->bitmap_glyph->bitmap.buffer;
++ a_raster->width = s->bitmap_glyph->bitmap.width;
++ a_raster->height = s->bitmap_glyph->bitmap.rows;
++ a_raster->line_step = s->bitmap_glyph->bitmap.pitch;
++ a_raster->orig_x = s->bitmap_glyph->left * 16;
++ a_raster->orig_y = s->bitmap_glyph->top * 16;
++ a_raster->left_indent = a_raster->top_indent = a_raster->black_height = a_raster->black_width = 0;
++ return 0;
++}
++
++/*
++ * Create an outline for the character a_char and return its metrics. Do not
++ * return the outline but store this.
++ * It can be retrieved by a subsequent call to get_char_outline.
++ */
++static FAPI_retcode
++get_char_outline_metrics(FAPI_server *a_server, FAPI_font *a_font,
++ FAPI_char_ref *a_char_ref, FAPI_metrics *a_metrics)
++{
++ FF_server *s = (FF_server*)a_server;
++ return load_glyph(a_font, a_char_ref, a_metrics, (FT_Glyph*)&s->outline_glyph, false);
++}
++
++typedef struct FF_path_info_s
++{
++ FAPI_path *path;
++ FracInt x;
++ FracInt y;
++} FF_path_info;
++
++static int move_to(FT_Vector *aTo, void *aObject)
++{
++ FF_path_info *p = (FF_path_info*)aObject;
++
++ /* FAPI expects that co-ordinates will be as implied by frac_shift
++ * in our case 16.16 fixed precision. True for 'low level' FT
++ * routines (apparently), it isn't true for these routines where
++ * FT returns a 26.6 format. Rescale to 16.16 so that FAPI will
++ * be able to convert to GS co-ordinates properly.
++ */
++ p->x = aTo->x << 10;
++ p->y = aTo->y << 10;
++
++ return p->path->moveto(p->path, p->x, p->y) ? -1 : 0;
++}
++
++static int line_to(FT_Vector *aTo, void *aObject)
++{
++ FF_path_info *p = (FF_path_info*)aObject;
++
++ /* See move_to() above */
++ p->x = aTo->x << 10;
++ p->y = aTo->y << 10;
++
++ return p->path->lineto(p->path, p->x, p->y) ? -1 : 0;
++}
++
++static int conic_to(FT_Vector *aControl, FT_Vector *aTo, void *aObject)
++{
++ FF_path_info *p = (FF_path_info*)aObject;
++ floatp x, y, Controlx, Controly, Control1x, Control1y, Control2x, Control2y;
++
++ /* More complivated than above, we need to do arithmetic on the
++ * co-ordinates, so we want them as floats and we will convert the
++ * result into 16.16 fixed precision for FAPI
++ *
++ * NB this code is funcitonally the same as the original, but I don't believe
++ * the comment (below) to be what the code is actually doing....
++ *
++ * Convert a quadratic spline to a cubic. Do this by changing the three points
++ * A, B and C to A, 1/3(B,A), 1/3(B,C), C - that is, the two cubic control points are
++ * a third of the way from the single quadratic control point to the end points. This
++ * gives the same curve as the original quadratic.
++ */
++
++ x = aTo->x / 64;
++ p->x = float2fixed(x) << 8;
++ y = aTo->y / 64;
++ p->y = float2fixed(y) << 8;
++ Controlx = aControl->x / 64;
++ Controly = aControl->y / 64;
++
++ Control1x = float2fixed((x + Controlx * 2) / 3) << 8;
++ Control1y = float2fixed((y + Controly * 2) / 3) << 8;
++ Control2x = float2fixed((x + Controlx * 2) / 3) << 8;
++ Control2y = float2fixed((y + Controly * 2) / 3) << 8;
++
++ return p->path->curveto(p->path, Control1x,
++ Control1y,
++ Control2x,
++ Control2y,
++ p->x, p->y) ? -1 : 0;
++}
++
++static int cubic_to(FT_Vector *aControl1, FT_Vector *aControl2, FT_Vector *aTo, void *aObject)
++{
++ FF_path_info *p = (FF_path_info*)aObject;
++ unsigned long Control1x, Control1y, Control2x, Control2y;
++
++ /* See move_to() above */
++ p->x = aTo->x << 10;
++ p->y = aTo->y << 10;
++
++ Control1x = aControl1->x << 10;
++ Control1y = aControl1->y << 10;
++ Control2x = aControl2->x << 10;
++ Control2y = aControl2->y << 10;
++ return p->path->curveto(p->path, Control1x, Control1y, Control2x, Control2y, p->x, p->y) ? -1 : 0;
++
++ p->x = aTo->x;
++ p->y = aTo->y;
++ return p->path->curveto(p->path, aControl1->x, aControl1->y, aControl2->x, aControl2->y, aTo->x, aTo->y) ? -1 : 0;
++}
+
+ static const FT_Outline_Funcs TheFtOutlineFuncs =
+- {
+- move_to,
+- line_to,
+- conic_to,
+- cubic_to,
+- 0,
+- 0
+- };
++{
++ move_to,
++ line_to,
++ conic_to,
++ cubic_to,
++ 0,
++ 0
++};
+
+-/**
+-Return the outline created by the last call to get_char_outline_metrics.
+-*/
+-static FAPI_retcode get_char_outline(FAPI_server *a_server,FAPI_path *a_path)
+- {
+- FF_server* s = (FF_server*)a_server;
+- FF_path_info p;
+- FT_Error ft_error = 0;
+- p.m_path = a_path;
+- p.m_x = 0;
+- p.m_y = 0;
+- ft_error = FT_Outline_Decompose(&s->m_outline_glyph->outline,&TheFtOutlineFuncs,&p);
+- a_path->closepath(a_path);
+- return ft_to_gs_error(ft_error);
+- }
++/*
++ * Return the outline created by the last call to get_char_outline_metrics.
++ */
++static FAPI_retcode
++get_char_outline(FAPI_server *a_server, FAPI_path *a_path)
++{
++ FF_server *s = (FF_server*)a_server;
++ FF_path_info p;
++ FT_Error ft_error = 0;
++ p.path = a_path;
++ p.x = 0;
++ p.y = 0;
++ ft_error = FT_Outline_Decompose(&s->outline_glyph->outline, &TheFtOutlineFuncs, &p);
++ a_path->closepath(a_path);
++ return ft_to_gs_error(ft_error);
++}
+
+ static FAPI_retcode release_char_data(FAPI_server *a_server)
+- {
+- FF_server* s = (FF_server*)a_server;
+- FT_Done_Glyph(&s->m_outline_glyph->root);
+- FT_Done_Glyph(&s->m_bitmap_glyph->root);
+- s->m_outline_glyph = NULL;
+- s->m_bitmap_glyph = NULL;
+- return 0;
+- }
++{
++ FF_server *s = (FF_server*)a_server;
++ FT_Done_Glyph(&s->outline_glyph->root);
++ FT_Done_Glyph(&s->bitmap_glyph->root);
++ s->outline_glyph = NULL;
++ s->bitmap_glyph = NULL;
++ return 0;
++}
+
+-static FAPI_retcode release_typeface(FAPI_server* a_server,void* a_server_font_data)
+- {
+- FF_face* face = (FF_face*)a_server_font_data;
+- delete_face(face);
+- return 0;
+- }
++static FAPI_retcode
++release_typeface(FAPI_server *a_server, void *a_server_font_data)
++{
++ FF_face *face = (FF_face*)a_server_font_data;
++ delete_face(face);
++ return 0;
++}
+
+-static void gs_freetype_destroy(i_plugin_instance* a_instance,i_plugin_client_memory* a_memory);
++static FAPI_retcode
++check_cmap_for_GID(FAPI_server *server, uint *index)
++{
++ FF_server *s = (FF_server*)server;
++ FF_face *face = (FF_face*)(server->ff.server_font_data);
++ FT_Face ft_face = face->ft_face;
++
++ *index = FT_Get_Char_Index(ft_face, *index);
++ return 0;
++}
++
++static void gs_freetype_destroy(i_plugin_instance *a_instance, i_plugin_client_memory *a_memory);
+
+ static const i_plugin_descriptor TheFreeTypeDescriptor =
+- {
++{
+ "FAPI",
+ "FreeType",
+ gs_freetype_destroy
+- };
++};
+
+ static const FAPI_server TheFreeTypeServer =
+- {
++{
+ { &TheFreeTypeDescriptor },
+ 16, /* frac_shift */
+ {gs_no_id},
+@@ -863,29 +905,28 @@ static const FAPI_server TheFreeTypeServer =
+ get_char_outline_metrics,
+ get_char_outline,
+ release_char_data,
+- release_typeface
+- };
++ release_typeface,
++ check_cmap_for_GID
++};
+
+ plugin_instantiation_proc(gs_fapi_ft_instantiate);
+
+-int gs_fapi_ft_instantiate( i_plugin_client_memory *a_memory,
+- i_plugin_instance **a_plugin_instance)
+- {
+- FF_server *server = (FF_server *)a_memory->alloc(a_memory,
+- sizeof(FF_server),"FF_server");
++int gs_fapi_ft_instantiate( i_plugin_client_memory *a_memory, i_plugin_instance **a_plugin_instance)
++{
++ FF_server *server = (FF_server*) a_memory->alloc(a_memory, sizeof (FF_server), "FF_server");
+ if (!server)
+- return e_VMerror;
+- memset(server,0,sizeof(*server));
+- server->m_fapi_server = TheFreeTypeServer;
+- *a_plugin_instance = &server->m_fapi_server.ig;
++ return e_VMerror;
++ memset(server, 0, sizeof(*server));
++ server->fapi_server = TheFreeTypeServer;
++ *a_plugin_instance = &server->fapi_server.ig;
+ return 0;
+- }
++}
+
+-static void gs_freetype_destroy(i_plugin_instance *a_plugin_instance,i_plugin_client_memory *a_memory)
+- {
+- FF_server *server = (FF_server *)a_plugin_instance;
+- FT_Done_Glyph(&server->m_outline_glyph->root);
+- FT_Done_Glyph(&server->m_bitmap_glyph->root);
+- FT_Done_FreeType(server->m_freetype_library);
+- a_memory->free(a_memory,server,"FF_server");
+- }
++static void gs_freetype_destroy(i_plugin_instance *a_plugin_instance, i_plugin_client_memory *a_memory)
++{
++ FF_server *server = (FF_server *)a_plugin_instance;
++ FT_Done_Glyph(&server->outline_glyph->root);
++ FT_Done_Glyph(&server->bitmap_glyph->root);
++ FT_Done_FreeType(server->freetype_library);
++ a_memory->free(a_memory, server, "FF_server");
++}
+diff --git a/psi/fapiufst.c b/psi/fapiufst.c
+--- a/psi/fapiufst.c
++++ b/psi/fapiufst.c
+@@ -1265,6 +1265,11 @@ static FAPI_retcode release_typeface(FAPI_server *server, void *font_data)
+ return code;
+ }
+
++static FAPI_retcode check_cmap_for_GID(FAPI_server *server, uint index)
++{
++ return 0;
++}
++
+ /* --------------------- The plugin definition : ------------------------- */
+
+
+@@ -1295,7 +1300,8 @@ static const FAPI_server If0 = {
+ get_char_outline_metrics,
+ get_char_outline,
+ release_char_data,
+- release_typeface
++ release_typeface,
++ check_cmap_for_GID
+ };
+
+ plugin_instantiation_proc(gs_fapiufst_instantiate); /* check prototype */
+diff --git a/psi/ibnum.c b/psi/ibnum.c
+--- a/psi/ibnum.c
++++ b/psi/ibnum.c
+@@ -124,11 +124,11 @@ sdecode_number(const byte * str, int format, ref * np)
+ case num_int32:
+ case num_int32 + 16:
+ if ((format & 31) == 0) {
+- np->value.intval = sdecodelong(str, format);
++ np->value.intval = sdecodeint32(str, format);
+ return t_integer;
+ } else {
+ np->value.realval =
+- (double)sdecodelong(str, format) *
++ (double)sdecodeint32(str, format) *
+ binary_scale[format & 31];
+ return t_real;
+ }
+@@ -178,18 +178,13 @@ sdecodeshort(const byte * p, int format)
+ }
+
+ /* Decode a (32-bit, signed) long. */
+-long
+-sdecodelong(const byte * p, int format)
++int
++sdecodeint32(const byte * p, int format)
+ {
+ int a = p[0], b = p[1], c = p[2], d = p[3];
+- long v = (num_is_lsb(format) ?
+- ((long)d << 24) + ((long)c << 16) + (b << 8) + a :
+- ((long)a << 24) + ((long)b << 16) + (c << 8) + d);
+-
+-#if arch_sizeof_long > 4
+- /* Propagate bit 31 as the sign. */
+- v = (v ^ 0x80000000L) - 0x80000000L;
+-#endif
++ int v = (num_is_lsb(format) ?
++ ((int)d << 24) + ((int)c << 16) + (b << 8) + a :
++ ((int)a << 24) + ((int)b << 16) + (c << 8) + d);
+ return v;
+ }
+
+diff --git a/psi/ibnum.h b/psi/ibnum.h
+--- a/psi/ibnum.h
++++ b/psi/ibnum.h
+@@ -72,7 +72,7 @@ int num_array_get(const gs_memory_t *mem, const ref *, int, uint, ref *);
+ int sdecode_number(const byte *, int, ref *);
+ int sdecodeshort(const byte *, int);
+ uint sdecodeushort(const byte *, int);
+-long sdecodelong(const byte *, int);
++int sdecodeint32(const byte *, int);
+ int sdecode_float(const byte *, int, float *);
+
+ #endif /* ibnum_INCLUDED */
+diff --git a/psi/idebug.c b/psi/idebug.c
+--- a/psi/idebug.c
++++ b/psi/idebug.c
+@@ -85,7 +85,7 @@ debug_print_full_ref(const gs_memory_t *mem, const ref * pref)
+ case t_fontID:
+ goto strct;
+ case t_integer:
+- dprintf1("int %ld", pref->value.intval);
++ dprintf1("int %d", pref->value.intval);
+ break;
+ case t_mark:
+ dprintf("mark");
+diff --git a/psi/idict.c b/psi/idict.c
+--- a/psi/idict.c
++++ b/psi/idict.c
+@@ -444,12 +444,11 @@ dict_put(ref * pdref /* t_dictionary */ , const ref * pkey, const ref * pvalue,
+ gs_memory_t *pmem = dict_mem(pdict);
+ int rcode = 0;
+ int code;
+- ref *pvslot;
++ ref *pvslot, kname;
+
+ /* Check the value. */
+ store_check_dest(pdref, pvalue);
+ top:if ((code = dict_find(pdref, pkey, &pvslot)) <= 0) { /* not found *//* Check for overflow */
+- ref kname;
+ uint index;
+
+ switch (code) {
+diff --git a/psi/idparam.c b/psi/idparam.c
+--- a/psi/idparam.c
++++ b/psi/idparam.c
+@@ -58,8 +58,7 @@ dict_int_null_param(const ref * pdict, const char *kstr, int minval,
+ int maxval, int defaultval, int *pvalue)
+ {
+ ref *pdval;
+- int code;
+- long ival;
++ int code, ival;
+
+ if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) {
+ ival = defaultval;
+@@ -378,7 +377,7 @@ dict_uid_param(const ref * pdict, gs_uid * puid, int defaultval,
+ } else {
+ if (!r_has_type(puniqueid, t_integer))
+ return_error(e_typecheck);
+- if (puniqueid->value.intval < 0 || puniqueid->value.intval > 0xffffffL)
++ if (puniqueid->value.intval < 0 || puniqueid->value.intval > 0xffffff)
+ return_error(e_rangecheck);
+ /* Apparently fonts created by Fontographer often have */
+ /* a UniqueID of 0, contrary to Adobe's specifications. */
+diff --git a/psi/ifapi.h b/psi/ifapi.h
+--- a/psi/ifapi.h
++++ b/psi/ifapi.h
+@@ -58,9 +58,25 @@ typedef enum {
+ FAPI_FONT_FEATURE_ForceBold,
+ FAPI_FONT_FEATURE_LanguageGroup,
+ FAPI_FONT_FEATURE_lenIV,
++ FAPI_FONT_FEATURE_GlobalSubrs_count,
+ FAPI_FONT_FEATURE_Subrs_count,
+ FAPI_FONT_FEATURE_Subrs_total_size,
+- FAPI_FONT_FEATURE_TT_size
++ FAPI_FONT_FEATURE_TT_size,
++ /* Multiple Master specifics */
++ FAPI_FONT_FEATURE_DollarBlend,
++ FAPI_FONT_FEATURE_DollarBlend_length,
++ FAPI_FONT_FEATURE_BlendAxisTypes_count,
++ FAPI_FONT_FEATURE_BlendAxisTypes,
++ FAPI_FONT_FEATURE_BlendPrivate_count,
++ FAPI_FONT_FEATURE_BlendFontInfo_count,
++ FAPI_FONT_FEATURE_WeightVector_count,
++ FAPI_FONT_FEATURE_WeightVector,
++ FAPI_FONT_FEATURE_BlendDesignPositionsArrays_count,
++ FAPI_FONT_FEATURE_BlendDesignPositionsArrayValue,
++ FAPI_FONT_FEATURE_BlendDesignMapArrays_count,
++ FAPI_FONT_FEATURE_BlendDesignMapSubArrays_count,
++ FAPI_FONT_FEATURE_BlendDesignMapArrayValue,
++ /* End MM specifics */
+ } fapi_font_feature;
+
+ typedef enum {
+@@ -106,6 +122,9 @@ struct FAPI_font_s {
+ unsigned short (*get_word )(FAPI_font *ff, fapi_font_feature var_id, int index);
+ unsigned long (*get_long )(FAPI_font *ff, fapi_font_feature var_id, int index);
+ float (*get_float)(FAPI_font *ff, fapi_font_feature var_id, int index);
++ int (*get_name) (FAPI_font *ff, fapi_font_feature var_id, int index, char *buffer, int len);
++ int (*get_proc) (FAPI_font *ff, fapi_font_feature var_id, int index, char *Buffer);
++ unsigned short (*get_gsubr)(FAPI_font *ff, int index, byte *buf, ushort buf_length);
+ unsigned short (*get_subr) (FAPI_font *ff, int index, byte *buf, ushort buf_length);
+ unsigned short (*get_glyph)(FAPI_font *ff, int char_code, byte *buf, ushort buf_length);
+ unsigned short (*serialize_tt_font)(FAPI_font *ff, void *buf, int buf_size);
+@@ -182,6 +201,7 @@ struct FAPI_server_s {
+ FAPI_retcode (*get_char_outline)(FAPI_server *server, FAPI_path *p);
+ FAPI_retcode (*release_char_data)(FAPI_server *server);
+ FAPI_retcode (*release_typeface)(FAPI_server *server, void *server_font_data);
++ FAPI_retcode (*check_cmap_for_GID)(FAPI_server *server, uint *index);
+ /* Some people get confused with terms "font cache" and "character cache".
+ "font cache" means a cache for scaled font objects, which mainly
+ keep the font header information and rules for adjusting it to specific raster.
+diff --git a/psi/int.mak b/psi/int.mak
+--- a/psi/int.mak
++++ b/psi/int.mak
+@@ -458,7 +458,7 @@ $(PSOBJ)zcolor.$(OBJ) : $(PSSRC)zcolor.c $(OP)\
+ $(gzstate_h) $(gxdcolor_h) $(gxdevice_h) $(gxdevmem_h) $(gxcmap_h)\
+ $(gxcspace_h) $(gxcolor2_h) $(gxpcolor_h)\
+ $(idict_h) $(icolor_h) $(idparam_h) $(iname_h) $(iutil_h) $(icsmap_h)\
+- $(ifunc_h) $(zht2_h) $(zcolor_h) $(zcie_h) $(zicc_h)
++ $(ifunc_h) $(zht2_h) $(zcolor_h) $(zcie_h) $(zicc_h) $(gscspace_h)
+ $(PSCC) $(PSO_)zcolor.$(OBJ) $(C_) $(PSSRC)zcolor.c
+
+ $(PSOBJ)zdevice.$(OBJ) : $(PSSRC)zdevice.c $(OP) $(string__h)\
+@@ -1801,43 +1801,37 @@ $(PSD)fapiu.dev : $(INT_MAK) $(ECHOGS_XE)
+
+ # FreeType bridge :
+
+-FT_LIB=$(FT_ROOT)$(D)objs$(D)freetype214MT_D
+-FT_INC=$(I_)$(FT_ROOT)$(D)include$(_I)
++# the top-level makefile should define
++# FT_CFLAGS for the include directive and other switches, and
++# FT_LIBS for the the library link command
+
+ wrfont_h=$(stdpre_h) $(PSSRC)wrfont.h
+ write_t1_h=$(ifapi_h) $(PSSRC)write_t1.h
+ write_t2_h=$(ifapi_h) $(PSSRC)write_t2.h
+
+-$(PSD)fapif1.dev : $(INT_MAK) $(ECHOGS_XE) \
+- $(FT_LIB)$(FT_LIB_EXT) \
+- $(PSOBJ)fapi_ft.$(OBJ) \
++$(PSD)fapif1.dev : $(INT_MAK) $(ECHOGS_XE) $(PSOBJ)fapi_ft.$(OBJ) \
+ $(PSOBJ)write_t1.$(OBJ) $(PSOBJ)write_t2.$(OBJ) $(PSOBJ)wrfont.$(OBJ)
+ $(SETMOD) $(PSD)fapif1 $(PSOBJ)fapi_ft.$(OBJ) $(PSOBJ)write_t1.$(OBJ)
+ $(ADDMOD) $(PSD)fapif1 $(PSOBJ)write_t2.$(OBJ) $(PSOBJ)wrfont.$(OBJ)
+ $(ADDMOD) $(PSD)fapif1 -plugin fapi_ft
+- $(ADDMOD) $(PSD)fapif1 -link $(FT_LIB)$(FT_LIB_EXT)
++ $(ADDMOD) $(PSD)fapif1 -link $(FT_LIBS)
+
+ $(PSOBJ)fapi_ft.$(OBJ) : $(PSSRC)fapi_ft.c $(AK)\
+ $(stdio__h) $(math__h) $(ifapi_h) $(gserror_h)\
+- $(FT_ROOT)$(D)include$(D)freetype$(D)freetype.h\
+- $(FT_ROOT)$(D)include$(D)freetype$(D)ftincrem.h\
+- $(FT_ROOT)$(D)include$(D)freetype$(D)ftglyph.h\
+- $(FT_ROOT)$(D)include$(D)freetype$(D)ftoutln.h\
+- $(FT_ROOT)$(D)include$(D)freetype$(D)fttrigon.h\
+ $(write_t1_h) $(write_t2_h)
+- $(PSCC) $(FT_CFLAGS) $(FT_INC) $(PSO_)fapi_ft.$(OBJ) $(C_) $(PSSRC)fapi_ft.c
++ $(PSCC) $(FT_CFLAGS) $(PSO_)fapi_ft.$(OBJ) $(C_) $(PSSRC)fapi_ft.c
+
+ $(PSOBJ)write_t1.$(OBJ) : $(PSSRC)write_t1.c $(AK)\
+ $(wrfont_h) $(write_t1_h)
+- $(PSCC) $(FT_CFLAGS) $(FT_INC) $(PSO_)write_t1.$(OBJ) $(C_) $(PSSRC)write_t1.c
++ $(PSCC) $(FT_CFLAGS) $(PSO_)write_t1.$(OBJ) $(C_) $(PSSRC)write_t1.c
+
+ $(PSOBJ)write_t2.$(OBJ) : $(PSSRC)write_t2.c $(AK)\
+- $(wrfont_h) $(write_t2_h) $(stdio_h)
+- $(PSCC) $(FT_CFLAGS) $(FT_INC) $(PSO_)write_t2.$(OBJ) $(C_) $(PSSRC)write_t2.c
++ $(wrfont_h) $(write_t2_h) $(ghost_h) $(gxfont_h) $(gxfont1_h)
++ $(PSCC) $(FT_CFLAGS) $(PSO_)write_t2.$(OBJ) $(C_) $(PSSRC)write_t2.c
+
+ $(PSOBJ)wrfont.$(OBJ) : $(PSSRC)wrfont.c $(AK)\
+ $(wrfont_h) $(stdio_h)
+- $(PSCC) $(FT_CFLAGS) $(FT_INC) $(PSO_)wrfont.$(OBJ) $(C_) $(PSSRC)wrfont.c
++ $(PSCC) $(FT_CFLAGS) $(PSO_)wrfont.$(OBJ) $(C_) $(PSSRC)wrfont.c
+
+ # stub for FreeType bridge :
+
+diff --git a/psi/interp.c b/psi/interp.c
+--- a/psi/interp.c
++++ b/psi/interp.c
+@@ -688,7 +688,9 @@ set_gc_signal(i_ctx_t *i_ctx_p, int *psignal, int value)
+ }
+ }
+
+-/* Copy the contents of an overflowed stack into a (local) array. */
++/* Copy top elements of an overflowed stack into a (local) array. */
++/* Adobe copies only 500 top elements, we copy up to 65535 top elements */
++/* for better debugging, PLRM compliance, and backward compatibility. */
+ static int
+ copy_stack(i_ctx_t *i_ctx_p, const ref_stack_t * pstack, int skip, ref * arr)
+ {
+@@ -696,6 +698,8 @@ copy_stack(i_ctx_t *i_ctx_p, const ref_stack_t * pstack, int skip, ref * arr)
+ uint save_space = ialloc_space(idmemory);
+ int code;
+
++ if (size > 65535)
++ size = 65535;
+ ialloc_set_space(idmemory, avm_local);
+ code = ialloc_ref_array(arr, a_all, size, "copy_stack");
+ if (code >= 0)
+diff --git a/psi/iparam.c b/psi/iparam.c
+--- a/psi/iparam.c
++++ b/psi/iparam.c
+@@ -63,7 +63,7 @@ ref_to_key(const ref * pref, gs_param_key_t * key, iparam_list *plist)
+ int len;
+ byte *buf;
+
+- sprintf(istr, "%ld", pref->value.intval);
++ sprintf(istr, "%d", pref->value.intval);
+ len = strlen(istr);
+ /* GC will take care of freeing this: */
+ buf = gs_alloc_string(plist->memory, len, "ref_to_key");
+@@ -390,7 +390,7 @@ stack_param_enumerate(iparam_list * plist, gs_param_enumerator_t * penum,
+ {
+ int code;
+ stack_param_list *const splist = (stack_param_list *) plist;
+- long index = penum->intval;
++ int index = penum->intval;
+ ref *stack_element;
+
+ do {
+@@ -560,12 +560,6 @@ ref_param_read_int_array(gs_param_list * plist, gs_param_name pkey,
+ code = gs_note_error(e_typecheck);
+ break;
+ }
+-#if arch_sizeof_int < arch_sizeof_long
+- if (elt.value.intval != (int)elt.value.intval) {
+- code = gs_note_error(e_rangecheck);
+- break;
+- }
+-#endif
+ piv[i] = (int)elt.value.intval;
+ }
+ if (code < 0) {
+diff --git a/psi/iref.h b/psi/iref.h
+--- a/psi/iref.h
++++ b/psi/iref.h
+@@ -380,7 +380,7 @@ struct ref_s {
+ struct tas_s tas;
+
+ union v { /* name the union to keep gdb happy */
+- long intval;
++ int intval;
+ ushort boolval;
+ float realval;
+ ulong saveid;
+diff --git a/psi/iscan.c b/psi/iscan.c
+--- a/psi/iscan.c
++++ b/psi/iscan.c
+@@ -693,10 +693,10 @@ scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
+ uint size = ref_stack_count_inline(&o_stack) - pstack;
+ ref arr;
+
+- if_debug4('S', "[S}]d=%d, s=%d->%ld, c=%d\n",
++ if_debug4('S', "[S}]d=%d, s=%d->%d, c=%d\n",
+ pdepth, pstack,
+ (pstack == pdepth ? 0 :
+- ref_stack_index(&o_stack, size)->value.intval),
++ ref_stack_index(&o_stack, size)->value.intval),
+ size + pstack);
+ myref = (pstack == pdepth ? pref : &arr);
+ if (check_only) {
+diff --git a/psi/iscanbin.c b/psi/iscanbin.c
+--- a/psi/iscanbin.c
++++ b/psi/iscanbin.c
+@@ -195,7 +195,7 @@ scan_bos(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
+
+ if (top_size == 0) {
+ /* Extended header (2-byte array size, 4-byte length) */
+- ulong lsize;
++ uint lsize;
+
+ if (rcnt < 7) {
+ s_end_inline(s, p - 1, rlimit);
+@@ -203,7 +203,7 @@ scan_bos(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
+ return scan_Refill;
+ }
+ pbs->top_size = top_size = sdecodeushort(p + 2, num_format);
+- pbs->lsize = lsize = sdecodelong(p + 4, num_format);
++ pbs->lsize = lsize = sdecodeint32(p + 4, num_format);
+ if ((size = lsize) != lsize) {
+ scan_bos_error(pstate, "bin obj seq length too large");
+ return_error(e_limitcheck);
+@@ -534,8 +534,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
+ for (; index < max_array_index; p += SIZEOF_BIN_SEQ_OBJ, index++) {
+ ref *op = abase + index;
+ uint osize;
+- long value;
+- uint atype, attrs;
++ int value, atype, attrs;
+
+ s_end_inline(s, p, rlimit); /* in case of error */
+ if (rlimit - p < SIZEOF_BIN_SEQ_OBJ) {
+@@ -555,7 +554,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
+ * syntaxerror if any unused field is non-zero (per PLRM).
+ */
+ osize = sdecodeushort(p + 3, num_format);
+- value = sdecodelong(p + 5, num_format);
++ value = sdecodeint32(p + 5, num_format);
+ switch (p[1] & 0x7f) {
+ case BS_TYPE_NULL:
+ if (osize | value) { /* unused */
+diff --git a/psi/iscannum.c b/psi/iscannum.c
+--- a/psi/iscannum.c
++++ b/psi/iscannum.c
+@@ -53,7 +53,6 @@ scan_number(const byte * str, const byte * end, int sign,
+ };
+
+ int ival;
+- long lval;
+ double dval;
+ int exp10;
+ int code = 0;
+@@ -102,8 +101,26 @@ scan_number(const byte * str, const byte * end, int sign,
+ GET_NEXT(c, sp, goto iret);
+ if (!IS_DIGIT(d, c))
+ break;
+- if (WOULD_OVERFLOW(((unsigned)ival), d, max_scan))
+- goto i2l;
++ if (WOULD_OVERFLOW(((unsigned)ival), d, max_scan)) {
++ //goto i2l;
++ if (ival == max_int / 10 && d == (max_int % 10) + 1 && sign < 0) {
++ GET_NEXT(c, sp, c = EOFC);
++ dval = -(double)min_int;
++ if (c == 'e' || c == 'E') {
++ exp10 = 0;
++ goto fs;
++ } else if (c == '.') {
++ GET_NEXT(c, sp, c = EOFC);
++ exp10 = 0;
++ goto fd;
++ } else if (!IS_DIGIT(d, c)) {
++ ival = min_int;
++ break;
++ }
++ } else
++ dval = ival;
++ goto l2d;
++ }
+ }
+ ind: /* We saw a non-digit while accumulating an integer in ival. */
+ switch (c) {
+@@ -113,6 +130,8 @@ scan_number(const byte * str, const byte * end, int sign,
+ default:
+ *psp = sp;
+ code = 1;
++ break;
++ case EOFC:
+ break;
+ case 'e':
+ case 'E':
+@@ -123,8 +142,8 @@ scan_number(const byte * str, const byte * end, int sign,
+ goto fe;
+ case '#':
+ {
+- const uint radix = (uint)ival;
+- ulong uval = 0, lmax;
++ const int radix = ival;
++ uint uval = 0, imax;
+
+ if (sign || radix < min_radix || radix > max_radix)
+ return_error(e_syntaxerror);
+@@ -134,19 +153,19 @@ scan_number(const byte * str, const byte * end, int sign,
+
+ switch (radix) {
+ case 2:
+- shift = 1, lmax = max_ulong >> 1;
++ shift = 1, imax = max_uint >> 1;
+ break;
+ case 4:
+- shift = 2, lmax = max_ulong >> 2;
++ shift = 2, imax = max_uint >> 2;
+ break;
+ case 8:
+- shift = 3, lmax = max_ulong >> 3;
++ shift = 3, imax = max_uint >> 3;
+ break;
+ case 16:
+- shift = 4, lmax = max_ulong >> 4;
++ shift = 4, imax = max_uint >> 4;
+ break;
+ case 32:
+- shift = 5, lmax = max_ulong >> 5;
++ shift = 5, imax = max_uint >> 5;
+ break;
+ default: /* can't happen */
+ return_error(e_rangecheck);
+@@ -159,13 +178,13 @@ scan_number(const byte * str, const byte * end, int sign,
+ code = 1;
+ break;
+ }
+- if (uval > lmax)
++ if (uval > imax)
+ return_error(e_limitcheck);
+ }
+ } else {
+- int lrem = max_ulong % radix;
++ int irem = max_uint % radix;
+
+- lmax = max_ulong / radix;
++ imax = max_uint / radix;
+ for (;; uval = uval * radix + d) {
+ GET_NEXT(c, sp, break);
+ d = decoder[c];
+@@ -174,8 +193,8 @@ scan_number(const byte * str, const byte * end, int sign,
+ code = 1;
+ break;
+ }
+- if (uval >= lmax &&
+- (uval > lmax || d > lrem)
++ if (uval >= imax &&
++ (uval > imax || d > irem)
+ )
+ return_error(e_limitcheck);
+ }
+@@ -188,59 +207,6 @@ iret:
+ make_int(pref, (sign < 0 ? -ival : ival));
+ return code;
+
+- /* Accumulate a long in lval. */
+-i2l:
+- for (lval = (unsigned)ival;;) {
+- if (WOULD_OVERFLOW(((unsigned long)lval), d, ((unsigned long)max_long))) {
+- /* Make a special check for entering the smallest */
+- /* (most negative) integer. */
+- if (lval == max_long / 10 &&
+- d == (int)(max_long % 10) + 1 && sign < 0
+- ) {
+- GET_NEXT(c, sp, c = EOFC);
+- dval = -(double)min_long;
+- if (c == 'e' || c == 'E') {
+- exp10 = 0;
+- goto fs;
+- } else if (c == '.') {
+- GET_NEXT(c, sp, c = EOFC);
+- exp10 = 0;
+- goto fd;
+- } else if (!IS_DIGIT(d, c)) {
+- lval = min_long;
+- break;
+- }
+- } else
+- dval = (unsigned long)lval;
+- goto l2d;
+- }
+- lval = lval * 10 + d;
+- GET_NEXT(c, sp, goto lret);
+- if (!IS_DIGIT(d, c))
+- break;
+- }
+- switch (c) {
+- case '.':
+- GET_NEXT(c, sp, c = EOFC);
+- exp10 = 0;
+- goto l2r;
+- case EOFC:
+- break;
+- default:
+- *psp = sp;
+- code = 1;
+- break;
+- case 'e':
+- case 'E':
+- exp10 = 0;
+- goto le;
+- case '#':
+- return_error(e_syntaxerror);
+- }
+-lret:
+- make_int(pref, (sign < 0 ? -lval : lval));
+- return code;
+-
+ /* Accumulate a double in dval. */
+ l2d:
+ exp10 = 0;
+@@ -291,8 +257,8 @@ i2r:
+ break;
+ }
+ if (WOULD_OVERFLOW(ival, d, max_int)) {
+- lval = ival;
+- goto l2r;
++ dval = ival;
++ goto fd;
+ }
+ ival = ival * 10 + d;
+ exp10--;
+@@ -310,32 +276,6 @@ i2r:
+ dval = ival;
+ goto fe;
+
+- /* We saw a '.' while accumulating a long in lval. */
+-l2r:
+- while (IS_DIGIT(d, c) || c == '-') {
+- /* Handle bogus '-' following '.' as in i2r above. */
+- if (c == '-') {
+- if ((scanner_options & SCAN_PDF_INV_NUM) == 0)
+- break;
+- do {
+- GET_NEXT(c, sp, c = EOFC);
+- } while (IS_DIGIT(d, c));
+- break;
+- }
+- if (WOULD_OVERFLOW(lval, d, max_long)) {
+- dval = lval;
+- goto fd;
+- }
+- lval = lval * 10 + d;
+- exp10--;
+- GET_NEXT(c, sp, c = EOFC);
+- }
+-le:
+- if (sign < 0)
+- lval = -lval;
+- dval = lval;
+- goto fe;
+-
+ /* Now we are accumulating a double in dval. */
+ fd:
+ while (IS_DIGIT(d, c)) {
+diff --git a/psi/iutil.c b/psi/iutil.c
+--- a/psi/iutil.c
++++ b/psi/iutil.c
+@@ -492,7 +492,7 @@ other:
+ data = (const byte *)(op->value.boolval ? "true" : "false");
+ break;
+ case t_integer:
+- sprintf(buf, "%ld", op->value.intval);
++ sprintf(buf, "%d", op->value.intval);
+ break;
+ case t_string:
+ check_read(*op);
+diff --git a/psi/iutil2.c b/psi/iutil2.c
+--- a/psi/iutil2.c
++++ b/psi/iutil2.c
+@@ -34,11 +34,8 @@ param_read_password(gs_param_list * plist, const char *kstr, password * ppass)
+ {
+ gs_param_string ps;
+ long ipass;
+- int code;
++ int code = param_read_string(plist, kstr, &ps);
+
+- ps.data = (const byte *)ppass->data, ps.size = ppass->size,
+- ps.persistent = false;
+- code = param_read_string(plist, kstr, &ps);
+ switch (code) {
+ case 0: /* OK */
+ if (ps.size > MAX_PASSWORD)
+diff --git a/psi/psromfs.mak b/psi/psromfs.mak
+--- a/psi/psromfs.mak
++++ b/psi/psromfs.mak
+@@ -25,8 +25,7 @@
+ RESOURCE_LIST=CIDFont$(D) CMap$(D) ColorSpace$(D) Decoding$(D) Encoding$(D) Font$(D) IdiomSet$(D) Init$(D) ProcSet$(D) SubstCID$(D)
+
+ # Note: gs_cet.ps is only needed to match Adobe CPSI defaults
+-PS_ROMFS_ARGS=-c -P $(PSRESDIR)$(D) -d Resource/ $(RESOURCE_LIST) \
+- -d lib/ -P $(PSLIBDIR)$(D) $(EXTRA_INIT_FILES)
++PS_ROMFS_ARGS=-c -P $(PSRESDIR)$(D) -d Resource/ $(RESOURCE_LIST) -d lib/ -P $(PSLIBDIR)$(D) $(EXTRA_INIT_FILES)
+
+ # We'd really like to have all of the files in Resourc/Init/ be dependencies
+ # for COMPILE_INITS=1, but we settle for just the main one. "touch" it if
+diff --git a/psi/wrfont.c b/psi/wrfont.c
+new file mode 100644
+--- /dev/null
++++ b/psi/wrfont.c
+@@ -0,0 +1,78 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++/*
++Support functions to serialize fonts as PostScript code that can
++then be passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 9th August 2002.
++*/
++
++#include "wrfont.h"
++#include "stdio_.h"
++
++#define EEXEC_KEY 55665
++#define EEXEC_FACTOR 52845
++#define EEXEC_OFFSET 22719
++
++void WRF_init(WRF_output* a_output,unsigned char* a_buffer,long a_buffer_size)
++ {
++ a_output->m_pos = a_buffer;
++ a_output->m_limit = a_buffer_size;
++ a_output->m_count = 0;
++ a_output->m_encrypt = false;
++ a_output->m_key = EEXEC_KEY;
++ }
++
++void WRF_wbyte(WRF_output* a_output,unsigned char a_byte)
++ {
++ if (a_output->m_count < a_output->m_limit)
++ {
++ if (a_output->m_encrypt)
++ {
++ a_byte ^= (a_output->m_key >> 8);
++ a_output->m_key = (unsigned short)((a_output->m_key + a_byte) * EEXEC_FACTOR + EEXEC_OFFSET);
++ }
++ *a_output->m_pos++ = a_byte;
++ }
++ a_output->m_count++;
++ }
++
++void WRF_wtext(WRF_output* a_output,const unsigned char* a_string,long a_length)
++ {
++ while (a_length > 0)
++ {
++ WRF_wbyte(a_output,*a_string++);
++ a_length--;
++ }
++ }
++
++void WRF_wstring(WRF_output* a_output,const char* a_string)
++ {
++ while (*a_string)
++ WRF_wbyte(a_output,*a_string++);
++ }
++
++void WRF_wfloat(WRF_output* a_output,double a_float)
++ {
++ char buffer[32];
++ sprintf(buffer,"%f",a_float);
++ WRF_wstring(a_output,buffer);
++ }
++
++void WRF_wint(WRF_output* a_output,long a_int)
++ {
++ char buffer[32];
++ sprintf(buffer,"%ld",a_int);
++ WRF_wstring(a_output,buffer);
++ }
+diff --git a/psi/wrfont.h b/psi/wrfont.h
+new file mode 100644
+--- /dev/null
++++ b/psi/wrfont.h
+@@ -0,0 +1,42 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++/*
++Header for support functions to serialize fonts as PostScript code that can
++then be passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 9th August 2002.
++*/
++
++#ifndef wrfont_INCLUDED
++#define wrfont_INCLUDED
++
++#include "stdpre.h"
++
++typedef struct WRF_output_
++ {
++ unsigned char* m_pos;
++ long m_limit;
++ long m_count;
++ bool m_encrypt;
++ unsigned short m_key;
++ } WRF_output;
++
++void WRF_init(WRF_output* a_output,unsigned char* a_buffer,long a_buffer_size);
++void WRF_wbyte(WRF_output* a_output,unsigned char a_byte);
++void WRF_wtext(WRF_output* a_output,const unsigned char* a_string,long a_length);
++void WRF_wstring(WRF_output* a_output,const char* a_string);
++void WRF_wfloat(WRF_output* a_output,double a_float);
++void WRF_wint(WRF_output* a_output,long a_int);
++
++#endif
+diff --git a/psi/write_t1.c b/psi/write_t1.c
+new file mode 100644
+--- /dev/null
++++ b/psi/write_t1.c
+@@ -0,0 +1,292 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++
++/*
++Functions to serialize a type 1 font as PostScript code that can then be
++passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 26th July 2002.
++*/
++
++#include "wrfont.h"
++#include "write_t1.h"
++
++/*
++Public structures and functions in this file are prefixed with FF_ because they are part of
++the FAPI FreeType implementation.
++*/
++
++static void write_word_entry(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_divisor)
++ {
++ short x;
++ WRF_wbyte(a_output,'/');
++ WRF_wstring(a_output,a_name);
++ WRF_wbyte(a_output,' ');
++ /* Get the value and convert it from unsigned to signed by assigning it to a short. */
++ x = a_fapi_font->get_word(a_fapi_font,a_index,0);
++ /* Divide by the divisor to bring it back to font units. */
++ x = (short)(x / a_divisor);
++ WRF_wint(a_output,x);
++ WRF_wstring(a_output," def\n");
++ }
++
++static void write_array_entry_with_count(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_count,int a_divisor)
++ {
++ int i;
++
++ if (a_count <= 0)
++ return;
++
++ WRF_wbyte(a_output,'/');
++ WRF_wstring(a_output,a_name);
++ WRF_wstring(a_output," [");
++ for (i = 0; i < a_count; i++)
++ {
++ /* Get the value and convert it from unsigned to signed by assigning it to a short. */
++ short x = a_fapi_font->get_word(a_fapi_font,a_index,i);
++ /* Divide by the divisor to bring it back to font units. */
++ x = (short)(x / a_divisor);
++ WRF_wint(a_output,x);
++ WRF_wbyte(a_output,(byte)(i == a_count - 1 ? ']' : ' '));
++ }
++ WRF_wstring(a_output," def\n");
++ }
++
++
++static void write_array_entry(FAPI_font* a_fapi_font,WRF_output* a_output,const char* a_name,int a_index,int a_divisor)
++ {
++ /* NOTE that the feature index must be preceded by the count index for this to work. */
++ int count = a_fapi_font->get_word(a_fapi_font,a_index - 1,0);
++ write_array_entry_with_count(a_fapi_font,a_output,a_name,a_index,count,a_divisor);
++ }
++
++static void write_subrs(FAPI_font* a_fapi_font,WRF_output* a_output)
++ {
++ int i;
++ int count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_Subrs_count,0);
++ if (count <= 0)
++ return;
++
++ WRF_wstring(a_output,"/Subrs ");
++ WRF_wint(a_output,count);
++ WRF_wstring(a_output," array\n");
++
++ for (i = 0; i < count; i++)
++ {
++ long length = a_fapi_font->get_subr(a_fapi_font,i,0,0);
++ long buffer_size;
++ WRF_wstring(a_output,"dup ");
++ WRF_wint(a_output,i);
++ WRF_wbyte(a_output,' ');
++ WRF_wint(a_output,length);
++ WRF_wstring(a_output," RD ");
++
++ /* Get the subroutine into the buffer and encrypt it in place. */
++ buffer_size = a_output->m_limit - a_output->m_count;
++ if (buffer_size >= length)
++ {
++ a_fapi_font->get_subr(a_fapi_font,i,a_output->m_pos,(ushort)length);
++ WRF_wtext(a_output,a_output->m_pos,length);
++ }
++ else
++ a_output->m_count += length;
++
++ WRF_wstring(a_output," NP\n");
++ }
++
++ WRF_wstring(a_output,"ND\n");
++ }
++
++static int is_MM_font(FAPI_font *a_fapi_font)
++{
++ return a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend,0);
++}
++
++static void write_private_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output)
++ {
++ a_output->m_encrypt = true;
++
++ /* Write 4 bytes that must encrypt to at least one character that cannot be a valid hexadecimal character. */
++ WRF_wstring(a_output,"XXXX");
++
++ /*+ to do: correct size of dictionary from 8. */
++ WRF_wstring(a_output,"dup /Private 8 dict dup begin\n");
++
++ WRF_wstring(a_output,"/MinFeature {16 16} def\n");
++ WRF_wstring(a_output,"/password 5839 def\n");
++ WRF_wstring(a_output,"/lenIV -1 def\n"); /* indicate that /subrs are not encoded. */
++ write_word_entry(a_fapi_font,a_output,"BlueFuzz",FAPI_FONT_FEATURE_BlueFuzz,16);
++
++ WRF_wstring(a_output,"/BlueScale ");
++ WRF_wfloat(a_output,a_fapi_font->get_long(a_fapi_font,FAPI_FONT_FEATURE_BlueScale,0) / 65536.0);
++ WRF_wstring(a_output," def\n");
++
++ write_word_entry(a_fapi_font,a_output,"BlueShift",FAPI_FONT_FEATURE_BlueShift,16);
++ write_array_entry(a_fapi_font,a_output,"BlueValues",FAPI_FONT_FEATURE_BlueValues,16);
++ write_array_entry(a_fapi_font,a_output,"OtherBlues",FAPI_FONT_FEATURE_OtherBlues,16);
++ write_array_entry(a_fapi_font,a_output,"FamilyBlues",FAPI_FONT_FEATURE_FamilyBlues,16);
++ write_array_entry(a_fapi_font,a_output,"FamilyOtherBlues",FAPI_FONT_FEATURE_FamilyOtherBlues,16);
++ write_word_entry(a_fapi_font,a_output,"ForceBold",FAPI_FONT_FEATURE_ForceBold,1);
++ write_array_entry_with_count(a_fapi_font,a_output,"StdHW",FAPI_FONT_FEATURE_StdHW,1,16);
++ write_array_entry_with_count(a_fapi_font,a_output,"StdVW",FAPI_FONT_FEATURE_StdVW,1,16);
++ write_array_entry(a_fapi_font,a_output,"StemSnapH",FAPI_FONT_FEATURE_StemSnapH,16);
++ write_array_entry(a_fapi_font,a_output,"StemSnapV",FAPI_FONT_FEATURE_StemSnapV,16);
++
++ if (is_MM_font(a_fapi_font)) {
++ WRF_wstring(a_output,"3 index /Blend get /Private get begin\n");
++ WRF_wstring(a_output,"|-\n");
++ }
++ write_subrs(a_fapi_font,a_output);
++ }
++
++static void write_blend_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output)
++{
++}
++
++static void write_main_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output)
++ {
++ int i;
++ WRF_wstring(a_output,"5 dict begin\n");
++
++ WRF_wstring(a_output,"/FontType 1 def\n");
++
++ WRF_wstring(a_output,"/FontMatrix [");
++ for (i = 0; i < 6; i++)
++ {
++ WRF_wfloat(a_output,a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_FontMatrix,i));
++ WRF_wbyte(a_output,(byte)(i == 5 ? ']' : ' '));
++ }
++ WRF_wbyte(a_output,'\n');
++
++ /* For now, specify standard encoding - I think GS will pass glyph indices so doesn't matter. */
++ WRF_wstring(a_output,"/Encoding StandardEncoding def\n");
++
++ WRF_wstring(a_output,"/FontBBox {");
++ for (i = 0; i < 4; i++)
++ {
++ short x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_FontBBox,i);
++ WRF_wint(a_output,x);
++ WRF_wbyte(a_output,(byte)(i == 3 ? '}' : ' '));
++ }
++ WRF_wbyte(a_output,'\n');
++ if (is_MM_font(a_fapi_font)) {
++ short x,x2;
++ float x1;
++ uint i, j, entries;
++ char Buffer[255];
++
++ entries = 0;
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendAxisTypes_count,0);
++ if (x)
++ entries++;
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignPositionsArrays_count,0);
++ if (x)
++ entries++;
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignMapArrays_count,0);
++ if (x)
++ entries++;
++
++ sprintf(Buffer, "/FontInfo %d dict dup begin\n", entries);
++ WRF_wstring(a_output, Buffer);
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendAxisTypes_count,0);
++ if (x) {
++ WRF_wstring(a_output, "/BlendAxisTypes [");
++ for (i = 0;i < x;i++) {
++ WRF_wstring(a_output," /");
++ a_fapi_font->get_name(a_fapi_font,FAPI_FONT_FEATURE_BlendAxisTypes,i, (char *)&Buffer,255);
++ WRF_wstring(a_output,Buffer);
++ }
++ WRF_wstring(a_output,"] def\n");
++ }
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignPositionsArrays_count,0);
++ if (x) {
++ WRF_wstring(a_output, "/BlendDesignPositions [");
++ x2 = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendAxisTypes_count,0);
++ for (i = 0;i < x; i++) {
++ WRF_wstring(a_output,"[");
++ for (j = 0; j < x2; j++) {
++ x1 = a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignPositionsArrayValue,i*8+j);
++ sprintf(Buffer, "%f ", x1);
++ WRF_wstring(a_output,Buffer);
++ }
++ WRF_wstring(a_output,"]");
++ }
++ WRF_wstring(a_output, "] def\n");
++ }
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignMapArrays_count,0);
++ if (x) {
++ WRF_wstring(a_output, "/BlendDesignMap [");
++ for (i = 0;i < x;i++) {
++ x2 = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignMapSubArrays_count,i);
++ WRF_wstring(a_output,"[");
++ for (j = 0; j < x2; j++) {
++ WRF_wstring(a_output,"[");
++ x1 = a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignPositionsArrayValue,i*64+j*64);
++ sprintf(Buffer, "%f ", x1);
++ WRF_wstring(a_output,Buffer);
++ x1 = a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_BlendDesignPositionsArrayValue,i*64+j*64 + 1);
++ sprintf(Buffer, "%f ", x1);
++ WRF_wstring(a_output,Buffer);
++ WRF_wstring(a_output,"]");
++ }
++ WRF_wstring(a_output,"]");
++ }
++ WRF_wstring(a_output, "] def\n");
++ }
++ WRF_wstring(a_output,"end readonly def\n");
++ WRF_wstring(a_output,"/$Blend {");
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend_length,0);
++ if(a_output->m_count)
++ a_output->m_count += x;
++ x = a_fapi_font->get_proc(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend,0,(char *)a_output->m_pos);
++ if(a_output->m_pos)
++ a_output->m_pos += x;
++ WRF_wstring(a_output,"} def\n");
++ WRF_wstring(a_output,"/$Blend {0.1 mul exch 0.45 mul add exch 0.17 mul add add} def\n");
++ WRF_wstring(a_output,"/WeightVector [");
++ x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_WeightVector_count,0);
++ for (i = 0;i < x;i++) {
++ x1 = a_fapi_font->get_float(a_fapi_font,FAPI_FONT_FEATURE_WeightVector,i);
++ sprintf(Buffer, "%f ", x1);
++ WRF_wstring(a_output,Buffer);
++ }
++ WRF_wstring(a_output,"] def\n");
++ }
++ WRF_wstring(a_output,"currentdict end\ncurrentfile eexec\n");
++ write_private_dictionary(a_fapi_font,a_output);
++ if (is_MM_font(a_fapi_font)) {
++ write_blend_dictionary(a_fapi_font, a_output);
++ }
++ }
++
++/**
++Write a Type 1 font in textual format and return its length in bytes.
++If a_buffer_size is less than the total length, only a_buffer_size bytes are written, but the total
++length is returned correctly.
++
++The PostScript is non-standard. The main dictionary contains no /Charstrings dictionary. This
++is supplied to FreeType using the incremental interface, There is also no /PaintType entry. This is required
++by PostScript but FreeType doesn't use it.
++*/
++long FF_serialize_type1_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size)
++ {
++ WRF_output output;
++ WRF_init(&output,a_buffer,a_buffer_size);
++
++ /* Leading comment identifying a Type 1 font. */
++ WRF_wstring(&output,"%!PS-AdobeFont-1\n");
++
++ write_main_dictionary(a_fapi_font,&output);
++ return output.m_count;
++ }
+diff --git a/psi/write_t1.h b/psi/write_t1.h
+new file mode 100644
+--- /dev/null
++++ b/psi/write_t1.h
+@@ -0,0 +1,28 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++/*
++Header for functions to serialize a type 1 font as PostScript code that can
++then be passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 26th July 2002.
++*/
++
++#ifndef write_t1_INCLUDED
++#define write_t1_INCLUDED
++
++#include "ifapi.h"
++
++long FF_serialize_type1_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size);
++
++#endif
+diff --git a/psi/write_t2.c b/psi/write_t2.c
+new file mode 100644
+--- /dev/null
++++ b/psi/write_t2.c
+@@ -0,0 +1,456 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++
++/*
++Functions to serialize a type 1 font so that it can then be
++passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 9th August 2002.
++*/
++
++#include "wrfont.h"
++#include "write_t2.h"
++#include "ghost.h"
++#include "gxfont.h"
++#include "gxfont1.h"
++
++/*
++Public structures and functions in this file are prefixed with FF_ because they are part of
++the FAPI FreeType implementation.
++*/
++
++static void write_4_byte_int(unsigned char* a_output,long a_int)
++ {
++ a_output[0] = (unsigned char)(a_int >> 24);
++ a_output[1] = (unsigned char)(a_int >> 16);
++ a_output[2] = (unsigned char)(a_int >> 8);
++ a_output[3] = (unsigned char)(a_int & 0xFF);
++ }
++
++static void write_type2_int(WRF_output* a_output,long a_int)
++ {
++ if (a_int >= -107 && a_int <= 107)
++ WRF_wbyte(a_output,(unsigned char)(a_int + 139));
++ else if (a_int >= -32768 && a_int <= 32767)
++ {
++ if (a_int >= 108 && a_int <= 1131)
++ a_int += 63124;
++ else if (a_int >= -1131 && a_int <= -108)
++ a_int = -a_int + 64148;
++ else
++ WRF_wbyte(a_output,28);
++ WRF_wbyte(a_output,(unsigned char)(a_int >> 8));
++ WRF_wbyte(a_output,(unsigned char)(a_int & 0xFF));
++ }
++ else
++ {
++ unsigned char buffer[4];
++ WRF_wbyte(a_output,29);
++ write_4_byte_int(buffer,a_int);
++ WRF_wtext(a_output,buffer,4);
++ }
++ }
++
++static void write_type2_float(WRF_output* a_output,double a_float)
++ {
++ char buffer[32];
++ const char* p = buffer;
++ int high = true;
++ char c = 0;
++ sprintf(buffer,"%f",a_float);
++ WRF_wbyte(a_output,30);
++ for (;;)
++ {
++ char n = 0;
++ if (*p >= '0' && *p <= '9')
++ n = (char)(*p - '0');
++ else if (*p == '.')
++ n = 0xA;
++ else if (*p == 'e' || *p == 'E')
++ {
++ if (p[1] == '-')
++ {
++ p++;
++ n = 0xC;
++ }
++ else
++ n = 0xB;
++ }
++ else if (*p == '-')
++ n = 0xE;
++ else if (*p == 0)
++ n = 0xF;
++ if (high)
++ {
++ if (*p == 0)
++ WRF_wbyte(a_output,0xFF);
++ else
++ c = (char)(n << 4);
++ }
++ else
++ {
++ c |= n;
++ WRF_wbyte(a_output,c);
++ }
++
++ if (*p == 0)
++ break;
++
++ high = !high;
++ p++;
++ }
++ }
++
++static void write_header(WRF_output* a_output)
++ {
++ WRF_wtext(a_output,(const unsigned char*)"\x1\x0\x4\x1",4);
++ }
++
++static void write_name_index(WRF_output* a_output)
++ {
++ /* Write a dummy name of 'x'. */
++ WRF_wtext(a_output,(const unsigned char*)"\x0\x1\x1\x1\x2""x",6);
++ }
++
++static void write_word_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,
++ int a_feature_count,bool a_two_byte_op,int a_op,int a_divisor)
++ {
++ if (a_feature_count > 0)
++ {
++ int i;
++ for (i = 0; i < a_feature_count; i++)
++ {
++ /* Get the value and convert it from unsigned to signed. */
++ short x = a_fapi_font->get_word(a_fapi_font,a_feature_id,i);
++ /* Divide by the divisor to bring it back to font units. */
++ x = (short)(x / a_divisor);
++ write_type2_int(a_output,x);
++ }
++ if (a_two_byte_op)
++ WRF_wbyte(a_output,12);
++ WRF_wbyte(a_output,(unsigned char)a_op);
++ }
++ }
++
++static void write_delta_array_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,
++ bool a_two_byte_op,int a_op,int a_divisor)
++ {
++ int i;
++ /* NOTE that the feature index (a_feature_id) must be preceded by the count index for this to work. */
++ int count = a_fapi_font->get_word(a_fapi_font,a_feature_id - 1,0);
++ if (count > 0)
++ {
++ short prev_value = 0;
++ for (i = 0; i < count; i++)
++ {
++ /* Get the value and convert it from unsigned to signed. */
++ short value = a_fapi_font->get_word(a_fapi_font,a_feature_id,i);
++ /* Divide by the divisor to bring it back to font units. */
++ value = (short)(value / a_divisor);
++ write_type2_int(a_output,value - prev_value);
++ prev_value = value;
++ }
++ if (a_two_byte_op)
++ WRF_wbyte(a_output,12);
++ WRF_wbyte(a_output,(unsigned char)a_op);
++ }
++ }
++
++static void write_float_entry(FAPI_font* a_fapi_font,WRF_output* a_output,int a_feature_id,int a_feature_count,bool a_two_byte_op,int a_op)
++ {
++ if (a_feature_count > 0)
++ {
++ int i;
++ for (i = 0; i < a_feature_count; i++)
++ {
++ double x = a_fapi_font->get_float(a_fapi_font,a_feature_id,i);
++ write_type2_float(a_output,x);
++ }
++ if (a_two_byte_op)
++ WRF_wbyte(a_output,12);
++ WRF_wbyte(a_output,(unsigned char)a_op);
++ }
++ }
++
++static void write_font_dict_index(FAPI_font* a_fapi_font,WRF_output* a_output,
++ unsigned char** a_charset_offset_ptr,
++ unsigned char** a_charstrings_offset_ptr,
++ unsigned char** a_private_dict_length_ptr)
++ {
++ unsigned char* data_start = 0;
++ WRF_wtext(a_output,(const unsigned char *)"\x0\x1\x2\x0\x1\x0\x0",7); /* count = 1, offset size = 2, first offset = 1, last offset = 0 (to be filled in later). */
++ if (a_output->m_pos)
++ data_start = a_output->m_pos;
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FontBBox,4,false,5,1);
++ write_float_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FontMatrix,6,true,7);
++ write_type2_int(a_output,0); /* 0 = Standard Encoding. */
++ WRF_wbyte(a_output,16); /* 16 = opcode for 'encoding'. */
++ *a_charset_offset_ptr = a_output->m_pos;
++ WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx",5); /* placeholder for the offset to the charset, which will be a 5-byte integer. */
++ WRF_wbyte(a_output,15); /* opcode for 'charset' */
++ *a_charstrings_offset_ptr = a_output->m_pos;
++ WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx",5); /* placeholder for the offset to the Charstrings index, which will be a 5-byte integer. */
++ WRF_wbyte(a_output,17); /* opcode for 'Charstrings' */
++ *a_private_dict_length_ptr = a_output->m_pos;
++ WRF_wtext(a_output,(const unsigned char *)"\x1d""xxxx\x1d""yyyy",10); /* placeholder for size and offset of Private dictionary, which will be 5-byte integers. */
++ WRF_wbyte(a_output,18); /* opcode for 'Private' */
++ if (a_output->m_pos)
++ {
++ int last_offset = a_output->m_pos - data_start + 1;
++ data_start[-2] = (unsigned char)(last_offset >> 8);
++ data_start[-1] = (unsigned char)(last_offset & 0xFF);
++ }
++ }
++
++/**
++Write the character set. Return the number of characters.
++For the moment this is always 1. The number cannot be obtained
++via the FAPI interface, and FreeType doesn't need to know anything more
++than the fact that there is at least one character.
++*/
++static int write_charset(WRF_output* a_output,unsigned char* a_charset_offset_ptr)
++ {
++ const int characters = 1;
++ int i = 0;
++
++ /* Write the offset to the start of the charset to the top dictionary. */
++ if (a_output->m_pos)
++ write_4_byte_int(a_charset_offset_ptr + 1,a_output->m_count);
++
++ /*
++ Write the charset. Write one less than the number of characters,
++ because the first one is assumed to be .notdef. For the moment
++ write all the others as .notdef (SID = 0) because we don't actually
++ need the charset at the moment.
++ */
++ WRF_wbyte(a_output,0); /* format = 0 */
++ for (i = 1; i < characters; i++)
++ {
++ WRF_wbyte(a_output,0);
++ WRF_wbyte(a_output,0);
++ }
++
++ return characters;
++ }
++
++/**
++Write a set of empty charstrings. The only reason for the existence of the charstrings index is to tell
++FreeType how many glyphs there are.
++*/
++static void write_charstrings_index(WRF_output* a_output,int a_characters,unsigned char* a_charstrings_offset_ptr)
++ {
++ /* Write the offset to the charstrings index to the top dictionary. */
++ if (a_output->m_pos)
++ write_4_byte_int(a_charstrings_offset_ptr + 1,a_output->m_count);
++
++ /* Write the index. */
++ WRF_wbyte(a_output,(unsigned char)(a_characters >> 8));
++ WRF_wbyte(a_output,(unsigned char)(a_characters & 0xFF));
++ WRF_wbyte(a_output,1); /* offset size = 1. */
++ while (a_characters-- >= 0)
++ WRF_wbyte(a_output,1); /* offset = 1 */
++ }
++
++static void write_gsubrs_index(FAPI_font* a_fapi_font,WRF_output* a_output)
++ {
++ unsigned char* cur_offset = 0;
++ unsigned char* data_start = 0;
++ int i;
++ int count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_GlobalSubrs_count,0);
++
++ WRF_wbyte(a_output,(unsigned char)(count >> 8));
++ WRF_wbyte(a_output,(unsigned char)(count & 0xFF));
++
++ if (count <= 0)
++ return;
++
++ WRF_wbyte(a_output,4); /* offset size = 4 bytes */
++ WRF_wtext(a_output,(const unsigned char *)"\x0\x0\x0\x1",4); /* first offset = 1 */
++
++ if (a_output->m_pos)
++ cur_offset = a_output->m_pos;
++
++ /* Write dummy bytes for the offsets at the end of each data item. */
++ for (i = 0; i < count; i++)
++ WRF_wtext(a_output,(const unsigned char *)"xxxx",4);
++
++ if (a_output->m_pos)
++ data_start = a_output->m_pos;
++
++ for (i = 0; i < count; i++)
++ {
++ long buffer_size = a_output->m_limit - a_output->m_count;
++ long length = a_fapi_font->get_gsubr(a_fapi_font,i,a_output->m_pos,(ushort)buffer_size);
++ if (a_output->m_pos)
++ WRF_wtext(a_output,a_output->m_pos,length);
++ else
++ a_output->m_count += length;
++ if (cur_offset)
++ {
++ long pos = a_output->m_pos - data_start + 1;
++ write_4_byte_int(cur_offset,pos);
++ cur_offset += 4;
++ }
++ }
++ }
++
++static void write_subrs_index(FAPI_font* a_fapi_font,WRF_output* a_output)
++ {
++ unsigned char* cur_offset = 0;
++ unsigned char* data_start = 0;
++ int i;
++ int count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_Subrs_count,0);
++
++ WRF_wbyte(a_output,(unsigned char)(count >> 8));
++ WRF_wbyte(a_output,(unsigned char)(count & 0xFF));
++
++ if (count <= 0)
++ return;
++
++ WRF_wbyte(a_output,4); /* offset size = 4 bytes */
++ WRF_wtext(a_output,(const unsigned char *)"\x0\x0\x0\x1",4); /* first offset = 1 */
++
++ if (a_output->m_pos)
++ cur_offset = a_output->m_pos;
++
++ /* Write dummy bytes for the offsets at the end of each data item. */
++ for (i = 0; i < count; i++)
++ WRF_wtext(a_output,(const unsigned char *)"xxxx",4);
++
++ if (a_output->m_pos)
++ data_start = a_output->m_pos;
++
++ for (i = 0; i < count; i++)
++ {
++ long buffer_size = a_output->m_limit - a_output->m_count;
++ long length = a_fapi_font->get_subr(a_fapi_font,i,a_output->m_pos,(ushort)buffer_size);
++ if (a_output->m_pos)
++ WRF_wtext(a_output,a_output->m_pos,length);
++ else
++ a_output->m_count += length;
++ if (cur_offset)
++ {
++ long pos = a_output->m_pos - data_start + 1;
++ write_4_byte_int(cur_offset,pos);
++ cur_offset += 4;
++ }
++ }
++ }
++
++static void write_private_dict(FAPI_font* a_fapi_font,WRF_output* a_output,unsigned char* a_private_dict_length_ptr)
++ {
++ int count, initial = a_output->m_count;
++ /* Write the offset to the start of the private dictionary to the top dictionary. */
++ unsigned char* start = a_output->m_pos;
++ if (a_output->m_pos)
++ write_4_byte_int(a_private_dict_length_ptr + 6,a_output->m_count);
++
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueFuzz,1,true,11,16);
++
++ write_type2_float(a_output,a_fapi_font->get_long(a_fapi_font,FAPI_FONT_FEATURE_BlueScale,0) / 65536.0);
++ WRF_wbyte(a_output,12);
++ WRF_wbyte(a_output,9);
++
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueShift,1,true,10,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_BlueValues,false,6,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_OtherBlues,false,7,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FamilyBlues,false,8,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_FamilyOtherBlues,false,9,16);
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_ForceBold,1,true,14,1);
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StdHW,1,false,10,16);
++ write_word_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StdVW,1,false,11,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StemSnapH,true,12,16);
++ write_delta_array_entry(a_fapi_font,a_output,FAPI_FONT_FEATURE_StemSnapV,true,13,16);
++
++ /*
++ Write the default width and the nominal width. These values are not available via
++ the FAPI interface so we have to get a pointer to the Type 1 font structure and
++ extract them directly.
++ */
++ {
++ gs_font_type1* t1 = (gs_font_type1*)a_fapi_font->client_font_data;
++ write_type2_float(a_output,fixed2float(t1->data.defaultWidthX));
++ WRF_wbyte(a_output,20);
++ write_type2_float(a_output,fixed2float(t1->data.nominalWidthX));
++ WRF_wbyte(a_output,21);
++ }
++
++ count = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_Subrs_count,0);
++ /* If we have local /Subrs we need to make a new dict ( see calling routine) and
++ * we also need to add an entry to the Provate dict with an offset to the /Subrs
++ * dict. This is complicated by the fact that the offset includes the data for
++ * the offset (its contained in the Private dict) and the size of the data depends
++ * on its value (because of number representation).
++ */
++ if (count) {
++ int n, n1 = a_output->m_count - initial + 2; /* One for the operator, one for the first try at the data representation */
++
++ /* We start by assuming one byte is sufficient for the data (less than 107 bytes)
++ * We run round the loop checking to see if the data is OK to be represented in that many bytes,
++ * if it is we stop, otherwise we add the required amount for the representation, and test again.
++ */
++ do {
++ n = n1;
++ if (n >= -107 && n <= 107)
++ n1 = n;
++ else
++ if (n >= -32768 && n <= 32767) {
++ if (n >= 108 && n <= 1131)
++ n1 = n + 1;
++ else if (n >= -1131 && n <= -108)
++ n1 = n + 1;
++ else
++ n1 = n + 2;
++ } else
++ n1 = n + 3;
++ } while (n1 != n);
++ write_type2_int(a_output, n);
++ WRF_wbyte(a_output,19);
++ }
++
++ /* Write the length in bytes of the private dictionary to the top dictionary. */
++ if (a_output->m_pos)
++ write_4_byte_int(a_private_dict_length_ptr + 1,a_output->m_pos - start);
++ }
++
++/**
++Write a Type 2 font in binary format and return its length in bytes.
++If a_buffer_size is less than the total length, only a_buffer_size bytes are written, but the total
++length is returned correctly.
++*/
++long FF_serialize_type2_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size)
++ {
++ unsigned char* charset_offset_ptr = NULL;
++ unsigned char* charstrings_offset_ptr = NULL;
++ unsigned char* private_dict_length_ptr = NULL;
++ int characters = 0;
++
++ WRF_output output;
++ WRF_init(&output,a_buffer,a_buffer_size);
++
++ write_header(&output);
++ write_name_index(&output);
++ write_font_dict_index(a_fapi_font,&output,&charset_offset_ptr,&charstrings_offset_ptr,&private_dict_length_ptr);
++
++ /* Write an empty string index. */
++ WRF_wtext(&output,(const unsigned char *)"\x0\x0",2);
++
++ write_gsubrs_index(a_fapi_font,&output);
++ characters = write_charset(&output,charset_offset_ptr);
++ write_charstrings_index(&output,characters,charstrings_offset_ptr);
++ write_private_dict(a_fapi_font,&output,private_dict_length_ptr);
++ write_subrs_index(a_fapi_font,&output);
++
++ return output.m_count;
++ }
+diff --git a/psi/write_t2.h b/psi/write_t2.h
+new file mode 100644
+--- /dev/null
++++ b/psi/write_t2.h
+@@ -0,0 +1,28 @@
++/* Copyright (C) 2001-2006 Artifex Software, Inc.
++ All Rights Reserved.
++
++ This software is provided AS-IS with no warranty, either express or
++ implied.
++
++ This software is distributed under license and may not be copied, modified
++ or distributed except as expressly authorized under the terms of that
++ license. Refer to licensing information at http://www.artifex.com/
++ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
++*/
++
++/* $Id$ */
++/*
++Header for functions to serialize a type 2 (CFF) font so that it can
++then be passed to FreeType via the FAPI FreeType bridge.
++Started by Graham Asher, 9th August 2002.
++*/
++
++#ifndef write_t2_INCLUDED
++#define write_t2_INCLUDED
++
++#include "ifapi.h"
++
++long FF_serialize_type2_font(FAPI_font* a_fapi_font,unsigned char* a_buffer,long a_buffer_size);
++
++#endif
+diff --git a/psi/zarith.c b/psi/zarith.c
+--- a/psi/zarith.c
++++ b/psi/zarith.c
+@@ -27,9 +27,9 @@
+ */
+
+ /* Define max and min values for what will fit in value.intval. */
+-#define MIN_INTVAL min_long
+-#define MAX_INTVAL max_long
+-#define MAX_HALF_INTVAL ((1L << (size_of(long) * 4 - 1)) - 1)
++#define MIN_INTVAL 0x80000000
++#define MAX_INTVAL 0x7fffffff
++#define MAX_HALF_INTVAL 0x7fff
+
+ /* <num1> <num2> add <sum> */
+ /* We make this into a separate procedure because */
+@@ -59,7 +59,7 @@ zop_add(register os_ptr op)
+ op[-1].value.realval += (double)op->value.intval;
+ break;
+ case t_integer: {
+- long int2 = op->value.intval;
++ int int2 = op->value.intval;
+
+ if (((op[-1].value.intval += int2) ^ int2) < 0 &&
+ ((op[-1].value.intval - int2) ^ int2) >= 0
+@@ -153,10 +153,10 @@ zmul(i_ctx_t *i_ctx_p)
+ op[-1].value.realval *= (double)op->value.intval;
+ break;
+ case t_integer: {
+- long int1 = op[-1].value.intval;
+- long int2 = op->value.intval;
+- unsigned long abs1 = (unsigned long)(int1 >= 0 ? int1 : -int1);
+- unsigned long abs2 = (unsigned long)(int2 >= 0 ? int2 : -int2);
++ int int1 = op[-1].value.intval;
++ int int2 = op->value.intval;
++ uint abs1 = (uint)(int1 >= 0 ? int1 : -int1);
++ uint abs2 = (uint)(int2 >= 0 ? int2 : -int2);
+ float fprod;
+
+ if ((abs1 > MAX_HALF_INTVAL || abs2 > MAX_HALF_INTVAL) &&
+@@ -207,7 +207,7 @@ zop_sub(register os_ptr op)
+ op[-1].value.realval -= (double)op->value.intval;
+ break;
+ case t_integer: {
+- long int1 = op[-1].value.intval;
++ int int1 = op[-1].value.intval;
+
+ if ((int1 ^ (op[-1].value.intval = int1 - op->value.intval)) < 0 &&
+ (int1 ^ op->value.intval) < 0
+diff --git a/psi/zcolor.c b/psi/zcolor.c
+--- a/psi/zcolor.c
++++ b/psi/zcolor.c
+@@ -49,6 +49,8 @@
+ #include "zcolor.h" /* For the PS_colour_space_t structure */
+ #include "zcie.h" /* For CIE space function declarations */
+ #include "zicc.h" /* For declaration of seticc */
++#include "gscspace.h" /* Needed for checking if current pgs colorspace is CIE */
++#include "iddict.h" /* for idict_put_string */
+
+ /* imported from gsht.c */
+ extern void gx_set_effective_transfer(gs_state *);
+@@ -336,13 +338,26 @@ zsetcolor(i_ctx_t * i_ctx_p)
+ return o_push_estack;
+ }
+
++/* This is used to detect color space changes due
++ to the changing of UseCIEColor during transparency
++ soft mask processing */
++
++static bool name_is_device_color( char *name )
++{
++
++ return( (strcmp(name, "DeviceGray") == 0) ||
++ (strcmp(name, "DeviceRGB") == 0) || (strcmp(name, "DeviceCMYK") == 0));
++
++}
++
++
+ /*
+ * Given two color space arrays, attempts to determine if they are the
+ * same space by comparing their contents recursively. For some spaces,
+ * especially CIE based color spaces, it can significantly improve
+ * performance if the same space is frequently re-used.
+ */
+-static int is_same_colorspace(i_ctx_t * i_ctx_p, ref *space1, ref *space2)
++static int is_same_colorspace(i_ctx_t * i_ctx_p, ref *space1, ref *space2, bool isCIE)
+ {
+ PS_colour_space_t *oldcspace = 0, *newcspace = 0;
+ ref oldspace, *poldspace = &oldspace, newspace, *pnewspace = &newspace;
+@@ -376,6 +391,29 @@ static int is_same_colorspace(i_ctx_t * i_ctx_p, ref *space1, ref *space2)
+ if (!oldcspace->compareproc(i_ctx_p, poldspace, pnewspace))
+ return 0;
+
++ /* See if current space is CIE based (which could happen
++ if UseCIE had been true previously), but UseCIE is false
++ and incoming space is device based. This can occur
++ when we are now processing a soft mask, which should not
++ use the UseCIEColor option.
++
++ Need to detect this case at both transitions
++
++ Device Color UseCIEColor true
++ Soft mask
++ Device color UseCIEColor false
++ Soft mask
++ Device color UseCIEColor true
++ */
++
++ if ( name_is_device_color(newcspace->name) ){
++ if ( gs_color_space_is_CIE(i_ctx_p->pgs->color_space) ){
++ if ( !isCIE ) return 0; /* The color spaces will be different */
++ } else {
++ if ( isCIE ) return 0; /* The color spaces will be different */
++ }
++ }
++
+ /* The current space is OK, if there is no alternate, then that's
+ * good enough.
+ */
+@@ -398,6 +436,8 @@ static int is_same_colorspace(i_ctx_t * i_ctx_p, ref *space1, ref *space2)
+ return 1;
+ }
+
++
++
+ /*
+ * <array> setcolorspace -
+ *
+@@ -412,6 +452,7 @@ zsetcolorspace(i_ctx_t * i_ctx_p)
+ os_ptr op = osp;
+ es_ptr ep = esp;
+ int code, depth;
++ bool is_CIE;
+
+ /* Make sure we have an operand... */
+ check_op(1);
+@@ -424,8 +465,10 @@ zsetcolorspace(i_ctx_t * i_ctx_p)
+ if (code < 0)
+ return code;
+
++ is_CIE = istate->use_cie_color.value.boolval;
++
+ /* See if its the same as the current space */
+- if (is_same_colorspace(i_ctx_p, op, &istate->colorspace.array)) {
++ if (is_same_colorspace(i_ctx_p, op, &istate->colorspace.array, is_CIE)) {
+ PS_colour_space_t *cspace;
+
+ /* Even if its the same space, we still need to set the correct
+@@ -3725,11 +3768,11 @@ static int devicencolorants_cont(i_ctx_t *i_ctx_p)
+ * so that our continuation is ahead of the sub-proc's continuation.
+ */
+ check_estack(1);
++ push(1);
+ /* The push_op_estack macro increments esp before use, so we don't need to */
+ push_op_estack(devicencolorants_cont);
+
+ make_int(pstage, 1);
+- push(1);
+ *op = space[1];
+ code = zsetcolorspace(i_ctx_p);
+ if (code != 0)
+@@ -5169,20 +5212,32 @@ static int validateiccspace(i_ctx_t * i_ctx_p, ref **r)
+ } else {
+ switch (components) {
+ case 1:
+- code = name_enter_string(imemory, "DeviceGray", *r);
++ code = name_enter_string(imemory, "DeviceGray", tempref);
+ break;
+ case 3:
+- code = name_enter_string(imemory, "DeviceRGB", *r);
++ code = name_enter_string(imemory, "DeviceRGB", tempref);
+ break;
+ case 4:
+- code = name_enter_string(imemory, "DeviceCMYK", *r);
++ code = name_enter_string(imemory, "DeviceCMYK", tempref);
+ break;
+ default:
+ return_error(e_rangecheck);
+ }
++ /* In case this space is the /ALternate for a previous ICCBased space
++ * insert the named space into the ICC dictionary. If we simply returned
++ * the named space, as before, then we are replacing the second ICCBased
++ * space in the first ICCBased space with the named space!
++ */
++ code = idict_put_string(&ICCdict, "Alternate", tempref);
++ if (code < 0)
++ return code;
++
++ /* And now revalidate with the newly updated dictionary */
++ return validateiccspace(i_ctx_p, r);
+ }
+ return code;
+ }
++
+ static int iccalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CIESubst)
+ {
+ int components, code = 0;
+@@ -5288,9 +5343,9 @@ static int iccrange(i_ctx_t * i_ctx_p, ref *space, float *ptr)
+ if (code < 0)
+ return code;
+ if (r_has_type(&valref, t_integer))
+- ptr[i * 2] = (float)valref.value.intval;
++ ptr[i] = (float)valref.value.intval;
+ else
+- ptr[i * 2] = (float)valref.value.realval;
++ ptr[i] = (float)valref.value.realval;
+ }
+ } else {
+ for (i=0;i<components;i++) {
+@@ -5606,6 +5661,8 @@ setdevicecolor_cont(i_ctx_t *i_ctx_p)
+ * so that our continuation is ahead of the sub-proc's continuation.
+ */
+ check_estack(1);
++ /* May need to push a /Device... name on the stack so make sure we have space */
++ check_ostack(1);
+ /* The push_op_estack macro increments esp before use, so we don't need to */
+ push_op_estack(setdevicecolor_cont);
+
+diff --git a/psi/zcontrol.c b/psi/zcontrol.c
+--- a/psi/zcontrol.c
++++ b/psi/zcontrol.c
+@@ -362,7 +362,7 @@ for_pos_int_continue(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+ register es_ptr ep = esp;
+- long var = ep[-3].value.intval;
++ int var = ep[-3].value.intval;
+
+ if (var > ep[-1].value.intval) {
+ esp -= 5; /* pop everything */
+@@ -381,7 +381,7 @@ for_neg_int_continue(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+ register es_ptr ep = esp;
+- long var = ep[-3].value.intval;
++ int var = ep[-3].value.intval;
+
+ if (var < ep[-1].value.intval) {
+ esp -= 5; /* pop everything */
+@@ -454,9 +454,9 @@ for_samples_continue(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+ es_ptr ep = esp;
+- long var = ep[-4].value.intval;
++ int var = ep[-4].value.intval;
+ float a = ep[-3].value.realval;
+- long n = ep[-2].value.intval;
++ int n = ep[-2].value.intval;
+ float b = ep[-1].value.realval;
+
+ if (var > n) {
+diff --git a/psi/zdict.c b/psi/zdict.c
+--- a/psi/zdict.c
++++ b/psi/zdict.c
+@@ -30,12 +30,8 @@ zdict(i_ctx_t *i_ctx_p)
+ os_ptr op = osp;
+
+ check_type(*op, t_integer);
+-#if arch_sizeof_int < arch_sizeof_long
+- check_int_leu(*op, max_uint);
+-#else
+ if (op->value.intval < 0)
+ return_error(e_rangecheck);
+-#endif
+ return dict_create((uint) op->value.intval, op);
+ }
+
+@@ -496,12 +492,8 @@ zsetmaxlength(i_ctx_t *i_ctx_p)
+ if (i_ctx_p->in_superexec == 0)
+ check_dict_write(*op1);
+ check_type(*op, t_integer);
+-#if arch_sizeof_int < arch_sizeof_long
+- check_int_leu(*op, max_uint);
+-#else
+ if (op->value.intval < 0)
+ return_error(e_rangecheck);
+-#endif
+ new_size = (uint) op->value.intval;
+ if (dict_length(op - 1) > new_size)
+ return_error(e_dictfull);
+diff --git a/psi/zdps.c b/psi/zdps.c
+--- a/psi/zdps.c
++++ b/psi/zdps.c
+@@ -41,19 +41,18 @@ zsetscreenphase(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+ int code;
+- long x, y;
++ int x, y;
+
+ check_type(op[-2], t_integer);
+ check_type(op[-1], t_integer);
+ check_type(*op, t_integer);
+ x = op[-1].value.intval;
+ y = op->value.intval;
+- if (x != (int)x || y != (int)y ||
+- op[-2].value.intval < -1 ||
++ if (op[-2].value.intval < -1 ||
+ op[-2].value.intval >= gs_color_select_count
+ )
+ return_error(e_rangecheck);
+- code = gs_setscreenphase(igs, (int)x, (int)y,
++ code = gs_setscreenphase(igs, x, y,
+ (gs_color_select_t) op[-2].value.intval);
+ if (code >= 0)
+ pop(3);
+diff --git a/psi/zfapi.c b/psi/zfapi.c
+--- a/psi/zfapi.c
++++ b/psi/zfapi.c
+@@ -15,7 +15,6 @@
+ /* Font API client */
+
+ #include "memory_.h"
+-#include "string_.h"
+ #include "math_.h"
+ #include "ghost.h"
+ #include "gp.h"
+@@ -36,8 +35,6 @@
+ #include "dstack.h"
+ #include "ichar.h"
+ #include "idict.h"
+-#include "iddict.h"
+-#include "idparam.h"
+ #include "iname.h"
+ #include "ifont.h"
+ #include "icid.h"
+@@ -49,9 +46,12 @@
+ #include "gzstate.h"
+ #include "gdevpsf.h"
+ #include "stream.h" /* for files.h */
+-#include "files.h"
+ #include "gscrypt1.h"
+ #include "gxfcid.h"
++#include "gsstype.h"
++#include "gxchar.h" /* for st_gs_show_enum */
++#include "ipacked.h" /* for packed_next */
++#include "iddict.h"
+
+ /* -------------------------------------------------------- */
+
+@@ -419,21 +419,121 @@ static ushort FAPI_FF_get_word(FAPI_font *ff, fapi_font_feature var_id, int inde
+ case FAPI_FONT_FEATURE_ForceBold: return pfont->data.ForceBold;
+ case FAPI_FONT_FEATURE_LanguageGroup: return pfont->data.LanguageGroup;
+ case FAPI_FONT_FEATURE_lenIV: return (ff->need_decrypt ? 0 : pfont->data.lenIV);
++ case FAPI_FONT_FEATURE_GlobalSubrs_count:
++ { ref *Private, *GlobalSubrs;
++ if (dict_find_string(pdr, "Private", &Private) <= 0)
++ return 0;
++ if (dict_find_string(Private, "GlobalSubrs", &GlobalSubrs) <= 0)
++ return 0;;
++ return r_size(GlobalSubrs);
++ }
+ case FAPI_FONT_FEATURE_Subrs_count:
+- { ref *Private, *Subrs, *GlobalSubrs;
+- int n1, n2;
++ { ref *Private, *Subrs;
+ if (dict_find_string(pdr, "Private", &Private) <= 0)
+ return 0;
+ if (dict_find_string(Private, "Subrs", &Subrs) <= 0)
+- Subrs = NULL;
+- if (dict_find_string(Private, "GlobalSubrs", &GlobalSubrs) <= 0)
+- GlobalSubrs = NULL;
+- n1 = (Subrs != NULL ? r_size(Subrs) : 0);
+- n2 = (GlobalSubrs != NULL ? r_size(GlobalSubrs) : 0);
+- /* trick : we return twice maximum of n1, n2 to pass both Subrs and GlobalSubrs in same array.
+- */
+- return (n1 < n2 ? n2 : n1) * 2;
++ return 0;
++ return r_size(Subrs);
+ }
++ /* Multiple Master specific */
++ case FAPI_FONT_FEATURE_DollarBlend:
++ { ref *DBlend;
++ if (dict_find_string(pdr, "$Blend", &DBlend) <= 0)
++ return 0;
++ return 1;
++ }
++ case FAPI_FONT_FEATURE_BlendAxisTypes_count:
++ { ref *Info, *Axes;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendAxisTypes", &Axes) <= 0)
++ return 0;
++ return r_size(Axes);
++ }
++ case FAPI_FONT_FEATURE_BlendFontInfo_count:
++ { ref *Info, *FontInfo;
++ if (dict_find_string(pdr, "Blend", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "FontInfo", &FontInfo) <= 0)
++ return 0;
++ return dict_length(FontInfo);
++ }
++ case FAPI_FONT_FEATURE_BlendPrivate_count:
++ { ref *Info, *Private;
++ if (dict_find_string(pdr, "Blend", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "Private", &Private) <= 0)
++ return 0;
++ return dict_length(Private);
++ }
++ case FAPI_FONT_FEATURE_WeightVector_count:
++ { ref *Array;
++ if (dict_find_string(pdr, "WeightVector", &Array) <= 0)
++ return 0;
++ return r_size(Array);
++ }
++ case FAPI_FONT_FEATURE_BlendDesignPositionsArrays_count:
++ { ref *Info, *Array;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendDesignPositions", &Array) <= 0)
++ return 0;
++ return r_size(Array);
++ }
++ case FAPI_FONT_FEATURE_BlendDesignMapArrays_count:
++ { ref *Info, *Array;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendDesignMap", &Array) <= 0)
++ return 0;
++ return r_size(Array);
++ }
++ case FAPI_FONT_FEATURE_BlendDesignMapSubArrays_count:
++ { ref *Info, *Array, SubArray;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendDesignMap", &Array) <= 0)
++ return 0;
++ if (array_get(ff->memory, Array, index, &SubArray) < 0)
++ return 0;
++ return r_size(&SubArray);
++ }
++ case FAPI_FONT_FEATURE_DollarBlend_length:
++ { ref *DBlend, Element, name, string;
++ int i, length = 0;
++ char Buffer[32];
++ if (dict_find_string(pdr, "$Blend", &DBlend) <= 0)
++ return 0;
++ for (i = 0;i < r_size(DBlend);i++) {
++ if (array_get(ff->memory, DBlend, i, &Element) < 0)
++ return 0;
++ switch (r_btype(&Element)) {
++ case t_name:
++ name_string_ref(ff->memory, &name, &string);
++ length += r_size(&string) + 1;
++ break;
++ case t_real:
++ sprintf(Buffer, "%f", Element.value.realval);
++ length += strlen(Buffer) + 1;
++ break;
++ case t_integer:
++ sprintf(Buffer, "%d", Element.value.intval);
++ length += strlen(Buffer) + 1;
++ break;
++ case t_operator:
++ { op_def const *op;
++
++ op = op_index_def(r_size(&Element));
++ length += strlen(op->oname + 1) + 1;
++ }
++ break;
++ default:
++ break;
++ }
++ }
++ return length;
++ }
++ /* End MM specifics */
+ }
+ return 0;
+ }
+@@ -470,6 +570,7 @@ static ulong FAPI_FF_get_long(FAPI_font *ff, fapi_font_feature var_id, int index
+
+ static float FAPI_FF_get_float(FAPI_font *ff, fapi_font_feature var_id, int index)
+ { gs_font_base *pbfont = (gs_font_base *)ff->client_font_data;
++ ref *pdr = (ref *)ff->client_font_data2;
+
+ switch((int)var_id) {
+ case FAPI_FONT_FEATURE_FontMatrix:
+@@ -483,10 +584,141 @@ static float FAPI_FF_get_float(FAPI_font *ff, fapi_font_feature var_id, int inde
+ case 5 : return pbfont->base->FontMatrix.ty / FontMatrix_div;
+ }
+ }
++ case FAPI_FONT_FEATURE_WeightVector:
++ { ref *Array, value;
++
++ if (dict_find_string(pdr, "WeightVector", &Array) <= 0)
++ return 0;
++ if (array_get(ff->memory, Array, index, &value) < 0)
++ return 0;
++ if (!r_has_type(&value, t_integer)) {
++ if (r_has_type(&value, t_real)) {
++ return value.value.realval;
++ } else
++ return 0;
++ }
++ else
++ return (float)value.value.intval;
++ }
++ case FAPI_FONT_FEATURE_BlendDesignPositionsArrayValue:
++ { ref *Info, *Array, SubArray, value;
++ int array_index = index / 8;
++ index %= 8;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendDesignPositions", &Array) <= 0)
++ return 0;
++ if (array_get(ff->memory, Array, array_index, &SubArray) < 0)
++ return 0;
++ if (array_get(ff->memory, &SubArray, index, &value) < 0)
++ return 0;
++ if (!r_has_type(&value, t_integer)) {
++ if (r_has_type(&value, t_real)) {
++ return value.value.realval;
++ } else
++ return 0;
++ }
++ else
++ return (float)value.value.intval;
++ }
++ case FAPI_FONT_FEATURE_BlendDesignMapArrayValue:
++ { ref *Info, *Array, SubArray, SubSubArray, value;
++ int array_index = index / 64, subarray_index = (index %64) / 8;
++ index %= 8;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendDesignMap", &Array) <= 0)
++ return 0;
++ if (array_get(ff->memory, Array, array_index, &SubArray) < 0)
++ return 0;
++ if (array_get(ff->memory, &SubArray, index, &SubSubArray) < 0)
++ return 0;
++ if (array_get(ff->memory, &SubSubArray, index, &value) < 0)
++ return 0;
++ if (!r_has_type(&value, t_integer)) {
++ if (r_has_type(&value, t_real)) {
++ return value.value.realval;
++ } else
++ return 0;
++ }
++ else
++ return (float)value.value.intval;
++ }
+ }
+ return 0;
+ }
+
++static int FAPI_FF_get_name(FAPI_font *ff, fapi_font_feature var_id, int index, char *Buffer, int len)
++{
++ ref name, string, *pdr = (ref *)ff->client_font_data2;
++
++ switch((int)var_id) {
++ case FAPI_FONT_FEATURE_BlendAxisTypes:
++ { ref *Info, *Axes;
++ if (dict_find_string(pdr, "FontInfo", &Info) <= 0)
++ return 0;
++ if (dict_find_string(Info, "BlendAxisTypes", &Axes) <= 0)
++ return 0;
++ if(!r_has_type(Axes, t_array))
++ return 0;
++ if (array_get(ff->memory, Axes, index, &name) < 0)
++ return 0;
++ }
++ }
++ name_string_ref(ff->memory, &name, &string);
++ if(r_size(&string) >= len)
++ return 0;
++ memcpy(Buffer, string.value.const_bytes, r_size(&string));
++ Buffer[r_size(&string)] = 0x00;
++ return 1;
++}
++
++static int FAPI_FF_get_proc(FAPI_font *ff, fapi_font_feature var_id, int index, char *Buffer)
++{
++ ref *pdr = (ref *)ff->client_font_data2;
++ char *ptr = Buffer;
++
++ if (!Buffer)
++ return 0;
++
++ switch((int)var_id) {
++ case FAPI_FONT_FEATURE_DollarBlend:
++ { ref *DBlend, Element;
++ int i;
++ char Buf[32];
++ if (dict_find_string(pdr, "$Blend", &DBlend) <= 0)
++ return 0;
++ for (i = 0;i < r_size(DBlend);i++) {
++ *ptr++ = 0x20;
++ if (array_get(ff->memory, DBlend, i, &Element) < 0)
++ return 0;
++ switch (r_btype(&Element)) {
++ case t_real:
++ sprintf(Buf, "%f", Element.value.realval);
++ strcpy(ptr, Buf);
++ ptr += strlen(Buf);
++ break;
++ case t_integer:
++ sprintf(Buf, "%d", Element.value.intval);
++ strcpy(ptr, Buf);
++ ptr += strlen(Buf);
++ break;
++ case t_operator:
++ { op_def const *op;
++
++ op = op_index_def(r_size(&Element));
++ strcpy(ptr, op->oname + 1);
++ ptr += strlen(op->oname + 1);
++ }
++ break;
++ default:
++ break;
++ }
++ }
++ }
++ }
++ return ptr - Buffer;
++}
+ static inline void decode_bytes(byte *p, const byte *s, int l, int lenIV)
+ { ushort state = 4330;
+
+@@ -518,30 +750,29 @@ static ushort get_type1_data(FAPI_font *ff, const ref *type1string,
+ return length;
+ }
+
++static ushort FAPI_FF_get_gsubr(FAPI_font *ff, int index, byte *buf, ushort buf_length)
++{ ref *pdr = (ref *)ff->client_font_data2;
++ ref *Private, *GlobalSubrs, subr;
++
++ if (dict_find_string(pdr, "Private", &Private) <= 0)
++ return 0;
++ if (dict_find_string(Private, "GlobalSubrs", &GlobalSubrs) <= 0)
++ return 0;
++ if (array_get(ff->memory,
++ GlobalSubrs, index, &subr) < 0 || r_type(&subr) != t_string)
++ return 0;
++ return get_type1_data(ff, &subr, buf, buf_length);
++}
++
+ static ushort FAPI_FF_get_subr(FAPI_font *ff, int index, byte *buf, ushort buf_length)
+ { ref *pdr = (ref *)ff->client_font_data2;
+- ref *Private, *Subrs, *GlobalSubrs, subr;
+- int n1, n2, n;
++ ref *Private, *Subrs, subr;
+
+ if (dict_find_string(pdr, "Private", &Private) <= 0)
+ return 0;
+ if (dict_find_string(Private, "Subrs", &Subrs) <= 0)
+- Subrs = NULL;
+- if (dict_find_string(Private, "GlobalSubrs", &GlobalSubrs) <= 0)
+- GlobalSubrs = NULL;
+- n1 = (Subrs != NULL ? r_size(Subrs) : 0);
+- n2 = (GlobalSubrs != NULL ? r_size(GlobalSubrs) : 0);
+- /* trick : we use the maximum of n1, n2 to pass both Subrs and GlobalSubrs in same array.
+- */
+- n = (n1 < n2 ? n2 : n1);
+- if (index < n && Subrs != NULL) {
+- if (array_get(ff->memory, Subrs, index, &subr) < 0 || r_type(&subr) != t_string)
+- return 0;
+- } else if (index >= n && GlobalSubrs != NULL) {
+- if (array_get(ff->memory,
+- GlobalSubrs, index - n, &subr) < 0 || r_type(&subr) != t_string)
+- return 0;
+- } else
++ return 0;
++ if (array_get(ff->memory, Subrs, index, &subr) < 0 || r_type(&subr) != t_string)
+ return 0;
+ return get_type1_data(ff, &subr, buf, buf_length);
+ }
+@@ -572,7 +803,12 @@ static int get_GlyphDirectory_data_ptr(const gs_memory_t *mem,
+ && r_type(glyph) == t_string) {
+ *ptr = glyph->value.const_bytes;
+ return r_size(glyph);
+- }
++ } else
++ /* We have a GlyphDirectory, but couldn't find the glyph. If we
++ * return -1 then we will attempt to use glyf and loca which
++ * will fail. Instead return 0, so we execute an 'empty' glyph.
++ */
++ return 0;
+ }
+ return -1;
+ }
+@@ -590,20 +826,19 @@ static bool get_MetricsCount(FAPI_font *ff)
+
+ static ushort FAPI_FF_get_glyph(FAPI_font *ff, int char_code, byte *buf, ushort buf_length)
+ { /*
+- * We assume that renderer requests glyph data with multiple consequtive
+- * calls to this function.
++ * We assume that renderer requests glyph data with multiple
++ * consecutive calls to this function.
+ *
+- * For a simple glyph it calls this
+- * function exactly twice : first with buf == NULL for requesting
+- * the necessary buffer length, and second with
+- * buf != NULL for requesting the data (the second call may be skept
+- * if the renderer discontinues the rendering on an exception).
++ * For a simple glyph it calls this function exactly twice: first
++ * with buf == NULL for requesting the necessary buffer length, and
++ * second with buf != NULL for requesting the data (the second call
++ * may be skipped if the renderer discontinues the rendering).
+ *
+ * For a composite glyph it calls this function 2 * (N + 1)
+- * times : 2 calls for the main glyph (same as above) followed with
+- * 2 * N calls for subglyphs, where N is less or equal to the number of
+- * subglyphs ( N may be less if the renderer caches glyph data,
+- * or discontinues the rendering on an exception).
++ * times: 2 calls for the main glyph (same as above) followed with
++ * 2 * N calls for subglyphs, where N is less or equal to the number
++ * of subglyphs (N may be less if the renderer caches glyph data,
++ * or discontinues rendering on an exception).
+ */
+ ref *pdr = (ref *)ff->client_font_data2;
+ ushort glyph_length;
+@@ -660,7 +895,7 @@ static ushort FAPI_FF_get_glyph(FAPI_font *ff, int char_code, byte *buf, ushort
+ } else {
+ gs_font_type42 *pfont42 = (gs_font_type42 *)ff->client_font_data;
+ ulong offset0, offset1;
+- bool error = sfnt_get_glyph_offset(pdr, pfont42, char_code, &offset0, &offset1);
++ bool error = sfnt_get_glyph_offset(pdr, pfont42, char_code, &offset0, &offset1);
+
+ glyph_length = (error ? -1 : offset1 - offset0);
+ if (buf != 0 && !error) {
+@@ -696,6 +931,9 @@ static const FAPI_font ff_stub = {
+ FAPI_FF_get_word,
+ FAPI_FF_get_long,
+ FAPI_FF_get_float,
++ FAPI_FF_get_name,
++ FAPI_FF_get_proc,
++ FAPI_FF_get_gsubr,
+ FAPI_FF_get_subr,
+ FAPI_FF_get_glyph,
+ FAPI_FF_serialize_tt_font
+@@ -936,24 +1174,37 @@ static int FAPI_refine_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font_base *pbfont, c
+
+ if (code > 0) {
+ /* Refine FontBBox : */
+- ref *v, x0, y0, x1, y1;
++ ref *v, mat[4], arr;
+
+ pbfont->FontBBox.p.x = (double)BBox[0] * size1 / size;
+ pbfont->FontBBox.p.y = (double)BBox[1] * size1 / size;
+ pbfont->FontBBox.q.x = (double)BBox[2] * size1 / size;
+ pbfont->FontBBox.q.y = (double)BBox[3] * size1 / size;
+- if (dict_find_string(op, "FontBBox", &v) <= 0 || !r_has_type(v, t_array))
+- return_error(e_invalidfont);
+- if (r_size(v) < 4)
+- return_error(e_invalidfont);
+- make_real(&x0, pbfont->FontBBox.p.x);
+- make_real(&y0, pbfont->FontBBox.p.y);
+- make_real(&x1, pbfont->FontBBox.q.x);
+- make_real(&y1, pbfont->FontBBox.q.y);
+- ref_assign_old(v, v->value.refs + 0, &x0, "FAPI_refine_font_BBox");
+- ref_assign_old(v, v->value.refs + 1, &y0, "FAPI_refine_font_BBox");
+- ref_assign_old(v, v->value.refs + 2, &x1, "FAPI_refine_font_BBox");
+- ref_assign_old(v, v->value.refs + 3, &y1, "FAPI_refine_font_BBox");
++ if (dict_find_string(op, "FontBBox", &v) > 0) {
++ if(!r_has_type(v, t_array) && !r_has_type(v, t_shortarray))
++ return_error(e_invalidfont);
++ if (r_size(v) < 4)
++ return_error(e_invalidfont);
++
++ make_real(&mat[0], pbfont->FontBBox.p.x);
++ make_real(&mat[1], pbfont->FontBBox.p.y);
++ make_real(&mat[2], pbfont->FontBBox.q.x);
++ make_real(&mat[3], pbfont->FontBBox.q.y);
++ if(r_has_type(v, t_shortarray)) {
++ /* Create a new full blown array in case the values are reals */
++ code = ialloc_ref_array(&arr, a_all, 4, "array");
++ if (code < 0)
++ return code;
++ v = &arr;
++ code = idict_put_string(op, "FontBBox", &arr);
++ if (code < 0)
++ return code;
++ }
++ ref_assign_old(v, v->value.refs + 0, &mat[0], "FAPI_refine_font_BBox");
++ ref_assign_old(v, v->value.refs + 1, &mat[1], "FAPI_refine_font_BBox");
++ ref_assign_old(v, v->value.refs + 2, &mat[2], "FAPI_refine_font_BBox");
++ ref_assign_old(v, v->value.refs + 3, &mat[3], "FAPI_refine_font_BBox");
++ }
+ }
+
+ /* Assign a Decoding : */
+@@ -1051,10 +1302,13 @@ static int zFAPIrebuildfont(i_ctx_t *i_ctx_p)
+ if (pfont->FontType == ft_CID_encrypted && v == NULL) {
+ if ((code = build_proc_name_refs(imemory, &build, ".FAPIBuildGlyph9", ".FAPIBuildGlyph9")) < 0)
+ return code;
++ pop(1);
++ return 0;
+ } else
+ if ((code = build_proc_name_refs(imemory, &build, ".FAPIBuildChar", ".FAPIBuildGlyph")) < 0)
+ return code;
+- if (name_index(imemory, &pdata->BuildChar) == name_index(imemory, &build.BuildChar)) {
++ if (pdata->BuildChar.value.pname && build.BuildChar.value.pname &&
++ name_index(imemory, &pdata->BuildChar) == name_index(imemory, &build.BuildChar)) {
+ /* Already rebuilt - maybe a substituted font. */
+ } else {
+ ref_assign_new(&pdata->BuildChar, &build.BuildChar);
+@@ -1141,12 +1395,34 @@ static const int frac_pixel_shift = 4;
+ static int fapi_finish_render_aux(i_ctx_t *i_ctx_p, gs_font_base *pbfont, FAPI_server *I)
+ { gs_text_enum_t *penum = op_show_find(i_ctx_p);
+ gs_show_enum *penum_s = (gs_show_enum *)penum;
+- gs_state *pgs = penum_s->pgs;
+- gx_device *dev1 = gs_currentdevice_inline(pgs); /* Possibly changed by zchar_set_cache. */
+- gx_device *dev = penum_s->dev;
++ gs_state *pgs;
++ gx_device *dev1;
++ gx_device *dev;
+ const int import_shift_v = _fixed_shift - I->frac_shift;
+ FAPI_raster rast;
+ int code;
++ extern_st(st_gs_show_enum);
++ extern_st(st_gs_state);
++
++ if(penum == NULL) {
++ return_error(e_undefined);
++ }
++ dev = penum_s->dev;
++
++ /* Ensure that pis points to a st_gs_gstate (graphics state) structure */
++ if (gs_object_type(penum->memory, penum->pis) != &st_gs_state) {
++ /* If pis is not a graphics state, see if the text enumerator is a
++ * show enumerator, in which case we have a pointer to the graphics state there
++ */
++ if (gs_object_type(penum->memory, penum) == &st_gs_show_enum) {
++ pgs = penum_s->pgs;
++ } else
++ /* No graphics state, give up... */
++ return_error(e_undefined);
++ } else
++ pgs = (gs_state *)penum->pis;
++
++ dev1 = gs_currentdevice_inline(pgs); /* Possibly changed by zchar_set_cache. */
+
+ if (SHOW_IS(penum, TEXT_DO_NONE)) {
+ /* do nothing */
+@@ -1155,7 +1431,7 @@ static int fapi_finish_render_aux(i_ctx_t *i_ctx_p, gs_font_base *pbfont, FAPI_s
+ return code;
+ } else {
+ int code = I->get_char_raster(I, &rast);
+- if (code == e_limitcheck) {
++ if (code == e_limitcheck || pbfont->PaintType) {
+ /* The server provides an outline instead the raster. */
+ gs_imager_state *pis = (gs_imager_state *)pgs->show_gstate;
+ gs_point pt;
+@@ -1204,19 +1480,31 @@ static int fapi_finish_render_aux(i_ctx_t *i_ctx_p, gs_font_base *pbfont, FAPI_s
+ dy + rast.top_indent, dy + rast.top_indent + rast.black_height - dev1->height);
+ if ((code = fapi_copy_mono(dev1, &rast, dx, dy)) < 0)
+ return code;
+- penum_s->cc->offset.x += float2fixed(penum_s->fapi_glyph_shift.x);
+- penum_s->cc->offset.y += float2fixed(penum_s->fapi_glyph_shift.y);
++
++ if (gs_object_type(penum->memory, penum) == &st_gs_show_enum) {
++ penum_s->cc->offset.x += float2fixed(penum_s->fapi_glyph_shift.x);
++ penum_s->cc->offset.y += float2fixed(penum_s->fapi_glyph_shift.y);
++ }
+ }
+ } else { /* Not using GS cache */
+ const gx_clip_path * pcpath = i_ctx_p->pgs->clip_path;
+ const gx_drawing_color * pdcolor = penum->pdcolor;
+
+- if ((code = gx_image_fill_masked(dev, rast.p, 0, rast.line_step, 0,
+- (int)(penum_s->pgs->ctm.tx + (double)rast_orig_x / (1 << frac_pixel_shift) + penum_s->fapi_glyph_shift.x + 0.5),
+- (int)(penum_s->pgs->ctm.ty + (double)rast_orig_y / (1 << frac_pixel_shift) + penum_s->fapi_glyph_shift.y + 0.5),
++ if (gs_object_type(penum->memory, penum) == &st_gs_show_enum) {
++ if ((code = gx_image_fill_masked(dev, rast.p, 0, rast.line_step, 0,
++ (int)(pgs->ctm.tx + (double)rast_orig_x / (1 << frac_pixel_shift) + penum_s->fapi_glyph_shift.x + 0.5),
++ (int)(pgs->ctm.ty + (double)rast_orig_y / (1 << frac_pixel_shift) + penum_s->fapi_glyph_shift.y + 0.5),
+ rast.width, rast.height,
+ pdcolor, 1, rop3_default, pcpath)) < 0)
+ return code;
++ } else {
++ if ((code = gx_image_fill_masked(dev, rast.p, 0, rast.line_step, 0,
++ (int)(pgs->ctm.tx + (double)rast_orig_x / (1 << frac_pixel_shift) + 0.5),
++ (int)(pgs->ctm.ty + (double)rast_orig_y / (1 << frac_pixel_shift) + 0.5),
++ rast.width, rast.height,
++ pdcolor, 1, rop3_default, pcpath)) < 0)
++ return code;
++ }
+ }
+ }
+ }
+@@ -1300,15 +1588,15 @@ static int FAPI_do_char(i_ctx_t *i_ctx_p, gs_font_base *pbfont, gx_device *dev,
+ } else
+ check_type(*op, t_integer);
+
+- /* Compute the sacle : */
++ if (penum == 0)
++ return_error(e_undefined);
++ /* Compute the scale : */
+ if (!SHOW_IS(penum, TEXT_DO_NONE) && !igs->in_charpath) {
+ gs_currentcharmatrix(igs, NULL, 1); /* make char_tm valid */
+ penum_s->fapi_log2_scale.x = -1;
+ gx_compute_text_oversampling(penum_s, (gs_font *)pbfont, alpha_bits, &log2_scale);
+ penum_s->fapi_log2_scale = log2_scale;
+ }
+- if (penum == 0)
+- return_error(e_undefined);
+ scale = 1 << I->frac_shift;
+ retry_oversampling:
+ if (I->face.font_id != pbfont->id ||
+@@ -1392,7 +1680,8 @@ retry_oversampling:
+ ref *Encoding;
+ int_param(op, 0xFF, &client_char_code);
+ if (dict_find_string(pdr, "Encoding", &Encoding) > 0 &&
+- (r_has_type(Encoding, t_array) || r_has_type(Encoding, t_shortarray))) {
++ (r_has_type(Encoding, t_array) ||
++ r_has_type(Encoding, t_shortarray) || r_has_type(Encoding, t_mixedarray))) {
+ if (array_get(imemory, Encoding, client_char_code, &char_name) < 0)
+ if ((code = name_ref(imemory, (const byte *)".notdef", 7, &char_name, -1)) < 0)
+ return code;
+@@ -1405,20 +1694,61 @@ retry_oversampling:
+ cr.char_codes_count = 1;
+ if (bCID) {
+ if (font_file_path != NULL) {
+- ref *Decoding, *SubstNWP, src_type, dst_type;
++ ref *Decoding, *TT_cmap, *SubstNWP;
++ ref src_type, dst_type;
++ bool is_glyph_index = true;
+ uint c;
+
+ if (dict_find_string(pdr, "Decoding", &Decoding) <= 0 || !r_has_type(Decoding, t_dictionary))
+ return_error(e_invalidfont);
+ if (dict_find_string(pdr, "SubstNWP", &SubstNWP) <= 0 || !r_has_type(SubstNWP, t_array))
+ return_error(e_invalidfont);
++ if (dict_find_string(pdr, "TT_cmap", &TT_cmap) <= 0 || !r_has_type(TT_cmap, t_dictionary)) {
++ ref *DecodingArray, char_code, char_code1, ih;
++ int i = client_char_code % 256, n;
+
+- code = cid_to_TT_charcode(imemory, Decoding, NULL, SubstNWP,
++ make_int(&ih, client_char_code / 256);
++ /* Check the Decoding array for this block of CIDs */
++ if (dict_find(Decoding, &ih, &DecodingArray) <= 0 ||
++ !r_has_type(DecodingArray, t_array) ||
++ array_get(imemory, DecodingArray, i, &char_code) < 0)
++ return_error(e_invalidfont);
++
++ /* Check the Decoding entry */
++ if (r_has_type(&char_code, t_integer))
++ n = 1;
++ else if (r_has_type(&char_code, t_array)) {
++ DecodingArray = &char_code;
++ i = 0;
++ n = r_size(DecodingArray);
++ } else
++ return_error(e_invalidfont);
++
++ for (;n--; i++) {
++ if (array_get(imemory, DecodingArray, i, &char_code1) < 0 ||
++ !r_has_type(&char_code1, t_integer))
++ return_error(e_invalidfont);
++
++ c = char_code1.value.intval;
++ I->check_cmap_for_GID(I, &c);
++ if (c != 0)
++ break;
++ }
++ } else {
++ code = cid_to_TT_charcode(imemory, Decoding, TT_cmap, SubstNWP,
+ client_char_code, &c, &src_type, &dst_type);
+- if (code < 0)
+- return code;
++ if (code < 0)
++ return code;
++
++ /* cid_to_TT_charcode() returns 1 if it found a
++ * matching character code. Otherwise it returns
++ * zero after setting c to zero (.notdef glyph id)
++ * or a negative value on error. */
++ if (code > 0)
++ is_glyph_index = false;
++ }
+ cr.char_codes[0] = c;
+- cr.is_glyph_index = (code == 0);
++ cr.is_glyph_index = is_glyph_index;
+ /* fixme : process the narrow/wide/proportional mapping type,
+ using src_type, dst_type. Should adjust the 'matrix' above.
+ Call get_font_proportional_feature for proper choice.
+@@ -1835,6 +2165,7 @@ static int do_FAPIpassfont(i_ctx_t *i_ctx_p, char *font_file_path, bool *success
+ FAPI_font_scale font_scale = {{1, 0, 0, 1, 0, 0}, {0, 0}, {1, 1}, true};
+ const char *decodingID = NULL;
+
++
+ if (code < 0)
+ return code;
+ code = FAPI_get_xlatmap(i_ctx_p, &xlatmap); /* Useful for emulated fonts hooked with FAPI. */
+diff --git a/psi/zfcid0.c b/psi/zfcid0.c
+--- a/psi/zfcid0.c
++++ b/psi/zfcid0.c
+@@ -542,7 +542,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p)
+ if (code < 0) { /* failed to load glyph data, put CID 0 */
+ int default_fallback_CID = 0 ;
+
+- if_debug2('J', "[J]ztype9cidmap() use CID %d instead of glyph-missing CID %ld\n", default_fallback_CID, op->value.intval);
++ if_debug2('J', "[J]ztype9cidmap() use CID %d instead of glyph-missing CID %d\n", default_fallback_CID, op->value.intval);
+
+ op->value.intval = default_fallback_CID;
+
+@@ -553,7 +553,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p)
+ &gdata, &fidx);
+
+ if (code < 0) {
+- if_debug1('J', "[J]ztype9cidmap() could not load default glyph (CID %ld)\n", op->value.intval);
++ if_debug1('J', "[J]ztype9cidmap() could not load default glyph (CID %d)\n", op->value.intval);
+ return_error(e_invalidfont);
+ }
+
+diff --git a/psi/zfile.c b/psi/zfile.c
+--- a/psi/zfile.c
++++ b/psi/zfile.c
+@@ -381,7 +381,7 @@ file_continue(i_ctx_t *i_ctx_p)
+ os_ptr op = osp;
+ es_ptr pscratch = esp - 2;
+ file_enum *pfen = r_ptr(esp - 1, file_enum);
+- long devlen = esp[-3].value.intval;
++ int devlen = esp[-3].value.intval;
+ gx_io_device *iodev = r_ptr(esp - 4, gx_io_device);
+ uint len = r_size(pscratch);
+ uint code;
+@@ -679,7 +679,7 @@ ztempfile(i_ctx_t *i_ctx_p)
+ uint fnlen;
+ FILE *sfile;
+ stream *s;
+- byte *buf;
++ byte *buf, *sbody;
+
+ if (code < 0)
+ return code;
+@@ -720,15 +720,21 @@ ztempfile(i_ctx_t *i_ctx_p)
+ return_error(e_invalidfileaccess);
+ }
+ fnlen = strlen(fname);
++ sbody = ialloc_string(fnlen, ".tempfile(fname)");
++ if (sbody == 0) {
++ gs_free_object(imemory, buf, "ztempfile(buffer)");
++ return_error(e_VMerror);
++ }
++ memcpy(sbody, fname, fnlen);
+ file_init_stream(s, sfile, fmode, buf, file_default_buffer_size);
+ code = ssetfilename(s, (const unsigned char*) fname, fnlen);
+ if (code < 0) {
+ sclose(s);
+ iodev_default->procs.delete_file(iodev_default, fname);
++ ifree_string(sbody, fnlen, ".tempfile(fname)");
+ return_error(e_VMerror);
+ }
+- make_const_string(op - 1, a_readonly | icurrent_space, fnlen,
+- s->file_name.data);
++ make_string(op - 1, a_readonly | icurrent_space, fnlen, sbody);
+ make_stream_file(op, s, fmode);
+ return code;
+ }
+diff --git a/psi/zfjbig2.c b/psi/zfjbig2.c
+--- a/psi/zfjbig2.c
++++ b/psi/zfjbig2.c
+@@ -77,11 +77,8 @@ z_jbig2decode(i_ctx_t * i_ctx_p)
+ }
+
+ /* we pass npop=0, since we've no arguments left to consume */
+- /* we pass 0 instead of the usual rspace(sop) which will allocate storage
+- for filter state from the same memory pool as the stream it's coding.
+- this causes no trouble because we maintain no pointers */
+ return filter_read(i_ctx_p, 0, &s_jbig2decode_template,
+- (stream_state *) & state, 0);
++ (stream_state *) & state, (sop ? r_space(sop) : 0));
+ }
+
+
+diff --git a/psi/zfunc4.c b/psi/zfunc4.c
+--- a/psi/zfunc4.c
++++ b/psi/zfunc4.c
+@@ -172,10 +172,6 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
+ case t_integer: {
+ int i = elt.value.intval;
+
+-#if ARCH_SIZEOF_INT < ARCH_SIZEOF_LONG
+- if (i != elt.value.intval) /* check for truncation */
+- return_error(e_rangecheck);
+-#endif
+ if (i == (byte)i) {
+ *p = PtCr_byte;
+ p[1] = (byte)i;
+diff --git a/psi/zgeneric.c b/psi/zgeneric.c
+--- a/psi/zgeneric.c
++++ b/psi/zgeneric.c
+@@ -71,7 +71,7 @@ zcopy_integer(i_ctx_t *i_ctx_p)
+ int count, i;
+ int code;
+
+- if ((ulong) op->value.intval > (ulong)(op - osbot)) {
++ if ((uint) op->value.intval > (uint)(op - osbot)) {
+ /* There might be enough elements in other blocks. */
+ check_type(*op, t_integer);
+ if (op->value.intval >= (int)ref_stack_count(&o_stack))
+@@ -478,7 +478,7 @@ dict_continue(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+ es_ptr obj = esp - 2;
+- int index = (int)esp->value.intval;
++ int index = esp->value.intval;
+
+ push(2); /* make room for key and value */
+ if ((index = dict_next(obj, index, op - 1)) >= 0) { /* continue */
+diff --git a/psi/zimage.c b/psi/zimage.c
+--- a/psi/zimage.c
++++ b/psi/zimage.c
+@@ -455,7 +455,7 @@ image_file_continue(i_ctx_t *i_ctx_p)
+ int code;
+ int px;
+ const ref *pp;
+- bool at_eof = false;
++ int at_eof_count = 0;
+
+ /*
+ * Do a first pass through the files to ensure that at least
+@@ -481,7 +481,7 @@ image_file_continue(i_ctx_t *i_ctx_p)
+ s_process_read_buf(s);
+ continue;
+ case EOFC:
+- at_eof = true;
++ at_eof_count++;
+ break; /* with no data available */
+ case INTC:
+ case CALLC:
+@@ -526,7 +526,7 @@ image_file_continue(i_ctx_t *i_ctx_p)
+ if (code == e_RemapColor)
+ return code;
+ }
+- if (at_eof)
++ if (at_eof_count >= num_sources)
+ code = 1;
+ if (code) {
+ int code1;
+diff --git a/psi/ziodev.c b/psi/ziodev.c
+--- a/psi/ziodev.c
++++ b/psi/ziodev.c
+@@ -74,8 +74,6 @@ zgetiodevice(i_ctx_t *i_ctx_p)
+ const byte *dname;
+
+ check_type(*op, t_integer);
+- if (op->value.intval != (int)op->value.intval)
+- return_error(e_rangecheck);
+ iodev = gs_getiodevice((int)(op->value.intval));
+ if (iodev == 0) /* index out of range */
+ return_error(e_rangecheck);
+diff --git a/psi/zmath.c b/psi/zmath.c
+--- a/psi/zmath.c
++++ b/psi/zmath.c
+@@ -225,14 +225,10 @@ static int
+ zsrand(i_ctx_t *i_ctx_p)
+ {
+ os_ptr op = osp;
+- long state;
++ int state;
+
+ check_type(*op, t_integer);
+ state = op->value.intval;
+-#if arch_sizeof_long > 4
+- /* Trim the state back to 32 bits. */
+- state = (int)state;
+-#endif
+ /*
+ * The following somewhat bizarre adjustments are according to
+ * public information from Adobe describing their implementation.
+diff --git a/psi/zpcolor.c b/psi/zpcolor.c
+--- a/psi/zpcolor.c
++++ b/psi/zpcolor.c
+@@ -110,6 +110,10 @@ zbuildpattern1(i_ctx_t *i_ctx_p)
+ if (code < 0)
+ return code;
+
++ code = dict_bool_param(op1, ".pattern_uses_transparency", 0, &template.uses_transparency);
++ if (code < 0)
++ return code;
++
+ code = dict_floats_param(imemory, op1, "BBox", 4, BBox, NULL);
+ if (code < 0)
+ return code;
+@@ -231,9 +235,14 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p)
+ return code;
+ }
+ /* gx_set_device_only(pgs, (gx_device *) pdev); */
+- if (internal_accum)
++ if (internal_accum) {
+ gs_setdevice_no_init(pgs, (gx_device *)pdev);
+- else {
++ if (pinst->template.uses_transparency) {
++ if_debug0('v', " pushing the pdf14 compositor device into this graphics state\n");
++ if ((code = gs_push_pdf14trans_device(pgs)) < 0)
++ return code;
++ }
++ } else {
+ gs_matrix m;
+ gs_rect bbox;
+ gs_fixed_rect clip_box;
+@@ -279,11 +288,22 @@ pattern_paint_finish(i_ctx_t *i_ctx_p)
+ {
+ int o_stack_adjust = ref_stack_count(&o_stack) - esp->value.intval;
+ gx_device_forward *pdev = r_ptr(esp - 1, gx_device_forward);
++ gs_pattern1_instance_t *pinst =
++ (gs_pattern1_instance_t *)gs_currentcolor(igs->saved)->pattern;
+
+ if (pdev != NULL) {
+ gx_color_tile *ctile;
+- int code = gx_pattern_cache_add_entry((gs_imager_state *)igs,
+- pdev, &ctile);
++ int code;
++
++ if (pinst->template.uses_transparency) {
++ gs_state *pgs = igs;
++ int code;
++
++ if_debug0('v', " popping the pdf14 compositor device into this graphics state\n");
++ if ((code = gs_pop_pdf14trans_device(pgs)) < 0)
++ return code;
++ }
++ code = gx_pattern_cache_add_entry((gs_imager_state *)igs, pdev, &ctile);
+ if (code < 0)
+ return code;
+ }
+diff --git a/psi/zstack.c b/psi/zstack.c
+--- a/psi/zstack.c
++++ b/psi/zstack.c
+@@ -112,7 +112,7 @@ zroll(i_ctx_t *i_ctx_p)
+
+ check_type(*op1, t_integer);
+ check_type(*op, t_integer);
+- if ((ulong) op1->value.intval > (ulong)(op1 - osbot)) {
++ if ((uint) op1->value.intval > (uint)(op1 - osbot)) {
+ /*
+ * The data might span multiple stack blocks.
+ * There are efficient ways to handle this situation,
+diff --git a/psi/ztrans.c b/psi/ztrans.c
+--- a/psi/ztrans.c
++++ b/psi/ztrans.c
+@@ -207,6 +207,7 @@ zbegintransparencygroup(i_ctx_t *i_ctx_p)
+ os_ptr dop = op - 4;
+ gs_transparency_group_params_t params;
+ gs_rect bbox;
++ ref *dummy;
+ int code;
+
+ check_type(*dop, t_dictionary);
+@@ -220,7 +221,14 @@ zbegintransparencygroup(i_ctx_t *i_ctx_p)
+ code = rect_param(&bbox, op);
+ if (code < 0)
+ return code;
+- params.ColorSpace = gs_currentcolorspace(igs);
++ /* If the CS is not given in the transparency group dict, set to NULL */
++ /* so that the transparency code knows to inherit from the parent layer */
++ if (dict_find_string(dop, "CS", &dummy) <= 0) {
++ params.ColorSpace = NULL;
++ } else {
++ /* the PDF interpreter set the colorspace, so use it */
++ params.ColorSpace = gs_currentcolorspace(igs);
++ }
+ code = gs_begin_transparency_group(igs, &params, &bbox);
+ if (code < 0)
+ return code;
+@@ -244,7 +252,8 @@ zendtransparencygroup(i_ctx_t *i_ctx_p)
+ return gs_end_transparency_group(igs);
+ }
+
+-/* <paramdict> <llx> <lly> <urx> <ury> .begintransparencymaskgroup - */
++/* <cs_set?> <paramdict> <llx> <lly> <urx> <ury> .begintransparencymaskgroup - */
++/* cs_set == false if we are inheriting the colorspace */
+ static int tf_using_function(floatp, float *, void *);
+ static int
+ zbegintransparencymaskgroup(i_ctx_t *i_ctx_p)
+@@ -269,16 +278,14 @@ zbegintransparencymaskgroup(i_ctx_t *i_ctx_p)
+ params.replacing = true;
+ if ((code = dict_floats_param(imemory, dop, "Background",
+ cs_num_components(gs_currentcolorspace(i_ctx_p->pgs)),
+- params.Background, NULL)) < 0
+- )
++ params.Background, NULL)) < 0)
+ return code;
+ else if (code > 0)
+ params.Background_components = code;
+ if ((code = dict_floats_param(imemory, dop, "GrayBackground",
+- 1, &params.GrayBackground, NULL)) < 0
+- )
++ 1, &params.GrayBackground, NULL)) < 0)
+ return code;
+- if (dict_find_string(dop, "TransferFunction", &pparam) >0) {
++ if (dict_find_string(dop, "TransferFunction", &pparam) > 0) {
+ gs_function_t *pfn = ref_function(pparam);
+
+ if (pfn == 0 || pfn->params.m != 1 || pfn->params.n != 1)
+@@ -289,10 +296,16 @@ zbegintransparencymaskgroup(i_ctx_t *i_ctx_p)
+ code = rect_param(&bbox, op);
+ if (code < 0)
+ return code;
++ /* Is the colorspace set for this mask ? */
++ if (op[-5].value.boolval) {
++ params.ColorSpace = gs_currentcolorspace(igs);
++ } else {
++ params.ColorSpace = NULL;
++ }
+ code = gs_begin_transparency_mask(igs, &params, &bbox, false);
+ if (code < 0)
+ return code;
+- pop(5);
++ pop(6);
+ return code;
+ }
+
+@@ -303,11 +316,16 @@ zbegintransparencymaskimage(i_ctx_t *i_ctx_p)
+ gs_transparency_mask_params_t params;
+ gs_rect bbox = { { 0, 0} , { 1, 1} };
+ int code;
++ gs_color_space *gray_cs = gs_cspace_new_DeviceGray(imemory);
+
++ if (!gray_cs)
++ return_error(e_VMerror);
++ params.ColorSpace = gray_cs; /* per PDF spec, Image SMask is alway DeviceGray */
+ gs_trans_mask_params_init(&params, TRANSPARENCY_MASK_Luminosity);
+ code = gs_begin_transparency_mask(igs, &params, &bbox, true);
+ if (code < 0)
+ return code;
++ rc_decrement(gray_cs, "zbegintransparencymaskimage");
+ return code;
+ }
+
+diff --git a/psi/ztype.c b/psi/ztype.c
+--- a/psi/ztype.c
++++ b/psi/ztype.c
+@@ -48,10 +48,10 @@ static int convert_to_string(const gs_memory_t *mem, os_ptr, os_ptr);
+ * constant expressions, so we can't use min_long and max_long.
+ * What a nuisance!
+ */
+-#define ALT_MIN_LONG (-1L << (arch_sizeof_long * 8 - 1))
+-#define ALT_MAX_LONG (~(ALT_MIN_LONG))
+-static const double min_int_real = (ALT_MIN_LONG * 1.0 - 1);
+-static const double max_int_real = (ALT_MAX_LONG * 1.0 + 1);
++#define ALT_MIN_INT (-1 << 31)
++#define ALT_MAX_INT (~(ALT_MIN_INT))
++static const double min_int_real = (ALT_MIN_INT * 1.0 - 1);
++static const double max_int_real = (ALT_MAX_INT * 1.0 + 1);
+
+ #define REAL_CAN_BE_INT(v)\
+ ((v) > min_int_real && (v) < max_int_real)
+@@ -357,14 +357,14 @@ zcvrs(i_ctx_t *i_ctx_p)
+ return_error(e_rangecheck); /* CET 24-05 wants rangecheck */
+ }
+ } else {
+- ulong ival;
++ uint ival;
+ byte digits[sizeof(ulong) * 8];
+ byte *endp = &digits[countof(digits)];
+ byte *dp = endp;
+
+ switch (r_type(op - 2)) {
+ case t_integer:
+- ival = (ulong) op[-2].value.intval;
++ ival = (uint) op[-2].value.intval;
+ break;
+ case t_real:
+ {
+diff --git a/psi/zupath.c b/psi/zupath.c
+--- a/psi/zupath.c
++++ b/psi/zupath.c
+@@ -652,15 +652,14 @@ zgetpath(i_ctx_t *i_ctx_p)
+ k = 0;
+ ref_assign(&leaf_ref[j], operators[pe]);
+ pe = gs_path_enum_next(&penum, pts);
+- if (pe == 0)
+- goto out;
++ if (pe <= 0)
++ return pe;
+ if (pe >= 5)
+ return_error(e_unregistered);
+ }
+ }
+ }
+ }
+- out:
+ return 0;
+ }
+
+diff --git a/toolbin/pdf_info.ps b/toolbin/pdf_info.ps
+--- a/toolbin/pdf_info.ps
++++ b/toolbin/pdf_info.ps
+@@ -83,10 +83,11 @@ systemdict /DumpMediaSizes known
+ /Resources pget {
+ /Font knownoget {
+ { exch pop oforce
+- dup
+- /FontDescriptor knownoget
+- {
+- dup /FontFile known 1 index /FontFile2 known or exch /FontFile3 known or
++ dup /DescendantFonts knownoget {
++ exch pop 0 get oforce
++ } if
++ dup /FontDescriptor knownoget {
++ dup /FontFile known 1 index /FontFile2 known or exch /FontFile3 known or
+ /ShowEmbeddedFonts where { pop pop false} if {
+ pop % skip embedded fonts
+ } {
+@@ -107,7 +108,7 @@ systemdict /DumpMediaSizes known
+
+ systemdict /DumpFontsUsed known
+ {
+- (\nFonts Used:) =
++ (\nFont or CIDFont resources used:) =
+ getPDFfonts { = } forall
+ } if
+
diff --git a/recipes/gs/gs/0002_svn_snapshot_jbig2dec.patch b/recipes/gs/gs/0002_svn_snapshot_jbig2dec.patch
new file mode 100644
index 0000000000..8858856fd6
--- /dev/null
+++ b/recipes/gs/gs/0002_svn_snapshot_jbig2dec.patch
@@ -0,0 +1,17181 @@
+Description: /jbig2dec changes r9437 → r9781 (release 8.64 → 2009-06-08)
+Author: Jonas Smedegaard <dr@jones.dk>
+diff --git a/jbig2dec/Makefile.am b/jbig2dec/Makefile.am
+--- a/jbig2dec/Makefile.am
++++ b/jbig2dec/Makefile.am
+@@ -1,4 +1,3 @@
+-# $Id: Makefile.am 6300 2005-12-28 19:56:24Z giles $
+ ## process this file with automake to generate Makefile.in
+
+ # require automake 1.7
+@@ -12,12 +11,13 @@ libjbig2dec_a_SOURCES = jbig2.c \
+ jbig2_segment.c jbig2_page.c \
+ jbig2_symbol_dict.c jbig2_text.c \
+ jbig2_generic.c jbig2_refinement.c jbig2_mmr.c \
++ jbig2_halftone.c \
+ jbig2_image.c jbig2_image_pbm.c \
+ os_types.h config_types.h config_win32.h \
+ jbig2.h jbig2_priv.h jbig2_image.h \
+ jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \
+ jbig2_huffman.h jbig2_hufftab.h jbig2_mmr.h \
+- jbig2_generic.h jbig2_symbol_dict.h \
++ jbig2_generic.h jbig2_symbol_dict.h jbig2_text.h \
+ jbig2_metadata.c jbig2_metadata.h
+
+ bin_PROGRAMS = jbig2dec
+diff --git a/jbig2dec/Makefile.in b/jbig2dec/Makefile.in
+--- a/jbig2dec/Makefile.in
++++ b/jbig2dec/Makefile.in
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.9.5 from Makefile.am.
++# Makefile.in generated by automake 1.10.2 from Makefile.am.
+ # @configure_input@
+
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005 Free Software Foundation, Inc.
++# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -14,21 +14,13 @@
+
+ @SET_MAKE@
+
+-# $Id: Makefile.in 6300 2005-12-28 19:56:24Z giles $
+
+
+-
+-SOURCES = $(libjbig2dec_a_SOURCES) $(jbig2dec_SOURCES) $(test_sha1_SOURCES)
+-
+-srcdir = @srcdir@
+-top_srcdir = @top_srcdir@
+ VPATH = @srcdir@
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
+ pkgincludedir = $(includedir)/@PACKAGE@
+-top_builddir = .
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+-INSTALL = @INSTALL@
+ install_sh_DATA = $(install_sh) -c -m 644
+ install_sh_PROGRAM = $(install_sh) -c
+ install_sh_SCRIPT = $(install_sh) -c
+@@ -41,7 +33,10 @@ NORMAL_UNINSTALL = :
+ PRE_UNINSTALL = :
+ POST_UNINSTALL = :
+ bin_PROGRAMS = jbig2dec$(EXEEXT)
+-noinst_PROGRAMS = test_sha1$(EXEEXT)
++noinst_PROGRAMS = test_sha1$(EXEEXT) test_huffman$(EXEEXT) \
++ test_arith$(EXEEXT)
++TESTS = test_sha1$(EXEEXT) test_jbig2dec.py test_huffman$(EXEEXT) \
++ test_arith$(EXEEXT)
+ subdir = .
+ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+@@ -54,7 +49,7 @@ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+- configure.lineno configure.status.lineno
++ configure.lineno config.status.lineno
+ mkinstalldirs = $(install_sh) -d
+ CONFIG_HEADER = config.h
+ CONFIG_CLEAN_FILES = config_types.h
+@@ -78,18 +73,30 @@ am_libjbig2dec_a_OBJECTS = jbig2.$(OBJEXT) jbig2_arith.$(OBJEXT) \
+ jbig2_page.$(OBJEXT) jbig2_symbol_dict.$(OBJEXT) \
+ jbig2_text.$(OBJEXT) jbig2_generic.$(OBJEXT) \
+ jbig2_refinement.$(OBJEXT) jbig2_mmr.$(OBJEXT) \
+- jbig2_image.$(OBJEXT) jbig2_image_pbm.$(OBJEXT) \
+- jbig2_metadata.$(OBJEXT)
++ jbig2_halftone.$(OBJEXT) jbig2_image.$(OBJEXT) \
++ jbig2_image_pbm.$(OBJEXT) jbig2_metadata.$(OBJEXT)
+ libjbig2dec_a_OBJECTS = $(am_libjbig2dec_a_OBJECTS)
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+ am_jbig2dec_OBJECTS = jbig2dec.$(OBJEXT) sha1.$(OBJEXT)
+ jbig2dec_OBJECTS = $(am_jbig2dec_OBJECTS)
+ jbig2dec_DEPENDENCIES = libjbig2dec.a @LIBOBJS@
++am_test_arith_OBJECTS = test_arith-jbig2_arith.$(OBJEXT)
++test_arith_OBJECTS = $(am_test_arith_OBJECTS)
++test_arith_DEPENDENCIES = libjbig2dec.a
++test_arith_LINK = $(CCLD) $(test_arith_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
++ $(LDFLAGS) -o $@
++am_test_huffman_OBJECTS = test_huffman-jbig2_huffman.$(OBJEXT)
++test_huffman_OBJECTS = $(am_test_huffman_OBJECTS)
++test_huffman_DEPENDENCIES = libjbig2dec.a
++test_huffman_LINK = $(CCLD) $(test_huffman_CFLAGS) $(CFLAGS) \
++ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ am_test_sha1_OBJECTS = test_sha1-sha1.$(OBJEXT)
+ test_sha1_OBJECTS = $(am_test_sha1_OBJECTS)
+ test_sha1_LDADD = $(LDADD)
+-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
++test_sha1_LINK = $(CCLD) $(test_sha1_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
++ $(LDFLAGS) -o $@
++DEFAULT_INCLUDES = -I.@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+@@ -97,8 +104,10 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ CCLD = $(CC)
+ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ SOURCES = $(libjbig2dec_a_SOURCES) $(jbig2dec_SOURCES) \
++ $(test_arith_SOURCES) $(test_huffman_SOURCES) \
+ $(test_sha1_SOURCES)
+ DIST_SOURCES = $(libjbig2dec_a_SOURCES) $(jbig2dec_SOURCES) \
++ $(test_arith_SOURCES) $(test_huffman_SOURCES) \
+ $(test_sha1_SOURCES)
+ includeHEADERS_INSTALL = $(INSTALL_HEADER)
+ HEADERS = $(include_HEADERS)
+@@ -116,8 +125,6 @@ GZIP_ENV = --best
+ distuninstallcheck_listfiles = find . -type f -print
+ distcleancheck_listfiles = find . -type f -print
+ ACLOCAL = @ACLOCAL@
+-AMDEP_FALSE = @AMDEP_FALSE@
+-AMDEP_TRUE = @AMDEP_TRUE@
+ AMTAR = @AMTAR@
+ AUTOCONF = @AUTOCONF@
+ AUTOHEADER = @AUTOHEADER@
+@@ -136,6 +143,8 @@ ECHO_N = @ECHO_N@
+ ECHO_T = @ECHO_T@
+ EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++GREP = @GREP@
++INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+@@ -149,6 +158,7 @@ LIBOBJS = @LIBOBJS@
+ LIBS = @LIBS@
+ LTLIBOBJS = @LTLIBOBJS@
+ MAKEINFO = @MAKEINFO@
++MKDIR_P = @MKDIR_P@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+@@ -162,11 +172,11 @@ SET_MAKE = @SET_MAKE@
+ SHELL = @SHELL@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
++abs_builddir = @abs_builddir@
++abs_srcdir = @abs_srcdir@
++abs_top_builddir = @abs_top_builddir@
++abs_top_srcdir = @abs_top_srcdir@
+ ac_ct_CC = @ac_ct_CC@
+-ac_ct_RANLIB = @ac_ct_RANLIB@
+-ac_ct_STRIP = @ac_ct_STRIP@
+-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+ am__include = @am__include@
+ am__leading_dot = @am__leading_dot@
+ am__quote = @am__quote@
+@@ -174,24 +184,36 @@ am__tar = @am__tar@
+ am__untar = @am__untar@
+ bindir = @bindir@
+ build_alias = @build_alias@
++builddir = @builddir@
+ datadir = @datadir@
++datarootdir = @datarootdir@
++docdir = @docdir@
++dvidir = @dvidir@
+ exec_prefix = @exec_prefix@
+ host_alias = @host_alias@
++htmldir = @htmldir@
+ includedir = @includedir@
+ infodir = @infodir@
+ install_sh = @install_sh@
+ libdir = @libdir@
+ libexecdir = @libexecdir@
++localedir = @localedir@
+ localstatedir = @localstatedir@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
++pdfdir = @pdfdir@
+ prefix = @prefix@
+ program_transform_name = @program_transform_name@
++psdir = @psdir@
+ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
++srcdir = @srcdir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
++top_build_prefix = @top_build_prefix@
++top_builddir = @top_builddir@
++top_srcdir = @top_srcdir@
+
+ # require automake 1.7
+ AUTOMAKE_OPTIONS = foreign 1.7 dist-bzip2 dist-zip -Wall
+@@ -202,12 +224,13 @@ libjbig2dec_a_SOURCES = jbig2.c \
+ jbig2_segment.c jbig2_page.c \
+ jbig2_symbol_dict.c jbig2_text.c \
+ jbig2_generic.c jbig2_refinement.c jbig2_mmr.c \
++ jbig2_halftone.c \
+ jbig2_image.c jbig2_image_pbm.c \
+ os_types.h config_types.h config_win32.h \
+ jbig2.h jbig2_priv.h jbig2_image.h \
+ jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \
+ jbig2_huffman.h jbig2_hufftab.h jbig2_mmr.h \
+- jbig2_generic.h jbig2_symbol_dict.h \
++ jbig2_generic.h jbig2_symbol_dict.h jbig2_text.h \
+ jbig2_metadata.c jbig2_metadata.h
+
+ jbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \
+@@ -215,11 +238,16 @@ jbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \
+ os_types.h config_types.h config_win32.h
+
+ jbig2dec_LDADD = libjbig2dec.a @LIBOBJS@
++EXTRA_DIST = test_jbig2dec.py msvc.mak LICENSE CHANGES
++MAINTAINERCLEANFILES = config_types.h.in
+ test_sha1_SOURCES = sha1.c sha1.h
+ test_sha1_CFLAGS = -DTEST
+-TESTS = test_sha1 test_jbig2dec.py
+-EXTRA_DIST = test_jbig2dec.py msvc.mak LICENSE
+-MAINTAINERCLEANFILES = config_types.h.in
++test_arith_SOURCES = jbig2_arith.c
++test_arith_CFLAGS = -DTEST
++test_arith_LDADD = libjbig2dec.a
++test_huffman_SOURCES = jbig2_huffman.c
++test_huffman_CFLAGS = -DTEST
++test_huffman_LDADD = libjbig2dec.a
+ all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+@@ -262,7 +290,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+- $(MAKE) stamp-h1; \
++ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+@@ -279,7 +307,7 @@ config_types.h: $(top_builddir)/config.status $(srcdir)/config_types.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+ install-libLIBRARIES: $(lib_LIBRARIES)
+ @$(NORMAL_INSTALL)
+- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
++ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+@@ -312,7 +340,7 @@ libjbig2dec.a: $(libjbig2dec_a_OBJECTS) $(libjbig2dec_a_DEPENDENCIES)
+ $(RANLIB) libjbig2dec.a
+ install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
++ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+@@ -338,10 +366,16 @@ clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+ jbig2dec$(EXEEXT): $(jbig2dec_OBJECTS) $(jbig2dec_DEPENDENCIES)
+ @rm -f jbig2dec$(EXEEXT)
+- $(LINK) $(jbig2dec_LDFLAGS) $(jbig2dec_OBJECTS) $(jbig2dec_LDADD) $(LIBS)
++ $(LINK) $(jbig2dec_OBJECTS) $(jbig2dec_LDADD) $(LIBS)
++test_arith$(EXEEXT): $(test_arith_OBJECTS) $(test_arith_DEPENDENCIES)
++ @rm -f test_arith$(EXEEXT)
++ $(test_arith_LINK) $(test_arith_OBJECTS) $(test_arith_LDADD) $(LIBS)
++test_huffman$(EXEEXT): $(test_huffman_OBJECTS) $(test_huffman_DEPENDENCIES)
++ @rm -f test_huffman$(EXEEXT)
++ $(test_huffman_LINK) $(test_huffman_OBJECTS) $(test_huffman_LDADD) $(LIBS)
+ test_sha1$(EXEEXT): $(test_sha1_OBJECTS) $(test_sha1_DEPENDENCIES)
+ @rm -f test_sha1$(EXEEXT)
+- $(LINK) $(test_sha1_LDFLAGS) $(test_sha1_OBJECTS) $(test_sha1_LDADD) $(LIBS)
++ $(test_sha1_LINK) $(test_sha1_OBJECTS) $(test_sha1_LDADD) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+@@ -359,6 +393,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_arith_iaid.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_arith_int.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_generic.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_halftone.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_huffman.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_image.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_image_pbm.Po@am__quote@
+@@ -371,39 +406,68 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2_text.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jbig2dec.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arith-jbig2_arith.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_huffman-jbig2_huffman.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sha1-sha1.Po@am__quote@
+
+ .c.o:
+-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
++@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+ .c.obj:
+-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
++@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
++test_arith-jbig2_arith.o: jbig2_arith.c
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_arith_CFLAGS) $(CFLAGS) -MT test_arith-jbig2_arith.o -MD -MP -MF $(DEPDIR)/test_arith-jbig2_arith.Tpo -c -o test_arith-jbig2_arith.o `test -f 'jbig2_arith.c' || echo '$(srcdir)/'`jbig2_arith.c
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_arith-jbig2_arith.Tpo $(DEPDIR)/test_arith-jbig2_arith.Po
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jbig2_arith.c' object='test_arith-jbig2_arith.o' libtool=no @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_arith_CFLAGS) $(CFLAGS) -c -o test_arith-jbig2_arith.o `test -f 'jbig2_arith.c' || echo '$(srcdir)/'`jbig2_arith.c
++
++test_arith-jbig2_arith.obj: jbig2_arith.c
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_arith_CFLAGS) $(CFLAGS) -MT test_arith-jbig2_arith.obj -MD -MP -MF $(DEPDIR)/test_arith-jbig2_arith.Tpo -c -o test_arith-jbig2_arith.obj `if test -f 'jbig2_arith.c'; then $(CYGPATH_W) 'jbig2_arith.c'; else $(CYGPATH_W) '$(srcdir)/jbig2_arith.c'; fi`
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_arith-jbig2_arith.Tpo $(DEPDIR)/test_arith-jbig2_arith.Po
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jbig2_arith.c' object='test_arith-jbig2_arith.obj' libtool=no @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_arith_CFLAGS) $(CFLAGS) -c -o test_arith-jbig2_arith.obj `if test -f 'jbig2_arith.c'; then $(CYGPATH_W) 'jbig2_arith.c'; else $(CYGPATH_W) '$(srcdir)/jbig2_arith.c'; fi`
++
++test_huffman-jbig2_huffman.o: jbig2_huffman.c
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_huffman_CFLAGS) $(CFLAGS) -MT test_huffman-jbig2_huffman.o -MD -MP -MF $(DEPDIR)/test_huffman-jbig2_huffman.Tpo -c -o test_huffman-jbig2_huffman.o `test -f 'jbig2_huffman.c' || echo '$(srcdir)/'`jbig2_huffman.c
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_huffman-jbig2_huffman.Tpo $(DEPDIR)/test_huffman-jbig2_huffman.Po
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jbig2_huffman.c' object='test_huffman-jbig2_huffman.o' libtool=no @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_huffman_CFLAGS) $(CFLAGS) -c -o test_huffman-jbig2_huffman.o `test -f 'jbig2_huffman.c' || echo '$(srcdir)/'`jbig2_huffman.c
++
++test_huffman-jbig2_huffman.obj: jbig2_huffman.c
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_huffman_CFLAGS) $(CFLAGS) -MT test_huffman-jbig2_huffman.obj -MD -MP -MF $(DEPDIR)/test_huffman-jbig2_huffman.Tpo -c -o test_huffman-jbig2_huffman.obj `if test -f 'jbig2_huffman.c'; then $(CYGPATH_W) 'jbig2_huffman.c'; else $(CYGPATH_W) '$(srcdir)/jbig2_huffman.c'; fi`
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_huffman-jbig2_huffman.Tpo $(DEPDIR)/test_huffman-jbig2_huffman.Po
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jbig2_huffman.c' object='test_huffman-jbig2_huffman.obj' libtool=no @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_huffman_CFLAGS) $(CFLAGS) -c -o test_huffman-jbig2_huffman.obj `if test -f 'jbig2_huffman.c'; then $(CYGPATH_W) 'jbig2_huffman.c'; else $(CYGPATH_W) '$(srcdir)/jbig2_huffman.c'; fi`
++
+ test_sha1-sha1.o: sha1.c
+-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -MT test_sha1-sha1.o -MD -MP -MF "$(DEPDIR)/test_sha1-sha1.Tpo" -c -o test_sha1-sha1.o `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c; \
+-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_sha1-sha1.Tpo" "$(DEPDIR)/test_sha1-sha1.Po"; else rm -f "$(DEPDIR)/test_sha1-sha1.Tpo"; exit 1; fi
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -MT test_sha1-sha1.o -MD -MP -MF $(DEPDIR)/test_sha1-sha1.Tpo -c -o test_sha1-sha1.o `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_sha1-sha1.Tpo $(DEPDIR)/test_sha1-sha1.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sha1.c' object='test_sha1-sha1.o' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -c -o test_sha1-sha1.o `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c
+
+ test_sha1-sha1.obj: sha1.c
+-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -MT test_sha1-sha1.obj -MD -MP -MF "$(DEPDIR)/test_sha1-sha1.Tpo" -c -o test_sha1-sha1.obj `if test -f 'sha1.c'; then $(CYGPATH_W) 'sha1.c'; else $(CYGPATH_W) '$(srcdir)/sha1.c'; fi`; \
+-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_sha1-sha1.Tpo" "$(DEPDIR)/test_sha1-sha1.Po"; else rm -f "$(DEPDIR)/test_sha1-sha1.Tpo"; exit 1; fi
++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -MT test_sha1-sha1.obj -MD -MP -MF $(DEPDIR)/test_sha1-sha1.Tpo -c -o test_sha1-sha1.obj `if test -f 'sha1.c'; then $(CYGPATH_W) 'sha1.c'; else $(CYGPATH_W) '$(srcdir)/sha1.c'; fi`
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test_sha1-sha1.Tpo $(DEPDIR)/test_sha1-sha1.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sha1.c' object='test_sha1-sha1.obj' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sha1_CFLAGS) $(CFLAGS) -c -o test_sha1-sha1.obj `if test -f 'sha1.c'; then $(CYGPATH_W) 'sha1.c'; else $(CYGPATH_W) '$(srcdir)/sha1.c'; fi`
+-uninstall-info-am:
+ install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+- test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
++ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+@@ -424,8 +488,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) ' { files[$$0] = 1; } \
+- END { for (i in files) print i; }'`; \
++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
++ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+ tags: TAGS
+
+@@ -437,8 +501,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) ' { files[$$0] = 1; } \
+- END { for (i in files) print i; }'`; \
++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
++ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+@@ -448,13 +512,12 @@ ctags: CTAGS
+ CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+- here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) ' { files[$$0] = 1; } \
+- END { for (i in files) print i; }'`; \
++ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
++ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+@@ -470,7 +533,7 @@ distclean-tags:
+ check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+- list='$(TESTS)'; \
++ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+@@ -479,7 +542,7 @@ check-TESTS: $(TESTS)
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+- *" $$tst "*) \
++ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+@@ -491,7 +554,7 @@ check-TESTS: $(TESTS)
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+- *" $$tst "*) \
++ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+@@ -505,23 +568,36 @@ check-TESTS: $(TESTS)
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
++ if test "$$all" -eq 1; then \
++ tests="test"; \
++ All=""; \
++ else \
++ tests="tests"; \
++ All="All "; \
++ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+- banner="All $$all tests passed"; \
++ banner="$$All$$all $$tests passed"; \
+ else \
+- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
++ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
++ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+- banner="$$failed of $$all tests failed"; \
++ banner="$$failed of $$all $$tests failed"; \
+ else \
+- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
++ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
++ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+- skipped="($$skip tests were not run)"; \
++ if test "$$skip" -eq 1; then \
++ skipped="($$skip test was not run)"; \
++ else \
++ skipped="($$skip tests were not run)"; \
++ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+@@ -542,24 +618,22 @@ check-TESTS: $(TESTS)
+
+ distdir: $(DISTFILES)
+ $(am__remove_distdir)
+- mkdir $(distdir)
+- $(mkdir_p) $(distdir)/.
+- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+- list='$(DISTFILES)'; for file in $$list; do \
+- case $$file in \
+- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+- esac; \
++ test -d $(distdir) || mkdir $(distdir)
++ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++ list='$(DISTFILES)'; \
++ dist_files=`for file in $$list; do echo $$file; done | \
++ sed -e "s|^$$srcdirstrip/||;t" \
++ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
++ case $$dist_files in \
++ */*) $(MKDIR_P) `echo "$$dist_files" | \
++ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
++ sort -u` ;; \
++ esac; \
++ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+- dir="/$$dir"; \
+- $(mkdir_p) "$(distdir)$$dir"; \
+- else \
+- dir=''; \
+- fi; \
+ if test -d $$d/$$file; then \
++ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+@@ -573,7 +647,7 @@ distdir: $(DISTFILES)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
++ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+@@ -582,6 +656,10 @@ dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
++dist-lzma: distdir
++ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
++ $(am__remove_distdir)
++
+ dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+@@ -610,6 +688,8 @@ distcheck: dist
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
++ *.tar.lzma*) \
++ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+@@ -649,7 +729,7 @@ distcheck: dist
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
++ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+ distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+@@ -674,7 +754,7 @@ check: check-am
+ all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) config.h
+ installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
+- test -z "$$dir" || $(mkdir_p) "$$dir"; \
++ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+ install: install-am
+ install-exec: install-exec-am
+@@ -725,12 +805,20 @@ info-am:
+
+ install-data-am: install-includeHEADERS
+
++install-dvi: install-dvi-am
++
+ install-exec-am: install-binPROGRAMS install-libLIBRARIES
+
++install-html: install-html-am
++
+ install-info: install-info-am
+
+ install-man:
+
++install-pdf: install-pdf-am
++
++install-ps: install-ps-am
++
+ installcheck-am:
+
+ maintainer-clean: maintainer-clean-am
+@@ -753,23 +841,27 @@ ps: ps-am
+ ps-am:
+
+ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
+- uninstall-info-am uninstall-libLIBRARIES
++ uninstall-libLIBRARIES
++
++.MAKE: install-am install-strip
+
+ .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+ clean clean-binPROGRAMS clean-generic clean-libLIBRARIES \
+ clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \
+- dist-shar dist-tarZ dist-zip distcheck distclean \
++ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+- install-binPROGRAMS install-data install-data-am install-exec \
+- install-exec-am install-includeHEADERS install-info \
+- install-info-am install-libLIBRARIES install-man install-strip \
++ install-binPROGRAMS install-data install-data-am install-dvi \
++ install-dvi-am install-exec install-exec-am install-html \
++ install-html-am install-includeHEADERS install-info \
++ install-info-am install-libLIBRARIES install-man install-pdf \
++ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \
+- uninstall-info-am uninstall-libLIBRARIES
++ uninstall-libLIBRARIES
+
+ # 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.
+diff --git a/jbig2dec/aclocal.m4 b/jbig2dec/aclocal.m4
+--- a/jbig2dec/aclocal.m4
++++ b/jbig2dec/aclocal.m4
+@@ -1,7 +1,7 @@
+-# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
++# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+-# 2005 Free Software Foundation, Inc.
++# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -11,7 +11,15 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
++m4_ifndef([AC_AUTOCONF_VERSION],
++ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
++m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
++[m4_warning([this file was generated for autoconf 2.63.
++You have another version of autoconf. It may work, but is not guaranteed to.
++If you have problems, you may need to regenerate the build system entirely.
++To do so, use the procedure documented by the package, typically `autoreconf'.])])
++
++# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+@@ -21,14 +29,31 @@
+ # ----------------------------
+ # Automake X.Y traces this macro to ensure aclocal.m4 has been
+ # generated from the m4 files accompanying Automake X.Y.
+-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
++# (This private macro should not be called outside this file.)
++AC_DEFUN([AM_AUTOMAKE_VERSION],
++[am__api_version='1.10'
++dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
++dnl require some minimum version. Point them to the right macro.
++m4_if([$1], [1.10.2], [],
++ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
++])
++
++# _AM_AUTOCONF_VERSION(VERSION)
++# -----------------------------
++# aclocal traces this macro to find the Autoconf version.
++# This is a private macro too. Using m4_define simplifies
++# the logic in aclocal, which can simply ignore this definition.
++m4_define([_AM_AUTOCONF_VERSION], [])
+
+ # AM_SET_CURRENT_AUTOMAKE_VERSION
+ # -------------------------------
+-# Call AM_AUTOMAKE_VERSION so it can be traced.
+-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
++# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+- [AM_AUTOMAKE_VERSION([1.9.5])])
++[AM_AUTOMAKE_VERSION([1.10.2])dnl
++m4_ifndef([AC_AUTOCONF_VERSION],
++ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
++_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+ # AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+@@ -85,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
+
+ # AM_CONDITIONAL -*- Autoconf -*-
+
+-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
++# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+ # Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 7
++# serial 8
+
+ # AM_CONDITIONAL(NAME, SHELL-CONDITION)
+ # -------------------------------------
+@@ -101,8 +126,10 @@ AC_DEFUN([AM_CONDITIONAL],
+ [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+-AC_SUBST([$1_TRUE])
+-AC_SUBST([$1_FALSE])
++AC_SUBST([$1_TRUE])dnl
++AC_SUBST([$1_FALSE])dnl
++_AM_SUBST_NOTMAKE([$1_TRUE])dnl
++_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+ if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+@@ -116,15 +143,14 @@ AC_CONFIG_COMMANDS_PRE(
+ Usually this means the macro was only invoked conditionally.]])
+ fi])])
+
+-
+-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ # Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 8
++# serial 9
+
+ # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+ # written in clear, in which case automake, when reading aclocal.m4,
+@@ -152,6 +178,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
+ ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
++ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+@@ -217,6 +244,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
++ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+@@ -269,61 +297,74 @@ if test "x$enable_dependency_tracking" != xno; then
+ AMDEPBACKSLASH='\'
+ fi
+ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+-AC_SUBST([AMDEPBACKSLASH])
++AC_SUBST([AMDEPBACKSLASH])dnl
++_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+ ])
+
+ # Generate code to set up dependency tracking. -*- Autoconf -*-
+
+-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+ # Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-#serial 3
++#serial 5
+
+ # _AM_OUTPUT_DEPENDENCY_COMMANDS
+ # ------------------------------
+ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+-[for mf in $CONFIG_FILES; do
+- # Strip MF so we end up with the name of the file.
+- mf=`echo "$mf" | sed -e 's/:.*$//'`
+- # Check whether this is an Automake generated Makefile or not.
+- # We used to match only the files named `Makefile.in', but
+- # some people rename them; so instead we look at the file content.
+- # Grep'ing the first line is not enough: some people post-process
+- # each Makefile.in and add a new line on top of each file to say so.
+- # So let's grep whole file.
+- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+- dirpart=`AS_DIRNAME("$mf")`
+- else
+- continue
+- fi
+- # Extract the definition of DEPDIR, am__include, and am__quote
+- # from the Makefile without running `make'.
+- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+- test -z "$DEPDIR" && continue
+- am__include=`sed -n 's/^am__include = //p' < "$mf"`
+- test -z "am__include" && continue
+- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+- # When using ansi2knr, U may be empty or an underscore; expand it
+- U=`sed -n 's/^U = //p' < "$mf"`
+- # Find all dependency output files, they are included files with
+- # $(DEPDIR) in their names. We invoke sed twice because it is the
+- # simplest approach to changing $(DEPDIR) to its actual value in the
+- # expansion.
+- for file in `sed -n "
+- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+- # Make sure the directory exists.
+- test -f "$dirpart/$file" && continue
+- fdir=`AS_DIRNAME(["$file"])`
+- AS_MKDIR_P([$dirpart/$fdir])
+- # echo "creating $dirpart/$file"
+- echo '# dummy' > "$dirpart/$file"
++[{
++ # Autoconf 2.62 quotes --file arguments for eval, but not when files
++ # are listed without --file. Let's play safe and only enable the eval
++ # if we detect the quoting.
++ case $CONFIG_FILES in
++ *\'*) eval set x "$CONFIG_FILES" ;;
++ *) set x $CONFIG_FILES ;;
++ esac
++ shift
++ for mf
++ do
++ # Strip MF so we end up with the name of the file.
++ mf=`echo "$mf" | sed -e 's/:.*$//'`
++ # Check whether this is an Automake generated Makefile or not.
++ # We used to match only the files named `Makefile.in', but
++ # some people rename them; so instead we look at the file content.
++ # Grep'ing the first line is not enough: some people post-process
++ # each Makefile.in and add a new line on top of each file to say so.
++ # Grep'ing the whole file is not good either: AIX grep has a line
++ # limit of 2048, but all sed's we know have understand at least 4000.
++ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
++ dirpart=`AS_DIRNAME("$mf")`
++ else
++ continue
++ fi
++ # Extract the definition of DEPDIR, am__include, and am__quote
++ # from the Makefile without running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ am__include=`sed -n 's/^am__include = //p' < "$mf"`
++ test -z "am__include" && continue
++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ # Find all dependency output files, they are included files with
++ # $(DEPDIR) in their names. We invoke sed twice because it is the
++ # simplest approach to changing $(DEPDIR) to its actual value in the
++ # expansion.
++ for file in `sed -n "
++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
++ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
++ # Make sure the directory exists.
++ test -f "$dirpart/$file" && continue
++ fdir=`AS_DIRNAME(["$file"])`
++ AS_MKDIR_P([$dirpart/$fdir])
++ # echo "creating $dirpart/$file"
++ echo '# dummy' > "$dirpart/$file"
++ done
+ done
+-done
++}
+ ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+@@ -354,14 +395,14 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+ # Do all the work for Automake. -*- Autoconf -*-
+
+-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+-# Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
++# 2005, 2006, 2008 Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 12
++# serial 13
+
+ # This macro actually does too much. Some checks are only needed if
+ # your package does certain things. But this isn't really a big deal.
+@@ -378,16 +419,20 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+ # arguments mandatory, and then we can depend on a new Autoconf
+ # release and drop the old call support.
+ AC_DEFUN([AM_INIT_AUTOMAKE],
+-[AC_PREREQ([2.58])dnl
++[AC_PREREQ([2.60])dnl
+ dnl Autoconf wants to disallow AM_ names. We explicitly allow
+ dnl the ones we care about.
+ m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+ AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+-# test to see if srcdir already configured
+-if test "`cd $srcdir && pwd`" != "`pwd`" &&
+- test -f $srcdir/config.status; then
+- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++if test "`cd $srcdir && pwd`" != "`pwd`"; then
++ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
++ # is not polluted with repeated "-I."
++ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
++ # test to see if srcdir already configured
++ if test -f $srcdir/config.status; then
++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++ fi
+ fi
+
+ # test whether we have cygpath
+@@ -407,6 +452,9 @@ m4_ifval([$2],
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+ [_AM_SET_OPTIONS([$1])dnl
++dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
++m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
++ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+@@ -442,6 +490,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
++AC_PROVIDE_IFELSE([AC_PROG_OBJC],
++ [_AM_DEPENDENCIES(OBJC)],
++ [define([AC_PROG_OBJC],
++ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ ])
+ ])
+
+@@ -455,16 +507,17 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ # our stamp files there.
+ AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+ [# Compute $1's index in $config_headers.
++_am_arg=$1
+ _am_stamp_count=1
+ for _am_header in $config_headers :; do
+ case $_am_header in
+- $1 | $1:* )
++ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+ done
+-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
++echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+ # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+ #
+@@ -477,7 +530,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+ # Define $install_sh.
+ AC_DEFUN([AM_PROG_INSTALL_SH],
+ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+-install_sh=${install_sh-"$am_aux_dir/install-sh"}
++install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+ AC_SUBST(install_sh)])
+
+ # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+@@ -553,16 +606,51 @@ AC_MSG_RESULT([$_am_result])
+ rm -f confinc confmf
+ ])
+
++# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 6
++
++# AM_PROG_CC_C_O
++# --------------
++# Like AC_PROG_CC_C_O, but changed for automake.
++AC_DEFUN([AM_PROG_CC_C_O],
++[AC_REQUIRE([AC_PROG_CC_C_O])dnl
++AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++AC_REQUIRE_AUX_FILE([compile])dnl
++# FIXME: we rely on the cache variable name because
++# there is no other way.
++set dummy $CC
++am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
++eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
++if test "$am_t" != yes; then
++ # Losing compiler, so override with the script.
++ # FIXME: It is wrong to rewrite CC.
++ # But if we don't then we get into trouble of one sort or another.
++ # A longer-term fix would be to have automake use am__CC in this case,
++ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
++ CC="$am_aux_dir/compile $CC"
++fi
++dnl Make sure AC_PROG_CC is never called again, or it will override our
++dnl setting of CC.
++m4_define([AC_PROG_CC],
++ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
++])
++
+ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
++# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 4
++# serial 5
+
+ # AM_MISSING_PROG(NAME, PROGRAM)
+ # ------------------------------
+@@ -578,6 +666,7 @@ AC_SUBST($1)])
+ # If it does, set am_missing_run to use it, otherwise, to nothing.
+ AC_DEFUN([AM_MISSING_HAS_RUN],
+ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++AC_REQUIRE_AUX_FILE([missing])dnl
+ test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+ # Use eval to expand $SHELL
+ if eval "$MISSING --run true"; then
+@@ -588,7 +677,7 @@ else
+ fi
+ ])
+
+-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+@@ -596,70 +685,33 @@ fi
+
+ # AM_PROG_MKDIR_P
+ # ---------------
+-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+-#
+-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+-# created by `make install' are always world readable, even if the
+-# installer happens to have an overly restrictive umask (e.g. 077).
+-# This was a mistake. There are at least two reasons why we must not
+-# use `-m 0755':
+-# - it causes special bits like SGID to be ignored,
+-# - it may be too restrictive (some setups expect 775 directories).
+-#
+-# Do not use -m 0755 and let people choose whatever they expect by
+-# setting umask.
+-#
+-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+-# Some implementations (such as Solaris 8's) are not thread-safe: if a
+-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+-# concurrently, both version can detect that a/ is missing, but only
+-# one can create it and the other will error out. Consequently we
+-# restrict ourselves to GNU make (using the --version option ensures
+-# this.)
++# Check for `mkdir -p'.
+ AC_DEFUN([AM_PROG_MKDIR_P],
+-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+- # We used to keeping the `.' as first argument, in order to
+- # allow $(mkdir_p) to be used without argument. As in
+- # $(mkdir_p) $(somedir)
+- # where $(somedir) is conditionally defined. However this is wrong
+- # for two reasons:
+- # 1. if the package is installed by a user who cannot write `.'
+- # make install will fail,
+- # 2. the above comment should most certainly read
+- # $(mkdir_p) $(DESTDIR)$(somedir)
+- # so it does not work when $(somedir) is undefined and
+- # $(DESTDIR) is not.
+- # To support the latter case, we have to write
+- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+- # so the `.' trick is pointless.
+- mkdir_p='mkdir -p --'
+-else
+- # On NextStep and OpenStep, the `mkdir' command does not
+- # recognize any option. It will interpret all options as
+- # directories to create, and then abort because `.' already
+- # exists.
+- for d in ./-p ./--version;
+- do
+- test -d $d && rmdir $d
+- done
+- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+- if test -f "$ac_aux_dir/mkinstalldirs"; then
+- mkdir_p='$(mkinstalldirs)'
+- else
+- mkdir_p='$(install_sh) -d'
+- fi
+-fi
+-AC_SUBST([mkdir_p])])
++[AC_PREREQ([2.60])dnl
++AC_REQUIRE([AC_PROG_MKDIR_P])dnl
++dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
++dnl while keeping a definition of mkdir_p for backward compatibility.
++dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
++dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
++dnl Makefile.ins that do not define MKDIR_P, so we do our own
++dnl adjustment using top_builddir (which is defined more often than
++dnl MKDIR_P).
++AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
++case $mkdir_p in
++ [[\\/$]]* | ?:[[\\/]]*) ;;
++ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
++esac
++])
+
+ # Helper functions for option handling. -*- Autoconf -*-
+
+-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
++# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+ #
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 3
++# serial 4
+
+ # _AM_MANGLE_OPTION(NAME)
+ # -----------------------
+@@ -676,7 +728,7 @@ AC_DEFUN([_AM_SET_OPTION],
+ # ----------------------------------
+ # OPTIONS is a space-separated list of Automake options.
+ AC_DEFUN([_AM_SET_OPTIONS],
+-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
++[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+ # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+ # -------------------------------------------
+@@ -761,9 +813,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+ if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+ fi
+-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+ AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
++# Copyright (C) 2006 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# _AM_SUBST_NOTMAKE(VARIABLE)
++# ---------------------------
++# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
++# This macro is traced by Automake.
++AC_DEFUN([_AM_SUBST_NOTMAKE])
++
+ # Check how to create a tarball. -*- Autoconf -*-
+
+ # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+diff --git a/jbig2dec/compile b/jbig2dec/compile
+--- a/jbig2dec/compile
++++ b/jbig2dec/compile
+@@ -1,7 +1,7 @@
+ #! /bin/sh
+ # Wrapper for compilers which do not understand `-c -o'.
+
+-scriptversion=2005-02-03.08
++scriptversion=2005-05-14.22
+
+ # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+ # Written by Tom Tromey <tromey@cygnus.com>.
+@@ -18,7 +18,7 @@ scriptversion=2005-02-03.08
+ #
+ # 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.
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+diff --git a/jbig2dec/config.h b/jbig2dec/config.h
+--- a/jbig2dec/config.h
++++ b/jbig2dec/config.h
+@@ -1,8 +1,11 @@
+-/* config.h. Generated by configure. */
++/* config.h. Generated from config.h.in by configure. */
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
++/* Define if building universal (internal helper macro) */
++/* #undef AC_APPLE_UNIVERSAL_BUILD */
++
+ /* Define if the local libc includes getopt_long() */
+-#define HAVE_GETOPT_LONG
++#define HAVE_GETOPT_LONG /**/
+
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #define HAVE_INTTYPES_H 1
+@@ -11,7 +14,7 @@
+ #define HAVE_LIBINTL_H 1
+
+ /* Define if libpng is available (-lpng) */
+-/* #undef HAVE_LIBPNG */
++#define HAVE_LIBPNG 1
+
+ /* Define to 1 if you have the <memory.h> header file. */
+ #define HAVE_MEMORY_H 1
+@@ -52,6 +55,9 @@
+ /* set by configure if an alternate header with the stdint.h types is found */
+ /* #undef JBIG2_REPLACE_STDINT_H */
+
++/* Define to 1 if your C compiler doesn't accept -c and -o together. */
++/* #undef NO_MINUS_C_MINUS_O */
++
+ /* Name of package */
+ #define PACKAGE "jbig2dec"
+
+@@ -62,38 +68,46 @@
+ #define PACKAGE_NAME "jbig2dec"
+
+ /* Define to the full name and version of this package. */
+-#define PACKAGE_STRING "jbig2dec 0.9pre"
++#define PACKAGE_STRING "jbig2dec 0.10"
+
+ /* Define to the one symbol short name of this package. */
+ #define PACKAGE_TARNAME "jbig2dec"
+
+ /* Define to the version of this package. */
+-#define PACKAGE_VERSION "0.9pre"
++#define PACKAGE_VERSION "0.10"
+
+-/* The size of a `char', as computed by sizeof. */
++/* The size of `char', as computed by sizeof. */
+ #define SIZEOF_CHAR 1
+
+-/* The size of a `int', as computed by sizeof. */
++/* The size of `int', as computed by sizeof. */
+ #define SIZEOF_INT 4
+
+-/* The size of a `long', as computed by sizeof. */
+-#define SIZEOF_LONG 4
++/* The size of `long', as computed by sizeof. */
++#define SIZEOF_LONG 8
+
+-/* The size of a `short', as computed by sizeof. */
++/* The size of `short', as computed by sizeof. */
+ #define SIZEOF_SHORT 2
+
+ /* Define to 1 if you have the ANSI C header files. */
+ #define STDC_HEADERS 1
+
+ /* Version number of package */
+-#define VERSION "0.9pre"
+-
+-/* Define to 1 if your processor stores words with the most significant byte
+- first (like Motorola and SPARC, unlike Intel and VAX). */
+-/* #undef WORDS_BIGENDIAN */
++#define VERSION "0.10"
++
++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
++ significant byte first (like Motorola and SPARC, unlike Intel). */
++#if defined AC_APPLE_UNIVERSAL_BUILD
++# if defined __BIG_ENDIAN__
++# define WORDS_BIGENDIAN 1
++# endif
++#else
++# ifndef WORDS_BIGENDIAN
++/* # undef WORDS_BIGENDIAN */
++# endif
++#endif
+
+ /* Define to empty if `const' does not conform to ANSI C. */
+ /* #undef const */
+
+-/* Define to `unsigned' if <sys/types.h> does not define. */
++/* Define to `unsigned int' if <sys/types.h> does not define. */
+ /* #undef size_t */
+diff --git a/jbig2dec/config.h.in b/jbig2dec/config.h.in
+--- a/jbig2dec/config.h.in
++++ b/jbig2dec/config.h.in
+@@ -1,5 +1,8 @@
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
++/* Define if building universal (internal helper macro) */
++#undef AC_APPLE_UNIVERSAL_BUILD
++
+ /* Define if the local libc includes getopt_long() */
+ #undef HAVE_GETOPT_LONG
+
+@@ -51,6 +54,9 @@
+ /* set by configure if an alternate header with the stdint.h types is found */
+ #undef JBIG2_REPLACE_STDINT_H
+
++/* Define to 1 if your C compiler doesn't accept -c and -o together. */
++#undef NO_MINUS_C_MINUS_O
++
+ /* Name of package */
+ #undef PACKAGE
+
+@@ -69,16 +75,16 @@
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
+-/* The size of a `char', as computed by sizeof. */
++/* The size of `char', as computed by sizeof. */
+ #undef SIZEOF_CHAR
+
+-/* The size of a `int', as computed by sizeof. */
++/* The size of `int', as computed by sizeof. */
+ #undef SIZEOF_INT
+
+-/* The size of a `long', as computed by sizeof. */
++/* The size of `long', as computed by sizeof. */
+ #undef SIZEOF_LONG
+
+-/* The size of a `short', as computed by sizeof. */
++/* The size of `short', as computed by sizeof. */
+ #undef SIZEOF_SHORT
+
+ /* Define to 1 if you have the ANSI C header files. */
+@@ -87,12 +93,20 @@
+ /* Version number of package */
+ #undef VERSION
+
+-/* Define to 1 if your processor stores words with the most significant byte
+- first (like Motorola and SPARC, unlike Intel and VAX). */
+-#undef WORDS_BIGENDIAN
++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
++ significant byte first (like Motorola and SPARC, unlike Intel). */
++#if defined AC_APPLE_UNIVERSAL_BUILD
++# if defined __BIG_ENDIAN__
++# define WORDS_BIGENDIAN 1
++# endif
++#else
++# ifndef WORDS_BIGENDIAN
++# undef WORDS_BIGENDIAN
++# endif
++#endif
+
+ /* Define to empty if `const' does not conform to ANSI C. */
+ #undef const
+
+-/* Define to `unsigned' if <sys/types.h> does not define. */
++/* Define to `unsigned int' if <sys/types.h> does not define. */
+ #undef size_t
+diff --git a/jbig2dec/config_win32.h b/jbig2dec/config_win32.h
+--- a/jbig2dec/config_win32.h
++++ b/jbig2dec/config_win32.h
+@@ -7,13 +7,10 @@
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: config_win32.h 8735 2008-05-15 16:17:48Z mvrhel $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ /* configuration header file for compiling under Microsoft Windows */
+@@ -28,18 +25,17 @@
+ typedef short int int16_t;
+ typedef int int32_t;
+ typedef __int64 int64_t;
+-
++
+ typedef unsigned char uint8_t;
+ typedef unsigned short int uint16_t;
+ typedef unsigned int uint32_t;
+ /* no uint64_t */
+
+-#if defined(_MSC_VER)
+- #if _MSC_VER < 1500 /* Visual Studio 2008 has definition for vsnprintf */
+- #define vsnprintf _vsnprintf
+- #endif
+-#endif
+-
++# if defined(_MSC_VER)
++# if _MSC_VER < 1500 /* VS 2008 has vsnprintf */
++# define vsnprintf _vsnprintf
++# endif
++# endif
+ # define snprintf _snprintf
+
+ #endif /* _MSC_VER */
+diff --git a/jbig2dec/configure b/jbig2dec/configure
+--- a/jbig2dec/configure
++++ b/jbig2dec/configure
+@@ -1,27 +1,84 @@
+ #! /bin/sh
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.59 for jbig2dec 0.9pre.
++# Generated by GNU Autoconf 2.63 for jbig2dec 0.10.
+ #
+ # Report bugs to <jbig2-dev@ghostscript.com>.
+ #
+-# Copyright (C) 2003 Free Software Foundation, Inc.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
++# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+ ## --------------------- ##
+ ## M4sh Initialization. ##
+ ## --------------------- ##
+
+-# Be Bourne compatible
++# Be more Bourne compatible
++DUALCASE=1; export DUALCASE # for MKS sh
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+- set -o posix
++ setopt NO_GLOB_SUBST
++else
++ case `(set -o) 2>/dev/null` in
++ *posix*) set -o posix ;;
++esac
++
++fi
++
++
++
++
++# PATH needs CR
++# Avoid depending upon Character Ranges.
++as_cr_letters='abcdefghijklmnopqrstuvwxyz'
++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
++as_cr_Letters=$as_cr_letters$as_cr_LETTERS
++as_cr_digits='0123456789'
++as_cr_alnum=$as_cr_Letters$as_cr_digits
++
++as_nl='
++'
++export as_nl
++# Printing a long string crashes Solaris 7 /usr/bin/printf.
++as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
++if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
++ as_echo='printf %s\n'
++ as_echo_n='printf %s'
++else
++ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
++ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
++ as_echo_n='/usr/ucb/echo -n'
++ else
++ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
++ as_echo_n_body='eval
++ arg=$1;
++ case $arg in
++ *"$as_nl"*)
++ expr "X$arg" : "X\\(.*\\)$as_nl";
++ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
++ esac;
++ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
++ '
++ export as_echo_n_body
++ as_echo_n='sh -c $as_echo_n_body as_echo'
++ fi
++ export as_echo_body
++ as_echo='sh -c $as_echo_body as_echo'
++fi
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ PATH_SEPARATOR=:
++ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
++ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
++ PATH_SEPARATOR=';'
++ }
+ fi
+-DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+ if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+@@ -31,33 +88,60 @@ else
+ fi
+
+
++# IFS
++# We need space, tab and new line, in precisely that order. Quoting is
++# there to prevent editors from complaining about space-tab.
++# (If _AS_PATH_WALK were called with IFS unset, it would disable word
++# splitting by setting IFS to empty value.)
++IFS=" "" $as_nl"
++
++# Find who we are. Look in the path if we contain no directory separator.
++case $0 in
++ *[\\/]* ) as_myself=$0 ;;
++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
++done
++IFS=$as_save_IFS
++
++ ;;
++esac
++# We did not find ourselves, most probably we were run as `sh COMMAND'
++# in which case we are not to be found in the path.
++if test "x$as_myself" = x; then
++ as_myself=$0
++fi
++if test ! -f "$as_myself"; then
++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
++ { (exit 1); exit 1; }
++fi
++
+ # Work around bugs in pre-3.0 UWIN ksh.
+-$as_unset ENV MAIL MAILPATH
++for as_var in ENV MAIL MAILPATH
++do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
++done
+ PS1='$ '
+ PS2='> '
+ PS4='+ '
+
+ # NLS nuisances.
+-for as_var in \
+- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+- LC_TELEPHONE LC_TIME
+-do
+- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+- eval $as_var=C; export $as_var
+- else
+- $as_unset $as_var
+- fi
+-done
++LC_ALL=C
++export LC_ALL
++LANGUAGE=C
++export LANGUAGE
+
+ # Required to use basename.
+-if expr a : '\(a\)' >/dev/null 2>&1; then
++if expr a : '\(a\)' >/dev/null 2>&1 &&
++ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+ else
+ as_expr=false
+ fi
+
+-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+ else
+ as_basename=false
+@@ -65,157 +149,391 @@ fi
+
+
+ # Name of the executable.
+-as_me=`$as_basename "$0" ||
++as_me=`$as_basename -- "$0" ||
+ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)$' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X/"$0" |
+- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+- /^X\/\(\/\/\)$/{ s//\1/; q; }
+- /^X\/\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
++ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{
++ s//\1/
++ q
++ }
++ /^X\/\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\/\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
+
++# CDPATH.
++$as_unset CDPATH
+
+-# PATH needs CR, and LINENO needs CR and PATH.
+-# Avoid depending upon Character Ranges.
+-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+-as_cr_digits='0123456789'
+-as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+-# The user is always right.
+-if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
+- echo "exit 0" >>conf$$.sh
+- chmod +x conf$$.sh
+- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+- PATH_SEPARATOR=';'
+- else
+- PATH_SEPARATOR=:
+- fi
+- rm -f conf$$.sh
++if test "x$CONFIG_SHELL" = x; then
++ if (eval ":") 2>/dev/null; then
++ as_have_required=yes
++else
++ as_have_required=no
+ fi
+
++ if test $as_have_required = yes && (eval ":
++(as_func_return () {
++ (exit \$1)
++}
++as_func_success () {
++ as_func_return 0
++}
++as_func_failure () {
++ as_func_return 1
++}
++as_func_ret_success () {
++ return 0
++}
++as_func_ret_failure () {
++ return 1
++}
+
+- as_lineno_1=$LINENO
+- as_lineno_2=$LINENO
+- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+- test "x$as_lineno_1" != "x$as_lineno_2" &&
+- test "x$as_lineno_3" = "x$as_lineno_2" || {
+- # Find who we are. Look in the path if we contain no path at all
+- # relative or not.
+- case $0 in
+- *[\\/]* ) as_myself=$0 ;;
+- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+-done
++exitcode=0
++if as_func_success; then
++ :
++else
++ exitcode=1
++ echo as_func_success failed.
++fi
+
+- ;;
+- esac
+- # We did not find ourselves, most probably we were run as `sh COMMAND'
+- # in which case we are not to be found in the path.
+- if test "x$as_myself" = x; then
+- as_myself=$0
+- fi
+- if test ! -f "$as_myself"; then
+- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+- { (exit 1); exit 1; }; }
+- fi
+- case $CONFIG_SHELL in
+- '')
++if as_func_failure; then
++ exitcode=1
++ echo as_func_failure succeeded.
++fi
++
++if as_func_ret_success; then
++ :
++else
++ exitcode=1
++ echo as_func_ret_success failed.
++fi
++
++if as_func_ret_failure; then
++ exitcode=1
++ echo as_func_ret_failure succeeded.
++fi
++
++if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
++ :
++else
++ exitcode=1
++ echo positional parameters were not saved.
++fi
++
++test \$exitcode = 0) || { (exit 1); exit 1; }
++
++(
++ as_lineno_1=\$LINENO
++ as_lineno_2=\$LINENO
++ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
++ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
++") 2> /dev/null; then
++ :
++else
++ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+ do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+- for as_base in sh bash ksh sh5; do
+- case $as_dir in
++ case $as_dir in
+ /*)
+- if ("$as_dir/$as_base" -c '
++ for as_base in sh bash ksh sh5; do
++ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
++ done;;
++ esac
++done
++IFS=$as_save_IFS
++
++
++ for as_shell in $as_candidate_shells $SHELL; do
++ # Try only shells that exist, to save several forks.
++ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
++ { ("$as_shell") 2> /dev/null <<\_ASEOF
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++ setopt NO_GLOB_SUBST
++else
++ case `(set -o) 2>/dev/null` in
++ *posix*) set -o posix ;;
++esac
++
++fi
++
++
++:
++_ASEOF
++}; then
++ CONFIG_SHELL=$as_shell
++ as_have_required=yes
++ if { "$as_shell" 2> /dev/null <<\_ASEOF
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++ setopt NO_GLOB_SUBST
++else
++ case `(set -o) 2>/dev/null` in
++ *posix*) set -o posix ;;
++esac
++
++fi
++
++
++:
++(as_func_return () {
++ (exit $1)
++}
++as_func_success () {
++ as_func_return 0
++}
++as_func_failure () {
++ as_func_return 1
++}
++as_func_ret_success () {
++ return 0
++}
++as_func_ret_failure () {
++ return 1
++}
++
++exitcode=0
++if as_func_success; then
++ :
++else
++ exitcode=1
++ echo as_func_success failed.
++fi
++
++if as_func_failure; then
++ exitcode=1
++ echo as_func_failure succeeded.
++fi
++
++if as_func_ret_success; then
++ :
++else
++ exitcode=1
++ echo as_func_ret_success failed.
++fi
++
++if as_func_ret_failure; then
++ exitcode=1
++ echo as_func_ret_failure succeeded.
++fi
++
++if ( set x; as_func_ret_success y && test x = "$1" ); then
++ :
++else
++ exitcode=1
++ echo positional parameters were not saved.
++fi
++
++test $exitcode = 0) || { (exit 1); exit 1; }
++
++(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+- CONFIG_SHELL=$as_dir/$as_base
+- export CONFIG_SHELL
+- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+- fi;;
+- esac
+- done
+-done
+-;;
+- esac
++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
++
++_ASEOF
++}; then
++ break
++fi
++
++fi
++
++ done
++
++ if test "x$CONFIG_SHELL" != x; then
++ for as_var in BASH_ENV ENV
++ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
++ done
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
++fi
++
++
++ if test $as_have_required = no; then
++ echo This script requires a shell more modern than all the
++ echo shells that I found on your system. Please install a
++ echo modern shell, or manually run the script under such a
++ echo shell if you do have one.
++ { (exit 1); exit 1; }
++fi
++
++
++fi
++
++fi
++
++
++
++(eval "as_func_return () {
++ (exit \$1)
++}
++as_func_success () {
++ as_func_return 0
++}
++as_func_failure () {
++ as_func_return 1
++}
++as_func_ret_success () {
++ return 0
++}
++as_func_ret_failure () {
++ return 1
++}
++
++exitcode=0
++if as_func_success; then
++ :
++else
++ exitcode=1
++ echo as_func_success failed.
++fi
++
++if as_func_failure; then
++ exitcode=1
++ echo as_func_failure succeeded.
++fi
++
++if as_func_ret_success; then
++ :
++else
++ exitcode=1
++ echo as_func_ret_success failed.
++fi
++
++if as_func_ret_failure; then
++ exitcode=1
++ echo as_func_ret_failure succeeded.
++fi
++
++if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
++ :
++else
++ exitcode=1
++ echo positional parameters were not saved.
++fi
++
++test \$exitcode = 0") || {
++ echo No shell found that supports shell functions.
++ echo Please tell bug-autoconf@gnu.org about your system,
++ echo including any error possibly output before this message.
++ echo This can help us improve future autoconf versions.
++ echo Configuration will now proceed without shell functions.
++}
++
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+- # line-number line before each line; the second 'sed' does the real
+- # work. The second script uses 'N' to pair each line-number line
+- # with the numbered line, and appends trailing '-' during
+- # substitution so that $LINENO is not a special case at line end.
++ # line-number line after each line using $LINENO; the second 'sed'
++ # does the real work. The second script uses 'N' to pair each
++ # line-number line with the line containing $LINENO, and appends
++ # trailing '-' during substitution so that $LINENO is not a special
++ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+- sed '=' <$as_myself |
++ # scripts with optimization help from Paolo Bonzini. Blame Lee
++ # E. McMahon (1931-1989) for sed's syntax. :-)
++ sed -n '
++ p
++ /[$]LINENO/=
++ ' <$as_myself |
+ sed '
++ s/[$]LINENO.*/&-/
++ t lineno
++ b
++ :lineno
+ N
+- s,$,-,
+- : loop
+- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ :loop
++ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+- s,-$,,
+- s,^['$as_cr_digits']*\n,,
++ s/-\n.*//
+ ' >$as_me.lineno &&
+- chmod +x $as_me.lineno ||
+- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ chmod +x "$as_me.lineno" ||
++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+- # original and so on. Autoconf is especially sensible to this).
+- . ./$as_me.lineno
++ # original and so on. Autoconf is especially sensitive to this).
++ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+ }
+
+
+-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+- *c*,-n*) ECHO_N= ECHO_C='
+-' ECHO_T=' ' ;;
+- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+-esac
++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
++ as_dirname=dirname
++else
++ as_dirname=false
++fi
+
+-if expr a : '\(a\)' >/dev/null 2>&1; then
++ECHO_C= ECHO_N= ECHO_T=
++case `echo -n x` in
++-n*)
++ case `echo 'x\c'` in
++ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
++ *) ECHO_C='\c';;
++ esac;;
++*)
++ ECHO_N='-n';;
++esac
++if expr a : '\(a\)' >/dev/null 2>&1 &&
++ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+ else
+ as_expr=false
+ fi
+
+ rm -f conf$$ conf$$.exe conf$$.file
+-echo >conf$$.file
+-if ln -s conf$$.file conf$$ 2>/dev/null; then
+- # We could just check for DJGPP; but this test a) works b) is more generic
+- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+- if test -f conf$$.exe; then
+- # Don't use ln at all; we don't have any links
+- as_ln_s='cp -p'
+- else
++if test -d conf$$.dir; then
++ rm -f conf$$.dir/conf$$.file
++else
++ rm -f conf$$.dir
++ mkdir conf$$.dir 2>/dev/null
++fi
++if (echo >conf$$.file) 2>/dev/null; then
++ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
++ # ... but there are two gotchas:
++ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
++ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
++ # In both cases, we have to default to `cp -p'.
++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
++ as_ln_s='cp -p'
++ elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++ else
++ as_ln_s='cp -p'
+ fi
+-elif ln conf$$.file conf$$ 2>/dev/null; then
+- as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+-rm -f conf$$ conf$$.exe conf$$.file
++rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
++rmdir conf$$.dir 2>/dev/null
+
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+@@ -224,7 +542,28 @@ else
+ as_mkdir_p=false
+ fi
+
+-as_executable_p="test -f"
++if test -x / >/dev/null 2>&1; then
++ as_test_x='test -x'
++else
++ if ls -dL / >/dev/null 2>&1; then
++ as_ls_L_option=L
++ else
++ as_ls_L_option=
++ fi
++ as_test_x='
++ eval sh -c '\''
++ if test -d "$1"; then
++ test -d "$1/.";
++ else
++ case $1 in
++ -*)set "./$1";;
++ esac;
++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
++ ???[sx]*):;;*)false;;esac;fi
++ '\'' sh
++ '
++fi
++as_executable_p=$as_test_x
+
+ # Sed expression to map a string onto a valid CPP name.
+ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+@@ -233,90 +572,179 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+-# IFS
+-# We need space, tab and new line, in precisely that order.
+-as_nl='
+-'
+-IFS=" $as_nl"
+-
+-# CDPATH.
+-$as_unset CDPATH
+
++exec 7<&0 </dev/null 6>&1
+
+ # Name of the host.
+ # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+ # so uname gets run too.
+ ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+-exec 6>&1
+-
+ #
+ # Initializations.
+ #
+ ac_default_prefix=/usr/local
++ac_clean_files=
+ ac_config_libobj_dir=.
++LIBOBJS=
+ cross_compiling=no
+ subdirs=
+ MFLAGS=
+ MAKEFLAGS=
+ SHELL=${CONFIG_SHELL-/bin/sh}
+
+-# Maximum number of lines to put in a shell here document.
+-# This variable seems obsolete. It should probably be removed, and
+-# only ac_max_sed_lines should be used.
+-: ${ac_max_here_lines=38}
+-
+ # Identity of this package.
+ PACKAGE_NAME='jbig2dec'
+ PACKAGE_TARNAME='jbig2dec'
+-PACKAGE_VERSION='0.9pre'
+-PACKAGE_STRING='jbig2dec 0.9pre'
++PACKAGE_VERSION='0.10'
++PACKAGE_STRING='jbig2dec 0.10'
+ PACKAGE_BUGREPORT='jbig2-dev@ghostscript.com'
+
+ ac_unique_file="jbig2dec.c"
+ # Factoring default headers for most tests.
+ ac_includes_default="\
+ #include <stdio.h>
+-#if HAVE_SYS_TYPES_H
++#ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+-#if HAVE_SYS_STAT_H
++#ifdef HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+ #endif
+-#if STDC_HEADERS
++#ifdef STDC_HEADERS
+ # include <stdlib.h>
+ # include <stddef.h>
+ #else
+-# if HAVE_STDLIB_H
++# ifdef HAVE_STDLIB_H
+ # include <stdlib.h>
+ # endif
+ #endif
+-#if HAVE_STRING_H
+-# if !STDC_HEADERS && HAVE_MEMORY_H
++#ifdef HAVE_STRING_H
++# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+ # include <memory.h>
+ # endif
+ # include <string.h>
+ #endif
+-#if HAVE_STRINGS_H
++#ifdef HAVE_STRINGS_H
+ # include <strings.h>
+ #endif
+-#if HAVE_INTTYPES_H
++#ifdef HAVE_INTTYPES_H
+ # include <inttypes.h>
+-#else
+-# if HAVE_STDINT_H
+-# include <stdint.h>
+-# endif
+ #endif
+-#if HAVE_UNISTD_H
++#ifdef HAVE_STDINT_H
++# include <stdint.h>
++#endif
++#ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif"
+
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB LIBOBJS CPP EGREP JBIG2_INT32_T JBIG2_INT16_T JBIG2_INT8_T JBIG2_STDINT_H LTLIBOBJS'
++ac_subst_vars='LTLIBOBJS
++JBIG2_STDINT_H
++JBIG2_INT8_T
++JBIG2_INT16_T
++JBIG2_INT32_T
++EGREP
++GREP
++CPP
++LIBOBJS
++RANLIB
++am__fastdepCC_FALSE
++am__fastdepCC_TRUE
++CCDEPMODE
++AMDEPBACKSLASH
++AMDEP_FALSE
++AMDEP_TRUE
++am__quote
++am__include
++DEPDIR
++OBJEXT
++EXEEXT
++ac_ct_CC
++CPPFLAGS
++LDFLAGS
++CFLAGS
++CC
++am__untar
++am__tar
++AMTAR
++am__leading_dot
++SET_MAKE
++AWK
++mkdir_p
++MKDIR_P
++INSTALL_STRIP_PROGRAM
++STRIP
++install_sh
++MAKEINFO
++AUTOHEADER
++AUTOMAKE
++AUTOCONF
++ACLOCAL
++VERSION
++PACKAGE
++CYGPATH_W
++am__isrc
++INSTALL_DATA
++INSTALL_SCRIPT
++INSTALL_PROGRAM
++target_alias
++host_alias
++build_alias
++LIBS
++ECHO_T
++ECHO_N
++ECHO_C
++DEFS
++mandir
++localedir
++libdir
++psdir
++pdfdir
++dvidir
++htmldir
++infodir
++docdir
++oldincludedir
++includedir
++localstatedir
++sharedstatedir
++sysconfdir
++datadir
++datarootdir
++libexecdir
++sbindir
++bindir
++program_transform_name
++prefix
++exec_prefix
++PACKAGE_BUGREPORT
++PACKAGE_STRING
++PACKAGE_VERSION
++PACKAGE_TARNAME
++PACKAGE_NAME
++PATH_SEPARATOR
++SHELL'
+ ac_subst_files=''
++ac_user_opts='
++enable_option_checking
++enable_dependency_tracking
++with_libpng
++'
++ ac_precious_vars='build_alias
++host_alias
++target_alias
++CC
++CFLAGS
++LDFLAGS
++LIBS
++CPPFLAGS
++CPP'
++
+
+ # Initialize some variables set by options.
+ ac_init_help=
+ ac_init_version=false
++ac_unrecognized_opts=
++ac_unrecognized_sep=
+ # The variables have the same names as the options, with
+ # dashes changed to underlines.
+ cache_file=/dev/null
+@@ -339,34 +767,48 @@ x_libraries=NONE
+ # and all the variables that are supposed to be based on exec_prefix
+ # by default will actually change.
+ # Use braces instead of parens because sh, perl, etc. also accept them.
++# (The list follows the same order as the GNU Coding Standards.)
+ bindir='${exec_prefix}/bin'
+ sbindir='${exec_prefix}/sbin'
+ libexecdir='${exec_prefix}/libexec'
+-datadir='${prefix}/share'
++datarootdir='${prefix}/share'
++datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
+-libdir='${exec_prefix}/lib'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+-infodir='${prefix}/info'
+-mandir='${prefix}/man'
++docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
++infodir='${datarootdir}/info'
++htmldir='${docdir}'
++dvidir='${docdir}'
++pdfdir='${docdir}'
++psdir='${docdir}'
++libdir='${exec_prefix}/lib'
++localedir='${datarootdir}/locale'
++mandir='${datarootdir}/man'
+
+ ac_prev=
++ac_dashdash=
+ for ac_option
+ do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+- eval "$ac_prev=\$ac_option"
++ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
++ case $ac_option in
++ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
++ *) ac_optarg=yes ;;
++ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+- case $ac_option in
++ case $ac_dashdash$ac_option in
++ --)
++ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+@@ -388,33 +830,61 @@ do
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
++ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+- | --da=*)
++ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
++ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
++ | --dataroo | --dataro | --datar)
++ ac_prev=datarootdir ;;
++ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
++ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
++ datarootdir=$ac_optarg ;;
++
+ -disable-* | --disable-*)
+- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+- eval "enable_$ac_feature=no" ;;
++ ac_useropt_orig=$ac_useropt
++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
++ case $ac_user_opts in
++ *"
++"enable_$ac_useropt"
++"*) ;;
++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
++ ac_unrecognized_sep=', ';;
++ esac
++ eval enable_$ac_useropt=no ;;
++
++ -docdir | --docdir | --docdi | --doc | --do)
++ ac_prev=docdir ;;
++ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
++ docdir=$ac_optarg ;;
++
++ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
++ ac_prev=dvidir ;;
++ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
++ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+- case $ac_option in
+- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+- *) ac_optarg=yes ;;
++ ac_useropt_orig=$ac_useropt
++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
++ case $ac_user_opts in
++ *"
++"enable_$ac_useropt"
++"*) ;;
++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
++ ac_unrecognized_sep=', ';;
+ esac
+- eval "enable_$ac_feature='$ac_optarg'" ;;
++ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+@@ -441,6 +911,12 @@ do
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
++ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
++ ac_prev=htmldir ;;
++ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
++ | --ht=*)
++ htmldir=$ac_optarg ;;
++
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+@@ -465,13 +941,16 @@ do
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
++ -localedir | --localedir | --localedi | --localed | --locale)
++ ac_prev=localedir ;;
++ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
++ localedir=$ac_optarg ;;
++
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+- | --localstate | --localstat | --localsta | --localst \
+- | --locals | --local | --loca | --loc | --lo)
++ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+@@ -536,6 +1015,16 @@ do
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
++ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
++ ac_prev=pdfdir ;;
++ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
++ pdfdir=$ac_optarg ;;
++
++ -psdir | --psdir | --psdi | --psd | --ps)
++ ac_prev=psdir ;;
++ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
++ psdir=$ac_optarg ;;
++
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+@@ -586,26 +1075,38 @@ do
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid package name: $ac_package" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_package=`echo $ac_package| sed 's/-/_/g'`
+- case $ac_option in
+- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+- *) ac_optarg=yes ;;
++ ac_useropt_orig=$ac_useropt
++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
++ case $ac_user_opts in
++ *"
++"with_$ac_useropt"
++"*) ;;
++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
++ ac_unrecognized_sep=', ';;
+ esac
+- eval "with_$ac_package='$ac_optarg'" ;;
++ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid package name: $ac_package" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_package=`echo $ac_package | sed 's/-/_/g'`
+- eval "with_$ac_package=no" ;;
++ ac_useropt_orig=$ac_useropt
++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
++ case $ac_user_opts in
++ *"
++"with_$ac_useropt"
++"*) ;;
++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
++ ac_unrecognized_sep=', ';;
++ esac
++ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+@@ -625,7 +1126,7 @@ do
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+- -*) { echo "$as_me: error: unrecognized option: $ac_option
++ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+ Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+@@ -634,17 +1135,16 @@ Try \`$0 --help' for more information." >&2
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+- eval "$ac_envvar='$ac_optarg'"
++ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
++ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+@@ -653,31 +1153,39 @@ done
+
+ if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+- { echo "$as_me: error: missing argument to $ac_option" >&2
++ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+ fi
+
+-# Be sure to have absolute paths.
+-for ac_var in exec_prefix prefix
+-do
+- eval ac_val=$`echo $ac_var`
+- case $ac_val in
+- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+- { (exit 1); exit 1; }; };;
++if test -n "$ac_unrecognized_opts"; then
++ case $enable_option_checking in
++ no) ;;
++ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
++ { (exit 1); exit 1; }; } ;;
++ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+-done
++fi
+
+-# Be sure to have absolute paths.
+-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+- localstatedir libdir includedir oldincludedir infodir mandir
++# Check all directory arguments for consistency.
++for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
++ datadir sysconfdir sharedstatedir localstatedir includedir \
++ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
++ libdir localedir mandir
+ do
+- eval ac_val=$`echo $ac_var`
++ eval ac_val=\$$ac_var
++ # Remove trailing slashes.
+ case $ac_val in
+- [\\/$]* | ?:[\\/]* ) ;;
+- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+- { (exit 1); exit 1; }; };;
++ */ )
++ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
++ eval $ac_var=\$ac_val;;
++ esac
++ # Be sure to have absolute directory names.
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* ) continue;;
++ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
++ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; }
+ done
+
+ # There might be people who depend on the old broken behavior: `$host'
+@@ -691,7 +1199,7 @@ target=$target_alias
+ if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
++ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+@@ -704,74 +1212,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
+ test "$silent" = yes && exec 6>/dev/null
+
+
++ac_pwd=`pwd` && test -n "$ac_pwd" &&
++ac_ls_di=`ls -di .` &&
++ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
++ { $as_echo "$as_me: error: working directory cannot be determined" >&2
++ { (exit 1); exit 1; }; }
++test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
++ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
++ { (exit 1); exit 1; }; }
++
++
+ # Find the source files, if location was not specified.
+ if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+- # Try the directory containing this script, then its parent.
+- ac_confdir=`(dirname "$0") 2>/dev/null ||
+-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$0" : 'X\(//\)[^/]' \| \
+- X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$0" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
++ # Try the directory containing this script, then the parent directory.
++ ac_confdir=`$as_dirname -- "$as_myself" ||
++$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_myself" : 'X\(//\)[^/]' \| \
++ X"$as_myself" : 'X\(//\)$' \| \
++ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$as_myself" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
+ srcdir=$ac_confdir
+- if test ! -r $srcdir/$ac_unique_file; then
++ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+ else
+ ac_srcdir_defaulted=no
+ fi
+-if test ! -r $srcdir/$ac_unique_file; then
+- if test "$ac_srcdir_defaulted" = yes; then
+- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++if test ! -r "$srcdir/$ac_unique_file"; then
++ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
++ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+- else
+- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+- { (exit 1); exit 1; }; }
+- fi
+ fi
+-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
++ac_abs_confdir=`(
++ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+-ac_env_build_alias_set=${build_alias+set}
+-ac_env_build_alias_value=$build_alias
+-ac_cv_env_build_alias_set=${build_alias+set}
+-ac_cv_env_build_alias_value=$build_alias
+-ac_env_host_alias_set=${host_alias+set}
+-ac_env_host_alias_value=$host_alias
+-ac_cv_env_host_alias_set=${host_alias+set}
+-ac_cv_env_host_alias_value=$host_alias
+-ac_env_target_alias_set=${target_alias+set}
+-ac_env_target_alias_value=$target_alias
+-ac_cv_env_target_alias_set=${target_alias+set}
+-ac_cv_env_target_alias_value=$target_alias
+-ac_env_CC_set=${CC+set}
+-ac_env_CC_value=$CC
+-ac_cv_env_CC_set=${CC+set}
+-ac_cv_env_CC_value=$CC
+-ac_env_CFLAGS_set=${CFLAGS+set}
+-ac_env_CFLAGS_value=$CFLAGS
+-ac_cv_env_CFLAGS_set=${CFLAGS+set}
+-ac_cv_env_CFLAGS_value=$CFLAGS
+-ac_env_LDFLAGS_set=${LDFLAGS+set}
+-ac_env_LDFLAGS_value=$LDFLAGS
+-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+-ac_cv_env_LDFLAGS_value=$LDFLAGS
+-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+-ac_env_CPPFLAGS_value=$CPPFLAGS
+-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+-ac_env_CPP_set=${CPP+set}
+-ac_env_CPP_value=$CPP
+-ac_cv_env_CPP_set=${CPP+set}
+-ac_cv_env_CPP_value=$CPP
++ pwd)`
++# When building in place, set srcdir=.
++if test "$ac_abs_confdir" = "$ac_pwd"; then
++ srcdir=.
++fi
++# Remove unnecessary trailing slashes from srcdir.
++# Double slashes in file names in object file debugging info
++# mess up M-x gdb in Emacs.
++case $srcdir in
++*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
++esac
++for ac_var in $ac_precious_vars; do
++ eval ac_env_${ac_var}_set=\${${ac_var}+set}
++ eval ac_env_${ac_var}_value=\$${ac_var}
++ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
++ eval ac_cv_env_${ac_var}_value=\$${ac_var}
++done
+
+ #
+ # Report the --help message.
+@@ -780,7 +1290,7 @@ if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+-\`configure' configures jbig2dec 0.9pre to adapt to many kinds of systems.
++\`configure' configures jbig2dec 0.10 to adapt to many kinds of systems.
+
+ Usage: $0 [OPTION]... [VAR=VALUE]...
+
+@@ -800,14 +1310,11 @@ Configuration:
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+-_ACEOF
+-
+- cat <<_ACEOF
+ Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
++ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [PREFIX]
++ [PREFIX]
+
+ By default, \`make install' will install all the files in
+ \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+@@ -817,18 +1324,25 @@ for instance \`--prefix=\$HOME'.
+ For better control, use the options below.
+
+ Fine tuning of the installation directories:
+- --bindir=DIR user executables [EPREFIX/bin]
+- --sbindir=DIR system admin executables [EPREFIX/sbin]
+- --libexecdir=DIR program executables [EPREFIX/libexec]
+- --datadir=DIR read-only architecture-independent data [PREFIX/share]
+- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+- --libdir=DIR object code libraries [EPREFIX/lib]
+- --includedir=DIR C header files [PREFIX/include]
+- --oldincludedir=DIR C header files for non-gcc [/usr/include]
+- --infodir=DIR info documentation [PREFIX/info]
+- --mandir=DIR man documentation [PREFIX/man]
++ --bindir=DIR user executables [EPREFIX/bin]
++ --sbindir=DIR system admin executables [EPREFIX/sbin]
++ --libexecdir=DIR program executables [EPREFIX/libexec]
++ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
++ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
++ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --libdir=DIR object code libraries [EPREFIX/lib]
++ --includedir=DIR C header files [PREFIX/include]
++ --oldincludedir=DIR C header files for non-gcc [/usr/include]
++ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
++ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
++ --infodir=DIR info documentation [DATAROOTDIR/info]
++ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
++ --mandir=DIR man documentation [DATAROOTDIR/man]
++ --docdir=DIR documentation root [DATAROOTDIR/doc/jbig2dec]
++ --htmldir=DIR html documentation [DOCDIR]
++ --dvidir=DIR dvi documentation [DOCDIR]
++ --pdfdir=DIR pdf documentation [DOCDIR]
++ --psdir=DIR ps documentation [DOCDIR]
+ _ACEOF
+
+ cat <<\_ACEOF
+@@ -842,11 +1356,12 @@ fi
+
+ if test -n "$ac_init_help"; then
+ case $ac_init_help in
+- short | recursive ) echo "Configuration of jbig2dec 0.9pre:";;
++ short | recursive ) echo "Configuration of jbig2dec 0.10:";;
+ esac
+ cat <<\_ACEOF
+
+ Optional Features:
++ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+@@ -855,7 +1370,7 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+- --with-libpng=prefix include support for png output (if libpng is
++ --with-libpng=prefix include support for png output (if libpng is
+ available)
+
+ Some influential environment variables:
+@@ -863,8 +1378,9 @@ Some influential environment variables:
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+- headers in a nonstandard directory <include dir>
++ LIBS libraries to pass to the linker, e.g. -l<library>
++ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
++ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+ Use these variables to override the choices made by `configure' or to help
+@@ -872,120 +1388,88 @@ it to find libraries and programs with nonstandard names/locations.
+
+ Report bugs to <jbig2-dev@ghostscript.com>.
+ _ACEOF
++ac_status=$?
+ fi
+
+ if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+- ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+- test -d $ac_dir || continue
++ test -d "$ac_dir" ||
++ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
++ continue
+ ac_builddir=.
+
+-if test "$ac_dir" != .; then
+- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+- # A "../" for each directory in $ac_dir_suffix.
+- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+-else
+- ac_dir_suffix= ac_top_builddir=
+-fi
++case "$ac_dir" in
++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
++*)
++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
++ # A ".." for each directory in $ac_dir_suffix.
++ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
++ case $ac_top_builddir_sub in
++ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
++ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
++ esac ;;
++esac
++ac_abs_top_builddir=$ac_pwd
++ac_abs_builddir=$ac_pwd$ac_dir_suffix
++# for backward compatibility:
++ac_top_builddir=$ac_top_build_prefix
+
+ case $srcdir in
+- .) # No --srcdir option. We are building in place.
++ .) # We are building in place.
+ ac_srcdir=.
+- if test -z "$ac_top_builddir"; then
+- ac_top_srcdir=.
+- else
+- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+- fi ;;
+- [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_top_srcdir=$ac_top_builddir_sub
++ ac_abs_top_srcdir=$ac_pwd ;;
++ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+- ac_top_srcdir=$srcdir ;;
+- *) # Relative path.
+- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+-esac
+-
+-# Do not use `cd foo && pwd` to compute absolute paths, because
+-# the directories may not exist.
+-case `pwd` in
+-.) ac_abs_builddir="$ac_dir";;
+-*)
+- case "$ac_dir" in
+- .) ac_abs_builddir=`pwd`;;
+- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+- *) ac_abs_builddir=`pwd`/"$ac_dir";;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_builddir=${ac_top_builddir}.;;
+-*)
+- case ${ac_top_builddir}. in
+- .) ac_abs_top_builddir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_srcdir=$ac_srcdir;;
+-*)
+- case $ac_srcdir in
+- .) ac_abs_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+- esac;;
++ ac_top_srcdir=$srcdir
++ ac_abs_top_srcdir=$srcdir ;;
++ *) # Relative name.
++ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_build_prefix$srcdir
++ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_srcdir=$ac_top_srcdir;;
+-*)
+- case $ac_top_srcdir in
+- .) ac_abs_top_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+- esac;;
+-esac
+-
+- cd $ac_dir
+- # Check for guested configure; otherwise get Cygnus style configure.
+- if test -f $ac_srcdir/configure.gnu; then
+- echo
+- $SHELL $ac_srcdir/configure.gnu --help=recursive
+- elif test -f $ac_srcdir/configure; then
+- echo
+- $SHELL $ac_srcdir/configure --help=recursive
+- elif test -f $ac_srcdir/configure.ac ||
+- test -f $ac_srcdir/configure.in; then
+- echo
+- $ac_configure --help
++ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
++
++ cd "$ac_dir" || { ac_status=$?; continue; }
++ # Check for guested configure.
++ if test -f "$ac_srcdir/configure.gnu"; then
++ echo &&
++ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
++ elif test -f "$ac_srcdir/configure"; then
++ echo &&
++ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+- fi
+- cd $ac_popdir
++ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ fi || ac_status=$?
++ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+ fi
+
+-test -n "$ac_init_help" && exit 0
++test -n "$ac_init_help" && exit $ac_status
+ if $ac_init_version; then
+ cat <<\_ACEOF
+-jbig2dec configure 0.9pre
+-generated by GNU Autoconf 2.59
++jbig2dec configure 0.10
++generated by GNU Autoconf 2.63
+
+-Copyright (C) 2003 Free Software Foundation, Inc.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+ _ACEOF
+- exit 0
++ exit
+ fi
+-exec 5>config.log
+-cat >&5 <<_ACEOF
++cat >config.log <<_ACEOF
+ This file contains any messages produced by compilers while
+ running configure, to aid debugging if configure makes a mistake.
+
+-It was created by jbig2dec $as_me 0.9pre, which was
+-generated by GNU Autoconf 2.59. Invocation command line was
++It was created by jbig2dec $as_me 0.10, which was
++generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+ _ACEOF
++exec 5>>config.log
+ {
+ cat <<_ASUNAME
+ ## --------- ##
+@@ -1004,7 +1488,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
+ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+ /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+ /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
++/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+ /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+ /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+@@ -1016,8 +1500,9 @@ for as_dir in $PATH
+ do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+- echo "PATH: $as_dir"
++ $as_echo "PATH: $as_dir"
+ done
++IFS=$as_save_IFS
+
+ } >&5
+
+@@ -1039,7 +1524,6 @@ _ACEOF
+ ac_configure_args=
+ ac_configure_args0=
+ ac_configure_args1=
+-ac_sep=
+ ac_must_keep_next=false
+ for ac_pass in 1 2
+ do
+@@ -1050,8 +1534,8 @@ do
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ *\'*)
++ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+@@ -1072,9 +1556,7 @@ do
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+- # Get rid of the leading space.
+- ac_sep=" "
++ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+@@ -1085,8 +1567,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
+ # When interrupted or exit'd, cleanup temporary files, and complete
+ # config.log. We remove comments because anyway the quotes in there
+ # would cause problems or look ugly.
+-# WARNING: Be sure not to use single quotes in there, as some shells,
+-# such as our DU 5.0 friend, will then `close' the trap.
++# WARNING: Use '\'' to represent an apostrophe within the trap.
++# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+ trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+@@ -1099,20 +1581,35 @@ trap 'exit_status=$?
+ _ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+-{
++(
++ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
++ eval ac_val=\$$ac_var
++ case $ac_val in #(
++ *${as_nl}*)
++ case $ac_var in #(
++ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
++$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
++ esac
++ case $ac_var in #(
++ _ | IFS | as_nl) ;; #(
++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
++ *) $as_unset $ac_var ;;
++ esac ;;
++ esac
++ done
+ (set) 2>&1 |
+- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+- *ac_space=\ *)
++ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
++ *${as_nl}ac_space=\ *)
+ sed -n \
+- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+- ;;
++ "s/'\''/'\''\\\\'\'''\''/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
++ ;; #(
+ *)
+- sed -n \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+- esac;
+-}
++ esac |
++ sort
++)
+ echo
+
+ cat <<\_ASBOX
+@@ -1123,22 +1620,28 @@ _ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+- eval ac_val=$`echo $ac_var`
+- echo "$ac_var='"'"'$ac_val'"'"'"
++ eval ac_val=\$$ac_var
++ case $ac_val in
++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
++ esac
++ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+-## ------------- ##
+-## Output files. ##
+-## ------------- ##
++## ------------------- ##
++## File substitutions. ##
++## ------------------- ##
+ _ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+- eval ac_val=$`echo $ac_var`
+- echo "$ac_var='"'"'$ac_val'"'"'"
++ eval ac_val=\$$ac_var
++ case $ac_val in
++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
++ esac
++ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+@@ -1150,26 +1653,24 @@ _ASBOX
+ ## ----------- ##
+ _ASBOX
+ echo
+- sed "/^$/d" confdefs.h | sort
++ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+- echo "$as_me: caught signal $ac_signal"
+- echo "$as_me: exit $exit_status"
++ $as_echo "$as_me: caught signal $ac_signal"
++ $as_echo "$as_me: exit $exit_status"
+ } >&5
+- rm -f core *.core &&
+- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++ rm -f core *.core core.conftest.* &&
++ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+- ' 0
++' 0
+ for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+ done
+ ac_signal=0
+
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+-rm -rf conftest* confdefs.h
+-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+-echo >confdefs.h
++rm -f -r conftest* confdefs.h
+
+ # Predefined preprocessor variables.
+
+@@ -1199,18 +1700,24 @@ _ACEOF
+
+
+ # Let the site file select an alternate cache file if it wants to.
+-# Prefer explicitly selected file to automatically selected ones.
+-if test -z "$CONFIG_SITE"; then
+- if test "x$prefix" != xNONE; then
+- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+- else
+- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+- fi
+-fi
+-for ac_site_file in $CONFIG_SITE; do
++# Prefer an explicitly selected file to automatically selected ones.
++ac_site_file1=NONE
++ac_site_file2=NONE
++if test -n "$CONFIG_SITE"; then
++ ac_site_file1=$CONFIG_SITE
++elif test "x$prefix" != xNONE; then
++ ac_site_file1=$prefix/share/config.site
++ ac_site_file2=$prefix/etc/config.site
++else
++ ac_site_file1=$ac_default_prefix/share/config.site
++ ac_site_file2=$ac_default_prefix/etc/config.site
++fi
++for ac_site_file in "$ac_site_file1" "$ac_site_file2"
++do
++ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+-echo "$as_me: loading site script $ac_site_file" >&6;}
++ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+@@ -1220,54 +1727,61 @@ if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+-echo "$as_me: loading cache $cache_file" >&6;}
++ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
++$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+- [\\/]* | ?:[\\/]* ) . $cache_file;;
+- *) . ./$cache_file;;
++ [\\/]* | ?:[\\/]* ) . "$cache_file";;
++ *) . "./$cache_file";;
+ esac
+ fi
+ else
+- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+-echo "$as_me: creating cache $cache_file" >&6;}
++ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
++$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+ fi
+
+ # Check that the precious variables saved in the cache have kept the same
+ # value.
+ ac_cache_corrupted=false
+-for ac_var in `(set) 2>&1 |
+- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+- eval ac_new_val="\$ac_env_${ac_var}_value"
++ eval ac_old_val=\$ac_cv_env_${ac_var}_value
++ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
++ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+-echo "$as_me: former value: $ac_old_val" >&2;}
+- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+-echo "$as_me: current value: $ac_new_val" >&2;}
+- ac_cache_corrupted=:
++ # differences in whitespace do not lead to failure.
++ ac_old_val_w=`echo x $ac_old_val`
++ ac_new_val_w=`echo x $ac_new_val`
++ if test "$ac_old_val_w" != "$ac_new_val_w"; then
++ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++ ac_cache_corrupted=:
++ else
++ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
++$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
++ eval $ac_var=\$ac_old_val
++ fi
++ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
++$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
++ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
++$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
++ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+@@ -1277,18 +1791,15 @@ echo "$as_me: current value: $ac_new_val" >&2;}
+ fi
+ done
+ if $ac_cache_corrupted; then
+- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+-ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+@@ -1313,37 +1824,48 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
++am__api_version='1.10'
+
+-am__api_version="1.9"
+ ac_aux_dir=
+-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+- if test -f $ac_dir/install-sh; then
++for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
++ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+- elif test -f $ac_dir/install.sh; then
++ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+- elif test -f $ac_dir/shtool; then
++ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
++ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
++$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
++
++# These three variables are undocumented and unsupported,
++# and are intended to be withdrawn in a future Autoconf release.
++# They can cause serious problems if a builder's source tree is in a directory
++# whose full name contains unusual characters.
++ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
++ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
++ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
++
+
+ # Find a good install program. We prefer a C program (faster),
+ # so one script is as good as another. But avoid the broken or
+@@ -1358,11 +1880,12 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # OS/2's system install, which has a completely different semantic
+ # ./install, which can be erroneously created by make from ./install.sh.
+-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++# Reject install programs that cannot install multiple files.
++{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++$as_echo_n "checking for a BSD-compatible install... " >&6; }
+ if test -z "$INSTALL"; then
+ if test "${ac_cv_path_install+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+@@ -1381,7 +1904,7 @@ case $as_dir/ in
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+@@ -1391,30 +1914,43 @@ case $as_dir/ in
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
++ rm -rf conftest.one conftest.two conftest.dir
++ echo one > conftest.one
++ echo two > conftest.two
++ mkdir conftest.dir
++ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
++ test -s conftest.one && test -s conftest.two &&
++ test -s conftest.dir/conftest.one &&
++ test -s conftest.dir/conftest.two
++ then
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
+ fi
+ fi
+ done
+ done
+ ;;
+ esac
++
+ done
++IFS=$as_save_IFS
+
++rm -rf conftest.one conftest.two conftest.dir
+
+ fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+- # As a last resort, use the slow shell script. We don't cache a
+- # path for INSTALL within a source directory, because that will
++ # As a last resort, use the slow shell script. Don't cache a
++ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+- # removed, or if the path is relative.
++ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+ fi
+-echo "$as_me:$LINENO: result: $INSTALL" >&5
+-echo "${ECHO_T}$INSTALL" >&6
++{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
++$as_echo "$INSTALL" >&6; }
+
+ # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+ # It thinks the first close brace ends the variable substitution.
+@@ -1424,8 +1960,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++$as_echo_n "checking whether build environment is sane... " >&6; }
+ # Just in case
+ sleep 1
+ echo timestamp > conftest.file
+@@ -1448,9 +1984,9 @@ if (
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" >&5
+-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+@@ -1461,26 +1997,23 @@ then
+ # Ok.
+ :
+ else
+- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+ Check your system clock" >&5
+-echo "$as_me: error: newly created file is older than distributed files!
++$as_echo "$as_me: error: newly created file is older than distributed files!
+ Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+-echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6
++{ $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ test "$program_prefix" != NONE &&
+- program_transform_name="s,^,$program_prefix,;$program_transform_name"
++ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+ # Use a double $ so make ignores it.
+ test "$program_suffix" != NONE &&
+- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+-# Double any \ or $. echo might interpret backslashes.
++ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
++# Double any \ or $.
+ # By default was `s,x,x', remove it if useless.
+-cat <<\_ACEOF >conftest.sed
+-s/[\\$]/&&/g;s/;s,x,x,$//
+-_ACEOF
+-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+-rm conftest.sed
++ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
++program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+ # expand $ac_aux_dir to an absolute path
+ am_aux_dir=`cd $ac_aux_dir && pwd`
+@@ -1491,51 +2024,66 @@ if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+ else
+ am_missing_run=
+- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+-fi
+-
+-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+- # We used to keeping the `.' as first argument, in order to
+- # allow $(mkdir_p) to be used without argument. As in
+- # $(mkdir_p) $(somedir)
+- # where $(somedir) is conditionally defined. However this is wrong
+- # for two reasons:
+- # 1. if the package is installed by a user who cannot write `.'
+- # make install will fail,
+- # 2. the above comment should most certainly read
+- # $(mkdir_p) $(DESTDIR)$(somedir)
+- # so it does not work when $(somedir) is undefined and
+- # $(DESTDIR) is not.
+- # To support the latter case, we have to write
+- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+- # so the `.' trick is pointless.
+- mkdir_p='mkdir -p --'
+-else
+- # On NextStep and OpenStep, the `mkdir' command does not
+- # recognize any option. It will interpret all options as
+- # directories to create, and then abort because `.' already
+- # exists.
+- for d in ./-p ./--version;
+- do
+- test -d $d && rmdir $d
+- done
+- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+- if test -f "$ac_aux_dir/mkinstalldirs"; then
+- mkdir_p='$(mkinstalldirs)'
++ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
++$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
++fi
++
++{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
++$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
++if test -z "$MKDIR_P"; then
++ if test "${ac_cv_path_mkdir+set}" = set; then
++ $as_echo_n "(cached) " >&6
++else
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_prog in mkdir gmkdir; do
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
++ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
++ 'mkdir (GNU coreutils) '* | \
++ 'mkdir (coreutils) '* | \
++ 'mkdir (fileutils) '4.1*)
++ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
++ break 3;;
++ esac
++ done
++ done
++done
++IFS=$as_save_IFS
++
++fi
++
++ if test "${ac_cv_path_mkdir+set}" = set; then
++ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+- mkdir_p='$(install_sh) -d'
++ # As a last resort, use the slow shell script. Don't cache a
++ # value for MKDIR_P within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the value is a relative name.
++ test -d ./--version && rmdir ./--version
++ MKDIR_P="$ac_install_sh -d"
+ fi
+ fi
++{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
++$as_echo "$MKDIR_P" >&6; }
++
++mkdir_p="$MKDIR_P"
++case $mkdir_p in
++ [\\/$]* | ?:[\\/]*) ;;
++ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
++esac
+
+ for ac_prog in gawk mawk nawk awk
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AWK+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+@@ -1546,54 +2094,58 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ AWK=$ac_cv_prog_AWK
+ if test -n "$AWK"; then
+- echo "$as_me:$LINENO: result: $AWK" >&5
+-echo "${ECHO_T}$AWK" >&6
++ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
++$as_echo "$AWK" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ test -n "$AWK" && break
+ done
+
+-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
++set x ${MAKE-make}
++ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
++if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.make <<\_ACEOF
++SHELL = /bin/sh
+ all:
+- @echo 'ac_maketemp="$(MAKE)"'
++ @echo '@@@%%%=$(MAKE)=@@@%%%'
+ _ACEOF
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+-if test -n "$ac_maketemp"; then
+- eval ac_cv_prog_make_${ac_make}_set=yes
+-else
+- eval ac_cv_prog_make_${ac_make}_set=no
+-fi
++case `${MAKE-make} -f conftest.make 2>/dev/null` in
++ *@@@%%%=?*=@@@%%%*)
++ eval ac_cv_prog_make_${ac_make}_set=yes;;
++ *)
++ eval ac_cv_prog_make_${ac_make}_set=no;;
++esac
+ rm -f conftest.make
+ fi
+-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+- echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6
++if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ SET_MAKE=
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+ fi
+
+@@ -1606,12 +2158,16 @@ else
+ fi
+ rmdir .tst 2>/dev/null
+
+-# test to see if srcdir already configured
+-if test "`cd $srcdir && pwd`" != "`pwd`" &&
+- test -f $srcdir/config.status; then
+- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++if test "`cd $srcdir && pwd`" != "`pwd`"; then
++ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
++ # is not polluted with repeated "-I."
++ am__isrc=' -I$(srcdir)'
++ # test to see if srcdir already configured
++ if test -f $srcdir/config.status; then
++ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
++ fi
+ fi
+
+ # test whether we have cygpath
+@@ -1626,7 +2182,7 @@ fi
+
+ # Define the identity of the package.
+ PACKAGE='jbig2dec'
+- VERSION='0.9pre'
++ VERSION='0.10'
+
+
+ cat >>confdefs.h <<_ACEOF
+@@ -1654,7 +2210,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+-install_sh=${install_sh-"$am_aux_dir/install-sh"}
++install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+ # Installed binaries are usually stripped using `strip' when the user
+ # run `make install-strip'. However `strip' might not be the right
+@@ -1664,10 +2220,10 @@ if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_STRIP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+@@ -1678,34 +2234,36 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ STRIP=$ac_cv_prog_STRIP
+ if test -n "$STRIP"; then
+- echo "$as_me:$LINENO: result: $STRIP" >&5
+-echo "${ECHO_T}$STRIP" >&6
++ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
++$as_echo "$STRIP" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ fi
+ if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+ set dummy strip; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+@@ -1716,33 +2274,43 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+ fi
+ fi
+ ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+ if test -n "$ac_ct_STRIP"; then
+- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+-echo "${ECHO_T}$ac_ct_STRIP" >&6
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++$as_echo "$ac_ct_STRIP" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+- STRIP=$ac_ct_STRIP
++ if test "x$ac_ct_STRIP" = x; then
++ STRIP=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ STRIP=$ac_ct_STRIP
++ fi
+ else
+ STRIP="$ac_cv_prog_STRIP"
+ fi
+
+ fi
+-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+ # We need awk for the "check" target. The system "awk" is bad on
+ # some platforms.
+@@ -1756,8 +2324,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+- ac_config_headers="$ac_config_headers config.h"
+-
++ac_config_headers="$ac_config_headers config.h"
+
+
+ # Checks for programs.
+@@ -1769,10 +2336,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}gcc; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -1783,34 +2350,36 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ fi
+ if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+@@ -1821,38 +2390,49 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ ac_ct_CC=$ac_cv_prog_ac_ct_CC
+ if test -n "$ac_ct_CC"; then
+- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+-echo "${ECHO_T}$ac_ct_CC" >&6
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++$as_echo "$ac_ct_CC" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+- CC=$ac_ct_CC
++ if test "x$ac_ct_CC" = x; then
++ CC=""
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ CC=$ac_ct_CC
++ fi
+ else
+ CC="$ac_cv_prog_CC"
+ fi
+
+ if test -z "$CC"; then
+- if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}cc; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -1863,76 +2443,36 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6
+-else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
+-fi
+-
+-fi
+-if test -z "$ac_cv_prog_CC"; then
+- ac_ct_CC=$CC
+- # Extract the first word of "cc", so it can be a program name with args.
+-set dummy cc; 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_ac_ct_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- if test -n "$ac_ct_CC"; then
+- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_ac_ct_CC="cc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+-done
+-
+-fi
+-fi
+-ac_ct_CC=$ac_cv_prog_ac_ct_CC
+-if test -n "$ac_ct_CC"; then
+- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+-echo "${ECHO_T}$ac_ct_CC" >&6
+-else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+- CC=$ac_ct_CC
+-else
+- CC="$ac_cv_prog_CC"
+-fi
+
++ fi
+ fi
+ if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -1944,17 +2484,18 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+@@ -1972,24 +2513,25 @@ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ fi
+ if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+- for ac_prog in cl
++ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+ set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -2000,38 +2542,40 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ test -n "$CC" && break
+ done
+ fi
+ if test -z "$CC"; then
+ ac_ct_CC=$CC
+- for ac_prog in cl
++ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+@@ -2042,58 +2586,90 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ ac_ct_CC=$ac_cv_prog_ac_ct_CC
+ if test -n "$ac_ct_CC"; then
+- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+-echo "${ECHO_T}$ac_ct_CC" >&6
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++$as_echo "$ac_ct_CC" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ test -n "$ac_ct_CC" && break
+ done
+
+- CC=$ac_ct_CC
++ if test "x$ac_ct_CC" = x; then
++ CC=""
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ CC=$ac_ct_CC
++ fi
+ fi
+
+ fi
+
+
+-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: no acceptable C compiler found in \$PATH
++$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }; }
+
+ # Provide some information about the compiler.
+-echo "$as_me:$LINENO:" \
+- "checking for C compiler version" >&5
+-ac_compiler=`set X $ac_compile; echo $2`
+-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+- (eval $ac_compiler --version </dev/null >&5) 2>&5
++$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
++set X $ac_compile
++ac_compiler=$2
++{ (ac_try="$ac_compiler --version >&5"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+- (eval $ac_compiler -v </dev/null >&5) 2>&5
++{ (ac_try="$ac_compiler -v >&5"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+- (eval $ac_compiler -V </dev/null >&5) 2>&5
++{ (ac_try="$ac_compiler -V >&5"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -2112,111 +2688,150 @@ main ()
+ }
+ _ACEOF
+ ac_clean_files_save=$ac_clean_files
+-ac_clean_files="$ac_clean_files a.out a.exe b.out"
++ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+ # Try to create an executable without -o first, disregard a.out.
+ # It will help us diagnose broken compilers, and finding out an intuition
+ # of exeext.
+-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+- (eval $ac_link_default) 2>&5
++{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++$as_echo_n "checking for C compiler default output file name... " >&6; }
++ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
++
++# The possible output files:
++ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
++
++ac_rmfiles=
++for ac_file in $ac_files
++do
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
++ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
++ esac
++done
++rm -f $ac_rmfiles
++
++if { (ac_try="$ac_link_default"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+- # Find the output, starting from the most likely. This scheme is
+-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+-# resort.
+-
+-# Be careful to initialize this variable, since it used to be cached.
+-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+-ac_cv_exeext=
+-# b.out is created by i960 compilers.
+-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
++ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
++# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
++# in a Makefile. We should not override ac_cv_exeext if it was cached,
++# so that the user can short-circuit this test for compilers unknown to
++# Autoconf.
++for ac_file in $ac_files ''
+ do
+ test -f "$ac_file" || continue
+ case $ac_file in
+- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+- ;;
+- conftest.$ac_ext )
+- # This is the source file.
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- # FIXME: I believe we export ac_cv_exeext for Libtool,
+- # but it would be cool to find out if it's true. Does anybody
+- # maintain Libtool? --akim.
+- export ac_cv_exeext
++ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
++ then :; else
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ fi
++ # We set ac_cv_exeext here because the later test for it is not
++ # safe: cross compilers may not add the suffix if given an `-o'
++ # argument, so we may need to know it at that point already.
++ # Even if this section looks crufty: it has the advantage of
++ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+ done
++test "$ac_cv_exeext" = no && ac_cv_exeext=
++
+ else
+- echo "$as_me: failed program was:" >&5
++ ac_file=''
++fi
++
++{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
++$as_echo "$ac_file" >&6; }
++if test -z "$ac_file"; then
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: C compiler cannot create executables
++$as_echo "$as_me: error: C compiler cannot create executables
+ See \`config.log' for more details." >&2;}
+- { (exit 77); exit 77; }; }
++ { (exit 77); exit 77; }; }; }
+ fi
+
+ ac_exeext=$ac_cv_exeext
+-echo "$as_me:$LINENO: result: $ac_file" >&5
+-echo "${ECHO_T}$ac_file" >&6
+
+-# Check the compiler produces executables we can run. If not, either
++# Check that the compiler produces executables we can run. If not, either
+ # the compiler is broken, or we cross compile.
+-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++$as_echo_n "checking whether the C compiler works... " >&6; }
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+ if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run C compiled programs.
++$as_echo "$as_me: error: cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }; }
+ fi
+ fi
+ fi
+-echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6
++{ $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+
+-rm -f a.out a.exe conftest$ac_cv_exeext b.out
++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ ac_clean_files=$ac_clean_files_save
+-# Check the compiler produces executables we can run. If not, either
++# Check that the compiler produces executables we can run. If not, either
+ # the compiler is broken, or we cross compile.
+-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+-echo "$as_me:$LINENO: result: $cross_compiling" >&5
+-echo "${ECHO_T}$cross_compiling" >&6
+-
+-echo "$as_me:$LINENO: checking for suffix of executables" >&5
+-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++$as_echo_n "checking whether we are cross compiling... " >&6; }
++{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
++$as_echo "$cross_compiling" >&6; }
++
++{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
++$as_echo_n "checking for suffix of executables... " >&6; }
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+ # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+@@ -2225,32 +2840,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+ done
+ else
+- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }; }
+ fi
+
+ rm -f conftest$ac_cv_exeext
+-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+-echo "${ECHO_T}$ac_cv_exeext" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++$as_echo "$ac_cv_exeext" >&6; }
+
+ rm -f conftest.$ac_ext
+ EXEEXT=$ac_cv_exeext
+ ac_exeext=$EXEEXT
+-echo "$as_me:$LINENO: checking for suffix of object files" >&5
+-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
++$as_echo_n "checking for suffix of object files... " >&6; }
+ if test "${ac_cv_objext+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -2268,39 +2884,48 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest.o conftest.obj
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
++ for ac_file in conftest.o conftest.obj conftest.*; do
++ test -f "$ac_file" || continue;
+ case $ac_file in
+- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute suffix of object files: cannot compile
++$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }; }
+ fi
+
+ rm -f conftest.$ac_cv_objext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+-echo "${ECHO_T}$ac_cv_objext" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++$as_echo "$ac_cv_objext" >&6; }
+ OBJEXT=$ac_cv_objext
+ ac_objext=$OBJEXT
+-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
++$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+ if test "${ac_cv_c_compiler_gnu+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -2321,50 +2946,54 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_compiler_gnu=no
++ ac_compiler_gnu=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+-GCC=`test $ac_compiler_gnu = yes && echo yes`
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++$as_echo "$ac_cv_c_compiler_gnu" >&6; }
++if test $ac_compiler_gnu = yes; then
++ GCC=yes
++else
++ GCC=
++fi
+ ac_test_CFLAGS=${CFLAGS+set}
+ ac_save_CFLAGS=$CFLAGS
+-CFLAGS="-g"
+-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++$as_echo_n "checking whether $CC accepts -g... " >&6; }
+ if test "${ac_cv_prog_cc_g+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- cat >conftest.$ac_ext <<_ACEOF
++ ac_save_c_werror_flag=$ac_c_werror_flag
++ ac_c_werror_flag=yes
++ ac_cv_prog_cc_g=no
++ CFLAGS="-g"
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2380,38 +3009,121 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ ac_cv_prog_cc_g=yes
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ CFLAGS=""
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ :
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_c_werror_flag=$ac_save_c_werror_flag
++ CFLAGS="-g"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_prog_cc_g=no
++
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ ac_c_werror_flag=$ac_save_c_werror_flag
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++$as_echo "$ac_cv_prog_cc_g" >&6; }
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+ elif test $ac_cv_prog_cc_g = yes; then
+@@ -2427,12 +3139,12 @@ else
+ CFLAGS=
+ fi
+ fi
+-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
++$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
++if test "${ac_cv_prog_cc_c89+set}" = set; then
++ $as_echo_n "(cached) " >&6
+ else
+- ac_cv_prog_cc_stdc=no
++ ac_cv_prog_cc_c89=no
+ ac_save_CC=$CC
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -2466,12 +3178,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
+ /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+- as 'x'. The following induces an error, until -std1 is added to get
++ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+- that's true only with -std1. */
++ that's true only with -std. */
+ int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
++/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
++ inside strings and character constants. */
++#define FOO(x) 'x'
++int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
++
+ int test (int i, double x);
+ struct s1 {int (*f) (int a);};
+ struct s2 {int (*f) (double a);};
+@@ -2486,205 +3203,58 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ return 0;
+ }
+ _ACEOF
+-# Don't try gcc -ansi; that turns off useful extensions and
+-# breaks some systems' header files.
+-# AIX -qlanglvl=ansi
+-# Ultrix and OSF/1 -std1
+-# HP-UX 10.20 and later -Ae
+-# HP-UX older versions -Aa -D_HPUX_SOURCE
+-# SVR4 -Xc -D__EXTENSIONS__
+-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
++for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
++ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+ do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_prog_cc_stdc=$ac_arg
+-break
+-else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ ac_cv_prog_cc_c89=$ac_arg
++else
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
++
+ fi
+-rm -f conftest.err conftest.$ac_objext
++
++rm -f core conftest.err conftest.$ac_objext
++ test "x$ac_cv_prog_cc_c89" != "xno" && break
+ done
+-rm -f conftest.$ac_ext conftest.$ac_objext
++rm -f conftest.$ac_ext
+ CC=$ac_save_CC
+
+ fi
+-
+-case "x$ac_cv_prog_cc_stdc" in
+- x|xno)
+- echo "$as_me:$LINENO: result: none needed" >&5
+-echo "${ECHO_T}none needed" >&6 ;;
++# AC_CACHE_VAL
++case "x$ac_cv_prog_cc_c89" in
++ x)
++ { $as_echo "$as_me:$LINENO: result: none needed" >&5
++$as_echo "none needed" >&6; } ;;
++ xno)
++ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
++$as_echo "unsupported" >&6; } ;;
+ *)
+- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+- CC="$CC $ac_cv_prog_cc_stdc" ;;
++ CC="$CC $ac_cv_prog_cc_c89"
++ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
++$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+ esac
+
+-# Some people use a C++ compiler to compile C. Since we use `exit',
+-# in C++ we need to declare it. In case someone uses the same compiler
+-# for both compiling C and C++ we need to have the C++ compiler decide
+-# the declaration of exit, since it's the most demanding environment.
+-cat >conftest.$ac_ext <<_ACEOF
+-#ifndef __cplusplus
+- choke me
+-#endif
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- for ac_declaration in \
+- '' \
+- 'extern "C" void std::exit (int) throw (); using std::exit;' \
+- 'extern "C" void std::exit (int); using std::exit;' \
+- 'extern "C" void exit (int) throw ();' \
+- 'extern "C" void exit (int);' \
+- 'void exit (int);'
+-do
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_declaration
+-#include <stdlib.h>
+-int
+-main ()
+-{
+-exit (42);
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- :
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-continue
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_declaration
+-int
+-main ()
+-{
+-exit (42);
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- break
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-done
+-rm -f conftest*
+-if test -n "$ac_declaration"; then
+- echo '#ifdef __cplusplus' >>confdefs.h
+- echo $ac_declaration >>confdefs.h
+- echo '#endif' >>confdefs.h
+-fi
+-
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -2692,7 +3262,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ DEPDIR="${am__leading_dot}deps"
+
+- ac_config_commands="$ac_config_commands depfiles"
++ac_config_commands="$ac_config_commands depfiles"
+
+
+ am_make=${MAKE-make}
+@@ -2702,8 +3272,8 @@ am__doit:
+ .PHONY: am__doit
+ END
+ # If we don't find an include directive, just comment out the code.
+-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
++$as_echo_n "checking for style of include used by $am_make... " >&6; }
+ am__include="#"
+ am__quote=
+ _am_result=none
+@@ -2730,22 +3300,20 @@ if test "$am__include" = "#"; then
+ fi
+
+
+-echo "$as_me:$LINENO: result: $_am_result" >&5
+-echo "${ECHO_T}$_am_result" >&6
++{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
++$as_echo "$_am_result" >&6; }
+ rm -f confinc confmf
+
+-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
++# Check whether --enable-dependency-tracking was given.
+ if test "${enable_dependency_tracking+set}" = set; then
+- enableval="$enable_dependency_tracking"
++ enableval=$enable_dependency_tracking;
++fi
+
+-fi;
+ if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ fi
+-
+-
+-if test "x$enable_dependency_tracking" != xno; then
++ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+ else
+@@ -2755,13 +3323,12 @@ fi
+
+
+
+-
+ depcc="$CC" am_compiler_list=
+
+-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
++$as_echo_n "checking dependency style of $depcc... " >&6; }
+ if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+@@ -2823,6 +3390,7 @@ else
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
++ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+@@ -2848,13 +3416,11 @@ else
+ fi
+
+ fi
+-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
++{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
++$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+ CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+-
+-
+-if
++ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+@@ -2865,13 +3431,145 @@ else
+ fi
+
+
++if test "x$CC" != xcc; then
++ { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
++$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
++else
++ { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
++$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
++fi
++set dummy $CC; ac_cc=`$as_echo "$2" |
++ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
++if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++# Make sure it works both with $CC and with simple cc.
++# We do the test twice because some compilers refuse to overwrite an
++# existing .o file with -o, though they will create one.
++ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
++rm -f conftest2.*
++if { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ test -f conftest2.$ac_objext && { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); };
++then
++ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
++ if test "x$CC" != xcc; then
++ # Test first that cc exists at all.
++ if { ac_try='cc -c conftest.$ac_ext >&5'
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
++ rm -f conftest2.*
++ if { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ test -f conftest2.$ac_objext && { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); };
++ then
++ # cc works too.
++ :
++ else
++ # cc exists but doesn't like -o.
++ eval ac_cv_prog_cc_${ac_cc}_c_o=no
++ fi
++ fi
++ fi
++else
++ eval ac_cv_prog_cc_${ac_cc}_c_o=no
++fi
++rm -f core conftest*
++
++fi
++if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
++else
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
++
++cat >>confdefs.h <<\_ACEOF
++#define NO_MINUS_C_MINUS_O 1
++_ACEOF
++
++fi
++
++# FIXME: we rely on the cache variable name because
++# there is no other way.
++set dummy $CC
++am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
++eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
++if test "$am_t" != yes; then
++ # Losing compiler, so override with the script.
++ # FIXME: It is wrong to rewrite CC.
++ # But if we don't then we get into trouble of one sort or another.
++ # A longer-term fix would be to have automake use am__CC in this case,
++ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
++ CC="$am_aux_dir/compile $CC"
++fi
++
++
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_RANLIB+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+@@ -2882,34 +3580,36 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+ fi
+ fi
+ RANLIB=$ac_cv_prog_RANLIB
+ if test -n "$RANLIB"; then
+- echo "$as_me:$LINENO: result: $RANLIB" >&5
+-echo "${ECHO_T}$RANLIB" >&6
++ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
++$as_echo "$RANLIB" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
++
+ fi
+ if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+ set dummy ranlib; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+@@ -2920,27 +3620,37 @@ 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
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+ done
++IFS=$as_save_IFS
+
+- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+ fi
+ fi
+ ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+ if test -n "$ac_ct_RANLIB"; then
+- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+-echo "${ECHO_T}$ac_ct_RANLIB" >&6
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++$as_echo "$ac_ct_RANLIB" >&6; }
+ else
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+- RANLIB=$ac_ct_RANLIB
++ if test "x$ac_ct_RANLIB" = x; then
++ RANLIB=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ RANLIB=$ac_ct_RANLIB
++ fi
+ else
+ RANLIB="$ac_cv_prog_RANLIB"
+ fi
+@@ -2953,13 +3663,13 @@ fi
+
+ # Checks for libraries.
+
+-# Check whether --with-libpng or --without-libpng was given.
++# Check whether --with-libpng was given.
+ if test "${with_libpng+set}" = set; then
+- withval="$with_libpng"
+- ac_cv_want_libpng="$withval"
++ withval=$with_libpng; ac_cv_want_libpng="$withval"
+ else
+ ac_cv_want_libpng="yes"
+-fi;
++fi
++
+ save_cflags="$CFLAGS"
+ save_ldflags="$LDFLAGS"
+ have_libpng="no"
+@@ -2969,13 +3679,12 @@ if test "x$ac_cv_want_libpng" != "xno"; then
+ LDFLAGS="$LDFLAGS -L$ac_cv_want_libpng/lib"
+ fi
+
+-echo "$as_me:$LINENO: checking for library containing pow" >&5
+-echo $ECHO_N "checking for library containing pow... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for library containing pow" >&5
++$as_echo_n "checking for library containing pow... " >&6; }
+ if test "${ac_cv_search_pow+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+-ac_cv_search_pow=no
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -2983,122 +3692,84 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char pow ();
+ int
+ main ()
+ {
+-pow ();
++return pow ();
+ ;
+ return 0;
+ }
+ _ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++for ac_lib in '' m; do
++ if test -z "$ac_lib"; then
++ ac_res="none required"
++ else
++ ac_res=-l$ac_lib
++ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
++ fi
++ rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_search_pow="none required"
+-else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
++ ac_cv_search_pow=$ac_res
++else
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-fi
+-rm -f conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-if test "$ac_cv_search_pow" = no; then
+- for ac_lib in m; do
+- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+
+-/* Override any gcc2 internal prototype to avoid an error. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char pow ();
+-int
+-main ()
+-{
+-pow ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_search_pow="-l$ac_lib"
+-break
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
++fi
+
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++ conftest$ac_exeext
++ if test "${ac_cv_search_pow+set}" = set; then
++ break
+ fi
+-rm -f conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+- done
++done
++if test "${ac_cv_search_pow+set}" = set; then
++ :
++else
++ ac_cv_search_pow=no
+ fi
++rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5
+-echo "${ECHO_T}$ac_cv_search_pow" >&6
+-if test "$ac_cv_search_pow" != no; then
+- test "$ac_cv_search_pow" = "none required" || LIBS="$ac_cv_search_pow $LIBS"
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5
++$as_echo "$ac_cv_search_pow" >&6; }
++ac_res=$ac_cv_search_pow
++if test "$ac_res" != no; then
++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ fi
+
+- echo "$as_me:$LINENO: checking for png_check_sig in -lpng" >&5
+-echo $ECHO_N "checking for png_check_sig in -lpng... $ECHO_C" >&6
++ { $as_echo "$as_me:$LINENO: checking for png_check_sig in -lpng" >&5
++$as_echo_n "checking for png_check_sig in -lpng... " >&6; }
+ if test "${ac_cv_lib_png_png_check_sig+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lpng $LIBS"
+@@ -3109,62 +3780,63 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char png_check_sig ();
+ int
+ main ()
+ {
+-png_check_sig ();
++return png_check_sig ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_png_png_check_sig=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_lib_png_png_check_sig=no
++ ac_cv_lib_png_png_check_sig=no
+ fi
+-rm -f conftest.err conftest.$ac_objext \
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_check_sig" >&5
+-echo "${ECHO_T}$ac_cv_lib_png_png_check_sig" >&6
+-if test $ac_cv_lib_png_png_check_sig = yes; then
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_check_sig" >&5
++$as_echo "$ac_cv_lib_png_png_check_sig" >&6; }
++if test "x$ac_cv_lib_png_png_check_sig" = x""yes; then
+
+- echo "$as_me:$LINENO: checking for deflate in -lz" >&5
+-echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6
++ { $as_echo "$as_me:$LINENO: checking for deflate in -lz" >&5
++$as_echo_n "checking for deflate in -lz... " >&6; }
+ if test "${ac_cv_lib_z_deflate+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lz $LIBS"
+@@ -3175,57 +3847,58 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char deflate ();
+ int
+ main ()
+ {
+-deflate ();
++return deflate ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_z_deflate=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_lib_z_deflate=no
++ ac_cv_lib_z_deflate=no
+ fi
+-rm -f conftest.err conftest.$ac_objext \
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
+-echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6
+-if test $ac_cv_lib_z_deflate = yes; then
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
++$as_echo "$ac_cv_lib_z_deflate" >&6; }
++if test "x$ac_cv_lib_z_deflate" = x""yes; then
+
+
+ cat >>confdefs.h <<\_ACEOF
+@@ -3233,12 +3906,10 @@ cat >>confdefs.h <<\_ACEOF
+ _ACEOF
+
+ LIBS="-lpng -lz $LIBS"
+- case $LIBOBJS in
+- "jbig2_image_png.$ac_objext" | \
+- *" jbig2_image_png.$ac_objext" | \
+- "jbig2_image_png.$ac_objext "* | \
++ case " $LIBOBJS " in
+ *" jbig2_image_png.$ac_objext "* ) ;;
+- *) LIBOBJS="$LIBOBJS jbig2_image_png.$ac_objext" ;;
++ *) LIBOBJS="$LIBOBJS jbig2_image_png.$ac_objext"
++ ;;
+ esac
+
+ have_libpng="yes"
+@@ -3260,15 +3931,15 @@ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
++$as_echo_n "checking how to run the C preprocessor... " >&6; }
+ # On Suns, sometimes $CPP names a directory.
+ if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+ fi
+ if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+@@ -3295,35 +3966,35 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ Syntax error
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+ continue
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+
+- # OK, works on sane cases. Now check whether non-existent headers
++ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -3333,34 +4004,34 @@ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <ac_nonexistent.h>
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ ac_preproc_ok=:
+ break
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+
+ done
+@@ -3378,8 +4049,8 @@ fi
+ else
+ ac_cv_prog_CPP=$CPP
+ fi
+-echo "$as_me:$LINENO: result: $CPP" >&5
+-echo "${ECHO_T}$CPP" >&6
++{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
++$as_echo "$CPP" >&6; }
+ ac_preproc_ok=false
+ for ac_c_preproc_warn_flag in '' yes
+ do
+@@ -3402,35 +4073,35 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ Syntax error
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+ continue
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+
+- # OK, works on sane cases. Now check whether non-existent headers
++ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -3440,34 +4111,34 @@ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <ac_nonexistent.h>
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ ac_preproc_ok=:
+ break
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+
+ done
+@@ -3476,11 +4147,13 @@ rm -f conftest.err conftest.$ac_ext
+ if $ac_preproc_ok; then
+ :
+ else
+- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }; }
+ fi
+
+ ac_ext=c
+@@ -3490,25 +4163,144 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+-echo "$as_me:$LINENO: checking for egrep" >&5
+-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+-if test "${ac_cv_prog_egrep+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
++$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
++if test "${ac_cv_path_GREP+set}" = set; then
++ $as_echo_n "(cached) " >&6
++else
++ if test -z "$GREP"; then
++ ac_path_GREP_found=false
++ # Loop through the user's path and test for each of PROGNAME-LIST
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_prog in grep ggrep; do
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
++ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
++# Check for GNU ac_path_GREP and select it if it is found.
++ # Check for GNU $ac_path_GREP
++case `"$ac_path_GREP" --version 2>&1` in
++*GNU*)
++ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
++*)
++ ac_count=0
++ $as_echo_n 0123456789 >"conftest.in"
++ while :
++ do
++ cat "conftest.in" "conftest.in" >"conftest.tmp"
++ mv "conftest.tmp" "conftest.in"
++ cp "conftest.in" "conftest.nl"
++ $as_echo 'GREP' >> "conftest.nl"
++ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
++ ac_count=`expr $ac_count + 1`
++ if test $ac_count -gt ${ac_path_GREP_max-0}; then
++ # Best one so far, save it but keep looking for a better one
++ ac_cv_path_GREP="$ac_path_GREP"
++ ac_path_GREP_max=$ac_count
++ fi
++ # 10*(2^10) chars as input seems more than enough
++ test $ac_count -gt 10 && break
++ done
++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
++esac
++
++ $ac_path_GREP_found && break 3
++ done
++ done
++done
++IFS=$as_save_IFS
++ if test -z "$ac_cv_path_GREP"; then
++ { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
++$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++else
++ ac_cv_path_GREP=$GREP
++fi
++
++fi
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
++$as_echo "$ac_cv_path_GREP" >&6; }
++ GREP="$ac_cv_path_GREP"
++
++
++{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
++$as_echo_n "checking for egrep... " >&6; }
++if test "${ac_cv_path_EGREP+set}" = set; then
++ $as_echo_n "(cached) " >&6
+ else
+- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+- then ac_cv_prog_egrep='grep -E'
+- else ac_cv_prog_egrep='egrep'
++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
++ then ac_cv_path_EGREP="$GREP -E"
++ else
++ if test -z "$EGREP"; then
++ ac_path_EGREP_found=false
++ # Loop through the user's path and test for each of PROGNAME-LIST
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_prog in egrep; do
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
++# Check for GNU ac_path_EGREP and select it if it is found.
++ # Check for GNU $ac_path_EGREP
++case `"$ac_path_EGREP" --version 2>&1` in
++*GNU*)
++ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
++*)
++ ac_count=0
++ $as_echo_n 0123456789 >"conftest.in"
++ while :
++ do
++ cat "conftest.in" "conftest.in" >"conftest.tmp"
++ mv "conftest.tmp" "conftest.in"
++ cp "conftest.in" "conftest.nl"
++ $as_echo 'EGREP' >> "conftest.nl"
++ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
++ ac_count=`expr $ac_count + 1`
++ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
++ # Best one so far, save it but keep looking for a better one
++ ac_cv_path_EGREP="$ac_path_EGREP"
++ ac_path_EGREP_max=$ac_count
+ fi
++ # 10*(2^10) chars as input seems more than enough
++ test $ac_count -gt 10 && break
++ done
++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
++esac
++
++ $ac_path_EGREP_found && break 3
++ done
++ done
++done
++IFS=$as_save_IFS
++ if test -z "$ac_cv_path_EGREP"; then
++ { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
++$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++else
++ ac_cv_path_EGREP=$EGREP
++fi
++
++ fi
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+- EGREP=$ac_cv_prog_egrep
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
++$as_echo "$ac_cv_path_EGREP" >&6; }
++ EGREP="$ac_cv_path_EGREP"
+
+
+-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
++$as_echo_n "checking for ANSI C header files... " >&6; }
+ if test "${ac_cv_header_stdc+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -3530,35 +4322,32 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_header_stdc=no
++ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+@@ -3614,6 +4403,7 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <ctype.h>
++#include <stdlib.h>
+ #if ((' ' & 0x0FF) == 0x020)
+ # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+@@ -3633,36 +4423,50 @@ main ()
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+- exit(2);
+- exit (0);
++ return 2;
++ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
++
++
+ fi
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+-echo "${ECHO_T}$ac_cv_header_stdc" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++$as_echo "$ac_cv_header_stdc" >&6; }
+ if test $ac_cv_header_stdc = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+@@ -3684,11 +4488,11 @@ fi
+ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+ do
+-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -3701,41 +4505,42 @@ $ac_includes_default
+ #include <$ac_header>
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-eval "$as_ac_Header=no"
++ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++as_val=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+@@ -3749,19 +4554,21 @@ done
+
+ for ac_header in libintl.h stddef.h unistd.h strings.h
+ do
+-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+- echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
++fi
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
+ else
+ # Is the header compilable?
+-echo "$as_me:$LINENO: checking $ac_header usability" >&5
+-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
++$as_echo_n "checking $ac_header usability... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -3772,41 +4579,38 @@ $ac_includes_default
+ #include <$ac_header>
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_header_compiler=no
++ ac_header_compiler=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-echo "${ECHO_T}$ac_header_compiler" >&6
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++$as_echo "$ac_header_compiler" >&6; }
+
+ # Is the header present?
+-echo "$as_me:$LINENO: checking $ac_header presence" >&5
+-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
++$as_echo_n "checking $ac_header presence... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -3815,81 +4619,83 @@ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <$ac_header>
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ ac_header_preproc=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-echo "${ECHO_T}$ac_header_preproc" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++$as_echo "$ac_header_preproc" >&6; }
+
+ # So? What about this header?
+ case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+- (
+- cat <<\_ASBOX
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ ( cat <<\_ASBOX
+ ## ---------------------------------------- ##
+ ## Report this to jbig2-dev@ghostscript.com ##
+ ## ---------------------------------------- ##
+ _ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ esac
+-echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
+ else
+ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
+
+ fi
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
++as_val=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+@@ -3900,73 +4706,15 @@ done
+
+ stdint_types_in="no_replacement_found"
+ stdint_types_discovered="yes"
+-echo "$as_me:$LINENO: checking for char" >&5
+-echo $ECHO_N "checking for char... $ECHO_C" >&6
+-if test "${ac_cv_type_char+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_includes_default
+-int
+-main ()
+-{
+-if ((char *) 0)
+- return 0;
+-if (sizeof (char))
+- return 0;
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_type_char=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_cv_type_char=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
+-echo "${ECHO_T}$ac_cv_type_char" >&6
+-
+-echo "$as_me:$LINENO: checking size of char" >&5
+-echo $ECHO_N "checking size of char... $ECHO_C" >&6
++# The cast to long int works around a bug in the HP C Compiler
++# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++# This bug is HP SR number 8606223364.
++{ $as_echo "$as_me:$LINENO: checking size of char" >&5
++$as_echo_n "checking size of char... " >&6; }
+ if test "${ac_cv_sizeof_char+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- if test "$ac_cv_type_char" = yes; then
+- # The cast to unsigned long works around a bug in the HP C Compiler
+- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+- # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -3979,7 +4727,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= 0)];
+ test_array [0] = 0
+
+ ;
+@@ -3987,27 +4735,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4020,7 +4764,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4028,46 +4772,43 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr $ac_mid + 1`
+- if test $ac_lo -le $ac_mid; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid + 1`
++ ac_lo=`expr $ac_mid + 1`
++ if test $ac_lo -le $ac_mid; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-cat >conftest.$ac_ext <<_ACEOF
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4077,7 +4818,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (char))) < 0)];
+ test_array [0] = 0
+
+ ;
+@@ -4085,27 +4826,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4118,7 +4855,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4126,50 +4863,49 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_hi=`expr '(' $ac_mid ')' - 1`
+- if test $ac_mid -le $ac_hi; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid`
++ ac_hi=`expr '(' $ac_mid ')' - 1`
++ if test $ac_mid -le $ac_hi; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo= ac_hi=
++ ac_lo= ac_hi=
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Binary search between lo and hi bounds.
+ while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+@@ -4183,7 +4919,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4191,52 +4927,48 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr '(' $ac_mid ')' + 1`
++ ac_lo=`expr '(' $ac_mid ')' + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case $ac_lo in
+ ?*) ac_cv_sizeof_char=$ac_lo;;
+-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
++'') if test "$ac_cv_type_char" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (char), 77
++$as_echo "$as_me: error: cannot compute sizeof (char)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; } ;;
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_char=0
++ fi ;;
+ esac
+ else
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -4244,8 +4976,8 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-long longval () { return (long) (sizeof (char)); }
+-unsigned long ulongval () { return (long) (sizeof (char)); }
++static long int longval () { return (long int) (sizeof (char)); }
++static unsigned long int ulongval () { return (long int) (sizeof (char)); }
+ #include <stdio.h>
+ #include <stdlib.h>
+ int
+@@ -4254,133 +4986,94 @@ main ()
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+- exit (1);
+- if (((long) (sizeof (char))) < 0)
++ return 1;
++ if (((long int) (sizeof (char))) < 0)
+ {
+- long i = longval ();
+- if (i != ((long) (sizeof (char))))
+- exit (1);
+- fprintf (f, "%ld\n", i);
++ long int i = longval ();
++ if (i != ((long int) (sizeof (char))))
++ return 1;
++ fprintf (f, "%ld", i);
+ }
+ else
+ {
+- unsigned long i = ulongval ();
+- if (i != ((long) (sizeof (char))))
+- exit (1);
+- fprintf (f, "%lu\n", i);
++ unsigned long int i = ulongval ();
++ if (i != ((long int) (sizeof (char))))
++ return 1;
++ fprintf (f, "%lu", i);
+ }
+- exit (ferror (f) || fclose (f) != 0);
++ /* Do not output a trailing newline, as this causes \r\n confusion
++ on some platforms. */
++ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_char=`cat conftest.val`
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
++if test "$ac_cv_type_char" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (char), 77
++$as_echo "$as_me: error: cannot compute sizeof (char)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_char=0
++ fi
+ fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ rm -f conftest.val
+-else
+- ac_cv_sizeof_char=0
+ fi
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
+-echo "${ECHO_T}$ac_cv_sizeof_char" >&6
+-cat >>confdefs.h <<_ACEOF
+-#define SIZEOF_CHAR $ac_cv_sizeof_char
+-_ACEOF
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
++$as_echo "$ac_cv_sizeof_char" >&6; }
+
+
+-echo "$as_me:$LINENO: checking for short" >&5
+-echo $ECHO_N "checking for short... $ECHO_C" >&6
+-if test "${ac_cv_type_short+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_includes_default
+-int
+-main ()
+-{
+-if ((short *) 0)
+- return 0;
+-if (sizeof (short))
+- return 0;
+- ;
+- return 0;
+-}
++
++cat >>confdefs.h <<_ACEOF
++#define SIZEOF_CHAR $ac_cv_sizeof_char
+ _ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_type_short=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_type_short=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
+-echo "${ECHO_T}$ac_cv_type_short" >&6
+
+-echo "$as_me:$LINENO: checking size of short" >&5
+-echo $ECHO_N "checking size of short... $ECHO_C" >&6
++# The cast to long int works around a bug in the HP C Compiler
++# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++# This bug is HP SR number 8606223364.
++{ $as_echo "$as_me:$LINENO: checking size of short" >&5
++$as_echo_n "checking size of short... " >&6; }
+ if test "${ac_cv_sizeof_short+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- if test "$ac_cv_type_short" = yes; then
+- # The cast to unsigned long works around a bug in the HP C Compiler
+- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+- # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4393,7 +5086,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)];
+ test_array [0] = 0
+
+ ;
+@@ -4401,27 +5094,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4434,7 +5123,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4442,46 +5131,43 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr $ac_mid + 1`
+- if test $ac_lo -le $ac_mid; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid + 1`
++ ac_lo=`expr $ac_mid + 1`
++ if test $ac_lo -le $ac_mid; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-cat >conftest.$ac_ext <<_ACEOF
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4491,7 +5177,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)];
+ test_array [0] = 0
+
+ ;
+@@ -4499,27 +5185,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4532,7 +5214,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4540,50 +5222,49 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_hi=`expr '(' $ac_mid ')' - 1`
+- if test $ac_mid -le $ac_hi; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid`
++ ac_hi=`expr '(' $ac_mid ')' - 1`
++ if test $ac_mid -le $ac_hi; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo= ac_hi=
++ ac_lo= ac_hi=
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Binary search between lo and hi bounds.
+ while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+@@ -4597,7 +5278,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4605,52 +5286,48 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr '(' $ac_mid ')' + 1`
++ ac_lo=`expr '(' $ac_mid ')' + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case $ac_lo in
+ ?*) ac_cv_sizeof_short=$ac_lo;;
+-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
++'') if test "$ac_cv_type_short" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (short), 77
++$as_echo "$as_me: error: cannot compute sizeof (short)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; } ;;
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_short=0
++ fi ;;
+ esac
+ else
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -4658,8 +5335,8 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-long longval () { return (long) (sizeof (short)); }
+-unsigned long ulongval () { return (long) (sizeof (short)); }
++static long int longval () { return (long int) (sizeof (short)); }
++static unsigned long int ulongval () { return (long int) (sizeof (short)); }
+ #include <stdio.h>
+ #include <stdlib.h>
+ int
+@@ -4668,133 +5345,94 @@ main ()
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+- exit (1);
+- if (((long) (sizeof (short))) < 0)
++ return 1;
++ if (((long int) (sizeof (short))) < 0)
+ {
+- long i = longval ();
+- if (i != ((long) (sizeof (short))))
+- exit (1);
+- fprintf (f, "%ld\n", i);
++ long int i = longval ();
++ if (i != ((long int) (sizeof (short))))
++ return 1;
++ fprintf (f, "%ld", i);
+ }
+ else
+ {
+- unsigned long i = ulongval ();
+- if (i != ((long) (sizeof (short))))
+- exit (1);
+- fprintf (f, "%lu\n", i);
++ unsigned long int i = ulongval ();
++ if (i != ((long int) (sizeof (short))))
++ return 1;
++ fprintf (f, "%lu", i);
+ }
+- exit (ferror (f) || fclose (f) != 0);
++ /* Do not output a trailing newline, as this causes \r\n confusion
++ on some platforms. */
++ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_short=`cat conftest.val`
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
++if test "$ac_cv_type_short" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (short), 77
++$as_echo "$as_me: error: cannot compute sizeof (short)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_short=0
++ fi
+ fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ rm -f conftest.val
+-else
+- ac_cv_sizeof_short=0
+ fi
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+-echo "${ECHO_T}$ac_cv_sizeof_short" >&6
+-cat >>confdefs.h <<_ACEOF
+-#define SIZEOF_SHORT $ac_cv_sizeof_short
+-_ACEOF
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
++$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+-echo "$as_me:$LINENO: checking for int" >&5
+-echo $ECHO_N "checking for int... $ECHO_C" >&6
+-if test "${ac_cv_type_int+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_includes_default
+-int
+-main ()
+-{
+-if ((int *) 0)
+- return 0;
+-if (sizeof (int))
+- return 0;
+- ;
+- return 0;
+-}
++
++cat >>confdefs.h <<_ACEOF
++#define SIZEOF_SHORT $ac_cv_sizeof_short
+ _ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_type_int=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_type_int=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+-echo "${ECHO_T}$ac_cv_type_int" >&6
+
+-echo "$as_me:$LINENO: checking size of int" >&5
+-echo $ECHO_N "checking size of int... $ECHO_C" >&6
++# The cast to long int works around a bug in the HP C Compiler
++# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++# This bug is HP SR number 8606223364.
++{ $as_echo "$as_me:$LINENO: checking size of int" >&5
++$as_echo_n "checking size of int... " >&6; }
+ if test "${ac_cv_sizeof_int+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- if test "$ac_cv_type_int" = yes; then
+- # The cast to unsigned long works around a bug in the HP C Compiler
+- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+- # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4807,7 +5445,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
+ test_array [0] = 0
+
+ ;
+@@ -4815,27 +5453,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4848,7 +5482,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4856,46 +5490,43 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr $ac_mid + 1`
+- if test $ac_lo -le $ac_mid; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid + 1`
++ ac_lo=`expr $ac_mid + 1`
++ if test $ac_lo -le $ac_mid; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-cat >conftest.$ac_ext <<_ACEOF
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4905,7 +5536,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
+ test_array [0] = 0
+
+ ;
+@@ -4913,27 +5544,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -4946,7 +5573,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -4954,50 +5581,49 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_hi=`expr '(' $ac_mid ')' - 1`
+- if test $ac_mid -le $ac_hi; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid`
++ ac_hi=`expr '(' $ac_mid ')' - 1`
++ if test $ac_mid -le $ac_hi; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo= ac_hi=
++ ac_lo= ac_hi=
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Binary search between lo and hi bounds.
+ while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+@@ -5011,7 +5637,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -5019,52 +5645,48 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr '(' $ac_mid ')' + 1`
++ ac_lo=`expr '(' $ac_mid ')' + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case $ac_lo in
+ ?*) ac_cv_sizeof_int=$ac_lo;;
+-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
++'') if test "$ac_cv_type_int" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (int), 77
++$as_echo "$as_me: error: cannot compute sizeof (int)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; } ;;
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_int=0
++ fi ;;
+ esac
+ else
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5072,8 +5694,8 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-long longval () { return (long) (sizeof (int)); }
+-unsigned long ulongval () { return (long) (sizeof (int)); }
++static long int longval () { return (long int) (sizeof (int)); }
++static unsigned long int ulongval () { return (long int) (sizeof (int)); }
+ #include <stdio.h>
+ #include <stdlib.h>
+ int
+@@ -5082,133 +5704,94 @@ main ()
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+- exit (1);
+- if (((long) (sizeof (int))) < 0)
++ return 1;
++ if (((long int) (sizeof (int))) < 0)
+ {
+- long i = longval ();
+- if (i != ((long) (sizeof (int))))
+- exit (1);
+- fprintf (f, "%ld\n", i);
++ long int i = longval ();
++ if (i != ((long int) (sizeof (int))))
++ return 1;
++ fprintf (f, "%ld", i);
+ }
+ else
+ {
+- unsigned long i = ulongval ();
+- if (i != ((long) (sizeof (int))))
+- exit (1);
+- fprintf (f, "%lu\n", i);
++ unsigned long int i = ulongval ();
++ if (i != ((long int) (sizeof (int))))
++ return 1;
++ fprintf (f, "%lu", i);
+ }
+- exit (ferror (f) || fclose (f) != 0);
++ /* Do not output a trailing newline, as this causes \r\n confusion
++ on some platforms. */
++ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_int=`cat conftest.val`
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
++if test "$ac_cv_type_int" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (int), 77
++$as_echo "$as_me: error: cannot compute sizeof (int)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_int=0
++ fi
+ fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ rm -f conftest.val
+-else
+- ac_cv_sizeof_int=0
+-fi
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+-echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+-cat >>confdefs.h <<_ACEOF
+-#define SIZEOF_INT $ac_cv_sizeof_int
+-_ACEOF
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
++$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+-echo "$as_me:$LINENO: checking for long" >&5
+-echo $ECHO_N "checking for long... $ECHO_C" >&6
+-if test "${ac_cv_type_long+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-$ac_includes_default
+-int
+-main ()
+-{
+-if ((long *) 0)
+- return 0;
+-if (sizeof (long))
+- return 0;
+- ;
+- return 0;
+-}
++
++cat >>confdefs.h <<_ACEOF
++#define SIZEOF_INT $ac_cv_sizeof_int
+ _ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_type_long=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_type_long=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+-echo "${ECHO_T}$ac_cv_type_long" >&6
+
+-echo "$as_me:$LINENO: checking size of long" >&5
+-echo $ECHO_N "checking size of long... $ECHO_C" >&6
++# The cast to long int works around a bug in the HP C Compiler
++# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++# This bug is HP SR number 8606223364.
++{ $as_echo "$as_me:$LINENO: checking size of long" >&5
++$as_echo_n "checking size of long... " >&6; }
+ if test "${ac_cv_sizeof_long+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- if test "$ac_cv_type_long" = yes; then
+- # The cast to unsigned long works around a bug in the HP C Compiler
+- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+- # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -5221,7 +5804,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)];
+ test_array [0] = 0
+
+ ;
+@@ -5229,27 +5812,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -5262,7 +5841,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -5270,46 +5849,43 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr $ac_mid + 1`
+- if test $ac_lo -le $ac_mid; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid + 1`
++ ac_lo=`expr $ac_mid + 1`
++ if test $ac_lo -le $ac_mid; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-cat >conftest.$ac_ext <<_ACEOF
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5319,7 +5895,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
++static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)];
+ test_array [0] = 0
+
+ ;
+@@ -5327,27 +5903,23 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -5360,7 +5932,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -5368,50 +5940,49 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_hi=`expr '(' $ac_mid ')' - 1`
+- if test $ac_mid -le $ac_hi; then
+- ac_lo= ac_hi=
+- break
+- fi
+- ac_mid=`expr 2 '*' $ac_mid`
++ ac_hi=`expr '(' $ac_mid ')' - 1`
++ if test $ac_mid -le $ac_hi; then
++ ac_lo= ac_hi=
++ break
++ fi
++ ac_mid=`expr 2 '*' $ac_mid`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo= ac_hi=
++ ac_lo= ac_hi=
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Binary search between lo and hi bounds.
+ while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+@@ -5425,7 +5996,7 @@ $ac_includes_default
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
++static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+ test_array [0] = 0
+
+ ;
+@@ -5433,52 +6004,48 @@ test_array [0] = 0
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_lo=`expr '(' $ac_mid ')' + 1`
++ ac_lo=`expr '(' $ac_mid ')' + 1`
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case $ac_lo in
+ ?*) ac_cv_sizeof_long=$ac_lo;;
+-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
++'') if test "$ac_cv_type_long" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (long), 77
++$as_echo "$as_me: error: cannot compute sizeof (long)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; } ;;
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_long=0
++ fi ;;
+ esac
+ else
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5486,8 +6053,8 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-long longval () { return (long) (sizeof (long)); }
+-unsigned long ulongval () { return (long) (sizeof (long)); }
++static long int longval () { return (long int) (sizeof (long)); }
++static unsigned long int ulongval () { return (long int) (sizeof (long)); }
+ #include <stdio.h>
+ #include <stdlib.h>
+ int
+@@ -5496,61 +6063,80 @@ main ()
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+- exit (1);
+- if (((long) (sizeof (long))) < 0)
++ return 1;
++ if (((long int) (sizeof (long))) < 0)
+ {
+- long i = longval ();
+- if (i != ((long) (sizeof (long))))
+- exit (1);
+- fprintf (f, "%ld\n", i);
++ long int i = longval ();
++ if (i != ((long int) (sizeof (long))))
++ return 1;
++ fprintf (f, "%ld", i);
+ }
+ else
+ {
+- unsigned long i = ulongval ();
+- if (i != ((long) (sizeof (long))))
+- exit (1);
+- fprintf (f, "%lu\n", i);
++ unsigned long int i = ulongval ();
++ if (i != ((long int) (sizeof (long))))
++ return 1;
++ fprintf (f, "%lu", i);
+ }
+- exit (ferror (f) || fclose (f) != 0);
++ /* Do not output a trailing newline, as this causes \r\n confusion
++ on some platforms. */
++ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
++if test "$ac_cv_type_long" = yes; then
++ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute sizeof (long), 77
++$as_echo "$as_me: error: cannot compute sizeof (long)
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++ { (exit 77); exit 77; }; }; }
++ else
++ ac_cv_sizeof_long=0
++ fi
+ fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ rm -f conftest.val
+-else
+- ac_cv_sizeof_long=0
+-fi
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+-echo "${ECHO_T}$ac_cv_sizeof_long" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
++$as_echo "$ac_cv_sizeof_long" >&6; }
++
++
++
+ cat >>confdefs.h <<_ACEOF
+ #define SIZEOF_LONG $ac_cv_sizeof_long
+ _ACEOF
+@@ -5573,17 +6159,17 @@ case 4 in
+ *) stdint_types_discovered="no";;
+ esac
+ if test "${ac_cv_header_stdint_h+set}" = set; then
+- echo "$as_me:$LINENO: checking for stdint.h" >&5
+-echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
++ { $as_echo "$as_me:$LINENO: checking for stdint.h" >&5
++$as_echo_n "checking for stdint.h... " >&6; }
+ if test "${ac_cv_header_stdint_h+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
+-echo "${ECHO_T}$ac_cv_header_stdint_h" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
++$as_echo "$ac_cv_header_stdint_h" >&6; }
+ else
+ # Is the header compilable?
+-echo "$as_me:$LINENO: checking stdint.h usability" >&5
+-echo $ECHO_N "checking stdint.h usability... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking stdint.h usability" >&5
++$as_echo_n "checking stdint.h usability... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5594,41 +6180,38 @@ $ac_includes_default
+ #include <stdint.h>
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_header_compiler=no
++ ac_header_compiler=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-echo "${ECHO_T}$ac_header_compiler" >&6
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++$as_echo "$ac_header_compiler" >&6; }
+
+ # Is the header present?
+-echo "$as_me:$LINENO: checking stdint.h presence" >&5
+-echo $ECHO_N "checking stdint.h presence... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking stdint.h presence" >&5
++$as_echo_n "checking stdint.h presence... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5637,84 +6220,82 @@ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <stdint.h>
+ _ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } >/dev/null; then
+- if test -s conftest.err; then
+- ac_cpp_err=$ac_c_preproc_warn_flag
+- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+- else
+- ac_cpp_err=
+- fi
+-else
+- ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
+ ac_header_preproc=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+ fi
++
+ rm -f conftest.err conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-echo "${ECHO_T}$ac_header_preproc" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++$as_echo "$ac_header_preproc" >&6; }
+
+ # So? What about this header?
+ case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+- { echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5
+-echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5
++$as_echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5
++$as_echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+- { echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: stdint.h: check for missing prerequisite headers?" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5
+-echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&5
+-echo "$as_me: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;}
+- { echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5
+-echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;}
+- (
+- cat <<\_ASBOX
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5
++$as_echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: check for missing prerequisite headers?" >&5
++$as_echo "$as_me: WARNING: stdint.h: check for missing prerequisite headers?" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5
++$as_echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&5
++$as_echo "$as_me: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5
++$as_echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5
++$as_echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;}
++ ( cat <<\_ASBOX
+ ## ---------------------------------------- ##
+ ## Report this to jbig2-dev@ghostscript.com ##
+ ## ---------------------------------------- ##
+ _ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ esac
+-echo "$as_me:$LINENO: checking for stdint.h" >&5
+-echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for stdint.h" >&5
++$as_echo_n "checking for stdint.h... " >&6; }
+ if test "${ac_cv_header_stdint_h+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_header_stdint_h=$ac_header_preproc
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
+-echo "${ECHO_T}$ac_cv_header_stdint_h" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5
++$as_echo "$ac_cv_header_stdint_h" >&6; }
+
+ fi
+
+
+ if test "x$ac_cv_header_stdint_h" != "xyes"; then
+ for include in sys/types.h inttypes.h sys/inttypes.h sys/int_types.h ; do
+- echo "$as_me:$LINENO: checking for uint32_t in $include" >&5
+-echo $ECHO_N "checking for uint32_t in $include... $ECHO_C" >&6
++ { $as_echo "$as_me:$LINENO: checking for uint32_t in $include" >&5
++$as_echo_n "checking for uint32_t in $include... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5731,58 +6312,55 @@ uint32_t canary;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+- echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ stdint_types_in="$include"
+ break;
+
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ if test "x$stdint_types_in" != "xno_replacement_found"; then
+- echo "$as_me:$LINENO: result: Adding $stdint_types_in to config header for stdint types" >&5
+-echo "${ECHO_T}Adding $stdint_types_in to config header for stdint types" >&6
++ { $as_echo "$as_me:$LINENO: result: Adding $stdint_types_in to config header for stdint types" >&5
++$as_echo "Adding $stdint_types_in to config header for stdint types" >&6; }
+
+ cat >>confdefs.h <<\_ACEOF
+-#define JBIG2_REPLACE_STDINT_H
++#define JBIG2_REPLACE_STDINT_H /**/
+ _ACEOF
+
+ elif test "x$stdint_types_discovered" = "xno"; then
+- { { echo "$as_me:$LINENO: error:
++ { { $as_echo "$as_me:$LINENO: error:
+ Unable to find suitable definitions of the stdint.h types (uint32_t and friends)
+ You will have to define these yourself in a separate header.
+ See config_win32.h for an example.
+ " >&5
+-echo "$as_me: error:
++$as_echo "$as_me: error:
+ Unable to find suitable definitions of the stdint.h types (uint32_t and friends)
+ You will have to define these yourself in a separate header.
+ See config_win32.h for an example.
+@@ -5800,10 +6378,10 @@ JBIG2_STDINT_H=$stdint_types_in
+
+
+ # Checks for typedefs, structures, and compiler characteristics.
+-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
++$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+ if test "${ac_cv_c_const+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -5819,10 +6397,10 @@ main ()
+ #ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+- const charset x;
++ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+- char const *const *ccp;
+- char **p;
++ char const *const *pcpcc;
++ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+@@ -5831,16 +6409,17 @@ main ()
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+- ccp = &g + (g ? g-g : 0);
++ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+- ++ccp;
+- p = (char**) ccp;
+- ccp = (char const *const *) p;
++ ++pcpcc;
++ ppc = (char**) pcpcc;
++ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
++ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+@@ -5859,7 +6438,9 @@ main ()
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
++ if (!foo) return 0;
+ }
++ return !cs[0] && !zero.x;
+ #endif
+
+ ;
+@@ -5867,52 +6448,50 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_c_const=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_c_const=no
++ ac_cv_c_const=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+-echo "${ECHO_T}$ac_cv_c_const" >&6
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
++$as_echo "$ac_cv_c_const" >&6; }
+ if test $ac_cv_c_const = no; then
+
+ cat >>confdefs.h <<\_ACEOF
+-#define const
++#define const /**/
+ _ACEOF
+
+ fi
+
+-echo "$as_me:$LINENO: checking for size_t" >&5
+-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
++$as_echo_n "checking for size_t... " >&6; }
+ if test "${ac_cv_type_size_t+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- cat >conftest.$ac_ext <<_ACEOF
++ ac_cv_type_size_t=no
++cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5922,223 +6501,412 @@ $ac_includes_default
+ int
+ main ()
+ {
+-if ((size_t *) 0)
+- return 0;
+ if (sizeof (size_t))
+- return 0;
++ return 0;
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++int
++main ()
++{
++if (sizeof ((size_t)))
++ return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_type_size_t=yes
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_type_size_t=no
++ ac_cv_type_size_t=yes
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+-echo "${ECHO_T}$ac_cv_type_size_t" >&6
+-if test $ac_cv_type_size_t = yes; then
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
++$as_echo "$ac_cv_type_size_t" >&6; }
++if test "x$ac_cv_type_size_t" = x""yes; then
+ :
+ else
+
+ cat >>confdefs.h <<_ACEOF
+-#define size_t unsigned
++#define size_t unsigned int
+ _ACEOF
+
+ fi
+
+-echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
++
++ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
++$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+ if test "${ac_cv_c_bigendian+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+- # See if sys/param.h defines the BYTE_ORDER macro.
+-cat >conftest.$ac_ext <<_ACEOF
++ ac_cv_c_bigendian=unknown
++ # See if we're dealing with a universal compiler.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#ifndef __APPLE_CC__
++ not a universal capable compiler
++ #endif
++ typedef int dummy;
++
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++
++ # Check for potential -arch flags. It is not universal unless
++ # there are some -arch flags. Note that *ppc* also matches
++ # ppc64. This check is also rather less than ideal.
++ case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #(
++ *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
++ esac
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ if test $ac_cv_c_bigendian = unknown; then
++ # See if sys/param.h defines the BYTE_ORDER macro.
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <sys/types.h>
+-#include <sys/param.h>
++ #include <sys/param.h>
+
+ int
+ main ()
+ {
+-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+- bogus endian macros
+-#endif
++#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
++ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
++ && LITTLE_ENDIAN)
++ bogus endian macros
++ #endif
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+-cat >conftest.$ac_ext <<_ACEOF
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <sys/types.h>
+-#include <sys/param.h>
++ #include <sys/param.h>
+
+ int
+ main ()
+ {
+ #if BYTE_ORDER != BIG_ENDIAN
+- not big endian
+-#endif
++ not big endian
++ #endif
+
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_c_bigendian=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_c_bigendian=no
++ ac_cv_c_bigendian=no
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-# It does not; compile a test program.
+-if test "$cross_compiling" = yes; then
+- # try to guess the endianness by grepping values into an object file
+- ac_cv_c_bigendian=unknown
+- cat >conftest.$ac_ext <<_ACEOF
++
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ fi
++ if test $ac_cv_c_bigendian = unknown; then
++ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
++#include <limits.h>
++
+ int
+ main ()
+ {
+- _ascii (); _ebcdic ();
++#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
++ bogus endian macros
++ #endif
++
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ # It does; now see whether it defined to _BIG_ENDIAN or not.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <limits.h>
++
++int
++main ()
++{
++#ifndef _BIG_ENDIAN
++ not big endian
++ #endif
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
+ ac_cv_c_bigendian=yes
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_cv_c_bigendian=no
+ fi
+-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+- if test "$ac_cv_c_bigendian" = unknown; then
+- ac_cv_c_bigendian=no
+- else
+- # finding both strings is unlikely to happen, but who knows?
+- ac_cv_c_bigendian=unknown
+- fi
+-fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ fi
++ if test $ac_cv_c_bigendian = unknown; then
++ # Compile a test program.
++ if test "$cross_compiling" = yes; then
++ # Try to guess by grepping values from an object file.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++short int ascii_mm[] =
++ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
++ short int ascii_ii[] =
++ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
++ int use_ascii (int i) {
++ return ascii_mm[i] + ascii_ii[i];
++ }
++ short int ebcdic_ii[] =
++ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
++ short int ebcdic_mm[] =
++ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
++ int use_ebcdic (int i) {
++ return ebcdic_mm[i] + ebcdic_ii[i];
++ }
++ extern int foo;
++
++int
++main ()
++{
++return use_ascii (foo) == use_ebcdic (foo);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
++ ac_cv_c_bigendian=yes
++ fi
++ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
++ if test "$ac_cv_c_bigendian" = unknown; then
++ ac_cv_c_bigendian=no
++ else
++ # finding both strings is unlikely to happen, but who knows?
++ ac_cv_c_bigendian=unknown
++ fi
++ fi
++else
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
++
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -6146,69 +6914,93 @@ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++$ac_includes_default
+ int
+ main ()
+ {
+- /* Are we little or big endian? From Harbison&Steele. */
+- union
+- {
+- long l;
+- char c[sizeof (long)];
+- } u;
+- u.l = 1;
+- exit (u.c[sizeof (long) - 1] == 1);
++
++ /* Are we little or big endian? From Harbison&Steele. */
++ union
++ {
++ long int l;
++ char c[sizeof (long int)];
++ } u;
++ u.l = 1;
++ return u.c[sizeof (long int) - 1] == 1;
++
++ ;
++ return 0;
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_bigendian=no
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+ ac_cv_c_bigendian=yes
+ fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++
++ fi
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+-echo "${ECHO_T}$ac_cv_c_bigendian" >&6
+-case $ac_cv_c_bigendian in
+- yes)
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
++$as_echo "$ac_cv_c_bigendian" >&6; }
++ case $ac_cv_c_bigendian in #(
++ yes)
++ cat >>confdefs.h <<\_ACEOF
++#define WORDS_BIGENDIAN 1
++_ACEOF
++;; #(
++ no)
++ ;; #(
++ universal)
+
+ cat >>confdefs.h <<\_ACEOF
+-#define WORDS_BIGENDIAN 1
++#define AC_APPLE_UNIVERSAL_BUILD 1
+ _ACEOF
+- ;;
+- no)
+- ;;
+- *)
+- { { echo "$as_me:$LINENO: error: unknown endianness
+-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+-echo "$as_me: error: unknown endianness
+-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
++
++ ;; #(
++ *)
++ { { $as_echo "$as_me:$LINENO: error: unknown endianness
++ presetting ac_cv_c_bigendian=no (or yes) will help" >&5
++$as_echo "$as_me: error: unknown endianness
++ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+ { (exit 1); exit 1; }; } ;;
+-esac
++ esac
+
+
+ # Checks for library functions.
+-echo "$as_me:$LINENO: checking for working memcmp" >&5
+-echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for working memcmp" >&5
++$as_echo_n "checking for working memcmp... " >&6; }
+ if test "${ac_cv_func_memcmp_working+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+@@ -6225,9 +7017,9 @@ main ()
+ {
+
+ /* Some versions of memcmp are not 8-bit clean. */
+- char c0 = 0x40, c1 = 0x80, c2 = 0x81;
++ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+- exit (1);
++ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+@@ -6243,9 +7035,9 @@ main ()
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+- exit (1);
++ return 1;
+ }
+- exit (0);
++ return 0;
+ }
+
+ ;
+@@ -6253,47 +7045,59 @@ main ()
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
++ { (case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_memcmp_working=yes
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: program exited with status $ac_status" >&5
++$as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+ ac_cv_func_memcmp_working=no
+ fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -rf conftest.dSYM
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
++
++
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+-echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
+-test $ac_cv_func_memcmp_working = no && case $LIBOBJS in
+- "memcmp.$ac_objext" | \
+- *" memcmp.$ac_objext" | \
+- "memcmp.$ac_objext "* | \
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
++$as_echo "$ac_cv_func_memcmp_working" >&6; }
++test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+- *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;;
++ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
++ ;;
+ esac
+
+
+
+ for ac_func in snprintf
+ do
+-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_func" >&5
+-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_var+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
++$as_echo_n "checking for $ac_func... " >&6; }
++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -6318,80 +7122,77 @@ cat >>conftest.$ac_ext <<_ACEOF
+
+ #undef $ac_func
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+-{
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char $ac_func ();
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++#if defined __stub_$ac_func || defined __stub___$ac_func
+ choke me
+-#else
+-char (*f) () = $ac_func;
+-#endif
+-#ifdef __cplusplus
+-}
+ #endif
+
+ int
+ main ()
+ {
+-return f != $ac_func;
++return $ac_func ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ eval "$as_ac_var=yes"
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-eval "$as_ac_var=no"
++ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.err conftest.$ac_objext \
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+-if test `eval echo '${'$as_ac_var'}'` = yes; then
++ac_res=`eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++as_val=`eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'`
++ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ _ACEOF
+
+ else
+- case $LIBOBJS in
+- "$ac_func.$ac_objext" | \
+- *" $ac_func.$ac_objext" | \
+- "$ac_func.$ac_objext "* | \
++ case " $LIBOBJS " in
+ *" $ac_func.$ac_objext "* ) ;;
+- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++ ;;
+ esac
+
+ fi
+@@ -6403,11 +7204,11 @@ done
+
+ for ac_func in memset strdup
+ do
+-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_func" >&5
+-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_var+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
++$as_echo_n "checking for $ac_func... " >&6; }
++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -6432,81 +7233,80 @@ cat >>conftest.$ac_ext <<_ACEOF
+
+ #undef $ac_func
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+-{
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char $ac_func ();
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++#if defined __stub_$ac_func || defined __stub___$ac_func
+ choke me
+-#else
+-char (*f) () = $ac_func;
+-#endif
+-#ifdef __cplusplus
+-}
+ #endif
+
+ int
+ main ()
+ {
+-return f != $ac_func;
++return $ac_func ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ eval "$as_ac_var=yes"
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-eval "$as_ac_var=no"
++ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.err conftest.$ac_objext \
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+-if test `eval echo '${'$as_ac_var'}'` = yes; then
++ac_res=`eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++as_val=`eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'`
++ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+ done
+
+
+-echo "$as_me:$LINENO: checking for getopt_long" >&5
+-echo $ECHO_N "checking for getopt_long... $ECHO_C" >&6
++{ $as_echo "$as_me:$LINENO: checking for getopt_long" >&5
++$as_echo_n "checking for getopt_long... " >&6; }
+ if test "${ac_cv_func_getopt_long+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -6531,90 +7331,81 @@ cat >>conftest.$ac_ext <<_ACEOF
+
+ #undef getopt_long
+
+-/* Override any gcc2 internal prototype to avoid an error. */
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
+ #ifdef __cplusplus
+ extern "C"
+-{
+ #endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+ char getopt_long ();
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined (__stub_getopt_long) || defined (__stub___getopt_long)
++#if defined __stub_getopt_long || defined __stub___getopt_long
+ choke me
+-#else
+-char (*f) () = getopt_long;
+-#endif
+-#ifdef __cplusplus
+-}
+ #endif
+
+ int
+ main ()
+ {
+-return f != getopt_long;
++return getopt_long ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_func_getopt_long=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-ac_cv_func_getopt_long=no
++ ac_cv_func_getopt_long=no
+ fi
+-rm -f conftest.err conftest.$ac_objext \
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5
+-echo "${ECHO_T}$ac_cv_func_getopt_long" >&6
+-if test $ac_cv_func_getopt_long = yes; then
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5
++$as_echo "$ac_cv_func_getopt_long" >&6; }
++if test "x$ac_cv_func_getopt_long" = x""yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+-#define HAVE_GETOPT_LONG
++#define HAVE_GETOPT_LONG /**/
+ _ACEOF
+
+ else
+
+- case $LIBOBJS in
+- "getopt.$ac_objext" | \
+- *" getopt.$ac_objext" | \
+- "getopt.$ac_objext "* | \
++ case " $LIBOBJS " in
+ *" getopt.$ac_objext "* ) ;;
+- *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;;
++ *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
++ ;;
+ esac
+
+- case $LIBOBJS in
+- "getopt1.$ac_objext" | \
+- *" getopt1.$ac_objext" | \
+- "getopt1.$ac_objext "* | \
++ case " $LIBOBJS " in
+ *" getopt1.$ac_objext "* ) ;;
+- *) LIBOBJS="$LIBOBJS getopt1.$ac_objext" ;;
++ *) LIBOBJS="$LIBOBJS getopt1.$ac_objext"
++ ;;
+ esac
+
+
+@@ -6622,7 +7413,7 @@ fi
+
+
+ # generate output
+- ac_config_files="$ac_config_files Makefile config_types.h"
++ac_config_files="$ac_config_files Makefile config_types.h"
+
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+@@ -6642,39 +7433,59 @@ _ACEOF
+
+ # The following way of writing the cache mishandles newlines in values,
+ # but we know of no workaround that is simple, portable, and efficient.
+-# So, don't put newlines in cache variables' values.
++# So, we kill variables containing newlines.
+ # Ultrix sh set writes to stderr and can't be redirected directly,
+ # and sets the high bit in the cache file unless we assign to the vars.
+-{
++(
++ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
++ eval ac_val=\$$ac_var
++ case $ac_val in #(
++ *${as_nl}*)
++ case $ac_var in #(
++ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
++$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
++ esac
++ case $ac_var in #(
++ _ | IFS | as_nl) ;; #(
++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
++ *) $as_unset $ac_var ;;
++ esac ;;
++ esac
++ done
++
+ (set) 2>&1 |
+- case `(ac_space=' '; set | grep ac_space) 2>&1` in
+- *ac_space=\ *)
++ case $as_nl`(ac_space=' '; set) 2>&1` in #(
++ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+- ;;
++ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+- sed -n \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+- esac;
+-} |
++ esac |
++ sort
++) |
+ sed '
++ /^ac_cv_env_/b end
+ t clear
+- : clear
++ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+- : end' >>confcache
+-if diff $cache_file confcache >/dev/null 2>&1; then :; else
+- if test -w $cache_file; then
+- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
++ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
++ :end' >>confcache
++if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
++ if test -w "$cache_file"; then
++ test "x$cache_file" != "x/dev/null" &&
++ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
++$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+- echo "not updating unwritable cache $cache_file"
++ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
++$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+ fi
+ rm -f confcache
+@@ -6683,32 +7494,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ # Let make expand exec_prefix.
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+-# VPATH may cause trouble with some makes, so we remove $(srcdir),
+-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+-# trailing colons and then remove the whole line if VPATH becomes empty
+-# (actually we leave an empty line to preserve line numbers).
+-if test "x$srcdir" = x.; then
+- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+-s/:*\$(srcdir):*/:/;
+-s/:*\${srcdir}:*/:/;
+-s/:*@srcdir@:*/:/;
+-s/^\([^=]*=[ ]*\):*/\1/;
+-s/:*$//;
+-s/^[^=]*=[ ]*$//;
+-}'
+-fi
+-
+ DEFS=-DHAVE_CONFIG_H
+
+ ac_libobjs=
+ ac_ltlibobjs=
+ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+- ac_i=`echo "$ac_i" |
+- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+- # 2. Add them.
+- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
++ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
++ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
++ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
++ # will be set to the directory where LIBOBJS objects are built.
++ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
++ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+ done
+ LIBOBJS=$ac_libobjs
+
+@@ -6716,26 +7513,28 @@ LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
++ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"AMDEP\" was never defined.
++$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
++ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
++$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
++
+ : ${CONFIG_STATUS=./config.status}
++ac_write_fail=0
+ ac_clean_files_save=$ac_clean_files
+ ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+-echo "$as_me: creating $CONFIG_STATUS" >&6;}
+-cat >$CONFIG_STATUS <<_ACEOF
++{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ #! $SHELL
+ # Generated by $as_me.
+ # Run this file to recreate the current configuration.
+@@ -6748,22 +7547,78 @@ ac_cs_silent=false
+ SHELL=\${CONFIG_SHELL-$SHELL}
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ ## --------------------- ##
+ ## M4sh Initialization. ##
+ ## --------------------- ##
+
+-# Be Bourne compatible
++# Be more Bourne compatible
++DUALCASE=1; export DUALCASE # for MKS sh
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+- set -o posix
++ setopt NO_GLOB_SUBST
++else
++ case `(set -o) 2>/dev/null` in
++ *posix*) set -o posix ;;
++esac
++
++fi
++
++
++
++
++# PATH needs CR
++# Avoid depending upon Character Ranges.
++as_cr_letters='abcdefghijklmnopqrstuvwxyz'
++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
++as_cr_Letters=$as_cr_letters$as_cr_LETTERS
++as_cr_digits='0123456789'
++as_cr_alnum=$as_cr_Letters$as_cr_digits
++
++as_nl='
++'
++export as_nl
++# Printing a long string crashes Solaris 7 /usr/bin/printf.
++as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
++if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
++ as_echo='printf %s\n'
++ as_echo_n='printf %s'
++else
++ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
++ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
++ as_echo_n='/usr/ucb/echo -n'
++ else
++ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
++ as_echo_n_body='eval
++ arg=$1;
++ case $arg in
++ *"$as_nl"*)
++ expr "X$arg" : "X\\(.*\\)$as_nl";
++ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
++ esac;
++ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
++ '
++ export as_echo_n_body
++ as_echo_n='sh -c $as_echo_n_body as_echo'
++ fi
++ export as_echo_body
++ as_echo='sh -c $as_echo_body as_echo'
++fi
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ PATH_SEPARATOR=:
++ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
++ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
++ PATH_SEPARATOR=';'
++ }
+ fi
+-DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+ if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+@@ -6773,33 +7628,60 @@ else
+ fi
+
+
++# IFS
++# We need space, tab and new line, in precisely that order. Quoting is
++# there to prevent editors from complaining about space-tab.
++# (If _AS_PATH_WALK were called with IFS unset, it would disable word
++# splitting by setting IFS to empty value.)
++IFS=" "" $as_nl"
++
++# Find who we are. Look in the path if we contain no directory separator.
++case $0 in
++ *[\\/]* ) as_myself=$0 ;;
++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
++done
++IFS=$as_save_IFS
++
++ ;;
++esac
++# We did not find ourselves, most probably we were run as `sh COMMAND'
++# in which case we are not to be found in the path.
++if test "x$as_myself" = x; then
++ as_myself=$0
++fi
++if test ! -f "$as_myself"; then
++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
++ { (exit 1); exit 1; }
++fi
++
+ # Work around bugs in pre-3.0 UWIN ksh.
+-$as_unset ENV MAIL MAILPATH
++for as_var in ENV MAIL MAILPATH
++do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
++done
+ PS1='$ '
+ PS2='> '
+ PS4='+ '
+
+ # NLS nuisances.
+-for as_var in \
+- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+- LC_TELEPHONE LC_TIME
+-do
+- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+- eval $as_var=C; export $as_var
+- else
+- $as_unset $as_var
+- fi
+-done
++LC_ALL=C
++export LC_ALL
++LANGUAGE=C
++export LANGUAGE
+
+ # Required to use basename.
+-if expr a : '\(a\)' >/dev/null 2>&1; then
++if expr a : '\(a\)' >/dev/null 2>&1 &&
++ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+ else
+ as_expr=false
+ fi
+
+-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+ else
+ as_basename=false
+@@ -6807,159 +7689,122 @@ fi
+
+
+ # Name of the executable.
+-as_me=`$as_basename "$0" ||
++as_me=`$as_basename -- "$0" ||
+ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)$' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X/"$0" |
+- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+- /^X\/\(\/\/\)$/{ s//\1/; q; }
+- /^X\/\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+-
+-
+-# PATH needs CR, and LINENO needs CR and PATH.
+-# Avoid depending upon Character Ranges.
+-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+-as_cr_digits='0123456789'
+-as_cr_alnum=$as_cr_Letters$as_cr_digits
++ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{
++ s//\1/
++ q
++ }
++ /^X\/\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\/\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
+
+-# The user is always right.
+-if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
+- echo "exit 0" >>conf$$.sh
+- chmod +x conf$$.sh
+- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+- PATH_SEPARATOR=';'
+- else
+- PATH_SEPARATOR=:
+- fi
+- rm -f conf$$.sh
+-fi
++# CDPATH.
++$as_unset CDPATH
+
+
+- as_lineno_1=$LINENO
+- as_lineno_2=$LINENO
+- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+- test "x$as_lineno_1" != "x$as_lineno_2" &&
+- test "x$as_lineno_3" = "x$as_lineno_2" || {
+- # Find who we are. Look in the path if we contain no path at all
+- # relative or not.
+- case $0 in
+- *[\\/]* ) as_myself=$0 ;;
+- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+-done
+
+- ;;
+- esac
+- # We did not find ourselves, most probably we were run as `sh COMMAND'
+- # in which case we are not to be found in the path.
+- if test "x$as_myself" = x; then
+- as_myself=$0
+- fi
+- if test ! -f "$as_myself"; then
+- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+- { (exit 1); exit 1; }; }
+- fi
+- case $CONFIG_SHELL in
+- '')
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for as_base in sh bash ksh sh5; do
+- case $as_dir in
+- /*)
+- if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+- CONFIG_SHELL=$as_dir/$as_base
+- export CONFIG_SHELL
+- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+- fi;;
+- esac
+- done
+-done
+-;;
+- esac
++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+- # line-number line before each line; the second 'sed' does the real
+- # work. The second script uses 'N' to pair each line-number line
+- # with the numbered line, and appends trailing '-' during
+- # substitution so that $LINENO is not a special case at line end.
++ # line-number line after each line using $LINENO; the second 'sed'
++ # does the real work. The second script uses 'N' to pair each
++ # line-number line with the line containing $LINENO, and appends
++ # trailing '-' during substitution so that $LINENO is not a special
++ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+- sed '=' <$as_myself |
++ # scripts with optimization help from Paolo Bonzini. Blame Lee
++ # E. McMahon (1931-1989) for sed's syntax. :-)
++ sed -n '
++ p
++ /[$]LINENO/=
++ ' <$as_myself |
+ sed '
++ s/[$]LINENO.*/&-/
++ t lineno
++ b
++ :lineno
+ N
+- s,$,-,
+- : loop
+- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ :loop
++ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+- s,-$,,
+- s,^['$as_cr_digits']*\n,,
++ s/-\n.*//
+ ' >$as_me.lineno &&
+- chmod +x $as_me.lineno ||
+- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
++ chmod +x "$as_me.lineno" ||
++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+- # original and so on. Autoconf is especially sensible to this).
+- . ./$as_me.lineno
++ # original and so on. Autoconf is especially sensitive to this).
++ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+ }
+
+
+-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+- *c*,-n*) ECHO_N= ECHO_C='
+-' ECHO_T=' ' ;;
+- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+-esac
++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
++ as_dirname=dirname
++else
++ as_dirname=false
++fi
+
+-if expr a : '\(a\)' >/dev/null 2>&1; then
++ECHO_C= ECHO_N= ECHO_T=
++case `echo -n x` in
++-n*)
++ case `echo 'x\c'` in
++ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
++ *) ECHO_C='\c';;
++ esac;;
++*)
++ ECHO_N='-n';;
++esac
++if expr a : '\(a\)' >/dev/null 2>&1 &&
++ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+ else
+ as_expr=false
+ fi
+
+ rm -f conf$$ conf$$.exe conf$$.file
+-echo >conf$$.file
+-if ln -s conf$$.file conf$$ 2>/dev/null; then
+- # We could just check for DJGPP; but this test a) works b) is more generic
+- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+- if test -f conf$$.exe; then
+- # Don't use ln at all; we don't have any links
+- as_ln_s='cp -p'
+- else
++if test -d conf$$.dir; then
++ rm -f conf$$.dir/conf$$.file
++else
++ rm -f conf$$.dir
++ mkdir conf$$.dir 2>/dev/null
++fi
++if (echo >conf$$.file) 2>/dev/null; then
++ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
++ # ... but there are two gotchas:
++ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
++ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
++ # In both cases, we have to default to `cp -p'.
++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
++ as_ln_s='cp -p'
++ elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++ else
++ as_ln_s='cp -p'
+ fi
+-elif ln conf$$.file conf$$ 2>/dev/null; then
+- as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+-rm -f conf$$ conf$$.exe conf$$.file
++rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
++rmdir conf$$.dir 2>/dev/null
+
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+@@ -6968,7 +7813,28 @@ else
+ as_mkdir_p=false
+ fi
+
+-as_executable_p="test -f"
++if test -x / >/dev/null 2>&1; then
++ as_test_x='test -x'
++else
++ if ls -dL / >/dev/null 2>&1; then
++ as_ls_L_option=L
++ else
++ as_ls_L_option=
++ fi
++ as_test_x='
++ eval sh -c '\''
++ if test -d "$1"; then
++ test -d "$1/.";
++ else
++ case $1 in
++ -*)set "./$1";;
++ esac;
++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
++ ???[sx]*):;;*)false;;esac;fi
++ '\'' sh
++ '
++fi
++as_executable_p=$as_test_x
+
+ # Sed expression to map a string onto a valid CPP name.
+ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+@@ -6977,31 +7843,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+-# IFS
+-# We need space, tab and new line, in precisely that order.
+-as_nl='
+-'
+-IFS=" $as_nl"
+-
+-# CDPATH.
+-$as_unset CDPATH
+-
+ exec 6>&1
+
+-# Open the log real soon, to keep \$[0] and so on meaningful, and to
++# Save the log message, to keep $[0] and so on meaningful, and to
+ # report actual input values of CONFIG_FILES etc. instead of their
+-# values after options handling. Logging --version etc. is OK.
+-exec 5>>config.log
+-{
+- echo
+- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+-## Running $as_me. ##
+-_ASBOX
+-} >&5
+-cat >&5 <<_CSEOF
+-
+-This file was extended by jbig2dec $as_me 0.9pre, which was
+-generated by GNU Autoconf 2.59. Invocation command line was
++# values after options handling.
++ac_log="
++This file was extended by jbig2dec $as_me 0.10, which was
++generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -7009,45 +7858,45 @@ generated by GNU Autoconf 2.59. Invocation command line was
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+-_CSEOF
+-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+-echo >&5
++on `(hostname || uname -n) 2>/dev/null | sed 1q`
++"
++
+ _ACEOF
+
+-# Files that config.status was made for.
+-if test -n "$ac_config_files"; then
+- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+-fi
++case $ac_config_files in *"
++"*) set x $ac_config_files; shift; ac_config_files=$*;;
++esac
+
+-if test -n "$ac_config_headers"; then
+- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+-fi
++case $ac_config_headers in *"
++"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
++esac
+
+-if test -n "$ac_config_links"; then
+- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+-fi
+
+-if test -n "$ac_config_commands"; then
+- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+-fi
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++# Files that config.status was made for.
++config_files="$ac_config_files"
++config_headers="$ac_config_headers"
++config_commands="$ac_config_commands"
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++_ACEOF
+
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ ac_cs_usage="\
+ \`$as_me' instantiates files from templates according to the
+ current configuration.
+
+-Usage: $0 [OPTIONS] [FILE]...
++Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+- -V, --version print version number, then exit
+- -q, --quiet do not print progress messages
++ -V, --version print version number and configuration settings, then exit
++ -q, --quiet, --silent
++ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+- --file=FILE[:TEMPLATE]
+- instantiate the configuration file FILE
+- --header=FILE[:TEMPLATE]
+- instantiate the configuration header FILE
++ --file=FILE[:TEMPLATE]
++ instantiate the configuration file FILE
++ --header=FILE[:TEMPLATE]
++ instantiate the configuration header FILE
+
+ Configuration files:
+ $config_files
+@@ -7059,83 +7908,84 @@ Configuration commands:
+ $config_commands
+
+ Report bugs to <bug-autoconf@gnu.org>."
+-_ACEOF
+
+-cat >>$CONFIG_STATUS <<_ACEOF
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_cs_version="\\
+-jbig2dec config.status 0.9pre
+-configured by $0, generated by GNU Autoconf 2.59,
+- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
++jbig2dec config.status 0.10
++configured by $0, generated by GNU Autoconf 2.63,
++ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+-Copyright (C) 2003 Free Software Foundation, Inc.
++Copyright (C) 2008 Free Software Foundation, Inc.
+ This config.status script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it."
+-srcdir=$srcdir
+-INSTALL="$INSTALL"
++
++ac_pwd='$ac_pwd'
++srcdir='$srcdir'
++INSTALL='$INSTALL'
++MKDIR_P='$MKDIR_P'
++AWK='$AWK'
++test -n "\$AWK" || AWK=awk
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
+-# If no file are specified by the user, then we need to provide default
+-# value. By we need to know if files were specified by the user.
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
++# The default lists apply if the user does not specify any file.
+ ac_need_defaults=:
+ while test $# != 0
+ do
+ case $1 in
+ --*=*)
+- ac_option=`expr "x$1" : 'x\([^=]*\)='`
+- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
++ ac_option=`expr "X$1" : 'X\([^=]*\)='`
++ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+- -*)
++ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+- *) # This is not an option, so the user has probably given explicit
+- # arguments.
+- ac_option=$1
+- ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+-_ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+- --version | --vers* | -V )
+- echo "$ac_cs_version"; exit 0 ;;
+- --he | --h)
+- # Conflict between --help and --header
+- { { echo "$as_me:$LINENO: error: ambiguous option: $1
+-Try \`$0 --help' for more information." >&5
+-echo "$as_me: error: ambiguous option: $1
+-Try \`$0 --help' for more information." >&2;}
+- { (exit 1); exit 1; }; };;
+- --help | --hel | -h )
+- echo "$ac_cs_usage"; exit 0 ;;
+- --debug | --d* | -d )
++ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
++ $as_echo "$ac_cs_version"; exit ;;
++ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ case $ac_optarg in
++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
++ case $ac_optarg in
++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+ ac_need_defaults=false;;
++ --he | --h)
++ # Conflict between --help and --header
++ { $as_echo "$as_me: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&2
++ { (exit 1); exit 1; }; };;
++ --help | --hel | -h )
++ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+-Try \`$0 --help' for more information." >&5
+-echo "$as_me: error: unrecognized option: $1
+-Try \`$0 --help' for more information." >&2;}
++ -*) { $as_echo "$as_me: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+- *) ac_config_targets="$ac_config_targets $1" ;;
++ *) ac_config_targets="$ac_config_targets $1"
++ ac_need_defaults=false ;;
+
+ esac
+ shift
+@@ -7149,40 +7999,54 @@ if $ac_cs_silent; then
+ fi
+
+ _ACEOF
+-cat >>$CONFIG_STATUS <<_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ if \$ac_cs_recheck; then
+- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++ shift
++ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
++ CONFIG_SHELL='$SHELL'
++ export CONFIG_SHELL
++ exec "\$@"
+ fi
+
+ _ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
++exec 5>>config.log
++{
++ echo
++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
++## Running $as_me. ##
++_ASBOX
++ $as_echo "$ac_log"
++} >&5
+
+-cat >>$CONFIG_STATUS <<_ACEOF
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ #
+-# INIT-COMMANDS section.
++# INIT-COMMANDS
+ #
+-
+ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+ _ACEOF
+
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+-
+-cat >>$CONFIG_STATUS <<\_ACEOF
++# Handling of arguments.
+ for ac_config_target in $ac_config_targets
+ do
+- case "$ac_config_target" in
+- # Handling of arguments.
+- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+- "config_types.h" ) CONFIG_FILES="$CONFIG_FILES config_types.h" ;;
+- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ case $ac_config_target in
++ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
++ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
++ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++ "config_types.h") CONFIG_FILES="$CONFIG_FILES config_types.h" ;;
++
++ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ done
+
++
+ # If the user did not use the arguments to specify the items to instantiate,
+ # then the envvar interface is used. Set only those that are not.
+ # We use the long form for the default assignment because of an extremely
+@@ -7194,815 +8058,791 @@ if $ac_need_defaults; then
+ fi
+
+ # Have a temporary directory for convenience. Make it in the build tree
+-# simply because there is no reason to put it here, and in addition,
++# simply because there is no reason against having it here, and in addition,
+ # creating and moving files from /tmp can sometimes cause problems.
+-# Create a temporary directory, and hook for its removal unless debugging.
++# Hook for its removal unless debugging.
++# Note that there is a small window in which the directory will not be cleaned:
++# after its creation but before its name has been assigned to `$tmp'.
+ $debug ||
+ {
+- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ tmp=
++ trap 'exit_status=$?
++ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
++' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+ }
+-
+ # Create a (secure) tmp directory for tmp files.
+
+ {
+- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
++ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+ } ||
+ {
+- tmp=./confstat$$-$RANDOM
+- (umask 077 && mkdir $tmp)
++ tmp=./conf$$-$RANDOM
++ (umask 077 && mkdir "$tmp")
+ } ||
+ {
+- echo "$me: cannot create a temporary directory in ." >&2
++ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+ }
+
++# Set up the scripts for CONFIG_FILES section.
++# No need to generate them if there are no CONFIG_FILES.
++# This happens for instance with `./config.status config.h'.
++if test -n "$CONFIG_FILES"; then
++
++
++ac_cr=' '
++ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
++if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
++ ac_cs_awk_cr='\\r'
++else
++ ac_cs_awk_cr=$ac_cr
++fi
++
++echo 'BEGIN {' >"$tmp/subs1.awk" &&
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<_ACEOF
+
+-#
+-# CONFIG_FILES section.
+-#
++{
++ echo "cat >conf$$subs.awk <<_ACEOF" &&
++ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
++ echo "_ACEOF"
++} >conf$$subs.sh ||
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
++ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
++ac_delim='%!_!# '
++for ac_last_try in false false false false false :; do
++ . ./conf$$subs.sh ||
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
+
+-# No need to generate the scripts if there are no CONFIG_FILES.
+-# This happens for instance when ./config.status config.h
+-if test -n "\$CONFIG_FILES"; then
+- # Protect against being on the right side of a sed subst in config.status.
+- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+-s,@SHELL@,$SHELL,;t t
+-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+-s,@exec_prefix@,$exec_prefix,;t t
+-s,@prefix@,$prefix,;t t
+-s,@program_transform_name@,$program_transform_name,;t t
+-s,@bindir@,$bindir,;t t
+-s,@sbindir@,$sbindir,;t t
+-s,@libexecdir@,$libexecdir,;t t
+-s,@datadir@,$datadir,;t t
+-s,@sysconfdir@,$sysconfdir,;t t
+-s,@sharedstatedir@,$sharedstatedir,;t t
+-s,@localstatedir@,$localstatedir,;t t
+-s,@libdir@,$libdir,;t t
+-s,@includedir@,$includedir,;t t
+-s,@oldincludedir@,$oldincludedir,;t t
+-s,@infodir@,$infodir,;t t
+-s,@mandir@,$mandir,;t t
+-s,@build_alias@,$build_alias,;t t
+-s,@host_alias@,$host_alias,;t t
+-s,@target_alias@,$target_alias,;t t
+-s,@DEFS@,$DEFS,;t t
+-s,@ECHO_C@,$ECHO_C,;t t
+-s,@ECHO_N@,$ECHO_N,;t t
+-s,@ECHO_T@,$ECHO_T,;t t
+-s,@LIBS@,$LIBS,;t t
+-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+-s,@CYGPATH_W@,$CYGPATH_W,;t t
+-s,@PACKAGE@,$PACKAGE,;t t
+-s,@VERSION@,$VERSION,;t t
+-s,@ACLOCAL@,$ACLOCAL,;t t
+-s,@AUTOCONF@,$AUTOCONF,;t t
+-s,@AUTOMAKE@,$AUTOMAKE,;t t
+-s,@AUTOHEADER@,$AUTOHEADER,;t t
+-s,@MAKEINFO@,$MAKEINFO,;t t
+-s,@install_sh@,$install_sh,;t t
+-s,@STRIP@,$STRIP,;t t
+-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+-s,@mkdir_p@,$mkdir_p,;t t
+-s,@AWK@,$AWK,;t t
+-s,@SET_MAKE@,$SET_MAKE,;t t
+-s,@am__leading_dot@,$am__leading_dot,;t t
+-s,@AMTAR@,$AMTAR,;t t
+-s,@am__tar@,$am__tar,;t t
+-s,@am__untar@,$am__untar,;t t
+-s,@CC@,$CC,;t t
+-s,@CFLAGS@,$CFLAGS,;t t
+-s,@LDFLAGS@,$LDFLAGS,;t t
+-s,@CPPFLAGS@,$CPPFLAGS,;t t
+-s,@ac_ct_CC@,$ac_ct_CC,;t t
+-s,@EXEEXT@,$EXEEXT,;t t
+-s,@OBJEXT@,$OBJEXT,;t t
+-s,@DEPDIR@,$DEPDIR,;t t
+-s,@am__include@,$am__include,;t t
+-s,@am__quote@,$am__quote,;t t
+-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+-s,@CCDEPMODE@,$CCDEPMODE,;t t
+-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+-s,@RANLIB@,$RANLIB,;t t
+-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+-s,@LIBOBJS@,$LIBOBJS,;t t
+-s,@CPP@,$CPP,;t t
+-s,@EGREP@,$EGREP,;t t
+-s,@JBIG2_INT32_T@,$JBIG2_INT32_T,;t t
+-s,@JBIG2_INT16_T@,$JBIG2_INT16_T,;t t
+-s,@JBIG2_INT8_T@,$JBIG2_INT8_T,;t t
+-s,@JBIG2_STDINT_H@,$JBIG2_STDINT_H,;t t
+-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+-CEOF
+-
+-_ACEOF
+-
+- cat >>$CONFIG_STATUS <<\_ACEOF
+- # Split the substitutions into bite-sized pieces for seds with
+- # small command number limits, like on Digital OSF/1 and HP-UX.
+- ac_max_sed_lines=48
+- ac_sed_frag=1 # Number of current file.
+- ac_beg=1 # First line for current file.
+- ac_end=$ac_max_sed_lines # Line after last line for current file.
+- ac_more_lines=:
+- ac_sed_cmds=
+- while $ac_more_lines; do
+- if test $ac_beg -gt 1; then
+- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+- else
+- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+- fi
+- if test ! -s $tmp/subs.frag; then
+- ac_more_lines=false
+- else
+- # The purpose of the label and of the branching condition is to
+- # speed up the sed processing (if there are no `@' at all, there
+- # is no need to browse any of the substitutions).
+- # These are the two extra sed commands mentioned above.
+- (echo ':t
+- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+- if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+- else
+- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+- fi
+- ac_sed_frag=`expr $ac_sed_frag + 1`
+- ac_beg=$ac_end
+- ac_end=`expr $ac_end + $ac_max_sed_lines`
+- fi
+- done
+- if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds=cat
++ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
++ if test $ac_delim_n = $ac_delim_num; then
++ break
++ elif $ac_last_try; then
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
++ else
++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
++done
++rm -f conf$$subs.sh
++
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
++_ACEOF
++sed -n '
++h
++s/^/S["/; s/!.*/"]=/
++p
++g
++s/^[^!]*!//
++:repl
++t repl
++s/'"$ac_delim"'$//
++t delim
++:nl
++h
++s/\(.\{148\}\).*/\1/
++t more1
++s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
++p
++n
++b repl
++:more1
++s/["\\]/\\&/g; s/^/"/; s/$/"\\/
++p
++g
++s/.\{148\}//
++t nl
++:delim
++h
++s/\(.\{148\}\).*/\1/
++t more2
++s/["\\]/\\&/g; s/^/"/; s/$/"/
++p
++b
++:more2
++s/["\\]/\\&/g; s/^/"/; s/$/"\\/
++p
++g
++s/.\{148\}//
++t delim
++' <conf$$subs.awk | sed '
++/^[^""]/{
++ N
++ s/\n//
++}
++' >>$CONFIG_STATUS || ac_write_fail=1
++rm -f conf$$subs.awk
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++_ACAWK
++cat >>"\$tmp/subs1.awk" <<_ACAWK &&
++ for (key in S) S_is_set[key] = 1
++ FS = ""
++
++}
++{
++ line = $ 0
++ nfields = split(line, field, "@")
++ substed = 0
++ len = length(field[1])
++ for (i = 2; i < nfields; i++) {
++ key = field[i]
++ keylen = length(key)
++ if (S_is_set[key]) {
++ value = S[key]
++ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
++ len += length(value) + length(field[++i])
++ substed = 1
++ } else
++ len += 1 + keylen
++ }
++
++ print line
++}
++
++_ACAWK
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
++if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
++ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
++else
++ cat
++fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
++ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
++$as_echo "$as_me: error: could not setup config files machinery" >&2;}
++ { (exit 1); exit 1; }; }
++_ACEOF
++
++# VPATH may cause trouble with some makes, so we remove $(srcdir),
++# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
++# trailing colons and then remove the whole line if VPATH becomes empty
++# (actually we leave an empty line to preserve line numbers).
++if test "x$srcdir" = x.; then
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
++s/:*\$(srcdir):*/:/
++s/:*\${srcdir}:*/:/
++s/:*@srcdir@:*/:/
++s/^\([^=]*=[ ]*\):*/\1/
++s/:*$//
++s/^[^=]*=[ ]*$//
++}'
++fi
++
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ fi # test -n "$CONFIG_FILES"
+
++# Set up the scripts for CONFIG_HEADERS section.
++# No need to generate them if there are no CONFIG_HEADERS.
++# This happens for instance with `./config.status Makefile'.
++if test -n "$CONFIG_HEADERS"; then
++cat >"$tmp/defines.awk" <<\_ACAWK ||
++BEGIN {
+ _ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
+-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+- case $ac_file in
+- - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+- * ) ac_file_in=$ac_file.in ;;
++
++# Transform confdefs.h into an awk script `defines.awk', embedded as
++# here-document in config.status, that substitutes the proper values into
++# config.h.in to produce config.h.
++
++# Create a delimiter string that does not exist in confdefs.h, to ease
++# handling of long lines.
++ac_delim='%!_!# '
++for ac_last_try in false false :; do
++ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
++ if test -z "$ac_t"; then
++ break
++ elif $ac_last_try; then
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
++ { (exit 1); exit 1; }; }
++ else
++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
++ fi
++done
++
++# For the awk script, D is an array of macro values keyed by name,
++# likewise P contains macro parameters if any. Preserve backslash
++# newline sequences.
++
++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
++sed -n '
++s/.\{148\}/&'"$ac_delim"'/g
++t rset
++:rset
++s/^[ ]*#[ ]*define[ ][ ]*/ /
++t def
++d
++:def
++s/\\$//
++t bsnl
++s/["\\]/\\&/g
++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
++D["\1"]=" \3"/p
++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
++d
++:bsnl
++s/["\\]/\\&/g
++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
++D["\1"]=" \3\\\\\\n"\\/p
++t cont
++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
++t cont
++d
++:cont
++n
++s/.\{148\}/&'"$ac_delim"'/g
++t clear
++:clear
++s/\\$//
++t bsnlc
++s/["\\]/\\&/g; s/^/"/; s/$/"/p
++d
++:bsnlc
++s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
++b cont
++' <confdefs.h | sed '
++s/'"$ac_delim"'/"\\\
++"/g' >>$CONFIG_STATUS || ac_write_fail=1
++
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++ for (key in D) D_is_set[key] = 1
++ FS = ""
++}
++/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
++ line = \$ 0
++ split(line, arg, " ")
++ if (arg[1] == "#") {
++ defundef = arg[2]
++ mac1 = arg[3]
++ } else {
++ defundef = substr(arg[1], 2)
++ mac1 = arg[2]
++ }
++ split(mac1, mac2, "(") #)
++ macro = mac2[1]
++ prefix = substr(line, 1, index(line, defundef) - 1)
++ if (D_is_set[macro]) {
++ # Preserve the white space surrounding the "#".
++ print prefix "define", macro P[macro] D[macro]
++ next
++ } else {
++ # Replace #undef with comments. This is necessary, for example,
++ # in the case of _POSIX_SOURCE, which is predefined and required
++ # on some systems where configure will not decide to define it.
++ if (defundef == "undef") {
++ print "/*", prefix defundef, macro, "*/"
++ next
++ }
++ }
++}
++{ print }
++_ACAWK
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
++ { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
++$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
++ { (exit 1); exit 1; }; }
++fi # test -n "$CONFIG_HEADERS"
++
++
++eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
++shift
++for ac_tag
++do
++ case $ac_tag in
++ :[FHLC]) ac_mode=$ac_tag; continue;;
++ esac
++ case $ac_mode$ac_tag in
++ :[FHL]*:*);;
++ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
++$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
++ { (exit 1); exit 1; }; };;
++ :[FH]-) ac_tag=-:-;;
++ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
++ esac
++ ac_save_IFS=$IFS
++ IFS=:
++ set x $ac_tag
++ IFS=$ac_save_IFS
++ shift
++ ac_file=$1
++ shift
++
++ case $ac_mode in
++ :L) ac_source=$1;;
++ :[FH])
++ ac_file_inputs=
++ for ac_f
++ do
++ case $ac_f in
++ -) ac_f="$tmp/stdin";;
++ *) # Look for the file first in the build tree, then in the source tree
++ # (if the path is not absolute). The absolute path cannot be DOS-style,
++ # because $ac_f cannot contain `:'.
++ test -f "$ac_f" ||
++ case $ac_f in
++ [\\/$]*) false;;
++ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
++ esac ||
++ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
++$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
++ { (exit 1); exit 1; }; };;
++ esac
++ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
++ ac_file_inputs="$ac_file_inputs '$ac_f'"
++ done
++
++ # Let's still pretend it is `configure' which instantiates (i.e., don't
++ # use $as_me), people would be surprised to read:
++ # /* config.h. Generated by config.status. */
++ configure_input='Generated from '`
++ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
++ `' by configure.'
++ if test x"$ac_file" != x-; then
++ configure_input="$ac_file. $configure_input"
++ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
++$as_echo "$as_me: creating $ac_file" >&6;}
++ fi
++ # Neutralize special characters interpreted by sed in replacement strings.
++ case $configure_input in #(
++ *\&* | *\|* | *\\* )
++ ac_sed_conf_input=`$as_echo "$configure_input" |
++ sed 's/[\\\\&|]/\\\\&/g'`;; #(
++ *) ac_sed_conf_input=$configure_input;;
++ esac
++
++ case $ac_tag in
++ *:-:* | *:-) cat >"$tmp/stdin" \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++ ;;
+ esac
+
+- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++ ac_dir=`$as_dirname -- "$ac_file" ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$ac_file" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- { if $as_mkdir_p; then
+- mkdir -p "$ac_dir"
+- else
+- as_dir="$ac_dir"
++ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
++ { as_dir="$ac_dir"
++ case $as_dir in #(
++ -*) as_dir=./$as_dir;;
++ esac
++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+- while test ! -d "$as_dir"; do
+- as_dirs="$as_dir $as_dirs"
+- as_dir=`(dirname "$as_dir") 2>/dev/null ||
++ while :; do
++ case $as_dir in #(
++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
++ *) as_qdir=$as_dir;;
++ esac
++ as_dirs="'$as_qdir' $as_dirs"
++ as_dir=`$as_dirname -- "$as_dir" ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$as_dir" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
++ test -d "$as_dir" && break
+ done
+- test ! -n "$as_dirs" || mkdir $as_dirs
+- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ test -z "$as_dirs" || eval "mkdir $as_dirs"
++ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
++$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+-
+ ac_builddir=.
+
+-if test "$ac_dir" != .; then
+- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+- # A "../" for each directory in $ac_dir_suffix.
+- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+-else
+- ac_dir_suffix= ac_top_builddir=
+-fi
++case "$ac_dir" in
++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
++*)
++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
++ # A ".." for each directory in $ac_dir_suffix.
++ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
++ case $ac_top_builddir_sub in
++ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
++ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
++ esac ;;
++esac
++ac_abs_top_builddir=$ac_pwd
++ac_abs_builddir=$ac_pwd$ac_dir_suffix
++# for backward compatibility:
++ac_top_builddir=$ac_top_build_prefix
+
+ case $srcdir in
+- .) # No --srcdir option. We are building in place.
++ .) # We are building in place.
+ ac_srcdir=.
+- if test -z "$ac_top_builddir"; then
+- ac_top_srcdir=.
+- else
+- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+- fi ;;
+- [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_top_srcdir=$ac_top_builddir_sub
++ ac_abs_top_srcdir=$ac_pwd ;;
++ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+- ac_top_srcdir=$srcdir ;;
+- *) # Relative path.
+- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+- ac_top_srcdir=$ac_top_builddir$srcdir ;;
++ ac_top_srcdir=$srcdir
++ ac_abs_top_srcdir=$srcdir ;;
++ *) # Relative name.
++ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_build_prefix$srcdir
++ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ esac
++ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+-# Do not use `cd foo && pwd` to compute absolute paths, because
+-# the directories may not exist.
+-case `pwd` in
+-.) ac_abs_builddir="$ac_dir";;
+-*)
+- case "$ac_dir" in
+- .) ac_abs_builddir=`pwd`;;
+- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+- *) ac_abs_builddir=`pwd`/"$ac_dir";;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_builddir=${ac_top_builddir}.;;
+-*)
+- case ${ac_top_builddir}. in
+- .) ac_abs_top_builddir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_srcdir=$ac_srcdir;;
+-*)
+- case $ac_srcdir in
+- .) ac_abs_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_srcdir=$ac_top_srcdir;;
+-*)
+- case $ac_top_srcdir in
+- .) ac_abs_top_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+- esac;;
+-esac
+
++ case $ac_mode in
++ :F)
++ #
++ # CONFIG_FILE
++ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
++ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
++ ac_MKDIR_P=$MKDIR_P
++ case $MKDIR_P in
++ [\\/$]* | ?:[\\/]* ) ;;
++ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
++ esac
++_ACEOF
+
+- if test x"$ac_file" != x-; then
+- { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
+- rm -f "$ac_file"
+- fi
+- # Let's still pretend it is `configure' which instantiates (i.e., don't
+- # use $as_me), people would be surprised to read:
+- # /* config.h. Generated by config.status. */
+- if test x"$ac_file" = x-; then
+- configure_input=
+- else
+- configure_input="$ac_file. "
+- fi
+- configure_input=$configure_input"Generated from `echo $ac_file_in |
+- sed 's,.*/,,'` by configure."
+-
+- # First look for the input files in the build tree, otherwise in the
+- # src tree.
+- ac_file_inputs=`IFS=:
+- for f in $ac_file_in; do
+- case $f in
+- -) echo $tmp/stdin ;;
+- [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+-echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
+- echo "$f";;
+- *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo "$f"
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo "$srcdir/$f"
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+-echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
+- fi;;
+- esac
+- done` || { (exit 1); exit 1; }
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
++# If the template does not know about datarootdir, expand it.
++# FIXME: This hack should be removed a few years after 2.60.
++ac_datarootdir_hack=; ac_datarootdir_seen=
++
++ac_sed_dataroot='
++/datarootdir/ {
++ p
++ q
++}
++/@datadir@/p
++/@docdir@/p
++/@infodir@/p
++/@localedir@/p
++/@mandir@/p
++'
++case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
++*datarootdir*) ac_datarootdir_seen=yes;;
++*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
++$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++ ac_datarootdir_hack='
++ s&@datadir@&$datadir&g
++ s&@docdir@&$docdir&g
++ s&@infodir@&$infodir&g
++ s&@localedir@&$localedir&g
++ s&@mandir@&$mandir&g
++ s&\\\${datarootdir}&$datarootdir&g' ;;
++esac
+ _ACEOF
+-cat >>$CONFIG_STATUS <<_ACEOF
+- sed "$ac_vpsub
++
++# Neutralize VPATH when `$srcdir' = `.'.
++# Shell code in configure.ac might set extrasub.
++# FIXME: do we really want to maintain this feature?
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++ac_sed_extra="$ac_vpsub
+ $extrasub
+ _ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ :t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+-s,@configure_input@,$configure_input,;t t
+-s,@srcdir@,$ac_srcdir,;t t
+-s,@abs_srcdir@,$ac_abs_srcdir,;t t
+-s,@top_srcdir@,$ac_top_srcdir,;t t
+-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+-s,@builddir@,$ac_builddir,;t t
+-s,@abs_builddir@,$ac_abs_builddir,;t t
+-s,@top_builddir@,$ac_top_builddir,;t t
+-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+-s,@INSTALL@,$ac_INSTALL,;t t
+-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+- rm -f $tmp/stdin
+- if test x"$ac_file" != x-; then
+- mv $tmp/out $ac_file
+- else
+- cat $tmp/out
+- rm -f $tmp/out
+- fi
++s|@configure_input@|$ac_sed_conf_input|;t t
++s&@top_builddir@&$ac_top_builddir_sub&;t t
++s&@top_build_prefix@&$ac_top_build_prefix&;t t
++s&@srcdir@&$ac_srcdir&;t t
++s&@abs_srcdir@&$ac_abs_srcdir&;t t
++s&@top_srcdir@&$ac_top_srcdir&;t t
++s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
++s&@builddir@&$ac_builddir&;t t
++s&@abs_builddir@&$ac_abs_builddir&;t t
++s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
++s&@INSTALL@&$ac_INSTALL&;t t
++s&@MKDIR_P@&$ac_MKDIR_P&;t t
++$ac_datarootdir_hack
++"
++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; }
+
+-done
+-_ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
++ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
++which seems to be undefined. Please make sure it is defined." >&5
++$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
++which seems to be undefined. Please make sure it is defined." >&2;}
+
+-#
+-# CONFIG_HEADER section.
+-#
+-
+-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+-# NAME is the cpp macro being defined and VALUE is the value it is being given.
+-#
+-# ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+-ac_dB='[ ].*$,\1#\2'
+-ac_dC=' '
+-ac_dD=',;t'
+-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+-ac_uB='$,\1#\2define\3'
+-ac_uC=' '
+-ac_uD=',;t'
+-
+-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ rm -f "$tmp/stdin"
+ case $ac_file in
+- - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+- * ) ac_file_in=$ac_file.in ;;
+- esac
+-
+- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
+-
+- # First look for the input files in the build tree, otherwise in the
+- # src tree.
+- ac_file_inputs=`IFS=:
+- for f in $ac_file_in; do
+- case $f in
+- -) echo $tmp/stdin ;;
+- [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+-echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
+- # Do quote $f, to prevent DOS paths from being IFS'd.
+- echo "$f";;
+- *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo "$f"
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo "$srcdir/$f"
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+-echo "$as_me: error: cannot find input file: $f" >&2;}
++ -) cat "$tmp/out" && rm -f "$tmp/out";;
++ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
++ esac \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+- fi;;
+- esac
+- done` || { (exit 1); exit 1; }
+- # Remove the trailing spaces.
+- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+-
+-_ACEOF
+-
+-# Transform confdefs.h into two sed scripts, `conftest.defines' and
+-# `conftest.undefs', that substitutes the proper values into
+-# config.h.in to produce config.h. The first handles `#define'
+-# templates, and the second `#undef' templates.
+-# And first: Protect against being on the right side of a sed subst in
+-# config.status. Protect against being in an unquoted here document
+-# in config.status.
+-rm -f conftest.defines conftest.undefs
+-# Using a here document instead of a string reduces the quoting nightmare.
+-# Putting comments in sed scripts is not portable.
+-#
+-# `end' is used to avoid that the second main sed command (meant for
+-# 0-ary CPP macros) applies to n-ary macro definitions.
+-# See the Autoconf documentation for `clear'.
+-cat >confdef2sed.sed <<\_ACEOF
+-s/[\\&,]/\\&/g
+-s,[\\$`],\\&,g
+-t clear
+-: clear
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+-t end
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+-: end
+-_ACEOF
+-# If some macros were called several times there might be several times
+-# the same #defines, which is useless. Nevertheless, we may not want to
+-# sort them, since we want the *last* AC-DEFINE to be honored.
+-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+-rm -f confdef2sed.sed
+-
+-# This sed command replaces #undef with comments. This is necessary, for
+-# example, in the case of _POSIX_SOURCE, which is predefined and required
+-# on some systems where configure will not decide to define it.
+-cat >>conftest.undefs <<\_ACEOF
+-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+-_ACEOF
+-
+-# Break up conftest.defines because some shells have a limit on the size
+-# of here documents, and old seds have small limits too (100 cmds).
+-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+-echo ' :' >>$CONFIG_STATUS
+-rm -f conftest.tail
+-while grep . conftest.defines >/dev/null
+-do
+- # Write a limited-size here document to $tmp/defines.sed.
+- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+- # Speed up: don't consider the non `#define' lines.
+- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+- # Work around the forget-to-reset-the-flag bug.
+- echo 't clr' >>$CONFIG_STATUS
+- echo ': clr' >>$CONFIG_STATUS
+- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+- echo 'CEOF
+- sed -f $tmp/defines.sed $tmp/in >$tmp/out
+- rm -f $tmp/in
+- mv $tmp/out $tmp/in
+-' >>$CONFIG_STATUS
+- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+- rm -f conftest.defines
+- mv conftest.tail conftest.defines
+-done
+-rm -f conftest.defines
+-echo ' fi # grep' >>$CONFIG_STATUS
+-echo >>$CONFIG_STATUS
+-
+-# Break up conftest.undefs because some shells have a limit on the size
+-# of here documents, and old seds have small limits too (100 cmds).
+-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+-rm -f conftest.tail
+-while grep . conftest.undefs >/dev/null
+-do
+- # Write a limited-size here document to $tmp/undefs.sed.
+- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+- # Speed up: don't consider the non `#undef'
+- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+- # Work around the forget-to-reset-the-flag bug.
+- echo 't clr' >>$CONFIG_STATUS
+- echo ': clr' >>$CONFIG_STATUS
+- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+- echo 'CEOF
+- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+- rm -f $tmp/in
+- mv $tmp/out $tmp/in
+-' >>$CONFIG_STATUS
+- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+- rm -f conftest.undefs
+- mv conftest.tail conftest.undefs
+-done
+-rm -f conftest.undefs
+-
+-cat >>$CONFIG_STATUS <<\_ACEOF
+- # Let's still pretend it is `configure' which instantiates (i.e., don't
+- # use $as_me), people would be surprised to read:
+- # /* config.h. Generated by config.status. */
+- if test x"$ac_file" = x-; then
+- echo "/* Generated by configure. */" >$tmp/config.h
+- else
+- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+- fi
+- cat $tmp/in >>$tmp/config.h
+- rm -f $tmp/in
++ ;;
++ :H)
++ #
++ # CONFIG_HEADER
++ #
+ if test x"$ac_file" != x-; then
+- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+-echo "$as_me: $ac_file is unchanged" >&6;}
++ {
++ $as_echo "/* $configure_input */" \
++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
++ } >"$tmp/config.h" \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; }
++ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
++ { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
++$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_file" : 'X\(//\)[^/]' \| \
+- X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$ac_file" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- { if $as_mkdir_p; then
+- mkdir -p "$ac_dir"
+- else
+- as_dir="$ac_dir"
+- as_dirs=
+- while test ! -d "$as_dir"; do
+- as_dirs="$as_dir $as_dirs"
+- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$as_dir" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- done
+- test ! -n "$as_dirs" || mkdir $as_dirs
+- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+- { (exit 1); exit 1; }; }; }
+-
+- rm -f $ac_file
+- mv $tmp/config.h $ac_file
++ rm -f "$ac_file"
++ mv "$tmp/config.h" "$ac_file" \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+ else
+- cat $tmp/config.h
+- rm -f $tmp/config.h
++ $as_echo "/* $configure_input */" \
++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
++ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
++$as_echo "$as_me: error: could not create -" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+-# Compute $ac_file's index in $config_headers.
++# Compute "$ac_file"'s index in $config_headers.
++_am_arg="$ac_file"
+ _am_stamp_count=1
+ for _am_header in $config_headers :; do
+ case $_am_header in
+- $ac_file | $ac_file:* )
++ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+ done
+-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X$ac_file : 'X\(//\)[^/]' \| \
+- X$ac_file : 'X\(//\)$' \| \
+- X$ac_file : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X$ac_file |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`/stamp-h$_am_stamp_count
+-done
+-_ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
+-
+-#
+-# CONFIG_COMMANDS section.
+-#
+-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_dest" : 'X\(//\)[^/]' \| \
+- X"$ac_dest" : 'X\(//\)$' \| \
+- X"$ac_dest" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$ac_dest" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- { if $as_mkdir_p; then
+- mkdir -p "$ac_dir"
+- else
+- as_dir="$ac_dir"
+- as_dirs=
+- while test ! -d "$as_dir"; do
+- as_dirs="$as_dir $as_dirs"
+- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$as_dir" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- done
+- test ! -n "$as_dirs" || mkdir $as_dirs
+- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+- { (exit 1); exit 1; }; }; }
+-
+- ac_builddir=.
+-
+-if test "$ac_dir" != .; then
+- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+- # A "../" for each directory in $ac_dir_suffix.
+- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+-else
+- ac_dir_suffix= ac_top_builddir=
+-fi
+-
+-case $srcdir in
+- .) # No --srcdir option. We are building in place.
+- ac_srcdir=.
+- if test -z "$ac_top_builddir"; then
+- ac_top_srcdir=.
+- else
+- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+- fi ;;
+- [\\/]* | ?:[\\/]* ) # Absolute path.
+- ac_srcdir=$srcdir$ac_dir_suffix;
+- ac_top_srcdir=$srcdir ;;
+- *) # Relative path.
+- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+-esac
++echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
++$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$_am_arg" : 'X\(//\)[^/]' \| \
++ X"$_am_arg" : 'X\(//\)$' \| \
++ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$_am_arg" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`/stamp-h$_am_stamp_count
++ ;;
+
+-# Do not use `cd foo && pwd` to compute absolute paths, because
+-# the directories may not exist.
+-case `pwd` in
+-.) ac_abs_builddir="$ac_dir";;
+-*)
+- case "$ac_dir" in
+- .) ac_abs_builddir=`pwd`;;
+- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+- *) ac_abs_builddir=`pwd`/"$ac_dir";;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_builddir=${ac_top_builddir}.;;
+-*)
+- case ${ac_top_builddir}. in
+- .) ac_abs_top_builddir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_srcdir=$ac_srcdir;;
+-*)
+- case $ac_srcdir in
+- .) ac_abs_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+- esac;;
+-esac
+-case $ac_abs_builddir in
+-.) ac_abs_top_srcdir=$ac_top_srcdir;;
+-*)
+- case $ac_top_srcdir in
+- .) ac_abs_top_srcdir=$ac_abs_builddir;;
+- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+- esac;;
+-esac
++ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
++$as_echo "$as_me: executing $ac_file commands" >&6;}
++ ;;
++ esac
+
+
+- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+-echo "$as_me: executing $ac_dest commands" >&6;}
+- case $ac_dest in
+- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+- # Strip MF so we end up with the name of the file.
+- mf=`echo "$mf" | sed -e 's/:.*$//'`
+- # Check whether this is an Automake generated Makefile or not.
+- # We used to match only the files named `Makefile.in', but
+- # some people rename them; so instead we look at the file content.
+- # Grep'ing the first line is not enough: some people post-process
+- # each Makefile.in and add a new line on top of each file to say so.
+- # So let's grep whole file.
+- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+- dirpart=`(dirname "$mf") 2>/dev/null ||
++ case $ac_file$ac_mode in
++ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
++ # Autoconf 2.62 quotes --file arguments for eval, but not when files
++ # are listed without --file. Let's play safe and only enable the eval
++ # if we detect the quoting.
++ case $CONFIG_FILES in
++ *\'*) eval set x "$CONFIG_FILES" ;;
++ *) set x $CONFIG_FILES ;;
++ esac
++ shift
++ for mf
++ do
++ # Strip MF so we end up with the name of the file.
++ mf=`echo "$mf" | sed -e 's/:.*$//'`
++ # Check whether this is an Automake generated Makefile or not.
++ # We used to match only the files named `Makefile.in', but
++ # some people rename them; so instead we look at the file content.
++ # Grep'ing the first line is not enough: some people post-process
++ # each Makefile.in and add a new line on top of each file to say so.
++ # Grep'ing the whole file is not good either: AIX grep has a line
++ # limit of 2048, but all sed's we know have understand at least 4000.
++ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
++ dirpart=`$as_dirname -- "$mf" ||
+ $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+- X"$mf" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$mf" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- else
+- continue
+- fi
+- # Extract the definition of DEPDIR, am__include, and am__quote
+- # from the Makefile without running `make'.
+- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+- test -z "$DEPDIR" && continue
+- am__include=`sed -n 's/^am__include = //p' < "$mf"`
+- test -z "am__include" && continue
+- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+- # When using ansi2knr, U may be empty or an underscore; expand it
+- U=`sed -n 's/^U = //p' < "$mf"`
+- # Find all dependency output files, they are included files with
+- # $(DEPDIR) in their names. We invoke sed twice because it is the
+- # simplest approach to changing $(DEPDIR) to its actual value in the
+- # expansion.
+- for file in `sed -n "
+- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+- # Make sure the directory exists.
+- test -f "$dirpart/$file" && continue
+- fdir=`(dirname "$file") 2>/dev/null ||
++ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$mf" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
++ else
++ continue
++ fi
++ # Extract the definition of DEPDIR, am__include, and am__quote
++ # from the Makefile without running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ am__include=`sed -n 's/^am__include = //p' < "$mf"`
++ test -z "am__include" && continue
++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ # Find all dependency output files, they are included files with
++ # $(DEPDIR) in their names. We invoke sed twice because it is the
++ # simplest approach to changing $(DEPDIR) to its actual value in the
++ # expansion.
++ for file in `sed -n "
++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
++ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
++ # Make sure the directory exists.
++ test -f "$dirpart/$file" && continue
++ fdir=`$as_dirname -- "$file" ||
+ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+- X"$file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$file" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
+- { if $as_mkdir_p; then
+- mkdir -p $dirpart/$fdir
+- else
+- as_dir=$dirpart/$fdir
++ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
++ { as_dir=$dirpart/$fdir
++ case $as_dir in #(
++ -*) as_dir=./$as_dir;;
++ esac
++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+- while test ! -d "$as_dir"; do
+- as_dirs="$as_dir $as_dirs"
+- as_dir=`(dirname "$as_dir") 2>/dev/null ||
++ while :; do
++ case $as_dir in #(
++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
++ *) as_qdir=$as_dir;;
++ esac
++ as_dirs="'$as_qdir' $as_dirs"
++ as_dir=`$as_dirname -- "$as_dir" ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
+-echo X"$as_dir" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'`
++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
++$as_echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'`
++ test -d "$as_dir" && break
+ done
+- test ! -n "$as_dirs" || mkdir $as_dirs
+- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
++ test -z "$as_dirs" || eval "mkdir $as_dirs"
++ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
++$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+-
+- # echo "creating $dirpart/$file"
+- echo '# dummy' > "$dirpart/$file"
++ # echo "creating $dirpart/$file"
++ echo '# dummy' > "$dirpart/$file"
++ done
+ done
+-done
++}
+ ;;
++
+ esac
+-done
+-_ACEOF
++done # for ac_tag
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
+
+ { (exit 0); exit 0; }
+ _ACEOF
+ chmod +x $CONFIG_STATUS
+ ac_clean_files=$ac_clean_files_save
+
++test $ac_write_fail = 0 ||
++ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
++
+
+ # configure is writing to config.log, and then calls config.status.
+ # config.status does its own redirection, appending to config.log.
+@@ -8024,4 +8864,8 @@ if test "$no_create" != yes; then
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+ fi
++if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
++ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
++$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
++fi
+
+diff --git a/jbig2dec/configure.ac b/jbig2dec/configure.ac
+--- a/jbig2dec/configure.ac
++++ b/jbig2dec/configure.ac
+@@ -1,16 +1,15 @@
+ # Process this file with autoconf to produce a configure script.
+
+-AC_INIT([jbig2dec], [0.9pre], [jbig2-dev@ghostscript.com])
++AC_INIT([jbig2dec], [0.10], [jbig2-dev@ghostscript.com])
+ AC_PREREQ(2.53)
+ AC_CONFIG_SRCDIR([jbig2dec.c])
+
+ AM_INIT_AUTOMAKE([-Wall])
+ AM_CONFIG_HEADER(config.h)
+
+-dnl AC_REVISION([$Rev: 8022 $])
+-
+ # Checks for programs.
+ AC_PROG_CC
++AM_PROG_CC_C_O
+ AC_PROG_RANLIB
+
+ # platform specific compiler flags
+diff --git a/jbig2dec/depcomp b/jbig2dec/depcomp
+--- a/jbig2dec/depcomp
++++ b/jbig2dec/depcomp
+@@ -1,9 +1,10 @@
+ #! /bin/sh
+ # depcomp - compile a program generating dependencies as side-effects
+
+-scriptversion=2005-02-09.22
++scriptversion=2007-03-29.01
+
+-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
++# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
++# Foundation, Inc.
+
+ # 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
+@@ -17,8 +18,8 @@ scriptversion=2005-02-09.22
+
+ # 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.
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301, USA.
+
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -91,7 +92,20 @@ gcc3)
+ ## gcc 3 implements dependency tracking that does exactly what
+ ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+ ## it if -MD -MP comes after the -MF stuff. Hmm.
+- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
++## Unfortunately, FreeBSD c89 acceptance of flags depends upon
++## the command line argument order; so add the flags where they
++## appear in depend2.am. Note that the slowdown incurred here
++## affects only configure: in makefiles, %FASTDEP% shortcuts this.
++ for arg
++ do
++ case $arg in
++ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
++ *) set fnord "$@" "$arg" ;;
++ esac
++ shift # fnord
++ shift # $arg
++ done
++ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+@@ -201,34 +215,39 @@ aix)
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+- tmpdepfile="$stripped.u"
++ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
++ test "x$dir" = "x$object" && dir=
++ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
++ tmpdepfile1=$dir$base.u
++ tmpdepfile2=$base.u
++ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
++ tmpdepfile1=$dir$base.u
++ tmpdepfile2=$dir$base.u
++ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+- if test -f "$tmpdepfile"; then :
+- else
+- stripped=`echo "$stripped" | sed 's,^.*/,,'`
+- tmpdepfile="$stripped.u"
+- fi
+-
+ if test $stat -eq 0; then :
+ else
+- rm -f "$tmpdepfile"
++ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
++ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
++ do
++ test -f "$tmpdepfile" && break
++ done
+ if test -f "$tmpdepfile"; then
+- outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
++ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
++ # That's a tab and a space in the [].
++ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+@@ -276,6 +295,46 @@ icc)
+ rm -f "$tmpdepfile"
+ ;;
+
++hp2)
++ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
++ # compilers, which have integrated preprocessors. The correct option
++ # to use with these is +Maked; it writes dependencies to a file named
++ # 'foo.d', which lands next to the object file, wherever that
++ # happens to be.
++ # Much of this is similar to the tru64 case; see comments there.
++ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
++ test "x$dir" = "x$object" && dir=
++ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
++ if test "$libtool" = yes; then
++ tmpdepfile1=$dir$base.d
++ tmpdepfile2=$dir.libs/$base.d
++ "$@" -Wc,+Maked
++ else
++ tmpdepfile1=$dir$base.d
++ tmpdepfile2=$dir$base.d
++ "$@" +Maked
++ fi
++ stat=$?
++ if test $stat -eq 0; then :
++ else
++ rm -f "$tmpdepfile1" "$tmpdepfile2"
++ exit $stat
++ fi
++
++ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
++ do
++ test -f "$tmpdepfile" && break
++ done
++ if test -f "$tmpdepfile"; then
++ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
++ # Add `dependent.h:' lines.
++ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
++ else
++ echo "#dummy" > "$depfile"
++ fi
++ rm -f "$tmpdepfile" "$tmpdepfile2"
++ ;;
++
+ tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+@@ -288,13 +347,13 @@ tru64)
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+- # static library. This mecanism is used in libtool 1.4 series to
++ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+- # compilations output dependencies in in $dir.libs/$base.o.d and
++ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+@@ -467,7 +526,8 @@ cpp)
+ done
+
+ "$@" -E |
+- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
++ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
++ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+diff --git a/jbig2dec/install-sh b/jbig2dec/install-sh
+--- a/jbig2dec/install-sh
++++ b/jbig2dec/install-sh
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # install - install a program, script, or datafile
+
+-scriptversion=2005-02-02.21
++scriptversion=2006-12-25.00
+
+ # This originates from X11R5 (mit/util/scripts/install.sh), which was
+ # later released in X11R6 (xc/config/util/install.sh) with the
+@@ -39,38 +39,68 @@ scriptversion=2005-02-02.21
+ # when there is no Makefile.
+ #
+ # This script is compatible with the BSD install script, but was written
+-# from scratch. It can only install one file at a time, a restriction
+-# shared with many OS's install programs.
++# from scratch.
++
++nl='
++'
++IFS=" "" $nl"
+
+ # set DOITPROG to echo to test this script
+
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
+-doit="${DOITPROG-}"
++doit=${DOITPROG-}
++if test -z "$doit"; then
++ doit_exec=exec
++else
++ doit_exec=$doit
++fi
+
+-# put in absolute paths if you don't have them in your path; or use env. vars.
++# Put in absolute file names if you don't have them in your path;
++# or use environment vars.
++
++chgrpprog=${CHGRPPROG-chgrp}
++chmodprog=${CHMODPROG-chmod}
++chownprog=${CHOWNPROG-chown}
++cmpprog=${CMPPROG-cmp}
++cpprog=${CPPROG-cp}
++mkdirprog=${MKDIRPROG-mkdir}
++mvprog=${MVPROG-mv}
++rmprog=${RMPROG-rm}
++stripprog=${STRIPPROG-strip}
++
++posix_glob='?'
++initialize_posix_glob='
++ test "$posix_glob" != "?" || {
++ if (set -f) 2>/dev/null; then
++ posix_glob=
++ else
++ posix_glob=:
++ fi
++ }
++'
+
+-mvprog="${MVPROG-mv}"
+-cpprog="${CPPROG-cp}"
+-chmodprog="${CHMODPROG-chmod}"
+-chownprog="${CHOWNPROG-chown}"
+-chgrpprog="${CHGRPPROG-chgrp}"
+-stripprog="${STRIPPROG-strip}"
+-rmprog="${RMPROG-rm}"
+-mkdirprog="${MKDIRPROG-mkdir}"
++posix_mkdir=
++
++# Desired mode of installed file.
++mode=0755
+
+-chmodcmd="$chmodprog 0755"
+-chowncmd=
+ chgrpcmd=
+-stripcmd=
++chmodcmd=$chmodprog
++chowncmd=
++mvcmd=$mvprog
+ rmcmd="$rmprog -f"
+-mvcmd="$mvprog"
++stripcmd=
++
+ src=
+ dst=
+ dir_arg=
+-dstarg=
++dst_arg=
++
++copy_on_change=false
+ no_target_directory=
+
+-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
++usage="\
++Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+@@ -80,81 +110,86 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+ In the 4th, create DIRECTORIES.
+
+ Options:
+--c (ignored)
+--d create directories instead of installing files.
+--g GROUP $chgrpprog installed files to GROUP.
+--m MODE $chmodprog installed files to MODE.
+--o USER $chownprog installed files to USER.
+--s $stripprog installed files.
+--t DIRECTORY install into DIRECTORY.
+--T report an error if DSTFILE is a directory.
+---help display this help and exit.
+---version display version info and exit.
++ --help display this help and exit.
++ --version display version info and exit.
++
++ -c (ignored)
++ -C install only if different (preserve the last data modification time)
++ -d create directories instead of installing files.
++ -g GROUP $chgrpprog installed files to GROUP.
++ -m MODE $chmodprog installed files to MODE.
++ -o USER $chownprog installed files to USER.
++ -s $stripprog installed files.
++ -t DIRECTORY install into DIRECTORY.
++ -T report an error if DSTFILE is a directory.
+
+ Environment variables override the default commands:
+- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
++ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
++ RMPROG STRIPPROG
+ "
+
+-while test -n "$1"; do
++while test $# -ne 0; do
+ case $1 in
+- -c) shift
+- continue;;
++ -c) ;;
++
++ -C) copy_on_change=true;;
+
+- -d) dir_arg=true
+- shift
+- continue;;
++ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+- shift
+- shift
+- continue;;
++ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+- -m) chmodcmd="$chmodprog $2"
+- shift
+- shift
+- continue;;
++ -m) mode=$2
++ case $mode in
++ *' '* | *' '* | *'
++'* | *'*'* | *'?'* | *'['*)
++ echo "$0: invalid mode: $mode" >&2
++ exit 1;;
++ esac
++ shift;;
+
+ -o) chowncmd="$chownprog $2"
+- shift
+- shift
+- continue;;
++ shift;;
+
+- -s) stripcmd=$stripprog
+- shift
+- continue;;
++ -s) stripcmd=$stripprog;;
+
+- -t) dstarg=$2
+- shift
+- shift
+- continue;;
++ -t) dst_arg=$2
++ shift;;
+
+- -T) no_target_directory=true
+- shift
+- continue;;
++ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+- *) # When -d is used, all remaining arguments are directories to create.
+- # When -t is used, the destination is already specified.
+- test -n "$dir_arg$dstarg" && break
+- # Otherwise, the last argument is the destination. Remove it from $@.
+- for arg
+- do
+- if test -n "$dstarg"; then
+- # $@ is not empty: it contains at least $arg.
+- set fnord "$@" "$dstarg"
+- shift # fnord
+- fi
+- shift # arg
+- dstarg=$arg
+- done
++ --) shift
+ break;;
++
++ -*) echo "$0: invalid option: $1" >&2
++ exit 1;;
++
++ *) break;;
+ esac
++ shift
+ done
+
+-if test -z "$1"; then
++if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
++ # When -d is used, all remaining arguments are directories to create.
++ # When -t is used, the destination is already specified.
++ # Otherwise, the last argument is the destination. Remove it from $@.
++ for arg
++ do
++ if test -n "$dst_arg"; then
++ # $@ is not empty: it contains at least $arg.
++ set fnord "$@" "$dst_arg"
++ shift # fnord
++ fi
++ shift # arg
++ dst_arg=$arg
++ done
++fi
++
++if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+@@ -164,24 +199,47 @@ if test -z "$1"; then
+ exit 0
+ fi
+
++if test -z "$dir_arg"; then
++ trap '(exit $?); exit' 1 2 13 15
++
++ # Set umask so as not to create temps with too-generous modes.
++ # However, 'strip' requires both read and write access to temps.
++ case $mode in
++ # Optimize common cases.
++ *644) cp_umask=133;;
++ *755) cp_umask=22;;
++
++ *[0-7])
++ if test -z "$stripcmd"; then
++ u_plus_rw=
++ else
++ u_plus_rw='% 200'
++ fi
++ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
++ *)
++ if test -z "$stripcmd"; then
++ u_plus_rw=
++ else
++ u_plus_rw=,u+rw
++ fi
++ cp_umask=$mode$u_plus_rw;;
++ esac
++fi
++
+ for src
+ do
+ # Protect names starting with `-'.
+ case $src in
+- -*) src=./$src ;;
++ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+- src=
+-
+- if test -d "$dst"; then
+- mkdircmd=:
+- chmodcmd=
+- else
+- mkdircmd=$mkdirprog
+- fi
++ dstdir=$dst
++ test -d "$dstdir"
++ dstdir_status=$?
+ else
++
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+@@ -190,71 +248,199 @@ do
+ exit 1
+ fi
+
+- if test -z "$dstarg"; then
++ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+- dst=$dstarg
++ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+- -*) dst=./$dst ;;
++ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+- echo "$0: $dstarg: Is a directory" >&2
++ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+- dst=$dst/`basename "$src"`
++ dstdir=$dst
++ dst=$dstdir/`basename "$src"`
++ dstdir_status=0
++ else
++ # Prefer dirname, but fall back on a substitute if dirname fails.
++ dstdir=`
++ (dirname "$dst") 2>/dev/null ||
++ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$dst" : 'X\(//\)[^/]' \| \
++ X"$dst" : 'X\(//\)$' \| \
++ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
++ echo X"$dst" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'
++ `
++
++ test -d "$dstdir"
++ dstdir_status=$?
+ fi
+ fi
+
+- # This sed command emulates the dirname command.
+- dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
++ obsolete_mkdir_used=false
++
++ if test $dstdir_status != 0; then
++ case $posix_mkdir in
++ '')
++ # Create intermediate dirs using mode 755 as modified by the umask.
++ # This is like FreeBSD 'install' as of 1997-10-28.
++ umask=`umask`
++ case $stripcmd.$umask in
++ # Optimize common cases.
++ *[2367][2367]) mkdir_umask=$umask;;
++ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
++
++ *[0-7])
++ mkdir_umask=`expr $umask + 22 \
++ - $umask % 100 % 40 + $umask % 20 \
++ - $umask % 10 % 4 + $umask % 2
++ `;;
++ *) mkdir_umask=$umask,go-w;;
++ esac
++
++ # With -d, create the new directory with the user-specified mode.
++ # Otherwise, rely on $mkdir_umask.
++ if test -n "$dir_arg"; then
++ mkdir_mode=-m$mode
++ else
++ mkdir_mode=
++ fi
++
++ posix_mkdir=false
++ case $umask in
++ *[123567][0-7][0-7])
++ # POSIX mkdir -p sets u+wx bits regardless of umask, which
++ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
++ ;;
++ *)
++ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
++ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
++
++ if (umask $mkdir_umask &&
++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
++ then
++ if test -z "$dir_arg" || {
++ # Check for POSIX incompatibilities with -m.
++ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
++ # other-writeable bit of parent directory when it shouldn't.
++ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
++ ls_ld_tmpdir=`ls -ld "$tmpdir"`
++ case $ls_ld_tmpdir in
++ d????-?r-*) different_mode=700;;
++ d????-?--*) different_mode=755;;
++ *) false;;
++ esac &&
++ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
++ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
++ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
++ }
++ }
++ then posix_mkdir=:
++ fi
++ rmdir "$tmpdir/d" "$tmpdir"
++ else
++ # Remove any dirs left behind by ancient mkdir implementations.
++ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
++ fi
++ trap '' 0;;
++ esac;;
++ esac
+
+- # Make sure that the destination directory exists.
++ if
++ $posix_mkdir && (
++ umask $mkdir_umask &&
++ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
++ )
++ then :
++ else
+
+- # Skip lots of stat calls in the usual case.
+- if test ! -d "$dstdir"; then
+- defaultIFS='
+- '
+- IFS="${IFS-$defaultIFS}"
++ # The umask is ridiculous, or mkdir does not conform to POSIX,
++ # or it failed possibly due to a race condition. Create the
++ # directory the slow way, step by step, checking for races as we go.
+
+- oIFS=$IFS
+- # Some sh's can't handle IFS=/ for some reason.
+- IFS='%'
+- set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+- shift
+- IFS=$oIFS
++ case $dstdir in
++ /*) prefix='/';;
++ -*) prefix='./';;
++ *) prefix='';;
++ esac
+
+- pathcomp=
++ eval "$initialize_posix_glob"
+
+- while test $# -ne 0 ; do
+- pathcomp=$pathcomp$1
++ oIFS=$IFS
++ IFS=/
++ $posix_glob set -f
++ set fnord $dstdir
+ shift
+- if test ! -d "$pathcomp"; then
+- $mkdirprog "$pathcomp"
+- # mkdir can fail with a `File exist' error in case several
+- # install-sh are creating the directory concurrently. This
+- # is OK.
+- test -d "$pathcomp" || exit
++ $posix_glob set +f
++ IFS=$oIFS
++
++ prefixes=
++
++ for d
++ do
++ test -z "$d" && continue
++
++ prefix=$prefix$d
++ if test -d "$prefix"; then
++ prefixes=
++ else
++ if $posix_mkdir; then
++ (umask=$mkdir_umask &&
++ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
++ # Don't fail if two instances are running concurrently.
++ test -d "$prefix" || exit 1
++ else
++ case $prefix in
++ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) qprefix=$prefix;;
++ esac
++ prefixes="$prefixes '$qprefix'"
++ fi
++ fi
++ prefix=$prefix/
++ done
++
++ if test -n "$prefixes"; then
++ # Don't fail if two instances are running concurrently.
++ (umask $mkdir_umask &&
++ eval "\$doit_exec \$mkdirprog $prefixes") ||
++ test -d "$dstdir" || exit 1
++ obsolete_mkdir_used=true
+ fi
+- pathcomp=$pathcomp/
+- done
++ fi
+ fi
+
+ if test -n "$dir_arg"; then
+- $doit $mkdircmd "$dst" \
+- && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+- && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+- && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+-
++ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
++ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
++ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
++ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+- dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+@@ -262,10 +448,9 @@ do
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+- trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+- $doit $cpprog "$src" "$dsttmp" &&
++ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+@@ -273,48 +458,59 @@ do
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+-
+- # Now rename the file to the real destination.
+- { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+- || {
+- # The rename failed, perhaps because mv can't rename something else
+- # to itself, or perhaps because mv is so ancient that it does not
+- # support -f.
+-
+- # Now remove or move aside any old file at destination location.
+- # We try this two ways since rm can't unlink itself on some
+- # systems and the destination file might be busy for other
+- # reasons. In this case, the final cleanup might fail but the new
+- # file should still install successfully.
+- {
+- if test -f "$dstdir/$dstfile"; then
+- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+- || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+- || {
+- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+- (exit 1); exit 1
+- }
+- else
+- :
+- fi
+- } &&
+-
+- # Now rename the file to the real destination.
+- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+- }
+- }
+- fi || { (exit 1); exit 1; }
++ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
++ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
++ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
++ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
++
++ # If -C, don't bother to copy if it wouldn't change the file.
++ if $copy_on_change &&
++ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
++ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
++
++ eval "$initialize_posix_glob" &&
++ $posix_glob set -f &&
++ set X $old && old=:$2:$4:$5:$6 &&
++ set X $new && new=:$2:$4:$5:$6 &&
++ $posix_glob set +f &&
++
++ test "$old" = "$new" &&
++ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
++ then
++ rm -f "$dsttmp"
++ else
++ # Rename the file to the real destination.
++ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
++
++ # The rename failed, perhaps because mv can't rename something else
++ # to itself, or perhaps because mv is so ancient that it does not
++ # support -f.
++ {
++ # Now remove or move aside any old file at destination location.
++ # We try this two ways since rm can't unlink itself on some
++ # systems and the destination file might be busy for other
++ # reasons. In this case, the final cleanup might fail but the new
++ # file should still install successfully.
++ {
++ test ! -f "$dst" ||
++ $doit $rmcmd -f "$dst" 2>/dev/null ||
++ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
++ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
++ } ||
++ { echo "$0: cannot unlink or rename $dst" >&2
++ (exit 1); exit 1
++ }
++ } &&
++
++ # Now rename the file to the real destination.
++ $doit $mvcmd "$dsttmp" "$dst"
++ }
++ fi || exit 1
++
++ trap '' 0
++ fi
+ done
+
+-# The final little trick to "correctly" pass the exit status to the exit trap.
+-{
+- (exit 0); exit 0
+-}
+-
+ # Local variables:
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
+ # time-stamp-start: "scriptversion="
+diff --git a/jbig2dec/jbig2.c b/jbig2dec/jbig2.c
+--- a/jbig2dec/jbig2.c
++++ b/jbig2dec/jbig2.c
+@@ -1,27 +1,24 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2005 Artifex Software, Inc.
+-
++
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
+- This software is distributed under license and may not
++
++ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2.c 8022 2007-06-05 22:23:38Z giles $
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdio.h>
+@@ -31,9 +28,6 @@
+
+ #include "jbig2.h"
+ #include "jbig2_priv.h"
+-#include "jbig2_arith.h"
+-#include "jbig2_generic.h"
+-#include "jbig2_symbol_dict.h"
+
+ static void *
+ jbig2_default_alloc (Jbig2Allocator *allocator, size_t size)
+@@ -79,7 +73,7 @@ jbig2_realloc (Jbig2Allocator *allocator, void *p, size_t size)
+ }
+
+ static int
+-jbig2_default_error(void *data, const char *msg,
++jbig2_default_error(void *data, const char *msg,
+ Jbig2Severity severity, int32_t seg_idx)
+ {
+ /* report only fatal errors by default */
+@@ -89,7 +83,7 @@ jbig2_default_error(void *data, const char *msg,
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
+-
++
+ return 0;
+ }
+
+@@ -133,7 +127,7 @@ jbig2_ctx_new (Jbig2Allocator *allocator,
+ JBIG2_SEVERITY_FATAL, -1);
+ return result;
+ }
+-
++
+ result->allocator = allocator;
+ result->options = options;
+ result->global_ctx = (const Jbig2Ctx *)global_ctx;
+@@ -145,7 +139,7 @@ jbig2_ctx_new (Jbig2Allocator *allocator,
+ JBIG2_FILE_HEADER;
+
+ result->buf = NULL;
+-
++
+ result->n_segments = 0;
+ result->n_segments_max = 16;
+ result->segments = (Jbig2Segment **)jbig2_alloc(allocator, result->n_segments_max * sizeof(Jbig2Segment *));
+@@ -219,7 +213,7 @@ jbig2_data_in (Jbig2Ctx *ctx, const unsigned char *data, size_t size)
+ {
+ byte *buf;
+ size_t buf_size = initial_buf_size;
+-
++
+ do
+ buf_size <<= 1;
+ while (buf_size < ctx->buf_wr_ix - ctx->buf_rd_ix + size);
+@@ -285,7 +279,7 @@ jbig2_data_in (Jbig2Ctx *ctx, const unsigned char *data, size_t size)
+ }
+ else
+ {
+- ctx->state = JBIG2_FILE_RANDOM_HEADERS;
++ ctx->state = JBIG2_FILE_RANDOM_HEADERS;
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1, "file header indicates random-access organization");
+
+ }
+@@ -430,4 +424,3 @@ jbig2_word_stream_buf_free(Jbig2Ctx *ctx, Jbig2WordStream *ws)
+ {
+ jbig2_free(ctx->allocator, ws);
+ }
+-
+diff --git a/jbig2dec/jbig2.h b/jbig2dec/jbig2.h
+--- a/jbig2dec/jbig2.h
++++ b/jbig2dec/jbig2.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2.h 8022 2007-06-05 22:23:38Z giles $
+ */
+
+ #ifdef __cplusplus
+@@ -70,7 +67,7 @@ Jbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,
+ /* errors are returned from the library via a callback. If no callback
+ is provided (a NULL argument is passed ot jbig2_ctx_new) a default
+ handler is used which prints fatal errors to the stderr stream. */
+-
++
+ /* error callback */
+ typedef int (*Jbig2ErrorCallback) (void *data,
+ const char *msg, Jbig2Severity severity,
+@@ -80,7 +77,7 @@ typedef int (*Jbig2ErrorCallback) (void *data,
+ clients can better control memory usage. If a NULL is passed for
+ this argumennt of jbig2_ctx_new, a default allocator based on malloc()
+ is used. */
+-
++
+ /* dynamic memory callbacks */
+ struct _Jbig2Allocator {
+ void *(*alloc) (Jbig2Allocator *allocator, size_t size);
+diff --git a/jbig2dec/jbig2_arith.c b/jbig2dec/jbig2_arith.c
+--- a/jbig2dec/jbig2_arith.c
++++ b/jbig2dec/jbig2_arith.c
+@@ -1,22 +1,19 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_arith.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+@@ -385,7 +382,7 @@ main (int argc, char **argv)
+ #ifdef JBIG2_DEBUG_ARITH
+ fprintf(stderr, "%3d: D = %d, ", i, D);
+ jbig2_arith_trace (as, cx);
+-#endif
++#endif
+ }
+
+ jbig2_free(ctx->allocator, as);
+diff --git a/jbig2dec/jbig2_arith.h b/jbig2dec/jbig2_arith.h
+--- a/jbig2dec/jbig2_arith.h
++++ b/jbig2dec/jbig2_arith.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_arith.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ typedef struct _Jbig2ArithState Jbig2ArithState;
+diff --git a/jbig2dec/jbig2_arith_iaid.c b/jbig2dec/jbig2_arith_iaid.c
+--- a/jbig2dec/jbig2_arith_iaid.c
++++ b/jbig2dec/jbig2_arith_iaid.c
+@@ -5,25 +5,22 @@
+
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_arith_iaid.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ /* Annex A.3 */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+diff --git a/jbig2dec/jbig2_arith_iaid.h b/jbig2dec/jbig2_arith_iaid.h
+--- a/jbig2dec/jbig2_arith_iaid.h
++++ b/jbig2dec/jbig2_arith_iaid.h
+@@ -7,13 +7,10 @@
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_arith_iaid.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ typedef struct _Jbig2ArithIaidCtx Jbig2ArithIaidCtx;
+diff --git a/jbig2dec/jbig2_arith_int.c b/jbig2dec/jbig2_arith_int.c
+--- a/jbig2dec/jbig2_arith_int.c
++++ b/jbig2dec/jbig2_arith_int.c
+@@ -1,29 +1,26 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001 Artifex Software, Inc.
+-
++
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_arith_int.c 8022 2007-06-05 22:23:38Z giles $
+ */
+
+ /* Annex A */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+diff --git a/jbig2dec/jbig2_arith_int.h b/jbig2dec/jbig2_arith_int.h
+--- a/jbig2dec/jbig2_arith_int.h
++++ b/jbig2dec/jbig2_arith_int.h
+@@ -7,13 +7,10 @@
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_arith_int.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ typedef struct _Jbig2ArithIntCtx Jbig2ArithIntCtx;
+diff --git a/jbig2dec/jbig2_generic.c b/jbig2dec/jbig2_generic.c
+--- a/jbig2dec/jbig2_generic.c
++++ b/jbig2dec/jbig2_generic.c
+@@ -1,22 +1,19 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2005 Artifex Software, Inc.
+-
++
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_generic.c 8320 2007-10-25 22:14:22Z giles $
+ */
+
+ /**
+@@ -25,7 +22,7 @@
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+@@ -540,7 +537,7 @@ jbig2_decode_generic_region(Jbig2Ctx *ctx,
+ return -1;
+ }
+
+-/**
++/**
+ * Handler for immediate generic region segments
+ */
+ int
+@@ -602,7 +599,7 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "allocated %d x %d image buffer for region decode results",
+ rsi.width, rsi.height);
+-
++
+ if (params.MMR)
+ {
+ code = jbig2_decode_generic_mmr(ctx, segment, &params,
+@@ -627,10 +624,9 @@ jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ jbig2_free(ctx->allocator, GB_stats);
+ }
+
+- jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],
++ jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],
+ image, rsi.x, rsi.y, JBIG2_COMPOSE_OR);
+ jbig2_image_release(ctx, image);
+-
++
+ return code;
+ }
+-
+diff --git a/jbig2dec/jbig2_generic.h b/jbig2dec/jbig2_generic.h
+--- a/jbig2dec/jbig2_generic.h
++++ b/jbig2dec/jbig2_generic.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2004 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_generic.h 8022 2007-06-05 22:23:38Z giles $
+ */
+
+ /**
+diff --git a/jbig2dec/jbig2_huffman.c b/jbig2dec/jbig2_huffman.c
+--- a/jbig2dec/jbig2_huffman.c
++++ b/jbig2dec/jbig2_huffman.c
+@@ -1,30 +1,28 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_huffman.c 8022 2007-06-05 22:23:38Z giles $
+ */
+
+-/* Huffman table decoding procedures
++/* Huffman table decoding procedures
+ -- See Annex B of the JBIG2 specification */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdlib.h>
++#include <string.h>
+
+ #ifdef JBIG2_DEBUG
+ #include <stdio.h>
+@@ -63,7 +61,7 @@ jbig2_huffman_new (Jbig2Ctx *ctx, Jbig2WordStream *ws)
+ {
+ Jbig2HuffmanState *result;
+
+- result = (Jbig2HuffmanState *)jbig2_alloc(ctx->allocator,
++ result = (Jbig2HuffmanState *)jbig2_alloc(ctx->allocator,
+ sizeof(Jbig2HuffmanState));
+
+ if (result != NULL) {
+@@ -94,7 +92,7 @@ jbig2_huffman_free (Jbig2Ctx *ctx, Jbig2HuffmanState *hs)
+ /** print current huffman state */
+ void jbig2_dump_huffman_state(Jbig2HuffmanState *hs) {
+ fprintf(stderr, "huffman state %08x %08x offset %d.%d\n",
+- hs->this_word, hs->next_word, hs->offset, hs->offset_bits);
++ hs->this_word, hs->next_word, hs->offset, hs->offset_bits);
+ }
+
+ /** print the binary string we're reading from */
+@@ -121,7 +119,7 @@ jbig2_huffman_skip(Jbig2HuffmanState *hs)
+ if (bits) {
+ bits = 8 - bits;
+ hs->offset_bits += bits;
+- hs->this_word = (hs->this_word << bits) |
++ hs->this_word = (hs->this_word << bits) |
+ (hs->next_word >> (32 - hs->offset_bits));
+ }
+
+@@ -160,7 +158,7 @@ void jbig2_huffman_advance(Jbig2HuffmanState *hs, int offset)
+ /* return the offset of the huffman decode pointer (in bytes)
+ * from the beginning of the WordStream
+ */
+-int
++int
+ jbig2_huffman_offset(Jbig2HuffmanState *hs)
+ {
+ return hs->offset + (hs->offset_bits >> 3);
+@@ -209,7 +207,7 @@ jbig2_huffman_get (Jbig2HuffmanState *hs,
+ int32_t result;
+
+ for (;;)
+- {
++ {
+ int log_table_size = table->log_table_size;
+ int PREFLEN;
+
+@@ -276,19 +274,20 @@ if (RANGELEN)
+ return result;
+ }
+
+-/* TODO: more than 8 bits here is wasteful of memory. We have support
++/* TODO: more than 8 bits here is wasteful of memory. We have support
+ for sub-trees in jbig2_huffman_get() above, but don't use it here.
+ We should, and then revert to 8 bits */
+ #define LOG_TABLE_SIZE_MAX 16
+
+ /** Build an in-memory representation of a Huffman table from the
+ * set of template params provided by the spec or a table segment
+- */
++ */
+ Jbig2HuffmanTable *
+ jbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
+ {
+- int LENCOUNT[1 << LOG_TABLE_SIZE_MAX];
++ int *LENCOUNT;
+ int LENMAX = -1;
++ const int lencountsize = 256 * sizeof(*LENCOUNT);
+ const Jbig2HuffmanLine *lines = params->lines;
+ int n_lines = params->n_lines;
+ int i, j;
+@@ -301,6 +300,14 @@ jbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
+ int CURCODE;
+ int CURTEMP;
+
++ LENCOUNT = jbig2_alloc(ctx->allocator, lencountsize);
++ if (LENCOUNT == NULL) {
++ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
++ "couldn't allocate storage for huffman histogram");
++ return NULL;
++ }
++ memset(LENCOUNT, 0, lencountsize);
++
+ /* B.3, 1. */
+ for (i = 0; i < params->n_lines; i++)
+ {
+@@ -356,6 +363,7 @@ jbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
+ end_j, max_j);
+ jbig2_free(ctx->allocator, result->entries);
+ jbig2_free(ctx->allocator, result);
++ jbig2_free(ctx->allocator, LENCOUNT);
+ return NULL;
+ }
+ /* todo: build extension tables */
+@@ -390,6 +398,8 @@ jbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
+ }
+ }
+
++ jbig2_free(ctx->allocator, LENCOUNT);
++
+ return result;
+ }
+
+@@ -436,7 +446,7 @@ main (int argc, char **argv)
+ Jbig2WordStream ws;
+ bool oob;
+ int32_t code;
+-
++
+ ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);
+
+ tables[0] = NULL;
+@@ -449,22 +459,22 @@ main (int argc, char **argv)
+
+ printf("testing jbig2 huffmann decoding...");
+ printf("\t(should be 8 5 (oob) 8)\n");
+-
++
+ {
+ int i;
+ int sequence_length = sizeof(test_tabindex);
+-
++
+ for (i = 0; i < sequence_length; i++) {
+ code = jbig2_huffman_get (hs, tables[test_tabindex[i]], &oob);
+ if (oob) printf("(oob) ");
+ else printf("%d ", code);
+ }
+ }
+-
++
+ printf("\n");
+
+ jbig2_ctx_free(ctx);
+-
++
+ return 0;
+ }
+ #endif
+diff --git a/jbig2dec/jbig2_huffman.h b/jbig2dec/jbig2_huffman.h
+--- a/jbig2dec/jbig2_huffman.h
++++ b/jbig2dec/jbig2_huffman.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_huffman.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifndef JBIG2_HUFFMAN_H
+@@ -66,7 +63,7 @@ jbig2_huffman_skip(Jbig2HuffmanState *hs);
+
+ void jbig2_huffman_advance(Jbig2HuffmanState *hs, int offset);
+
+-int
++int
+ jbig2_huffman_offset(Jbig2HuffmanState *hs);
+
+ int32_t
+diff --git a/jbig2dec/jbig2_hufftab.h b/jbig2dec/jbig2_hufftab.h
+--- a/jbig2dec/jbig2_hufftab.h
++++ b/jbig2dec/jbig2_hufftab.h
+@@ -1,22 +1,19 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_hufftab.h 8022 2007-06-05 22:23:38Z giles $
+ */
+
+-/* predefined Huffman table definitions
++/* predefined Huffman table definitions
+ -- See Annex B of the JBIG2 specification */
+
+ #ifndef JBIG2_HUFFTAB_H
+diff --git a/jbig2dec/jbig2_image.c b/jbig2dec/jbig2_image.c
+--- a/jbig2dec/jbig2_image.c
++++ b/jbig2dec/jbig2_image.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_image.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdio.h>
+@@ -35,14 +32,14 @@ Jbig2Image* jbig2_image_new(Jbig2Ctx *ctx, int width, int height)
+ {
+ Jbig2Image *image;
+ int stride;
+-
++
+ image = (Jbig2Image *)jbig2_alloc(ctx->allocator, sizeof(*image));
+ if (image == NULL) {
+ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
+ "could not allocate image structure");
+ return NULL;
+ }
+-
++
+ stride = ((width - 1) >> 3) + 1; /* generate a byte-aligned stride */
+ image->data = (uint8_t *)jbig2_alloc(ctx->allocator, stride*height);
+ if (image->data == NULL) {
+@@ -82,7 +79,7 @@ void jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image)
+ }
+
+ /* resize a Jbig2Image */
+-Jbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,
++Jbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,
+ int width, int height)
+ {
+ if (width == image->width) {
+@@ -178,7 +175,7 @@ int jbig2_image_compose_unopt(Jbig2Ctx *ctx,
+ }
+
+ /* composite one jbig2_image onto another */
+-int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
++int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
+ int x, int y, Jbig2ComposeOp op)
+ {
+ int i, j;
+@@ -188,7 +185,7 @@ int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
+ uint8_t *s, *ss;
+ uint8_t *d, *dd;
+ uint8_t mask, rightmask;
+-
++
+ if (op != JBIG2_COMPOSE_OR) {
+ /* hand off the the general routine */
+ return jbig2_image_compose_unopt(ctx, dst, src, x, y, op);
+@@ -200,15 +197,15 @@ int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
+ ss = src->data;
+ /* FIXME: this isn't sufficient for the < 0 cases */
+ if (x < 0) { w += x; x = 0; }
+- if (y < 0) { h += y; y = 0; }
++ if (y < 0) { h += y; y = 0; }
+ w = (x + w < dst->width) ? w : dst->width - x;
+ h = (y + h < dst->height) ? h : dst->height - y;
+-#ifdef JBIG2_DEBUG
++#ifdef JBIG2_DEBUG
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,
+- "composting %dx%d at (%d, %d) afer clipping\n",
++ "composting %dx%d at (%d, %d) after clipping\n",
+ w, h, x, y);
+ #endif
+-
++
+ #if 0
+ /* special case complete/strip replacement */
+ /* disabled because it's only safe to do when the destination
+@@ -222,8 +219,8 @@ int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
+ leftbyte = x >> 3;
+ rightbyte = (x + w - 1) >> 3;
+ shift = x & 7;
+-
+- /* general OR case */
++
++ /* general OR case */
+ s = ss;
+ d = dd = dst->data + y*dst->stride + leftbyte;
+ if (leftbyte == rightbyte) {
+@@ -264,7 +261,7 @@ int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,
+ s = (ss += src->stride);
+ }
+ }
+-
++
+ return 0;
+ }
+
+@@ -290,7 +287,7 @@ int jbig2_image_get_pixel(Jbig2Image *image, int x, int y)
+
+ if ((x < 0) || (x >= w)) return 0;
+ if ((y < 0) || (y >= h)) return 0;
+-
++
+ return ((image->data[byte]>>bit) & 1);
+ }
+
+diff --git a/jbig2dec/jbig2_image.h b/jbig2dec/jbig2_image.h
+--- a/jbig2dec/jbig2_image.h
++++ b/jbig2dec/jbig2_image.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2002 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_image.h 8320 2007-10-25 22:14:22Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+
+diff --git a/jbig2dec/jbig2_image_pbm.c b/jbig2dec/jbig2_image_pbm.c
+--- a/jbig2dec/jbig2_image_pbm.c
++++ b/jbig2dec/jbig2_image_pbm.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
+- Copyright (C) 2002 Artifex Software, Inc.
+-
++
++ Copyright (C) 2009 Artifex Software, Inc.
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_image_pbm.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdio.h>
+@@ -33,14 +30,14 @@ int jbig2_image_write_pbm_file(Jbig2Image *image, char *filename)
+ {
+ FILE *out;
+ int error;
+-
++
+ if ((out = fopen(filename, "wb")) == NULL) {
+ fprintf(stderr, "unable to open '%s' for writing", filename);
+ return 1;
+ }
+-
++
+ error = jbig2_image_write_pbm(image, out);
+-
++
+ fclose(out);
+ return (error);
+ }
+@@ -51,12 +48,12 @@ int jbig2_image_write_pbm(Jbig2Image *image, FILE *out)
+ {
+ /* pbm header */
+ fprintf(out, "P4\n%d %d\n", image->width, image->height);
+-
++
+ /* pbm format pads to a byte boundary, so we can
+ just write out the whole data buffer
+ NB: this assumes minimal stride for the width */
+ fwrite(image->data, 1, image->height*image->stride, out);
+-
++
+ /* success */
+ return 0;
+ }
+@@ -66,14 +63,16 @@ Jbig2Image *jbig2_image_read_pbm_file(Jbig2Ctx *ctx, char *filename)
+ {
+ FILE *in;
+ Jbig2Image *image;
+-
++
+ if ((in = fopen(filename, "rb")) == NULL) {
+ fprintf(stderr, "unable to open '%s' for reading\n", filename);
+ return NULL;
+ }
+-
++
+ image = jbig2_image_read_pbm(ctx, in);
+-
++
++ fclose(in);
++
+ return (image);
+ }
+
+@@ -85,7 +84,7 @@ Jbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in)
+ Jbig2Image *image;
+ int c;
+ char buf[32];
+-
++
+ /* look for 'P4' magic */
+ while ((c = fgetc(in)) != 'P') {
+ if (feof(in)) return NULL;
+@@ -109,16 +108,25 @@ Jbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in)
+ while ((c = fgetc(in)) != '\n');
+ continue;
+ }
++ /* report unexpected eof */
++ if (c == EOF) {
++ fprintf(stderr, "end-of-file parsing pbm header\n");
++ return NULL;
++ }
+ if (isdigit(c)) {
+ buf[i++] = c;
+- while (isdigit(buf[i++] = fgetc(in))) {
+- if (feof(in) || i >= 32) {
++ while (isdigit(c = fgetc(in))) {
++ if (i >= 32) {
+ fprintf(stderr, "pbm parsing error\n");
+ return NULL;
+ }
++ buf[i++] = c;
+ }
+ buf[i] = '\0';
+- sscanf(buf, "%d", &dim[done]);
++ if (sscanf(buf, "%d", &dim[done]) != 1) {
++ fprintf(stderr, "couldn't read pbm image dimensions\n");
++ return NULL;
++ }
+ i = 0;
+ done++;
+ }
+@@ -136,7 +144,7 @@ Jbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in)
+ fprintf(stderr, "unexpected end of pbm file.\n");
+ jbig2_image_release(ctx, image);
+ return NULL;
+- }
++ }
+ /* success */
+ return image;
+ }
+diff --git a/jbig2dec/jbig2_image_png.c b/jbig2dec/jbig2_image_png.c
+--- a/jbig2dec/jbig2_image_png.c
++++ b/jbig2dec/jbig2_image_png.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_image_png.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdio.h>
+@@ -55,14 +52,14 @@ int jbig2_image_write_png_file(Jbig2Image *image, char *filename)
+ {
+ FILE *out;
+ int error;
+-
++
+ if ((out = fopen(filename, "wb")) == NULL) {
+ fprintf(stderr, "unable to open '%s' for writing\n", filename);
+ return 1;
+ }
+-
++
+ error = jbig2_image_write_png(image, out);
+-
++
+ fclose(out);
+ return (error);
+ }
+@@ -75,14 +72,14 @@ int jbig2_image_write_png(Jbig2Image *image, FILE *out)
+ png_structp png;
+ png_infop info;
+ png_bytep rowpointer;
+-
++
+ png = png_create_write_struct(PNG_LIBPNG_VER_STRING,
+ NULL, NULL, NULL);
+ if (png == NULL) {
+ fprintf(stderr, "unable to create png structure\n");
+ return 2;
+ }
+-
++
+ info = png_create_info_struct(png);
+ if (info == NULL) {
+ fprintf(stderr, "unable to create png info structure\n");
+@@ -104,7 +101,7 @@ int jbig2_image_write_png(Jbig2Image *image, FILE *out)
+ /* png_init_io(png, out); */
+ png_set_write_fn(png, (png_voidp)out, jbig2_png_write_data,
+ jbig2_png_flush);
+-
++
+ /* now we fill out the info structure with our format data */
+ png_set_IHDR(png, info, image->width, image->height,
+ 1, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE,
+@@ -113,17 +110,17 @@ int jbig2_image_write_png(Jbig2Image *image, FILE *out)
+
+ /* png natively treates 0 as black. This will convert for us */
+ png_set_invert_mono(png);
+-
++
+ /* write out each row in turn */
+ rowpointer = (png_bytep)image->data;
+ for(i = 0; i < image->height; i++) {
+ png_write_row(png, rowpointer);
+ rowpointer += image->stride;
+ }
+-
++
+ /* finish and clean up */
+ png_write_end(png, info);
+ png_destroy_write_struct(&png, &info);
+-
++
+ return 0;
+ }
+diff --git a/jbig2dec/jbig2_metadata.c b/jbig2dec/jbig2_metadata.c
+--- a/jbig2dec/jbig2_metadata.c
++++ b/jbig2dec/jbig2_metadata.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2003 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_metadata.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdlib.h>
+@@ -32,7 +29,7 @@
+ Jbig2Metadata *jbig2_metadata_new(Jbig2Ctx *ctx, Jbig2Encoding encoding)
+ {
+ Jbig2Metadata *md = jbig2_alloc(ctx->allocator, sizeof(Jbig2Metadata));
+-
++
+ if (md != NULL) {
+ md->encoding = encoding;
+ md->entries = 0;
+@@ -82,7 +79,7 @@ int jbig2_metadata_add(Jbig2Ctx *ctx, Jbig2Metadata *md,
+ const char *value, const int value_length)
+ {
+ char **keys, **values;
+-
++
+ /* grow the array if necessary */
+ if (md->entries == md->max_entries) {
+ md->max_entries >>= 2;
+@@ -96,12 +93,12 @@ int jbig2_metadata_add(Jbig2Ctx *ctx, Jbig2Metadata *md,
+ md->keys = keys;
+ md->values = values;
+ }
+-
++
+ /* copy the passed key,value pair */
+ md->keys[md->entries] = jbig2_strndup(ctx, key, key_length);
+ md->values[md->entries] = jbig2_strndup(ctx, value, value_length);
+ md->entries++;
+-
++
+ return 0;
+ }
+
+@@ -115,10 +112,10 @@ int jbig2_parse_comment_ascii(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ Jbig2Metadata *comment;
+ char *key, *value;
+ int key_length, value_length;
+-
++
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+ "ASCII comment data");
+-
++
+ comment = jbig2_metadata_new(ctx, JBIG2_ENCODING_ASCII);
+ if (comment == NULL) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+@@ -137,12 +134,12 @@ int jbig2_parse_comment_ascii(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+ "'%s'\t'%s'", key, value);
+ }
+-
++
+ /* TODO: associate with ctx, page, or referred-to segment(s) */
+ segment->result = comment;
+-
++
+ return 0;
+-
++
+ too_short:
+ jbig2_metadata_free(ctx, comment);
+ return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+diff --git a/jbig2dec/jbig2_metadata.h b/jbig2dec/jbig2_metadata.h
+--- a/jbig2dec/jbig2_metadata.h
++++ b/jbig2dec/jbig2_metadata.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2003 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_metadata.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+
+diff --git a/jbig2dec/jbig2_mmr.c b/jbig2dec/jbig2_mmr.c
+--- a/jbig2dec/jbig2_mmr.c
++++ b/jbig2dec/jbig2_mmr.c
+@@ -1,24 +1,29 @@
+ /*
+-jbig2dec
++ jbig2dec
+
+-Copyright (C) 2001-2002 Artifex Software, Inc.
++ Copyright (C) 2001-2002 Artifex Software, Inc.
+
+-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 software is provided AS-IS with no warranty,
++ either express or implied.
+
+-$Id: jbig2_mmr.c 8022 2007-06-05 22:23:38Z giles $
++ This software is distributed under license and may not
++ be copied, modified or distributed except as expressly
++ authorized under the terms of the license contained in
++ the file LICENSE in this distribution.
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+-/*
+-An implementation of MMR decoding. This is based on the implementation
+-in Fitz, which in turn is based on the one in Ghostscript.
++/* An implementation of MMR decoding. This is based on the
++ implementation in Fitz, which in turn is based on the one
++ in Ghostscript.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+diff --git a/jbig2dec/jbig2_mmr.h b/jbig2dec/jbig2_mmr.h
+--- a/jbig2dec/jbig2_mmr.h
++++ b/jbig2dec/jbig2_mmr.h
+@@ -7,13 +7,10 @@
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_mmr.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ int
+diff --git a/jbig2dec/jbig2_page.c b/jbig2dec/jbig2_page.c
+--- a/jbig2dec/jbig2_page.c
++++ b/jbig2dec/jbig2_page.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_page.c 8778 2008-05-26 19:04:05Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stdlib.h>
+@@ -76,7 +73,7 @@ jbig2_parse_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segm
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "unexpected page info segment, marking previous page finished");
+ }
+-
++
+ /* find a free page */
+ {
+ int index, j;
+@@ -101,17 +98,17 @@ jbig2_parse_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segm
+ page->state = JBIG2_PAGE_NEW;
+ page->number = segment->page_association;
+ }
+-
++
+ /* FIXME: would be nice if we tried to work around this */
+ if (segment->data_length < 19) {
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+ "segment too short");
+ }
+-
++
+ /* 7.4.8.x */
+ page->width = jbig2_get_int32(segment_data);
+ page->height = jbig2_get_int32(segment_data + 4);
+-
++
+ page->x_resolution = jbig2_get_int32(segment_data + 8);
+ page->y_resolution = jbig2_get_int32(segment_data + 12);
+ page->flags = segment_data[16];
+@@ -133,12 +130,12 @@ jbig2_parse_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segm
+ page->striped = TRUE;
+ }
+ page->end_row = 0;
+-
++
+ if (segment->data_length > 19) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "extra data in segment");
+ }
+-
++
+ dump_page_info(ctx, segment, page);
+
+ /* allocate an approprate page image buffer */
+@@ -160,7 +157,7 @@ jbig2_parse_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segm
+ page->image->width, page->image->height,
+ page->image->stride*page->image->height);
+ }
+-
++
+ return 0;
+ }
+
+@@ -177,13 +174,13 @@ jbig2_parse_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *s
+ if (end_row < page.end_row) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "end of stripe segment with non-positive end row advance"
+- "(new end row %d vs current end row %d)",
++ " (new end row %d vs current end row %d)",
+ end_row, page.end_row);
+ } else {
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+ "end of stripe: advancing end row to %d", end_row);
+ }
+-
++
+ page.end_row = end_row;
+
+ return 0;
+@@ -236,12 +233,12 @@ jbig2_parse_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *seg
+ "end of page marker for page %d doesn't match current page number %d",
+ segment->page_association, page_number);
+ }
+-
++
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+ "end of page %d", page_number);
+
+ jbig2_complete_page(ctx);
+-
++
+ #ifdef OUTPUT_PBM
+ jbig2_image_write_pbm(ctx->pages[ctx->current_page].image, stdout);
+ #endif
+@@ -269,7 +266,7 @@ jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *image,
+ jbig2_image_resize(ctx, page->image,
+ page->image->width, new_height);
+ }
+- }
++ }
+
+ jbig2_image_compose(ctx, page->image, image,
+ x, y + page->end_row, JBIG2_COMPOSE_OR);
+@@ -302,7 +299,7 @@ Jbig2Image *jbig2_page_out(Jbig2Ctx *ctx)
+ return ctx->pages[index].image;
+ }
+ }
+-
++
+ /* no pages available */
+ return NULL;
+ }
+@@ -313,7 +310,7 @@ Jbig2Image *jbig2_page_out(Jbig2Ctx *ctx)
+ int jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image)
+ {
+ int index;
+-
++
+ /* find the matching page struct and mark it released */
+ for (index = 0; index < ctx->max_page_index; index++) {
+ if (ctx->pages[index].image == image) {
+@@ -324,7 +321,7 @@ int jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image)
+ return 0;
+ }
+ }
+-
++
+ /* no matching pages */
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,
+ "jbig2_release_page called on unknown page");
+diff --git a/jbig2dec/jbig2_priv.h b/jbig2dec/jbig2_priv.h
+--- a/jbig2dec/jbig2_priv.h
++++ b/jbig2dec/jbig2_priv.h
+@@ -1,23 +1,20 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_priv.h 8022 2007-06-05 22:23:38Z giles $
+-
+- shared library internals
+ */
+
++/* library internals */
++
+ typedef uint8_t byte;
+ typedef int bool;
+
+@@ -62,7 +59,7 @@ struct _Jbig2Ctx {
+ Jbig2Segment **segments;
+ int n_segments; /* index of last segment header parsed */
+ int segment_index; /* index of last segment body parsed */
+-
++
+ /* list of decoded pages, including the one in progress,
+ currently stored as a contiguous, 0-indexed array. */
+ int current_page;
+@@ -155,7 +152,7 @@ int jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ const uint8_t *segment_data);
+ int jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ const byte *segment_data);
+-
++
+ /* The word stream design is a compromise between simplicity and
+ trying to amortize the number of method calls. Each ::get_next_word
+ invocation pulls 4 bytes from the stream, packed big-endian into a
+diff --git a/jbig2dec/jbig2_refinement.c b/jbig2dec/jbig2_refinement.c
+--- a/jbig2dec/jbig2_refinement.c
++++ b/jbig2dec/jbig2_refinement.c
+@@ -1,22 +1,19 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2004 Artifex Software, Inc.
+-
++
+ This software is provided AS-IS with no warranty,
+ either express or implied.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_refinement.c 8320 2007-10-25 22:14:22Z giles $
+ */
+
+ /**
+@@ -25,7 +22,7 @@
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+@@ -37,7 +34,6 @@
+ #include "jbig2_priv.h"
+ #include "jbig2_arith.h"
+ #include "jbig2_generic.h"
+-#include "jbig2_mmr.h"
+ #include "jbig2_image.h"
+
+ static int
+@@ -72,11 +68,11 @@ jbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx,
+ for (y = 0; y < GRH; y++) {
+ for (x = 0; x < GRW; x++) {
+ CONTEXT = 0;
+- CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;
+- CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;
+- CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;
+- CONTEXT |= jbig2_image_get_pixel(image, x + params->grat[0],
+- y + params->grat[1]) << 3;
++ CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;
++ CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;
++ CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;
++ CONTEXT |= jbig2_image_get_pixel(image, x + params->grat[0],
++ y + params->grat[1]) << 3;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+1) << 4;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+1) << 5;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx-1, y-dy+1) << 6;
+@@ -85,13 +81,13 @@ jbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx,
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx-1, y-dy+0) << 9;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy-1) << 10;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy-1) << 11;
+- CONTEXT |= jbig2_image_get_pixel(ref, x-dx+params->grat[2],
++ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+params->grat[2],
+ y-dy+params->grat[3]) << 12;
+ bit = jbig2_arith_decode(as, &GR_stats[CONTEXT]);
+ jbig2_image_set_pixel(image, x, y, bit);
+ }
+ }
+-#ifdef JBIG2_DEBUG
++#ifdef JBIG2_DEBUG_DUMP
+ {
+ static count = 0;
+ char name[32];
+@@ -127,10 +123,10 @@ jbig2_decode_refinement_template1_unopt(Jbig2Ctx *ctx,
+ for (y = 0; y < GRH; y++) {
+ for (x = 0; x < GRW; x++) {
+ CONTEXT = 0;
+- CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;
+- CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;
+- CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;
+- CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 3;
++ CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;
++ CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;
++ CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;
++ CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 3;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+1) << 4;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+1) << 5;
+ CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+0) << 6;
+@@ -142,7 +138,7 @@ jbig2_decode_refinement_template1_unopt(Jbig2Ctx *ctx,
+ }
+ }
+
+-#ifdef JBIG2_DEBUG
++#ifdef JBIG2_DEBUG_DUMP
+ {
+ static count = 0;
+ char name[32];
+@@ -197,9 +193,9 @@ jbig2_decode_refinement_template1(Jbig2Ctx *ctx,
+ const int minor_width = GRW - x > 8 ? 8 : GRW - x;
+
+ if (y >= 1) {
+- line_m1 = (line_m1 << 8) |
++ line_m1 = (line_m1 << 8) |
+ (x + 8 < GRW ? grreg_line[-stride + (x >> 3) + 1] : 0);
+- refline_m1 = (refline_m1 << 8) |
++ refline_m1 = (refline_m1 << 8) |
+ (x + 8 < GRW ? grref_line[-refstride + (x >> 3) + 1] << 2 : 0);
+ }
+
+@@ -275,7 +271,7 @@ jbig2_decode_refinement_region(Jbig2Ctx *ctx,
+ return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "decode_refinement_region: typical prediction coding NYI");
+ if (params->GRTEMPLATE)
+- return jbig2_decode_refinement_template1_unopt(ctx, segment, params,
++ return jbig2_decode_refinement_template1_unopt(ctx, segment, params,
+ as, image, GR_stats);
+ else
+ return jbig2_decode_refinement_template0_unopt(ctx, segment, params,
+@@ -294,7 +290,7 @@ jbig2_region_find_referred(Jbig2Ctx *ctx,Jbig2Segment *segment)
+ int index;
+
+ for (index = 0; index < nsegments; index++) {
+- rsegment = jbig2_find_segment(ctx,
++ rsegment = jbig2_find_segment(ctx,
+ segment->referred_to_segments[index]);
+ if (rsegment == NULL) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+@@ -317,7 +313,7 @@ jbig2_region_find_referred(Jbig2Ctx *ctx,Jbig2Segment *segment)
+ return NULL;
+ }
+
+-/**
++/**
+ * Handler for generic refinement region segments
+ */
+ int
+@@ -328,7 +324,7 @@ jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ Jbig2RegionSegmentInfo rsi;
+ int offset = 0;
+ byte seg_flags;
+-
++
+ /* 7.4.7 */
+ if (segment->data_length < 18)
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+@@ -362,7 +358,7 @@ jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ params.grat[2] = segment_data[offset + 2];
+ params.grat[3] = segment_data[offset + 3];
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+- "grat1: (%d, %d) grat2: (%d, %d)",
++ "grat1: (%d, %d) grat2: (%d, %d)",
+ params.grat[0], params.grat[1],
+ params.grat[2], params.grat[3]);
+ offset += 4;
+@@ -376,7 +372,7 @@ jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ if (ref == NULL)
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+ "could not find reference bitmap!");
+- /* the reference bitmap is the result of a previous
++ /* the reference bitmap is the result of a previous
+ intermediate region segment; the reference selection
+ rules say to use the first one available, and not to
+ reuse any intermediate result, so we simply clone it
+@@ -388,7 +384,7 @@ jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ "found reference bitmap in segment %d", ref->number);
+ } else {
+ /* the reference is just (a subset of) the page buffer */
+- params.reference = jbig2_image_clone(ctx,
++ params.reference = jbig2_image_clone(ctx,
+ ctx->pages[ctx->current_page].image);
+ /* TODO: subset the image if appropriate */
+ }
+diff --git a/jbig2dec/jbig2_segment.c b/jbig2dec/jbig2_segment.c
+--- a/jbig2dec/jbig2_segment.c
++++ b/jbig2dec/jbig2_segment.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_segment.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h> /* size_t */
+@@ -75,21 +72,21 @@ jbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,
+ pa_size = result->flags & 0x40 ? 4 : 1; /* 7.2.6 */
+ if (offset + referred_to_segment_count*referred_to_segment_size + pa_size + 4 > buf_size)
+ {
+- jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,
++ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,
+ "jbig2_parse_segment_header() called with insufficient data", -1);
+ jbig2_free (ctx->allocator, result);
+ return NULL;
+ }
+-
++
+ /* 7.2.5 */
+ if (referred_to_segment_count)
+ {
+ int i;
+
+ referred_to_segments = jbig2_alloc(ctx->allocator, referred_to_segment_count * referred_to_segment_size * sizeof(uint32_t));
+-
++
+ for (i = 0; i < referred_to_segment_count; i++) {
+- referred_to_segments[i] =
++ referred_to_segments[i] =
+ (referred_to_segment_size == 1) ? buf[offset] :
+ (referred_to_segment_size == 2) ? jbig2_get_int16(buf+offset) :
+ jbig2_get_int32(buf + offset);
+@@ -104,7 +101,7 @@ jbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,
+ {
+ result->referred_to_segments = NULL;
+ }
+-
++
+ /* 7.2.6 */
+ if (result->flags & 0x40) {
+ result->page_association = jbig2_get_int32(buf + offset);
+@@ -115,7 +112,7 @@ jbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,
+ "segment %d is associated with page %d",
+ result->number, result->page_association);
+-
++
+ /* 7.2.7 */
+ result->data_length = jbig2_get_int32(buf + offset);
+ *p_header_size = offset + 4;
+@@ -165,12 +162,12 @@ jbig2_find_segment(Jbig2Ctx *ctx, uint32_t number)
+ for (index = index_max; index >= 0; index--)
+ if (ctx->segments[index]->number == number)
+ return (ctx->segments[index]);
+-
++
+ if (global_ctx)
+ for (index = global_ctx->segment_index - 1; index >= 0; index--)
+ if (global_ctx->segments[index]->number == number)
+ return (global_ctx->segments[index]);
+-
++
+ /* didn't find a match */
+ return NULL;
+ }
+@@ -197,7 +194,7 @@ int jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ bool reserved, dependent, necessary;
+
+ type = jbig2_get_int32(segment_data);
+-
++
+ reserved = type & 0x20000000;
+ dependent = type & 0x40000000;
+ necessary = type & 0x80000000;
+@@ -206,7 +203,7 @@ int jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "extension segment is marked 'necessary' but not 'reservered' contrary to spec");
+ }
+-
++
+ switch (type) {
+ case 0x20000000: return jbig2_parse_comment_ascii(ctx, segment, segment_data);
+ case 0x20000002: return jbig2_parse_comment_unicode(ctx, segment, segment_data);
+@@ -219,7 +216,7 @@ int jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ "unhandled extension segment");
+ }
+ }
+-
++
+ return 0;
+ }
+
+diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
+--- a/jbig2dec/jbig2_symbol_dict.c
++++ b/jbig2dec/jbig2_symbol_dict.c
+@@ -1,26 +1,23 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_symbol_dict.c 8433 2007-12-11 08:29:58Z ken $
+-
+- symbol dictionary segment decode and support
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
++/* symbol dictionary segment decode and support */
++
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+@@ -70,12 +67,12 @@ jbig2_dump_symbol_dict(Jbig2Ctx *ctx, Jbig2Segment *segment)
+ Jbig2SymbolDict *dict = (Jbig2SymbolDict *)segment->result;
+ int index;
+ char filename[24];
+-
++
+ if (dict == NULL) return;
+ jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
+ "dumping symbol dict as %d individual png files\n", dict->n_symbols);
+ for (index = 0; index < dict->n_symbols; index++) {
+- snprintf(filename, sizeof(filename), "symbol_%02d-%04d.png",
++ snprintf(filename, sizeof(filename), "symbol_%02d-%04d.png",
+ segment->number, index);
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "dumping symbol %d/%d as '%s'", index, dict->n_symbols, filename);
+@@ -93,7 +90,7 @@ Jbig2SymbolDict *
+ jbig2_sd_new(Jbig2Ctx *ctx, int n_symbols)
+ {
+ Jbig2SymbolDict *new = NULL;
+-
++
+ new = (Jbig2SymbolDict *)jbig2_alloc(ctx->allocator,
+ sizeof(Jbig2SymbolDict));
+ if (new != NULL) {
+@@ -110,7 +107,7 @@ jbig2_sd_new(Jbig2Ctx *ctx, int n_symbols)
+ jbig2_free(ctx->allocator, new);
+ return NULL;
+ }
+-
++
+ return new;
+ }
+
+@@ -119,7 +116,7 @@ void
+ jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict)
+ {
+ int i;
+-
++
+ if (dict == NULL) return;
+ for (i = 0; i < dict->n_symbols; i++)
+ if (dict->glyphs[i]) jbig2_image_release(ctx, dict->glyphs[i]);
+@@ -142,12 +139,12 @@ jbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)
+ int index;
+ Jbig2Segment *rsegment;
+ int n_dicts = 0;
+-
++
+ for (index = 0; index < segment->referred_to_segment_count; index++) {
+ rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]);
+ if (rsegment && ((rsegment->flags & 63) == 0)) n_dicts++;
+ }
+-
++
+ return (n_dicts);
+ }
+
+@@ -160,7 +157,7 @@ jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)
+ Jbig2SymbolDict **dicts;
+ int n_dicts = jbig2_sd_count_referred(ctx, segment);
+ int dindex = 0;
+-
++
+ dicts = jbig2_alloc(ctx->allocator, sizeof(Jbig2SymbolDict *) * n_dicts);
+ for (index = 0; index < segment->referred_to_segment_count; index++) {
+ rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]);
+@@ -169,25 +166,25 @@ jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)
+ dicts[dindex++] = (Jbig2SymbolDict *)rsegment->result;
+ }
+ }
+-
++
+ if (dindex != n_dicts) {
+ /* should never happen */
+ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+ "counted %d symbol dictionaries but build a list with %d.\n",
+ n_dicts, dindex);
+ }
+-
++
+ return (dicts);
+ }
+
+-/* generate a new symbol dictionary by concatenating a list of
++/* generate a new symbol dictionary by concatenating a list of
+ existing dictionaries */
+ Jbig2SymbolDict *
+ jbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts, Jbig2SymbolDict **dicts)
+ {
+ int i,j,k, symbols;
+ Jbig2SymbolDict *new = NULL;
+-
++
+ /* count the imported symbols and allocate a new array */
+ symbols = 0;
+ for(i = 0; i < n_dicts; i++)
+@@ -201,7 +198,7 @@ jbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts, Jbig2SymbolDict **dicts)
+ for (j = 0; j < dicts[i]->n_symbols; j++)
+ new->glyphs[k++] = jbig2_image_clone(ctx, dicts[i]->glyphs[j]);
+ }
+-
++
+ return new;
+ }
+
+@@ -311,7 +308,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ #ifdef JBIG2_DEBUG
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "HCHEIGHT = %d", HCHEIGHT);
+-#endif
++#endif
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "decoding height class %d with %d syms decoded", HCHEIGHT, NSYMSDECODED);
+
+@@ -374,7 +371,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ code = jbig2_decode_generic_region(ctx, segment, &region_params,
+ as, image, GB_stats);
+ /* todo: handle errors */
+-
++
+ SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+
+ } else {
+@@ -399,7 +396,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ Jbig2Image *image;
+ int i;
+
+- if (tparams == NULL)
++ if (tparams == NULL)
+ {
+ /* First time through, we need to initialise the */
+ /* various tables for Huffman or adaptive encoding */
+@@ -438,7 +435,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ tparams->IADS = jbig2_arith_int_ctx_new(ctx);
+ tparams->IAIT = jbig2_arith_int_ctx_new(ctx);
+ /* Table 31 */
+- for (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) <
++ for (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) <
+ (int)(params->SDNUMINSYMS + params->SDNUMNEWSYMS); SBSYMCODELEN++);
+ tparams->IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN);
+ tparams->IARI = jbig2_arith_int_ctx_new(ctx);
+@@ -485,7 +482,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ }
+
+ /* multiple symbols are handled as a text region */
+- jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
++ jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
+ n_refagg_dicts, image, data, size, GR_stats, as, (Jbig2WordStream *)NULL);
+
+ SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+@@ -514,7 +511,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ "refinement references unknown symbol %d", ID);
+ return NULL;
+ }
+-
++
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "symbol is a refinement of id %d with the refinement applied at (%d,%d)",
+ ID, RDX, RDY);
+@@ -523,14 +520,14 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+
+ /* Table 18 */
+ rparams.GRTEMPLATE = params->SDRTEMPLATE;
+- rparams.reference = (ID < ninsyms) ?
++ rparams.reference = (ID < ninsyms) ?
+ params->SDINSYMS->glyphs[ID] :
+ SDNEWSYMS->glyphs[ID-ninsyms];
+ rparams.DX = RDX;
+ rparams.DY = RDY;
+ rparams.TPGRON = 0;
+ memcpy(rparams.grat, params->sdrat, 4);
+- jbig2_decode_refinement_region(ctx, segment,
++ jbig2_decode_refinement_region(ctx, segment,
+ &rparams, as, image, GR_stats);
+
+ SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+@@ -542,7 +539,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ {
+ char name[64];
+ FILE *out;
+- snprintf(name, 64, "sd.%04d.%04d.pbm",
++ snprintf(name, 64, "sd.%04d.%04d.pbm",
+ segment->number, NSYMSDECODED);
+ out = fopen(name, "wb");
+ jbig2_image_write_pbm(SDNEWSYMS->glyphs[NSYMSDECODED], out);
+@@ -558,7 +555,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ if (params->SDHUFF && !params->SDREFAGG) {
+ SDNEWSYMWIDTHS[NSYMSDECODED] = SYMWIDTH;
+ }
+-
++
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "decoded symbol %d of %d (%dx%d)",
+ NSYMSDECODED, params->SDNUMNEWSYMS,
+@@ -597,7 +594,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ if (BMSIZE == 0) {
+ /* if BMSIZE == 0 bitmap is uncompressed */
+ const byte *src = data + jbig2_huffman_offset(hs);
+- const int stride = (image->width >> 3) +
++ const int stride = (image->width >> 3) +
+ ((image->width & 7) ? 1 : 0);
+ byte *dst = image->data;
+
+@@ -638,17 +635,17 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ for (j = HCFIRSTSYM; j < NSYMSDECODED; j++) {
+ Jbig2Image *glyph;
+ glyph = jbig2_image_new(ctx, SDNEWSYMWIDTHS[j], HCHEIGHT);
+- jbig2_image_compose(ctx, glyph, image,
++ jbig2_image_compose(ctx, glyph, image,
+ -x, 0, JBIG2_COMPOSE_REPLACE);
+ x += SDNEWSYMWIDTHS[j];
+- SDNEWSYMS->glyphs[j] = glyph;
++ SDNEWSYMS->glyphs[j] = glyph;
+ }
+ jbig2_image_release(ctx, image);
+ }
+
+ } /* end of symbol decode loop */
+
+- if (tparams != NULL)
++ if (tparams != NULL)
+ {
+ if (!params->SDHUFF)
+ {
+@@ -680,7 +677,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ }
+
+ jbig2_free(ctx->allocator, GB_stats);
+-
++
+ /* 6.5.10 */
+ SDEXSYMS = jbig2_sd_new(ctx, params->SDNUMEXSYMS);
+ {
+@@ -688,7 +685,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ int j = 0;
+ int k, m, exflag = 0;
+ int32_t exrunlength;
+-
++
+ if (params->SDINSYMS != NULL)
+ m = params->SDINSYMS->n_symbols;
+ else
+@@ -699,9 +696,18 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ exrunlength = params->SDNUMEXSYMS;
+ else
+ code = jbig2_arith_int_decode(IAEX, as, &exrunlength);
++ if (exrunlength > params->SDNUMEXSYMS - j) {
++ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
++ "runlength too large in export symbol table (%d > %d - %d)\n",
++ exrunlength, params->SDNUMEXSYMS, j);
++ jbig2_sd_release(ctx, SDEXSYMS);
++ /* skip to the cleanup code and return SDEXSYMS = NULL */
++ SDEXSYMS = NULL;
++ break;
++ }
+ for(k = 0; k < exrunlength; k++)
+ if (exflag) {
+- SDEXSYMS->glyphs[j++] = (i < m) ?
++ SDEXSYMS->glyphs[j++] = (i < m) ?
+ jbig2_image_clone(ctx, params->SDINSYMS->glyphs[i]) :
+ jbig2_image_clone(ctx, SDNEWSYMS->glyphs[i-m]);
+ i++;
+@@ -709,9 +715,9 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ exflag = !exflag;
+ }
+ }
+-
++
+ jbig2_sd_release(ctx, SDNEWSYMS);
+-
++
+ if (!params->SDHUFF) {
+ jbig2_arith_int_ctx_free(ctx, IADH);
+ jbig2_arith_int_ctx_free(ctx, IADW);
+@@ -722,7 +728,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ jbig2_arith_int_ctx_free(ctx, IARDX);
+ jbig2_arith_int_ctx_free(ctx, IARDY);
+ }
+- jbig2_free(ctx->allocator, as);
++ jbig2_free(ctx->allocator, as);
+ } else {
+ if (params->SDREFAGG) {
+ jbig2_free(ctx->allocator, SDNEWSYMWIDTHS);
+@@ -732,7 +738,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ }
+
+ jbig2_word_stream_buf_free(ctx, ws);
+-
++
+ return SDEXSYMS;
+ }
+
+@@ -747,7 +753,7 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ int offset;
+ Jbig2ArithCx *GB_stats = NULL;
+ Jbig2ArithCx *GR_stats = NULL;
+-
++
+ if (segment->data_length < 10)
+ goto too_short;
+
+@@ -766,11 +772,11 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ if (params.SDHUFF) {
+ switch ((flags & 0x000c) >> 2) {
+ case 0: /* Table B.4 */
+- params.SDHUFFDH = jbig2_build_huffman_table(ctx,
++ params.SDHUFFDH = jbig2_build_huffman_table(ctx,
+ &jbig2_huffman_params_D);
+ break;
+ case 1: /* Table B.5 */
+- params.SDHUFFDH = jbig2_build_huffman_table(ctx,
++ params.SDHUFFDH = jbig2_build_huffman_table(ctx,
+ &jbig2_huffman_params_E);
+ break;
+ case 3: /* Custom table from referred segment */
+@@ -785,11 +791,11 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ }
+ switch ((flags & 0x0030) >> 4) {
+ case 0: /* Table B.2 */
+- params.SDHUFFDW = jbig2_build_huffman_table(ctx,
++ params.SDHUFFDW = jbig2_build_huffman_table(ctx,
+ &jbig2_huffman_params_B);
+ break;
+ case 1: /* Table B.3 */
+- params.SDHUFFDW = jbig2_build_huffman_table(ctx,
++ params.SDHUFFDW = jbig2_build_huffman_table(ctx,
+ &jbig2_huffman_params_C);
+ break;
+ case 3: /* Custom table from referred segment */
+@@ -811,7 +817,7 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ params.SDHUFFBMSIZE = jbig2_build_huffman_table(ctx,
+ &jbig2_huffman_params_A);
+ }
+- if (flags & 0x0080) {
++ if (flags & 0x0080) {
+ /* Custom table from referred segment */
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+ "symbol dictionary uses custom REFAGG huffman table (NYI)");
+@@ -833,7 +839,7 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "SDHUFF is zero, but contrary to spec SDHUFFDW is not.");
+ }
+- }
++ }
+
+ if (flags & 0x0080) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+@@ -853,7 +859,7 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ offset += 4;
+ } else {
+ /* sdrat is meaningless if SDRTEMPLATE is 1, but set a value
+- to avoid confusion if anybody looks */
++ to avoid confusion if anybody looks */
+ memset(params.sdrat, 0, 4);
+ }
+
+@@ -874,8 +880,8 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ {
+ int n_dicts = jbig2_sd_count_referred(ctx, segment);
+ Jbig2SymbolDict **dicts = NULL;
+-
+- params.SDINSYMS = NULL;
++
++ params.SDINSYMS = NULL;
+ if (n_dicts > 0) {
+ dicts = jbig2_sd_list_referred(ctx, segment);
+ params.SDINSYMS = jbig2_sd_cat(ctx, n_dicts, dicts);
+@@ -886,7 +892,7 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ params.SDNUMINSYMS = 0;
+ }
+ }
+-
++
+ /* 7.4.2.2 (4) */
+ if (!params.SDHUFF) {
+ int stats_size = params.SDTEMPLATE == 0 ? 65536 :
+diff --git a/jbig2dec/jbig2_symbol_dict.h b/jbig2dec/jbig2_symbol_dict.h
+--- a/jbig2dec/jbig2_symbol_dict.h
++++ b/jbig2dec/jbig2_symbol_dict.h
+@@ -1,22 +1,19 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2002 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_symbol_dict.h 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
++*/
+
+- symbol dictionary header
+- */
++/* symbol dictionary header */
+
+ /* the results of decoding a symbol dictionary */
+ typedef struct {
+@@ -47,12 +44,12 @@ Jbig2SymbolDict *
+ jbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts,
+ Jbig2SymbolDict **dicts);
+
+-/* count the number of dictionary segments referred
++/* count the number of dictionary segments referred
+ to by the given segment */
+ int
+ jbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
+
+-/* return an array of pointers to symbol dictionaries referred
++/* return an array of pointers to symbol dictionaries referred
+ to by a segment */
+ Jbig2SymbolDict **
+ jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
+diff --git a/jbig2dec/jbig2_text.c b/jbig2dec/jbig2_text.c
+--- a/jbig2dec/jbig2_text.c
++++ b/jbig2dec/jbig2_text.c
+@@ -1,24 +1,21 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2002-2008 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2_text.c 8723 2008-05-09 14:00:44Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+-#endif
++#endif
+ #include "os_types.h"
+
+ #include <stddef.h>
+@@ -79,14 +76,14 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ Jbig2HuffmanTable *SBSYMCODES = NULL;
+ int code = 0;
+ int RI;
+-
++
+ SBNUMSYMS = 0;
+ for (index = 0; index < n_dicts; index++) {
+ SBNUMSYMS += dicts[index]->n_symbols;
+ }
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "symbol list contains %d glyphs in %d dictionaries", SBNUMSYMS, n_dicts);
+-
++
+ if (params->SBHUFF) {
+ Jbig2HuffmanTable *runcodes;
+ Jbig2HuffmanParams runcodeparams;
+@@ -141,14 +138,14 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ len = code;
+ range = 1;
+ } else {
+- if (index < 1) {
+- jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+- "error decoding symbol id table: run length with no antecedent!");
+- /* todo: memory cleanup */
+- return -1;
+- }
+ if (code == 32) {
+ len = symcodelengths[index-1].PREFLEN;
++ if (index < 1) {
++ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
++ "error decoding symbol id table: run length with no antecedent!");
++ /* todo: memory cleanup */
++ return -1;
++ }
+ } else {
+ len = 0; /* code == 33 or 34 */
+ }
+@@ -165,8 +162,8 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ range = SBNUMSYMS - index;
+ }
+ for (r = 0; r < range; r++) {
+- symcodelengths[index+r].PREFLEN = len;
+- symcodelengths[index+r].RANGELEN = 0;
++ symcodelengths[index+r].PREFLEN = len;
++ symcodelengths[index+r].RANGELEN = 0;
+ symcodelengths[index+r].RANGELOW = index + r;
+ }
+ index += r;
+@@ -198,7 +195,7 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+
+ /* 6.4.5 (1) */
+ jbig2_image_clear(ctx, image, params->SBDEFPIXEL);
+-
++
+ /* 6.4.6 */
+ if (params->SBHUFF) {
+ STRIPT = jbig2_huffman_get(hs, params->SBHUFFDT, &code);
+@@ -210,7 +207,7 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ STRIPT *= -(params->SBSTRIPS);
+ FIRSTS = 0;
+ NINSTANCES = 0;
+-
++
+ /* 6.4.5 (3) */
+ while (NINSTANCES < params->SBNUMINSTANCES) {
+ /* (3b) */
+@@ -221,7 +218,7 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ }
+ DT *= params->SBSTRIPS;
+ STRIPT += DT;
+-
++
+ first_symbol = TRUE;
+ /* 6.4.5 (3c) - decode symbols in strip */
+ for (;;) {
+@@ -293,7 +290,7 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ Jbig2RefinementRegionParams rparams;
+ Jbig2Image *IBO;
+ int32_t RDW, RDH, RDX, RDY;
+- Jbig2Image *image;
++ Jbig2Image *refimage;
+ int BMSIZE = 0;
+
+ /* 6.4.11 (1, 2, 3, 4) */
+@@ -313,8 +310,8 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+
+ /* 6.4.11 (6) */
+ IBO = IB;
+- image = jbig2_image_new(ctx, IBO->width + RDW,
+- IBO->height + RDH);
++ refimage = jbig2_image_new(ctx, IBO->width + RDW,
++ IBO->height + RDH);
+
+ /* Table 12 */
+ rparams.GRTEMPLATE = params->SBRTEMPLATE;
+@@ -324,8 +321,8 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ rparams.TPGRON = 0;
+ memcpy(rparams.grat, params->sbrat, 4);
+ jbig2_decode_refinement_region(ctx, segment,
+- &rparams, as, image, GR_stats);
+- IB = image;
++ &rparams, as, refimage, GR_stats);
++ IB = refimage;
+
+ jbig2_image_release(ctx, IBO);
+
+@@ -335,17 +332,17 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ }
+
+ }
+-
++
+ /* (3c.vi) */
+ if ((!params->TRANSPOSED) && (params->REFCORNER > 1)) {
+ CURS += IB->width - 1;
+ } else if ((params->TRANSPOSED) && !(params->REFCORNER & 1)) {
+ CURS += IB->height - 1;
+ }
+-
++
+ /* (3c.vii) */
+ S = CURS;
+-
++
+ /* (3c.viii) */
+ if (!params->TRANSPOSED) {
+ switch (params->REFCORNER) { /* FIXME: double check offsets */
+@@ -362,23 +359,23 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+ case JBIG2_CORNER_BOTTOMRIGHT: y = S - IB->width + 1; x = T - IB->height + 1; break;
+ }
+ }
+-
++
+ /* (3c.ix) */
+ #ifdef JBIG2_DEBUG
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+- "composing glyph id %d: %dx%d @ (%d,%d) symbol %d/%d",
++ "composing glyph id %d: %dx%d @ (%d,%d) symbol %d/%d",
+ ID, IB->width, IB->height, x, y, NINSTANCES + 1,
+ params->SBNUMINSTANCES);
+ #endif
+ jbig2_image_compose(ctx, image, IB, x, y, params->SBCOMBOP);
+-
++
+ /* (3c.x) */
+ if ((!params->TRANSPOSED) && (params->REFCORNER < 2)) {
+ CURS += IB->width -1 ;
+ } else if ((params->TRANSPOSED) && (params->REFCORNER & 1)) {
+ CURS += IB->height - 1;
+ }
+-
++
+ /* (3c.xi) */
+ NINSTANCES++;
+
+@@ -390,8 +387,8 @@ jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+
+ if (params->SBHUFF) {
+ jbig2_release_huffman_table(ctx, SBSYMCODES);
+- }
+-
++ }
++
+ return 0;
+ }
+
+@@ -411,22 +408,22 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ uint16_t huffman_flags = 0;
+ Jbig2ArithCx *GR_stats = NULL;
+ int code = 0;
+- Jbig2WordStream *ws = NULL;
+- Jbig2ArithState *as = NULL;
+-
++ Jbig2WordStream *ws = NULL;
++ Jbig2ArithState *as = NULL;
++
+ /* 7.4.1 */
+ if (segment->data_length < 17)
+ goto too_short;
+ jbig2_get_region_segment_info(&region_info, segment_data);
+ offset += 17;
+-
++
+ /* 7.4.3.1.1 */
+ flags = jbig2_get_int16(segment_data + offset);
+ offset += 2;
+
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "text region header flags 0x%04x", flags);
+-
++
+ params.SBHUFF = flags & 0x0001;
+ params.SBREFINE = flags & 0x0002;
+ params.LOGSBSTRIPS = (flags & 0x000c) >> 2;
+@@ -450,7 +447,7 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ /* 7.4.3.1.2 */
+ huffman_flags = jbig2_get_int16(segment_data + offset);
+ offset += 2;
+-
++
+ if (huffman_flags & 0x8000)
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "reserved bit 15 of text region huffman flags is not zero");
+@@ -465,16 +462,19 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ params.sbrat[2] = segment_data[offset + 2];
+ params.sbrat[3] = segment_data[offset + 3];
+ offset += 4;
++ } else {
++ /* zero these for the sake of later debug messages */
++ memset(params.sbrat, 0, sizeof(params.sbrat));
+ }
+ }
+-
++
+ /* 7.4.3.1.4 */
+ params.SBNUMINSTANCES = jbig2_get_int32(segment_data + offset);
+ offset += 4;
+-
++
+ if (params.SBHUFF) {
+ /* 7.4.3.1.5 - Symbol ID Huffman table */
+- /* ...this is handled in the segment body decoder */
++ /* ...this is handled in the segment body decoder */
+
+ /* 7.4.3.1.6 - Other Huffman table selection */
+ switch (huffman_flags & 0x0003) {
+@@ -626,12 +626,12 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ "text region uses custom RSIZE huffman table (NYI)");
+ break;
+ }
+-
++
+ if (huffman_flags & 0x8000) {
+ jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
+ "text region huffman flags bit 15 is set, contrary to spec");
+ }
+-
++
+ /* 7.4.3.1.7 */
+ /* For convenience this is done in the body decoder routine */
+ }
+@@ -640,7 +640,7 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ "text region: %d x %d @ (%d,%d) %d symbols",
+ region_info.width, region_info.height,
+ region_info.x, region_info.y, params.SBNUMINSTANCES);
+-
++
+ /* 7.4.3.2 (2) - compose the list of symbol dictionaries */
+ n_dicts = jbig2_sd_count_referred(ctx, segment);
+ if (n_dicts != 0) {
+@@ -656,7 +656,7 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ } else {
+ int index;
+ if (dicts[0] == NULL) {
+- return jbig2_error(ctx, JBIG2_SEVERITY_WARNING,
++ return jbig2_error(ctx, JBIG2_SEVERITY_WARNING,
+ segment->number,
+ "unable to find first referenced symbol dictionary!");
+ }
+@@ -745,17 +745,17 @@ jbig2_parse_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segmen
+ segment->result = image;
+ } else {
+ /* otherwise composite onto the page */
+- jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
++ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "composing %dx%d decoded text region onto page at (%d, %d)",
+ region_info.width, region_info.height, region_info.x, region_info.y);
+ jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page], image,
+ region_info.x, region_info.y, region_info.op);
+ jbig2_image_release(ctx, image);
+ }
+-
+- /* success */
++
++ /* success */
+ return 0;
+-
++
+ too_short:
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+ "Segment too short");
+diff --git a/jbig2dec/jbig2_text.h b/jbig2dec/jbig2_text.h
+--- a/jbig2dec/jbig2_text.h
++++ b/jbig2dec/jbig2_text.h
+@@ -1,76 +1,73 @@
+-/*
+- jbig2dec
+-
+- Copyright (C) 2002-2004 Artifex Software, Inc.
+-
+- This software is distributed under license and may not
+- be copied, modified or distributed except as expressly
+- authorized under the terms of the license contained in
+- the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: jbig2_text.h 8022 2007-06-05 22:23:38Z giles $
+-*/
+-
+-/**
+- * Headers for Text region handling
+- **/
+-
+-typedef enum {
+- JBIG2_CORNER_BOTTOMLEFT = 0,
+- JBIG2_CORNER_TOPLEFT = 1,
+- JBIG2_CORNER_BOTTOMRIGHT = 2,
+- JBIG2_CORNER_TOPRIGHT = 3
+-} Jbig2RefCorner;
+-
+-typedef struct {
+- bool SBHUFF;
+- bool SBREFINE;
+- bool SBDEFPIXEL;
+- Jbig2ComposeOp SBCOMBOP;
+- bool TRANSPOSED;
+- Jbig2RefCorner REFCORNER;
+- int SBDSOFFSET;
+- /* int SBW; */
+- /* int SBH; */
+- uint32_t SBNUMINSTANCES;
+- int LOGSBSTRIPS;
+- int SBSTRIPS;
+- /* int SBNUMSYMS; */
+- /* SBSYMCODES */
+- /* SBSYMCODELEN */
+- /* SBSYMS */
+- Jbig2HuffmanTable *SBHUFFFS;
+- Jbig2HuffmanTable *SBHUFFDS;
+- Jbig2HuffmanTable *SBHUFFDT;
+- Jbig2HuffmanTable *SBHUFFRDW;
+- Jbig2HuffmanTable *SBHUFFRDH;
+- Jbig2HuffmanTable *SBHUFFRDX;
+- Jbig2HuffmanTable *SBHUFFRDY;
+- Jbig2HuffmanTable *SBHUFFRSIZE;
+- Jbig2ArithIntCtx *IADT;
+- Jbig2ArithIntCtx *IAFS;
+- Jbig2ArithIntCtx *IADS;
+- Jbig2ArithIntCtx *IAIT;
+- Jbig2ArithIaidCtx *IAID;
+- Jbig2ArithIntCtx *IARI;
+- Jbig2ArithIntCtx *IARDW;
+- Jbig2ArithIntCtx *IARDH;
+- Jbig2ArithIntCtx *IARDX;
+- Jbig2ArithIntCtx *IARDY;
+- bool SBRTEMPLATE;
+- int8_t sbrat[4];
+-} Jbig2TextRegionParams;
+-
+-int
+-jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+- const Jbig2TextRegionParams *params,
+- const Jbig2SymbolDict * const *dicts, const int n_dicts,
+- Jbig2Image *image,
+- const byte *data, const size_t size,
+- Jbig2ArithCx *GR_stats,
+- Jbig2ArithState *as, Jbig2WordStream *ws);
++/*
++ jbig2dec
++
++ Copyright (C) 2002-2004 Artifex Software, Inc.
++
++ This software is distributed under license and may not
++ be copied, modified or distributed except as expressly
++ authorized under the terms of the license contained in
++ the file LICENSE in this distribution.
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
++*/
++
++/**
++ * Headers for Text region handling
++ **/
++
++typedef enum {
++ JBIG2_CORNER_BOTTOMLEFT = 0,
++ JBIG2_CORNER_TOPLEFT = 1,
++ JBIG2_CORNER_BOTTOMRIGHT = 2,
++ JBIG2_CORNER_TOPRIGHT = 3
++} Jbig2RefCorner;
++
++typedef struct {
++ bool SBHUFF;
++ bool SBREFINE;
++ bool SBDEFPIXEL;
++ Jbig2ComposeOp SBCOMBOP;
++ bool TRANSPOSED;
++ Jbig2RefCorner REFCORNER;
++ int SBDSOFFSET;
++ /* int SBW; */
++ /* int SBH; */
++ uint32_t SBNUMINSTANCES;
++ int LOGSBSTRIPS;
++ int SBSTRIPS;
++ /* int SBNUMSYMS; */
++ /* SBSYMCODES */
++ /* SBSYMCODELEN */
++ /* SBSYMS */
++ Jbig2HuffmanTable *SBHUFFFS;
++ Jbig2HuffmanTable *SBHUFFDS;
++ Jbig2HuffmanTable *SBHUFFDT;
++ Jbig2HuffmanTable *SBHUFFRDW;
++ Jbig2HuffmanTable *SBHUFFRDH;
++ Jbig2HuffmanTable *SBHUFFRDX;
++ Jbig2HuffmanTable *SBHUFFRDY;
++ Jbig2HuffmanTable *SBHUFFRSIZE;
++ Jbig2ArithIntCtx *IADT;
++ Jbig2ArithIntCtx *IAFS;
++ Jbig2ArithIntCtx *IADS;
++ Jbig2ArithIntCtx *IAIT;
++ Jbig2ArithIaidCtx *IAID;
++ Jbig2ArithIntCtx *IARI;
++ Jbig2ArithIntCtx *IARDW;
++ Jbig2ArithIntCtx *IARDH;
++ Jbig2ArithIntCtx *IARDX;
++ Jbig2ArithIntCtx *IARDY;
++ bool SBRTEMPLATE;
++ int8_t sbrat[4];
++} Jbig2TextRegionParams;
++
++int
++jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
++ const Jbig2TextRegionParams *params,
++ const Jbig2SymbolDict * const *dicts, const int n_dicts,
++ Jbig2Image *image,
++ const byte *data, const size_t size,
++ Jbig2ArithCx *GR_stats,
++ Jbig2ArithState *as, Jbig2WordStream *ws);
+diff --git a/jbig2dec/jbig2dec.c b/jbig2dec/jbig2dec.c
+--- a/jbig2dec/jbig2dec.c
++++ b/jbig2dec/jbig2dec.c
+@@ -1,25 +1,29 @@
+ /*
+ jbig2dec
+-
+- Copyright (C) 2001-2003 Artifex Software, Inc.
+-
++
++ Copyright (C) 2001-2009 Artifex Software, Inc.
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: jbig2dec.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
++#ifndef PACKAGE
++#define PACKAGE "jbig2dec"
++#endif
++#ifndef VERSION
++#define VERSION "unknown-version"
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -86,7 +90,7 @@ hash_print(jbig2dec_params_t *params, FILE *out)
+ unsigned char md[SHA1_DIGEST_SIZE];
+ char digest[2*SHA1_DIGEST_SIZE + 1];
+ int i;
+-
++
+ SHA1_Final(params->hash_ctx, md);
+ for (i = 0; i < SHA1_DIGEST_SIZE; i++) {
+ snprintf(&(digest[2*i]), 3, "%02x", md[i]);
+@@ -114,7 +118,7 @@ set_output_format(jbig2dec_params_t *params, const char *format)
+ #endif
+ /* default to pbm */
+ params->output_format=jbig2dec_format_pbm;
+-
++
+ return 0;
+ }
+
+@@ -223,7 +227,7 @@ print_usage (void)
+ #endif
+ "\n"
+ );
+-
++
+ return 1;
+ }
+
+@@ -234,7 +238,7 @@ error_callback(void *error_callback_data, const char *buf, Jbig2Severity severit
+ const jbig2dec_params_t *params = error_callback_data;
+ char *type;
+ char segment[22];
+-
++
+ switch (severity) {
+ case JBIG2_SEVERITY_DEBUG:
+ if (params->verbose < 3) return 0;
+@@ -250,7 +254,7 @@ error_callback(void *error_callback_data, const char *buf, Jbig2Severity severit
+ }
+ if (seg_idx == -1) segment[0] = '\0';
+ else snprintf(segment, sizeof(segment), "(segment 0x%02x)", seg_idx);
+-
++
+ fprintf(stderr, "jbig2dec %s %s %s\n", type, buf, segment);
+
+ return 0;
+@@ -262,15 +266,15 @@ make_output_filename(const char *input_filename, const char *extension)
+ char *output_filename;
+ const char *c, *e;
+ int len;
+-
++
+ if (extension == NULL) {
+ fprintf(stderr, "make_output_filename called with no extension!\n");
+ exit (1);
+ }
+-
++
+ if (input_filename == NULL)
+ c = "out";
+- else {
++ else {
+ /* strip any leading path */
+ c = strrchr(input_filename, '/'); /* *nix */
+ if (c == NULL)
+@@ -284,24 +288,24 @@ make_output_filename(const char *input_filename, const char *extension)
+ /* make sure we haven't just stripped the last character */
+ if (*c == '\0')
+ c = "out";
+-
++
+ /* strip the extension */
+ len = strlen(c);
+ e = strrchr(c, '.');
+ if (e != NULL)
+ len -= strlen(e);
+-
++
+ /* allocate enough space for the base + ext */
+ output_filename = malloc(len + strlen(extension) + 1);
+ if (output_filename == NULL) {
+ fprintf(stderr, "couldn't allocate memory for output_filename\n");
+ exit (1);
+ }
+-
++
+ strncpy(output_filename, c, len);
+ strncpy(output_filename + len, extension, strlen(extension));
+ *(output_filename + len + strlen(extension)) = '\0';
+-
++
+ /* return the new string */
+ return (output_filename);
+ }
+@@ -343,7 +347,7 @@ write_page_image(jbig2dec_params_t *params, Jbig2Image *image)
+ return 1;
+ }
+ }
+-
++
+ return 0;
+ }
+
+@@ -351,17 +355,17 @@ static int
+ write_document_hash(jbig2dec_params_t *params)
+ {
+ FILE *out;
+-
++
+ if (!strncmp(params->output_file, "-", 2)) {
+ out = stderr;
+ } else {
+ out = stdout;
+ }
+-
++
+ fprintf(out, "Hash of decoded document: ");
+ hash_print(params, out);
+ fprintf(out, "\n");
+-
++
+ return 0;
+ }
+
+@@ -373,18 +377,18 @@ main (int argc, char **argv)
+ uint8_t buf[4096];
+ jbig2dec_params_t params;
+ int filearg;
+-
++
+ /* set defaults */
+ params.mode = render;
+ params.verbose = 1;
+ params.hash = 0;
+ params.output_file = NULL;
+ params.output_format = jbig2dec_format_none;
+-
++
+ filearg = parse_options(argc, argv, &params);
+
+ if (params.hash) hash_init(&params);
+-
++
+ switch (params.mode) {
+ case usage:
+ print_usage();
+@@ -394,7 +398,7 @@ main (int argc, char **argv)
+ fprintf(stderr, "Sorry, segment dump not yet implemented\n");
+ break;
+ case render:
+-
++
+ if ((argc - filearg) == 1)
+ /* only one argument--open as a jbig2 file */
+ {
+@@ -430,7 +434,7 @@ main (int argc, char **argv)
+ else
+ /* any other number of arguments */
+ return print_usage();
+-
++
+ ctx = jbig2_ctx_new(NULL, f_page != NULL ? JBIG2_OPTIONS_EMBEDDED : 0,
+ NULL,
+ error_callback, &params);
+@@ -469,7 +473,7 @@ main (int argc, char **argv)
+ /* work around broken CVision embedded streams */
+ if (f_page != NULL)
+ jbig2_complete_page(ctx);
+-
++
+ if (params.output_file == NULL)
+ {
+ #ifdef HAVE_LIBPNG
+@@ -494,14 +498,14 @@ main (int argc, char **argv)
+ }
+ if (params.hash) write_document_hash(&params);
+ }
+-
++
+ jbig2_ctx_free(ctx);
+
+ } /* end params.mode switch */
+
+ if (params.output_file) free(params.output_file);
+ if (params.hash) hash_free(&params);
+-
++
+ /* fin */
+ return 0;
+ }
+diff --git a/jbig2dec/memcmp.c b/jbig2dec/memcmp.c
+--- a/jbig2dec/memcmp.c
++++ b/jbig2dec/memcmp.c
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2001-2005 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
+- San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+
+- $Id: memcmp.c 8022 2007-06-05 22:23:38Z giles $
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
++ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+ */
+
+ #ifdef HAVE_CONFIG_H
+diff --git a/jbig2dec/missing b/jbig2dec/missing
+--- a/jbig2dec/missing
++++ b/jbig2dec/missing
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+ # Common stub for a few missing GNU programs while installing.
+
+-scriptversion=2005-02-08.22
++scriptversion=2006-05-10.23
+
+-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
++# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+ # Free Software Foundation, Inc.
+ # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+@@ -19,8 +19,8 @@ scriptversion=2005-02-08.22
+
+ # 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.
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301, USA.
+
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -33,6 +33,8 @@ if test $# -eq 0; then
+ fi
+
+ run=:
++sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
++sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+ # In the cases where this matters, `missing' is being run in the
+ # srcdir already.
+@@ -44,7 +46,7 @@ fi
+
+ msg="missing on your system"
+
+-case "$1" in
++case $1 in
+ --run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+@@ -77,6 +79,7 @@ Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
++ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+@@ -106,7 +109,7 @@ esac
+ # Now exit if we have it, but it failed. Also exit now if we
+ # don't have it and --version was passed (most likely to detect
+ # the program).
+-case "$1" in
++case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+@@ -135,7 +138,7 @@ esac
+
+ # If it does not exist, or fails to run (possibly an outdated version),
+ # try to emulate it.
+-case "$1" in
++case $1 in
+ aclocal*)
+ echo 1>&2 "\
+ WARNING: \`$1' is $msg. You should only need it if
+@@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+- case "$f" in
++ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+@@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
++ file=`echo "$*" | sed -n "$sed_output"`
++ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+@@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+- if [ $# -ne 1 ]; then
++ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+- case "$LASTARG" in
++ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+- if [ -f "$SRCFILE" ]; then
++ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+- if [ -f "$SRCFILE" ]; then
++ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+- if [ ! -f y.tab.h ]; then
++ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+- if [ ! -f y.tab.c ]; then
++ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+@@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+- if [ $# -ne 1 ]; then
++ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+- case "$LASTARG" in
++ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+- if [ -f "$SRCFILE" ]; then
++ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+- if [ ! -f lex.yy.c ]; then
++ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+@@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+- if test -z "$file"; then
+- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+- fi
+- if [ -f "$file" ]; then
++ file=`echo "$*" | sed -n "$sed_output"`
++ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
++ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+@@ -289,14 +290,23 @@ WARNING: \`$1' is $msg. You should only need it if
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
++ file=`echo "$*" | sed -n "$sed_output"`
++ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
++ file=`sed -n '
++ /^@setfilename/{
++ s/.* \([^ ]*\) *$/\1/
++ p
++ q
++ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
++ # If the file does not exist, the user really needs makeinfo;
++ # let's fail without touching anything.
++ test -f $file || exit 1
+ touch $file
+ ;;
+
+@@ -314,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if
+ fi
+ firstarg="$1"
+ if shift; then
+- case "$firstarg" in
++ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+- case "$firstarg" in
++ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+diff --git a/jbig2dec/os_types.h b/jbig2dec/os_types.h
+--- a/jbig2dec/os_types.h
++++ b/jbig2dec/os_types.h
+@@ -1,19 +1,16 @@
+ /*
+ jbig2dec
+-
++
+ Copyright (C) 2003 Artifex Software, Inc.
+-
++
+ This software is distributed under license and may not
+ be copied, modified or distributed except as expressly
+ authorized under the terms of the license contained in
+ the file LICENSE in this distribution.
+-
+- For information on commercial licensing, go to
+- http://www.artifex.com/licensing/ or contact
+- Artifex Software, Inc., 101 Lucas Valley Road #110,
++
++ For further licensing information refer to http://artifex.com/ or
++ contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+-
+- $Id: os_types.h 8037 2007-06-10 01:51:33Z alexcher $
+ */
+
+ /*
+@@ -41,7 +38,7 @@
+ #endif
+ #elif defined(HAVE_CONFIG_H)
+ # include "config_types.h"
+-#elif defined(_WIN32) || defined(__WIN32__)
++#elif defined(_WIN32) || defined(__WIN32__)
+ # include "config_win32.h"
+ #endif
+
+diff --git a/jbig2dec/sha1.c b/jbig2dec/sha1.c
+--- a/jbig2dec/sha1.c
++++ b/jbig2dec/sha1.c
+@@ -4,7 +4,7 @@ By Steve Reid <sreid@sea-to-sky.net>
+ 100% Public Domain
+
+ -----------------
+-Modified 7/98
++Modified 7/98
+ By James H. Brown <jbrown@burgoyne.com>
+ Still 100% Public Domain
+
+@@ -26,7 +26,7 @@ Since the file IO in main() reads 16K at a time, any file 8K or larger would
+ be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
+ "a"s).
+
+-I also changed the declaration of variables i & j in SHA1Update to
++I also changed the declaration of variables i & j in SHA1Update to
+ unsigned long from unsigned int for the same reason.
+
+ These changes should make no difference to any 32 bit implementations since
+@@ -53,7 +53,7 @@ Still 100% public domain
+ Modified 4/01
+ By Saul Kravitz <Saul.Kravitz@celera.com>
+ Still 100% PD
+-Modified to run on Compaq Alpha hardware.
++Modified to run on Compaq Alpha hardware.
+
+ -----------------
+ Modified 07/2002
+@@ -116,7 +116,7 @@ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
+ void SHAPrintContext(SHA1_CTX *context, char *msg){
+ printf("%s (%d,%d) %x %x %x %x %x\n",
+ msg,
+- context->count[0], context->count[1],
++ context->count[0], context->count[1],
+ context->state[0],
+ context->state[1],
+ context->state[2],
+@@ -245,7 +245,7 @@ void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE])
+ digest[i] = (uint8_t)
+ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
+ }
+-
++
+ /* Wipe variables */
+ i = 0;
+ memset(context->buffer, 0, 64);
+@@ -257,7 +257,7 @@ void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE])
+ SHA1_Transform(context->state, context->buffer);
+ #endif
+ }
+-
++
+ /*************************************************************/
+
+ #if 0
+@@ -282,7 +282,7 @@ FILE* file;
+ fputs("Unable to open file.", stderr);
+ return(-1);
+ }
+- }
++ }
+ SHA1_Init(&context);
+ while (!feof(file)) { /* note: what if ferror(file) */
+ i = fread(buffer, 1, 16384, file);
+@@ -313,13 +313,13 @@ static char *test_results[] = {
+ "A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D",
+ "84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1",
+ "34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F"};
+-
++
+
+ void digest_to_hex(const uint8_t digest[SHA1_DIGEST_SIZE], char *output)
+ {
+ int i,j;
+ char *c = output;
+-
++
+ for (i = 0; i < SHA1_DIGEST_SIZE/4; i++) {
+ for (j = 0; j < 4; j++) {
+ sprintf(c,"%02X", digest[i*4+j]);
+@@ -330,7 +330,7 @@ void digest_to_hex(const uint8_t digest[SHA1_DIGEST_SIZE], char *output)
+ }
+ *(c - 1) = '\0';
+ }
+-
++
+ int main(int argc, char** argv)
+ {
+ int k;
+@@ -339,8 +339,8 @@ int main(int argc, char** argv)
+ char output[80];
+
+ fprintf(stdout, "verifying SHA-1 implementation... ");
+-
+- for (k = 0; k < 2; k++){
++
++ for (k = 0; k < 2; k++){
+ SHA1_Init(&context);
+ SHA1_Update(&context, (uint8_t*)test_data[k], strlen(test_data[k]));
+ SHA1_Final(&context, digest);
+@@ -352,7 +352,7 @@ int main(int argc, char** argv)
+ fprintf(stderr,"\t%s returned\n", output);
+ fprintf(stderr,"\t%s is correct\n", test_results[k]);
+ return (1);
+- }
++ }
+ }
+ /* million 'a' vector we feed separately */
+ SHA1_Init(&context);
+diff --git a/jbig2dec/test_jbig2dec.py b/jbig2dec/test_jbig2dec.py
+--- a/jbig2dec/test_jbig2dec.py
++++ b/jbig2dec/test_jbig2dec.py
+@@ -1,12 +1,60 @@
+ #! /usr/bin/env python
+
+ # this is the testtest script for jbig2dec
+-# $Id: test_jbig2dec.py 6300 2005-12-28 19:56:24Z giles $
+
+ import os, re
+-import unittest
++import sys, time
+
+-class KnownFileHash(unittest.TestCase):
++class SelfTest:
++ 'generic class for self tests'
++ def __init__(self):
++ self.result = 'unrun'
++ self.msg = ''
++ def shortDescription(self):
++ 'returns a short name for the test'
++ return "generic self test"
++ def runTest(self):
++ 'call this to execute the test'
++ pass
++ def fail(self, msg=None):
++ self.result = 'FAIL'
++ self.msg = msg
++ def failIf(self, check, msg=None):
++ if check: self.fail(msg)
++ def assertEqual(self, a, b, msg=None):
++ if a != b: self.fail(msg)
++
++class SelfTestSuite:
++ 'generic class for running a collection of SelfTest instances'
++ def __init__(self, stream=sys.stderr):
++ self.stream = stream
++ self.tests = []
++ self.fails = []
++ self.xfails = []
++ self.errors = []
++ def addTest(self, test):
++ self.tests.append(test)
++ def run(self):
++ starttime = time.time()
++ for test in self.tests:
++ self.stream.write("%s ... " % test.shortDescription())
++ test.result = 'ok'
++ test.runTest()
++ if test.result != 'ok':
++ self.fails.append(test)
++ self.stream.write("%s\n" % test.result)
++ stoptime = time.time()
++ self.stream.write('-'*72 + '\n')
++ self.stream.write('ran %d tests in %.3f seconds\n\n' %
++ (len(self.tests), stoptime - starttime))
++ if len(self.fails):
++ self.stream.write('FAILED %d of %d tests\n' %
++ (len(self.fails),len(self.tests)))
++ else:
++ self.stream.write('PASSED all %d tests\n' % len(self.tests))
++
++class KnownFileHash(SelfTest):
++ 'self test to check for correct decode of known test files'
+
+ # hashes of known test inputs
+ known_042_DECODED = "ebfdf6e2fc5ff3ee2271c2fa19de0e52712046e8"
+@@ -101,10 +149,10 @@ class KnownFileHash(unittest.TestCase):
+ "ff373f070f5f405b732c53ffffff087eff22ff5b") )
+
+ def __init__(self, file, file_hash, decode_hash):
++ SelfTest.__init__(self)
+ self.file = file
+ self.file_hash = file_hash
+ self.decode_hash = decode_hash
+- unittest.TestCase.__init__(self)
+
+ def shortDescription(self):
+ return "Checking '%s' for correct decoded document hash" % self.file
+@@ -126,7 +174,7 @@ class KnownFileHash(unittest.TestCase):
+ return
+ self.fail('document hash was not found in the output')
+
+-suite = unittest.TestSuite()
++suite = SelfTestSuite()
+ for filename, file_hash, decode_hash in KnownFileHash.known_hashes:
+ # only add tests for files we can find
+ if not os.access(filename, os.R_OK): continue
+@@ -135,8 +183,5 @@ for filename, file_hash, decode_hash in KnownFileHash.known_hashes:
+
+ # run the defined tests if we're called as a script
+ if __name__ == "__main__":
+- import sys
+- verbosity = 2
+- runner = unittest.TextTestRunner(verbosity=verbosity)
+- result = runner.run(suite)
+- sys.exit(not result.wasSuccessful())
++ result = suite.run()
++ sys.exit(not result)
diff --git a/recipes/gs/gs/1001_install_cjk_examples.patch b/recipes/gs/gs/1001_install_cjk_examples.patch
new file mode 100644
index 0000000000..16de1c84d4
--- /dev/null
+++ b/recipes/gs/gs/1001_install_cjk_examples.patch
@@ -0,0 +1,18 @@
+Description: Install CJK example files
+Author: Jonas Smedegaard <dr@jones.dk>
+diff -ruN a/base/unixinst.mak b/base/unixinst.mak
+--- a/base/unixinst.mak
++++ b/base/unixinst.mak
+@@ -169,6 +169,12 @@
+ ridt91.eps ;\
+ do $(INSTALL_DATA) $(PSEXDIR)/$$f $(DESTDIR)$(exdir) ;\
+ done
++ -mkdir -p $(DESTDIR)$(exdir)/cjk
++ for f in \
++all_ac1.ps all_aj1.ps all_ak1.ps gscjk_ac.ps gscjk_aj.ps iso2022.ps \
++all_ag1.ps all_aj2.ps article9.ps gscjk_ag.ps gscjk_ak.ps iso2022v.ps ;\
++ do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(DESTDIR)$(exdir)/cjk ;\
++ done
+
+ install-shared: $(GS_SHARED_OBJS)
+ -mkdir -p $(DESTDIR)$(gssharedir)
diff --git a/recipes/gs/gs/1002_ps2pdf_man_fix.patch b/recipes/gs/gs/1002_ps2pdf_man_fix.patch
new file mode 100644
index 0000000000..0314d040ac
--- /dev/null
+++ b/recipes/gs/gs/1002_ps2pdf_man_fix.patch
@@ -0,0 +1,126 @@
+Description: Document ps2pdf14 in ps2pdf manpage
+Author: Jonas Smedegaard <dr@jones.dk>
+--- a/man/ps2pdf.1
++++ b/man/ps2pdf.1
+@@ -1,17 +1,21 @@
+ .\" $Id: ps2pdf.1 9434 2009-02-03 17:03:41Z giles $
+-.TH PS2PDF 1 "3 February 2009" 8.64 Ghostscript \" -*- nroff -*-
++.TH PS2PDF 1 "7 February 2009" 8.64 Ghostscript \" -*- nroff -*-
+ .SH NAME
+ ps2pdf \- Convert PostScript to PDF using ghostscript
+ .br
+ ps2pdf12 \- Convert PostScript to PDF\ 1.2 (Acrobat\ 3-and-later compatible) using ghostscript
+ .br
+ ps2pdf13 \- Convert PostScript to PDF\ 1.3 (Acrobat\ 4-and-later compatible) using ghostscript
++.br
++ps2pdf14 \- Convert PostScript to PDF\ 1.4 (Acrobat\ 5-and-later compatible) using ghostscript
+ .SH SYNOPSIS
+ \fBps2pdf\fR [options...] {input.[e]ps|-} [output.pdf|-]
+ .br
+ \fBps2pdf12\fR [options...] {input.[e]ps|-} [output.pdf|-]
+ .br
+ \fBps2pdf13\fR [options...] {input.[e]ps|-} [output.pdf|-]
++.br
++\fBps2pdf14\fR [options...] {input.[e]ps|-} [output.pdf|-]
+ .SH DESCRIPTION
+ The
+ .B ps2pdf
+@@ -32,13 +36,17 @@
+ .B ps2pdf13
+ will always produce PDF 1.3 output (Acrobat 4-and-later compatible).
+ .IP -
++.B ps2pdf14
++will always produce PDF 1.4 output (Acrobat 5-and-later compatible).
++.IP -
+ .B ps2pdf
+ per se currently produces PDF 1.4 output.
+ However, this may change in the future. If you care about
+ the compatibility level of the output, use
+-.B ps2pdf12
++.BR ps2pdf12 ,
++.B ps2pdf13
+ or
+-.BR ps2pdf13 ,
++.BR ps2pdf14 ,
+ or use the
+ .B \-dCompatibility=1.x
+ switch in the command line.
+--- a/man/de/ps2pdf.1
++++ b/man/de/ps2pdf.1
+@@ -1,54 +1,63 @@
+ .\" $Id: ps2pdf.1 9322 2009-01-04 20:15:19Z till $
+-.\" Using encoding of the German (de_DE) translation: ISO-8859-1
++.\" Using encoding of the German (de_DE) translation: UTF-8
+ .\" Translation by Tobias Burnus <burnus@gmx.de> and Thomas Hoffmann
+ .\" revised for version 7.06 by Wolfram Quester <wolfi@mittelerde.physik.uni-kostanz.de>
+-.TH PS2PDF 1 "8.Juli 2002" 7.21 Ghostscript \" -*- nroff -*-
++.\" revised for version 8.64 and recoded to UTF-8 by Jonas Smedegaard <dr@jones.dk>
++.TH PS2PDF 1 "7.März 2009" 8.64 Ghostscript \" -*- nroff -*-
+ .SH NAME
+ ps2pdf \- konvertiert PostScript nach PDF mittels ghostscript
+ .br
+-ps2pdf12 \- konvertiert PostScript nach PDF\ 1.2 (kompatibel zu Acrobat\ 3 und später) mittels ghostscript
++ps2pdf12 \- konvertiert PostScript nach PDF\ 1.2 (kompatibel zu Acrobat\ 3 und später) mittels ghostscript
+ .br
+-ps2pdf13 \- konvertiert PostScript nach PDF\ 1.3 (kompatibel zu Acrobat\ 4 und später) mittels ghostscript
++ps2pdf13 \- konvertiert PostScript nach PDF\ 1.3 (kompatibel zu Acrobat\ 4 und später) mittels ghostscript
++.br
++ps2pdf14 \- konvertiert PostScript nach PDF\ 1.4 (kompatibel zu Acrobat\ 5 und später) mittels ghostscript
+ .SH SYNTAX
+ \fBps2pdf\fR [Optionen...] {Eingabe.[e]ps|-} [Ausgabe.pdf|-]
+ .br
+ \fBps2pdf12\fR [Optionen...] {Eingabe.[e]ps|-} [Ausgabe.pdf|-]
+ .br
+ \fBps2pdf13\fR [Optionen...] {Eingabe.[e]ps|-} [Ausgabe.pdf|-]
++.br
++\fBps2pdf14\fR [Optionen...] {Eingabe.[e]ps|-} [Ausgabe.pdf|-]
+ .SH BESCHREIBUNG
+-Außer in der Benutzerschnittstelle sind die
++Außer in der Benutzerschnittstelle sind die
+ .B ps2pdf\-Skripte
+-nahezu in allen Funktionen äquivalent zu Adobe Acrobat Distiller: Sie konvertieren
++nahezu in allen Funktionen äquivalent zu Adobe Acrobat Distiller: Sie konvertieren
+ PostScript-Dateien in das Portable Document Format (PDF).
+
+ .PP
+ Die drei Skripte unterscheiden sich wie folgt:
+ .IP -
+ .B ps2pdf12
+-produziert immer PDF-1.2-Dateien (kompatibel zu Acrobat 3 und später).
++produziert immer PDF-1.2-Dateien (kompatibel zu Acrobat 3 und später).
+ .IP -
+ .B ps2pdf13
+-produziert immer PDF-1.3-Dateien (kompatibel zu Acrobat 4 und später).
++produziert immer PDF-1.3-Dateien (kompatibel zu Acrobat 4 und später).
++.IP -
++.B ps2pdf14
++produziert immer PDF-1.4-Dateien (kompatibel zu Acrobat 5 und später).
+ .IP -
+ .B ps2pdf
+-selbst produziert standardgemäß PDF-1.2-Dateien (kompatibel zu Acrobat 3 und später); In späteren Versionen kann sich das jedoch ändern. Falls Sie eine bestimmte PDF-Version benötigen, sollten Sie
++selbst produziert standardgemäß PDF-1.4-Dateien (kompatibel zu Acrobat 5 und später); In späteren Versionen kann sich das jedoch ändern. Falls Sie eine bestimmte PDF-Version benötigen, sollten Sie
+ .B ps2pdf12,
+-.BR ps2pdf13
++.B ps2pdf13,
++.BR ps2pdf14
+ oder den
+ .B \-dCompatibility=1.x
+ Schalter in der Kommandozeile benutzen.
+ .PP
+ Die Konvertierung mittels
+ .BR ps2pdf
+-unterliegt einigen Beschränkungen. Ausführlichere Informationen dazu stehen in der HTML-Dokumentation.
++unterliegt einigen Beschränkungen. Ausführlichere Informationen dazu stehen in der HTML-Dokumentation.
+ .SH OPTIONEN
+-Für ps2pdf gelten die gleichen Optionen wie für gs(1).
++Für ps2pdf gelten die gleichen Optionen wie für gs(1).
+ .SH SIEHE AUCH
+ gs(1), ps2pdfwr(1),
+ .br
+ Ps2pdf.htm in der Ghostscript-Dokumentation
+ .SH VERSION
+-Dieses Dokument wurde zuletzt für Ghostscript Version 7.21 durchgesehen.
++Dieses Dokument wurde zuletzt für Ghostscript Version 8.64 durchgesehen.
+ .SH AUTOR
+ Artifex Software, Inc. sind die
+ Hauptautoren von Ghostscript.
diff --git a/recipes/gs/gs/1003_fix_autoconf_create_from_infiles.patch b/recipes/gs/gs/1003_fix_autoconf_create_from_infiles.patch
new file mode 100644
index 0000000000..2f9d898d9e
--- /dev/null
+++ b/recipes/gs/gs/1003_fix_autoconf_create_from_infiles.patch
@@ -0,0 +1,14 @@
+Description: Use newer autoconf syntax to declare autogenerated files
+Author: Jonas Smedegaard <dr@jones.dk>
+diff --git a/base/configure.ac b/base/configure.ac
+--- a/base/configure.ac
++++ b/base/configure.ac
+@@ -1077,6 +1077,7 @@ dnl --------------------------------------------------
+
+ AC_SUBST(OPT_CFLAGS)
+ AC_SUBST(GCFLAGS)
+-AC_OUTPUT(Makefile cups/pstopxl cups/pstoraster)
++AC_CONFIG_FILES([Makefile cups/pstopxl cups/pstoraster])
++AC_OUTPUT
+
+ chmod +x cups/pstopxl cups/pstoraster
diff --git a/recipes/gs/gs/1004_CVE-2009-0792_CVE-2009-0584_CVE-2009-0583.patch b/recipes/gs/gs/1004_CVE-2009-0792_CVE-2009-0584_CVE-2009-0583.patch
new file mode 100644
index 0000000000..79231fb3ec
--- /dev/null
+++ b/recipes/gs/gs/1004_CVE-2009-0792_CVE-2009-0584_CVE-2009-0583.patch
@@ -0,0 +1,1154 @@
+Description: fixing various integer overflows
+Author: Nico Golde <nion@debian.org>
+diff -urNad ghostscript-8.64~dfsg~/icclib/icc.c ghostscript-8.64~dfsg/icclib/icc.c
+--- ghostscript-8.64~dfsg~/icclib/icc.c 2008-05-09 06:12:01.000000000 +0200
++++ ghostscript-8.64~dfsg/icclib/icc.c 2009-04-22 01:44:37.000000000 +0200
+@@ -152,6 +152,8 @@
+ * Various bug fixes and enhancements.
+ */
+
++#include <limits.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+@@ -313,8 +315,11 @@
+ icmFileMem *p = (icmFileMem *)pp;
+ size_t len;
+
++ if (count > 0 && size > SIZE_MAX / count)
++ return 0;
++
+ len = size * count;
+- if ((p->cur + len) >= p->end) { /* Too much */
++ if (len > (p->end - p->cur)) { /* Too much */
+ if (size > 0)
+ count = (p->end - p->cur)/size;
+ else
+@@ -1634,6 +1639,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmUInt8Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -1698,7 +1705,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (unsigned int *) icp->al->malloc(icp->al, p->size * sizeof(unsigned int))) == NULL) {
++ if ((p->data = (unsigned int *) icp->al->calloc(icp->al, p->size, sizeof(unsigned int))) == NULL) {
+ sprintf(icp->err,"icmUInt8Array_alloc: malloc() of icmUInt8Array data failed");
+ return icp->errc = 2;
+ }
+@@ -1749,6 +1756,10 @@
+ icmUInt16Array *p = (icmUInt16Array *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 2) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += p->size * 2; /* 2 bytes for each UInt16 */
+ return len;
+ }
+@@ -1821,6 +1832,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmUInt16Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -1885,7 +1898,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (unsigned int *) icp->al->malloc(icp->al, p->size * sizeof(unsigned int))) == NULL) {
++ if ((p->data = (unsigned int *) icp->al->calloc(icp->al, p->size, sizeof(unsigned int))) == NULL) {
+ sprintf(icp->err,"icmUInt16Array_alloc: malloc() of icmUInt16Array data failed");
+ return icp->errc = 2;
+ }
+@@ -1936,6 +1949,10 @@
+ icmUInt32Array *p = (icmUInt32Array *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 4) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += p->size * 4; /* 4 bytes for each UInt32 */
+ return len;
+ }
+@@ -2008,6 +2025,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmUInt32Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -2072,7 +2091,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (unsigned int *) icp->al->malloc(icp->al, p->size * sizeof(unsigned int))) == NULL) {
++ if ((p->data = (unsigned int *) icp->al->calloc(icp->al, p->size, sizeof(unsigned int))) == NULL) {
+ sprintf(icp->err,"icmUInt32Array_alloc: malloc() of icmUInt32Array data failed");
+ return icp->errc = 2;
+ }
+@@ -2123,6 +2142,10 @@
+ icmUInt64Array *p = (icmUInt64Array *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 8) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += p->size * 8; /* 8 bytes for each UInt64 */
+ return len;
+ }
+@@ -2195,6 +2218,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmUInt64Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -2259,7 +2284,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (icmUint64 *) icp->al->malloc(icp->al, p->size * sizeof(icmUint64))) == NULL) {
++ if ((p->data = (icmUint64 *) icp->al->calloc(icp->al, p->size, sizeof(icmUint64))) == NULL) {
+ sprintf(icp->err,"icmUInt64Array_alloc: malloc() of icmUInt64Array data failed");
+ return icp->errc = 2;
+ }
+@@ -2310,6 +2335,10 @@
+ icmU16Fixed16Array *p = (icmU16Fixed16Array *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 4) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += p->size * 4; /* 4 byte for each U16Fixed16 */
+ return len;
+ }
+@@ -2382,6 +2411,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmU16Fixed16Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -2446,7 +2477,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (double *) icp->al->malloc(icp->al, p->size * sizeof(double))) == NULL) {
++ if ((p->data = (double *) icp->al->calloc(icp->al, p->size, sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmU16Fixed16Array_alloc: malloc() of icmU16Fixed16Array data failed");
+ return icp->errc = 2;
+ }
+@@ -2497,6 +2528,10 @@
+ icmS15Fixed16Array *p = (icmS15Fixed16Array *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 4) {
++ p->icp->errc = 1;
++ return (unsigned int) - 1;
++ }
+ len += p->size * 4; /* 4 byte for each S15Fixed16 */
+ return len;
+ }
+@@ -2569,6 +2604,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmS15Fixed16Array_write malloc() failed");
+ return icp->errc = 2;
+@@ -2633,7 +2670,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (double *) icp->al->malloc(icp->al, p->size * sizeof(double))) == NULL) {
++ if ((p->data = (double *) icp->al->calloc(icp->al, p->size, sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmS15Fixed16Array_alloc: malloc() of icmS15Fixed16Array data failed");
+ return icp->errc = 2;
+ }
+@@ -2726,6 +2763,10 @@
+ icmXYZArray *p = (icmXYZArray *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->size > (UINT_MAX - len) / 12) {
++ p->icp->errc = 1;
++ return (unsigned int) - 1;
++ }
+ len += p->size * 12; /* 12 bytes for each XYZ */
+ return len;
+ }
+@@ -2798,6 +2839,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmXYZArray_write malloc() failed");
+ return icp->errc = 2;
+@@ -2865,7 +2908,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (icmXYZNumber *) icp->al->malloc(icp->al, p->size * sizeof(icmXYZNumber))) == NULL) {
++ if ((p->data = (icmXYZNumber *) icp->al->calloc(icp->al, p->size, sizeof(icmXYZNumber))) == NULL) {
+ sprintf(icp->err,"icmXYZArray_alloc: malloc() of icmXYZArray data failed");
+ return icp->errc = 2;
+ }
+@@ -2939,7 +2982,7 @@
+ rv |= 1;
+ }
+ ix = (int)floor(val); /* Coordinate */
+- if (ix > (p->size-2))
++ if (ix < 0 || ix > (p->size-2))
+ ix = (p->size-2);
+ w = val - (double)ix; /* weight */
+ val = p->data[ix];
+@@ -2961,6 +3004,11 @@
+ ) {
+ int i;
+
++ if (size > INT_MAX - 2)
++ /* Although rt->size is unsigned long, the rt data
++ * structure uses int data types to store indices. */
++ return 2;
++
+ rt->size = size; /* Stash pointers to these away */
+ rt->data = data;
+
+@@ -2979,7 +3027,7 @@
+ rt->qscale = (double)rt->rsize/(rt->rmax - rt->rmin); /* Scale factor to quantize to */
+
+ /* Initialize the reverse lookup structures, and get overall min/max */
+- if ((rt->rlists = (int **) icp->al->calloc(icp->al, 1, rt->rsize * sizeof(int *))) == NULL) {
++ if ((rt->rlists = (int **) icp->al->calloc(icp->al, rt->rsize, sizeof(int *))) == NULL) {
+ return 2;
+ }
+
+@@ -2992,6 +3040,15 @@
+ int t;
+ t = s; s = e; e = t;
+ }
++ /* s and e should both be in the range [0,rt->rsize]
++ * now, but let's not rely on floating point
++ * calculations -- double-check. */
++ if (s < 0)
++ s = 0;
++ if (e < 0)
++ e = 0;
++ if (s >= rt->rsize)
++ s = rt->rsize-1;
+ if (e >= rt->rsize)
+ e = rt->rsize-1;
+
+@@ -3001,7 +3058,7 @@
+ int nf; /* Next free slot */
+ if (rt->rlists[j] == NULL) { /* No allocation */
+ as = 5; /* Start with space for 5 */
+- if ((rt->rlists[j] = (int *) icp->al->malloc(icp->al, sizeof(int) * as)) == NULL) {
++ if ((rt->rlists[j] = (int *) icp->al->calloc(icp->al, sizeof(int), as)) == NULL) {
+ return 2;
+ }
+ rt->rlists[j][0] = as;
+@@ -3010,6 +3067,9 @@
+ as = rt->rlists[j][0]; /* Allocate space for this list */
+ nf = rt->rlists[j][1]; /* Next free location in list */
+ if (nf >= as) { /* need to expand space */
++ if (as > INT_MAX / 2 / sizeof (int))
++ return 2;
++
+ as *= 2;
+ rt->rlists[j] = (int *) icp->al->realloc(icp->al,rt->rlists[j], sizeof(int) * as);
+ if (rt->rlists[j] == NULL) {
+@@ -3061,7 +3121,7 @@
+ val = rsize_1;
+ ix = (int)floor(val); /* Coordinate */
+
+- if (ix > (rt->size-2))
++ if (ix < 0 || ix > (rt->size-2))
+ ix = (rt->size-2);
+ if (rt->rlists[ix] != NULL) { /* There is a list of fwd candidates */
+ /* For each candidate forward range */
+@@ -3088,6 +3148,7 @@
+ /* We have failed to find an exact value, so return the nearest value */
+ /* (This is slow !) */
+ val = fabs(ival - rt->data[0]);
++ /* rt->size is known to be < INT_MAX */
+ for (k = 0, i = 1; i < rt->size; i++) {
+ double er;
+ er = fabs(ival - rt->data[i]);
+@@ -3141,6 +3202,10 @@
+ icmCurve *p = (icmCurve *)pp;
+ unsigned int len = 0;
+ len += 12; /* 12 bytes for tag, padding and count */
++ if (p->size > (UINT_MAX - len) / 2) {
++ p->icp->errc = 1;
++ return (unsigned int) - 1;
++ }
+ len += p->size * 2; /* 2 bytes for each UInt16 */
+ return len;
+ }
+@@ -3238,6 +3303,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmCurve_write malloc() failed");
+ return icp->errc = 2;
+@@ -3347,7 +3414,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (double *) icp->al->malloc(icp->al, p->size * sizeof(double))) == NULL) {
++ if ((p->data = (double *) icp->al->calloc(icp->al, p->size, sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmCurve_alloc: malloc() of icmCurve data failed");
+ return icp->errc = 2;
+ }
+@@ -3493,6 +3560,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmData_write malloc() failed");
+ return icp->errc = 2;
+@@ -3620,7 +3689,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (unsigned char *) icp->al->malloc(icp->al, p->size * sizeof(unsigned char))) == NULL) {
++ if ((p->data = (unsigned char *) icp->al->calloc(icp->al, p->size, sizeof(unsigned char))) == NULL) {
+ sprintf(icp->err,"icmData_alloc: malloc() of icmData data failed");
+ return icp->errc = 2;
+ }
+@@ -3745,6 +3814,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmText_write malloc() failed");
+ return icp->errc = 2;
+@@ -3834,7 +3905,7 @@
+ if (p->size != p->_size) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (char *) icp->al->malloc(icp->al, p->size * sizeof(char))) == NULL) {
++ if ((p->data = (char *) icp->al->calloc(icp->al, p->size, sizeof(char))) == NULL) {
+ sprintf(icp->err,"icmText_alloc: malloc() of icmText data failed");
+ return icp->errc = 2;
+ }
+@@ -4038,6 +4109,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmDateTimeNumber_write malloc() failed");
+ return icp->errc = 2;
+@@ -4128,11 +4201,15 @@
+ /* icmLut object */
+
+ /* Utility function - raise one integer to an integer power */
+-static unsigned int uipow(unsigned int a, unsigned int b) {
++static int uipow(unsigned int a, unsigned int b, unsigned int *ret) {
+ unsigned int rv = 1;
+- for (; b > 0; b--)
++ for (; b > 0; b--) {
++ if (a > 0 && rv > UINT_MAX / a)
++ return 1;
+ rv *= a;
+- return rv;
++ }
++ *ret = rv;
++ return 0;
+ }
+
+ /* - - - - - - - - - - - - - - - - */
+@@ -4242,7 +4319,7 @@
+ rv |= 1;
+ }
+ ix = (int)floor(val); /* Grid coordinate */
+- if (ix > (p->inputEnt-2))
++ if (ix < 0 || ix > (p->inputEnt-2))
+ ix = (p->inputEnt-2);
+ w = val - (double)ix; /* weight */
+ val = table[ix];
+@@ -4268,7 +4345,7 @@
+ if (p->inputChan <= 8) {
+ gw = GW; /* Use stack allocation */
+ } else {
+- if ((gw = (double *) icp->al->malloc(icp->al, (1 << p->inputChan) * sizeof(double))) == NULL) {
++ if ((gw = (double *) icp->al->calloc(icp->al, (1 << p->inputChan), sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmLut_lookup_clut: malloc() failed");
+ return icp->errc = 2;
+ }
+@@ -4301,7 +4378,7 @@
+ rv |= 1;
+ }
+ x = (int)floor(val); /* Grid coordinate */
+- if (x > clutPoints_2)
++ if (x < 0 || x > clutPoints_2)
+ x = clutPoints_2;
+ co[e] = val - (double)x; /* 1.0 - weight */
+ gp += x * p->dinc[e]; /* Add index offset for base of cube */
+@@ -4374,7 +4451,7 @@
+ rv |= 1;
+ }
+ x = (int)floor(val); /* Grid coordinate */
+- if (x > clutPoints_2)
++ if (x < 0 || x > clutPoints_2)
+ x = clutPoints_2;
+ co[e] = val - (double)x; /* 1.0 - weight */
+ gp += x * p->dinc[e]; /* Add index offset for base of cube */
+@@ -4447,7 +4524,7 @@
+ rv |= 1;
+ }
+ ix = (int)floor(val); /* Grid coordinate */
+- if (ix > (p->outputEnt-2))
++ if (ix < 0 || ix > (p->outputEnt-2))
+ ix = (p->outputEnt-2);
+ w = val - (double)ix; /* weight */
+ val = table[ix];
+@@ -4819,19 +4896,50 @@
+ ) {
+ icmLut *p = (icmLut *)pp;
+ unsigned int len = 0;
++ unsigned int pw;
+
+ if (p->ttype == icSigLut8Type) {
+ len += 48; /* tag and header */
++ if (p->inputChan > 0 &&
++ p->inputEnt > (UINT_MAX - len) / p->inputChan / 1)
++ goto overflow;
++
+ len += 1 * (p->inputChan * p->inputEnt);
+- len += 1 * (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ if (uipow(p->clutPoints,p->inputChan, &pw) ||
++ (p->outputChan > 0 &&
++ pw > (UINT_MAX - len) / p->outputChan / 1))
++ goto overflow;
++
++ len += 1 * (p->outputChan * pw);
++ if (p->outputChan > 0 &&
++ p->outputEnt > (UINT_MAX - len) / p->outputChan / 1)
++ goto overflow;
++
+ len += 1 * (p->outputChan * p->outputEnt);
+ } else {
+ len += 52; /* tag and header */
++ if (p->inputChan > 0 &&
++ p->inputEnt > (UINT_MAX - len) / p->inputChan / 2)
++ goto overflow;
++
+ len += 2 * (p->inputChan * p->inputEnt);
+- len += 2 * (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ if (uipow(p->clutPoints,p->inputChan, &pw) ||
++ (p->outputChan > 0 &&
++ pw > (UINT_MAX - len) / p->outputChan / 2))
++ goto overflow;
++
++ len += 2 * (p->outputChan * pw);
++ if (p->outputChan > 0 &&
++ p->outputEnt > (UINT_MAX - len) / p->outputChan / 2)
++ goto overflow;
++
+ len += 2 * (p->outputChan * p->outputEnt);
+ }
+ return len;
++
++ overflow:
++ p->icp->errc = 1;
++ return (unsigned int) -1;
+ }
+
+ /* read the object, return 0 on success, error code on fail */
+@@ -4844,6 +4952,7 @@
+ icc *icp = p->icp;
+ int rv = 0;
+ unsigned long i, j, g, size;
++ unsigned int pw;
+ char *bp, *buf;
+
+ if (len < 4) {
+@@ -4904,6 +5013,11 @@
+ return icp->errc = 1;
+ }
+
++ if (p->clutPoints > 100) {
++ sprintf(icp->err,"icmLut_read: too many clutPoints");
++ return icp->errc = 1;
++ }
++
+ /* Read 3x3 transform matrix */
+ for (j = 0; j < 3; j++) { /* Rows */
+ for (i = 0; i < 3; i++) { /* Columns */
+@@ -4921,13 +5035,18 @@
+ bp = buf+52;
+ }
+
+- if (len < icmLut_get_size((icmBase *)p)) {
++ if (len < icmLut_get_size((icmBase *)p) || icp->errc) {
+ sprintf(icp->err,"icmLut_read: Tag too small for contents");
+ icp->al->free(icp->al, buf);
+ return icp->errc = 1;
+ }
+
+ /* Read the input tables */
++ if (p->inputEnt > 0 && p->inputChan > UINT_MAX / p->inputEnt) {
++ sprintf(icp->err,"icmLut_read: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
+ size = (p->inputChan * p->inputEnt);
+ if ((rv = p->allocate((icmBase *)p)) != 0) {
+ icp->al->free(icp->al, buf);
+@@ -4942,7 +5061,14 @@
+ }
+
+ /* Read the clut table */
+- size = (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ if (uipow(p->clutPoints,p->inputChan,&pw) ||
++ (p->outputChan > 0 &&
++ pw > UINT_MAX / p->outputChan)) {
++ sprintf(icp->err,"icmLut_read: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
++ size = (p->outputChan * pw);
+ if ((rv = p->allocate((icmBase *)p)) != 0) {
+ icp->al->free(icp->al, buf);
+ return rv;
+@@ -4956,6 +5082,11 @@
+ }
+
+ /* Read the output tables */
++ if (p->outputChan > 0 && p->outputEnt > UINT_MAX / p->outputChan) {
++ sprintf(icp->err,"icmLut_read: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
+ size = (p->outputChan * p->outputEnt);
+ if ((rv = p->allocate((icmBase *)p)) != 0) {
+ icp->al->free(icp->al, buf);
+@@ -4995,12 +5126,14 @@
+ icmLut *p = (icmLut *)pp;
+ icc *icp = p->icp;
+ unsigned long i,j;
+- unsigned int len, size;
++ unsigned int len, size, pw;
+ char *bp, *buf; /* Buffer to write from */
+ int rv = 0;
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmLut_write malloc() failed");
+ return icp->errc = 2;
+@@ -5066,6 +5199,11 @@
+ }
+
+ /* Write the input tables */
++ if (p->inputEnt > 0 && p->inputChan > UINT_MAX / p->inputEnt) {
++ sprintf(icp->err,"icmLut_write: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
+ size = (p->inputChan * p->inputEnt);
+ if (p->ttype == icSigLut8Type) {
+ for (i = 0; i < size; i++, bp += 1) {
+@@ -5086,7 +5224,14 @@
+ }
+
+ /* Write the clut table */
+- size = (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ if (uipow(p->clutPoints,p->inputChan,&pw) ||
++ (p->outputChan > 0 &&
++ pw > UINT_MAX / p->outputChan)) {
++ sprintf(icp->err,"icmLut_write: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
++ size = (p->outputChan * pw);
+ if (p->ttype == icSigLut8Type) {
+ for (i = 0; i < size; i++, bp += 1) {
+ if ((rv = write_DCS8Number(p->clutTable[i], bp)) != 0) {
+@@ -5106,6 +5251,11 @@
+ }
+
+ /* Write the output tables */
++ if (p->outputChan > 0 && p->outputEnt > UINT_MAX / p->outputChan) {
++ sprintf(icp->err,"icmLut_write: overflow");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
+ size = (p->outputChan * p->outputEnt);
+ if (p->ttype == icSigLut8Type) {
+ for (i = 0; i < size; i++, bp += 1) {
+@@ -5177,7 +5327,14 @@
+ if (p->inputChan > MAX_CHAN) {
+ fprintf(op," !!Can't dump > %d input channel CLUT table!!\n",MAX_CHAN);
+ } else {
+- size = (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ unsigned int pw;
++ if (uipow(p->clutPoints,p->inputChan,&pw) ||
++ (p->outputChan > 0 &&
++ pw > UINT_MAX / p->outputChan)) {
++ fprintf(op,"Would overflow.\n");
++ return;
++ }
++ size = (p->outputChan * pw);
+ for (j = 0; j < p->inputChan; j++)
+ ii[j] = 0;
+ for (i = 0; i < size;) {
+@@ -5216,7 +5373,7 @@
+ static int icmLut_allocate(
+ icmBase *pp
+ ) {
+- unsigned int i, j, g, size;
++ unsigned int i, j, g, size, pw;
+ icmLut *p = (icmLut *)pp;
+ icc *icp = p->icp;
+
+@@ -5231,6 +5388,10 @@
+ return icp->errc = 1;
+ }
+
++ if (p->inputEnt > 0 && p->inputChan > UINT_MAX / p->inputEnt) {
++ sprintf(icp->err,"icmLut_alloc: too many entries");
++ return icp->errc = 1;
++ }
+ size = (p->inputChan * p->inputEnt);
+ if (size != p->inputTable_size) {
+ if (p->inputTable != NULL)
+@@ -5241,7 +5402,13 @@
+ }
+ p->inputTable_size = size;
+ }
+- size = (p->outputChan * uipow(p->clutPoints,p->inputChan));
++ if (uipow(p->clutPoints,p->inputChan,&pw) ||
++ (p->outputChan > 0 &&
++ pw > UINT_MAX / p->outputChan)) {
++ sprintf(icp->err,"icmLut_alloc: overflow");
++ return icp->errc = 1;
++ }
++ size = (p->outputChan * pw);
+ if (size != p->clutTable_size) {
+ if (p->clutTable != NULL)
+ icp->al->free(icp->al, p->clutTable);
+@@ -5251,6 +5418,10 @@
+ }
+ p->clutTable_size = size;
+ }
++ if (p->outputChan > 0 && p->outputEnt > UINT_MAX / p->outputChan) {
++ sprintf(icp->err,"icmLut_alloc: overflow");
++ return icp->errc = 1;
++ }
+ size = (p->outputChan * p->outputEnt);
+ if (size != p->outputTable_size) {
+ if (p->outputTable != NULL)
+@@ -5441,6 +5612,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmMeasurement_write malloc() failed");
+ return icp->errc = 2;
+@@ -5712,13 +5885,20 @@
+ len += p->nDeviceCoords * 1; /* bytes for each named color */
+ }
+ } else { /* Named Color 2 */
++ unsigned int col;
+ len += 8; /* 8 bytes for tag and padding */
+ len += 4; /* 4 for vendor specific flags */
+ len += 4; /* 4 for count of named colors */
+ len += 4; /* 4 for number of device coords */
+ len += 32; /* 32 for prefix of color names */
+ len += 32; /* 32 for suffix of color names */
+- len += p->count * (32 + 6 + p->nDeviceCoords * 2); /* bytes for each named color */
++ col = 32 + 6 + p->nDeviceCoords * 2;
++ if (p->nDeviceCoords > (UINT_MAX - (32 + 6)) / 2 ||
++ (p->count > 0 && col > (UINT_MAX - len) / p->count)) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
++ len += p->count * col; /* bytes for each named color */
+ }
+ return len;
+ }
+@@ -5882,6 +6062,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmNamedColor_write malloc() failed");
+ return icp->errc = 2;
+@@ -6109,9 +6291,22 @@
+ ) {
+ icmTextDescription *p = (icmTextDescription *)pp;
+ unsigned int len = 0;
++ if (p->size > UINT_MAX - (8 + 4 + 8)) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += 8; /* 8 bytes for tag and padding */
+ len += 4 + p->size; /* Ascii string length + ascii string */
+- len += 8 + 2 * p->ucSize; /* Unicode language code + length + string */
++ len += 8; /* Unicode language code + length */
++ if (p->ucSize > (UINT_MAX - len) / 2) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
++ len += 2 * p->ucSize; /* Unicode string */
++ if (len > (UINT_MAX - (3 + 67))) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += 3 + 67; /* ScriptCode code, length string */
+ return len;
+ }
+@@ -6294,6 +6489,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmTextDescription_write malloc() failed");
+ return icp->errc = 2;
+@@ -6535,7 +6732,7 @@
+ if (p->size != p->_size) {
+ if (p->desc != NULL)
+ icp->al->free(icp->al, p->desc);
+- if ((p->desc = (char *) icp->al->malloc(icp->al, p->size * sizeof(char))) == NULL) {
++ if ((p->desc = (char *) icp->al->calloc(icp->al, p->size, sizeof(char))) == NULL) {
+ sprintf(icp->err,"icmTextDescription_alloc: malloc() of Ascii description failed");
+ return icp->errc = 2;
+ }
+@@ -6544,7 +6741,7 @@
+ if (p->ucSize != p->uc_size) {
+ if (p->ucDesc != NULL)
+ icp->al->free(icp->al, p->ucDesc);
+- if ((p->ucDesc = (ORD16 *) icp->al->malloc(icp->al, p->ucSize * sizeof(ORD16))) == NULL) {
++ if ((p->ucDesc = (ORD16 *) icp->al->calloc(icp->al, p->ucSize, sizeof(ORD16))) == NULL) {
+ sprintf(icp->err,"icmTextDescription_alloc: malloc() of Unicode description failed");
+ return icp->errc = 2;
+ }
+@@ -6820,6 +7017,12 @@
+ bp += 8; /* Skip padding */
+
+ p->count = read_UInt32Number(bp); /* Number of sequence descriptions */
++ if (p->count > 1000) {
++ sprintf(icp->err,"icmProfileSequenceDesc_read: too many sequence descriptions");
++ icp->al->free(icp->al, buf);
++ return icp->errc = 1;
++ }
++
+ bp += 4;
+
+ /* Read all the sequence descriptions */
+@@ -6852,6 +7055,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmProfileSequenceDesc_write malloc() failed");
+ return icp->errc = 2;
+@@ -6922,7 +7127,7 @@
+ if (p->count != p->_count) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (icmDescStruct *) icp->al->malloc(icp->al, p->count * sizeof(icmDescStruct))) == NULL) {
++ if ((p->data = (icmDescStruct *) icp->al->calloc(icp->al, p->count, sizeof(icmDescStruct))) == NULL) {
+ sprintf(icp->err,"icmProfileSequenceDesc_allocate Allocation of DescStruct array failed");
+ return icp->errc = 2;
+ }
+@@ -7041,6 +7246,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmSignature_write malloc() failed");
+ return icp->errc = 2;
+@@ -7156,6 +7363,10 @@
+ icmScreening *p = (icmScreening *)pp;
+ unsigned int len = 0;
+ len += 16; /* 16 bytes for tag, padding, flag & channeles */
++ if (p->channels > (UINT_MAX - len) / 12) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += p->channels * 12; /* 12 bytes for each channel */
+ return len;
+ }
+@@ -7235,6 +7446,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmScreening_write malloc() failed");
+ return icp->errc = 2;
+@@ -7315,7 +7528,7 @@
+ if (p->channels != p->_channels) {
+ if (p->data != NULL)
+ icp->al->free(icp->al, p->data);
+- if ((p->data = (icmScreeningData *) icp->al->malloc(icp->al, p->channels * sizeof(icmScreeningData))) == NULL) {
++ if ((p->data = (icmScreeningData *) icp->al->calloc(icp->al, p->channels, sizeof(icmScreeningData))) == NULL) {
+ sprintf(icp->err,"icmScreening_alloc: malloc() of icmScreening data failed");
+ return icp->errc = 2;
+ }
+@@ -7366,10 +7579,20 @@
+ icmUcrBg *p = (icmUcrBg *)pp;
+ unsigned int len = 0;
+ len += 8; /* 8 bytes for tag and padding */
++ if (p->UCRcount > (UINT_MAX - len - 4) / 2)
++ goto overflow;
++
+ len += 4 + p->UCRcount * 2; /* Undercolor Removal */
++ if (p->BGcount > (UINT_MAX - len - 4 - p->size) / 2)
++ goto overflow;
++
+ len += 4 + p->BGcount * 2; /* Black Generation */
+ len += p->size; /* Description string */
+ return len;
++
++ overflow:
++ p->icp->errc = 1;
++ return (unsigned int) -1;
+ }
+
+ /* read the object, return 0 on success, error code on fail */
+@@ -7498,6 +7721,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmUcrBg_write malloc() failed");
+ return icp->errc = 2;
+@@ -7663,7 +7888,7 @@
+ if (p->UCRcount != p->UCR_count) {
+ if (p->UCRcurve != NULL)
+ icp->al->free(icp->al, p->UCRcurve);
+- if ((p->UCRcurve = (double *) icp->al->malloc(icp->al, p->UCRcount * sizeof(double))) == NULL) {
++ if ((p->UCRcurve = (double *) icp->al->calloc(icp->al, p->UCRcount, sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmUcrBg_allocate: malloc() of UCR curve data failed");
+ return icp->errc = 2;
+ }
+@@ -7672,7 +7897,7 @@
+ if (p->BGcount != p->BG_count) {
+ if (p->BGcurve != NULL)
+ icp->al->free(icp->al, p->BGcurve);
+- if ((p->BGcurve = (double *) icp->al->malloc(icp->al, p->BGcount * sizeof(double))) == NULL) {
++ if ((p->BGcurve = (double *) icp->al->calloc(icp->al, p->BGcount, sizeof(double))) == NULL) {
+ sprintf(icp->err,"icmUcrBg_allocate: malloc() of BG curve data failed");
+ return icp->errc = 2;
+ }
+@@ -7681,7 +7906,7 @@
+ if (p->size != p->_size) {
+ if (p->string != NULL)
+ icp->al->free(icp->al, p->string);
+- if ((p->string = (char *) icp->al->malloc(icp->al, p->size * sizeof(char))) == NULL) {
++ if ((p->string = (char *) icp->al->calloc(icp->al, p->size, sizeof(char))) == NULL) {
+ sprintf(icp->err,"icmUcrBg_allocate: malloc() of string data failed");
+ return icp->errc = 2;
+ }
+@@ -7743,6 +7968,15 @@
+ len += 2; /* 2 bytes for channels */
+ len += 2; /* 2 for entry count */
+ len += 2; /* 2 for entry size */
++ if (p->u.table.entryCount > 0 &&
++ p->u.table.entrySize > 0 &&
++ p->u.table.channels >
++ (UINT_MAX - len) /
++ p->u.table.entryCount /
++ p->u.table.entrySize) {
++ p->icp->errc = 1;
++ return (unsigned int) -1;
++ }
+ len += ( p->u.table.channels * /* compute table size */
+ p->u.table.entryCount *
+ p->u.table.entrySize );
+@@ -7762,10 +7996,11 @@
+ ) {
+ icmVideoCardGamma *p = (icmVideoCardGamma *)pp;
+ icc *icp = p->icp;
+- int rv, c;
++ int rv;
+ char *bp, *buf;
+ unsigned char *pchar;
+ unsigned short *pshort;
++ unsigned long c;
+
+ if (len < 18) {
+ sprintf(icp->err,"icmVideoCardGamma_read: Tag too small to be legal");
+@@ -7803,6 +8038,16 @@
+ p->u.table.channels = read_UInt16Number(bp+12);
+ p->u.table.entryCount = read_UInt16Number(bp+14);
+ p->u.table.entrySize = read_UInt16Number(bp+16);
++ if (p->u.table.entrySize > 65530 || p->u.table.entrySize == 0) {
++ sprintf(icp->err,"icmVideoCardGamma_read: Too many entries (or none)");
++ return icp->errc = 1;
++ }
++ if (p->u.table.entryCount > 0 && p->u.table.entrySize > 0 &&
++ p->u.table.channels >
++ UINT_MAX / p->u.table.entryCount / p->u.table.entrySize) {
++ sprintf(icp->err,"icmVideoCardGamma_read: Overflow reading tag");
++ return icp->errc = 1;
++ }
+ if (len-18 < p->u.table.channels*p->u.table.entryCount*p->u.table.entrySize) {
+ sprintf(icp->err,"icmVideoCardGamma_read: Tag too small to be legal");
+ return icp->errc = 1;
+@@ -7871,6 +8116,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmViewingConditions_write malloc() failed");
+ return icp->errc = 2;
+@@ -8049,7 +8296,7 @@
+ ) {
+ icmVideoCardGamma *p = (icmVideoCardGamma *)pp;
+ icc *icp = p->icp;
+- int size;
++ unsigned int size;
+
+ /* note: allocation is only relevant for table type
+ * and in that case the channels, entryCount, and entrySize
+@@ -8059,6 +8306,11 @@
+ if (p->tagType == icmVideoCardGammaTableType) {
+ if (p->u.table.data != NULL)
+ icp->al->free(icp->al, p->u.table.data);
++ if (p->u.table.entryCount > 0 &&
++ p->u.table.channels > UINT_MAX / p->u.table.entryCount) {
++ sprintf(icp->err,"icmVideoCardGamma_alloc: table too large");
++ return icp->errc = 1;
++ }
+ size = (p->u.table.channels *
+ p->u.table.entryCount);
+ switch (p->u.table.entrySize) {
+@@ -8066,6 +8318,10 @@
+ size *= sizeof(unsigned char);
+ break;
+ case 2:
++ if (size > UINT_MAX / sizeof(unsigned short)) {
++ sprintf(icp->err,"icmVideoCardGamma_alloc: table too large");
++ return icp->errc = 1;
++ }
+ size *= sizeof(unsigned short);
+ break;
+ default:
+@@ -8201,6 +8457,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmViewingConditions_write malloc() failed");
+ return icp->errc = 2;
+@@ -8433,6 +8691,8 @@
+
+ /* Allocate a file write buffer */
+ len = p->get_size((icmBase *)p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->malloc(icp->al, len)) == NULL) {
+ sprintf(icp->err,"icmCrdInfo_write malloc() failed");
+ return icp->errc = 2;
+@@ -8585,7 +8845,7 @@
+ if (p->ppsize != p->_ppsize) {
+ if (p->ppname != NULL)
+ icp->al->free(icp->al, p->ppname);
+- if ((p->ppname = (char *) icp->al->malloc(icp->al, p->ppsize * sizeof(char))) == NULL) {
++ if ((p->ppname = (char *) icp->al->calloc(icp->al, p->ppsize, sizeof(char))) == NULL) {
+ sprintf(icp->err,"icmCrdInfo_alloc: malloc() of string data failed");
+ return icp->errc = 2;
+ }
+@@ -8595,7 +8855,7 @@
+ if (p->crdsize[t] != p->_crdsize[t]) {
+ if (p->crdname[t] != NULL)
+ icp->al->free(icp->al, p->crdname[t]);
+- if ((p->crdname[t] = (char *) icp->al->malloc(icp->al, p->crdsize[t] * sizeof(char))) == NULL) {
++ if ((p->crdname[t] = (char *) icp->al->calloc(icp->al, p->crdsize[t], sizeof(char))) == NULL) {
+ sprintf(icp->err,"icmCrdInfo_alloc: malloc() of CRD%d name string failed",t);
+ return icp->errc = 2;
+ }
+@@ -8736,6 +8996,8 @@
+ int rv = 0;
+
+ len = p->get_size(p);
++ if (icp->errc)
++ return icp->errc;
+ if ((buf = (char *) icp->al->calloc(icp->al,1,len)) == NULL) { /* Zero it - some CMS are fussy */
+ sprintf(icp->err,"icmHeader_write calloc() failed");
+ return icp->errc = 2;
+@@ -9245,13 +9507,23 @@
+ }
+
+ p->count = read_UInt32Number(tcbuf); /* Tag count */
++ if (p->count > 100) {
++ sprintf(p->err,"icc_read: too many table tags");
++ return p->errc = 1;
++ }
+ if (p->count > 0) {
+ char *bp, *buf;
+- if ((p->data = (icmTag *) p->al->malloc(p->al, p->count * sizeof(icmTag))) == NULL) {
++ if ((p->data = (icmTag *) p->al->calloc(p->al, p->count, sizeof(icmTag))) == NULL) {
+ sprintf(p->err,"icc_read: Tag table malloc() failed");
+ return p->errc = 2;
+ }
+
++ if (p->count > (UINT_MAX - 4) / 12) {
++ sprintf(p->err,"icc_read: overflow");
++ p->al->free(p->al, p->data);
++ p->data = NULL;
++ return p->errc = 1;
++ }
+ len = 4 + p->count * 12;
+ if ((buf = (char *) p->al->malloc(p->al, len)) == NULL) {
+ sprintf(p->err,"icc_read: Tag table read buffer malloc() failed");
+@@ -9281,6 +9553,14 @@
+ return p->errc = 1;
+ }
+ p->data[i].size = read_UInt32Number(bp + 8);
++ if (p->data[i].offset + p->data[i].size >
++ p->header->size) {
++ sprintf(p->err,"icc_read: tag out of bounds");
++ p->al->free(p->al, p->data);
++ p->data = NULL;
++ p->al->free(p->al, buf);
++ return p->errc = 1;
++ }
+ if ( p->fp->seek(p->fp, of + p->data[i].offset) != 0
+ || p->fp->read(p->fp, tcbuf, 1, 4) != 4) {
+ sprintf(p->err,"icc_read: fseek() or fread() failed on tag headers");
+@@ -9321,8 +9601,14 @@
+ }
+
+ size += p->header->get_size(p->header);
++ if (p->errc)
++ return (unsigned int) -1;
+
+ size = DO_ALIGN(size);
++ if (size == 0 || p->count > (UINT_MAX - 4 - size) / 12) {
++ p->errc = 1;
++ return (unsigned int) -1;
++ }
+ size += 4 + p->count * 12; /* Tag table length */
+
+ /* Reset touched flag for each tag type */
+@@ -9337,8 +9623,13 @@
+ /* Get size for each tag type, skipping links */
+ for (i = 0; i < p->count; i++) {
+ if (p->data[i].objp->touched == 0) { /* Not alllowed for previously */
++ unsigned int obj_size;
+ size = DO_ALIGN(size);
+- size += p->data[i].objp->get_size(p->data[i].objp);
++ obj_size = p->data[i].objp->get_size(p->data[i].objp);
++ if (size == 0 || p->errc ||
++ obj_size > UINT_MAX - size)
++ return (unsigned int) -1;
++ size += obj_size;
+ p->data[i].objp->touched = 1; /* Don't account for this again */
+ }
+ }
+@@ -9373,9 +9664,19 @@
+ }
+
+ size += p->header->get_size(p->header);
++ if (p->errc)
++ return p->errc;
+
++ if (p->count > (UINT_MAX - 4) / 12) {
++ sprintf(p->err,"icc_write: too many tags");
++ return p->errc = 1;
++ }
+ len = 4 + p->count * 12; /* Tag table length */
+ size = DO_ALIGN(size);
++ if (size == 0 || size > UINT_MAX - len) {
++ sprintf(p->err,"icc_write: overflow writing tag table");
++ return p->errc = 1;
++ }
+ size += len;
+
+ /* Allocate memory buffer for tag table */
+@@ -9406,6 +9707,12 @@
+ size = DO_ALIGN(size);
+ p->data[i].offset = size; /* Profile relative target */
+ p->data[i].size = p->data[i].objp->get_size(p->data[i].objp);
++ if (size == 0 ||
++ p->errc || p->data[i].size > UINT_MAX - size) {
++ sprintf(p->err,"icc_write: internal error - overflow?");
++ p->al->free(p->al, buf);
++ return p->errc;
++ }
+ size += p->data[i].size;
+ p->data[i].objp->touched = 1; /* Allocated space for it */
+ } else { /* must be linked - copy allocation */
+@@ -9529,6 +9836,11 @@
+ }
+
+ /* Make space in tag table for new tag item */
++ if (p->count > (UINT_MAX / sizeof(icmTag)) - 1) {
++ sprintf(p->err,"icc_add_tag: overflow");
++ p->errc = 1;
++ return NULL;
++ }
+ if (p->data == NULL)
+ tp = p->al->malloc(p->al, (p->count+1) * sizeof(icmTag));
+ else
+@@ -9612,6 +9924,11 @@
+ }
+
+ /* Make space in tag table for new tag item */
++ if (p->count > (UINT_MAX / sizeof(icmTag)) - 1) {
++ sprintf(p->err,"icc_link_tag: overflow");
++ p->errc = 1;
++ return NULL;
++ }
+ if (p->data == NULL)
+ tp = p->al->malloc(p->al, (p->count+1) * sizeof(icmTag));
+ else
diff --git a/recipes/gs/gs/1006_system-jasper.patch b/recipes/gs/gs/1006_system-jasper.patch
new file mode 100644
index 0000000000..f547ef5a4f
--- /dev/null
+++ b/recipes/gs/gs/1006_system-jasper.patch
@@ -0,0 +1,28 @@
+Description: Avoid calling routine not available in official libjasper
+Author: Tim Waugh <twaugh@redhat.com>
+diff -up ghostscript-8.64/base/sjpx.c.system-jasper ghostscript-8.64/base/sjpx.c
+--- ghostscript-8.64/base/sjpx.c.system-jasper 2008-08-21 00:22:49.000000000 +0100
++++ ghostscript-8.64/base/sjpx.c 2009-02-04 11:35:56.000000000 +0000
+@@ -34,14 +34,6 @@ static void s_jpxd_set_defaults(stream_s
+ private_st_jpxd_state(); /* creates a gc object for our state,
+ defined in sjpx.h */
+
+-/* error reporting callback for the jpx library */
+-static void
+-s_jpx_jas_error_cb(jas_error_t err, char *msg)
+-{
+- dprintf2("jasper (code %d) %s", (int)err, msg);
+-}
+-
+-
+ /* initialize the steam.
+ this involves allocating the stream and image structures, and
+ initializing the decoder.
+@@ -59,7 +51,6 @@ s_jpxd_init(stream_state * ss)
+ }
+
+ status = jas_init();
+- jas_set_error_cb(s_jpx_jas_error_cb);
+ #ifdef JPX_DEBUG
+ /* raise the error reporting threshold from the default (0) */
+ jas_setdbglevel(1);
diff --git a/recipes/gs/gs/1007_fix_pphs_script_not_lib.patch b/recipes/gs/gs/1007_fix_pphs_script_not_lib.patch
new file mode 100644
index 0000000000..3b962d057f
--- /dev/null
+++ b/recipes/gs/gs/1007_fix_pphs_script_not_lib.patch
@@ -0,0 +1,22 @@
+Description: Install pphs as a user script, not a library
+Author: Jonas Smedegaard <dr@jones.dk>
+--- a/base/unixinst.mak 2009-05-24 18:40:45.000000000 +0200
++++ b/base/unixinst.mak 2009-05-24 18:43:02.000000000 +0200
+@@ -39,7 +39,7 @@
+ $(SH) -c 'for f in \
+ gsbj gsdj gsdj500 gslj gslp gsnd \
+ bdftops dumphint dvipdf eps2eps font2c \
+-pdf2dsc pdf2ps pdfopt pf2afm pfbtopfa printafm \
++pdf2dsc pdf2ps pdfopt pf2afm pfbtopfa pphs printafm \
+ ps2ascii ps2epsi ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr ps2ps ps2ps2 \
+ wftopfa fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh ;\
+ do if ( test -f $(PSLIBDIR)/$$f ); then \
+@@ -72,7 +72,7 @@
+ jispaper.ps landscap.ps level1.ps lines.ps markhint.ps markpath.ps \
+ mkcidfm.ps opdfread.ps PDFA_def.ps PDFX_def.ps \
+ packfile.ps pcharstr.ps pf2afm.ps pfbtopfa.ps ppath.ps \
+-pphs pphs.ps \
++pphs.ps \
+ prfont.ps printafm.ps \
+ ps2ai.ps ps2ascii.ps ps2epsi.ps quit.ps rollconv.ps \
+ showchar.ps showpage.ps stcinfo.ps stcolor.ps stocht.ps \
diff --git a/recipes/gs/gs/2001_docdir_fix_for_debian.patch b/recipes/gs/gs/2001_docdir_fix_for_debian.patch
new file mode 100644
index 0000000000..24e93ef325
--- /dev/null
+++ b/recipes/gs/gs/2001_docdir_fix_for_debian.patch
@@ -0,0 +1,16 @@
+Description: Set docdir appropriately for Debian
+Author: Masayuki Hatta <mhatta@debian.org>
+diff -urN a/base/Makefile.in b/base/Makefile.in
+--- a/base/Makefile.in
++++ b/base/Makefile.in
+@@ -71,8 +71,8 @@
+ gssharedir = @libdir@/ghostscript/$(GS_DOT_VERSION)
+ gsincludedir = @includedir@/ghostscript/
+
+-docdir=$(gsdatadir)/doc
+-exdir=$(gsdatadir)/examples
++docdir=$(prefix)/share/doc/ghostscript
++exdir=$(prefix)/share/doc/ghostscript/examples
+ GS_DOCDIR=$(docdir)
+
+ # Define install location for 'cups' device/filter support
diff --git a/recipes/gs/gs/2002_gs_man_fix_debian.patch b/recipes/gs/gs/2002_gs_man_fix_debian.patch
new file mode 100644
index 0000000000..c9d6f8393b
--- /dev/null
+++ b/recipes/gs/gs/2002_gs_man_fix_debian.patch
@@ -0,0 +1,40 @@
+Description: Fixes for gs.1 (Debian specific path adjustments)
+Author: Masayuki Hatta <mhatta@debian.org>
+diff -urN a/man/gs.1 b/man/gs.1
+--- a/man/gs.1
++++ b/man/gs.1
+@@ -295,18 +295,18 @@
+ are typically based in \fBC:\\GS\fR, but may be elsewhere, especially if
+ you install Ghostscript with \fBGSview\fR. Run "\fBgs -h\fR" to find the
+ location of Ghostscript documentation on your system, from which you can
+-get more details.
++get more details. On a Debian system they are in \fB/usr\fR.
+ .TP
+-.B /usr/local/share/ghostscript/#.##/*
++.B /usr/share/gs-gpl/#.##/*/*
+ Startup files, utilities, and basic font definitions
+ .TP
+-.B /usr/local/share/ghostscript/fonts/*
+-More font definitions
++.B /usr/share/fonts/type1/gsfonts/*
++More font definitions from the gsfonts package
+ .TP
+-.B /usr/local/share/ghostscript/#.##/examples/*
++.B /usr/share/doc/gs-gpl/examples/*
+ Ghostscript demonstration files
+ .TP
+-.B /usr/local/share/ghostscript/#.##/doc/*
++.B /usr/share/doc/gs-gpl/*
+ Diverse document files
+ .SH "INITIALIZATION FILES"
+ When looking for the initialization files "gs_*.ps", the files related to
+@@ -330,7 +330,8 @@
+ Ghostscript makefile when the executable was built. When \fBgs\fR is built
+ on Unix, \fBGS_LIB_DEFAULT\fR is usually
+ "/usr/local/share/ghostscript/#.##:/usr/local/share/ghostscript/fonts"
+-where "#.##" represents the Ghostscript version number.
++where "#.##" represents the Ghostscript version number. They are
++"/usr/share/gs-gpl/#.## on a Debian system".
+ .PP
+ Each of these (\fBGS_LIB_DEFAULT\fR, \fBGS_LIB\fR, and \fB\-I\fR parameter)
+ may be either a single directory or a list of directories separated by
diff --git a/recipes/gs/gs_8.64.bb b/recipes/gs/gs_8.64.bb
new file mode 100644
index 0000000000..37f0af1b42
--- /dev/null
+++ b/recipes/gs/gs_8.64.bb
@@ -0,0 +1,54 @@
+DESCRIPTION = "An interpreter of the Postscript language"
+LICENSE = "GPL"
+SECTION = "console/utils"
+HOMEPAGE = "http://www.gnu.org/software/ghostscript/ghostscript.html"
+DEPENDS = "jpeg zlib fontconfig cups"
+PR = "r2"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/g/ghostscript/ghostscript_${PV}~dfsg.orig.tar.gz \
+ file://0001_svn_snapshot.patch;patch=1 \
+ file://0002_svn_snapshot_jbig2dec.patch;patch=1 \
+ file://1001_install_cjk_examples.patch;patch=1 \
+ file://1002_ps2pdf_man_fix.patch;patch=1 \
+ file://1003_fix_autoconf_create_from_infiles.patch;patch=1 \
+ file://1004_CVE-2009-0792_CVE-2009-0584_CVE-2009-0583.patch;patch=1 \
+ file://1006_system-jasper.patch;patch=1 \
+ file://1007_fix_pphs_script_not_lib.patch;patch=1 \
+ file://2001_docdir_fix_for_debian.patch;patch=1 \
+ file://2002_gs_man_fix_debian.patch;patch=1 \
+ "
+
+S = "${WORKDIR}/ghostscript-${PV}~dfsg"
+
+inherit autotools
+
+EXTRA_OECONF = "--without-x --with-jasper --with-zlib=${STAGING_DIR_HOST}${layout_prefix}"
+
+PACKAGES += "cups-gs"
+
+do_configure() {
+ # hack script to allow for cross compiling
+ sed 's,&& ./configure$,& --host=\$host --build=\$build --target=\$target,g' -i configure
+
+ gnu-configize
+ oe_runconf
+}
+
+do_stage () {
+ install -d ${STAGING_INCDIR}/ghostscript
+ install -m 755 ${S}/psi/*.h ${STAGING_INCDIR}/ghostscript/
+ oe_libinstall -so -C sobin libgs ${STAGING_LIBDIR}
+}
+
+do_compile_append () {
+ oe_runmake so
+}
+
+do_install_append () {
+ oe_runmake 'DESTDIR=${D}' soinstall
+}
+
+FILES_${PN} += "${datadir}/ghostscript"
+FILES_cups-gs = "${libdir}/cups/filter/* ${datadir}/cups ${sysconfdir}/cups"
+
+RDEPENDS_cups-gs += "gs"
diff --git a/recipes/gstreamer/gst-plugins-bad_0.10.12.bb b/recipes/gstreamer/gst-plugins-bad_0.10.12.bb
new file mode 100644
index 0000000000..c7aa008d61
--- /dev/null
+++ b/recipes/gstreamer/gst-plugins-bad_0.10.12.bb
@@ -0,0 +1,11 @@
+require gst-plugins.inc
+
+SRC_URI += "file://vorbisenc.h file://vorbisdec.h \
+ file://ivorbis-thumb.patch;patch=1"
+
+DEPENDS += "gst-plugins-base openssl directfb"
+
+do_compile_prepend() {
+ # work around missing files in upstream tarball (upstream bug #454078)
+ install -m 0644 ${WORKDIR}/vorbis*.h ${S}/ext/ivorbis/
+}
diff --git a/recipes/gstreamer/gst-plugins-bad_0.10.9.bb b/recipes/gstreamer/gst-plugins-bad_0.10.9.bb
new file mode 100644
index 0000000000..fdcc240dd7
--- /dev/null
+++ b/recipes/gstreamer/gst-plugins-bad_0.10.9.bb
@@ -0,0 +1,14 @@
+require gst-plugins.inc
+PR = "r2"
+
+SRC_URI += "file://vorbisenc.h file://vorbisdec.h \
+ file://gst-plugins-directfb-fix.patch;patch=1;pnum=2 \
+ file://ivorbis-thumb.patch;patch=1"
+
+DEPENDS += "gst-plugins-base openssl"
+EXTRA_OECONF += " ac_cv_openssldir=no"
+
+do_compile_prepend() {
+ # work around missing files in upstream tarball (upstream bug #454078)
+ install -m 0644 ${WORKDIR}/vorbis*.h ${S}/ext/ivorbis/
+}
diff --git a/recipes/gstreamer/gst-plugins-good/fix-unit-scale-asseration.patch b/recipes/gstreamer/gst-plugins-good/fix-unit-scale-asseration.patch
new file mode 100644
index 0000000000..749c4918a9
--- /dev/null
+++ b/recipes/gstreamer/gst-plugins-good/fix-unit-scale-asseration.patch
@@ -0,0 +1,33 @@
+diff -uNr gst-plugins-good-0.10.15/sys/v4l2/gstv4l2src.c gst-plugins-good-0.10.15.new/sys/v4l2/gstv4l2src.c
+--- gst-plugins-good-0.10.15/sys/v4l2/gstv4l2src.c 2009-05-11 19:00:07.000000000 -0500
++++ gst-plugins-good-0.10.15.new/sys/v4l2/gstv4l2src.c 2009-06-22 09:51:50.000000000 -0500
+@@ -1377,14 +1377,22 @@
+ timestamp = gst_clock_get_time (clock) - timestamp;
+ gst_object_unref (clock);
+
+- latency =
+- gst_util_uint64_scale_int (GST_SECOND, v4l2src->fps_d,
+- v4l2src->fps_n);
++ /* we must have a framerate */
++ if (v4l2src->fps_n <= 0 || v4l2src->fps_d <= 0) {
++ GST_WARNING_OBJECT (src,
++ "Can't give latency since framerate isn't fixated !");
++ timestamp = GST_CLOCK_TIME_NONE;
++ }
++ else {
++ latency =
++ gst_util_uint64_scale_int (GST_SECOND, v4l2src->fps_d,
++ v4l2src->fps_n);
+
+- if (timestamp > latency)
+- timestamp -= latency;
+- else
+- timestamp = 0;
++ if (timestamp > latency)
++ timestamp -= latency;
++ else
++ timestamp = 0;
++ }
+ }
+
+ /* FIXME: use the timestamp from the buffer itself! */
diff --git a/recipes/gstreamer/gst-plugins-good_0.10.15.bb b/recipes/gstreamer/gst-plugins-good_0.10.15.bb
new file mode 100644
index 0000000000..ff4d11bc08
--- /dev/null
+++ b/recipes/gstreamer/gst-plugins-good_0.10.15.bb
@@ -0,0 +1,14 @@
+require gst-plugins.inc
+
+PR = "r3"
+
+SRC_URI += "file://fix-unit-scale-asseration.patch;patch=1"
+
+OE_ALLOW_INSECURE_DOWNLOADS = "1"
+inherit gconf
+
+DEPENDS += "gst-plugins-base openssl popt"
+
+PACKAGES =+ "gst-plugin-gconfelements"
+FILES_gst-plugin-gconfelements += "${sysconfdir}/gconf"
+
diff --git a/recipes/gstreamer/gstreamer_0.10.23.bb b/recipes/gstreamer/gstreamer_0.10.23.bb
index 906aa239ac..22bc2172ed 100644
--- a/recipes/gstreamer/gstreamer_0.10.23.bb
+++ b/recipes/gstreamer/gstreamer_0.10.23.bb
@@ -1,5 +1,7 @@
require gstreamer.inc
+EXTRA_OECONF += "ac_cv_func_register_printf_function=no"
+
do_configure_prepend() {
sed -i -e s:docs::g Makefile.am
}
diff --git a/recipes/gtk+/gtk+-2.16.0/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.16.4/hardcoded_libtool.patch
index 82fbbac8d7..82fbbac8d7 100644
--- a/recipes/gtk+/gtk+-2.16.0/hardcoded_libtool.patch
+++ b/recipes/gtk+/gtk+-2.16.4/hardcoded_libtool.patch
diff --git a/recipes/gtk+/gtk+-2.16.0/no-demos.patch b/recipes/gtk+/gtk+-2.16.4/no-demos.patch
index 0fc4c48d1a..0fc4c48d1a 100644
--- a/recipes/gtk+/gtk+-2.16.0/no-demos.patch
+++ b/recipes/gtk+/gtk+-2.16.4/no-demos.patch
diff --git a/recipes/gtk+/gtk+-2.16.0/run-iconcache.patch b/recipes/gtk+/gtk+-2.16.4/run-iconcache.patch
index ac15e9ab24..ac15e9ab24 100644
--- a/recipes/gtk+/gtk+-2.16.0/run-iconcache.patch
+++ b/recipes/gtk+/gtk+-2.16.4/run-iconcache.patch
diff --git a/recipes/gtk+/gtk+-2.16.0/toggle-font.diff b/recipes/gtk+/gtk+-2.16.4/toggle-font.diff
index 59ad150b2f..59ad150b2f 100644
--- a/recipes/gtk+/gtk+-2.16.0/toggle-font.diff
+++ b/recipes/gtk+/gtk+-2.16.4/toggle-font.diff
diff --git a/recipes/gtk+/gtk+_2.16.0.bb b/recipes/gtk+/gtk+_2.16.4.bb
index 0b4e24eea7..4fde9b6825 100644
--- a/recipes/gtk+/gtk+_2.16.0.bb
+++ b/recipes/gtk+/gtk+_2.16.4.bb
@@ -1,7 +1,7 @@
require gtk+.inc
DEPENDS += "cairo jasper"
-PR = "r2"
+PR = "r0"
# disabled per default - this uses as little patches as possible
DEFAULT_PREFERENCE = "-1"
diff --git a/recipes/gtk-webcore/files/wscript-fix.patch b/recipes/gtk-webcore/files/wscript-fix.patch
new file mode 100644
index 0000000000..58a0cbff46
--- /dev/null
+++ b/recipes/gtk-webcore/files/wscript-fix.patch
@@ -0,0 +1,14 @@
+Index: git/wscript
+===================================================================
+--- git.orig/wscript
++++ git/wscript
+@@ -62,8 +62,7 @@ def rc_file(self, node):
+ rctask.set_inputs (node)
+ rctask.set_outputs (node.change_ext ('.rc.o'))
+ self.compiled_tasks.append (rctask)
+-Task.simple_task_type ('winrc', '${WINRC} -o${TGT} ${SRC}', color='BLUE',
+- before='cc cxx', shell=False)
++ Task.simple_task_type ('winrc', '${WINRC} -o${TGT} ${SRC}', color='BLUE', before='cc cxx', shell=False)
+
+ def configure (conf):
+ def option_checkfatal (option, desc):
diff --git a/recipes/gtk-webcore/midori_0.1.8.bb b/recipes/gtk-webcore/midori_0.1.8.bb
new file mode 100644
index 0000000000..8568074343
--- /dev/null
+++ b/recipes/gtk-webcore/midori_0.1.8.bb
@@ -0,0 +1,31 @@
+require midori.inc
+
+DEPENDS += "python-native python-docutils-native"
+
+SRC_URI = "http://goodies.xfce.org/releases/midori/midori-${PV}.tar.bz2 \
+ file://waf"
+
+do_configure() {
+ cp -f ${WORKDIR}/waf ${S}/
+ sed -i -e 's:, shell=False::g' wscript
+ ./configure \
+ --prefix=${prefix} \
+ --bindir=${bindir} \
+ --sbindir=${sbindir} \
+ --libexecdir=${libexecdir} \
+ --datadir=${datadir} \
+ --sysconfdir=${sysconfdir} \
+ --sharedstatedir=${sharedstatedir} \
+ --localstatedir=${localstatedir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --infodir=${infodir} \
+ --mandir=${mandir} \
+ ${EXTRA_OECONF}
+
+ sed -i /LINK_CC/d ./_build_/c4che/default.cache.py
+ echo "LINK_CC = '${CXX}'" >> ./_build_/c4che/default.cache.py
+}
+
+
+
diff --git a/recipes/gtk-webcore/midori_git.bb b/recipes/gtk-webcore/midori_git.bb
index aa5a213f78..decc81c365 100644
--- a/recipes/gtk-webcore/midori_git.bb
+++ b/recipes/gtk-webcore/midori_git.bb
@@ -3,11 +3,12 @@ require midori.inc
DEPENDS += "python-native python-docutils-native"
# increment PR every time SRCREV is updated!
-PR = "r1"
+PR = "r2"
PV = "0.1.7+${PR}+gitr${SRCREV}"
SRC_URI = "git://git.xfce.org/kalikiana/midori;protocol=git \
- file://waf"
+ file://waf \
+ file://wscript-fix.patch;patch=1"
S = "${WORKDIR}/git"
diff --git a/recipes/gtksourceview/gtksourceview2_2.6.0.bb b/recipes/gtksourceview/gtksourceview2_2.6.0.bb
index ee9f6549ac..f7889c8538 100644
--- a/recipes/gtksourceview/gtksourceview2_2.6.0.bb
+++ b/recipes/gtksourceview/gtksourceview2_2.6.0.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Portable C library for multiline text editing"
HOMEPAGE = "http://projects.gnome.org/gtksourceview/"
LICENSE = "LGPL"
DEPENDS = "gtk+ libgnomeprint"
-PR = "r0"
+PR = "r1"
PNAME = "gtksourceview"
S = "${WORKDIR}/${PNAME}-${PV}"
@@ -16,3 +16,5 @@ do_stage() {
autotools_stage_all
}
+FILES_${PN} += " ${datadir}/gtksourceview-2.0"
+
diff --git a/recipes/guile/guile-native_1.8.2.bb b/recipes/guile/guile-native_1.8.2.bb
index 7c4b26e873..2dc32bfd3d 100644
--- a/recipes/guile/guile-native_1.8.2.bb
+++ b/recipes/guile/guile-native_1.8.2.bb
@@ -1,13 +1,17 @@
SECTION = "unknown"
LICENSE = "GPL"
DEPENDS = "gmp-native libtool (< 2)"
-SRC_URI = "http://ftp.gnu.org/pub/gnu/guile/guile-${PV}.tar.gz \
- "
+SRC_URI = "http://ftp.gnu.org/pub/gnu/guile/guile-${PV}.tar.gz"
+
+PR = "r1"
inherit autotools native
S="${WORKDIR}/guile-${PV}"
+
+EXTRA_OECONF += "--enable-error-on-warning=no"
+
OE_LT_RPATH_ALLOW = "any"
LDFLAGS += " -L${STAGING_LIBDIR} "
diff --git a/recipes/hal/hal.inc b/recipes/hal/hal.inc
index da24afe25a..72df07f8bd 100644
--- a/recipes/hal/hal.inc
+++ b/recipes/hal/hal.inc
@@ -9,7 +9,7 @@ S = "${WORKDIR}/hal-${PV}"
inherit autotools pkgconfig
-DEPENDS = "virtual/kernel util-linux-ng dbus-glib udev intltool intltool-native expat libusb gperf-native"
+DEPENDS = "virtual/kernel util-linux-ng dbus-glib udev intltool intltool-native expat virtual/libusb0 gperf-native"
RDEPENDS += "hal-info udev-utils"
RRECOMMENDS += "eject"
diff --git a/recipes/hal/hal_0.5.12.bb b/recipes/hal/hal_0.5.12.bb
index b6531e8235..3edb33275b 100644
--- a/recipes/hal/hal_0.5.12.bb
+++ b/recipes/hal/hal_0.5.12.bb
@@ -2,9 +2,12 @@ require hal.inc
DEFAULT_PREFERENCE = "-1"
+PR = "r1"
+
# The following code finds the right linux/input.h,
# which also works with external-toolchain/SDK
do_configure() {
+ sed -i -e s:1.43:1.41:g ${S}/configure.in
linux_input_h=`echo "#include <linux/input.h>" | ${CPP} - | \
grep "linux\/input.h" | head -n 1 | awk -F '"' '{print $2}'`
autotools_do_configure --with-linux-input-header=${linux_input_h}
diff --git a/recipes/hal/hal_0.5.13.bb b/recipes/hal/hal_0.5.13.bb
new file mode 100644
index 0000000000..c5d9f65c2c
--- /dev/null
+++ b/recipes/hal/hal_0.5.13.bb
@@ -0,0 +1,12 @@
+require hal.inc
+
+DEFAULT_PREFERENCE = "-1"
+
+# The following code finds the right linux/input.h,
+# which also works with external-toolchain/SDK
+do_configure() {
+ sed -i -e s:1.43:1.41:g ${S}/configure.in
+ linux_input_h=`echo "#include <linux/input.h>" | ${CPP} - | \
+ grep "linux\/input.h" | head -n 1 | awk -F '"' '{print $2}'`
+ autotools_do_configure --with-linux-input-header=${linux_input_h}
+}
diff --git a/recipes/hal/hal_0.5.9.1.bb b/recipes/hal/hal_0.5.9.1.bb
index ecc98e10bc..b666446cc2 100644
--- a/recipes/hal/hal_0.5.9.1.bb
+++ b/recipes/hal/hal_0.5.9.1.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://freedesktop.org/Software/hal"
SECTION = "unknown"
LICENSE = "GPL LGPL AFL"
-DEPENDS = "virtual/kernel dbus-glib udev intltool-native expat libusb-compat"
+DEPENDS = "virtual/kernel dbus-glib udev intltool-native expat virtual/libusb0"
RDEPENDS_${PN} += "udev-utils hal-info"
PR = "r9"
diff --git a/recipes/hal/hal_git.bb b/recipes/hal/hal_git.bb
index 5fcd7433ed..8bd8285613 100644
--- a/recipes/hal/hal_git.bb
+++ b/recipes/hal/hal_git.bb
@@ -5,7 +5,7 @@ LICENSE = "GPL LGPL AFL"
DEFAULT_PREFERENCE = "-1"
-DEPENDS = "virtual/kernel dbus-glib udev intltool-native expat libusb-compat"
+DEPENDS = "virtual/kernel dbus-glib udev intltool-native expat virtual/libusb0"
RDEPENDS_${PN} += "udev-utils hal-info"
SRC_URI = "git://anongit.freedesktop.org/hal/;protocol=git \
diff --git a/recipes/i2c-tools/read-edid_1.4.1.bb b/recipes/i2c-tools/read-edid_1.4.1.bb
index e1f10ca48d..3fa98b3223 100644
--- a/recipes/i2c-tools/read-edid_1.4.1.bb
+++ b/recipes/i2c-tools/read-edid_1.4.1.bb
@@ -1,5 +1,6 @@
DESCRIPTION = "read-edid elucidates various very useful informations from a conforming PnP monitor"
LICENSE = "GPL"
+PR = "r1"
SRC_URI = "http://john.fremlin.de/programs/linux/read-edid/read-edid-${PV}.tar.gz \
http://ftp.de.debian.org/debian/pool/main/r/read-edid/read-edid_1.4.1-2.1.diff.gz;patch=1 "
@@ -7,13 +8,15 @@ SRC_URI = "http://john.fremlin.de/programs/linux/read-edid/read-edid-${PV}.tar.g
inherit autotools
do_compile() {
- oe_runmake parse-edid
+ oe_runmake parse-edid get-edid
}
do_install() {
install -d ${D}/${sbindir}
install -m 0755 parse-edid ${D}/${sbindir}/
+ install -m 0755 get-edid ${D}/${sbindir}/
}
-PACKAGES =+ "parse-edid"
+PACKAGES =+ "parse-edid get-edid"
FILES_parse-edid = "${sbindir}/parse-edid"
+FILES_get-edid = "${sbindir}/parse-edid"
diff --git a/recipes/icecast/icecast_2.3.2.bb b/recipes/icecast/icecast_2.3.2.bb
new file mode 100644
index 0000000000..bb82d59557
--- /dev/null
+++ b/recipes/icecast/icecast_2.3.2.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Icecast streaming media server"
+LICENSE = "GPLv2"
+
+DEPENDS = "libvorbis libogg libtheora speex libxslt libxslt-native"
+
+PR = "r2"
+
+SRC_URI = "http://downloads.us.xiph.org/releases/icecast/${PN}-${PV}.tar.gz"
+
+# disable curl
+EXTRA_OECONF = " \
+ --without-curl \
+ --with-ogg=${STAGING_LIBDIR} \
+ --with-vorbis=${STAGING_LIBDIR} \
+ --with-theora=${STAGING_LIBDIR} \
+ --with-speex=${STAGING_LIBDIR} \
+ "
+
+S = "${WORKDIR}/${PN}-${PV}"
+inherit autotools
+
diff --git a/recipes/icon-slicer/icon-slicer-native_0.3.bb b/recipes/icon-slicer/icon-slicer-native_0.3.bb
index e23bcacdff..f7be0de306 100644
--- a/recipes/icon-slicer/icon-slicer-native_0.3.bb
+++ b/recipes/icon-slicer/icon-slicer-native_0.3.bb
@@ -4,7 +4,7 @@ SRC_URI = "http://freedesktop.org/software/icon-slicer/releases/icon-slicer-${PV
inherit autotools native
-DEPENDS = "gtk+-native popt-native"
+DEPENDS = "gdk-pixbuf-csource-native popt-native"
S = "${WORKDIR}/icon-slicer-${PV}"
diff --git a/recipes/imagemagick/imagemagick_6.3.5-10.bb b/recipes/imagemagick/imagemagick_6.3.5-10.bb
index 7b92a8252e..cf9e82f3e2 100644
--- a/recipes/imagemagick/imagemagick_6.3.5-10.bb
+++ b/recipes/imagemagick/imagemagick_6.3.5-10.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "ImageMagick is an image convertion tools"
SECTION = "console/utils"
LICENSE = "GPL"
DEPENDS = "tiff"
-PR = "r3"
+PR = "r4"
SRC_URI = "ftp://ftp.nluug.nl/pub/ImageMagick/ImageMagick-${PV}.tar.bz2 \
file://PerlMagic_MakePatch;patch=1 \
diff --git a/recipes/images/sugar-image.bb b/recipes/images/sugar-image.bb
index 247927543b..e4513f6fe5 100644
--- a/recipes/images/sugar-image.bb
+++ b/recipes/images/sugar-image.bb
@@ -1,5 +1,6 @@
XSERVER ?= "xserver-kdrive-fbdev"
SPLASH ?= ' ${@base_contains("MACHINE_FEATURES", "screen", "psplash-angstrom", "",d)}'
+ANGSTROM_EXTRA_INSTALL += ""
export IMAGE_BASENAME = "sugar-image"
@@ -10,7 +11,7 @@ IMAGE_INSTALL = "\
angstrom-x11-base-depends \
angstrom-gpe-task-base \
angstrom-gpe-task-settings \
- sugar-sucrose \
+ task-sugar-sucrose \
${SPLASH} \
${ANGSTROM_EXTRA_INSTALL}"
diff --git a/recipes/initscripts/initscripts-1.0/checkroot b/recipes/initscripts/initscripts-1.0/checkroot
index e5aa9aaf99..7ad00d09ad 100755
--- a/recipes/initscripts/initscripts-1.0/checkroot
+++ b/recipes/initscripts/initscripts-1.0/checkroot
@@ -182,6 +182,15 @@ else
fi
fi
+ROOTFSDEV="/dev/root"
+if ! grep -q "^$ROOTFSDEV\>" /proc/mounts; then
+ ROOTFSDEV="rootfs"
+fi
+if [ x$(grep "^$ROOTFSDEV\>" /proc/mounts | awk '{print $4}') = "x$rootmode" ]; then
+ echo "Root filesystem already $rootmode, not remounting"
+ exit 0
+fi
+
#
# If the root filesystem was not marked as read-only in /etc/fstab,
# remount the rootfs rw but do not try to change mtab because it
@@ -189,15 +198,6 @@ fi
# and finally write the new mtab.
# This part is only needed if the rootfs was mounted ro.
#
-ROOTFSDEV="/dev/root"
-if ! grep -q "^$ROOTFSDEV\w" /proc/mounts; then
- ROOTFSDEV="rootfs"
-fi
-if [ x$(grep "^$ROOTFSDEV\w" /proc/mounts | awk '{print $4}') = "xrw" ]; then
- echo "Root filesystem already read-write, not remounting"
- exit 0
-fi
-
echo "Remounting root file system..."
mount -n -o remount,$rootmode /
if test "$rootmode" = rw
diff --git a/recipes/irrlicht/files/irrlicht_beagle.diff b/recipes/irrlicht/files/irrlicht_beagle.diff
new file mode 100644
index 0000000000..88709bfb77
--- /dev/null
+++ b/recipes/irrlicht/files/irrlicht_beagle.diff
@@ -0,0 +1,865 @@
+Index: source/Irrlicht/SoftwareDriver2_compile_config.h
+===================================================================
+--- source/Irrlicht/SoftwareDriver2_compile_config.h (revision 2409)
++++ source/Irrlicht/SoftwareDriver2_compile_config.h (working copy)
+@@ -60,7 +60,7 @@
+ //#define SOFTWARE_DRIVER_2_LIGHTING
+ //#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR
+ //#define SOFTWARE_DRIVER_2_32BIT
+- #define SOFTWARE_DRIVER_2_MIPMAPPING
++ //#define SOFTWARE_DRIVER_2_MIPMAPPING
+ #define SOFTWARE_DRIVER_2_USE_WBUFFER
+ #define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 0
+ #endif
+Index: source/Irrlicht/CSoftwareDriver2.cpp
+===================================================================
+--- source/Irrlicht/CSoftwareDriver2.cpp (revision 2409)
++++ source/Irrlicht/CSoftwareDriver2.cpp (working copy)
+@@ -1489,18 +1489,6 @@
+ setCurrentShader();
+ }
+
+-
+-
+-#ifdef SOFTWARE_DRIVER_2_LIGHTING
+-
+-//! Sets the fog mode.
+-void CBurningVideoDriver::setFog(SColor color, bool linearFog, f32 start,
+- f32 end, f32 density, bool pixelFog, bool rangeFog)
+-{
+- CNullDriver::setFog(color, linearFog, start, end, density, pixelFog, rangeFog);
+- LightSpace.FogColor.setA8R8G8B8 ( color.color );
+-}
+-
+ /*!
+ Camera Position in World Space
+ */
+@@ -1524,6 +1512,18 @@
+ LightSpace.campos.w = 1.f;
+ }
+
++#ifdef SOFTWARE_DRIVER_2_LIGHTING
++
++//! Sets the fog mode.
++void CBurningVideoDriver::setFog(SColor color, bool linearFog, f32 start,
++ f32 end, f32 density, bool pixelFog, bool rangeFog)
++{
++ CNullDriver::setFog(color, linearFog, start, end, density, pixelFog, rangeFog);
++ LightSpace.FogColor.setA8R8G8B8 ( color.color );
++}
++
++
++
+ /*!
+ applies lighting model
+ */
+Index: source/Irrlicht/COGLESTexture.cpp
+===================================================================
+--- source/Irrlicht/COGLESTexture.cpp (revision 2409)
++++ source/Irrlicht/COGLESTexture.cpp (working copy)
+@@ -105,7 +105,8 @@
+ default:
+ break;
+ }
+- }
++ }
++ destFormat=ECF_A1R5G5B5; //Added to get textures working on Beagle Board
+ return destFormat;
+ }
+
+Index: include/IrrCompileConfig.h
+===================================================================
+--- include/IrrCompileConfig.h (revision 2409)
++++ include/IrrCompileConfig.h (working copy)
+@@ -254,9 +254,9 @@
+ 16Bit + SubPixel/SubTexel Correct + ZBuffer
+ */
+
+-#define BURNINGVIDEO_RENDERER_BEAUTIFUL
++//#define BURNINGVIDEO_RENDERER_BEAUTIFUL
+ //#define BURNINGVIDEO_RENDERER_FAST
+-//#define BURNINGVIDEO_RENDERER_ULTRA_FAST
++#define BURNINGVIDEO_RENDERER_ULTRA_FAST
+ //#define BURNINGVIDEO_RENDERER_CE
+
+ //! Uncomment the following line if you want to ignore the deprecated warnings
+Index: examples/03.CustomSceneNode/main.cpp
+===================================================================
+--- examples/03.CustomSceneNode/main.cpp (revision 2409)
++++ examples/03.CustomSceneNode/main.cpp (working copy)
+@@ -171,7 +171,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL-ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -182,7 +182,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/03.CustomSceneNode/Makefile
+===================================================================
+--- examples/03.CustomSceneNode/Makefile (revision 2409)
++++ examples/03.CustomSceneNode/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/07.Collision/main.cpp
+===================================================================
+--- examples/07.Collision/main.cpp (revision 2409)
++++ examples/07.Collision/main.cpp (working copy)
+@@ -42,7 +42,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -53,7 +53,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/07.Collision/Makefile
+===================================================================
+--- examples/07.Collision/Makefile (revision 2409)
++++ examples/07.Collision/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/15.LoadIrrFile/main.cpp
+===================================================================
+--- examples/15.LoadIrrFile/main.cpp (revision 2409)
++++ examples/15.LoadIrrFile/main.cpp (working copy)
+@@ -25,7 +25,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -36,7 +36,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/15.LoadIrrFile/Makefile
+===================================================================
+--- examples/15.LoadIrrFile/Makefile (revision 2409)
++++ examples/15.LoadIrrFile/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/18.SplitScreen/main.cpp
+===================================================================
+--- examples/18.SplitScreen/main.cpp (revision 2409)
++++ examples/18.SplitScreen/main.cpp (working copy)
+@@ -78,7 +78,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -89,7 +89,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/18.SplitScreen/Makefile
+===================================================================
+--- examples/18.SplitScreen/Makefile (revision 2409)
++++ examples/18.SplitScreen/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/05.UserInterface/main.cpp
+===================================================================
+--- examples/05.UserInterface/main.cpp (revision 2409)
++++ examples/05.UserInterface/main.cpp (working copy)
+@@ -163,7 +163,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -174,7 +174,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/05.UserInterface/Makefile
+===================================================================
+--- examples/05.UserInterface/Makefile (revision 2409)
++++ examples/05.UserInterface/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/19.MouseAndJoystick/main.cpp
+===================================================================
+--- examples/19.MouseAndJoystick/main.cpp (revision 2409)
++++ examples/19.MouseAndJoystick/main.cpp (working copy)
+@@ -107,7 +107,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -118,7 +118,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/19.MouseAndJoystick/Makefile
+===================================================================
+--- examples/19.MouseAndJoystick/Makefile (revision 2409)
++++ examples/19.MouseAndJoystick/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
+Index: examples/12.TerrainRendering/main.cpp
+===================================================================
+--- examples/12.TerrainRendering/main.cpp (revision 2409)
++++ examples/12.TerrainRendering/main.cpp (working copy)
+@@ -89,7 +89,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -100,7 +100,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/12.TerrainRendering/Makefile
+===================================================================
+--- examples/12.TerrainRendering/Makefile (revision 2409)
++++ examples/12.TerrainRendering/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/Demo/main.cpp
+===================================================================
+--- examples/Demo/main.cpp (revision 2409)
++++ examples/Demo/main.cpp (working copy)
+@@ -29,7 +29,7 @@
+ bool aa = false;
+
+ #ifndef _IRR_WINDOWS_
+- video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;
++ video::E_DRIVER_TYPE driverType = video::EDT_OPENGLES1;
+ #else
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+ #endif
+Index: examples/Demo/Makefile
+===================================================================
+--- examples/Demo/Makefile (revision 2409)
++++ examples/Demo/Makefile (working copy)
+@@ -10,10 +10,11 @@
+ endif
+
+ all: all_linux
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+ all_linux: SYSTEM=Linux
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/$(SYSTEM) -lIrrlicht $(OGELSLIBS) -lXxf86vm -lXext -lX11
+
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+ all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
+Index: examples/13.RenderToTexture/main.cpp
+===================================================================
+--- examples/13.RenderToTexture/main.cpp (revision 2409)
++++ examples/13.RenderToTexture/main.cpp (working copy)
+@@ -24,7 +24,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -35,7 +35,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/13.RenderToTexture/Makefile
+===================================================================
+--- examples/13.RenderToTexture/Makefile (revision 2409)
++++ examples/13.RenderToTexture/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/20.ManagedLights/main.cpp
+===================================================================
+--- examples/20.ManagedLights/main.cpp (revision 2409)
++++ examples/20.ManagedLights/main.cpp (working copy)
+@@ -284,7 +284,7 @@
+ else
+ {
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -296,7 +296,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/20.ManagedLights/Makefile
+===================================================================
+--- examples/20.ManagedLights/Makefile (revision 2409)
++++ examples/20.ManagedLights/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
+Index: examples/01.HelloWorld/Makefile
+===================================================================
+--- examples/01.HelloWorld/Makefile (revision 2409)
++++ examples/01.HelloWorld/Makefile (working copy)
+@@ -30,10 +30,11 @@
+
+ #default target is Linux
+ all: all_linux
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+ all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
+-all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
+ all_win32 clean_win32 static_win32: SUF=.exe
+Index: examples/21.Quake3Explorer/main.cpp
+===================================================================
+--- examples/21.Quake3Explorer/main.cpp (revision 2409)
++++ examples/21.Quake3Explorer/main.cpp (working copy)
+@@ -680,7 +680,7 @@
+ gui.VideoDriver = env->addComboBox(rect<s32>( dim.Width - 300, 24, dim.Width - 10, 40 ),gui.Window);
+ gui.VideoDriver->addItem(L"Direct3D 9.0c", EDT_DIRECT3D9 );
+ gui.VideoDriver->addItem(L"Direct3D 8.1", EDT_DIRECT3D8 );
+- gui.VideoDriver->addItem(L"OpenGL 1.5", EDT_OPENGL);
++ gui.VideoDriver->addItem(L"OpenGL ES1", EDT_OGLES1);
+ gui.VideoDriver->addItem(L"Software Renderer", EDT_SOFTWARE);
+ gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO);
+ gui.VideoDriver->setSelected ( gui.VideoDriver->getIndexForItemData ( Game->deviceParam.DriverType ) );
+@@ -2080,7 +2080,7 @@
+ {
+ game.setDefault ();
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Video (TM) Thomas Alten\n"\
+ " (otherKey) exit\n\n");
+
+@@ -2091,7 +2091,7 @@
+ {
+ case 'a': game.deviceParam.DriverType = EDT_DIRECT3D9;break;
+ case 'b': game.deviceParam.DriverType = EDT_DIRECT3D8;break;
+- case 'c': game.deviceParam.DriverType = EDT_OPENGL; break;
++ case 'c': game.deviceParam.DriverType = EDT_OGLES1; break;
+ case 'd': game.deviceParam.DriverType = EDT_SOFTWARE; break;
+ case 'e': game.deviceParam.DriverType = EDT_BURNINGSVIDEO;break;
+ default: game.retVal = 3; break;
+Index: examples/21.Quake3Explorer/Makefile
+===================================================================
+--- examples/21.Quake3Explorer/Makefile (revision 2409)
++++ examples/21.Quake3Explorer/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/11.PerPixelLighting/main.cpp
+===================================================================
+--- examples/11.PerPixelLighting/main.cpp (revision 2409)
++++ examples/11.PerPixelLighting/main.cpp (working copy)
+@@ -159,7 +159,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -170,7 +170,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/11.PerPixelLighting/Makefile
+===================================================================
+--- examples/11.PerPixelLighting/Makefile (revision 2409)
++++ examples/11.PerPixelLighting/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/16.Quake3MapShader/main.cpp
+===================================================================
+--- examples/16.Quake3MapShader/main.cpp (revision 2409)
++++ examples/16.Quake3MapShader/main.cpp (working copy)
+@@ -130,7 +130,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -141,7 +141,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/16.Quake3MapShader/Makefile
+===================================================================
+--- examples/16.Quake3MapShader/Makefile (revision 2409)
++++ examples/16.Quake3MapShader/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/08.SpecialFX/main.cpp
+===================================================================
+--- examples/08.SpecialFX/main.cpp (revision 2409)
++++ examples/08.SpecialFX/main.cpp (working copy)
+@@ -37,7 +37,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -47,7 +47,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/08.SpecialFX/Makefile
+===================================================================
+--- examples/08.SpecialFX/Makefile (revision 2409)
++++ examples/08.SpecialFX/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/09.Meshviewer/main.cpp
+===================================================================
+--- examples/09.Meshviewer/main.cpp (revision 2409)
++++ examples/09.Meshviewer/main.cpp (working copy)
+@@ -554,7 +554,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D8;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -564,8 +564,8 @@
+ switch(key)
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+- case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'b': driverType = video::EDT_DIRECT3D8;break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/09.Meshviewer/Makefile
+===================================================================
+--- examples/09.Meshviewer/Makefile (revision 2409)
++++ examples/09.Meshviewer/Makefile (working copy)
+@@ -6,8 +6,8 @@
+
+ # general compiler settings
+ CPPFLAGS = -I../../include -I/usr/X11R6/include
+-CXXFLAGS = -O3 -ffast-math
+-#CXXFLAGS = -g -Wall
++#CXXFLAGS = -O3 -ffast-math
++CXXFLAGS = -g -Wall
+
+ #default target is Linux
+ all: all_linux
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/02.Quake3Map/main.cpp
+===================================================================
+--- examples/02.Quake3Map/main.cpp (revision 2409)
++++ examples/02.Quake3Map/main.cpp (working copy)
+@@ -54,9 +54,9 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
+- " (d) OpenGL-ES1\n (e) Software Renderer\n (f) Burning's Software Renderer\n"\
+- " (g) NullDevice\n (otherKey) exit\n\n");
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
++ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
++ " (f) NullDevice\n (otherKey) exit\n\n");
+
+ char i;
+ std::cin >> i;
+@@ -65,11 +65,10 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
+- case 'd': driverType = video::EDT_OGLES1; break;
+- case 'e': driverType = video::EDT_SOFTWARE; break;
+- case 'f': driverType = video::EDT_BURNINGSVIDEO;break;
+- case 'g': driverType = video::EDT_NULL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
++ case 'd': driverType = video::EDT_SOFTWARE; break;
++ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
++ case 'f': driverType = video::EDT_NULL; break;
+ default: return 1;
+ }
+
+Index: examples/02.Quake3Map/Makefile
+===================================================================
+--- examples/02.Quake3Map/Makefile (revision 2409)
++++ examples/02.Quake3Map/Makefile (working copy)
+@@ -16,7 +16,7 @@
+ LIBSELECT=64
+ endif
+
+-OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+ all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+Index: examples/10.Shaders/main.cpp
+===================================================================
+--- examples/10.Shaders/main.cpp (revision 2409)
++++ examples/10.Shaders/main.cpp (working copy)
+@@ -119,7 +119,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -130,7 +130,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/10.Shaders/Makefile
+===================================================================
+--- examples/10.Shaders/Makefile (revision 2409)
++++ examples/10.Shaders/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/06.2DGraphics/main.cpp
+===================================================================
+--- examples/06.2DGraphics/main.cpp (revision 2409)
++++ examples/06.2DGraphics/main.cpp (working copy)
+@@ -29,7 +29,7 @@
+ video::E_DRIVER_TYPE driverType;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -40,7 +40,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/06.2DGraphics/Makefile
+===================================================================
+--- examples/06.2DGraphics/Makefile (revision 2409)
++++ examples/06.2DGraphics/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32 clean_win32: SYSTEM=Win32-gcc
+Index: examples/04.Movement/main.cpp
+===================================================================
+--- examples/04.Movement/main.cpp (revision 2409)
++++ examples/04.Movement/main.cpp (working copy)
+@@ -75,7 +75,7 @@
+ video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+ printf("Please select the driver you want for this example:\n"\
+- " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
++ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL ES1\n"\
+ " (d) Software Renderer\n (e) Burning's Software Renderer\n"\
+ " (f) NullDevice\n (otherKey) exit\n\n");
+
+@@ -86,7 +86,7 @@
+ {
+ case 'a': driverType = video::EDT_DIRECT3D9;break;
+ case 'b': driverType = video::EDT_DIRECT3D8;break;
+- case 'c': driverType = video::EDT_OPENGL; break;
++ case 'c': driverType = video::EDT_OGLES1; break;
+ case 'd': driverType = video::EDT_SOFTWARE; break;
+ case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+ case 'f': driverType = video::EDT_NULL; break;
+Index: examples/04.Movement/Makefile
+===================================================================
+--- examples/04.Movement/Makefile (revision 2409)
++++ examples/04.Movement/Makefile (working copy)
+@@ -15,9 +15,10 @@
+ ifeq ($(HOSTTYPE), x86_64)
+ LIBSELECT=64
+ endif
+-
++
++OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -lEGL
+ # target specific settings
+-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
++all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11
+ all_linux clean_linux: SYSTEM=Linux
+ all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+ all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
diff --git a/recipes/irrlicht/irrlicht-examples-gles.bb b/recipes/irrlicht/irrlicht-examples-gles.bb
new file mode 100644
index 0000000000..6de692ec0e
--- /dev/null
+++ b/recipes/irrlicht/irrlicht-examples-gles.bb
@@ -0,0 +1,42 @@
+DESCRIPTION = "Irrlicht 3D rendering engine "
+LICENSE = "zlib"
+DEPENDS = "virtual/libx11 libxxf86vm virtual/egl"
+
+SRCREV = "2409"
+PV = "1.6+svnr${SRCREV}"
+
+SRC_URI = "svn://irrlicht.svn.sourceforge.net/svnroot/irrlicht/branches;module=ogl-es;proto=https \
+ file://irrlicht_beagle.diff;patch=1;pnum=0 \
+ "
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+S = "${WORKDIR}/ogl-es"
+
+do_compile(){
+ cd ${WORKDIR}/ogl-es/source/Irrlicht
+ oe_runmake
+ cd ${WORKDIR}/ogl-es/examples
+ oe_runmake
+}
+
+EXTRA_OEMAKE = -I${WORKDIR}/egl-es/include
+
+do_stage() {
+ install ${S}/lib/Linux/libIrrlicht.a ${STAGING_LIBDIR}
+}
+
+do_install() {
+ install -d ${D}${datadir}/irrlicht/bin
+ install -d ${D}${libdir}
+ install ${S}/lib/Linux/libIrrlicht.a ${D}${libdir}
+ cp -a ${S}/bin/Linux ${D}${datadir}/irrlicht/bin/
+ mkdir ${D}${datadir}/irrlicht/media
+ cp ${S}/media/* ${D}${datadir}/irrlicht/media/
+ find ${D} -name ".svn" | xargs rm -rf
+}
+
+FILES_${PN} = "${datadir}/irrlicht/"
+FILES_${PN}-dbg += "${datadir}/irrlicht/bin/Linux/.debug"
+FILES_${PN} += "${libdir}/"
+
diff --git a/recipes/julius/julius_4.1.2.bb b/recipes/julius/julius_4.1.2.bb
new file mode 100644
index 0000000000..d528357122
--- /dev/null
+++ b/recipes/julius/julius_4.1.2.bb
@@ -0,0 +1,63 @@
+DESCRIPTION = "Julius is a high-performance, two-pass large vocabulary continuous speech recognition (LVCSR) decoder software for speech-related researchers and developers."
+LICENSE = "julius"
+DEPENDS = "libsndfile1 flex zlib alsa-lib"
+
+SRC_URI = "http://iij.dl.sourceforge.jp/julius/37582/julius-${PV}.tar.gz"
+
+inherit autotools
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+EXTRA_OECONF = "--with-mictype=alsa --enable-julian"
+
+do_configure() {
+ libtoolize --force
+ gnu-configize
+ oe_runconf
+}
+
+do_install() {
+ export prefix=${D}${prefix}
+ export libdir=${D}${libdir}
+ export bindir=${D}${bindir}
+ export includedir=${D}${includedir}
+ export mandir=${D}${mandir}
+ export exec_prefix=${D}${exec_prefix}
+ export datadir=${D}${datadir}
+
+ for i in libsent libjulius julius mkbingram mkbinhmm adinrec adintool mkgshmm mkss jcontrol generate-ngram jclient-perl man ; do
+ sed -i -e s:\ /usr/bin:\ \$\{bindir\}:g -e s:\ /usr/share:\ \$\{datadir\}:g ${S}/$i/Makefile
+ cd ${S}/$i
+ oe_runmake -e install
+ done
+
+ for i in mkdfa/mkfa-1.44-flex mkdfa dfa_minimize generate accept_check nextword yomi2voca gram2sapixml dfa_determinize ; do
+ sed -i -e s:\ /usr/bin:\ \$\{bindir\}:g ${S}/gramtools/$i/Makefile
+ cd ${S}/gramtools/$i
+ oe_runmake -e install
+ done
+
+ for i in ${D}${bindir}/*.pl ; do
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ echo sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i >> /tmp/k
+ done
+}
+
+do_stage() {
+ export libdir=${STAGING_LIBDIR}
+ export bindir=${STAGING_BINDIR}
+ export includedir=${STAGING_INCDIR}
+ export datadir=${STAGING_DATADIR}
+
+ for i in libsent libjulius julius mkbingram mkbinhmm adinrec adintool mkgshmm mkss jcontrol generate-ngram jclient-perl man ; do
+ sed -i -e s:\ /usr/bin:\ \$\{bindir\}:g -e s:\ /usr/share:\ \$\{datadir\}:g ${S}/$i/Makefile
+ cd ${S}/$i
+ oe_runmake -e install
+ done
+
+ for i in mkdfa/mkfa-1.44-flex mkdfa dfa_minimize generate accept_check nextword yomi2voca gram2sapixml dfa_determinize ; do
+ sed -i -e s:\ /usr/bin:\ \$\{bindir\}:g ${S}/gramtools/$i/Makefile
+ cd ${S}/gramtools/$i
+ oe_runmake -e install
+ done
+}
diff --git a/recipes/kexecboot/kexecboot_git.bb b/recipes/kexecboot/kexecboot_git.bb
index c5e91f080e..3696ddaa9a 100644
--- a/recipes/kexecboot/kexecboot_git.bb
+++ b/recipes/kexecboot/kexecboot_git.bb
@@ -1,8 +1,8 @@
-PR = "r1"
-DEFAULT_PREFERENCE = "-1"
+PV = "0.5"
+PR = "r3+gitr${SRCREV}"
-SRC_URI = "git://git.linuxtogo.org/home/groups/kexecboot/kexecboot.git;protocol=git "
-SRCREV = "c5f17845f0f620adff854c2239a8aaa5d9942255"
+SRC_URI = "git://git.linuxtogo.org/home/groups/kexecboot/kexecboot.git;protocol=git;branch=cfgfiles "
+SRCREV = "0d4d33d85baa6251de3b1e20bd7bd464f11c5097"
# v0.51 (pre cfg-files)
#SRCREV = "c5f17845f0f620adff854c2239a8aaa5d9942255"
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/0001-ASoC-Add-support-for-OMAP3-EVM.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-ASoC-Add-support-for-OMAP3-EVM.patch
new file mode 100644
index 0000000000..a76e96e444
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-ASoC-Add-support-for-OMAP3-EVM.patch
@@ -0,0 +1,206 @@
+From c1dad0b6b434300ae64c902d11611c54c513ea10 Mon Sep 17 00:00:00 2001
+From: Anuj Aggarwal <anuj.aggarwal@ti.com>
+Date: Fri, 21 Nov 2008 17:41:03 +0530
+Subject: [PATCH] ASoC: Add support for OMAP3 EVM
+
+This patch adds ALSA SoC support for OMAP3 EVM using TWL4030 audio codec.
+
+Signed-off-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
+---
+ sound/soc/omap/Kconfig | 8 +++
+ sound/soc/omap/Makefile | 3 +-
+ sound/soc/omap/omap3evm.c | 147 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 157 insertions(+), 1 deletions(-)
+ create mode 100644 sound/soc/omap/omap3evm.c
+
+diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
+index 0daeee4..deb6ba9 100644
+--- a/sound/soc/omap/Kconfig
++++ b/sound/soc/omap/Kconfig
+@@ -22,6 +22,14 @@ config SND_OMAP_SOC_OMAP3_BEAGLE
+ help
+ Say Y if you want to add support for SoC audio on the Beagleboard.
+
++config SND_OMAP_SOC_OMAP3EVM
++ tristate "SoC Audio support for OMAP3EVM board"
++ depends on SND_OMAP_SOC && MACH_OMAP3EVM
++ select SND_OMAP_SOC_MCBSP
++ select SND_SOC_TWL4030
++ help
++ Say Y if you want to add support for SoC audio on the omap3evm board.
++
+ config SND_OMAP_SOC_OSK5912
+ tristate "SoC Audio support for omap osk5912"
+ depends on SND_OMAP_SOC && MACH_OMAP_OSK
+diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
+index 4bae404..ef31c25 100644
+--- a/sound/soc/omap/Makefile
++++ b/sound/soc/omap/Makefile
+@@ -10,9 +10,10 @@ snd-soc-n810-objs := n810.o
+ snd-soc-omap3beagle-objs := omap3beagle.o
+ snd-soc-osk5912-objs := osk5912.o
+ snd-soc-overo-objs := overo.o
++snd-soc-omap3evm-objs := omap3evm.o
+
+ obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
+ obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
+ obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
+ obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
+-
++obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o
+diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
+new file mode 100644
+index 0000000..570af55
+--- /dev/null
++++ b/sound/soc/omap/omap3evm.c
+@@ -0,0 +1,147 @@
++/*
++ * omap3evm.c -- ALSA SoC support for OMAP3 EVM
++ *
++ * Author: Anuj Aggarwal <anuj.aggarwal@ti.com>
++ *
++ * Based on sound/soc/omap/beagle.c by Steve Sakoman
++ *
++ * Copyright (C) 2008 Texas Instruments, Incorporated
++ *
++ * 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 version 2.
++ *
++ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
++ * whether express or implied; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ */
++
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++#include <sound/core.h>
++#include <sound/pcm.h>
++#include <sound/soc.h>
++#include <sound/soc-dapm.h>
++
++#include <asm/mach-types.h>
++#include <mach/hardware.h>
++#include <mach/gpio.h>
++#include <mach/mcbsp.h>
++
++#include "omap-mcbsp.h"
++#include "omap-pcm.h"
++#include "../codecs/twl4030.h"
++
++static int omap3evm_hw_params(struct snd_pcm_substream *substream,
++ struct snd_pcm_hw_params *params)
++{
++ struct snd_soc_pcm_runtime *rtd = substream->private_data;
++ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
++ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
++ int ret;
++
++ /* Set codec DAI configuration */
++ ret = snd_soc_dai_set_fmt(codec_dai,
++ SND_SOC_DAIFMT_I2S |
++ SND_SOC_DAIFMT_NB_NF |
++ SND_SOC_DAIFMT_CBM_CFM);
++ if (ret < 0) {
++ printk(KERN_ERR "can't set codec DAI configuration\n");
++ return ret;
++ }
++
++ /* Set cpu DAI configuration */
++ ret = snd_soc_dai_set_fmt(cpu_dai,
++ SND_SOC_DAIFMT_I2S |
++ SND_SOC_DAIFMT_NB_NF |
++ SND_SOC_DAIFMT_CBM_CFM);
++ if (ret < 0) {
++ printk(KERN_ERR "can't set cpu DAI configuration\n");
++ return ret;
++ }
++
++ /* Set the codec system clock for DAC and ADC */
++ ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
++ SND_SOC_CLOCK_IN);
++ if (ret < 0) {
++ printk(KERN_ERR "can't set codec system clock\n");
++ return ret;
++ }
++
++ return 0;
++}
++
++static struct snd_soc_ops omap3evm_ops = {
++ .hw_params = omap3evm_hw_params,
++};
++
++/* Digital audio interface glue - connects codec <--> CPU */
++static struct snd_soc_dai_link omap3evm_dai = {
++ .name = "TWL4030",
++ .stream_name = "TWL4030",
++ .cpu_dai = &omap_mcbsp_dai[0],
++ .codec_dai = &twl4030_dai,
++ .ops = &omap3evm_ops,
++};
++
++/* Audio machine driver */
++static struct snd_soc_machine snd_soc_machine_omap3evm = {
++ .name = "omap3evm",
++ .dai_link = &omap3evm_dai,
++ .num_links = 1,
++};
++
++/* Audio subsystem */
++static struct snd_soc_device omap3evm_snd_devdata = {
++ .machine = &snd_soc_machine_omap3evm,
++ .platform = &omap_soc_platform,
++ .codec_dev = &soc_codec_dev_twl4030,
++};
++
++static struct platform_device *omap3evm_snd_device;
++
++static int __init omap3evm_soc_init(void)
++{
++ int ret;
++
++ if (!machine_is_omap3evm()) {
++ pr_debug("Not OMAP3 EVM!\n");
++ return -ENODEV;
++ }
++ pr_info("OMAP3 EVM SoC init\n");
++
++ omap3evm_snd_device = platform_device_alloc("soc-audio", -1);
++ if (!omap3evm_snd_device) {
++ printk(KERN_ERR "Platform device allocation failed\n");
++ return -ENOMEM;
++ }
++
++ platform_set_drvdata(omap3evm_snd_device, &omap3evm_snd_devdata);
++ omap3evm_snd_devdata.dev = &omap3evm_snd_device->dev;
++ *(unsigned int *)omap3evm_dai.cpu_dai->private_data = 1; /* McBSP2 */
++
++ ret = platform_device_add(omap3evm_snd_device);
++ if (ret)
++ goto err1;
++
++ return 0;
++
++err1:
++ printk(KERN_ERR "Unable to add platform device\n");
++ platform_device_put(omap3evm_snd_device);
++
++ return ret;
++}
++
++static void __exit omap3evm_soc_exit(void)
++{
++ platform_device_unregister(omap3evm_snd_device);
++}
++
++module_init(omap3evm_soc_init);
++module_exit(omap3evm_soc_exit);
++
++MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>");
++MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM");
++MODULE_LICENSE("GPL");
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/0001-This-merges-Steve-Kipisz-USB-EHCI-support.-He-star.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-This-merges-Steve-Kipisz-USB-EHCI-support.-He-star.patch
new file mode 100644
index 0000000000..d590f8ffb9
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-This-merges-Steve-Kipisz-USB-EHCI-support.-He-star.patch
@@ -0,0 +1,146 @@
+From f8f10f496bce396416d7156da876222c6ce8c341 Mon Sep 17 00:00:00 2001
+From: Steven Kipisz <skipisz@beagleboard.org>
+Date: Wed, 9 Jan 2009 12:01:11 -0600
+Subject: [PATCH-USB] Omap3 beagleboard: add support for EHCI in revision C1 boards
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 10 +---------
+ arch/arm/mach-omap2/usb-ehci.c | 4 +---
+ drivers/usb/host/ehci-omap.c | 26 ++++++++++++++++++++++++++
+ 3 files changed, 28 insertions(+), 12 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index fe97bab..de81153 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -140,15 +140,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ * power switch and overcurrent detect
+ */
+
+- gpio_request(gpio + 1, "EHCI_nOC");
+- gpio_direction_input(gpio + 1);
+-
+- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+-
+- /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+- gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
++ /* TODO: This needs to be modified to not rely on u-boot */
+
+ return 0;
+ }
+diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
+index 489439d..2c6305b 100644
+--- a/arch/arm/mach-omap2/usb-ehci.c
++++ b/arch/arm/mach-omap2/usb-ehci.c
+@@ -152,9 +152,7 @@ static void setup_ehci_io_mux(void)
+ void __init usb_ehci_init(void)
+ {
+ #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
+- /* Setup Pin IO MUX for EHCI */
+- if (cpu_is_omap34xx())
+- setup_ehci_io_mux();
++ /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
+
+ if (platform_device_register(&ehci_device) < 0) {
+ printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
+
+diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
+index 1b3266c..8472996 100644
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -48,16 +48,26 @@
+ * to get the PHY state machine in working state
+ */
+ #define EXTERNAL_PHY_RESET
++#ifdef CONFIG_MACH_OMAP3_BEAGLE
++#define EXT_PHY_RESET_GPIO_PORT2 (147)
++#else
+ #define EXT_PHY_RESET_GPIO_PORT1 (57)
+ #define EXT_PHY_RESET_GPIO_PORT2 (61)
++#endif
+ #define EXT_PHY_RESET_DELAY (10)
+
++#define PHY_STP_PULLUP_ENABLE (0x10)
++#define PHY_STP_PULLUP_DISABLE (0x90)
++
++
+ /* ISSUE2:
+ * USBHOST supports External charge pump PHYs only
+ * Use the VBUS from Port1 to power VBUS of Port2 externally
+ * So use Port2 as the working ULPI port
+ */
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ #define VBUS_INTERNAL_CHARGEPUMP_HACK
++#endif
+
+ #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
+
+@@ -225,14 +235,43 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+
+ #ifdef EXTERNAL_PHY_RESET
+ /* Refer: ISSUE1 */
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
++#endif
+ gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
++ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
+ /* Hold the PHY in RESET for enough time till DIR is high */
+ udelay(EXT_PHY_RESET_DELAY);
+ #endif
+
++ /*
++ * The PHY register 0x7 - Interface Control register is
++ * configured to disable the integrated STP pull-up resistor
++ * used for interface protection.
++ *
++ * May not need to be here.
++ */
++ omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (PHY_STP_PULLUP_DISABLE),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
++ /* Force PHY to HS */
++ omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (0x40),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
+ /* Configure TLL for 60Mhz clk for ULPI */
+ ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
+ if (IS_ERR(ehci_clocks->usbtll_fck_clk))
+@@ -307,7 +346,9 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+ * Hold the PHY in RESET for enough time till PHY is settled and ready
+ */
+ udelay(EXT_PHY_RESET_DELAY);
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
++#endif
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
+ #endif
+
+@@ -393,7 +434,9 @@ static void omap_stop_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+
+
+ #ifdef EXTERNAL_PHY_RESET
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_free(EXT_PHY_RESET_GPIO_PORT1);
++#endif
+ gpio_free(EXT_PHY_RESET_GPIO_PORT2);
+ #endif
+
+--
+1.6.0.4.790.gaa14a
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch
new file mode 100644
index 0000000000..49045f7bb1
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch
@@ -0,0 +1,90 @@
+From 7efa7cc5b807cb840c62b5bf54bf47181c9b95a6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@openembedded.org>
+Date: Mon, 30 Mar 2009 15:21:37 +0200
+Subject: [PATCH v2] ARM: OMAP: board-ldp: add regulator info to get the microSD slot working again
+
+The ldp board was left behind when other boards got updated. The ldp info was copied from the beagleboard board file and s/beagle/ldp/g
+
+Changes since v1:
+ * dropped vsim portion since only 4 pins are hooked up
+
+Signed-off-by: Koen Kooi <koen@beagleboard.org>
+---
+ arch/arm/mach-omap2/board-ldp.c | 32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
+index 30926b0..19a5c15 100644
+--- a/arch/arm/mach-omap2/board-ldp.c
++++ b/arch/arm/mach-omap2/board-ldp.c
+@@ -22,6 +22,7 @@
+ #include <linux/clk.h>
+ #include <linux/spi/spi.h>
+ #include <linux/spi/ads7846.h>
++#include <linux/regulator/machine.h>
+ #include <linux/i2c/twl4030.h>
+
+ #include <mach/hardware.h>
+@@ -450,7 +451,16 @@ static struct twl4030_script *twl4030_scripts[] __initdata = {
+ &wrst_script,
+ };
+
++static const struct twl4030_resconfig ldp_resconfig[] = {
++ /* disable regulators that u-boot left enabled; the
++ * devices' drivers should be managing these.
++ */
++ { .resource = RES_VMMC1, },
++ { 0, },
++};
++
+ static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
++ .resource_config = ldp_resconfig,
+ .scripts = twl4030_scripts,
+ .size = ARRAY_SIZE(twl4030_scripts),
+ };
+@@ -474,6 +484,25 @@ static struct twl4030_madc_platform_data ldp_madc_data = {
+ .irq_line = 1,
+ };
+
++static struct regulator_consumer_supply ldp_vmmc1_supply = {
++ .supply = "vmmc",
++};
++
++/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
++static struct regulator_init_data ldp_vmmc1 = {
++ .constraints = {
++ .min_uV = 1850000,
++ .max_uV = 3150000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
++ | REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &ldp_vmmc1_supply,
++};
++
+ static struct twl4030_platform_data ldp_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+@@ -483,6 +512,7 @@ static struct twl4030_platform_data ldp_twldata = {
+ .madc = &ldp_madc_data,
+ .usb = &ldp_usb_data,
+ .power = &sdp3430_t2scripts_data,
++ .vmmc1 = &ldp_vmmc1,
+ .gpio = &ldp_gpio_data,
+ .keypad = &ldp_kp_twl4030_data,
+ };
+@@ -530,6 +560,8 @@ static void __init omap_ldp_init(void)
+ omap_serial_init();
+ usb_musb_init();
+ twl4030_mmc_init(mmc);
++ /* link regulators to MMC adapters */
++ ldp_vmmc1_supply.dev = mmc[0].dev;
+ }
+
+ static void __init omap_ldp_map_io(void)
+--
+1.6.2
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch
new file mode 100644
index 0000000000..7852f0afdb
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch
@@ -0,0 +1,287 @@
+From 8a7643b09856f4f661403dcedbe0455b3cbeeea9 Mon Sep 17 00:00:00 2001
+From: Steven Newbury <s_j_newbury@yahoo.co.uk>
+Date: Fri, 22 May 2009 14:25:40 +0200
+Subject: [PATCH] implement TIF_RESTORE_SIGMASK support and enable the related
+ syscalls:
+
+pselect6
+ppoll
+epoll_pwait
+
+Based on http://www.spinics.net/lists/arm-kernel/msg38114.html
+---
+ arch/arm/include/asm/thread_info.h | 2 +
+ arch/arm/include/asm/unistd.h | 7 ++-
+ arch/arm/kernel/calls.S | 6 +-
+ arch/arm/kernel/signal.c | 90 +++++++++++++++---------------------
+ 4 files changed, 46 insertions(+), 59 deletions(-)
+
+diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
+index 4f88482..2cf0917 100644
+--- a/arch/arm/include/asm/thread_info.h
++++ b/arch/arm/include/asm/thread_info.h
+@@ -136,6 +136,7 @@ extern void vfp_sync_state(struct thread_info *thread);
+ #define TIF_SIGPENDING 0
+ #define TIF_NEED_RESCHED 1
+ #define TIF_SYSCALL_TRACE 8
++#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
+ #define TIF_POLLING_NRFLAG 16
+ #define TIF_USING_IWMMXT 17
+ #define TIF_MEMDIE 18
+@@ -144,6 +145,7 @@ extern void vfp_sync_state(struct thread_info *thread);
+ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
+ #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
+ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
++#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
+ #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
+ #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
+ #define _TIF_FREEZE (1 << TIF_FREEZE)
+diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
+index 94cc58e..cd1eaa0 100644
+--- a/arch/arm/include/asm/unistd.h
++++ b/arch/arm/include/asm/unistd.h
+@@ -360,8 +360,8 @@
+ #define __NR_readlinkat (__NR_SYSCALL_BASE+332)
+ #define __NR_fchmodat (__NR_SYSCALL_BASE+333)
+ #define __NR_faccessat (__NR_SYSCALL_BASE+334)
+- /* 335 for pselect6 */
+- /* 336 for ppoll */
++#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
++#define __NR_ppoll (__NR_SYSCALL_BASE+336)
+ #define __NR_unshare (__NR_SYSCALL_BASE+337)
+ #define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
+ #define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
+@@ -372,7 +372,7 @@
+ #define __NR_vmsplice (__NR_SYSCALL_BASE+343)
+ #define __NR_move_pages (__NR_SYSCALL_BASE+344)
+ #define __NR_getcpu (__NR_SYSCALL_BASE+345)
+- /* 346 for epoll_pwait */
++#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
+ #define __NR_kexec_load (__NR_SYSCALL_BASE+347)
+ #define __NR_utimensat (__NR_SYSCALL_BASE+348)
+ #define __NR_signalfd (__NR_SYSCALL_BASE+349)
+@@ -430,6 +430,7 @@
+ #define __ARCH_WANT_SYS_SIGPENDING
+ #define __ARCH_WANT_SYS_SIGPROCMASK
+ #define __ARCH_WANT_SYS_RT_SIGACTION
++#define __ARCH_WANT_SYS_RT_SIGSUSPEND
+
+ #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
+ #define __ARCH_WANT_SYS_TIME
+diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
+index 1680e9e..534000d 100644
+--- a/arch/arm/kernel/calls.S
++++ b/arch/arm/kernel/calls.S
+@@ -344,8 +344,8 @@
+ CALL(sys_readlinkat)
+ CALL(sys_fchmodat)
+ CALL(sys_faccessat)
+-/* 335 */ CALL(sys_ni_syscall) /* eventually pselect6 */
+- CALL(sys_ni_syscall) /* eventually ppoll */
++/* 335 */ CALL(sys_pselect6)
++ CALL(sys_ppoll)
+ CALL(sys_unshare)
+ CALL(sys_set_robust_list)
+ CALL(sys_get_robust_list)
+@@ -355,7 +355,7 @@
+ CALL(sys_vmsplice)
+ CALL(sys_move_pages)
+ /* 345 */ CALL(sys_getcpu)
+- CALL(sys_ni_syscall) /* eventually epoll_pwait */
++ CALL(sys_epoll_pwait)
+ CALL(sys_kexec_load)
+ CALL(sys_utimensat)
+ CALL(sys_signalfd)
+diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
+index 80b8b5c..7645048 100644
+--- a/arch/arm/kernel/signal.c
++++ b/arch/arm/kernel/signal.c
+@@ -47,57 +47,23 @@ const unsigned long sigreturn_codes[7] = {
+ MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN,
+ };
+
+-static int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall);
++static void do_signal(struct pt_regs * regs, int syscall);
+
+ /*
+ * atomically swap in the new signal mask, and wait for a signal.
+ */
+-asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask, struct pt_regs *regs)
++asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask)
+ {
+- sigset_t saveset;
+-
+ mask &= _BLOCKABLE;
+ spin_lock_irq(&current->sighand->siglock);
+- saveset = current->blocked;
++ current->saved_sigmask = current->blocked;
+ siginitset(&current->blocked, mask);
+ recalc_sigpending();
+ spin_unlock_irq(&current->sighand->siglock);
+- regs->ARM_r0 = -EINTR;
+-
+- while (1) {
+- current->state = TASK_INTERRUPTIBLE;
+- schedule();
+- if (do_signal(&saveset, regs, 0))
+- return regs->ARM_r0;
+- }
+-}
+-
+-asmlinkage int
+-sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs *regs)
+-{
+- sigset_t saveset, newset;
+-
+- /* XXX: Don't preclude handling different sized sigset_t's. */
+- if (sigsetsize != sizeof(sigset_t))
+- return -EINVAL;
+-
+- if (copy_from_user(&newset, unewset, sizeof(newset)))
+- return -EFAULT;
+- sigdelsetmask(&newset, ~_BLOCKABLE);
+-
+- spin_lock_irq(&current->sighand->siglock);
+- saveset = current->blocked;
+- current->blocked = newset;
+- recalc_sigpending();
+- spin_unlock_irq(&current->sighand->siglock);
+- regs->ARM_r0 = -EINTR;
+-
+- while (1) {
+- current->state = TASK_INTERRUPTIBLE;
+- schedule();
+- if (do_signal(&saveset, regs, 0))
+- return regs->ARM_r0;
+- }
++ current->state = TASK_INTERRUPTIBLE;
++ schedule();
++ set_thread_flag(TIF_RESTORE_SIGMASK);
++ return -ERESTARTNOHAND;
+ }
+
+ asmlinkage int
+@@ -290,7 +256,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
+
+ badframe:
+ force_sig(SIGSEGV, current);
+- return 0;
++ return -EFAULT;
+ }
+
+ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
+@@ -325,7 +291,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
+
+ badframe:
+ force_sig(SIGSEGV, current);
+- return 0;
++ return -EFAULT;
+ }
+
+ static int
+@@ -541,7 +507,7 @@ static inline void restart_syscall(struct pt_regs *regs)
+ /*
+ * OK, we're invoking a handler
+ */
+-static void
++static int
+ handle_signal(unsigned long sig, struct k_sigaction *ka,
+ siginfo_t *info, sigset_t *oldset,
+ struct pt_regs * regs, int syscall)
+@@ -592,7 +558,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
+
+ if (ret != 0) {
+ force_sigsegv(sig, tsk);
+- return;
++ return ret;
+ }
+
+ /*
+@@ -606,6 +572,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
+ recalc_sigpending();
+ spin_unlock_irq(&tsk->sighand->siglock);
+
++ return ret;
+ }
+
+ /*
+@@ -617,11 +584,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
+ * the kernel can handle, and then we build all the user-level signal handling
+ * stack-frames in one go after that.
+ */
+-static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
++static void do_signal(struct pt_regs *regs, int syscall)
+ {
+ struct k_sigaction ka;
+ siginfo_t info;
+ int signr;
++ sigset_t *oldset;
+
+ /*
+ * We want the common case to go fast, which
+@@ -630,18 +598,29 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
+ * if so.
+ */
+ if (!user_mode(regs))
+- return 0;
++ return;
+
+ if (try_to_freeze())
+ goto no_signal;
+
+ single_step_clear(current);
+
++ if (test_thread_flag(TIF_RESTORE_SIGMASK))
++ oldset = &current->saved_sigmask;
++ else
++ oldset = &current->blocked;
++
+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+ if (signr > 0) {
+- handle_signal(signr, &ka, &info, oldset, regs, syscall);
++ if (handle_signal(signr, &ka, &info, oldset, regs, syscall) == 0) {
++ /* a signal was successfully delivered; the saved
++ * sigmask will have been stored in the signal frame,
++ * and will be restored by sigreturn, so we can simply
++ * clear the TIF_RESTORE_SIGMASK flag */
++ clear_thread_flag(TIF_RESTORE_SIGMASK);
++ }
+ single_step_set(current);
+- return 1;
++ return;
+ }
+
+ no_signal:
+@@ -665,7 +644,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
+ usp = (u32 __user *)regs->ARM_sp;
+
+ /*
+- * Either we supports OABI only, or we have
++ * Either we support OABI only, or we have
+ * EABI with the OABI compat layer enabled.
+ * In the later case we don't know if user
+ * space is EABI or not, and if not we must
+@@ -695,12 +674,17 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
+ }
+ }
+ single_step_set(current);
+- return 0;
++ /* if there's no signal to deliver, we just put the saved sigmask
++ back. */
++ if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
++ clear_thread_flag(TIF_RESTORE_SIGMASK);
++ sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
++ }
+ }
+
+ asmlinkage void
+ do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall)
+ {
+- if (thread_flags & _TIF_SIGPENDING)
+- do_signal(&current->blocked, regs, syscall);
++ if (thread_flags & (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK))
++ do_signal(regs, syscall);
+ }
+--
+1.6.2.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/0124-leds-gpio-broken-with-current-git.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/0124-leds-gpio-broken-with-current-git.patch
new file mode 100644
index 0000000000..dc6e190e89
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/0124-leds-gpio-broken-with-current-git.patch
@@ -0,0 +1,79 @@
+From c810e850d830330cf04225a4cff8e981e153f269 Mon Sep 17 00:00:00 2001
+From: David Brownell <david-b@pacbell.net>
+Date: Mon, 23 Feb 2009 14:08:14 -0800
+Subject: [PATCH 124/133] leds-gpio broken with current git?
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+On Monday 23 February 2009, David Brownell wrote:
+>
+> > Perhaps something broke with Tony's RC1 merge?
+> > The LEDs are broken for me as well.
+>
+> Still works for me.  Did you maybe not enable the twl4030
+> GPIO support in Kconfig?
+
+Oh, and if you did *not*, please give this patch a try.
+I've been meaning to test it.
+
+- Dave
+
+==============
+Sometimes it's awkward to make sure that the array in the
+platform_data handed to the leds-gpio driver has only valid
+data ... some leds may not be always available, and coping
+with that currently requires patching or rebuilding the array.
+
+This patch fixes that by making it be OK to pass an invalid
+GPIO (such as "-EINVAL") ... such table entries are skipped.
+---
+ drivers/leds/leds-gpio.c | 12 +++++++++++-
+ 1 files changed, 11 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
+index b13bd29..83737e6 100644
+--- a/drivers/leds/leds-gpio.c
++++ b/drivers/leds/leds-gpio.c
+@@ -90,13 +90,19 @@ static int gpio_led_probe(struct platform_device *pdev)
+ cur_led = &pdata->leds[i];
+ led_dat = &leds_data[i];
+
++ /* skip leds that aren't available */
++ led_dat->gpio = cur_led->gpio;
++ if (!gpio_is_valid(led_dat->gpio)) {
++ dev_dbg(&pdev->dev, "skipping %s\n", cur_led->name);
++ continue;
++ }
++
+ ret = gpio_request(cur_led->gpio, cur_led->name);
+ if (ret < 0)
+ goto err;
+
+ led_dat->cdev.name = cur_led->name;
+ led_dat->cdev.default_trigger = cur_led->default_trigger;
+- led_dat->gpio = cur_led->gpio;
+ led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
+ led_dat->active_low = cur_led->active_low;
+ if (pdata->gpio_blink_set) {
+@@ -124,6 +130,8 @@ static int gpio_led_probe(struct platform_device *pdev)
+ err:
+ if (i > 0) {
+ for (i = i - 1; i >= 0; i--) {
++ if (!gpio_is_valid(leds_data[i].gpio))
++ continue;
+ led_classdev_unregister(&leds_data[i].cdev);
+ cancel_work_sync(&leds_data[i].work);
+ gpio_free(leds_data[i].gpio);
+@@ -144,6 +152,8 @@ static int __devexit gpio_led_remove(struct platform_device *pdev)
+ leds_data = platform_get_drvdata(pdev);
+
+ for (i = 0; i < pdata->num_leds; i++) {
++ if (!gpio_is_valid(leds_data[i].gpio))
++ continue;
+ led_classdev_unregister(&leds_data[i].cdev);
+ cancel_work_sync(&leds_data[i].work);
+ gpio_free(leds_data[i].gpio);
+--
+1.6.0.4.790.gaa14a
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/ads7846-detection.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/ads7846-detection.patch
new file mode 100644
index 0000000000..25a1cb052c
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/ads7846-detection.patch
@@ -0,0 +1,41 @@
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 2ae5ab8..a68b0a6 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -1154,9 +1154,16 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ /* take a first sample, leaving nPENIRQ active and vREF off; avoid
+ * the touchscreen, in case it's not connected.
+ */
+- (void) ads7846_read12_ser(&spi->dev,
++ err = ads7846_read12_ser(&spi->dev,
+ READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
+
++ /* if sample is all 0's or all 1's then there is no device on spi */
++ if ( (err == 0x000) || (err == 0xfff)) {
++ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
++ err = -ENODEV;
++ goto err_free_irq;
++ }
++
+ err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
+ if (err)
+ goto err_remove_hwmon;
+@@ -1174,7 +1181,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ err_free_irq:
+ free_irq(spi->irq, ts);
+ err_free_gpio:
+- if (ts->gpio_pendown != -1)
++ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
+ gpio_free(ts->gpio_pendown);
+ err_cleanup_filter:
+ if (ts->filter_cleanup)
+@@ -1201,7 +1208,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
+ /* suspend left the IRQ disabled */
+ enable_irq(ts->spi->irq);
+
+- if (ts->gpio_pendown != -1)
++ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
+ gpio_free(ts->gpio_pendown);
+
+ if (ts->filter_cleanup)
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/beagle-asoc.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/beagle-asoc.patch
new file mode 100644
index 0000000000..b2b920037e
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/beagle-asoc.patch
@@ -0,0 +1,35 @@
+diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
+index 4f7f040..ccd8973 100644
+--- a/sound/soc/omap/Kconfig
++++ b/sound/soc/omap/Kconfig
+@@ -55,3 +55,13 @@ config SND_OMAP_SOC_OMAP3_PANDORA
+ select SND_SOC_TWL4030
+ help
+ Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
++
++config SND_OMAP_SOC_OMAP3_BEAGLE
++ tristate "SoC Audio support for OMAP3 Beagle"
++ depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_BEAGLE
++ select SND_OMAP_SOC_MCBSP
++ select SND_SOC_TWL4030
++ help
++ Say Y if you want to add support for SoC audio on the Beagleboard.
++
++
+diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
+index 76fedd9..0c9e4ac 100644
+--- a/sound/soc/omap/Makefile
++++ b/sound/soc/omap/Makefile
+@@ -12,6 +12,7 @@ snd-soc-overo-objs := overo.o
+ snd-soc-omap2evm-objs := omap2evm.o
+ snd-soc-sdp3430-objs := sdp3430.o
+ snd-soc-omap3pandora-objs := omap3pandora.o
++snd-soc-omap3beagle-objs := omap3beagle.o
+
+ obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
+ obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
+@@ -19,3 +20,4 @@ obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
+ obj-$(CONFIG_MACH_OMAP2EVM) += snd-soc-omap2evm.o
+ obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
+ obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
++obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/defconfig
new file mode 100644
index 0000000000..7bb7f39d9f
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/defconfig
@@ -0,0 +1,2741 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Thu Jul 16 15:21:36 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=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=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+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 is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+# CONFIG_OMAP_SMARTREFLEX is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+CONFIG_OMAP_IOMMU=y
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=12
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+CONFIG_MACH_OMAP3EVM=y
+CONFIG_MACH_OMAP3_BEAGLE=y
+CONFIG_MACH_OVERO=y
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_ARM_ERRATUM_451034 is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=m
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+# CONFIG_DEFAULT_BIC is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_MIP6=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_DCCP=m
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+# CONFIG_NETFILTER_TPROXY is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+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
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+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_TIME=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+CONFIG_IP_VS_DEBUG=y
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_IDLETIMER=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_DCCP=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=y
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+# CONFIG_TIPC_ADVANCED is not set
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# 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=m
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_MULTIQ=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_DRR=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FLOW=m
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=m
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+# CONFIG_ACT200L_DONGLE is not set
+CONFIG_KINGSUN_DONGLE=m
+CONFIG_KSDAZZLE_DONGLE=m
+CONFIG_KS959_DONGLE=m
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_MCS_FIR=m
+# CONFIG_OMAP_IR is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTSDIO=y
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+CONFIG_BT_HCIBFUSB=y
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+# CONFIG_PHONET is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=y
+CONFIG_LIB80211_CRYPT_WEP=y
+CONFIG_LIB80211_CRYPT_CCMP=y
+CONFIG_LIB80211_CRYPT_TKIP=y
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_WIMAX=m
+CONFIG_WIMAX_DEBUG_LEVEL=8
+# CONFIG_RFKILL is not set
+CONFIG_NET_9P=m
+# CONFIG_NET_9P_DEBUG is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+CONFIG_EEPROM_93CX6=y
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+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=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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=m
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+CONFIG_ISCSI_TCP=m
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_MACVLAN=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_VETH=m
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+CONFIG_LIBERTAS=y
+CONFIG_LIBERTAS_USB=y
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=y
+CONFIG_USB_NET_RNDIS_WLAN=y
+CONFIG_RTL8187=y
+# CONFIG_MAC80211_HWSIM is not set
+CONFIG_P54_COMMON=y
+CONFIG_P54_USB=y
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=y
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_B43=y
+CONFIG_B43_LEDS=y
+# CONFIG_B43_DEBUG is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_ZD1211RW=y
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_RT2X00=y
+CONFIG_RT2500USB=y
+CONFIG_RT73USB=y
+CONFIG_RT2X00_LIB_USB=y
+CONFIG_RT2X00_LIB=y
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+
+#
+# WiMAX Wireless Broadband devices
+#
+# CONFIG_WIMAX_I2400M_USB is not set
+# CONFIG_WIMAX_I2400M_SDIO is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=y
+CONFIG_USB_KAWETH=y
+CONFIG_USB_PEGASUS=y
+CONFIG_USB_RTL8150=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_DM9601=y
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_GL620A=y
+CONFIG_USB_NET_NET1080=y
+CONFIG_USB_NET_PLUSB=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=y
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOATM is not set
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=y
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_TWL4030 is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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 is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_TWL4030_PWRBUTTON=n
+CONFIG_INPUT_UINPUT=y
+
+#
+# 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWEROFF=y
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_TSL2563 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_OMAP24XX is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_TWL4030_BCI_BATTERY is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S 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_LM70 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_LTC4245 is not set
+# CONFIG_SENSORS_MAX1111 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_ADS7828 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=y
+# CONFIG_SSB_SILENT is not set
+# CONFIG_SSB_DEBUG is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+# CONFIG_TWL4030_POWER is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_DMA_SG=m
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DVB=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_IR_I2C=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_VIVI=m
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+CONFIG_VIDEO_OMAP3=m
+CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=m
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_STV06XX=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+CONFIG_USB_GSPCA_MARS=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_OV534=m
+CONFIG_USB_GSPCA_PAC207=m
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_STK014=m
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+CONFIG_DVB_DYNAMIC_MINORS=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_DW2102=m
+CONFIG_DVB_USB_CINERGY_T2=m
+CONFIG_DVB_USB_ANYSEE=m
+CONFIG_DVB_USB_DTV5100=m
+CONFIG_DVB_USB_AF9015=m
+CONFIG_DVB_SIANO_SMS1XXX=m
+CONFIG_DVB_SIANO_SMS1XXX_SMS_IDS=y
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+CONFIG_DVB_STB0899=m
+CONFIG_DVB_STB6100=m
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_STV0288=m
+CONFIG_DVB_STB6000=m
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_TDA8261=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TUNER_CX24113=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+CONFIG_DVB_CX24116=m
+CONFIG_DVB_SI21XX=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_DRX397XD=m
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_OR51211=m
+CONFIG_DVB_OR51132=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_LGDT3304=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+CONFIG_DVB_S921=m
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+# CONFIG_DVB_ISL6405 is not set
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_LGS8GL5=m
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+CONFIG_DVB_AF9013=m
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# 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_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C=m
+# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
+# CONFIG_PANEL_N800 is not set
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=m
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=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
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+# CONFIG_SND_OMAP_SOC_OVERO is not set
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL4030=y
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+CONFIG_GREENASIA_FF=y
+CONFIG_HID_TOPSEED=y
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_OMAP_EHCI_PHY_MODE=y
+# CONFIG_OMAP_EHCI_TLL_MODE is not set
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_OXU210HP_HCD=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_U132_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+CONFIG_USB_TMC=m
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_OPTICON=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_BERRY_CHARGE=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+# CONFIG_USB_APPLEDISPLAY is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_TEST=m
+# CONFIG_USB_ISIGHTFW is not set
+CONFIG_USB_VST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ZERO_HNPTEST=y
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_USB_G_PRINTER=m
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=m
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+CONFIG_LEDS_OMAP=y
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+CONFIG_REGULATOR_TWL4030=y
+CONFIG_UIO=m
+CONFIG_UIO_PDRV=m
+CONFIG_UIO_PDRV_GENIRQ=m
+# CONFIG_UIO_SMX is not set
+# CONFIG_UIO_SERCOS3 is not set
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_MEILHAUS is not set
+# CONFIG_USB_IP_COMMON is not set
+CONFIG_W35UND=m
+CONFIG_PRISM2_USB=m
+# CONFIG_ECHO is not set
+CONFIG_USB_ATMEL=m
+# CONFIG_AGNX is not set
+CONFIG_OTUS=m
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_INPUT_MIMIO is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_LOGGER=m
+CONFIG_ANDROID_RAM_CONSOLE=y
+CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y
+# CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION is not set
+# CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT is not set
+CONFIG_ANDROID_TIMED_GPIO=m
+CONFIG_ANDROID_LOW_MEMORY_KILLER=y
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+CONFIG_EXT4_FS=m
+# CONFIG_EXT4DEV_COMPAT is not set
+CONFIG_EXT4_FS_XATTR=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+# CONFIG_REISERFS_FS_POSIX_ACL is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_DLM=m
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_FS_O2CB=m
+CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
+CONFIG_OCFS2_FS_STATS=y
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_FS_POSIX_ACL is not set
+CONFIG_BTRFS_FS=m
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+# CONFIG_ECRYPT_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+CONFIG_CRAMFS=m
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+CONFIG_VXFS_FS=m
+CONFIG_MINIX_FS=m
+CONFIG_OMFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+CONFIG_CIFS_EXPERIMENTAL=y
+# CONFIG_CIFS_DFS_UPCALL is not set
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_CODA_FS=m
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=n
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_FIPS=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/ehci.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/ehci.patch
new file mode 100644
index 0000000000..5a8c84471b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/ehci.patch
@@ -0,0 +1,131 @@
+Index: git/arch/arm/mach-omap2/board-omap3beagle.c
+===================================================================
+--- git.orig/arch/arm/mach-omap2/board-omap3beagle.c
++++ git/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -154,6 +154,7 @@ static int beagle_twl_gpio_setup(struct
+ * power switch and overcurrent detect
+ */
+
++#if 0 /* TODO: This needs to be modified to not rely on u-boot */
+ gpio_request(gpio + 1, "EHCI_nOC");
+ gpio_direction_input(gpio + 1);
+
+@@ -163,7 +164,7 @@ static int beagle_twl_gpio_setup(struct
+
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+-
++#endif
+ return 0;
+ }
+
+Index: git/arch/arm/mach-omap2/usb-ehci.c
+===================================================================
+--- git.orig/arch/arm/mach-omap2/usb-ehci.c
++++ git/arch/arm/mach-omap2/usb-ehci.c
+@@ -147,9 +147,11 @@ static void setup_ehci_io_mux(void)
+
+ void __init usb_ehci_init(void)
+ {
++#if 0 /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
+ /* Setup Pin IO MUX for EHCI */
+ if (cpu_is_omap34xx())
+ setup_ehci_io_mux();
++#endif
+
+ if (platform_device_register(&ehci_device) < 0) {
+ printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
+Index: git/drivers/usb/host/ehci-omap.c
+===================================================================
+--- git.orig/drivers/usb/host/ehci-omap.c
++++ git/drivers/usb/host/ehci-omap.c
+@@ -48,16 +48,25 @@
+ * to get the PHY state machine in working state
+ */
+ #define EXTERNAL_PHY_RESET
++#ifdef CONFIG_MACH_OMAP3_BEAGLE
++#define EXT_PHY_RESET_GPIO_PORT2 (147)
++#else
+ #define EXT_PHY_RESET_GPIO_PORT1 (57)
+ #define EXT_PHY_RESET_GPIO_PORT2 (61)
++#endif
+ #define EXT_PHY_RESET_DELAY (10)
+
++#define PHY_STP_PULLUP_ENABLE (0x10)
++#define PHY_STP_PULLUP_DISABLE (0x90)
++
+ /* ISSUE2:
+ * USBHOST supports External charge pump PHYs only
+ * Use the VBUS from Port1 to power VBUS of Port2 externally
+ * So use Port2 as the working ULPI port
+ */
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ #define VBUS_INTERNAL_CHARGEPUMP_HACK
++#endif
+
+ #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
+
+@@ -225,14 +234,43 @@ static int omap_start_ehc(struct platfor
+
+ #ifdef EXTERNAL_PHY_RESET
+ /* Refer: ISSUE1 */
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
++#endif
+ gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
++ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
+ /* Hold the PHY in RESET for enough time till DIR is high */
+ udelay(EXT_PHY_RESET_DELAY);
+ #endif
+
++ /*
++ * The PHY register 0x7 - Interface Control register is
++ * configured to disable the integrated STP pull-up resistor
++ * used for interface protection.
++ *
++ * May not need to be here.
++ */
++ omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (PHY_STP_PULLUP_DISABLE),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
++ /* Force PHY to HS */
++ omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (0x40),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
+ /* Configure TLL for 60Mhz clk for ULPI */
+ ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
+ if (IS_ERR(ehci_clocks->usbtll_fck_clk))
+@@ -307,7 +345,9 @@ static int omap_start_ehc(struct platfor
+ * Hold the PHY in RESET for enough time till PHY is settled and ready
+ */
+ udelay(EXT_PHY_RESET_DELAY);
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
++#endif
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
+ #endif
+
+@@ -393,7 +433,9 @@ static void omap_stop_ehc(struct platfor
+
+
+ #ifdef EXTERNAL_PHY_RESET
++#ifndef CONFIG_MACH_OMAP3_BEAGLE
+ gpio_free(EXT_PHY_RESET_GPIO_PORT1);
++#endif
+ gpio_free(EXT_PHY_RESET_GPIO_PORT2);
+ #endif
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/logo_linux_clut224.ppm b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/logo_linux_clut224.ppm
new file mode 100644
index 0000000000..d29fc1c544
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/logo_linux_clut224.ppm
@@ -0,0 +1,73147 @@
+P3
+# CREATOR: GIMP PNM Filter Version 1.1
+387 63
+255
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+250
+139
+73
+247
+143
+74
+247
+143
+74
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+143
+74
+250
+139
+73
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+53
+248
+138
+64
+250
+139
+73
+247
+143
+74
+247
+143
+74
+250
+139
+73
+248
+138
+64
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+60
+248
+138
+64
+247
+143
+74
+247
+143
+74
+247
+143
+74
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+130
+60
+250
+139
+73
+247
+143
+74
+247
+143
+74
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+111
+26
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+60
+248
+138
+64
+247
+143
+74
+247
+143
+74
+247
+143
+74
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+130
+53
+247
+130
+60
+250
+139
+73
+249
+146
+83
+249
+152
+92
+249
+159
+103
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+247
+165
+111
+247
+165
+111
+249
+159
+103
+249
+152
+92
+249
+146
+83
+250
+139
+73
+247
+130
+60
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+247
+143
+74
+247
+150
+84
+246
+156
+93
+249
+159
+103
+249
+159
+103
+246
+156
+93
+247
+150
+84
+250
+139
+73
+247
+130
+60
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+123
+41
+248
+138
+64
+247
+143
+74
+249
+152
+92
+249
+159
+103
+249
+159
+103
+249
+159
+103
+246
+156
+93
+247
+150
+84
+250
+139
+73
+247
+130
+53
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+248
+138
+64
+249
+146
+83
+249
+152
+92
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+152
+92
+249
+146
+83
+248
+138
+64
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+248
+138
+64
+247
+143
+74
+249
+152
+92
+249
+159
+103
+249
+159
+103
+249
+159
+103
+246
+156
+93
+247
+150
+84
+250
+139
+73
+247
+130
+53
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+60
+250
+139
+73
+247
+150
+84
+249
+159
+103
+247
+165
+111
+249
+174
+124
+248
+180
+134
+252
+185
+144
+240
+181
+138
+219
+170
+138
+219
+170
+138
+230
+173
+136
+240
+181
+138
+248
+180
+134
+249
+174
+124
+247
+165
+111
+249
+159
+103
+249
+146
+83
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+130
+60
+247
+143
+74
+249
+159
+103
+214
+151
+109
+121
+100
+85
+65
+67
+64
+74
+68
+68
+129
+102
+78
+214
+151
+109
+246
+156
+93
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+123
+41
+248
+138
+64
+249
+146
+83
+249
+159
+103
+204
+141
+99
+102
+91
+75
+65
+67
+64
+81
+77
+76
+146
+111
+88
+238
+159
+107
+249
+152
+92
+250
+139
+73
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+248
+138
+64
+247
+150
+84
+245
+162
+103
+162
+125
+96
+81
+77
+76
+55
+66
+67
+99
+90
+79
+187
+140
+108
+249
+159
+103
+247
+150
+84
+248
+138
+64
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+123
+41
+248
+138
+64
+249
+146
+83
+249
+159
+103
+187
+140
+108
+102
+91
+75
+58
+69
+70
+76
+78
+76
+146
+111
+88
+238
+159
+107
+249
+152
+92
+250
+139
+73
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+53
+248
+138
+64
+249
+146
+83
+249
+159
+103
+251
+168
+115
+248
+180
+134
+239
+182
+144
+186
+157
+134
+124
+111
+99
+82
+69
+65
+65
+58
+56
+55
+48
+48
+65
+58
+56
+65
+58
+56
+65
+58
+56
+99
+90
+79
+158
+130
+108
+230
+173
+136
+250
+176
+132
+247
+165
+111
+249
+152
+92
+247
+143
+74
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+250
+139
+73
+246
+156
+93
+214
+151
+109
+74
+68
+68
+56
+64
+60
+95
+87
+59
+88
+82
+59
+56
+64
+60
+81
+77
+76
+238
+159
+107
+249
+152
+92
+248
+138
+64
+247
+130
+53
+246
+116
+28
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+187
+140
+108
+51
+62
+63
+69
+69
+61
+95
+87
+59
+83
+78
+61
+48
+58
+59
+121
+100
+85
+247
+165
+111
+247
+150
+84
+248
+138
+64
+247
+123
+41
+246
+116
+28
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+130
+60
+247
+150
+84
+247
+165
+111
+139
+115
+96
+48
+58
+59
+95
+78
+64
+118
+86
+65
+81
+73
+62
+48
+58
+59
+162
+125
+96
+249
+159
+103
+249
+146
+83
+247
+130
+60
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+187
+140
+108
+48
+58
+59
+76
+70
+64
+118
+86
+65
+95
+78
+64
+51
+62
+63
+121
+100
+85
+247
+165
+111
+247
+150
+84
+248
+138
+64
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+247
+143
+74
+249
+152
+92
+247
+165
+111
+250
+176
+132
+251
+192
+154
+167
+142
+123
+65
+58
+56
+35
+31
+30
+71
+60
+43
+108
+87
+46
+129
+106
+52
+137
+110
+49
+156
+125
+62
+187
+166
+150
+129
+106
+52
+101
+83
+47
+59
+50
+39
+55
+48
+48
+139
+115
+96
+240
+181
+138
+249
+174
+124
+249
+159
+103
+247
+143
+74
+247
+130
+53
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+130
+60
+247
+150
+84
+247
+165
+111
+124
+111
+99
+56
+64
+60
+137
+110
+49
+171
+129
+45
+171
+129
+45
+129
+106
+52
+51
+62
+63
+162
+125
+96
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+245
+169
+119
+81
+77
+76
+69
+69
+61
+152
+119
+47
+171
+129
+45
+171
+129
+45
+105
+93
+60
+48
+58
+59
+187
+140
+108
+249
+159
+103
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+130
+53
+250
+139
+73
+249
+159
+103
+210
+156
+119
+51
+62
+63
+112
+85
+63
+234
+126
+45
+234
+126
+45
+225
+124
+48
+95
+78
+64
+63
+74
+74
+234
+168
+124
+246
+156
+93
+250
+139
+73
+247
+123
+41
+246
+116
+28
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+245
+169
+119
+81
+77
+76
+81
+73
+62
+212
+120
+56
+234
+126
+45
+234
+126
+45
+135
+94
+64
+41
+58
+57
+187
+140
+108
+249
+159
+103
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+249
+146
+83
+249
+159
+103
+249
+174
+124
+249
+189
+146
+236
+186
+153
+99
+90
+79
+47
+40
+38
+85
+71
+43
+145
+114
+49
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+160
+120
+43
+195
+167
+113
+216
+194
+154
+168
+127
+42
+168
+127
+42
+123
+102
+54
+59
+50
+39
+82
+69
+65
+230
+173
+136
+249
+174
+124
+249
+159
+103
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+246
+156
+93
+245
+169
+119
+84
+85
+82
+83
+78
+61
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+75
+74
+61
+101
+100
+92
+249
+174
+124
+246
+156
+93
+248
+138
+64
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+210
+156
+119
+48
+58
+59
+105
+93
+60
+171
+129
+45
+158
+125
+46
+161
+127
+40
+152
+119
+47
+62
+63
+61
+139
+115
+96
+251
+168
+115
+247
+150
+84
+247
+130
+60
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+249
+146
+83
+247
+165
+111
+158
+130
+108
+51
+62
+63
+188
+112
+56
+234
+125
+52
+224
+123
+55
+234
+126
+45
+163
+104
+61
+48
+58
+59
+210
+156
+119
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+247
+165
+111
+210
+156
+119
+55
+66
+67
+146
+97
+64
+234
+126
+45
+224
+123
+55
+234
+125
+52
+199
+115
+54
+62
+63
+61
+139
+115
+96
+251
+168
+115
+247
+150
+84
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+249
+146
+83
+249
+159
+103
+250
+176
+132
+219
+170
+138
+150
+125
+114
+65
+58
+56
+24
+22
+23
+59
+50
+39
+152
+119
+47
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+160
+120
+43
+158
+125
+46
+227
+196
+175
+192
+155
+91
+160
+120
+43
+171
+129
+45
+158
+125
+46
+85
+71
+43
+65
+58
+56
+219
+170
+138
+249
+174
+124
+246
+156
+93
+250
+139
+73
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+247
+103
+7
+246
+109
+10
+246
+116
+28
+247
+130
+53
+247
+143
+74
+249
+159
+103
+230
+173
+136
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+252
+185
+144
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+203
+161
+131
+43
+57
+62
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+133
+120
+107
+250
+176
+132
+246
+156
+93
+248
+138
+64
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+154
+133
+118
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+186
+157
+134
+250
+176
+132
+246
+156
+93
+250
+139
+73
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+250
+139
+73
+246
+156
+93
+249
+174
+124
+209
+171
+139
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+133
+120
+107
+249
+174
+124
+246
+156
+93
+248
+138
+64
+247
+123
+41
+247
+111
+26
+246
+109
+10
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+250
+176
+132
+158
+130
+108
+47
+40
+38
+59
+50
+39
+85
+71
+43
+85
+71
+43
+59
+50
+39
+35
+31
+30
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+152
+119
+47
+192
+155
+91
+224
+207
+180
+158
+125
+46
+160
+120
+43
+168
+127
+42
+171
+129
+45
+71
+60
+43
+82
+69
+65
+239
+182
+144
+249
+174
+124
+249
+152
+92
+248
+138
+64
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+249
+146
+83
+247
+165
+111
+239
+182
+144
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+250
+197
+158
+250
+176
+132
+249
+159
+103
+247
+143
+74
+247
+130
+60
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+60
+249
+146
+83
+249
+159
+103
+248
+180
+134
+212
+173
+150
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+137
+127
+115
+248
+180
+134
+249
+159
+103
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+130
+53
+250
+139
+73
+249
+159
+103
+250
+176
+132
+167
+142
+123
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+187
+166
+150
+249
+189
+146
+251
+168
+115
+249
+152
+92
+250
+139
+73
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+53
+248
+138
+64
+247
+150
+84
+247
+165
+111
+252
+185
+144
+212
+173
+150
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+133
+120
+107
+248
+180
+134
+249
+159
+103
+250
+139
+73
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+103
+7
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+250
+139
+73
+249
+159
+103
+250
+176
+132
+167
+142
+123
+24
+22
+23
+85
+71
+43
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+85
+71
+43
+35
+31
+30
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+152
+119
+47
+216
+194
+154
+195
+167
+113
+152
+119
+47
+158
+125
+46
+168
+127
+42
+158
+125
+46
+59
+50
+39
+139
+115
+96
+252
+185
+144
+247
+165
+111
+247
+150
+84
+247
+130
+60
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+60
+247
+150
+84
+251
+168
+115
+236
+186
+153
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+251
+209
+178
+249
+189
+146
+249
+174
+124
+249
+159
+103
+249
+146
+83
+248
+138
+64
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+248
+138
+64
+247
+143
+74
+246
+156
+93
+249
+174
+124
+251
+192
+154
+207
+178
+158
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+249
+189
+146
+247
+165
+111
+247
+150
+84
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+123
+41
+247
+130
+60
+247
+143
+74
+249
+159
+103
+252
+185
+144
+167
+142
+123
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+51
+62
+63
+187
+166
+150
+250
+200
+166
+248
+180
+134
+247
+165
+111
+249
+152
+92
+247
+143
+74
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+60
+250
+139
+73
+249
+152
+92
+247
+165
+111
+248
+180
+134
+250
+197
+158
+207
+178
+158
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+252
+185
+144
+249
+159
+103
+247
+143
+74
+247
+130
+53
+246
+116
+28
+246
+109
+10
+247
+103
+7
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+247
+150
+84
+251
+168
+115
+230
+173
+136
+47
+40
+38
+59
+50
+39
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+161
+127
+40
+171
+129
+45
+59
+50
+39
+71
+60
+43
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+152
+119
+47
+170
+137
+67
+239
+227
+208
+170
+137
+67
+160
+120
+43
+158
+125
+46
+171
+129
+45
+123
+102
+54
+47
+40
+38
+209
+171
+139
+248
+180
+134
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+123
+41
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+130
+60
+247
+150
+84
+249
+174
+124
+236
+186
+153
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+255
+215
+190
+253
+204
+176
+249
+189
+146
+249
+174
+124
+247
+165
+111
+246
+156
+93
+249
+146
+83
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+123
+41
+246
+116
+28
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+250
+139
+73
+247
+143
+74
+249
+146
+83
+247
+150
+84
+249
+146
+83
+249
+146
+83
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+250
+139
+73
+247
+143
+74
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+143
+74
+247
+143
+74
+250
+139
+73
+250
+139
+73
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+60
+250
+139
+73
+247
+143
+74
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+143
+74
+247
+143
+74
+247
+143
+74
+247
+143
+74
+247
+150
+84
+249
+159
+103
+249
+174
+124
+252
+185
+144
+250
+200
+166
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+251
+192
+154
+249
+174
+124
+246
+156
+93
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+60
+248
+138
+64
+250
+139
+73
+247
+143
+74
+249
+146
+83
+247
+150
+84
+249
+146
+83
+249
+146
+83
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+60
+250
+139
+73
+247
+150
+84
+251
+168
+115
+249
+189
+146
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+187
+166
+150
+253
+212
+188
+250
+197
+158
+248
+180
+134
+251
+168
+115
+249
+159
+103
+247
+150
+84
+247
+143
+74
+250
+139
+73
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+250
+139
+73
+247
+143
+74
+249
+146
+83
+247
+150
+84
+247
+150
+84
+249
+146
+83
+247
+143
+74
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+109
+10
+246
+109
+10
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+53
+247
+130
+60
+248
+138
+64
+247
+143
+74
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+143
+74
+247
+143
+74
+247
+143
+74
+250
+139
+73
+250
+139
+73
+250
+139
+73
+248
+138
+64
+248
+138
+64
+248
+138
+64
+248
+138
+64
+248
+138
+64
+248
+138
+64
+250
+139
+73
+250
+139
+73
+250
+139
+73
+250
+139
+73
+247
+143
+74
+247
+143
+74
+250
+139
+73
+250
+139
+73
+248
+138
+64
+248
+138
+64
+247
+130
+60
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+60
+247
+130
+60
+248
+138
+64
+250
+139
+73
+247
+143
+74
+247
+150
+84
+249
+159
+103
+251
+168
+115
+248
+180
+134
+250
+197
+158
+253
+212
+188
+207
+178
+158
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+249
+189
+146
+247
+165
+111
+247
+143
+74
+247
+130
+53
+246
+116
+28
+246
+109
+10
+247
+103
+7
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+111
+26
+247
+118
+39
+247
+123
+41
+247
+130
+53
+247
+130
+60
+250
+139
+73
+247
+143
+74
+249
+146
+83
+247
+150
+84
+247
+150
+84
+249
+146
+83
+247
+143
+74
+250
+139
+73
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+118
+39
+247
+118
+39
+247
+118
+39
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+248
+138
+64
+248
+138
+64
+250
+139
+73
+250
+139
+73
+247
+143
+74
+247
+143
+74
+250
+139
+73
+250
+139
+73
+248
+138
+64
+247
+130
+60
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+60
+248
+138
+64
+250
+139
+73
+247
+143
+74
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+143
+74
+247
+143
+74
+250
+139
+73
+250
+139
+73
+248
+138
+64
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+252
+185
+144
+139
+115
+96
+35
+31
+30
+129
+106
+52
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+117
+98
+55
+35
+31
+30
+152
+119
+47
+168
+127
+42
+168
+127
+42
+160
+120
+43
+168
+127
+42
+171
+129
+45
+152
+119
+47
+216
+194
+154
+224
+207
+180
+160
+120
+43
+160
+120
+43
+137
+110
+49
+102
+91
+75
+35
+31
+30
+115
+102
+92
+250
+200
+166
+250
+176
+132
+249
+159
+103
+249
+146
+83
+247
+130
+60
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+116
+28
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+236
+186
+153
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+255
+215
+190
+255
+215
+190
+253
+204
+176
+250
+197
+158
+252
+185
+144
+249
+174
+124
+251
+168
+115
+249
+159
+103
+246
+156
+93
+247
+150
+84
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+249
+146
+83
+249
+152
+92
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+249
+159
+103
+247
+150
+84
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+246
+116
+28
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+60
+250
+139
+73
+249
+146
+83
+249
+152
+92
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+247
+165
+111
+247
+165
+111
+249
+159
+103
+249
+159
+103
+246
+156
+93
+247
+150
+84
+249
+146
+83
+247
+143
+74
+248
+138
+64
+247
+130
+60
+247
+130
+60
+247
+130
+60
+248
+138
+64
+250
+139
+73
+249
+146
+83
+249
+152
+92
+249
+159
+103
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+247
+165
+111
+249
+159
+103
+247
+165
+111
+251
+168
+115
+250
+176
+132
+252
+185
+144
+250
+200
+166
+255
+215
+190
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+137
+127
+115
+250
+200
+166
+250
+176
+132
+247
+165
+111
+249
+152
+92
+247
+150
+84
+249
+146
+83
+247
+150
+84
+249
+152
+92
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+249
+159
+103
+246
+156
+93
+247
+150
+84
+247
+143
+74
+250
+139
+73
+247
+143
+74
+249
+146
+83
+249
+159
+103
+249
+174
+124
+251
+192
+154
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+173
+106
+60
+51
+62
+63
+187
+166
+150
+255
+215
+190
+253
+212
+188
+250
+200
+166
+249
+189
+146
+248
+180
+134
+249
+174
+124
+247
+165
+111
+249
+159
+103
+249
+152
+92
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+246
+116
+28
+247
+111
+26
+246
+116
+28
+247
+118
+39
+247
+123
+41
+247
+130
+53
+248
+138
+64
+247
+143
+74
+249
+152
+92
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+249
+159
+103
+249
+152
+92
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+53
+248
+138
+64
+247
+143
+74
+247
+150
+84
+249
+159
+103
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+247
+165
+111
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+246
+156
+93
+246
+156
+93
+246
+156
+93
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+152
+92
+249
+152
+92
+247
+150
+84
+249
+146
+83
+249
+146
+83
+249
+146
+83
+247
+150
+84
+249
+152
+92
+246
+156
+93
+249
+159
+103
+247
+165
+111
+249
+174
+124
+250
+176
+132
+249
+189
+146
+250
+200
+166
+253
+212
+188
+255
+215
+190
+207
+178
+158
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+249
+189
+146
+247
+165
+111
+247
+143
+74
+247
+130
+53
+246
+116
+28
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+53
+248
+138
+64
+247
+143
+74
+247
+150
+84
+249
+159
+103
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+249
+159
+103
+249
+152
+92
+249
+146
+83
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+60
+248
+138
+64
+247
+143
+74
+249
+146
+83
+249
+152
+92
+246
+156
+93
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+249
+159
+103
+246
+156
+93
+249
+152
+92
+247
+150
+84
+249
+146
+83
+247
+143
+74
+247
+143
+74
+247
+143
+74
+249
+146
+83
+247
+150
+84
+246
+156
+93
+249
+159
+103
+247
+165
+111
+247
+165
+111
+251
+168
+115
+251
+168
+115
+251
+168
+115
+247
+165
+111
+247
+165
+111
+247
+165
+111
+249
+159
+103
+249
+159
+103
+246
+156
+93
+247
+150
+84
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+103
+7
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+236
+186
+153
+47
+40
+38
+59
+50
+39
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+47
+40
+38
+108
+87
+46
+168
+127
+42
+111
+94
+57
+76
+70
+64
+59
+50
+39
+101
+83
+47
+160
+120
+43
+170
+137
+67
+253
+255
+252
+195
+167
+113
+145
+114
+49
+69
+69
+61
+120
+114
+108
+35
+31
+30
+47
+40
+38
+217
+187
+166
+250
+197
+158
+250
+176
+132
+249
+159
+103
+249
+146
+83
+248
+138
+64
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+250
+139
+73
+246
+156
+93
+250
+176
+132
+232
+190
+161
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+255
+215
+190
+255
+215
+190
+245
+212
+186
+227
+196
+175
+212
+173
+150
+209
+171
+139
+219
+170
+138
+240
+181
+138
+250
+176
+132
+251
+168
+115
+249
+159
+103
+247
+150
+84
+250
+139
+73
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+53
+247
+130
+53
+248
+138
+64
+249
+146
+83
+246
+156
+93
+247
+165
+111
+249
+174
+124
+248
+180
+134
+240
+181
+138
+219
+170
+138
+203
+161
+131
+203
+161
+131
+219
+170
+138
+240
+181
+138
+250
+176
+132
+249
+174
+124
+249
+159
+103
+249
+152
+92
+247
+143
+74
+247
+130
+60
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+53
+248
+138
+64
+249
+146
+83
+246
+156
+93
+247
+165
+111
+249
+174
+124
+245
+179
+138
+230
+173
+136
+203
+161
+131
+203
+161
+131
+219
+170
+138
+239
+182
+144
+251
+192
+154
+249
+189
+146
+252
+185
+144
+252
+185
+144
+248
+180
+134
+245
+169
+119
+234
+168
+124
+247
+165
+111
+249
+159
+103
+249
+152
+92
+247
+150
+84
+247
+150
+84
+247
+150
+84
+249
+152
+92
+249
+159
+103
+247
+165
+111
+249
+174
+124
+248
+180
+134
+230
+173
+136
+219
+170
+138
+203
+161
+131
+209
+171
+139
+239
+182
+144
+251
+192
+154
+249
+189
+146
+249
+189
+146
+252
+185
+144
+252
+185
+144
+249
+189
+146
+236
+186
+153
+250
+200
+166
+255
+215
+190
+255
+215
+190
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+137
+127
+115
+253
+204
+176
+252
+185
+144
+249
+174
+124
+247
+165
+111
+247
+165
+111
+247
+165
+111
+251
+168
+115
+249
+174
+124
+248
+180
+134
+230
+173
+136
+219
+170
+138
+203
+161
+131
+209
+171
+139
+230
+173
+136
+245
+179
+138
+250
+176
+132
+251
+168
+115
+249
+159
+103
+249
+159
+103
+246
+156
+93
+249
+159
+103
+251
+168
+115
+248
+180
+134
+250
+197
+158
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+173
+106
+60
+51
+62
+63
+187
+166
+150
+255
+215
+190
+255
+215
+190
+234
+204
+183
+207
+178
+158
+209
+171
+139
+209
+171
+139
+230
+173
+136
+248
+180
+134
+249
+174
+124
+247
+165
+111
+249
+152
+92
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+248
+138
+64
+247
+143
+74
+249
+152
+92
+247
+165
+111
+249
+174
+124
+248
+180
+134
+240
+181
+138
+219
+170
+138
+203
+161
+131
+203
+161
+131
+219
+170
+138
+240
+181
+138
+248
+180
+134
+249
+174
+124
+247
+165
+111
+249
+152
+92
+247
+143
+74
+248
+138
+64
+247
+130
+53
+247
+123
+41
+247
+123
+41
+247
+123
+41
+247
+130
+53
+247
+130
+60
+247
+143
+74
+249
+152
+92
+249
+159
+103
+249
+174
+124
+250
+176
+132
+240
+181
+138
+219
+170
+138
+203
+161
+131
+203
+161
+131
+230
+173
+136
+251
+192
+154
+249
+189
+146
+249
+189
+146
+252
+185
+144
+252
+185
+144
+248
+180
+134
+234
+168
+124
+250
+176
+132
+248
+180
+134
+250
+176
+132
+250
+176
+132
+250
+176
+132
+248
+180
+134
+248
+180
+134
+230
+173
+136
+240
+181
+138
+252
+185
+144
+252
+185
+144
+252
+185
+144
+252
+185
+144
+248
+180
+134
+234
+168
+124
+234
+168
+124
+249
+174
+124
+251
+168
+115
+247
+165
+111
+247
+165
+111
+247
+165
+111
+251
+168
+115
+249
+174
+124
+250
+176
+132
+248
+180
+134
+230
+173
+136
+219
+170
+138
+209
+171
+139
+207
+178
+158
+227
+196
+175
+253
+212
+188
+255
+215
+190
+217
+187
+166
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+249
+189
+146
+247
+165
+111
+247
+143
+74
+247
+130
+53
+246
+116
+28
+247
+111
+26
+246
+109
+10
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+247
+143
+74
+249
+152
+92
+249
+159
+103
+249
+174
+124
+248
+180
+134
+240
+181
+138
+219
+170
+138
+203
+161
+131
+203
+161
+131
+219
+170
+138
+240
+181
+138
+248
+180
+134
+249
+174
+124
+247
+165
+111
+249
+159
+103
+247
+150
+84
+249
+146
+83
+247
+143
+74
+247
+143
+74
+249
+146
+83
+249
+152
+92
+249
+159
+103
+247
+165
+111
+234
+168
+124
+234
+168
+124
+248
+180
+134
+252
+185
+144
+252
+185
+144
+252
+185
+144
+248
+180
+134
+250
+176
+132
+234
+168
+124
+249
+174
+124
+251
+168
+115
+247
+165
+111
+247
+165
+111
+249
+159
+103
+247
+165
+111
+251
+168
+115
+249
+174
+124
+250
+176
+132
+248
+180
+134
+230
+173
+136
+203
+161
+131
+203
+161
+131
+219
+170
+138
+239
+182
+144
+251
+192
+154
+249
+189
+146
+252
+185
+144
+252
+185
+144
+248
+180
+134
+234
+168
+124
+238
+159
+107
+247
+165
+111
+249
+152
+92
+247
+143
+74
+247
+130
+60
+247
+123
+41
+246
+116
+28
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+130
+53
+247
+143
+74
+247
+165
+111
+252
+185
+144
+154
+133
+118
+24
+22
+23
+108
+87
+46
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+71
+60
+43
+85
+71
+43
+101
+83
+47
+89
+84
+82
+152
+147
+147
+24
+22
+23
+24
+22
+23
+108
+87
+46
+168
+127
+42
+224
+207
+180
+253
+255
+252
+209
+171
+139
+101
+83
+47
+24
+22
+23
+35
+31
+30
+35
+31
+30
+167
+142
+123
+253
+212
+188
+250
+197
+158
+248
+180
+134
+247
+165
+111
+247
+150
+84
+250
+139
+73
+247
+130
+60
+247
+130
+60
+248
+138
+64
+249
+146
+83
+249
+159
+103
+250
+176
+132
+232
+190
+161
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+97
+98
+96
+217
+187
+166
+137
+127
+115
+91
+92
+89
+55
+66
+67
+48
+58
+59
+48
+58
+59
+55
+66
+67
+84
+85
+82
+133
+120
+107
+209
+171
+139
+248
+180
+134
+251
+168
+115
+249
+159
+103
+247
+150
+84
+247
+143
+74
+250
+139
+73
+250
+139
+73
+249
+146
+83
+249
+152
+92
+247
+165
+111
+249
+174
+124
+245
+179
+138
+178
+146
+122
+124
+111
+99
+76
+78
+76
+51
+62
+63
+48
+58
+59
+48
+58
+59
+58
+69
+70
+91
+92
+89
+144
+125
+110
+203
+161
+131
+248
+180
+134
+249
+174
+124
+249
+159
+103
+247
+150
+84
+247
+143
+74
+248
+138
+64
+248
+138
+64
+250
+139
+73
+249
+146
+83
+246
+156
+93
+247
+165
+111
+250
+176
+132
+230
+173
+136
+154
+133
+118
+101
+100
+92
+58
+69
+70
+48
+58
+59
+48
+58
+59
+51
+62
+63
+84
+85
+82
+137
+127
+115
+217
+187
+166
+253
+212
+188
+227
+196
+175
+144
+125
+110
+89
+84
+82
+81
+77
+76
+115
+102
+92
+210
+156
+119
+249
+174
+124
+251
+168
+115
+251
+168
+115
+251
+168
+115
+249
+174
+124
+250
+176
+132
+252
+185
+144
+195
+157
+134
+124
+111
+99
+76
+78
+76
+51
+62
+63
+48
+58
+59
+48
+58
+59
+70
+79
+77
+120
+114
+108
+187
+166
+150
+253
+212
+188
+253
+212
+188
+172
+150
+134
+101
+100
+92
+77
+85
+81
+101
+100
+92
+176
+156
+141
+255
+215
+190
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+253
+212
+188
+250
+197
+158
+252
+185
+144
+248
+180
+134
+248
+180
+134
+252
+185
+144
+239
+182
+144
+167
+142
+123
+109
+106
+99
+70
+79
+77
+48
+58
+59
+48
+58
+59
+48
+58
+59
+58
+69
+70
+91
+92
+89
+150
+125
+114
+219
+170
+138
+248
+180
+134
+249
+174
+124
+249
+174
+124
+249
+174
+124
+250
+176
+132
+249
+189
+146
+253
+204
+176
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+176
+156
+141
+187
+166
+150
+109
+106
+99
+63
+74
+74
+43
+57
+62
+43
+57
+62
+43
+57
+62
+63
+74
+74
+109
+106
+99
+178
+146
+122
+245
+179
+138
+249
+174
+124
+249
+159
+103
+247
+150
+84
+247
+143
+74
+248
+138
+64
+248
+138
+64
+248
+138
+64
+247
+143
+74
+247
+150
+84
+249
+159
+103
+249
+174
+124
+252
+185
+144
+195
+157
+134
+124
+111
+99
+77
+85
+81
+51
+62
+63
+41
+58
+57
+43
+57
+62
+51
+62
+63
+77
+85
+81
+124
+111
+99
+195
+157
+134
+252
+185
+144
+249
+174
+124
+249
+159
+103
+247
+150
+84
+247
+143
+74
+248
+138
+64
+247
+130
+60
+248
+138
+64
+250
+139
+73
+247
+150
+84
+249
+159
+103
+251
+168
+115
+248
+180
+134
+203
+161
+131
+124
+111
+99
+77
+85
+81
+48
+58
+59
+43
+57
+62
+43
+57
+62
+63
+74
+74
+109
+106
+99
+187
+166
+150
+253
+212
+188
+253
+212
+188
+187
+166
+150
+109
+106
+99
+77
+85
+81
+84
+85
+82
+150
+125
+114
+232
+190
+161
+253
+204
+176
+253
+204
+176
+172
+150
+134
+101
+100
+92
+77
+85
+81
+91
+92
+89
+137
+127
+115
+227
+196
+175
+253
+212
+188
+186
+157
+134
+109
+106
+99
+77
+85
+81
+84
+85
+82
+124
+111
+99
+219
+170
+138
+249
+189
+146
+249
+189
+146
+249
+189
+146
+251
+192
+154
+250
+197
+158
+186
+157
+134
+109
+106
+99
+70
+79
+77
+43
+57
+62
+43
+57
+62
+41
+58
+57
+63
+74
+74
+101
+100
+92
+176
+156
+141
+194
+173
+157
+55
+66
+67
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+249
+189
+146
+247
+165
+111
+247
+143
+74
+247
+130
+53
+247
+118
+39
+247
+111
+26
+246
+109
+10
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+249
+146
+83
+249
+159
+103
+249
+174
+124
+252
+185
+144
+203
+161
+131
+133
+120
+107
+84
+85
+82
+55
+66
+67
+43
+57
+62
+41
+58
+57
+51
+62
+63
+77
+85
+81
+124
+111
+99
+178
+146
+122
+239
+182
+144
+250
+176
+132
+249
+174
+124
+247
+165
+111
+249
+159
+103
+249
+159
+103
+247
+165
+111
+249
+174
+124
+210
+156
+119
+124
+111
+99
+77
+85
+81
+77
+85
+81
+109
+106
+99
+194
+173
+157
+253
+212
+188
+217
+187
+166
+133
+120
+107
+89
+84
+82
+76
+78
+76
+101
+100
+92
+178
+146
+122
+249
+189
+146
+252
+185
+144
+252
+185
+144
+252
+185
+144
+251
+192
+154
+236
+186
+153
+167
+142
+123
+101
+100
+92
+63
+74
+74
+41
+58
+57
+43
+57
+62
+51
+62
+63
+77
+85
+81
+137
+127
+115
+217
+187
+166
+253
+212
+188
+227
+196
+175
+144
+125
+110
+84
+85
+82
+76
+78
+76
+115
+102
+92
+204
+141
+99
+249
+159
+103
+247
+143
+74
+247
+130
+60
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+250
+197
+158
+82
+69
+65
+47
+40
+38
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+101
+83
+47
+59
+50
+39
+101
+83
+47
+24
+22
+23
+35
+31
+30
+24
+22
+23
+24
+22
+23
+108
+87
+46
+168
+127
+42
+195
+167
+113
+253
+255
+252
+253
+255
+252
+239
+227
+208
+186
+157
+134
+162
+125
+96
+105
+93
+60
+47
+40
+38
+150
+125
+114
+217
+187
+166
+250
+200
+166
+252
+185
+144
+251
+168
+115
+246
+156
+93
+249
+146
+83
+247
+143
+74
+249
+146
+83
+249
+152
+92
+247
+165
+111
+252
+185
+144
+232
+190
+161
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+55
+66
+67
+58
+69
+70
+56
+64
+60
+83
+78
+61
+105
+93
+60
+117
+98
+55
+117
+98
+55
+105
+93
+60
+83
+78
+61
+56
+64
+60
+55
+66
+67
+144
+125
+110
+239
+182
+144
+250
+176
+132
+247
+165
+111
+249
+159
+103
+246
+156
+93
+249
+159
+103
+247
+165
+111
+249
+174
+124
+252
+185
+144
+195
+157
+134
+89
+84
+82
+48
+58
+59
+63
+69
+60
+95
+87
+59
+111
+94
+57
+123
+102
+54
+117
+98
+55
+105
+93
+60
+83
+78
+61
+56
+64
+60
+51
+62
+63
+124
+111
+99
+219
+170
+138
+248
+180
+134
+251
+168
+115
+249
+159
+103
+249
+152
+92
+249
+152
+92
+246
+156
+93
+247
+165
+111
+249
+174
+124
+252
+185
+144
+167
+142
+123
+70
+79
+77
+51
+62
+63
+75
+74
+61
+100
+89
+56
+117
+98
+55
+123
+102
+54
+105
+93
+60
+83
+78
+61
+51
+62
+63
+63
+74
+74
+172
+150
+134
+109
+106
+99
+51
+62
+63
+83
+78
+61
+95
+87
+59
+65
+67
+64
+65
+67
+64
+209
+171
+139
+249
+189
+146
+249
+189
+146
+249
+189
+146
+250
+197
+158
+212
+173
+150
+109
+106
+99
+48
+58
+59
+63
+69
+60
+95
+87
+59
+111
+94
+57
+123
+102
+54
+117
+98
+55
+95
+87
+59
+62
+63
+61
+48
+58
+59
+137
+127
+115
+146
+135
+124
+48
+58
+59
+75
+74
+61
+95
+87
+59
+75
+74
+61
+48
+58
+59
+161
+144
+134
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+255
+215
+190
+251
+209
+178
+250
+200
+166
+250
+200
+166
+250
+200
+166
+172
+150
+134
+77
+85
+81
+48
+58
+59
+69
+69
+61
+95
+87
+59
+111
+94
+57
+123
+102
+54
+117
+98
+55
+100
+89
+56
+75
+74
+61
+56
+64
+60
+55
+66
+67
+133
+120
+107
+236
+186
+153
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+253
+212
+188
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+173
+106
+60
+51
+62
+63
+63
+74
+74
+48
+58
+59
+76
+70
+64
+118
+86
+65
+146
+97
+64
+155
+100
+63
+146
+97
+64
+118
+86
+65
+76
+70
+64
+43
+57
+62
+91
+92
+89
+203
+161
+131
+248
+180
+134
+251
+168
+115
+249
+159
+103
+249
+152
+92
+247
+150
+84
+249
+152
+92
+249
+159
+103
+251
+168
+115
+248
+180
+134
+209
+171
+139
+101
+100
+92
+43
+57
+62
+69
+69
+61
+106
+82
+65
+135
+94
+64
+155
+100
+63
+155
+100
+63
+135
+94
+64
+106
+82
+65
+65
+67
+64
+43
+57
+62
+101
+100
+92
+209
+171
+139
+248
+180
+134
+251
+168
+115
+249
+159
+103
+249
+152
+92
+247
+150
+84
+247
+150
+84
+246
+156
+93
+247
+165
+111
+250
+176
+132
+219
+170
+138
+124
+111
+99
+48
+58
+59
+62
+63
+61
+106
+82
+65
+139
+96
+61
+155
+100
+63
+146
+97
+64
+125
+90
+64
+76
+70
+64
+41
+58
+57
+120
+114
+108
+172
+150
+134
+51
+62
+63
+69
+69
+61
+112
+85
+63
+95
+78
+64
+51
+62
+63
+120
+114
+108
+245
+212
+186
+146
+135
+124
+43
+57
+62
+81
+73
+62
+118
+86
+65
+95
+78
+64
+56
+64
+60
+101
+100
+92
+133
+120
+107
+43
+57
+62
+76
+70
+64
+112
+85
+63
+106
+82
+65
+62
+63
+61
+77
+85
+81
+227
+196
+175
+253
+212
+188
+253
+212
+188
+217
+187
+166
+109
+106
+99
+41
+58
+57
+69
+69
+61
+112
+85
+63
+139
+96
+61
+155
+100
+63
+146
+97
+64
+118
+86
+65
+81
+73
+62
+48
+58
+59
+58
+69
+70
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+111
+26
+246
+116
+28
+247
+123
+41
+248
+138
+64
+249
+146
+83
+249
+159
+103
+250
+176
+132
+219
+170
+138
+124
+111
+99
+43
+57
+62
+62
+63
+61
+106
+82
+65
+135
+94
+64
+155
+100
+63
+155
+100
+63
+139
+96
+61
+106
+82
+65
+69
+69
+61
+43
+57
+62
+91
+92
+89
+195
+157
+134
+251
+192
+154
+252
+185
+144
+248
+180
+134
+248
+180
+134
+252
+185
+144
+203
+161
+131
+63
+74
+74
+62
+63
+61
+106
+82
+65
+112
+85
+63
+69
+69
+61
+55
+66
+67
+146
+135
+124
+63
+74
+74
+56
+64
+60
+95
+78
+64
+112
+85
+63
+76
+70
+64
+48
+58
+59
+172
+150
+134
+253
+204
+176
+251
+209
+178
+251
+209
+178
+187
+166
+150
+77
+85
+81
+48
+58
+59
+81
+73
+62
+125
+90
+64
+146
+97
+64
+155
+100
+63
+139
+96
+61
+95
+78
+64
+56
+64
+60
+58
+69
+70
+161
+144
+134
+109
+106
+99
+51
+62
+63
+95
+78
+64
+112
+85
+63
+65
+67
+64
+65
+67
+64
+204
+141
+99
+246
+156
+93
+250
+139
+73
+247
+130
+53
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+246
+116
+28
+247
+130
+53
+247
+143
+74
+249
+159
+103
+252
+185
+144
+209
+171
+139
+24
+22
+23
+85
+71
+43
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+137
+110
+49
+47
+40
+38
+137
+110
+49
+101
+83
+47
+59
+50
+39
+59
+50
+39
+101
+83
+47
+158
+125
+46
+160
+120
+43
+192
+155
+91
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+237
+233
+225
+152
+147
+147
+81
+77
+76
+55
+48
+48
+115
+102
+92
+212
+173
+150
+251
+192
+154
+249
+174
+124
+247
+165
+111
+249
+159
+103
+249
+159
+103
+247
+165
+111
+249
+174
+124
+249
+189
+146
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+43
+57
+62
+95
+87
+59
+145
+114
+49
+168
+127
+42
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+145
+114
+49
+95
+87
+59
+48
+58
+59
+109
+106
+99
+236
+186
+153
+252
+185
+144
+248
+180
+134
+250
+176
+132
+250
+176
+132
+252
+185
+144
+251
+192
+154
+150
+125
+114
+48
+58
+59
+69
+69
+61
+117
+98
+55
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+152
+119
+47
+100
+89
+56
+56
+64
+60
+63
+74
+74
+186
+157
+134
+249
+189
+146
+248
+180
+134
+249
+174
+124
+249
+174
+124
+250
+176
+132
+252
+185
+144
+251
+192
+154
+133
+120
+107
+48
+58
+59
+75
+74
+61
+137
+110
+49
+168
+127
+42
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+145
+114
+49
+75
+74
+61
+43
+57
+62
+51
+62
+63
+123
+102
+54
+171
+129
+45
+171
+129
+45
+145
+114
+49
+56
+64
+60
+133
+120
+107
+253
+212
+188
+251
+209
+178
+253
+212
+188
+194
+173
+157
+63
+74
+74
+56
+64
+60
+111
+94
+57
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+158
+125
+46
+105
+93
+60
+51
+62
+63
+43
+57
+62
+88
+82
+59
+168
+127
+42
+171
+129
+45
+168
+127
+42
+88
+82
+59
+63
+74
+74
+187
+166
+150
+55
+66
+67
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+133
+120
+107
+48
+58
+59
+75
+74
+61
+129
+106
+52
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+171
+129
+45
+168
+127
+42
+145
+114
+49
+95
+87
+59
+51
+62
+63
+77
+85
+81
+212
+173
+150
+253
+204
+176
+253
+204
+176
+251
+209
+178
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+41
+58
+57
+69
+69
+61
+155
+100
+63
+214
+121
+50
+234
+126
+45
+234
+126
+45
+234
+126
+45
+234
+126
+45
+234
+126
+45
+224
+123
+55
+155
+100
+63
+69
+69
+61
+51
+62
+63
+178
+146
+122
+249
+189
+146
+250
+176
+132
+251
+168
+115
+251
+168
+115
+249
+174
+124
+250
+176
+132
+249
+189
+146
+167
+142
+123
+55
+66
+67
+65
+67
+64
+146
+97
+64
+212
+120
+56
+234
+126
+45
+234
+125
+52
+234
+126
+45
+234
+125
+52
+234
+126
+45
+234
+125
+52
+209
+117
+53
+146
+97
+64
+65
+67
+64
+55
+66
+67
+178
+146
+122
+249
+189
+146
+250
+176
+132
+251
+168
+115
+247
+165
+111
+251
+168
+115
+249
+174
+124
+252
+185
+144
+203
+161
+131
+63
+74
+74
+56
+64
+60
+125
+90
+64
+209
+117
+53
+234
+126
+45
+234
+126
+45
+234
+125
+52
+234
+126
+45
+234
+126
+45
+214
+121
+50
+146
+97
+64
+56
+64
+60
+41
+58
+57
+81
+73
+62
+209
+117
+53
+234
+126
+45
+234
+126
+45
+125
+90
+64
+51
+62
+63
+176
+156
+141
+55
+66
+67
+106
+82
+65
+225
+124
+48
+234
+126
+45
+234
+126
+45
+146
+97
+64
+41
+58
+57
+43
+57
+62
+125
+90
+64
+214
+121
+50
+234
+126
+45
+234
+126
+45
+183
+110
+59
+56
+64
+60
+137
+127
+115
+255
+215
+190
+194
+173
+157
+63
+74
+74
+62
+63
+61
+146
+97
+64
+214
+121
+50
+234
+125
+52
+234
+126
+45
+234
+125
+52
+234
+125
+52
+234
+126
+45
+225
+124
+48
+173
+106
+60
+81
+73
+62
+35
+56
+60
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+247
+130
+53
+247
+118
+39
+246
+116
+28
+246
+116
+28
+247
+123
+41
+247
+130
+60
+249
+146
+83
+247
+165
+111
+248
+180
+134
+186
+157
+134
+58
+69
+70
+56
+64
+60
+135
+94
+64
+199
+115
+54
+234
+125
+52
+234
+126
+45
+234
+125
+52
+234
+125
+52
+234
+126
+45
+234
+125
+52
+212
+120
+56
+155
+100
+63
+76
+70
+64
+51
+62
+63
+146
+135
+124
+251
+209
+178
+253
+204
+176
+250
+200
+166
+253
+204
+176
+101
+100
+92
+69
+69
+61
+194
+112
+58
+234
+126
+45
+234
+126
+45
+199
+115
+54
+65
+67
+64
+35
+56
+60
+81
+73
+62
+194
+112
+58
+234
+125
+52
+234
+126
+45
+214
+121
+50
+95
+78
+64
+63
+74
+74
+238
+205
+179
+255
+215
+190
+161
+144
+134
+43
+57
+62
+81
+73
+62
+173
+106
+60
+225
+124
+48
+234
+126
+45
+234
+126
+45
+234
+125
+52
+234
+126
+45
+234
+126
+45
+194
+112
+58
+95
+78
+64
+41
+58
+57
+48
+58
+59
+155
+100
+63
+234
+126
+45
+234
+126
+45
+199
+115
+54
+69
+69
+61
+99
+90
+79
+251
+168
+115
+247
+150
+84
+247
+130
+60
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+60
+247
+150
+84
+249
+174
+124
+251
+192
+154
+124
+111
+99
+35
+31
+30
+137
+110
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+47
+40
+38
+108
+87
+46
+175
+132
+40
+161
+127
+40
+168
+127
+42
+171
+129
+45
+158
+125
+46
+152
+119
+47
+203
+161
+131
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+186
+181
+179
+89
+84
+82
+47
+40
+38
+139
+115
+96
+236
+186
+153
+252
+185
+144
+250
+176
+132
+249
+174
+124
+250
+176
+132
+252
+185
+144
+250
+197
+158
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+111
+94
+57
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+111
+94
+57
+48
+58
+59
+109
+106
+99
+253
+204
+176
+250
+200
+166
+250
+200
+166
+250
+200
+166
+253
+204
+176
+137
+127
+115
+43
+57
+62
+88
+82
+59
+158
+125
+46
+171
+129
+45
+161
+127
+40
+158
+125
+46
+158
+125
+46
+168
+127
+42
+161
+127
+40
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+145
+114
+49
+69
+69
+61
+51
+62
+63
+187
+166
+150
+250
+200
+166
+250
+197
+158
+251
+192
+154
+250
+197
+158
+253
+204
+176
+133
+120
+107
+48
+58
+59
+95
+87
+59
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+158
+125
+46
+75
+74
+61
+62
+63
+61
+168
+127
+42
+161
+127
+40
+158
+125
+46
+171
+129
+45
+83
+78
+61
+91
+92
+89
+255
+215
+190
+255
+215
+190
+207
+178
+158
+58
+69
+70
+63
+69
+60
+145
+114
+49
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+105
+93
+60
+43
+57
+62
+137
+110
+49
+171
+129
+45
+158
+125
+46
+171
+129
+45
+137
+110
+49
+51
+62
+63
+146
+135
+124
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+152
+119
+47
+65
+67
+64
+137
+127
+115
+255
+215
+190
+255
+215
+190
+245
+212
+186
+120
+114
+108
+48
+58
+59
+100
+89
+56
+168
+127
+42
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+129
+106
+52
+61
+67
+58
+63
+74
+74
+207
+178
+158
+255
+215
+190
+255
+215
+190
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+95
+78
+64
+209
+117
+53
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+209
+117
+53
+89
+75
+66
+51
+62
+63
+187
+166
+150
+250
+197
+158
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+161
+144
+134
+41
+58
+57
+95
+78
+64
+199
+115
+54
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+199
+115
+54
+89
+75
+66
+41
+58
+57
+167
+142
+123
+250
+200
+166
+251
+192
+154
+252
+185
+144
+249
+189
+146
+250
+197
+158
+212
+173
+150
+63
+74
+74
+69
+69
+61
+183
+110
+59
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+163
+104
+61
+41
+58
+57
+135
+94
+64
+234
+126
+45
+224
+123
+55
+234
+125
+52
+188
+112
+56
+51
+62
+63
+109
+106
+99
+51
+62
+63
+188
+112
+56
+234
+126
+45
+224
+123
+55
+234
+125
+52
+188
+112
+56
+43
+57
+62
+112
+85
+63
+234
+126
+45
+227
+126
+50
+224
+123
+55
+227
+126
+50
+234
+126
+45
+95
+78
+64
+109
+106
+99
+217
+187
+166
+58
+69
+70
+69
+69
+61
+188
+112
+56
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+214
+121
+50
+95
+78
+64
+146
+97
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+247
+130
+53
+247
+123
+41
+247
+118
+39
+247
+123
+41
+247
+130
+53
+247
+143
+74
+249
+159
+103
+250
+176
+132
+186
+157
+134
+51
+62
+63
+81
+73
+62
+188
+112
+56
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+212
+120
+56
+106
+82
+65
+41
+58
+57
+146
+135
+124
+255
+215
+190
+255
+215
+190
+234
+204
+183
+63
+74
+74
+125
+90
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+234
+125
+52
+89
+75
+66
+62
+63
+61
+199
+115
+54
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+163
+104
+61
+48
+58
+59
+217
+187
+166
+172
+150
+134
+41
+58
+57
+106
+82
+65
+214
+121
+50
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+225
+124
+48
+81
+73
+62
+69
+69
+61
+227
+126
+50
+227
+126
+50
+224
+123
+55
+238
+123
+45
+125
+90
+64
+55
+66
+67
+250
+176
+132
+246
+156
+93
+250
+139
+73
+247
+123
+41
+247
+111
+26
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+250
+139
+73
+249
+159
+103
+248
+180
+134
+232
+190
+161
+47
+40
+38
+71
+60
+43
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+71
+60
+43
+71
+60
+43
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+160
+120
+43
+170
+137
+67
+237
+233
+225
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+186
+181
+179
+74
+68
+68
+89
+75
+66
+212
+173
+150
+250
+197
+158
+251
+192
+154
+249
+189
+146
+251
+192
+154
+253
+204
+176
+234
+204
+183
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+111
+94
+57
+48
+58
+59
+161
+144
+134
+255
+215
+190
+255
+215
+190
+255
+215
+190
+172
+150
+134
+48
+58
+59
+95
+87
+59
+168
+127
+42
+168
+127
+42
+158
+125
+46
+161
+127
+40
+171
+129
+45
+158
+125
+46
+152
+119
+47
+152
+119
+47
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+152
+119
+47
+69
+69
+61
+58
+69
+70
+217
+187
+166
+255
+215
+190
+255
+215
+190
+255
+215
+190
+172
+150
+134
+43
+57
+62
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+171
+129
+45
+171
+129
+45
+158
+125
+46
+168
+127
+42
+137
+110
+49
+83
+78
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+84
+85
+82
+255
+215
+190
+238
+205
+179
+84
+85
+82
+62
+63
+61
+145
+114
+49
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+161
+127
+40
+158
+125
+46
+88
+82
+59
+152
+119
+47
+161
+127
+40
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+152
+119
+47
+63
+69
+60
+137
+127
+115
+255
+215
+190
+255
+215
+190
+137
+127
+115
+48
+58
+59
+105
+93
+60
+171
+129
+45
+161
+127
+40
+158
+125
+46
+168
+127
+42
+168
+127
+42
+158
+125
+46
+152
+119
+47
+152
+119
+47
+168
+127
+42
+171
+129
+45
+158
+125
+46
+158
+125
+46
+171
+129
+45
+145
+114
+49
+62
+63
+61
+70
+79
+77
+227
+196
+175
+255
+215
+190
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+212
+120
+56
+214
+121
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+234
+126
+45
+234
+126
+45
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+76
+70
+64
+70
+79
+77
+234
+204
+183
+253
+212
+188
+251
+209
+178
+253
+212
+188
+187
+166
+150
+43
+57
+62
+95
+78
+64
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+234
+126
+45
+234
+126
+45
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+214
+121
+50
+95
+78
+64
+48
+58
+59
+194
+173
+157
+253
+212
+188
+251
+209
+178
+251
+209
+178
+245
+212
+186
+91
+92
+89
+62
+63
+61
+188
+112
+56
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+234
+125
+52
+234
+126
+45
+227
+126
+50
+224
+123
+55
+234
+126
+45
+125
+90
+64
+146
+97
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+97
+98
+96
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+212
+120
+56
+183
+110
+59
+214
+121
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+227
+126
+50
+234
+126
+45
+95
+78
+64
+84
+85
+82
+91
+92
+89
+62
+63
+61
+188
+112
+56
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+234
+126
+45
+234
+126
+45
+227
+126
+50
+224
+123
+55
+227
+126
+50
+224
+123
+55
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+123
+41
+247
+123
+41
+247
+130
+53
+248
+138
+64
+249
+152
+92
+249
+174
+124
+209
+171
+139
+58
+69
+70
+81
+73
+62
+209
+117
+53
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+234
+125
+52
+234
+125
+52
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+112
+85
+63
+41
+58
+57
+172
+150
+134
+255
+215
+190
+227
+196
+175
+63
+74
+74
+135
+94
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+194
+112
+58
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+238
+128
+40
+163
+104
+61
+55
+66
+67
+161
+144
+134
+58
+69
+70
+95
+78
+64
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+234
+126
+45
+234
+126
+45
+234
+125
+52
+227
+126
+50
+234
+125
+52
+173
+106
+60
+118
+86
+65
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+146
+97
+64
+51
+62
+63
+252
+185
+144
+249
+159
+103
+247
+143
+74
+247
+130
+53
+246
+116
+28
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+249
+146
+83
+251
+168
+115
+251
+192
+154
+154
+133
+118
+24
+22
+23
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+108
+87
+46
+47
+40
+38
+158
+125
+46
+158
+125
+46
+158
+125
+46
+160
+120
+43
+156
+125
+62
+224
+207
+180
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+152
+147
+147
+35
+31
+30
+55
+48
+48
+154
+133
+118
+217
+187
+166
+253
+204
+176
+253
+204
+176
+253
+212
+188
+234
+204
+183
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+158
+125
+46
+168
+127
+42
+158
+125
+46
+123
+102
+54
+105
+93
+60
+111
+94
+57
+129
+106
+52
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+83
+78
+61
+58
+69
+70
+227
+196
+175
+255
+215
+190
+217
+187
+166
+58
+69
+70
+75
+74
+61
+168
+127
+42
+161
+127
+40
+158
+125
+46
+168
+127
+42
+152
+119
+47
+105
+93
+60
+69
+69
+61
+62
+63
+61
+62
+63
+61
+75
+74
+61
+117
+98
+55
+161
+127
+40
+161
+127
+40
+158
+125
+46
+171
+129
+45
+145
+114
+49
+56
+64
+60
+97
+98
+96
+245
+212
+186
+255
+215
+190
+227
+196
+175
+63
+74
+74
+75
+74
+61
+158
+125
+46
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+158
+125
+46
+129
+106
+52
+111
+94
+57
+105
+93
+60
+129
+106
+52
+158
+125
+46
+168
+127
+42
+161
+127
+40
+152
+119
+47
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+84
+85
+82
+255
+215
+190
+161
+144
+134
+48
+58
+59
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+117
+98
+55
+105
+93
+60
+117
+98
+55
+145
+114
+49
+171
+129
+45
+168
+127
+42
+152
+119
+47
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+255
+215
+190
+194
+173
+157
+48
+58
+59
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+152
+119
+47
+95
+87
+59
+69
+69
+61
+62
+63
+61
+62
+63
+61
+83
+78
+61
+123
+102
+54
+168
+127
+42
+161
+127
+40
+158
+125
+46
+171
+129
+45
+129
+106
+52
+51
+62
+63
+120
+114
+108
+255
+215
+190
+255
+215
+190
+161
+144
+134
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+227
+126
+50
+227
+126
+50
+188
+112
+56
+146
+97
+64
+135
+94
+64
+146
+97
+64
+199
+115
+54
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+173
+106
+60
+48
+58
+59
+146
+135
+124
+255
+215
+190
+255
+215
+190
+234
+204
+183
+77
+85
+81
+76
+70
+64
+214
+121
+50
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+214
+121
+50
+163
+104
+61
+135
+94
+64
+135
+94
+64
+163
+104
+61
+224
+123
+55
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+212
+120
+56
+76
+70
+64
+77
+85
+81
+238
+205
+179
+255
+215
+190
+255
+215
+190
+161
+144
+134
+48
+58
+59
+155
+100
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+199
+115
+54
+155
+100
+63
+135
+94
+64
+146
+97
+64
+188
+112
+56
+227
+126
+50
+227
+126
+50
+214
+121
+50
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+125
+52
+227
+126
+50
+224
+123
+55
+227
+126
+50
+227
+126
+50
+199
+115
+54
+125
+90
+64
+51
+62
+63
+55
+66
+67
+41
+58
+57
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+209
+117
+53
+155
+100
+63
+135
+94
+64
+139
+96
+61
+183
+110
+59
+227
+126
+50
+227
+126
+50
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+247
+130
+60
+247
+130
+53
+247
+130
+53
+247
+130
+60
+249
+146
+83
+247
+165
+111
+252
+185
+144
+101
+100
+92
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+173
+106
+60
+135
+94
+64
+135
+94
+64
+163
+104
+61
+214
+121
+50
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+81
+73
+62
+58
+69
+70
+227
+196
+175
+234
+204
+183
+63
+74
+74
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+234
+125
+52
+212
+120
+56
+155
+100
+63
+69
+69
+61
+76
+78
+76
+84
+85
+82
+65
+67
+64
+209
+117
+53
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+183
+110
+59
+139
+96
+61
+135
+94
+64
+155
+100
+63
+209
+117
+53
+234
+125
+52
+224
+123
+55
+212
+120
+56
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+251
+192
+154
+251
+168
+115
+249
+146
+83
+247
+130
+53
+247
+118
+39
+246
+109
+10
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+250
+176
+132
+232
+190
+161
+65
+58
+56
+59
+50
+39
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+47
+40
+38
+129
+106
+52
+168
+127
+42
+160
+120
+43
+158
+125
+46
+224
+207
+180
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+219
+212
+208
+62
+63
+61
+35
+31
+30
+91
+92
+89
+164
+158
+157
+186
+181
+179
+82
+69
+65
+176
+156
+141
+255
+215
+190
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+65
+67
+64
+48
+58
+59
+55
+66
+67
+55
+66
+67
+48
+58
+59
+83
+78
+61
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+137
+110
+49
+51
+62
+63
+146
+135
+124
+255
+215
+190
+120
+114
+108
+56
+64
+60
+145
+114
+49
+171
+129
+45
+158
+125
+46
+168
+127
+42
+152
+119
+47
+69
+69
+61
+43
+57
+62
+109
+106
+99
+146
+135
+124
+137
+127
+115
+91
+92
+89
+43
+57
+62
+88
+82
+59
+158
+125
+46
+161
+127
+40
+158
+125
+46
+171
+129
+45
+117
+98
+55
+48
+58
+59
+172
+150
+134
+255
+215
+190
+146
+135
+124
+51
+62
+63
+137
+110
+49
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+75
+74
+61
+48
+58
+59
+55
+66
+67
+55
+66
+67
+48
+58
+59
+69
+69
+61
+137
+110
+49
+168
+127
+42
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+234
+204
+183
+70
+79
+77
+83
+78
+61
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+111
+94
+57
+56
+64
+60
+43
+57
+62
+58
+69
+70
+48
+58
+59
+56
+64
+60
+100
+89
+56
+158
+125
+46
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+137
+127
+115
+255
+215
+190
+97
+98
+96
+62
+63
+61
+152
+119
+47
+168
+127
+42
+158
+125
+46
+168
+127
+42
+137
+110
+49
+62
+63
+61
+51
+62
+63
+120
+114
+108
+146
+135
+124
+137
+127
+115
+84
+85
+82
+43
+57
+62
+95
+87
+59
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+100
+89
+56
+43
+57
+62
+194
+173
+157
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+118
+86
+65
+51
+62
+63
+43
+57
+62
+58
+69
+70
+41
+58
+57
+56
+64
+60
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+106
+82
+65
+63
+74
+74
+234
+204
+183
+255
+215
+190
+161
+144
+134
+48
+58
+59
+173
+106
+60
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+183
+110
+59
+76
+70
+64
+43
+57
+62
+55
+66
+67
+55
+66
+67
+48
+58
+59
+81
+73
+62
+183
+110
+59
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+126
+45
+163
+104
+61
+48
+58
+59
+161
+144
+134
+255
+215
+190
+234
+204
+183
+63
+74
+74
+95
+78
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+135
+94
+64
+62
+63
+61
+43
+57
+62
+58
+69
+70
+43
+57
+62
+51
+62
+63
+125
+90
+64
+225
+124
+48
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+97
+98
+96
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+125
+52
+227
+126
+50
+173
+106
+60
+95
+78
+64
+56
+64
+60
+51
+62
+63
+120
+114
+108
+70
+79
+77
+89
+75
+66
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+163
+104
+61
+65
+67
+64
+41
+58
+57
+55
+66
+67
+51
+62
+63
+48
+58
+59
+106
+82
+65
+209
+117
+53
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+249
+146
+83
+248
+138
+64
+247
+130
+53
+247
+130
+60
+250
+139
+73
+246
+156
+93
+250
+176
+132
+186
+157
+134
+41
+58
+57
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+199
+115
+54
+89
+75
+66
+48
+58
+59
+51
+62
+63
+55
+66
+67
+43
+57
+62
+76
+70
+64
+173
+106
+60
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+137
+127
+115
+234
+204
+183
+63
+74
+74
+135
+94
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+199
+115
+54
+125
+90
+64
+69
+69
+61
+41
+58
+57
+97
+98
+96
+146
+135
+124
+51
+62
+63
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+214
+121
+50
+106
+82
+65
+48
+58
+59
+51
+62
+63
+55
+66
+67
+41
+58
+57
+65
+67
+64
+163
+104
+61
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+197
+158
+251
+168
+115
+247
+150
+84
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+246
+116
+28
+247
+130
+53
+247
+143
+74
+249
+159
+103
+252
+185
+144
+154
+133
+118
+24
+22
+23
+108
+87
+46
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+71
+60
+43
+85
+71
+43
+171
+129
+45
+160
+120
+43
+216
+194
+154
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+237
+233
+225
+65
+58
+56
+62
+63
+61
+219
+212
+208
+253
+255
+252
+237
+233
+225
+120
+114
+108
+35
+31
+30
+55
+48
+48
+227
+196
+175
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+51
+62
+63
+84
+85
+82
+187
+166
+150
+227
+196
+175
+227
+196
+175
+161
+144
+134
+51
+62
+63
+69
+69
+61
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+91
+92
+89
+217
+187
+166
+55
+66
+67
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+75
+74
+61
+58
+69
+70
+187
+166
+150
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+161
+144
+134
+43
+57
+62
+100
+89
+56
+171
+129
+45
+158
+125
+46
+158
+125
+46
+161
+127
+40
+75
+74
+61
+84
+85
+82
+234
+204
+183
+76
+78
+76
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+62
+63
+61
+63
+74
+74
+176
+156
+141
+227
+196
+175
+227
+196
+175
+176
+156
+141
+70
+79
+77
+62
+63
+61
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+97
+98
+96
+172
+150
+134
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+105
+93
+60
+43
+57
+62
+120
+114
+108
+207
+178
+158
+227
+196
+175
+217
+187
+166
+120
+114
+108
+41
+58
+57
+95
+87
+59
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+56
+64
+60
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+146
+135
+124
+207
+178
+158
+48
+58
+59
+111
+94
+57
+171
+129
+45
+158
+125
+46
+168
+127
+42
+152
+119
+47
+62
+63
+61
+70
+79
+77
+207
+178
+158
+255
+215
+190
+255
+215
+190
+255
+215
+190
+238
+205
+179
+137
+127
+115
+43
+57
+62
+117
+98
+55
+168
+127
+42
+158
+125
+46
+168
+127
+42
+152
+119
+47
+62
+63
+61
+109
+106
+99
+255
+215
+190
+161
+144
+134
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+106
+82
+65
+41
+58
+57
+137
+127
+115
+217
+187
+166
+227
+196
+175
+207
+178
+158
+109
+106
+99
+41
+58
+57
+146
+97
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+176
+156
+141
+245
+212
+186
+70
+79
+77
+95
+78
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+188
+112
+56
+56
+64
+60
+70
+79
+77
+176
+156
+141
+227
+196
+175
+227
+196
+175
+176
+156
+141
+63
+74
+74
+62
+63
+61
+194
+112
+58
+227
+126
+50
+224
+123
+55
+227
+126
+50
+227
+126
+50
+95
+78
+64
+77
+85
+81
+245
+212
+186
+172
+150
+134
+48
+58
+59
+173
+106
+60
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+135
+94
+64
+35
+56
+60
+120
+114
+108
+207
+178
+158
+227
+196
+175
+217
+187
+166
+133
+120
+107
+35
+56
+60
+118
+86
+65
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+95
+78
+64
+48
+58
+59
+70
+79
+77
+146
+135
+124
+217
+187
+166
+207
+178
+158
+51
+62
+63
+155
+100
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+163
+104
+61
+48
+58
+59
+91
+92
+89
+194
+173
+157
+227
+196
+175
+217
+187
+166
+146
+135
+124
+43
+57
+62
+89
+75
+66
+214
+121
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+247
+165
+111
+247
+150
+84
+248
+138
+64
+247
+130
+60
+248
+138
+64
+249
+146
+83
+247
+165
+111
+239
+182
+144
+91
+92
+89
+76
+70
+64
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+76
+70
+64
+55
+66
+67
+172
+150
+134
+227
+196
+175
+227
+196
+175
+187
+166
+150
+77
+85
+81
+51
+62
+63
+173
+106
+60
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+118
+86
+65
+58
+69
+70
+217
+187
+166
+70
+79
+77
+135
+94
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+225
+124
+48
+125
+90
+64
+56
+64
+60
+55
+66
+67
+120
+114
+108
+187
+166
+150
+245
+212
+186
+120
+114
+108
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+225
+124
+48
+95
+78
+64
+43
+57
+62
+146
+135
+124
+217
+187
+166
+227
+196
+175
+194
+173
+157
+91
+92
+89
+48
+58
+59
+163
+104
+61
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+197
+158
+249
+174
+124
+247
+150
+84
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+249
+146
+83
+251
+168
+115
+239
+182
+144
+65
+58
+56
+59
+50
+39
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+108
+87
+46
+47
+40
+38
+152
+119
+47
+170
+137
+67
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+174
+168
+167
+24
+22
+23
+109
+106
+99
+152
+147
+147
+97
+98
+96
+47
+40
+38
+24
+22
+23
+35
+31
+30
+35
+31
+30
+176
+156
+141
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+76
+78
+76
+227
+196
+175
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+187
+166
+150
+51
+62
+63
+95
+87
+59
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+117
+98
+55
+55
+66
+67
+109
+106
+99
+48
+58
+59
+137
+110
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+117
+98
+55
+48
+58
+59
+187
+166
+150
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+137
+127
+115
+51
+62
+63
+145
+114
+49
+168
+127
+42
+158
+125
+46
+171
+129
+45
+117
+98
+55
+55
+66
+67
+137
+127
+115
+55
+66
+67
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+55
+66
+67
+207
+178
+158
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+217
+187
+166
+58
+69
+70
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+91
+92
+89
+109
+106
+99
+69
+69
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+120
+114
+108
+245
+212
+186
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+137
+127
+115
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+146
+135
+124
+146
+135
+124
+62
+63
+61
+152
+119
+47
+168
+127
+42
+158
+125
+46
+168
+127
+42
+100
+89
+56
+51
+62
+63
+207
+178
+158
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+109
+106
+99
+63
+69
+60
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+100
+89
+56
+51
+62
+63
+227
+196
+175
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+155
+100
+63
+41
+58
+57
+146
+135
+124
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+109
+106
+99
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+224
+123
+55
+76
+70
+64
+109
+106
+99
+194
+173
+157
+43
+57
+62
+163
+104
+61
+234
+125
+52
+224
+123
+55
+224
+123
+55
+225
+124
+48
+89
+75
+66
+63
+74
+74
+217
+187
+166
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+217
+187
+166
+58
+69
+70
+95
+78
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+155
+100
+63
+43
+57
+62
+207
+178
+158
+109
+106
+99
+76
+70
+64
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+51
+62
+63
+120
+114
+108
+253
+212
+188
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+137
+127
+115
+48
+58
+59
+173
+106
+60
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+188
+112
+56
+62
+63
+61
+58
+69
+70
+161
+144
+134
+234
+204
+183
+255
+215
+190
+255
+215
+190
+137
+127
+115
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+212
+120
+56
+69
+69
+61
+77
+85
+81
+234
+204
+183
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+176
+156
+141
+35
+56
+60
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+251
+168
+115
+247
+150
+84
+250
+139
+73
+248
+138
+64
+250
+139
+73
+249
+152
+92
+249
+174
+124
+209
+171
+139
+43
+57
+62
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+112
+85
+63
+51
+62
+63
+194
+173
+157
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+227
+196
+175
+70
+79
+77
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+48
+58
+59
+146
+135
+124
+77
+85
+81
+135
+94
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+214
+121
+50
+95
+78
+64
+35
+56
+60
+120
+114
+108
+217
+187
+166
+255
+215
+190
+255
+215
+190
+227
+196
+175
+58
+69
+70
+125
+90
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+41
+58
+57
+172
+150
+134
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+234
+204
+183
+77
+85
+81
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+51
+62
+63
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+178
+146
+122
+24
+22
+23
+101
+83
+47
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+152
+119
+47
+47
+40
+38
+123
+102
+54
+209
+171
+139
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+164
+158
+157
+24
+22
+23
+24
+22
+23
+24
+22
+23
+24
+22
+23
+24
+22
+23
+35
+31
+30
+35
+31
+30
+47
+40
+38
+194
+173
+157
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+48
+58
+59
+176
+156
+141
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+255
+215
+190
+120
+114
+108
+56
+64
+60
+152
+119
+47
+161
+127
+40
+158
+125
+46
+168
+127
+42
+137
+110
+49
+51
+62
+63
+48
+58
+59
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+63
+74
+74
+194
+173
+157
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+172
+150
+134
+48
+58
+59
+111
+94
+57
+171
+129
+45
+158
+125
+46
+168
+127
+42
+152
+119
+47
+56
+64
+60
+51
+62
+63
+56
+64
+60
+152
+119
+47
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+146
+135
+124
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+146
+135
+124
+51
+62
+63
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+70
+79
+77
+63
+74
+74
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+171
+129
+45
+95
+87
+59
+55
+66
+67
+227
+196
+175
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+234
+204
+183
+70
+79
+77
+88
+82
+59
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+56
+64
+60
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+97
+98
+96
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+84
+85
+82
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+207
+178
+158
+217
+187
+166
+146
+135
+124
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+168
+127
+42
+129
+106
+52
+51
+62
+63
+187
+166
+150
+176
+156
+141
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+89
+75
+66
+70
+79
+77
+245
+212
+186
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+217
+187
+166
+43
+57
+62
+125
+90
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+106
+82
+65
+77
+85
+81
+133
+120
+107
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+48
+58
+59
+161
+144
+134
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+146
+135
+124
+48
+58
+59
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+133
+120
+107
+77
+85
+81
+118
+86
+65
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+125
+90
+64
+55
+66
+67
+227
+196
+175
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+234
+204
+183
+63
+74
+74
+106
+82
+65
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+97
+98
+96
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+224
+123
+55
+89
+75
+66
+63
+74
+74
+217
+187
+166
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+91
+92
+89
+95
+78
+64
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+146
+97
+64
+43
+57
+62
+187
+166
+150
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+255
+215
+190
+101
+100
+92
+76
+70
+64
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+251
+168
+115
+247
+150
+84
+250
+139
+73
+250
+139
+73
+247
+143
+74
+249
+159
+103
+250
+176
+132
+154
+133
+118
+51
+62
+63
+183
+110
+59
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+133
+120
+107
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+176
+156
+141
+43
+57
+62
+163
+104
+61
+234
+125
+52
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+91
+92
+89
+70
+79
+77
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+146
+97
+64
+35
+56
+60
+161
+144
+134
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+194
+173
+157
+48
+58
+59
+163
+104
+61
+234
+126
+45
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+97
+98
+96
+255
+215
+190
+255
+215
+190
+255
+215
+190
+253
+212
+188
+255
+215
+190
+255
+215
+190
+187
+166
+150
+43
+57
+62
+163
+104
+61
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+159
+103
+248
+180
+134
+124
+111
+99
+35
+31
+30
+137
+110
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+59
+50
+39
+85
+71
+43
+216
+194
+154
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+207
+202
+200
+47
+40
+38
+24
+22
+23
+35
+31
+30
+35
+31
+30
+35
+31
+30
+35
+31
+30
+24
+22
+23
+65
+58
+56
+238
+205
+179
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+100
+89
+56
+63
+74
+74
+227
+196
+175
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+251
+209
+178
+255
+215
+190
+194
+173
+157
+48
+58
+59
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+43
+57
+62
+95
+87
+59
+168
+127
+42
+158
+125
+46
+161
+127
+40
+158
+125
+46
+63
+69
+60
+43
+57
+62
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+43
+57
+62
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+75
+74
+61
+43
+57
+62
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+117
+98
+55
+51
+62
+63
+217
+187
+166
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+217
+187
+166
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+48
+58
+59
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+109
+106
+99
+255
+215
+190
+253
+212
+188
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+212
+188
+255
+215
+190
+120
+114
+108
+63
+69
+60
+158
+125
+46
+161
+127
+40
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+120
+114
+108
+70
+79
+77
+105
+93
+60
+171
+129
+45
+158
+125
+46
+168
+127
+42
+152
+119
+47
+56
+64
+60
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+51
+62
+63
+43
+57
+62
+111
+94
+57
+171
+129
+45
+158
+125
+46
+161
+127
+40
+152
+119
+47
+62
+63
+61
+146
+135
+124
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+146
+135
+124
+255
+215
+190
+253
+212
+188
+250
+200
+166
+250
+200
+166
+253
+204
+176
+253
+212
+188
+253
+212
+188
+97
+98
+96
+89
+75
+66
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+139
+96
+61
+51
+62
+63
+63
+74
+74
+89
+75
+66
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+135
+94
+64
+55
+66
+67
+217
+187
+166
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+217
+187
+166
+51
+62
+63
+139
+96
+61
+234
+126
+45
+224
+123
+55
+227
+126
+50
+225
+124
+48
+81
+73
+62
+58
+69
+70
+51
+62
+63
+146
+97
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+224
+123
+55
+81
+73
+62
+109
+106
+99
+255
+215
+190
+253
+212
+188
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+212
+188
+255
+215
+190
+120
+114
+108
+69
+69
+61
+212
+120
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+234
+125
+52
+224
+123
+55
+227
+126
+50
+194
+112
+58
+51
+62
+63
+146
+135
+124
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+234
+204
+183
+70
+79
+77
+118
+86
+65
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+106
+82
+65
+77
+85
+81
+245
+212
+186
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+251
+209
+178
+255
+215
+190
+176
+156
+141
+56
+64
+60
+188
+112
+56
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+251
+168
+115
+249
+152
+92
+247
+143
+74
+247
+143
+74
+247
+150
+84
+249
+159
+103
+248
+180
+134
+120
+114
+108
+69
+69
+61
+212
+120
+56
+227
+126
+50
+224
+123
+55
+234
+125
+52
+155
+100
+63
+43
+57
+62
+194
+173
+157
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+234
+204
+183
+63
+74
+74
+112
+85
+63
+234
+125
+52
+227
+126
+50
+224
+123
+55
+234
+125
+52
+106
+82
+65
+58
+69
+70
+55
+66
+67
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+95
+78
+64
+77
+85
+81
+245
+212
+186
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+48
+58
+59
+172
+150
+134
+255
+215
+190
+251
+209
+178
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+245
+212
+186
+63
+74
+74
+112
+85
+63
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+250
+139
+73
+249
+159
+103
+252
+185
+144
+82
+69
+65
+47
+40
+38
+158
+125
+46
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+85
+71
+43
+59
+50
+39
+216
+194
+154
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+164
+158
+157
+47
+40
+38
+24
+22
+23
+24
+22
+23
+24
+22
+23
+35
+31
+30
+65
+67
+64
+65
+58
+56
+227
+196
+175
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+84
+85
+82
+255
+215
+190
+251
+209
+178
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+200
+166
+253
+212
+188
+227
+196
+175
+58
+69
+70
+105
+93
+60
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+75
+74
+61
+41
+58
+57
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+137
+110
+49
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+41
+58
+57
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+95
+87
+59
+70
+79
+77
+245
+212
+186
+253
+212
+188
+250
+200
+166
+251
+192
+154
+251
+192
+154
+250
+200
+166
+253
+212
+188
+238
+205
+179
+70
+79
+77
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+48
+58
+59
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+168
+127
+42
+152
+119
+47
+56
+64
+60
+146
+135
+124
+255
+215
+190
+253
+204
+176
+250
+197
+158
+251
+192
+154
+251
+192
+154
+253
+204
+176
+255
+215
+190
+172
+150
+134
+51
+62
+63
+145
+114
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+97
+98
+96
+55
+66
+67
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+123
+102
+54
+117
+98
+55
+145
+114
+49
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+137
+127
+115
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+187
+166
+150
+255
+215
+190
+253
+204
+176
+251
+192
+154
+251
+192
+154
+250
+197
+158
+253
+204
+176
+255
+215
+190
+137
+127
+115
+65
+67
+64
+209
+117
+53
+227
+126
+50
+224
+123
+55
+234
+125
+52
+163
+104
+61
+43
+57
+62
+41
+58
+57
+106
+82
+65
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+106
+82
+65
+77
+85
+81
+245
+212
+186
+251
+209
+178
+250
+197
+158
+249
+189
+146
+251
+192
+154
+250
+197
+158
+251
+209
+178
+238
+205
+179
+77
+85
+81
+112
+85
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+106
+82
+65
+41
+58
+57
+48
+58
+59
+163
+104
+61
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+62
+63
+61
+146
+135
+124
+255
+215
+190
+253
+204
+176
+250
+197
+158
+251
+192
+154
+251
+192
+154
+253
+204
+176
+255
+215
+190
+176
+156
+141
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+234
+125
+52
+224
+123
+55
+227
+126
+50
+183
+110
+59
+48
+58
+59
+176
+156
+141
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+227
+196
+175
+58
+69
+70
+139
+96
+61
+234
+125
+52
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+120
+114
+108
+255
+215
+190
+253
+204
+176
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+200
+166
+255
+215
+190
+207
+178
+158
+48
+58
+59
+163
+104
+61
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+192
+154
+249
+174
+124
+246
+156
+93
+247
+150
+84
+249
+146
+83
+249
+152
+92
+251
+168
+115
+249
+189
+146
+97
+98
+96
+89
+75
+66
+225
+124
+48
+227
+126
+50
+224
+123
+55
+234
+126
+45
+125
+90
+64
+58
+69
+70
+227
+196
+175
+253
+212
+188
+250
+200
+166
+251
+192
+154
+249
+189
+146
+250
+197
+158
+251
+209
+178
+255
+215
+190
+97
+98
+96
+89
+75
+66
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+125
+90
+64
+43
+57
+62
+43
+57
+62
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+137
+127
+115
+69
+69
+61
+212
+120
+56
+227
+126
+50
+224
+123
+55
+234
+126
+45
+155
+100
+63
+43
+57
+62
+207
+178
+158
+255
+215
+190
+250
+200
+166
+251
+192
+154
+251
+192
+154
+250
+197
+158
+251
+209
+178
+255
+215
+190
+109
+106
+99
+89
+75
+66
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+143
+74
+249
+159
+103
+252
+185
+144
+55
+48
+48
+59
+50
+39
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+156
+125
+62
+101
+83
+47
+59
+50
+39
+209
+171
+139
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+219
+212
+208
+137
+127
+115
+101
+100
+92
+120
+114
+108
+186
+181
+179
+152
+147
+147
+55
+48
+48
+227
+196
+175
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+97
+98
+96
+255
+215
+190
+253
+204
+176
+251
+192
+154
+249
+189
+146
+249
+189
+146
+250
+197
+158
+251
+209
+178
+234
+204
+183
+70
+79
+77
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+161
+127
+40
+75
+74
+61
+41
+58
+57
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+75
+74
+61
+41
+58
+57
+88
+82
+59
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+88
+82
+59
+77
+85
+81
+245
+212
+186
+251
+209
+178
+250
+197
+158
+249
+189
+146
+249
+189
+146
+250
+197
+158
+251
+209
+178
+245
+212
+186
+84
+85
+82
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+43
+57
+62
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+56
+64
+60
+161
+144
+134
+255
+215
+190
+250
+200
+166
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+255
+215
+190
+187
+166
+150
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+65
+67
+64
+91
+92
+89
+55
+66
+67
+129
+106
+52
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+158
+125
+46
+63
+69
+60
+137
+127
+115
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+173
+106
+60
+48
+58
+59
+187
+166
+150
+255
+215
+190
+250
+200
+166
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+41
+58
+57
+118
+86
+65
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+95
+78
+64
+91
+92
+89
+255
+215
+190
+253
+204
+176
+251
+192
+154
+252
+185
+144
+252
+185
+144
+251
+192
+154
+253
+204
+176
+245
+212
+186
+91
+92
+89
+106
+82
+65
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+112
+85
+63
+41
+58
+57
+48
+58
+59
+173
+106
+60
+234
+125
+52
+224
+123
+55
+227
+126
+50
+199
+115
+54
+56
+64
+60
+161
+144
+134
+255
+215
+190
+250
+200
+166
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+255
+215
+190
+187
+166
+150
+48
+58
+59
+183
+110
+59
+234
+125
+52
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+176
+156
+141
+255
+215
+190
+253
+212
+188
+251
+209
+178
+253
+212
+188
+217
+187
+166
+55
+66
+67
+146
+97
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+214
+121
+50
+69
+69
+61
+137
+127
+115
+255
+215
+190
+253
+204
+176
+251
+192
+154
+249
+189
+146
+249
+189
+146
+250
+200
+166
+253
+212
+188
+217
+187
+166
+51
+62
+63
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+250
+197
+158
+249
+174
+124
+249
+159
+103
+249
+152
+92
+249
+152
+92
+249
+159
+103
+249
+174
+124
+250
+197
+158
+91
+92
+89
+95
+78
+64
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+125
+90
+64
+70
+79
+77
+234
+204
+183
+251
+209
+178
+250
+197
+158
+249
+189
+146
+252
+185
+144
+251
+192
+154
+253
+204
+176
+255
+215
+190
+120
+114
+108
+81
+73
+62
+224
+123
+55
+227
+126
+50
+224
+123
+55
+234
+126
+45
+135
+94
+64
+41
+58
+57
+41
+58
+57
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+253
+212
+188
+253
+212
+188
+251
+209
+178
+251
+209
+178
+255
+215
+190
+137
+127
+115
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+146
+97
+64
+51
+62
+63
+227
+196
+175
+253
+212
+188
+250
+197
+158
+249
+189
+146
+249
+189
+146
+251
+192
+154
+253
+204
+176
+255
+215
+190
+120
+114
+108
+81
+73
+62
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+139
+96
+61
+51
+62
+63
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+250
+139
+73
+249
+159
+103
+252
+185
+144
+55
+48
+48
+59
+50
+39
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+154
+125
+71
+170
+137
+67
+108
+87
+46
+59
+50
+39
+192
+155
+91
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+186
+181
+179
+47
+40
+38
+65
+58
+56
+245
+212
+186
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+84
+85
+82
+253
+212
+188
+251
+209
+178
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+200
+166
+253
+212
+188
+234
+204
+183
+63
+74
+74
+100
+89
+56
+171
+129
+45
+158
+125
+46
+158
+125
+46
+161
+127
+40
+75
+74
+61
+41
+58
+57
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+111
+94
+57
+56
+64
+60
+43
+57
+62
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+95
+87
+59
+70
+79
+77
+245
+212
+186
+251
+209
+178
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+197
+158
+251
+209
+178
+245
+212
+186
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+43
+57
+62
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+158
+125
+46
+152
+119
+47
+56
+64
+60
+161
+144
+134
+255
+215
+190
+253
+204
+176
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+255
+215
+190
+176
+156
+141
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+91
+92
+89
+55
+66
+67
+123
+102
+54
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+145
+114
+49
+100
+89
+56
+48
+58
+59
+187
+166
+150
+176
+156
+141
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+176
+156
+141
+255
+215
+190
+250
+200
+166
+251
+192
+154
+251
+192
+154
+250
+197
+158
+253
+204
+176
+255
+215
+190
+146
+135
+124
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+234
+125
+52
+163
+104
+61
+48
+58
+59
+41
+58
+57
+112
+85
+63
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+106
+82
+65
+84
+85
+82
+255
+215
+190
+251
+209
+178
+250
+197
+158
+249
+189
+146
+249
+189
+146
+250
+197
+158
+251
+209
+178
+238
+205
+179
+84
+85
+82
+106
+82
+65
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+106
+82
+65
+41
+58
+57
+48
+58
+59
+173
+106
+60
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+146
+135
+124
+255
+215
+190
+253
+204
+176
+251
+192
+154
+249
+189
+146
+251
+192
+154
+250
+200
+166
+255
+215
+190
+176
+156
+141
+51
+62
+63
+183
+110
+59
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+176
+156
+141
+253
+212
+188
+253
+204
+176
+250
+200
+166
+253
+204
+176
+217
+187
+166
+55
+66
+67
+146
+97
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+120
+114
+108
+255
+215
+190
+253
+204
+176
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+200
+166
+253
+212
+188
+207
+178
+158
+48
+58
+59
+163
+104
+61
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+250
+200
+166
+248
+180
+134
+251
+168
+115
+247
+165
+111
+247
+165
+111
+251
+168
+115
+248
+180
+134
+250
+200
+166
+91
+92
+89
+89
+75
+66
+225
+124
+48
+227
+126
+50
+224
+123
+55
+234
+126
+45
+125
+90
+64
+63
+74
+74
+227
+196
+175
+251
+209
+178
+250
+197
+158
+249
+189
+146
+249
+189
+146
+250
+197
+158
+253
+204
+176
+255
+215
+190
+109
+106
+99
+89
+75
+66
+225
+124
+48
+227
+126
+50
+224
+123
+55
+234
+125
+52
+125
+90
+64
+43
+57
+62
+41
+58
+57
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+253
+212
+188
+253
+204
+176
+250
+200
+166
+250
+200
+166
+251
+209
+178
+137
+127
+115
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+155
+100
+63
+43
+57
+62
+217
+187
+166
+253
+212
+188
+250
+200
+166
+251
+192
+154
+249
+189
+146
+250
+197
+158
+253
+204
+176
+255
+215
+190
+120
+114
+108
+81
+73
+62
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+250
+139
+73
+249
+159
+103
+248
+180
+134
+76
+70
+64
+47
+40
+38
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+156
+125
+62
+154
+125
+71
+170
+137
+67
+101
+83
+47
+59
+50
+39
+170
+137
+67
+255
+238
+227
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+152
+147
+147
+35
+31
+30
+24
+22
+23
+115
+102
+92
+255
+215
+190
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+171
+129
+45
+105
+93
+60
+58
+69
+70
+227
+196
+175
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+207
+178
+158
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+43
+57
+62
+100
+89
+56
+171
+129
+45
+158
+125
+46
+161
+127
+40
+158
+125
+46
+75
+74
+61
+48
+58
+59
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+48
+58
+59
+101
+100
+92
+91
+92
+89
+75
+74
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+111
+94
+57
+55
+66
+67
+227
+196
+175
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+255
+215
+190
+227
+196
+175
+51
+62
+63
+105
+93
+60
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+48
+58
+59
+48
+58
+59
+123
+102
+54
+168
+127
+42
+158
+125
+46
+161
+127
+40
+158
+125
+46
+69
+69
+61
+120
+114
+108
+255
+215
+190
+251
+209
+178
+250
+200
+166
+250
+197
+158
+250
+200
+166
+251
+209
+178
+255
+215
+190
+146
+135
+124
+56
+64
+60
+152
+119
+47
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+109
+106
+99
+63
+74
+74
+111
+94
+57
+171
+129
+45
+158
+125
+46
+161
+127
+40
+152
+119
+47
+69
+69
+61
+51
+62
+63
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+56
+64
+60
+51
+62
+63
+48
+58
+59
+120
+114
+108
+245
+212
+186
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+62
+63
+61
+137
+127
+115
+255
+215
+190
+251
+209
+178
+250
+200
+166
+250
+200
+166
+250
+200
+166
+253
+212
+188
+255
+215
+190
+109
+106
+99
+81
+73
+62
+224
+123
+55
+227
+126
+50
+224
+123
+55
+234
+125
+52
+155
+100
+63
+48
+58
+59
+43
+57
+62
+95
+78
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+125
+90
+64
+63
+74
+74
+227
+196
+175
+253
+212
+188
+250
+200
+166
+250
+197
+158
+250
+197
+158
+253
+204
+176
+255
+215
+190
+227
+196
+175
+55
+66
+67
+125
+90
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+89
+75
+66
+48
+58
+59
+48
+58
+59
+155
+100
+63
+234
+126
+45
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+120
+114
+108
+255
+215
+190
+251
+209
+178
+250
+200
+166
+250
+197
+158
+250
+200
+166
+251
+209
+178
+255
+215
+190
+137
+127
+115
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+97
+98
+96
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+48
+58
+59
+176
+156
+141
+251
+209
+178
+250
+200
+166
+250
+197
+158
+250
+200
+166
+227
+196
+175
+63
+74
+74
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+95
+78
+64
+91
+92
+89
+253
+212
+188
+253
+212
+188
+250
+200
+166
+250
+200
+166
+250
+200
+166
+251
+209
+178
+255
+215
+190
+172
+150
+134
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+251
+209
+178
+251
+192
+154
+250
+176
+132
+249
+174
+124
+249
+174
+124
+248
+180
+134
+251
+192
+154
+251
+209
+178
+109
+106
+99
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+146
+97
+64
+43
+57
+62
+217
+187
+166
+255
+215
+190
+253
+204
+176
+250
+197
+158
+250
+197
+158
+250
+200
+166
+253
+212
+188
+245
+212
+186
+70
+79
+77
+106
+82
+65
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+112
+85
+63
+51
+62
+63
+51
+62
+63
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+245
+212
+186
+250
+200
+166
+251
+192
+154
+250
+197
+158
+253
+204
+176
+146
+135
+124
+65
+67
+64
+209
+117
+53
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+187
+166
+150
+255
+215
+190
+253
+204
+176
+250
+200
+166
+250
+197
+158
+250
+200
+166
+253
+212
+188
+255
+215
+190
+84
+85
+82
+95
+78
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+109
+10
+247
+111
+26
+247
+123
+41
+248
+138
+64
+249
+152
+92
+249
+174
+124
+121
+100
+85
+35
+31
+30
+108
+87
+46
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+156
+125
+62
+154
+125
+71
+154
+125
+71
+171
+129
+45
+85
+71
+43
+71
+60
+43
+171
+129
+45
+224
+207
+180
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+237
+233
+225
+174
+168
+167
+81
+77
+76
+24
+22
+23
+35
+31
+30
+35
+31
+30
+187
+166
+150
+255
+215
+190
+255
+215
+190
+234
+204
+183
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+51
+62
+63
+176
+156
+141
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+146
+135
+124
+51
+62
+63
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+152
+119
+47
+56
+64
+60
+43
+57
+62
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+48
+58
+59
+146
+135
+124
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+172
+150
+134
+172
+150
+134
+146
+135
+124
+146
+135
+124
+194
+173
+157
+245
+212
+186
+137
+127
+115
+63
+69
+60
+158
+125
+46
+161
+127
+40
+158
+125
+46
+168
+127
+42
+137
+110
+49
+51
+62
+63
+161
+144
+134
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+161
+144
+134
+48
+58
+59
+137
+110
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+55
+66
+67
+51
+62
+63
+105
+93
+60
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+70
+79
+77
+245
+212
+186
+255
+215
+190
+253
+212
+188
+251
+209
+178
+253
+212
+188
+255
+215
+190
+255
+215
+190
+91
+92
+89
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+133
+120
+107
+84
+85
+82
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+75
+74
+61
+55
+66
+67
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+161
+144
+134
+172
+150
+134
+172
+150
+134
+137
+127
+115
+146
+135
+124
+207
+178
+158
+245
+212
+186
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+76
+78
+76
+245
+212
+186
+255
+215
+190
+253
+212
+188
+253
+212
+188
+253
+212
+188
+255
+215
+190
+227
+196
+175
+58
+69
+70
+118
+86
+65
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+125
+90
+64
+63
+74
+74
+97
+98
+96
+76
+70
+64
+214
+121
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+163
+104
+61
+48
+58
+59
+187
+166
+150
+255
+215
+190
+255
+215
+190
+251
+209
+178
+251
+209
+178
+255
+215
+190
+255
+215
+190
+176
+156
+141
+48
+58
+59
+173
+106
+60
+227
+126
+50
+224
+123
+55
+227
+126
+50
+212
+120
+56
+69
+69
+61
+101
+100
+92
+63
+74
+74
+125
+90
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+106
+82
+65
+63
+74
+74
+234
+204
+183
+255
+215
+190
+253
+212
+188
+253
+212
+188
+253
+212
+188
+255
+215
+190
+245
+212
+186
+70
+79
+77
+89
+75
+66
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+176
+156
+141
+253
+204
+176
+251
+192
+154
+251
+192
+154
+251
+192
+154
+250
+200
+166
+77
+85
+81
+106
+82
+65
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+135
+94
+64
+51
+62
+63
+217
+187
+166
+255
+215
+190
+255
+215
+190
+253
+212
+188
+253
+212
+188
+255
+215
+190
+255
+215
+190
+109
+106
+99
+76
+70
+64
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+255
+215
+190
+250
+200
+166
+251
+192
+154
+252
+185
+144
+252
+185
+144
+251
+192
+154
+250
+200
+166
+255
+215
+190
+146
+135
+124
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+51
+62
+63
+146
+135
+124
+255
+215
+190
+255
+215
+190
+251
+209
+178
+251
+209
+178
+253
+212
+188
+255
+215
+190
+194
+173
+157
+43
+57
+62
+146
+97
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+77
+85
+81
+63
+74
+74
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+251
+209
+178
+250
+197
+158
+249
+189
+146
+249
+189
+146
+250
+200
+166
+172
+150
+134
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+120
+114
+108
+255
+215
+190
+255
+215
+190
+253
+212
+188
+251
+209
+178
+253
+212
+188
+255
+215
+190
+217
+187
+166
+51
+62
+63
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+60
+247
+150
+84
+251
+168
+115
+187
+140
+108
+24
+22
+23
+59
+50
+39
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+156
+125
+62
+154
+125
+71
+154
+125
+71
+154
+125
+71
+156
+125
+62
+158
+125
+46
+47
+40
+38
+108
+87
+46
+158
+125
+46
+195
+167
+113
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+219
+212
+208
+164
+158
+157
+109
+106
+99
+65
+58
+56
+24
+22
+23
+24
+22
+23
+94
+60
+47
+178
+86
+46
+59
+50
+39
+150
+125
+114
+255
+215
+190
+255
+215
+190
+234
+204
+183
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+69
+69
+61
+84
+85
+82
+234
+204
+183
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+217
+187
+166
+55
+66
+67
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+123
+102
+54
+51
+62
+63
+76
+78
+76
+56
+64
+60
+152
+119
+47
+168
+127
+42
+158
+125
+46
+168
+127
+42
+129
+106
+52
+48
+58
+59
+161
+144
+134
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+217
+187
+166
+133
+120
+107
+77
+85
+81
+77
+85
+81
+146
+135
+124
+245
+212
+186
+176
+156
+141
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+75
+74
+61
+63
+74
+74
+227
+196
+175
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+234
+204
+183
+76
+78
+76
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+77
+85
+81
+77
+85
+81
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+48
+58
+59
+146
+135
+124
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+172
+150
+134
+48
+58
+59
+117
+98
+55
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+146
+135
+124
+120
+114
+108
+69
+69
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+111
+94
+57
+51
+62
+63
+176
+156
+141
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+194
+173
+157
+120
+114
+108
+70
+79
+77
+84
+85
+82
+161
+144
+134
+255
+215
+190
+255
+215
+190
+161
+144
+134
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+155
+100
+63
+41
+58
+57
+161
+144
+134
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+137
+127
+115
+48
+58
+59
+183
+110
+59
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+89
+75
+66
+97
+98
+96
+172
+150
+134
+48
+58
+59
+183
+110
+59
+227
+126
+50
+224
+123
+55
+227
+126
+50
+214
+121
+50
+76
+70
+64
+84
+85
+82
+234
+204
+183
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+234
+204
+183
+77
+85
+81
+81
+73
+62
+224
+123
+55
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+176
+156
+141
+97
+98
+96
+95
+78
+64
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+146
+135
+124
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+161
+144
+134
+41
+58
+57
+155
+100
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+176
+156
+141
+250
+200
+166
+249
+189
+146
+252
+185
+144
+249
+189
+146
+250
+200
+166
+120
+114
+108
+69
+69
+61
+214
+121
+50
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+101
+100
+92
+245
+212
+186
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+187
+166
+150
+43
+57
+62
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+255
+215
+190
+253
+212
+188
+253
+204
+176
+250
+200
+166
+250
+200
+166
+253
+204
+176
+253
+212
+188
+255
+215
+190
+187
+166
+150
+41
+58
+57
+155
+100
+63
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+95
+78
+64
+58
+69
+70
+227
+196
+175
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+91
+92
+89
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+62
+63
+61
+133
+120
+107
+77
+85
+81
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+253
+204
+176
+251
+192
+154
+252
+185
+144
+252
+185
+144
+251
+192
+154
+212
+173
+150
+48
+58
+59
+155
+100
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+118
+86
+65
+51
+62
+63
+207
+178
+158
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+109
+106
+99
+56
+64
+60
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+247
+111
+26
+246
+116
+28
+247
+130
+53
+247
+143
+74
+249
+159
+103
+248
+180
+134
+89
+75
+66
+24
+22
+23
+85
+71
+43
+171
+129
+45
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+156
+125
+62
+154
+125
+71
+154
+125
+71
+154
+125
+71
+156
+125
+62
+175
+132
+40
+85
+71
+43
+47
+40
+38
+158
+125
+46
+158
+125
+46
+170
+137
+67
+237
+233
+225
+253
+255
+252
+253
+255
+252
+253
+255
+252
+207
+202
+200
+164
+158
+157
+146
+135
+124
+120
+114
+108
+89
+84
+82
+65
+58
+56
+47
+40
+38
+24
+22
+23
+24
+22
+23
+35
+31
+30
+94
+60
+47
+178
+86
+46
+226
+110
+35
+241
+100
+24
+144
+77
+47
+65
+58
+56
+253
+212
+188
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+129
+106
+52
+48
+58
+59
+101
+100
+92
+217
+187
+166
+245
+212
+186
+245
+212
+186
+194
+173
+157
+76
+78
+76
+56
+64
+60
+145
+114
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+171
+129
+45
+88
+82
+59
+77
+85
+81
+176
+156
+141
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+95
+87
+59
+41
+58
+57
+137
+127
+115
+227
+196
+175
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+207
+178
+158
+120
+114
+108
+48
+58
+59
+62
+63
+61
+100
+89
+56
+95
+87
+59
+51
+62
+63
+120
+114
+108
+227
+196
+175
+55
+66
+67
+100
+89
+56
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+137
+110
+49
+51
+62
+63
+84
+85
+82
+207
+178
+158
+245
+212
+186
+245
+212
+186
+207
+178
+158
+97
+98
+96
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+91
+92
+89
+120
+114
+108
+63
+69
+60
+158
+125
+46
+161
+127
+40
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+43
+57
+62
+161
+144
+134
+227
+196
+175
+253
+212
+188
+234
+204
+183
+161
+144
+134
+51
+62
+63
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+146
+135
+124
+176
+156
+141
+48
+58
+59
+137
+110
+49
+171
+129
+45
+158
+125
+46
+161
+127
+40
+158
+125
+46
+75
+74
+61
+43
+57
+62
+161
+144
+134
+234
+204
+183
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+194
+173
+157
+109
+106
+99
+43
+57
+62
+69
+69
+61
+105
+93
+60
+88
+82
+59
+48
+58
+59
+146
+135
+124
+255
+215
+190
+161
+144
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+225
+124
+48
+95
+78
+64
+43
+57
+62
+161
+144
+134
+234
+204
+183
+245
+212
+186
+227
+196
+175
+146
+135
+124
+35
+56
+60
+125
+90
+64
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+188
+112
+56
+51
+62
+63
+161
+144
+134
+234
+204
+183
+51
+62
+63
+125
+90
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+125
+52
+163
+104
+61
+43
+57
+62
+97
+98
+96
+207
+178
+158
+245
+212
+186
+245
+212
+186
+207
+178
+158
+91
+92
+89
+48
+58
+59
+173
+106
+60
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+118
+86
+65
+55
+66
+67
+234
+204
+183
+146
+135
+124
+56
+64
+60
+194
+112
+58
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+112
+85
+63
+35
+56
+60
+146
+135
+124
+227
+196
+175
+253
+212
+188
+234
+204
+183
+161
+144
+134
+43
+57
+62
+95
+78
+64
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+176
+156
+141
+250
+197
+158
+252
+185
+144
+248
+180
+134
+248
+180
+134
+251
+192
+154
+172
+150
+134
+48
+58
+59
+173
+106
+60
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+41
+58
+57
+120
+114
+108
+217
+187
+166
+245
+212
+186
+234
+204
+183
+176
+156
+141
+58
+69
+70
+81
+73
+62
+214
+121
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+255
+215
+190
+255
+215
+190
+217
+187
+166
+133
+120
+107
+84
+85
+82
+91
+92
+89
+146
+135
+124
+234
+204
+183
+238
+205
+179
+63
+74
+74
+95
+78
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+84
+85
+82
+194
+173
+157
+245
+212
+186
+245
+212
+186
+217
+187
+166
+109
+106
+99
+41
+58
+57
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+146
+97
+64
+51
+62
+63
+187
+166
+150
+76
+78
+76
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+97
+98
+96
+250
+200
+166
+249
+189
+146
+248
+180
+134
+248
+180
+134
+252
+185
+144
+232
+190
+161
+70
+79
+77
+112
+85
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+199
+115
+54
+65
+67
+64
+70
+79
+77
+187
+166
+150
+238
+205
+179
+245
+212
+186
+217
+187
+166
+133
+120
+107
+35
+56
+60
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+123
+41
+247
+130
+60
+247
+150
+84
+251
+168
+115
+203
+161
+131
+55
+48
+48
+24
+22
+23
+71
+60
+43
+145
+114
+49
+171
+129
+45
+171
+129
+45
+158
+125
+46
+156
+125
+62
+154
+125
+71
+154
+125
+71
+156
+125
+62
+156
+125
+62
+171
+129
+45
+171
+129
+45
+101
+83
+47
+35
+31
+30
+123
+102
+54
+171
+129
+45
+158
+125
+46
+160
+120
+43
+224
+207
+180
+253
+255
+252
+253
+255
+252
+219
+212
+208
+47
+40
+38
+24
+22
+23
+24
+22
+23
+24
+22
+23
+24
+22
+23
+24
+22
+23
+35
+31
+30
+35
+31
+30
+24
+22
+23
+47
+40
+38
+226
+110
+35
+241
+100
+24
+226
+110
+35
+226
+110
+35
+144
+77
+47
+55
+48
+48
+238
+205
+179
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+123
+102
+54
+56
+64
+60
+51
+62
+63
+84
+85
+82
+84
+85
+82
+48
+58
+59
+63
+69
+60
+129
+106
+52
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+56
+64
+60
+137
+127
+115
+245
+212
+186
+84
+85
+82
+69
+69
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+158
+125
+46
+95
+87
+59
+48
+58
+59
+63
+74
+74
+109
+106
+99
+133
+120
+107
+133
+120
+107
+91
+92
+89
+51
+62
+63
+56
+64
+60
+100
+89
+56
+152
+119
+47
+171
+129
+45
+175
+132
+40
+100
+89
+56
+48
+58
+59
+217
+187
+166
+120
+114
+108
+63
+69
+60
+152
+119
+47
+161
+127
+40
+158
+125
+46
+158
+125
+46
+168
+127
+42
+129
+106
+52
+61
+67
+58
+51
+62
+63
+84
+85
+82
+84
+85
+82
+51
+62
+63
+56
+64
+60
+123
+102
+54
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+97
+98
+96
+187
+166
+150
+48
+58
+59
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+158
+125
+46
+83
+78
+61
+48
+58
+59
+63
+74
+74
+91
+92
+89
+70
+79
+77
+48
+58
+59
+75
+74
+61
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+146
+135
+124
+234
+204
+183
+63
+74
+74
+83
+78
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+152
+119
+47
+83
+78
+61
+48
+58
+59
+70
+79
+77
+109
+106
+99
+133
+120
+107
+120
+114
+108
+84
+85
+82
+48
+58
+59
+61
+67
+58
+111
+94
+57
+158
+125
+46
+171
+129
+45
+171
+129
+45
+88
+82
+59
+58
+69
+70
+238
+205
+179
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+212
+120
+56
+95
+78
+64
+43
+57
+62
+70
+79
+77
+84
+85
+82
+63
+74
+74
+48
+58
+59
+118
+86
+65
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+112
+85
+63
+55
+66
+67
+227
+196
+175
+255
+215
+190
+120
+114
+108
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+155
+100
+63
+62
+63
+61
+51
+62
+63
+77
+85
+81
+77
+85
+81
+51
+62
+63
+62
+63
+61
+155
+100
+63
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+199
+115
+54
+56
+64
+60
+120
+114
+108
+255
+215
+190
+217
+187
+166
+43
+57
+62
+125
+90
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+106
+82
+65
+48
+58
+59
+63
+74
+74
+84
+85
+82
+70
+79
+77
+43
+57
+62
+95
+78
+64
+212
+120
+56
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+172
+150
+134
+251
+192
+154
+248
+180
+134
+249
+174
+124
+249
+174
+124
+248
+180
+134
+236
+186
+153
+63
+74
+74
+95
+78
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+135
+94
+64
+51
+62
+63
+55
+66
+67
+84
+85
+82
+70
+79
+77
+41
+58
+57
+81
+73
+62
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+255
+215
+190
+194
+173
+157
+58
+69
+70
+62
+63
+61
+106
+82
+65
+95
+78
+64
+51
+62
+63
+91
+92
+89
+238
+205
+179
+161
+144
+134
+48
+58
+59
+183
+110
+59
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+125
+52
+173
+106
+60
+65
+67
+64
+48
+58
+59
+77
+85
+81
+84
+85
+82
+55
+66
+67
+56
+64
+60
+146
+97
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+69
+69
+61
+101
+100
+92
+227
+196
+175
+63
+74
+74
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+250
+197
+158
+252
+185
+144
+249
+174
+124
+249
+174
+124
+250
+176
+132
+251
+192
+154
+120
+114
+108
+62
+63
+61
+209
+117
+53
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+188
+112
+56
+76
+70
+64
+41
+58
+57
+77
+85
+81
+84
+85
+82
+58
+69
+70
+48
+58
+59
+125
+90
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+243
+101
+2
+247
+103
+7
+247
+103
+7
+247
+111
+26
+247
+118
+39
+247
+130
+53
+250
+139
+73
+246
+156
+93
+249
+174
+124
+203
+161
+131
+55
+48
+48
+24
+22
+23
+35
+31
+30
+85
+71
+43
+137
+110
+49
+152
+119
+47
+168
+127
+42
+171
+129
+45
+171
+129
+45
+168
+127
+42
+152
+119
+47
+117
+98
+55
+59
+50
+39
+35
+31
+30
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+152
+119
+47
+224
+207
+180
+253
+255
+252
+253
+255
+252
+253
+255
+252
+146
+135
+124
+65
+58
+56
+35
+31
+30
+24
+22
+23
+24
+22
+23
+35
+31
+30
+35
+31
+30
+35
+31
+30
+35
+31
+30
+24
+22
+23
+83
+53
+42
+236
+108
+29
+236
+108
+29
+226
+110
+35
+94
+60
+47
+65
+58
+56
+253
+212
+188
+255
+215
+190
+238
+205
+179
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+168
+127
+42
+145
+114
+49
+105
+93
+60
+83
+78
+61
+83
+78
+61
+111
+94
+57
+158
+125
+46
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+88
+82
+59
+51
+62
+63
+217
+187
+166
+255
+215
+190
+176
+156
+141
+43
+57
+62
+105
+93
+60
+171
+129
+45
+158
+125
+46
+158
+125
+46
+161
+127
+40
+168
+127
+42
+137
+110
+49
+88
+82
+59
+69
+69
+61
+62
+63
+61
+63
+69
+60
+75
+74
+61
+105
+93
+60
+152
+119
+47
+171
+129
+45
+168
+127
+42
+158
+125
+46
+171
+129
+45
+129
+106
+52
+48
+58
+59
+194
+173
+157
+207
+178
+158
+43
+57
+62
+100
+89
+56
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+152
+119
+47
+111
+94
+57
+83
+78
+61
+83
+78
+61
+105
+93
+60
+145
+114
+49
+168
+127
+42
+161
+127
+40
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+84
+85
+82
+245
+212
+186
+77
+85
+81
+75
+74
+61
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+129
+106
+52
+95
+87
+59
+81
+73
+62
+95
+87
+59
+123
+102
+54
+168
+127
+42
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+56
+64
+60
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+255
+215
+190
+161
+144
+134
+48
+58
+59
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+129
+106
+52
+88
+82
+59
+69
+69
+61
+62
+63
+61
+63
+69
+60
+75
+74
+61
+117
+98
+55
+152
+119
+47
+171
+129
+45
+161
+127
+40
+158
+125
+46
+171
+129
+45
+111
+94
+57
+48
+58
+59
+227
+196
+175
+176
+156
+141
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+227
+126
+50
+163
+104
+61
+112
+85
+63
+95
+78
+64
+118
+86
+65
+173
+106
+60
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+183
+110
+59
+51
+62
+63
+133
+120
+107
+255
+215
+190
+255
+215
+190
+217
+187
+166
+51
+62
+63
+106
+82
+65
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+199
+115
+54
+135
+94
+64
+95
+78
+64
+95
+78
+64
+135
+94
+64
+199
+115
+54
+234
+125
+52
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+106
+82
+65
+51
+62
+63
+217
+187
+166
+255
+215
+190
+255
+215
+190
+120
+114
+108
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+173
+106
+60
+118
+86
+65
+95
+78
+64
+112
+85
+63
+163
+104
+61
+227
+126
+50
+227
+126
+50
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+101
+100
+92
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+172
+150
+134
+252
+185
+144
+249
+174
+124
+247
+165
+111
+247
+165
+111
+249
+174
+124
+252
+185
+144
+154
+133
+118
+48
+58
+59
+163
+104
+61
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+188
+112
+56
+125
+90
+64
+95
+78
+64
+106
+82
+65
+155
+100
+63
+224
+123
+55
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+137
+127
+115
+253
+212
+188
+91
+92
+89
+69
+69
+61
+194
+112
+58
+234
+126
+45
+234
+126
+45
+163
+104
+61
+51
+62
+63
+137
+127
+115
+238
+205
+179
+63
+74
+74
+89
+75
+66
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+209
+117
+53
+146
+97
+64
+106
+82
+65
+95
+78
+64
+125
+90
+64
+194
+112
+58
+234
+126
+45
+227
+126
+50
+224
+123
+55
+227
+126
+50
+234
+126
+45
+125
+90
+64
+41
+58
+57
+194
+173
+157
+238
+205
+179
+63
+74
+74
+135
+94
+64
+234
+125
+52
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+251
+192
+154
+250
+176
+132
+251
+168
+115
+247
+165
+111
+249
+174
+124
+245
+179
+138
+195
+157
+134
+41
+58
+57
+135
+94
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+125
+52
+214
+121
+50
+146
+97
+64
+106
+82
+65
+95
+78
+64
+125
+90
+64
+183
+110
+59
+227
+126
+50
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+125
+52
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+249
+152
+92
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+247
+103
+7
+246
+109
+10
+247
+111
+26
+247
+118
+39
+247
+130
+53
+247
+143
+74
+249
+159
+103
+250
+176
+132
+219
+170
+138
+115
+102
+92
+47
+40
+38
+24
+22
+23
+35
+31
+30
+47
+40
+38
+59
+50
+39
+59
+50
+39
+59
+50
+39
+59
+50
+39
+47
+40
+38
+47
+40
+38
+71
+60
+43
+137
+110
+49
+171
+129
+45
+158
+125
+46
+158
+125
+46
+152
+119
+47
+170
+137
+67
+219
+212
+208
+237
+233
+225
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+219
+212
+208
+152
+147
+147
+109
+106
+99
+65
+67
+64
+35
+31
+30
+35
+31
+30
+35
+31
+30
+35
+31
+30
+24
+22
+23
+94
+60
+47
+178
+86
+46
+109
+63
+45
+35
+31
+30
+124
+111
+99
+251
+209
+178
+251
+209
+178
+234
+204
+183
+76
+78
+76
+95
+87
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+117
+98
+55
+129
+106
+52
+168
+127
+42
+168
+127
+42
+171
+129
+45
+168
+127
+42
+168
+127
+42
+171
+129
+45
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+117
+98
+55
+48
+58
+59
+146
+135
+124
+255
+215
+190
+255
+215
+190
+255
+215
+190
+120
+114
+108
+51
+62
+63
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+158
+125
+46
+152
+119
+47
+152
+119
+47
+158
+125
+46
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+158
+125
+46
+81
+73
+62
+58
+69
+70
+227
+196
+175
+255
+215
+190
+120
+114
+108
+48
+58
+59
+129
+106
+52
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+168
+127
+42
+168
+127
+42
+152
+119
+47
+117
+98
+55
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+88
+82
+59
+84
+85
+82
+255
+215
+190
+176
+156
+141
+48
+58
+59
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+168
+127
+42
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+145
+114
+49
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+117
+98
+55
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+63
+69
+60
+137
+127
+115
+255
+215
+190
+238
+205
+179
+91
+92
+89
+56
+64
+60
+137
+110
+49
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+158
+125
+46
+152
+119
+47
+158
+125
+46
+168
+127
+42
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+152
+119
+47
+69
+69
+61
+84
+85
+82
+245
+212
+186
+172
+150
+134
+62
+63
+61
+199
+115
+54
+227
+126
+50
+224
+123
+55
+227
+126
+50
+199
+115
+54
+125
+90
+64
+227
+126
+50
+227
+126
+50
+227
+126
+50
+234
+125
+52
+227
+126
+50
+234
+125
+52
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+214
+121
+50
+81
+73
+62
+63
+74
+74
+227
+196
+175
+255
+215
+190
+253
+212
+188
+255
+215
+190
+146
+135
+124
+48
+58
+59
+146
+97
+64
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+227
+126
+50
+227
+126
+50
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+139
+96
+61
+48
+58
+59
+146
+135
+124
+255
+215
+190
+253
+212
+188
+255
+215
+190
+217
+187
+166
+55
+66
+67
+95
+78
+64
+225
+124
+48
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+227
+126
+50
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+163
+104
+61
+183
+110
+59
+227
+126
+50
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+97
+98
+96
+56
+64
+60
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+183
+110
+59
+51
+62
+63
+167
+142
+123
+248
+180
+134
+247
+165
+111
+249
+159
+103
+246
+156
+93
+249
+159
+103
+249
+174
+124
+239
+182
+144
+77
+85
+81
+65
+67
+64
+199
+115
+54
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+227
+126
+50
+227
+126
+50
+234
+125
+52
+227
+126
+50
+227
+126
+50
+135
+94
+64
+188
+112
+56
+227
+126
+50
+224
+123
+55
+227
+126
+50
+209
+117
+53
+65
+67
+64
+146
+135
+124
+227
+196
+175
+43
+57
+62
+146
+97
+64
+234
+126
+45
+224
+123
+55
+224
+123
+55
+234
+126
+45
+106
+82
+65
+70
+79
+77
+253
+212
+188
+176
+156
+141
+41
+58
+57
+125
+90
+64
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+234
+125
+52
+227
+126
+50
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+155
+100
+63
+48
+58
+59
+120
+114
+108
+253
+212
+188
+234
+204
+183
+63
+74
+74
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+252
+185
+144
+245
+169
+119
+249
+159
+103
+249
+159
+103
+247
+165
+111
+249
+174
+124
+251
+192
+154
+109
+106
+99
+62
+63
+61
+188
+112
+56
+234
+125
+52
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+234
+125
+52
+227
+126
+50
+234
+125
+52
+227
+126
+50
+227
+126
+50
+212
+120
+56
+199
+115
+54
+224
+123
+55
+224
+123
+55
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+200
+166
+249
+174
+124
+247
+150
+84
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+243
+101
+2
+243
+101
+2
+247
+103
+7
+247
+111
+26
+247
+111
+26
+247
+123
+41
+247
+130
+60
+243
+141
+78
+249
+159
+103
+250
+176
+132
+251
+192
+154
+207
+178
+158
+154
+133
+118
+82
+69
+65
+24
+22
+23
+71
+60
+43
+101
+83
+47
+101
+83
+47
+101
+83
+47
+117
+98
+55
+145
+114
+49
+171
+129
+45
+168
+127
+42
+160
+120
+43
+160
+120
+43
+158
+125
+46
+192
+155
+91
+237
+233
+225
+81
+77
+76
+55
+48
+48
+74
+68
+68
+81
+77
+76
+89
+84
+82
+91
+92
+89
+89
+84
+82
+81
+77
+76
+65
+58
+56
+47
+40
+38
+35
+31
+30
+55
+48
+48
+115
+102
+92
+172
+150
+134
+55
+48
+48
+24
+22
+23
+24
+22
+23
+24
+22
+23
+65
+58
+56
+230
+173
+136
+251
+192
+154
+250
+197
+158
+250
+200
+166
+84
+85
+82
+88
+82
+59
+171
+129
+45
+158
+125
+46
+158
+125
+46
+171
+129
+45
+83
+78
+61
+69
+69
+61
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+117
+98
+55
+48
+58
+59
+101
+100
+92
+238
+205
+179
+253
+204
+176
+250
+200
+166
+253
+204
+176
+238
+205
+179
+91
+92
+89
+51
+62
+63
+117
+98
+55
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+145
+114
+49
+75
+74
+61
+48
+58
+59
+172
+150
+134
+253
+212
+188
+255
+215
+190
+234
+204
+183
+84
+85
+82
+56
+64
+60
+129
+106
+52
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+81
+73
+62
+63
+69
+60
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+83
+78
+61
+84
+85
+82
+255
+215
+190
+245
+212
+186
+109
+106
+99
+51
+62
+63
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+171
+129
+45
+105
+93
+60
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+137
+127
+115
+58
+69
+70
+111
+94
+57
+171
+129
+45
+158
+125
+46
+158
+125
+46
+158
+125
+46
+62
+63
+61
+137
+127
+115
+255
+215
+190
+255
+215
+190
+227
+196
+175
+77
+85
+81
+56
+64
+60
+129
+106
+52
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+161
+127
+40
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+168
+127
+42
+137
+110
+49
+69
+69
+61
+51
+62
+63
+187
+166
+150
+255
+215
+190
+172
+150
+134
+51
+62
+63
+194
+112
+58
+227
+126
+50
+224
+123
+55
+234
+125
+52
+183
+110
+59
+48
+58
+59
+155
+100
+63
+234
+126
+45
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+125
+52
+209
+117
+53
+89
+75
+66
+48
+58
+59
+187
+166
+150
+250
+200
+166
+250
+197
+158
+251
+192
+154
+250
+197
+158
+250
+200
+166
+109
+106
+99
+48
+58
+59
+135
+94
+64
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+135
+94
+64
+43
+57
+62
+120
+114
+108
+250
+200
+166
+250
+197
+158
+251
+192
+154
+250
+197
+158
+250
+200
+166
+172
+150
+134
+41
+58
+57
+106
+82
+65
+214
+121
+50
+234
+125
+52
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+234
+126
+45
+183
+110
+59
+48
+58
+59
+135
+94
+64
+234
+126
+45
+224
+123
+55
+227
+126
+50
+188
+112
+56
+51
+62
+63
+109
+106
+99
+51
+62
+63
+183
+110
+59
+227
+126
+50
+224
+123
+55
+234
+125
+52
+173
+106
+60
+48
+58
+59
+178
+146
+122
+245
+169
+119
+246
+156
+93
+247
+150
+84
+249
+146
+83
+247
+150
+84
+249
+159
+103
+249
+174
+124
+203
+161
+131
+58
+69
+70
+76
+70
+64
+194
+112
+58
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+183
+110
+59
+48
+58
+59
+163
+104
+61
+234
+126
+45
+224
+123
+55
+227
+126
+50
+209
+117
+53
+62
+63
+61
+146
+135
+124
+217
+187
+166
+43
+57
+62
+163
+104
+61
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+126
+45
+125
+90
+64
+58
+69
+70
+234
+204
+183
+255
+215
+190
+137
+127
+115
+41
+58
+57
+118
+86
+65
+225
+124
+48
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+146
+97
+64
+51
+62
+63
+97
+98
+96
+238
+205
+179
+255
+215
+190
+234
+204
+183
+63
+74
+74
+118
+86
+65
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+81
+73
+62
+101
+100
+92
+250
+176
+132
+247
+165
+111
+246
+156
+93
+249
+152
+92
+249
+159
+103
+251
+168
+115
+252
+185
+144
+217
+187
+166
+58
+69
+70
+69
+69
+61
+199
+115
+54
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+224
+123
+55
+227
+126
+50
+225
+124
+48
+81
+73
+62
+81
+73
+62
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+139
+96
+61
+55
+66
+67
+250
+197
+158
+249
+174
+124
+247
+150
+84
+247
+130
+60
+247
+118
+39
+247
+111
+26
+247
+103
+7
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+237
+95
+0
+237
+95
+0
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+237
+95
+0
+243
+101
+2
+247
+103
+7
+236
+102
+14
+247
+111
+26
+246
+116
+28
+247
+123
+41
+247
+130
+60
+243
+141
+78
+249
+159
+103
+249
+174
+124
+249
+189
+146
+253
+204
+176
+124
+111
+99
+35
+31
+30
+145
+114
+49
+175
+132
+40
+171
+129
+45
+168
+127
+42
+192
+155
+91
+216
+194
+154
+224
+207
+180
+224
+207
+180
+216
+194
+154
+216
+194
+154
+239
+227
+208
+253
+255
+252
+253
+255
+252
+186
+181
+179
+146
+135
+124
+120
+114
+108
+109
+106
+99
+95
+78
+64
+71
+60
+43
+85
+71
+43
+101
+83
+47
+108
+87
+46
+35
+31
+30
+150
+125
+114
+227
+196
+175
+255
+215
+190
+253
+212
+188
+212
+173
+150
+121
+100
+85
+95
+78
+64
+129
+102
+78
+234
+168
+124
+250
+176
+132
+250
+176
+132
+248
+180
+134
+249
+189
+146
+124
+111
+99
+62
+63
+61
+152
+119
+47
+171
+129
+45
+171
+129
+45
+145
+114
+49
+56
+64
+60
+43
+57
+62
+83
+78
+61
+152
+119
+47
+171
+129
+45
+171
+129
+45
+168
+127
+42
+168
+127
+42
+171
+129
+45
+171
+129
+45
+152
+119
+47
+95
+87
+59
+48
+58
+59
+101
+100
+92
+236
+186
+153
+251
+192
+154
+252
+185
+144
+248
+180
+134
+245
+179
+138
+249
+189
+146
+236
+186
+153
+101
+100
+92
+48
+58
+59
+88
+82
+59
+137
+110
+49
+168
+127
+42
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+171
+129
+45
+168
+127
+42
+145
+114
+49
+100
+89
+56
+56
+64
+60
+58
+69
+70
+172
+150
+134
+250
+200
+166
+251
+192
+154
+250
+197
+158
+250
+200
+166
+217
+187
+166
+84
+85
+82
+51
+62
+63
+105
+93
+60
+158
+125
+46
+171
+129
+45
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+152
+119
+47
+83
+78
+61
+43
+57
+62
+48
+58
+59
+129
+106
+52
+175
+132
+40
+171
+129
+45
+158
+125
+46
+63
+69
+60
+120
+114
+108
+255
+215
+190
+255
+215
+190
+227
+196
+175
+84
+85
+82
+51
+62
+63
+105
+93
+60
+158
+125
+46
+171
+129
+45
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+158
+125
+46
+105
+93
+60
+48
+58
+59
+48
+58
+59
+129
+106
+52
+168
+127
+42
+158
+125
+46
+168
+127
+42
+145
+114
+49
+51
+62
+63
+172
+150
+134
+91
+92
+89
+75
+74
+61
+168
+127
+42
+171
+129
+45
+175
+132
+40
+117
+98
+55
+48
+58
+59
+176
+156
+141
+253
+204
+176
+253
+204
+176
+253
+204
+176
+217
+187
+166
+84
+85
+82
+48
+58
+59
+95
+87
+59
+145
+114
+49
+168
+127
+42
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+171
+129
+45
+158
+125
+46
+137
+110
+49
+95
+87
+59
+51
+62
+63
+70
+79
+77
+187
+166
+150
+251
+209
+178
+251
+209
+178
+207
+178
+158
+43
+57
+62
+135
+94
+64
+238
+123
+45
+234
+126
+45
+234
+126
+45
+118
+86
+65
+35
+56
+60
+56
+64
+60
+155
+100
+63
+234
+125
+52
+234
+126
+45
+234
+125
+52
+227
+126
+50
+227
+126
+50
+234
+126
+45
+227
+126
+50
+163
+104
+61
+76
+70
+64
+51
+62
+63
+167
+142
+123
+251
+192
+154
+248
+180
+134
+249
+174
+124
+249
+174
+124
+250
+176
+132
+245
+179
+138
+236
+186
+153
+109
+106
+99
+41
+58
+57
+95
+78
+64
+183
+110
+59
+234
+125
+52
+234
+126
+45
+234
+125
+52
+227
+126
+50
+227
+126
+50
+234
+125
+52
+234
+126
+45
+227
+126
+50
+183
+110
+59
+95
+78
+64
+43
+57
+62
+124
+111
+99
+236
+186
+153
+252
+185
+144
+250
+176
+132
+249
+174
+124
+249
+174
+124
+248
+180
+134
+251
+192
+154
+154
+133
+118
+43
+57
+62
+81
+73
+62
+173
+106
+60
+227
+126
+50
+234
+126
+45
+227
+126
+50
+227
+126
+50
+227
+126
+50
+234
+126
+45
+234
+125
+52
+155
+100
+63
+56
+64
+60
+35
+56
+60
+89
+75
+66
+227
+126
+50
+234
+126
+45
+238
+128
+40
+146
+97
+64
+43
+57
+62
+176
+156
+141
+58
+69
+70
+118
+86
+65
+234
+126
+45
+234
+126
+45
+234
+126
+45
+112
+85
+63
+43
+57
+62
+210
+156
+119
+245
+162
+103
+247
+150
+84
+247
+143
+74
+248
+138
+64
+241
+138
+68
+249
+146
+83
+249
+159
+103
+250
+176
+132
+195
+157
+134
+58
+69
+70
+65
+67
+64
+155
+100
+63
+227
+126
+50
+234
+126
+45
+227
+126
+50
+227
+126
+50
+234
+125
+52
+234
+126
+45
+234
+126
+45
+173
+106
+60
+65
+67
+64
+35
+56
+60
+106
+82
+65
+234
+126
+45
+234
+126
+45
+238
+128
+40
+146
+97
+64
+43
+57
+62
+187
+166
+150
+234
+204
+183
+55
+66
+67
+106
+82
+65
+234
+126
+45
+234
+125
+52
+234
+125
+52
+224
+123
+55
+81
+73
+62
+91
+92
+89
+245
+212
+186
+253
+212
+188
+253
+212
+188
+137
+127
+115
+41
+58
+57
+89
+75
+66
+173
+106
+60
+227
+126
+50
+234
+126
+45
+227
+126
+50
+227
+126
+50
+227
+126
+50
+234
+125
+52
+234
+126
+45
+234
+125
+52
+194
+112
+58
+106
+82
+65
+43
+57
+62
+101
+100
+92
+227
+196
+175
+251
+209
+178
+251
+209
+178
+253
+212
+188
+97
+98
+96
+69
+69
+61
+209
+117
+53
+234
+126
+45
+238
+128
+40
+173
+106
+60
+51
+62
+63
+139
+115
+96
+251
+168
+115
+246
+156
+93
+247
+150
+84
+249
+146
+83
+249
+152
+92
+247
+165
+111
+248
+180
+134
+250
+200
+166
+187
+166
+150
+55
+66
+67
+69
+69
+61
+163
+104
+61
+234
+125
+52
+234
+126
+45
+234
+125
+52
+227
+126
+50
+227
+126
+50
+234
+126
+45
+234
+126
+45
+199
+115
+54
+95
+78
+64
+35
+56
+60
+81
+73
+62
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+139
+96
+61
+51
+62
+63
+250
+197
+158
+245
+169
+119
+247
+150
+84
+247
+130
+60
+247
+118
+39
+235
+107
+16
+243
+101
+2
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+246
+97
+3
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+246
+97
+3
+237
+95
+0
+243
+101
+2
+247
+103
+7
+236
+102
+14
+247
+111
+26
+246
+116
+28
+238
+123
+45
+241
+132
+59
+247
+143
+74
+246
+156
+93
+245
+169
+119
+230
+173
+136
+47
+40
+38
+59
+50
+39
+168
+127
+42
+161
+127
+40
+160
+120
+43
+192
+155
+91
+255
+238
+227
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+253
+255
+252
+239
+227
+208
+170
+137
+67
+171
+129
+45
+171
+129
+45
+171
+129
+45
+59
+50
+39
+154
+133
+118
+250
+200
+166
+250
+197
+158
+249
+189
+146
+248
+180
+134
+249
+174
+124
+247
+165
+111
+247
+165
+111
+245
+162
+103
+249
+159
+103
+245
+162
+103
+247
+165
+111
+249
+174
+124
+203
+161
+131
+55
+66
+67
+69
+69
+61
+111
+94
+57
+105
+93
+60
+69
+69
+61
+63
+74
+74
+137
+127
+115
+51
+62
+63
+62
+63
+61
+95
+87
+59
+129
+106
+52
+137
+110
+49
+137
+110
+49
+123
+102
+54
+95
+87
+59
+62
+63
+61
+51
+62
+63
+133
+120
+107
+239
+182
+144
+248
+180
+134
+245
+169
+119
+247
+165
+111
+249
+159
+103
+245
+162
+103
+251
+168
+115
+250
+176
+132
+239
+182
+144
+154
+133
+118
+63
+74
+74
+51
+62
+63
+75
+74
+61
+105
+93
+60
+123
+102
+54
+137
+110
+49
+137
+110
+49
+137
+110
+49
+123
+102
+54
+100
+89
+56
+75
+74
+61
+56
+64
+60
+55
+66
+67
+124
+111
+99
+219
+170
+138
+252
+185
+144
+250
+176
+132
+249
+174
+124
+249
+174
+124
+250
+176
+132
+252
+185
+144
+236
+186
+153
+124
+111
+99
+48
+58
+59
+63
+69
+60
+95
+87
+59
+123
+102
+54
+137
+110
+49
+137
+110
+49
+129
+106
+52
+95
+87
+59
+62
+63
+61
+55
+66
+67
+146
+135
+124
+77
+85
+81
+61
+67
+58
+105
+93
+60
+111
+94
+57
+75
+74
+61
+48
+58
+59
+194
+173
+157
+255
+215
+190
+255
+215
+190
+255
+215
+190
+234
+204
+183
+120
+114
+108
+43
+57
+62
+69
+69
+61
+100
+89
+56
+129
+106
+52
+137
+110
+49
+137
+110
+49
+129
+106
+52
+105
+93
+60
+69
+69
+61
+48
+58
+59
+77
+85
+81
+51
+62
+63
+137
+110
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+137
+110
+49
+51
+62
+63
+187
+166
+150
+187
+166
+150
+48
+58
+59
+75
+74
+61
+111
+94
+57
+95
+87
+59
+56
+64
+60
+99
+90
+79
+239
+182
+144
+252
+185
+144
+245
+179
+138
+252
+185
+144
+249
+189
+146
+236
+186
+153
+137
+127
+115
+55
+66
+67
+56
+64
+60
+83
+78
+61
+111
+94
+57
+129
+106
+52
+137
+110
+49
+137
+110
+49
+129
+106
+52
+117
+98
+55
+95
+87
+59
+69
+69
+61
+51
+62
+63
+63
+74
+74
+133
+120
+107
+236
+186
+153
+250
+197
+158
+251
+192
+154
+251
+192
+154
+250
+197
+158
+124
+111
+99
+51
+62
+63
+112
+85
+63
+146
+97
+64
+106
+82
+65
+48
+58
+59
+120
+114
+108
+101
+100
+92
+48
+58
+59
+95
+78
+64
+146
+97
+64
+183
+110
+59
+188
+112
+56
+173
+106
+60
+139
+96
+61
+89
+75
+66
+48
+58
+59
+77
+85
+81
+186
+157
+134
+245
+179
+138
+245
+169
+119
+245
+162
+103
+246
+156
+93
+246
+156
+93
+246
+156
+93
+247
+165
+111
+249
+174
+124
+249
+189
+146
+154
+133
+118
+58
+69
+70
+51
+62
+63
+95
+78
+64
+139
+96
+61
+173
+106
+60
+183
+110
+59
+183
+110
+59
+173
+106
+60
+139
+96
+61
+95
+78
+64
+51
+62
+63
+63
+74
+74
+167
+142
+123
+249
+189
+146
+249
+174
+124
+247
+165
+111
+246
+156
+93
+246
+156
+93
+246
+156
+93
+245
+162
+103
+245
+169
+119
+245
+179
+138
+178
+146
+122
+70
+79
+77
+48
+58
+59
+89
+75
+66
+139
+96
+61
+173
+106
+60
+188
+112
+56
+183
+110
+59
+155
+100
+63
+95
+78
+64
+48
+58
+59
+101
+100
+92
+146
+135
+124
+48
+58
+59
+95
+78
+64
+146
+97
+64
+125
+90
+64
+62
+63
+61
+101
+100
+92
+245
+212
+186
+137
+127
+115
+48
+58
+59
+106
+82
+65
+146
+97
+64
+106
+82
+65
+48
+58
+59
+124
+111
+99
+247
+165
+111
+247
+150
+84
+241
+138
+68
+241
+132
+59
+247
+130
+53
+247
+130
+53
+242
+133
+67
+241
+145
+79
+245
+162
+103
+250
+176
+132
+203
+161
+131
+91
+92
+89
+43
+57
+62
+81
+73
+62
+135
+94
+64
+173
+106
+60
+188
+112
+56
+183
+110
+59
+155
+100
+63
+106
+82
+65
+51
+62
+63
+91
+92
+89
+133
+120
+107
+48
+58
+59
+95
+78
+64
+146
+97
+64
+118
+86
+65
+56
+64
+60
+101
+100
+92
+245
+212
+186
+253
+212
+188
+146
+135
+124
+48
+58
+59
+118
+86
+65
+183
+110
+59
+173
+106
+60
+95
+78
+64
+43
+57
+62
+186
+157
+134
+250
+197
+158
+251
+192
+154
+250
+197
+158
+250
+200
+166
+172
+150
+134
+70
+79
+77
+48
+58
+59
+89
+75
+66
+135
+94
+64
+163
+104
+61
+183
+110
+59
+183
+110
+59
+173
+106
+60
+146
+97
+64
+95
+78
+64
+56
+64
+60
+55
+66
+67
+150
+125
+114
+236
+186
+153
+251
+192
+154
+249
+189
+146
+249
+189
+146
+251
+192
+154
+195
+157
+134
+51
+62
+63
+76
+70
+64
+139
+96
+61
+125
+90
+64
+65
+67
+64
+76
+78
+76
+234
+168
+124
+249
+159
+103
+247
+150
+84
+243
+141
+78
+247
+143
+74
+247
+150
+84
+249
+159
+103
+250
+176
+132
+250
+197
+158
+255
+215
+190
+207
+178
+158
+84
+85
+82
+48
+58
+59
+89
+75
+66
+146
+97
+64
+173
+106
+60
+183
+110
+59
+183
+110
+59
+163
+104
+61
+118
+86
+65
+62
+63
+61
+58
+69
+70
+63
+74
+74
+81
+73
+62
+227
+126
+50
+227
+126
+50
+224
+123
+55
+234
+126
+45
+135
+94
+64
+58
+69
+70
+251
+192
+154
+245
+169
+119
+249
+146
+83
+247
+130
+53
+238
+116
+34
+235
+107
+16
+243
+101
+2
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+246
+97
+3
+246
+97
+3
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+243
+101
+2
+236
+102
+14
+236
+102
+14
+235
+107
+16
+246
+116
+28
+239
+117
+44
+241
+132
+59
+247
+143
+74
+249
+152
+92
+214
+151
+109
+118
+86
+65
+146
+111
+88
+192
+155
+91
+192
+155
+91
+195
+167
+113
+239
+227
+208
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+255
+238
+227
+216
+194
+154
+192
+155
+91
+192
+155
+91
+192
+155
+91
+146
+111
+88
+162
+125
+96
+250
+176
+132
+245
+169
+119
+247
+165
+111
+249
+159
+103
+246
+156
+93
+247
+150
+84
+243
+141
+78
+243
+141
+78
+243
+141
+78
+241
+145
+79
+247
+150
+84
+249
+159
+103
+245
+169
+119
+187
+140
+108
+89
+84
+82
+48
+58
+59
+48
+58
+59
+91
+92
+89
+194
+173
+157
+255
+215
+190
+207
+178
+158
+109
+106
+99
+51
+62
+63
+48
+58
+59
+51
+62
+63
+48
+58
+59
+48
+58
+59
+55
+66
+67
+124
+111
+99
+203
+161
+131
+248
+180
+134
+245
+169
+119
+249
+159
+103
+247
+150
+84
+243
+141
+78
+243
+141
+78
+243
+141
+78
+247
+150
+84
+249
+159
+103
+245
+169
+119
+248
+180
+134
+219
+170
+138
+154
+133
+118
+84
+85
+82
+51
+62
+63
+48
+58
+59
+51
+62
+63
+51
+62
+63
+48
+58
+59
+48
+58
+59
+55
+66
+67
+91
+92
+89
+154
+133
+118
+209
+171
+139
+245
+179
+138
+249
+174
+124
+247
+165
+111
+249
+159
+103
+246
+156
+93
+246
+156
+93
+249
+159
+103
+247
+165
+111
+249
+174
+124
+252
+185
+144
+195
+157
+134
+109
+106
+99
+55
+66
+67
+48
+58
+59
+51
+62
+63
+51
+62
+63
+48
+58
+59
+51
+62
+63
+109
+106
+99
+207
+178
+158
+255
+215
+190
+217
+187
+166
+91
+92
+89
+51
+62
+63
+48
+58
+59
+76
+78
+76
+172
+150
+134
+253
+212
+188
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+255
+215
+190
+194
+173
+157
+101
+100
+92
+51
+62
+63
+48
+58
+59
+48
+58
+59
+51
+62
+63
+48
+58
+59
+48
+58
+59
+97
+98
+96
+194
+173
+157
+146
+135
+124
+56
+64
+60
+145
+114
+49
+168
+127
+42
+158
+125
+46
+168
+127
+42
+129
+106
+52
+48
+58
+59
+194
+173
+157
+255
+215
+190
+176
+156
+141
+76
+78
+76
+48
+58
+59
+55
+66
+67
+115
+102
+92
+234
+168
+124
+245
+169
+119
+247
+165
+111
+247
+165
+111
+247
+165
+111
+245
+169
+119
+249
+174
+124
+245
+179
+138
+209
+171
+139
+144
+125
+110
+76
+78
+76
+48
+58
+59
+48
+58
+59
+51
+62
+63
+51
+62
+63
+48
+58
+59
+48
+58
+59
+58
+69
+70
+101
+100
+92
+154
+133
+118
+219
+170
+138
+252
+185
+144
+248
+180
+134
+249
+174
+124
+245
+169
+119
+249
+174
+124
+250
+176
+132
+230
+173
+136
+124
+111
+99
+55
+66
+67
+43
+57
+62
+58
+69
+70
+137
+127
+115
+245
+212
+186
+245
+212
+186
+161
+144
+134
+70
+79
+77
+43
+57
+62
+51
+62
+63
+51
+62
+63
+48
+58
+59
+43
+57
+62
+84
+85
+82
+154
+133
+118
+240
+181
+138
+249
+174
+124
+247
+165
+111
+249
+152
+92
+243
+141
+78
+241
+138
+68
+242
+133
+67
+241
+138
+68
+241
+145
+79
+246
+156
+93
+247
+165
+111
+250
+176
+132
+219
+170
+138
+144
+125
+110
+77
+85
+81
+43
+57
+62
+48
+58
+59
+48
+58
+59
+51
+62
+63
+48
+58
+59
+43
+57
+62
+77
+85
+81
+150
+125
+114
+219
+170
+138
+250
+176
+132
+247
+165
+111
+246
+156
+93
+241
+145
+79
+241
+138
+68
+241
+138
+68
+241
+138
+68
+243
+141
+78
+249
+152
+92
+247
+165
+111
+250
+176
+132
+230
+173
+136
+154
+133
+118
+77
+85
+81
+43
+57
+62
+48
+58
+59
+51
+62
+63
+48
+58
+59
+43
+57
+62
+70
+79
+77
+161
+144
+134
+245
+212
+186
+255
+215
+190
+161
+144
+134
+63
+74
+74
+43
+57
+62
+51
+62
+63
+109
+106
+99
+217
+187
+166
+251
+209
+178
+238
+205
+179
+137
+127
+115
+58
+69
+70
+43
+57
+62
+58
+69
+70
+139
+115
+96
+238
+159
+107
+249
+152
+92
+241
+138
+68
+247
+130
+53
+238
+123
+45
+239
+117
+44
+247
+118
+39
+238
+123
+45
+241
+132
+59
+241
+145
+79
+249
+159
+103
+249
+174
+124
+240
+181
+138
+167
+142
+123
+91
+92
+89
+43
+57
+62
+48
+58
+59
+51
+62
+63
+48
+58
+59
+43
+57
+62
+63
+74
+74
+137
+127
+115
+234
+204
+183
+255
+215
+190
+146
+135
+124
+63
+74
+74
+43
+57
+62
+51
+62
+63
+115
+102
+92
+236
+186
+153
+251
+192
+154
+251
+192
+154
+236
+186
+153
+133
+120
+107
+43
+57
+62
+48
+58
+59
+48
+58
+59
+55
+66
+67
+158
+130
+108
+248
+180
+134
+250
+176
+132
+249
+174
+124
+249
+174
+124
+250
+176
+132
+252
+185
+144
+239
+182
+144
+154
+133
+118
+84
+85
+82
+43
+57
+62
+48
+58
+59
+48
+58
+59
+51
+62
+63
+48
+58
+59
+43
+57
+62
+70
+79
+77
+133
+120
+107
+219
+170
+138
+245
+179
+138
+250
+176
+132
+245
+169
+119
+247
+165
+111
+247
+165
+111
+245
+169
+119
+249
+174
+124
+187
+140
+108
+81
+77
+76
+43
+57
+62
+43
+57
+62
+99
+90
+79
+214
+151
+109
+249
+159
+103
+247
+150
+84
+247
+143
+74
+241
+138
+68
+241
+138
+68
+249
+146
+83
+249
+159
+103
+250
+176
+132
+250
+197
+158
+255
+215
+190
+255
+215
+190
+245
+212
+186
+161
+144
+134
+77
+85
+81
+43
+57
+62
+48
+58
+59
+51
+62
+63
+48
+58
+59
+41
+58
+57
+55
+66
+67
+120
+114
+108
+217
+187
+166
+97
+98
+96
+95
+78
+64
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+112
+85
+63
+70
+79
+77
+249
+189
+146
+247
+165
+111
+243
+141
+78
+247
+130
+53
+238
+116
+34
+236
+102
+14
+243
+101
+2
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+235
+94
+9
+235
+94
+9
+236
+102
+14
+235
+107
+16
+236
+108
+29
+239
+117
+44
+238
+123
+53
+242
+133
+67
+241
+145
+79
+241
+153
+96
+247
+165
+111
+249
+174
+124
+250
+176
+132
+245
+179
+138
+252
+185
+144
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+249
+189
+146
+252
+185
+144
+245
+179
+138
+250
+176
+132
+249
+174
+124
+245
+169
+119
+245
+162
+103
+241
+153
+96
+241
+145
+86
+243
+141
+78
+241
+138
+68
+242
+133
+67
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+241
+132
+59
+242
+133
+67
+243
+141
+78
+241
+145
+86
+249
+159
+103
+238
+159
+107
+210
+156
+119
+210
+156
+119
+240
+181
+138
+249
+189
+146
+251
+192
+154
+251
+192
+154
+250
+197
+158
+212
+173
+150
+186
+157
+134
+167
+142
+123
+167
+142
+123
+195
+157
+134
+219
+170
+138
+248
+180
+134
+245
+169
+119
+245
+162
+103
+247
+150
+84
+243
+141
+78
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+138
+68
+247
+150
+84
+245
+162
+103
+245
+169
+119
+250
+176
+132
+239
+182
+144
+219
+170
+138
+186
+157
+134
+167
+142
+123
+167
+142
+123
+172
+150
+134
+195
+157
+134
+219
+170
+138
+239
+182
+144
+248
+180
+134
+245
+169
+119
+245
+162
+103
+241
+153
+96
+241
+145
+79
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+145
+79
+241
+153
+96
+247
+165
+111
+249
+174
+124
+245
+179
+138
+219
+170
+138
+186
+157
+134
+167
+142
+123
+167
+142
+123
+186
+157
+134
+212
+173
+150
+250
+197
+158
+251
+192
+154
+251
+192
+154
+249
+189
+146
+239
+182
+144
+219
+170
+138
+219
+170
+138
+239
+182
+144
+250
+197
+158
+250
+200
+166
+251
+209
+178
+238
+205
+179
+172
+150
+134
+137
+127
+115
+161
+144
+134
+217
+187
+166
+253
+212
+188
+227
+196
+175
+194
+173
+157
+176
+156
+141
+172
+150
+134
+187
+166
+150
+217
+187
+166
+255
+215
+190
+245
+212
+186
+76
+78
+76
+75
+74
+61
+158
+125
+46
+158
+125
+46
+158
+125
+46
+171
+129
+45
+105
+93
+60
+58
+69
+70
+217
+187
+166
+255
+215
+190
+253
+204
+176
+236
+186
+153
+210
+156
+119
+210
+156
+119
+247
+165
+111
+249
+159
+103
+249
+152
+92
+241
+145
+86
+243
+141
+78
+241
+145
+79
+247
+150
+84
+241
+153
+96
+245
+162
+103
+245
+169
+119
+248
+180
+134
+239
+182
+144
+209
+171
+139
+186
+157
+134
+167
+142
+123
+167
+142
+123
+178
+146
+122
+195
+157
+134
+230
+173
+136
+239
+182
+144
+250
+176
+132
+245
+169
+119
+247
+165
+111
+249
+159
+103
+241
+153
+96
+249
+152
+92
+249
+152
+92
+241
+153
+96
+245
+162
+103
+247
+165
+111
+210
+156
+119
+210
+156
+119
+230
+173
+136
+249
+189
+146
+249
+189
+146
+251
+192
+154
+250
+197
+158
+236
+186
+153
+203
+161
+131
+167
+142
+123
+167
+142
+123
+178
+146
+122
+203
+161
+131
+240
+181
+138
+249
+174
+124
+247
+165
+111
+241
+153
+96
+243
+141
+78
+242
+133
+67
+238
+123
+53
+238
+123
+45
+238
+123
+45
+238
+123
+45
+241
+132
+59
+241
+138
+68
+241
+145
+86
+249
+159
+103
+245
+169
+119
+250
+176
+132
+240
+181
+138
+209
+171
+139
+178
+146
+122
+167
+142
+123
+167
+142
+123
+186
+157
+134
+209
+171
+139
+240
+181
+138
+250
+176
+132
+245
+169
+119
+249
+159
+103
+241
+145
+86
+241
+138
+68
+241
+132
+59
+238
+123
+45
+238
+123
+45
+238
+123
+45
+247
+130
+53
+242
+133
+67
+241
+145
+79
+241
+153
+96
+247
+165
+111
+250
+176
+132
+240
+181
+138
+203
+161
+131
+178
+146
+122
+167
+142
+123
+167
+142
+123
+195
+157
+134
+236
+186
+153
+251
+192
+154
+251
+192
+154
+249
+189
+146
+249
+189
+146
+230
+173
+136
+203
+161
+131
+219
+170
+138
+245
+179
+138
+245
+179
+138
+245
+179
+138
+245
+179
+138
+248
+180
+134
+234
+168
+124
+214
+151
+109
+214
+151
+109
+245
+162
+103
+241
+145
+86
+241
+138
+68
+238
+123
+53
+239
+117
+44
+238
+116
+34
+236
+108
+29
+236
+108
+29
+238
+116
+34
+238
+123
+45
+241
+132
+59
+243
+141
+78
+241
+153
+96
+247
+165
+111
+249
+174
+124
+240
+181
+138
+209
+171
+139
+178
+146
+122
+167
+142
+123
+167
+142
+123
+195
+157
+134
+236
+186
+153
+250
+197
+158
+251
+192
+154
+249
+189
+146
+249
+189
+146
+230
+173
+136
+210
+156
+119
+210
+156
+119
+250
+176
+132
+249
+174
+124
+249
+174
+124
+249
+174
+124
+249
+174
+124
+250
+176
+132
+210
+156
+119
+162
+125
+96
+162
+125
+96
+214
+151
+109
+247
+165
+111
+245
+162
+103
+241
+153
+96
+241
+153
+96
+241
+153
+96
+249
+159
+103
+247
+165
+111
+245
+169
+119
+250
+176
+132
+240
+181
+138
+209
+171
+139
+186
+157
+134
+167
+142
+123
+167
+142
+123
+178
+146
+122
+203
+161
+131
+239
+182
+144
+248
+180
+134
+245
+169
+119
+245
+162
+103
+241
+153
+96
+241
+145
+86
+241
+145
+86
+241
+145
+86
+247
+150
+84
+241
+153
+96
+245
+162
+103
+238
+159
+107
+204
+141
+99
+214
+151
+109
+241
+153
+96
+249
+152
+92
+243
+141
+78
+242
+133
+67
+241
+132
+59
+241
+132
+59
+241
+138
+68
+241
+145
+79
+245
+162
+103
+248
+180
+134
+212
+173
+150
+146
+135
+124
+137
+127
+115
+176
+156
+141
+234
+204
+183
+253
+212
+188
+217
+187
+166
+187
+166
+150
+172
+150
+134
+176
+156
+141
+194
+173
+157
+234
+204
+183
+255
+215
+190
+194
+173
+157
+43
+57
+62
+139
+96
+61
+234
+126
+45
+224
+123
+55
+227
+126
+50
+227
+126
+50
+89
+75
+66
+101
+100
+92
+245
+179
+138
+245
+162
+103
+241
+138
+68
+238
+123
+45
+236
+108
+29
+236
+102
+14
+235
+94
+9
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+235
+94
+9
+235
+94
+9
+236
+102
+14
+235
+107
+16
+236
+108
+29
+238
+116
+34
+238
+123
+45
+241
+132
+59
+241
+138
+68
+241
+145
+79
+249
+152
+92
+241
+153
+96
+245
+162
+103
+245
+162
+103
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+245
+162
+103
+245
+162
+103
+241
+153
+96
+241
+153
+96
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+243
+141
+78
+241
+145
+86
+241
+153
+96
+245
+162
+103
+245
+162
+103
+247
+165
+111
+247
+165
+111
+245
+169
+119
+245
+169
+119
+245
+169
+119
+249
+174
+124
+245
+169
+119
+245
+169
+119
+245
+169
+119
+247
+165
+111
+241
+153
+96
+241
+145
+86
+243
+141
+78
+241
+132
+59
+238
+123
+53
+239
+117
+44
+238
+116
+34
+238
+116
+34
+238
+116
+34
+239
+117
+44
+238
+123
+45
+241
+132
+59
+241
+138
+68
+241
+145
+86
+241
+153
+96
+245
+162
+103
+245
+169
+119
+249
+174
+124
+250
+176
+132
+250
+176
+132
+250
+176
+132
+249
+174
+124
+245
+169
+119
+247
+165
+111
+241
+153
+96
+241
+145
+86
+243
+141
+78
+242
+133
+67
+241
+132
+59
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+241
+132
+59
+242
+133
+67
+243
+141
+78
+249
+152
+92
+245
+162
+103
+247
+165
+111
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+247
+165
+111
+247
+165
+111
+247
+165
+111
+247
+165
+111
+245
+169
+119
+249
+174
+124
+245
+179
+138
+251
+192
+154
+232
+190
+161
+101
+100
+92
+51
+62
+63
+63
+69
+60
+51
+62
+63
+55
+66
+67
+109
+106
+99
+176
+156
+141
+234
+204
+183
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+207
+178
+158
+91
+92
+89
+51
+62
+63
+129
+106
+52
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+75
+74
+61
+91
+92
+89
+245
+212
+186
+250
+200
+166
+252
+185
+144
+249
+174
+124
+247
+165
+111
+241
+153
+96
+241
+145
+79
+241
+138
+68
+242
+133
+67
+241
+132
+59
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+86
+241
+153
+96
+247
+165
+111
+245
+169
+119
+249
+174
+124
+250
+176
+132
+250
+176
+132
+249
+174
+124
+249
+174
+124
+245
+169
+119
+245
+162
+103
+241
+153
+96
+241
+145
+86
+241
+145
+79
+241
+138
+68
+242
+133
+67
+242
+133
+67
+242
+133
+67
+241
+138
+68
+243
+141
+78
+241
+145
+86
+241
+153
+96
+241
+153
+96
+245
+162
+103
+245
+162
+103
+247
+165
+111
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+247
+165
+111
+245
+162
+103
+241
+153
+96
+241
+145
+79
+241
+138
+68
+238
+123
+53
+238
+123
+45
+238
+116
+34
+235
+113
+30
+235
+113
+30
+238
+116
+34
+239
+117
+44
+238
+123
+45
+241
+132
+59
+241
+138
+68
+241
+145
+86
+241
+153
+96
+245
+162
+103
+245
+169
+119
+245
+169
+119
+249
+174
+124
+249
+174
+124
+245
+169
+119
+245
+169
+119
+245
+162
+103
+241
+153
+96
+241
+145
+86
+241
+138
+68
+241
+132
+59
+238
+123
+45
+239
+117
+44
+238
+116
+34
+235
+113
+30
+235
+113
+30
+238
+116
+34
+238
+123
+45
+241
+132
+59
+241
+138
+68
+241
+145
+86
+241
+153
+96
+245
+162
+103
+247
+165
+111
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+247
+165
+111
+247
+165
+111
+247
+165
+111
+245
+162
+103
+245
+162
+103
+245
+162
+103
+245
+162
+103
+245
+162
+103
+245
+162
+103
+245
+162
+103
+245
+162
+103
+241
+153
+96
+241
+153
+96
+241
+145
+86
+243
+141
+78
+241
+132
+59
+238
+123
+53
+239
+117
+44
+235
+113
+30
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+108
+29
+235
+113
+30
+239
+117
+44
+238
+123
+53
+242
+133
+67
+241
+145
+79
+241
+153
+96
+245
+162
+103
+247
+165
+111
+245
+169
+119
+245
+169
+119
+249
+174
+124
+245
+169
+119
+245
+169
+119
+245
+169
+119
+245
+169
+119
+247
+165
+111
+247
+165
+111
+245
+162
+103
+245
+162
+103
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+153
+96
+249
+152
+92
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+243
+141
+78
+241
+145
+86
+241
+153
+96
+245
+162
+103
+245
+169
+119
+245
+169
+119
+249
+174
+124
+249
+174
+124
+249
+174
+124
+245
+169
+119
+247
+165
+111
+241
+153
+96
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+79
+241
+145
+79
+241
+145
+79
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+242
+133
+67
+241
+145
+86
+247
+165
+111
+210
+156
+119
+63
+74
+74
+62
+63
+61
+69
+69
+61
+48
+58
+59
+63
+74
+74
+133
+120
+107
+194
+173
+157
+245
+212
+186
+255
+215
+190
+255
+215
+190
+255
+215
+190
+245
+212
+186
+176
+156
+141
+55
+66
+67
+76
+70
+64
+212
+120
+56
+227
+126
+50
+224
+123
+55
+234
+125
+52
+194
+112
+58
+56
+64
+60
+154
+133
+118
+250
+176
+132
+241
+153
+96
+242
+133
+67
+239
+117
+44
+236
+108
+29
+236
+102
+14
+235
+94
+9
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+236
+108
+29
+235
+113
+30
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+138
+68
+241
+138
+68
+243
+141
+78
+243
+141
+78
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+79
+243
+141
+78
+243
+141
+78
+243
+141
+78
+241
+138
+68
+241
+138
+68
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+238
+116
+34
+238
+116
+34
+236
+108
+29
+236
+108
+29
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+241
+132
+59
+242
+133
+67
+241
+138
+68
+243
+141
+78
+243
+141
+78
+241
+145
+79
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+239
+117
+44
+238
+116
+34
+236
+108
+29
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+108
+29
+238
+116
+34
+239
+117
+44
+238
+123
+45
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+86
+249
+152
+92
+241
+153
+96
+241
+153
+96
+241
+153
+96
+249
+152
+92
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+45
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+138
+68
+241
+145
+79
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+79
+241
+145
+79
+241
+145
+79
+241
+145
+86
+241
+153
+96
+245
+162
+103
+245
+169
+119
+245
+179
+138
+144
+125
+110
+51
+62
+63
+117
+98
+55
+158
+125
+46
+145
+114
+49
+105
+93
+60
+69
+69
+61
+48
+58
+59
+58
+69
+70
+91
+92
+89
+120
+114
+108
+120
+114
+108
+91
+92
+89
+48
+58
+59
+56
+64
+60
+123
+102
+54
+171
+129
+45
+158
+125
+46
+158
+125
+46
+168
+127
+42
+137
+110
+49
+48
+58
+59
+161
+144
+134
+250
+197
+158
+248
+180
+134
+247
+165
+111
+241
+153
+96
+241
+145
+79
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+86
+249
+152
+92
+241
+153
+96
+241
+153
+96
+241
+153
+96
+241
+145
+86
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+45
+238
+123
+45
+239
+117
+44
+238
+123
+45
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+138
+68
+241
+138
+68
+243
+141
+78
+241
+145
+79
+241
+145
+79
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+79
+243
+141
+78
+242
+133
+67
+241
+132
+59
+238
+123
+45
+238
+116
+34
+235
+113
+30
+236
+108
+29
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+108
+29
+235
+113
+30
+239
+117
+44
+238
+123
+45
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+86
+241
+145
+86
+241
+153
+96
+241
+153
+96
+241
+145
+86
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+45
+239
+117
+44
+235
+113
+30
+236
+108
+29
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+108
+29
+235
+113
+30
+239
+117
+44
+238
+123
+45
+241
+132
+59
+242
+133
+67
+243
+141
+78
+241
+145
+79
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+79
+241
+145
+79
+243
+141
+78
+243
+141
+78
+243
+141
+78
+243
+141
+78
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+242
+133
+67
+241
+132
+59
+238
+123
+53
+238
+123
+45
+238
+116
+34
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+238
+116
+34
+238
+123
+45
+238
+123
+53
+242
+133
+67
+241
+138
+68
+241
+145
+79
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+86
+241
+145
+79
+243
+141
+78
+243
+141
+78
+241
+138
+68
+241
+138
+68
+241
+138
+68
+242
+133
+67
+242
+133
+67
+242
+133
+67
+241
+138
+68
+241
+138
+68
+241
+138
+68
+241
+138
+68
+242
+133
+67
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+138
+68
+243
+141
+78
+241
+145
+86
+241
+145
+86
+241
+153
+96
+241
+153
+96
+241
+145
+86
+241
+145
+86
+243
+141
+78
+241
+138
+68
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+239
+117
+44
+239
+117
+44
+239
+117
+44
+238
+123
+45
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+239
+117
+44
+239
+117
+44
+238
+123
+53
+242
+133
+67
+241
+145
+86
+238
+159
+107
+84
+85
+82
+69
+69
+61
+188
+112
+56
+214
+121
+50
+173
+106
+60
+112
+85
+63
+62
+63
+61
+41
+58
+57
+63
+74
+74
+97
+98
+96
+120
+114
+108
+109
+106
+99
+77
+85
+81
+41
+58
+57
+81
+73
+62
+194
+112
+58
+234
+125
+52
+224
+123
+55
+224
+123
+55
+234
+126
+45
+125
+90
+64
+51
+62
+63
+209
+171
+139
+245
+169
+119
+241
+145
+86
+241
+132
+59
+238
+116
+34
+235
+107
+16
+236
+102
+14
+235
+94
+9
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+237
+95
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+235
+94
+9
+235
+94
+9
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+45
+238
+123
+45
+239
+117
+44
+239
+117
+44
+238
+116
+34
+235
+113
+30
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+238
+116
+34
+239
+117
+44
+239
+117
+44
+238
+123
+45
+238
+123
+45
+238
+123
+53
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+138
+68
+241
+145
+86
+238
+159
+107
+234
+168
+124
+84
+85
+82
+83
+78
+61
+171
+129
+45
+158
+125
+46
+168
+127
+42
+168
+127
+42
+158
+125
+46
+129
+106
+52
+100
+89
+56
+83
+78
+61
+75
+74
+61
+69
+69
+61
+83
+78
+61
+105
+93
+60
+152
+119
+47
+168
+127
+42
+158
+125
+46
+158
+125
+46
+161
+127
+40
+168
+127
+42
+75
+74
+61
+63
+74
+74
+236
+186
+153
+245
+179
+138
+238
+159
+107
+241
+145
+86
+241
+138
+68
+241
+132
+59
+238
+123
+45
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+45
+238
+123
+53
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+45
+238
+116
+34
+235
+113
+30
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+239
+117
+44
+239
+117
+44
+238
+116
+34
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+53
+238
+123
+53
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+239
+117
+44
+239
+117
+44
+239
+117
+44
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+238
+123
+45
+239
+117
+44
+239
+117
+44
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+239
+117
+44
+238
+123
+45
+238
+123
+53
+238
+123
+53
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+241
+132
+59
+238
+123
+53
+238
+123
+45
+239
+117
+44
+238
+116
+34
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+123
+45
+241
+132
+59
+241
+145
+86
+204
+141
+99
+41
+58
+57
+155
+100
+63
+234
+126
+45
+227
+126
+50
+227
+126
+50
+234
+125
+52
+209
+117
+53
+155
+100
+63
+118
+86
+65
+89
+75
+66
+81
+73
+62
+81
+73
+62
+106
+82
+65
+155
+100
+63
+214
+121
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+194
+112
+58
+56
+64
+60
+109
+106
+99
+245
+179
+138
+245
+162
+103
+241
+138
+68
+238
+123
+45
+235
+113
+30
+236
+102
+14
+235
+94
+9
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+235
+113
+30
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+230
+97
+5
+230
+97
+5
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+113
+30
+235
+113
+30
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+239
+117
+44
+239
+117
+44
+239
+117
+44
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+235
+113
+30
+238
+116
+34
+238
+123
+45
+238
+123
+53
+241
+138
+68
+241
+145
+86
+238
+159
+107
+89
+84
+82
+75
+74
+61
+168
+127
+42
+168
+127
+42
+158
+125
+46
+158
+125
+46
+161
+127
+40
+168
+127
+42
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+95
+87
+59
+48
+58
+59
+167
+142
+123
+245
+179
+138
+238
+159
+107
+241
+145
+86
+242
+133
+67
+238
+123
+45
+238
+116
+34
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+239
+117
+44
+239
+117
+44
+239
+117
+44
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+113
+30
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+235
+113
+30
+235
+113
+30
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+230
+97
+5
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+235
+113
+30
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+236
+108
+29
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+113
+30
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+238
+116
+34
+235
+113
+30
+236
+108
+29
+236
+108
+29
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+236
+108
+29
+236
+108
+29
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+108
+29
+235
+113
+30
+239
+117
+44
+241
+132
+59
+241
+145
+79
+204
+141
+99
+48
+58
+59
+139
+96
+61
+234
+126
+45
+224
+123
+55
+224
+123
+55
+224
+123
+55
+227
+126
+50
+234
+126
+45
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+126
+45
+234
+126
+45
+227
+126
+50
+224
+123
+55
+224
+123
+55
+234
+125
+52
+214
+121
+50
+81
+73
+62
+58
+69
+70
+219
+170
+138
+245
+169
+119
+241
+145
+86
+241
+132
+59
+239
+117
+44
+236
+108
+29
+236
+102
+14
+235
+94
+9
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+235
+94
+9
+230
+97
+5
+229
+102
+7
+229
+102
+7
+236
+102
+14
+236
+102
+14
+224
+98
+18
+224
+98
+18
+224
+98
+18
+236
+102
+14
+224
+98
+18
+236
+102
+14
+236
+102
+14
+224
+98
+18
+224
+98
+18
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+224
+98
+18
+236
+102
+14
+236
+102
+14
+229
+102
+7
+229
+102
+7
+230
+97
+5
+235
+94
+9
+235
+94
+9
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+235
+94
+9
+230
+97
+5
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+224
+98
+18
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+235
+94
+9
+230
+97
+5
+229
+102
+7
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+224
+98
+18
+236
+102
+14
+229
+102
+7
+230
+97
+5
+235
+94
+9
+235
+94
+9
+230
+97
+5
+231
+91
+2
+230
+97
+5
+235
+94
+9
+235
+94
+9
+235
+94
+9
+230
+97
+5
+229
+102
+7
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+224
+98
+18
+236
+102
+14
+235
+107
+16
+236
+108
+29
+239
+117
+44
+234
+125
+52
+231
+136
+72
+241
+153
+96
+162
+125
+96
+48
+58
+59
+95
+87
+59
+158
+125
+46
+171
+129
+45
+168
+127
+42
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+158
+125
+46
+168
+127
+42
+171
+129
+45
+158
+125
+46
+95
+87
+59
+48
+58
+59
+124
+111
+99
+245
+179
+138
+247
+165
+111
+241
+145
+86
+241
+132
+59
+238
+123
+45
+238
+116
+34
+236
+108
+29
+224
+98
+18
+229
+102
+7
+230
+97
+5
+235
+94
+9
+235
+94
+9
+230
+97
+5
+230
+97
+5
+230
+97
+5
+235
+94
+9
+230
+97
+5
+229
+102
+7
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+94
+9
+230
+97
+5
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+236
+102
+14
+224
+98
+18
+224
+98
+18
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+224
+98
+18
+236
+102
+14
+229
+102
+7
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+229
+102
+7
+236
+102
+14
+224
+98
+18
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+224
+98
+18
+236
+102
+14
+229
+102
+7
+230
+97
+5
+235
+94
+9
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+235
+94
+9
+235
+94
+9
+229
+102
+7
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+235
+107
+16
+236
+102
+14
+224
+98
+18
+224
+98
+18
+236
+102
+14
+224
+98
+18
+224
+98
+18
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+229
+102
+7
+236
+102
+14
+235
+94
+9
+230
+97
+5
+235
+94
+9
+235
+94
+9
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+235
+94
+9
+230
+97
+5
+230
+97
+5
+229
+102
+7
+236
+102
+14
+224
+98
+18
+236
+102
+14
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+224
+98
+18
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+236
+102
+14
+224
+98
+18
+236
+102
+14
+236
+102
+14
+236
+102
+14
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+236
+102
+14
+236
+102
+14
+224
+98
+18
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+235
+107
+16
+236
+102
+14
+236
+102
+14
+236
+102
+14
+229
+102
+7
+230
+97
+5
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+235
+94
+9
+230
+97
+5
+235
+94
+9
+236
+102
+14
+236
+102
+14
+236
+102
+14
+229
+102
+7
+230
+97
+5
+229
+102
+7
+224
+98
+18
+236
+108
+29
+238
+116
+34
+238
+123
+53
+243
+141
+78
+241
+153
+96
+99
+90
+79
+56
+64
+60
+155
+100
+63
+234
+126
+45
+234
+126
+45
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+227
+126
+50
+224
+123
+55
+224
+123
+55
+227
+126
+50
+227
+126
+50
+234
+126
+45
+194
+112
+58
+81
+73
+62
+48
+58
+59
+178
+146
+122
+249
+174
+124
+241
+153
+96
+231
+136
+72
+234
+125
+52
+238
+116
+34
+235
+107
+16
+229
+102
+7
+235
+94
+9
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+229
+102
+7
+236
+102
+14
+235
+113
+30
+239
+117
+44
+230
+128
+60
+236
+147
+85
+238
+159
+107
+139
+115
+96
+48
+58
+59
+69
+69
+61
+111
+94
+57
+145
+114
+49
+158
+125
+46
+168
+127
+42
+171
+129
+45
+168
+127
+42
+168
+127
+42
+168
+127
+42
+168
+127
+42
+171
+129
+45
+168
+127
+42
+152
+119
+47
+117
+98
+55
+69
+69
+61
+48
+58
+59
+144
+125
+110
+240
+181
+138
+247
+165
+111
+236
+147
+85
+242
+133
+67
+238
+123
+45
+235
+113
+30
+235
+107
+16
+236
+102
+14
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+230
+97
+5
+229
+102
+7
+235
+107
+16
+235
+113
+30
+238
+123
+45
+242
+133
+67
+241
+153
+96
+214
+151
+109
+99
+90
+79
+48
+58
+59
+95
+78
+64
+155
+100
+63
+209
+117
+53
+227
+126
+50
+234
+125
+52
+234
+125
+52
+234
+125
+52
+234
+125
+52
+234
+125
+52
+234
+126
+45
+234
+126
+45
+227
+126
+50
+194
+112
+58
+125
+90
+64
+56
+64
+60
+58
+69
+70
+178
+146
+122
+250
+176
+132
+238
+159
+107
+241
+145
+79
+234
+125
+52
+239
+117
+44
+236
+108
+29
+224
+98
+18
+230
+97
+5
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+230
+97
+5
+229
+102
+7
+223
+103
+18
+226
+110
+35
+234
+125
+52
+231
+136
+72
+241
+153
+96
+245
+169
+119
+178
+146
+122
+101
+100
+92
+48
+58
+59
+56
+64
+60
+69
+69
+61
+95
+87
+59
+111
+94
+57
+123
+102
+54
+129
+106
+52
+129
+106
+52
+123
+102
+54
+105
+93
+60
+88
+82
+59
+62
+63
+61
+48
+58
+59
+91
+92
+89
+186
+157
+134
+245
+179
+138
+238
+159
+107
+236
+147
+85
+230
+128
+60
+234
+125
+52
+226
+110
+35
+223
+103
+18
+224
+98
+18
+230
+97
+5
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+230
+97
+5
+224
+98
+18
+236
+108
+29
+239
+117
+44
+230
+123
+57
+243
+141
+78
+238
+159
+107
+234
+168
+124
+158
+130
+108
+76
+78
+76
+41
+58
+57
+62
+63
+61
+95
+78
+64
+125
+90
+64
+146
+97
+64
+163
+104
+61
+173
+106
+60
+163
+104
+61
+155
+100
+63
+125
+90
+64
+95
+78
+64
+56
+64
+60
+43
+57
+62
+124
+111
+99
+209
+171
+139
+234
+168
+124
+238
+159
+107
+241
+145
+79
+230
+128
+60
+239
+117
+44
+236
+108
+29
+236
+102
+14
+229
+102
+7
+230
+97
+5
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+231
+91
+2
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+226
+93
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+230
+97
+5
+230
+97
+5
+224
+98
+18
+236
+108
+29
+226
+110
+35
+230
+123
+57
+231
+136
+72
+241
+153
+96
+238
+159
+107
+240
+181
+138
+203
+161
+131
+150
+125
+114
+101
+100
+92
+76
+78
+76
+55
+66
+67
+48
+58
+59
+48
+58
+59
+48
+58
+59
+48
+58
+59
+58
+69
+70
+84
+85
+82
+124
+111
+99
+178
+146
+122
+240
+181
+138
+234
+168
+124
+238
+159
+107
+236
+147
+85
+230
+128
+60
+234
+125
+52
+226
+110
+35
+223
+103
+18
+224
+98
+18
+230
+97
+5
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+230
+97
+5
+224
+98
+18
+223
+103
+18
+226
+110
+35
+225
+124
+48
+230
+128
+60
+236
+147
+85
+241
+153
+96
+234
+168
+124
+230
+173
+136
+186
+157
+134
+133
+120
+107
+91
+92
+89
+63
+74
+74
+51
+62
+63
+48
+58
+59
+48
+58
+59
+48
+58
+59
+51
+62
+63
+63
+74
+74
+91
+92
+89
+144
+125
+110
+203
+161
+131
+240
+181
+138
+245
+169
+119
+241
+153
+96
+241
+145
+79
+230
+128
+60
+225
+124
+48
+226
+110
+35
+223
+103
+18
+224
+98
+18
+230
+97
+5
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+230
+97
+5
+224
+98
+18
+223
+103
+18
+226
+110
+35
+239
+117
+44
+230
+123
+57
+231
+136
+72
+236
+147
+85
+238
+159
+107
+245
+169
+119
+234
+168
+124
+240
+181
+138
+239
+182
+144
+236
+186
+153
+250
+197
+158
+250
+197
+158
+250
+197
+158
+251
+192
+154
+236
+186
+153
+239
+182
+144
+245
+179
+138
+234
+168
+124
+238
+159
+107
+241
+153
+96
+231
+136
+72
+230
+128
+60
+225
+124
+48
+226
+110
+35
+223
+103
+18
+224
+98
+18
+230
+97
+5
+230
+97
+5
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+230
+97
+5
+224
+98
+18
+223
+103
+18
+226
+110
+35
+225
+124
+48
+230
+128
+60
+231
+136
+72
+241
+153
+96
+238
+159
+107
+234
+168
+124
+240
+181
+138
+239
+182
+144
+236
+186
+153
+251
+192
+154
+250
+197
+158
+250
+197
+158
+250
+197
+158
+236
+186
+153
+239
+182
+144
+240
+181
+138
+234
+168
+124
+245
+169
+119
+238
+159
+107
+236
+147
+85
+231
+136
+72
+230
+123
+57
+239
+117
+44
+226
+110
+35
+223
+103
+18
+224
+98
+18
+230
+97
+5
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+225
+92
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+225
+124
+48
+230
+128
+60
+231
+136
+72
+236
+147
+85
+241
+153
+96
+238
+159
+107
+238
+159
+107
+234
+168
+124
+234
+168
+124
+234
+168
+124
+234
+168
+124
+234
+168
+124
+238
+159
+107
+238
+159
+107
+241
+153
+96
+236
+147
+85
+231
+136
+72
+230
+128
+60
+230
+123
+57
+226
+110
+35
+226
+110
+35
+223
+103
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+226
+110
+35
+225
+124
+48
+230
+123
+57
+230
+128
+60
+231
+136
+72
+236
+147
+85
+241
+153
+96
+238
+159
+107
+238
+159
+107
+234
+168
+124
+234
+168
+124
+234
+168
+124
+234
+168
+124
+234
+168
+124
+238
+159
+107
+238
+159
+107
+241
+153
+96
+236
+147
+85
+231
+136
+72
+230
+128
+60
+225
+124
+48
+226
+110
+35
+226
+110
+35
+223
+103
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+220
+93
+11
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+225
+124
+48
+230
+128
+60
+230
+128
+60
+231
+136
+72
+231
+136
+72
+236
+147
+85
+236
+147
+85
+236
+147
+85
+236
+147
+85
+236
+147
+85
+231
+136
+72
+231
+136
+72
+231
+136
+72
+230
+128
+60
+227
+126
+50
+225
+124
+48
+226
+110
+35
+223
+103
+18
+223
+103
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+218
+87
+5
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+225
+124
+48
+230
+123
+57
+230
+128
+60
+231
+136
+72
+231
+136
+72
+231
+136
+72
+236
+147
+85
+236
+147
+85
+236
+147
+85
+236
+147
+85
+236
+147
+85
+231
+136
+72
+231
+136
+72
+230
+128
+60
+230
+123
+57
+225
+124
+48
+226
+110
+35
+226
+110
+35
+223
+103
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+220
+93
+11
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+225
+124
+48
+225
+124
+48
+225
+124
+48
+224
+123
+55
+224
+123
+55
+224
+123
+55
+230
+123
+57
+224
+123
+55
+224
+123
+55
+225
+124
+48
+225
+124
+48
+226
+110
+35
+226
+110
+35
+223
+103
+18
+223
+103
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+218
+87
+5
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+220
+93
+11
+224
+98
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+226
+110
+35
+225
+124
+48
+225
+124
+48
+224
+123
+55
+230
+123
+57
+230
+123
+57
+230
+123
+57
+230
+123
+57
+230
+123
+57
+225
+124
+48
+225
+124
+48
+226
+110
+35
+226
+110
+35
+226
+110
+35
+223
+103
+18
+224
+98
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+221
+89
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+224
+98
+18
+224
+98
+18
+224
+98
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+223
+103
+18
+223
+103
+18
+224
+98
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+224
+98
+18
+224
+98
+18
+223
+103
+18
+223
+103
+18
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+226
+110
+35
+223
+103
+18
+224
+98
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+220
+93
+11
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+220
+93
+11
+220
+93
+11
+224
+98
+18
+224
+98
+18
+224
+98
+18
+224
+98
+18
+224
+98
+18
+224
+98
+18
+220
+93
+11
+224
+98
+18
+220
+93
+11
+220
+93
+11
+220
+93
+11
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+220
+93
+11
+220
+93
+11
+220
+93
+11
+220
+93
+11
+220
+93
+11
+224
+98
+18
+224
+98
+18
+224
+98
+18
+224
+98
+18
+224
+98
+18
+220
+93
+11
+220
+93
+11
+220
+93
+11
+220
+93
+11
+220
+93
+11
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+218
+87
+5
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+217
+86
+3
+217
+86
+3
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
+214
+84
+0
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/tincantools-puppy.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/tincantools-puppy.diff
new file mode 100644
index 0000000000..c7856731e5
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/beagleboard/tincantools-puppy.diff
@@ -0,0 +1,66 @@
+--- /tmp/board-omap3beagle.c 2009-07-01 01:06:44.000000000 +0200
++++ git/arch/arm/mach-omap2/board-omap3beagle.c 2009-07-01 01:06:50.000000000 +0200
+@@ -125,6 +125,13 @@
+ .wires = 8,
+ .gpio_wp = 29,
+ },
++ {
++ .mmc = 2,
++ .wires = 4,
++ .gpio_wp = 141,
++ .gpio_cd = 162,
++ .transceiver = true,
++ },
+ {} /* Terminator */
+ };
+
+@@ -132,6 +139,11 @@
+ .supply = "vmmc",
+ };
+
++static struct regulator_consumer_supply beagle_vmmc2_supply = {
++ .supply = "vmmc",
++};
++
++
+ static struct regulator_consumer_supply beagle_vsim_supply = {
+ .supply = "vmmc_aux",
+ };
+@@ -148,6 +160,7 @@
+
+ /* link regulators to MMC adapters */
+ beagle_vmmc1_supply.dev = mmc[0].dev;
++ beagle_vmmc2_supply.dev = mmc[1].dev;
+ beagle_vsim_supply.dev = mmc[0].dev;
+
+ /* REVISIT: need ehci-omap hooks for external VBUS
+@@ -209,6 +222,21 @@
+ .consumer_supplies = &beagle_vmmc1_supply,
+ };
+
++/* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */
++static struct regulator_init_data beagle_vmmc2 = {
++ .constraints = {
++ .min_uV = 2700000,
++ .max_uV = 3150000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
++ | REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &beagle_vmmc2_supply,
++};
++
+ /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
+ static struct regulator_init_data beagle_vsim = {
+ .constraints = {
+@@ -284,6 +312,7 @@
+ .gpio = &beagle_gpio_data,
+ .power = &beagle_power_data,
+ .vmmc1 = &beagle_vmmc1,
++ .vmmc2 = &beagle_vmmc2,
+ .vsim = &beagle_vsim,
+ .vdac = &beagle_vdac,
+ .vpll2 = &beagle_vpll2,
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/cache-display-fix.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/cache-display-fix.patch
new file mode 100644
index 0000000000..019fd5acf1
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/cache-display-fix.patch
@@ -0,0 +1,238 @@
+On Tue, 2008-07-01 at 06:23 +0100, Dirk Behme wrote:
+> Catalin Marinas wrote:
+> > But, anyway, if you want a patch, Harry is updating it to a recent
+> > kernel.
+>
+> Any news on this? I think there are some people wanting a patch ;)
+
+See below for a preliminary patch updated to 2.6.26-rc8. Note that I
+don't plan to submit it in its current form but clean it up a bit first.
+
+
+Show the cache type of ARMv7 CPUs
+
+From: Catalin Marinas <catalin.marinas@arm.com>
+
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+---
+
+ arch/arm/kernel/setup.c | 137 +++++++++++++++++++++++++++++++++++++++++++++-
+ include/asm-arm/system.h | 18 ++++++
+ 2 files changed, 153 insertions(+), 2 deletions(-)
+
+
+diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
+index 5ae0eb2..0cd238d 100644
+--- a/arch/arm/kernel/setup.c
++++ b/arch/arm/kernel/setup.c
+@@ -256,6 +256,24 @@ static const char *proc_arch[] = {
+ "?(17)",
+ };
+
++static const char *v7_cache_policy[4] = {
++ "reserved",
++ "AVIVT",
++ "VIPT",
++ "PIPT",
++};
++
++static const char *v7_cache_type[8] = {
++ "none",
++ "instruction only",
++ "data only",
++ "separate instruction and data",
++ "unified",
++ "unknown type",
++ "unknown type",
++ "unknown type",
++};
++
+ #define CACHE_TYPE(x) (((x) >> 25) & 15)
+ #define CACHE_S(x) ((x) & (1 << 24))
+ #define CACHE_DSIZE(x) (((x) >> 12) & 4095) /* only if S=1 */
+@@ -266,6 +284,22 @@ static const char *proc_arch[] = {
+ #define CACHE_M(y) ((y) & (1 << 2))
+ #define CACHE_LINE(y) ((y) & 3)
+
++#define CACHE_TYPE_V7(x) (((x) >> 14) & 3)
++#define CACHE_UNIFIED(x) ((((x) >> 27) & 7)+1)
++#define CACHE_COHERENT(x) ((((x) >> 24) & 7)+1)
++
++#define CACHE_ID_LEVEL_MASK 7
++#define CACHE_ID_LEVEL_BITS 3
++
++#define CACHE_LINE_V7(v) ((1 << (((v) & 7)+4)))
++#define CACHE_ASSOC_V7(v) ((((v) >> 3) & ((1<<10)-1))+1)
++#define CACHE_SETS_V7(v) ((((v) >> 13) & ((1<<15)-1))+1)
++#define CACHE_SIZE_V7(v) (CACHE_LINE_V7(v)*CACHE_ASSOC_V7(v)*CACHE_SETS_V7(v))
++#define CACHE_WA_V7(v) (((v) & (1<<28)) != 0)
++#define CACHE_RA_V7(v) (((v) & (1<<29)) != 0)
++#define CACHE_WB_V7(v) (((v) & (1<<30)) != 0)
++#define CACHE_WT_V7(v) (((v) & (1<<31)) != 0)
++
+ static inline void dump_cache(const char *prefix, int cpu, unsigned int cache)
+ {
+ unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0);
+@@ -279,11 +313,57 @@ static inline void dump_cache(const char *prefix, int cpu, unsigned int cache)
+ CACHE_LINE(cache)));
+ }
+
++static void dump_v7_cache(const char *type, int cpu, unsigned int level)
++{
++ unsigned int cachesize;
++
++ write_extended_cpuid(2,0,0,0,level); /* Set the cache size selection register */
++ write_extended_cpuid(0,7,5,4,0); /* Prefetch flush to wait for above */
++ cachesize = read_extended_cpuid(1,0,0,0);
++
++ printk("CPU%u: %s cache: %d bytes, associativity %d, %d byte lines, %d sets,\n supports%s%s%s%s\n",
++ cpu, type,
++ CACHE_SIZE_V7(cachesize),CACHE_ASSOC_V7(cachesize),
++ CACHE_LINE_V7(cachesize),CACHE_SETS_V7(cachesize),
++ CACHE_WA_V7(cachesize) ? " WA" : "",
++ CACHE_RA_V7(cachesize) ? " RA" : "",
++ CACHE_WB_V7(cachesize) ? " WB" : "",
++ CACHE_WT_V7(cachesize) ? " WT" : "");
++}
++
+ static void __init dump_cpu_info(int cpu)
+ {
+ unsigned int info = read_cpuid(CPUID_CACHETYPE);
+
+- if (info != processor_id) {
++ if (info != processor_id && (info & (1 << 31))) {
++ /* ARMv7 style of cache info register */
++ unsigned int id = read_extended_cpuid(1,0,0,1);
++ unsigned int level = 0;
++ printk("CPU%u: L1 I %s cache. Caches unified at level %u, coherent at level %u\n",
++ cpu,
++ v7_cache_policy[CACHE_TYPE_V7(info)],
++ CACHE_UNIFIED(id),
++ CACHE_COHERENT(id));
++
++ while (id & CACHE_ID_LEVEL_MASK) {
++ printk("CPU%u: Level %u cache is %s\n",
++ cpu, (level >> 1)+1, v7_cache_type[id & CACHE_ID_LEVEL_MASK]);
++
++ if (id & 1) {
++ /* Dump I at this level */
++ dump_v7_cache("I", cpu, level | 1);
++ }
++
++ if (id & (4 | 2)) {
++ /* Dump D or unified at this level */
++ dump_v7_cache((id & 4) ? "unified" : "D", cpu, level);
++ }
++
++ /* Next level out */
++ level += 2;
++ id >>= CACHE_ID_LEVEL_BITS;
++ }
++ } else if (info != processor_id) {
+ printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT",
+ cache_types[CACHE_TYPE(info)]);
+ if (CACHE_S(info)) {
+@@ -916,6 +996,30 @@ c_show_cache(struct seq_file *m, const char *type, unsigned int cache)
+ CACHE_LINE(cache)));
+ }
+
++static void c_show_v7_cache(struct seq_file *m, const char *type, unsigned int levelselect)
++{
++ unsigned int cachesize;
++ unsigned int level = (levelselect >> 1) + 1;
++
++ write_extended_cpuid(2,0,0,0,levelselect); /* Set the cache size selection register */
++ write_extended_cpuid(0,7,5,4,0); /* Prefetch flush to wait for above */
++ cachesize = read_extended_cpuid(1,0,0,0);
++
++ seq_printf(m, "L%u %s size\t\t: %d bytes\n"
++ "L%u %s assoc\t\t: %d\n"
++ "L%u %s line length\t: %d\n"
++ "L%u %s sets\t\t: %d\n"
++ "L%u %s supports\t\t:%s%s%s%s\n",
++ level, type, CACHE_SIZE_V7(cachesize),
++ level, type, CACHE_ASSOC_V7(cachesize),
++ level, type, CACHE_LINE_V7(cachesize),
++ level, type, CACHE_SETS_V7(cachesize),
++ level, type, CACHE_WA_V7(cachesize) ? " WA" : "",
++ CACHE_RA_V7(cachesize) ? " RA" : "",
++ CACHE_WB_V7(cachesize) ? " WB" : "",
++ CACHE_WT_V7(cachesize) ? " WT" : "");
++}
++
+ static int c_show(struct seq_file *m, void *v)
+ {
+ int i;
+@@ -971,7 +1075,36 @@ static int c_show(struct seq_file *m, void *v)
+
+ {
+ unsigned int cache_info = read_cpuid(CPUID_CACHETYPE);
+- if (cache_info != processor_id) {
++ if (cache_info != processor_id && (cache_info & (1<<31))) {
++ /* V7 style of cache info register */
++ unsigned int id = read_extended_cpuid(1,0,0,1);
++ unsigned int levelselect = 0;
++ seq_printf(m, "L1 I cache\t:%s\n"
++ "Cache unification level\t: %u\n"
++ "Cache coherency level\t: %u\n",
++ v7_cache_policy[CACHE_TYPE_V7(cache_info)],
++ CACHE_UNIFIED(id),
++ CACHE_COHERENT(id));
++
++ while (id & CACHE_ID_LEVEL_MASK) {
++ seq_printf(m, "Level %u cache\t\t: %s\n",
++ (levelselect >> 1)+1, v7_cache_type[id & CACHE_ID_LEVEL_MASK]);
++
++ if (id & 1) {
++ /* Dump I at this level */
++ c_show_v7_cache(m, "I", levelselect | 1);
++ }
++
++ if (id & (4 | 2)) {
++ /* Dump D or unified at this level */
++ c_show_v7_cache(m, (id & 4) ? "cache" : "D", levelselect);
++ }
++
++ /* Next level out */
++ levelselect += 2;
++ id >>= CACHE_ID_LEVEL_BITS;
++ }
++ } else if (cache_info != processor_id) {
+ seq_printf(m, "Cache type\t: %s\n"
+ "Cache clean\t: %s\n"
+ "Cache lockdown\t: %s\n"
+diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
+index 514af79..704738e 100644
+--- a/arch/arm/include/asm/system.h
++++ b/arch/arm/include/asm/system.h
+@@ -74,6 +74,24 @@
+ : "cc"); \
+ __val; \
+ })
++#define read_extended_cpuid(op1,op2,op3,op4) \
++ ({ \
++ unsigned int __val; \
++ asm("mrc p15," __stringify(op1) ",%0,c" __stringify(op2)",c" __stringify(op3)"," __stringify(op4) \
++ : "=r" (__val) \
++ : \
++ : "cc"); \
++ __val; \
++ })
++
++#define write_extended_cpuid(op1,op2,op3,op4,v) \
++ ({ \
++ unsigned int __val = v; \
++ asm("mcr p15," __stringify(op1) ",%0,c" __stringify(op2)",c" __stringify(op3)"," __stringify(op4) \
++ : \
++ : "r" (__val) \
++ : "cc"); \
++ })
+ #else
+ extern unsigned int processor_id;
+ #define read_cpuid(reg) (processor_id)
+
+
+--
+Catalin
+
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch
index ac26554845..ac26554845 100644
--- a/recipes/linux/linux-omap-pm/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
index 5873ae280c..5c86e6a654 100644
--- a/recipes/linux/linux-omap-pm/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch
@@ -1,7 +1,7 @@
From 02243f13eec816e11d16676a131bc04b8a0666ab Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 11 Feb 2009 16:33:02 +0200
-Subject: [PATCH] OMAPFB: move omapfb.h to include/linux/
+Subject: [PATCH 02/69] OMAPFB: move omapfb.h to include/linux/
This is needed so that omapfb.h is automatically exported to user space.
@@ -85,6 +85,25 @@ index cb32b61..f6f6571 100644
#include <mach/blizzard.h>
#include <../drivers/cbus/tahvo.h>
+diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
+index adbe21f..a04e3ee 100644
+--- a/arch/arm/mach-omap2/io.c
++++ b/arch/arm/mach-omap2/io.c
+@@ -18,13 +18,13 @@
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+ #include <linux/init.h>
++#include <linux/omapfb.h>
+ #include <linux/io.h>
+
+ #include <asm/tlb.h>
+
+ #include <asm/mach/map.h>
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <mach/sram.h>
+ #include <mach/sdrc.h>
+ #include <mach/gpmc.h>
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 3746222..40615a6 100644
--- a/arch/arm/plat-omap/fb.c
@@ -1293,5 +1312,5 @@ index 0000000..b226bdf
+
+#endif /* __OMAPFB_H */
--
-1.5.6.5
+1.6.2.4
diff --git a/recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch
index 4610e28704..4610e28704 100644
--- a/recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0004-DSS2-OMAP-framebuffer-driver.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0004-DSS2-OMAP-framebuffer-driver.patch
index 877bb43c56..877bb43c56 100644
--- a/recipes/linux/linux-omap-pm/dss2/0004-DSS2-OMAP-framebuffer-driver.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0004-DSS2-OMAP-framebuffer-driver.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0005-DSS2-Add-panel-drivers.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0005-DSS2-Add-panel-drivers.patch
index c68c89e171..c68c89e171 100644
--- a/recipes/linux/linux-omap-pm/dss2/0005-DSS2-Add-panel-drivers.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0005-DSS2-Add-panel-drivers.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch
index 258b0b6531..258b0b6531 100644
--- a/recipes/linux/linux-omap-pm/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
index 62d653700e..26d21d8744 100644
--- a/recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
@@ -4908,6 +4908,14 @@ diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-343
index 0a1099e..3c664a9 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
+@@ -37,6 +37,7 @@
+ #include <mach/common.h>
+ #include <mach/dma.h>
+ #include <mach/gpmc.h>
++#include <mach/display.h>
+
+ #include <mach/control.h>
+
@@ -242,6 +243,35 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
},
};
@@ -5178,6 +5186,14 @@ index 346351e..b67e7a5 100644
#include <mach/hardware.h>
#include <asm/mach-types.h>
+@@ -43,6 +44,7 @@
+ #include <mach/gpmc.h>
+ #include <mach/nand.h>
+ #include <mach/mux.h>
++#include <mach/display.h>
+
+ #include "twl4030-generic-scripts.h"
+ #include "mmc-twl4030.h"
@@ -312,10 +314,6 @@ static void __init omap3_beagle_init_irq(void)
omap_gpio_init();
}
@@ -5305,6 +5321,14 @@ diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-om
index 024d7c4..6f5a866 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -36,6 +36,7 @@
+ #include <mach/usb.h>
+ #include <mach/common.h>
+ #include <mach/mcspi.h>
++#include <mach/display.h>
+
+ #include "sdram-micron-mt46h32m32lf-6.h"
+ #include "twl4030-generic-scripts.h"
@@ -216,13 +217,215 @@ static int __init omap3_evm_i2c_init(void)
return 0;
}
diff --git a/recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch
index f4cd192bdd..f4cd192bdd 100644
--- a/recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0009-DSS2-Add-acx565akm-panel.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0009-DSS2-Add-acx565akm-panel.patch
index 82a1474056..82a1474056 100644
--- a/recipes/linux/linux-omap-pm/dss2/0009-DSS2-Add-acx565akm-panel.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0009-DSS2-Add-acx565akm-panel.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch
index f994327ec1..f994327ec1 100644
--- a/recipes/linux/linux-omap-pm/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch
index 2dad1d337f..2dad1d337f 100644
--- a/recipes/linux/linux-omap-pm/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0012-DSS2-Fix-DMA-rotation.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0012-DSS2-Fix-DMA-rotation.patch
index 8e1d139c72..8e1d139c72 100644
--- a/recipes/linux/linux-omap-pm/dss2/0012-DSS2-Fix-DMA-rotation.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0012-DSS2-Fix-DMA-rotation.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch
index 1abc7a8264..1abc7a8264 100644
--- a/recipes/linux/linux-omap-pm/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
index d8aa4eb893..d8aa4eb893 100644
--- a/recipes/linux/linux-omap-pm/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
index a0f2b9f528..a0f2b9f528 100644
--- a/recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch
index 35d65a996d..35d65a996d 100644
--- a/recipes/linux/linux-omap-pm/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch
index e9a5dcc67a..e9a5dcc67a 100644
--- a/recipes/linux/linux-omap-pm/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch
index 0261db2bd4..0261db2bd4 100644
--- a/recipes/linux/linux-omap-pm/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
index 6569c71471..6569c71471 100644
--- a/recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch
index c6971ea452..c6971ea452 100644
--- a/recipes/linux/linux-omap-pm/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0021-DSS2-Add-venc-register-dump.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch
index 44f126e7a4..44f126e7a4 100644
--- a/recipes/linux/linux-omap-pm/dss2/0021-DSS2-Add-venc-register-dump.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0022-DSS2-FB-remove-unused-var-warning.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch
index 207a85f115..207a85f115 100644
--- a/recipes/linux/linux-omap-pm/dss2/0022-DSS2-FB-remove-unused-var-warning.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch
index 45045c4b4b..45045c4b4b 100644
--- a/recipes/linux/linux-omap-pm/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch
index 1a68d9425a..1a68d9425a 100644
--- a/recipes/linux/linux-omap-pm/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
index 7f889d95d8..7f889d95d8 100644
--- a/recipes/linux/linux-omap-pm/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch
index f5c249e045..f5c249e045 100644
--- a/recipes/linux/linux-omap-pm/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch
index 5265ae6b0a..5265ae6b0a 100644
--- a/recipes/linux/linux-omap-pm/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch
index 178349ed2a..178349ed2a 100644
--- a/recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch
index e9f25dfef1..e9f25dfef1 100644
--- a/recipes/linux/linux-omap-pm/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch
index 63b3594ef5..63b3594ef5 100644
--- a/recipes/linux/linux-omap-pm/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch
index 684857c15f..684857c15f 100644
--- a/recipes/linux/linux-omap-pm/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch
index df3a7a9dd9..df3a7a9dd9 100644
--- a/recipes/linux/linux-omap-pm/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0033-DSS2-Prefer-3-tap-filter.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch
index 6457a5b94a..6457a5b94a 100644
--- a/recipes/linux/linux-omap-pm/dss2/0033-DSS2-Prefer-3-tap-filter.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0033-DSS2-Prefer-3-tap-filter.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch
index dd01886406..dd01886406 100644
--- a/recipes/linux/linux-omap-pm/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch
index 6b29d50dc0..6b29d50dc0 100644
--- a/recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch
index ace5079234..ace5079234 100644
--- a/recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch
index e7f43ad83d..e7f43ad83d 100644
--- a/recipes/linux/linux-omap-pm/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0037-DSS2-Added-support-for-querying-color-keying.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch
index 096c976a70..096c976a70 100644
--- a/recipes/linux/linux-omap-pm/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch
index d731b78008..d731b78008 100644
--- a/recipes/linux/linux-omap-pm/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
index 471a2a7f6c..471a2a7f6c 100644
--- a/recipes/linux/linux-omap-pm/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch
index 2c90c0cc06..2c90c0cc06 100644
--- a/recipes/linux/linux-omap-pm/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch
index 7e2e44d809..7e2e44d809 100644
--- a/recipes/linux/linux-omap-pm/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch
index 2e09335611..2e09335611 100644
--- a/recipes/linux/linux-omap-pm/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch
index 19d24c3a07..19d24c3a07 100644
--- a/recipes/linux/linux-omap-pm/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0045-DSS2-Fixed-line-endings-from-to.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch
index 3206306cc7..3206306cc7 100644
--- a/recipes/linux/linux-omap-pm/dss2/0045-DSS2-Fixed-line-endings-from-to.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0045-DSS2-Fixed-line-endings-from-to.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch
index 301db79267..301db79267 100644
--- a/recipes/linux/linux-omap-pm/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
index fbc30b8858..fbc30b8858 100644
--- a/recipes/linux/linux-omap-pm/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch
index 1097fedabf..1097fedabf 100644
--- a/recipes/linux/linux-omap-pm/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
index d9901f95d9..d9901f95d9 100644
--- a/recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch
index 4a0a078bc7..4a0a078bc7 100644
--- a/recipes/linux/linux-omap-pm/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch
index 739d3cd1a6..739d3cd1a6 100644
--- a/recipes/linux/linux-omap-pm/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch
index a28a96b23b..a28a96b23b 100644
--- a/recipes/linux/linux-omap-pm/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch
index 38d162d024..38d162d024 100644
--- a/recipes/linux/linux-omap-pm/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0054-DSS2-DSI-more-error-handling.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0054-DSS2-DSI-more-error-handling.patch
index 5f4f155452..5f4f155452 100644
--- a/recipes/linux/linux-omap-pm/dss2/0054-DSS2-DSI-more-error-handling.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0054-DSS2-DSI-more-error-handling.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0055-DSS2-Added-global-alpha-support.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0055-DSS2-Added-global-alpha-support.patch
index c545b648cc..c545b648cc 100644
--- a/recipes/linux/linux-omap-pm/dss2/0055-DSS2-Added-global-alpha-support.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0055-DSS2-Added-global-alpha-support.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch
index c46fda0d52..c46fda0d52 100644
--- a/recipes/linux/linux-omap-pm/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch
index 929f41b590..929f41b590 100644
--- a/recipes/linux/linux-omap-pm/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch
index 7a6f23b349..7a6f23b349 100644
--- a/recipes/linux/linux-omap-pm/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch
index 9ca0f2eab1..9ca0f2eab1 100644
--- a/recipes/linux/linux-omap-pm/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch
index 0ff2c7b1a6..0ff2c7b1a6 100644
--- a/recipes/linux/linux-omap-pm/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0061-DSS2-VRFB-save-restore-context.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0061-DSS2-VRFB-save-restore-context.patch
index a0b694736b..a0b694736b 100644
--- a/recipes/linux/linux-omap-pm/dss2/0061-DSS2-VRFB-save-restore-context.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0061-DSS2-VRFB-save-restore-context.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0062-DSS2-VRAM-Fix-indentation.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0062-DSS2-VRAM-Fix-indentation.patch
index 8d5f57866d..8d5f57866d 100644
--- a/recipes/linux/linux-omap-pm/dss2/0062-DSS2-VRAM-Fix-indentation.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0062-DSS2-VRAM-Fix-indentation.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch
index 8633921979..8633921979 100644
--- a/recipes/linux/linux-omap-pm/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0064-VRFB-fix-debug-messages.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0064-VRFB-fix-debug-messages.patch
index 2ba9b1b1a2..2ba9b1b1a2 100644
--- a/recipes/linux/linux-omap-pm/dss2/0064-VRFB-fix-debug-messages.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0064-VRFB-fix-debug-messages.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0065-VRFB-add-suspend-resume-functionality.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0065-VRFB-add-suspend-resume-functionality.patch
index 17f959cb27..17f959cb27 100644
--- a/recipes/linux/linux-omap-pm/dss2/0065-VRFB-add-suspend-resume-functionality.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0065-VRFB-add-suspend-resume-functionality.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch
index a3af90d959..a3af90d959 100644
--- a/recipes/linux/linux-omap-pm/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch
index 911fe79bfa..911fe79bfa 100644
--- a/recipes/linux/linux-omap-pm/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch
index fba2ebd5db..fba2ebd5db 100644
--- a/recipes/linux/linux-omap-pm/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch
index c637c48602..c637c48602 100644
--- a/recipes/linux/linux-omap-pm/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch
diff --git a/recipes/linux/linux-omap-pm/dss2/0070-DSS2-fix-irq1.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0070-DSS2-fix-irq1.diff
index 8f384dfe2d..8f384dfe2d 100644
--- a/recipes/linux/linux-omap-pm/dss2/0070-DSS2-fix-irq1.diff
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0070-DSS2-fix-irq1.diff
diff --git a/recipes/linux/linux-omap-pm/dss2/0071-DSS2-fix-irq2.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0071-DSS2-fix-irq2.diff
index cb8aaf1a28..cb8aaf1a28 100644
--- a/recipes/linux/linux-omap-pm/dss2/0071-DSS2-fix-irq2.diff
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/dss2/0071-DSS2-fix-irq2.diff
diff --git a/recipes/uclibc/uclibc-svn/uClibc.config b/recipes/kexecboot/linux-kexecboot-2.6.29/ehci.patch
index e69de29bb2..e69de29bb2 100644
--- a/recipes/uclibc/uclibc-svn/uClibc.config
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/ehci.patch
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/evm-mcspi-ts.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/evm-mcspi-ts.diff
new file mode 100644
index 0000000000..64d797cf96
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/evm-mcspi-ts.diff
@@ -0,0 +1,132 @@
+From linux-omap-owner@vger.kernel.org Sun Nov 02 21:08:25 2008
+Received: from localhost
+ ([127.0.0.1] helo=dominion ident=koen)
+ by dominion.dominion.void with esmtp (Exim 4.69)
+ (envelope-from <linux-omap-owner@vger.kernel.org>)
+ id 1KwjFJ-0008Hg-0T
+ for koen@localhost; Sun, 02 Nov 2008 21:08:25 +0100
+Received: from xs.service.utwente.nl [130.89.5.250]
+ by dominion with POP3 (fetchmail-6.3.9-rc2)
+ for <koen@localhost> (single-drop); Sun, 02 Nov 2008 21:08:25 +0100 (CET)
+Received: from mail.service.utwente.nl ([130.89.5.253]) by exchange.service.utwente.nl with Microsoft SMTPSVC(6.0.3790.3959);
+ Sun, 2 Nov 2008 20:57:16 +0100
+Received: from mx.utwente.nl ([130.89.2.13]) by mail.service.utwente.nl with Microsoft SMTPSVC(6.0.3790.3959);
+ Sun, 2 Nov 2008 20:57:16 +0100
+Received: from vger.kernel.org (vger.kernel.org [209.132.176.167])
+ by mx.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id mA2JudEK010968
+ for <k.kooi@student.utwente.nl>; Sun, 2 Nov 2008 20:56:40 +0100
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1752819AbYKBT4i (ORCPT <rfc822;k.kooi@student.utwente.nl>);
+ Sun, 2 Nov 2008 14:56:38 -0500
+Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752829AbYKBT4i
+ (ORCPT <rfc822;linux-omap-outgoing>); Sun, 2 Nov 2008 14:56:38 -0500
+Received: from fg-out-1718.google.com ([72.14.220.153]:32481 "EHLO
+ fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
+ with ESMTP id S1752819AbYKBT4h (ORCPT
+ <rfc822;linux-omap@vger.kernel.org>); Sun, 2 Nov 2008 14:56:37 -0500
+Received: by fg-out-1718.google.com with SMTP id 19so1869080fgg.17
+ for <linux-omap@vger.kernel.org>; Sun, 02 Nov 2008 11:56:33 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=gmail.com; s=gamma;
+ h=domainkey-signature:received:received:from:to:cc:subject:date
+ :message-id:x-mailer:in-reply-to:references;
+ bh=Ftvoq8kE3ciPRy7pNy5VLkNnZD8o0HYWIrO1LMS/lAY=;
+ b=HpEcngDUbAObGNJuQmBIG3SoNHesUL57GluZGlYO7kxFxfH6N8zeHjKuRSk86+mT5s
+ gMhyCC07wjVp75HnqCtKbOJzNw/8F4ZGbL2lY1LC99+zxHW1JBQv5c3ZaoCVqTw6TuH0
+ bQ8Ew2BwHknT3wGA+QcGoMJJs5aw62AhPiyHY=
+DomainKey-Signature: a=rsa-sha1; c=nofws;
+ d=gmail.com; s=gamma;
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
+ b=aio1APZhCIcYIrMY844QkdaQzKw0/yiuaVjqfv52fnft1kafGT2qAS3KfXAc61a9If
+ sXHbi2fr/r1a7YZJJVGqkJX0WmWTY0OqdhS1lmugP/dXEMHeqaArKATbvxrq9/svb1bV
+ Vzpkm6sOzLrr54uo+BcZNoxHWqb8W2UrRxuTk=
+Received: by 10.103.131.18 with SMTP id i18mr6668205mun.126.1225655793072;
+ Sun, 02 Nov 2008 11:56:33 -0800 (PST)
+Received: from localhost.localdomain ([78.59.134.74])
+ by mx.google.com with ESMTPS id g1sm23199635muf.8.2008.11.02.11.56.31
+ (version=TLSv1/SSLv3 cipher=RC4-MD5);
+ Sun, 02 Nov 2008 11:56:31 -0800 (PST)
+From: Grazvydas Ignotas <notasas@gmail.com>
+To: linux-omap@vger.kernel.org
+Cc: Grazvydas Ignotas <notasas@gmail.com>
+Subject: Re: omap3evm LCD red-tint workaround
+Date: Sun, 2 Nov 2008 21:56:19 +0200
+Message-Id: <1225655779-18934-1-git-send-email-notasas@gmail.com>
+X-Mailer: git-send-email 1.5.4.3
+In-Reply-To: <57322719-1A5A-45DC-9846-5C0A3B6EF346@student.utwente.nl>
+References: <57322719-1A5A-45DC-9846-5C0A3B6EF346@student.utwente.nl>
+Sender: linux-omap-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-omap.vger.kernel.org>
+X-Mailing-List: linux-omap@vger.kernel.org
+X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact servicedesk@icts.utwente.nl for more information.
+X-UTwente-MailScanner: Found to be clean
+X-UTwente-MailScanner-From: linux-omap-owner@vger.kernel.org
+X-Spam-Status: No
+X-OriginalArrivalTime: 02 Nov 2008 19:57:16.0876 (UTC) FILETIME=[34FBA0C0:01C93D25]
+
+> PS: TS is still unusable with the 16x16 pixel resolution
+This is also the case for Pandora. The patch below fixes the problem,
+but as I have no other boards to test this on, I haven't sent it.
+See if it helps you.
+
+
+From 91f3af26bbf751b846e6265d86387e81be7c1364 Mon Sep 17 00:00:00 2001
+From: Grazvydas Ignotas <notasas@gmail.com>
+Date: Tue, 28 Oct 2008 22:01:42 +0200
+Subject: [PATCH] OMAP3: fix McSPI transfers
+
+Currently on OMAP3 if both write and read is set up for a transfer,
+the first byte returned on read is corrupted. Work around this by
+disabling channel between reads and writes, instead of transfers.
+---
+ drivers/spi/omap2_mcspi.c | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
+index 454a271..4890b6c 100644
+--- a/drivers/spi/omap2_mcspi.c
++++ b/drivers/spi/omap2_mcspi.c
+@@ -710,7 +710,6 @@ static void omap2_mcspi_work(struct work_struct *work)
+ spi = m->spi;
+ cs = spi->controller_state;
+
+- omap2_mcspi_set_enable(spi, 1);
+ list_for_each_entry(t, &m->transfers, transfer_list) {
+ if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
+ status = -EINVAL;
+@@ -741,6 +740,8 @@ static void omap2_mcspi_work(struct work_struct *work)
+ if (t->len) {
+ unsigned count;
+
++ omap2_mcspi_set_enable(spi, 1);
++
+ /* RX_ONLY mode needs dummy data in TX reg */
+ if (t->tx_buf == NULL)
+ __raw_writel(0, cs->base
+@@ -752,6 +753,8 @@ static void omap2_mcspi_work(struct work_struct *work)
+ count = omap2_mcspi_txrx_pio(spi, t);
+ m->actual_length += count;
+
++ omap2_mcspi_set_enable(spi, 0);
++
+ if (count != t->len) {
+ status = -EIO;
+ break;
+@@ -777,8 +780,6 @@ static void omap2_mcspi_work(struct work_struct *work)
+ if (cs_active)
+ omap2_mcspi_force_cs(spi, 0);
+
+- omap2_mcspi_set_enable(spi, 0);
+-
+ m->status = status;
+ m->complete(m->context);
+
+--
+1.5.4.3
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-omap" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/fix-audio-capture.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-audio-capture.patch
new file mode 100644
index 0000000000..c5ff914757
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-audio-capture.patch
@@ -0,0 +1,16 @@
+diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
+index ee2f0d3..8b4aafb 100644
+--- a/sound/soc/codecs/twl4030.c
++++ b/sound/soc/codecs/twl4030.c
+@@ -45,8 +45,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+ 0xc3, /* REG_OPTION (0x2) */
+ 0x00, /* REG_UNKNOWN (0x3) */
+ 0x00, /* REG_MICBIAS_CTL (0x4) */
+- 0x20, /* REG_ANAMICL (0x5) */
+- 0x00, /* REG_ANAMICR (0x6) */
++ 0x34, /* REG_ANAMICL (0x5) */
++ 0x14, /* REG_ANAMICR (0x6) */
+ 0x00, /* REG_AVADC_CTL (0x7) */
+ 0x00, /* REG_ADCMICSEL (0x8) */
+ 0x00, /* REG_DIGMIXING (0x9) */
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/fix-install.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-install.patch
new file mode 100644
index 0000000000..46bc25a50b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-install.patch
@@ -0,0 +1,23 @@
+From: Steve Sakoman <steve@sakoman.com>
+Date: Mon, 18 Aug 2008 16:07:31 +0000 (-0700)
+Subject: scripts/Makefile.fwinst: add missing space when setting mode in cmd_install
+X-Git-Url: http://www.sakoman.net/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff_plain;h=f039944bdd491cde7327133e9976881d3133ae70
+
+scripts/Makefile.fwinst: add missing space when setting mode in cmd_install
+
+This was causing build failures on some machines
+---
+
+diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
+index 6bf8e87..fb20532 100644
+--- a/scripts/Makefile.fwinst
++++ b/scripts/Makefile.fwinst
+@@ -37,7 +37,7 @@ install-all-dirs: $(installed-fw-dirs)
+ @true
+
+ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
+- cmd_install = $(INSTALL) -m0644 $< $@
++ cmd_install = $(INSTALL) -m 0644 $< $@
+
+ $(installed-fw-dirs):
+ $(call cmd,mkdir)
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/fix-unaligned-access.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-unaligned-access.diff
new file mode 100644
index 0000000000..c82090f54a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/fix-unaligned-access.diff
@@ -0,0 +1,41 @@
+From: Mans Rullgard <mans@mansr.com>
+Date: Sat, 28 Mar 2009 12:54:25 +0000 (+0000)
+Subject: NSM: Fix unaligned accesses in nsm_init_private()
+X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=8f2bd6fdde1ebfef57f65b6cf29b29008c23d297
+
+NSM: Fix unaligned accesses in nsm_init_private()
+
+This fixes unaligned accesses in nsm_init_private() when
+creating nlm_reboot keys.
+
+Signed-off-by: Mans Rullgard <mans@mansr.com>
+---
+
+diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
+index 5e2c4d5..6d5d4a4 100644
+--- a/fs/lockd/mon.c
++++ b/fs/lockd/mon.c
+@@ -16,6 +16,8 @@
+ #include <linux/sunrpc/svc.h>
+ #include <linux/lockd/lockd.h>
+
++#include <asm/unaligned.h>
++
+ #define NLMDBG_FACILITY NLMDBG_MONITOR
+ #define NSM_PROGRAM 100024
+ #define NSM_VERSION 1
+@@ -274,10 +276,12 @@ static void nsm_init_private(struct nsm_handle *nsm)
+ {
+ u64 *p = (u64 *)&nsm->sm_priv.data;
+ struct timespec ts;
++ s64 ns;
+
+ ktime_get_ts(&ts);
+- *p++ = timespec_to_ns(&ts);
+- *p = (unsigned long)nsm;
++ ns = timespec_to_ns(&ts);
++ put_unaligned(ns, p);
++ put_unaligned((unsigned long)nsm, p + 1);
+ }
+
+ static struct nsm_handle *nsm_create_handle(const struct sockaddr *sap,
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0001-omap-iommu-tlb-and-pagetable-primitives.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0001-omap-iommu-tlb-and-pagetable-primitives.patch
new file mode 100644
index 0000000000..c2c9bc2b62
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0001-omap-iommu-tlb-and-pagetable-primitives.patch
@@ -0,0 +1,1226 @@
+From a62a047ed02162573e4bece18ecf8bdd66ccd06b Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Mon, 26 Jan 2009 15:13:40 +0200
+Subject: [PATCH] omap iommu: tlb and pagetable primitives
+
+This patch provides:
+
+- iotlb_*() : iommu tlb operations
+- iopgtable_*() : iommu pagetable(twl) operations
+- iommu_*() : the other generic operations
+
+and the entry points to register and acquire iommu object.
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/iommu.h | 157 +++++
+ arch/arm/plat-omap/iommu.c | 953 +++++++++++++++++++++++++++++++
+ arch/arm/plat-omap/iopgtable.h | 72 +++
+ 3 files changed, 1182 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/plat-omap/include/mach/iommu.h
+ create mode 100644 arch/arm/plat-omap/iommu.c
+ create mode 100644 arch/arm/plat-omap/iopgtable.h
+
+diff --git a/arch/arm/plat-omap/include/mach/iommu.h b/arch/arm/plat-omap/include/mach/iommu.h
+new file mode 100644
+index 0000000..ef04d7a
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/iommu.h
+@@ -0,0 +1,157 @@
++/*
++ * omap iommu: main structures
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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.
++ */
++
++#ifndef __MACH_IOMMU_H
++#define __MACH_IOMMU_H
++
++struct iotlb_entry {
++ u32 da;
++ u32 pa;
++ u32 pgsz, prsvd, valid;
++ union {
++ u16 ap;
++ struct {
++ u32 endian, elsz, mixed;
++ };
++ };
++};
++
++struct iommu {
++ const char *name;
++ struct module *owner;
++ struct clk *clk;
++ void __iomem *regbase;
++ struct device *dev;
++
++ unsigned int refcount;
++ struct mutex iommu_lock; /* global for this whole object */
++
++ /*
++ * We don't change iopgd for a situation like pgd for a task,
++ * but share it globally for each iommu.
++ */
++ u32 *iopgd;
++ spinlock_t page_table_lock; /* protect iopgd */
++
++ int nr_tlb_entries;
++
++ struct list_head mmap;
++ struct mutex mmap_lock; /* protect mmap */
++
++ int (*isr)(struct iommu *obj);
++
++ void *ctx; /* iommu context: registres saved area */
++};
++
++struct cr_regs {
++ union {
++ struct {
++ u16 cam_l;
++ u16 cam_h;
++ };
++ u32 cam;
++ };
++ union {
++ struct {
++ u16 ram_l;
++ u16 ram_h;
++ };
++ u32 ram;
++ };
++};
++
++struct iotlb_lock {
++ short base;
++ short vict;
++};
++
++/* architecture specific functions */
++struct iommu_functions {
++ unsigned long version;
++
++ int (*enable)(struct iommu *obj);
++ void (*disable)(struct iommu *obj);
++ u32 (*fault_isr)(struct iommu *obj, u32 *ra);
++
++ void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr);
++ void (*tlb_load_cr)(struct iommu *obj, struct cr_regs *cr);
++
++ struct cr_regs *(*alloc_cr)(struct iommu *obj, struct iotlb_entry *e);
++ int (*cr_valid)(struct cr_regs *cr);
++ u32 (*cr_to_virt)(struct cr_regs *cr);
++ void (*cr_to_e)(struct cr_regs *cr, struct iotlb_entry *e);
++ ssize_t (*dump_cr)(struct iommu *obj, struct cr_regs *cr, char *buf);
++
++ u32 (*get_pte_attr)(struct iotlb_entry *e);
++
++ void (*save_ctx)(struct iommu *obj);
++ void (*restore_ctx)(struct iommu *obj);
++ ssize_t (*dump_ctx)(struct iommu *obj, char *buf);
++};
++
++struct iommu_platform_data {
++ const char *name;
++ const char *clk_name;
++ const int nr_tlb_entries;
++};
++
++#include <mach/iommu2.h>
++
++/*
++ * utilities for super page(16MB, 1MB, 64KB and 4KB)
++ */
++
++#define iopgsz_max(bytes) \
++ (((bytes) >= SZ_16M) ? SZ_16M : \
++ ((bytes) >= SZ_1M) ? SZ_1M : \
++ ((bytes) >= SZ_64K) ? SZ_64K : \
++ ((bytes) >= SZ_4K) ? SZ_4K : 0)
++
++#define bytes_to_iopgsz(bytes) \
++ (((bytes) == SZ_16M) ? MMU_CAM_PGSZ_16M : \
++ ((bytes) == SZ_1M) ? MMU_CAM_PGSZ_1M : \
++ ((bytes) == SZ_64K) ? MMU_CAM_PGSZ_64K : \
++ ((bytes) == SZ_4K) ? MMU_CAM_PGSZ_4K : -1)
++
++#define iopgsz_to_bytes(iopgsz) \
++ (((iopgsz) == MMU_CAM_PGSZ_16M) ? SZ_16M : \
++ ((iopgsz) == MMU_CAM_PGSZ_1M) ? SZ_1M : \
++ ((iopgsz) == MMU_CAM_PGSZ_64K) ? SZ_64K : \
++ ((iopgsz) == MMU_CAM_PGSZ_4K) ? SZ_4K : 0)
++
++#define iopgsz_ok(bytes) (bytes_to_iopgsz(bytes) >= 0)
++
++/*
++ * global functions
++ */
++extern u32 iommu_arch_version(void);
++
++extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e);
++extern void flush_iotlb_page(struct iommu *obj, u32 da);
++extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
++extern void flush_iotlb_all(struct iommu *obj);
++
++ssize_t iotlb_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf);
++
++extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
++extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
++
++extern struct iommu *iommu_get(const char *name);
++extern void iommu_put(struct iommu *obj);
++
++extern void iommu_save_ctx(struct iommu *obj);
++extern void iommu_restore_ctx(struct iommu *obj);
++
++extern int install_iommu_arch(const struct iommu_functions *ops);
++extern void uninstall_iommu_arch(const struct iommu_functions *ops);
++
++#endif /* __MACH_IOMMU_H */
+diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
+new file mode 100644
+index 0000000..e638883
+--- /dev/null
++++ b/arch/arm/plat-omap/iommu.c
+@@ -0,0 +1,953 @@
++/*
++ * omap iommu: tlb and pagetable primitives
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
++ * Paul Mundt and Toshihiro Kobayashi
++ *
++ * 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/err.h>
++#include <linux/module.h>
++#include <linux/interrupt.h>
++#include <linux/ioport.h>
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++
++#include <asm/io.h>
++#include <asm/cacheflush.h>
++
++#include <mach/clock.h>
++#include <mach/iommu.h>
++
++#include "iopgtable.h"
++
++/* accommodate the difference between omap1 and omap2/3 */
++static const struct iommu_functions *arch_iommu;
++
++static struct platform_driver omap_iommu_driver;
++static struct kmem_cache *iopte_cachep;
++
++/**
++ * install_iommu_arch() - Install archtecure specific iommu functions
++ * @ops: a pointer to architecture specific iommu functions
++ *
++ * There are several kind of iommu algorithm(tlb, pagetable) among
++ * omap series. This interface installs such an iommu algorighm.
++ **/
++int install_iommu_arch(const struct iommu_functions *ops)
++{
++ if (arch_iommu)
++ return -EBUSY;
++
++ arch_iommu = ops;
++ return 0;
++}
++EXPORT_SYMBOL_GPL(install_iommu_arch);
++
++/**
++ * uninstall_iommu_arch() - Uninstall archtecure specific iommu functions
++ * @ops: a pointer to architecture specific iommu functions
++ *
++ * This interface uninstalls the iommu algorighm installed previously.
++ **/
++void uninstall_iommu_arch(const struct iommu_functions *ops)
++{
++ if (arch_iommu != ops)
++ pr_err("%s: not your arch\n", __func__);
++
++ arch_iommu = NULL;
++}
++EXPORT_SYMBOL_GPL(uninstall_iommu_arch);
++
++/**
++ * iommu_save_ctx() - Save registers for pm off-mode support
++ * @obj: target iommu
++ **/
++void iommu_save_ctx(struct iommu *obj)
++{
++ arch_iommu->save_ctx(obj);
++}
++EXPORT_SYMBOL_GPL(iommu_save_ctx);
++
++/**
++ * iommu_restore_ctx() - Restore registers for pm off-mode support
++ * @obj: target iommu
++ **/
++void iommu_restore_ctx(struct iommu *obj)
++{
++ arch_iommu->restore_ctx(obj);
++}
++EXPORT_SYMBOL_GPL(iommu_restore_ctx);
++
++/**
++ * iommu_arch_version() - Return running iommu arch version
++ **/
++u32 iommu_arch_version(void)
++{
++ return arch_iommu->version;
++}
++EXPORT_SYMBOL_GPL(iommu_arch_version);
++
++static int iommu_enable(struct iommu *obj)
++{
++ int err;
++
++ if (!obj)
++ return -EINVAL;
++
++ clk_enable(obj->clk);
++
++ err = arch_iommu->enable(obj);
++
++ clk_disable(obj->clk);
++ return err;
++}
++
++static void iommu_disable(struct iommu *obj)
++{
++ if (!obj)
++ return;
++
++ clk_enable(obj->clk);
++
++ arch_iommu->disable(obj);
++
++ clk_disable(obj->clk);
++}
++
++#ifdef DEBUG
++static ssize_t iommu_dump_ctx(struct iommu *obj, char *buf)
++{
++ if (!obj || !buf)
++ return -EINVAL;
++
++ return arch_iommu->dump_ctx(obj, buf);
++}
++#endif
++
++/*
++ * TLB operations
++ */
++static inline void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
++{
++ BUG_ON(!cr || !e);
++
++ arch_iommu->cr_to_e(cr, e);
++}
++
++static inline int iotlb_cr_valid(struct cr_regs *cr)
++{
++ if (!cr)
++ return -EINVAL;
++
++ return arch_iommu->cr_valid(cr);
++}
++
++static inline struct cr_regs *iotlb_alloc_cr(struct iommu *obj,
++ struct iotlb_entry *e)
++{
++ if (!e)
++ return NULL;
++
++ return arch_iommu->alloc_cr(obj, e);
++}
++
++static inline u32 iotlb_cr_to_virt(struct cr_regs *cr)
++{
++ return arch_iommu->cr_to_virt(cr);
++}
++
++static u32 get_iopte_attr(struct iotlb_entry *e)
++{
++ return arch_iommu->get_pte_attr(e);
++}
++
++static u32 iommu_report_fault(struct iommu *obj, u32 *da)
++{
++ return arch_iommu->fault_isr(obj, da);
++}
++
++static void iotlb_lock_get(struct iommu *obj, struct iotlb_lock *l)
++{
++ u32 val;
++
++ val = iommu_read_reg(obj, MMU_LOCK);
++
++ l->base = MMU_LOCK_BASE(val);
++ l->vict = MMU_LOCK_VICT(val);
++
++ BUG_ON(l->base != 0); /* Currently no preservation is used */
++}
++
++static void iotlb_lock_set(struct iommu *obj, struct iotlb_lock *l)
++{
++ u32 val;
++
++ BUG_ON(l->base != 0); /* Currently no preservation is used */
++
++ val = (l->base << MMU_LOCK_BASE_SHIFT);
++ val |= (l->vict << MMU_LOCK_VICT_SHIFT);
++
++ iommu_write_reg(obj, val, MMU_LOCK);
++}
++
++static void iotlb_read_cr(struct iommu *obj, struct cr_regs *cr)
++{
++ arch_iommu->tlb_read_cr(obj, cr);
++}
++
++static void iotlb_load_cr(struct iommu *obj, struct cr_regs *cr)
++{
++ arch_iommu->tlb_load_cr(obj, cr);
++
++ iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
++ iommu_write_reg(obj, 1, MMU_LD_TLB);
++}
++
++/**
++ * iotlb_dump_cr() - Dump an iommu tlb entry into buf
++ * @obj: target iommu
++ * @cr: contents of cam and ram register
++ * @buf: output buffer
++ **/
++ssize_t iotlb_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf)
++{
++ BUG_ON(!cr || !buf);
++
++ return arch_iommu->dump_cr(obj, cr, buf);
++}
++EXPORT_SYMBOL_GPL(iotlb_dump_cr);
++
++/**
++ * load_iotlb_entry() - Set an iommu tlb entry
++ * @obj: target iommu
++ * @e: an iommu tlb entry info
++ **/
++int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e)
++{
++ int i;
++ int err = 0;
++ struct iotlb_lock l;
++ struct cr_regs *cr;
++
++ if (!obj || !obj->nr_tlb_entries || !e)
++ return -EINVAL;
++
++ clk_enable(obj->clk);
++
++ for (i = 0; i < obj->nr_tlb_entries; i++) {
++ struct cr_regs tmp;
++
++ iotlb_lock_get(obj, &l);
++ l.vict = i;
++ iotlb_lock_set(obj, &l);
++ iotlb_read_cr(obj, &tmp);
++ if (!iotlb_cr_valid(&tmp))
++ break;
++ }
++
++ if (i == obj->nr_tlb_entries) {
++ dev_dbg(obj->dev, "%s: full: no entry\n", __func__);
++ err = -EBUSY;
++ goto out;
++ }
++
++ cr = iotlb_alloc_cr(obj, e);
++ if (IS_ERR(cr)) {
++ clk_disable(obj->clk);
++ return PTR_ERR(cr);
++ }
++
++ iotlb_load_cr(obj, cr);
++ kfree(cr);
++
++ /* increment victim for next tlb load */
++ if (++l.vict == obj->nr_tlb_entries)
++ l.vict = 0;
++ iotlb_lock_set(obj, &l);
++out:
++ clk_disable(obj->clk);
++ return err;
++}
++EXPORT_SYMBOL_GPL(load_iotlb_entry);
++
++/**
++ * flush_iotlb_page() - Clear an iommu tlb entry
++ * @obj: target iommu
++ * @da: iommu device virtual address
++ *
++ * Clear an iommu tlb entry which includes 'da' address.
++ **/
++void flush_iotlb_page(struct iommu *obj, u32 da)
++{
++ struct iotlb_lock l;
++ int i;
++
++ clk_enable(obj->clk);
++
++ for (i = 0; i < obj->nr_tlb_entries; i++) {
++ struct cr_regs cr;
++ u32 start;
++ size_t bytes;
++
++ iotlb_lock_get(obj, &l);
++ l.vict = i;
++ iotlb_lock_set(obj, &l);
++ iotlb_read_cr(obj, &cr);
++ if (!iotlb_cr_valid(&cr))
++ continue;
++
++ start = iotlb_cr_to_virt(&cr);
++ bytes = iopgsz_to_bytes(cr.cam & 3);
++
++ if ((start <= da) && (da < start + bytes)) {
++ dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n",
++ __func__, start, da, bytes);
++
++ iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
++ }
++ }
++ clk_disable(obj->clk);
++
++ if (i == obj->nr_tlb_entries)
++ dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da);
++}
++EXPORT_SYMBOL_GPL(flush_iotlb_page);
++
++/**
++ * flush_iotlb_range() - Clear an iommu tlb entries
++ * @obj: target iommu
++ * @start: iommu device virtual address(start)
++ * @end: iommu device virtual address(end)
++ *
++ * Clear an iommu tlb entry which includes 'da' address.
++ **/
++void flush_iotlb_range(struct iommu *obj, u32 start, u32 end)
++{
++ u32 da = start;
++
++ while (da < end) {
++ flush_iotlb_page(obj, da);
++ /* FIXME: Optimize for multiple page size */
++ da += IOPTE_SIZE;
++ }
++}
++EXPORT_SYMBOL_GPL(flush_iotlb_range);
++
++/**
++ * flush_iotlb_all() - Clear all iommu tlb entries
++ * @obj: target iommu
++ **/
++void flush_iotlb_all(struct iommu *obj)
++{
++ struct iotlb_lock l;
++
++ clk_enable(obj->clk);
++
++ l.base = 0;
++ l.vict = 0;
++ iotlb_lock_set(obj, &l);
++
++ iommu_write_reg(obj, 1, MMU_GFLUSH);
++
++ clk_disable(obj->clk);
++}
++EXPORT_SYMBOL_GPL(flush_iotlb_all);
++
++/*
++ * H/W pagetable operations
++ */
++static void flush_iopgd_range(u32 *first, u32 *last)
++{
++ /* FIXME: L2 cache should be taken care of if it exists */
++ do {
++ asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pgd"
++ : : "r" (first));
++ first += L1_CACHE_BYTES / sizeof(*first);
++ } while (first <= last);
++}
++
++static void flush_iopte_range(u32 *first, u32 *last)
++{
++ /* FIXME: L2 cache should be taken care of if it exists */
++ do {
++ asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pte"
++ : : "r" (first));
++ first += L1_CACHE_BYTES / sizeof(*first);
++ } while (first <= last);
++}
++
++static void iopte_free(u32 *iopte)
++{
++ /* Note: freed iopte's must be clean ready for re-use */
++ kmem_cache_free(iopte_cachep, iopte);
++}
++
++static u32 *iopte_alloc(struct iommu *obj, u32 *iopgd, u32 da)
++{
++ u32 *iopte;
++
++ /* a table has already existed */
++ if (*iopgd)
++ goto pte_ready;
++
++ /*
++ * do the allocation outside the page table lock
++ */
++ spin_unlock(&obj->page_table_lock);
++ iopte = kmem_cache_zalloc(iopte_cachep, GFP_KERNEL);
++ spin_lock(&obj->page_table_lock);
++
++ if (!*iopgd) {
++ if (!iopte)
++ return ERR_PTR(-ENOMEM);
++
++ *iopgd = virt_to_phys(iopte) | IOPGD_TABLE;
++ flush_iopgd_range(iopgd, iopgd);
++
++ dev_vdbg(obj->dev, "%s: a new pte:%p\n", __func__, iopte);
++ } else {
++ /* We raced, free the reduniovant table */
++ iopte_free(iopte);
++ }
++
++pte_ready:
++ iopte = iopte_offset(iopgd, da);
++
++ dev_vdbg(obj->dev,
++ "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
++ __func__, da, iopgd, *iopgd, iopte, *iopte);
++
++ return iopte;
++}
++
++static int iopgd_alloc_section(struct iommu *obj, u32 da, u32 pa, u32 prot)
++{
++ u32 *iopgd = iopgd_offset(obj, da);
++
++ *iopgd = (pa & IOSECTION_MASK) | prot | IOPGD_SECTION;
++ flush_iopgd_range(iopgd, iopgd);
++ return 0;
++}
++
++static int iopgd_alloc_super(struct iommu *obj, u32 da, u32 pa, u32 prot)
++{
++ u32 *iopgd = iopgd_offset(obj, da);
++ int i;
++
++ for (i = 0; i < 16; i++)
++ *(iopgd + i) = (pa & IOSUPER_MASK) | prot | IOPGD_SUPER;
++ flush_iopgd_range(iopgd, iopgd + 15);
++ return 0;
++}
++
++static int iopte_alloc_page(struct iommu *obj, u32 da, u32 pa, u32 prot)
++{
++ u32 *iopgd = iopgd_offset(obj, da);
++ u32 *iopte = iopte_alloc(obj, iopgd, da);
++
++ if (IS_ERR(iopte))
++ return PTR_ERR(iopte);
++
++ *iopte = (pa & IOPAGE_MASK) | prot | IOPTE_SMALL;
++ flush_iopte_range(iopte, iopte);
++
++ dev_vdbg(obj->dev, "%s: da:%08x pa:%08x pte:%p *pte:%08x\n",
++ __func__, da, pa, iopte, *iopte);
++
++ return 0;
++}
++
++static int iopte_alloc_large(struct iommu *obj, u32 da, u32 pa, u32 prot)
++{
++ u32 *iopgd = iopgd_offset(obj, da);
++ u32 *iopte = iopte_alloc(obj, iopgd, da);
++ int i;
++
++ if (IS_ERR(iopte))
++ return PTR_ERR(iopte);
++
++ for (i = 0; i < 16; i++)
++ *(iopte + i) = (pa & IOLARGE_MASK) | prot | IOPTE_LARGE;
++ flush_iopte_range(iopte, iopte + 15);
++ return 0;
++}
++
++static int iopgtable_store_entry_core(struct iommu *obj, struct iotlb_entry *e)
++{
++ int (*fn)(struct iommu *, u32, u32, u32);
++ u32 prot;
++ int err;
++
++ if (!obj || !e)
++ return -EINVAL;
++
++ switch (e->pgsz) {
++ case MMU_CAM_PGSZ_16M:
++ fn = iopgd_alloc_super;
++ break;
++ case MMU_CAM_PGSZ_1M:
++ fn = iopgd_alloc_section;
++ break;
++ case MMU_CAM_PGSZ_64K:
++ fn = iopte_alloc_large;
++ break;
++ case MMU_CAM_PGSZ_4K:
++ fn = iopte_alloc_page;
++ break;
++ default:
++ fn = NULL;
++ BUG();
++ break;
++ }
++
++ prot = get_iopte_attr(e);
++
++ spin_lock(&obj->page_table_lock);
++ err = fn(obj, e->da, e->pa, prot);
++ spin_unlock(&obj->page_table_lock);
++
++ return err;
++}
++
++#ifdef DEBUG
++static void dump_tlb_entries(struct iommu *obj)
++{
++ int i;
++ struct iotlb_lock l;
++
++ clk_enable(obj->clk);
++
++ pr_info("%8s %8s\n", "cam:", "ram:");
++ pr_info("-----------------------------------------\n");
++
++ for (i = 0; i < obj->nr_tlb_entries; i++) {
++ struct cr_regs cr;
++ static char buf[4096];
++
++ iotlb_lock_get(obj, &l);
++ l.vict = i;
++ iotlb_lock_set(obj, &l);
++ iotlb_read_cr(obj, &cr);
++ if (!iotlb_cr_valid(&cr))
++ continue;
++
++ memset(buf, 0, 4096);
++ iotlb_dump_cr(obj, &cr, buf);
++ pr_err("%s", buf);
++ }
++
++ clk_disable(obj->clk);
++}
++#else
++static inline void dump_tlb_entries(struct iommu *obj) {}
++#endif
++
++/**
++ * iopgtable_store_entry() - Make an iommu pte entry
++ * @obj: target iommu
++ * @e: an iommu tlb entry info
++ **/
++int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e)
++{
++ int err;
++
++ flush_iotlb_page(obj, e->da);
++ err = iopgtable_store_entry_core(obj, e);
++#ifdef USE_IOTLB
++ if (!err)
++ load_iotlb_entry(obj, e);
++#endif
++ return err;
++}
++EXPORT_SYMBOL_GPL(iopgtable_store_entry);
++
++/**
++ * iopgtable_lookup_entry() - Lookup an iommu pte entry
++ * @obj: target iommu
++ * @da: iommu device virtual address
++ * @ppgd: iommu pgd entry pointer to be returned
++ * @ppte: iommu pte entry pointer to be returned
++ **/
++void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte)
++{
++ u32 *iopgd, *iopte = NULL;
++
++ iopgd = iopgd_offset(obj, da);
++ if (!*iopgd)
++ goto out;
++
++ if (*iopgd & IOPGD_TABLE)
++ iopte = iopte_offset(iopgd, da);
++out:
++ *ppgd = iopgd;
++ *ppte = iopte;
++}
++EXPORT_SYMBOL_GPL(iopgtable_lookup_entry);
++
++static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da)
++{
++ size_t bytes;
++ u32 *iopgd = iopgd_offset(obj, da);
++ int nent = 1;
++
++ if (!*iopgd)
++ return 0;
++
++ if (*iopgd & IOPGD_TABLE) {
++ int i;
++ u32 *iopte = iopte_offset(iopgd, da);
++
++ bytes = IOPTE_SIZE;
++ if (*iopte & IOPTE_LARGE) {
++ nent *= 16;
++ /* rewind to the 1st entry */
++ iopte = (u32 *)((u32)iopte & IOLARGE_MASK);
++ }
++ bytes *= nent;
++ memset(iopte, 0, nent * sizeof(*iopte));
++ flush_iopte_range(iopte, iopte + (nent - 1) * sizeof(*iopte));
++
++ /*
++ * do table walk to check if this table is necessary or not
++ */
++ iopte = iopte_offset(iopgd, 0);
++ for (i = 0; i < PTRS_PER_IOPTE; i++)
++ if (iopte[i])
++ goto out;
++
++ iopte_free(iopte);
++ nent = 1; /* for the next L1 entry */
++ } else {
++ bytes = IOPGD_SIZE;
++ if (*iopgd & IOPGD_SUPER) {
++ nent *= 16;
++ /* rewind to the 1st entry */
++ iopgd = (u32 *)((u32)iopgd & IOSUPER_MASK);
++ }
++ bytes *= nent;
++ }
++ memset(iopgd, 0, nent * sizeof(*iopgd));
++ flush_iopgd_range(iopgd, iopgd + (nent - 1) * sizeof(*iopgd));
++out:
++ return bytes;
++}
++
++/**
++ * iopgtable_clear_entry() - Remove an iommu pte entry
++ * @obj: target iommu
++ * @da: iommu device virtual address
++ **/
++size_t iopgtable_clear_entry(struct iommu *obj, u32 da)
++{
++ size_t bytes;
++
++ spin_lock(&obj->page_table_lock);
++
++ bytes = iopgtable_clear_entry_core(obj, da);
++ flush_iotlb_page(obj, da);
++
++ spin_unlock(&obj->page_table_lock);
++
++ return bytes;
++}
++EXPORT_SYMBOL_GPL(iopgtable_clear_entry);
++
++static void iopgtable_clear_entry_all(struct iommu *obj)
++{
++ int i;
++
++ spin_lock(&obj->page_table_lock);
++
++ for (i = 0; i < PTRS_PER_IOPGD; i++) {
++ u32 da;
++ u32 *iopgd;
++
++ da = i << IOPGD_SHIFT;
++ iopgd = iopgd_offset(obj, da);
++
++ if (!*iopgd)
++ continue;
++
++ if (*iopgd & IOPGD_TABLE)
++ iopte_free(iopte_offset(iopgd, 0));
++
++ *iopgd = 0;
++ flush_iopgd_range(iopgd, iopgd);
++ }
++
++ flush_iotlb_all(obj);
++
++ spin_unlock(&obj->page_table_lock);
++}
++
++/*
++ * Device IOMMU generic operations
++ */
++static irqreturn_t iommu_fault_handler(int irq, void *data)
++{
++ u32 stat, da;
++ u32 *iopgd, *iopte;
++ int err = -EIO;
++ struct iommu *obj = data;
++
++ /* Dynamic loading TLB or PTE */
++ if (obj->isr)
++ err = obj->isr(obj);
++
++ if (!err)
++ return IRQ_HANDLED;
++
++ stat = iommu_report_fault(obj, &da);
++ if (!stat)
++ return IRQ_HANDLED;
++
++ iopgd = iopgd_offset(obj, da);
++
++ if (!(*iopgd & IOPGD_TABLE)) {
++ dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__,
++ da, iopgd, *iopgd);
++ return IRQ_NONE;
++ }
++
++ iopte = iopte_offset(iopgd, da);
++
++ dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
++ __func__, da, iopgd, *iopgd, iopte, *iopte);
++
++ dump_tlb_entries(obj);
++
++ return IRQ_NONE;
++}
++
++static int device_match_by_alias(struct device *dev, void *data)
++{
++ struct iommu *obj = to_iommu(dev);
++ const char *name = data;
++
++ pr_debug("%s: %s %s\n", __func__, obj->name, name);
++
++ return strcmp(obj->name, name) == 0;
++}
++
++/**
++ * iommu_put() - Get iommu handler
++ * @name: target iommu name
++ **/
++struct iommu *iommu_get(const char *name)
++{
++ int err = -ENOMEM;
++ struct device *dev;
++ struct iommu *obj;
++
++ dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name,
++ device_match_by_alias);
++ if (!dev)
++ return ERR_PTR(-ENODEV);
++
++ obj = to_iommu(dev);
++
++ mutex_lock(&obj->iommu_lock);
++
++ if (obj->refcount++ == 0) {
++ err = iommu_enable(obj);
++ if (err)
++ goto err_enable;
++ flush_iotlb_all(obj);
++ }
++
++ if (!try_module_get(obj->owner))
++ goto err_module;
++
++ mutex_unlock(&obj->iommu_lock);
++
++ dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
++ return obj;
++
++err_module:
++ if (obj->refcount == 1)
++ iommu_disable(obj);
++err_enable:
++ mutex_unlock(&obj->iommu_lock);
++ return ERR_PTR(err);
++}
++EXPORT_SYMBOL_GPL(iommu_get);
++
++/**
++ * iommu_put() - Put back iommu handler
++ * @obj: target iommu
++ **/
++void iommu_put(struct iommu *obj)
++{
++ if (!obj && IS_ERR(obj))
++ return;
++
++ mutex_lock(&obj->iommu_lock);
++
++ if (--obj->refcount == 0)
++ iommu_disable(obj);
++
++ module_put(obj->owner);
++
++ mutex_unlock(&obj->iommu_lock);
++
++ dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
++}
++EXPORT_SYMBOL_GPL(iommu_put);
++
++/*
++ * OMAP Device MMU(IOMMU) detection
++ */
++static int __devinit omap_iommu_probe(struct platform_device *pdev)
++{
++ int err = -ENODEV;
++ void *p;
++ int irq;
++ struct iommu *obj;
++ struct resource *res;
++ struct iommu_platform_data *pdata = pdev->dev.platform_data;
++
++ if (pdev->num_resources != 2)
++ return -EINVAL;
++
++ obj = kzalloc(sizeof(*obj) + MMU_REG_SIZE, GFP_KERNEL);
++ if (!obj)
++ return -ENOMEM;
++
++ obj->clk = clk_get(&pdev->dev, pdata->clk_name);
++ if (IS_ERR(obj->clk))
++ goto err_clk;
++
++ obj->nr_tlb_entries = pdata->nr_tlb_entries;
++ obj->name = pdata->name;
++ obj->dev = &pdev->dev;
++ obj->ctx = (void *)obj + sizeof(*obj);
++
++ mutex_init(&obj->iommu_lock);
++ mutex_init(&obj->mmap_lock);
++ spin_lock_init(&obj->page_table_lock);
++ INIT_LIST_HEAD(&obj->mmap);
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ err = -ENODEV;
++ goto err_mem;
++ }
++ obj->regbase = ioremap(res->start, resource_size(res));
++ if (!obj->regbase) {
++ err = -ENOMEM;
++ goto err_mem;
++ }
++
++ res = request_mem_region(res->start, resource_size(res),
++ dev_name(&pdev->dev));
++ if (!res) {
++ err = -EIO;
++ goto err_mem;
++ }
++
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0) {
++ err = -ENODEV;
++ goto err_irq;
++ }
++ err = request_irq(irq, iommu_fault_handler, IRQF_SHARED,
++ dev_name(&pdev->dev), obj);
++ if (err < 0)
++ goto err_irq;
++ platform_set_drvdata(pdev, obj);
++
++ p = (void *)__get_free_pages(GFP_KERNEL, get_order(IOPGD_TABLE_SIZE));
++ if (!p) {
++ err = -ENOMEM;
++ goto err_pgd;
++ }
++ memset(p, 0, IOPGD_TABLE_SIZE);
++ clean_dcache_area(p, IOPGD_TABLE_SIZE);
++ obj->iopgd = p;
++
++ BUG_ON(!IS_ALIGNED((unsigned long)obj->iopgd, IOPGD_TABLE_SIZE));
++
++ dev_info(&pdev->dev, "%s registered\n", obj->name);
++ return 0;
++
++err_pgd:
++ free_irq(irq, obj);
++err_irq:
++ release_mem_region(res->start, resource_size(res));
++ iounmap(obj->regbase);
++err_mem:
++ clk_put(obj->clk);
++err_clk:
++ kfree(obj);
++ return err;
++}
++
++static int __devexit omap_iommu_remove(struct platform_device *pdev)
++{
++ int irq;
++ struct resource *res;
++ struct iommu *obj = platform_get_drvdata(pdev);
++
++ platform_set_drvdata(pdev, NULL);
++
++ iopgtable_clear_entry_all(obj);
++ free_pages((unsigned long)obj->iopgd, get_order(IOPGD_TABLE_SIZE));
++
++ irq = platform_get_irq(pdev, 0);
++ free_irq(irq, obj);
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ release_mem_region(res->start, resource_size(res));
++ iounmap(obj->regbase);
++
++ clk_put(obj->clk);
++ dev_info(&pdev->dev, "%s removed\n", obj->name);
++ kfree(obj);
++ return 0;
++}
++
++static struct platform_driver omap_iommu_driver = {
++ .probe = omap_iommu_probe,
++ .remove = __devexit_p(omap_iommu_remove),
++ .driver = {
++ .name = "omap-iommu",
++ },
++};
++
++static void iopte_cachep_ctor(void *iopte)
++{
++ clean_dcache_area(iopte, IOPTE_TABLE_SIZE);
++}
++
++static int __init omap_iommu_init(void)
++{
++ struct kmem_cache *p;
++ const unsigned long flags = SLAB_HWCACHE_ALIGN;
++
++ p = kmem_cache_create("iopte_cache", IOPTE_TABLE_SIZE, 0, flags,
++ iopte_cachep_ctor);
++ if (!p)
++ return -ENOMEM;
++ iopte_cachep = p;
++
++ return platform_driver_register(&omap_iommu_driver);
++}
++module_init(omap_iommu_init);
++
++static void __exit omap_iommu_exit(void)
++{
++ kmem_cache_destroy(iopte_cachep);
++
++ platform_driver_unregister(&omap_iommu_driver);
++}
++module_exit(omap_iommu_exit);
++
++MODULE_DESCRIPTION("omap iommu: tlb and pagetable primitives");
++MODULE_ALIAS("platform:omap-iommu");
++MODULE_AUTHOR("Hiroshi DOYU, Paul Mundt and Toshihiro Kobayashi");
++MODULE_LICENSE("GPL v2");
+diff --git a/arch/arm/plat-omap/iopgtable.h b/arch/arm/plat-omap/iopgtable.h
+new file mode 100644
+index 0000000..37dac43
+--- /dev/null
++++ b/arch/arm/plat-omap/iopgtable.h
+@@ -0,0 +1,72 @@
++/*
++ * omap iommu: pagetable definitions
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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.
++ */
++
++#ifndef __PLAT_OMAP_IOMMU_H
++#define __PLAT_OMAP_IOMMU_H
++
++#define IOPGD_SHIFT 20
++#define IOPGD_SIZE (1 << IOPGD_SHIFT)
++#define IOPGD_MASK (~(IOPGD_SIZE - 1))
++#define IOSECTION_MASK IOPGD_MASK
++#define PTRS_PER_IOPGD (1 << (32 - IOPGD_SHIFT))
++#define IOPGD_TABLE_SIZE (PTRS_PER_IOPGD * sizeof(u32))
++
++#define IOSUPER_SIZE (IOPGD_SIZE << 4)
++#define IOSUPER_MASK (~(IOSUPER_SIZE - 1))
++
++#define IOPTE_SHIFT 12
++#define IOPTE_SIZE (1 << IOPTE_SHIFT)
++#define IOPTE_MASK (~(IOPTE_SIZE - 1))
++#define IOPAGE_MASK IOPTE_MASK
++#define PTRS_PER_IOPTE (1 << (IOPGD_SHIFT - IOPTE_SHIFT))
++#define IOPTE_TABLE_SIZE (PTRS_PER_IOPTE * sizeof(u32))
++
++#define IOLARGE_SIZE (IOPTE_SIZE << 4)
++#define IOLARGE_MASK (~(IOLARGE_SIZE - 1))
++
++#define IOPGD_TABLE (1 << 0)
++#define IOPGD_SECTION (2 << 0)
++#define IOPGD_SUPER (1 << 18 | 2 << 0)
++
++#define IOPTE_SMALL (2 << 0)
++#define IOPTE_LARGE (1 << 0)
++
++#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
++#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
++
++#define iopte_paddr(iopgd) (*iopgd & ~((1 << 10) - 1))
++#define iopte_vaddr(iopgd) ((u32 *)phys_to_virt(iopte_paddr(iopgd)))
++
++#define iopte_index(da) (((da) >> IOPTE_SHIFT) & (PTRS_PER_IOPTE - 1))
++#define iopte_offset(iopgd, da) (iopte_vaddr(iopgd) + iopte_index(da))
++
++static inline u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa,
++ u32 flags)
++{
++ memset(e, 0, sizeof(*e));
++
++ e->da = da;
++ e->pa = pa;
++ e->valid = 1;
++ /* FIXME: add OMAP1 support */
++ e->pgsz = flags & MMU_CAM_PGSZ_MASK;
++ e->endian = flags & MMU_RAM_ENDIAN_MASK;
++ e->elsz = flags & MMU_RAM_ELSZ_MASK;
++ e->mixed = flags & MMU_RAM_MIXED_MASK;
++
++ return iopgsz_to_bytes(e->pgsz);
++}
++
++#define to_iommu(dev) \
++ (struct iommu *)platform_get_drvdata(to_platform_device(dev))
++
++#endif /* __PLAT_OMAP_IOMMU_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0002-omap-iommu-omap2-architecture-specific-functions.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0002-omap-iommu-omap2-architecture-specific-functions.patch
new file mode 100644
index 0000000000..d5f78dd14e
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0002-omap-iommu-omap2-architecture-specific-functions.patch
@@ -0,0 +1,453 @@
+From c79d7959c45f40e47520aa6acd54c19094754787 Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Mon, 26 Jan 2009 15:13:45 +0200
+Subject: [PATCH] omap iommu: omap2 architecture specific functions
+
+The structure 'arch_mmu' accommodates the difference between omap1 and
+omap2/3.
+
+This patch provides omap2/3 specific functions
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/mach-omap2/iommu2.c | 326 ++++++++++++++++++++++++++++++
+ arch/arm/plat-omap/include/mach/iommu2.h | 94 +++++++++
+ 2 files changed, 420 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/mach-omap2/iommu2.c
+ create mode 100644 arch/arm/plat-omap/include/mach/iommu2.h
+
+diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
+new file mode 100644
+index 0000000..88a44f1
+--- /dev/null
++++ b/arch/arm/mach-omap2/iommu2.c
+@@ -0,0 +1,326 @@
++/*
++ * omap iommu: omap2/3 architecture specific functions
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
++ * Paul Mundt and Toshihiro Kobayashi
++ *
++ * 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/err.h>
++#include <linux/device.h>
++#include <linux/jiffies.h>
++#include <linux/module.h>
++#include <linux/stringify.h>
++
++#include <asm/io.h>
++
++#include <mach/iommu.h>
++#include <mach/iommu2.h>
++
++/*
++ * omap2 architecture specific register bit definitions
++ */
++#define IOMMU_ARCH_VERSION 0x00000011
++
++/* SYSCONF */
++#define MMU_SYS_IDLE_SHIFT 3
++#define MMU_SYS_IDLE_FORCE (0 << MMU_SYS_IDLE_SHIFT)
++#define MMU_SYS_IDLE_NONE (1 << MMU_SYS_IDLE_SHIFT)
++#define MMU_SYS_IDLE_SMART (2 << MMU_SYS_IDLE_SHIFT)
++#define MMU_SYS_IDLE_MASK (3 << MMU_SYS_IDLE_SHIFT)
++
++#define MMU_SYS_SOFTRESET (1 << 1)
++#define MMU_SYS_AUTOIDLE 1
++
++/* SYSSTATUS */
++#define MMU_SYS_RESETDONE 1
++
++/* IRQSTATUS & IRQENABLE */
++#define MMU_IRQ_MULTIHITFAULT (1 << 4)
++#define MMU_IRQ_TABLEWALKFAULT (1 << 3)
++#define MMU_IRQ_EMUMISS (1 << 2)
++#define MMU_IRQ_TRANSLATIONFAULT (1 << 1)
++#define MMU_IRQ_TLBMISS (1 << 0)
++#define MMU_IRQ_MASK \
++ (MMU_IRQ_MULTIHITFAULT | MMU_IRQ_TABLEWALKFAULT | MMU_IRQ_EMUMISS | \
++ MMU_IRQ_TRANSLATIONFAULT)
++
++/* MMU_CNTL */
++#define MMU_CNTL_SHIFT 1
++#define MMU_CNTL_MASK (7 << MMU_CNTL_SHIFT)
++#define MMU_CNTL_EML_TLB (1 << 3)
++#define MMU_CNTL_TWL_EN (1 << 2)
++#define MMU_CNTL_MMU_EN (1 << 1)
++
++#define get_cam_va_mask(pgsz) \
++ (((pgsz) == MMU_CAM_PGSZ_16M) ? 0xff000000 : \
++ ((pgsz) == MMU_CAM_PGSZ_1M) ? 0xfff00000 : \
++ ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \
++ ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0)
++
++static int omap2_iommu_enable(struct iommu *obj)
++{
++ u32 l, pa;
++ unsigned long timeout;
++
++ if (!obj->iopgd || !IS_ALIGNED((u32)obj->iopgd, SZ_16K))
++ return -EINVAL;
++
++ pa = virt_to_phys(obj->iopgd);
++ if (!IS_ALIGNED(pa, SZ_16K))
++ return -EINVAL;
++
++ iommu_write_reg(obj, MMU_SYS_SOFTRESET, MMU_SYSCONFIG);
++
++ timeout = jiffies + msecs_to_jiffies(20);
++ do {
++ l = iommu_read_reg(obj, MMU_SYSSTATUS);
++ if (l & MMU_SYS_RESETDONE)
++ break;
++ } while (time_after(jiffies, timeout));
++
++ if (!(l & MMU_SYS_RESETDONE)) {
++ dev_err(obj->dev, "can't take mmu out of reset\n");
++ return -ENODEV;
++ }
++
++ l = iommu_read_reg(obj, MMU_REVISION);
++ dev_info(obj->dev, "%s: version %d.%d\n", obj->name,
++ (l >> 4) & 0xf, l & 0xf);
++
++ l = iommu_read_reg(obj, MMU_SYSCONFIG);
++ l &= ~MMU_SYS_IDLE_MASK;
++ l |= (MMU_SYS_IDLE_SMART | MMU_SYS_AUTOIDLE);
++ iommu_write_reg(obj, l, MMU_SYSCONFIG);
++
++ iommu_write_reg(obj, MMU_IRQ_MASK, MMU_IRQENABLE);
++ iommu_write_reg(obj, pa, MMU_TTB);
++
++ l = iommu_read_reg(obj, MMU_CNTL);
++ l &= ~MMU_CNTL_MASK;
++ l |= (MMU_CNTL_MMU_EN | MMU_CNTL_TWL_EN);
++ iommu_write_reg(obj, l, MMU_CNTL);
++
++ return 0;
++}
++
++static void omap2_iommu_disable(struct iommu *obj)
++{
++ u32 l = iommu_read_reg(obj, MMU_CNTL);
++
++ l &= ~MMU_CNTL_MASK;
++ iommu_write_reg(obj, l, MMU_CNTL);
++ iommu_write_reg(obj, MMU_SYS_IDLE_FORCE, MMU_SYSCONFIG);
++
++ dev_dbg(obj->dev, "%s is shutting down\n", obj->name);
++}
++
++static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
++{
++ int i;
++ u32 stat, da;
++ const char *err_msg[] = {
++ "tlb miss",
++ "translation fault",
++ "emulation miss",
++ "table walk fault",
++ "multi hit fault",
++ };
++
++ stat = iommu_read_reg(obj, MMU_IRQSTATUS);
++ stat &= MMU_IRQ_MASK;
++ if (!stat)
++ return 0;
++
++ da = iommu_read_reg(obj, MMU_FAULT_AD);
++ *ra = da;
++
++ dev_err(obj->dev, "%s:\tda:%08x ", __func__, da);
++
++ for (i = 0; i < ARRAY_SIZE(err_msg); i++) {
++ if (stat & (1 << i))
++ printk("%s ", err_msg[i]);
++ }
++ printk("\n");
++
++ iommu_write_reg(obj, stat, MMU_IRQSTATUS);
++ return stat;
++}
++
++static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr)
++{
++ cr->cam = iommu_read_reg(obj, MMU_READ_CAM);
++ cr->ram = iommu_read_reg(obj, MMU_READ_RAM);
++}
++
++static void omap2_tlb_load_cr(struct iommu *obj, struct cr_regs *cr)
++{
++ iommu_write_reg(obj, cr->cam | MMU_CAM_V, MMU_CAM);
++ iommu_write_reg(obj, cr->ram, MMU_RAM);
++}
++
++static u32 omap2_cr_to_virt(struct cr_regs *cr)
++{
++ u32 page_size = cr->cam & MMU_CAM_PGSZ_MASK;
++ u32 mask = get_cam_va_mask(cr->cam & page_size);
++
++ return cr->cam & mask;
++}
++
++static struct cr_regs *omap2_alloc_cr(struct iommu *obj, struct iotlb_entry *e)
++{
++ struct cr_regs *cr;
++
++ if (e->da & ~(get_cam_va_mask(e->pgsz))) {
++ dev_err(obj->dev, "%s:\twrong alignment: %08x\n", __func__,
++ e->da);
++ return ERR_PTR(-EINVAL);
++ }
++
++ cr = kmalloc(sizeof(*cr), GFP_KERNEL);
++ if (!cr)
++ return ERR_PTR(-ENOMEM);
++
++ cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz;
++ cr->ram = e->pa | e->endian | e->elsz | e->mixed;
++
++ return cr;
++}
++
++static inline int omap2_cr_valid(struct cr_regs *cr)
++{
++ return cr->cam & MMU_CAM_V;
++}
++
++static u32 omap2_get_pte_attr(struct iotlb_entry *e)
++{
++ u32 attr;
++
++ attr = e->mixed << 5;
++ attr |= e->endian;
++ attr |= e->elsz >> 3;
++ attr <<= ((e->pgsz & MMU_CAM_PGSZ_4K) ? 0 : 6);
++
++ return attr;
++}
++
++static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf)
++{
++ char *p = buf;
++
++ /* FIXME: Need more detail analysis of cam/ram */
++ p += sprintf(p, "%08x %08x\n", cr->cam, cr->ram);
++
++ return p - buf;
++}
++
++#define pr_reg(name) \
++ p += sprintf(p, "%20s: %08x\n", \
++ __stringify(name), iommu_read_reg(obj, MMU_##name));
++
++static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf)
++{
++ char *p = buf;
++
++ pr_reg(REVISION);
++ pr_reg(SYSCONFIG);
++ pr_reg(SYSSTATUS);
++ pr_reg(IRQSTATUS);
++ pr_reg(IRQENABLE);
++ pr_reg(WALKING_ST);
++ pr_reg(CNTL);
++ pr_reg(FAULT_AD);
++ pr_reg(TTB);
++ pr_reg(LOCK);
++ pr_reg(LD_TLB);
++ pr_reg(CAM);
++ pr_reg(RAM);
++ pr_reg(GFLUSH);
++ pr_reg(FLUSH_ENTRY);
++ pr_reg(READ_CAM);
++ pr_reg(READ_RAM);
++ pr_reg(EMU_FAULT_AD);
++
++ return p - buf;
++}
++
++static void omap2_iommu_save_ctx(struct iommu *obj)
++{
++ int i;
++ u32 *p = obj->ctx;
++
++ for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
++ p[i] = iommu_read_reg(obj, i * sizeof(u32));
++ dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
++ }
++
++ BUG_ON(p[0] != IOMMU_ARCH_VERSION);
++}
++
++static void omap2_iommu_restore_ctx(struct iommu *obj)
++{
++ int i;
++ u32 *p = obj->ctx;
++
++ for (i = 0; i < (MMU_REG_SIZE / sizeof(u32)); i++) {
++ iommu_write_reg(obj, p[i], i * sizeof(u32));
++ dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
++ }
++
++ BUG_ON(p[0] != IOMMU_ARCH_VERSION);
++}
++
++static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
++{
++ e->da = cr->cam & MMU_CAM_VATAG_MASK;
++ e->pa = cr->ram & MMU_RAM_PADDR_MASK;
++ e->valid = cr->cam & MMU_CAM_V;
++ e->pgsz = cr->cam & MMU_CAM_PGSZ_MASK;
++ e->endian = cr->ram & MMU_RAM_ENDIAN_MASK;
++ e->elsz = cr->ram & MMU_RAM_ELSZ_MASK;
++ e->mixed = cr->ram & MMU_RAM_MIXED;
++}
++
++static const struct iommu_functions omap2_iommu_ops = {
++ .version = IOMMU_ARCH_VERSION,
++
++ .enable = omap2_iommu_enable,
++ .disable = omap2_iommu_disable,
++ .fault_isr = omap2_iommu_fault_isr,
++
++ .tlb_read_cr = omap2_tlb_read_cr,
++ .tlb_load_cr = omap2_tlb_load_cr,
++
++ .cr_to_e = omap2_cr_to_e,
++ .cr_to_virt = omap2_cr_to_virt,
++ .alloc_cr = omap2_alloc_cr,
++ .cr_valid = omap2_cr_valid,
++ .dump_cr = omap2_dump_cr,
++
++ .get_pte_attr = omap2_get_pte_attr,
++
++ .save_ctx = omap2_iommu_save_ctx,
++ .restore_ctx = omap2_iommu_restore_ctx,
++ .dump_ctx = omap2_iommu_dump_ctx,
++};
++
++static int __init omap2_iommu_init(void)
++{
++ return install_iommu_arch(&omap2_iommu_ops);
++}
++module_init(omap2_iommu_init);
++
++static void __exit omap2_iommu_exit(void)
++{
++ uninstall_iommu_arch(&omap2_iommu_ops);
++}
++module_exit(omap2_iommu_exit);
++
++MODULE_AUTHOR("Hiroshi DOYU, Paul Mundt and Toshihiro Kobayashi");
++MODULE_DESCRIPTION("omap iommu: omap2/3 architecture specific functions");
++MODULE_LICENSE("GPL v2");
+diff --git a/arch/arm/plat-omap/include/mach/iommu2.h b/arch/arm/plat-omap/include/mach/iommu2.h
+new file mode 100644
+index 0000000..d746047
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/iommu2.h
+@@ -0,0 +1,94 @@
++/*
++ * omap iommu: omap2 architecture specific definitions
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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.
++ */
++
++#ifndef __MACH_IOMMU2_H
++#define __MACH_IOMMU2_H
++
++/*
++ * MMU Register offsets
++ */
++#define MMU_REVISION 0x00
++#define MMU_SYSCONFIG 0x10
++#define MMU_SYSSTATUS 0x14
++#define MMU_IRQSTATUS 0x18
++#define MMU_IRQENABLE 0x1c
++#define MMU_WALKING_ST 0x40
++#define MMU_CNTL 0x44
++#define MMU_FAULT_AD 0x48
++#define MMU_TTB 0x4c
++#define MMU_LOCK 0x50
++#define MMU_LD_TLB 0x54
++#define MMU_CAM 0x58
++#define MMU_RAM 0x5c
++#define MMU_GFLUSH 0x60
++#define MMU_FLUSH_ENTRY 0x64
++#define MMU_READ_CAM 0x68
++#define MMU_READ_RAM 0x6c
++#define MMU_EMU_FAULT_AD 0x70
++
++#define MMU_REG_SIZE 256
++
++/*
++ * MMU Register bit definitions
++ */
++#define MMU_LOCK_BASE_SHIFT 10
++#define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT)
++#define MMU_LOCK_BASE(x) \
++ ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT)
++
++#define MMU_LOCK_VICT_SHIFT 4
++#define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT)
++#define MMU_LOCK_VICT(x) \
++ ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT)
++
++#define MMU_CAM_VATAG_SHIFT 12
++#define MMU_CAM_VATAG_MASK \
++ ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT)
++#define MMU_CAM_P (1 << 3)
++#define MMU_CAM_V (1 << 2)
++#define MMU_CAM_PGSZ_MASK 3
++#define MMU_CAM_PGSZ_1M (0 << 0)
++#define MMU_CAM_PGSZ_64K (1 << 0)
++#define MMU_CAM_PGSZ_4K (2 << 0)
++#define MMU_CAM_PGSZ_16M (3 << 0)
++
++#define MMU_RAM_PADDR_SHIFT 12
++#define MMU_RAM_PADDR_MASK \
++ ((~0UL >> MMU_RAM_PADDR_SHIFT) << MMU_RAM_PADDR_SHIFT)
++#define MMU_RAM_ENDIAN_SHIFT 9
++#define MMU_RAM_ENDIAN_MASK (1 << MMU_RAM_ENDIAN_SHIFT)
++#define MMU_RAM_ENDIAN_BIG (1 << MMU_RAM_ENDIAN_SHIFT)
++#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)
++#define MMU_RAM_ELSZ_SHIFT 7
++#define MMU_RAM_ELSZ_MASK (3 << MMU_RAM_ELSZ_SHIFT)
++#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)
++#define MMU_RAM_ELSZ_16 (1 << MMU_RAM_ELSZ_SHIFT)
++#define MMU_RAM_ELSZ_32 (2 << MMU_RAM_ELSZ_SHIFT)
++#define MMU_RAM_ELSZ_NONE (3 << MMU_RAM_ELSZ_SHIFT)
++#define MMU_RAM_MIXED_SHIFT 6
++#define MMU_RAM_MIXED_MASK (1 << MMU_RAM_MIXED_SHIFT)
++#define MMU_RAM_MIXED MMU_RAM_MIXED_MASK
++
++/*
++ * register accessors
++ */
++static inline u32 iommu_read_reg(struct iommu *obj, size_t offs)
++{
++ return __raw_readl(obj->regbase + offs);
++}
++
++static inline void iommu_write_reg(struct iommu *obj, u32 val, size_t offs)
++{
++ __raw_writel(val, obj->regbase + offs);
++}
++
++#endif /* __MACH_IOMMU2_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0003-omap-iommu-omap3-iommu-device-registration.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0003-omap-iommu-omap3-iommu-device-registration.patch
new file mode 100644
index 0000000000..2954c47872
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0003-omap-iommu-omap3-iommu-device-registration.patch
@@ -0,0 +1,124 @@
+From 6a84082597dd322713c5d5951530e3eecb878ad4 Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Wed, 28 Jan 2009 21:32:04 +0200
+Subject: [PATCH] omap iommu: omap3 iommu device registration
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/mach-omap2/omap3-iommu.c | 104 +++++++++++++++++++++++++++++++++++++
+ 1 files changed, 104 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/mach-omap2/omap3-iommu.c
+
+diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c
+new file mode 100644
+index 0000000..97481cc
+--- /dev/null
++++ b/arch/arm/mach-omap2/omap3-iommu.c
+@@ -0,0 +1,104 @@
++/*
++ * omap iommu: omap3 device registration
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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/platform_device.h>
++#include <linux/io.h>
++
++#include <mach/iommu.h>
++
++#define OMAP3_MMU1_BASE 0x480bd400
++#define OMAP3_MMU2_BASE 0x5d000000
++#define OMAP3_MMU1_IRQ 24
++#define OMAP3_MMU2_IRQ 28
++
++static struct resource omap3_iommu_res[] = {
++ { /* Camera ISP MMU */
++ .start = OMAP3_MMU1_BASE,
++ .end = OMAP3_MMU1_BASE + MMU_REG_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = OMAP3_MMU1_IRQ,
++ .flags = IORESOURCE_IRQ,
++ },
++ { /* IVA2.2 MMU */
++ .start = OMAP3_MMU2_BASE,
++ .end = OMAP3_MMU2_BASE + MMU_REG_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = OMAP3_MMU2_IRQ,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++#define NR_IOMMU_RES (ARRAY_SIZE(omap3_iommu_res) / 2)
++
++static const struct iommu_platform_data omap3_iommu_pdata[] __initconst = {
++ {
++ .name = "isp",
++ .nr_tlb_entries = 8,
++ .clk_name = "cam_ick",
++ },
++ {
++ .name = "iva2",
++ .nr_tlb_entries = 32,
++ .clk_name = "iva2_ck",
++ },
++};
++#define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata)
++
++static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES];
++
++static int __init omap3_iommu_init(void)
++{
++ int i, err;
++
++ for (i = 0; i < NR_IOMMU_DEVICES; i++) {
++ struct platform_device *pdev;
++
++ pdev = platform_device_alloc("omap-iommu", i + 1);
++ if (!pdev)
++ goto err_out;
++ err = platform_device_add_resources(pdev,
++ &omap3_iommu_res[2 * i], NR_IOMMU_RES);
++ if (err)
++ goto err_out;
++ err = platform_device_add_data(pdev, &omap3_iommu_pdata[i],
++ sizeof(omap3_iommu_pdata[0]));
++ if (err)
++ goto err_out;
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_out;
++ omap3_iommu_pdev[i] = pdev;
++ }
++ return 0;
++
++err_out:
++ while (i--)
++ platform_device_put(omap3_iommu_pdev[i]);
++ return err;
++}
++module_init(omap3_iommu_init);
++
++static void __exit omap3_iommu_exit(void)
++{
++ int i;
++
++ for (i = 0; i < NR_IOMMU_DEVICES; i++)
++ platform_device_unregister(omap3_iommu_pdev[i]);
++}
++module_exit(omap3_iommu_exit);
++
++MODULE_AUTHOR("Hiroshi DOYU");
++MODULE_DESCRIPTION("omap iommu: omap3 device registration");
++MODULE_LICENSE("GPL v2");
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0004-omap-iommu-simple-virtual-address-space-management.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0004-omap-iommu-simple-virtual-address-space-management.patch
new file mode 100644
index 0000000000..945778b943
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0004-omap-iommu-simple-virtual-address-space-management.patch
@@ -0,0 +1,1083 @@
+From 07365182b998af3dc2b79e822b8e21a3f50262c4 Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Wed, 28 Jan 2009 21:32:08 +0200
+Subject: [PATCH] omap iommu: simple virtual address space management
+
+This patch provides a device drivers, which has a omap iommu, with
+address mapping APIs between device virtual address(iommu), physical
+address and MPU virtual address.
+
+There are 4 possible patterns for iommu virtual address(iova/da) mapping.
+
+ |iova/ mapping iommu_ page
+ | da pa va (d)-(p)-(v) function type
+ ---------------------------------------------------------------------------
+ 1 | c c c 1 - 1 - 1 _kmap() / _kunmap() s
+ 2 | c c,a c 1 - 1 - 1 _kmalloc()/ _kfree() s
+ 3 | c d c 1 - n - 1 _vmap() / _vunmap() s
+ 4 | c d,a c 1 - n - 1 _vmalloc()/ _vfree() n*
+
+ 'iova': device iommu virtual address
+ 'da': alias of 'iova'
+ 'pa': physical address
+ 'va': mpu virtual address
+
+ 'c': contiguous memory area
+ 'd': dicontiguous memory area
+ 'a': anonymous memory allocation
+ '()': optional feature
+
+ 'n': a normal page(4KB) size is used.
+ 's': multiple iommu superpage(16MB, 1MB, 64KB, 4KB) size is used.
+
+ '*': not yet, but feasible.
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/include/asm/io.h | 6 +
+ arch/arm/mm/ioremap.c | 11 +
+ arch/arm/plat-omap/include/mach/iovmm.h | 94 ++++
+ arch/arm/plat-omap/iovmm.c | 891 +++++++++++++++++++++++++++++++
+ 4 files changed, 1002 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/plat-omap/include/mach/iovmm.h
+ create mode 100644 arch/arm/plat-omap/iovmm.c
+
+diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
+index d2a59cf..cbdadfe 100644
+--- a/arch/arm/include/asm/io.h
++++ b/arch/arm/include/asm/io.h
+@@ -75,6 +75,12 @@ extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int);
+ extern void __iounmap(volatile void __iomem *addr);
+
+ /*
++ * external interface to remap single page with appropriate type
++ */
++extern int ioremap_page(unsigned long virt, unsigned long phys,
++ unsigned int mtype);
++
++/*
+ * Bad read/write accesses...
+ */
+ extern void __readwrite_bug(const char *fn);
+diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
+index 9f88dd3..8441351 100644
+--- a/arch/arm/mm/ioremap.c
++++ b/arch/arm/mm/ioremap.c
+@@ -110,6 +110,17 @@ static int remap_area_pages(unsigned long start, unsigned long pfn,
+ return err;
+ }
+
++int ioremap_page(unsigned long virt, unsigned long phys, unsigned int mtype)
++{
++ const struct mem_type *type;
++
++ type = get_mem_type(mtype);
++ if (!type)
++ return -EINVAL;
++
++ return remap_area_pages(virt, __phys_to_pfn(phys), PAGE_SIZE, type);
++}
++EXPORT_SYMBOL(ioremap_page);
+
+ void __check_kvm_seq(struct mm_struct *mm)
+ {
+diff --git a/arch/arm/plat-omap/include/mach/iovmm.h b/arch/arm/plat-omap/include/mach/iovmm.h
+new file mode 100644
+index 0000000..bdc7ce5
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/iovmm.h
+@@ -0,0 +1,94 @@
++/*
++ * omap iommu: simple virtual address space management
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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.
++ */
++
++#ifndef __IOMMU_MMAP_H
++#define __IOMMU_MMAP_H
++
++struct iovm_struct {
++ struct iommu *iommu; /* iommu object which this belongs to */
++ u32 da_start; /* area definition */
++ u32 da_end;
++ u32 flags; /* IOVMF_: see below */
++ struct list_head list; /* linked in ascending order */
++ const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */
++ void *va; /* mpu side mapped address */
++};
++
++/*
++ * IOVMF_FLAGS: attribute for iommu virtual memory area(iovma)
++ *
++ * lower 16 bit is used for h/w and upper 16 bit is for s/w.
++ */
++#define IOVMF_SW_SHIFT 16
++#define IOVMF_HW_SIZE (1 << IOVMF_SW_SHIFT)
++#define IOVMF_HW_MASK (IOVMF_HW_SIZE - 1)
++#define IOVMF_SW_MASK (~IOVMF_HW_MASK)UL
++
++/*
++ * iovma: h/w flags derived from cam and ram attribute
++ */
++#define IOVMF_CAM_MASK (~((1 << 10) - 1))
++#define IOVMF_RAM_MASK (~IOVMF_CAM_MASK)
++
++#define IOVMF_PGSZ_MASK (3 << 0)
++#define IOVMF_PGSZ_1M MMU_CAM_PGSZ_1M
++#define IOVMF_PGSZ_64K MMU_CAM_PGSZ_64K
++#define IOVMF_PGSZ_4K MMU_CAM_PGSZ_4K
++#define IOVMF_PGSZ_16M MMU_CAM_PGSZ_16M
++
++#define IOVMF_ENDIAN_MASK (1 << 9)
++#define IOVMF_ENDIAN_BIG MMU_RAM_ENDIAN_BIG
++#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE
++
++#define IOVMF_ELSZ_MASK (3 << 7)
++#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8
++#define IOVMF_ELSZ_16 MMU_RAM_ELSZ_16
++#define IOVMF_ELSZ_32 MMU_RAM_ELSZ_32
++#define IOVMF_ELSZ_NONE MMU_RAM_ELSZ_NONE
++
++#define IOVMF_MIXED_MASK (1 << 6)
++#define IOVMF_MIXED MMU_RAM_MIXED
++
++/*
++ * iovma: s/w flags, used for mapping and umapping internally.
++ */
++#define IOVMF_MMIO (1 << IOVMF_SW_SHIFT)
++#define IOVMF_ALLOC (2 << IOVMF_SW_SHIFT)
++#define IOVMF_ALLOC_MASK (3 << IOVMF_SW_SHIFT)
++
++/* "superpages" is supported just with physically linear pages */
++#define IOVMF_DISCONT (1 << (2 + IOVMF_SW_SHIFT))
++#define IOVMF_LINEAR (2 << (2 + IOVMF_SW_SHIFT))
++#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))
++
++#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
++#define IOVMF_DA_ANON (2 << (4 + IOVMF_SW_SHIFT))
++#define IOVMF_DA_MASK (3 << (4 + IOVMF_SW_SHIFT))
++
++
++extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da);
++extern u32 iommu_vmap(struct iommu *obj, u32 da,
++ const struct sg_table *sgt, u32 flags);
++extern struct sg_table *iommu_vunmap(struct iommu *obj, u32 da);
++extern u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes,
++ u32 flags);
++extern void iommu_vfree(struct iommu *obj, const u32 da);
++extern u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
++ u32 flags);
++extern void iommu_kunmap(struct iommu *obj, u32 da);
++extern u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes,
++ u32 flags);
++extern void iommu_kfree(struct iommu *obj, u32 da);
++
++extern void *da_to_va(struct iommu *obj, u32 da);
++
++#endif /* __IOMMU_MMAP_H */
+diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
+new file mode 100644
+index 0000000..6726d10
+--- /dev/null
++++ b/arch/arm/plat-omap/iovmm.c
+@@ -0,0 +1,891 @@
++/*
++ * omap iommu: simple virtual address space management
++ *
++ * Copyright (C) 2008-2009 Nokia Corporation
++ *
++ * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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/err.h>
++#include <linux/vmalloc.h>
++#include <linux/device.h>
++#include <linux/scatterlist.h>
++
++#include <asm/io.h>
++#include <asm/cacheflush.h>
++
++#include <mach/iommu.h>
++#include <mach/iovmm.h>
++
++#include "iopgtable.h"
++
++/*
++ * A device driver needs to create address mappings between:
++ *
++ * - iommu/device address
++ * - physical address
++ * - mpu virtual address
++ *
++ * There are 4 possible patterns for them:
++ *
++ * |iova/ mapping iommu_ page
++ * | da pa va (d)-(p)-(v) function type
++ * ---------------------------------------------------------------------------
++ * 1 | c c c 1 - 1 - 1 _kmap() / _kunmap() s
++ * 2 | c c,a c 1 - 1 - 1 _kmalloc()/ _kfree() s
++ * 3 | c d c 1 - n - 1 _vmap() / _vunmap() s
++ * 4 | c d,a c 1 - n - 1 _vmalloc()/ _vfree() n*
++ *
++ *
++ * 'iova': device iommu virtual address
++ * 'da': alias of 'iova'
++ * 'pa': physical address
++ * 'va': mpu virtual address
++ *
++ * 'c': contiguous memory area
++ * 'd': dicontiguous memory area
++ * 'a': anonymous memory allocation
++ * '()': optional feature
++ *
++ * 'n': a normal page(4KB) size is used.
++ * 's': multiple iommu superpage(16MB, 1MB, 64KB, 4KB) size is used.
++ *
++ * '*': not yet, but feasible.
++ */
++
++static struct kmem_cache *iovm_area_cachep;
++
++/* return total bytes of sg buffers */
++static size_t sgtable_len(const struct sg_table *sgt)
++{
++ unsigned int i, total = 0;
++ struct scatterlist *sg;
++
++ if (!sgt)
++ return 0;
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i) {
++ size_t bytes;
++
++ bytes = sg_dma_len(sg);
++
++ if (!iopgsz_ok(bytes)) {
++ pr_err("%s: sg[%d] not iommu pagesize(%x)\n",
++ __func__, i, bytes);
++ return 0;
++ }
++
++ total += bytes;
++ }
++
++ return total;
++}
++#define sgtable_ok(x) (!!sgtable_len(x))
++
++/*
++ * calculate the optimal number sg elements from total bytes based on
++ * iommu superpages
++ */
++static unsigned int sgtable_nents(size_t bytes)
++{
++ int i;
++ unsigned int nr_entries;
++ const unsigned long pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
++
++ if (!IS_ALIGNED(bytes, PAGE_SIZE)) {
++ pr_err("%s: wrong size %08x\n", __func__, bytes);
++ return 0;
++ }
++
++ nr_entries = 0;
++ for (i = 0; i < ARRAY_SIZE(pagesize); i++) {
++ if (bytes >= pagesize[i]) {
++ nr_entries += (bytes / pagesize[i]);
++ bytes %= pagesize[i];
++ }
++ }
++ BUG_ON(bytes);
++
++ return nr_entries;
++}
++
++/* allocate and initialize sg_table header(a kind of 'superblock') */
++static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
++{
++ unsigned int nr_entries;
++ int err;
++ struct sg_table *sgt;
++
++ if (!bytes)
++ return ERR_PTR(-EINVAL);
++
++ if (!IS_ALIGNED(bytes, PAGE_SIZE))
++ return ERR_PTR(-EINVAL);
++
++ /* FIXME: IOVMF_DA_FIXED should support 'superpages' */
++ if ((flags & IOVMF_LINEAR) && (flags & IOVMF_DA_ANON)) {
++ nr_entries = sgtable_nents(bytes);
++ if (!nr_entries)
++ return ERR_PTR(-EINVAL);
++ } else
++ nr_entries = bytes / PAGE_SIZE;
++
++ sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
++ if (!sgt)
++ return ERR_PTR(-ENOMEM);
++
++ err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL);
++ if (err)
++ return ERR_PTR(err);
++
++ pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries);
++
++ return sgt;
++}
++
++/* free sg_table header(a kind of superblock) */
++static void sgtable_free(struct sg_table *sgt)
++{
++ if (!sgt)
++ return;
++
++ sg_free_table(sgt);
++ kfree(sgt);
++
++ pr_debug("%s: sgt:%p\n", __func__, sgt);
++}
++
++/* map 'sglist' to a contiguous mpu virtual area and return 'va' */
++static void *vmap_sg(const struct sg_table *sgt)
++{
++ u32 va;
++ size_t total;
++ unsigned int i;
++ struct scatterlist *sg;
++ struct vm_struct *new;
++
++ total = sgtable_len(sgt);
++ if (!total)
++ return ERR_PTR(-EINVAL);
++
++ new = __get_vm_area(total, VM_IOREMAP, VMALLOC_START, VMALLOC_END);
++ if (!new)
++ return ERR_PTR(-ENOMEM);
++ va = (u32)new->addr;
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i) {
++ size_t bytes;
++ u32 pa;
++ int err;
++
++ pa = sg_phys(sg);
++ bytes = sg_dma_len(sg);
++
++ BUG_ON(bytes != PAGE_SIZE);
++
++ err = ioremap_page(va, pa, MT_DEVICE);
++ if (err)
++ goto err_out;
++
++ va += bytes;
++ }
++
++ flush_cache_vmap(new->addr, total);
++ return new->addr;
++
++err_out:
++ WARN_ON(1); /* FIXME: cleanup some mpu mappings */
++ vunmap(new->addr);
++ return ERR_PTR(-EAGAIN);
++}
++
++static inline void vunmap_sg(const void *va)
++{
++ vunmap(va);
++}
++
++static struct iovm_struct *__find_iovm_area(struct iommu *obj, const u32 da)
++{
++ struct iovm_struct *tmp;
++
++ list_for_each_entry(tmp, &obj->mmap, list) {
++ if ((da >= tmp->da_start) && (da < tmp->da_end)) {
++ size_t len;
++
++ len = tmp->da_end - tmp->da_start;
++
++ dev_dbg(obj->dev, "%s: %08x-%08x-%08x(%x) %08x\n",
++ __func__, tmp->da_start, da, tmp->da_end, len,
++ tmp->flags);
++
++ return tmp;
++ }
++ }
++
++ return NULL;
++}
++
++/**
++ * find_iovm_area - find iovma which includes @da
++ * @da: iommu device virtual address
++ *
++ * Find the existing iovma starting at @da
++ */
++struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da)
++{
++ struct iovm_struct *area;
++
++ mutex_lock(&obj->mmap_lock);
++ area = __find_iovm_area(obj, da);
++ mutex_unlock(&obj->mmap_lock);
++
++ return area;
++}
++EXPORT_SYMBOL_GPL(find_iovm_area);
++
++/*
++ * This finds the hole(area) which fits the requested address and len
++ * in iovmas mmap, and returns the new allocated iovma.
++ */
++static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
++ size_t bytes, u32 flags)
++{
++ struct iovm_struct *new, *tmp;
++ u32 start, prev_end, alignement;
++
++ if (!obj || !bytes)
++ return ERR_PTR(-EINVAL);
++
++ start = da;
++ alignement = PAGE_SIZE;
++
++ if (flags & IOVMF_DA_ANON) {
++ /*
++ * Reserve the first page for NULL
++ */
++ start = PAGE_SIZE;
++ if (flags & IOVMF_LINEAR)
++ alignement = iopgsz_max(bytes);
++ start = roundup(start, alignement);
++ }
++
++ tmp = NULL;
++ if (list_empty(&obj->mmap))
++ goto found;
++
++ prev_end = 0;
++ list_for_each_entry(tmp, &obj->mmap, list) {
++
++ if ((prev_end <= start) && (start + bytes < tmp->da_start))
++ goto found;
++
++ if (flags & IOVMF_DA_ANON)
++ start = roundup(tmp->da_end, alignement);
++
++ prev_end = tmp->da_end;
++ }
++
++ if ((start >= prev_end) && (ULONG_MAX - start >= bytes))
++ goto found;
++
++ dev_dbg(obj->dev, "%s: no space to fit %08x(%x) flags: %08x\n",
++ __func__, da, bytes, flags);
++
++ return ERR_PTR(-EINVAL);
++
++found:
++ new = kmem_cache_zalloc(iovm_area_cachep, GFP_KERNEL);
++ if (!new)
++ return ERR_PTR(-ENOMEM);
++
++ new->iommu = obj;
++ new->da_start = start;
++ new->da_end = start + bytes;
++ new->flags = flags;
++
++ /*
++ * keep ascending order of iovmas
++ */
++ if (tmp)
++ list_add_tail(&new->list, &tmp->list);
++ else
++ list_add(&new->list, &obj->mmap);
++
++ dev_dbg(obj->dev, "%s: found %08x-%08x-%08x(%x) %08x\n",
++ __func__, new->da_start, start, new->da_end, bytes, flags);
++
++ return new;
++}
++
++static void free_iovm_area(struct iommu *obj, struct iovm_struct *area)
++{
++ size_t bytes;
++
++ BUG_ON(!obj || !area);
++
++ bytes = area->da_end - area->da_start;
++
++ dev_dbg(obj->dev, "%s: %08x-%08x(%x) %08x\n",
++ __func__, area->da_start, area->da_end, bytes, area->flags);
++
++ list_del(&area->list);
++ kmem_cache_free(iovm_area_cachep, area);
++}
++
++/**
++ * da_to_va - convert (d) to (v)
++ * @obj: objective iommu
++ * @da: iommu device virtual address
++ * @va: mpu virtual address
++ *
++ * Returns mpu virtual addr which corresponds to a given device virtual addr
++ */
++void *da_to_va(struct iommu *obj, u32 da)
++{
++ void *va = NULL;
++ struct iovm_struct *area;
++
++ mutex_lock(&obj->mmap_lock);
++
++ area = __find_iovm_area(obj, da);
++ if (!area) {
++ dev_warn(obj->dev, "%s: no da area(%08x)\n", __func__, da);
++ goto out;
++ }
++ va = area->va;
++ mutex_unlock(&obj->mmap_lock);
++out:
++ return va;
++}
++EXPORT_SYMBOL_GPL(da_to_va);
++
++static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
++{
++ unsigned int i;
++ struct scatterlist *sg;
++ void *va = _va;
++ void *va_end;
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i) {
++ struct page *pg;
++ const size_t bytes = PAGE_SIZE;
++
++ /*
++ * iommu 'superpage' isn't supported with 'iommu_vmalloc()'
++ */
++ pg = vmalloc_to_page(va);
++ BUG_ON(!pg);
++ sg_set_page(sg, pg, bytes, 0);
++
++ va += bytes;
++ }
++
++ va_end = _va + PAGE_SIZE * i;
++ flush_cache_vmap(_va, va_end);
++}
++
++static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
++{
++ /*
++ * Actually this is not necessary at all, just exists for
++ * consistency of the code readibility.
++ */
++ BUG_ON(!sgt);
++}
++
++static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
++{
++ unsigned int i;
++ struct scatterlist *sg;
++ void *va;
++
++ va = phys_to_virt(pa);
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i) {
++ size_t bytes;
++
++ bytes = iopgsz_max(len);
++
++ BUG_ON(!iopgsz_ok(bytes));
++
++ sg_set_buf(sg, phys_to_virt(pa), bytes);
++ /*
++ * 'pa' is cotinuous(linear).
++ */
++ pa += bytes;
++ len -= bytes;
++ }
++ BUG_ON(len);
++
++ clean_dcache_area(va, len);
++}
++
++static inline void sgtable_drain_kmalloc(struct sg_table *sgt)
++{
++ /*
++ * Actually this is not necessary at all, just exists for
++ * consistency of the code readibility
++ */
++ BUG_ON(!sgt);
++}
++
++/* create 'da' <-> 'pa' mapping from 'sgt' */
++static int map_iovm_area(struct iommu *obj, struct iovm_struct *new,
++ const struct sg_table *sgt, u32 flags)
++{
++ int err;
++ unsigned int i, j;
++ struct scatterlist *sg;
++ u32 da = new->da_start;
++
++ if (!obj || !new || !sgt)
++ return -EINVAL;
++
++ BUG_ON(!sgtable_ok(sgt));
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i) {
++ u32 pa;
++ int pgsz;
++ size_t bytes;
++ struct iotlb_entry e;
++
++ pa = sg_phys(sg);
++ bytes = sg_dma_len(sg);
++
++ flags &= ~IOVMF_PGSZ_MASK;
++ pgsz = bytes_to_iopgsz(bytes);
++ if (pgsz < 0)
++ goto err_out;
++ flags |= pgsz;
++
++ pr_debug("%s: [%d] %08x %08x(%x)\n", __func__,
++ i, da, pa, bytes);
++
++ iotlb_init_entry(&e, da, pa, flags);
++ err = iopgtable_store_entry(obj, &e);
++ if (err)
++ goto err_out;
++
++ da += bytes;
++ }
++ return 0;
++
++err_out:
++ da = new->da_start;
++
++ for_each_sg(sgt->sgl, sg, i, j) {
++ size_t bytes;
++
++ bytes = iopgtable_clear_entry(obj, da);
++
++ BUG_ON(!iopgsz_ok(bytes));
++
++ da += bytes;
++ }
++ return err;
++}
++
++/* release 'da' <-> 'pa' mapping */
++static void unmap_iovm_area(struct iommu *obj, struct iovm_struct *area)
++{
++ u32 start;
++ size_t total = area->da_end - area->da_start;
++
++ BUG_ON((!total) || !IS_ALIGNED(total, PAGE_SIZE));
++
++ start = area->da_start;
++ while (total > 0) {
++ size_t bytes;
++
++ bytes = iopgtable_clear_entry(obj, start);
++ if (bytes == 0)
++ bytes = PAGE_SIZE;
++ else
++ dev_dbg(obj->dev, "%s: unmap %08x(%x) %08x\n",
++ __func__, start, bytes, area->flags);
++
++ BUG_ON(!IS_ALIGNED(bytes, PAGE_SIZE));
++
++ total -= bytes;
++ start += bytes;
++ }
++ BUG_ON(total);
++}
++
++/* template function for all unmapping */
++static struct sg_table *unmap_vm_area(struct iommu *obj, const u32 da,
++ void (*fn)(const void *), u32 flags)
++{
++ struct sg_table *sgt = NULL;
++ struct iovm_struct *area;
++
++ BUG_ON(in_interrupt());
++
++ if (!IS_ALIGNED(da, PAGE_SIZE)) {
++ dev_err(obj->dev, "%s: alignment err(%08x)\n", __func__, da);
++ return NULL;
++ }
++
++ mutex_lock(&obj->mmap_lock);
++
++ area = __find_iovm_area(obj, da);
++ if (!area) {
++ dev_err(obj->dev, "%s: no da area(%08x)\n", __func__, da);
++ goto out;
++ }
++
++ if ((area->flags & flags) != flags) {
++ dev_err(obj->dev, "%s: wrong flags(%08x)\n", __func__,
++ area->flags);
++ goto out;
++ }
++ sgt = (struct sg_table *)area->sgt;
++
++ unmap_iovm_area(obj, area);
++
++ fn(area->va);
++
++ dev_dbg(obj->dev, "%s: %08x-%08x-%08x(%x) %08x\n", __func__,
++ area->da_start, da, area->da_end,
++ area->da_end - area->da_start, area->flags);
++
++ free_iovm_area(obj, area);
++out:
++ mutex_unlock(&obj->mmap_lock);
++
++ return sgt;
++}
++
++static u32 map_iommu_region(struct iommu *obj, u32 da,
++ const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
++{
++ int err = -ENOMEM;
++ struct iovm_struct *new;
++
++ mutex_lock(&obj->mmap_lock);
++
++ new = alloc_iovm_area(obj, da, bytes, flags);
++ if (IS_ERR(new)) {
++ err = PTR_ERR(new);
++ goto err_alloc_iovma;
++ }
++ new->va = va;
++ new->sgt = sgt;
++
++ if (map_iovm_area(obj, new, sgt, new->flags))
++ goto err_map;
++
++ mutex_unlock(&obj->mmap_lock);
++
++ dev_dbg(obj->dev, "%s: da:%08x(%x) flags:%08x va:%p\n",
++ __func__, new->da_start, bytes, new->flags, va);
++
++ return new->da_start;
++
++err_map:
++ free_iovm_area(obj, new);
++err_alloc_iovma:
++ mutex_unlock(&obj->mmap_lock);
++ return err;
++}
++
++static inline u32 __iommu_vmap(struct iommu *obj, u32 da,
++ const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
++{
++ return map_iommu_region(obj, da, sgt, va, bytes, flags);
++}
++
++/**
++ * iommu_vmap - (d)-(p)-(v) address mapper
++ * @obj: objective iommu
++ * @sgt: address of scatter gather table
++ * @flags: iovma and page property
++ *
++ * Creates 1-n-1 mapping with given @sgt and returns @da.
++ * All @sgt element must be io page size aligned.
++ */
++u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
++ u32 flags)
++{
++ size_t bytes;
++ void *va;
++
++ if (!obj || !obj->dev || !sgt)
++ return -EINVAL;
++
++ bytes = sgtable_len(sgt);
++ if (!bytes)
++ return -EINVAL;
++ bytes = PAGE_ALIGN(bytes);
++
++ va = vmap_sg(sgt);
++ if (IS_ERR(va))
++ return PTR_ERR(va);
++
++ flags &= IOVMF_HW_MASK;
++ flags |= IOVMF_DISCONT;
++ flags |= IOVMF_MMIO;
++ flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
++
++ da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
++ if (IS_ERR_VALUE(da))
++ vunmap_sg(va);
++
++ return da;
++}
++EXPORT_SYMBOL_GPL(iommu_vmap);
++
++/**
++ * iommu_vunmap - release virtual mapping obtained by 'iommu_vmap()'
++ * @obj: objective iommu
++ * @da: iommu device virtual address
++ *
++ * Free the iommu virtually contiguous memory area starting at
++ * @da, which was returned by 'iommu_vmap()'.
++ */
++struct sg_table *iommu_vunmap(struct iommu *obj, u32 da)
++{
++ struct sg_table *sgt;
++ /*
++ * 'sgt' is allocated before 'iommu_vmalloc()' is called.
++ * Just returns 'sgt' to the caller to free
++ */
++ sgt = unmap_vm_area(obj, da, vunmap_sg, IOVMF_DISCONT | IOVMF_MMIO);
++ if (!sgt)
++ dev_err(obj->dev, "%s: No sgt\n", __func__);
++ return sgt;
++}
++EXPORT_SYMBOL_GPL(iommu_vunmap);
++
++/**
++ * iommu_vmalloc - (d)-(p)-(v) address allocator and mapper
++ * @obj: objective iommu
++ * @da: contiguous iommu virtual memory
++ * @bytes: allocation size
++ * @flags: iovma and page property
++ *
++ * Allocate @bytes linearly and creates 1-n-1 mapping and returns
++ * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
++ */
++u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
++{
++ void *va;
++ struct sg_table *sgt;
++
++ if (!obj || !obj->dev || !bytes)
++ return -EINVAL;
++
++ bytes = PAGE_ALIGN(bytes);
++
++ va = vmalloc(bytes);
++ if (!va)
++ return -ENOMEM;
++
++ sgt = sgtable_alloc(bytes, flags);
++ if (IS_ERR(sgt)) {
++ da = PTR_ERR(sgt);
++ goto err_sgt_alloc;
++ }
++ sgtable_fill_vmalloc(sgt, va);
++
++ flags &= IOVMF_HW_MASK;
++ flags |= IOVMF_DISCONT;
++ flags |= IOVMF_ALLOC;
++ flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
++
++ da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
++ if (IS_ERR_VALUE(da))
++ goto err_iommu_vmap;
++
++ return da;
++
++err_iommu_vmap:
++ sgtable_drain_vmalloc(sgt);
++ sgtable_free(sgt);
++err_sgt_alloc:
++ vfree(va);
++ return da;
++}
++EXPORT_SYMBOL_GPL(iommu_vmalloc);
++
++/**
++ * iommu_vfree - release memory allocated by 'iommu_vmalloc()'
++ * @obj: objective iommu
++ * @da: iommu device virtual address
++ *
++ * Frees the iommu virtually continuous memory area starting at
++ * @da, as obtained from 'iommu_vmalloc()'.
++ */
++void iommu_vfree(struct iommu *obj, const u32 da)
++{
++ struct sg_table *sgt;
++
++ sgt = unmap_vm_area(obj, da, vfree, IOVMF_DISCONT | IOVMF_ALLOC);
++ if (!sgt)
++ dev_err(obj->dev, "%s: No sgt\n", __func__);
++ sgtable_free(sgt);
++}
++EXPORT_SYMBOL_GPL(iommu_vfree);
++
++static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
++ size_t bytes, u32 flags)
++{
++ struct sg_table *sgt;
++
++ sgt = sgtable_alloc(bytes, flags);
++ if (IS_ERR(sgt))
++ return PTR_ERR(sgt);
++
++ sgtable_fill_kmalloc(sgt, pa, bytes);
++
++ da = map_iommu_region(obj, da, sgt, va, bytes, flags);
++ if (IS_ERR_VALUE(da)) {
++ sgtable_drain_kmalloc(sgt);
++ sgtable_free(sgt);
++ }
++
++ return da;
++}
++
++/**
++ * iommu_kmap - (d)-(p)-(v) address mapper
++ * @obj: objective iommu
++ * @da: contiguous iommu virtual memory
++ * @pa: contiguous physical memory
++ * @flags: iovma and page property
++ *
++ * Creates 1-1-1 mapping and returns @da again, which can be
++ * adjusted if 'IOVMF_DA_ANON' is set.
++ */
++u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
++ u32 flags)
++{
++ void *va;
++
++ if (!obj || !obj->dev || !bytes)
++ return -EINVAL;
++
++ bytes = PAGE_ALIGN(bytes);
++
++ va = ioremap(pa, bytes);
++ if (!va)
++ return -ENOMEM;
++
++ flags &= IOVMF_HW_MASK;
++ flags |= IOVMF_LINEAR;
++ flags |= IOVMF_MMIO;
++ flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
++
++ da = __iommu_kmap(obj, da, pa, va, bytes, flags);
++ if (IS_ERR_VALUE(da))
++ iounmap(va);
++
++ return da;
++}
++EXPORT_SYMBOL_GPL(iommu_kmap);
++
++/**
++ * iommu_kunmap - release virtual mapping obtained by 'iommu_kmap()'
++ * @obj: objective iommu
++ * @da: iommu device virtual address
++ *
++ * Frees the iommu virtually contiguous memory area starting at
++ * @da, which was passed to and was returned by'iommu_kmap()'.
++ */
++void iommu_kunmap(struct iommu *obj, u32 da)
++{
++ struct sg_table *sgt;
++
++ sgt = unmap_vm_area(obj, da, __iounmap, IOVMF_LINEAR | IOVMF_MMIO);
++ if (!sgt)
++ dev_err(obj->dev, "%s: No sgt\n", __func__);
++ sgtable_free(sgt);
++}
++EXPORT_SYMBOL_GPL(iommu_kunmap);
++
++/**
++ * iommu_kmalloc - (d)-(p)-(v) address allocator and mapper
++ * @obj: objective iommu
++ * @da: contiguous iommu virtual memory
++ * @bytes: bytes for allocation
++ * @flags: iovma and page property
++ *
++ * Allocate @bytes linearly and creates 1-1-1 mapping and returns
++ * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
++ */
++u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
++{
++ void *va;
++ u32 pa;
++
++ if (!obj || !obj->dev || !bytes)
++ return -EINVAL;
++
++ bytes = PAGE_ALIGN(bytes);
++
++ va = kmalloc(bytes, GFP_KERNEL | GFP_DMA);
++ if (!va)
++ return -ENOMEM;
++ pa = virt_to_phys(va);
++
++ flags &= IOVMF_HW_MASK;
++ flags |= IOVMF_LINEAR;
++ flags |= IOVMF_ALLOC;
++ flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
++
++ da = __iommu_kmap(obj, da, pa, va, bytes, flags);
++ if (IS_ERR_VALUE(da))
++ kfree(va);
++
++ return da;
++}
++EXPORT_SYMBOL_GPL(iommu_kmalloc);
++
++/**
++ * iommu_kfree - release virtual mapping obtained by 'iommu_kmalloc()'
++ * @obj: objective iommu
++ * @da: iommu device virtual address
++ *
++ * Frees the iommu virtually contiguous memory area starting at
++ * @da, which was passed to and was returned by'iommu_kmalloc()'.
++ */
++void iommu_kfree(struct iommu *obj, u32 da)
++{
++ struct sg_table *sgt;
++
++ sgt = unmap_vm_area(obj, da, kfree, IOVMF_LINEAR | IOVMF_ALLOC);
++ if (!sgt)
++ dev_err(obj->dev, "%s: No sgt\n", __func__);
++ sgtable_free(sgt);
++}
++EXPORT_SYMBOL_GPL(iommu_kfree);
++
++
++static int __init iovmm_init(void)
++{
++ const unsigned long flags = SLAB_HWCACHE_ALIGN;
++ struct kmem_cache *p;
++
++ p = kmem_cache_create("iovm_area_cache", sizeof(struct iovm_struct), 0,
++ flags, NULL);
++ if (!p)
++ return -ENOMEM;
++ iovm_area_cachep = p;
++
++ return 0;
++}
++module_init(iovmm_init);
++
++static void __exit iovmm_exit(void)
++{
++ kmem_cache_destroy(iovm_area_cachep);
++}
++module_exit(iovmm_exit);
++
++MODULE_DESCRIPTION("omap iommu: simple virtual address space management");
++MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
++MODULE_LICENSE("GPL v2");
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0005-omap-iommu-entries-for-Kconfig-and-Makefile.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0005-omap-iommu-entries-for-Kconfig-and-Makefile.patch
new file mode 100644
index 0000000000..c0f9e4d9ac
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0005-omap-iommu-entries-for-Kconfig-and-Makefile.patch
@@ -0,0 +1,45 @@
+From 7de046a6a8446358001c38ad1d0b2b829ca0c98c Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Wed, 28 Jan 2009 21:32:08 +0200
+Subject: [PATCH] omap iommu: entries for Kconfig and Makefile
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/plat-omap/Kconfig | 8 ++++++++
+ arch/arm/plat-omap/Makefile | 1 +
+ 2 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
+index b16ae76..2090bb5 100644
+--- a/arch/arm/plat-omap/Kconfig
++++ b/arch/arm/plat-omap/Kconfig
+@@ -176,6 +176,14 @@ config OMAP_MBOX_FWK
+ Say Y here if you want to use OMAP Mailbox framework support for
+ DSP, IVA1.0 and IVA2 in OMAP1/2/3.
+
++config OMAP_IOMMU
++ tristate "IOMMU support"
++ depends on ARCH_OMAP
++ default n
++ help
++ Say Y here if you want to use OMAP IOMMU support for IVA2 and
++ Camera in OMAP3.
++
+ choice
+ prompt "System timer"
+ default OMAP_MPU_TIMER
+diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
+index 3ebc09e..aa8f6df 100644
+--- a/arch/arm/plat-omap/Makefile
++++ b/arch/arm/plat-omap/Makefile
+@@ -13,6 +13,7 @@ obj- :=
+ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
+
+ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
++obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
+
+ obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
+ obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0006-omap-iommu-Don-t-try-BUG_ON-in_interrupt.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0006-omap-iommu-Don-t-try-BUG_ON-in_interrupt.patch
new file mode 100644
index 0000000000..54a7abfe85
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0006-omap-iommu-Don-t-try-BUG_ON-in_interrupt.patch
@@ -0,0 +1,26 @@
+From b03f695e25bbdaa95a2cc87e15ee8592e7ca128d Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Feb 2009 18:01:29 +0200
+Subject: [PATCH] omap iommu: Don't try BUG_ON(in_interrupt())
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ arch/arm/plat-omap/iovmm.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
+index 6726d10..bdfbb09 100644
+--- a/arch/arm/plat-omap/iovmm.c
++++ b/arch/arm/plat-omap/iovmm.c
+@@ -523,8 +523,6 @@ static struct sg_table *unmap_vm_area(struct iommu *obj, const u32 da,
+ struct sg_table *sgt = NULL;
+ struct iovm_struct *area;
+
+- BUG_ON(in_interrupt());
+-
+ if (!IS_ALIGNED(da, PAGE_SIZE)) {
+ dev_err(obj->dev, "%s: alignment err(%08x)\n", __func__, da);
+ return NULL;
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0007-omap-iommu-We-support-chained-scatterlists-probabl.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0007-omap-iommu-We-support-chained-scatterlists-probabl.patch
new file mode 100644
index 0000000000..d8ad0eb0b7
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0007-omap-iommu-We-support-chained-scatterlists-probabl.patch
@@ -0,0 +1,24 @@
+From 24f984f784cae1a4515fe1be8db1ac24cdf51e84 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Feb 2009 18:37:41 +0200
+Subject: [PATCH] omap iommu: We support chained scatterlists, probably. :)
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ arch/arm/include/asm/scatterlist.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
+index ca0a37d..393f8b8 100644
+--- a/arch/arm/include/asm/scatterlist.h
++++ b/arch/arm/include/asm/scatterlist.h
+@@ -24,4 +24,6 @@ struct scatterlist {
+ #define sg_dma_address(sg) ((sg)->dma_address)
+ #define sg_dma_len(sg) ((sg)->length)
+
++#define ARCH_HAS_SG_CHAIN
++
+ #endif /* _ASMARM_SCATTERLIST_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0008-omap2-iommu-entries-for-Kconfig-and-Makefile.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0008-omap2-iommu-entries-for-Kconfig-and-Makefile.patch
new file mode 100644
index 0000000000..298e797c37
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/iommu/0008-omap2-iommu-entries-for-Kconfig-and-Makefile.patch
@@ -0,0 +1,29 @@
+From 3c65ff4a684d3e0f4d9c59e731975408452c3743 Mon Sep 17 00:00:00 2001
+From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+Date: Wed, 28 Jan 2009 21:32:09 +0200
+Subject: [PATCH] omap2 iommu: entries for Kconfig and Makefile
+
+Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
+---
+ arch/arm/mach-omap2/Makefile | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
+index b44bb78..33b5aa8 100644
+--- a/arch/arm/mach-omap2/Makefile
++++ b/arch/arm/mach-omap2/Makefile
+@@ -38,6 +38,11 @@ obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o
+ obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
+ mailbox_mach-objs := mailbox.o
+
++iommu-y += iommu2.o
++iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
++
++obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y)
++
+ # Specific board support
+ obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
+ obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o board-h4-mmc.o
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0001-omap3isp-Add-ISP-main-driver-and-register-definitio.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0001-omap3isp-Add-ISP-main-driver-and-register-definitio.patch
new file mode 100644
index 0000000000..e6e07d8afc
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0001-omap3isp-Add-ISP-main-driver-and-register-definitio.patch
@@ -0,0 +1,4625 @@
+From 77c99cd863b906c803c3dec08753c19bf9b67882 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add ISP main driver and register definitions
+
+TODO:
+
+- Release resoures in isp_probe() if something fails.
+
+- Implement a sensible generic interface so that the ISP can offer a
+ v4l2_subdev (like the v4l2-int-device slaves) interface towards the
+ camera driver.
+
+- Handle CSI1 and CSI2 error cases (currently unhandled?).
+
+- Fix H3A / HIST interrupt enabling / disabling.
+
+- Clean up the private ioctls.
+
+- Handle SBL overflows somehow.
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/Makefile | 2 +
+ drivers/media/video/isp/Makefile | 12 +
+ drivers/media/video/isp/isp.c | 2547 ++++++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/isp.h | 318 +++++
+ drivers/media/video/isp/ispreg.h | 1674 +++++++++++++++++++++++++
+ 5 files changed, 4553 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/Makefile
+ create mode 100644 drivers/media/video/isp/isp.c
+ create mode 100644 drivers/media/video/isp/isp.h
+ create mode 100644 drivers/media/video/isp/ispreg.h
+
+diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
+index 72f6d03..e654270 100644
+--- a/drivers/media/video/Makefile
++++ b/drivers/media/video/Makefile
+@@ -106,6 +106,8 @@ obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o
+ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
+ obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
+
++obj-y += isp/
++
+ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+
+ obj-$(CONFIG_USB_DABUSB) += dabusb.o
+diff --git a/drivers/media/video/isp/Makefile b/drivers/media/video/isp/Makefile
+new file mode 100644
+index 0000000..f14d617
+--- /dev/null
++++ b/drivers/media/video/isp/Makefile
+@@ -0,0 +1,12 @@
++# Makefile for OMAP3 ISP driver
++
++ifdef CONFIG_ARCH_OMAP3410
++isp-mod-objs += \
++ isp.o ispccdc.o
++else
++isp-mod-objs += \
++ isp.o ispccdc.o ispmmu.o \
++ isppreview.o ispresizer.o isph3a.o isphist.o isp_af.o ispcsi2.o
++endif
++
++obj-$(CONFIG_VIDEO_OMAP3) += isp-mod.o
+diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c
+new file mode 100644
+index 0000000..54c839b
+--- /dev/null
++++ b/drivers/media/video/isp/isp.c
+@@ -0,0 +1,2547 @@
++/*
++ * isp.c
++ *
++ * Driver Library for ISP Control module in TI's OMAP3 Camera ISP
++ * ISP interface and IRQ related APIs are defined here.
++ *
++ * Copyright (C) 2009 Texas Instruments.
++ * Copyright (C) 2009 Nokia.
++ *
++ * Contributors:
++ * Sameer Venkatraman <sameerv@ti.com>
++ * Mohit Jalori <mjalori@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ * Toni Leinonen <toni.leinonen@nokia.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <asm/cacheflush.h>
++
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/clk.h>
++#include <linux/dma-mapping.h>
++#include <linux/vmalloc.h>
++#include <linux/platform_device.h>
++
++#include "isp.h"
++#include "ispmmu.h"
++#include "ispreg.h"
++#include "ispccdc.h"
++#include "isph3a.h"
++#include "isphist.h"
++#include "isp_af.h"
++#include "isppreview.h"
++#include "ispresizer.h"
++#include "ispcsi2.h"
++
++static struct isp_device *omap3isp;
++
++static int isp_try_size(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output);
++
++static void isp_save_ctx(void);
++
++static void isp_restore_ctx(void);
++
++static void isp_buf_init(void);
++
++/* List of image formats supported via OMAP ISP */
++const static struct v4l2_fmtdesc isp_formats[] = {
++ {
++ .description = "UYVY, packed",
++ .pixelformat = V4L2_PIX_FMT_UYVY,
++ },
++ {
++ .description = "YUYV (YUV 4:2:2), packed",
++ .pixelformat = V4L2_PIX_FMT_YUYV,
++ },
++ {
++ .description = "Bayer10 (GrR/BGb)",
++ .pixelformat = V4L2_PIX_FMT_SGRBG10,
++ },
++};
++
++/* ISP Crop capabilities */
++static struct v4l2_rect ispcroprect;
++static struct v4l2_rect cur_rect;
++
++/**
++ * struct vcontrol - Video control structure.
++ * @qc: V4L2 Query control structure.
++ * @current_value: Current value of the control.
++ */
++static struct vcontrol {
++ struct v4l2_queryctrl qc;
++ int current_value;
++} video_control[] = {
++ {
++ {
++ .id = V4L2_CID_BRIGHTNESS,
++ .type = V4L2_CTRL_TYPE_INTEGER,
++ .name = "Brightness",
++ .minimum = ISPPRV_BRIGHT_LOW,
++ .maximum = ISPPRV_BRIGHT_HIGH,
++ .step = ISPPRV_BRIGHT_STEP,
++ .default_value = ISPPRV_BRIGHT_DEF,
++ },
++ .current_value = ISPPRV_BRIGHT_DEF,
++ },
++ {
++ {
++ .id = V4L2_CID_CONTRAST,
++ .type = V4L2_CTRL_TYPE_INTEGER,
++ .name = "Contrast",
++ .minimum = ISPPRV_CONTRAST_LOW,
++ .maximum = ISPPRV_CONTRAST_HIGH,
++ .step = ISPPRV_CONTRAST_STEP,
++ .default_value = ISPPRV_CONTRAST_DEF,
++ },
++ .current_value = ISPPRV_CONTRAST_DEF,
++ },
++ {
++ {
++ .id = V4L2_CID_COLORFX,
++ .type = V4L2_CTRL_TYPE_MENU,
++ .name = "Color Effects",
++ .minimum = V4L2_COLORFX_NONE,
++ .maximum = V4L2_COLORFX_SEPIA,
++ .step = 1,
++ .default_value = V4L2_COLORFX_NONE,
++ },
++ .current_value = V4L2_COLORFX_NONE,
++ }
++};
++
++static struct v4l2_querymenu video_menu[] = {
++ {
++ .id = V4L2_CID_COLORFX,
++ .index = 0,
++ .name = "None",
++ },
++ {
++ .id = V4L2_CID_COLORFX,
++ .index = 1,
++ .name = "B&W",
++ },
++ {
++ .id = V4L2_CID_COLORFX,
++ .index = 2,
++ .name = "Sepia",
++ },
++};
++
++struct isp_buf {
++ dma_addr_t isp_addr;
++ void (*complete)(struct videobuf_buffer *vb, void *priv);
++ struct videobuf_buffer *vb;
++ void *priv;
++ u32 vb_state;
++};
++
++#define ISP_BUFS_IS_FULL(bufs) \
++ (((bufs)->queue + 1) % NUM_BUFS == (bufs)->done)
++#define ISP_BUFS_IS_EMPTY(bufs) ((bufs)->queue == (bufs)->done)
++#define ISP_BUFS_IS_LAST(bufs) \
++ ((bufs)->queue == ((bufs)->done + 1) % NUM_BUFS)
++#define ISP_BUFS_QUEUED(bufs) \
++ ((((bufs)->done - (bufs)->queue + NUM_BUFS)) % NUM_BUFS)
++#define ISP_BUF_DONE(bufs) ((bufs)->buf + (bufs)->done)
++#define ISP_BUF_NEXT_DONE(bufs) \
++ ((bufs)->buf + ((bufs)->done + 1) % NUM_BUFS)
++#define ISP_BUF_QUEUE(bufs) ((bufs)->buf + (bufs)->queue)
++#define ISP_BUF_MARK_DONE(bufs) \
++ (bufs)->done = ((bufs)->done + 1) % NUM_BUFS;
++#define ISP_BUF_MARK_QUEUED(bufs) \
++ (bufs)->queue = ((bufs)->queue + 1) % NUM_BUFS;
++
++struct isp_bufs {
++ dma_addr_t isp_addr_capture[VIDEO_MAX_FRAME];
++ spinlock_t lock; /* For handling current buffer */
++ /* queue full: (ispsg.queue + 1) % NUM_BUFS == ispsg.done
++ queue empty: ispsg.queue == ispsg.done */
++ struct isp_buf buf[NUM_BUFS];
++ /* Next slot to queue a buffer. */
++ int queue;
++ /* Buffer that is being processed. */
++ int done;
++ /* Wait for this many hs_vs before anything else. */
++ int wait_hs_vs;
++};
++
++/**
++ * struct ispirq - Structure for containing callbacks to be called in ISP ISR.
++ * @isp_callbk: Array which stores callback functions, indexed by the type of
++ * callback (8 possible types).
++ * @isp_callbk_arg1: Pointer to array containing pointers to the first argument
++ * to be passed to the requested callback function.
++ * @isp_callbk_arg2: Pointer to array containing pointers to the second
++ * argument to be passed to the requested callback function.
++ *
++ * This structure is used to contain all the callback functions related for
++ * each callback type (CBK_CCDC_VD0, CBK_CCDC_VD1, CBK_PREV_DONE,
++ * CBK_RESZ_DONE, CBK_MMU_ERR, CBK_H3A_AWB_DONE, CBK_HIST_DONE, CBK_HS_VS,
++ * CBK_LSC_ISR).
++ */
++struct isp_irq {
++ isp_callback_t isp_callbk[CBK_END];
++ isp_vbq_callback_ptr isp_callbk_arg1[CBK_END];
++ void *isp_callbk_arg2[CBK_END];
++};
++
++/**
++ * struct ispmodule - Structure for storing ISP sub-module information.
++ * @isp_pipeline: Bit mask for submodules enabled within the ISP.
++ * @applyCrop: Flag to do a crop operation when video buffer queue ISR is done
++ * @pix: Structure containing the format and layout of the output image.
++ * @ccdc_input_width: ISP CCDC module input image width.
++ * @ccdc_input_height: ISP CCDC module input image height.
++ * @ccdc_output_width: ISP CCDC module output image width.
++ * @ccdc_output_height: ISP CCDC module output image height.
++ * @preview_input_width: ISP Preview module input image width.
++ * @preview_input_height: ISP Preview module input image height.
++ * @preview_output_width: ISP Preview module output image width.
++ * @preview_output_height: ISP Preview module output image height.
++ * @resizer_input_width: ISP Resizer module input image width.
++ * @resizer_input_height: ISP Resizer module input image height.
++ * @resizer_output_width: ISP Resizer module output image width.
++ * @resizer_output_height: ISP Resizer module output image height.
++ */
++struct isp_module {
++ unsigned int isp_pipeline;
++ int applyCrop;
++ struct v4l2_pix_format pix;
++ unsigned int ccdc_input_width;
++ unsigned int ccdc_input_height;
++ unsigned int ccdc_output_width;
++ unsigned int ccdc_output_height;
++ unsigned int preview_input_width;
++ unsigned int preview_input_height;
++ unsigned int preview_output_width;
++ unsigned int preview_output_height;
++ unsigned int resizer_input_width;
++ unsigned int resizer_input_height;
++ unsigned int resizer_output_width;
++ unsigned int resizer_output_height;
++};
++
++#define RAW_CAPTURE(isp) \
++ (!((isp)->module.isp_pipeline & OMAP_ISP_PREVIEW))
++
++/**
++ * struct isp - Structure for storing ISP Control module information
++ * @lock: Spinlock to sync between isr and processes.
++ * @isp_mutex: Semaphore used to get access to the ISP.
++ * @ref_count: Reference counter.
++ * @cam_ick: Pointer to ISP Interface clock.
++ * @cam_fck: Pointer to ISP Functional clock.
++ *
++ * This structure is used to store the OMAP ISP Control Information.
++ */
++static struct isp {
++ spinlock_t lock; /* For handling registered ISP callbacks */
++ struct mutex isp_mutex; /* For handling ref_count field */
++ int ref_count;
++ struct clk *cam_ick;
++ struct clk *cam_mclk;
++ struct clk *csi2_fck;
++ struct isp_interface_config *config;
++ dma_addr_t tmp_buf;
++ size_t tmp_buf_size;
++ unsigned long tmp_buf_offset;
++ struct isp_bufs bufs;
++ struct isp_irq irq;
++ struct isp_module module;
++} isp_obj;
++
++/* Structure for saving/restoring ISP module registers */
++static struct isp_reg isp_reg_list[] = {
++ {OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_GRESET_LENGTH, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_PSTRB_REPLAY, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_FRAME, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_PSTRB_DELAY, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_STRB_DELAY, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_SHUT_DELAY, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_PSTRB_LENGTH, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_STRB_LENGTH, 0},
++ {OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_SHUT_LENGTH, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF_SYSCONFIG, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF_IRQENABLE, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF0_CTRL, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF1_CTRL, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF0_START, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF1_START, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF0_END, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF1_END, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF0_WINDOWSIZE, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF1_WINDOWSIZE, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF0_THRESHOLD, 0},
++ {OMAP3_ISP_IOMEM_CBUFF, ISP_CBUFF1_THRESHOLD, 0},
++ {0, ISP_TOK_TERM, 0}
++};
++
++u32 isp_reg_readl(enum isp_mem_resources isp_mmio_range, u32 reg_offset)
++{
++ return __raw_readl(omap3isp->mmio_base[isp_mmio_range] + reg_offset);
++}
++EXPORT_SYMBOL(isp_reg_readl);
++
++void isp_reg_writel(u32 reg_value, enum isp_mem_resources isp_mmio_range,
++ u32 reg_offset)
++{
++ __raw_writel(reg_value,
++ omap3isp->mmio_base[isp_mmio_range] + reg_offset);
++}
++EXPORT_SYMBOL(isp_reg_writel);
++
++/*
++ *
++ * V4L2 Handling
++ *
++ */
++
++/**
++ * find_vctrl - Returns the index of the ctrl array of the requested ctrl ID.
++ * @id: Requested control ID.
++ *
++ * Returns 0 if successful, -EINVAL if not found, or -EDOM if its out of
++ * domain.
++ **/
++static int find_vctrl(int id)
++{
++ int i;
++
++ if (id < V4L2_CID_BASE)
++ return -EDOM;
++
++ for (i = (ARRAY_SIZE(video_control) - 1); i >= 0; i--)
++ if (video_control[i].qc.id == id)
++ break;
++
++ if (i < 0)
++ i = -EINVAL;
++
++ return i;
++}
++
++static int find_next_vctrl(int id)
++{
++ int i;
++ u32 best = (u32)-1;
++
++ for (i = 0; i < ARRAY_SIZE(video_control); i++) {
++ if (video_control[i].qc.id > id &&
++ (best == (u32)-1 ||
++ video_control[i].qc.id <
++ video_control[best].qc.id)) {
++ best = i;
++ }
++ }
++
++ if (best == (u32)-1)
++ return -EINVAL;
++
++ return best;
++}
++
++/**
++ * find_vmenu - Returns index of the menu array of the requested ctrl option.
++ * @id: Requested control ID.
++ * @index: Requested menu option index.
++ *
++ * Returns 0 if successful, -EINVAL if not found, or -EDOM if its out of
++ * domain.
++ **/
++static int find_vmenu(int id, int index)
++{
++ int i;
++
++ if (id < V4L2_CID_BASE)
++ return -EDOM;
++
++ for (i = (ARRAY_SIZE(video_menu) - 1); i >= 0; i--) {
++ if (video_menu[i].id != id || video_menu[i].index != index)
++ continue;
++ return i;
++ }
++
++ return -EINVAL;
++}
++
++/**
++ * isp_release_resources - Free ISP submodules
++ **/
++static void isp_release_resources(void)
++{
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_CCDC)
++ ispccdc_free();
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_PREVIEW)
++ isppreview_free();
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_RESIZER)
++ ispresizer_free();
++ return;
++}
++
++static int isp_wait(int (*busy)(void), int wait_for_busy, int max_wait)
++{
++ int wait = 0;
++
++ if (max_wait == 0)
++ max_wait = 10000; /* 10 ms */
++
++ while ((wait_for_busy && !busy())
++ || (!wait_for_busy && busy())) {
++ rmb();
++ udelay(1);
++ wait++;
++ if (wait > max_wait) {
++ printk(KERN_ALERT "%s: wait is too much\n", __func__);
++ return -EBUSY;
++ }
++ }
++ DPRINTK_ISPCTRL(KERN_ALERT "%s: wait %d\n", __func__, wait);
++
++ return 0;
++}
++
++static int ispccdc_sbl_wait_idle(int max_wait)
++{
++ return isp_wait(ispccdc_sbl_busy, 0, max_wait);
++}
++
++static void isp_enable_interrupts(int is_raw)
++{
++ isp_reg_writel(-1, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_CCDC_LSC_PREF_ERR_IRQ |
++ IRQ0ENABLE_HS_VS_IRQ |
++ IRQ0ENABLE_CCDC_VD0_IRQ |
++ IRQ0ENABLE_CCDC_VD1_IRQ);
++
++ if (is_raw)
++ return;
++
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_PRV_DONE_IRQ |
++ IRQ0ENABLE_RSZ_DONE_IRQ);
++
++ return;
++}
++
++static void isp_disable_interrupts(void)
++{
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~(IRQ0ENABLE_CCDC_LSC_PREF_ERR_IRQ |
++ IRQ0ENABLE_HS_VS_IRQ |
++ IRQ0ENABLE_CCDC_VD0_IRQ |
++ IRQ0ENABLE_CCDC_VD1_IRQ |
++ IRQ0ENABLE_PRV_DONE_IRQ |
++ IRQ0ENABLE_RSZ_DONE_IRQ));
++}
++
++/**
++ * isp_set_callback - Sets the callback for the ISP module done events.
++ * @type: Type of the event for which callback is requested.
++ * @callback: Method to be called as callback in the ISR context.
++ * @arg1: First argument to be passed when callback is called in ISR.
++ * @arg2: Second argument to be passed when callback is called in ISR.
++ *
++ * This function sets a callback function for a done event in the ISP
++ * module, and enables the corresponding interrupt.
++ **/
++int isp_set_callback(enum isp_callback_type type, isp_callback_t callback,
++ isp_vbq_callback_ptr arg1,
++ void *arg2)
++{
++ unsigned long irqflags = 0;
++
++ if (callback == NULL) {
++ DPRINTK_ISPCTRL("ISP_ERR : Null Callback\n");
++ return -EINVAL;
++ }
++
++ spin_lock_irqsave(&isp_obj.lock, irqflags);
++ isp_obj.irq.isp_callbk[type] = callback;
++ isp_obj.irq.isp_callbk_arg1[type] = arg1;
++ isp_obj.irq.isp_callbk_arg2[type] = arg2;
++ spin_unlock_irqrestore(&isp_obj.lock, irqflags);
++
++ switch (type) {
++ case CBK_H3A_AWB_DONE:
++ isp_reg_writel(IRQ0ENABLE_H3A_AWB_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_H3A_AWB_DONE_IRQ);
++ break;
++ case CBK_H3A_AF_DONE:
++ isp_reg_writel(IRQ0ENABLE_H3A_AF_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_H3A_AF_DONE_IRQ);
++ break;
++ case CBK_HIST_DONE:
++ isp_reg_writel(IRQ0ENABLE_HIST_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_HIST_DONE_IRQ);
++ break;
++ case CBK_PREV_DONE:
++ isp_reg_writel(IRQ0ENABLE_PRV_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_PRV_DONE_IRQ);
++ break;
++ default:
++ break;
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_set_callback);
++
++/**
++ * isp_unset_callback - Clears the callback for the ISP module done events.
++ * @type: Type of the event for which callback to be cleared.
++ *
++ * This function clears a callback function for a done event in the ISP
++ * module, and disables the corresponding interrupt.
++ **/
++int isp_unset_callback(enum isp_callback_type type)
++{
++ unsigned long irqflags = 0;
++
++ spin_lock_irqsave(&isp_obj.lock, irqflags);
++ isp_obj.irq.isp_callbk[type] = NULL;
++ isp_obj.irq.isp_callbk_arg1[type] = NULL;
++ isp_obj.irq.isp_callbk_arg2[type] = NULL;
++ spin_unlock_irqrestore(&isp_obj.lock, irqflags);
++
++ switch (type) {
++ case CBK_H3A_AWB_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_H3A_AWB_DONE_IRQ);
++ break;
++ case CBK_H3A_AF_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_H3A_AF_DONE_IRQ);
++ break;
++ case CBK_HIST_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_HIST_DONE_IRQ);
++ break;
++ case CBK_CSIA:
++ isp_csi2_irq_set(0);
++ break;
++ case CBK_CSIB:
++ isp_reg_writel(IRQ0ENABLE_CSIB_IRQ, OMAP3_ISP_IOMEM_MAIN,
++ ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_CSIB_IRQ);
++ break;
++ case CBK_PREV_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_PRV_DONE_IRQ);
++ break;
++ default:
++ break;
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_unset_callback);
++
++/**
++ * isp_set_xclk - Configures the specified cam_xclk to the desired frequency.
++ * @xclk: Desired frequency of the clock in Hz.
++ * @xclksel: XCLK to configure (0 = A, 1 = B).
++ *
++ * Configures the specified MCLK divisor in the ISP timing control register
++ * (TCTRL_CTRL) to generate the desired xclk clock value.
++ *
++ * Divisor = CM_CAM_MCLK_HZ / xclk
++ *
++ * Returns the final frequency that is actually being generated
++ **/
++u32 isp_set_xclk(u32 xclk, u8 xclksel)
++{
++ u32 divisor;
++ u32 currentxclk;
++
++ if (xclk >= CM_CAM_MCLK_HZ) {
++ divisor = ISPTCTRL_CTRL_DIV_BYPASS;
++ currentxclk = CM_CAM_MCLK_HZ;
++ } else if (xclk >= 2) {
++ divisor = CM_CAM_MCLK_HZ / xclk;
++ if (divisor >= ISPTCTRL_CTRL_DIV_BYPASS)
++ divisor = ISPTCTRL_CTRL_DIV_BYPASS - 1;
++ currentxclk = CM_CAM_MCLK_HZ / divisor;
++ } else {
++ divisor = xclk;
++ currentxclk = 0;
++ }
++
++ switch (xclksel) {
++ case 0:
++ isp_reg_and_or(OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
++ ~ISPTCTRL_CTRL_DIVA_MASK,
++ divisor << ISPTCTRL_CTRL_DIVA_SHIFT);
++ DPRINTK_ISPCTRL("isp_set_xclk(): cam_xclka set to %d Hz\n",
++ currentxclk);
++ break;
++ case 1:
++ isp_reg_and_or(OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
++ ~ISPTCTRL_CTRL_DIVB_MASK,
++ divisor << ISPTCTRL_CTRL_DIVB_SHIFT);
++ DPRINTK_ISPCTRL("isp_set_xclk(): cam_xclkb set to %d Hz\n",
++ currentxclk);
++ break;
++ default:
++ DPRINTK_ISPCTRL("ISP_ERR: isp_set_xclk(): Invalid requested "
++ "xclk. Must be 0 (A) or 1 (B)."
++ "\n");
++ return -EINVAL;
++ }
++
++ return currentxclk;
++}
++EXPORT_SYMBOL(isp_set_xclk);
++
++/**
++ * isp_power_settings - Sysconfig settings, for Power Management.
++ * @isp_sysconfig: Structure containing the power settings for ISP to configure
++ *
++ * Sets the power settings for the ISP, and SBL bus.
++ **/
++static void isp_power_settings(int idle)
++{
++ if (idle) {
++ isp_reg_writel(ISP_SYSCONFIG_AUTOIDLE |
++ (ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY <<
++ ISP_SYSCONFIG_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_MAIN,
++ ISP_SYSCONFIG);
++ if (omap_rev() == OMAP3430_REV_ES1_0) {
++ isp_reg_writel(ISPCSI1_AUTOIDLE |
++ (ISPCSI1_MIDLEMODE_SMARTSTANDBY <<
++ ISPCSI1_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_CSI2A,
++ ISP_CSIA_SYSCONFIG);
++ isp_reg_writel(ISPCSI1_AUTOIDLE |
++ (ISPCSI1_MIDLEMODE_SMARTSTANDBY <<
++ ISPCSI1_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_CCP2,
++ ISP_CSIB_SYSCONFIG);
++ }
++ isp_reg_writel(ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN,
++ ISP_CTRL);
++
++ } else {
++ isp_reg_writel(ISP_SYSCONFIG_AUTOIDLE |
++ (ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY <<
++ ISP_SYSCONFIG_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_MAIN,
++ ISP_SYSCONFIG);
++ if (omap_rev() == OMAP3430_REV_ES1_0) {
++ isp_reg_writel(ISPCSI1_AUTOIDLE |
++ (ISPCSI1_MIDLEMODE_FORCESTANDBY <<
++ ISPCSI1_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_CSI2A,
++ ISP_CSIA_SYSCONFIG);
++
++ isp_reg_writel(ISPCSI1_AUTOIDLE |
++ (ISPCSI1_MIDLEMODE_FORCESTANDBY <<
++ ISPCSI1_MIDLEMODE_SHIFT),
++ OMAP3_ISP_IOMEM_CCP2,
++ ISP_CSIB_SYSCONFIG);
++ }
++
++ isp_reg_writel(ISPCTRL_SBL_AUTOIDLE, OMAP3_ISP_IOMEM_MAIN,
++ ISP_CTRL);
++ }
++}
++
++#define BIT_SET(var, shift, mask, val) \
++ do { \
++ var = (var & ~(mask << shift)) \
++ | (val << shift); \
++ } while (0)
++
++static int isp_init_csi(struct isp_interface_config *config)
++{
++ u32 i = 0, val, reg;
++ int format;
++
++ switch (config->u.csi.format) {
++ case V4L2_PIX_FMT_SGRBG10:
++ format = 0x16; /* RAW10+VP */
++ break;
++ case V4L2_PIX_FMT_SGRBG10DPCM8:
++ format = 0x12; /* RAW8+DPCM10+VP */
++ break;
++ default:
++ printk(KERN_ERR "isp_init_csi: bad csi format\n");
++ return -EINVAL;
++ }
++
++ /* Reset the CSI and wait for reset to complete */
++ isp_reg_writel(isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_SYSCONFIG) |
++ BIT(1),
++ OMAP3_ISP_IOMEM_CCP2,
++ ISPCSI1_SYSCONFIG);
++ while (!(isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_SYSSTATUS) &
++ BIT(0))) {
++ udelay(10);
++ if (i++ > 10)
++ break;
++ }
++ if (!(isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_SYSSTATUS) &
++ BIT(0))) {
++ printk(KERN_WARNING
++ "omap3_isp: timeout waiting for csi reset\n");
++ }
++
++ /* ISPCSI1_CTRL */
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_CTRL);
++ val &= ~BIT(11); /* Enable VP only off ->
++ extract embedded data to interconnect */
++ BIT_SET(val, 8, 0x3, config->u.csi.vpclk); /* Video port clock */
++/* val |= BIT(3); */ /* Wait for FEC before disabling interface */
++ val |= BIT(2); /* I/O cell output is parallel
++ (no effect, but errata says should be enabled
++ for class 1/2) */
++ val |= BIT(12); /* VP clock polarity to falling edge
++ (needed or bad picture!) */
++
++ /* Data/strobe physical layer */
++ BIT_SET(val, 1, 1, config->u.csi.signalling);
++ BIT_SET(val, 10, 1, config->u.csi.strobe_clock_inv);
++ val |= BIT(4); /* Magic bit to enable CSI1 and strobe mode */
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_CCP2, ISPCSI1_CTRL);
++
++ /* ISPCSI1_LCx_CTRL logical channel #0 */
++ reg = ISPCSI1_LCx_CTRL(0); /* reg = ISPCSI1_CTRL1; */
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, reg);
++ /* Format = RAW10+VP or RAW8+DPCM10+VP*/
++ BIT_SET(val, 3, 0x1f, format);
++ /* Enable setting of frame regions of interest */
++ BIT_SET(val, 1, 1, 1);
++ BIT_SET(val, 2, 1, config->u.csi.crc);
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_CCP2, reg);
++
++ /* ISPCSI1_DAT_START for logical channel #0 */
++ reg = ISPCSI1_LCx_DAT_START(0); /* reg = ISPCSI1_DAT_START; */
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, reg);
++ BIT_SET(val, 16, 0xfff, config->u.csi.data_start);
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_CCP2, reg);
++
++ /* ISPCSI1_DAT_SIZE for logical channel #0 */
++ reg = ISPCSI1_LCx_DAT_SIZE(0); /* reg = ISPCSI1_DAT_SIZE; */
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, reg);
++ BIT_SET(val, 16, 0xfff, config->u.csi.data_size);
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_CCP2, reg);
++
++ /* Clear status bits for logical channel #0 */
++ isp_reg_writel(0xFFF & ~BIT(6), OMAP3_ISP_IOMEM_CCP2,
++ ISPCSI1_LC01_IRQSTATUS);
++
++ /* Enable CSI1 */
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_CTRL);
++ val |= BIT(0) | BIT(4);
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_CCP2, ISPCSI1_CTRL);
++
++ if (!(isp_reg_readl(OMAP3_ISP_IOMEM_CCP2, ISPCSI1_CTRL) & BIT(4))) {
++ printk(KERN_WARNING "OMAP3 CSI1 bus not available\n");
++ if (config->u.csi.signalling) /* Strobe mode requires CSI1 */
++ return -EIO;
++ }
++
++ return 0;
++}
++
++/**
++ * isp_configure_interface - Configures ISP Control I/F related parameters.
++ * @config: Pointer to structure containing the desired configuration for the
++ * ISP.
++ *
++ * Configures ISP control register (ISP_CTRL) with the values specified inside
++ * the config structure. Controls:
++ * - Selection of parallel or serial input to the preview hardware.
++ * - Data lane shifter.
++ * - Pixel clock polarity.
++ * - 8 to 16-bit bridge at the input of CCDC module.
++ * - HS or VS synchronization signal detection
++ **/
++int isp_configure_interface(struct isp_interface_config *config)
++{
++ u32 ispctrl_val = isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL);
++ int r;
++
++ isp_obj.config = config;
++
++ ispctrl_val &= ISPCTRL_SHIFT_MASK;
++ ispctrl_val |= config->dataline_shift << ISPCTRL_SHIFT_SHIFT;
++ ispctrl_val &= ~ISPCTRL_PAR_CLK_POL_INV;
++
++ ispctrl_val &= ISPCTRL_PAR_SER_CLK_SEL_MASK;
++
++ isp_buf_init();
++
++ switch (config->ccdc_par_ser) {
++ case ISP_PARLL:
++ ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL;
++ ispctrl_val |= config->u.par.par_clk_pol
++ << ISPCTRL_PAR_CLK_POL_SHIFT;
++ ispctrl_val &= ~ISPCTRL_PAR_BRIDGE_BENDIAN;
++ ispctrl_val |= config->u.par.par_bridge
++ << ISPCTRL_PAR_BRIDGE_SHIFT;
++ break;
++ case ISP_CSIA:
++ ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_CSIA;
++ ispctrl_val &= ~ISPCTRL_PAR_BRIDGE_BENDIAN;
++
++ isp_csi2_ctx_config_format(0, config->u.csi.format);
++ isp_csi2_ctx_update(0, false);
++
++ if (config->u.csi.crc)
++ isp_csi2_ctrl_config_ecc_enable(true);
++
++ isp_csi2_ctrl_config_vp_out_ctrl(config->u.csi.vpclk);
++ isp_csi2_ctrl_config_vp_only_enable(true);
++ isp_csi2_ctrl_config_vp_clk_enable(true);
++ isp_csi2_ctrl_update(false);
++
++ isp_csi2_irq_complexio1_set(1);
++ isp_csi2_irq_status_set(1);
++ isp_csi2_irq_set(1);
++
++ isp_csi2_enable(1);
++ mdelay(3);
++ break;
++ case ISP_CSIB:
++ ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_CSIB;
++ r = isp_init_csi(config);
++ if (r)
++ return r;
++ break;
++ case ISP_NONE:
++ return 0;
++ default:
++ return -EINVAL;
++ }
++
++ ispctrl_val &= ~ISPCTRL_SYNC_DETECT_VSRISE;
++ ispctrl_val |= config->hsvs_syncdetect;
++
++ isp_reg_writel(ispctrl_val, OMAP3_ISP_IOMEM_MAIN, ISP_CTRL);
++
++ /* Set sensor specific fields in CCDC and Previewer module.*/
++ isppreview_set_skip(config->prev_sph, config->prev_slv);
++ ispccdc_set_wenlog(config->wenlog);
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_configure_interface);
++
++static int isp_buf_process(struct isp_bufs *bufs);
++
++/**
++ * omap34xx_isp_isr - Interrupt Service Routine for Camera ISP module.
++ * @irq: Not used currently.
++ * @ispirq_disp: Pointer to the object that is passed while request_irq is
++ * called. This is the isp_obj.irq object containing info on the
++ * callback.
++ *
++ * Handles the corresponding callback if plugged in.
++ *
++ * Returns IRQ_HANDLED when IRQ was correctly handled, or IRQ_NONE when the
++ * IRQ wasn't handled.
++ **/
++static irqreturn_t omap34xx_isp_isr(int irq, void *_isp)
++{
++ struct isp *isp = _isp;
++ struct isp_irq *irqdis = &isp->irq;
++ struct isp_bufs *bufs = &isp->bufs;
++ unsigned long flags;
++ u32 irqstatus = 0;
++ unsigned long irqflags = 0;
++ int wait_hs_vs = 0;
++
++ irqstatus = isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_writel(irqstatus, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++
++ spin_lock_irqsave(&bufs->lock, flags);
++ wait_hs_vs = bufs->wait_hs_vs;
++ if (irqstatus & HS_VS && bufs->wait_hs_vs)
++ bufs->wait_hs_vs--;
++ spin_unlock_irqrestore(&bufs->lock, flags);
++
++ spin_lock_irqsave(&isp_obj.lock, irqflags);
++ /*
++ * We need to wait for the first HS_VS interrupt from CCDC.
++ * Otherwise our frame (and everything else) might be bad.
++ */
++ if (wait_hs_vs)
++ goto out_ignore_buff;
++
++ if (irqstatus & CCDC_VD0) {
++ if (RAW_CAPTURE(&isp_obj))
++ isp_buf_process(bufs);
++ if (!ispccdc_busy())
++ ispccdc_config_shadow_registers();
++ }
++
++ if (irqstatus & PREV_DONE) {
++ if (irqdis->isp_callbk[CBK_PREV_DONE])
++ irqdis->isp_callbk[CBK_PREV_DONE](
++ PREV_DONE,
++ irqdis->isp_callbk_arg1[CBK_PREV_DONE],
++ irqdis->isp_callbk_arg2[CBK_PREV_DONE]);
++ else if (!RAW_CAPTURE(&isp_obj) && !ispresizer_busy()) {
++ if (isp_obj.module.applyCrop) {
++ ispresizer_applycrop();
++ if (!ispresizer_busy())
++ isp_obj.module.applyCrop = 0;
++ }
++ if (!isppreview_busy()) {
++ ispresizer_enable(1);
++ if (isppreview_busy()) {
++ /* FIXME: locking! */
++ ISP_BUF_DONE(bufs)->vb_state =
++ VIDEOBUF_ERROR;
++ printk(KERN_ERR "%s: can't stop"
++ " preview\n", __func__);
++ }
++ }
++ if (!isppreview_busy())
++ isppreview_config_shadow_registers();
++ if (!isppreview_busy())
++ isph3a_update_wb();
++ }
++ }
++
++ if (irqstatus & RESZ_DONE) {
++ if (!RAW_CAPTURE(&isp_obj)) {
++ if (!ispresizer_busy())
++ ispresizer_config_shadow_registers();
++ isp_buf_process(bufs);
++ }
++ }
++
++ if (irqstatus & H3A_AWB_DONE) {
++ if (irqdis->isp_callbk[CBK_H3A_AWB_DONE])
++ irqdis->isp_callbk[CBK_H3A_AWB_DONE](
++ H3A_AWB_DONE,
++ irqdis->isp_callbk_arg1[CBK_H3A_AWB_DONE],
++ irqdis->isp_callbk_arg2[CBK_H3A_AWB_DONE]);
++ }
++
++ if (irqstatus & HIST_DONE) {
++ if (irqdis->isp_callbk[CBK_HIST_DONE])
++ irqdis->isp_callbk[CBK_HIST_DONE](
++ HIST_DONE,
++ irqdis->isp_callbk_arg1[CBK_HIST_DONE],
++ irqdis->isp_callbk_arg2[CBK_HIST_DONE]);
++ }
++
++ if (irqstatus & H3A_AF_DONE) {
++ if (irqdis->isp_callbk[CBK_H3A_AF_DONE])
++ irqdis->isp_callbk[CBK_H3A_AF_DONE](
++ H3A_AF_DONE,
++ irqdis->isp_callbk_arg1[CBK_H3A_AF_DONE],
++ irqdis->isp_callbk_arg2[CBK_H3A_AF_DONE]);
++ }
++
++
++out_ignore_buff:
++ if (irqstatus & LSC_PRE_ERR) {
++ struct isp_buf *buf = ISP_BUF_DONE(bufs);
++ /* Mark buffer faulty. */
++ buf->vb_state = VIDEOBUF_ERROR;
++ ispccdc_lsc_error_handler();
++ printk(KERN_ERR "%s: lsc prefetch error\n", __func__);
++ }
++
++ if (irqstatus & CSIA) {
++ struct isp_buf *buf = ISP_BUF_DONE(bufs);
++ isp_csi2_isr();
++ buf->vb_state = VIDEOBUF_ERROR;
++ }
++
++ if (irqstatus & IRQ0STATUS_CSIB_IRQ) {
++ u32 ispcsi1_irqstatus;
++
++ ispcsi1_irqstatus = isp_reg_readl(OMAP3_ISP_IOMEM_CCP2,
++ ISPCSI1_LC01_IRQSTATUS);
++ DPRINTK_ISPCTRL("%x\n", ispcsi1_irqstatus);
++ }
++
++ if (irqdis->isp_callbk[CBK_CATCHALL]) {
++ irqdis->isp_callbk[CBK_CATCHALL](
++ irqstatus,
++ irqdis->isp_callbk_arg1[CBK_CATCHALL],
++ irqdis->isp_callbk_arg2[CBK_CATCHALL]);
++ }
++
++ spin_unlock_irqrestore(&isp_obj.lock, irqflags);
++
++#if 1
++ {
++ static const struct {
++ int num;
++ char *name;
++ } bits[] = {
++ { 31, "HS_VS_IRQ" },
++ { 30, "SEC_ERR_IRQ" },
++ { 29, "OCP_ERR_IRQ" },
++ { 28, "MMU_ERR_IRQ" },
++ { 27, "res27" },
++ { 26, "res26" },
++ { 25, "OVF_IRQ" },
++ { 24, "RSZ_DONE_IRQ" },
++ { 23, "res23" },
++ { 22, "res22" },
++ { 21, "CBUFF_IRQ" },
++ { 20, "PRV_DONE_IRQ" },
++ { 19, "CCDC_LSC_PREFETCH_ERROR" },
++ { 18, "CCDC_LSC_PREFETCH_COMPLETED" },
++ { 17, "CCDC_LSC_DONE" },
++ { 16, "HIST_DONE_IRQ" },
++ { 15, "res15" },
++ { 14, "res14" },
++ { 13, "H3A_AWB_DONE_IRQ" },
++ { 12, "H3A_AF_DONE_IRQ" },
++ { 11, "CCDC_ERR_IRQ" },
++ { 10, "CCDC_VD2_IRQ" },
++ { 9, "CCDC_VD1_IRQ" },
++ { 8, "CCDC_VD0_IRQ" },
++ { 7, "res7" },
++ { 6, "res6" },
++ { 5, "res5" },
++ { 4, "CSIB_IRQ" },
++ { 3, "CSIB_LCM_IRQ" },
++ { 2, "res2" },
++ { 1, "res1" },
++ { 0, "CSIA_IRQ" },
++ };
++ int i;
++ for (i = 0; i < ARRAY_SIZE(bits); i++) {
++ if ((1 << bits[i].num) & irqstatus)
++ DPRINTK_ISPCTRL("%s ", bits[i].name);
++ }
++ DPRINTK_ISPCTRL("\n");
++ }
++#endif
++
++ return IRQ_HANDLED;
++}
++
++/* Device name, needed for resource tracking layer */
++struct device_driver camera_drv = {
++ .name = "camera"
++};
++
++struct device camera_dev = {
++ .driver = &camera_drv,
++};
++
++/**
++ * isp_tmp_buf_free - To free allocated 10MB memory
++ *
++ **/
++static void isp_tmp_buf_free(void)
++{
++ if (isp_obj.tmp_buf) {
++ ispmmu_vfree(isp_obj.tmp_buf);
++ isp_obj.tmp_buf = 0;
++ isp_obj.tmp_buf_size = 0;
++ }
++}
++
++/**
++ * isp_tmp_buf_alloc - To allocate a 10MB memory
++ *
++ **/
++static u32 isp_tmp_buf_alloc(size_t size)
++{
++ isp_tmp_buf_free();
++
++ printk(KERN_INFO "%s: allocating %d bytes\n", __func__, size);
++
++ isp_obj.tmp_buf = ispmmu_vmalloc(size);
++ if (IS_ERR((void *)isp_obj.tmp_buf)) {
++ printk(KERN_ERR "ispmmu_vmap mapping failed ");
++ return -ENOMEM;
++ }
++ isp_obj.tmp_buf_size = size;
++
++ isppreview_set_outaddr(isp_obj.tmp_buf);
++ ispresizer_set_inaddr(isp_obj.tmp_buf);
++
++ return 0;
++}
++
++/**
++ * isp_start - Starts ISP submodule
++ *
++ * Start the needed isp components assuming these components
++ * are configured correctly.
++ **/
++void isp_start(void)
++{
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_PREVIEW
++ && is_isppreview_enabled())
++ isppreview_enable(1);
++
++ return;
++}
++EXPORT_SYMBOL(isp_start);
++
++#define ISP_STATISTICS_BUSY \
++ ()
++#define ISP_STOP_TIMEOUT msecs_to_jiffies(1000)
++static int __isp_disable_modules(int suspend)
++{
++ unsigned long timeout = jiffies + ISP_STOP_TIMEOUT;
++ int reset = 0;
++
++ /*
++ * We need to stop all the modules after CCDC first or they'll
++ * never stop since they may not get a full frame from CCDC.
++ */
++ if (suspend) {
++ isp_af_suspend();
++ isph3a_aewb_suspend();
++ isp_hist_suspend();
++ isppreview_suspend();
++ ispresizer_suspend();
++ } else {
++ isp_af_enable(0);
++ isph3a_aewb_enable(0);
++ isp_hist_enable(0);
++ isppreview_enable(0);
++ ispresizer_enable(0);
++ }
++
++ timeout = jiffies + ISP_STOP_TIMEOUT;
++ while (isp_af_busy()
++ || isph3a_aewb_busy()
++ || isp_hist_busy()
++ || isppreview_busy()
++ || ispresizer_busy()) {
++ if (time_after(jiffies, timeout)) {
++ printk(KERN_ERR "%s: can't stop non-ccdc modules\n",
++ __func__);
++ reset = 1;
++ break;
++ }
++ msleep(1);
++ }
++
++ /* Let's stop CCDC now. */
++ if (suspend)
++ /* This function supends lsc too */
++ ispccdc_suspend();
++ else {
++ ispccdc_enable_lsc(0);
++ ispccdc_enable(0);
++ }
++
++ timeout = jiffies + ISP_STOP_TIMEOUT;
++ while (ispccdc_busy()) {
++ if (time_after(jiffies, timeout)) {
++ printk(KERN_ERR "%s: can't stop ccdc\n", __func__);
++ reset = 1;
++ break;
++ }
++ msleep(1);
++ }
++
++ return reset;
++}
++
++static int isp_stop_modules(void)
++{
++ return __isp_disable_modules(0);
++}
++
++static int isp_suspend_modules(void)
++{
++ return __isp_disable_modules(1);
++}
++
++static void isp_resume_modules(void)
++{
++ ispresizer_resume();
++ isppreview_resume();
++ isp_hist_resume();
++ isph3a_aewb_resume();
++ isp_af_resume();
++ ispccdc_resume();
++}
++
++static void isp_reset(void)
++{
++ unsigned long timeout = 0;
++
++ isp_reg_writel(isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG)
++ | ISP_SYSCONFIG_SOFTRESET,
++ OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG);
++ while (!(isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_SYSSTATUS) & 0x1)) {
++ if (timeout++ > 10000) {
++ printk(KERN_ALERT "%s: cannot reset ISP\n", __func__);
++ break;
++ }
++ udelay(1);
++ }
++}
++
++/**
++ * isp_stop - Stops isp submodules
++ **/
++void isp_stop()
++{
++ int reset;
++
++ isp_disable_interrupts();
++ reset = isp_stop_modules();
++ isp_buf_init();
++ if (!reset)
++ return;
++
++ isp_save_ctx();
++ isp_reset();
++ isp_restore_ctx();
++}
++EXPORT_SYMBOL(isp_stop);
++
++static void isp_set_buf(struct isp_buf *buf)
++{
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_RESIZER
++ && is_ispresizer_enabled())
++ ispresizer_set_outaddr(buf->isp_addr);
++ else if (isp_obj.module.isp_pipeline & OMAP_ISP_CCDC)
++ ispccdc_set_outaddr(buf->isp_addr);
++
++}
++
++/**
++ * isp_calc_pipeline - Sets pipeline depending of input and output pixel format
++ * @pix_input: Pointer to V4L2 pixel format structure for input image.
++ * @pix_output: Pointer to V4L2 pixel format structure for output image.
++ **/
++static u32 isp_calc_pipeline(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ isp_release_resources();
++ if ((pix_input->pixelformat == V4L2_PIX_FMT_SGRBG10
++ || pix_input->pixelformat == V4L2_PIX_FMT_SGRBG10DPCM8)
++ && pix_output->pixelformat != V4L2_PIX_FMT_SGRBG10) {
++ isp_obj.module.isp_pipeline =
++ OMAP_ISP_CCDC | OMAP_ISP_PREVIEW | OMAP_ISP_RESIZER;
++ ispccdc_request();
++ isppreview_request();
++ ispresizer_request();
++ ispccdc_config_datapath(CCDC_RAW, CCDC_OTHERS_VP);
++ isppreview_config_datapath(PRV_RAW_CCDC, PREVIEW_MEM);
++ ispresizer_config_datapath(RSZ_MEM_YUV);
++ } else {
++ isp_obj.module.isp_pipeline = OMAP_ISP_CCDC;
++ ispccdc_request();
++ if (pix_input->pixelformat == V4L2_PIX_FMT_SGRBG10
++ || pix_input->pixelformat == V4L2_PIX_FMT_SGRBG10DPCM8)
++ ispccdc_config_datapath(CCDC_RAW, CCDC_OTHERS_VP_MEM);
++ else
++ ispccdc_config_datapath(CCDC_YUV_SYNC,
++ CCDC_OTHERS_MEM);
++ }
++ return 0;
++}
++
++/**
++ * isp_config_pipeline - Configures the image size and ycpos for ISP submodules
++ * @pix_input: Pointer to V4L2 pixel format structure for input image.
++ * @pix_output: Pointer to V4L2 pixel format structure for output image.
++ *
++ * The configuration of ycpos depends on the output pixel format for both the
++ * Preview and Resizer submodules.
++ **/
++static void isp_config_pipeline(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ ispccdc_config_size(isp_obj.module.ccdc_input_width,
++ isp_obj.module.ccdc_input_height,
++ isp_obj.module.ccdc_output_width,
++ isp_obj.module.ccdc_output_height);
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_PREVIEW) {
++ isppreview_config_size(isp_obj.module.preview_input_width,
++ isp_obj.module.preview_input_height,
++ isp_obj.module.preview_output_width,
++ isp_obj.module.preview_output_height);
++ }
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_RESIZER) {
++ ispresizer_config_size(isp_obj.module.resizer_input_width,
++ isp_obj.module.resizer_input_height,
++ isp_obj.module.resizer_output_width,
++ isp_obj.module.resizer_output_height);
++ }
++
++ if (pix_output->pixelformat == V4L2_PIX_FMT_UYVY) {
++ isppreview_config_ycpos(YCPOS_YCrYCb);
++ if (is_ispresizer_enabled())
++ ispresizer_config_ycpos(0);
++ } else {
++ isppreview_config_ycpos(YCPOS_CrYCbY);
++ if (is_ispresizer_enabled())
++ ispresizer_config_ycpos(1);
++ }
++
++ return;
++}
++
++static void isp_buf_init(void)
++{
++ struct isp_bufs *bufs = &isp_obj.bufs;
++ int sg;
++
++ bufs->queue = 0;
++ bufs->done = 0;
++ bufs->wait_hs_vs = isp_obj.config->wait_hs_vs;
++ for (sg = 0; sg < NUM_BUFS; sg++) {
++ bufs->buf[sg].complete = NULL;
++ bufs->buf[sg].vb = NULL;
++ bufs->buf[sg].priv = NULL;
++ }
++}
++
++/**
++ * isp_vbq_sync - Walks the pages table and flushes the cache for
++ * each page.
++ **/
++static int isp_vbq_sync(struct videobuf_buffer *vb, int when)
++{
++ flush_cache_all();
++
++ return 0;
++}
++
++static int isp_buf_process(struct isp_bufs *bufs)
++{
++ struct isp_buf *buf = NULL;
++ unsigned long flags;
++ int last;
++
++ spin_lock_irqsave(&bufs->lock, flags);
++
++ if (ISP_BUFS_IS_EMPTY(bufs))
++ goto out;
++
++ if (RAW_CAPTURE(&isp_obj) && ispccdc_sbl_wait_idle(1000)) {
++ printk(KERN_ERR "ccdc %d won't become idle!\n",
++ RAW_CAPTURE(&isp_obj));
++ goto out;
++ }
++
++ /* We had at least one buffer in queue. */
++ buf = ISP_BUF_DONE(bufs);
++ last = ISP_BUFS_IS_LAST(bufs);
++
++ if (!last) {
++ /* Set new buffer address. */
++ isp_set_buf(ISP_BUF_NEXT_DONE(bufs));
++ } else {
++ /* Tell ISP not to write any of our buffers. */
++ isp_disable_interrupts();
++ if (RAW_CAPTURE(&isp_obj))
++ ispccdc_enable(0);
++ else
++ ispresizer_enable(0);
++ /*
++ * We must wait for the HS_VS since before that the
++ * CCDC may trigger interrupts even if it's not
++ * receiving a frame.
++ */
++ bufs->wait_hs_vs = isp_obj.config->wait_hs_vs;
++ }
++ if ((RAW_CAPTURE(&isp_obj) && ispccdc_busy())
++ || (!RAW_CAPTURE(&isp_obj) && ispresizer_busy())) {
++ /*
++ * Next buffer available: for the transfer to succeed, the
++ * CCDC (RAW capture) or resizer (YUV capture) must be idle
++ * for the duration of transfer setup. Bad things happen
++ * otherwise!
++ *
++ * Next buffer not available: if we fail to stop the
++ * ISP the buffer is probably going to be bad.
++ */
++ /* Mark this buffer faulty. */
++ buf->vb_state = VIDEOBUF_ERROR;
++ /* Mark next faulty, too, in case we have one. */
++ if (!last) {
++ ISP_BUF_NEXT_DONE(bufs)->vb_state =
++ VIDEOBUF_ERROR;
++ printk(KERN_ALERT "OUCH!!!\n");
++ } else {
++ printk(KERN_ALERT "Ouch!\n");
++ }
++ }
++
++ /* Mark the current buffer as done. */
++ ISP_BUF_MARK_DONE(bufs);
++
++ DPRINTK_ISPCTRL(KERN_ALERT "%s: finish %d mmu %p\n", __func__,
++ (bufs->done - 1 + NUM_BUFS) % NUM_BUFS,
++ (bufs->buf+((bufs->done - 1 + NUM_BUFS)
++ % NUM_BUFS))->isp_addr);
++
++out:
++ spin_unlock_irqrestore(&bufs->lock, flags);
++
++ if (buf != NULL) {
++ /*
++ * We want to dequeue a buffer from the video buffer
++ * queue. Let's do it!
++ */
++ isp_vbq_sync(buf->vb, DMA_FROM_DEVICE);
++ buf->vb->state = buf->vb_state;
++ buf->complete(buf->vb, buf->priv);
++ }
++
++ return 0;
++}
++
++int isp_buf_queue(struct videobuf_buffer *vb,
++ void (*complete)(struct videobuf_buffer *vb, void *priv),
++ void *priv)
++{
++ unsigned long flags;
++ struct isp_buf *buf;
++ struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
++ const struct scatterlist *sglist = dma->sglist;
++ struct isp_bufs *bufs = &isp_obj.bufs;
++ int sglen = dma->sglen;
++
++ BUG_ON(sglen < 0 || !sglist);
++
++ isp_vbq_sync(vb, DMA_TO_DEVICE);
++
++ spin_lock_irqsave(&bufs->lock, flags);
++
++ BUG_ON(ISP_BUFS_IS_FULL(bufs));
++
++ buf = ISP_BUF_QUEUE(bufs);
++
++ buf->isp_addr = bufs->isp_addr_capture[vb->i];
++ buf->complete = complete;
++ buf->vb = vb;
++ buf->priv = priv;
++ buf->vb_state = VIDEOBUF_DONE;
++
++ if (ISP_BUFS_IS_EMPTY(bufs)) {
++ isp_enable_interrupts(RAW_CAPTURE(&isp_obj));
++ isp_set_buf(buf);
++ ispccdc_enable(1);
++ isp_start();
++ }
++
++ ISP_BUF_MARK_QUEUED(bufs);
++
++ spin_unlock_irqrestore(&bufs->lock, flags);
++
++ DPRINTK_ISPCTRL(KERN_ALERT "%s: queue %d vb %d, mmu %p\n", __func__,
++ (bufs->queue - 1 + NUM_BUFS) % NUM_BUFS, vb->i,
++ buf->isp_addr);
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_buf_queue);
++
++int isp_vbq_setup(struct videobuf_queue *vbq, unsigned int *cnt,
++ unsigned int *size)
++{
++ int rval = 0;
++ size_t tmp_size = PAGE_ALIGN(isp_obj.module.preview_output_width
++ * isp_obj.module.preview_output_height
++ * ISP_BYTES_PER_PIXEL);
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_PREVIEW
++ && isp_obj.tmp_buf_size < tmp_size)
++ rval = isp_tmp_buf_alloc(tmp_size);
++
++ return rval;
++}
++EXPORT_SYMBOL(isp_vbq_setup);
++
++/**
++ * isp_vbq_prepare - Videobuffer queue prepare.
++ * @vbq: Pointer to videobuf_queue structure.
++ * @vb: Pointer to videobuf_buffer structure.
++ * @field: Requested Field order for the videobuffer.
++ *
++ * Returns 0 if successful, or -EIO if the ispmmu was unable to map a
++ * scatter-gather linked list data space.
++ **/
++int isp_vbq_prepare(struct videobuf_queue *vbq, struct videobuf_buffer *vb,
++ enum v4l2_field field)
++{
++ unsigned int isp_addr;
++ struct videobuf_dmabuf *vdma;
++ struct isp_bufs *bufs = &isp_obj.bufs;
++
++ int err = 0;
++
++ vdma = videobuf_to_dma(vb);
++
++ isp_addr = ispmmu_vmap(vdma->sglist, vdma->sglen);
++
++ if (IS_ERR_VALUE(isp_addr))
++ err = -EIO;
++ else
++ bufs->isp_addr_capture[vb->i] = isp_addr;
++
++ return err;
++}
++EXPORT_SYMBOL(isp_vbq_prepare);
++
++/**
++ * isp_vbq_release - Videobuffer queue release.
++ * @vbq: Pointer to videobuf_queue structure.
++ * @vb: Pointer to videobuf_buffer structure.
++ **/
++void isp_vbq_release(struct videobuf_queue *vbq, struct videobuf_buffer *vb)
++{
++ struct isp_bufs *bufs = &isp_obj.bufs;
++
++ ispmmu_vunmap(bufs->isp_addr_capture[vb->i]);
++ bufs->isp_addr_capture[vb->i] = (dma_addr_t)NULL;
++ return;
++}
++EXPORT_SYMBOL(isp_vbq_release);
++
++/**
++ * isp_queryctrl - Query V4L2 control from existing controls in ISP.
++ * @a: Pointer to v4l2_queryctrl structure. It only needs the id field filled.
++ *
++ * Returns 0 if successful, or -EINVAL if not found in ISP.
++ **/
++int isp_queryctrl(struct v4l2_queryctrl *a)
++{
++ int i;
++
++ if (a->id & V4L2_CTRL_FLAG_NEXT_CTRL) {
++ a->id &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
++ i = find_next_vctrl(a->id);
++ } else {
++ i = find_vctrl(a->id);
++ }
++
++ if (i < 0)
++ return -EINVAL;
++
++ *a = video_control[i].qc;
++ return 0;
++}
++EXPORT_SYMBOL(isp_queryctrl);
++
++/**
++ * isp_queryctrl - Query V4L2 control from existing controls in ISP.
++ * @a: Pointer to v4l2_queryctrl structure. It only needs the id field filled.
++ *
++ * Returns 0 if successful, or -EINVAL if not found in ISP.
++ **/
++int isp_querymenu(struct v4l2_querymenu *a)
++{
++ int i;
++
++ i = find_vmenu(a->id, a->index);
++
++ if (i < 0)
++ return -EINVAL;
++
++ *a = video_menu[i];
++ return 0;
++}
++EXPORT_SYMBOL(isp_querymenu);
++
++/**
++ * isp_g_ctrl - Gets value of the desired V4L2 control.
++ * @a: V4L2 control to read actual value from.
++ *
++ * Return 0 if successful, or -EINVAL if chosen control is not found.
++ **/
++int isp_g_ctrl(struct v4l2_control *a)
++{
++ u8 current_value;
++ int rval = 0;
++
++ if (!isp_obj.ref_count)
++ return -EINVAL;
++
++ switch (a->id) {
++ case V4L2_CID_BRIGHTNESS:
++ isppreview_query_brightness(&current_value);
++ a->value = current_value / ISPPRV_BRIGHT_UNITS;
++ break;
++ case V4L2_CID_CONTRAST:
++ isppreview_query_contrast(&current_value);
++ a->value = current_value / ISPPRV_CONTRAST_UNITS;
++ break;
++ case V4L2_CID_COLORFX:
++ isppreview_get_color(&current_value);
++ a->value = current_value;
++ break;
++ default:
++ rval = -EINVAL;
++ break;
++ }
++
++ return rval;
++}
++EXPORT_SYMBOL(isp_g_ctrl);
++
++/**
++ * isp_s_ctrl - Sets value of the desired V4L2 control.
++ * @a: V4L2 control to read actual value from.
++ *
++ * Return 0 if successful, -EINVAL if chosen control is not found or value
++ * is out of bounds, -EFAULT if copy_from_user or copy_to_user operation fails
++ * from camera abstraction layer related controls or the transfered user space
++ * pointer via the value field is not set properly.
++ **/
++int isp_s_ctrl(struct v4l2_control *a)
++{
++ int rval = 0;
++ u8 new_value = a->value;
++
++ if (!isp_obj.ref_count)
++ return -EINVAL;
++
++ switch (a->id) {
++ case V4L2_CID_BRIGHTNESS:
++ if (new_value > ISPPRV_BRIGHT_HIGH)
++ rval = -EINVAL;
++ else
++ isppreview_update_brightness(&new_value);
++ break;
++ case V4L2_CID_CONTRAST:
++ if (new_value > ISPPRV_CONTRAST_HIGH)
++ rval = -EINVAL;
++ else
++ isppreview_update_contrast(&new_value);
++ break;
++ case V4L2_CID_COLORFX:
++ if (new_value > V4L2_COLORFX_SEPIA)
++ rval = -EINVAL;
++ else
++ isppreview_set_color(&new_value);
++ break;
++ default:
++ rval = -EINVAL;
++ break;
++ }
++
++ return rval;
++}
++EXPORT_SYMBOL(isp_s_ctrl);
++
++/**
++ * isp_handle_private - Handle all private ioctls for isp module.
++ * @cmd: ioctl cmd value
++ * @arg: ioctl arg value
++ *
++ * Return 0 if successful, -EINVAL if chosen cmd value is not handled or value
++ * is out of bounds, -EFAULT if ioctl arg value is not valid.
++ * Function simply routes the input ioctl cmd id to the appropriate handler in
++ * the isp module.
++ **/
++int isp_handle_private(int cmd, void *arg)
++{
++ int rval = 0;
++
++ if (!isp_obj.ref_count)
++ return -EINVAL;
++
++ switch (cmd) {
++ case VIDIOC_PRIVATE_ISP_CCDC_CFG:
++ rval = omap34xx_isp_ccdc_config(arg);
++ break;
++ case VIDIOC_PRIVATE_ISP_PRV_CFG:
++ rval = omap34xx_isp_preview_config(arg);
++ break;
++ case VIDIOC_PRIVATE_ISP_AEWB_CFG: {
++ struct isph3a_aewb_config *params;
++ params = (struct isph3a_aewb_config *)arg;
++ rval = isph3a_aewb_configure(params);
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_AEWB_REQ: {
++ struct isph3a_aewb_data *data;
++ data = (struct isph3a_aewb_data *)arg;
++ rval = isph3a_aewb_request_statistics(data);
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_HIST_CFG: {
++ struct isp_hist_config *params;
++ params = (struct isp_hist_config *)arg;
++ rval = isp_hist_configure(params);
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_HIST_REQ: {
++ struct isp_hist_data *data;
++ data = (struct isp_hist_data *)arg;
++ rval = isp_hist_request_statistics(data);
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_AF_CFG: {
++ struct af_configuration *params;
++ params = (struct af_configuration *)arg;
++ rval = isp_af_configure(params);
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_AF_REQ: {
++ struct isp_af_data *data;
++ data = (struct isp_af_data *)arg;
++ rval = isp_af_request_statistics(data);
++ }
++ break;
++ default:
++ rval = -EINVAL;
++ break;
++ }
++ return rval;
++}
++EXPORT_SYMBOL(isp_handle_private);
++
++/**
++ * isp_enum_fmt_cap - Gets more information of chosen format index and type
++ * @f: Pointer to structure containing index and type of format to read from.
++ *
++ * Returns 0 if successful, or -EINVAL if format index or format type is
++ * invalid.
++ **/
++int isp_enum_fmt_cap(struct v4l2_fmtdesc *f)
++{
++ int index = f->index;
++ enum v4l2_buf_type type = f->type;
++ int rval = -EINVAL;
++
++ if (index >= NUM_ISP_CAPTURE_FORMATS)
++ goto err;
++
++ memset(f, 0, sizeof(*f));
++ f->index = index;
++ f->type = type;
++
++ switch (f->type) {
++ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
++ rval = 0;
++ break;
++ default:
++ goto err;
++ }
++
++ f->flags = isp_formats[index].flags;
++ strncpy(f->description, isp_formats[index].description,
++ sizeof(f->description));
++ f->pixelformat = isp_formats[index].pixelformat;
++err:
++ return rval;
++}
++EXPORT_SYMBOL(isp_enum_fmt_cap);
++
++/**
++ * isp_g_fmt_cap - Gets current output image format.
++ * @f: Pointer to V4L2 format structure to be filled with current output format
++ **/
++void isp_g_fmt_cap(struct v4l2_pix_format *pix)
++{
++ *pix = isp_obj.module.pix;
++ return;
++}
++EXPORT_SYMBOL(isp_g_fmt_cap);
++
++/**
++ * isp_s_fmt_cap - Sets I/O formats and crop and configures pipeline in ISP
++ * @f: Pointer to V4L2 format structure to be filled with current output format
++ *
++ * Returns 0 if successful, or return value of either isp_try_size or
++ * isp_try_fmt if there is an error.
++ **/
++int isp_s_fmt_cap(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ int crop_scaling_w = 0, crop_scaling_h = 0;
++ int rval = 0;
++
++ if (!isp_obj.ref_count)
++ return -EINVAL;
++
++ rval = isp_calc_pipeline(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++ rval = isp_try_size(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++ rval = isp_try_fmt(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++ if (ispcroprect.width != pix_output->width) {
++ crop_scaling_w = 1;
++ ispcroprect.left = 0;
++ ispcroprect.width = pix_output->width;
++ }
++
++ if (ispcroprect.height != pix_output->height) {
++ crop_scaling_h = 1;
++ ispcroprect.top = 0;
++ ispcroprect.height = pix_output->height;
++ }
++
++ isp_config_pipeline(pix_input, pix_output);
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_RESIZER
++ && (crop_scaling_h || crop_scaling_w))
++ isp_config_crop(pix_output);
++
++out:
++ return rval;
++}
++EXPORT_SYMBOL(isp_s_fmt_cap);
++
++/**
++ * isp_config_crop - Configures crop parameters in isp resizer.
++ * @croppix: Pointer to V4L2 pixel format structure containing crop parameters
++ **/
++void isp_config_crop(struct v4l2_pix_format *croppix)
++{
++ u8 crop_scaling_w;
++ u8 crop_scaling_h;
++ unsigned long org_left, num_pix, new_top;
++
++ struct v4l2_pix_format *pix = croppix;
++
++ crop_scaling_w = (isp_obj.module.preview_output_width * 10) /
++ pix->width;
++ crop_scaling_h = (isp_obj.module.preview_output_height * 10) /
++ pix->height;
++
++ cur_rect.left = (ispcroprect.left * crop_scaling_w) / 10;
++ cur_rect.top = (ispcroprect.top * crop_scaling_h) / 10;
++ cur_rect.width = (ispcroprect.width * crop_scaling_w) / 10;
++ cur_rect.height = (ispcroprect.height * crop_scaling_h) / 10;
++
++ org_left = cur_rect.left;
++ while (((int)cur_rect.left & 0xFFFFFFF0) != (int)cur_rect.left)
++ (int)cur_rect.left--;
++
++ num_pix = org_left - cur_rect.left;
++ new_top = (int)(num_pix * 3) / 4;
++ cur_rect.top = cur_rect.top - new_top;
++ cur_rect.height = (2 * new_top) + cur_rect.height;
++
++ cur_rect.width = cur_rect.width + (2 * num_pix);
++ while (((int)cur_rect.width & 0xFFFFFFF0) != (int)cur_rect.width)
++ (int)cur_rect.width--;
++
++ isp_obj.tmp_buf_offset =
++ cur_rect.left * 2 +
++ isp_obj.module.preview_output_width * 2 * cur_rect.top;
++
++ ispresizer_trycrop(cur_rect.left, cur_rect.top, cur_rect.width,
++ cur_rect.height,
++ isp_obj.module.resizer_output_width,
++ isp_obj.module.resizer_output_height);
++
++ return;
++}
++EXPORT_SYMBOL(isp_config_crop);
++
++/**
++ * isp_g_crop - Gets crop rectangle size and position.
++ * @a: Pointer to V4L2 crop structure to be filled.
++ *
++ * Always returns 0.
++ **/
++int isp_g_crop(struct v4l2_crop *a)
++{
++ struct v4l2_crop *crop = a;
++
++ crop->c = ispcroprect;
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_g_crop);
++
++/**
++ * isp_s_crop - Sets crop rectangle size and position and queues crop operation
++ * @a: Pointer to V4L2 crop structure with desired parameters.
++ * @pix: Pointer to V4L2 pixel format structure with desired parameters.
++ *
++ * Returns 0 if successful, or -EINVAL if crop parameters are out of bounds.
++ **/
++int isp_s_crop(struct v4l2_crop *a, struct v4l2_pix_format *pix)
++{
++ struct v4l2_crop *crop = a;
++ int rval = 0;
++
++ if (!isp_obj.ref_count)
++ return -EINVAL;
++
++ if (crop->c.left < 0)
++ crop->c.left = 0;
++ if (crop->c.width < 0)
++ crop->c.width = 0;
++ if (crop->c.top < 0)
++ crop->c.top = 0;
++ if (crop->c.height < 0)
++ crop->c.height = 0;
++
++ if (crop->c.left >= pix->width)
++ crop->c.left = pix->width - 1;
++ if (crop->c.top >= pix->height)
++ crop->c.top = pix->height - 1;
++
++ if (crop->c.left + crop->c.width > pix->width)
++ crop->c.width = pix->width - crop->c.left;
++ if (crop->c.top + crop->c.height > pix->height)
++ crop->c.height = pix->height - crop->c.top;
++
++ ispcroprect.left = crop->c.left;
++ ispcroprect.top = crop->c.top;
++ ispcroprect.width = crop->c.width;
++ ispcroprect.height = crop->c.height;
++
++ isp_config_crop(pix);
++
++ isp_obj.module.applyCrop = 1;
++
++ return rval;
++}
++EXPORT_SYMBOL(isp_s_crop);
++
++/**
++ * isp_try_fmt_cap - Tries desired input/output image formats
++ * @pix_input: Pointer to V4L2 pixel format structure for input image.
++ * @pix_output: Pointer to V4L2 pixel format structure for output image.
++ *
++ * Returns 0 if successful, or return value of either isp_try_size or
++ * isp_try_fmt if there is an error.
++ **/
++int isp_try_fmt_cap(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ int rval = 0;
++
++ rval = isp_calc_pipeline(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++ rval = isp_try_size(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++ rval = isp_try_fmt(pix_input, pix_output);
++ if (rval)
++ goto out;
++
++out:
++ return rval;
++}
++EXPORT_SYMBOL(isp_try_fmt_cap);
++
++/**
++ * isp_try_size - Tries size configuration for I/O images of each ISP submodule
++ * @pix_input: Pointer to V4L2 pixel format structure for input image.
++ * @pix_output: Pointer to V4L2 pixel format structure for output image.
++ *
++ * Returns 0 if successful, or return value of ispccdc_try_size,
++ * isppreview_try_size, or ispresizer_try_size (depending on the pipeline
++ * configuration) if there is an error.
++ **/
++static int isp_try_size(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ int rval = 0;
++
++ if (pix_output->width <= ISPRSZ_MIN_OUTPUT
++ || pix_output->height <= ISPRSZ_MIN_OUTPUT)
++ return -EINVAL;
++
++ if (pix_output->width >= ISPRSZ_MAX_OUTPUT
++ || pix_output->height > ISPRSZ_MAX_OUTPUT)
++ return -EINVAL;
++
++ isp_obj.module.ccdc_input_width = pix_input->width;
++ isp_obj.module.ccdc_input_height = pix_input->height;
++ isp_obj.module.resizer_output_width = pix_output->width;
++ isp_obj.module.resizer_output_height = pix_output->height;
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_CCDC) {
++ rval = ispccdc_try_size(isp_obj.module.ccdc_input_width,
++ isp_obj.module.ccdc_input_height,
++ &isp_obj.module.ccdc_output_width,
++ &isp_obj.module.ccdc_output_height);
++ if (rval) {
++ printk(KERN_ERR "ISP_ERR: The dimensions %dx%d are not"
++ " supported\n", pix_input->width,
++ pix_input->height);
++ return rval;
++ }
++ pix_output->width = isp_obj.module.ccdc_output_width;
++ pix_output->height = isp_obj.module.ccdc_output_height;
++ }
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_PREVIEW) {
++ isp_obj.module.preview_input_width =
++ isp_obj.module.ccdc_output_width;
++ isp_obj.module.preview_input_height =
++ isp_obj.module.ccdc_output_height;
++ rval = isppreview_try_size(
++ isp_obj.module.preview_input_width,
++ isp_obj.module.preview_input_height,
++ &isp_obj.module.preview_output_width,
++ &isp_obj.module.preview_output_height);
++ if (rval) {
++ printk(KERN_ERR "ISP_ERR: The dimensions %dx%d are not"
++ " supported\n", pix_input->width,
++ pix_input->height);
++ return rval;
++ }
++ pix_output->width = isp_obj.module.preview_output_width;
++ pix_output->height = isp_obj.module.preview_output_height;
++ }
++
++ if (isp_obj.module.isp_pipeline & OMAP_ISP_RESIZER) {
++ isp_obj.module.resizer_input_width =
++ isp_obj.module.preview_output_width;
++ isp_obj.module.resizer_input_height =
++ isp_obj.module.preview_output_height;
++ rval = ispresizer_try_size(
++ &isp_obj.module.resizer_input_width,
++ &isp_obj.module.resizer_input_height,
++ &isp_obj.module.resizer_output_width,
++ &isp_obj.module.resizer_output_height);
++ if (rval) {
++ printk(KERN_ERR "ISP_ERR: The dimensions %dx%d are not"
++ " supported\n", pix_input->width,
++ pix_input->height);
++ return rval;
++ }
++ pix_output->width = isp_obj.module.resizer_output_width;
++ pix_output->height = isp_obj.module.resizer_output_height;
++ }
++
++ return rval;
++}
++
++/**
++ * isp_try_fmt - Validates input/output format parameters.
++ * @pix_input: Pointer to V4L2 pixel format structure for input image.
++ * @pix_output: Pointer to V4L2 pixel format structure for output image.
++ *
++ * Always returns 0.
++ **/
++int isp_try_fmt(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output)
++{
++ int ifmt;
++
++ for (ifmt = 0; ifmt < NUM_ISP_CAPTURE_FORMATS; ifmt++) {
++ if (pix_output->pixelformat == isp_formats[ifmt].pixelformat)
++ break;
++ }
++ if (ifmt == NUM_ISP_CAPTURE_FORMATS)
++ ifmt = 1;
++ pix_output->pixelformat = isp_formats[ifmt].pixelformat;
++ pix_output->field = V4L2_FIELD_NONE;
++ pix_output->bytesperline = pix_output->width * ISP_BYTES_PER_PIXEL;
++ pix_output->sizeimage =
++ PAGE_ALIGN(pix_output->bytesperline * pix_output->height);
++ pix_output->priv = 0;
++ switch (pix_output->pixelformat) {
++ case V4L2_PIX_FMT_YUYV:
++ case V4L2_PIX_FMT_UYVY:
++ pix_output->colorspace = V4L2_COLORSPACE_JPEG;
++ break;
++ default:
++ pix_output->colorspace = V4L2_COLORSPACE_SRGB;
++ }
++
++ isp_obj.module.pix.pixelformat = pix_output->pixelformat;
++ isp_obj.module.pix.width = pix_output->width;
++ isp_obj.module.pix.height = pix_output->height;
++ isp_obj.module.pix.field = pix_output->field;
++ isp_obj.module.pix.bytesperline = pix_output->bytesperline;
++ isp_obj.module.pix.sizeimage = pix_output->sizeimage;
++ isp_obj.module.pix.priv = pix_output->priv;
++ isp_obj.module.pix.colorspace = pix_output->colorspace;
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_try_fmt);
++
++/**
++ * isp_save_ctx - Saves ISP, CCDC, HIST, H3A, PREV, RESZ & MMU context.
++ *
++ * Routine for saving the context of each module in the ISP.
++ * CCDC, HIST, H3A, PREV, RESZ and MMU.
++ **/
++static void isp_save_ctx(void)
++{
++ isp_save_context(isp_reg_list);
++ ispccdc_save_context();
++ ispmmu_save_context();
++ isphist_save_context();
++ isph3a_save_context();
++ isppreview_save_context();
++ ispresizer_save_context();
++}
++
++/**
++ * isp_restore_ctx - Restores ISP, CCDC, HIST, H3A, PREV, RESZ & MMU context.
++ *
++ * Routine for restoring the context of each module in the ISP.
++ * CCDC, HIST, H3A, PREV, RESZ and MMU.
++ **/
++static void isp_restore_ctx(void)
++{
++ isp_restore_context(isp_reg_list);
++ ispccdc_restore_context();
++ ispmmu_restore_context();
++ isphist_restore_context();
++ isph3a_restore_context();
++ isppreview_restore_context();
++ ispresizer_restore_context();
++}
++
++static int isp_enable_clocks(void)
++{
++ int r;
++
++ r = clk_enable(isp_obj.cam_ick);
++ if (r) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_en for ick failed\n");
++ goto out_clk_enable_ick;
++ }
++ r = clk_enable(isp_obj.cam_mclk);
++ if (r) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_en for mclk failed\n");
++ goto out_clk_enable_mclk;
++ }
++ r = clk_enable(isp_obj.csi2_fck);
++ if (r) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_en for csi2_fclk"
++ " failed\n");
++ goto out_clk_enable_csi2_fclk;
++ }
++ return 0;
++
++out_clk_enable_csi2_fclk:
++ clk_disable(isp_obj.cam_mclk);
++out_clk_enable_mclk:
++ clk_disable(isp_obj.cam_ick);
++out_clk_enable_ick:
++ return r;
++}
++
++static void isp_disable_clocks(void)
++{
++ clk_disable(isp_obj.cam_ick);
++ clk_disable(isp_obj.cam_mclk);
++ clk_disable(isp_obj.csi2_fck);
++}
++
++/**
++ * isp_get - Adquires the ISP resource.
++ *
++ * Initializes the clocks for the first acquire.
++ **/
++int isp_get(void)
++{
++ static int has_context;
++ int ret_err = 0;
++
++ if (omap3isp == NULL)
++ return -EBUSY;
++
++ DPRINTK_ISPCTRL("isp_get: old %d\n", isp_obj.ref_count);
++ mutex_lock(&(isp_obj.isp_mutex));
++ if (isp_obj.ref_count == 0) {
++ ret_err = isp_enable_clocks();
++ if (ret_err)
++ goto out_err;
++ /* We don't want to restore context before saving it! */
++ if (has_context)
++ isp_restore_ctx();
++ else
++ has_context = 1;
++ } else {
++ mutex_unlock(&isp_obj.isp_mutex);
++ return -EBUSY;
++ }
++ isp_obj.ref_count++;
++ mutex_unlock(&(isp_obj.isp_mutex));
++
++ DPRINTK_ISPCTRL("isp_get: new %d\n", isp_obj.ref_count);
++ return isp_obj.ref_count;
++
++out_err:
++ mutex_unlock(&(isp_obj.isp_mutex));
++ return ret_err;
++}
++EXPORT_SYMBOL(isp_get);
++
++/**
++ * isp_put - Releases the ISP resource.
++ *
++ * Releases the clocks also for the last release.
++ **/
++int isp_put(void)
++{
++ if (omap3isp == NULL)
++ return -EBUSY;
++
++ DPRINTK_ISPCTRL("isp_put: old %d\n", isp_obj.ref_count);
++ mutex_lock(&(isp_obj.isp_mutex));
++ if (isp_obj.ref_count) {
++ if (--isp_obj.ref_count == 0) {
++ isp_save_ctx();
++ isp_tmp_buf_free();
++ isp_release_resources();
++ isp_obj.module.isp_pipeline = 0;
++ isp_disable_clocks();
++ memset(&ispcroprect, 0, sizeof(ispcroprect));
++ memset(&cur_rect, 0, sizeof(cur_rect));
++ }
++ }
++ mutex_unlock(&(isp_obj.isp_mutex));
++ DPRINTK_ISPCTRL("isp_put: new %d\n", isp_obj.ref_count);
++ return isp_obj.ref_count;
++}
++EXPORT_SYMBOL(isp_put);
++
++/**
++ * isp_save_context - Saves the values of the ISP module registers.
++ * @reg_list: Structure containing pairs of register address and value to
++ * modify on OMAP.
++ **/
++void isp_save_context(struct isp_reg *reg_list)
++{
++ struct isp_reg *next = reg_list;
++
++ for (; next->reg != ISP_TOK_TERM; next++)
++ next->val = isp_reg_readl(next->mmio_range, next->reg);
++}
++EXPORT_SYMBOL(isp_save_context);
++
++/**
++ * isp_restore_context - Restores the values of the ISP module registers.
++ * @reg_list: Structure containing pairs of register address and value to
++ * modify on OMAP.
++ **/
++void isp_restore_context(struct isp_reg *reg_list)
++{
++ struct isp_reg *next = reg_list;
++
++ for (; next->reg != ISP_TOK_TERM; next++)
++ isp_reg_writel(next->val, next->mmio_range, next->reg);
++}
++EXPORT_SYMBOL(isp_restore_context);
++
++static int isp_remove(struct platform_device *pdev)
++{
++ struct isp_device *isp = platform_get_drvdata(pdev);
++ int i;
++
++ isp_csi2_cleanup();
++ isp_af_exit();
++ isp_resizer_cleanup();
++ isp_preview_cleanup();
++ ispmmu_cleanup();
++ isph3a_aewb_cleanup();
++ isp_hist_cleanup();
++ isp_ccdc_cleanup();
++
++ if (!isp)
++ return 0;
++
++ clk_put(isp_obj.cam_ick);
++ clk_put(isp_obj.cam_mclk);
++ clk_put(isp_obj.csi2_fck);
++
++ free_irq(isp->irq, &isp_obj);
++
++ for (i = 0; i <= OMAP3_ISP_IOMEM_CSI2PHY; i++) {
++ if (isp->mmio_base[i]) {
++ iounmap((void *)isp->mmio_base[i]);
++ isp->mmio_base[i] = 0;
++ }
++
++ if (isp->mmio_base_phys[i]) {
++ release_mem_region(isp->mmio_base_phys[i],
++ isp->mmio_size[i]);
++ isp->mmio_base_phys[i] = 0;
++ }
++ }
++
++ omap3isp = NULL;
++
++ kfree(isp);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++
++static int isp_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ int reset;
++
++ mutex_lock(&(isp_obj.isp_mutex));
++ DPRINTK_ISPCTRL("isp_suspend: starting\n");
++ if (isp_obj.ref_count == 0)
++ goto out;
++
++ isp_disable_interrupts();
++ reset = isp_suspend_modules();
++ isp_save_ctx();
++ if (reset)
++ isp_reset();
++
++ isp_disable_clocks();
++
++out:
++ DPRINTK_ISPCTRL("isp_suspend: done\n");
++ mutex_unlock(&(isp_obj.isp_mutex));
++ return 0;
++}
++
++static int isp_resume(struct platform_device *pdev)
++{
++ int ret_err = 0;
++
++ DPRINTK_ISPCTRL("isp_resume: starting\n");
++
++ if (omap3isp == NULL)
++ goto out;
++
++ if (isp_obj.ref_count >= 0) {
++ ret_err = isp_enable_clocks();
++ if (ret_err)
++ goto out;
++ isp_restore_ctx();
++ isp_resume_modules();
++ isp_enable_interrupts(RAW_CAPTURE(&isp_obj));
++ isp_start();
++ }
++
++out:
++ DPRINTK_ISPCTRL("isp_resume: done \n");
++ return ret_err;
++}
++
++#else
++
++#define isp_suspend NULL
++#define isp_resume NULL
++
++#endif /* CONFIG_PM */
++
++
++static int isp_probe(struct platform_device *pdev)
++{
++ struct isp_device *isp;
++ int ret_err = 0;
++ int i;
++
++ isp = kzalloc(sizeof(*isp), GFP_KERNEL);
++ if (!isp) {
++ dev_err(&pdev->dev, "could not allocate memory\n");
++ return -ENOMEM;
++ }
++
++ platform_set_drvdata(pdev, isp);
++
++ isp->dev = &pdev->dev;
++
++ for (i = 0; i <= OMAP3_ISP_IOMEM_CSI2PHY; i++) {
++ struct resource *mem;
++ /* request the mem region for the camera registers */
++ mem = platform_get_resource(pdev, IORESOURCE_MEM, i);
++ if (!mem) {
++ dev_err(isp->dev, "no mem resource?\n");
++ return -ENODEV;
++ }
++
++ if (!request_mem_region(mem->start, mem->end - mem->start + 1,
++ pdev->name)) {
++ dev_err(isp->dev,
++ "cannot reserve camera register I/O region\n");
++ return -ENODEV;
++
++ }
++ isp->mmio_base_phys[i] = mem->start;
++ isp->mmio_size[i] = mem->end - mem->start + 1;
++
++ /* map the region */
++ isp->mmio_base[i] = (unsigned long)
++ ioremap_nocache(isp->mmio_base_phys[i],
++ isp->mmio_size[i]);
++ if (!isp->mmio_base[i]) {
++ dev_err(isp->dev,
++ "cannot map camera register I/O region\n");
++ return -ENODEV;
++ }
++ }
++
++ isp->irq = platform_get_irq(pdev, 0);
++ if (isp->irq <= 0) {
++ dev_err(isp->dev, "no irq for camera?\n");
++ return -ENODEV;
++ }
++
++ isp_obj.cam_ick = clk_get(&camera_dev, "cam_ick");
++ if (IS_ERR(isp_obj.cam_ick)) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_get for "
++ "cam_ick failed\n");
++ return PTR_ERR(isp_obj.cam_ick);
++ }
++ isp_obj.cam_mclk = clk_get(&camera_dev, "cam_mclk");
++ if (IS_ERR(isp_obj.cam_mclk)) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_get for "
++ "cam_mclk failed\n");
++ ret_err = PTR_ERR(isp_obj.cam_mclk);
++ goto out_clk_get_mclk;
++ }
++ isp_obj.csi2_fck = clk_get(&camera_dev, "csi2_96m_fck");
++ if (IS_ERR(isp_obj.csi2_fck)) {
++ DPRINTK_ISPCTRL("ISP_ERR: clk_get for csi2_fclk"
++ " failed\n");
++ ret_err = PTR_ERR(isp_obj.csi2_fck);
++ goto out_clk_get_csi2_fclk;
++ }
++
++ if (request_irq(isp->irq, omap34xx_isp_isr, IRQF_SHARED,
++ "Omap 3 Camera ISP", &isp_obj)) {
++ DPRINTK_ISPCTRL("Could not install ISR\n");
++ ret_err = -EINVAL;
++ goto out_request_irq;
++ }
++
++ isp_obj.ref_count = 0;
++
++ mutex_init(&(isp_obj.isp_mutex));
++ spin_lock_init(&isp_obj.lock);
++ spin_lock_init(&isp_obj.bufs.lock);
++
++ omap3isp = isp;
++
++ ret_err = ispmmu_init();
++ if (ret_err)
++ goto out_ispmmu_init;
++
++ isp_ccdc_init();
++ isp_hist_init();
++ isph3a_aewb_init();
++ isp_preview_init();
++ isp_resizer_init();
++ isp_af_init();
++ isp_csi2_init();
++
++ isp_get();
++ isp_power_settings(1);
++ isp_put();
++
++ isph3a_notify(1);
++ isp_af_notify(1);
++
++ return 0;
++
++out_ispmmu_init:
++ omap3isp = NULL;
++ free_irq(isp->irq, &isp_obj);
++out_request_irq:
++ clk_put(isp_obj.csi2_fck);
++out_clk_get_csi2_fclk:
++ clk_put(isp_obj.cam_mclk);
++out_clk_get_mclk:
++ clk_put(isp_obj.cam_ick);
++
++ return ret_err;
++}
++
++static struct platform_driver omap3isp_driver = {
++ .probe = isp_probe,
++ .remove = isp_remove,
++ .suspend = isp_suspend,
++ .resume = isp_resume,
++ .driver = {
++ .name = "omap3isp",
++ },
++};
++
++/**
++ * isp_init - ISP module initialization.
++ **/
++static int __init isp_init(void)
++{
++ return platform_driver_register(&omap3isp_driver);
++}
++
++/**
++ * isp_cleanup - ISP module cleanup.
++ **/
++static void __exit isp_cleanup(void)
++{
++ platform_driver_unregister(&omap3isp_driver);
++}
++
++/**
++ * isp_print_status - Prints the values of the ISP Control Module registers
++ *
++ * Also prints other debug information stored in the ISP module structure.
++ **/
++void isp_print_status(void)
++{
++ if (!is_ispctrl_debug_enabled())
++ return;
++
++ DPRINTK_ISPCTRL("###ISP_CTRL=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ DPRINTK_ISPCTRL("###ISP_TCTRL_CTRL=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL));
++ DPRINTK_ISPCTRL("###ISP_SYSCONFIG=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_SYSCONFIG));
++ DPRINTK_ISPCTRL("###ISP_SYSSTATUS=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_SYSSTATUS));
++ DPRINTK_ISPCTRL("###ISP_IRQ0ENABLE=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE));
++ DPRINTK_ISPCTRL("###ISP_IRQ0STATUS=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS));
++}
++EXPORT_SYMBOL(isp_print_status);
++
++module_init(isp_init);
++module_exit(isp_cleanup);
++
++MODULE_AUTHOR("Texas Instruments");
++MODULE_DESCRIPTION("ISP Control Module Library");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/media/video/isp/isp.h b/drivers/media/video/isp/isp.h
+new file mode 100644
+index 0000000..55c98a9
+--- /dev/null
++++ b/drivers/media/video/isp/isp.h
+@@ -0,0 +1,318 @@
++/*
++ * isp.h
++ *
++ * Top level public header file for ISP Control module in
++ * TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments.
++ * Copyright (C) 2009 Nokia.
++ *
++ * Contributors:
++ * Sameer Venkatraman <sameerv@ti.com>
++ * Mohit Jalori <mjalori@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_TOP_H
++#define OMAP_ISP_TOP_H
++#include <mach/cpu.h>
++#include <media/videobuf-dma-sg.h>
++#include <linux/videodev2.h>
++#define OMAP_ISP_CCDC (1 << 0)
++#define OMAP_ISP_PREVIEW (1 << 1)
++#define OMAP_ISP_RESIZER (1 << 2)
++#define OMAP_ISP_AEWB (1 << 3)
++#define OMAP_ISP_AF (1 << 4)
++#define OMAP_ISP_HIST (1 << 5)
++
++#define ISP_TOK_TERM 0xFFFFFFFF /*
++ * terminating token for ISP
++ * modules reg list
++ */
++#define NUM_BUFS VIDEO_MAX_FRAME
++
++#ifndef CONFIG_ARCH_OMAP3410
++#define USE_ISP_PREVIEW
++#define USE_ISP_RESZ
++#define is_isppreview_enabled() 1
++#define is_ispresizer_enabled() 1
++#else
++#define is_isppreview_enabled() 0
++#define is_ispresizer_enabled() 0
++#endif
++
++#define ISP_BYTES_PER_PIXEL 2
++#define NUM_ISP_CAPTURE_FORMATS (sizeof(isp_formats) / \
++ sizeof(isp_formats[0]))
++typedef int (*isp_vbq_callback_ptr) (struct videobuf_buffer *vb);
++typedef void (*isp_callback_t) (unsigned long status,
++ isp_vbq_callback_ptr arg1, void *arg2);
++
++enum isp_mem_resources {
++ OMAP3_ISP_IOMEM_MAIN,
++ OMAP3_ISP_IOMEM_CBUFF,
++ OMAP3_ISP_IOMEM_CCP2,
++ OMAP3_ISP_IOMEM_CCDC,
++ OMAP3_ISP_IOMEM_HIST,
++ OMAP3_ISP_IOMEM_H3A,
++ OMAP3_ISP_IOMEM_PREV,
++ OMAP3_ISP_IOMEM_RESZ,
++ OMAP3_ISP_IOMEM_SBL,
++ OMAP3_ISP_IOMEM_CSI2A,
++ OMAP3_ISP_IOMEM_CSI2PHY
++};
++
++struct isp_device {
++ struct device *dev;
++
++ /*** platform HW resources ***/
++ unsigned int irq;
++
++#define mmio_base_main mmio_base[OMAP3_ISP_IOMEM_MAIN]
++#define mmio_cbuff_main mmio_base[OMAP3_ISP_IOMEM_CBUFF]
++#define mmio_ccp2_main mmio_base[OMAP3_ISP_IOMEM_CCP2]
++#define mmio_ccdc_main mmio_base[OMAP3_ISP_IOMEM_CCDC]
++#define mmio_hist_main mmio_base[OMAP3_ISP_IOMEM_HIST]
++#define mmio_h3a_main mmio_base[OMAP3_ISP_IOMEM_H3A]
++#define mmio_prev_main mmio_base[OMAP3_ISP_IOMEM_PREV]
++#define mmio_resz_main mmio_base[OMAP3_ISP_IOMEM_RESZ]
++#define mmio_sbl_main mmio_base[OMAP3_ISP_IOMEM_SBL]
++#define mmio_csi2_main mmio_base[OMAP3_ISP_IOMEM_CSI2A]
++#define mmio_csi2phy_main mmio_base[OMAP3_ISP_IOMEM_CSI2PHY]
++ unsigned long mmio_base[OMAP3_ISP_IOMEM_CSI2PHY + 1];
++ unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_CSI2PHY + 1];
++ unsigned long mmio_size[OMAP3_ISP_IOMEM_CSI2PHY + 1];
++};
++
++enum isp_interface_type {
++ ISP_PARLL = 1,
++ ISP_CSIA = 2,
++ ISP_CSIB = 4,
++ ISP_NONE = 8 /* memory input to preview / resizer */
++};
++
++enum isp_irqevents {
++ CSIA = 0x01,
++ CSIB = 0x10,
++ CCDC_VD0 = 0x100,
++ CCDC_VD1 = 0x200,
++ CCDC_VD2 = 0x400,
++ CCDC_ERR = 0x800,
++ H3A_AWB_DONE = 0x2000,
++ H3A_AF_DONE = 0x1000,
++ HIST_DONE = 0x10000,
++ PREV_DONE = 0x100000,
++ LSC_DONE = 0x20000,
++ LSC_PRE_COMP = 0x40000,
++ LSC_PRE_ERR = 0x80000,
++ RESZ_DONE = 0x1000000,
++ SBL_OVF = 0x2000000,
++ MMU_ERR = 0x10000000,
++ OCP_ERR = 0x20000000,
++ HS_VS = 0x80000000
++};
++
++enum isp_callback_type {
++ CBK_CCDC_VD0,
++ CBK_CCDC_VD1,
++ CBK_PREV_DONE,
++ CBK_RESZ_DONE,
++ CBK_MMU_ERR,
++ CBK_H3A_AWB_DONE,
++ CBK_HIST_DONE,
++ CBK_HS_VS,
++ CBK_LSC_ISR,
++ CBK_H3A_AF_DONE,
++ CBK_CATCHALL,
++ CBK_CSIA,
++ CBK_CSIB,
++ CBK_END,
++};
++
++/**
++ * struct isp_reg - Structure for ISP register values.
++ * @reg: 32-bit Register address.
++ * @val: 32-bit Register value.
++ */
++struct isp_reg {
++ enum isp_mem_resources mmio_range;
++ u32 reg;
++ u32 val;
++};
++
++/**
++ * struct isp_interface_config - ISP interface configuration.
++ * @ccdc_par_ser: ISP interface type. 0 - Parallel, 1 - CSIA, 2 - CSIB to CCDC.
++ * @par_bridge: CCDC Bridge input control. Parallel interface.
++ * 0 - Disable, 1 - Enable, first byte->cam_d(bits 7 to 0)
++ * 2 - Enable, first byte -> cam_d(bits 15 to 8)
++ * @par_clk_pol: Pixel clock polarity on the parallel interface.
++ * 0 - Non Inverted, 1 - Inverted
++ * @dataline_shift: Data lane shifter.
++ * 0 - No Shift, 1 - CAMEXT[13 to 2]->CAM[11 to 0]
++ * 2 - CAMEXT[13 to 4]->CAM[9 to 0]
++ * 3 - CAMEXT[13 to 6]->CAM[7 to 0]
++ * @hsvs_syncdetect: HS or VS synchronization signal detection.
++ * 0 - HS Falling, 1 - HS rising
++ * 2 - VS falling, 3 - VS rising
++ * @strobe: Strobe related parameter.
++ * @prestrobe: PreStrobe related parameter.
++ * @shutter: Shutter related parameter.
++ * @hskip: Horizontal Start Pixel performed in Preview module.
++ * @vskip: Vertical Start Line performed in Preview module.
++ * @wenlog: Store the value for the sensor specific wenlog field.
++ * @wait_hs_vs: Wait for this many hs_vs before anything else in the beginning.
++ */
++struct isp_interface_config {
++ enum isp_interface_type ccdc_par_ser;
++ u8 dataline_shift;
++ u32 hsvs_syncdetect;
++ int strobe;
++ int prestrobe;
++ int shutter;
++ u32 prev_sph;
++ u32 prev_slv;
++ u32 wenlog;
++ int wait_hs_vs;
++ union {
++ struct par {
++ unsigned par_bridge:2;
++ unsigned par_clk_pol:1;
++ } par;
++ struct csi {
++ unsigned crc:1;
++ unsigned mode:1;
++ unsigned edge:1;
++ unsigned signalling:1;
++ unsigned strobe_clock_inv:1;
++ unsigned vs_edge:1;
++ unsigned channel:3;
++ unsigned vpclk:2; /* Video port output clock */
++ unsigned int data_start;
++ unsigned int data_size;
++ u32 format; /* V4L2_PIX_FMT_* */
++ } csi;
++ } u;
++};
++
++u32 isp_reg_readl(enum isp_mem_resources isp_mmio_range, u32 reg_offset);
++
++void isp_reg_writel(u32 reg_value, enum isp_mem_resources isp_mmio_range,
++ u32 reg_offset);
++
++static inline void isp_reg_and(enum isp_mem_resources mmio_range, u32 reg,
++ u32 and_bits)
++{
++ u32 v = isp_reg_readl(mmio_range, reg);
++
++ isp_reg_writel(v & and_bits, mmio_range, reg);
++}
++
++static inline void isp_reg_or(enum isp_mem_resources mmio_range, u32 reg,
++ u32 or_bits)
++{
++ u32 v = isp_reg_readl(mmio_range, reg);
++
++ isp_reg_writel(v | or_bits, mmio_range, reg);
++}
++
++static inline void isp_reg_and_or(enum isp_mem_resources mmio_range, u32 reg,
++ u32 and_bits, u32 or_bits)
++{
++ u32 v = isp_reg_readl(mmio_range, reg);
++
++ isp_reg_writel((v & and_bits) | or_bits, mmio_range, reg);
++}
++
++void isp_start(void);
++
++void isp_stop(void);
++
++int isp_buf_queue(struct videobuf_buffer *vb,
++ void (*complete)(struct videobuf_buffer *vb, void *priv),
++ void *priv);
++
++int isp_vbq_setup(struct videobuf_queue *vbq, unsigned int *cnt,
++ unsigned int *size);
++
++int isp_vbq_prepare(struct videobuf_queue *vbq, struct videobuf_buffer *vb,
++ enum v4l2_field field);
++
++void isp_vbq_release(struct videobuf_queue *vbq, struct videobuf_buffer *vb);
++
++int isp_set_callback(enum isp_callback_type type, isp_callback_t callback,
++ isp_vbq_callback_ptr arg1, void *arg2);
++
++int isp_unset_callback(enum isp_callback_type type);
++
++u32 isp_set_xclk(u32 xclk, u8 xclksel);
++
++int isp_configure_interface(struct isp_interface_config *config);
++
++int isp_get(void);
++
++int isp_put(void);
++
++int isp_queryctrl(struct v4l2_queryctrl *a);
++
++int isp_querymenu(struct v4l2_querymenu *a);
++
++int isp_g_ctrl(struct v4l2_control *a);
++
++int isp_s_ctrl(struct v4l2_control *a);
++
++int isp_enum_fmt_cap(struct v4l2_fmtdesc *f);
++
++int isp_try_fmt_cap(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output);
++
++void isp_g_fmt_cap(struct v4l2_pix_format *pix);
++
++int isp_s_fmt_cap(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output);
++
++int isp_g_crop(struct v4l2_crop *a);
++
++int isp_s_crop(struct v4l2_crop *a, struct v4l2_pix_format *pix);
++
++void isp_config_crop(struct v4l2_pix_format *pix);
++
++int isp_try_fmt(struct v4l2_pix_format *pix_input,
++ struct v4l2_pix_format *pix_output);
++
++int isp_handle_private(int cmd, void *arg);
++
++void isp_save_context(struct isp_reg *);
++
++void isp_restore_context(struct isp_reg *);
++
++void isp_print_status(void);
++
++int __init isp_ccdc_init(void);
++int __init isp_hist_init(void);
++int __init isph3a_aewb_init(void);
++int __init isp_preview_init(void);
++int __init isp_resizer_init(void);
++int __init isp_af_init(void);
++int __init isp_csi2_init(void);
++
++void isp_ccdc_cleanup(void);
++void isp_hist_cleanup(void);
++void isph3a_aewb_cleanup(void);
++void isp_preview_cleanup(void);
++void isp_hist_cleanup(void);
++void isp_resizer_cleanup(void);
++void isp_af_exit(void);
++void isp_csi2_cleanup(void);
++
++#endif /* OMAP_ISP_TOP_H */
+diff --git a/drivers/media/video/isp/ispreg.h b/drivers/media/video/isp/ispreg.h
+new file mode 100644
+index 0000000..4f8e1ef
+--- /dev/null
++++ b/drivers/media/video/isp/ispreg.h
+@@ -0,0 +1,1674 @@
++/*
++ * ispreg.h
++ *
++ * Header file for all the ISP module in TI's OMAP3 Camera ISP.
++ * It has the OMAP HW register definitions.
++ *
++ * Copyright (C) 2009 Texas Instruments.
++ * Copyright (C) 2009 Nokia.
++ *
++ * Contributors:
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ * Thara Gopinath <thara@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef __ISPREG_H__
++#define __ISPREG_H__
++
++#include <mach/omap34xx.h>
++
++/* Note: Uncomment below defines as needed for enabling module specific debug
++ * messages
++ */
++
++/*
++ #define OMAP_ISPCTRL_DEBUG
++ #define OMAP_ISPCCDC_DEBUG
++ #define OMAP_ISPPREV_DEBUG
++ #define OMAP_ISPRESZ_DEBUG
++ #define OMAP_ISPMMU_DEBUG
++ #define OMAP_ISPH3A_DEBUG
++ #define OMAP_ISP_AF_DEBUG
++ #define OMAP_ISPHIST_DEBUG
++*/
++
++#ifdef OMAP_ISPCTRL_DEBUG
++#define DPRINTK_ISPCTRL(format, ...) \
++ printk(KERN_INFO "ISPCTRL: " format, ## __VA_ARGS__)
++#define is_ispctrl_debug_enabled() 1
++#else
++#define DPRINTK_ISPCTRL(format, ...)
++#define is_ispctrl_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPCCDC_DEBUG
++#define DPRINTK_ISPCCDC(format, ...) \
++ printk(KERN_INFO "ISPCCDC: " format, ## __VA_ARGS__)
++#define is_ispccdc_debug_enabled() 1
++#else
++#define DPRINTK_ISPCCDC(format, ...)
++#define is_ispccdc_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPPREV_DEBUG
++#define DPRINTK_ISPPREV(format, ...) \
++ printk(KERN_INFO "ISPPREV: " format, ## __VA_ARGS__)
++#define is_ispprev_debug_enabled() 1
++#else
++#define DPRINTK_ISPPREV(format, ...)
++#define is_ispprev_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPRESZ_DEBUG
++#define DPRINTK_ISPRESZ(format, ...) \
++ printk(KERN_INFO "ISPRESZ: " format, ## __VA_ARGS__)
++#define is_ispresz_debug_enabled() 1
++#else
++#define DPRINTK_ISPRESZ(format, ...)
++#define is_ispresz_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPMMU_DEBUG
++#define DPRINTK_ISPMMU(format, ...) \
++ printk(KERN_INFO "ISPMMU: " format, ## __VA_ARGS__)
++#define is_ispmmu_debug_enabled() 1
++#else
++#define DPRINTK_ISPMMU(format, ...)
++#define is_ispmmu_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPH3A_DEBUG
++#define DPRINTK_ISPH3A(format, ...) \
++ printk(KERN_INFO "ISPH3A: " format, ## __VA_ARGS__)
++#define is_isph3a_debug_enabled() 1
++#else
++#define DPRINTK_ISPH3A(format, ...)
++#define is_isph3a_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISP_AF_DEBUG
++#define DPRINTK_ISP_AF(format, ...) \
++ printk(KERN_INFO "ISP_AF: " format, ## __VA_ARGS__)
++#define is_isp_af_debug_enabled() 1
++#else
++#define DPRINTK_ISP_AF(format, ...)
++#define is_isp_af_debug_enabled() 0
++#endif
++
++#ifdef OMAP_ISPHIST_DEBUG
++#define DPRINTK_ISPHIST(format, ...) \
++ printk(KERN_INFO "ISPHIST: " format, ## __VA_ARGS__)
++#define is_isphist_debug_enabled() 1
++#else
++#define DPRINTK_ISPHIST(format, ...)
++#define is_isphist_debug_enabled() 0
++#endif
++
++#define ISP_32B_BOUNDARY_BUF 0xFFFFFFE0
++#define ISP_32B_BOUNDARY_OFFSET 0x0000FFE0
++
++#define CM_CAM_MCLK_HZ 216000000
++
++/* ISP Submodules offset */
++
++#define OMAP3ISP_REG_BASE OMAP3430_ISP_BASE
++#define OMAP3ISP_REG(offset) (OMAP3ISP_REG_BASE + (offset))
++
++#define OMAP3ISP_CBUFF_REG_OFFSET 0x0100
++#define OMAP3ISP_CBUFF_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_CBUFF_REG_OFFSET)
++#define OMAP3ISP_CBUFF_REG(offset) (OMAP3ISP_CBUFF_REG_BASE + (offset))
++
++#define OMAP3ISP_CCP2_REG_OFFSET 0x0400
++#define OMAP3ISP_CCP2_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_CCP2_REG_OFFSET)
++#define OMAP3ISP_CCP2_REG(offset) (OMAP3ISP_CCP2_REG_BASE + (offset))
++
++#define OMAP3ISP_CCDC_REG_OFFSET 0x0600
++#define OMAP3ISP_CCDC_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_CCDC_REG_OFFSET)
++#define OMAP3ISP_CCDC_REG(offset) (OMAP3ISP_CCDC_REG_BASE + (offset))
++
++#define OMAP3ISP_HIST_REG_OFFSET 0x0A00
++#define OMAP3ISP_HIST_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_HIST_REG_OFFSET)
++#define OMAP3ISP_HIST_REG(offset) (OMAP3ISP_HIST_REG_BASE + (offset))
++
++#define OMAP3ISP_H3A_REG_OFFSET 0x0C00
++#define OMAP3ISP_H3A_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_H3A_REG_OFFSET)
++#define OMAP3ISP_H3A_REG(offset) (OMAP3ISP_H3A_REG_BASE + (offset))
++
++#define OMAP3ISP_PREV_REG_OFFSET 0x0E00
++#define OMAP3ISP_PREV_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_PREV_REG_OFFSET)
++#define OMAP3ISP_PREV_REG(offset) (OMAP3ISP_PREV_REG_BASE + (offset))
++
++#define OMAP3ISP_RESZ_REG_OFFSET 0x1000
++#define OMAP3ISP_RESZ_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_RESZ_REG_OFFSET)
++#define OMAP3ISP_RESZ_REG(offset) (OMAP3ISP_RESZ_REG_BASE + (offset))
++
++#define OMAP3ISP_SBL_REG_OFFSET 0x1200
++#define OMAP3ISP_SBL_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_SBL_REG_OFFSET)
++#define OMAP3ISP_SBL_REG(offset) (OMAP3ISP_SBL_REG_BASE + (offset))
++
++#define OMAP3ISP_MMU_REG_OFFSET 0x1400
++#define OMAP3ISP_MMU_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_MMU_REG_OFFSET)
++#define OMAP3ISP_MMU_REG(offset) (OMAP3ISP_MMU_REG_BASE + (offset))
++
++#define OMAP3ISP_CSI2A_REG_OFFSET 0x1800
++#define OMAP3ISP_CSI2A_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_CSI2A_REG_OFFSET)
++#define OMAP3ISP_CSI2A_REG(offset) (OMAP3ISP_CSI2A_REG_BASE + (offset))
++
++#define OMAP3ISP_CSI2PHY_REG_OFFSET 0x1970
++#define OMAP3ISP_CSI2PHY_REG_BASE (OMAP3ISP_REG_BASE + \
++ OMAP3ISP_CSI2PHY_REG_OFFSET)
++#define OMAP3ISP_CSI2PHY_REG(offset) (OMAP3ISP_CSI2PHY_REG_BASE + (offset))
++
++/* ISP module register offset */
++
++#define ISP_REVISION (0x000)
++#define ISP_SYSCONFIG (0x004)
++#define ISP_SYSSTATUS (0x008)
++#define ISP_IRQ0ENABLE (0x00C)
++#define ISP_IRQ0STATUS (0x010)
++#define ISP_IRQ1ENABLE (0x014)
++#define ISP_IRQ1STATUS (0x018)
++#define ISP_TCTRL_GRESET_LENGTH (0x030)
++#define ISP_TCTRL_PSTRB_REPLAY (0x034)
++#define ISP_CTRL (0x040)
++#define ISP_SECURE (0x044)
++#define ISP_TCTRL_CTRL (0x050)
++#define ISP_TCTRL_FRAME (0x054)
++#define ISP_TCTRL_PSTRB_DELAY (0x058)
++#define ISP_TCTRL_STRB_DELAY (0x05C)
++#define ISP_TCTRL_SHUT_DELAY (0x060)
++#define ISP_TCTRL_PSTRB_LENGTH (0x064)
++#define ISP_TCTRL_STRB_LENGTH (0x068)
++#define ISP_TCTRL_SHUT_LENGTH (0x06C)
++#define ISP_PING_PONG_ADDR (0x070)
++#define ISP_PING_PONG_MEM_RANGE (0x074)
++#define ISP_PING_PONG_BUF_SIZE (0x078)
++
++/* CSI1 receiver registers (ES2.0) */
++#define ISPCSI1_REVISION (0x000)
++#define ISPCSI1_SYSCONFIG (0x004)
++#define ISPCSI1_SYSSTATUS (0x008)
++#define ISPCSI1_LC01_IRQENABLE (0x00C)
++#define ISPCSI1_LC01_IRQSTATUS (0x010)
++#define ISPCSI1_LC23_IRQENABLE (0x014)
++#define ISPCSI1_LC23_IRQSTATUS (0x018)
++#define ISPCSI1_LCM_IRQENABLE (0x02C)
++#define ISPCSI1_LCM_IRQSTATUS (0x030)
++#define ISPCSI1_CTRL (0x040)
++#define ISPCSI1_DBG (0x044)
++#define ISPCSI1_GNQ (0x048)
++#define ISPCSI1_LCx_CTRL(x) ((0x050)+0x30*(x))
++#define ISPCSI1_LCx_CODE(x) ((0x054)+0x30*(x))
++#define ISPCSI1_LCx_STAT_START(x) ((0x058)+0x30*(x))
++#define ISPCSI1_LCx_STAT_SIZE(x) ((0x05C)+0x30*(x))
++#define ISPCSI1_LCx_SOF_ADDR(x) ((0x060)+0x30*(x))
++#define ISPCSI1_LCx_EOF_ADDR(x) ((0x064)+0x30*(x))
++#define ISPCSI1_LCx_DAT_START(x) ((0x068)+0x30*(x))
++#define ISPCSI1_LCx_DAT_SIZE(x) ((0x06C)+0x30*(x))
++#define ISPCSI1_LCx_DAT_PING_ADDR(x) ((0x070)+0x30*(x))
++#define ISPCSI1_LCx_DAT_PONG_ADDR(x) ((0x074)+0x30*(x))
++#define ISPCSI1_LCx_DAT_OFST(x) ((0x078)+0x30*(x))
++#define ISPCSI1_LCM_CTRL (0x1D0)
++#define ISPCSI1_LCM_VSIZE (0x1D4)
++#define ISPCSI1_LCM_HSIZE (0x1D8)
++#define ISPCSI1_LCM_PREFETCH (0x1DC)
++#define ISPCSI1_LCM_SRC_ADDR (0x1E0)
++#define ISPCSI1_LCM_SRC_OFST (0x1E4)
++#define ISPCSI1_LCM_DST_ADDR (0x1E8)
++#define ISPCSI1_LCM_DST_OFST (0x1EC)
++#define ISP_CSIB_SYSCONFIG ISPCSI1_SYSCONFIG
++#define ISP_CSIA_SYSCONFIG ISPCSI2_SYSCONFIG
++
++/* ISP_CBUFF Registers */
++
++#define ISP_CBUFF_SYSCONFIG (0x010)
++#define ISP_CBUFF_IRQENABLE (0x01C)
++
++#define ISP_CBUFF0_CTRL (0x020)
++#define ISP_CBUFF1_CTRL (0x024)
++
++#define ISP_CBUFF0_START (0x040)
++#define ISP_CBUFF1_START (0x044)
++
++#define ISP_CBUFF0_END (0x050)
++#define ISP_CBUFF1_END (0x054)
++
++#define ISP_CBUFF0_WINDOWSIZE (0x060)
++#define ISP_CBUFF1_WINDOWSIZE (0x064)
++
++#define ISP_CBUFF0_THRESHOLD (0x070)
++#define ISP_CBUFF1_THRESHOLD (0x074)
++
++/* CCDC module register offset */
++
++#define ISPCCDC_PID (0x000)
++#define ISPCCDC_PCR (0x004)
++#define ISPCCDC_SYN_MODE (0x008)
++#define ISPCCDC_HD_VD_WID (0x00C)
++#define ISPCCDC_PIX_LINES (0x010)
++#define ISPCCDC_HORZ_INFO (0x014)
++#define ISPCCDC_VERT_START (0x018)
++#define ISPCCDC_VERT_LINES (0x01C)
++#define ISPCCDC_CULLING (0x020)
++#define ISPCCDC_HSIZE_OFF (0x024)
++#define ISPCCDC_SDOFST (0x028)
++#define ISPCCDC_SDR_ADDR (0x02C)
++#define ISPCCDC_CLAMP (0x030)
++#define ISPCCDC_DCSUB (0x034)
++#define ISPCCDC_COLPTN (0x038)
++#define ISPCCDC_BLKCMP (0x03C)
++#define ISPCCDC_FPC (0x040)
++#define ISPCCDC_FPC_ADDR (0x044)
++#define ISPCCDC_VDINT (0x048)
++#define ISPCCDC_ALAW (0x04C)
++#define ISPCCDC_REC656IF (0x050)
++#define ISPCCDC_CFG (0x054)
++#define ISPCCDC_FMTCFG (0x058)
++#define ISPCCDC_FMT_HORZ (0x05C)
++#define ISPCCDC_FMT_VERT (0x060)
++#define ISPCCDC_FMT_ADDR0 (0x064)
++#define ISPCCDC_FMT_ADDR1 (0x068)
++#define ISPCCDC_FMT_ADDR2 (0x06C)
++#define ISPCCDC_FMT_ADDR3 (0x070)
++#define ISPCCDC_FMT_ADDR4 (0x074)
++#define ISPCCDC_FMT_ADDR5 (0x078)
++#define ISPCCDC_FMT_ADDR6 (0x07C)
++#define ISPCCDC_FMT_ADDR7 (0x080)
++#define ISPCCDC_PRGEVEN0 (0x084)
++#define ISPCCDC_PRGEVEN1 (0x088)
++#define ISPCCDC_PRGODD0 (0x08C)
++#define ISPCCDC_PRGODD1 (0x090)
++#define ISPCCDC_VP_OUT (0x094)
++
++#define ISPCCDC_LSC_CONFIG (0x098)
++#define ISPCCDC_LSC_INITIAL (0x09C)
++#define ISPCCDC_LSC_TABLE_BASE (0x0A0)
++#define ISPCCDC_LSC_TABLE_OFFSET (0x0A4)
++
++/* SBL */
++#define ISPSBL_CCDC_WR_0 (0x028)
++#define ISPSBL_CCDC_WR_0_DATA_READY (1 << 21)
++#define ISPSBL_CCDC_WR_1 (0x02C)
++#define ISPSBL_CCDC_WR_2 (0x030)
++#define ISPSBL_CCDC_WR_3 (0x034)
++
++/* Histogram registers */
++#define ISPHIST_PID (0x000)
++#define ISPHIST_PCR (0x004)
++#define ISPHIST_CNT (0x008)
++#define ISPHIST_WB_GAIN (0x00C)
++#define ISPHIST_R0_HORZ (0x010)
++#define ISPHIST_R0_VERT (0x014)
++#define ISPHIST_R1_HORZ (0x018)
++#define ISPHIST_R1_VERT (0x01C)
++#define ISPHIST_R2_HORZ (0x020)
++#define ISPHIST_R2_VERT (0x024)
++#define ISPHIST_R3_HORZ (0x028)
++#define ISPHIST_R3_VERT (0x02C)
++#define ISPHIST_ADDR (0x030)
++#define ISPHIST_DATA (0x034)
++#define ISPHIST_RADD (0x038)
++#define ISPHIST_RADD_OFF (0x03C)
++#define ISPHIST_H_V_INFO (0x040)
++
++/* H3A module registers */
++#define ISPH3A_PID (0x000)
++#define ISPH3A_PCR (0x004)
++#define ISPH3A_AEWWIN1 (0x04C)
++#define ISPH3A_AEWINSTART (0x050)
++#define ISPH3A_AEWINBLK (0x054)
++#define ISPH3A_AEWSUBWIN (0x058)
++#define ISPH3A_AEWBUFST (0x05C)
++#define ISPH3A_AFPAX1 (0x008)
++#define ISPH3A_AFPAX2 (0x00C)
++#define ISPH3A_AFPAXSTART (0x010)
++#define ISPH3A_AFIIRSH (0x014)
++#define ISPH3A_AFBUFST (0x018)
++#define ISPH3A_AFCOEF010 (0x01C)
++#define ISPH3A_AFCOEF032 (0x020)
++#define ISPH3A_AFCOEF054 (0x024)
++#define ISPH3A_AFCOEF076 (0x028)
++#define ISPH3A_AFCOEF098 (0x02C)
++#define ISPH3A_AFCOEF0010 (0x030)
++#define ISPH3A_AFCOEF110 (0x034)
++#define ISPH3A_AFCOEF132 (0x038)
++#define ISPH3A_AFCOEF154 (0x03C)
++#define ISPH3A_AFCOEF176 (0x040)
++#define ISPH3A_AFCOEF198 (0x044)
++#define ISPH3A_AFCOEF1010 (0x048)
++
++#define ISPPRV_PCR (0x004)
++#define ISPPRV_HORZ_INFO (0x008)
++#define ISPPRV_VERT_INFO (0x00C)
++#define ISPPRV_RSDR_ADDR (0x010)
++#define ISPPRV_RADR_OFFSET (0x014)
++#define ISPPRV_DSDR_ADDR (0x018)
++#define ISPPRV_DRKF_OFFSET (0x01C)
++#define ISPPRV_WSDR_ADDR (0x020)
++#define ISPPRV_WADD_OFFSET (0x024)
++#define ISPPRV_AVE (0x028)
++#define ISPPRV_HMED (0x02C)
++#define ISPPRV_NF (0x030)
++#define ISPPRV_WB_DGAIN (0x034)
++#define ISPPRV_WBGAIN (0x038)
++#define ISPPRV_WBSEL (0x03C)
++#define ISPPRV_CFA (0x040)
++#define ISPPRV_BLKADJOFF (0x044)
++#define ISPPRV_RGB_MAT1 (0x048)
++#define ISPPRV_RGB_MAT2 (0x04C)
++#define ISPPRV_RGB_MAT3 (0x050)
++#define ISPPRV_RGB_MAT4 (0x054)
++#define ISPPRV_RGB_MAT5 (0x058)
++#define ISPPRV_RGB_OFF1 (0x05C)
++#define ISPPRV_RGB_OFF2 (0x060)
++#define ISPPRV_CSC0 (0x064)
++#define ISPPRV_CSC1 (0x068)
++#define ISPPRV_CSC2 (0x06C)
++#define ISPPRV_CSC_OFFSET (0x070)
++#define ISPPRV_CNT_BRT (0x074)
++#define ISPPRV_CSUP (0x078)
++#define ISPPRV_SETUP_YC (0x07C)
++#define ISPPRV_SET_TBL_ADDR (0x080)
++#define ISPPRV_SET_TBL_DATA (0x084)
++#define ISPPRV_CDC_THR0 (0x090)
++#define ISPPRV_CDC_THR1 (ISPPRV_CDC_THR0 + (0x4))
++#define ISPPRV_CDC_THR2 (ISPPRV_CDC_THR0 + (0x4) * 2)
++#define ISPPRV_CDC_THR3 (ISPPRV_CDC_THR0 + (0x4) * 3)
++
++#define ISPPRV_REDGAMMA_TABLE_ADDR 0x0000
++#define ISPPRV_GREENGAMMA_TABLE_ADDR 0x0400
++#define ISPPRV_BLUEGAMMA_TABLE_ADDR 0x0800
++#define ISPPRV_NF_TABLE_ADDR 0x0C00
++#define ISPPRV_YENH_TABLE_ADDR 0x1000
++#define ISPPRV_CFA_TABLE_ADDR 0x1400
++
++#define ISPPRV_MAXOUTPUT_WIDTH 1280
++#define ISPPRV_MAXOUTPUT_WIDTH_ES2 3300
++#define ISPRSZ_MIN_OUTPUT 64
++#define ISPRSZ_MAX_OUTPUT 3312
++
++/* Resizer module register offset */
++#define ISPRSZ_PID (0x000)
++#define ISPRSZ_PCR (0x004)
++#define ISPRSZ_CNT (0x008)
++#define ISPRSZ_OUT_SIZE (0x00C)
++#define ISPRSZ_IN_START (0x010)
++#define ISPRSZ_IN_SIZE (0x014)
++#define ISPRSZ_SDR_INADD (0x018)
++#define ISPRSZ_SDR_INOFF (0x01C)
++#define ISPRSZ_SDR_OUTADD (0x020)
++#define ISPRSZ_SDR_OUTOFF (0x024)
++#define ISPRSZ_HFILT10 (0x028)
++#define ISPRSZ_HFILT32 (0x02C)
++#define ISPRSZ_HFILT54 (0x030)
++#define ISPRSZ_HFILT76 (0x034)
++#define ISPRSZ_HFILT98 (0x038)
++#define ISPRSZ_HFILT1110 (0x03C)
++#define ISPRSZ_HFILT1312 (0x040)
++#define ISPRSZ_HFILT1514 (0x044)
++#define ISPRSZ_HFILT1716 (0x048)
++#define ISPRSZ_HFILT1918 (0x04C)
++#define ISPRSZ_HFILT2120 (0x050)
++#define ISPRSZ_HFILT2322 (0x054)
++#define ISPRSZ_HFILT2524 (0x058)
++#define ISPRSZ_HFILT2726 (0x05C)
++#define ISPRSZ_HFILT2928 (0x060)
++#define ISPRSZ_HFILT3130 (0x064)
++#define ISPRSZ_VFILT10 (0x068)
++#define ISPRSZ_VFILT32 (0x06C)
++#define ISPRSZ_VFILT54 (0x070)
++#define ISPRSZ_VFILT76 (0x074)
++#define ISPRSZ_VFILT98 (0x078)
++#define ISPRSZ_VFILT1110 (0x07C)
++#define ISPRSZ_VFILT1312 (0x080)
++#define ISPRSZ_VFILT1514 (0x084)
++#define ISPRSZ_VFILT1716 (0x088)
++#define ISPRSZ_VFILT1918 (0x08C)
++#define ISPRSZ_VFILT2120 (0x090)
++#define ISPRSZ_VFILT2322 (0x094)
++#define ISPRSZ_VFILT2524 (0x098)
++#define ISPRSZ_VFILT2726 (0x09C)
++#define ISPRSZ_VFILT2928 (0x0A0)
++#define ISPRSZ_VFILT3130 (0x0A4)
++#define ISPRSZ_YENH (0x0A8)
++
++/* MMU module registers */
++#define ISPMMU_REVISION (0x000)
++#define ISPMMU_SYSCONFIG (0x010)
++#define ISPMMU_SYSSTATUS (0x014)
++#define ISPMMU_IRQSTATUS (0x018)
++#define ISPMMU_IRQENABLE (0x01C)
++#define ISPMMU_WALKING_ST (0x040)
++#define ISPMMU_CNTL (0x044)
++#define ISPMMU_FAULT_AD (0x048)
++#define ISPMMU_TTB (0x04C)
++#define ISPMMU_LOCK (0x050)
++#define ISPMMU_LD_TLB (0x054)
++#define ISPMMU_CAM (0x058)
++#define ISPMMU_RAM (0x05C)
++#define ISPMMU_GFLUSH (0x060)
++#define ISPMMU_FLUSH_ENTRY (0x064)
++#define ISPMMU_READ_CAM (0x068)
++#define ISPMMU_READ_RAM (0x06c)
++#define ISPMMU_EMU_FAULT_AD (0x070)
++
++#define ISP_INT_CLR 0xFF113F11
++#define ISPPRV_PCR_EN 1
++#define ISPPRV_PCR_BUSY (1 << 1)
++#define ISPPRV_PCR_SOURCE (1 << 2)
++#define ISPPRV_PCR_ONESHOT (1 << 3)
++#define ISPPRV_PCR_WIDTH (1 << 4)
++#define ISPPRV_PCR_INVALAW (1 << 5)
++#define ISPPRV_PCR_DRKFEN (1 << 6)
++#define ISPPRV_PCR_DRKFCAP (1 << 7)
++#define ISPPRV_PCR_HMEDEN (1 << 8)
++#define ISPPRV_PCR_NFEN (1 << 9)
++#define ISPPRV_PCR_CFAEN (1 << 10)
++#define ISPPRV_PCR_CFAFMT_SHIFT 11
++#define ISPPRV_PCR_CFAFMT_MASK 0x7800
++#define ISPPRV_PCR_CFAFMT_BAYER (0 << 11)
++#define ISPPRV_PCR_CFAFMT_SONYVGA (1 << 11)
++#define ISPPRV_PCR_CFAFMT_RGBFOVEON (2 << 11)
++#define ISPPRV_PCR_CFAFMT_DNSPL (3 << 11)
++#define ISPPRV_PCR_CFAFMT_HONEYCOMB (4 << 11)
++#define ISPPRV_PCR_CFAFMT_RRGGBBFOVEON (5 << 11)
++#define ISPPRV_PCR_YNENHEN (1 << 15)
++#define ISPPRV_PCR_SUPEN (1 << 16)
++#define ISPPRV_PCR_YCPOS_SHIFT 17
++#define ISPPRV_PCR_YCPOS_YCrYCb (0 << 17)
++#define ISPPRV_PCR_YCPOS_YCbYCr (1 << 17)
++#define ISPPRV_PCR_YCPOS_CbYCrY (2 << 17)
++#define ISPPRV_PCR_YCPOS_CrYCbY (3 << 17)
++#define ISPPRV_PCR_RSZPORT (1 << 19)
++#define ISPPRV_PCR_SDRPORT (1 << 20)
++#define ISPPRV_PCR_SCOMP_EN (1 << 21)
++#define ISPPRV_PCR_SCOMP_SFT_SHIFT (22)
++#define ISPPRV_PCR_SCOMP_SFT_MASK (~(7 << 22))
++#define ISPPRV_PCR_GAMMA_BYPASS (1 << 26)
++#define ISPPRV_PCR_DCOREN (1 << 27)
++#define ISPPRV_PCR_DCCOUP (1 << 28)
++#define ISPPRV_PCR_DRK_FAIL (1 << 31)
++
++#define ISPPRV_HORZ_INFO_EPH_SHIFT 0
++#define ISPPRV_HORZ_INFO_EPH_MASK 0x3fff
++#define ISPPRV_HORZ_INFO_SPH_SHIFT 16
++#define ISPPRV_HORZ_INFO_SPH_MASK 0x3fff0
++
++#define ISPPRV_VERT_INFO_ELV_SHIFT 0
++#define ISPPRV_VERT_INFO_ELV_MASK 0x3fff
++#define ISPPRV_VERT_INFO_SLV_SHIFT 16
++#define ISPPRV_VERT_INFO_SLV_MASK 0x3fff0
++
++#define ISPPRV_AVE_EVENDIST_SHIFT 2
++#define ISPPRV_AVE_EVENDIST_1 0x0
++#define ISPPRV_AVE_EVENDIST_2 0x1
++#define ISPPRV_AVE_EVENDIST_3 0x2
++#define ISPPRV_AVE_EVENDIST_4 0x3
++#define ISPPRV_AVE_ODDDIST_SHIFT 4
++#define ISPPRV_AVE_ODDDIST_1 0x0
++#define ISPPRV_AVE_ODDDIST_2 0x1
++#define ISPPRV_AVE_ODDDIST_3 0x2
++#define ISPPRV_AVE_ODDDIST_4 0x3
++
++#define ISPPRV_HMED_THRESHOLD_SHIFT 0
++#define ISPPRV_HMED_EVENDIST (1 << 8)
++#define ISPPRV_HMED_ODDDIST (1 << 9)
++
++#define ISPPRV_WBGAIN_COEF0_SHIFT 0
++#define ISPPRV_WBGAIN_COEF1_SHIFT 8
++#define ISPPRV_WBGAIN_COEF2_SHIFT 16
++#define ISPPRV_WBGAIN_COEF3_SHIFT 24
++
++#define ISPPRV_WBSEL_COEF0 0x0
++#define ISPPRV_WBSEL_COEF1 0x1
++#define ISPPRV_WBSEL_COEF2 0x2
++#define ISPPRV_WBSEL_COEF3 0x3
++
++#define ISPPRV_WBSEL_N0_0_SHIFT 0
++#define ISPPRV_WBSEL_N0_1_SHIFT 2
++#define ISPPRV_WBSEL_N0_2_SHIFT 4
++#define ISPPRV_WBSEL_N0_3_SHIFT 6
++#define ISPPRV_WBSEL_N1_0_SHIFT 8
++#define ISPPRV_WBSEL_N1_1_SHIFT 10
++#define ISPPRV_WBSEL_N1_2_SHIFT 12
++#define ISPPRV_WBSEL_N1_3_SHIFT 14
++#define ISPPRV_WBSEL_N2_0_SHIFT 16
++#define ISPPRV_WBSEL_N2_1_SHIFT 18
++#define ISPPRV_WBSEL_N2_2_SHIFT 20
++#define ISPPRV_WBSEL_N2_3_SHIFT 22
++#define ISPPRV_WBSEL_N3_0_SHIFT 24
++#define ISPPRV_WBSEL_N3_1_SHIFT 26
++#define ISPPRV_WBSEL_N3_2_SHIFT 28
++#define ISPPRV_WBSEL_N3_3_SHIFT 30
++
++#define ISPPRV_CFA_GRADTH_HOR_SHIFT 0
++#define ISPPRV_CFA_GRADTH_VER_SHIFT 8
++
++#define ISPPRV_BLKADJOFF_B_SHIFT 0
++#define ISPPRV_BLKADJOFF_G_SHIFT 8
++#define ISPPRV_BLKADJOFF_R_SHIFT 16
++
++#define ISPPRV_RGB_MAT1_MTX_RR_SHIFT 0
++#define ISPPRV_RGB_MAT1_MTX_GR_SHIFT 16
++
++#define ISPPRV_RGB_MAT2_MTX_BR_SHIFT 0
++#define ISPPRV_RGB_MAT2_MTX_RG_SHIFT 16
++
++#define ISPPRV_RGB_MAT3_MTX_GG_SHIFT 0
++#define ISPPRV_RGB_MAT3_MTX_BG_SHIFT 16
++
++#define ISPPRV_RGB_MAT4_MTX_RB_SHIFT 0
++#define ISPPRV_RGB_MAT4_MTX_GB_SHIFT 16
++
++#define ISPPRV_RGB_MAT5_MTX_BB_SHIFT 0
++
++#define ISPPRV_RGB_OFF1_MTX_OFFG_SHIFT 0
++#define ISPPRV_RGB_OFF1_MTX_OFFR_SHIFT 16
++
++#define ISPPRV_RGB_OFF2_MTX_OFFB_SHIFT 0
++
++#define ISPPRV_CSC0_RY_SHIFT 0
++#define ISPPRV_CSC0_GY_SHIFT 10
++#define ISPPRV_CSC0_BY_SHIFT 20
++
++#define ISPPRV_CSC1_RCB_SHIFT 0
++#define ISPPRV_CSC1_GCB_SHIFT 10
++#define ISPPRV_CSC1_BCB_SHIFT 20
++
++#define ISPPRV_CSC2_RCR_SHIFT 0
++#define ISPPRV_CSC2_GCR_SHIFT 10
++#define ISPPRV_CSC2_BCR_SHIFT 20
++
++#define ISPPRV_CSC_OFFSET_CR_SHIFT 0
++#define ISPPRV_CSC_OFFSET_CB_SHIFT 8
++#define ISPPRV_CSC_OFFSET_Y_SHIFT 16
++
++#define ISPPRV_CNT_BRT_BRT_SHIFT 0
++#define ISPPRV_CNT_BRT_CNT_SHIFT 8
++
++#define ISPPRV_CONTRAST_MAX 0x10
++#define ISPPRV_CONTRAST_MIN 0xFF
++#define ISPPRV_BRIGHT_MIN 0x00
++#define ISPPRV_BRIGHT_MAX 0xFF
++
++#define ISPPRV_CSUP_CSUPG_SHIFT 0
++#define ISPPRV_CSUP_THRES_SHIFT 8
++#define ISPPRV_CSUP_HPYF_SHIFT 16
++
++#define ISPPRV_SETUP_YC_MINC_SHIFT 0
++#define ISPPRV_SETUP_YC_MAXC_SHIFT 8
++#define ISPPRV_SETUP_YC_MINY_SHIFT 16
++#define ISPPRV_SETUP_YC_MAXY_SHIFT 24
++#define ISPPRV_YC_MAX 0xFF
++#define ISPPRV_YC_MIN 0x0
++
++/* Define bit fields within selected registers */
++#define ISP_REVISION_SHIFT 0
++
++#define ISP_SYSCONFIG_AUTOIDLE 0
++#define ISP_SYSCONFIG_SOFTRESET (1 << 1)
++#define ISP_SYSCONFIG_MIDLEMODE_SHIFT 12
++#define ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY 0x0
++#define ISP_SYSCONFIG_MIDLEMODE_NOSTANBY 0x1
++#define ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY 0x2
++
++#define ISP_SYSSTATUS_RESETDONE 0
++
++#define IRQ0ENABLE_CSIA_IRQ 1
++#define IRQ0ENABLE_CSIA_LC1_IRQ (1 << 1)
++#define IRQ0ENABLE_CSIA_LC2_IRQ (1 << 2)
++#define IRQ0ENABLE_CSIA_LC3_IRQ (1 << 3)
++#define IRQ0ENABLE_CSIB_IRQ (1 << 4)
++#define IRQ0ENABLE_CSIB_LC1_IRQ (1 << 5)
++#define IRQ0ENABLE_CSIB_LC2_IRQ (1 << 6)
++#define IRQ0ENABLE_CSIB_LC3_IRQ (1 << 7)
++#define IRQ0ENABLE_CCDC_VD0_IRQ (1 << 8)
++#define IRQ0ENABLE_CCDC_VD1_IRQ (1 << 9)
++#define IRQ0ENABLE_CCDC_VD2_IRQ (1 << 10)
++#define IRQ0ENABLE_CCDC_ERR_IRQ (1 << 11)
++#define IRQ0ENABLE_H3A_AF_DONE_IRQ (1 << 12)
++#define IRQ0ENABLE_H3A_AWB_DONE_IRQ (1 << 13)
++#define IRQ0ENABLE_HIST_DONE_IRQ (1 << 16)
++#define IRQ0ENABLE_CCDC_LSC_DONE_IRQ (1 << 17)
++#define IRQ0ENABLE_CCDC_LSC_PREF_COMP_IRQ (1 << 18)
++#define IRQ0ENABLE_CCDC_LSC_PREF_ERR_IRQ (1 << 19)
++#define IRQ0ENABLE_PRV_DONE_IRQ (1 << 20)
++#define IRQ0ENABLE_RSZ_DONE_IRQ (1 << 24)
++#define IRQ0ENABLE_OVF_IRQ (1 << 25)
++#define IRQ0ENABLE_PING_IRQ (1 << 26)
++#define IRQ0ENABLE_PONG_IRQ (1 << 27)
++#define IRQ0ENABLE_MMU_ERR_IRQ (1 << 28)
++#define IRQ0ENABLE_OCP_ERR_IRQ (1 << 29)
++#define IRQ0ENABLE_SEC_ERR_IRQ (1 << 30)
++#define IRQ0ENABLE_HS_VS_IRQ (1 << 31)
++
++#define IRQ0STATUS_CSIA_IRQ 1
++#define IRQ0STATUS_CSIA_LC1_IRQ (1 << 1)
++#define IRQ0STATUS_CSIA_LC2_IRQ (1 << 2)
++#define IRQ0STATUS_CSIA_LC3_IRQ (1 << 3)
++#define IRQ0STATUS_CSIB_IRQ (1 << 4)
++#define IRQ0STATUS_CSIB_LC1_IRQ (1 << 5)
++#define IRQ0STATUS_CSIB_LC2_IRQ (1 << 6)
++#define IRQ0STATUS_CSIB_LC3_IRQ (1 << 7)
++#define IRQ0STATUS_CCDC_VD0_IRQ (1 << 8)
++#define IRQ0STATUS_CCDC_VD1_IRQ (1 << 9)
++#define IRQ0STATUS_CCDC_VD2_IRQ (1 << 10)
++#define IRQ0STATUS_CCDC_ERR_IRQ (1 << 11)
++#define IRQ0STATUS_H3A_AF_DONE_IRQ (1 << 12)
++#define IRQ0STATUS_H3A_AWB_DONE_IRQ (1 << 13)
++#define IRQ0STATUS_HIST_DONE_IRQ (1 << 16)
++#define IRQ0STATUS_PRV_DONE_IRQ (1 << 20)
++#define IRQ0STATUS_RSZ_DONE_IRQ (1 << 24)
++#define IRQ0STATUS_OVF_IRQ (1 << 25)
++#define IRQ0STATUS_PING_IRQ (1 << 26)
++#define IRQ0STATUS_PONG_IRQ (1 << 27)
++#define IRQ0STATUS_MMU_ERR_IRQ (1 << 28)
++#define IRQ0STATUS_OCP_ERR_IRQ (1 << 29)
++#define IRQ0STATUS_SEC_ERR_IRQ (1 << 30)
++#define IRQ0STATUS_HS_VS_IRQ (1 << 31)
++
++#define TCTRL_GRESET_LEN 0
++
++#define TCTRL_PSTRB_REPLAY_DELAY 0
++#define TCTRL_PSTRB_REPLAY_COUNTER_SHIFT 25
++
++#define ISPCTRL_PAR_SER_CLK_SEL_PARALLEL 0x0
++#define ISPCTRL_PAR_SER_CLK_SEL_CSIA 0x1
++#define ISPCTRL_PAR_SER_CLK_SEL_CSIB 0x2
++#define ISPCTRL_PAR_SER_CLK_SEL_MASK 0xFFFFFFFC
++
++#define ISPCTRL_PAR_BRIDGE_SHIFT 2
++#define ISPCTRL_PAR_BRIDGE_DISABLE (0x0 << 2)
++#define ISPCTRL_PAR_BRIDGE_LENDIAN (0x2 << 2)
++#define ISPCTRL_PAR_BRIDGE_BENDIAN (0x3 << 2)
++
++#define ISPCTRL_PAR_CLK_POL_SHIFT 4
++#define ISPCTRL_PAR_CLK_POL_INV (1 << 4)
++#define ISPCTRL_PING_PONG_EN (1 << 5)
++#define ISPCTRL_SHIFT_SHIFT 6
++#define ISPCTRL_SHIFT_0 (0x0 << 6)
++#define ISPCTRL_SHIFT_2 (0x1 << 6)
++#define ISPCTRL_SHIFT_4 (0x2 << 6)
++#define ISPCTRL_SHIFT_MASK (~(0x3 << 6))
++
++#define ISPCTRL_CCDC_CLK_EN (1 << 8)
++#define ISPCTRL_SCMP_CLK_EN (1 << 9)
++#define ISPCTRL_H3A_CLK_EN (1 << 10)
++#define ISPCTRL_HIST_CLK_EN (1 << 11)
++#define ISPCTRL_PREV_CLK_EN (1 << 12)
++#define ISPCTRL_RSZ_CLK_EN (1 << 13)
++#define ISPCTRL_SYNC_DETECT_SHIFT 14
++#define ISPCTRL_SYNC_DETECT_HSFALL (0x0 << ISPCTRL_SYNC_DETECT_SHIFT)
++#define ISPCTRL_SYNC_DETECT_HSRISE (0x1 << ISPCTRL_SYNC_DETECT_SHIFT)
++#define ISPCTRL_SYNC_DETECT_VSFALL (0x2 << ISPCTRL_SYNC_DETECT_SHIFT)
++#define ISPCTRL_SYNC_DETECT_VSRISE (0x3 << ISPCTRL_SYNC_DETECT_SHIFT)
++#define ISPCTRL_SYNC_DETECT_MASK (0x3 << ISPCTRL_SYNC_DETECT_SHIFT)
++
++#define ISPCTRL_CCDC_RAM_EN (1 << 16)
++#define ISPCTRL_PREV_RAM_EN (1 << 17)
++#define ISPCTRL_SBL_RD_RAM_EN (1 << 18)
++#define ISPCTRL_SBL_WR1_RAM_EN (1 << 19)
++#define ISPCTRL_SBL_WR0_RAM_EN (1 << 20)
++#define ISPCTRL_SBL_AUTOIDLE (1 << 21)
++#define ISPCTRL_SBL_SHARED_RPORTB (1 << 28)
++#define ISPCTRL_JPEG_FLUSH (1 << 30)
++#define ISPCTRL_CCDC_FLUSH (1 << 31)
++
++#define ISPSECURE_SECUREMODE 0
++
++#define ISPTCTRL_CTRL_DIV_LOW 0x0
++#define ISPTCTRL_CTRL_DIV_HIGH 0x1
++#define ISPTCTRL_CTRL_DIV_BYPASS 0x1F
++
++#define ISPTCTRL_CTRL_DIVA_SHIFT 0
++#define ISPTCTRL_CTRL_DIVA_MASK (0x1F << ISPTCTRL_CTRL_DIVA_SHIFT)
++
++#define ISPTCTRL_CTRL_DIVB_SHIFT 5
++#define ISPTCTRL_CTRL_DIVB_MASK (0x1F << ISPTCTRL_CTRL_DIVB_SHIFT)
++
++#define ISPTCTRL_CTRL_DIVC_SHIFT 10
++#define ISPTCTRL_CTRL_DIVC_NOCLOCK (0x0 << 10)
++
++#define ISPTCTRL_CTRL_SHUTEN (1 << 21)
++#define ISPTCTRL_CTRL_PSTRBEN (1 << 22)
++#define ISPTCTRL_CTRL_STRBEN (1 << 23)
++#define ISPTCTRL_CTRL_SHUTPOL (1 << 24)
++#define ISPTCTRL_CTRL_STRBPSTRBPOL (1 << 26)
++
++#define ISPTCTRL_CTRL_INSEL_SHIFT 27
++#define ISPTCTRL_CTRL_INSEL_PARALLEL (0x0 << 27)
++#define ISPTCTRL_CTRL_INSEL_CSIA (0x1 << 27)
++#define ISPTCTRL_CTRL_INSEL_CSIB (0x2 << 27)
++
++#define ISPTCTRL_CTRL_GRESETEn (1 << 29)
++#define ISPTCTRL_CTRL_GRESETPOL (1 << 30)
++#define ISPTCTRL_CTRL_GRESETDIR (1 << 31)
++
++#define ISPTCTRL_FRAME_SHUT_SHIFT 0
++#define ISPTCTRL_FRAME_PSTRB_SHIFT 6
++#define ISPTCTRL_FRAME_STRB_SHIFT 12
++
++#define ISPCCDC_PID_PREV_SHIFT 0
++#define ISPCCDC_PID_CID_SHIFT 8
++#define ISPCCDC_PID_TID_SHIFT 16
++
++#define ISPCCDC_PCR_EN 1
++#define ISPCCDC_PCR_BUSY (1 << 1)
++
++#define ISPCCDC_SYN_MODE_VDHDOUT 0x1
++#define ISPCCDC_SYN_MODE_FLDOUT (1 << 1)
++#define ISPCCDC_SYN_MODE_VDPOL (1 << 2)
++#define ISPCCDC_SYN_MODE_HDPOL (1 << 3)
++#define ISPCCDC_SYN_MODE_FLDPOL (1 << 4)
++#define ISPCCDC_SYN_MODE_EXWEN (1 << 5)
++#define ISPCCDC_SYN_MODE_DATAPOL (1 << 6)
++#define ISPCCDC_SYN_MODE_FLDMODE (1 << 7)
++#define ISPCCDC_SYN_MODE_DATSIZ_MASK 0xFFFFF8FF
++#define ISPCCDC_SYN_MODE_DATSIZ_8_16 (0x0 << 8)
++#define ISPCCDC_SYN_MODE_DATSIZ_12 (0x4 << 8)
++#define ISPCCDC_SYN_MODE_DATSIZ_11 (0x5 << 8)
++#define ISPCCDC_SYN_MODE_DATSIZ_10 (0x6 << 8)
++#define ISPCCDC_SYN_MODE_DATSIZ_8 (0x7 << 8)
++#define ISPCCDC_SYN_MODE_PACK8 (1 << 11)
++#define ISPCCDC_SYN_MODE_INPMOD_MASK 0xFFFFCFFF
++#define ISPCCDC_SYN_MODE_INPMOD_RAW (0 << 12)
++#define ISPCCDC_SYN_MODE_INPMOD_YCBCR16 (1 << 12)
++#define ISPCCDC_SYN_MODE_INPMOD_YCBCR8 (2 << 12)
++#define ISPCCDC_SYN_MODE_LPF (1 << 14)
++#define ISPCCDC_SYN_MODE_FLDSTAT (1 << 15)
++#define ISPCCDC_SYN_MODE_VDHDEN (1 << 16)
++#define ISPCCDC_SYN_MODE_WEN (1 << 17)
++#define ISPCCDC_SYN_MODE_VP2SDR (1 << 18)
++#define ISPCCDC_SYN_MODE_SDR2RSZ (1 << 19)
++
++#define ISPCCDC_HD_VD_WID_VDW_SHIFT 0
++#define ISPCCDC_HD_VD_WID_HDW_SHIFT 16
++
++#define ISPCCDC_PIX_LINES_HLPRF_SHIFT 0
++#define ISPCCDC_PIX_LINES_PPLN_SHIFT 16
++
++#define ISPCCDC_HORZ_INFO_NPH_SHIFT 0
++#define ISPCCDC_HORZ_INFO_NPH_MASK 0xFFFF8000
++#define ISPCCDC_HORZ_INFO_SPH_MASK 0x1000FFFF
++#define ISPCCDC_HORZ_INFO_SPH_SHIFT 16
++
++#define ISPCCDC_VERT_START_SLV0_SHIFT 16
++#define ISPCCDC_VERT_START_SLV0_MASK 0x1000FFFF
++#define ISPCCDC_VERT_START_SLV1_SHIFT 0
++
++#define ISPCCDC_VERT_LINES_NLV_MASK 0xFFFF8000
++#define ISPCCDC_VERT_LINES_NLV_SHIFT 0
++
++#define ISPCCDC_CULLING_CULV_SHIFT 0
++#define ISPCCDC_CULLING_CULHODD_SHIFT 16
++#define ISPCCDC_CULLING_CULHEVN_SHIFT 24
++
++#define ISPCCDC_HSIZE_OFF_SHIFT 0
++
++#define ISPCCDC_SDOFST_FINV (1 << 14)
++#define ISPCCDC_SDOFST_FOFST_1L 0
++#define ISPCCDC_SDOFST_FOFST_4L (3 << 12)
++#define ISPCCDC_SDOFST_LOFST3_SHIFT 0
++#define ISPCCDC_SDOFST_LOFST2_SHIFT 3
++#define ISPCCDC_SDOFST_LOFST1_SHIFT 6
++#define ISPCCDC_SDOFST_LOFST0_SHIFT 9
++#define EVENEVEN 1
++#define ODDEVEN 2
++#define EVENODD 3
++#define ODDODD 4
++
++#define ISPCCDC_CLAMP_OBGAIN_SHIFT 0
++#define ISPCCDC_CLAMP_OBST_SHIFT 10
++#define ISPCCDC_CLAMP_OBSLN_SHIFT 25
++#define ISPCCDC_CLAMP_OBSLEN_SHIFT 28
++#define ISPCCDC_CLAMP_CLAMPEN (1 << 31)
++
++#define ISPCCDC_COLPTN_R_Ye 0x0
++#define ISPCCDC_COLPTN_Gr_Cy 0x1
++#define ISPCCDC_COLPTN_Gb_G 0x2
++#define ISPCCDC_COLPTN_B_Mg 0x3
++#define ISPCCDC_COLPTN_CP0PLC0_SHIFT 0
++#define ISPCCDC_COLPTN_CP0PLC1_SHIFT 2
++#define ISPCCDC_COLPTN_CP0PLC2_SHIFT 4
++#define ISPCCDC_COLPTN_CP0PLC3_SHIFT 6
++#define ISPCCDC_COLPTN_CP1PLC0_SHIFT 8
++#define ISPCCDC_COLPTN_CP1PLC1_SHIFT 10
++#define ISPCCDC_COLPTN_CP1PLC2_SHIFT 12
++#define ISPCCDC_COLPTN_CP1PLC3_SHIFT 14
++#define ISPCCDC_COLPTN_CP2PLC0_SHIFT 16
++#define ISPCCDC_COLPTN_CP2PLC1_SHIFT 18
++#define ISPCCDC_COLPTN_CP2PLC2_SHIFT 20
++#define ISPCCDC_COLPTN_CP2PLC3_SHIFT 22
++#define ISPCCDC_COLPTN_CP3PLC0_SHIFT 24
++#define ISPCCDC_COLPTN_CP3PLC1_SHIFT 26
++#define ISPCCDC_COLPTN_CP3PLC2_SHIFT 28
++#define ISPCCDC_COLPTN_CP3PLC3_SHIFT 30
++
++#define ISPCCDC_BLKCMP_B_MG_SHIFT 0
++#define ISPCCDC_BLKCMP_GB_G_SHIFT 8
++#define ISPCCDC_BLKCMP_GR_CY_SHIFT 16
++#define ISPCCDC_BLKCMP_R_YE_SHIFT 24
++
++#define ISPCCDC_FPC_FPNUM_SHIFT 0
++#define ISPCCDC_FPC_FPCEN (1 << 15)
++#define ISPCCDC_FPC_FPERR (1 << 16)
++
++#define ISPCCDC_VDINT_1_SHIFT 0
++#define ISPCCDC_VDINT_0_SHIFT 16
++#define ISPCCDC_VDINT_0_MASK 0x7FFF
++#define ISPCCDC_VDINT_1_MASK 0x7FFF
++
++#define ISPCCDC_ALAW_GWDI_SHIFT 0
++#define ISPCCDC_ALAW_CCDTBL (1 << 3)
++
++#define ISPCCDC_REC656IF_R656ON 1
++#define ISPCCDC_REC656IF_ECCFVH (1 << 1)
++
++#define ISPCCDC_CFG_BW656 (1 << 5)
++#define ISPCCDC_CFG_FIDMD_SHIFT 6
++#define ISPCCDC_CFG_WENLOG (1 << 8)
++#define ISPCCDC_CFG_WENLOG_AND (0 << 8)
++#define ISPCCDC_CFG_WENLOG_OR (1 << 8)
++#define ISPCCDC_CFG_Y8POS (1 << 11)
++#define ISPCCDC_CFG_BSWD (1 << 12)
++#define ISPCCDC_CFG_MSBINVI (1 << 13)
++#define ISPCCDC_CFG_VDLC (1 << 15)
++
++#define ISPCCDC_FMTCFG_FMTEN 0x1
++#define ISPCCDC_FMTCFG_LNALT (1 << 1)
++#define ISPCCDC_FMTCFG_LNUM_SHIFT 2
++#define ISPCCDC_FMTCFG_PLEN_ODD_SHIFT 4
++#define ISPCCDC_FMTCFG_PLEN_EVEN_SHIFT 8
++#define ISPCCDC_FMTCFG_VPIN_MASK 0xFFFF8000
++#define ISPCCDC_FMTCFG_VPIN_12_3 (0x3 << 12)
++#define ISPCCDC_FMTCFG_VPIN_11_2 (0x4 << 12)
++#define ISPCCDC_FMTCFG_VPIN_10_1 (0x5 << 12)
++#define ISPCCDC_FMTCFG_VPIN_9_0 (0x6 << 12)
++#define ISPCCDC_FMTCFG_VPEN (1 << 15)
++
++#define ISPCCDC_FMTCF_VPIF_FRQ_MASK 0xFFF8FFFF
++#define ISPCCDC_FMTCF_VPIF_FRQ_BY2 (0x0 << 16)
++#define ISPCCDC_FMTCF_VPIF_FRQ_BY3 (0x1 << 16)
++#define ISPCCDC_FMTCF_VPIF_FRQ_BY4 (0x2 << 16)
++#define ISPCCDC_FMTCF_VPIF_FRQ_BY5 (0x3 << 16)
++#define ISPCCDC_FMTCF_VPIF_FRQ_BY6 (0x4 << 16)
++
++#define ISPCCDC_FMT_HORZ_FMTLNH_SHIFT 0
++#define ISPCCDC_FMT_HORZ_FMTSPH_SHIFT 16
++
++#define ISPCCDC_FMT_VERT_FMTLNV_SHIFT 0
++#define ISPCCDC_FMT_VERT_FMTSLV_SHIFT 16
++
++#define ISPCCDC_FMT_HORZ_FMTSPH_MASK 0x1FFF0000
++#define ISPCCDC_FMT_HORZ_FMTLNH_MASK 0x1FFF
++
++#define ISPCCDC_FMT_VERT_FMTSLV_MASK 0x1FFF0000
++#define ISPCCDC_FMT_VERT_FMTLNV_MASK 0x1FFF
++
++#define ISPCCDC_VP_OUT_HORZ_ST_SHIFT 0
++#define ISPCCDC_VP_OUT_HORZ_NUM_SHIFT 4
++#define ISPCCDC_VP_OUT_VERT_NUM_SHIFT 17
++
++#define ISPRSZ_PID_PREV_SHIFT 0
++#define ISPRSZ_PID_CID_SHIFT 8
++#define ISPRSZ_PID_TID_SHIFT 16
++
++#define ISPRSZ_PCR_ENABLE 0x5
++#define ISPRSZ_PCR_BUSY (1 << 1)
++
++#define ISPRSZ_CNT_HRSZ_SHIFT 0
++#define ISPRSZ_CNT_HRSZ_MASK 0x3FF
++#define ISPRSZ_CNT_VRSZ_SHIFT 10
++#define ISPRSZ_CNT_VRSZ_MASK 0xFFC00
++#define ISPRSZ_CNT_HSTPH_SHIFT 20
++#define ISPRSZ_CNT_HSTPH_MASK 0x700000
++#define ISPRSZ_CNT_VSTPH_SHIFT 23
++#define ISPRSZ_CNT_VSTPH_MASK 0x3800000
++#define ISPRSZ_CNT_CBILIN_MASK 0x20000000
++#define ISPRSZ_CNT_INPTYP_MASK 0x08000000
++#define ISPRSZ_CNT_PIXFMT_MASK 0x04000000
++#define ISPRSZ_CNT_YCPOS (1 << 26)
++#define ISPRSZ_CNT_INPTYP (1 << 27)
++#define ISPRSZ_CNT_INPSRC (1 << 28)
++#define ISPRSZ_CNT_CBILIN (1 << 29)
++
++#define ISPRSZ_OUT_SIZE_HORZ_SHIFT 0
++#define ISPRSZ_OUT_SIZE_HORZ_MASK 0x7FF
++#define ISPRSZ_OUT_SIZE_VERT_SHIFT 16
++#define ISPRSZ_OUT_SIZE_VERT_MASK 0x7FF0000
++
++
++#define ISPRSZ_IN_START_HORZ_ST_SHIFT 0
++#define ISPRSZ_IN_START_HORZ_ST_MASK 0x1FFF
++#define ISPRSZ_IN_START_VERT_ST_SHIFT 16
++#define ISPRSZ_IN_START_VERT_ST_MASK 0x1FFF0000
++
++
++#define ISPRSZ_IN_SIZE_HORZ_SHIFT 0
++#define ISPRSZ_IN_SIZE_HORZ_MASK 0x1FFF
++#define ISPRSZ_IN_SIZE_VERT_SHIFT 16
++#define ISPRSZ_IN_SIZE_VERT_MASK 0x1FFF0000
++
++#define ISPRSZ_SDR_INADD_ADDR_SHIFT 0
++#define ISPRSZ_SDR_INADD_ADDR_MASK 0xFFFFFFFF
++
++#define ISPRSZ_SDR_INOFF_OFFSET_SHIFT 0
++#define ISPRSZ_SDR_INOFF_OFFSET_MASK 0xFFFF
++
++#define ISPRSZ_SDR_OUTADD_ADDR_SHIFT 0
++#define ISPRSZ_SDR_OUTADD_ADDR_MASK 0xFFFFFFFF
++
++
++#define ISPRSZ_SDR_OUTOFF_OFFSET_SHIFT 0
++#define ISPRSZ_SDR_OUTOFF_OFFSET_MASK 0xFFFF
++
++#define ISPRSZ_HFILT10_COEF0_SHIFT 0
++#define ISPRSZ_HFILT10_COEF0_MASK 0x3FF
++#define ISPRSZ_HFILT10_COEF1_SHIFT 16
++#define ISPRSZ_HFILT10_COEF1_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT32_COEF2_SHIFT 0
++#define ISPRSZ_HFILT32_COEF2_MASK 0x3FF
++#define ISPRSZ_HFILT32_COEF3_SHIFT 16
++#define ISPRSZ_HFILT32_COEF3_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT54_COEF4_SHIFT 0
++#define ISPRSZ_HFILT54_COEF4_MASK 0x3FF
++#define ISPRSZ_HFILT54_COEF5_SHIFT 16
++#define ISPRSZ_HFILT54_COEF5_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT76_COEFF6_SHIFT 0
++#define ISPRSZ_HFILT76_COEFF6_MASK 0x3FF
++#define ISPRSZ_HFILT76_COEFF7_SHIFT 16
++#define ISPRSZ_HFILT76_COEFF7_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT98_COEFF8_SHIFT 0
++#define ISPRSZ_HFILT98_COEFF8_MASK 0x3FF
++#define ISPRSZ_HFILT98_COEFF9_SHIFT 16
++#define ISPRSZ_HFILT98_COEFF9_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT1110_COEF10_SHIFT 0
++#define ISPRSZ_HFILT1110_COEF10_MASK 0x3FF
++#define ISPRSZ_HFILT1110_COEF11_SHIFT 16
++#define ISPRSZ_HFILT1110_COEF11_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT1312_COEFF12_SHIFT 0
++#define ISPRSZ_HFILT1312_COEFF12_MASK 0x3FF
++#define ISPRSZ_HFILT1312_COEFF13_SHIFT 16
++#define ISPRSZ_HFILT1312_COEFF13_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT1514_COEFF14_SHIFT 0
++#define ISPRSZ_HFILT1514_COEFF14_MASK 0x3FF
++#define ISPRSZ_HFILT1514_COEFF15_SHIFT 16
++#define ISPRSZ_HFILT1514_COEFF15_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT1716_COEF16_SHIFT 0
++#define ISPRSZ_HFILT1716_COEF16_MASK 0x3FF
++#define ISPRSZ_HFILT1716_COEF17_SHIFT 16
++#define ISPRSZ_HFILT1716_COEF17_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT1918_COEF18_SHIFT 0
++#define ISPRSZ_HFILT1918_COEF18_MASK 0x3FF
++#define ISPRSZ_HFILT1918_COEF19_SHIFT 16
++#define ISPRSZ_HFILT1918_COEF19_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT2120_COEF20_SHIFT 0
++#define ISPRSZ_HFILT2120_COEF20_MASK 0x3FF
++#define ISPRSZ_HFILT2120_COEF21_SHIFT 16
++#define ISPRSZ_HFILT2120_COEF21_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT2322_COEF22_SHIFT 0
++#define ISPRSZ_HFILT2322_COEF22_MASK 0x3FF
++#define ISPRSZ_HFILT2322_COEF23_SHIFT 16
++#define ISPRSZ_HFILT2322_COEF23_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT2524_COEF24_SHIFT 0
++#define ISPRSZ_HFILT2524_COEF24_MASK 0x3FF
++#define ISPRSZ_HFILT2524_COEF25_SHIFT 16
++#define ISPRSZ_HFILT2524_COEF25_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT2726_COEF26_SHIFT 0
++#define ISPRSZ_HFILT2726_COEF26_MASK 0x3FF
++#define ISPRSZ_HFILT2726_COEF27_SHIFT 16
++#define ISPRSZ_HFILT2726_COEF27_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT2928_COEF28_SHIFT 0
++#define ISPRSZ_HFILT2928_COEF28_MASK 0x3FF
++#define ISPRSZ_HFILT2928_COEF29_SHIFT 16
++#define ISPRSZ_HFILT2928_COEF29_MASK 0x3FF0000
++
++#define ISPRSZ_HFILT3130_COEF30_SHIFT 0
++#define ISPRSZ_HFILT3130_COEF30_MASK 0x3FF
++#define ISPRSZ_HFILT3130_COEF31_SHIFT 16
++#define ISPRSZ_HFILT3130_COEF31_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT10_COEF0_SHIFT 0
++#define ISPRSZ_VFILT10_COEF0_MASK 0x3FF
++#define ISPRSZ_VFILT10_COEF1_SHIFT 16
++#define ISPRSZ_VFILT10_COEF1_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT32_COEF2_SHIFT 0
++#define ISPRSZ_VFILT32_COEF2_MASK 0x3FF
++#define ISPRSZ_VFILT32_COEF3_SHIFT 16
++#define ISPRSZ_VFILT32_COEF3_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT54_COEF4_SHIFT 0
++#define ISPRSZ_VFILT54_COEF4_MASK 0x3FF
++#define ISPRSZ_VFILT54_COEF5_SHIFT 16
++#define ISPRSZ_VFILT54_COEF5_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT76_COEFF6_SHIFT 0
++#define ISPRSZ_VFILT76_COEFF6_MASK 0x3FF
++#define ISPRSZ_VFILT76_COEFF7_SHIFT 16
++#define ISPRSZ_VFILT76_COEFF7_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT98_COEFF8_SHIFT 0
++#define ISPRSZ_VFILT98_COEFF8_MASK 0x3FF
++#define ISPRSZ_VFILT98_COEFF9_SHIFT 16
++#define ISPRSZ_VFILT98_COEFF9_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT1110_COEF10_SHIFT 0
++#define ISPRSZ_VFILT1110_COEF10_MASK 0x3FF
++#define ISPRSZ_VFILT1110_COEF11_SHIFT 16
++#define ISPRSZ_VFILT1110_COEF11_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT1312_COEFF12_SHIFT 0
++#define ISPRSZ_VFILT1312_COEFF12_MASK 0x3FF
++#define ISPRSZ_VFILT1312_COEFF13_SHIFT 16
++#define ISPRSZ_VFILT1312_COEFF13_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT1514_COEFF14_SHIFT 0
++#define ISPRSZ_VFILT1514_COEFF14_MASK 0x3FF
++#define ISPRSZ_VFILT1514_COEFF15_SHIFT 16
++#define ISPRSZ_VFILT1514_COEFF15_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT1716_COEF16_SHIFT 0
++#define ISPRSZ_VFILT1716_COEF16_MASK 0x3FF
++#define ISPRSZ_VFILT1716_COEF17_SHIFT 16
++#define ISPRSZ_VFILT1716_COEF17_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT1918_COEF18_SHIFT 0
++#define ISPRSZ_VFILT1918_COEF18_MASK 0x3FF
++#define ISPRSZ_VFILT1918_COEF19_SHIFT 16
++#define ISPRSZ_VFILT1918_COEF19_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT2120_COEF20_SHIFT 0
++#define ISPRSZ_VFILT2120_COEF20_MASK 0x3FF
++#define ISPRSZ_VFILT2120_COEF21_SHIFT 16
++#define ISPRSZ_VFILT2120_COEF21_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT2322_COEF22_SHIFT 0
++#define ISPRSZ_VFILT2322_COEF22_MASK 0x3FF
++#define ISPRSZ_VFILT2322_COEF23_SHIFT 16
++#define ISPRSZ_VFILT2322_COEF23_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT2524_COEF24_SHIFT 0
++#define ISPRSZ_VFILT2524_COEF24_MASK 0x3FF
++#define ISPRSZ_VFILT2524_COEF25_SHIFT 16
++#define ISPRSZ_VFILT2524_COEF25_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT2726_COEF26_SHIFT 0
++#define ISPRSZ_VFILT2726_COEF26_MASK 0x3FF
++#define ISPRSZ_VFILT2726_COEF27_SHIFT 16
++#define ISPRSZ_VFILT2726_COEF27_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT2928_COEF28_SHIFT 0
++#define ISPRSZ_VFILT2928_COEF28_MASK 0x3FF
++#define ISPRSZ_VFILT2928_COEF29_SHIFT 16
++#define ISPRSZ_VFILT2928_COEF29_MASK 0x3FF0000
++
++#define ISPRSZ_VFILT3130_COEF30_SHIFT 0
++#define ISPRSZ_VFILT3130_COEF30_MASK 0x3FF
++#define ISPRSZ_VFILT3130_COEF31_SHIFT 16
++#define ISPRSZ_VFILT3130_COEF31_MASK 0x3FF0000
++
++#define ISPRSZ_YENH_CORE_SHIFT 0
++#define ISPRSZ_YENH_CORE_MASK 0xFF
++#define ISPRSZ_YENH_SLOP_SHIFT 8
++#define ISPRSZ_YENH_SLOP_MASK 0xF00
++#define ISPRSZ_YENH_GAIN_SHIFT 12
++#define ISPRSZ_YENH_GAIN_MASK 0xF000
++#define ISPRSZ_YENH_ALGO_SHIFT 16
++#define ISPRSZ_YENH_ALGO_MASK 0x30000
++
++#define ISPH3A_PCR_AEW_ALAW_EN_SHIFT 1
++#define ISPH3A_PCR_AF_MED_TH_SHIFT 3
++#define ISPH3A_PCR_AF_RGBPOS_SHIFT 11
++#define ISPH3A_PCR_AEW_AVE2LMT_SHIFT 22
++#define ISPH3A_PCR_AEW_AVE2LMT_MASK 0xFFC00000
++#define ISPH3A_PCR_BUSYAF (1 << 15)
++#define ISPH3A_PCR_BUSYAEAWB (1 << 18)
++
++#define ISPH3A_AEWWIN1_WINHC_SHIFT 0
++#define ISPH3A_AEWWIN1_WINHC_MASK 0x3F
++#define ISPH3A_AEWWIN1_WINVC_SHIFT 6
++#define ISPH3A_AEWWIN1_WINVC_MASK 0x1FC0
++#define ISPH3A_AEWWIN1_WINW_SHIFT 13
++#define ISPH3A_AEWWIN1_WINW_MASK 0xFE000
++#define ISPH3A_AEWWIN1_WINH_SHIFT 24
++#define ISPH3A_AEWWIN1_WINH_MASK 0x7F000000
++
++#define ISPH3A_AEWINSTART_WINSH_SHIFT 0
++#define ISPH3A_AEWINSTART_WINSH_MASK 0x0FFF
++#define ISPH3A_AEWINSTART_WINSV_SHIFT 16
++#define ISPH3A_AEWINSTART_WINSV_MASK 0x0FFF0000
++
++#define ISPH3A_AEWINBLK_WINH_SHIFT 0
++#define ISPH3A_AEWINBLK_WINH_MASK 0x7F
++#define ISPH3A_AEWINBLK_WINSV_SHIFT 16
++#define ISPH3A_AEWINBLK_WINSV_MASK 0x0FFF0000
++
++#define ISPH3A_AEWSUBWIN_AEWINCH_SHIFT 0
++#define ISPH3A_AEWSUBWIN_AEWINCH_MASK 0x0F
++#define ISPH3A_AEWSUBWIN_AEWINCV_SHIFT 8
++#define ISPH3A_AEWSUBWIN_AEWINCV_MASK 0x0F00
++
++#define ISPHIST_PCR_ENABLE_SHIFT 0
++#define ISPHIST_PCR_ENABLE_MASK 0x01
++#define ISPHIST_PCR_BUSY 0x02
++
++#define ISPHIST_CNT_DATASIZE_SHIFT 8
++#define ISPHIST_CNT_DATASIZE_MASK 0x0100
++#define ISPHIST_CNT_CLEAR_SHIFT 7
++#define ISPHIST_CNT_CLEAR_MASK 0x080
++#define ISPHIST_CNT_CFA_SHIFT 6
++#define ISPHIST_CNT_CFA_MASK 0x040
++#define ISPHIST_CNT_BINS_SHIFT 4
++#define ISPHIST_CNT_BINS_MASK 0x030
++#define ISPHIST_CNT_SOURCE_SHIFT 3
++#define ISPHIST_CNT_SOURCE_MASK 0x08
++#define ISPHIST_CNT_SHIFT_SHIFT 0
++#define ISPHIST_CNT_SHIFT_MASK 0x07
++
++#define ISPHIST_WB_GAIN_WG00_SHIFT 24
++#define ISPHIST_WB_GAIN_WG00_MASK 0xFF000000
++#define ISPHIST_WB_GAIN_WG01_SHIFT 16
++#define ISPHIST_WB_GAIN_WG01_MASK 0xFF0000
++#define ISPHIST_WB_GAIN_WG02_SHIFT 8
++#define ISPHIST_WB_GAIN_WG02_MASK 0xFF00
++#define ISPHIST_WB_GAIN_WG03_SHIFT 0
++#define ISPHIST_WB_GAIN_WG03_MASK 0xFF
++
++#define ISPHIST_REGHORIZ_HSTART_SHIFT 16 /*
++ * REGION 0 to 3 HORZ
++ * and VERT
++ */
++#define ISPHIST_REGHORIZ_HSTART_MASK 0x3FFF0000
++#define ISPHIST_REGHORIZ_HEND_SHIFT 0
++#define ISPHIST_REGHORIZ_HEND_MASK 0x3FFF
++#define ISPHIST_REGVERT_VSTART_SHIFT 16
++#define ISPHIST_REGVERT_VSTART_MASK 0x3FFF0000
++#define ISPHIST_REGVERT_VEND_SHIFT 0
++#define ISPHIST_REGVERT_VEND_MASK 0x3FFF
++
++#define ISPHIST_REGHORIZ_MASK 0x3FFF3FFF
++#define ISPHIST_REGVERT_MASK 0x3FFF3FFF
++
++#define ISPHIST_ADDR_SHIFT 0
++#define ISPHIST_ADDR_MASK 0x3FF
++
++#define ISPHIST_DATA_SHIFT 0
++#define ISPHIST_DATA_MASK 0xFFFFF
++
++#define ISPHIST_RADD_SHIFT 0
++#define ISPHIST_RADD_MASK 0xFFFFFFFF
++
++#define ISPHIST_RADD_OFF_SHIFT 0
++#define ISPHIST_RADD_OFF_MASK 0xFFFF
++
++#define ISPHIST_HV_INFO_HSIZE_SHIFT 16
++#define ISPHIST_HV_INFO_HSIZE_MASK 0x3FFF0000
++#define ISPHIST_HV_INFO_VSIZE_SHIFT 0
++#define ISPHIST_HV_INFO_VSIZE_MASK 0x3FFF
++
++#define ISPHIST_HV_INFO_MASK 0x3FFF3FFF
++
++#define ISPCCDC_LSC_GAIN_MODE_N_MASK 0x700
++#define ISPCCDC_LSC_GAIN_MODE_N_SHIFT 8
++#define ISPCCDC_LSC_GAIN_MODE_M_MASK 0x3800
++#define ISPCCDC_LSC_GAIN_MODE_M_SHIFT 12
++#define ISPCCDC_LSC_GAIN_FORMAT_MASK 0xE
++#define ISPCCDC_LSC_GAIN_FORMAT_SHIFT 1
++#define ISPCCDC_LSC_AFTER_REFORMATTER_MASK (1<<6)
++
++#define ISPCCDC_LSC_INITIAL_X_MASK 0x3F
++#define ISPCCDC_LSC_INITIAL_X_SHIFT 0
++#define ISPCCDC_LSC_INITIAL_Y_MASK 0x3F0000
++#define ISPCCDC_LSC_INITIAL_Y_SHIFT 16
++
++#define ISPMMU_REVISION_REV_MINOR_MASK 0xF
++#define ISPMMU_REVISION_REV_MAJOR_SHIFT 0x4
++
++#define IRQENABLE_MULTIHITFAULT (1<<4)
++#define IRQENABLE_TWFAULT (1<<3)
++#define IRQENABLE_EMUMISS (1<<2)
++#define IRQENABLE_TRANSLNFAULT (1<<1)
++#define IRQENABLE_TLBMISS (1)
++
++#define ISPMMU_MMUCNTL_MMU_EN (1<<1)
++#define ISPMMU_MMUCNTL_TWL_EN (1<<2)
++#define ISPMMU_MMUCNTL_EMUTLBUPDATE (1<<3)
++#define ISPMMU_AUTOIDLE 0x1
++#define ISPMMU_SIDLEMODE_FORCEIDLE 0
++#define ISPMMU_SIDLEMODE_NOIDLE 1
++#define ISPMMU_SIDLEMODE_SMARTIDLE 2
++#define ISPMMU_SIDLEMODE_SHIFT 3
++
++#define ISPCSI1_AUTOIDLE 0x1
++#define ISPCSI1_MIDLEMODE_SHIFT 12
++#define ISPCSI1_MIDLEMODE_FORCESTANDBY 0x0
++#define ISPCSI1_MIDLEMODE_NOSTANDBY 0x1
++#define ISPCSI1_MIDLEMODE_SMARTSTANDBY 0x2
++
++/* CSI2 receiver registers (ES2.0) */
++#define ISPCSI2_REVISION (0x000)
++#define ISPCSI2_SYSCONFIG (0x010)
++#define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT 12
++#define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_MASK \
++ (0x3 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
++#define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_FORCE \
++ (0x0 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
++#define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_NO \
++ (0x1 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
++#define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SMART \
++ (0x2 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
++#define ISPCSI2_SYSCONFIG_SOFT_RESET_SHIFT 1
++#define ISPCSI2_SYSCONFIG_SOFT_RESET_MASK \
++ (0x1 << ISPCSI2_SYSCONFIG_SOFT_RESET_SHIFT)
++#define ISPCSI2_SYSCONFIG_SOFT_RESET_NORMAL \
++ (0x0 << ISPCSI2_SYSCONFIG_SOFT_RESET_SHIFT)
++#define ISPCSI2_SYSCONFIG_SOFT_RESET_RESET \
++ (0x1 << ISPCSI2_SYSCONFIG_SOFT_RESET_SHIFT)
++#define ISPCSI2_SYSCONFIG_AUTO_IDLE_SHIFT 0
++#define ISPCSI2_SYSCONFIG_AUTO_IDLE_MASK \
++ (0x1 << ISPCSI2_SYSCONFIG_AUTO_IDLE_SHIFT)
++#define ISPCSI2_SYSCONFIG_AUTO_IDLE_FREE \
++ (0x0 << ISPCSI2_SYSCONFIG_AUTO_IDLE_SHIFT)
++#define ISPCSI2_SYSCONFIG_AUTO_IDLE_AUTO \
++ (0x1 << ISPCSI2_SYSCONFIG_AUTO_IDLE_SHIFT)
++#define ISPCSI2_SYSSTATUS (0x014)
++#define ISPCSI2_SYSSTATUS_RESET_DONE_SHIFT 0
++#define ISPCSI2_SYSSTATUS_RESET_DONE_MASK \
++ (0x1 << ISPCSI2_SYSSTATUS_RESET_DONE_SHIFT)
++#define ISPCSI2_SYSSTATUS_RESET_DONE_ONGOING \
++ (0x0 << ISPCSI2_SYSSTATUS_RESET_DONE_SHIFT)
++#define ISPCSI2_SYSSTATUS_RESET_DONE_DONE \
++ (0x1 << ISPCSI2_SYSSTATUS_RESET_DONE_SHIFT)
++#define ISPCSI2_IRQSTATUS (0x018)
++#define ISPCSI2_IRQSTATUS_OCP_ERR_IRQ (1 << 14)
++#define ISPCSI2_IRQSTATUS_SHORT_PACKET_IRQ (1 << 13)
++#define ISPCSI2_IRQSTATUS_ECC_CORRECTION_IRQ (1 << 12)
++#define ISPCSI2_IRQSTATUS_ECC_NO_CORRECTION_IRQ (1 << 11)
++#define ISPCSI2_IRQSTATUS_COMPLEXIO2_ERR_IRQ (1 << 10)
++#define ISPCSI2_IRQSTATUS_COMPLEXIO1_ERR_IRQ (1 << 9)
++#define ISPCSI2_IRQSTATUS_FIFO_OVF_IRQ (1 << 8)
++#define ISPCSI2_IRQSTATUS_CONTEXT(n) (1 << (n))
++
++#define ISPCSI2_IRQENABLE (0x01C)
++#define ISPCSI2_CTRL (0x040)
++#define ISPCSI2_CTRL_VP_CLK_EN_SHIFT 15
++#define ISPCSI2_CTRL_VP_CLK_EN_MASK (0x1 << ISPCSI2_CTRL_VP_CLK_EN_SHIFT)
++#define ISPCSI2_CTRL_VP_CLK_EN_DISABLE (0x0 << ISPCSI2_CTRL_VP_CLK_EN_SHIFT)
++#define ISPCSI2_CTRL_VP_CLK_EN_ENABLE (0x1 << ISPCSI2_CTRL_VP_CLK_EN_SHIFT)
++
++#define ISPCSI2_CTRL_VP_ONLY_EN_SHIFT 11
++#define ISPCSI2_CTRL_VP_ONLY_EN_MASK (0x1 << ISPCSI2_CTRL_VP_ONLY_EN_SHIFT)
++#define ISPCSI2_CTRL_VP_ONLY_EN_DISABLE (0x0 << ISPCSI2_CTRL_VP_ONLY_EN_SHIFT)
++#define ISPCSI2_CTRL_VP_ONLY_EN_ENABLE (0x1 << ISPCSI2_CTRL_VP_ONLY_EN_SHIFT)
++
++#define ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT 8
++#define ISPCSI2_CTRL_VP_OUT_CTRL_MASK (0x3 << \
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
++#define ISPCSI2_CTRL_VP_OUT_CTRL_DISABLE (0x0 << \
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
++#define ISPCSI2_CTRL_VP_OUT_CTRL_DIV2 (0x1 << \
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
++#define ISPCSI2_CTRL_VP_OUT_CTRL_DIV3 (0x2 << \
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
++#define ISPCSI2_CTRL_VP_OUT_CTRL_DIV4 (0x3 << \
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
++
++#define ISPCSI2_CTRL_DBG_EN_SHIFT 7
++#define ISPCSI2_CTRL_DBG_EN_MASK (0x1 << ISPCSI2_CTRL_DBG_EN_SHIFT)
++#define ISPCSI2_CTRL_DBG_EN_DISABLE (0x0 << ISPCSI2_CTRL_DBG_EN_SHIFT)
++#define ISPCSI2_CTRL_DBG_EN_ENABLE (0x1 << ISPCSI2_CTRL_DBG_EN_SHIFT)
++
++#define ISPCSI2_CTRL_BURST_SIZE_SHIFT 5
++#define ISPCSI2_CTRL_BURST_SIZE_MASK (0x3 << \
++ ISPCSI2_CTRL_BURST_SIZE_SHIFT)
++#define ISPCSI2_CTRL_BURST_SIZE_MYSTERY_VAL (0x2 << \
++ ISPCSI2_CTRL_BURST_SIZE_SHIFT)
++
++#define ISPCSI2_CTRL_FRAME_SHIFT 3
++#define ISPCSI2_CTRL_FRAME_MASK (0x1 << ISPCSI2_CTRL_FRAME_SHIFT)
++#define ISPCSI2_CTRL_FRAME_DISABLE_IMM (0x0 << ISPCSI2_CTRL_FRAME_SHIFT)
++#define ISPCSI2_CTRL_FRAME_DISABLE_FEC (0x1 << ISPCSI2_CTRL_FRAME_SHIFT)
++
++#define ISPCSI2_CTRL_ECC_EN_SHIFT 2
++#define ISPCSI2_CTRL_ECC_EN_MASK (0x1 << ISPCSI2_CTRL_ECC_EN_SHIFT)
++#define ISPCSI2_CTRL_ECC_EN_DISABLE (0x0 << ISPCSI2_CTRL_ECC_EN_SHIFT)
++#define ISPCSI2_CTRL_ECC_EN_ENABLE (0x1 << ISPCSI2_CTRL_ECC_EN_SHIFT)
++
++#define ISPCSI2_CTRL_SECURE_SHIFT 1
++#define ISPCSI2_CTRL_SECURE_MASK (0x1 << ISPCSI2_CTRL_SECURE_SHIFT)
++#define ISPCSI2_CTRL_SECURE_DISABLE (0x0 << ISPCSI2_CTRL_SECURE_SHIFT)
++#define ISPCSI2_CTRL_SECURE_ENABLE (0x1 << ISPCSI2_CTRL_SECURE_SHIFT)
++
++#define ISPCSI2_CTRL_IF_EN_SHIFT 0
++#define ISPCSI2_CTRL_IF_EN_MASK (0x1 << ISPCSI2_CTRL_IF_EN_SHIFT)
++#define ISPCSI2_CTRL_IF_EN_DISABLE (0x0 << ISPCSI2_CTRL_IF_EN_SHIFT)
++#define ISPCSI2_CTRL_IF_EN_ENABLE (0x1 << ISPCSI2_CTRL_IF_EN_SHIFT)
++
++#define ISPCSI2_DBG_H (0x044)
++#define ISPCSI2_GNQ (0x048)
++#define ISPCSI2_COMPLEXIO_CFG1 (0x050)
++#define ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_SHIFT 29
++#define ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_MASK \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_ONGOING \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_DONE \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_RESET_DONE_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_SHIFT 27
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_MASK \
++ (0x3 << ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_OFF \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_ON \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_ULPW \
++ (0x2 << ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_SHIFT 25
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_MASK \
++ (0x3 << ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_OFF \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_ON \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_ULPW \
++ (0x2 << ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_SHIFT 24
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_MASK \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_DISABLE \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_ENABLE \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_SHIFT)
++
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(n) (3 + ((n) * 4))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POL_MASK(n) \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POL_PN(n) \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POL_NP(n) \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(n))
++
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n) ((n) * 4)
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_MASK(n) \
++ (0x7 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_NC(n) \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_1(n) \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_2(n) \
++ (0x2 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_3(n) \
++ (0x3 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_4(n) \
++ (0x4 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++#define ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_5(n) \
++ (0x5 << ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(n))
++
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT 3
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_MASK \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_PN \
++ (0x0 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_NP \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT)
++
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT 0
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_MASK \
++ (0x7 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_1 \
++ (0x1 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_2 \
++ (0x2 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_3 \
++ (0x3 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_4 \
++ (0x4 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++#define ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_5 \
++ (0x5 << ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT)
++
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS (0x054)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEALLULPMEXIT (1 << 26)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEALLULPMENTER (1 << 25)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEULPM5 (1 << 24)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEULPM4 (1 << 23)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEULPM3 (1 << 22)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEULPM2 (1 << 21)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_STATEULPM1 (1 << 20)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRCONTROL5 (1 << 19)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRCONTROL4 (1 << 18)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRCONTROL3 (1 << 17)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRCONTROL2 (1 << 16)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRCONTROL1 (1 << 15)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRESC5 (1 << 14)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRESC4 (1 << 13)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRESC3 (1 << 12)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRESC2 (1 << 11)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRESC1 (1 << 10)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTSYNCHS5 (1 << 9)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTSYNCHS4 (1 << 8)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTSYNCHS3 (1 << 7)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTSYNCHS2 (1 << 6)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTSYNCHS1 (1 << 5)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTHS5 (1 << 4)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTHS4 (1 << 3)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTHS3 (1 << 2)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTHS2 (1 << 1)
++#define ISPCSI2_COMPLEXIO1_IRQSTATUS_ERRSOTHS1 1
++
++#define ISPCSI2_SHORT_PACKET (0x05C)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE (0x060)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEALLULPMEXIT (1 << 26)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEALLULPMENTER (1 << 25)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM5 (1 << 24)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM4 (1 << 23)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM3 (1 << 22)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM2 (1 << 21)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM1 (1 << 20)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL5 (1 << 19)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL4 (1 << 18)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL3 (1 << 17)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL2 (1 << 16)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL1 (1 << 15)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC5 (1 << 14)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC4 (1 << 13)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC3 (1 << 12)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC2 (1 << 11)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC1 (1 << 10)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS5 (1 << 9)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS4 (1 << 8)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS3 (1 << 7)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS2 (1 << 6)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS1 (1 << 5)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS5 (1 << 4)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS4 (1 << 3)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS3 (1 << 2)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS2 (1 << 1)
++#define ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS1 1
++#define ISPCSI2_DBG_P (0x068)
++#define ISPCSI2_TIMING (0x06C)
++
++
++#define ISPCSI2_TIMING_FORCE_RX_MODE_IO_SHIFT(n) \
++ ((16 * ((n) - 1)) + 15)
++#define ISPCSI2_TIMING_FORCE_RX_MODE_IO_MASK(n) \
++ (0x1 << ISPCSI2_TIMING_FORCE_RX_MODE_IO_SHIFT(n))
++#define ISPCSI2_TIMING_FORCE_RX_MODE_IO_DISABLE(n) \
++ (0x0 << ISPCSI2_TIMING_FORCE_RX_MODE_IO_SHIFT(n))
++#define ISPCSI2_TIMING_FORCE_RX_MODE_IO_ENABLE(n) \
++ (0x1 << ISPCSI2_TIMING_FORCE_RX_MODE_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X16_IO_SHIFT(n) ((16 * ((n) - 1)) + 14)
++#define ISPCSI2_TIMING_STOP_STATE_X16_IO_MASK(n) \
++ (0x1 << ISPCSI2_TIMING_STOP_STATE_X16_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X16_IO_DISABLE(n) \
++ (0x0 << ISPCSI2_TIMING_STOP_STATE_X16_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X16_IO_ENABLE(n) \
++ (0x1 << ISPCSI2_TIMING_STOP_STATE_X16_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X4_IO_SHIFT(n) ((16 * ((n) - 1)) + 13)
++#define ISPCSI2_TIMING_STOP_STATE_X4_IO_MASK(n) \
++ (0x1 << ISPCSI2_TIMING_STOP_STATE_X4_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X4_IO_DISABLE(n) \
++ (0x0 << ISPCSI2_TIMING_STOP_STATE_X4_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_X4_IO_ENABLE(n) \
++ (0x1 << ISPCSI2_TIMING_STOP_STATE_X4_IO_SHIFT(n))
++#define ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(n) (16 * ((n) - 1))
++#define ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_MASK(n) \
++ (0x1fff << ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(n))
++
++#define ISPCSI2_CTX_CTRL1(n) ((0x070) + 0x20 * (n))
++#define ISPCSI2_CTX_CTRL1_COUNT_SHIFT 8
++#define ISPCSI2_CTX_CTRL1_COUNT_MASK (0xFF << \
++ ISPCSI2_CTX_CTRL1_COUNT_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOF_EN_SHIFT 7
++#define ISPCSI2_CTX_CTRL1_EOF_EN_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_EOF_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOF_EN_DISABLE \
++ (0x0 << ISPCSI2_CTX_CTRL1_EOF_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOF_EN_ENABLE \
++ (0x1 << ISPCSI2_CTX_CTRL1_EOF_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOL_EN_SHIFT 6
++#define ISPCSI2_CTX_CTRL1_EOL_EN_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_EOL_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOL_EN_DISABLE \
++ (0x0 << ISPCSI2_CTX_CTRL1_EOL_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_EOL_EN_ENABLE \
++ (0x1 << ISPCSI2_CTX_CTRL1_EOL_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CS_EN_SHIFT 5
++#define ISPCSI2_CTX_CTRL1_CS_EN_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_CS_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CS_EN_DISABLE \
++ (0x0 << ISPCSI2_CTX_CTRL1_CS_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CS_EN_ENABLE \
++ (0x1 << ISPCSI2_CTX_CTRL1_CS_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_SHIFT 4
++#define ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_DISABLE \
++ (0x0 << ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_ENABLE \
++ (0x1 << ISPCSI2_CTX_CTRL1_COUNT_UNLOCK_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_PING_PONG_SHIFT 3
++#define ISPCSI2_CTX_CTRL1_PING_PONG_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_PING_PONG_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CTX_EN_SHIFT 0
++#define ISPCSI2_CTX_CTRL1_CTX_EN_MASK \
++ (0x1 << ISPCSI2_CTX_CTRL1_CTX_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CTX_EN_DISABLE \
++ (0x0 << ISPCSI2_CTX_CTRL1_CTX_EN_SHIFT)
++#define ISPCSI2_CTX_CTRL1_CTX_EN_ENABLE \
++ (0x1 << ISPCSI2_CTX_CTRL1_CTX_EN_SHIFT)
++
++#define ISPCSI2_CTX_CTRL2(n) ((0x074) + 0x20 * (n))
++#define ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT 11
++#define ISPCSI2_CTX_CTRL2_VIRTUAL_ID_MASK \
++ (0x3 << ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT)
++#define ISPCSI2_CTX_CTRL2_FORMAT_SHIFT 0
++#define ISPCSI2_CTX_CTRL2_FORMAT_MASK (0x3FF << \
++ ISPCSI2_CTX_CTRL2_FORMAT_SHIFT)
++
++#define ISPCSI2_CTX_DAT_OFST(n) ((0x078) + 0x20 * (n))
++#define ISPCSI2_CTX_DAT_OFST_OFST_SHIFT 5
++#define ISPCSI2_CTX_DAT_OFST_OFST_MASK (0x7FF << \
++ ISPCSI2_CTX_DAT_OFST_OFST_SHIFT)
++
++#define ISPCSI2_CTX_DAT_PING_ADDR(n) ((0x07C) + 0x20 * (n))
++#define ISPCSI2_CTX_DAT_PONG_ADDR(n) ((0x080) + 0x20 * (n))
++#define ISPCSI2_CTX_IRQENABLE(n) ((0x084) + 0x20 * (n))
++#define ISPCSI2_CTX_IRQENABLE_ECC_CORRECTION_IRQ (1 << 8)
++#define ISPCSI2_CTX_IRQENABLE_LINE_NUMBER_IRQ (1 << 7)
++#define ISPCSI2_CTX_IRQENABLE_FRAME_NUMBER_IRQ (1 << 6)
++#define ISPCSI2_CTX_IRQENABLE_CS_IRQ (1 << 5)
++#define ISPCSI2_CTX_IRQENABLE_LE_IRQ (1 << 3)
++#define ISPCSI2_CTX_IRQENABLE_LS_IRQ (1 << 2)
++#define ISPCSI2_CTX_IRQENABLE_FE_IRQ (1 << 1)
++#define ISPCSI2_CTX_IRQENABLE_FS_IRQ 1
++#define ISPCSI2_CTX_IRQSTATUS(n) ((0x088) + 0x20 * (n))
++#define ISPCSI2_CTX_IRQSTATUS_ECC_CORRECTION_IRQ (1 << 8)
++#define ISPCSI2_CTX_IRQSTATUS_LINE_NUMBER_IRQ (1 << 7)
++#define ISPCSI2_CTX_IRQSTATUS_FRAME_NUMBER_IRQ (1 << 6)
++#define ISPCSI2_CTX_IRQSTATUS_CS_IRQ (1 << 5)
++#define ISPCSI2_CTX_IRQSTATUS_LE_IRQ (1 << 3)
++#define ISPCSI2_CTX_IRQSTATUS_LS_IRQ (1 << 2)
++#define ISPCSI2_CTX_IRQSTATUS_FE_IRQ (1 << 1)
++#define ISPCSI2_CTX_IRQSTATUS_FS_IRQ 1
++
++#define ISPCSI2_CTX_CTRL3(n) ((0x08C) + 0x20 * (n))
++#define ISPCSI2_CTX_CTRL3_ALPHA_SHIFT 5
++#define ISPCSI2_CTX_CTRL3_ALPHA_MASK (0x3FFF << \
++ ISPCSI2_CTX_CTRL3_ALPHA_SHIFT)
++
++#define ISPCSI2PHY_CFG0 (0x000)
++#define ISPCSI2PHY_CFG0_THS_TERM_SHIFT 8
++#define ISPCSI2PHY_CFG0_THS_TERM_MASK \
++ (0xFF << ISPCSI2PHY_CFG0_THS_TERM_SHIFT)
++#define ISPCSI2PHY_CFG0_THS_TERM_RESETVAL \
++ (0x04 << ISPCSI2PHY_CFG0_THS_TERM_SHIFT)
++#define ISPCSI2PHY_CFG0_THS_SETTLE_SHIFT 0
++#define ISPCSI2PHY_CFG0_THS_SETTLE_MASK \
++ (0xFF << ISPCSI2PHY_CFG0_THS_SETTLE_SHIFT)
++#define ISPCSI2PHY_CFG0_THS_SETTLE_RESETVAL \
++ (0x27 << ISPCSI2PHY_CFG0_THS_SETTLE_SHIFT)
++#define ISPCSI2PHY_CFG1 (0x004)
++#define ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT 18
++#define ISPCSI2PHY_CFG1_TCLK_TERM_MASK \
++ (0x7F << ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT)
++#define ISPCSI2PHY_CFG1_TCLK_TERM__RESETVAL \
++ (0x00 << ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT)
++#define ISPCSI2PHY_CFG1_RESERVED1_SHIFT 10
++#define ISPCSI2PHY_CFG1_RESERVED1_MASK \
++ (0xFF << ISPCSI2PHY_CFG1_RESERVED1_SHIFT)
++#define ISPCSI2PHY_CFG1_RESERVED1__RESETVAL \
++ (0xB8 << ISPCSI2PHY_CFG1_RESERVED1_SHIFT)
++#define ISPCSI2PHY_CFG1_TCLK_MISS_SHIFT 8
++#define ISPCSI2PHY_CFG1_TCLK_MISS_MASK \
++ (0x3 << ISPCSI2PHY_CFG1_TCLK_MISS_SHIFT)
++#define ISPCSI2PHY_CFG1_TCLK_MISS__RESETVAL \
++ (0x1 << ISPCSI2PHY_CFG1_TCLK_MISS_SHIFT)
++#define ISPCSI2PHY_CFG1_TCLK_SETTLE_SHIFT 0
++#define ISPCSI2PHY_CFG1_TCLK_SETTLE_MASK \
++ (0xFF << ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT)
++#define ISPCSI2PHY_CFG1_TCLK_SETTLE__RESETVAL \
++ (0x0E << ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT)
++#define ISPCSI2PHY_CFG1__RESETVAL (ISPCSI2PHY_CFG1_TCLK_TERM__RESETVAL | \
++ ISPCSI2PHY_CFG1_RESERVED1__RESETVAL | \
++ ISPCSI2PHY_CFG1_TCLK_MISS__RESETVAL | \
++ ISPCSI2PHY_CFG1_TCLK_SETTLE__RESETVAL)
++#define ISPCSI2PHY_CFG1__EDITABLE_MASK (ISPCSI2PHY_CFG1_TCLK_TERM_MASK | \
++ ISPCSI2PHY_CFG1_RESERVED1_MASK | \
++ ISPCSI2PHY_CFG1_TCLK_MISS_MASK | \
++ ISPCSI2PHY_CFG1_TCLK_SETTLE_MASK)
++
++#endif /* __ISPREG_H__ */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0002-omap3isp-Add-ISP-MMU-wrapper.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0002-omap3isp-Add-ISP-MMU-wrapper.patch
new file mode 100644
index 0000000000..cfca26723a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0002-omap3isp-Add-ISP-MMU-wrapper.patch
@@ -0,0 +1,209 @@
+From 731527a7dc26533a878c7c5f36fc148fdcaa21b8 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add ISP MMU wrapper
+
+TODO:
+
+- The ISP driver should start using the IOMMU directly without this wrapper.
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/ispmmu.c | 141 ++++++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/ispmmu.h | 36 ++++++++++
+ 2 files changed, 177 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/ispmmu.c
+ create mode 100644 drivers/media/video/isp/ispmmu.h
+
+diff --git a/drivers/media/video/isp/ispmmu.c b/drivers/media/video/isp/ispmmu.c
+new file mode 100644
+index 0000000..f872c71
+--- /dev/null
++++ b/drivers/media/video/isp/ispmmu.c
+@@ -0,0 +1,141 @@
++/*
++ * omap iommu wrapper for TI's OMAP3430 Camera ISP
++ *
++ * Copyright (C) 2008--2009 Nokia.
++ *
++ * Contributors:
++ * Hiroshi Doyu <hiroshi.doyu@nokia.com>
++ * Sakari Ailus <sakari.ailus@nokia.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/module.h>
++
++#include "ispmmu.h"
++#include "isp.h"
++
++#include <mach/iommu.h>
++#include <mach/iovmm.h>
++
++#define IOMMU_FLAG (IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_8)
++
++static struct iommu *isp_iommu;
++
++dma_addr_t ispmmu_vmalloc(size_t bytes)
++{
++ return (dma_addr_t)iommu_vmalloc(isp_iommu, 0, bytes, IOMMU_FLAG);
++}
++
++void ispmmu_vfree(const dma_addr_t da)
++{
++ iommu_vfree(isp_iommu, (u32)da);
++}
++
++dma_addr_t ispmmu_kmap(u32 pa, int size)
++{
++ void *da;
++
++ da = (void *)iommu_kmap(isp_iommu, 0, pa, size, IOMMU_FLAG);
++ if (IS_ERR(da))
++ return PTR_ERR(da);
++
++ return (dma_addr_t)da;
++}
++
++void ispmmu_kunmap(dma_addr_t da)
++{
++ iommu_kunmap(isp_iommu, (u32)da);
++}
++
++dma_addr_t ispmmu_vmap(const struct scatterlist *sglist,
++ int sglen)
++{
++ int err;
++ void *da;
++ struct sg_table *sgt;
++ unsigned int i;
++ struct scatterlist *sg, *src = (struct scatterlist *)sglist;
++
++ /*
++ * convert isp sglist to iommu sgt
++ * FIXME: should be fixed in the upper layer?
++ */
++ sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
++ if (!sgt)
++ return -ENOMEM;
++ err = sg_alloc_table(sgt, sglen, GFP_KERNEL);
++ if (err)
++ goto err_sg_alloc;
++
++ for_each_sg(sgt->sgl, sg, sgt->nents, i)
++ sg_set_buf(sg, phys_to_virt(sg_dma_address(src + i)),
++ sg_dma_len(src + i));
++
++ da = (void *)iommu_vmap(isp_iommu, 0, sgt, IOMMU_FLAG);
++ if (IS_ERR(da))
++ goto err_vmap;
++
++ return (dma_addr_t)da;
++
++err_vmap:
++ sg_free_table(sgt);
++err_sg_alloc:
++ kfree(sgt);
++ return -ENOMEM;
++}
++EXPORT_SYMBOL_GPL(ispmmu_vmap);
++
++void ispmmu_vunmap(dma_addr_t da)
++{
++ struct sg_table *sgt;
++
++ sgt = iommu_vunmap(isp_iommu, (u32)da);
++ if (!sgt)
++ return;
++ sg_free_table(sgt);
++ kfree(sgt);
++}
++EXPORT_SYMBOL_GPL(ispmmu_vunmap);
++
++void ispmmu_save_context(void)
++{
++ if (isp_iommu)
++ iommu_save_ctx(isp_iommu);
++}
++
++void ispmmu_restore_context(void)
++{
++ if (isp_iommu)
++ iommu_restore_ctx(isp_iommu);
++}
++
++int __init ispmmu_init(void)
++{
++ int err = 0;
++
++ isp_get();
++ isp_iommu = iommu_get("isp");
++ if (IS_ERR(isp_iommu)) {
++ err = PTR_ERR(isp_iommu);
++ isp_iommu = NULL;
++ }
++ isp_put();
++
++ return err;
++}
++
++void ispmmu_cleanup(void)
++{
++ isp_get();
++ if (isp_iommu)
++ iommu_put(isp_iommu);
++ isp_put();
++ isp_iommu = NULL;
++}
+diff --git a/drivers/media/video/isp/ispmmu.h b/drivers/media/video/isp/ispmmu.h
+new file mode 100644
+index 0000000..0bc5bcb
+--- /dev/null
++++ b/drivers/media/video/isp/ispmmu.h
+@@ -0,0 +1,36 @@
++/*
++ * omap iommu wrapper for TI's OMAP3430 Camera ISP
++ *
++ * Copyright (C) 2008--2009 Nokia.
++ *
++ * Contributors:
++ * Hiroshi Doyu <hiroshi.doyu@nokia.com>
++ * Sakari Ailus <sakari.ailus@nokia.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_MMU_H
++#define OMAP_ISP_MMU_H
++
++#include <linux/err.h>
++#include <linux/scatterlist.h>
++
++dma_addr_t ispmmu_vmalloc(size_t bytes);
++void ispmmu_vfree(const dma_addr_t da);
++dma_addr_t ispmmu_kmap(u32 pa, int size);
++void ispmmu_kunmap(dma_addr_t da);
++dma_addr_t ispmmu_vmap(const struct scatterlist *sglist, int sglen);
++void ispmmu_vunmap(dma_addr_t da);
++void ispmmu_save_context(void);
++void ispmmu_restore_context(void);
++int ispmmu_init(void);
++void ispmmu_cleanup(void);
++
++#endif /* OMAP_ISP_MMU_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch
new file mode 100644
index 0000000000..66c171f544
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch
@@ -0,0 +1,696 @@
+From 98ca1ef8c6e2561989aeef981131cf5077eab1d1 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add userspace header
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ arch/arm/plat-omap/include/mach/isp_user.h | 676 ++++++++++++++++++++++++++++
+ 1 files changed, 676 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/plat-omap/include/mach/isp_user.h
+
+diff --git a/arch/arm/plat-omap/include/mach/isp_user.h b/arch/arm/plat-omap/include/mach/isp_user.h
+new file mode 100644
+index 0000000..b819e26
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/isp_user.h
+@@ -0,0 +1,676 @@
++/*
++ * isp_user.h
++ *
++ * Include file for OMAP ISP module in TI's OMAP3.
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Mohit Jalori <mjalori@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_USER_H
++#define OMAP_ISP_USER_H
++
++/* ISP Private IOCTLs */
++#define VIDIOC_PRIVATE_ISP_CCDC_CFG \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct ispccdc_update_config)
++#define VIDIOC_PRIVATE_ISP_PRV_CFG \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct ispprv_update_config)
++#define VIDIOC_PRIVATE_ISP_AEWB_CFG \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct isph3a_aewb_config)
++#define VIDIOC_PRIVATE_ISP_AEWB_REQ \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct isph3a_aewb_data)
++#define VIDIOC_PRIVATE_ISP_HIST_CFG \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct isp_hist_config)
++#define VIDIOC_PRIVATE_ISP_HIST_REQ \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct isp_hist_data)
++#define VIDIOC_PRIVATE_ISP_AF_CFG \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct af_configuration)
++#define VIDIOC_PRIVATE_ISP_AF_REQ \
++ _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct isp_af_data)
++
++/* AE/AWB related structures and flags*/
++
++/* Flags for update field */
++#define REQUEST_STATISTICS (1 << 0)
++#define SET_COLOR_GAINS (1 << 1)
++#define SET_DIGITAL_GAIN (1 << 2)
++#define SET_EXPOSURE (1 << 3)
++#define SET_ANALOG_GAIN (1 << 4)
++
++#define MAX_FRAME_COUNT 0x0FFF
++#define MAX_FUTURE_FRAMES 10
++
++#define MAX_SATURATION_LIM 1023
++#define MIN_WIN_H 2
++#define MAX_WIN_H 256
++#define MIN_WIN_W 6
++#define MAX_WIN_W 256
++#define MAX_WINVC 128
++#define MAX_WINHC 36
++#define MAX_WINSTART 4095
++#define MIN_SUB_INC 2
++#define MAX_SUB_INC 32
++
++/* Range Constants */
++#define AF_IIRSH_MIN 0
++#define AF_IIRSH_MAX 4094
++#define AF_PAXEL_HORIZONTAL_COUNT_MIN 0
++#define AF_PAXEL_HORIZONTAL_COUNT_MAX 35
++#define AF_PAXEL_VERTICAL_COUNT_MIN 0
++#define AF_PAXEL_VERTICAL_COUNT_MAX 127
++#define AF_PAXEL_INCREMENT_MIN 0
++#define AF_PAXEL_INCREMENT_MAX 14
++#define AF_PAXEL_HEIGHT_MIN 0
++#define AF_PAXEL_HEIGHT_MAX 127
++#define AF_PAXEL_WIDTH_MIN 0
++#define AF_PAXEL_WIDTH_MAX 127
++#define AF_PAXEL_HZSTART_MIN 2
++#define AF_PAXEL_HZSTART_MAX 4094
++
++#define AF_PAXEL_VTSTART_MIN 0
++#define AF_PAXEL_VTSTART_MAX 4095
++#define AF_THRESHOLD_MAX 255
++#define AF_COEF_MAX 4095
++#define AF_PAXEL_SIZE 48
++
++/**
++ * struct isph3a_aewb_config - AE AWB configuration reset values.
++ * saturation_limit: Saturation limit.
++ * @win_height: Window Height. Range 2 - 256, even values only.
++ * @win_width: Window Width. Range 6 - 256, even values only.
++ * @ver_win_count: Vertical Window Count. Range 1 - 128.
++ * @hor_win_count: Horizontal Window Count. Range 1 - 36.
++ * @ver_win_start: Vertical Window Start. Range 0 - 4095.
++ * @hor_win_start: Horizontal Window Start. Range 0 - 4095.
++ * @blk_ver_win_start: Black Vertical Windows Start. Range 0 - 4095.
++ * @blk_win_height: Black Window Height. Range 2 - 256, even values only.
++ * @subsample_ver_inc: Subsample Vertical points increment Range 2 - 32, even
++ * values only.
++ * @subsample_hor_inc: Subsample Horizontal points increment Range 2 - 32, even
++ * values only.
++ * @alaw_enable: AEW ALAW EN flag.
++ * @aewb_enable: AE AWB stats generation EN flag.
++ */
++struct isph3a_aewb_config {
++ __u16 saturation_limit;
++ __u16 win_height;
++ __u16 win_width;
++ __u16 ver_win_count;
++ __u16 hor_win_count;
++ __u16 ver_win_start;
++ __u16 hor_win_start;
++ __u16 blk_ver_win_start;
++ __u16 blk_win_height;
++ __u16 subsample_ver_inc;
++ __u16 subsample_hor_inc;
++ __u8 alaw_enable;
++ __u8 aewb_enable;
++};
++
++/**
++ * struct isph3a_aewb_data - Structure of data sent to or received from user
++ * @h3a_aewb_statistics_buf: Pointer to pass to user.
++ * @shutter: Shutter speed.
++ * @gain: Sensor analog Gain.
++ * @shutter_cap: Shutter speed for capture.
++ * @gain_cap: Sensor Gain for capture.
++ * @dgain: White balance digital gain.
++ * @wb_gain_b: White balance color gain blue.
++ * @wb_gain_r: White balance color gain red.
++ * @wb_gain_gb: White balance color gain green blue.
++ * @wb_gain_gr: White balance color gain green red.
++ * @frame_number: Frame number of requested stats.
++ * @curr_frame: Current frame number being processed.
++ * @update: Bitwise flags to update parameters.
++ * @ts: Timestamp of returned framestats.
++ * @field_count: Sequence number of returned framestats.
++ */
++struct isph3a_aewb_data {
++ void *h3a_aewb_statistics_buf;
++ __u32 shutter;
++ __u16 gain;
++ __u32 shutter_cap;
++ __u16 gain_cap;
++ __u16 dgain;
++ __u16 wb_gain_b;
++ __u16 wb_gain_r;
++ __u16 wb_gain_gb;
++ __u16 wb_gain_gr;
++ __u16 frame_number;
++ __u16 curr_frame;
++ __u8 update;
++ struct timeval ts;
++ __u32 config_counter;
++ unsigned long field_count;
++};
++
++
++/* Histogram related structs */
++/* Flags for number of bins */
++#define BINS_32 0x0
++#define BINS_64 0x1
++#define BINS_128 0x2
++#define BINS_256 0x3
++
++struct isp_hist_config {
++ __u8 hist_source; /* CCDC or Memory */
++ __u8 input_bit_width; /* Needed o know the size per pixel */
++ __u8 hist_frames; /* Num of frames to be processed and
++ * accumulated
++ */
++ __u8 hist_h_v_info; /* frame-input width and height if source is
++ * memory
++ */
++ __u16 hist_radd; /* frame-input address in memory */
++ __u16 hist_radd_off; /* line-offset for frame-input */
++ __u16 hist_bins; /* number of bins: 32, 64, 128, or 256 */
++ __u16 wb_gain_R; /* White Balance Field-to-Pattern Assignments */
++ __u16 wb_gain_RG; /* White Balance Field-to-Pattern Assignments */
++ __u16 wb_gain_B; /* White Balance Field-to-Pattern Assignments */
++ __u16 wb_gain_BG; /* White Balance Field-to-Pattern Assignments */
++ __u8 num_regions; /* number of regions to be configured */
++ __u16 reg0_hor; /* Region 0 size and position */
++ __u16 reg0_ver; /* Region 0 size and position */
++ __u16 reg1_hor; /* Region 1 size and position */
++ __u16 reg1_ver; /* Region 1 size and position */
++ __u16 reg2_hor; /* Region 2 size and position */
++ __u16 reg2_ver; /* Region 2 size and position */
++ __u16 reg3_hor; /* Region 3 size and position */
++ __u16 reg3_ver; /* Region 3 size and position */
++};
++
++struct isp_hist_data {
++ __u32 *hist_statistics_buf; /* Pointer to pass to user */
++};
++
++/* Auto Focus related structs */
++
++#define AF_NUMBER_OF_COEF 11
++
++/* Flags for update field */
++#define REQUEST_STATISTICS (1 << 0)
++#define LENS_DESIRED_POSITION (1 << 1)
++#define LENS_CURRENT_POSITION (1 << 2)
++
++/**
++ * struct isp_af_xtrastats - Extra statistics related to AF generated stats.
++ * @ts: Timestamp when the frame gets delivered to the user.
++ * @field_count: Field count of the frame delivered to the user.
++ * @lens_position: Lens position when the stats are being generated.
++ */
++struct isp_af_xtrastats {
++ struct timeval ts;
++ unsigned long field_count;
++ __u16 lens_position; /* deprecated */
++};
++
++/**
++ * struct isp_af_data - AF statistics data to transfer between driver and user.
++ * @af_statistics_buf: Pointer to pass to user.
++ * @lens_current_position: Read value of lens absolute position.
++ * @desired_lens_direction: Lens desired location.
++ * @update: Bitwise flags to update parameters.
++ * @frame_number: Data for which frame is desired/given.
++ * @curr_frame: Current frame number being processed by AF module.
++ * @xtrastats: Extra statistics structure.
++ */
++struct isp_af_data {
++ void *af_statistics_buf;
++ __u16 lens_current_position; /* deprecated */
++ __u16 desired_lens_direction; /* deprecated */
++ __u16 update;
++ __u16 frame_number;
++ __u16 curr_frame;
++ __u32 config_counter;
++ struct isp_af_xtrastats xtrastats;
++};
++
++/* enum used for status of specific feature */
++enum af_alaw_enable {
++ H3A_AF_ALAW_DISABLE = 0,
++ H3A_AF_ALAW_ENABLE = 1
++};
++
++enum af_hmf_enable {
++ H3A_AF_HMF_DISABLE = 0,
++ H3A_AF_HMF_ENABLE = 1
++};
++
++enum af_config_flag {
++ H3A_AF_CFG_DISABLE = 0,
++ H3A_AF_CFG_ENABLE = 1
++};
++
++enum af_mode {
++ ACCUMULATOR_SUMMED = 0,
++ ACCUMULATOR_PEAK = 1
++};
++
++/* Red, Green, and blue pixel location in the AF windows */
++enum rgbpos {
++ GR_GB_BAYER = 0, /* GR and GB as Bayer pattern */
++ RG_GB_BAYER = 1, /* RG and GB as Bayer pattern */
++ GR_BG_BAYER = 2, /* GR and BG as Bayer pattern */
++ RG_BG_BAYER = 3, /* RG and BG as Bayer pattern */
++ GG_RB_CUSTOM = 4, /* GG and RB as custom pattern */
++ RB_GG_CUSTOM = 5 /* RB and GG as custom pattern */
++};
++
++/* Contains the information regarding the Horizontal Median Filter */
++struct af_hmf {
++ enum af_hmf_enable enable; /* Status of Horizontal Median Filter */
++ unsigned int threshold; /* Threshhold Value for Horizontal Median
++ * Filter
++ */
++};
++
++/* Contains the information regarding the IIR Filters */
++struct af_iir {
++ unsigned int hz_start_pos; /* IIR Start Register Value */
++ int coeff_set0[AF_NUMBER_OF_COEF]; /*
++ * IIR Filter Coefficient for
++ * Set 0
++ */
++ int coeff_set1[AF_NUMBER_OF_COEF]; /*
++ * IIR Filter Coefficient for
++ * Set 1
++ */
++};
++
++/* Contains the information regarding the Paxels Structure in AF Engine */
++struct af_paxel {
++ unsigned int width; /* Width of the Paxel */
++ unsigned int height; /* Height of the Paxel */
++ unsigned int hz_start; /* Horizontal Start Position */
++ unsigned int vt_start; /* Vertical Start Position */
++ unsigned int hz_cnt; /* Horizontal Count */
++ unsigned int vt_cnt; /* vertical Count */
++ unsigned int line_incr; /* Line Increment */
++};
++/* Contains the parameters required for hardware set up of AF Engine */
++struct af_configuration {
++ enum af_alaw_enable alaw_enable; /*ALWAW status */
++ struct af_hmf hmf_config; /*HMF configurations */
++ enum rgbpos rgb_pos; /*RGB Positions */
++ struct af_iir iir_config; /*IIR filter configurations */
++ struct af_paxel paxel_config; /*Paxel parameters */
++ enum af_mode mode; /*Accumulator mode */
++ enum af_config_flag af_config; /*Flag indicates Engine is configured */
++};
++
++/* ISP CCDC structs */
++
++/* Abstraction layer CCDC configurations */
++#define ISP_ABS_CCDC_ALAW (1 << 0)
++#define ISP_ABS_CCDC_LPF (1 << 1)
++#define ISP_ABS_CCDC_BLCLAMP (1 << 2)
++#define ISP_ABS_CCDC_BCOMP (1 << 3)
++#define ISP_ABS_CCDC_FPC (1 << 4)
++#define ISP_ABS_CCDC_CULL (1 << 5)
++#define ISP_ABS_CCDC_COLPTN (1 << 6)
++#define ISP_ABS_CCDC_CONFIG_LSC (1 << 7)
++#define ISP_ABS_TBL_LSC (1 << 8)
++
++#define RGB_MAX 3
++
++/* Enumeration constants for Alaw input width */
++enum alaw_ipwidth {
++ ALAW_BIT12_3 = 0x3,
++ ALAW_BIT11_2 = 0x4,
++ ALAW_BIT10_1 = 0x5,
++ ALAW_BIT9_0 = 0x6
++};
++
++/* Enumeration constants for Video Port */
++enum vpin {
++ BIT12_3 = 3,
++ BIT11_2 = 4,
++ BIT10_1 = 5,
++ BIT9_0 = 6
++};
++
++enum vpif_freq {
++ PIXCLKBY2,
++ PIXCLKBY3_5,
++ PIXCLKBY4_5,
++ PIXCLKBY5_5,
++ PIXCLKBY6_5
++};
++
++/**
++ * struct ispccdc_lsc_config - Structure for LSC configuration.
++ * @offset: Table Offset of the gain table.
++ * @gain_mode_n: Vertical dimension of a paxel in LSC configuration.
++ * @gain_mode_m: Horizontal dimension of a paxel in LSC configuration.
++ * @gain_format: Gain table format.
++ * @fmtsph: Start pixel horizontal from start of the HS sync pulse.
++ * @fmtlnh: Number of pixels in horizontal direction to use for the data
++ * reformatter.
++ * @fmtslv: Start line from start of VS sync pulse for the data reformatter.
++ * @fmtlnv: Number of lines in vertical direction for the data reformatter.
++ * @initial_x: X position, in pixels, of the first active pixel in reference
++ * to the first active paxel. Must be an even number.
++ * @initial_y: Y position, in pixels, of the first active pixel in reference
++ * to the first active paxel. Must be an even number.
++ * @size: Size of LSC gain table. Filled when loaded from userspace.
++ */
++struct ispccdc_lsc_config {
++ __u16 offset;
++ __u8 gain_mode_n;
++ __u8 gain_mode_m;
++ __u8 gain_format;
++ __u16 fmtsph;
++ __u16 fmtlnh;
++ __u16 fmtslv;
++ __u16 fmtlnv;
++ __u8 initial_x;
++ __u8 initial_y;
++ __u32 size;
++};
++
++/**
++ * struct ispccdc_bclamp - Structure for Optical & Digital black clamp subtract
++ * @obgain: Optical black average gain.
++ * @obstpixel: Start Pixel w.r.t. HS pulse in Optical black sample.
++ * @oblines: Optical Black Sample lines.
++ * @oblen: Optical Black Sample Length.
++ * @dcsubval: Digital Black Clamp subtract value.
++ */
++struct ispccdc_bclamp {
++ __u8 obgain;
++ __u8 obstpixel;
++ __u8 oblines;
++ __u8 oblen;
++ __u16 dcsubval;
++};
++
++/**
++ * ispccdc_fpc - Structure for FPC
++ * @fpnum: Number of faulty pixels to be corrected in the frame.
++ * @fpcaddr: Memory address of the FPC Table
++ */
++struct ispccdc_fpc {
++ __u16 fpnum;
++ __u32 fpcaddr;
++};
++
++/**
++ * ispccdc_blcomp - Structure for Black Level Compensation parameters.
++ * @b_mg: B/Mg pixels. 2's complement. -128 to +127.
++ * @gb_g: Gb/G pixels. 2's complement. -128 to +127.
++ * @gr_cy: Gr/Cy pixels. 2's complement. -128 to +127.
++ * @r_ye: R/Ye pixels. 2's complement. -128 to +127.
++ */
++struct ispccdc_blcomp {
++ __u8 b_mg;
++ __u8 gb_g;
++ __u8 gr_cy;
++ __u8 r_ye;
++};
++
++/**
++ * struct ispccdc_vp - Structure for Video Port parameters
++ * @bitshift_sel: Video port input select. 3 - bits 12-3, 4 - bits 11-2,
++ * 5 - bits 10-1, 6 - bits 9-0.
++ * @freq_sel: Video port data ready frequency. 1 - 1/3.5, 2 - 1/4.5,
++ * 3 - 1/5.5, 4 - 1/6.5.
++ */
++struct ispccdc_vp {
++ enum vpin bitshift_sel;
++ enum vpif_freq freq_sel;
++};
++
++/**
++ * ispccdc_culling - Structure for Culling parameters.
++ * @v_pattern: Vertical culling pattern.
++ * @h_odd: Horizontal Culling pattern for odd lines.
++ * @h_even: Horizontal Culling pattern for even lines.
++ */
++struct ispccdc_culling {
++ __u8 v_pattern;
++ __u16 h_odd;
++ __u16 h_even;
++};
++
++/**
++ * ispccdc_update_config - Structure for CCDC configuration.
++ * @update: Specifies which CCDC registers should be updated.
++ * @flag: Specifies which CCDC functions should be enabled.
++ * @alawip: Enable/Disable A-Law compression.
++ * @bclamp: Black clamp control register.
++ * @blcomp: Black level compensation value for RGrGbB Pixels. 2's complement.
++ * @fpc: Number of faulty pixels corrected in the frame, address of FPC table.
++ * @cull: Cull control register.
++ * @colptn: Color pattern of the sensor.
++ * @lsc: Pointer to LSC gain table.
++ */
++struct ispccdc_update_config {
++ __u16 update;
++ __u16 flag;
++ enum alaw_ipwidth alawip;
++ struct ispccdc_bclamp *bclamp;
++ struct ispccdc_blcomp *blcomp;
++ struct ispccdc_fpc *fpc;
++ struct ispccdc_lsc_config *lsc_cfg;
++ struct ispccdc_culling *cull;
++ __u32 colptn;
++ __u8 *lsc;
++};
++
++/* Preview configuration */
++
++/*Abstraction layer preview configurations*/
++#define ISP_ABS_PREV_LUMAENH (1 << 0)
++#define ISP_ABS_PREV_INVALAW (1 << 1)
++#define ISP_ABS_PREV_HRZ_MED (1 << 2)
++#define ISP_ABS_PREV_CFA (1 << 3)
++#define ISP_ABS_PREV_CHROMA_SUPP (1 << 4)
++#define ISP_ABS_PREV_WB (1 << 5)
++#define ISP_ABS_PREV_BLKADJ (1 << 6)
++#define ISP_ABS_PREV_RGB2RGB (1 << 7)
++#define ISP_ABS_PREV_COLOR_CONV (1 << 8)
++#define ISP_ABS_PREV_YC_LIMIT (1 << 9)
++#define ISP_ABS_PREV_DEFECT_COR (1 << 10)
++#define ISP_ABS_PREV_GAMMABYPASS (1 << 11)
++#define ISP_ABS_TBL_NF (1 << 12)
++#define ISP_ABS_TBL_REDGAMMA (1 << 13)
++#define ISP_ABS_TBL_GREENGAMMA (1 << 14)
++#define ISP_ABS_TBL_BLUEGAMMA (1 << 15)
++
++#define ISPPRV_NF_TBL_SIZE 64
++#define ISPPRV_CFA_TBL_SIZE 576
++#define ISPPRV_GAMMA_TBL_SIZE 1024
++#define ISPPRV_YENH_TBL_SIZE 128
++
++/**
++ * struct ispprev_hmed - Structure for Horizontal Median Filter.
++ * @odddist: Distance between consecutive pixels of same color in the odd line.
++ * @evendist: Distance between consecutive pixels of same color in the even
++ * line.
++ * @thres: Horizontal median filter threshold.
++ */
++struct ispprev_hmed {
++ __u8 odddist;
++ __u8 evendist;
++ __u8 thres;
++};
++
++/*
++ * Enumeration for CFA Formats supported by preview
++ */
++enum cfa_fmt {
++ CFAFMT_BAYER, CFAFMT_SONYVGA, CFAFMT_RGBFOVEON,
++ CFAFMT_DNSPL, CFAFMT_HONEYCOMB, CFAFMT_RRGGBBFOVEON
++};
++
++/**
++ * struct ispprev_cfa - Structure for CFA Inpterpolation.
++ * @cfafmt: CFA Format Enum value supported by preview.
++ * @cfa_gradthrs_vert: CFA Gradient Threshold - Vertical.
++ * @cfa_gradthrs_horz: CFA Gradient Threshold - Horizontal.
++ * @cfa_table: Pointer to the CFA table.
++ */
++struct ispprev_cfa {
++ enum cfa_fmt cfafmt;
++ __u8 cfa_gradthrs_vert;
++ __u8 cfa_gradthrs_horz;
++ __u32 *cfa_table;
++};
++
++/**
++ * struct ispprev_csup - Structure for Chrominance Suppression.
++ * @gain: Gain.
++ * @thres: Threshold.
++ * @hypf_en: Flag to enable/disable the High Pass Filter.
++ */
++struct ispprev_csup {
++ __u8 gain;
++ __u8 thres;
++ __u8 hypf_en;
++};
++
++/**
++ * struct ispprev_wbal - Structure for White Balance.
++ * @dgain: Digital gain (U10Q8).
++ * @coef3: White balance gain - COEF 3 (U8Q5).
++ * @coef2: White balance gain - COEF 2 (U8Q5).
++ * @coef1: White balance gain - COEF 1 (U8Q5).
++ * @coef0: White balance gain - COEF 0 (U8Q5).
++ */
++struct ispprev_wbal {
++ __u16 dgain;
++ __u8 coef3;
++ __u8 coef2;
++ __u8 coef1;
++ __u8 coef0;
++};
++
++/**
++ * struct ispprev_blkadj - Structure for Black Adjustment.
++ * @red: Black level offset adjustment for Red in 2's complement format
++ * @green: Black level offset adjustment for Green in 2's complement format
++ * @blue: Black level offset adjustment for Blue in 2's complement format
++ */
++struct ispprev_blkadj {
++ /*Black level offset adjustment for Red in 2's complement format */
++ __u8 red;
++ /*Black level offset adjustment for Green in 2's complement format */
++ __u8 green;
++ /* Black level offset adjustment for Blue in 2's complement format */
++ __u8 blue;
++};
++
++/**
++ * struct ispprev_rgbtorgb - Structure for RGB to RGB Blending.
++ * @matrix: Blending values(S12Q8 format)
++ * [RR] [GR] [BR]
++ * [RG] [GG] [BG]
++ * [RB] [GB] [BB]
++ * @offset: Blending offset value for R,G,B in 2's complement integer format.
++ */
++struct ispprev_rgbtorgb {
++ __u16 matrix[3][3];
++ __u16 offset[3];
++};
++
++/**
++ * struct ispprev_csc - Structure for Color Space Conversion from RGB-YCbYCr
++ * @matrix: Color space conversion coefficients(S10Q8)
++ * [CSCRY] [CSCGY] [CSCBY]
++ * [CSCRCB] [CSCGCB] [CSCBCB]
++ * [CSCRCR] [CSCGCR] [CSCBCR]
++ * @offset: CSC offset values for Y offset, CB offset and CR offset respectively
++ */
++struct ispprev_csc {
++ __u16 matrix[RGB_MAX][RGB_MAX];
++ __s16 offset[RGB_MAX];
++};
++
++/**
++ * struct ispprev_yclimit - Structure for Y, C Value Limit.
++ * @minC: Minimum C value
++ * @maxC: Maximum C value
++ * @minY: Minimum Y value
++ * @maxY: Maximum Y value
++ */
++struct ispprev_yclimit {
++ __u8 minC;
++ __u8 maxC;
++ __u8 minY;
++ __u8 maxY;
++};
++
++/**
++ * struct ispprev_dcor - Structure for Defect correction.
++ * @couplet_mode_en: Flag to enable or disable the couplet dc Correction in NF
++ * @detect_correct: Thresholds for correction bit 0:10 detect 16:25 correct
++ */
++struct ispprev_dcor {
++ __u8 couplet_mode_en;
++ __u32 detect_correct[4];
++};
++
++/**
++ * struct ispprev_nf - Structure for Noise Filter
++ * @spread: Spread value to be used in Noise Filter
++ * @table: Pointer to the Noise Filter table
++ */
++struct ispprev_nf {
++ __u8 spread;
++ __u32 table[ISPPRV_NF_TBL_SIZE];
++};
++
++/**
++ * struct ispprv_update_config - Structure for Preview Configuration (user).
++ * @update: Specifies which ISP Preview registers should be updated.
++ * @flag: Specifies which ISP Preview functions should be enabled.
++ * @yen: Pointer to luma enhancement table.
++ * @shading_shift: 3bit value of shift used in shading compensation.
++ * @prev_hmed: Pointer to structure containing the odd and even distance.
++ * between the pixels in the image along with the filter threshold.
++ * @prev_cfa: Pointer to structure containing the CFA interpolation table, CFA.
++ * format in the image, vertical and horizontal gradient threshold.
++ * @csup: Pointer to Structure for Chrominance Suppression coefficients.
++ * @prev_wbal: Pointer to structure for White Balance.
++ * @prev_blkadj: Pointer to structure for Black Adjustment.
++ * @rgb2rgb: Pointer to structure for RGB to RGB Blending.
++ * @prev_csc: Pointer to structure for Color Space Conversion from RGB-YCbYCr.
++ * @yclimit: Pointer to structure for Y, C Value Limit.
++ * @prev_dcor: Pointer to structure for defect correction.
++ * @prev_nf: Pointer to structure for Noise Filter
++ * @red_gamma: Pointer to red gamma correction table.
++ * @green_gamma: Pointer to green gamma correction table.
++ * @blue_gamma: Pointer to blue gamma correction table.
++ */
++struct ispprv_update_config {
++ __u16 update;
++ __u16 flag;
++ void *yen;
++ __u32 shading_shift;
++ struct ispprev_hmed *prev_hmed;
++ struct ispprev_cfa *prev_cfa;
++ struct ispprev_csup *csup;
++ struct ispprev_wbal *prev_wbal;
++ struct ispprev_blkadj *prev_blkadj;
++ struct ispprev_rgbtorgb *rgb2rgb;
++ struct ispprev_csc *prev_csc;
++ struct ispprev_yclimit *yclimit;
++ struct ispprev_dcor *prev_dcor;
++ struct ispprev_nf *prev_nf;
++ __u32 *red_gamma;
++ __u32 *green_gamma;
++ __u32 *blue_gamma;
++};
++
++#endif /* OMAP_ISP_USER_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0004-omap3isp-Add-ISP-frontend-CCDC.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0004-omap3isp-Add-ISP-frontend-CCDC.patch
new file mode 100644
index 0000000000..4a161729fd
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0004-omap3isp-Add-ISP-frontend-CCDC.patch
@@ -0,0 +1,1875 @@
+From 9ea796fe5383a6961125a6a18185a901fe8627d7 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add ISP frontend (CCDC)
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/ispccdc.c | 1638 +++++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/ispccdc.h | 209 +++++
+ 2 files changed, 1847 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/ispccdc.c
+ create mode 100644 drivers/media/video/isp/ispccdc.h
+
+diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c
+new file mode 100644
+index 0000000..2574ea2
+--- /dev/null
++++ b/drivers/media/video/isp/ispccdc.c
+@@ -0,0 +1,1638 @@
++/*
++ * ispccdc.c
++ *
++ * Driver Library for CCDC module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Senthilvadivu Guruswamy <svadivu@ti.com>
++ * Pallavi Kulkarni <p-kulkarni@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/mutex.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "ispccdc.h"
++#include "ispmmu.h"
++
++#define LSC_TABLE_INIT_SIZE 50052
++
++static u32 *fpc_table_add;
++static unsigned long fpc_table_add_m;
++
++/**
++ * struct isp_ccdc - Structure for the CCDC module to store its own information
++ * @ccdc_inuse: Flag to determine if CCDC has been reserved or not (0 or 1).
++ * @ccdcout_w: CCDC output width.
++ * @ccdcout_h: CCDC output height.
++ * @ccdcin_w: CCDC input width.
++ * @ccdcin_h: CCDC input height.
++ * @ccdcin_woffset: CCDC input horizontal offset.
++ * @ccdcin_hoffset: CCDC input vertical offset.
++ * @crop_w: Crop width.
++ * @crop_h: Crop weight.
++ * @ccdc_inpfmt: CCDC input format.
++ * @ccdc_outfmt: CCDC output format.
++ * @vpout_en: Video port output enable.
++ * @wen: Data write enable.
++ * @exwen: External data write enable.
++ * @refmt_en: Reformatter enable.
++ * @ccdcslave: CCDC slave mode enable.
++ * @syncif_ipmod: Image
++ * @obclamp_en: Data input format.
++ * @mutexlock: Mutex used to get access to the CCDC.
++ */
++static struct isp_ccdc {
++ u8 ccdc_inuse;
++ u32 ccdcout_w;
++ u32 ccdcout_h;
++ u32 ccdcin_w;
++ u32 ccdcin_h;
++ u32 ccdcin_woffset;
++ u32 ccdcin_hoffset;
++ u32 crop_w;
++ u32 crop_h;
++ u8 ccdc_inpfmt;
++ u8 ccdc_outfmt;
++ u8 vpout_en;
++ u8 wen;
++ u8 exwen;
++ u8 refmt_en;
++ u8 ccdcslave;
++ u8 syncif_ipmod;
++ u8 obclamp_en;
++ u8 pm_state;
++ u8 lsc_enable;
++ int lsc_state;
++ struct mutex mutexlock; /* For checking/modifying ccdc_inuse */
++ u32 wenlog;
++} ispccdc_obj;
++
++static struct ispccdc_lsc_config lsc_config;
++static u8 *lsc_gain_table;
++static unsigned long lsc_ispmmu_addr;
++static int lsc_initialized;
++static u8 *lsc_gain_table_tmp;
++
++/* Structure for saving/restoring CCDC module registers*/
++static struct isp_reg ispccdc_reg_list[] = {
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HD_VD_WID, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PIX_LINES, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HORZ_INFO, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VERT_START, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VERT_LINES, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CULLING, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HSIZE_OFF, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDR_ADDR, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CLAMP, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_DCSUB, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_COLPTN, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_BLKCMP, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC_ADDR, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VDINT, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_ALAW, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_REC656IF, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_HORZ, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_VERT, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR0, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR1, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR2, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR3, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR4, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR5, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR6, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_ADDR7, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PRGEVEN0, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PRGEVEN1, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PRGODD0, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PRGODD1, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VP_OUT, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_INITIAL, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_TABLE_BASE, 0},
++ {OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_TABLE_OFFSET, 0},
++ {0, ISP_TOK_TERM, 0}
++};
++
++/**
++ * omap34xx_isp_ccdc_config - Sets CCDC configuration from userspace
++ * @userspace_add: Structure containing CCDC configuration sent from userspace.
++ *
++ * Returns 0 if successful, -EINVAL if the pointer to the configuration
++ * structure is null, or the copy_from_user function fails to copy user space
++ * memory to kernel space memory.
++ **/
++int omap34xx_isp_ccdc_config(void *userspace_add)
++{
++ struct ispccdc_bclamp bclamp_t;
++ struct ispccdc_blcomp blcomp_t;
++ struct ispccdc_fpc fpc_t;
++ struct ispccdc_culling cull_t;
++ struct ispccdc_update_config *ccdc_struct;
++
++ if (userspace_add == NULL)
++ return -EINVAL;
++
++ ccdc_struct = userspace_add;
++
++ if (ISP_ABS_CCDC_ALAW & ccdc_struct->flag) {
++ if (ISP_ABS_CCDC_ALAW & ccdc_struct->update)
++ ispccdc_config_alaw(ccdc_struct->alawip);
++ ispccdc_enable_alaw(1);
++ } else if (ISP_ABS_CCDC_ALAW & ccdc_struct->update)
++ ispccdc_enable_alaw(0);
++
++ if (ISP_ABS_CCDC_LPF & ccdc_struct->flag)
++ ispccdc_enable_lpf(1);
++ else
++ ispccdc_enable_lpf(0);
++
++ if (ISP_ABS_CCDC_BLCLAMP & ccdc_struct->flag) {
++ if (ISP_ABS_CCDC_BLCLAMP & ccdc_struct->update) {
++ if (copy_from_user(&bclamp_t, (struct ispccdc_bclamp *)
++ ccdc_struct->bclamp,
++ sizeof(struct ispccdc_bclamp)))
++ goto copy_from_user_err;
++
++ ispccdc_enable_black_clamp(1);
++ ispccdc_config_black_clamp(bclamp_t);
++ } else
++ ispccdc_enable_black_clamp(1);
++ } else {
++ if (ISP_ABS_CCDC_BLCLAMP & ccdc_struct->update) {
++ if (copy_from_user(&bclamp_t, (struct ispccdc_bclamp *)
++ ccdc_struct->bclamp,
++ sizeof(struct ispccdc_bclamp)))
++ goto copy_from_user_err;
++
++ ispccdc_enable_black_clamp(0);
++ ispccdc_config_black_clamp(bclamp_t);
++ }
++ }
++
++ if (ISP_ABS_CCDC_BCOMP & ccdc_struct->update) {
++ if (copy_from_user(&blcomp_t, (struct ispccdc_blcomp *)
++ ccdc_struct->blcomp,
++ sizeof(blcomp_t)))
++ goto copy_from_user_err;
++
++ ispccdc_config_black_comp(blcomp_t);
++ }
++
++ if (ISP_ABS_CCDC_FPC & ccdc_struct->flag) {
++ if (ISP_ABS_CCDC_FPC & ccdc_struct->update) {
++ if (copy_from_user(&fpc_t, (struct ispccdc_fpc *)
++ ccdc_struct->fpc,
++ sizeof(fpc_t)))
++ goto copy_from_user_err;
++ fpc_table_add = kmalloc(64 + fpc_t.fpnum * 4,
++ GFP_KERNEL | GFP_DMA);
++ if (!fpc_table_add) {
++ printk(KERN_ERR "Cannot allocate memory for"
++ " FPC table");
++ return -ENOMEM;
++ }
++ while (((unsigned long)fpc_table_add & 0xFFFFFFC0)
++ != (unsigned long)fpc_table_add)
++ fpc_table_add++;
++
++ fpc_table_add_m = ispmmu_kmap(virt_to_phys
++ (fpc_table_add),
++ fpc_t.fpnum * 4);
++
++ if (copy_from_user(fpc_table_add, (u32 *)fpc_t.fpcaddr,
++ fpc_t.fpnum * 4))
++ goto copy_from_user_err;
++
++ fpc_t.fpcaddr = fpc_table_add_m;
++ ispccdc_config_fpc(fpc_t);
++ }
++ ispccdc_enable_fpc(1);
++ } else if (ISP_ABS_CCDC_FPC & ccdc_struct->update)
++ ispccdc_enable_fpc(0);
++
++ if (ISP_ABS_CCDC_CULL & ccdc_struct->update) {
++ if (copy_from_user(&cull_t, (struct ispccdc_culling *)
++ ccdc_struct->cull,
++ sizeof(cull_t)))
++ goto copy_from_user_err;
++ ispccdc_config_culling(cull_t);
++ }
++
++ if (is_isplsc_activated()) {
++ if (ISP_ABS_CCDC_CONFIG_LSC & ccdc_struct->flag) {
++ if (ISP_ABS_CCDC_CONFIG_LSC & ccdc_struct->update) {
++ if (copy_from_user(
++ &lsc_config,
++ (struct ispccdc_lsc_config *)
++ ccdc_struct->lsc_cfg,
++ sizeof(struct ispccdc_lsc_config)))
++ goto copy_from_user_err;
++ ispccdc_config_lsc(&lsc_config);
++ }
++ ispccdc_enable_lsc(1);
++ } else if (ISP_ABS_CCDC_CONFIG_LSC & ccdc_struct->update) {
++ ispccdc_enable_lsc(0);
++ }
++ if (ISP_ABS_TBL_LSC & ccdc_struct->update) {
++ if (copy_from_user(lsc_gain_table,
++ ccdc_struct->lsc, lsc_config.size))
++ goto copy_from_user_err;
++ ispccdc_load_lsc(lsc_gain_table, lsc_config.size);
++ }
++ }
++
++ if (ISP_ABS_CCDC_COLPTN & ccdc_struct->update)
++ ispccdc_config_imgattr(ccdc_struct->colptn);
++
++ return 0;
++
++copy_from_user_err:
++ printk(KERN_ERR "CCDC Config:Copy From User Error");
++ return -EINVAL ;
++}
++EXPORT_SYMBOL(omap34xx_isp_ccdc_config);
++
++/**
++ * Set the value to be used for CCDC_CFG.WENLOG.
++ * w - Value of wenlog.
++ */
++void ispccdc_set_wenlog(u32 wenlog)
++{
++ ispccdc_obj.wenlog = wenlog;
++}
++EXPORT_SYMBOL(ispccdc_set_wenlog);
++
++/**
++ * ispccdc_request - Reserves the CCDC module.
++ *
++ * Reserves the CCDC module and assures that is used only once at a time.
++ *
++ * Returns 0 if successful, or -EBUSY if CCDC module is busy.
++ **/
++int ispccdc_request(void)
++{
++ mutex_lock(&ispccdc_obj.mutexlock);
++ if (ispccdc_obj.ccdc_inuse) {
++ mutex_unlock(&ispccdc_obj.mutexlock);
++ DPRINTK_ISPCCDC("ISP_ERR : CCDC Module Busy\n");
++ return -EBUSY;
++ }
++
++ ispccdc_obj.ccdc_inuse = 1;
++ mutex_unlock(&ispccdc_obj.mutexlock);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, ISPCTRL_CCDC_RAM_EN |
++ ISPCTRL_CCDC_CLK_EN |
++ ISPCTRL_SBL_WR1_RAM_EN);
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_VDLC);
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_request);
++
++/**
++ * ispccdc_free - Frees the CCDC module.
++ *
++ * Frees the CCDC module so it can be used by another process.
++ *
++ * Returns 0 if successful, or -EINVAL if module has been already freed.
++ **/
++int ispccdc_free(void)
++{
++ mutex_lock(&ispccdc_obj.mutexlock);
++ if (!ispccdc_obj.ccdc_inuse) {
++ mutex_unlock(&ispccdc_obj.mutexlock);
++ DPRINTK_ISPCCDC("ISP_ERR: CCDC Module already freed\n");
++ return -EINVAL;
++ }
++
++ ispccdc_obj.ccdc_inuse = 0;
++ mutex_unlock(&ispccdc_obj.mutexlock);
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
++ ~(ISPCTRL_CCDC_CLK_EN |
++ ISPCTRL_CCDC_RAM_EN |
++ ISPCTRL_SBL_WR1_RAM_EN));
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_free);
++
++/**
++ * ispccdc_free_lsc - Frees Lens Shading Compensation table
++ *
++ * Always returns 0.
++ **/
++static int ispccdc_free_lsc(void)
++{
++ if (!lsc_ispmmu_addr)
++ return 0;
++
++ ispccdc_enable_lsc(0);
++ lsc_initialized = 0;
++ isp_reg_writel(0, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_TABLE_BASE);
++ ispmmu_kunmap(lsc_ispmmu_addr);
++ kfree(lsc_gain_table);
++ return 0;
++}
++
++/**
++ * ispccdc_allocate_lsc - Allocate space for Lens Shading Compensation table
++ * @table_size: LSC gain table size.
++ *
++ * Returns 0 if successful, -ENOMEM of its no memory available, or -EINVAL if
++ * table_size is zero.
++ **/
++static int ispccdc_allocate_lsc(u32 table_size)
++{
++ if (table_size == 0)
++ return -EINVAL;
++
++ if ((lsc_config.size >= table_size) && lsc_gain_table)
++ return 0;
++
++ ispccdc_free_lsc();
++
++ lsc_gain_table = kmalloc(table_size, GFP_KERNEL | GFP_DMA);
++
++ if (!lsc_gain_table) {
++ printk(KERN_ERR "Cannot allocate memory for gain tables \n");
++ return -ENOMEM;
++ }
++
++ lsc_ispmmu_addr = ispmmu_kmap(virt_to_phys(lsc_gain_table), table_size);
++ if (lsc_ispmmu_addr <= 0) {
++ printk(KERN_ERR "Cannot map memory for gain tables \n");
++ kfree(lsc_gain_table);
++ return -ENOMEM;
++ }
++
++ return 0;
++}
++
++/**
++ * ispccdc_program_lsc - Program Lens Shading Compensation table.
++ * @table_size: LSC gain table size.
++ *
++ * Returns 0 if successful, or -EINVAL if there's no mapped address for the
++ * table yet.
++ **/
++static int ispccdc_program_lsc(void)
++{
++ if (!lsc_ispmmu_addr)
++ return -EINVAL;
++
++ if (lsc_initialized)
++ return 0;
++
++ isp_reg_writel(lsc_ispmmu_addr, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_TABLE_BASE);
++ lsc_initialized = 1;
++ return 0;
++}
++
++/**
++ * ispccdc_load_lsc - Load Lens Shading Compensation table.
++ * @table_addr: LSC gain table MMU Mapped address.
++ * @table_size: LSC gain table size.
++ *
++ * Returns 0 if successful, -ENOMEM of its no memory available, or -EINVAL if
++ * table_size is zero.
++ **/
++int ispccdc_load_lsc(u8 *table_addr, u32 table_size)
++{
++ int ret;
++
++ if (!is_isplsc_activated())
++ return 0;
++
++ if (!table_addr)
++ return -EINVAL;
++
++ ret = ispccdc_allocate_lsc(table_size);
++ if (ret)
++ return ret;
++
++ if (table_addr != lsc_gain_table)
++ memcpy(lsc_gain_table, table_addr, table_size);
++ ret = ispccdc_program_lsc();
++ if (ret)
++ return ret;
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_load_lsc);
++
++/**
++ * ispccdc_config_lsc - Configures the lens shading compensation module
++ * @lsc_cfg: LSC configuration structure
++ **/
++void ispccdc_config_lsc(struct ispccdc_lsc_config *lsc_cfg)
++{
++ int reg;
++
++ if (!is_isplsc_activated())
++ return;
++
++ ispccdc_enable_lsc(0);
++ isp_reg_writel(lsc_cfg->offset, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_TABLE_OFFSET);
++
++ reg = 0;
++ reg |= lsc_cfg->gain_mode_n << ISPCCDC_LSC_GAIN_MODE_N_SHIFT;
++ reg |= lsc_cfg->gain_mode_m << ISPCCDC_LSC_GAIN_MODE_M_SHIFT;
++ reg |= lsc_cfg->gain_format << ISPCCDC_LSC_GAIN_FORMAT_SHIFT;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG);
++
++ reg = 0;
++ reg &= ~ISPCCDC_LSC_INITIAL_X_MASK;
++ reg |= lsc_cfg->initial_x << ISPCCDC_LSC_INITIAL_X_SHIFT;
++ reg &= ~ISPCCDC_LSC_INITIAL_Y_MASK;
++ reg |= lsc_cfg->initial_y << ISPCCDC_LSC_INITIAL_Y_SHIFT;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_INITIAL);
++}
++EXPORT_SYMBOL(ispccdc_config_lsc);
++
++int __ispccdc_enable_lsc(u8 enable)
++{
++ if (!is_isplsc_activated())
++ return -ENODEV;
++
++ if (enable) {
++ if (!ispccdc_busy()) {
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
++ ISPCTRL_SBL_SHARED_RPORTB
++ | ISPCTRL_SBL_RD_RAM_EN);
++
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_CONFIG, 0x1);
++
++ ispccdc_obj.lsc_state = 1;
++ } else {
++ /* Postpone enabling LSC */
++ ispccdc_obj.lsc_enable = 1;
++ return -EBUSY;
++ }
++ } else {
++ isp_reg_and(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_LSC_CONFIG, 0xFFFE);
++ ispccdc_obj.lsc_state = ispccdc_obj.lsc_enable = 0;
++ }
++
++ return 0;
++}
++
++/**
++ * ispccdc_enable_lsc - Enables/Disables the Lens Shading Compensation module.
++ * @enable: 0 Disables LSC, 1 Enables LSC.
++ **/
++void ispccdc_enable_lsc(u8 enable)
++{
++ if (__ispccdc_enable_lsc(enable)) {
++ if (enable)
++ ispccdc_obj.lsc_state = 1;
++ else
++ ispccdc_obj.lsc_state = ispccdc_obj.lsc_enable = 0;
++ }
++}
++EXPORT_SYMBOL(ispccdc_enable_lsc);
++
++void ispccdc_lsc_error_handler(void)
++{
++ int lsc_enable = ispccdc_obj.lsc_state;
++
++ ispccdc_enable_lsc(0);
++
++ ispccdc_obj.lsc_enable = lsc_enable;
++}
++
++/**
++ * ispccdc_config_crop - Configures crop parameters for the ISP CCDC.
++ * @left: Left offset of the crop area.
++ * @top: Top offset of the crop area.
++ * @height: Height of the crop area.
++ * @width: Width of the crop area.
++ *
++ * The following restrictions are applied for the crop settings. If incoming
++ * values do not follow these restrictions then we map the settings to the
++ * closest acceptable crop value.
++ * 1) Left offset is always odd. This can be avoided if we enable byte swap
++ * option for incoming data into CCDC.
++ * 2) Top offset is always even.
++ * 3) Crop height is always even.
++ * 4) Crop width is always a multiple of 16 pixels
++ **/
++void ispccdc_config_crop(u32 left, u32 top, u32 height, u32 width)
++{
++ ispccdc_obj.ccdcin_woffset = left + (left % 2);
++ ispccdc_obj.ccdcin_hoffset = top + (top % 2);
++
++ ispccdc_obj.crop_w = width - (width % 16);
++ ispccdc_obj.crop_h = height + (height % 2);
++
++ DPRINTK_ISPCCDC("\n\tOffsets L %d T %d W %d H %d\n",
++ ispccdc_obj.ccdcin_woffset,
++ ispccdc_obj.ccdcin_hoffset,
++ ispccdc_obj.crop_w,
++ ispccdc_obj.crop_h);
++}
++
++/**
++ * ispccdc_config_datapath - Specifies the input and output modules for CCDC.
++ * @input: Indicates the module that inputs the image to the CCDC.
++ * @output: Indicates the module to which the CCDC outputs the image.
++ *
++ * Configures the default configuration for the CCDC to work with.
++ *
++ * The valid values for the input are CCDC_RAW (0), CCDC_YUV_SYNC (1),
++ * CCDC_YUV_BT (2), and CCDC_OTHERS (3).
++ *
++ * The valid values for the output are CCDC_YUV_RSZ (0), CCDC_YUV_MEM_RSZ (1),
++ * CCDC_OTHERS_VP (2), CCDC_OTHERS_MEM (3), CCDC_OTHERS_VP_MEM (4).
++ *
++ * Returns 0 if successful, or -EINVAL if wrong I/O combination or wrong input
++ * or output values.
++ **/
++int ispccdc_config_datapath(enum ccdc_input input, enum ccdc_output output)
++{
++ u32 syn_mode = 0;
++ struct ispccdc_vp vpcfg;
++ struct ispccdc_syncif syncif;
++ struct ispccdc_bclamp blkcfg;
++
++ u32 colptn = ISPCCDC_COLPTN_Gr_Cy << ISPCCDC_COLPTN_CP0PLC0_SHIFT |
++ ISPCCDC_COLPTN_R_Ye << ISPCCDC_COLPTN_CP0PLC1_SHIFT |
++ ISPCCDC_COLPTN_Gr_Cy << ISPCCDC_COLPTN_CP0PLC2_SHIFT |
++ ISPCCDC_COLPTN_R_Ye << ISPCCDC_COLPTN_CP0PLC3_SHIFT |
++ ISPCCDC_COLPTN_B_Mg << ISPCCDC_COLPTN_CP1PLC0_SHIFT |
++ ISPCCDC_COLPTN_Gb_G << ISPCCDC_COLPTN_CP1PLC1_SHIFT |
++ ISPCCDC_COLPTN_B_Mg << ISPCCDC_COLPTN_CP1PLC2_SHIFT |
++ ISPCCDC_COLPTN_Gb_G << ISPCCDC_COLPTN_CP1PLC3_SHIFT |
++ ISPCCDC_COLPTN_Gr_Cy << ISPCCDC_COLPTN_CP2PLC0_SHIFT |
++ ISPCCDC_COLPTN_R_Ye << ISPCCDC_COLPTN_CP2PLC1_SHIFT |
++ ISPCCDC_COLPTN_Gr_Cy << ISPCCDC_COLPTN_CP2PLC2_SHIFT |
++ ISPCCDC_COLPTN_R_Ye << ISPCCDC_COLPTN_CP2PLC3_SHIFT |
++ ISPCCDC_COLPTN_B_Mg << ISPCCDC_COLPTN_CP3PLC0_SHIFT |
++ ISPCCDC_COLPTN_Gb_G << ISPCCDC_COLPTN_CP3PLC1_SHIFT |
++ ISPCCDC_COLPTN_B_Mg << ISPCCDC_COLPTN_CP3PLC2_SHIFT |
++ ISPCCDC_COLPTN_Gb_G << ISPCCDC_COLPTN_CP3PLC3_SHIFT;
++
++ /* CCDC does not convert the image format */
++ if ((input == CCDC_RAW || input == CCDC_OTHERS) &&
++ output == CCDC_YUV_RSZ) {
++ DPRINTK_ISPCCDC("ISP_ERR: Wrong CCDC I/O Combination\n");
++ return -EINVAL;
++ }
++
++ syn_mode = isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
++
++ switch (output) {
++ case CCDC_YUV_RSZ:
++ syn_mode |= ISPCCDC_SYN_MODE_SDR2RSZ;
++ syn_mode &= ~ISPCCDC_SYN_MODE_WEN;
++ break;
++
++ case CCDC_YUV_MEM_RSZ:
++ syn_mode |= ISPCCDC_SYN_MODE_SDR2RSZ;
++ ispccdc_obj.wen = 1;
++ syn_mode |= ISPCCDC_SYN_MODE_WEN;
++ break;
++
++ case CCDC_OTHERS_VP:
++ syn_mode &= ~ISPCCDC_SYN_MODE_VP2SDR;
++ syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
++ syn_mode &= ~ISPCCDC_SYN_MODE_WEN;
++ vpcfg.bitshift_sel = BIT9_0;
++ vpcfg.freq_sel = PIXCLKBY2;
++ ispccdc_config_vp(vpcfg);
++ ispccdc_enable_vp(1);
++ break;
++
++ case CCDC_OTHERS_MEM:
++ syn_mode &= ~ISPCCDC_SYN_MODE_VP2SDR;
++ syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
++ syn_mode |= ISPCCDC_SYN_MODE_WEN;
++ syn_mode &= ~ISPCCDC_SYN_MODE_EXWEN;
++ isp_reg_and(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG,
++ ~ISPCCDC_CFG_WENLOG);
++ vpcfg.bitshift_sel = BIT11_2;
++ vpcfg.freq_sel = PIXCLKBY2;
++ ispccdc_config_vp(vpcfg);
++ ispccdc_enable_vp(0);
++ break;
++
++ case CCDC_OTHERS_VP_MEM:
++ syn_mode &= ~ISPCCDC_SYN_MODE_VP2SDR;
++ syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
++ syn_mode |= ISPCCDC_SYN_MODE_WEN;
++ syn_mode &= ~ISPCCDC_SYN_MODE_EXWEN;
++
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG,
++ ~ISPCCDC_CFG_WENLOG,
++ ispccdc_obj.wenlog);
++ vpcfg.bitshift_sel = BIT9_0;
++ vpcfg.freq_sel = PIXCLKBY2;
++ ispccdc_config_vp(vpcfg);
++ ispccdc_enable_vp(1);
++ break;
++ default:
++ DPRINTK_ISPCCDC("ISP_ERR: Wrong CCDC Output\n");
++ return -EINVAL;
++ };
++
++ isp_reg_writel(syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
++
++ switch (input) {
++ case CCDC_RAW:
++ syncif.ccdc_mastermode = 0;
++ syncif.datapol = 0;
++ syncif.datsz = DAT10;
++ syncif.fldmode = 0;
++ syncif.fldout = 0;
++ syncif.fldpol = 0;
++ syncif.fldstat = 0;
++ syncif.hdpol = 0;
++ syncif.ipmod = RAW;
++ syncif.vdpol = 0;
++ ispccdc_config_sync_if(syncif);
++ ispccdc_config_imgattr(colptn);
++ blkcfg.dcsubval = 64;
++ ispccdc_config_black_clamp(blkcfg);
++ if (is_isplsc_activated()) {
++ ispccdc_config_lsc(&lsc_config);
++ ispccdc_load_lsc(lsc_gain_table_tmp,
++ LSC_TABLE_INIT_SIZE);
++ }
++
++ break;
++ case CCDC_YUV_SYNC:
++ syncif.ccdc_mastermode = 0;
++ syncif.datapol = 0;
++ syncif.datsz = DAT8;
++ syncif.fldmode = 0;
++ syncif.fldout = 0;
++ syncif.fldpol = 0;
++ syncif.fldstat = 0;
++ syncif.hdpol = 0;
++ syncif.ipmod = YUV16;
++ syncif.vdpol = 1;
++ ispccdc_config_imgattr(0);
++ ispccdc_config_sync_if(syncif);
++ blkcfg.dcsubval = 0;
++ ispccdc_config_black_clamp(blkcfg);
++ break;
++ case CCDC_YUV_BT:
++ break;
++ case CCDC_OTHERS:
++ break;
++ default:
++ DPRINTK_ISPCCDC("ISP_ERR: Wrong CCDC Input\n");
++ return -EINVAL;
++ }
++
++ ispccdc_obj.ccdc_inpfmt = input;
++ ispccdc_obj.ccdc_outfmt = output;
++ ispccdc_print_status();
++ isp_print_status();
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_config_datapath);
++
++/**
++ * ispccdc_config_sync_if - Sets the sync i/f params between sensor and CCDC.
++ * @syncif: Structure containing the sync parameters like field state, CCDC in
++ * master/slave mode, raw/yuv data, polarity of data, field, hs, vs
++ * signals.
++ **/
++void ispccdc_config_sync_if(struct ispccdc_syncif syncif)
++{
++ u32 syn_mode = isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
++
++ syn_mode |= ISPCCDC_SYN_MODE_VDHDEN;
++
++ if (syncif.fldstat)
++ syn_mode |= ISPCCDC_SYN_MODE_FLDSTAT;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_FLDSTAT;
++
++ syn_mode &= ISPCCDC_SYN_MODE_INPMOD_MASK;
++ ispccdc_obj.syncif_ipmod = syncif.ipmod;
++
++ switch (syncif.ipmod) {
++ case RAW:
++ break;
++ case YUV16:
++ syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
++ break;
++ case YUV8:
++ syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
++ break;
++ };
++
++ syn_mode &= ISPCCDC_SYN_MODE_DATSIZ_MASK;
++ switch (syncif.datsz) {
++ case DAT8:
++ syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8;
++ break;
++ case DAT10:
++ syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_10;
++ break;
++ case DAT11:
++ syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_11;
++ break;
++ case DAT12:
++ syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_12;
++ break;
++ };
++
++ if (syncif.fldmode)
++ syn_mode |= ISPCCDC_SYN_MODE_FLDMODE;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_FLDMODE;
++
++ if (syncif.datapol)
++ syn_mode |= ISPCCDC_SYN_MODE_DATAPOL;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_DATAPOL;
++
++ if (syncif.fldpol)
++ syn_mode |= ISPCCDC_SYN_MODE_FLDPOL;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_FLDPOL;
++
++ if (syncif.hdpol)
++ syn_mode |= ISPCCDC_SYN_MODE_HDPOL;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_HDPOL;
++
++ if (syncif.vdpol)
++ syn_mode |= ISPCCDC_SYN_MODE_VDPOL;
++ else
++ syn_mode &= ~ISPCCDC_SYN_MODE_VDPOL;
++
++ if (syncif.ccdc_mastermode) {
++ syn_mode |= ISPCCDC_SYN_MODE_FLDOUT | ISPCCDC_SYN_MODE_VDHDOUT;
++ isp_reg_writel(syncif.hs_width << ISPCCDC_HD_VD_WID_HDW_SHIFT
++ | syncif.vs_width << ISPCCDC_HD_VD_WID_VDW_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_HD_VD_WID);
++
++ isp_reg_writel(syncif.ppln << ISPCCDC_PIX_LINES_PPLN_SHIFT
++ | syncif.hlprf << ISPCCDC_PIX_LINES_HLPRF_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_PIX_LINES);
++ } else
++ syn_mode &= ~(ISPCCDC_SYN_MODE_FLDOUT |
++ ISPCCDC_SYN_MODE_VDHDOUT);
++
++ isp_reg_writel(syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
++
++ if (!(syncif.bt_r656_en)) {
++ isp_reg_and(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_REC656IF,
++ ~ISPCCDC_REC656IF_R656ON);
++ }
++}
++EXPORT_SYMBOL(ispccdc_config_sync_if);
++
++/**
++ * ispccdc_config_black_clamp - Configures the clamp parameters in CCDC.
++ * @bclamp: Structure containing the optical black average gain, optical black
++ * sample length, sample lines, and the start pixel position of the
++ * samples w.r.t the HS pulse.
++ * Configures the clamp parameters in CCDC. Either if its being used the
++ * optical black clamp, or the digital clamp. If its a digital clamp, then
++ * assures to put a valid DC substraction level.
++ *
++ * Returns always 0 when completed.
++ **/
++int ispccdc_config_black_clamp(struct ispccdc_bclamp bclamp)
++{
++ u32 bclamp_val = 0;
++
++ if (ispccdc_obj.obclamp_en) {
++ bclamp_val |= bclamp.obgain << ISPCCDC_CLAMP_OBGAIN_SHIFT;
++ bclamp_val |= bclamp.oblen << ISPCCDC_CLAMP_OBSLEN_SHIFT;
++ bclamp_val |= bclamp.oblines << ISPCCDC_CLAMP_OBSLN_SHIFT;
++ bclamp_val |= bclamp.obstpixel << ISPCCDC_CLAMP_OBST_SHIFT;
++ isp_reg_writel(bclamp_val, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_CLAMP);
++ } else {
++ if (omap_rev() < OMAP3430_REV_ES2_0)
++ if (ispccdc_obj.syncif_ipmod == YUV16 ||
++ ispccdc_obj.syncif_ipmod == YUV8 ||
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_REC656IF) &
++ ISPCCDC_REC656IF_R656ON)
++ bclamp.dcsubval = 0;
++ isp_reg_writel(bclamp.dcsubval, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_DCSUB);
++ }
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_config_black_clamp);
++
++/**
++ * ispccdc_enable_black_clamp - Enables/Disables the optical black clamp.
++ * @enable: 0 Disables optical black clamp, 1 Enables optical black clamp.
++ *
++ * Enables or disables the optical black clamp. When disabled, the digital
++ * clamp operates.
++ **/
++void ispccdc_enable_black_clamp(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CLAMP,
++ ~ISPCCDC_CLAMP_CLAMPEN,
++ enable ? ISPCCDC_CLAMP_CLAMPEN : 0);
++ ispccdc_obj.obclamp_en = enable;
++}
++EXPORT_SYMBOL(ispccdc_enable_black_clamp);
++
++/**
++ * ispccdc_config_fpc - Configures the Faulty Pixel Correction parameters.
++ * @fpc: Structure containing the number of faulty pixels corrected in the
++ * frame, address of the FPC table.
++ *
++ * Returns 0 if successful, or -EINVAL if FPC Address is not on the 64 byte
++ * boundary.
++ **/
++int ispccdc_config_fpc(struct ispccdc_fpc fpc)
++{
++ u32 fpc_val = 0;
++
++ fpc_val = isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC);
++
++ if ((fpc.fpcaddr & 0xFFFFFFC0) == fpc.fpcaddr) {
++ isp_reg_writel(fpc_val & (~ISPCCDC_FPC_FPCEN),
++ OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC);
++ isp_reg_writel(fpc.fpcaddr,
++ OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC_ADDR);
++ } else {
++ DPRINTK_ISPCCDC("FPC Address should be on 64byte boundary\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(fpc_val | (fpc.fpnum << ISPCCDC_FPC_FPNUM_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC);
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_config_fpc);
++
++/**
++ * ispccdc_enable_fpc - Enables the Faulty Pixel Correction.
++ * @enable: 0 Disables FPC, 1 Enables FPC.
++ **/
++void ispccdc_enable_fpc(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FPC,
++ ~ISPCCDC_FPC_FPCEN,
++ enable ? ISPCCDC_FPC_FPCEN : 0);
++}
++EXPORT_SYMBOL(ispccdc_enable_fpc);
++
++/**
++ * ispccdc_config_black_comp - Configures Black Level Compensation parameters.
++ * @blcomp: Structure containing the black level compensation value for RGrGbB
++ * pixels. in 2's complement.
++ **/
++void ispccdc_config_black_comp(struct ispccdc_blcomp blcomp)
++{
++ u32 blcomp_val = 0;
++
++ blcomp_val |= blcomp.b_mg << ISPCCDC_BLKCMP_B_MG_SHIFT;
++ blcomp_val |= blcomp.gb_g << ISPCCDC_BLKCMP_GB_G_SHIFT;
++ blcomp_val |= blcomp.gr_cy << ISPCCDC_BLKCMP_GR_CY_SHIFT;
++ blcomp_val |= blcomp.r_ye << ISPCCDC_BLKCMP_R_YE_SHIFT;
++
++ isp_reg_writel(blcomp_val, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_BLKCMP);
++}
++EXPORT_SYMBOL(ispccdc_config_black_comp);
++
++/**
++ * ispccdc_config_vp - Configures the Video Port Configuration parameters.
++ * @vpcfg: Structure containing the Video Port input frequency, and the 10 bit
++ * format.
++ **/
++void ispccdc_config_vp(struct ispccdc_vp vpcfg)
++{
++ u32 fmtcfg_vp = isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG);
++
++ fmtcfg_vp &= ISPCCDC_FMTCFG_VPIN_MASK & ISPCCDC_FMTCF_VPIF_FRQ_MASK;
++
++ switch (vpcfg.bitshift_sel) {
++ case BIT9_0:
++ fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_9_0;
++ break;
++ case BIT10_1:
++ fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_10_1;
++ break;
++ case BIT11_2:
++ fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_11_2;
++ break;
++ case BIT12_3:
++ fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_12_3;
++ break;
++ };
++ switch (vpcfg.freq_sel) {
++ case PIXCLKBY2:
++ fmtcfg_vp |= ISPCCDC_FMTCF_VPIF_FRQ_BY2;
++ break;
++ case PIXCLKBY3_5:
++ fmtcfg_vp |= ISPCCDC_FMTCF_VPIF_FRQ_BY3;
++ break;
++ case PIXCLKBY4_5:
++ fmtcfg_vp |= ISPCCDC_FMTCF_VPIF_FRQ_BY4;
++ break;
++ case PIXCLKBY5_5:
++ fmtcfg_vp |= ISPCCDC_FMTCF_VPIF_FRQ_BY5;
++ break;
++ case PIXCLKBY6_5:
++ fmtcfg_vp |= ISPCCDC_FMTCF_VPIF_FRQ_BY6;
++ break;
++ };
++ isp_reg_writel(fmtcfg_vp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG);
++}
++EXPORT_SYMBOL(ispccdc_config_vp);
++
++/**
++ * ispccdc_enable_vp - Enables the Video Port.
++ * @enable: 0 Disables VP, 1 Enables VP
++ **/
++void ispccdc_enable_vp(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG,
++ ~ISPCCDC_FMTCFG_VPEN,
++ enable ? ISPCCDC_FMTCFG_VPEN : 0);
++}
++EXPORT_SYMBOL(ispccdc_enable_vp);
++
++/**
++ * ispccdc_config_reformatter - Configures the Reformatter.
++ * @refmt: Structure containing the memory address to format and the bit fields
++ * for the reformatter registers.
++ *
++ * Configures the Reformatter register values if line alternating is disabled.
++ * Else, just enabling line alternating is enough.
++ **/
++void ispccdc_config_reformatter(struct ispccdc_refmt refmt)
++{
++ u32 fmtcfg_val = 0;
++
++ fmtcfg_val = isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG);
++
++ if (refmt.lnalt)
++ fmtcfg_val |= ISPCCDC_FMTCFG_LNALT;
++ else {
++ fmtcfg_val &= ~ISPCCDC_FMTCFG_LNALT;
++ fmtcfg_val &= 0xFFFFF003;
++ fmtcfg_val |= refmt.lnum << ISPCCDC_FMTCFG_LNUM_SHIFT;
++ fmtcfg_val |= refmt.plen_even <<
++ ISPCCDC_FMTCFG_PLEN_EVEN_SHIFT;
++ fmtcfg_val |= refmt.plen_odd << ISPCCDC_FMTCFG_PLEN_ODD_SHIFT;
++
++ isp_reg_writel(refmt.prgeven0, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_PRGEVEN0);
++ isp_reg_writel(refmt.prgeven1, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_PRGEVEN1);
++ isp_reg_writel(refmt.prgodd0, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_PRGODD0);
++ isp_reg_writel(refmt.prgodd1, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_PRGODD1);
++ isp_reg_writel(refmt.fmtaddr0, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR0);
++ isp_reg_writel(refmt.fmtaddr1, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR1);
++ isp_reg_writel(refmt.fmtaddr2, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR2);
++ isp_reg_writel(refmt.fmtaddr3, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR3);
++ isp_reg_writel(refmt.fmtaddr4, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR4);
++ isp_reg_writel(refmt.fmtaddr5, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR5);
++ isp_reg_writel(refmt.fmtaddr6, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR6);
++ isp_reg_writel(refmt.fmtaddr7, OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_ADDR7);
++ }
++ isp_reg_writel(fmtcfg_val, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG);
++}
++EXPORT_SYMBOL(ispccdc_config_reformatter);
++
++/**
++ * ispccdc_enable_reformatter - Enables the Reformatter.
++ * @enable: 0 Disables Reformatter, 1- Enables Data Reformatter
++ **/
++void ispccdc_enable_reformatter(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG,
++ ~ISPCCDC_FMTCFG_FMTEN,
++ enable ? ISPCCDC_FMTCFG_FMTEN : 0);
++ ispccdc_obj.refmt_en = enable;
++}
++EXPORT_SYMBOL(ispccdc_enable_reformatter);
++
++/**
++ * ispccdc_config_culling - Configures the culling parameters.
++ * @cull: Structure containing the vertical culling pattern, and horizontal
++ * culling pattern for odd and even lines.
++ **/
++void ispccdc_config_culling(struct ispccdc_culling cull)
++{
++ u32 culling_val = 0;
++
++ culling_val |= cull.v_pattern << ISPCCDC_CULLING_CULV_SHIFT;
++ culling_val |= cull.h_even << ISPCCDC_CULLING_CULHEVN_SHIFT;
++ culling_val |= cull.h_odd << ISPCCDC_CULLING_CULHODD_SHIFT;
++
++ isp_reg_writel(culling_val, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CULLING);
++}
++EXPORT_SYMBOL(ispccdc_config_culling);
++
++/**
++ * ispccdc_enable_lpf - Enables the Low-Pass Filter (LPF).
++ * @enable: 0 Disables LPF, 1 Enables LPF
++ **/
++void ispccdc_enable_lpf(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE,
++ ~ISPCCDC_SYN_MODE_LPF,
++ enable ? ISPCCDC_SYN_MODE_LPF : 0);
++}
++EXPORT_SYMBOL(ispccdc_enable_lpf);
++
++/**
++ * ispccdc_config_alaw - Configures the input width for A-law.
++ * @ipwidth: Input width for A-law
++ **/
++void ispccdc_config_alaw(enum alaw_ipwidth ipwidth)
++{
++ isp_reg_writel(ipwidth << ISPCCDC_ALAW_GWDI_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC, ISPCCDC_ALAW);
++}
++EXPORT_SYMBOL(ispccdc_config_alaw);
++
++/**
++ * ispccdc_enable_alaw - Enables the A-law compression.
++ * @enable: 0 - Disables A-law, 1 - Enables A-law
++ **/
++void ispccdc_enable_alaw(u8 enable)
++{
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_ALAW,
++ ~ISPCCDC_ALAW_CCDTBL,
++ enable ? ISPCCDC_ALAW_CCDTBL : 0);
++}
++EXPORT_SYMBOL(ispccdc_enable_alaw);
++
++/**
++ * ispccdc_config_imgattr - Configures the sensor image specific attributes.
++ * @colptn: Color pattern of the sensor.
++ **/
++void ispccdc_config_imgattr(u32 colptn)
++{
++ isp_reg_writel(colptn, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_COLPTN);
++}
++EXPORT_SYMBOL(ispccdc_config_imgattr);
++
++void ispccdc_config_shadow_registers(void)
++{
++ if (ispccdc_obj.lsc_enable) {
++ ispccdc_enable_lsc(1);
++ ispccdc_obj.lsc_enable = 0;
++ }
++}
++
++/**
++ * ispccdc_try_size - Checks if requested Input/output dimensions are valid
++ * @input_w: input width for the CCDC in number of pixels per line
++ * @input_h: input height for the CCDC in number of lines
++ * @output_w: output width from the CCDC in number of pixels per line
++ * @output_h: output height for the CCDC in number of lines
++ *
++ * Calculates the number of pixels cropped if the reformater is disabled,
++ * Fills up the output width and height variables in the isp_ccdc structure.
++ *
++ * Returns 0 if successful, or -EINVAL if the input width is less than 2 pixels
++ **/
++int ispccdc_try_size(u32 input_w, u32 input_h, u32 *output_w, u32 *output_h)
++{
++ if (input_w < 32 || input_h < 32) {
++ DPRINTK_ISPCCDC("ISP_ERR: CCDC cannot handle input width less"
++ " than 32 pixels or height less than 32\n");
++ return -EINVAL;
++ }
++
++ if (ispccdc_obj.crop_w)
++ *output_w = ispccdc_obj.crop_w;
++ else
++ *output_w = input_w;
++
++ if (ispccdc_obj.crop_h)
++ *output_h = ispccdc_obj.crop_h;
++ else
++ *output_h = input_h;
++
++ if (!ispccdc_obj.refmt_en
++ && ispccdc_obj.ccdc_outfmt != CCDC_OTHERS_MEM
++ && ispccdc_obj.ccdc_outfmt != CCDC_OTHERS_VP_MEM)
++ *output_h -= 1;
++
++ if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_MEM
++ || ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP_MEM) {
++ if (*output_w % 16) {
++ *output_w -= (*output_w % 16);
++ *output_w += 16;
++ }
++ }
++
++ ispccdc_obj.ccdcout_w = *output_w;
++ ispccdc_obj.ccdcout_h = *output_h;
++ ispccdc_obj.ccdcin_w = input_w;
++ ispccdc_obj.ccdcin_h = input_h;
++
++ DPRINTK_ISPCCDC("try size: ccdcin_w=%u,ccdcin_h=%u,ccdcout_w=%u,"
++ " ccdcout_h=%u\n",
++ ispccdc_obj.ccdcin_w,
++ ispccdc_obj.ccdcin_h,
++ ispccdc_obj.ccdcout_w,
++ ispccdc_obj.ccdcout_h);
++
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_try_size);
++
++/**
++ * ispccdc_config_size - Configure the dimensions of the CCDC input/output
++ * @input_w: input width for the CCDC in number of pixels per line
++ * @input_h: input height for the CCDC in number of lines
++ * @output_w: output width from the CCDC in number of pixels per line
++ * @output_h: output height for the CCDC in number of lines
++ *
++ * Configures the appropriate values stored in the isp_ccdc structure to
++ * HORZ/VERT_INFO registers and the VP_OUT depending on whether the image
++ * is stored in memory or given to the another module in the ISP pipeline.
++ *
++ * Returns 0 if successful, or -EINVAL if try_size was not called before to
++ * validate the requested dimensions.
++ **/
++int ispccdc_config_size(u32 input_w, u32 input_h, u32 output_w, u32 output_h)
++{
++ DPRINTK_ISPCCDC("config size: input_w=%u, input_h=%u, output_w=%u,"
++ " output_h=%u\n",
++ input_w, input_h,
++ output_w, output_h);
++ if (output_w != ispccdc_obj.ccdcout_w
++ || output_h != ispccdc_obj.ccdcout_h) {
++ DPRINTK_ISPCCDC("ISP_ERR : ispccdc_try_size should"
++ " be called before config size\n");
++ return -EINVAL;
++ }
++
++ if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP) {
++ isp_reg_writel((ispccdc_obj.ccdcin_woffset <<
++ ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
++ (ispccdc_obj.ccdcin_w <<
++ ISPCCDC_FMT_HORZ_FMTLNH_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_HORZ);
++ isp_reg_writel((ispccdc_obj.ccdcin_hoffset <<
++ ISPCCDC_FMT_VERT_FMTSLV_SHIFT) |
++ (ispccdc_obj.ccdcin_h <<
++ ISPCCDC_FMT_VERT_FMTLNV_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_VERT);
++ isp_reg_writel((ispccdc_obj.ccdcout_w <<
++ ISPCCDC_VP_OUT_HORZ_NUM_SHIFT) |
++ (ispccdc_obj.ccdcout_h - 1) <<
++ ISPCCDC_VP_OUT_VERT_NUM_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VP_OUT);
++ isp_reg_writel((((ispccdc_obj.ccdcout_h - 25) &
++ ISPCCDC_VDINT_0_MASK) <<
++ ISPCCDC_VDINT_0_SHIFT) |
++ ((50 & ISPCCDC_VDINT_1_MASK) <<
++ ISPCCDC_VDINT_1_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VDINT);
++
++ } else if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_MEM) {
++ isp_reg_writel(0, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VP_OUT);
++ if (ispccdc_obj.ccdc_inpfmt == CCDC_RAW) {
++ isp_reg_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT
++ | ((ispccdc_obj.ccdcout_w - 1)
++ << ISPCCDC_HORZ_INFO_NPH_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_HORZ_INFO);
++ } else {
++ isp_reg_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT
++ | ((ispccdc_obj.ccdcout_w - 1)
++ << ISPCCDC_HORZ_INFO_NPH_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_HORZ_INFO);
++ }
++ isp_reg_writel(0 << ISPCCDC_VERT_START_SLV0_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_START);
++ isp_reg_writel((ispccdc_obj.ccdcout_h - 1) <<
++ ISPCCDC_VERT_LINES_NLV_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_LINES);
++
++ ispccdc_config_outlineoffset(ispccdc_obj.ccdcout_w * 2, 0, 0);
++ isp_reg_writel((((ispccdc_obj.ccdcout_h - 2) &
++ ISPCCDC_VDINT_0_MASK) <<
++ ISPCCDC_VDINT_0_SHIFT) |
++ ((100 & ISPCCDC_VDINT_1_MASK) <<
++ ISPCCDC_VDINT_1_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VDINT);
++ } else if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP_MEM) {
++ isp_reg_writel((0 << ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
++ (ispccdc_obj.ccdcin_w <<
++ ISPCCDC_FMT_HORZ_FMTLNH_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_HORZ);
++ isp_reg_writel((0 << ISPCCDC_FMT_VERT_FMTSLV_SHIFT) |
++ ((ispccdc_obj.ccdcin_h) <<
++ ISPCCDC_FMT_VERT_FMTLNV_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_FMT_VERT);
++ isp_reg_writel((ispccdc_obj.ccdcout_w
++ << ISPCCDC_VP_OUT_HORZ_NUM_SHIFT) |
++ ((ispccdc_obj.ccdcout_h - 1) <<
++ ISPCCDC_VP_OUT_VERT_NUM_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VP_OUT);
++ isp_reg_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT |
++ ((ispccdc_obj.ccdcout_w - 1) <<
++ ISPCCDC_HORZ_INFO_NPH_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_HORZ_INFO);
++ isp_reg_writel(0 << ISPCCDC_VERT_START_SLV0_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_START);
++ isp_reg_writel((ispccdc_obj.ccdcout_h - 1) <<
++ ISPCCDC_VERT_LINES_NLV_SHIFT,
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_LINES);
++ ispccdc_config_outlineoffset(ispccdc_obj.ccdcout_w * 2, 0, 0);
++ isp_reg_writel((((ispccdc_obj.ccdcout_h - 2) &
++ ISPCCDC_VDINT_0_MASK) <<
++ ISPCCDC_VDINT_0_SHIFT) |
++ ((100 & ISPCCDC_VDINT_1_MASK) <<
++ ISPCCDC_VDINT_1_SHIFT),
++ OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VDINT);
++ }
++
++ if (is_isplsc_activated()) {
++ if (ispccdc_obj.ccdc_inpfmt == CCDC_RAW) {
++ ispccdc_config_lsc(&lsc_config);
++ ispccdc_load_lsc(lsc_gain_table, lsc_config.size);
++ }
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_config_size);
++
++/**
++ * ispccdc_config_outlineoffset - Configures the output line offset
++ * @offset: Must be twice the Output width and aligned on 32 byte boundary
++ * @oddeven: Specifies the odd/even line pattern to be chosen to store the
++ * output.
++ * @numlines: Set the value 0-3 for +1-4lines, 4-7 for -1-4lines.
++ *
++ * - Configures the output line offset when stored in memory
++ * - Sets the odd/even line pattern to store the output
++ * (EVENEVEN (1), ODDEVEN (2), EVENODD (3), ODDODD (4))
++ * - Configures the number of even and odd line fields in case of rearranging
++ * the lines.
++ *
++ * Returns 0 if successful, or -EINVAL if the offset is not in 32 byte
++ * boundary.
++ **/
++int ispccdc_config_outlineoffset(u32 offset, u8 oddeven, u8 numlines)
++{
++ if ((offset & ISP_32B_BOUNDARY_OFFSET) == offset) {
++ isp_reg_writel((offset & 0xFFFF), OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_HSIZE_OFF);
++ } else {
++ DPRINTK_ISPCCDC("ISP_ERR : Offset should be in 32 byte"
++ " boundary\n");
++ return -EINVAL;
++ }
++
++ isp_reg_and(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ ~ISPCCDC_SDOFST_FINV);
++
++ isp_reg_and(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ ~ISPCCDC_SDOFST_FOFST_4L);
++
++ switch (oddeven) {
++ case EVENEVEN:
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ (numlines & 0x7) << ISPCCDC_SDOFST_LOFST0_SHIFT);
++ break;
++ case ODDEVEN:
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ (numlines & 0x7) << ISPCCDC_SDOFST_LOFST1_SHIFT);
++ break;
++ case EVENODD:
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ (numlines & 0x7) << ISPCCDC_SDOFST_LOFST2_SHIFT);
++ break;
++ case ODDODD:
++ isp_reg_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST,
++ (numlines & 0x7) << ISPCCDC_SDOFST_LOFST3_SHIFT);
++ break;
++ default:
++ break;
++ }
++ return 0;
++}
++EXPORT_SYMBOL(ispccdc_config_outlineoffset);
++
++/**
++ * ispccdc_set_outaddr - Sets the memory address where the output will be saved
++ * @addr: 32-bit memory address aligned on 32 byte boundary.
++ *
++ * Sets the memory address where the output will be saved.
++ *
++ * Returns 0 if successful, or -EINVAL if the address is not in the 32 byte
++ * boundary.
++ **/
++int ispccdc_set_outaddr(u32 addr)
++{
++ if ((addr & ISP_32B_BOUNDARY_BUF) == addr) {
++ isp_reg_writel(addr, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDR_ADDR);
++ return 0;
++ } else {
++ DPRINTK_ISPCCDC("ISP_ERR : Address should be in 32 byte"
++ " boundary\n");
++ return -EINVAL;
++ }
++
++}
++EXPORT_SYMBOL(ispccdc_set_outaddr);
++
++void __ispccdc_enable(u8 enable)
++{
++ if (enable) {
++ if (ispccdc_obj.lsc_enable
++ && ispccdc_obj.ccdc_inpfmt == CCDC_RAW)
++ ispccdc_enable_lsc(1);
++
++ } else {
++ ispccdc_obj.lsc_enable = ispccdc_obj.lsc_state;
++ }
++
++ isp_reg_and_or(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PCR, ~ISPCCDC_PCR_EN,
++ enable ? ISPCCDC_PCR_EN : 0);
++}
++
++/**
++ * ispccdc_enable - Enables the CCDC module.
++ * @enable: 0 Disables CCDC, 1 Enables CCDC
++ *
++ * Client should configure all the sub modules in CCDC before this.
++ **/
++void ispccdc_enable(u8 enable)
++{
++ __ispccdc_enable(enable);
++ ispccdc_obj.pm_state = enable;
++}
++EXPORT_SYMBOL(ispccdc_enable);
++
++/**
++ * ispccdc_suspend - Suspend the CCDC module.
++ **/
++void ispccdc_suspend(void)
++{
++ if (ispccdc_obj.pm_state) {
++ if (ispccdc_obj.lsc_state)
++ __ispccdc_enable_lsc(0);
++ else if (ispccdc_obj.lsc_enable) {
++ ispccdc_obj.lsc_state = 1;
++ ispccdc_obj.lsc_enable = 0;
++ }
++ __ispccdc_enable(0);
++ }
++}
++EXPORT_SYMBOL(ispccdc_suspend);
++
++/**
++ * ispccdc_resume - Resume the CCDC module.
++ **/
++void ispccdc_resume(void)
++{
++ if (ispccdc_obj.pm_state) {
++ if (ispccdc_obj.lsc_state)
++ __ispccdc_enable_lsc(1);
++ __ispccdc_enable(1);
++ }
++}
++EXPORT_SYMBOL(ispccdc_resume);
++
++/*
++ * Returns zero if the CCDC is idle and the image has been written to
++ * memory, too.
++ */
++int ispccdc_sbl_busy(void)
++{
++ return ispccdc_busy()
++ | (isp_reg_readl(OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_0) &
++ ISPSBL_CCDC_WR_0_DATA_READY)
++ | (isp_reg_readl(OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_1) &
++ ISPSBL_CCDC_WR_0_DATA_READY)
++ | (isp_reg_readl(OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_2) &
++ ISPSBL_CCDC_WR_0_DATA_READY)
++ | (isp_reg_readl(OMAP3_ISP_IOMEM_SBL, ISPSBL_CCDC_WR_3) &
++ ISPSBL_CCDC_WR_0_DATA_READY);
++}
++EXPORT_SYMBOL(ispccdc_sbl_busy);
++
++/**
++ * ispccdc_busy - Gets busy state of the CCDC.
++ **/
++int ispccdc_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PCR) &
++ ISPCCDC_PCR_BUSY;
++}
++EXPORT_SYMBOL(ispccdc_busy);
++
++/**
++ * ispccdc_save_context - Saves the values of the CCDC module registers
++ **/
++void ispccdc_save_context(void)
++{
++ DPRINTK_ISPCCDC("Saving context\n");
++ isp_save_context(ispccdc_reg_list);
++}
++EXPORT_SYMBOL(ispccdc_save_context);
++
++/**
++ * ispccdc_restore_context - Restores the values of the CCDC module registers
++ **/
++void ispccdc_restore_context(void)
++{
++ DPRINTK_ISPCCDC("Restoring context\n");
++ isp_restore_context(ispccdc_reg_list);
++}
++EXPORT_SYMBOL(ispccdc_restore_context);
++
++/**
++ * ispccdc_print_status - Prints the values of the CCDC Module registers
++ *
++ * Also prints other debug information stored in the CCDC module.
++ **/
++void ispccdc_print_status(void)
++{
++ if (!is_ispccdc_debug_enabled())
++ return;
++
++ DPRINTK_ISPCCDC("Module in use =%d\n", ispccdc_obj.ccdc_inuse);
++ DPRINTK_ISPCCDC("Accepted CCDC Input (width = %d,Height = %d)\n",
++ ispccdc_obj.ccdcin_w,
++ ispccdc_obj.ccdcin_h);
++ DPRINTK_ISPCCDC("Accepted CCDC Output (width = %d,Height = %d)\n",
++ ispccdc_obj.ccdcout_w,
++ ispccdc_obj.ccdcout_h);
++ DPRINTK_ISPCCDC("###CCDC PCR=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PCR));
++ DPRINTK_ISPCCDC("ISP_CTRL =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ switch (ispccdc_obj.ccdc_inpfmt) {
++ case CCDC_RAW:
++ DPRINTK_ISPCCDC("ccdc input format is CCDC_RAW\n");
++ break;
++ case CCDC_YUV_SYNC:
++ DPRINTK_ISPCCDC("ccdc input format is CCDC_YUV_SYNC\n");
++ break;
++ case CCDC_YUV_BT:
++ DPRINTK_ISPCCDC("ccdc input format is CCDC_YUV_BT\n");
++ break;
++ }
++
++ switch (ispccdc_obj.ccdc_outfmt) {
++ case CCDC_OTHERS_VP:
++ DPRINTK_ISPCCDC("ccdc output format is CCDC_OTHERS_VP\n");
++ break;
++ case CCDC_OTHERS_MEM:
++ DPRINTK_ISPCCDC("ccdc output format is CCDC_OTHERS_MEM\n");
++ break;
++ case CCDC_YUV_RSZ:
++ DPRINTK_ISPCCDC("ccdc output format is CCDC_YUV_RSZ\n");
++ break;
++ }
++
++ DPRINTK_ISPCCDC("###ISP_CTRL in ccdc =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ DPRINTK_ISPCCDC("###ISP_IRQ0ENABLE in ccdc =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE));
++ DPRINTK_ISPCCDC("###ISP_IRQ0STATUS in ccdc =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS));
++ DPRINTK_ISPCCDC("###CCDC SYN_MODE=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE));
++ DPRINTK_ISPCCDC("###CCDC HORZ_INFO=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HORZ_INFO));
++ DPRINTK_ISPCCDC("###CCDC VERT_START=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_START));
++ DPRINTK_ISPCCDC("###CCDC VERT_LINES=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_LINES));
++ DPRINTK_ISPCCDC("###CCDC CULLING=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CULLING));
++ DPRINTK_ISPCCDC("###CCDC HSIZE_OFF=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HSIZE_OFF));
++ DPRINTK_ISPCCDC("###CCDC SDOFST=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDOFST));
++ DPRINTK_ISPCCDC("###CCDC SDR_ADDR=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDR_ADDR));
++ DPRINTK_ISPCCDC("###CCDC CLAMP=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CLAMP));
++ DPRINTK_ISPCCDC("###CCDC COLPTN=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_COLPTN));
++ DPRINTK_ISPCCDC("###CCDC CFG=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG));
++ DPRINTK_ISPCCDC("###CCDC VP_OUT=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_VP_OUT));
++ DPRINTK_ISPCCDC("###CCDC_SDR_ADDR= 0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDR_ADDR));
++ DPRINTK_ISPCCDC("###CCDC FMTCFG=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG));
++ DPRINTK_ISPCCDC("###CCDC FMT_HORZ=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_HORZ));
++ DPRINTK_ISPCCDC("###CCDC FMT_VERT=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMT_VERT));
++ DPRINTK_ISPCCDC("###CCDC LSC_CONFIG=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_CONFIG));
++ DPRINTK_ISPCCDC("###CCDC LSC_INIT=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_INITIAL));
++ DPRINTK_ISPCCDC("###CCDC LSC_TABLE BASE=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_TABLE_BASE));
++ DPRINTK_ISPCCDC("###CCDC LSC TABLE OFFSET=0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_LSC_TABLE_OFFSET));
++}
++EXPORT_SYMBOL(ispccdc_print_status);
++
++/**
++ * isp_ccdc_init - CCDC module initialization.
++ *
++ * Always returns 0
++ **/
++int __init isp_ccdc_init(void)
++{
++ ispccdc_obj.ccdc_inuse = 0;
++ ispccdc_config_crop(0, 0, 0, 0);
++ mutex_init(&ispccdc_obj.mutexlock);
++
++ if (is_isplsc_activated()) {
++ lsc_gain_table_tmp = kmalloc(LSC_TABLE_INIT_SIZE, GFP_KERNEL |
++ GFP_DMA);
++ memset(lsc_gain_table_tmp, 0x40, LSC_TABLE_INIT_SIZE);
++ lsc_config.initial_x = 0;
++ lsc_config.initial_y = 0;
++ lsc_config.gain_mode_n = 0x6;
++ lsc_config.gain_mode_m = 0x6;
++ lsc_config.gain_format = 0x4;
++ lsc_config.offset = 0x60;
++ lsc_config.size = LSC_TABLE_INIT_SIZE;
++ ispccdc_obj.lsc_enable = 1;
++ }
++
++ return 0;
++}
++
++/**
++ * isp_ccdc_cleanup - CCDC module cleanup.
++ **/
++void isp_ccdc_cleanup(void)
++{
++ if (is_isplsc_activated()) {
++ ispccdc_free_lsc();
++ kfree(lsc_gain_table_tmp);
++ }
++
++ if (fpc_table_add_m != 0) {
++ ispmmu_kunmap(fpc_table_add_m);
++ kfree(fpc_table_add);
++ }
++}
+diff --git a/drivers/media/video/isp/ispccdc.h b/drivers/media/video/isp/ispccdc.h
+new file mode 100644
+index 0000000..4ef40a6
+--- /dev/null
++++ b/drivers/media/video/isp/ispccdc.h
+@@ -0,0 +1,209 @@
++/*
++ * ispccdc.h
++ *
++ * Driver header file for CCDC module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Senthilvadivu Guruswamy <svadivu@ti.com>
++ * Pallavi Kulkarni <p-kulkarni@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_CCDC_H
++#define OMAP_ISP_CCDC_H
++
++#include <mach/isp_user.h>
++
++#define is_isplsc_activated() 1
++
++/* Enumeration constants for CCDC input output format */
++enum ccdc_input {
++ CCDC_RAW,
++ CCDC_YUV_SYNC,
++ CCDC_YUV_BT,
++ CCDC_OTHERS
++};
++
++enum ccdc_output {
++ CCDC_YUV_RSZ,
++ CCDC_YUV_MEM_RSZ,
++ CCDC_OTHERS_VP,
++ CCDC_OTHERS_MEM,
++ CCDC_OTHERS_VP_MEM
++};
++
++/* Enumeration constants for the sync interface parameters */
++enum inpmode {
++ RAW,
++ YUV16,
++ YUV8
++};
++enum datasize {
++ DAT8,
++ DAT10,
++ DAT11,
++ DAT12
++};
++
++
++/**
++ * struct ispccdc_syncif - Structure for Sync Interface between sensor and CCDC
++ * @ccdc_mastermode: Master mode. 1 - Master, 0 - Slave.
++ * @fldstat: Field state. 0 - Odd Field, 1 - Even Field.
++ * @ipmod: Input mode.
++ * @datsz: Data size.
++ * @fldmode: 0 - Progressive, 1 - Interlaced.
++ * @datapol: 0 - Positive, 1 - Negative.
++ * @fldpol: 0 - Positive, 1 - Negative.
++ * @hdpol: 0 - Positive, 1 - Negative.
++ * @vdpol: 0 - Positive, 1 - Negative.
++ * @fldout: 0 - Input, 1 - Output.
++ * @hs_width: Width of the Horizontal Sync pulse, used for HS/VS Output.
++ * @vs_width: Width of the Vertical Sync pulse, used for HS/VS Output.
++ * @ppln: Number of pixels per line, used for HS/VS Output.
++ * @hlprf: Number of half lines per frame, used for HS/VS Output.
++ * @bt_r656_en: 1 - Enable ITU-R BT656 mode, 0 - Sync mode.
++ */
++struct ispccdc_syncif {
++ u8 ccdc_mastermode;
++ u8 fldstat;
++ enum inpmode ipmod;
++ enum datasize datsz;
++ u8 fldmode;
++ u8 datapol;
++ u8 fldpol;
++ u8 hdpol;
++ u8 vdpol;
++ u8 fldout;
++ u8 hs_width;
++ u8 vs_width;
++ u8 ppln;
++ u8 hlprf;
++ u8 bt_r656_en;
++};
++
++/**
++ * ispccdc_refmt - Structure for Reformatter parameters
++ * @lnalt: Line alternating mode enable. 0 - Enable, 1 - Disable.
++ * @lnum: Number of output lines from 1 input line. 1 to 4 lines.
++ * @plen_even: Number of program entries in even line minus 1.
++ * @plen_odd: Number of program entries in odd line minus 1.
++ * @prgeven0: Program entries 0-7 for even lines register
++ * @prgeven1: Program entries 8-15 for even lines register
++ * @prgodd0: Program entries 0-7 for odd lines register
++ * @prgodd1: Program entries 8-15 for odd lines register
++ * @fmtaddr0: Output line in which the original pixel is to be placed
++ * @fmtaddr1: Output line in which the original pixel is to be placed
++ * @fmtaddr2: Output line in which the original pixel is to be placed
++ * @fmtaddr3: Output line in which the original pixel is to be placed
++ * @fmtaddr4: Output line in which the original pixel is to be placed
++ * @fmtaddr5: Output line in which the original pixel is to be placed
++ * @fmtaddr6: Output line in which the original pixel is to be placed
++ * @fmtaddr7: Output line in which the original pixel is to be placed
++ */
++struct ispccdc_refmt {
++ u8 lnalt;
++ u8 lnum;
++ u8 plen_even;
++ u8 plen_odd;
++ u32 prgeven0;
++ u32 prgeven1;
++ u32 prgodd0;
++ u32 prgodd1;
++ u32 fmtaddr0;
++ u32 fmtaddr1;
++ u32 fmtaddr2;
++ u32 fmtaddr3;
++ u32 fmtaddr4;
++ u32 fmtaddr5;
++ u32 fmtaddr6;
++ u32 fmtaddr7;
++};
++
++int ispccdc_request(void);
++
++int ispccdc_free(void);
++
++int ispccdc_config_datapath(enum ccdc_input input, enum ccdc_output output);
++
++void ispccdc_config_crop(u32 left, u32 top, u32 height, u32 width);
++
++void ispccdc_config_sync_if(struct ispccdc_syncif syncif);
++
++int ispccdc_config_black_clamp(struct ispccdc_bclamp bclamp);
++
++void ispccdc_enable_black_clamp(u8 enable);
++
++int ispccdc_config_fpc(struct ispccdc_fpc fpc);
++
++void ispccdc_enable_fpc(u8 enable);
++
++void ispccdc_config_black_comp(struct ispccdc_blcomp blcomp);
++
++void ispccdc_config_vp(struct ispccdc_vp vp);
++
++void ispccdc_enable_vp(u8 enable);
++
++void ispccdc_config_reformatter(struct ispccdc_refmt refmt);
++
++void ispccdc_enable_reformatter(u8 enable);
++
++void ispccdc_config_culling(struct ispccdc_culling culling);
++
++void ispccdc_enable_lpf(u8 enable);
++
++void ispccdc_config_alaw(enum alaw_ipwidth ipwidth);
++
++void ispccdc_enable_alaw(u8 enable);
++
++int ispccdc_load_lsc(u8 *table_addr, u32 table_size);
++
++void ispccdc_config_lsc(struct ispccdc_lsc_config *lsc_cfg);
++
++void ispccdc_enable_lsc(u8 enable);
++
++void ispccdc_lsc_error_handler(void);
++
++void ispccdc_config_imgattr(u32 colptn);
++
++void ispccdc_config_shadow_registers(void);
++
++int ispccdc_try_size(u32 input_w, u32 input_h, u32 *output_w, u32 *output_h);
++
++int ispccdc_config_size(u32 input_w, u32 input_h, u32 output_w, u32 output_h);
++
++int ispccdc_config_outlineoffset(u32 offset, u8 oddeven, u8 numlines);
++
++int ispccdc_set_outaddr(u32 addr);
++
++void ispccdc_enable(u8 enable);
++
++void ispccdc_suspend(void);
++
++void ispccdc_resume(void);
++
++int ispccdc_sbl_busy(void);
++
++int ispccdc_busy(void);
++
++void ispccdc_save_context(void);
++
++void ispccdc_restore_context(void);
++
++void ispccdc_print_status(void);
++
++int omap34xx_isp_ccdc_config(void *userspace_add);
++
++void ispccdc_set_wenlog(u32 wenlog);
++
++#endif /* OMAP_ISP_CCDC_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0005-omap3isp-Add-ISP-backend-PRV-and-RSZ.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0005-omap3isp-Add-ISP-backend-PRV-and-RSZ.patch
new file mode 100644
index 0000000000..c549eadc88
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0005-omap3isp-Add-ISP-backend-PRV-and-RSZ.patch
@@ -0,0 +1,3413 @@
+From 926b51afea146826c8076e5fb305eaa0332399b4 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add ISP backend (PRV and RSZ)
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/isppreview.c | 1929 ++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/isppreview.h | 354 +++++++
+ drivers/media/video/isp/ispresizer.c | 928 ++++++++++++++++
+ drivers/media/video/isp/ispresizer.h | 158 +++
+ 4 files changed, 3369 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/isppreview.c
+ create mode 100644 drivers/media/video/isp/isppreview.h
+ create mode 100644 drivers/media/video/isp/ispresizer.c
+ create mode 100644 drivers/media/video/isp/ispresizer.h
+
+diff --git a/drivers/media/video/isp/isppreview.c b/drivers/media/video/isp/isppreview.c
+new file mode 100644
+index 0000000..17f1abc
+--- /dev/null
++++ b/drivers/media/video/isp/isppreview.c
+@@ -0,0 +1,1929 @@
++/*
++ * isppreview.c
++ *
++ * Driver Library for Preview module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Senthilvadivu Guruswamy <svadivu@ti.com>
++ * Pallavi Kulkarni <p-kulkarni@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/mutex.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "isppreview.h"
++
++static struct ispprev_nf prev_nf_t;
++static struct prev_params *params;
++static int rg_update, gg_update, bg_update, nf_enable, nf_update;
++
++/* Structure for saving/restoring preview module registers */
++static struct isp_reg ispprev_reg_list[] = {
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_HORZ_INFO, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_VERT_INFO, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RSDR_ADDR, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RADR_OFFSET, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_DSDR_ADDR, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_DRKF_OFFSET, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_WSDR_ADDR, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_WADD_OFFSET, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_AVE, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_HMED, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_NF, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_WB_DGAIN, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_WBGAIN, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_WBSEL, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CFA, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_BLKADJOFF, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT1, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT2, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT3, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT4, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT5, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF1, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF2, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC0, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC1, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC2, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC_OFFSET, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CSUP, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_SETUP_YC, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR0, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR1, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR2, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR3, 0x0000},
++ {OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, 0x0000},
++ {0, ISP_TOK_TERM, 0x0000}
++};
++
++
++/* Default values in Office Flourescent Light for RGBtoRGB Blending */
++static struct ispprev_rgbtorgb flr_rgb2rgb = {
++ { /* RGB-RGB Matrix */
++ {0x01E2, 0x0F30, 0x0FEE},
++ {0x0F9B, 0x01AC, 0x0FB9},
++ {0x0FE0, 0x0EC0, 0x0260}
++ }, /* RGB Offset */
++ {0x0000, 0x0000, 0x0000}
++};
++
++/* Default values in Office Flourescent Light for RGB to YUV Conversion*/
++static struct ispprev_csc flr_prev_csc[] = {
++ {
++ { /* CSC Coef Matrix */
++ {66, 129, 25},
++ {-38, -75, 112},
++ {112, -94 , -18}
++ }, /* CSC Offset */
++ {0x0, 0x0, 0x0}
++ },
++ {
++ { /* CSC Coef Matrix BW */
++ {66, 129, 25},
++ {0, 0, 0},
++ {0, 0, 0}
++ }, /* CSC Offset */
++ {0x0, 0x0, 0x0}
++ },
++ {
++ { /* CSC Coef Matrix Sepia */
++ {19, 38, 7},
++ {0, 0, 0},
++ {0, 0, 0}
++ }, /* CSC Offset */
++ {0x0, 0xE7, 0x14}
++ }
++};
++
++
++/* Default values in Office Flourescent Light for CFA Gradient*/
++#define FLR_CFA_GRADTHRS_HORZ 0x28
++#define FLR_CFA_GRADTHRS_VERT 0x28
++
++/* Default values in Office Flourescent Light for Chroma Suppression*/
++#define FLR_CSUP_GAIN 0x0D
++#define FLR_CSUP_THRES 0xEB
++
++/* Default values in Office Flourescent Light for Noise Filter*/
++#define FLR_NF_STRGTH 0x03
++
++/* Default values in Office Flourescent Light for White Balance*/
++#define FLR_WBAL_DGAIN 0x100
++#define FLR_WBAL_COEF0 0x20
++#define FLR_WBAL_COEF1 0x29
++#define FLR_WBAL_COEF2 0x2d
++#define FLR_WBAL_COEF3 0x20
++
++#define FLR_WBAL_COEF0_ES1 0x20
++#define FLR_WBAL_COEF1_ES1 0x23
++#define FLR_WBAL_COEF2_ES1 0x39
++#define FLR_WBAL_COEF3_ES1 0x20
++
++/* Default values in Office Flourescent Light for Black Adjustment*/
++#define FLR_BLKADJ_BLUE 0x0
++#define FLR_BLKADJ_GREEN 0x0
++#define FLR_BLKADJ_RED 0x0
++
++static int update_color_matrix;
++
++/**
++ * struct isp_prev - Structure for storing ISP Preview module information
++ * @prev_inuse: Flag to determine if CCDC has been reserved or not (0 or 1).
++ * @prevout_w: Preview output width.
++ * @prevout_h: Preview output height.
++ * @previn_w: Preview input width.
++ * @previn_h: Preview input height.
++ * @prev_inpfmt: Preview input format.
++ * @prev_outfmt: Preview output format.
++ * @hmed_en: Horizontal median filter enable.
++ * @nf_en: Noise filter enable.
++ * @dcor_en: Defect correction enable.
++ * @cfa_en: Color Filter Array (CFA) interpolation enable.
++ * @csup_en: Chrominance suppression enable.
++ * @yenh_en: Luma enhancement enable.
++ * @fmtavg: Number of horizontal pixels to average in input formatter. The
++ * input width should be a multiple of this number.
++ * @brightness: Brightness in preview module.
++ * @contrast: Contrast in preview module.
++ * @color: Color effect in preview module.
++ * @cfafmt: Color Filter Array (CFA) Format.
++ * @ispprev_mutex: Mutex for isp preview.
++ *
++ * This structure is used to store the OMAP ISP Preview module Information.
++ */
++static struct isp_prev {
++ int pm_state;
++ u8 prev_inuse;
++ u32 prevout_w;
++ u32 prevout_h;
++ u32 previn_w;
++ u32 previn_h;
++ enum preview_input prev_inpfmt;
++ enum preview_output prev_outfmt;
++ u8 hmed_en;
++ u8 nf_en;
++ u8 dcor_en;
++ u8 cfa_en;
++ u8 csup_en;
++ u8 yenh_en;
++ u8 fmtavg;
++ u8 brightness;
++ u8 contrast;
++ enum v4l2_colorfx color;
++ enum cfa_fmt cfafmt;
++ struct mutex ispprev_mutex; /* For checking/modifying prev_inuse */
++ u32 sph;
++ u32 slv;
++} ispprev_obj;
++
++/* Saved parameters */
++static struct prev_params *prev_config_params;
++
++/*
++ * Coeficient Tables for the submodules in Preview.
++ * Array is initialised with the values from.the tables text file.
++ */
++
++/*
++ * CFA Filter Coefficient Table
++ *
++ */
++static u32 cfa_coef_table[] = {
++#include "cfa_coef_table.h"
++};
++
++/*
++ * Gamma Correction Table - Red
++ */
++static u32 redgamma_table[] = {
++#include "redgamma_table.h"
++};
++
++/*
++ * Gamma Correction Table - Green
++ */
++static u32 greengamma_table[] = {
++#include "greengamma_table.h"
++};
++
++/*
++ * Gamma Correction Table - Blue
++ */
++static u32 bluegamma_table[] = {
++#include "bluegamma_table.h"
++};
++
++/*
++ * Noise Filter Threshold table
++ */
++static u32 noise_filter_table[] = {
++#include "noise_filter_table.h"
++};
++
++/*
++ * Luminance Enhancement Table
++ */
++static u32 luma_enhance_table[] = {
++#include "luma_enhance_table.h"
++};
++
++/**
++ * omap34xx_isp_preview_config - Abstraction layer Preview configuration.
++ * @userspace_add: Pointer from Userspace to structure with flags and data to
++ * update.
++ **/
++int omap34xx_isp_preview_config(void *userspace_add)
++{
++ struct ispprev_hmed prev_hmed_t;
++ struct ispprev_cfa prev_cfa_t;
++ struct ispprev_csup csup_t;
++ struct ispprev_wbal prev_wbal_t;
++ struct ispprev_blkadj prev_blkadj_t;
++ struct ispprev_rgbtorgb rgb2rgb_t;
++ struct ispprev_csc prev_csc_t;
++ struct ispprev_yclimit yclimit_t;
++ struct ispprev_dcor prev_dcor_t;
++ struct ispprv_update_config *preview_struct;
++ struct isptables_update isp_table_update;
++ int yen_t[ISPPRV_YENH_TBL_SIZE];
++
++ if (userspace_add == NULL)
++ return -EINVAL;
++
++ preview_struct = userspace_add;
++
++ if (ISP_ABS_PREV_LUMAENH & preview_struct->flag) {
++ if (ISP_ABS_PREV_LUMAENH & preview_struct->update) {
++ if (copy_from_user(yen_t, preview_struct->yen,
++ sizeof(yen_t)))
++ goto err_copy_from_user;
++ isppreview_config_luma_enhancement(yen_t);
++ }
++ params->features |= PREV_LUMA_ENHANCE;
++ } else if (ISP_ABS_PREV_LUMAENH & preview_struct->update)
++ params->features &= ~PREV_LUMA_ENHANCE;
++
++ if (ISP_ABS_PREV_INVALAW & preview_struct->flag) {
++ isppreview_enable_invalaw(1);
++ params->features |= PREV_INVERSE_ALAW;
++ } else {
++ isppreview_enable_invalaw(0);
++ params->features &= ~PREV_INVERSE_ALAW;
++ }
++
++ if (ISP_ABS_PREV_HRZ_MED & preview_struct->flag) {
++ if (ISP_ABS_PREV_HRZ_MED & preview_struct->update) {
++ if (copy_from_user(&prev_hmed_t,
++ (struct ispprev_hmed *)
++ preview_struct->prev_hmed,
++ sizeof(struct ispprev_hmed)))
++ goto err_copy_from_user;
++ isppreview_config_hmed(prev_hmed_t);
++ }
++ isppreview_enable_hmed(1);
++ params->features |= PREV_HORZ_MEDIAN_FILTER;
++ } else if (ISP_ABS_PREV_HRZ_MED & preview_struct->update) {
++ isppreview_enable_hmed(0);
++ params->features &= ~PREV_HORZ_MEDIAN_FILTER;
++ }
++
++ if (ISP_ABS_PREV_CFA & preview_struct->flag) {
++ if (ISP_ABS_PREV_CFA & preview_struct->update) {
++ if (copy_from_user(&prev_cfa_t,
++ (struct ispprev_cfa *)
++ preview_struct->prev_cfa,
++ sizeof(struct ispprev_cfa)))
++ goto err_copy_from_user;
++
++ isppreview_config_cfa(prev_cfa_t);
++ }
++ isppreview_enable_cfa(1);
++ params->features |= PREV_CFA;
++ } else if (ISP_ABS_PREV_CFA & preview_struct->update) {
++ isppreview_enable_cfa(0);
++ params->features &= ~PREV_CFA;
++ }
++
++ if (ISP_ABS_PREV_CHROMA_SUPP & preview_struct->flag) {
++ if (ISP_ABS_PREV_CHROMA_SUPP & preview_struct->update) {
++ if (copy_from_user(&csup_t,
++ (struct ispprev_csup *)
++ preview_struct->csup,
++ sizeof(struct ispprev_csup)))
++ goto err_copy_from_user;
++ isppreview_config_chroma_suppression(csup_t);
++ }
++ isppreview_enable_chroma_suppression(1);
++ params->features |= PREV_CHROMA_SUPPRESS;
++ } else if (ISP_ABS_PREV_CHROMA_SUPP & preview_struct->update) {
++ isppreview_enable_chroma_suppression(0);
++ params->features &= ~PREV_CHROMA_SUPPRESS;
++ }
++
++ if (ISP_ABS_PREV_WB & preview_struct->update) {
++ if (copy_from_user(&prev_wbal_t, (struct ispprev_wbal *)
++ preview_struct->prev_wbal,
++ sizeof(struct ispprev_wbal)))
++ goto err_copy_from_user;
++ isppreview_config_whitebalance(prev_wbal_t);
++ }
++
++ if (ISP_ABS_PREV_BLKADJ & preview_struct->update) {
++ if (copy_from_user(&prev_blkadj_t, (struct ispprev_blkadjl *)
++ preview_struct->prev_blkadj,
++ sizeof(struct ispprev_blkadj)))
++ goto err_copy_from_user;
++ isppreview_config_blkadj(prev_blkadj_t);
++ }
++
++ if (ISP_ABS_PREV_RGB2RGB & preview_struct->update) {
++ if (copy_from_user(&rgb2rgb_t, (struct ispprev_rgbtorgb *)
++ preview_struct->rgb2rgb,
++ sizeof(struct ispprev_rgbtorgb)))
++ goto err_copy_from_user;
++ isppreview_config_rgb_blending(rgb2rgb_t);
++ }
++
++ if (ISP_ABS_PREV_COLOR_CONV & preview_struct->update) {
++ if (copy_from_user(&prev_csc_t, (struct ispprev_csc *)
++ preview_struct->prev_csc,
++ sizeof(struct ispprev_csc)))
++ goto err_copy_from_user;
++ isppreview_config_rgb_to_ycbcr(prev_csc_t);
++ }
++
++ if (ISP_ABS_PREV_YC_LIMIT & preview_struct->update) {
++ if (copy_from_user(&yclimit_t, (struct ispprev_yclimit *)
++ preview_struct->yclimit,
++ sizeof(struct ispprev_yclimit)))
++ goto err_copy_from_user;
++ isppreview_config_yc_range(yclimit_t);
++ }
++
++ if (ISP_ABS_PREV_DEFECT_COR & preview_struct->flag) {
++ if (ISP_ABS_PREV_DEFECT_COR & preview_struct->update) {
++ if (copy_from_user(&prev_dcor_t,
++ (struct ispprev_dcor *)
++ preview_struct->prev_dcor,
++ sizeof(struct ispprev_dcor)))
++ goto err_copy_from_user;
++ isppreview_config_dcor(prev_dcor_t);
++ }
++ isppreview_enable_dcor(1);
++ params->features |= PREV_DEFECT_COR;
++ } else if (ISP_ABS_PREV_DEFECT_COR & preview_struct->update) {
++ isppreview_enable_dcor(0);
++ params->features &= ~PREV_DEFECT_COR;
++ }
++
++ if (ISP_ABS_PREV_GAMMABYPASS & preview_struct->flag) {
++ isppreview_enable_gammabypass(1);
++ params->features |= PREV_GAMMA_BYPASS;
++ } else {
++ isppreview_enable_gammabypass(0);
++ params->features &= ~PREV_GAMMA_BYPASS;
++ }
++
++ isp_table_update.update = preview_struct->update;
++ isp_table_update.flag = preview_struct->flag;
++ isp_table_update.prev_nf = preview_struct->prev_nf;
++ isp_table_update.red_gamma = preview_struct->red_gamma;
++ isp_table_update.green_gamma = preview_struct->green_gamma;
++ isp_table_update.blue_gamma = preview_struct->blue_gamma;
++
++ if (omap34xx_isp_tables_update(&isp_table_update))
++ goto err_copy_from_user;
++
++ return 0;
++
++err_copy_from_user:
++ printk(KERN_ERR "Preview Config: Copy From User Error\n");
++ return -EFAULT;
++}
++EXPORT_SYMBOL_GPL(omap34xx_isp_preview_config);
++
++/**
++ * omap34xx_isp_tables_update - Abstraction layer Tables update.
++ * @isptables_struct: Pointer from Userspace to structure with flags and table
++ * data to update.
++ **/
++int omap34xx_isp_tables_update(struct isptables_update *isptables_struct)
++{
++
++ if (ISP_ABS_TBL_NF & isptables_struct->flag) {
++ nf_enable = 1;
++ params->features |= PREV_NOISE_FILTER;
++ if (ISP_ABS_TBL_NF & isptables_struct->update) {
++ if (copy_from_user(&prev_nf_t, (struct ispprev_nf *)
++ isptables_struct->prev_nf,
++ sizeof(struct ispprev_nf)))
++ goto err_copy_from_user;
++
++ nf_update = 1;
++ } else
++ nf_update = 0;
++ } else {
++ nf_enable = 0;
++ params->features &= ~PREV_NOISE_FILTER;
++ if (ISP_ABS_TBL_NF & isptables_struct->update)
++ nf_update = 1;
++ else
++ nf_update = 0;
++ }
++
++ if (ISP_ABS_TBL_REDGAMMA & isptables_struct->update) {
++ if (copy_from_user(redgamma_table, isptables_struct->red_gamma,
++ sizeof(redgamma_table))) {
++ goto err_copy_from_user;
++ }
++ rg_update = 1;
++ } else
++ rg_update = 0;
++
++ if (ISP_ABS_TBL_GREENGAMMA & isptables_struct->update) {
++ if (copy_from_user(greengamma_table,
++ isptables_struct->green_gamma,
++ sizeof(greengamma_table)))
++ goto err_copy_from_user;
++ gg_update = 1;
++ } else
++ gg_update = 0;
++
++ if (ISP_ABS_TBL_BLUEGAMMA & isptables_struct->update) {
++ if (copy_from_user(bluegamma_table,
++ isptables_struct->blue_gamma,
++ sizeof(bluegamma_table))) {
++ goto err_copy_from_user;
++ }
++ bg_update = 1;
++ } else
++ bg_update = 0;
++
++ return 0;
++
++err_copy_from_user:
++ printk(KERN_ERR "Preview Tables:Copy From User Error\n");
++ return -EFAULT;
++}
++
++/**
++ * isppreview_config_shadow_registers - Program shadow registers for preview.
++ *
++ * Allows user to program shadow registers associated with preview module.
++ **/
++void isppreview_config_shadow_registers()
++{
++ u8 current_brightness_contrast;
++ int ctr, prv_disabled;
++
++ isppreview_query_brightness(&current_brightness_contrast);
++ if (current_brightness_contrast !=
++ (ispprev_obj.brightness * ISPPRV_BRIGHT_UNITS)) {
++ DPRINTK_ISPPREV(" Changing Brightness level to %d\n",
++ ispprev_obj.brightness);
++ isppreview_config_brightness(ispprev_obj.brightness *
++ ISPPRV_BRIGHT_UNITS);
++ }
++
++ isppreview_query_contrast(&current_brightness_contrast);
++ if (current_brightness_contrast !=
++ (ispprev_obj.contrast * ISPPRV_CONTRAST_UNITS)) {
++ DPRINTK_ISPPREV(" Changing Contrast level to %d\n",
++ ispprev_obj.contrast);
++ isppreview_config_contrast(ispprev_obj.contrast *
++ ISPPRV_CONTRAST_UNITS);
++ }
++ if (update_color_matrix) {
++ isppreview_config_rgb_to_ycbcr(flr_prev_csc[ispprev_obj.color]);
++ update_color_matrix = 0;
++ }
++ if (gg_update || rg_update || bg_update || nf_update) {
++ isppreview_enable(0);
++ prv_disabled = 1;
++ }
++
++ if (gg_update) {
++ isp_reg_writel(ISPPRV_TBL_ADDR_GREEN_G_START,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++
++ for (ctr = 0; ctr < ISP_GAMMA_TABLE_SIZE; ctr++) {
++ isp_reg_writel(greengamma_table[ctr],
++ OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_DATA);
++ }
++ gg_update = 0;
++ }
++
++ if (rg_update) {
++ isp_reg_writel(ISPPRV_TBL_ADDR_RED_G_START,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++
++ for (ctr = 0; ctr < ISP_GAMMA_TABLE_SIZE; ctr++) {
++ isp_reg_writel(redgamma_table[ctr],
++ OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_DATA);
++ }
++ rg_update = 0;
++ }
++
++ if (bg_update) {
++ isp_reg_writel(ISPPRV_TBL_ADDR_BLUE_G_START,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++
++ for (ctr = 0; ctr < ISP_GAMMA_TABLE_SIZE; ctr++) {
++ isp_reg_writel(bluegamma_table[ctr],
++ OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_DATA);
++ }
++ bg_update = 0;
++ }
++
++ if (nf_update && nf_enable) {
++ isp_reg_writel(0xC00,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++ isp_reg_writel(prev_nf_t.spread,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_NF);
++ for (ctr = 0; ctr < ISPPRV_NF_TBL_SIZE; ctr++) {
++ isp_reg_writel(prev_nf_t.table[ctr],
++ OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_DATA);
++ }
++ isppreview_enable_noisefilter(1);
++ nf_update = 0;
++ }
++
++ if (~nf_update && nf_enable)
++ isppreview_enable_noisefilter(1);
++
++ if (nf_update && ~nf_enable)
++ isppreview_enable_noisefilter(0);
++
++ if (prv_disabled) {
++ isppreview_enable(1);
++ prv_disabled = 0;
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_shadow_registers);
++
++/**
++ * isppreview_request - Reserves the preview module.
++ *
++ * Returns 0 if successful, or -EBUSY if the module was already reserved.
++ **/
++int isppreview_request()
++{
++ mutex_lock(&ispprev_obj.ispprev_mutex);
++ if (ispprev_obj.prev_inuse) {
++ mutex_unlock(&ispprev_obj.ispprev_mutex);
++ printk(KERN_ERR "ISP_ERR : Preview Module Busy\n");
++ return -EBUSY;
++ }
++ ispprev_obj.prev_inuse = 1;
++ mutex_unlock(&ispprev_obj.ispprev_mutex);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL, ISPCTRL_PREV_RAM_EN |
++ ISPCTRL_PREV_CLK_EN |
++ ISPCTRL_SBL_WR1_RAM_EN);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_request);
++
++/**
++ * isppreview_free - Frees the preview module.
++ *
++ * Returns 0 if successful, or -EINVAL if the module was already freed.
++ **/
++int isppreview_free()
++{
++ mutex_lock(&ispprev_obj.ispprev_mutex);
++ if (ispprev_obj.prev_inuse) {
++ ispprev_obj.prev_inuse = 0;
++ mutex_unlock(&ispprev_obj.ispprev_mutex);
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
++ ~(ISPCTRL_PREV_CLK_EN |
++ ISPCTRL_PREV_RAM_EN |
++ ISPCTRL_SBL_WR1_RAM_EN));
++ return 0;
++ } else {
++ mutex_unlock(&ispprev_obj.ispprev_mutex);
++ DPRINTK_ISPPREV("ISP_ERR : Preview Module already freed\n");
++ return -EINVAL;
++ }
++
++}
++EXPORT_SYMBOL_GPL(isppreview_free);
++
++/** isppreview_config_datapath - Specifies input and output modules for Preview
++ * @input: Indicates the module that gives the image to preview.
++ * @output: Indicates the module to which the preview outputs to.
++ *
++ * Configures the default configuration for the CCDC to work with.
++ *
++ * The valid values for the input are PRV_RAW_CCDC (0), PRV_RAW_MEM (1),
++ * PRV_RGBBAYERCFA (2), PRV_COMPCFA (3), PRV_CCDC_DRKF (4), PRV_OTHERS (5).
++ *
++ * The valid values for the output are PREVIEW_RSZ (0), PREVIEW_MEM (1).
++ *
++ * Returns 0 if successful, or -EINVAL if wrong input or output values are
++ * specified.
++ **/
++int isppreview_config_datapath(enum preview_input input,
++ enum preview_output output)
++{
++ u32 pcr = 0;
++ u8 enable = 0;
++ struct prev_params *params = prev_config_params;
++ struct ispprev_yclimit yclimit;
++
++ pcr = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++
++ switch (input) {
++ case PRV_RAW_CCDC:
++ pcr &= ~ISPPRV_PCR_SOURCE;
++ pcr &= ~ISPPRV_PCR_ONESHOT;
++ ispprev_obj.prev_inpfmt = PRV_RAW_CCDC;
++ break;
++ case PRV_RAW_MEM:
++ pcr |= ISPPRV_PCR_SOURCE;
++ pcr |= ISPPRV_PCR_ONESHOT;
++ ispprev_obj.prev_inpfmt = PRV_RAW_MEM;
++ break;
++ case PRV_CCDC_DRKF:
++ pcr |= ISPPRV_PCR_DRKFCAP;
++ pcr |= ISPPRV_PCR_ONESHOT;
++ ispprev_obj.prev_inpfmt = PRV_CCDC_DRKF;
++ break;
++ case PRV_COMPCFA:
++ ispprev_obj.prev_inpfmt = PRV_COMPCFA;
++ break;
++ case PRV_OTHERS:
++ ispprev_obj.prev_inpfmt = PRV_OTHERS;
++ break;
++ case PRV_RGBBAYERCFA:
++ ispprev_obj.prev_inpfmt = PRV_RGBBAYERCFA;
++ break;
++ default:
++ printk(KERN_ERR "ISP_ERR : Wrong Input\n");
++ return -EINVAL;
++ };
++
++ switch (output) {
++ case PREVIEW_RSZ:
++ pcr |= ISPPRV_PCR_RSZPORT;
++ pcr &= ~ISPPRV_PCR_SDRPORT;
++ break;
++ case PREVIEW_MEM:
++ pcr &= ~ISPPRV_PCR_RSZPORT;
++ pcr |= ISPPRV_PCR_SDRPORT;
++ break;
++ default:
++ printk(KERN_ERR "ISP_ERR : Wrong Output\n");
++ return -EINVAL;
++ }
++ ispprev_obj.prev_outfmt = output;
++
++ isp_reg_writel(pcr, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++
++ isppreview_config_ycpos(params->pix_fmt);
++
++ if (params->cfa.cfa_table != NULL)
++ isppreview_config_cfa(params->cfa);
++ if (params->csup.hypf_en == 1)
++ isppreview_config_chroma_suppression(params->csup);
++ if (params->ytable != NULL)
++ isppreview_config_luma_enhancement(params->ytable);
++
++ if (params->gtable.redtable != NULL)
++ isppreview_config_gammacorrn(params->gtable);
++
++ enable = (params->features & PREV_CFA) ? 1 : 0;
++ isppreview_enable_cfa(enable);
++
++ enable = (params->features & PREV_CHROMA_SUPPRESS) ? 1 : 0;
++ isppreview_enable_chroma_suppression(enable);
++
++ enable = (params->features & PREV_LUMA_ENHANCE) ? 1 : 0;
++ isppreview_enable_luma_enhancement(enable);
++
++ enable = (params->features & PREV_NOISE_FILTER) ? 1 : 0;
++ if (enable)
++ isppreview_config_noisefilter(params->nf);
++ isppreview_enable_noisefilter(enable);
++
++ enable = (params->features & PREV_DEFECT_COR) ? 1 : 0;
++ if (enable)
++ isppreview_config_dcor(params->dcor);
++ isppreview_enable_dcor(enable);
++
++ enable = (params->features & PREV_GAMMA_BYPASS) ? 1 : 0;
++ isppreview_enable_gammabypass(enable);
++
++ isppreview_config_whitebalance(params->wbal);
++ isppreview_config_blkadj(params->blk_adj);
++ isppreview_config_rgb_blending(params->rgb2rgb);
++ isppreview_config_rgb_to_ycbcr(params->rgb2ycbcr);
++
++ isppreview_config_contrast(params->contrast * ISPPRV_CONTRAST_UNITS);
++ isppreview_config_brightness(params->brightness * ISPPRV_BRIGHT_UNITS);
++
++ yclimit.minC = ISPPRV_YC_MIN;
++ yclimit.maxC = ISPPRV_YC_MAX;
++ yclimit.minY = ISPPRV_YC_MIN;
++ yclimit.maxY = ISPPRV_YC_MAX;
++ isppreview_config_yc_range(yclimit);
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_config_datapath);
++
++/**
++ * isppreview_set_skip - Set the number of rows/columns that should be skipped.
++ * h - Start Pixel Horizontal.
++ * v - Start Line Vertical.
++ **/
++void isppreview_set_skip(u32 h, u32 v)
++{
++ ispprev_obj.sph = h;
++ ispprev_obj.slv = v;
++}
++EXPORT_SYMBOL_GPL(isppreview_set_skip);
++
++/**
++ * isppreview_config_ycpos - Configure byte layout of YUV image.
++ * @mode: Indicates the required byte layout.
++ **/
++void isppreview_config_ycpos(enum preview_ycpos_mode mode)
++{
++ u32 pcr = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++ pcr &= ~ISPPRV_PCR_YCPOS_CrYCbY;
++ pcr |= (mode << ISPPRV_PCR_YCPOS_SHIFT);
++ isp_reg_writel(pcr, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_ycpos);
++
++/**
++ * isppreview_config_averager - Enable / disable / configure averager
++ * @average: Average value to be configured.
++ **/
++void isppreview_config_averager(u8 average)
++{
++ int reg = 0;
++
++ reg = AVE_ODD_PIXEL_DIST | AVE_EVEN_PIXEL_DIST | average;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_PREV, ISPPRV_AVE);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_averager);
++
++/**
++ * isppreview_enable_invalaw - Enable/Disable Inverse A-Law module in Preview.
++ * @enable: 1 - Reverse the A-Law done in CCDC.
++ **/
++void isppreview_enable_invalaw(u8 enable)
++{
++ u32 pcr_val = 0;
++ pcr_val = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++
++ if (enable) {
++ isp_reg_writel(pcr_val | ISPPRV_PCR_WIDTH | ISPPRV_PCR_INVALAW,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++ } else {
++ isp_reg_writel(pcr_val &
++ ~(ISPPRV_PCR_WIDTH | ISPPRV_PCR_INVALAW),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_invalaw);
++
++/**
++ * isppreview_enable_drkframe - Enable/Disable of the darkframe subtract.
++ * @enable: 1 - Acquires memory bandwidth since the pixels in each frame is
++ * subtracted with the pixels in the current frame.
++ *
++ * The proccess is applied for each captured frame.
++ **/
++void isppreview_enable_drkframe(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_DRKFEN);
++ else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_DRKFEN);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_drkframe);
++
++/**
++ * isppreview_enable_shadcomp - Enables/Disables the shading compensation.
++ * @enable: 1 - Enables the shading compensation.
++ *
++ * If dark frame subtract won't be used, then enable this shading
++ * compensation.
++ **/
++void isppreview_enable_shadcomp(u8 enable)
++{
++
++ if (enable) {
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ISPPRV_PCR_SCOMP_EN);
++ isppreview_enable_drkframe(1);
++ } else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_SCOMP_EN);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_shadcomp);
++
++/**
++ * isppreview_config_drkf_shadcomp - Configures shift value in shading comp.
++ * @scomp_shtval: 3bit value of shift used in shading compensation.
++ **/
++void isppreview_config_drkf_shadcomp(u8 scomp_shtval)
++{
++ u32 pcr_val = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++
++ pcr_val &= ISPPRV_PCR_SCOMP_SFT_MASK;
++ isp_reg_writel(pcr_val | (scomp_shtval << ISPPRV_PCR_SCOMP_SFT_SHIFT),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_drkf_shadcomp);
++
++/**
++ * isppreview_enable_hmed - Enables/Disables of the Horizontal Median Filter.
++ * @enable: 1 - Enables Horizontal Median Filter.
++ **/
++void isppreview_enable_hmed(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_HMEDEN);
++ else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_HMEDEN);
++ }
++ ispprev_obj.hmed_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_hmed);
++
++/**
++ * isppreview_config_hmed - Configures the Horizontal Median Filter.
++ * @prev_hmed: Structure containing the odd and even distance between the
++ * pixels in the image along with the filter threshold.
++ **/
++void isppreview_config_hmed(struct ispprev_hmed prev_hmed)
++{
++
++ u32 odddist = 0;
++ u32 evendist = 0;
++
++ if (prev_hmed.odddist == 1)
++ odddist = ~ISPPRV_HMED_ODDDIST;
++ else
++ odddist = ISPPRV_HMED_ODDDIST;
++
++ if (prev_hmed.evendist == 1)
++ evendist = ~ISPPRV_HMED_EVENDIST;
++ else
++ evendist = ISPPRV_HMED_EVENDIST;
++
++ isp_reg_writel(odddist | evendist | (prev_hmed.thres <<
++ ISPPRV_HMED_THRESHOLD_SHIFT),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_HMED);
++
++}
++EXPORT_SYMBOL_GPL(isppreview_config_hmed);
++
++/**
++ * isppreview_config_noisefilter - Configures the Noise Filter.
++ * @prev_nf: Structure containing the noisefilter table, strength to be used
++ * for the noise filter and the defect correction enable flag.
++ **/
++void isppreview_config_noisefilter(struct ispprev_nf prev_nf)
++{
++ int i = 0;
++
++ isp_reg_writel(prev_nf.spread, OMAP3_ISP_IOMEM_PREV, ISPPRV_NF);
++ isp_reg_writel(ISPPRV_NF_TABLE_ADDR, OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_ADDR);
++ for (i = 0; i < ISPPRV_NF_TBL_SIZE; i++) {
++ isp_reg_writel(prev_nf.table[i], OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_DATA);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_noisefilter);
++
++/**
++ * isppreview_config_dcor - Configures the defect correction
++ * @prev_nf: Structure containing the defect correction structure
++ **/
++void isppreview_config_dcor(struct ispprev_dcor prev_dcor)
++{
++ if (prev_dcor.couplet_mode_en) {
++ isp_reg_writel(prev_dcor.detect_correct[0],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR0);
++ isp_reg_writel(prev_dcor.detect_correct[1],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR1);
++ isp_reg_writel(prev_dcor.detect_correct[2],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR2);
++ isp_reg_writel(prev_dcor.detect_correct[3],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CDC_THR3);
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_DCCOUP);
++ } else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_DCCOUP);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_dcor);
++
++/**
++ * isppreview_config_cfa - Configures the CFA Interpolation parameters.
++ * @prev_cfa: Structure containing the CFA interpolation table, CFA format
++ * in the image, vertical and horizontal gradient threshold.
++ **/
++void isppreview_config_cfa(struct ispprev_cfa prev_cfa)
++{
++ int i = 0;
++
++ ispprev_obj.cfafmt = prev_cfa.cfafmt;
++
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ (prev_cfa.cfafmt << ISPPRV_PCR_CFAFMT_SHIFT));
++
++ isp_reg_writel(
++ (prev_cfa.cfa_gradthrs_vert << ISPPRV_CFA_GRADTH_VER_SHIFT) |
++ (prev_cfa.cfa_gradthrs_horz << ISPPRV_CFA_GRADTH_HOR_SHIFT),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CFA);
++
++ isp_reg_writel(ISPPRV_CFA_TABLE_ADDR, OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_SET_TBL_ADDR);
++
++ for (i = 0; i < ISPPRV_CFA_TBL_SIZE; i++) {
++ isp_reg_writel(prev_cfa.cfa_table[i],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_DATA);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_cfa);
++
++/**
++ * isppreview_config_gammacorrn - Configures the Gamma Correction table values
++ * @gtable: Structure containing the table for red, blue, green gamma table.
++ **/
++void isppreview_config_gammacorrn(struct ispprev_gtable gtable)
++{
++ int i = 0;
++
++ isp_reg_writel(ISPPRV_REDGAMMA_TABLE_ADDR,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++ for (i = 0; i < ISPPRV_GAMMA_TBL_SIZE; i++) {
++ isp_reg_writel(gtable.redtable[i],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_DATA);
++ }
++
++ isp_reg_writel(ISPPRV_GREENGAMMA_TABLE_ADDR,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++ for (i = 0; i < ISPPRV_GAMMA_TBL_SIZE; i++) {
++ isp_reg_writel(gtable.greentable[i],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_DATA);
++ }
++
++ isp_reg_writel(ISPPRV_BLUEGAMMA_TABLE_ADDR,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++ for (i = 0; i < ISPPRV_GAMMA_TBL_SIZE; i++) {
++ isp_reg_writel(gtable.bluetable[i],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_DATA);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_gammacorrn);
++
++/**
++ * isppreview_config_luma_enhancement - Sets the Luminance Enhancement table.
++ * @ytable: Structure containing the table for Luminance Enhancement table.
++ **/
++void isppreview_config_luma_enhancement(u32 *ytable)
++{
++ int i = 0;
++
++ isp_reg_writel(ISPPRV_YENH_TABLE_ADDR,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_ADDR);
++ for (i = 0; i < ISPPRV_YENH_TBL_SIZE; i++) {
++ isp_reg_writel(ytable[i],
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SET_TBL_DATA);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_config_luma_enhancement);
++
++/**
++ * isppreview_config_chroma_suppression - Configures the Chroma Suppression.
++ * @csup: Structure containing the threshold value for suppression
++ * and the hypass filter enable flag.
++ **/
++void isppreview_config_chroma_suppression(struct ispprev_csup csup)
++{
++ isp_reg_writel(csup.gain | (csup.thres << ISPPRV_CSUP_THRES_SHIFT) |
++ (csup.hypf_en << ISPPRV_CSUP_HPYF_SHIFT),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CSUP);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_chroma_suppression);
++
++/**
++ * isppreview_enable_noisefilter - Enables/Disables the Noise Filter.
++ * @enable: 1 - Enables the Noise Filter.
++ **/
++void isppreview_enable_noisefilter(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_NFEN);
++ else
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ~ISPPRV_PCR_NFEN);
++ ispprev_obj.nf_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_noisefilter);
++
++/**
++ * isppreview_enable_dcor - Enables/Disables the defect correction.
++ * @enable: 1 - Enables the defect correction.
++ **/
++void isppreview_enable_dcor(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_DCOREN);
++ else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_DCOREN);
++ }
++ ispprev_obj.dcor_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_dcor);
++
++/**
++ * isppreview_enable_cfa - Enable/Disable the CFA Interpolation.
++ * @enable: 1 - Enables the CFA.
++ **/
++void isppreview_enable_cfa(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_CFAEN);
++ else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_CFAEN);
++ }
++ ispprev_obj.cfa_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_cfa);
++
++/**
++ * isppreview_enable_gammabypass - Enables/Disables the GammaByPass
++ * @enable: 1 - Bypasses Gamma - 10bit input is cropped to 8MSB.
++ * 0 - Goes through Gamma Correction. input and output is 10bit.
++ **/
++void isppreview_enable_gammabypass(u8 enable)
++{
++ if (enable) {
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ISPPRV_PCR_GAMMA_BYPASS);
++ } else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_GAMMA_BYPASS);
++ }
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_gammabypass);
++
++/**
++ * isppreview_enable_luma_enhancement - Enables/Disables Luminance Enhancement
++ * @enable: 1 - Enable the Luminance Enhancement.
++ **/
++void isppreview_enable_luma_enhancement(u8 enable)
++{
++ if (enable) {
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ISPPRV_PCR_YNENHEN);
++ } else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_YNENHEN);
++ }
++ ispprev_obj.yenh_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_luma_enhancement);
++
++/**
++ * isppreview_enable_chroma_suppression - Enables/Disables Chrominance Suppr.
++ * @enable: 1 - Enable the Chrominance Suppression.
++ **/
++void isppreview_enable_chroma_suppression(u8 enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_SUPEN);
++ else {
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
++ ~ISPPRV_PCR_SUPEN);
++ }
++ ispprev_obj.csup_en = enable ? 1 : 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable_chroma_suppression);
++
++/**
++ * isppreview_config_whitebalance - Configures the White Balance parameters.
++ * @prev_wbal: Structure containing the digital gain and white balance
++ * coefficient.
++ *
++ * Coefficient matrix always with default values.
++ **/
++void isppreview_config_whitebalance(struct ispprev_wbal prev_wbal)
++{
++ u32 val;
++
++ isp_reg_writel(prev_wbal.dgain, OMAP3_ISP_IOMEM_PREV, ISPPRV_WB_DGAIN);
++
++ val = prev_wbal.coef0 << ISPPRV_WBGAIN_COEF0_SHIFT;
++ val |= prev_wbal.coef1 << ISPPRV_WBGAIN_COEF1_SHIFT;
++ val |= prev_wbal.coef2 << ISPPRV_WBGAIN_COEF2_SHIFT;
++ val |= prev_wbal.coef3 << ISPPRV_WBGAIN_COEF3_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_WBGAIN);
++
++ isp_reg_writel(ISPPRV_WBSEL_COEF0 << ISPPRV_WBSEL_N0_0_SHIFT |
++ ISPPRV_WBSEL_COEF1 << ISPPRV_WBSEL_N0_1_SHIFT |
++ ISPPRV_WBSEL_COEF0 << ISPPRV_WBSEL_N0_2_SHIFT |
++ ISPPRV_WBSEL_COEF1 << ISPPRV_WBSEL_N0_3_SHIFT |
++ ISPPRV_WBSEL_COEF2 << ISPPRV_WBSEL_N1_0_SHIFT |
++ ISPPRV_WBSEL_COEF3 << ISPPRV_WBSEL_N1_1_SHIFT |
++ ISPPRV_WBSEL_COEF2 << ISPPRV_WBSEL_N1_2_SHIFT |
++ ISPPRV_WBSEL_COEF3 << ISPPRV_WBSEL_N1_3_SHIFT |
++ ISPPRV_WBSEL_COEF0 << ISPPRV_WBSEL_N2_0_SHIFT |
++ ISPPRV_WBSEL_COEF1 << ISPPRV_WBSEL_N2_1_SHIFT |
++ ISPPRV_WBSEL_COEF0 << ISPPRV_WBSEL_N2_2_SHIFT |
++ ISPPRV_WBSEL_COEF1 << ISPPRV_WBSEL_N2_3_SHIFT |
++ ISPPRV_WBSEL_COEF2 << ISPPRV_WBSEL_N3_0_SHIFT |
++ ISPPRV_WBSEL_COEF3 << ISPPRV_WBSEL_N3_1_SHIFT |
++ ISPPRV_WBSEL_COEF2 << ISPPRV_WBSEL_N3_2_SHIFT |
++ ISPPRV_WBSEL_COEF3 << ISPPRV_WBSEL_N3_3_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_WBSEL);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_whitebalance);
++
++/**
++ * isppreview_config_whitebalance2 - Configures the White Balance parameters.
++ * @prev_wbal: Structure containing the digital gain and white balance
++ * coefficient.
++ *
++ * Coefficient matrix can be changed.
++ **/
++void isppreview_config_whitebalance2(struct prev_white_balance prev_wbal)
++{
++ isp_reg_writel(prev_wbal.wb_dgain,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_WB_DGAIN);
++ isp_reg_writel(prev_wbal.wb_gain[0] |
++ prev_wbal.wb_gain[1] << ISPPRV_WBGAIN_COEF1_SHIFT |
++ prev_wbal.wb_gain[2] << ISPPRV_WBGAIN_COEF2_SHIFT |
++ prev_wbal.wb_gain[3] << ISPPRV_WBGAIN_COEF3_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_WBGAIN);
++
++ isp_reg_writel(
++ prev_wbal.wb_coefmatrix[0][0] << ISPPRV_WBSEL_N0_0_SHIFT |
++ prev_wbal.wb_coefmatrix[0][1] << ISPPRV_WBSEL_N0_1_SHIFT |
++ prev_wbal.wb_coefmatrix[0][2] << ISPPRV_WBSEL_N0_2_SHIFT |
++ prev_wbal.wb_coefmatrix[0][3] << ISPPRV_WBSEL_N0_3_SHIFT |
++ prev_wbal.wb_coefmatrix[1][0] << ISPPRV_WBSEL_N1_0_SHIFT |
++ prev_wbal.wb_coefmatrix[1][1] << ISPPRV_WBSEL_N1_1_SHIFT |
++ prev_wbal.wb_coefmatrix[1][2] << ISPPRV_WBSEL_N1_2_SHIFT |
++ prev_wbal.wb_coefmatrix[1][3] << ISPPRV_WBSEL_N1_3_SHIFT |
++ prev_wbal.wb_coefmatrix[2][0] << ISPPRV_WBSEL_N2_0_SHIFT |
++ prev_wbal.wb_coefmatrix[2][1] << ISPPRV_WBSEL_N2_1_SHIFT |
++ prev_wbal.wb_coefmatrix[2][2] << ISPPRV_WBSEL_N2_2_SHIFT |
++ prev_wbal.wb_coefmatrix[2][3] << ISPPRV_WBSEL_N2_3_SHIFT |
++ prev_wbal.wb_coefmatrix[3][0] << ISPPRV_WBSEL_N3_0_SHIFT |
++ prev_wbal.wb_coefmatrix[3][1] << ISPPRV_WBSEL_N3_1_SHIFT |
++ prev_wbal.wb_coefmatrix[3][2] << ISPPRV_WBSEL_N3_2_SHIFT |
++ prev_wbal.wb_coefmatrix[3][3] << ISPPRV_WBSEL_N3_3_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_WBSEL);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_whitebalance2);
++
++/**
++ * isppreview_config_blkadj - Configures the Black Adjustment parameters.
++ * @prev_blkadj: Structure containing the black adjustment towards red, green,
++ * blue.
++ **/
++void isppreview_config_blkadj(struct ispprev_blkadj prev_blkadj)
++{
++ isp_reg_writel(prev_blkadj.blue |
++ (prev_blkadj.green << ISPPRV_BLKADJOFF_G_SHIFT) |
++ (prev_blkadj.red << ISPPRV_BLKADJOFF_R_SHIFT),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_BLKADJOFF);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_blkadj);
++
++/**
++ * isppreview_config_rgb_blending - Configures the RGB-RGB Blending matrix.
++ * @rgb2rgb: Structure containing the rgb to rgb blending matrix and the rgb
++ * offset.
++ **/
++void isppreview_config_rgb_blending(struct ispprev_rgbtorgb rgb2rgb)
++{
++ u32 val = 0;
++
++ val = (rgb2rgb.matrix[0][0] & 0xfff) << ISPPRV_RGB_MAT1_MTX_RR_SHIFT;
++ val |= (rgb2rgb.matrix[0][1] & 0xfff) << ISPPRV_RGB_MAT1_MTX_GR_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT1);
++
++ val = (rgb2rgb.matrix[0][2] & 0xfff) << ISPPRV_RGB_MAT2_MTX_BR_SHIFT;
++ val |= (rgb2rgb.matrix[1][0] & 0xfff) << ISPPRV_RGB_MAT2_MTX_RG_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT2);
++
++ val = (rgb2rgb.matrix[1][1] & 0xfff) << ISPPRV_RGB_MAT3_MTX_GG_SHIFT;
++ val |= (rgb2rgb.matrix[1][2] & 0xfff) << ISPPRV_RGB_MAT3_MTX_BG_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT3);
++
++ val = (rgb2rgb.matrix[2][0] & 0xfff) << ISPPRV_RGB_MAT4_MTX_RB_SHIFT;
++ val |= (rgb2rgb.matrix[2][1] & 0xfff) << ISPPRV_RGB_MAT4_MTX_GB_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT4);
++
++ val = (rgb2rgb.matrix[2][2] & 0xfff) << ISPPRV_RGB_MAT5_MTX_BB_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT5);
++
++ val = (rgb2rgb.offset[0] & 0x3ff) << ISPPRV_RGB_OFF1_MTX_OFFG_SHIFT;
++ val |= (rgb2rgb.offset[1] & 0x3ff) << ISPPRV_RGB_OFF1_MTX_OFFR_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF1);
++
++ val = (rgb2rgb.offset[2] & 0x3ff) << ISPPRV_RGB_OFF2_MTX_OFFB_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF2);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_rgb_blending);
++
++/**
++ * Configures the RGB-YCbYCr conversion matrix
++ * @prev_csc: Structure containing the RGB to YCbYCr matrix and the
++ * YCbCr offset.
++ **/
++void isppreview_config_rgb_to_ycbcr(struct ispprev_csc prev_csc)
++{
++ u32 val = 0;
++
++ val = (prev_csc.matrix[0][0] & 0x3ff) << ISPPRV_CSC0_RY_SHIFT;
++ val |= (prev_csc.matrix[0][1] & 0x3ff) << ISPPRV_CSC0_GY_SHIFT;
++ val |= (prev_csc.matrix[0][2] & 0x3ff) << ISPPRV_CSC0_BY_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC0);
++
++ val = (prev_csc.matrix[1][0] & 0x3ff) << ISPPRV_CSC1_RCB_SHIFT;
++ val |= (prev_csc.matrix[1][1] & 0x3ff) << ISPPRV_CSC1_GCB_SHIFT;
++ val |= (prev_csc.matrix[1][2] & 0x3ff) << ISPPRV_CSC1_BCB_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC1);
++
++ val = (prev_csc.matrix[2][0] & 0x3ff) << ISPPRV_CSC2_RCR_SHIFT;
++ val |= (prev_csc.matrix[2][1] & 0x3ff) << ISPPRV_CSC2_GCR_SHIFT;
++ val |= (prev_csc.matrix[2][2] & 0x3ff) << ISPPRV_CSC2_BCR_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC2);
++
++ val = (prev_csc.offset[0] & 0xff) << ISPPRV_CSC_OFFSET_CR_SHIFT;
++ val |= (prev_csc.offset[1] & 0xff) << ISPPRV_CSC_OFFSET_CB_SHIFT;
++ val |= (prev_csc.offset[2] & 0xff) << ISPPRV_CSC_OFFSET_Y_SHIFT;
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC_OFFSET);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_rgb_to_ycbcr);
++
++/**
++ * isppreview_query_contrast - Query the contrast.
++ * @contrast: Pointer to hold the current programmed contrast value.
++ **/
++void isppreview_query_contrast(u8 *contrast)
++{
++ u32 brt_cnt_val = 0;
++
++ brt_cnt_val = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++ *contrast = (brt_cnt_val >> ISPPRV_CNT_BRT_CNT_SHIFT) & 0xff;
++ DPRINTK_ISPPREV(" Current brt cnt value in hw is %x\n", brt_cnt_val);
++}
++EXPORT_SYMBOL_GPL(isppreview_query_contrast);
++
++/**
++ * isppreview_update_contrast - Updates the contrast.
++ * @contrast: Pointer to hold the current programmed contrast value.
++ *
++ * Value should be programmed before enabling the module.
++ **/
++void isppreview_update_contrast(u8 *contrast)
++{
++ ispprev_obj.contrast = *contrast;
++}
++EXPORT_SYMBOL_GPL(isppreview_update_contrast);
++
++/**
++ * isppreview_config_contrast - Configures the Contrast.
++ * @contrast: 8 bit value in U8Q4 format.
++ *
++ * Value should be programmed before enabling the module.
++ **/
++void isppreview_config_contrast(u8 contrast)
++{
++ u32 brt_cnt_val = 0;
++
++ brt_cnt_val = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++ brt_cnt_val &= ~(0xff << ISPPRV_CNT_BRT_CNT_SHIFT);
++ contrast &= 0xff;
++ isp_reg_writel(brt_cnt_val | contrast << ISPPRV_CNT_BRT_CNT_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_contrast);
++
++/**
++ * isppreview_get_contrast_range - Gets the range contrast value.
++ * @min_contrast: Pointer to hold the minimum Contrast value.
++ * @max_contrast: Pointer to hold the maximum Contrast value.
++ **/
++void isppreview_get_contrast_range(u8 *min_contrast, u8 *max_contrast)
++{
++ *min_contrast = ISPPRV_CONTRAST_MIN;
++ *max_contrast = ISPPRV_CONTRAST_MAX;
++}
++EXPORT_SYMBOL_GPL(isppreview_get_contrast_range);
++
++/**
++ * isppreview_update_brightness - Updates the brightness in preview module.
++ * @brightness: Pointer to hold the current programmed brightness value.
++ *
++ **/
++void isppreview_update_brightness(u8 *brightness)
++{
++ ispprev_obj.brightness = *brightness;
++}
++EXPORT_SYMBOL_GPL(isppreview_update_brightness);
++
++/**
++ * isppreview_config_brightness - Configures the brightness.
++ * @contrast: 8bitvalue in U8Q0 format.
++ **/
++void isppreview_config_brightness(u8 brightness)
++{
++ u32 brt_cnt_val = 0;
++
++ DPRINTK_ISPPREV("\tConfiguring brightness in ISP: %d\n", brightness);
++ brt_cnt_val = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++ brt_cnt_val &= ~(0xff << ISPPRV_CNT_BRT_BRT_SHIFT);
++ brightness &= 0xff;
++ isp_reg_writel(brt_cnt_val | brightness << ISPPRV_CNT_BRT_BRT_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_brightness);
++
++/**
++ * isppreview_query_brightness - Query the brightness.
++ * @brightness: Pointer to hold the current programmed brightness value.
++ **/
++void isppreview_query_brightness(u8 *brightness)
++{
++ *brightness = isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT);
++}
++EXPORT_SYMBOL_GPL(isppreview_query_brightness);
++
++/**
++ * isppreview_get_brightness_range - Gets the range brightness value
++ * @min_brightness: Pointer to hold the minimum brightness value
++ * @max_brightness: Pointer to hold the maximum brightness value
++ **/
++void isppreview_get_brightness_range(u8 *min_brightness, u8 *max_brightness)
++{
++ *min_brightness = ISPPRV_BRIGHT_MIN;
++ *max_brightness = ISPPRV_BRIGHT_MAX;
++}
++EXPORT_SYMBOL_GPL(isppreview_get_brightness_range);
++
++/**
++ * isppreview_set_color - Sets the color effect.
++ * @mode: Indicates the required color effect.
++ **/
++void isppreview_set_color(u8 *mode)
++{
++ ispprev_obj.color = *mode;
++ update_color_matrix = 1;
++}
++EXPORT_SYMBOL_GPL(isppreview_set_color);
++
++/**
++ * isppreview_get_color - Gets the current color effect.
++ * @mode: Indicates the current color effect.
++ **/
++void isppreview_get_color(u8 *mode)
++{
++ *mode = ispprev_obj.color;
++}
++EXPORT_SYMBOL_GPL(isppreview_get_color);
++
++/**
++ * isppreview_config_yc_range - Configures the max and min Y and C values.
++ * @yclimit: Structure containing the range of Y and C values.
++ **/
++void isppreview_config_yc_range(struct ispprev_yclimit yclimit)
++{
++ isp_reg_writel(yclimit.maxC << ISPPRV_SETUP_YC_MAXC_SHIFT |
++ yclimit.maxY << ISPPRV_SETUP_YC_MAXY_SHIFT |
++ yclimit.minC << ISPPRV_SETUP_YC_MINC_SHIFT |
++ yclimit.minY << ISPPRV_SETUP_YC_MINY_SHIFT,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_SETUP_YC);
++}
++EXPORT_SYMBOL_GPL(isppreview_config_yc_range);
++
++/**
++ * isppreview_try_size - Calculates output dimensions with the modules enabled.
++ * @input_w: input width for the preview in number of pixels per line
++ * @input_h: input height for the preview in number of lines
++ * @output_w: output width from the preview in number of pixels per line
++ * @output_h: output height for the preview in number of lines
++ *
++ * Calculates the number of pixels cropped in the submodules that are enabled,
++ * Fills up the output width height variables in the isp_prev structure.
++ **/
++int isppreview_try_size(u32 input_w, u32 input_h, u32 *output_w, u32 *output_h)
++{
++ u32 prevout_w = input_w;
++ u32 prevout_h = input_h;
++ u32 div = 0;
++ int max_out;
++
++ ispprev_obj.previn_w = input_w;
++ ispprev_obj.previn_h = input_h;
++
++ if (input_w < 32 || input_h < 32) {
++ printk(KERN_ERR "ISP_ERR : preview does not support "
++ "width < 16 or height < 32 \n");
++ return -EINVAL;
++ }
++ if (omap_rev() == OMAP3430_REV_ES1_0)
++ max_out = ISPPRV_MAXOUTPUT_WIDTH;
++ else
++ max_out = ISPPRV_MAXOUTPUT_WIDTH_ES2;
++
++ ispprev_obj.fmtavg = 0;
++
++ if (input_w > max_out) {
++ div = (input_w/max_out);
++ if (div >= 2 && div < 4) {
++ ispprev_obj.fmtavg = 1;
++ prevout_w /= 2;
++ } else if (div >= 4 && div < 8) {
++ ispprev_obj.fmtavg = 2;
++ prevout_w /= 4;
++ } else if (div >= 8) {
++ ispprev_obj.fmtavg = 3;
++ prevout_w /= 8;
++ }
++ }
++
++ if (ispprev_obj.hmed_en)
++ prevout_w -= 4;
++ if (ispprev_obj.nf_en) {
++ prevout_w -= 4;
++ prevout_h -= 4;
++ }
++ if (ispprev_obj.cfa_en) {
++ switch (ispprev_obj.cfafmt) {
++ case CFAFMT_BAYER:
++ case CFAFMT_SONYVGA:
++ prevout_w -= 4;
++ prevout_h -= 4;
++ break;
++ case CFAFMT_RGBFOVEON:
++ case CFAFMT_RRGGBBFOVEON:
++ case CFAFMT_DNSPL:
++ case CFAFMT_HONEYCOMB:
++ prevout_h -= 2;
++ break;
++ };
++ }
++ if (ispprev_obj.yenh_en || ispprev_obj.csup_en)
++ prevout_w -= 2;
++
++ /* Start at the correct row/column by skipping
++ * a Sensor specific amount.
++ */
++ prevout_w -= ispprev_obj.sph;
++ prevout_h -= ispprev_obj.slv;
++
++
++ if (prevout_w % 2)
++ prevout_w -= 1;
++
++ if (ispprev_obj.prev_outfmt == PREVIEW_MEM) {
++ if (((prevout_w * 2) & ISP_32B_BOUNDARY_OFFSET) !=
++ (prevout_w * 2)) {
++ prevout_w = ((prevout_w * 2) &
++ ISP_32B_BOUNDARY_OFFSET) / 2;
++ }
++ }
++ *output_w = prevout_w;
++ ispprev_obj.prevout_w = prevout_w;
++ *output_h = prevout_h;
++ ispprev_obj.prevout_h = prevout_h;
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_try_size);
++
++/**
++ * isppreview_config_size - Sets the size of ISP preview output.
++ * @input_w: input width for the preview in number of pixels per line
++ * @input_h: input height for the preview in number of lines
++ * @output_w: output width from the preview in number of pixels per line
++ * @output_h: output height for the preview in number of lines
++ *
++ * Configures the appropriate values stored in the isp_prev structure to
++ * HORZ/VERT_INFO. Configures PRV_AVE if needed for downsampling as calculated
++ * in trysize.
++ **/
++int isppreview_config_size(u32 input_w, u32 input_h, u32 output_w, u32 output_h)
++{
++ u32 prevsdroff;
++
++ if ((output_w != ispprev_obj.prevout_w) ||
++ (output_h != ispprev_obj.prevout_h)) {
++ printk(KERN_ERR "ISP_ERR : isppreview_try_size should "
++ "be called before config size\n");
++ return -EINVAL;
++ }
++
++ isp_reg_writel((ispprev_obj.sph << ISPPRV_HORZ_INFO_SPH_SHIFT) |
++ (ispprev_obj.previn_w - 1),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_HORZ_INFO);
++ isp_reg_writel((ispprev_obj.slv << ISPPRV_VERT_INFO_SLV_SHIFT) |
++ (ispprev_obj.previn_h - 2),
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_VERT_INFO);
++
++ if (ispprev_obj.cfafmt == CFAFMT_BAYER)
++ isp_reg_writel(ISPPRV_AVE_EVENDIST_2 <<
++ ISPPRV_AVE_EVENDIST_SHIFT |
++ ISPPRV_AVE_ODDDIST_2 <<
++ ISPPRV_AVE_ODDDIST_SHIFT |
++ ispprev_obj.fmtavg,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_AVE);
++
++ if (ispprev_obj.prev_outfmt == PREVIEW_MEM) {
++ prevsdroff = ispprev_obj.prevout_w * 2;
++ if ((prevsdroff & ISP_32B_BOUNDARY_OFFSET) != prevsdroff) {
++ DPRINTK_ISPPREV("ISP_WARN: Preview output buffer line"
++ " size is truncated"
++ " to 32byte boundary\n");
++ prevsdroff &= ISP_32B_BOUNDARY_BUF ;
++ }
++ isppreview_config_outlineoffset(prevsdroff);
++ }
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_config_size);
++
++/**
++ * isppreview_config_inlineoffset - Configures the Read address line offset.
++ * @offset: Line Offset for the input image.
++ **/
++int isppreview_config_inlineoffset(u32 offset)
++{
++ if ((offset & ISP_32B_BOUNDARY_OFFSET) == offset) {
++ isp_reg_writel(offset & 0xffff,
++ OMAP3_ISP_IOMEM_PREV, ISPPRV_RADR_OFFSET);
++ } else {
++ printk(KERN_ERR "ISP_ERR : Offset should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_config_inlineoffset);
++
++/**
++ * isppreview_set_inaddr - Sets memory address of input frame.
++ * @addr: 32bit memory address aligned on 32byte boundary.
++ *
++ * Configures the memory address from which the input frame is to be read.
++ **/
++int isppreview_set_inaddr(u32 addr)
++{
++ if ((addr & ISP_32B_BOUNDARY_BUF) == addr)
++ isp_reg_writel(addr, OMAP3_ISP_IOMEM_PREV, ISPPRV_RSDR_ADDR);
++ else {
++ printk(KERN_ERR "ISP_ERR: Address should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_set_inaddr);
++
++/**
++ * isppreview_config_outlineoffset - Configures the Write address line offset.
++ * @offset: Line Offset for the preview output.
++ **/
++int isppreview_config_outlineoffset(u32 offset)
++{
++ if ((offset & ISP_32B_BOUNDARY_OFFSET) != offset) {
++ printk(KERN_ERR "ISP_ERR : Offset should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(offset & 0xffff, OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_WADD_OFFSET);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_config_outlineoffset);
++
++/**
++ * isppreview_set_outaddr - Sets the memory address to store output frame
++ * @addr: 32bit memory address aligned on 32byte boundary.
++ *
++ * Configures the memory address to which the output frame is written.
++ **/
++int isppreview_set_outaddr(u32 addr)
++{
++ if ((addr & ISP_32B_BOUNDARY_BUF) != addr) {
++ printk(KERN_ERR "ISP_ERR: Address should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(addr, OMAP3_ISP_IOMEM_PREV, ISPPRV_WSDR_ADDR);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_set_outaddr);
++
++/**
++ * isppreview_config_darklineoffset - Sets the Dark frame address line offset.
++ * @offset: Line Offset for the Darkframe.
++ **/
++int isppreview_config_darklineoffset(u32 offset)
++{
++ if ((offset & ISP_32B_BOUNDARY_OFFSET) != offset) {
++ printk(KERN_ERR "ISP_ERR : Offset should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(offset & 0xffff, OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_DRKF_OFFSET);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_config_darklineoffset);
++
++/**
++ * isppreview_set_darkaddr - Sets the memory address to store Dark frame.
++ * @addr: 32bit memory address aligned on 32 bit boundary.
++ **/
++int isppreview_set_darkaddr(u32 addr)
++{
++ if ((addr & ISP_32B_BOUNDARY_BUF) != addr) {
++ printk(KERN_ERR "ISP_ERR : Address should be in 32 byte "
++ "boundary\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(addr, OMAP3_ISP_IOMEM_PREV, ISPPRV_DSDR_ADDR);
++ return 0;
++}
++EXPORT_SYMBOL_GPL(isppreview_set_darkaddr);
++
++void __isppreview_enable(int enable)
++{
++ if (enable)
++ isp_reg_or(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ISPPRV_PCR_EN);
++ else
++ isp_reg_and(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR, ~ISPPRV_PCR_EN);
++}
++
++/**
++ * isppreview_enable - Enables the Preview module.
++ * @enable: 1 - Enables the preview module.
++ *
++ * Client should configure all the sub modules in Preview before this.
++ **/
++void isppreview_enable(int enable)
++{
++ __isppreview_enable(enable);
++ ispprev_obj.pm_state = enable;
++}
++EXPORT_SYMBOL_GPL(isppreview_enable);
++
++/**
++ * isppreview_suspend - Suspend Preview module.
++ **/
++void isppreview_suspend(void)
++{
++ if (ispprev_obj.pm_state)
++ __isppreview_enable(0);
++}
++EXPORT_SYMBOL_GPL(isppreview_suspend);
++
++/**
++ * isppreview_resume - Resume Preview module.
++ **/
++void isppreview_resume(void)
++{
++ if (ispprev_obj.pm_state)
++ __isppreview_enable(1);
++}
++EXPORT_SYMBOL_GPL(isppreview_resume);
++
++
++/**
++ * isppreview_busy - Gets busy state of preview module.
++ **/
++int isppreview_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR) &
++ ISPPRV_PCR_BUSY;
++}
++EXPORT_SYMBOL_GPL(isppreview_busy);
++
++/**
++ * isppreview_get_config - Gets parameters of preview module.
++ **/
++struct prev_params *isppreview_get_config(void)
++{
++ return prev_config_params;
++}
++EXPORT_SYMBOL_GPL(isppreview_get_config);
++
++/**
++ * isppreview_save_context - Saves the values of the preview module registers.
++ **/
++void isppreview_save_context(void)
++{
++ DPRINTK_ISPPREV("Saving context\n");
++ isp_save_context(ispprev_reg_list);
++}
++EXPORT_SYMBOL_GPL(isppreview_save_context);
++
++/**
++ * isppreview_restore_context - Restores the values of preview module registers
++ **/
++void isppreview_restore_context(void)
++{
++ DPRINTK_ISPPREV("Restoring context\n");
++ isp_restore_context(ispprev_reg_list);
++}
++EXPORT_SYMBOL_GPL(isppreview_restore_context);
++
++/**
++ * isppreview_print_status - Prints the values of the Preview Module registers.
++ *
++ * Also prints other debug information stored in the preview moduel.
++ **/
++void isppreview_print_status(void)
++{
++ DPRINTK_ISPPREV("Module in use =%d\n", ispprev_obj.prev_inuse);
++ DPRINTK_ISPPREV("Preview Input format =%d, Output Format =%d\n",
++ ispprev_obj.prev_inpfmt,
++ ispprev_obj.prev_outfmt);
++ DPRINTK_ISPPREV("Accepted Preview Input (width = %d,Height = %d)\n",
++ ispprev_obj.previn_w,
++ ispprev_obj.previn_h);
++ DPRINTK_ISPPREV("Accepted Preview Output (width = %d,Height = %d)\n",
++ ispprev_obj.prevout_w,
++ ispprev_obj.prevout_h);
++ DPRINTK_ISPPREV("###ISP_CTRL in preview =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ DPRINTK_ISPPREV("###ISP_IRQ0ENABLE in preview =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE));
++ DPRINTK_ISPPREV("###ISP_IRQ0STATUS in preview =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS));
++ DPRINTK_ISPPREV("###PRV PCR =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR));
++ DPRINTK_ISPPREV("###PRV HORZ_INFO =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_HORZ_INFO));
++ DPRINTK_ISPPREV("###PRV VERT_INFO =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_VERT_INFO));
++ DPRINTK_ISPPREV("###PRV WSDR_ADDR =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_WSDR_ADDR));
++ DPRINTK_ISPPREV("###PRV WADD_OFFSET =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_WADD_OFFSET));
++ DPRINTK_ISPPREV("###PRV AVE =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_AVE));
++ DPRINTK_ISPPREV("###PRV HMED =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_HMED));
++ DPRINTK_ISPPREV("###PRV NF =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_NF));
++ DPRINTK_ISPPREV("###PRV WB_DGAIN =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_WB_DGAIN));
++ DPRINTK_ISPPREV("###PRV WBGAIN =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_WBGAIN));
++ DPRINTK_ISPPREV("###PRV WBSEL =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_WBSEL));
++ DPRINTK_ISPPREV("###PRV CFA =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CFA));
++ DPRINTK_ISPPREV("###PRV BLKADJOFF =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_BLKADJOFF));
++ DPRINTK_ISPPREV("###PRV RGB_MAT1 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT1));
++ DPRINTK_ISPPREV("###PRV RGB_MAT2 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT2));
++ DPRINTK_ISPPREV("###PRV RGB_MAT3 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT3));
++ DPRINTK_ISPPREV("###PRV RGB_MAT4 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT4));
++ DPRINTK_ISPPREV("###PRV RGB_MAT5 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_MAT5));
++ DPRINTK_ISPPREV("###PRV RGB_OFF1 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF1));
++ DPRINTK_ISPPREV("###PRV RGB_OFF2 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_RGB_OFF2));
++ DPRINTK_ISPPREV("###PRV CSC0 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC0));
++ DPRINTK_ISPPREV("###PRV CSC1 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC1));
++ DPRINTK_ISPPREV("###PRV CSC2 =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC2));
++ DPRINTK_ISPPREV("###PRV CSC_OFFSET =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CSC_OFFSET));
++ DPRINTK_ISPPREV("###PRV CNT_BRT =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CNT_BRT));
++ DPRINTK_ISPPREV("###PRV CSUP =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_CSUP));
++ DPRINTK_ISPPREV("###PRV SETUP_YC =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_PREV, ISPPRV_SETUP_YC));
++}
++EXPORT_SYMBOL_GPL(isppreview_print_status);
++
++/**
++ * isp_preview_init - Module Initialization.
++ **/
++int __init isp_preview_init(void)
++{
++ int i = 0;
++
++ prev_config_params = kmalloc(sizeof(*prev_config_params), GFP_KERNEL);
++ if (!prev_config_params) {
++ printk(KERN_ERR "Can't get memory for isp_preview params!\n");
++ return -ENOMEM;
++ }
++ params = prev_config_params;
++
++ ispprev_obj.prev_inuse = 0;
++ mutex_init(&ispprev_obj.ispprev_mutex);
++
++ /* Init values */
++ ispprev_obj.sph = 2;
++ ispprev_obj.slv = 0;
++ ispprev_obj.color = V4L2_COLORFX_NONE;
++ ispprev_obj.contrast = ISPPRV_CONTRAST_DEF;
++ params->contrast = ISPPRV_CONTRAST_DEF;
++ ispprev_obj.brightness = ISPPRV_BRIGHT_DEF;
++ params->brightness = ISPPRV_BRIGHT_DEF;
++ params->average = NO_AVE;
++ params->lens_shading_shift = 0;
++ params->pix_fmt = YCPOS_YCrYCb;
++ params->cfa.cfafmt = CFAFMT_BAYER;
++ params->cfa.cfa_table = cfa_coef_table;
++ params->cfa.cfa_gradthrs_horz = FLR_CFA_GRADTHRS_HORZ;
++ params->cfa.cfa_gradthrs_vert = FLR_CFA_GRADTHRS_VERT;
++ params->csup.gain = FLR_CSUP_GAIN;
++ params->csup.thres = FLR_CSUP_THRES;
++ params->csup.hypf_en = 0;
++ params->ytable = luma_enhance_table;
++ params->nf.spread = FLR_NF_STRGTH;
++ memcpy(params->nf.table, noise_filter_table, sizeof(params->nf.table));
++ params->dcor.couplet_mode_en = 1;
++ for (i = 0; i < 4; i++)
++ params->dcor.detect_correct[i] = 0xE;
++ params->gtable.bluetable = bluegamma_table;
++ params->gtable.greentable = greengamma_table;
++ params->gtable.redtable = redgamma_table;
++ params->wbal.dgain = FLR_WBAL_DGAIN;
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ params->wbal.coef0 = FLR_WBAL_COEF0_ES1;
++ params->wbal.coef1 = FLR_WBAL_COEF1_ES1;
++ params->wbal.coef2 = FLR_WBAL_COEF2_ES1;
++ params->wbal.coef3 = FLR_WBAL_COEF3_ES1;
++ } else {
++ params->wbal.coef0 = FLR_WBAL_COEF0;
++ params->wbal.coef1 = FLR_WBAL_COEF1;
++ params->wbal.coef2 = FLR_WBAL_COEF2;
++ params->wbal.coef3 = FLR_WBAL_COEF3;
++ }
++ params->blk_adj.red = FLR_BLKADJ_RED;
++ params->blk_adj.green = FLR_BLKADJ_GREEN;
++ params->blk_adj.blue = FLR_BLKADJ_BLUE;
++ params->rgb2rgb = flr_rgb2rgb;
++ params->rgb2ycbcr = flr_prev_csc[ispprev_obj.color];
++
++ params->features = PREV_CFA | PREV_DEFECT_COR | PREV_NOISE_FILTER;
++ params->features &= ~(PREV_AVERAGER | PREV_INVERSE_ALAW |
++ PREV_HORZ_MEDIAN_FILTER |
++ PREV_GAMMA_BYPASS |
++ PREV_DARK_FRAME_SUBTRACT |
++ PREV_LENS_SHADING |
++ PREV_DARK_FRAME_CAPTURE |
++ PREV_CHROMA_SUPPRESS |
++ PREV_LUMA_ENHANCE);
++ return 0;
++}
++
++/**
++ * isp_preview_cleanup - Module Cleanup.
++ **/
++void isp_preview_cleanup(void)
++{
++ kfree(prev_config_params);
++}
+diff --git a/drivers/media/video/isp/isppreview.h b/drivers/media/video/isp/isppreview.h
+new file mode 100644
+index 0000000..e88c329
+--- /dev/null
++++ b/drivers/media/video/isp/isppreview.h
+@@ -0,0 +1,354 @@
++/*
++ * isppreview.h
++ *
++ * Driver header file for Preview module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Senthilvadivu Guruswamy <svadivu@ti.com>
++ * Pallavi Kulkarni <p-kulkarni@ti.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_PREVIEW_H
++#define OMAP_ISP_PREVIEW_H
++
++#include <mach/isp_user.h>
++/* Isp query control structure */
++
++#define ISPPRV_BRIGHT_STEP 0x1
++#define ISPPRV_BRIGHT_DEF 0x0
++#define ISPPRV_BRIGHT_LOW 0x0
++#define ISPPRV_BRIGHT_HIGH 0xF
++#define ISPPRV_BRIGHT_UNITS 0x7
++
++#define ISPPRV_CONTRAST_STEP 0x1
++#define ISPPRV_CONTRAST_DEF 0x4
++#define ISPPRV_CONTRAST_LOW 0x0
++#define ISPPRV_CONTRAST_HIGH 0xF
++#define ISPPRV_CONTRAST_UNITS 0x4
++
++#define NO_AVE 0x0
++#define AVE_2_PIX 0x1
++#define AVE_4_PIX 0x2
++#define AVE_8_PIX 0x3
++#define AVE_ODD_PIXEL_DIST (1 << 4) /* For Bayer Sensors */
++#define AVE_EVEN_PIXEL_DIST (1 << 2)
++
++#define WB_GAIN_MAX 4
++
++/* Features list */
++#define PREV_AVERAGER (1 << 0)
++#define PREV_INVERSE_ALAW (1 << 1)
++#define PREV_HORZ_MEDIAN_FILTER (1 << 2)
++#define PREV_NOISE_FILTER (1 << 3)
++#define PREV_CFA (1 << 4)
++#define PREV_GAMMA_BYPASS (1 << 5)
++#define PREV_LUMA_ENHANCE (1 << 6)
++#define PREV_CHROMA_SUPPRESS (1 << 7)
++#define PREV_DARK_FRAME_SUBTRACT (1 << 8)
++#define PREV_LENS_SHADING (1 << 9)
++#define PREV_DARK_FRAME_CAPTURE (1 << 10)
++#define PREV_DEFECT_COR (1 << 11)
++
++
++#define ISP_NF_TABLE_SIZE (1 << 10)
++
++#define ISP_GAMMA_TABLE_SIZE (1 << 10)
++
++/* Table addresses */
++#define ISPPRV_TBL_ADDR_RED_G_START 0x00
++#define ISPPRV_TBL_ADDR_BLUE_G_START 0x800
++#define ISPPRV_TBL_ADDR_GREEN_G_START 0x400
++
++/*
++ *Enumeration Constants for input and output format
++ */
++enum preview_input {
++ PRV_RAW_CCDC,
++ PRV_RAW_MEM,
++ PRV_RGBBAYERCFA,
++ PRV_COMPCFA,
++ PRV_CCDC_DRKF,
++ PRV_OTHERS
++};
++enum preview_output {
++ PREVIEW_RSZ,
++ PREVIEW_MEM
++};
++/*
++ * Configure byte layout of YUV image
++ */
++enum preview_ycpos_mode {
++ YCPOS_YCrYCb = 0,
++ YCPOS_YCbYCr = 1,
++ YCPOS_CbYCrY = 2,
++ YCPOS_CrYCbY = 3
++};
++
++/**
++ * struct ispprev_gtable - Structure for Gamma Correction.
++ * @redtable: Pointer to the red gamma table.
++ * @greentable: Pointer to the green gamma table.
++ * @bluetable: Pointer to the blue gamma table.
++ */
++struct ispprev_gtable {
++ u32 *redtable;
++ u32 *greentable;
++ u32 *bluetable;
++};
++
++/**
++ * struct prev_white_balance - Structure for White Balance 2.
++ * @wb_dgain: White balance common gain.
++ * @wb_gain: Individual color gains.
++ * @wb_coefmatrix: Coefficient matrix
++ */
++struct prev_white_balance {
++ u16 wb_dgain; /* white balance common gain */
++ u8 wb_gain[WB_GAIN_MAX]; /* individual color gains */
++ u8 wb_coefmatrix[WB_GAIN_MAX][WB_GAIN_MAX];
++};
++
++/**
++ * struct prev_size_params - Structure for size parameters.
++ * @hstart: Starting pixel.
++ * @vstart: Starting line.
++ * @hsize: Width of input image.
++ * @vsize: Height of input image.
++ * @pixsize: Pixel size of the image in terms of bits.
++ * @in_pitch: Line offset of input image.
++ * @out_pitch: Line offset of output image.
++ */
++struct prev_size_params {
++ unsigned int hstart;
++ unsigned int vstart;
++ unsigned int hsize;
++ unsigned int vsize;
++ unsigned char pixsize;
++ unsigned short in_pitch;
++ unsigned short out_pitch;
++};
++
++/**
++ * struct prev_rgb2ycbcr_coeffs - Structure RGB2YCbCr parameters.
++ * @coeff: Color conversion gains in 3x3 matrix.
++ * @offset: Color conversion offsets.
++ */
++struct prev_rgb2ycbcr_coeffs {
++ short coeff[RGB_MAX][RGB_MAX];
++ short offset[RGB_MAX];
++};
++
++/**
++ * struct prev_darkfrm_params - Structure for Dark frame suppression.
++ * @addr: Memory start address.
++ * @offset: Line offset.
++ */
++struct prev_darkfrm_params {
++ u32 addr;
++ u32 offset;
++ };
++
++/**
++ * struct prev_params - Structure for all configuration
++ * @features: Set of features enabled.
++ * @pix_fmt: Output pixel format.
++ * @cfa: CFA coefficients.
++ * @csup: Chroma suppression coefficients.
++ * @ytable: Pointer to Luma enhancement coefficients.
++ * @nf: Noise filter coefficients.
++ * @dcor: Noise filter coefficients.
++ * @gtable: Gamma coefficients.
++ * @wbal: White Balance parameters.
++ * @blk_adj: Black adjustment parameters.
++ * @rgb2rgb: RGB blending parameters.
++ * @rgb2ycbcr: RGB to ycbcr parameters.
++ * @hmf_params: Horizontal median filter.
++ * @size_params: Size parameters.
++ * @drkf_params: Darkframe parameters.
++ * @lens_shading_shift:
++ * @average: Downsampling rate for averager.
++ * @contrast: Contrast.
++ * @brightness: Brightness.
++ */
++struct prev_params {
++ u16 features;
++ enum preview_ycpos_mode pix_fmt;
++ struct ispprev_cfa cfa;
++ struct ispprev_csup csup;
++ u32 *ytable;
++ struct ispprev_nf nf;
++ struct ispprev_dcor dcor;
++ struct ispprev_gtable gtable;
++ struct ispprev_wbal wbal;
++ struct ispprev_blkadj blk_adj;
++ struct ispprev_rgbtorgb rgb2rgb;
++ struct ispprev_csc rgb2ycbcr;
++ struct ispprev_hmed hmf_params;
++ struct prev_size_params size_params;
++ struct prev_darkfrm_params drkf_params;
++ u8 lens_shading_shift;
++ u8 average;
++ u8 contrast;
++ u8 brightness;
++};
++
++/**
++ * struct isptables_update - Structure for Table Configuration.
++ * @update: Specifies which tables should be updated.
++ * @flag: Specifies which tables should be enabled.
++ * @prev_nf: Pointer to structure for Noise Filter
++ * @lsc: Pointer to LSC gain table. (currently not used)
++ * @red_gamma: Pointer to red gamma correction table.
++ * @green_gamma: Pointer to green gamma correction table.
++ * @blue_gamma: Pointer to blue gamma correction table.
++ */
++struct isptables_update {
++ u16 update;
++ u16 flag;
++ struct ispprev_nf *prev_nf;
++ u32 *lsc;
++ u32 *red_gamma;
++ u32 *green_gamma;
++ u32 *blue_gamma;
++};
++
++void isppreview_config_shadow_registers(void);
++
++int isppreview_request(void);
++
++int isppreview_free(void);
++
++int isppreview_config_datapath(enum preview_input input,
++ enum preview_output output);
++
++void isppreview_config_ycpos(enum preview_ycpos_mode mode);
++
++void isppreview_config_averager(u8 average);
++
++void isppreview_enable_invalaw(u8 enable);
++
++void isppreview_enable_drkframe(u8 enable);
++
++void isppreview_enable_shadcomp(u8 enable);
++
++void isppreview_config_drkf_shadcomp(u8 scomp_shtval);
++
++void isppreview_enable_gammabypass(u8 enable);
++
++void isppreview_enable_hmed(u8 enable);
++
++void isppreview_config_hmed(struct ispprev_hmed);
++
++void isppreview_enable_noisefilter(u8 enable);
++
++void isppreview_config_noisefilter(struct ispprev_nf prev_nf);
++
++void isppreview_enable_dcor(u8 enable);
++
++void isppreview_config_dcor(struct ispprev_dcor prev_dcor);
++
++
++void isppreview_config_cfa(struct ispprev_cfa);
++
++void isppreview_config_gammacorrn(struct ispprev_gtable);
++
++void isppreview_config_chroma_suppression(struct ispprev_csup csup);
++
++void isppreview_enable_cfa(u8 enable);
++
++void isppreview_config_luma_enhancement(u32 *ytable);
++
++void isppreview_enable_luma_enhancement(u8 enable);
++
++void isppreview_enable_chroma_suppression(u8 enable);
++
++void isppreview_config_whitebalance(struct ispprev_wbal);
++
++void isppreview_config_blkadj(struct ispprev_blkadj);
++
++void isppreview_config_rgb_blending(struct ispprev_rgbtorgb);
++
++void isppreview_config_rgb_to_ycbcr(struct ispprev_csc);
++
++void isppreview_update_contrast(u8 *contrast);
++
++void isppreview_query_contrast(u8 *contrast);
++
++void isppreview_config_contrast(u8 contrast);
++
++void isppreview_get_contrast_range(u8 *min_contrast, u8 *max_contrast);
++
++void isppreview_update_brightness(u8 *brightness);
++
++void isppreview_config_brightness(u8 brightness);
++
++void isppreview_get_brightness_range(u8 *min_brightness, u8 *max_brightness);
++
++void isppreview_set_color(u8 *mode);
++
++void isppreview_get_color(u8 *mode);
++
++void isppreview_query_brightness(u8 *brightness);
++
++void isppreview_config_yc_range(struct ispprev_yclimit yclimit);
++
++int isppreview_try_size(u32 input_w, u32 input_h, u32 *output_w,
++ u32 *output_h);
++
++int isppreview_config_size(u32 input_w, u32 input_h, u32 output_w,
++ u32 output_h);
++
++int isppreview_config_inlineoffset(u32 offset);
++
++int isppreview_set_inaddr(u32 addr);
++
++int isppreview_config_outlineoffset(u32 offset);
++
++int isppreview_set_outaddr(u32 addr);
++
++int isppreview_config_darklineoffset(u32 offset);
++
++int isppreview_set_darkaddr(u32 addr);
++
++void isppreview_enable(int enable);
++
++void isppreview_suspend(void);
++
++void isppreview_resume(void);
++
++int isppreview_busy(void);
++
++struct prev_params *isppreview_get_config(void);
++
++void isppreview_print_status(void);
++
++#ifndef CONFIG_ARCH_OMAP3410
++void isppreview_save_context(void);
++#else
++static inline void isppreview_save_context(void) {}
++#endif
++
++#ifndef CONFIG_ARCH_OMAP3410
++void isppreview_restore_context(void);
++#else
++static inline void isppreview_restore_context(void) {}
++#endif
++
++int omap34xx_isp_preview_config(void *userspace_add);
++
++int omap34xx_isp_tables_update(struct isptables_update *isptables_struct);
++
++void isppreview_set_skip(u32 h, u32 v);
++
++#endif/* OMAP_ISP_PREVIEW_H */
+diff --git a/drivers/media/video/isp/ispresizer.c b/drivers/media/video/isp/ispresizer.c
+new file mode 100644
+index 0000000..f78ddb3
+--- /dev/null
++++ b/drivers/media/video/isp/ispresizer.c
+@@ -0,0 +1,928 @@
++/*
++ * ispresizer.c
++ *
++ * Driver Library for Resizer module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C)2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sameer Venkatraman <sameerv@ti.com>
++ * Mohit Jalori
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/module.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "ispresizer.h"
++
++/* Default configuration of resizer,filter coefficients,yenh for camera isp */
++static struct isprsz_yenh ispreszdefaultyenh = {0, 0, 0, 0};
++static struct isprsz_coef ispreszdefcoef = {
++ {
++ 0x0027, 0x00B2, 0x00B2, 0x0027,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ 0x0027, 0x00B2, 0x0027, 0x00B2,
++ },
++ {
++ 0x0000, 0x0100, 0x0000, 0x0000,
++ 0x03FA, 0x00F6, 0x0010, 0x0000,
++ 0x03F9, 0x00DB, 0x002C, 0x0000,
++ 0x03FB, 0x00B3, 0x0053, 0x03FF,
++ 0x03FD, 0x0082, 0x0084, 0x03FD,
++ 0x03FF, 0x0053, 0x00B3, 0x03FB,
++ 0x0000, 0x002C, 0x00DB, 0x03F9,
++ 0x0000, 0x0010, 0x00F6, 0x03FA
++ },
++ {
++ 0x0004, 0x0023, 0x0023, 0x005A,
++ 0x005A, 0x0058, 0x0058, 0x0004,
++ 0x0023, 0x0023, 0x005A, 0x005A,
++ 0x0058, 0x0058, 0x0004, 0x0023,
++ 0x0023, 0x005A, 0x005A, 0x0058,
++ 0x0058, 0x0004, 0x0023, 0x0023,
++ 0x005A, 0x005A, 0x0058, 0x0058
++ },
++ {
++ 0x0004, 0x0023, 0x005A, 0x0058,
++ 0x0023, 0x0004, 0x0000, 0x0002,
++ 0x0018, 0x004d, 0x0060, 0x0031,
++ 0x0008, 0x0000, 0x0001, 0x000f,
++ 0x003f, 0x0062, 0x003f, 0x000f,
++ 0x0001, 0x0000, 0x0008, 0x0031,
++ 0x0060, 0x004d, 0x0018, 0x0002
++ }
++};
++
++/**
++ * struct isp_res - Structure for the resizer module to store its information.
++ * @res_inuse: Indicates if resizer module has been reserved. 1 - Reserved,
++ * 0 - Freed.
++ * @h_startphase: Horizontal starting phase.
++ * @v_startphase: Vertical starting phase.
++ * @h_resz: Horizontal resizing value.
++ * @v_resz: Vertical resizing value.
++ * @outputwidth: Output Image Width in pixels.
++ * @outputheight: Output Image Height in pixels.
++ * @inputwidth: Input Image Width in pixels.
++ * @inputheight: Input Image Height in pixels.
++ * @algo: Algorithm select. 0 - Disable, 1 - [-1 2 -1]/2 high-pass filter,
++ * 2 - [-1 -2 6 -2 -1]/4 high-pass filter.
++ * @ipht_crop: Vertical start line for cropping.
++ * @ipwd_crop: Horizontal start pixel for cropping.
++ * @cropwidth: Crop Width.
++ * @cropheight: Crop Height.
++ * @resinput: Resizer input.
++ * @coeflist: Register configuration for Resizer.
++ * @ispres_mutex: Mutex for isp resizer.
++ */
++static struct isp_res {
++ int pm_state;
++ u8 res_inuse;
++ u8 h_startphase;
++ u8 v_startphase;
++ u16 h_resz;
++ u16 v_resz;
++ u32 outputwidth;
++ u32 outputheight;
++ u32 inputwidth;
++ u32 inputheight;
++ u8 algo;
++ u32 ipht_crop;
++ u32 ipwd_crop;
++ u32 cropwidth;
++ u32 cropheight;
++ dma_addr_t tmp_buf;
++ enum ispresizer_input resinput;
++ struct isprsz_coef coeflist;
++ struct mutex ispres_mutex; /* For checking/modifying res_inuse */
++} ispres_obj;
++
++/* Structure for saving/restoring resizer module registers */
++static struct isp_reg isprsz_reg_list[] = {
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_OUT_SIZE, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_IN_START, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_IN_SIZE, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INADD, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INOFF, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTADD, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTOFF, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT10, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT32, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT54, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT76, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT98, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT1110, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT1312, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT1514, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT1716, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT1918, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT2120, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT2322, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT2524, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT2726, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT2928, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_HFILT3130, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT10, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT32, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT54, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT76, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT98, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT1110, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT1312, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT1514, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT1716, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT1918, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT2120, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT2322, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT2524, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT2726, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT2928, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_VFILT3130, 0x0000},
++ {OMAP3_ISP_IOMEM_RESZ, ISPRSZ_YENH, 0x0000},
++ {0, ISP_TOK_TERM, 0x0000}
++};
++
++/**
++ * ispresizer_config_shadow_registers - Configure shadow registers.
++ **/
++void ispresizer_config_shadow_registers()
++{
++ return;
++}
++EXPORT_SYMBOL(ispresizer_config_shadow_registers);
++
++/**
++ * ispresizer_trycrop - Validate crop dimensions.
++ * @left: Left distance to start position of crop.
++ * @top: Top distance to start position of crop.
++ * @width: Width of input image.
++ * @height: Height of input image.
++ * @ow: Width of output image.
++ * @oh: Height of output image.
++ **/
++void ispresizer_trycrop(u32 left, u32 top, u32 width, u32 height, u32 ow,
++ u32 oh)
++{
++ ispres_obj.cropwidth = width + 6;
++ ispres_obj.cropheight = height + 6;
++ ispresizer_try_size(&ispres_obj.cropwidth, &ispres_obj.cropheight, &ow,
++ &oh);
++ ispres_obj.ipht_crop = top;
++ ispres_obj.ipwd_crop = left;
++}
++EXPORT_SYMBOL(ispresizer_trycrop);
++
++/**
++ * ispresizer_applycrop - Apply crop to input image.
++ **/
++void ispresizer_applycrop(void)
++{
++ ispresizer_config_size(ispres_obj.cropwidth, ispres_obj.cropheight,
++ ispres_obj.outputwidth,
++ ispres_obj.outputheight);
++ return;
++}
++EXPORT_SYMBOL(ispresizer_applycrop);
++
++/**
++ * ispresizer_request - Reserves the Resizer module.
++ *
++ * Allows only one user at a time.
++ *
++ * Returns 0 if successful, or -EBUSY if resizer module was already requested.
++ **/
++int ispresizer_request()
++{
++ mutex_lock(&ispres_obj.ispres_mutex);
++ if (!ispres_obj.res_inuse) {
++ ispres_obj.res_inuse = 1;
++ mutex_unlock(&ispres_obj.ispres_mutex);
++ isp_reg_writel(isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL) |
++ ISPCTRL_SBL_WR0_RAM_EN |
++ ISPCTRL_RSZ_CLK_EN,
++ OMAP3_ISP_IOMEM_MAIN, ISP_CTRL);
++ return 0;
++ } else {
++ mutex_unlock(&ispres_obj.ispres_mutex);
++ printk(KERN_ERR "ISP_ERR : Resizer Module Busy\n");
++ return -EBUSY;
++ }
++}
++EXPORT_SYMBOL(ispresizer_request);
++
++/**
++ * ispresizer_free - Makes Resizer module free.
++ *
++ * Returns 0 if successful, or -EINVAL if resizer module was already freed.
++ **/
++int ispresizer_free()
++{
++ mutex_lock(&ispres_obj.ispres_mutex);
++ if (ispres_obj.res_inuse) {
++ ispres_obj.res_inuse = 0;
++ mutex_unlock(&ispres_obj.ispres_mutex);
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL,
++ ~(ISPCTRL_RSZ_CLK_EN | ISPCTRL_SBL_WR0_RAM_EN));
++ return 0;
++ } else {
++ mutex_unlock(&ispres_obj.ispres_mutex);
++ DPRINTK_ISPRESZ("ISP_ERR : Resizer Module already freed\n");
++ return -EINVAL;
++ }
++}
++EXPORT_SYMBOL(ispresizer_free);
++
++/**
++ * ispresizer_config_datapath - Specifies which input to use in resizer module
++ * @input: Indicates the module that gives the image to resizer.
++ *
++ * Sets up the default resizer configuration according to the arguments.
++ *
++ * Returns 0 if successful, or -EINVAL if an unsupported input was requested.
++ **/
++int ispresizer_config_datapath(enum ispresizer_input input)
++{
++ u32 cnt = 0;
++ DPRINTK_ISPRESZ("ispresizer_config_datapath()+\n");
++ ispres_obj.resinput = input;
++ switch (input) {
++ case RSZ_OTFLY_YUV:
++ cnt &= ~ISPRSZ_CNT_INPTYP;
++ cnt &= ~ISPRSZ_CNT_INPSRC;
++ ispresizer_set_inaddr(0);
++ ispresizer_config_inlineoffset(0);
++ break;
++ case RSZ_MEM_YUV:
++ cnt |= ISPRSZ_CNT_INPSRC;
++ cnt &= ~ISPRSZ_CNT_INPTYP;
++ break;
++ case RSZ_MEM_COL8:
++ cnt |= ISPRSZ_CNT_INPSRC;
++ cnt |= ISPRSZ_CNT_INPTYP;
++ break;
++ default:
++ printk(KERN_ERR "ISP_ERR : Wrong Input\n");
++ return -EINVAL;
++ }
++ isp_reg_or(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, cnt);
++ ispresizer_config_ycpos(0);
++ ispresizer_config_filter_coef(&ispreszdefcoef);
++ ispresizer_enable_cbilin(0);
++ ispresizer_config_luma_enhance(&ispreszdefaultyenh);
++ DPRINTK_ISPRESZ("ispresizer_config_datapath()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_config_datapath);
++
++/**
++ * ispresizer_try_size - Validates input and output images size.
++ * @input_w: input width for the resizer in number of pixels per line
++ * @input_h: input height for the resizer in number of lines
++ * @output_w: output width from the resizer in number of pixels per line
++ * resizer when writing to memory needs this to be multiple of 16.
++ * @output_h: output height for the resizer in number of lines, must be even.
++ *
++ * Calculates the horizontal and vertical resize ratio, number of pixels to
++ * be cropped in the resizer module and checks the validity of various
++ * parameters. Formula used for calculation is:-
++ *
++ * 8-phase 4-tap mode :-
++ * inputwidth = (32 * sph + (ow - 1) * hrsz + 16) >> 8 + 7
++ * inputheight = (32 * spv + (oh - 1) * vrsz + 16) >> 8 + 4
++ * endpahse for width = ((32 * sph + (ow - 1) * hrsz + 16) >> 5) % 8
++ * endphase for height = ((32 * sph + (oh - 1) * hrsz + 16) >> 5) % 8
++ *
++ * 4-phase 7-tap mode :-
++ * inputwidth = (64 * sph + (ow - 1) * hrsz + 32) >> 8 + 7
++ * inputheight = (64 * spv + (oh - 1) * vrsz + 32) >> 8 + 7
++ * endpahse for width = ((64 * sph + (ow - 1) * hrsz + 32) >> 6) % 4
++ * endphase for height = ((64 * sph + (oh - 1) * hrsz + 32) >> 6) % 4
++ *
++ * Where:
++ * sph = Start phase horizontal
++ * spv = Start phase vertical
++ * ow = Output width
++ * oh = Output height
++ * hrsz = Horizontal resize value
++ * vrsz = Vertical resize value
++ *
++ * Fills up the output/input widht/height, horizontal/vertical resize ratio,
++ * horizontal/vertical crop variables in the isp_res structure.
++ **/
++int ispresizer_try_size(u32 *input_width, u32 *input_height, u32 *output_w,
++ u32 *output_h)
++{
++ u32 rsz, rsz_7, rsz_4;
++ u32 sph;
++ u32 input_w, input_h;
++ int max_in_otf, max_out_7tap;
++
++ input_w = *input_width;
++ input_h = *input_height;
++
++ if (input_w < 32 || input_h < 32) {
++ DPRINTK_ISPCCDC("ISP_ERR: RESIZER cannot handle input width"
++ " less than 32 pixels or height less than"
++ " 32\n");
++ return -EINVAL;
++ }
++ input_w -= 6;
++ input_h -= 6;
++
++ if (input_h > MAX_IN_HEIGHT)
++ return -EINVAL;
++
++ if (*output_w < 16)
++ *output_w = 16;
++
++ if (*output_h < 2)
++ *output_h = 2;
++
++ if (omap_rev() == OMAP3430_REV_ES1_0) {
++ max_in_otf = MAX_IN_WIDTH_ONTHEFLY_MODE;
++ max_out_7tap = MAX_7TAP_VRSZ_OUTWIDTH;
++ } else {
++ max_in_otf = MAX_IN_WIDTH_ONTHEFLY_MODE_ES2;
++ max_out_7tap = MAX_7TAP_VRSZ_OUTWIDTH_ES2;
++ }
++
++ if (ispres_obj.resinput == RSZ_OTFLY_YUV) {
++ if (input_w > max_in_otf)
++ return -EINVAL;
++ } else {
++ if (input_w > MAX_IN_WIDTH_MEMORY_MODE)
++ return -EINVAL;
++ }
++
++ *output_h &= 0xfffffffe;
++ sph = DEFAULTSTPHASE;
++
++ rsz_7 = ((input_h - 7) * 256) / (*output_h - 1);
++ rsz_4 = ((input_h - 4) * 256) / (*output_h - 1);
++
++ rsz = (input_h * 256) / *output_h;
++
++ if (rsz <= MID_RESIZE_VALUE) {
++ rsz = rsz_4;
++ if (rsz < MINIMUM_RESIZE_VALUE) {
++ rsz = MINIMUM_RESIZE_VALUE;
++ *output_h = (((input_h - 4) * 256) / rsz) + 1;
++ printk(KERN_INFO "%s: using output_h %d instead\n",
++ __func__, *output_h);
++ }
++ } else {
++ rsz = rsz_7;
++ if (*output_w > max_out_7tap)
++ *output_w = max_out_7tap;
++ if (rsz > MAXIMUM_RESIZE_VALUE) {
++ rsz = MAXIMUM_RESIZE_VALUE;
++ *output_h = (((input_h - 7) * 256) / rsz) + 1;
++ printk(KERN_INFO "%s: using output_h %d instead\n",
++ __func__, *output_h);
++ }
++ }
++
++ if (rsz > MID_RESIZE_VALUE) {
++ input_h =
++ (((64 * sph) + ((*output_h - 1) * rsz) + 32) / 256) + 7;
++ } else {
++ input_h =
++ (((32 * sph) + ((*output_h - 1) * rsz) + 16) / 256) + 4;
++ }
++
++ ispres_obj.outputheight = *output_h;
++ ispres_obj.v_resz = rsz;
++ ispres_obj.inputheight = input_h;
++ ispres_obj.ipht_crop = DEFAULTSTPIXEL;
++ ispres_obj.v_startphase = sph;
++
++ *output_w &= 0xfffffff0;
++ sph = DEFAULTSTPHASE;
++
++ rsz_7 = ((input_w - 7) * 256) / (*output_w - 1);
++ rsz_4 = ((input_w - 4) * 256) / (*output_w - 1);
++
++ rsz = (input_w * 256) / *output_w;
++ if (rsz > MID_RESIZE_VALUE) {
++ rsz = rsz_7;
++ if (rsz > MAXIMUM_RESIZE_VALUE) {
++ rsz = MAXIMUM_RESIZE_VALUE;
++ *output_w = (((input_w - 7) * 256) / rsz) + 1;
++ *output_w = (*output_w + 0xf) & 0xfffffff0;
++ printk(KERN_INFO "%s: using output_w %d instead\n",
++ __func__, *output_w);
++ }
++ } else {
++ rsz = rsz_4;
++ if (rsz < MINIMUM_RESIZE_VALUE) {
++ rsz = MINIMUM_RESIZE_VALUE;
++ *output_w = (((input_w - 4) * 256) / rsz) + 1;
++ *output_w = (*output_w + 0xf) & 0xfffffff0;
++ printk(KERN_INFO "%s: using output_w %d instead\n",
++ __func__, *output_w);
++ }
++ }
++
++ /* Recalculate input based on TRM equations */
++ if (rsz > MID_RESIZE_VALUE) {
++ input_w =
++ (((64 * sph) + ((*output_w - 1) * rsz) + 32) / 256) + 7;
++ } else {
++ input_w =
++ (((32 * sph) + ((*output_w - 1) * rsz) + 16) / 256) + 7;
++ }
++
++ ispres_obj.outputwidth = *output_w;
++ ispres_obj.h_resz = rsz;
++ ispres_obj.inputwidth = input_w;
++ ispres_obj.ipwd_crop = DEFAULTSTPIXEL;
++ ispres_obj.h_startphase = sph;
++
++ *input_height = input_h;
++ *input_width = input_w;
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_try_size);
++
++/**
++ * ispresizer_config_size - Configures input and output image size.
++ * @input_w: input width for the resizer in number of pixels per line.
++ * @input_h: input height for the resizer in number of lines.
++ * @output_w: output width from the resizer in number of pixels per line.
++ * @output_h: output height for the resizer in number of lines.
++ *
++ * Configures the appropriate values stored in the isp_res structure in the
++ * resizer registers.
++ *
++ * Returns 0 if successful, or -EINVAL if passed values haven't been verified
++ * with ispresizer_try_size() previously.
++ **/
++int ispresizer_config_size(u32 input_w, u32 input_h, u32 output_w,
++ u32 output_h)
++{
++ int i, j;
++ u32 res;
++ DPRINTK_ISPRESZ("ispresizer_config_size()+, input_w = %d,input_h ="
++ " %d, output_w = %d, output_h"
++ " = %d,hresz = %d,vresz = %d,"
++ " hcrop = %d, vcrop = %d,"
++ " hstph = %d, vstph = %d\n",
++ ispres_obj.inputwidth,
++ ispres_obj.inputheight,
++ ispres_obj.outputwidth,
++ ispres_obj.outputheight,
++ ispres_obj.h_resz,
++ ispres_obj.v_resz,
++ ispres_obj.ipwd_crop,
++ ispres_obj.ipht_crop,
++ ispres_obj.h_startphase,
++ ispres_obj.v_startphase);
++ if ((output_w != ispres_obj.outputwidth)
++ || (output_h != ispres_obj.outputheight)) {
++ printk(KERN_ERR "Output parameters passed do not match the"
++ " values calculated by the"
++ " trysize passed w %d, h %d"
++ " \n", output_w , output_h);
++ return -EINVAL;
++ }
++
++ /* Set Resizer input address and offset adderss */
++ ispresizer_config_inlineoffset(isp_reg_readl(OMAP3_ISP_IOMEM_PREV,
++ ISPPRV_WADD_OFFSET));
++
++ res = isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT) &
++ ~(ISPRSZ_CNT_HSTPH_MASK | ISPRSZ_CNT_VSTPH_MASK);
++ isp_reg_writel(res |
++ (ispres_obj.h_startphase << ISPRSZ_CNT_HSTPH_SHIFT) |
++ (ispres_obj.v_startphase << ISPRSZ_CNT_VSTPH_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_CNT);
++ /* Set start address for cropping */
++ isp_reg_writel(ispres_obj.tmp_buf + 2 *
++ (ispres_obj.ipht_crop * ispres_obj.inputwidth +
++ (ispres_obj.ipwd_crop & ~15)),
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INADD);
++
++ isp_reg_writel(
++ ((ispres_obj.ipwd_crop & 15) << ISPRSZ_IN_START_HORZ_ST_SHIFT) |
++ (0x00 << ISPRSZ_IN_START_VERT_ST_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_IN_START);
++
++ isp_reg_writel((0x00 << ISPRSZ_IN_START_HORZ_ST_SHIFT) |
++ (0x00 << ISPRSZ_IN_START_VERT_ST_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_IN_START);
++
++ isp_reg_writel((ispres_obj.inputwidth << ISPRSZ_IN_SIZE_HORZ_SHIFT) |
++ (ispres_obj.inputheight <<
++ ISPRSZ_IN_SIZE_VERT_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_IN_SIZE);
++ if (!ispres_obj.algo) {
++ isp_reg_writel((output_w << ISPRSZ_OUT_SIZE_HORZ_SHIFT) |
++ (output_h << ISPRSZ_OUT_SIZE_VERT_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_OUT_SIZE);
++ } else {
++ isp_reg_writel(((output_w - 4) << ISPRSZ_OUT_SIZE_HORZ_SHIFT) |
++ (output_h << ISPRSZ_OUT_SIZE_VERT_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_OUT_SIZE);
++ }
++
++ res = isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT) &
++ ~(ISPRSZ_CNT_HRSZ_MASK | ISPRSZ_CNT_VRSZ_MASK);
++ isp_reg_writel(res |
++ ((ispres_obj.h_resz - 1) << ISPRSZ_CNT_HRSZ_SHIFT) |
++ ((ispres_obj.v_resz - 1) << ISPRSZ_CNT_VRSZ_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_CNT);
++ if (ispres_obj.h_resz <= MID_RESIZE_VALUE) {
++ j = 0;
++ for (i = 0; i < 16; i++) {
++ isp_reg_writel(
++ (ispres_obj.coeflist.h_filter_coef_4tap[j]
++ << ISPRSZ_HFILT10_COEF0_SHIFT) |
++ (ispres_obj.coeflist.h_filter_coef_4tap[j + 1]
++ << ISPRSZ_HFILT10_COEF1_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_HFILT10 + (i * 0x04));
++ j += 2;
++ }
++ } else {
++ j = 0;
++ for (i = 0; i < 16; i++) {
++ if ((i + 1) % 4 == 0) {
++ isp_reg_writel((ispres_obj.coeflist.
++ h_filter_coef_7tap[j] <<
++ ISPRSZ_HFILT10_COEF0_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_HFILT10 + (i * 0x04));
++ j += 1;
++ } else {
++ isp_reg_writel((ispres_obj.coeflist.
++ h_filter_coef_7tap[j] <<
++ ISPRSZ_HFILT10_COEF0_SHIFT) |
++ (ispres_obj.coeflist.
++ h_filter_coef_7tap[j+1] <<
++ ISPRSZ_HFILT10_COEF1_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_HFILT10 + (i * 0x04));
++ j += 2;
++ }
++ }
++ }
++ if (ispres_obj.v_resz <= MID_RESIZE_VALUE) {
++ j = 0;
++ for (i = 0; i < 16; i++) {
++ isp_reg_writel((ispres_obj.coeflist.
++ v_filter_coef_4tap[j] <<
++ ISPRSZ_VFILT10_COEF0_SHIFT) |
++ (ispres_obj.coeflist.
++ v_filter_coef_4tap[j + 1] <<
++ ISPRSZ_VFILT10_COEF1_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_VFILT10 + (i * 0x04));
++ j += 2;
++ }
++ } else {
++ j = 0;
++ for (i = 0; i < 16; i++) {
++ if ((i + 1) % 4 == 0) {
++ isp_reg_writel((ispres_obj.coeflist.
++ v_filter_coef_7tap[j] <<
++ ISPRSZ_VFILT10_COEF0_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_VFILT10 + (i * 0x04));
++ j += 1;
++ } else {
++ isp_reg_writel((ispres_obj.coeflist.
++ v_filter_coef_7tap[j] <<
++ ISPRSZ_VFILT10_COEF0_SHIFT) |
++ (ispres_obj.coeflist.
++ v_filter_coef_7tap[j+1] <<
++ ISPRSZ_VFILT10_COEF1_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_VFILT10 + (i * 0x04));
++ j += 2;
++ }
++ }
++ }
++
++ ispresizer_config_outlineoffset(output_w*2);
++ DPRINTK_ISPRESZ("ispresizer_config_size()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_config_size);
++
++void __ispresizer_enable(int enable)
++{
++ int val;
++ DPRINTK_ISPRESZ("+ispresizer_enable()+\n");
++ if (enable) {
++ val = (isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_PCR) & 0x2) |
++ ISPRSZ_PCR_ENABLE;
++ } else {
++ val = isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_PCR) &
++ ~ISPRSZ_PCR_ENABLE;
++ }
++ isp_reg_writel(val, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_PCR);
++ DPRINTK_ISPRESZ("+ispresizer_enable()-\n");
++}
++
++/**
++ * ispresizer_enable - Enables the resizer module.
++ * @enable: 1 - Enable, 0 - Disable
++ *
++ * Client should configure all the sub modules in resizer before this.
++ **/
++void ispresizer_enable(int enable)
++{
++ __ispresizer_enable(enable);
++ ispres_obj.pm_state = enable;
++}
++EXPORT_SYMBOL(ispresizer_enable);
++
++/**
++ * ispresizer_suspend - Suspend resizer module.
++ **/
++void ispresizer_suspend(void)
++{
++ if (ispres_obj.pm_state)
++ __ispresizer_enable(0);
++}
++EXPORT_SYMBOL(ispresizer_suspend);
++
++/**
++ * ispresizer_resume - Resume resizer module.
++ **/
++void ispresizer_resume(void)
++{
++ if (ispres_obj.pm_state)
++ __ispresizer_enable(1);
++}
++EXPORT_SYMBOL(ispresizer_resume);
++
++/**
++ * ispresizer_busy - Checks if ISP resizer is busy.
++ *
++ * Returns busy field from ISPRSZ_PCR register.
++ **/
++int ispresizer_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_PCR) &
++ ISPPRV_PCR_BUSY;
++}
++EXPORT_SYMBOL(ispresizer_busy);
++
++/**
++ * ispresizer_config_startphase - Sets the horizontal and vertical start phase.
++ * @hstartphase: horizontal start phase (0 - 7).
++ * @vstartphase: vertical startphase (0 - 7).
++ *
++ * This API just updates the isp_res struct. Actual register write happens in
++ * ispresizer_config_size.
++ **/
++void ispresizer_config_startphase(u8 hstartphase, u8 vstartphase)
++{
++ DPRINTK_ISPRESZ("ispresizer_config_startphase()+\n");
++ ispres_obj.h_startphase = hstartphase;
++ ispres_obj.v_startphase = vstartphase;
++ DPRINTK_ISPRESZ("ispresizer_config_startphase()-\n");
++}
++EXPORT_SYMBOL(ispresizer_config_startphase);
++
++/**
++ * ispresizer_config_ycpos - Specifies if output should be in YC or CY format.
++ * @yc: 0 - YC format, 1 - CY format
++ **/
++void ispresizer_config_ycpos(u8 yc)
++{
++ DPRINTK_ISPRESZ("ispresizer_config_ycpos()+\n");
++ isp_reg_and_or(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, ~ISPRSZ_CNT_YCPOS,
++ (yc ? ISPRSZ_CNT_YCPOS : 0));
++ DPRINTK_ISPRESZ("ispresizer_config_ycpos()-\n");
++}
++EXPORT_SYMBOL(ispresizer_config_ycpos);
++
++/**
++ * Sets the chrominance algorithm
++ * @cbilin: 0 - chrominance uses same processing as luminance,
++ * 1 - bilinear interpolation processing
++ **/
++void ispresizer_enable_cbilin(u8 enable)
++{
++ DPRINTK_ISPRESZ("ispresizer_enable_cbilin()+\n");
++ isp_reg_and_or(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, ~ISPRSZ_CNT_CBILIN,
++ (enable ? ISPRSZ_CNT_CBILIN : 0));
++ DPRINTK_ISPRESZ("ispresizer_enable_cbilin()-\n");
++}
++EXPORT_SYMBOL(ispresizer_enable_cbilin);
++
++/**
++ * ispresizer_config_luma_enhance - Configures luminance enhancer parameters.
++ * @yenh: Pointer to structure containing desired values for core, slope, gain
++ * and algo parameters.
++ **/
++void ispresizer_config_luma_enhance(struct isprsz_yenh *yenh)
++{
++ DPRINTK_ISPRESZ("ispresizer_config_luma_enhance()+\n");
++ ispres_obj.algo = yenh->algo;
++ isp_reg_writel((yenh->algo << ISPRSZ_YENH_ALGO_SHIFT) |
++ (yenh->gain << ISPRSZ_YENH_GAIN_SHIFT) |
++ (yenh->slope << ISPRSZ_YENH_SLOP_SHIFT) |
++ (yenh->coreoffset << ISPRSZ_YENH_CORE_SHIFT),
++ OMAP3_ISP_IOMEM_RESZ,
++ ISPRSZ_YENH);
++ DPRINTK_ISPRESZ("ispresizer_config_luma_enhance()-\n");
++}
++EXPORT_SYMBOL(ispresizer_config_luma_enhance);
++
++/**
++ * ispresizer_config_filter_coef - Sets filter coefficients for 4 & 7-tap mode.
++ * This API just updates the isp_res struct.Actual register write happens in
++ * ispresizer_config_size.
++ * @coef: Structure containing horizontal and vertical filter coefficients for
++ * both 4-tap and 7-tap mode.
++ **/
++void ispresizer_config_filter_coef(struct isprsz_coef *coef)
++{
++ int i;
++ DPRINTK_ISPRESZ("ispresizer_config_filter_coef()+\n");
++ for (i = 0; i < 32; i++) {
++ ispres_obj.coeflist.h_filter_coef_4tap[i] =
++ coef->h_filter_coef_4tap[i];
++ ispres_obj.coeflist.v_filter_coef_4tap[i] =
++ coef->v_filter_coef_4tap[i];
++ }
++ for (i = 0; i < 28; i++) {
++ ispres_obj.coeflist.h_filter_coef_7tap[i] =
++ coef->h_filter_coef_7tap[i];
++ ispres_obj.coeflist.v_filter_coef_7tap[i] =
++ coef->v_filter_coef_7tap[i];
++ }
++ DPRINTK_ISPRESZ("ispresizer_config_filter_coef()-\n");
++}
++EXPORT_SYMBOL(ispresizer_config_filter_coef);
++
++/**
++ * ispresizer_config_inlineoffset - Configures the read address line offset.
++ * @offset: Line Offset for the input image.
++ *
++ * Returns 0 if successful, or -EINVAL if offset is not 32 bits aligned.
++ **/
++int ispresizer_config_inlineoffset(u32 offset)
++{
++ DPRINTK_ISPRESZ("ispresizer_config_inlineoffset()+\n");
++ if (offset % 32)
++ return -EINVAL;
++ isp_reg_writel(offset << ISPRSZ_SDR_INOFF_OFFSET_SHIFT,
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INOFF);
++ DPRINTK_ISPRESZ("ispresizer_config_inlineoffset()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_config_inlineoffset);
++
++/**
++ * ispresizer_set_inaddr - Sets the memory address of the input frame.
++ * @addr: 32bit memory address aligned on 32byte boundary.
++ *
++ * Returns 0 if successful, or -EINVAL if address is not 32 bits aligned.
++ **/
++int ispresizer_set_inaddr(u32 addr)
++{
++ DPRINTK_ISPRESZ("ispresizer_set_inaddr()+\n");
++ if (addr % 32)
++ return -EINVAL;
++ isp_reg_writel(addr << ISPRSZ_SDR_INADD_ADDR_SHIFT,
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INADD);
++ ispres_obj.tmp_buf = addr;
++ DPRINTK_ISPRESZ("ispresizer_set_inaddr()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_set_inaddr);
++
++/**
++ * ispresizer_config_outlineoffset - Configures the write address line offset.
++ * @offset: Line offset for the preview output.
++ *
++ * Returns 0 if successful, or -EINVAL if address is not 32 bits aligned.
++ **/
++int ispresizer_config_outlineoffset(u32 offset)
++{
++ DPRINTK_ISPRESZ("ispresizer_config_outlineoffset()+\n");
++ if (offset % 32)
++ return -EINVAL;
++ isp_reg_writel(offset << ISPRSZ_SDR_OUTOFF_OFFSET_SHIFT,
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTOFF);
++ DPRINTK_ISPRESZ("ispresizer_config_outlineoffset()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_config_outlineoffset);
++
++/**
++ * Configures the memory address to which the output frame is written.
++ * @addr: 32bit memory address aligned on 32byte boundary.
++ **/
++int ispresizer_set_outaddr(u32 addr)
++{
++ DPRINTK_ISPRESZ("ispresizer_set_outaddr()+\n");
++ if (addr % 32)
++ return -EINVAL;
++ isp_reg_writel(addr << ISPRSZ_SDR_OUTADD_ADDR_SHIFT,
++ OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTADD);
++ DPRINTK_ISPRESZ("ispresizer_set_outaddr()-\n");
++ return 0;
++}
++EXPORT_SYMBOL(ispresizer_set_outaddr);
++
++/**
++ * ispresizer_save_context - Saves the values of the resizer module registers.
++ **/
++void ispresizer_save_context(void)
++{
++ DPRINTK_ISPRESZ("Saving context\n");
++ isp_save_context(isprsz_reg_list);
++}
++EXPORT_SYMBOL(ispresizer_save_context);
++
++/**
++ * ispresizer_restore_context - Restores resizer module register values.
++ **/
++void ispresizer_restore_context(void)
++{
++ DPRINTK_ISPRESZ("Restoring context\n");
++ isp_restore_context(isprsz_reg_list);
++}
++EXPORT_SYMBOL(ispresizer_restore_context);
++
++/**
++ * ispresizer_print_status - Prints the values of the resizer module registers.
++ **/
++void ispresizer_print_status()
++{
++ if (!is_ispresz_debug_enabled())
++ return;
++ DPRINTK_ISPRESZ("###ISP_CTRL inresizer =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ DPRINTK_ISPRESZ("###ISP_IRQ0ENABLE in resizer =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE));
++ DPRINTK_ISPRESZ("###ISP_IRQ0STATUS in resizer =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS));
++ DPRINTK_ISPRESZ("###RSZ PCR =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_PCR));
++ DPRINTK_ISPRESZ("###RSZ CNT =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT));
++ DPRINTK_ISPRESZ("###RSZ OUT SIZE =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_OUT_SIZE));
++ DPRINTK_ISPRESZ("###RSZ IN START =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_IN_START));
++ DPRINTK_ISPRESZ("###RSZ IN SIZE =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_IN_SIZE));
++ DPRINTK_ISPRESZ("###RSZ SDR INADD =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INADD));
++ DPRINTK_ISPRESZ("###RSZ SDR INOFF =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_INOFF));
++ DPRINTK_ISPRESZ("###RSZ SDR OUTADD =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTADD));
++ DPRINTK_ISPRESZ("###RSZ SDR OTOFF =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_SDR_OUTOFF));
++ DPRINTK_ISPRESZ("###RSZ YENH =0x%x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_RESZ, ISPRSZ_YENH));
++}
++EXPORT_SYMBOL(ispresizer_print_status);
++
++/**
++ * isp_resizer_init - Module Initialisation.
++ *
++ * Always returns 0.
++ **/
++int __init isp_resizer_init(void)
++{
++ mutex_init(&ispres_obj.ispres_mutex);
++ ispres_obj.pm_state = 0;
++ return 0;
++}
++
++/**
++ * isp_resizer_cleanup - Module Cleanup.
++ **/
++void isp_resizer_cleanup(void)
++{
++}
+diff --git a/drivers/media/video/isp/ispresizer.h b/drivers/media/video/isp/ispresizer.h
+new file mode 100644
+index 0000000..4e92225
+--- /dev/null
++++ b/drivers/media/video/isp/ispresizer.h
+@@ -0,0 +1,158 @@
++/*
++ * ispresizer.h
++ *
++ * Driver header file for Resizer module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sameer Venkatraman <sameerv@ti.com>
++ * Mohit Jalori
++ * Sergio Aguirre <saaguirre@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_RESIZER_H
++#define OMAP_ISP_RESIZER_H
++
++/*
++ * Resizer Constants
++ */
++#define MAX_IN_WIDTH_MEMORY_MODE 4095
++
++#define MAX_IN_WIDTH_ONTHEFLY_MODE 1280
++#define MAX_IN_WIDTH_ONTHEFLY_MODE_ES2 4095
++#define MAX_IN_HEIGHT 4095
++#define MINIMUM_RESIZE_VALUE 64
++#define MAXIMUM_RESIZE_VALUE 1024
++#define MID_RESIZE_VALUE 512
++
++#define MAX_7TAP_HRSZ_OUTWIDTH 1280
++#define MAX_7TAP_VRSZ_OUTWIDTH 640
++
++#define MAX_7TAP_HRSZ_OUTWIDTH_ES2 3300
++#define MAX_7TAP_VRSZ_OUTWIDTH_ES2 1650
++
++#define DEFAULTSTPIXEL 0
++#define DEFAULTSTPHASE 1
++#define DEFAULTHSTPIXEL4TAPMODE 3
++#define FOURPHASE 4
++#define EIGHTPHASE 8
++#define RESIZECONSTANT 256
++#define SHIFTER4TAPMODE 0
++#define SHIFTER7TAPMODE 1
++#define DEFAULTOFFSET 7
++#define OFFSETVERT4TAPMODE 4
++#define OPWDALIGNCONSTANT 0xfffffff0
++
++/*
++ * The client is supposed to call resizer API in the following sequence:
++ * - request()
++ * - config_datatpath()
++ * - optionally config/enable sub modules
++ * - try/config size
++ * - setup callback
++ * - setup in/out memory offsets and ptrs
++ * - enable()
++ * ...
++ * - disable()
++ * - free()
++ */
++
++enum ispresizer_input {
++ RSZ_OTFLY_YUV,
++ RSZ_MEM_YUV,
++ RSZ_MEM_COL8
++};
++
++/**
++ * struct isprsz_coef - Structure for resizer filter coeffcients.
++ * @h_filter_coef_4tap: Horizontal filter coefficients for 8-phase/4-tap
++ * mode (.5x-4x)
++ * @v_filter_coef_4tap: Vertical filter coefficients for 8-phase/4-tap
++ * mode (.5x-4x)
++ * @h_filter_coef_7tap: Horizontal filter coefficients for 4-phase/7-tap
++ * mode (.25x-.5x)
++ * @v_filter_coef_7tap: Vertical filter coefficients for 4-phase/7-tap
++ * mode (.25x-.5x)
++ */
++struct isprsz_coef {
++ u16 h_filter_coef_4tap[32];
++ u16 v_filter_coef_4tap[32];
++ u16 h_filter_coef_7tap[28];
++ u16 v_filter_coef_7tap[28];
++};
++
++/**
++ * struct isprsz_yenh - Structure for resizer luminance enhancer parameters.
++ * @algo: Algorithm select.
++ * @gain: Maximum gain.
++ * @slope: Slope.
++ * @coreoffset: Coring offset.
++ */
++struct isprsz_yenh {
++ u8 algo;
++ u8 gain;
++ u8 slope;
++ u8 coreoffset;
++};
++
++void ispresizer_config_shadow_registers(void);
++
++int ispresizer_request(void);
++
++int ispresizer_free(void);
++
++int ispresizer_config_datapath(enum ispresizer_input input);
++
++void ispresizer_enable_cbilin(u8 enable);
++
++void ispresizer_config_ycpos(u8 yc);
++
++void ispresizer_config_startphase(u8 hstartphase, u8 vstartphase);
++
++void ispresizer_config_filter_coef(struct isprsz_coef *coef);
++
++void ispresizer_config_luma_enhance(struct isprsz_yenh *yenh);
++
++int ispresizer_try_size(u32 *input_w, u32 *input_h, u32 *output_w,
++ u32 *output_h);
++
++void ispresizer_applycrop(void);
++
++void ispresizer_trycrop(u32 left, u32 top, u32 width, u32 height, u32 ow,
++ u32 oh);
++
++int ispresizer_config_size(u32 input_w, u32 input_h, u32 output_w,
++ u32 output_h);
++
++int ispresizer_config_inlineoffset(u32 offset);
++
++int ispresizer_set_inaddr(u32 addr);
++
++int ispresizer_config_outlineoffset(u32 offset);
++
++int ispresizer_set_outaddr(u32 addr);
++
++void ispresizer_enable(int enable);
++
++void ispresizer_suspend(void);
++
++void ispresizer_resume(void);
++
++int ispresizer_busy(void);
++
++void ispresizer_save_context(void);
++
++void ispresizer_restore_context(void);
++
++void ispresizer_print_status(void);
++
++#endif /* OMAP_ISP_RESIZER_H */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0006-omap3isp-Add-statistics-collection-modules-H3A-and.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0006-omap3isp-Add-statistics-collection-modules-H3A-and.patch
new file mode 100644
index 0000000000..876ce780f0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0006-omap3isp-Add-statistics-collection-modules-H3A-and.patch
@@ -0,0 +1,2741 @@
+From 9a39eab5ed1b70711c3b10de95cd90749293ef7a Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add statistics collection modules (H3A and HIST)
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/isp_af.c | 784 +++++++++++++++++++++++++++++++
+ drivers/media/video/isp/isp_af.h | 125 +++++
+ drivers/media/video/isp/isph3a.c | 932 +++++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/isph3a.h | 127 +++++
+ drivers/media/video/isp/isphist.c | 608 ++++++++++++++++++++++++
+ drivers/media/video/isp/isphist.h | 105 +++++
+ 6 files changed, 2681 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/isp_af.c
+ create mode 100644 drivers/media/video/isp/isp_af.h
+ create mode 100644 drivers/media/video/isp/isph3a.c
+ create mode 100644 drivers/media/video/isp/isph3a.h
+ create mode 100644 drivers/media/video/isp/isphist.c
+ create mode 100644 drivers/media/video/isp/isphist.h
+
+diff --git a/drivers/media/video/isp/isp_af.c b/drivers/media/video/isp/isp_af.c
+new file mode 100644
+index 0000000..a607b97
+--- /dev/null
++++ b/drivers/media/video/isp/isp_af.c
+@@ -0,0 +1,784 @@
++/*
++ * isp_af.c
++ *
++ * AF module for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++/* Linux specific include files */
++#include <asm/cacheflush.h>
++
++#include <linux/uaccess.h>
++#include <linux/dma-mapping.h>
++#include <asm/atomic.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "isph3a.h"
++#include "isp_af.h"
++#include "ispmmu.h"
++
++/**
++ * struct isp_af_buffer - AF frame stats buffer.
++ * @virt_addr: Virtual address to mmap the buffer.
++ * @phy_addr: Physical address of the buffer.
++ * @addr_align: Virtual Address 32 bytes aligned.
++ * @ispmmu_addr: Address of the buffer mapped by the ISPMMU.
++ * @mmap_addr: Mapped memory area of buffer. For userspace access.
++ * @locked: 1 - Buffer locked from write. 0 - Buffer can be overwritten.
++ * @frame_num: Frame number from which the statistics are taken.
++ * @lens_position: Lens position currently set in the DW9710 Coil motor driver.
++ * @next: Pointer to link next buffer.
++ */
++struct isp_af_buffer {
++ unsigned long virt_addr;
++ unsigned long phy_addr;
++ unsigned long addr_align;
++ unsigned long ispmmu_addr;
++ unsigned long mmap_addr;
++
++ u8 locked;
++ u16 frame_num;
++ u32 config_counter;
++ struct isp_af_xtrastats xtrastats;
++ struct isp_af_buffer *next;
++};
++
++/**
++ * struct isp_af_status - AF status.
++ * @initialized: 1 - Buffers initialized.
++ * @update: 1 - Update registers.
++ * @stats_req: 1 - Future stats requested.
++ * @stats_done: 1 - Stats ready for user.
++ * @frame_req: Number of frame requested for statistics.
++ * @af_buff: Array of statistics buffers to access.
++ * @stats_buf_size: Statistics buffer size.
++ * @curr_cfg_buf_size: Current user configured stats buff size.
++ * @min_buf_size: Minimum statisitics buffer size.
++ * @frame_count: Frame Count.
++ * @stats_wait: Wait primitive for locking/unlocking the stats request.
++ * @buffer_lock: Spinlock for statistics buffers access.
++ */
++static struct isp_af_status {
++ u8 initialized;
++ u8 update;
++ u8 stats_req;
++ u8 stats_done;
++ u16 frame_req;
++
++ struct isp_af_buffer af_buff[H3A_MAX_BUFF];
++ unsigned int stats_buf_size;
++ unsigned int min_buf_size;
++ unsigned int curr_cfg_buf_size;
++
++ int pm_state;
++ u32 frame_count;
++ wait_queue_head_t stats_wait;
++ atomic_t config_counter;
++ spinlock_t buffer_lock; /* For stats buffers read/write sync */
++} afstat;
++
++struct af_device *af_dev_configptr;
++static struct isp_af_buffer *active_buff;
++static int af_major = -1;
++static int camnotify;
++
++/**
++ * isp_af_setxtrastats - Receives extra statistics from prior frames.
++ * @xtrastats: Pointer to structure containing extra statistics fields like
++ * field count and timestamp of frame.
++ *
++ * Called from update_vbq in camera driver
++ **/
++void isp_af_setxtrastats(struct isp_af_xtrastats *xtrastats, u8 updateflag)
++{
++ int i, past_i;
++
++ if (active_buff == NULL)
++ return;
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if (afstat.af_buff[i].frame_num == active_buff->frame_num)
++ break;
++ }
++
++ if (i == H3A_MAX_BUFF)
++ return;
++
++ if (i == 0) {
++ if (afstat.af_buff[H3A_MAX_BUFF - 1].locked == 0)
++ past_i = H3A_MAX_BUFF - 1;
++ else
++ past_i = H3A_MAX_BUFF - 2;
++ } else if (i == 1) {
++ if (afstat.af_buff[0].locked == 0)
++ past_i = 0;
++ else
++ past_i = H3A_MAX_BUFF - 1;
++ } else {
++ if (afstat.af_buff[i - 1].locked == 0)
++ past_i = i - 1;
++ else
++ past_i = i - 2;
++ }
++
++ if (updateflag & AF_UPDATEXS_TS)
++ afstat.af_buff[past_i].xtrastats.ts = xtrastats->ts;
++
++ if (updateflag & AF_UPDATEXS_FIELDCOUNT)
++ afstat.af_buff[past_i].xtrastats.field_count =
++ xtrastats->field_count;
++}
++EXPORT_SYMBOL(isp_af_setxtrastats);
++
++/*
++ * Helper function to update buffer cache pages
++ */
++static void isp_af_update_req_buffer(struct isp_af_buffer *buffer)
++{
++ int size = afstat.stats_buf_size;
++
++ size = PAGE_ALIGN(size);
++ /* Update the kernel pages of the requested buffer */
++ dmac_inv_range((void *)buffer->addr_align, (void *)buffer->addr_align +
++ size);
++}
++
++#define IS_OUT_OF_BOUNDS(value, min, max) \
++ (((value) < (min)) || ((value) > (max)))
++
++/* Function to check paxel parameters */
++int isp_af_check_paxel(void)
++{
++ struct af_paxel *paxel_cfg = &af_dev_configptr->config->paxel_config;
++ struct af_iir *iir_cfg = &af_dev_configptr->config->iir_config;
++
++ /* Check horizontal Count */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->hz_cnt, AF_PAXEL_HORIZONTAL_COUNT_MIN,
++ AF_PAXEL_HORIZONTAL_COUNT_MAX)) {
++ DPRINTK_ISP_AF("Error : Horizontal Count is incorrect");
++ return -AF_ERR_HZ_COUNT;
++ }
++
++ /*Check Vertical Count */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->vt_cnt, AF_PAXEL_VERTICAL_COUNT_MIN,
++ AF_PAXEL_VERTICAL_COUNT_MAX)) {
++ DPRINTK_ISP_AF("Error : Vertical Count is incorrect");
++ return -AF_ERR_VT_COUNT;
++ }
++
++ /*Check Height */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->height, AF_PAXEL_HEIGHT_MIN,
++ AF_PAXEL_HEIGHT_MAX)) {
++ DPRINTK_ISP_AF("Error : Height is incorrect");
++ return -AF_ERR_HEIGHT;
++ }
++
++ /*Check width */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->width, AF_PAXEL_WIDTH_MIN,
++ AF_PAXEL_WIDTH_MAX)) {
++ DPRINTK_ISP_AF("Error : Width is incorrect");
++ return -AF_ERR_WIDTH;
++ }
++
++ /*Check Line Increment */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->line_incr, AF_PAXEL_INCREMENT_MIN,
++ AF_PAXEL_INCREMENT_MAX)) {
++ DPRINTK_ISP_AF("Error : Line Increment is incorrect");
++ return -AF_ERR_INCR;
++ }
++
++ /*Check Horizontal Start */
++ if ((paxel_cfg->hz_start % 2 != 0) ||
++ (paxel_cfg->hz_start < (iir_cfg->hz_start_pos + 2)) ||
++ IS_OUT_OF_BOUNDS(paxel_cfg->hz_start,
++ AF_PAXEL_HZSTART_MIN, AF_PAXEL_HZSTART_MAX)) {
++ DPRINTK_ISP_AF("Error : Horizontal Start is incorrect");
++ return -AF_ERR_HZ_START;
++ }
++
++ /*Check Vertical Start */
++ if (IS_OUT_OF_BOUNDS(paxel_cfg->vt_start, AF_PAXEL_VTSTART_MIN,
++ AF_PAXEL_VTSTART_MAX)) {
++ DPRINTK_ISP_AF("Error : Vertical Start is incorrect");
++ return -AF_ERR_VT_START;
++ }
++ return 0;
++}
++
++/**
++ * isp_af_check_iir - Function to check IIR Coefficient.
++ **/
++int isp_af_check_iir(void)
++{
++ struct af_iir *iir_cfg = &af_dev_configptr->config->iir_config;
++ int index;
++
++ for (index = 0; index < AF_NUMBER_OF_COEF; index++) {
++ if ((iir_cfg->coeff_set0[index]) > AF_COEF_MAX) {
++ DPRINTK_ISP_AF("Error : Coefficient for set 0 is "
++ "incorrect");
++ return -AF_ERR_IIR_COEF;
++ }
++
++ if ((iir_cfg->coeff_set1[index]) > AF_COEF_MAX) {
++ DPRINTK_ISP_AF("Error : Coefficient for set 1 is "
++ "incorrect");
++ return -AF_ERR_IIR_COEF;
++ }
++ }
++
++ if (IS_OUT_OF_BOUNDS(iir_cfg->hz_start_pos, AF_IIRSH_MIN,
++ AF_IIRSH_MAX)) {
++ DPRINTK_ISP_AF("Error : IIRSH is incorrect");
++ return -AF_ERR_IIRSH;
++ }
++
++ return 0;
++}
++/**
++ * isp_af_unlock_buffers - Helper function to unlock all buffers.
++ **/
++static void isp_af_unlock_buffers(void)
++{
++ int i;
++ unsigned long irqflags;
++
++ spin_lock_irqsave(&afstat.buffer_lock, irqflags);
++ for (i = 0; i < H3A_MAX_BUFF; i++)
++ afstat.af_buff[i].locked = 0;
++
++ spin_unlock_irqrestore(&afstat.buffer_lock, irqflags);
++}
++
++/*
++ * Helper function to link allocated buffers
++ */
++static void isp_af_link_buffers(void)
++{
++ int i;
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if ((i + 1) < H3A_MAX_BUFF)
++ afstat.af_buff[i].next = &afstat.af_buff[i + 1];
++ else
++ afstat.af_buff[i].next = &afstat.af_buff[0];
++ }
++}
++
++/* Function to perform hardware set up */
++int isp_af_configure(struct af_configuration *afconfig)
++{
++ int result;
++ int buff_size, i;
++ unsigned int busyaf;
++ struct af_configuration *af_curr_cfg = af_dev_configptr->config;
++
++ if (NULL == afconfig) {
++ printk(KERN_ERR "Null argument in configuration. \n");
++ return -EINVAL;
++ }
++
++ memcpy(af_curr_cfg, afconfig, sizeof(struct af_configuration));
++ /* Get the value of PCR register */
++ busyaf = isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++
++ if ((busyaf & AF_BUSYAF) == AF_BUSYAF) {
++ DPRINTK_ISP_AF("AF_register_setup_ERROR : Engine Busy");
++ DPRINTK_ISP_AF("\n Configuration cannot be done ");
++ return -AF_ERR_ENGINE_BUSY;
++ }
++
++ /* Check IIR Coefficient and start Values */
++ result = isp_af_check_iir();
++ if (result < 0)
++ return result;
++
++ /* Check Paxel Values */
++ result = isp_af_check_paxel();
++ if (result < 0)
++ return result;
++
++ /* Check HMF Threshold Values */
++ if (af_curr_cfg->hmf_config.threshold > AF_THRESHOLD_MAX) {
++ DPRINTK_ISP_AF("Error : HMF Threshold is incorrect");
++ return -AF_ERR_THRESHOLD;
++ }
++
++ /* Compute buffer size */
++ buff_size = (af_curr_cfg->paxel_config.hz_cnt + 1) *
++ (af_curr_cfg->paxel_config.vt_cnt + 1) * AF_PAXEL_SIZE;
++
++ afstat.curr_cfg_buf_size = buff_size;
++ /* Deallocate the previous buffers */
++ if (afstat.stats_buf_size && buff_size > afstat.stats_buf_size) {
++ isp_af_enable(0);
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ ispmmu_kunmap(afstat.af_buff[i].ispmmu_addr);
++ dma_free_coherent(
++ NULL, afstat.min_buf_size,
++ (void *)afstat.af_buff[i].virt_addr,
++ (dma_addr_t)afstat.af_buff[i].phy_addr);
++ afstat.af_buff[i].virt_addr = 0;
++ }
++ afstat.stats_buf_size = 0;
++ }
++
++ if (!afstat.af_buff[0].virt_addr) {
++ afstat.stats_buf_size = buff_size;
++ afstat.min_buf_size = PAGE_ALIGN(afstat.stats_buf_size);
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ afstat.af_buff[i].virt_addr =
++ (unsigned long)dma_alloc_coherent(
++ NULL,
++ afstat.min_buf_size,
++ (dma_addr_t *)
++ &afstat.af_buff[i].phy_addr,
++ GFP_KERNEL | GFP_DMA);
++ if (afstat.af_buff[i].virt_addr == 0) {
++ printk(KERN_ERR "Can't acquire memory for "
++ "buffer[%d]\n", i);
++ return -ENOMEM;
++ }
++ afstat.af_buff[i].addr_align =
++ afstat.af_buff[i].virt_addr;
++ while ((afstat.af_buff[i].addr_align & 0xFFFFFFC0) !=
++ afstat.af_buff[i].addr_align)
++ afstat.af_buff[i].addr_align++;
++ afstat.af_buff[i].ispmmu_addr =
++ ispmmu_kmap(afstat.af_buff[i].phy_addr,
++ afstat.min_buf_size);
++ }
++ isp_af_unlock_buffers();
++ isp_af_link_buffers();
++
++ /* First active buffer */
++ if (active_buff == NULL)
++ active_buff = &afstat.af_buff[0];
++ isp_af_set_address(active_buff->ispmmu_addr);
++ }
++
++ result = isp_af_register_setup(af_dev_configptr);
++ if (result < 0)
++ return result;
++ af_dev_configptr->size_paxel = buff_size;
++ atomic_inc(&afstat.config_counter);
++ afstat.initialized = 1;
++ afstat.frame_count = 1;
++ active_buff->frame_num = 1;
++ /* Set configuration flag to indicate HW setup done */
++ if (af_curr_cfg->af_config)
++ isp_af_enable(1);
++ else
++ isp_af_enable(0);
++
++ /* Success */
++ return 0;
++}
++EXPORT_SYMBOL(isp_af_configure);
++
++int isp_af_register_setup(struct af_device *af_dev)
++{
++ unsigned int pcr = 0, pax1 = 0, pax2 = 0, paxstart = 0;
++ unsigned int coef = 0;
++ unsigned int base_coef_set0 = 0;
++ unsigned int base_coef_set1 = 0;
++ int index;
++
++ /* Configure Hardware Registers */
++ /* Read PCR Register */
++ pcr = isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++
++ /* Set Accumulator Mode */
++ if (af_dev->config->mode == ACCUMULATOR_PEAK)
++ pcr |= FVMODE;
++ else
++ pcr &= ~FVMODE;
++
++ /* Set A-law */
++ if (af_dev->config->alaw_enable == H3A_AF_ALAW_ENABLE)
++ pcr |= AF_ALAW_EN;
++ else
++ pcr &= ~AF_ALAW_EN;
++
++ /* Set RGB Position */
++ pcr &= ~RGBPOS;
++ pcr |= af_dev->config->rgb_pos << AF_RGBPOS_SHIFT;
++
++ /* HMF Configurations */
++ if (af_dev->config->hmf_config.enable == H3A_AF_HMF_ENABLE) {
++ pcr &= ~AF_MED_EN;
++ /* Enable HMF */
++ pcr |= AF_MED_EN;
++
++ /* Set Median Threshold */
++ pcr &= ~MED_TH;
++ pcr |= af_dev->config->hmf_config.threshold << AF_MED_TH_SHIFT;
++ } else
++ pcr &= ~AF_MED_EN;
++
++ /* Set PCR Register */
++ isp_reg_writel(pcr, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++
++ pax1 &= ~PAXW;
++ pax1 |= af_dev->config->paxel_config.width << AF_PAXW_SHIFT;
++
++ /* Set height in AFPAX1 */
++ pax1 &= ~PAXH;
++ pax1 |= af_dev->config->paxel_config.height;
++
++ isp_reg_writel(pax1, OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAX1);
++
++ /* Configure AFPAX2 Register */
++ /* Set Line Increment in AFPAX2 Register */
++ pax2 &= ~AFINCV;
++ pax2 |= af_dev->config->paxel_config.line_incr << AF_LINE_INCR_SHIFT;
++ /* Set Vertical Count */
++ pax2 &= ~PAXVC;
++ pax2 |= af_dev->config->paxel_config.vt_cnt << AF_VT_COUNT_SHIFT;
++ /* Set Horizontal Count */
++ pax2 &= ~PAXHC;
++ pax2 |= af_dev->config->paxel_config.hz_cnt;
++ isp_reg_writel(pax2, OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAX2);
++
++ /* Configure PAXSTART Register */
++ /*Configure Horizontal Start */
++ paxstart &= ~PAXSH;
++ paxstart |= af_dev->config->paxel_config.hz_start << AF_HZ_START_SHIFT;
++ /* Configure Vertical Start */
++ paxstart &= ~PAXSV;
++ paxstart |= af_dev->config->paxel_config.vt_start;
++ isp_reg_writel(paxstart, OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAXSTART);
++
++ /*SetIIRSH Register */
++ isp_reg_writel(af_dev->config->iir_config.hz_start_pos,
++ OMAP3_ISP_IOMEM_H3A, ISPH3A_AFIIRSH);
++
++ /*Set IIR Filter0 Coefficients */
++ base_coef_set0 = ISPH3A_AFCOEF010;
++ for (index = 0; index <= 8; index += 2) {
++ coef &= ~COEF_MASK0;
++ coef |= af_dev->config->iir_config.coeff_set0[index];
++ coef &= ~COEF_MASK1;
++ coef |= af_dev->config->iir_config.coeff_set0[index + 1] <<
++ AF_COEF_SHIFT;
++ isp_reg_writel(coef, OMAP3_ISP_IOMEM_H3A, base_coef_set0);
++ base_coef_set0 = base_coef_set0 + AFCOEF_OFFSET;
++ }
++
++ /* set AFCOEF0010 Register */
++ isp_reg_writel(af_dev->config->iir_config.coeff_set0[10],
++ OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF010);
++
++ /*Set IIR Filter1 Coefficients */
++
++ base_coef_set1 = ISPH3A_AFCOEF110;
++ for (index = 0; index <= 8; index += 2) {
++ coef &= ~COEF_MASK0;
++ coef |= af_dev->config->iir_config.coeff_set1[index];
++ coef &= ~COEF_MASK1;
++ coef |= af_dev->config->iir_config.coeff_set1[index + 1] <<
++ AF_COEF_SHIFT;
++ isp_reg_writel(coef, OMAP3_ISP_IOMEM_H3A, base_coef_set1);
++
++ base_coef_set1 = base_coef_set1 + AFCOEF_OFFSET;
++ }
++ isp_reg_writel(af_dev->config->iir_config.coeff_set1[10],
++ OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF1010);
++
++ return 0;
++}
++
++/* Function to set address */
++void isp_af_set_address(unsigned long address)
++{
++ isp_reg_writel(address, OMAP3_ISP_IOMEM_H3A, ISPH3A_AFBUFST);
++}
++
++static int isp_af_stats_available(struct isp_af_data *afdata)
++{
++ int i, ret;
++ unsigned long irqflags;
++
++ spin_lock_irqsave(&afstat.buffer_lock, irqflags);
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ DPRINTK_ISP_AF("Checking Stats buff[%d] (%d) for %d\n",
++ i, afstat.af_buff[i].frame_num,
++ afdata->frame_number);
++ if (afdata->frame_number == afstat.af_buff[i].frame_num
++ && afstat.af_buff[i].frame_num != active_buff->frame_num) {
++ afstat.af_buff[i].locked = 1;
++ spin_unlock_irqrestore(&afstat.buffer_lock, irqflags);
++ isp_af_update_req_buffer(&afstat.af_buff[i]);
++ afstat.af_buff[i].frame_num = 0;
++ ret = copy_to_user((void *)afdata->af_statistics_buf,
++ (void *)afstat.af_buff[i].virt_addr,
++ afstat.curr_cfg_buf_size);
++ if (ret) {
++ printk(KERN_ERR "Failed copy_to_user for "
++ "H3A stats buff, %d\n", ret);
++ }
++ afdata->xtrastats.ts = afstat.af_buff[i].xtrastats.ts;
++ afdata->xtrastats.field_count =
++ afstat.af_buff[i].xtrastats.field_count;
++ return 0;
++ }
++ }
++ spin_unlock_irqrestore(&afstat.buffer_lock, irqflags);
++ /* Stats unavailable */
++
++ return -1;
++}
++
++void isp_af_notify(int notify)
++{
++ camnotify = notify;
++ if (camnotify && afstat.initialized) {
++ printk(KERN_DEBUG "Warning Camera Off \n");
++ afstat.stats_req = 0;
++ afstat.stats_done = 1;
++ wake_up_interruptible(&afstat.stats_wait);
++ }
++}
++EXPORT_SYMBOL(isp_af_notify);
++/*
++ * This API allows the user to update White Balance gains, as well as
++ * exposure time and analog gain. It is also used to request frame
++ * statistics.
++ */
++int isp_af_request_statistics(struct isp_af_data *afdata)
++{
++ int ret = 0;
++ u16 frame_diff = 0;
++ u16 frame_cnt = afstat.frame_count;
++ wait_queue_t wqt;
++
++ if (!af_dev_configptr->config->af_config) {
++ printk(KERN_ERR "AF engine not enabled\n");
++ return -EINVAL;
++ }
++
++ if (!(afdata->update & REQUEST_STATISTICS)) {
++ afdata->af_statistics_buf = NULL;
++ goto out;
++ }
++
++ isp_af_unlock_buffers();
++ /* Stats available? */
++ DPRINTK_ISP_AF("Stats available?\n");
++ ret = isp_af_stats_available(afdata);
++ if (!ret)
++ goto out;
++
++ /* Stats in near future? */
++ DPRINTK_ISP_AF("Stats in near future?\n");
++ if (afdata->frame_number > frame_cnt)
++ frame_diff = afdata->frame_number - frame_cnt;
++ else if (afdata->frame_number < frame_cnt) {
++ if (frame_cnt > MAX_FRAME_COUNT - MAX_FUTURE_FRAMES
++ && afdata->frame_number < MAX_FRAME_COUNT) {
++ frame_diff = afdata->frame_number + MAX_FRAME_COUNT -
++ frame_cnt;
++ } else {
++ /* Frame unavailable */
++ frame_diff = MAX_FUTURE_FRAMES + 1;
++ }
++ }
++
++ if (frame_diff > MAX_FUTURE_FRAMES) {
++ printk(KERN_ERR "Invalid frame requested, returning current"
++ " frame stats\n");
++ afdata->frame_number = frame_cnt;
++ }
++ if (!camnotify) {
++ /* Block until frame in near future completes */
++ afstat.frame_req = afdata->frame_number;
++ afstat.stats_req = 1;
++ afstat.stats_done = 0;
++ init_waitqueue_entry(&wqt, current);
++ ret = wait_event_interruptible(afstat.stats_wait,
++ afstat.stats_done == 1);
++ if (ret < 0) {
++ afdata->af_statistics_buf = NULL;
++ return ret;
++ }
++ DPRINTK_ISP_AF("ISP AF request status interrupt raised\n");
++
++ /* Stats now available */
++ ret = isp_af_stats_available(afdata);
++ if (ret) {
++ printk(KERN_ERR "After waiting for stats, stats not"
++ " available!!\n");
++ afdata->af_statistics_buf = NULL;
++ }
++ }
++
++out:
++ afdata->curr_frame = afstat.frame_count;
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_af_request_statistics);
++
++/* This function will handle the H3A interrupt. */
++static void isp_af_isr(unsigned long status, isp_vbq_callback_ptr arg1,
++ void *arg2)
++{
++ u16 frame_align;
++
++ if ((H3A_AF_DONE & status) != H3A_AF_DONE)
++ return;
++
++ /* timestamp stats buffer */
++ do_gettimeofday(&active_buff->xtrastats.ts);
++ active_buff->config_counter = atomic_read(&afstat.config_counter);
++
++ /* Exchange buffers */
++ active_buff = active_buff->next;
++ if (active_buff->locked == 1)
++ active_buff = active_buff->next;
++ isp_af_set_address(active_buff->ispmmu_addr);
++
++ /* Update frame counter */
++ afstat.frame_count++;
++ frame_align = afstat.frame_count;
++ if (afstat.frame_count > MAX_FRAME_COUNT) {
++ afstat.frame_count = 1;
++ frame_align++;
++ }
++ active_buff->frame_num = afstat.frame_count;
++
++ /* Future Stats requested? */
++ if (afstat.stats_req) {
++ /* Is the frame we want already done? */
++ if (frame_align >= afstat.frame_req + 1) {
++ afstat.stats_req = 0;
++ afstat.stats_done = 1;
++ wake_up_interruptible(&afstat.stats_wait);
++ }
++ }
++}
++
++int __isp_af_enable(int enable)
++{
++ unsigned int pcr;
++
++ pcr = isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++
++ /* Set AF_EN bit in PCR Register */
++ if (enable) {
++ if (isp_set_callback(CBK_H3A_AF_DONE, isp_af_isr,
++ (void *)NULL, (void *)NULL)) {
++ printk(KERN_ERR "No callback for AF\n");
++ return -EINVAL;
++ }
++
++ pcr |= AF_EN;
++ } else {
++ isp_unset_callback(CBK_H3A_AF_DONE);
++ pcr &= ~AF_EN;
++ }
++ isp_reg_writel(pcr, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++ return 0;
++}
++
++/* Function to Enable/Disable AF Engine */
++int isp_af_enable(int enable)
++{
++ int rval;
++
++ rval = __isp_af_enable(enable);
++
++ if (!rval)
++ afstat.pm_state = enable;
++
++ return rval;
++}
++
++/* Function to Suspend AF Engine */
++void isp_af_suspend(void)
++{
++ if (afstat.pm_state)
++ __isp_af_enable(0);
++}
++
++/* Function to Resume AF Engine */
++void isp_af_resume(void)
++{
++ if (afstat.pm_state)
++ __isp_af_enable(1);
++}
++
++int isp_af_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR)
++ & ISPH3A_PCR_BUSYAF;
++}
++
++/* Function to register the AF character device driver. */
++int __init isp_af_init(void)
++{
++ /*allocate memory for device structure and initialize it with 0 */
++ af_dev_configptr = kzalloc(sizeof(struct af_device), GFP_KERNEL);
++ if (!af_dev_configptr)
++ goto err_nomem1;
++
++ active_buff = NULL;
++
++ af_dev_configptr->config = (struct af_configuration *)
++ kzalloc(sizeof(struct af_configuration), GFP_KERNEL);
++
++ if (af_dev_configptr->config == NULL)
++ goto err_nomem2;
++
++ memset(&afstat, 0, sizeof(afstat));
++
++ init_waitqueue_head(&afstat.stats_wait);
++ spin_lock_init(&afstat.buffer_lock);
++
++ return 0;
++
++err_nomem2:
++ kfree(af_dev_configptr);
++err_nomem1:
++ printk(KERN_ERR "Error: kmalloc fail");
++ return -ENOMEM;
++}
++
++void isp_af_exit(void)
++{
++ int i;
++
++ /* Free buffers */
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if (!afstat.af_buff[i].phy_addr)
++ continue;
++
++ ispmmu_kunmap(afstat.af_buff[i].ispmmu_addr);
++
++ dma_free_coherent(NULL,
++ afstat.min_buf_size,
++ (void *)afstat.af_buff[i].virt_addr,
++ (dma_addr_t)afstat.af_buff[i].phy_addr);
++ }
++ kfree(af_dev_configptr->config);
++ kfree(af_dev_configptr);
++
++ memset(&afstat, 0, sizeof(afstat));
++
++ af_major = -1;
++}
+diff --git a/drivers/media/video/isp/isp_af.h b/drivers/media/video/isp/isp_af.h
+new file mode 100644
+index 0000000..ee2b89f
+--- /dev/null
++++ b/drivers/media/video/isp/isp_af.h
+@@ -0,0 +1,125 @@
++/*
++ * isp_af.h
++ *
++ * Include file for AF module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++/* Device Constants */
++#ifndef OMAP_ISP_AF_H
++#define OMAP_ISP_AF_H
++
++#include <mach/isp_user.h>
++
++#define AF_MAJOR_NUMBER 0
++#define ISPAF_NAME "OMAPISP_AF"
++#define AF_NR_DEVS 1
++#define AF_TIMEOUT ((300 * HZ) / 1000)
++
++
++
++/* Print Macros */
++/*list of error code */
++#define AF_ERR_HZ_COUNT 800 /* Invalid Horizontal Count */
++#define AF_ERR_VT_COUNT 801 /* Invalid Vertical Count */
++#define AF_ERR_HEIGHT 802 /* Invalid Height */
++#define AF_ERR_WIDTH 803 /* Invalid width */
++#define AF_ERR_INCR 804 /* Invalid Increment */
++#define AF_ERR_HZ_START 805 /* Invalid horizontal Start */
++#define AF_ERR_VT_START 806 /* Invalud vertical Start */
++#define AF_ERR_IIRSH 807 /* Invalid IIRSH value */
++#define AF_ERR_IIR_COEF 808 /* Invalid Coefficient */
++#define AF_ERR_SETUP 809 /* Setup not done */
++#define AF_ERR_THRESHOLD 810 /* Invalid Threshold */
++#define AF_ERR_ENGINE_BUSY 811 /* Engine is busy */
++
++#define AFPID 0x0 /* Peripheral Revision
++ * and Class Information
++ */
++
++#define AFCOEF_OFFSET 0x00000004 /* COEFFICIENT BASE
++ * ADDRESS
++ */
++
++/*
++ * PCR fields
++ */
++#define AF_BUSYAF (1 << 15)
++#define FVMODE (1 << 14)
++#define RGBPOS (0x7 << 11)
++#define MED_TH (0xFF << 3)
++#define AF_MED_EN (1 << 2)
++#define AF_ALAW_EN (1 << 1)
++#define AF_EN (1 << 0)
++
++/*
++ * AFPAX1 fields
++ */
++#define PAXW (0x7F << 16)
++#define PAXH 0x7F
++
++/*
++ * AFPAX2 fields
++ */
++#define AFINCV (0xF << 13)
++#define PAXVC (0x7F << 6)
++#define PAXHC 0x3F
++
++/*
++ * AFPAXSTART fields
++ */
++#define PAXSH (0xFFF<<16)
++#define PAXSV 0xFFF
++
++/*
++ * COEFFICIENT MASK
++ */
++
++#define COEF_MASK0 0xFFF
++#define COEF_MASK1 (0xFFF<<16)
++
++/* BIT SHIFTS */
++#define AF_RGBPOS_SHIFT 11
++#define AF_MED_TH_SHIFT 3
++#define AF_PAXW_SHIFT 16
++#define AF_LINE_INCR_SHIFT 13
++#define AF_VT_COUNT_SHIFT 6
++#define AF_HZ_START_SHIFT 16
++#define AF_COEF_SHIFT 16
++
++#define AF_UPDATEXS_TS (1 << 0)
++#define AF_UPDATEXS_FIELDCOUNT (1 << 1)
++#define AF_UPDATEXS_LENSPOS (1 << 2)
++
++/* Structure for device of AF Engine */
++struct af_device {
++ struct af_configuration *config; /*Device configuration structure */
++ int size_paxel; /*Paxel size in bytes */
++};
++
++int isp_af_check_paxel(void);
++int isp_af_check_iir(void);
++int isp_af_register_setup(struct af_device *af_dev);
++int isp_af_enable(int);
++void isp_af_suspend(void);
++void isp_af_resume(void);
++int isp_af_busy(void);
++void isp_af_notify(int notify);
++int isp_af_request_statistics(struct isp_af_data *afdata);
++int isp_af_configure(struct af_configuration *afconfig);
++void isp_af_set_address(unsigned long);
++void isp_af_setxtrastats(struct isp_af_xtrastats *xtrastats, u8 updateflag);
++#endif /* OMAP_ISP_AF_H */
+diff --git a/drivers/media/video/isp/isph3a.c b/drivers/media/video/isp/isph3a.c
+new file mode 100644
+index 0000000..7ff1c5b
+--- /dev/null
++++ b/drivers/media/video/isp/isph3a.c
+@@ -0,0 +1,932 @@
++/*
++ * isph3a.c
++ *
++ * H3A module for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <asm/cacheflush.h>
++
++#include <linux/dma-mapping.h>
++#include <linux/uaccess.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "isph3a.h"
++#include "ispmmu.h"
++#include "isppreview.h"
++
++/**
++ * struct isph3a_aewb_buffer - AE, AWB frame stats buffer.
++ * @virt_addr: Virtual address to mmap the buffer.
++ * @phy_addr: Physical address of the buffer.
++ * @addr_align: Virtual Address 32 bytes aligned.
++ * @ispmmu_addr: Address of the buffer mapped by the ISPMMU.
++ * @mmap_addr: Mapped memory area of buffer. For userspace access.
++ * @locked: 1 - Buffer locked from write. 0 - Buffer can be overwritten.
++ * @frame_num: Frame number from which the statistics are taken.
++ * @next: Pointer to link next buffer.
++ */
++struct isph3a_aewb_buffer {
++ unsigned long virt_addr;
++ unsigned long phy_addr;
++ unsigned long addr_align;
++ unsigned long ispmmu_addr;
++ unsigned long mmap_addr; /* For userspace */
++ struct timeval ts;
++ u32 config_counter;
++
++ u8 locked;
++ u16 frame_num;
++ struct isph3a_aewb_buffer *next;
++};
++
++/**
++ * struct isph3a_aewb_status - AE, AWB status.
++ * @initialized: 1 - Buffers initialized.
++ * @update: 1 - Update registers.
++ * @stats_req: 1 - Future stats requested.
++ * @stats_done: 1 - Stats ready for user.
++ * @frame_req: Number of frame requested for statistics.
++ * @h3a_buff: Array of statistics buffers to access.
++ * @stats_buf_size: Statistics buffer size.
++ * @min_buf_size: Minimum statisitics buffer size.
++ * @win_count: Window Count.
++ * @frame_count: Frame Count.
++ * @stats_wait: Wait primitive for locking/unlocking the stats request.
++ * @buffer_lock: Spinlock for statistics buffers access.
++ */
++static struct isph3a_aewb_status {
++ u8 initialized;
++ u8 update;
++ u8 stats_req;
++ u8 stats_done;
++ u16 frame_req;
++ int pm_state;
++
++ struct isph3a_aewb_buffer h3a_buff[H3A_MAX_BUFF];
++ unsigned int stats_buf_size;
++ unsigned int min_buf_size;
++ unsigned int curr_cfg_buf_size;
++
++ atomic_t config_counter;
++
++ u16 win_count;
++ u32 frame_count;
++ wait_queue_head_t stats_wait;
++ spinlock_t buffer_lock; /* For stats buffers read/write sync */
++} aewbstat;
++
++/**
++ * struct isph3a_aewb_regs - Current value of AE, AWB configuration registers.
++ * reg_pcr: Peripheral control register.
++ * reg_win1: Control register.
++ * reg_start: Start position register.
++ * reg_blk: Black line register.
++ * reg_subwin: Configuration register.
++ */
++static struct isph3a_aewb_regs {
++ u32 reg_pcr;
++ u32 reg_win1;
++ u32 reg_start;
++ u32 reg_blk;
++ u32 reg_subwin;
++} aewb_regs;
++
++static struct isph3a_aewb_config aewb_config_local = {
++ .saturation_limit = 0x3FF,
++ .win_height = 0,
++ .win_width = 0,
++ .ver_win_count = 0,
++ .hor_win_count = 0,
++ .ver_win_start = 0,
++ .hor_win_start = 0,
++ .blk_ver_win_start = 0,
++ .blk_win_height = 0,
++ .subsample_ver_inc = 0,
++ .subsample_hor_inc = 0,
++ .alaw_enable = 0,
++ .aewb_enable = 0,
++};
++
++/* Structure for saving/restoring h3a module registers */
++static struct isp_reg isph3a_reg_list[] = {
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR, 0}, /* Should be the first one */
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWWIN1, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINSTART, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINBLK, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWSUBWIN, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWBUFST, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAX1, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAX2, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFPAXSTART, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFIIRSH, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFBUFST, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF010, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF032, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF054, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF076, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF098, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF0010, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF110, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF132, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF154, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF176, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF198, 0},
++ {OMAP3_ISP_IOMEM_H3A, ISPH3A_AFCOEF1010, 0},
++ {0, ISP_TOK_TERM, 0}
++};
++
++static struct ispprev_wbal h3awb_update;
++static struct isph3a_aewb_buffer *active_buff;
++static struct isph3a_aewb_xtrastats h3a_xtrastats[H3A_MAX_BUFF];
++static int camnotify;
++static int wb_update;
++static void isph3a_print_status(void);
++
++/**
++ * isph3a_aewb_setxtrastats - Receives extra statistics from prior frames.
++ * @xtrastats: Pointer to structure containing extra statistics fields like
++ * field count and timestamp of frame.
++ *
++ * Called from update_vbq in camera driver
++ **/
++void isph3a_aewb_setxtrastats(struct isph3a_aewb_xtrastats *xtrastats)
++{
++ int i;
++
++ if (active_buff == NULL)
++ return;
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if (aewbstat.h3a_buff[i].frame_num != active_buff->frame_num)
++ continue;
++
++ if (i == 0) {
++ if (aewbstat.h3a_buff[H3A_MAX_BUFF - 1].locked == 0) {
++ h3a_xtrastats[H3A_MAX_BUFF - 1] =
++ *xtrastats;
++ } else {
++ h3a_xtrastats[H3A_MAX_BUFF - 2] =
++ *xtrastats;
++ }
++ } else if (i == 1) {
++ if (aewbstat.h3a_buff[0].locked == 0)
++ h3a_xtrastats[0] = *xtrastats;
++ else {
++ h3a_xtrastats[H3A_MAX_BUFF - 1] =
++ *xtrastats;
++ }
++ } else {
++ if (aewbstat.h3a_buff[i - 1].locked == 0)
++ h3a_xtrastats[i - 1] = *xtrastats;
++ else
++ h3a_xtrastats[i - 2] = *xtrastats;
++ }
++ return;
++ }
++}
++EXPORT_SYMBOL(isph3a_aewb_setxtrastats);
++
++void __isph3a_aewb_enable(u8 enable)
++{
++ isp_reg_writel(IRQ0STATUS_H3A_AWB_DONE_IRQ, OMAP3_ISP_IOMEM_MAIN,
++ ISP_IRQ0STATUS);
++
++ if (enable) {
++ aewb_regs.reg_pcr |= ISPH3A_PCR_AEW_EN;
++ DPRINTK_ISPH3A(" H3A enabled \n");
++ } else {
++ aewb_regs.reg_pcr &= ~ISPH3A_PCR_AEW_EN;
++ DPRINTK_ISPH3A(" H3A disabled \n");
++ }
++ isp_reg_and_or(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR, ~ISPH3A_PCR_AEW_EN,
++ (enable ? ISPH3A_PCR_AEW_EN : 0));
++ aewb_config_local.aewb_enable = enable;
++}
++
++/**
++ * isph3a_aewb_enable - Enables AE, AWB engine in the H3A module.
++ * @enable: 1 - Enables the AE & AWB engine.
++ *
++ * Client should configure all the AE & AWB registers in H3A before this.
++ **/
++void isph3a_aewb_enable(u8 enable)
++{
++ __isph3a_aewb_enable(enable);
++ aewbstat.pm_state = enable;
++}
++
++/**
++ * isph3a_aewb_suspend - Suspend AE, AWB engine in the H3A module.
++ **/
++void isph3a_aewb_suspend(void)
++{
++ if (aewbstat.pm_state)
++ __isph3a_aewb_enable(0);
++}
++
++/**
++ * isph3a_aewb_resume - Resume AE, AWB engine in the H3A module.
++ **/
++void isph3a_aewb_resume(void)
++{
++ if (aewbstat.pm_state)
++ __isph3a_aewb_enable(1);
++}
++
++int isph3a_aewb_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR)
++ & ISPH3A_PCR_BUSYAEAWB;
++}
++
++/**
++ * isph3a_update_wb - Updates WB parameters.
++ *
++ * Needs to be called when no ISP Preview processing is taking place.
++ **/
++void isph3a_update_wb(void)
++{
++ if (wb_update) {
++ isppreview_config_whitebalance(h3awb_update);
++ wb_update = 0;
++ }
++ return;
++}
++EXPORT_SYMBOL(isph3a_update_wb);
++
++/**
++ * isph3a_aewb_update_regs - Helper function to update h3a registers.
++ **/
++static void isph3a_aewb_update_regs(void)
++{
++ isp_reg_writel(aewb_regs.reg_pcr, OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR);
++ isp_reg_writel(aewb_regs.reg_win1, OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWWIN1);
++ isp_reg_writel(aewb_regs.reg_start, OMAP3_ISP_IOMEM_H3A,
++ ISPH3A_AEWINSTART);
++ isp_reg_writel(aewb_regs.reg_blk, OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINBLK);
++ isp_reg_writel(aewb_regs.reg_subwin, OMAP3_ISP_IOMEM_H3A,
++ ISPH3A_AEWSUBWIN);
++
++ aewbstat.update = 0;
++ aewbstat.frame_count = 1;
++}
++
++/**
++ * isph3a_aewb_update_req_buffer - Helper function to update buffer cache pages
++ * @buffer: Pointer to structure
++ **/
++static void isph3a_aewb_update_req_buffer(struct isph3a_aewb_buffer *buffer)
++{
++ int size = aewbstat.stats_buf_size;
++
++ size = PAGE_ALIGN(size);
++ dmac_inv_range((void *)buffer->addr_align,
++ (void *)buffer->addr_align + size);
++}
++
++/**
++ * isph3a_aewb_stats_available - Check for stats available of specified frame.
++ * @aewbdata: Pointer to return AE AWB statistics data
++ *
++ * Returns 0 if successful, or -1 if statistics are unavailable.
++ **/
++static int isph3a_aewb_stats_available(struct isph3a_aewb_data *aewbdata)
++{
++ int i, ret;
++ unsigned long irqflags;
++
++ spin_lock_irqsave(&aewbstat.buffer_lock, irqflags);
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ DPRINTK_ISPH3A("Checking Stats buff[%d] (%d) for %d\n",
++ i, aewbstat.h3a_buff[i].frame_num,
++ aewbdata->frame_number);
++ if ((aewbdata->frame_number !=
++ aewbstat.h3a_buff[i].frame_num) ||
++ (aewbstat.h3a_buff[i].frame_num ==
++ active_buff->frame_num))
++ continue;
++ aewbstat.h3a_buff[i].locked = 1;
++ spin_unlock_irqrestore(&aewbstat.buffer_lock, irqflags);
++ isph3a_aewb_update_req_buffer(&aewbstat.h3a_buff[i]);
++ aewbstat.h3a_buff[i].frame_num = 0;
++ ret = copy_to_user((void *)aewbdata->h3a_aewb_statistics_buf,
++ (void *)aewbstat.h3a_buff[i].virt_addr,
++ aewbstat.curr_cfg_buf_size);
++ if (ret) {
++ printk(KERN_ERR "Failed copy_to_user for "
++ "H3A stats buff, %d\n", ret);
++ }
++ aewbdata->ts = aewbstat.h3a_buff[i].ts;
++ aewbdata->config_counter = aewbstat.h3a_buff[i].config_counter;
++ aewbdata->field_count = h3a_xtrastats[i].field_count;
++ return 0;
++ }
++ spin_unlock_irqrestore(&aewbstat.buffer_lock, irqflags);
++
++ return -1;
++}
++
++/**
++ * isph3a_aewb_link_buffers - Helper function to link allocated buffers.
++ **/
++static void isph3a_aewb_link_buffers(void)
++{
++ int i;
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if ((i + 1) < H3A_MAX_BUFF) {
++ aewbstat.h3a_buff[i].next = &aewbstat.h3a_buff[i + 1];
++ h3a_xtrastats[i].next = &h3a_xtrastats[i + 1];
++ } else {
++ aewbstat.h3a_buff[i].next = &aewbstat.h3a_buff[0];
++ h3a_xtrastats[i].next = &h3a_xtrastats[0];
++ }
++ }
++}
++
++/**
++ * isph3a_aewb_unlock_buffers - Helper function to unlock all buffers.
++ **/
++static void isph3a_aewb_unlock_buffers(void)
++{
++ int i;
++ unsigned long irqflags;
++
++ spin_lock_irqsave(&aewbstat.buffer_lock, irqflags);
++ for (i = 0; i < H3A_MAX_BUFF; i++)
++ aewbstat.h3a_buff[i].locked = 0;
++
++ spin_unlock_irqrestore(&aewbstat.buffer_lock, irqflags);
++}
++
++/**
++ * isph3a_aewb_isr - Callback from ISP driver for H3A AEWB interrupt.
++ * @status: IRQ0STATUS in case of MMU error, 0 for H3A interrupt.
++ * @arg1: Not used as of now.
++ * @arg2: Not used as of now.
++ */
++static void isph3a_aewb_isr(unsigned long status, isp_vbq_callback_ptr arg1,
++ void *arg2)
++{
++ u16 frame_align;
++
++ if ((H3A_AWB_DONE & status) != H3A_AWB_DONE)
++ return;
++
++ do_gettimeofday(&active_buff->ts);
++ active_buff->config_counter = atomic_read(&aewbstat.config_counter);
++ active_buff = active_buff->next;
++ if (active_buff->locked == 1)
++ active_buff = active_buff->next;
++ isp_reg_writel(active_buff->ispmmu_addr, OMAP3_ISP_IOMEM_H3A,
++ ISPH3A_AEWBUFST);
++
++ aewbstat.frame_count++;
++ frame_align = aewbstat.frame_count;
++ if (aewbstat.frame_count > MAX_FRAME_COUNT) {
++ aewbstat.frame_count = 1;
++ frame_align++;
++ }
++ active_buff->frame_num = aewbstat.frame_count;
++
++ if (aewbstat.stats_req) {
++ DPRINTK_ISPH3A("waiting for frame %d\n", aewbstat.frame_req);
++ if (frame_align >= aewbstat.frame_req + 1) {
++ aewbstat.stats_req = 0;
++ aewbstat.stats_done = 1;
++ wake_up_interruptible(&aewbstat.stats_wait);
++ }
++ }
++
++ if (aewbstat.update)
++ isph3a_aewb_update_regs();
++}
++
++/**
++ * isph3a_aewb_set_params - Helper function to check & store user given params.
++ * @user_cfg: Pointer to AE and AWB parameters struct.
++ *
++ * As most of them are busy-lock registers, need to wait until AEW_BUSY = 0 to
++ * program them during ISR.
++ *
++ * Returns 0 if successful, or -EINVAL if any of the parameters are invalid.
++ **/
++static int isph3a_aewb_set_params(struct isph3a_aewb_config *user_cfg)
++{
++ if (unlikely(user_cfg->saturation_limit > MAX_SATURATION_LIM)) {
++ printk(KERN_ERR "Invalid Saturation_limit: %d\n",
++ user_cfg->saturation_limit);
++ return -EINVAL;
++ }
++ if (aewb_config_local.saturation_limit != user_cfg->saturation_limit) {
++ WRITE_SAT_LIM(aewb_regs.reg_pcr, user_cfg->saturation_limit);
++ aewb_config_local.saturation_limit =
++ user_cfg->saturation_limit;
++ aewbstat.update = 1;
++ }
++
++ if (aewb_config_local.alaw_enable != user_cfg->alaw_enable) {
++ WRITE_ALAW(aewb_regs.reg_pcr, user_cfg->alaw_enable);
++ aewb_config_local.alaw_enable = user_cfg->alaw_enable;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->win_height < MIN_WIN_H ||
++ user_cfg->win_height > MAX_WIN_H ||
++ user_cfg->win_height & 0x01)) {
++ printk(KERN_ERR "Invalid window height: %d\n",
++ user_cfg->win_height);
++ return -EINVAL;
++ }
++ if (aewb_config_local.win_height != user_cfg->win_height) {
++ WRITE_WIN_H(aewb_regs.reg_win1, user_cfg->win_height);
++ aewb_config_local.win_height = user_cfg->win_height;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->win_width < MIN_WIN_W ||
++ user_cfg->win_width > MAX_WIN_W ||
++ user_cfg->win_width & 0x01)) {
++ printk(KERN_ERR "Invalid window width: %d\n",
++ user_cfg->win_width);
++ return -EINVAL;
++ }
++ if (aewb_config_local.win_width != user_cfg->win_width) {
++ WRITE_WIN_W(aewb_regs.reg_win1, user_cfg->win_width);
++ aewb_config_local.win_width = user_cfg->win_width;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->ver_win_count < 1 ||
++ user_cfg->ver_win_count > MAX_WINVC)) {
++ printk(KERN_ERR "Invalid vertical window count: %d\n",
++ user_cfg->ver_win_count);
++ return -EINVAL;
++ }
++ if (aewb_config_local.ver_win_count != user_cfg->ver_win_count) {
++ WRITE_VER_C(aewb_regs.reg_win1, user_cfg->ver_win_count);
++ aewb_config_local.ver_win_count = user_cfg->ver_win_count;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->hor_win_count < 1 ||
++ user_cfg->hor_win_count > MAX_WINHC)) {
++ printk(KERN_ERR "Invalid horizontal window count: %d\n",
++ user_cfg->hor_win_count);
++ return -EINVAL;
++ }
++ if (aewb_config_local.hor_win_count != user_cfg->hor_win_count) {
++ WRITE_HOR_C(aewb_regs.reg_win1, user_cfg->hor_win_count);
++ aewb_config_local.hor_win_count = user_cfg->hor_win_count;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->ver_win_start > MAX_WINSTART)) {
++ printk(KERN_ERR "Invalid vertical window start: %d\n",
++ user_cfg->ver_win_start);
++ return -EINVAL;
++ }
++ if (aewb_config_local.ver_win_start != user_cfg->ver_win_start) {
++ WRITE_VER_WIN_ST(aewb_regs.reg_start, user_cfg->ver_win_start);
++ aewb_config_local.ver_win_start = user_cfg->ver_win_start;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->hor_win_start > MAX_WINSTART)) {
++ printk(KERN_ERR "Invalid horizontal window start: %d\n",
++ user_cfg->hor_win_start);
++ return -EINVAL;
++ }
++ if (aewb_config_local.hor_win_start != user_cfg->hor_win_start) {
++ WRITE_HOR_WIN_ST(aewb_regs.reg_start, user_cfg->hor_win_start);
++ aewb_config_local.hor_win_start = user_cfg->hor_win_start;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->blk_ver_win_start > MAX_WINSTART)) {
++ printk(KERN_ERR "Invalid black vertical window start: %d\n",
++ user_cfg->blk_ver_win_start);
++ return -EINVAL;
++ }
++ if (aewb_config_local.blk_ver_win_start !=
++ user_cfg->blk_ver_win_start) {
++ WRITE_BLK_VER_WIN_ST(aewb_regs.reg_blk,
++ user_cfg->blk_ver_win_start);
++ aewb_config_local.blk_ver_win_start =
++ user_cfg->blk_ver_win_start;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->blk_win_height < MIN_WIN_H ||
++ user_cfg->blk_win_height > MAX_WIN_H ||
++ user_cfg->blk_win_height & 0x01)) {
++ printk(KERN_ERR "Invalid black window height: %d\n",
++ user_cfg->blk_win_height);
++ return -EINVAL;
++ }
++ if (aewb_config_local.blk_win_height != user_cfg->blk_win_height) {
++ WRITE_BLK_WIN_H(aewb_regs.reg_blk, user_cfg->blk_win_height);
++ aewb_config_local.blk_win_height = user_cfg->blk_win_height;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->subsample_ver_inc < MIN_SUB_INC ||
++ user_cfg->subsample_ver_inc > MAX_SUB_INC ||
++ user_cfg->subsample_ver_inc & 0x01)) {
++ printk(KERN_ERR "Invalid vertical subsample increment: %d\n",
++ user_cfg->subsample_ver_inc);
++ return -EINVAL;
++ }
++ if (aewb_config_local.subsample_ver_inc !=
++ user_cfg->subsample_ver_inc) {
++ WRITE_SUB_VER_INC(aewb_regs.reg_subwin,
++ user_cfg->subsample_ver_inc);
++ aewb_config_local.subsample_ver_inc =
++ user_cfg->subsample_ver_inc;
++ aewbstat.update = 1;
++ }
++
++ if (unlikely(user_cfg->subsample_hor_inc < MIN_SUB_INC ||
++ user_cfg->subsample_hor_inc > MAX_SUB_INC ||
++ user_cfg->subsample_hor_inc & 0x01)) {
++ printk(KERN_ERR "Invalid horizontal subsample increment: %d\n",
++ user_cfg->subsample_hor_inc);
++ return -EINVAL;
++ }
++ if (aewb_config_local.subsample_hor_inc !=
++ user_cfg->subsample_hor_inc) {
++ WRITE_SUB_HOR_INC(aewb_regs.reg_subwin,
++ user_cfg->subsample_hor_inc);
++ aewb_config_local.subsample_hor_inc =
++ user_cfg->subsample_hor_inc;
++ aewbstat.update = 1;
++ }
++
++ if (!aewbstat.initialized || !aewb_config_local.aewb_enable) {
++ isph3a_aewb_update_regs();
++ aewbstat.initialized = 1;
++ }
++ return 0;
++}
++
++/**
++ * isph3a_aewb_configure - Configure AEWB regs, enable/disable H3A engine.
++ * @aewbcfg: Pointer to AEWB config structure.
++ *
++ * Returns 0 if successful, -EINVAL if aewbcfg pointer is NULL, -ENOMEM if
++ * was unable to allocate memory for the buffer, of other errors if H3A
++ * callback is not set or the parameters for AEWB are invalid.
++ **/
++int isph3a_aewb_configure(struct isph3a_aewb_config *aewbcfg)
++{
++ int ret = 0;
++ int i;
++ int win_count = 0;
++
++ if (NULL == aewbcfg) {
++ printk(KERN_ERR "Null argument in configuration. \n");
++ return -EINVAL;
++ }
++
++ if (!aewbstat.initialized) {
++ DPRINTK_ISPH3A("Setting callback for H3A\n");
++ ret = isp_set_callback(CBK_H3A_AWB_DONE, isph3a_aewb_isr,
++ (void *)NULL, (void *)NULL);
++ if (ret) {
++ printk(KERN_ERR "No callback for H3A\n");
++ return ret;
++ }
++ }
++
++ ret = isph3a_aewb_set_params(aewbcfg);
++ if (ret) {
++ printk(KERN_ERR "Invalid parameters! \n");
++ return ret;
++ }
++
++ win_count = aewbcfg->ver_win_count * aewbcfg->hor_win_count;
++ win_count += aewbcfg->hor_win_count;
++ ret = win_count / 8;
++ win_count += win_count % 8 ? 1 : 0;
++ win_count += ret;
++
++ aewbstat.win_count = win_count;
++ aewbstat.curr_cfg_buf_size = win_count * AEWB_PACKET_SIZE;
++
++ if (aewbstat.stats_buf_size
++ && win_count * AEWB_PACKET_SIZE > aewbstat.stats_buf_size) {
++ DPRINTK_ISPH3A("There was a previous buffer... "
++ "Freeing/unmapping current stat busffs\n");
++ isph3a_aewb_enable(0);
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ ispmmu_kunmap(aewbstat.h3a_buff[i].ispmmu_addr);
++ dma_free_coherent(
++ NULL,
++ aewbstat.min_buf_size,
++ (void *)aewbstat.h3a_buff[i].virt_addr,
++ (dma_addr_t)aewbstat.h3a_buff[i].phy_addr);
++ aewbstat.h3a_buff[i].virt_addr = 0;
++ }
++ aewbstat.stats_buf_size = 0;
++ }
++
++ if (!aewbstat.h3a_buff[0].virt_addr) {
++ aewbstat.stats_buf_size = win_count * AEWB_PACKET_SIZE;
++ aewbstat.min_buf_size = PAGE_ALIGN(aewbstat.stats_buf_size);
++
++ DPRINTK_ISPH3A("Allocating/mapping new stat buffs\n");
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ aewbstat.h3a_buff[i].virt_addr =
++ (unsigned long)dma_alloc_coherent(
++ NULL,
++ aewbstat.min_buf_size,
++ (dma_addr_t *)
++ &aewbstat.h3a_buff[i].phy_addr,
++ GFP_KERNEL | GFP_DMA);
++ if (aewbstat.h3a_buff[i].virt_addr == 0) {
++ printk(KERN_ERR "Can't acquire memory for "
++ "buffer[%d]\n", i);
++ return -ENOMEM;
++ }
++ aewbstat.h3a_buff[i].addr_align =
++ aewbstat.h3a_buff[i].virt_addr;
++ while ((aewbstat.h3a_buff[i].addr_align & 0xFFFFFFC0) !=
++ aewbstat.h3a_buff[i].addr_align)
++ aewbstat.h3a_buff[i].addr_align++;
++ aewbstat.h3a_buff[i].ispmmu_addr =
++ ispmmu_kmap(aewbstat.h3a_buff[i].phy_addr,
++ aewbstat.min_buf_size);
++ }
++ isph3a_aewb_unlock_buffers();
++ isph3a_aewb_link_buffers();
++
++ if (active_buff == NULL)
++ active_buff = &aewbstat.h3a_buff[0];
++
++ isp_reg_writel(active_buff->ispmmu_addr, OMAP3_ISP_IOMEM_H3A,
++ ISPH3A_AEWBUFST);
++ }
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ DPRINTK_ISPH3A("buff[%d] addr is:\n virt 0x%lX\n"
++ " aligned 0x%lX\n"
++ " phys 0x%lX\n"
++ " ispmmu 0x%08lX\n"
++ " mmapped 0x%lX\n"
++ " frame_num %d\n", i,
++ aewbstat.h3a_buff[i].virt_addr,
++ aewbstat.h3a_buff[i].addr_align,
++ aewbstat.h3a_buff[i].phy_addr,
++ aewbstat.h3a_buff[i].ispmmu_addr,
++ aewbstat.h3a_buff[i].mmap_addr,
++ aewbstat.h3a_buff[i].frame_num);
++ }
++
++ active_buff->frame_num = 1;
++
++ atomic_inc(&aewbstat.config_counter);
++ isph3a_aewb_enable(aewbcfg->aewb_enable);
++ isph3a_print_status();
++
++ return 0;
++}
++EXPORT_SYMBOL(isph3a_aewb_configure);
++
++/**
++ * isph3a_aewb_request_statistics - REquest statistics and update gains in AEWB
++ * @aewbdata: Pointer to return AE AWB statistics data.
++ *
++ * This API allows the user to update White Balance gains, as well as
++ * exposure time and analog gain. It is also used to request frame
++ * statistics.
++ *
++ * Returns 0 if successful, -EINVAL when H3A engine is not enabled, or other
++ * errors when setting gains.
++ **/
++int isph3a_aewb_request_statistics(struct isph3a_aewb_data *aewbdata)
++{
++ int ret = 0;
++ u16 frame_diff = 0;
++ u16 frame_cnt = aewbstat.frame_count;
++ wait_queue_t wqt;
++
++ if (!aewb_config_local.aewb_enable) {
++ printk(KERN_ERR "H3A engine not enabled\n");
++ return -EINVAL;
++ }
++
++ DPRINTK_ISPH3A("isph3a_aewb_request_statistics: Enter "
++ "(frame req. => %d, current frame => %d,"
++ "update => %d)\n",
++ aewbdata->frame_number, frame_cnt, aewbdata->update);
++ DPRINTK_ISPH3A("User data received: \n");
++ DPRINTK_ISPH3A("Digital gain = 0x%04x\n", aewbdata->dgain);
++ DPRINTK_ISPH3A("WB gain b *= 0x%04x\n", aewbdata->wb_gain_b);
++ DPRINTK_ISPH3A("WB gain r *= 0x%04x\n", aewbdata->wb_gain_r);
++ DPRINTK_ISPH3A("WB gain gb = 0x%04x\n", aewbdata->wb_gain_gb);
++ DPRINTK_ISPH3A("WB gain gr = 0x%04x\n", aewbdata->wb_gain_gr);
++
++ if (!aewbdata->update) {
++ aewbdata->h3a_aewb_statistics_buf = NULL;
++ goto out;
++ }
++ if (aewbdata->update & SET_DIGITAL_GAIN)
++ h3awb_update.dgain = (u16)aewbdata->dgain;
++ if (aewbdata->update & SET_COLOR_GAINS) {
++ h3awb_update.coef0 = (u8)aewbdata->wb_gain_gr;
++ h3awb_update.coef1 = (u8)aewbdata->wb_gain_r;
++ h3awb_update.coef2 = (u8)aewbdata->wb_gain_b;
++ h3awb_update.coef3 = (u8)aewbdata->wb_gain_gb;
++ }
++ if (aewbdata->update & (SET_COLOR_GAINS | SET_DIGITAL_GAIN))
++ wb_update = 1;
++
++ if (!(aewbdata->update & REQUEST_STATISTICS)) {
++ aewbdata->h3a_aewb_statistics_buf = NULL;
++ goto out;
++ }
++
++ if (aewbdata->frame_number < 1) {
++ printk(KERN_ERR "Illeagal frame number "
++ "requested (%d)\n",
++ aewbdata->frame_number);
++ return -EINVAL;
++ }
++
++ isph3a_aewb_unlock_buffers();
++
++ DPRINTK_ISPH3A("Stats available?\n");
++ ret = isph3a_aewb_stats_available(aewbdata);
++ if (!ret)
++ goto out;
++
++ DPRINTK_ISPH3A("Stats in near future?\n");
++ if (aewbdata->frame_number > frame_cnt)
++ frame_diff = aewbdata->frame_number - frame_cnt;
++ else if (aewbdata->frame_number < frame_cnt) {
++ if ((frame_cnt > (MAX_FRAME_COUNT - MAX_FUTURE_FRAMES)) &&
++ (aewbdata->frame_number < MAX_FRAME_COUNT)) {
++ frame_diff = aewbdata->frame_number + MAX_FRAME_COUNT -
++ frame_cnt;
++ } else
++ frame_diff = MAX_FUTURE_FRAMES + 1;
++ }
++
++ if (frame_diff > MAX_FUTURE_FRAMES) {
++ printk(KERN_ERR "Invalid frame requested, returning current"
++ " frame stats\n");
++ aewbdata->frame_number = frame_cnt;
++ }
++ if (camnotify) {
++ DPRINTK_ISPH3A("NOT Waiting on stats IRQ for frame %d "
++ "because camnotify set\n",
++ aewbdata->frame_number);
++ aewbdata->h3a_aewb_statistics_buf = NULL;
++ goto out;
++ }
++ DPRINTK_ISPH3A("Waiting on stats IRQ for frame %d\n",
++ aewbdata->frame_number);
++ aewbstat.frame_req = aewbdata->frame_number;
++ aewbstat.stats_req = 1;
++ aewbstat.stats_done = 0;
++ init_waitqueue_entry(&wqt, current);
++ ret = wait_event_interruptible(aewbstat.stats_wait,
++ aewbstat.stats_done == 1);
++ if (ret < 0) {
++ printk(KERN_ERR "isph3a_aewb_request_statistics"
++ " Error on wait event %d\n", ret);
++ aewbdata->h3a_aewb_statistics_buf = NULL;
++ return ret;
++ }
++
++ DPRINTK_ISPH3A("ISP AEWB request status interrupt raised\n");
++ ret = isph3a_aewb_stats_available(aewbdata);
++ if (ret) {
++ DPRINTK_ISPH3A("After waiting for stats,"
++ " stats not available!!\n");
++ aewbdata->h3a_aewb_statistics_buf = NULL;
++ }
++out:
++ DPRINTK_ISPH3A("isph3a_aewb_request_statistics: "
++ "aewbdata->h3a_aewb_statistics_buf => %p\n",
++ aewbdata->h3a_aewb_statistics_buf);
++ aewbdata->curr_frame = aewbstat.frame_count;
++
++ return 0;
++}
++EXPORT_SYMBOL(isph3a_aewb_request_statistics);
++
++/**
++ * isph3a_aewb_init - Module Initialisation.
++ *
++ * Always returns 0.
++ **/
++int __init isph3a_aewb_init(void)
++{
++ memset(&aewbstat, 0, sizeof(aewbstat));
++ memset(&aewb_regs, 0, sizeof(aewb_regs));
++
++ init_waitqueue_head(&aewbstat.stats_wait);
++ spin_lock_init(&aewbstat.buffer_lock);
++ return 0;
++}
++
++/**
++ * isph3a_aewb_cleanup - Module exit.
++ **/
++void isph3a_aewb_cleanup(void)
++{
++ int i;
++
++ for (i = 0; i < H3A_MAX_BUFF; i++) {
++ if (!aewbstat.h3a_buff[i].phy_addr)
++ continue;
++
++ ispmmu_kunmap(aewbstat.h3a_buff[i].ispmmu_addr);
++ dma_free_coherent(NULL,
++ aewbstat.min_buf_size,
++ (void *)aewbstat.h3a_buff[i].virt_addr,
++ (dma_addr_t)aewbstat.h3a_buff[i].phy_addr);
++ }
++ memset(&aewbstat, 0, sizeof(aewbstat));
++ memset(&aewb_regs, 0, sizeof(aewb_regs));
++}
++
++/**
++ * isph3a_print_status - Debug print. Values of H3A related registers.
++ **/
++static void isph3a_print_status(void)
++{
++ DPRINTK_ISPH3A("ISPH3A_PCR = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_PCR));
++ DPRINTK_ISPH3A("ISPH3A_AEWWIN1 = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWWIN1));
++ DPRINTK_ISPH3A("ISPH3A_AEWINSTART = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINSTART));
++ DPRINTK_ISPH3A("ISPH3A_AEWINBLK = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWINBLK));
++ DPRINTK_ISPH3A("ISPH3A_AEWSUBWIN = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWSUBWIN));
++ DPRINTK_ISPH3A("ISPH3A_AEWBUFST = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_H3A, ISPH3A_AEWBUFST));
++ DPRINTK_ISPH3A("stats windows = %d\n", aewbstat.win_count);
++ DPRINTK_ISPH3A("stats buff size = %d\n", aewbstat.stats_buf_size);
++ DPRINTK_ISPH3A("currently configured stats buff size = %d\n",
++ aewbstat.curr_cfg_buf_size);
++}
++
++/**
++ * isph3a_notify - Unblocks user request for statistics when camera is off
++ * @notify: 1 - Camera is turned off
++ *
++ * Used when the user has requested statistics about a future frame, but the
++ * camera is turned off before it happens, and this function unblocks the
++ * request so the user can continue in its program.
++ **/
++void isph3a_notify(int notify)
++{
++ camnotify = notify;
++ if (camnotify && aewbstat.initialized) {
++ printk(KERN_DEBUG "Warning Camera Off \n");
++ aewbstat.stats_req = 0;
++ aewbstat.stats_done = 1;
++ wake_up_interruptible(&aewbstat.stats_wait);
++ }
++}
++EXPORT_SYMBOL(isph3a_notify);
++
++/**
++ * isph3a_save_context - Saves the values of the h3a module registers.
++ **/
++void isph3a_save_context(void)
++{
++ DPRINTK_ISPH3A(" Saving context\n");
++ isp_save_context(isph3a_reg_list);
++ /* Avoid enable during restore ctx */
++ isph3a_reg_list[0].val &= ~ISPH3A_PCR_AEW_EN;
++}
++EXPORT_SYMBOL(isph3a_save_context);
++
++/**
++ * isph3a_restore_context - Restores the values of the h3a module registers.
++ **/
++void isph3a_restore_context(void)
++{
++ DPRINTK_ISPH3A(" Restoring context\n");
++ isp_restore_context(isph3a_reg_list);
++}
++EXPORT_SYMBOL(isph3a_restore_context);
+diff --git a/drivers/media/video/isp/isph3a.h b/drivers/media/video/isp/isph3a.h
+new file mode 100644
+index 0000000..7d4c765
+--- /dev/null
++++ b/drivers/media/video/isp/isph3a.h
+@@ -0,0 +1,127 @@
++/*
++ * isph3a.h
++ *
++ * Include file for H3A module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_H3A_H
++#define OMAP_ISP_H3A_H
++
++#include <mach/isp_user.h>
++
++#define AEWB_PACKET_SIZE 16
++#define H3A_MAX_BUFF 5
++
++/* Flags for changed registers */
++#define PCR_CHNG (1 << 0)
++#define AEWWIN1_CHNG (1 << 1)
++#define AEWINSTART_CHNG (1 << 2)
++#define AEWINBLK_CHNG (1 << 3)
++#define AEWSUBWIN_CHNG (1 << 4)
++#define PRV_WBDGAIN_CHNG (1 << 5)
++#define PRV_WBGAIN_CHNG (1 << 6)
++
++/* ISPH3A REGISTERS bits */
++#define ISPH3A_PCR_AF_EN (1 << 0)
++#define ISPH3A_PCR_AF_ALAW_EN (1 << 1)
++#define ISPH3A_PCR_AF_MED_EN (1 << 2)
++#define ISPH3A_PCR_AF_BUSY (1 << 15)
++#define ISPH3A_PCR_AEW_EN (1 << 16)
++#define ISPH3A_PCR_AEW_ALAW_EN (1 << 17)
++#define ISPH3A_PCR_AEW_BUSY (1 << 18)
++
++#define WRITE_SAT_LIM(reg, sat_limit) \
++ (reg = (reg & (~(ISPH3A_PCR_AEW_AVE2LMT_MASK))) \
++ | (sat_limit << ISPH3A_PCR_AEW_AVE2LMT_SHIFT))
++
++#define WRITE_ALAW(reg, alaw_en) \
++ (reg = (reg & (~(ISPH3A_PCR_AEW_ALAW_EN))) \
++ | ((alaw_en & ISPH3A_PCR_AF_ALAW_EN) \
++ << ISPH3A_PCR_AEW_ALAW_EN_SHIFT))
++
++#define WRITE_WIN_H(reg, height) \
++ (reg = (reg & (~(ISPH3A_AEWWIN1_WINH_MASK))) \
++ | (((height >> 1) - 1) << ISPH3A_AEWWIN1_WINH_SHIFT))
++
++#define WRITE_WIN_W(reg, width) \
++ (reg = (reg & (~(ISPH3A_AEWWIN1_WINW_MASK))) \
++ | (((width >> 1) - 1) << ISPH3A_AEWWIN1_WINW_SHIFT))
++
++#define WRITE_VER_C(reg, ver_count) \
++ (reg = (reg & ~(ISPH3A_AEWWIN1_WINVC_MASK)) \
++ | ((ver_count - 1) << ISPH3A_AEWWIN1_WINVC_SHIFT))
++
++#define WRITE_HOR_C(reg, hor_count) \
++ (reg = (reg & ~(ISPH3A_AEWWIN1_WINHC_MASK)) \
++ | ((hor_count - 1) << ISPH3A_AEWWIN1_WINHC_SHIFT))
++
++#define WRITE_VER_WIN_ST(reg, ver_win_st) \
++ (reg = (reg & ~(ISPH3A_AEWINSTART_WINSV_MASK)) \
++ | (ver_win_st << ISPH3A_AEWINSTART_WINSV_SHIFT))
++
++#define WRITE_HOR_WIN_ST(reg, hor_win_st) \
++ (reg = (reg & ~(ISPH3A_AEWINSTART_WINSH_MASK)) \
++ | (hor_win_st << ISPH3A_AEWINSTART_WINSH_SHIFT))
++
++#define WRITE_BLK_VER_WIN_ST(reg, blk_win_st) \
++ (reg = (reg & ~(ISPH3A_AEWINBLK_WINSV_MASK)) \
++ | (blk_win_st << ISPH3A_AEWINBLK_WINSV_SHIFT))
++
++#define WRITE_BLK_WIN_H(reg, height) \
++ (reg = (reg & ~(ISPH3A_AEWINBLK_WINH_MASK)) \
++ | (((height >> 1) - 1) << ISPH3A_AEWINBLK_WINH_SHIFT))
++
++#define WRITE_SUB_VER_INC(reg, sub_ver_inc) \
++ (reg = (reg & ~(ISPH3A_AEWSUBWIN_AEWINCV_MASK)) \
++ | (((sub_ver_inc >> 1) - 1) << ISPH3A_AEWSUBWIN_AEWINCV_SHIFT))
++
++#define WRITE_SUB_HOR_INC(reg, sub_hor_inc) \
++ (reg = (reg & ~(ISPH3A_AEWSUBWIN_AEWINCH_MASK)) \
++ | (((sub_hor_inc >> 1) - 1) << ISPH3A_AEWSUBWIN_AEWINCH_SHIFT))
++
++/**
++ * struct isph3a_aewb_xtrastats - Structure with extra statistics sent by cam.
++ * @field_count: Sequence number of returned framestats.
++ * @isph3a_aewb_xtrastats: Pointer to next buffer with extra stats.
++ */
++struct isph3a_aewb_xtrastats {
++ unsigned long field_count;
++ struct isph3a_aewb_xtrastats *next;
++};
++
++void isph3a_aewb_setxtrastats(struct isph3a_aewb_xtrastats *xtrastats);
++
++int isph3a_aewb_configure(struct isph3a_aewb_config *aewbcfg);
++
++int isph3a_aewb_request_statistics(struct isph3a_aewb_data *aewbdata);
++
++void isph3a_save_context(void);
++
++void isph3a_restore_context(void);
++
++void isph3a_aewb_enable(u8 enable);
++
++int isph3a_aewb_busy(void);
++
++void isph3a_aewb_suspend(void);
++
++void isph3a_aewb_resume(void);
++
++void isph3a_update_wb(void);
++
++void isph3a_notify(int notify);
++#endif /* OMAP_ISP_H3A_H */
+diff --git a/drivers/media/video/isp/isphist.c b/drivers/media/video/isp/isphist.c
+new file mode 100644
+index 0000000..c6f6a77
+--- /dev/null
++++ b/drivers/media/video/isp/isphist.c
+@@ -0,0 +1,608 @@
++/*
++ * isphist.c
++ *
++ * HISTOGRAM module for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <asm/cacheflush.h>
++
++#include <linux/delay.h>
++#include <linux/dma-mapping.h>
++#include <linux/uaccess.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "isphist.h"
++#include "ispmmu.h"
++
++/**
++ * struct isp_hist_status - Histogram status.
++ * @hist_enable: Enables the histogram module.
++ * @initialized: Flag to indicate that the module is correctly initializated.
++ * @frame_cnt: Actual frame count.
++ * @frame_req: Frame requested by user.
++ * @completed: Flag to indicate if a frame request is completed.
++ */
++struct isp_hist_status {
++ u8 hist_enable;
++ u8 pm_state;
++ u8 initialized;
++ u8 frame_cnt;
++ u8 frame_req;
++ u8 completed;
++} histstat;
++
++/**
++ * struct isp_hist_buffer - Frame histogram buffer.
++ * @virt_addr: Virtual address to mmap the buffer.
++ * @phy_addr: Physical address of the buffer.
++ * @addr_align: Virtual Address 32 bytes aligned.
++ * @ispmmu_addr: Address of the buffer mapped by the ISPMMU.
++ * @mmap_addr: Mapped memory area of buffer. For userspace access.
++ */
++struct isp_hist_buffer {
++ unsigned long virt_addr;
++ unsigned long phy_addr;
++ unsigned long addr_align;
++ unsigned long ispmmu_addr;
++ unsigned long mmap_addr;
++} hist_buff;
++
++/**
++ * struct isp_hist_regs - Current value of Histogram configuration registers.
++ * @reg_pcr: Peripheral control register.
++ * @reg_cnt: Histogram control register.
++ * @reg_wb_gain: Histogram white balance gain register.
++ * @reg_r0_h: Region 0 horizontal register.
++ * @reg_r0_v: Region 0 vertical register.
++ * @reg_r1_h: Region 1 horizontal register.
++ * @reg_r1_v: Region 1 vertical register.
++ * @reg_r2_h: Region 2 horizontal register.
++ * @reg_r2_v: Region 2 vertical register.
++ * @reg_r3_h: Region 3 horizontal register.
++ * @reg_r3_v: Region 3 vertical register.
++ * @reg_hist_addr: Histogram address register.
++ * @reg_hist_data: Histogram data.
++ * @reg_hist_radd: Address register. When input data comes from mem.
++ * @reg_hist_radd_off: Address offset register. When input data comes from mem.
++ * @reg_h_v_info: Image size register. When input data comes from mem.
++ */
++static struct isp_hist_regs {
++ u32 reg_pcr;
++ u32 reg_cnt;
++ u32 reg_wb_gain;
++ u32 reg_r0_h;
++ u32 reg_r0_v;
++ u32 reg_r1_h;
++ u32 reg_r1_v;
++ u32 reg_r2_h;
++ u32 reg_r2_v;
++ u32 reg_r3_h;
++ u32 reg_r3_v;
++ u32 reg_hist_addr;
++ u32 reg_hist_data;
++ u32 reg_hist_radd;
++ u32 reg_hist_radd_off;
++ u32 reg_h_v_info;
++} hist_regs;
++
++/* Structure for saving/restoring histogram module registers */
++struct isp_reg isphist_reg_list[] = {
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_WB_GAIN, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R0_HORZ, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R0_VERT, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R1_HORZ, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R1_VERT, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R2_HORZ, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R2_VERT, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R3_HORZ, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_R3_VERT, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_ADDR, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_RADD, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_RADD_OFF, 0},
++ {OMAP3_ISP_IOMEM_HIST, ISPHIST_H_V_INFO, 0},
++ {0, ISP_TOK_TERM, 0}
++};
++
++static void isp_hist_print_status(void);
++
++void __isp_hist_enable(u8 enable)
++{
++ if (enable)
++ DPRINTK_ISPHIST(" histogram enabled \n");
++ else
++ DPRINTK_ISPHIST(" histogram disabled \n");
++
++ isp_reg_and_or(OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR, ~ISPHIST_PCR_EN,
++ (enable ? ISPHIST_PCR_EN : 0));
++ histstat.hist_enable = enable;
++}
++
++/**
++ * isp_hist_enable - Enables ISP Histogram submodule operation.
++ * @enable: 1 - Enables the histogram submodule.
++ *
++ * Client should configure all the Histogram registers before calling this
++ * function.
++ **/
++void isp_hist_enable(u8 enable)
++{
++ __isp_hist_enable(enable);
++ histstat.pm_state = enable;
++}
++
++/**
++ * isp_hist_suspend - Suspend ISP Histogram submodule.
++ **/
++void isp_hist_suspend(void)
++{
++ if (histstat.pm_state)
++ __isp_hist_enable(0);
++}
++
++/**
++ * isp_hist_resume - Resume ISP Histogram submodule.
++ **/
++void isp_hist_resume(void)
++{
++ if (histstat.pm_state)
++ __isp_hist_enable(1);
++}
++
++int isp_hist_busy(void)
++{
++ return isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR) &
++ ISPHIST_PCR_BUSY;
++}
++
++
++/**
++ * isp_hist_update_regs - Helper function to update Histogram registers.
++ **/
++static void isp_hist_update_regs(void)
++{
++ isp_reg_writel(hist_regs.reg_pcr, OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR);
++ isp_reg_writel(hist_regs.reg_cnt, OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT);
++ isp_reg_writel(hist_regs.reg_wb_gain, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_WB_GAIN);
++ isp_reg_writel(hist_regs.reg_r0_h, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R0_HORZ);
++ isp_reg_writel(hist_regs.reg_r0_v, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R0_VERT);
++ isp_reg_writel(hist_regs.reg_r1_h, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R1_HORZ);
++ isp_reg_writel(hist_regs.reg_r1_v, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R1_VERT);
++ isp_reg_writel(hist_regs.reg_r2_h, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R2_HORZ);
++ isp_reg_writel(hist_regs.reg_r2_v, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R2_VERT);
++ isp_reg_writel(hist_regs.reg_r3_h, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R3_HORZ);
++ isp_reg_writel(hist_regs.reg_r3_v, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_R3_VERT);
++ isp_reg_writel(hist_regs.reg_hist_addr, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_ADDR);
++ isp_reg_writel(hist_regs.reg_hist_data, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_DATA);
++ isp_reg_writel(hist_regs.reg_hist_radd, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_RADD);
++ isp_reg_writel(hist_regs.reg_hist_radd_off, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_RADD_OFF);
++ isp_reg_writel(hist_regs.reg_h_v_info, OMAP3_ISP_IOMEM_HIST,
++ ISPHIST_H_V_INFO);
++}
++
++/**
++ * isp_hist_isr - Callback from ISP driver for HIST interrupt.
++ * @status: IRQ0STATUS in case of MMU error, 0 for hist interrupt.
++ * arg1 and arg2 Not used as of now.
++ **/
++static void isp_hist_isr(unsigned long status, isp_vbq_callback_ptr arg1,
++ void *arg2)
++{
++ isp_hist_enable(0);
++
++ if (!(status & HIST_DONE))
++ return;
++
++ if (!histstat.completed) {
++ if (histstat.frame_req == histstat.frame_cnt) {
++ histstat.frame_cnt = 0;
++ histstat.frame_req = 0;
++ histstat.completed = 1;
++ } else {
++ isp_hist_enable(1);
++ histstat.frame_cnt++;
++ }
++ }
++}
++
++/**
++ * isp_hist_reset_mem - clear Histogram memory before start stats engine.
++ *
++ * Returns 0 after histogram memory was cleared.
++ **/
++static int isp_hist_reset_mem(void)
++{
++ int i;
++
++ isp_reg_or(OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT, ISPHIST_CNT_CLR_EN);
++
++ for (i = 0; i < HIST_MEM_SIZE; i++)
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_DATA);
++
++ isp_reg_and(OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT, ~ISPHIST_CNT_CLR_EN);
++
++ return 0;
++}
++
++/**
++ * isp_hist_set_params - Helper function to check and store user given params.
++ * @user_cfg: Pointer to user configuration structure.
++ *
++ * Returns 0 on success configuration.
++ **/
++static int isp_hist_set_params(struct isp_hist_config *user_cfg)
++{
++
++ int reg_num = 0;
++ int bit_shift = 0;
++
++
++ if (isp_hist_busy())
++ return -EINVAL;
++
++ if (user_cfg->input_bit_width > MIN_BIT_WIDTH)
++ WRITE_DATA_SIZE(hist_regs.reg_cnt, 0);
++ else
++ WRITE_DATA_SIZE(hist_regs.reg_cnt, 1);
++
++ WRITE_SOURCE(hist_regs.reg_cnt, user_cfg->hist_source);
++
++ if (user_cfg->hist_source) {
++ WRITE_HV_INFO(hist_regs.reg_h_v_info, user_cfg->hist_h_v_info);
++
++ if ((user_cfg->hist_radd & ISP_32B_BOUNDARY_BUF) ==
++ user_cfg->hist_radd) {
++ WRITE_RADD(hist_regs.reg_hist_radd,
++ user_cfg->hist_radd);
++ } else {
++ printk(KERN_ERR "Address should be in 32 byte boundary"
++ "\n");
++ return -EINVAL;
++ }
++
++ if ((user_cfg->hist_radd_off & ISP_32B_BOUNDARY_OFFSET) ==
++ user_cfg->hist_radd_off) {
++ WRITE_RADD_OFF(hist_regs.reg_hist_radd_off,
++ user_cfg->hist_radd_off);
++ } else {
++ printk(KERN_ERR "Offset should be in 32 byte boundary"
++ "\n");
++ return -EINVAL;
++ }
++
++ }
++
++ isp_hist_reset_mem();
++ DPRINTK_ISPHIST("ISPHIST: Memory Cleared\n");
++ histstat.frame_req = user_cfg->hist_frames;
++
++ if (unlikely(user_cfg->wb_gain_R > MAX_WB_GAIN ||
++ user_cfg->wb_gain_RG > MAX_WB_GAIN ||
++ user_cfg->wb_gain_B > MAX_WB_GAIN ||
++ user_cfg->wb_gain_BG > MAX_WB_GAIN)) {
++ printk(KERN_ERR "Invalid WB gain\n");
++ return -EINVAL;
++ } else {
++ WRITE_WB_R(hist_regs.reg_wb_gain, user_cfg->wb_gain_R);
++ WRITE_WB_RG(hist_regs.reg_wb_gain, user_cfg->wb_gain_RG);
++ WRITE_WB_B(hist_regs.reg_wb_gain, user_cfg->wb_gain_B);
++ WRITE_WB_BG(hist_regs.reg_wb_gain, user_cfg->wb_gain_BG);
++ }
++
++ /* Regions size and position */
++
++ if (user_cfg->num_regions > MAX_REGIONS)
++ return -EINVAL;
++
++ if (likely((user_cfg->reg0_hor & ISPHIST_REGHORIZ_HEND_MASK) -
++ ((user_cfg->reg0_hor & ISPHIST_REGHORIZ_HSTART_MASK) >>
++ ISPHIST_REGHORIZ_HSTART_SHIFT))) {
++ WRITE_REG_HORIZ(hist_regs.reg_r0_h, user_cfg->reg0_hor);
++ reg_num++;
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++
++ if (likely((user_cfg->reg0_ver & ISPHIST_REGVERT_VEND_MASK) -
++ ((user_cfg->reg0_ver & ISPHIST_REGVERT_VSTART_MASK) >>
++ ISPHIST_REGVERT_VSTART_SHIFT))) {
++ WRITE_REG_VERT(hist_regs.reg_r0_v, user_cfg->reg0_ver);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++
++ if (user_cfg->num_regions >= 1) {
++ if (likely((user_cfg->reg1_hor & ISPHIST_REGHORIZ_HEND_MASK) -
++ ((user_cfg->reg1_hor &
++ ISPHIST_REGHORIZ_HSTART_MASK) >>
++ ISPHIST_REGHORIZ_HSTART_SHIFT))) {
++ WRITE_REG_HORIZ(hist_regs.reg_r1_h, user_cfg->reg1_hor);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++
++ if (likely((user_cfg->reg1_ver & ISPHIST_REGVERT_VEND_MASK) -
++ ((user_cfg->reg1_ver &
++ ISPHIST_REGVERT_VSTART_MASK) >>
++ ISPHIST_REGVERT_VSTART_SHIFT))) {
++ WRITE_REG_VERT(hist_regs.reg_r1_v, user_cfg->reg1_ver);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++ }
++
++ if (user_cfg->num_regions >= 2) {
++ if (likely((user_cfg->reg2_hor & ISPHIST_REGHORIZ_HEND_MASK) -
++ ((user_cfg->reg2_hor &
++ ISPHIST_REGHORIZ_HSTART_MASK) >>
++ ISPHIST_REGHORIZ_HSTART_SHIFT))) {
++ WRITE_REG_HORIZ(hist_regs.reg_r2_h, user_cfg->reg2_hor);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++
++ if (likely((user_cfg->reg2_ver & ISPHIST_REGVERT_VEND_MASK) -
++ ((user_cfg->reg2_ver &
++ ISPHIST_REGVERT_VSTART_MASK) >>
++ ISPHIST_REGVERT_VSTART_SHIFT))) {
++ WRITE_REG_VERT(hist_regs.reg_r2_v, user_cfg->reg2_ver);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++ }
++
++ if (user_cfg->num_regions >= 3) {
++ if (likely((user_cfg->reg3_hor & ISPHIST_REGHORIZ_HEND_MASK) -
++ ((user_cfg->reg3_hor &
++ ISPHIST_REGHORIZ_HSTART_MASK) >>
++ ISPHIST_REGHORIZ_HSTART_SHIFT))) {
++ WRITE_REG_HORIZ(hist_regs.reg_r3_h, user_cfg->reg3_hor);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++
++ if (likely((user_cfg->reg3_ver & ISPHIST_REGVERT_VEND_MASK) -
++ ((user_cfg->reg3_ver &
++ ISPHIST_REGVERT_VSTART_MASK) >>
++ ISPHIST_REGVERT_VSTART_SHIFT))) {
++ WRITE_REG_VERT(hist_regs.reg_r3_v, user_cfg->reg3_ver);
++ } else {
++ printk(KERN_ERR "Invalid Region parameters\n");
++ return -EINVAL;
++ }
++ }
++ reg_num = user_cfg->num_regions;
++ if (unlikely(((user_cfg->hist_bins > BINS_256) &&
++ (user_cfg->hist_bins != BINS_32)) ||
++ ((user_cfg->hist_bins == BINS_256) &&
++ reg_num != 0) || ((user_cfg->hist_bins ==
++ BINS_128) && reg_num >= 2))) {
++ printk(KERN_ERR "Invalid Bins Number: %d\n",
++ user_cfg->hist_bins);
++ return -EINVAL;
++ } else {
++ WRITE_NUM_BINS(hist_regs.reg_cnt, user_cfg->hist_bins);
++ }
++
++ if (user_cfg->input_bit_width > MAX_BIT_WIDTH ||
++ user_cfg->input_bit_width < MIN_BIT_WIDTH) {
++ printk(KERN_ERR "Invalid Bit Width: %d\n",
++ user_cfg->input_bit_width);
++ return -EINVAL;
++ } else {
++ switch (user_cfg->hist_bins) {
++ case BINS_256:
++ bit_shift = user_cfg->input_bit_width - 8;
++ break;
++ case BINS_128:
++ bit_shift = user_cfg->input_bit_width - 7;
++ break;
++ case BINS_64:
++ bit_shift = user_cfg->input_bit_width - 6;
++ break;
++ case BINS_32:
++ bit_shift = user_cfg->input_bit_width - 5;
++ break;
++ default:
++ return -EINVAL;
++ }
++ WRITE_BIT_SHIFT(hist_regs.reg_cnt, bit_shift);
++ }
++
++ isp_hist_update_regs();
++ histstat.initialized = 1;
++
++ return 0;
++}
++
++/**
++ * isp_hist_configure - API to configure HIST registers.
++ * @histcfg: Pointer to user configuration structure.
++ *
++ * Returns 0 on success configuration.
++ **/
++int isp_hist_configure(struct isp_hist_config *histcfg)
++{
++
++ int ret = 0;
++
++ if (NULL == histcfg) {
++ printk(KERN_ERR "Null argument in configuration. \n");
++ return -EINVAL;
++ }
++
++ if (!histstat.initialized) {
++ DPRINTK_ISPHIST("Setting callback for HISTOGRAM\n");
++ ret = isp_set_callback(CBK_HIST_DONE, isp_hist_isr,
++ (void *)NULL, (void *)NULL);
++ if (ret) {
++ printk(KERN_ERR "No callback for HIST\n");
++ return ret;
++ }
++ }
++
++ ret = isp_hist_set_params(histcfg);
++ if (ret) {
++ printk(KERN_ERR "Invalid parameters! \n");
++ return ret;
++ }
++
++ histstat.frame_cnt = 0;
++ histstat.completed = 0;
++ isp_hist_enable(1);
++ isp_hist_print_status();
++
++ return 0;
++}
++EXPORT_SYMBOL(isp_hist_configure);
++
++/**
++ * isp_hist_request_statistics - Request statistics in Histogram.
++ * @histdata: Pointer to data structure.
++ *
++ * This API allows the user to request for histogram statistics.
++ *
++ * Returns 0 on successful request.
++ **/
++int isp_hist_request_statistics(struct isp_hist_data *histdata)
++{
++ int i, ret;
++ u32 curr;
++
++ if (isp_hist_busy())
++ return -EBUSY;
++
++ if (!histstat.completed && histstat.initialized)
++ return -EINVAL;
++
++ isp_reg_or(OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT, ISPHIST_CNT_CLR_EN);
++
++ for (i = 0; i < HIST_MEM_SIZE; i++) {
++ curr = isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_DATA);
++ ret = put_user(curr, histdata->hist_statistics_buf + i);
++ if (ret) {
++ printk(KERN_ERR "Failed copy_to_user for "
++ "HIST stats buff, %d\n", ret);
++ }
++ }
++
++ isp_reg_and(OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT,
++ ~ISPHIST_CNT_CLR_EN);
++ histstat.completed = 0;
++ return 0;
++}
++EXPORT_SYMBOL(isp_hist_request_statistics);
++
++/**
++ * isp_hist_init - Module Initialization.
++ *
++ * Returns 0 if successful.
++ **/
++int __init isp_hist_init(void)
++{
++ memset(&histstat, 0, sizeof(histstat));
++ memset(&hist_regs, 0, sizeof(hist_regs));
++
++ return 0;
++}
++
++/**
++ * isp_hist_cleanup - Module cleanup.
++ **/
++void isp_hist_cleanup(void)
++{
++ memset(&histstat, 0, sizeof(histstat));
++ memset(&hist_regs, 0, sizeof(hist_regs));
++}
++
++/**
++ * isphist_save_context - Saves the values of the histogram module registers.
++ **/
++void isphist_save_context(void)
++{
++ DPRINTK_ISPHIST(" Saving context\n");
++ isp_save_context(isphist_reg_list);
++}
++EXPORT_SYMBOL(isphist_save_context);
++
++/**
++ * isphist_restore_context - Restores the values of the histogram module regs.
++ **/
++void isphist_restore_context(void)
++{
++ DPRINTK_ISPHIST(" Restoring context\n");
++ isp_restore_context(isphist_reg_list);
++}
++EXPORT_SYMBOL(isphist_restore_context);
++
++/**
++ * isp_hist_print_status - Debug print
++ **/
++static void isp_hist_print_status(void)
++{
++ DPRINTK_ISPHIST("ISPHIST_PCR = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_PCR));
++ DPRINTK_ISPHIST("ISPHIST_CNT = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT));
++ DPRINTK_ISPHIST("ISPHIST_WB_GAIN = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_WB_GAIN));
++ DPRINTK_ISPHIST("ISPHIST_R0_HORZ = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R0_HORZ));
++ DPRINTK_ISPHIST("ISPHIST_R0_VERT = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R0_VERT));
++ DPRINTK_ISPHIST("ISPHIST_R1_HORZ = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R1_HORZ));
++ DPRINTK_ISPHIST("ISPHIST_R1_VERT = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R1_VERT));
++ DPRINTK_ISPHIST("ISPHIST_R2_HORZ = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R2_HORZ));
++ DPRINTK_ISPHIST("ISPHIST_R2_VERT = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R2_VERT));
++ DPRINTK_ISPHIST("ISPHIST_R3_HORZ = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R3_HORZ));
++ DPRINTK_ISPHIST("ISPHIST_R3_VERT = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_R3_VERT));
++ DPRINTK_ISPHIST("ISPHIST_ADDR = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_ADDR));
++ DPRINTK_ISPHIST("ISPHIST_RADD = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_RADD));
++ DPRINTK_ISPHIST("ISPHIST_RADD_OFF = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_RADD_OFF));
++ DPRINTK_ISPHIST("ISPHIST_H_V_INFO = 0x%08x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_HIST, ISPHIST_H_V_INFO));
++}
+diff --git a/drivers/media/video/isp/isphist.h b/drivers/media/video/isp/isphist.h
+new file mode 100644
+index 0000000..6b17c4e
+--- /dev/null
++++ b/drivers/media/video/isp/isphist.h
+@@ -0,0 +1,105 @@
++/*
++ * isphist.h
++ *
++ * Header file for HISTOGRAM module in TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_HIST_H
++#define OMAP_ISP_HIST_H
++
++#include <mach/isp_user.h>
++
++#define MAX_REGIONS 0x4
++#define MAX_WB_GAIN 255
++#define MIN_WB_GAIN 0x0
++#define MAX_BIT_WIDTH 14
++#define MIN_BIT_WIDTH 8
++
++#define ISPHIST_PCR_EN (1 << 0)
++#define HIST_MEM_SIZE 1024
++#define ISPHIST_CNT_CLR_EN (1 << 7)
++
++#define WRITE_SOURCE(reg, source) \
++ (reg = (reg & ~(ISPHIST_CNT_SOURCE_MASK)) \
++ | (source << ISPHIST_CNT_SOURCE_SHIFT))
++
++#define WRITE_HV_INFO(reg, hv_info) \
++ (reg = ((reg & ~(ISPHIST_HV_INFO_MASK)) \
++ | (hv_info & ISPHIST_HV_INFO_MASK)))
++
++#define WRITE_RADD(reg, radd) \
++ (reg = (reg & ~(ISPHIST_RADD_MASK)) \
++ | (radd << ISPHIST_RADD_SHIFT))
++
++#define WRITE_RADD_OFF(reg, radd_off) \
++ (reg = (reg & ~(ISPHIST_RADD_OFF_MASK)) \
++ | (radd_off << ISPHIST_RADD_OFF_SHIFT))
++
++#define WRITE_BIT_SHIFT(reg, bit_shift) \
++ (reg = (reg & ~(ISPHIST_CNT_SHIFT_MASK)) \
++ | (bit_shift << ISPHIST_CNT_SHIFT_SHIFT))
++
++#define WRITE_DATA_SIZE(reg, data_size) \
++ (reg = (reg & ~(ISPHIST_CNT_DATASIZE_MASK)) \
++ | (data_size << ISPHIST_CNT_DATASIZE_SHIFT))
++
++#define WRITE_NUM_BINS(reg, num_bins) \
++ (reg = (reg & ~(ISPHIST_CNT_BINS_MASK)) \
++ | (num_bins << ISPHIST_CNT_BINS_SHIFT))
++
++#define WRITE_WB_R(reg, reg_wb_gain) \
++ reg = ((reg & ~(ISPHIST_WB_GAIN_WG00_MASK)) \
++ | (reg_wb_gain << ISPHIST_WB_GAIN_WG00_SHIFT))
++
++#define WRITE_WB_RG(reg, reg_wb_gain) \
++ (reg = (reg & ~(ISPHIST_WB_GAIN_WG01_MASK)) \
++ | (reg_wb_gain << ISPHIST_WB_GAIN_WG01_SHIFT))
++
++#define WRITE_WB_B(reg, reg_wb_gain) \
++ (reg = (reg & ~(ISPHIST_WB_GAIN_WG02_MASK)) \
++ | (reg_wb_gain << ISPHIST_WB_GAIN_WG02_SHIFT))
++
++#define WRITE_WB_BG(reg, reg_wb_gain) \
++ (reg = (reg & ~(ISPHIST_WB_GAIN_WG03_MASK)) \
++ | (reg_wb_gain << ISPHIST_WB_GAIN_WG03_SHIFT))
++
++#define WRITE_REG_HORIZ(reg, reg_n_hor) \
++ (reg = ((reg & ~ISPHIST_REGHORIZ_MASK) \
++ | (reg_n_hor & ISPHIST_REGHORIZ_MASK)))
++
++#define WRITE_REG_VERT(reg, reg_n_vert) \
++ (reg = ((reg & ~ISPHIST_REGVERT_MASK) \
++ | (reg_n_vert & ISPHIST_REGVERT_MASK)))
++
++
++void isp_hist_enable(u8 enable);
++
++int isp_hist_busy(void);
++
++int isp_hist_configure(struct isp_hist_config *histcfg);
++
++int isp_hist_request_statistics(struct isp_hist_data *histdata);
++
++void isphist_save_context(void);
++
++void isp_hist_suspend(void);
++
++void isp_hist_resume(void);
++
++void isphist_restore_context(void);
++
++#endif /* OMAP_ISP_HIST */
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch
new file mode 100644
index 0000000000..842f395388
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch
@@ -0,0 +1,2384 @@
+From 9fbe7b786427d981cac890a7407da09232f5d1e2 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add CSI2 interface support
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/ispcsi2.c | 2124 +++++++++++++++++++++++++++++++++++++
+ drivers/media/video/isp/ispcsi2.h | 232 ++++
+ 2 files changed, 2356 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/ispcsi2.c
+ create mode 100644 drivers/media/video/isp/ispcsi2.h
+
+diff --git a/drivers/media/video/isp/ispcsi2.c b/drivers/media/video/isp/ispcsi2.c
+new file mode 100644
+index 0000000..5141b5a
+--- /dev/null
++++ b/drivers/media/video/isp/ispcsi2.c
+@@ -0,0 +1,2124 @@
++/*
++ * ispcsi2.c
++ *
++ * Driver Library for ISP CSI Control module in TI's OMAP3 Camera ISP
++ * ISP CSI interface and IRQ related APIs are defined here.
++ *
++ * Copyright (C) 2009 Texas Instruments.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Dominic Curran <dcurran@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/delay.h>
++#include <media/v4l2-common.h>
++
++#include "isp.h"
++#include "ispreg.h"
++#include "ispcsi2.h"
++
++static struct isp_csi2_cfg current_csi2_cfg;
++static struct isp_csi2_cfg_update current_csi2_cfg_update;
++
++static bool update_complexio_cfg1;
++static bool update_phy_cfg0;
++static bool update_phy_cfg1;
++static bool update_ctx_ctrl1[8];
++static bool update_ctx_ctrl2[8];
++static bool update_ctx_ctrl3[8];
++static bool update_timing;
++static bool update_ctrl;
++static bool uses_videoport;
++
++/**
++ * isp_csi2_complexio_lanes_config - Configuration of CSI2 ComplexIO lanes.
++ * @reqcfg: Pointer to structure containing desired lane configuration
++ *
++ * Validates and saves to internal driver memory the passed configuration.
++ * Returns 0 if successful, or -EINVAL if null pointer is passed, invalid
++ * lane position or polarity is set, and if 2 lanes try to occupy the same
++ * position. To apply this settings, use the isp_csi2_complexio_lanes_update()
++ * function just after calling this function.
++ **/
++int isp_csi2_complexio_lanes_config(struct isp_csi2_lanes_cfg *reqcfg)
++{
++ int i;
++ bool pos_occupied[5] = {false, false, false, false, false};
++ struct isp_csi2_lanes_cfg *currlanes = &current_csi2_cfg.lanes;
++ struct isp_csi2_lanes_cfg_update *currlanes_u =
++ &current_csi2_cfg_update.lanes;
++
++ /* Validating parameters sent by driver */
++ if (reqcfg == NULL) {
++ printk(KERN_ERR "Invalid Complex IO Configuration sent by"
++ " sensor\n");
++ goto err_einval;
++ }
++
++ /* Data lanes verification */
++ for (i = 0; i < 4; i++) {
++ if ((reqcfg->data[i].pol > 1) || (reqcfg->data[i].pos > 5)) {
++ printk(KERN_ERR "Invalid CSI-2 Complex IO configuration"
++ " parameters for data lane #%d\n", i);
++ goto err_einval;
++ }
++ if (pos_occupied[reqcfg->data[i].pos - 1] &&
++ reqcfg->data[i].pos > 0) {
++ printk(KERN_ERR "Lane #%d already occupied\n",
++ reqcfg->data[i].pos);
++ goto err_einval;
++ } else
++ pos_occupied[reqcfg->data[i].pos - 1] = true;
++ }
++
++ /* Clock lane verification */
++ if ((reqcfg->clk.pol > 1) || (reqcfg->clk.pos > 5) ||
++ (reqcfg->clk.pos == 0)) {
++ printk(KERN_ERR "Invalid CSI-2 Complex IO configuration"
++ " parameters for clock lane\n");
++ goto err_einval;
++ }
++ if (pos_occupied[reqcfg->clk.pos - 1]) {
++ printk(KERN_ERR "Lane #%d already occupied",
++ reqcfg->clk.pos);
++ goto err_einval;
++ } else
++ pos_occupied[reqcfg->clk.pos - 1] = true;
++
++ for (i = 0; i < 4; i++) {
++ if (currlanes->data[i].pos != reqcfg->data[i].pos) {
++ currlanes->data[i].pos = reqcfg->data[i].pos;
++ currlanes_u->data[i] = true;
++ update_complexio_cfg1 = true;
++ }
++ if (currlanes->data[i].pol != reqcfg->data[i].pol) {
++ currlanes->data[i].pol = reqcfg->data[i].pol;
++ currlanes_u->data[i] = true;
++ update_complexio_cfg1 = true;
++ }
++ }
++
++ if (currlanes->clk.pos != reqcfg->clk.pos) {
++ currlanes->clk.pos = reqcfg->clk.pos;
++ currlanes_u->clk = true;
++ update_complexio_cfg1 = true;
++ }
++ if (currlanes->clk.pol != reqcfg->clk.pol) {
++ currlanes->clk.pol = reqcfg->clk.pol;
++ currlanes_u->clk = true;
++ update_complexio_cfg1 = true;
++ }
++ return 0;
++err_einval:
++ return -EINVAL;
++}
++
++/**
++ * isp_csi2_complexio_lanes_update - Applies CSI2 ComplexIO lanes configuration.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_complexio_lanes_config() function.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_complexio_lanes_config() function, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_complexio_lanes_update(bool force_update)
++{
++ struct isp_csi2_lanes_cfg *currlanes = &current_csi2_cfg.lanes;
++ struct isp_csi2_lanes_cfg_update *currlanes_u =
++ &current_csi2_cfg_update.lanes;
++ u32 reg;
++ int i;
++
++ if (!update_complexio_cfg1 && !force_update)
++ return 0;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++ for (i = 0; i < 4; i++) {
++ if (currlanes_u->data[i] || force_update) {
++ reg &= ~(ISPCSI2_COMPLEXIO_CFG1_DATA_POL_MASK(i + 1) |
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_MASK(i +
++ 1));
++ reg |= (currlanes->data[i].pol <<
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(i + 1));
++ reg |= (currlanes->data[i].pos <<
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(i +
++ 1));
++ currlanes_u->data[i] = false;
++ }
++ }
++
++ if (currlanes_u->clk || force_update) {
++ reg &= ~(ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_MASK |
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_MASK);
++ reg |= (currlanes->clk.pol <<
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT);
++ reg |= (currlanes->clk.pos <<
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT);
++ currlanes_u->clk = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++
++ update_complexio_cfg1 = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_complexio_lanes_get - Gets CSI2 ComplexIO lanes configuration.
++ *
++ * Gets settings from HW registers and fills in the internal driver memory
++ * Always returns 0.
++ **/
++int isp_csi2_complexio_lanes_get(void)
++{
++ struct isp_csi2_lanes_cfg *currlanes = &current_csi2_cfg.lanes;
++ struct isp_csi2_lanes_cfg_update *currlanes_u =
++ &current_csi2_cfg_update.lanes;
++ u32 reg;
++ int i;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++ for (i = 0; i < 4; i++) {
++ currlanes->data[i].pol = (reg &
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POL_MASK(i + 1)) >>
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POL_SHIFT(i + 1);
++ currlanes->data[i].pos = (reg &
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_MASK(i + 1)) >>
++ ISPCSI2_COMPLEXIO_CFG1_DATA_POSITION_SHIFT(i + 1);
++ currlanes_u->data[i] = false;
++ }
++ currlanes->clk.pol = (reg & ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_MASK) >>
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POL_SHIFT;
++ currlanes->clk.pos = (reg &
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_MASK) >>
++ ISPCSI2_COMPLEXIO_CFG1_CLOCK_POSITION_SHIFT;
++ currlanes_u->clk = false;
++
++ update_complexio_cfg1 = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_complexio_power_status - Gets CSI2 ComplexIO power status.
++ *
++ * Returns 3 possible valid states: ISP_CSI2_POWER_OFF, ISP_CSI2_POWER_ON,
++ * and ISP_CSI2_POWER_ULPW.
++ **/
++static enum isp_csi2_power_cmds isp_csi2_complexio_power_status(void)
++{
++ enum isp_csi2_power_cmds ret;
++ u32 reg;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1) &
++ ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_MASK;
++ switch (reg) {
++ case ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_OFF:
++ ret = ISP_CSI2_POWER_OFF;
++ break;
++ case ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_ON:
++ ret = ISP_CSI2_POWER_ON;
++ break;
++ case ISPCSI2_COMPLEXIO_CFG1_PWR_STATUS_ULPW:
++ ret = ISP_CSI2_POWER_ULPW;
++ break;
++ default:
++ return -EINVAL;
++ }
++ return ret;
++}
++
++/**
++ * isp_csi2_complexio_power_autoswitch - Sets CSI2 ComplexIO power autoswitch.
++ * @enable: Sets or clears the autoswitch function enable flag.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_complexio_power_autoswitch(bool enable)
++{
++ u32 reg;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++ reg &= ~ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_MASK;
++
++ if (enable)
++ reg |= ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_ENABLE;
++ else
++ reg |= ISPCSI2_COMPLEXIO_CFG1_PWR_AUTO_DISABLE;
++
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++ return 0;
++}
++
++/**
++ * isp_csi2_complexio_power - Sets the desired power command for CSI2 ComplexIO.
++ * @power_cmd: Power command to be set.
++ *
++ * Returns 0 if successful, or -EBUSY if the retry count is exceeded.
++ **/
++int isp_csi2_complexio_power(enum isp_csi2_power_cmds power_cmd)
++{
++ enum isp_csi2_power_cmds current_state;
++ u32 reg;
++ u8 retry_count;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1) &
++ ~ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_MASK;
++ switch (power_cmd) {
++ case ISP_CSI2_POWER_OFF:
++ reg |= ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_OFF;
++ break;
++ case ISP_CSI2_POWER_ON:
++ reg |= ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_ON;
++ break;
++ case ISP_CSI2_POWER_ULPW:
++ reg |= ISPCSI2_COMPLEXIO_CFG1_PWR_CMD_ULPW;
++ break;
++ default:
++ printk(KERN_ERR "CSI2: ERROR - Wrong Power command!\n");
++ return -EINVAL;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_COMPLEXIO_CFG1);
++
++ retry_count = 0;
++ do {
++ udelay(50);
++ current_state = isp_csi2_complexio_power_status();
++
++ if (current_state != power_cmd) {
++ printk(KERN_DEBUG "CSI2: Complex IO power command not"
++ " yet taken.");
++ if (++retry_count < 100) {
++ printk(KERN_DEBUG " Retrying...\n");
++ udelay(50);
++ } else {
++ printk(KERN_DEBUG " Retry count exceeded!\n");
++ }
++ }
++ } while ((current_state != power_cmd) && (retry_count < 100));
++
++ if (retry_count == 100)
++ return -EBUSY;
++
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_frame_mode - Configure if_en behaviour for CSI2
++ * @frame_mode: Desired action for IF_EN switch off. 0 - disable IF immediately
++ * 1 - disable after all Frame end Code is received in all
++ * contexts.
++ *
++ * Validates and saves to internal driver memory the passed configuration.
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_frame_mode(enum isp_csi2_frame_mode frame_mode)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->frame_mode != frame_mode) {
++ currctrl->frame_mode = frame_mode;
++ currctrl_u->frame_mode = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_vp_clk_enable - Enables/disables CSI2 Videoport clock.
++ * @vp_clk_enable: Boolean value to specify the Videoport clock state.
++ *
++ * Validates and saves to internal driver memory the passed configuration.
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_vp_clk_enable(bool vp_clk_enable)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->vp_clk_enable != vp_clk_enable) {
++ currctrl->vp_clk_enable = vp_clk_enable;
++ currctrl_u->vp_clk_enable = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_vp_only_enable - Sets CSI2 Videoport clock as exclusive
++ * @vp_only_enable: Boolean value to specify if the Videoport clock is
++ * exclusive, setting the OCP port as disabled.
++ *
++ * Validates and saves to internal driver memory the passed configuration.
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_vp_only_enable(bool vp_only_enable)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->vp_only_enable != vp_only_enable) {
++ currctrl->vp_only_enable = vp_only_enable;
++ currctrl_u->vp_only_enable = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_vp_out_ctrl - Sets CSI2 Videoport clock divider
++ * @vp_out_ctrl: Divider value for setting videoport clock frequency based on
++ * OCP port frequency, valid dividers are between 1 and 4.
++ *
++ * Validates and saves to internal driver memory the passed configuration.
++ * Returns 0 if successful, or -EINVAL if wrong divider value is passed.
++ **/
++int isp_csi2_ctrl_config_vp_out_ctrl(u8 vp_out_ctrl)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if ((vp_out_ctrl == 0) || (vp_out_ctrl > 4)) {
++ printk(KERN_ERR "CSI2: Wrong divisor value. Must be between"
++ " 1 and 4");
++ return -EINVAL;
++ }
++
++ if (currctrl->vp_out_ctrl != vp_out_ctrl) {
++ currctrl->vp_out_ctrl = vp_out_ctrl;
++ currctrl_u->vp_out_ctrl = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_debug_enable - Sets CSI2 debug
++ * @debug_enable: Boolean for setting debug configuration on CSI2.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_debug_enable(bool debug_enable)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->debug_enable != debug_enable) {
++ currctrl->debug_enable = debug_enable;
++ currctrl_u->debug_enable = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_burst_size - Sets CSI2 burst size.
++ * @burst_size: Burst size of the memory saving capability of receiver.
++ *
++ * Returns 0 if successful, or -EINVAL if burst size is wrong.
++ **/
++int isp_csi2_ctrl_config_burst_size(u8 burst_size)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++ if (burst_size > 3) {
++ printk(KERN_ERR "CSI2: Wrong burst size. Must be between"
++ " 0 and 3");
++ return -EINVAL;
++ }
++
++ if (currctrl->burst_size != burst_size) {
++ currctrl->burst_size = burst_size;
++ currctrl_u->burst_size = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_ecc_enable - Enables ECC on CSI2 Receiver
++ * @ecc_enable: Boolean to enable/disable the CSI2 receiver ECC handling.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_ecc_enable(bool ecc_enable)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->ecc_enable != ecc_enable) {
++ currctrl->ecc_enable = ecc_enable;
++ currctrl_u->ecc_enable = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_ecc_enable - Enables ECC on CSI2 Receiver
++ * @ecc_enable: Boolean to enable/disable the CSI2 receiver ECC handling.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_secure_mode(bool secure_mode)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->secure_mode != secure_mode) {
++ currctrl->secure_mode = secure_mode;
++ currctrl_u->secure_mode = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_config_if_enable - Enables CSI2 Receiver interface.
++ * @if_enable: Boolean to enable/disable the CSI2 receiver interface.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_config_if_enable(bool if_enable)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++
++ if (currctrl->if_enable != if_enable) {
++ currctrl->if_enable = if_enable;
++ currctrl_u->if_enable = true;
++ update_ctrl = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_update - Applies CSI2 control configuration.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_ctrl_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_ctrl_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_update(bool force_update)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++ u32 reg;
++
++ if (update_ctrl || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTRL);
++ if (currctrl_u->frame_mode || force_update) {
++ reg &= ~ISPCSI2_CTRL_FRAME_MASK;
++ if (currctrl->frame_mode)
++ reg |= ISPCSI2_CTRL_FRAME_DISABLE_FEC;
++ else
++ reg |= ISPCSI2_CTRL_FRAME_DISABLE_IMM;
++ currctrl_u->frame_mode = false;
++ }
++ if (currctrl_u->vp_clk_enable || force_update) {
++ reg &= ~ISPCSI2_CTRL_VP_CLK_EN_MASK;
++ if (currctrl->vp_clk_enable)
++ reg |= ISPCSI2_CTRL_VP_CLK_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_VP_CLK_EN_DISABLE;
++ currctrl_u->vp_clk_enable = false;
++ }
++ if (currctrl_u->vp_only_enable || force_update) {
++ reg &= ~ISPCSI2_CTRL_VP_ONLY_EN_MASK;
++ uses_videoport = currctrl->vp_only_enable;
++ if (currctrl->vp_only_enable)
++ reg |= ISPCSI2_CTRL_VP_ONLY_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_VP_ONLY_EN_DISABLE;
++ currctrl_u->vp_only_enable = false;
++ }
++ if (currctrl_u->vp_out_ctrl || force_update) {
++ reg &= ~ISPCSI2_CTRL_VP_OUT_CTRL_MASK;
++ reg |= (currctrl->vp_out_ctrl - 1) <<
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT;
++ currctrl_u->vp_out_ctrl = false;
++ }
++ if (currctrl_u->debug_enable || force_update) {
++ reg &= ~ISPCSI2_CTRL_DBG_EN_MASK;
++ if (currctrl->debug_enable)
++ reg |= ISPCSI2_CTRL_DBG_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_DBG_EN_DISABLE;
++ currctrl_u->debug_enable = false;
++ }
++ if (currctrl_u->burst_size || force_update) {
++ reg &= ~ISPCSI2_CTRL_BURST_SIZE_MASK;
++ reg |= currctrl->burst_size <<
++ ISPCSI2_CTRL_BURST_SIZE_SHIFT;
++ currctrl_u->burst_size = false;
++ }
++ if (currctrl_u->ecc_enable || force_update) {
++ reg &= ~ISPCSI2_CTRL_ECC_EN_MASK;
++ if (currctrl->ecc_enable)
++ reg |= ISPCSI2_CTRL_ECC_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_ECC_EN_DISABLE;
++ currctrl_u->ecc_enable = false;
++ }
++ if (currctrl_u->secure_mode || force_update) {
++ reg &= ~ISPCSI2_CTRL_SECURE_MASK;
++ if (currctrl->secure_mode)
++ reg |= ISPCSI2_CTRL_SECURE_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_SECURE_DISABLE;
++ currctrl_u->secure_mode = false;
++ }
++ if (currctrl_u->if_enable || force_update) {
++ reg &= ~ISPCSI2_CTRL_IF_EN_MASK;
++ if (currctrl->if_enable)
++ reg |= ISPCSI2_CTRL_IF_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTRL_IF_EN_DISABLE;
++ currctrl_u->if_enable = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTRL);
++ update_ctrl = false;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctrl_get - Gets CSI2 control configuration
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctrl_get(void)
++{
++ struct isp_csi2_ctrl_cfg *currctrl = &current_csi2_cfg.ctrl;
++ struct isp_csi2_ctrl_cfg_update *currctrl_u =
++ &current_csi2_cfg_update.ctrl;
++ u32 reg;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTRL);
++ currctrl->frame_mode = (reg & ISPCSI2_CTRL_FRAME_MASK) >>
++ ISPCSI2_CTRL_FRAME_SHIFT;
++ currctrl_u->frame_mode = false;
++
++ if ((reg & ISPCSI2_CTRL_VP_CLK_EN_MASK) ==
++ ISPCSI2_CTRL_VP_CLK_EN_ENABLE)
++ currctrl->vp_clk_enable = true;
++ else
++ currctrl->vp_clk_enable = false;
++ currctrl_u->vp_clk_enable = false;
++
++ if ((reg & ISPCSI2_CTRL_VP_ONLY_EN_MASK) ==
++ ISPCSI2_CTRL_VP_ONLY_EN_ENABLE)
++ currctrl->vp_only_enable = true;
++ else
++ currctrl->vp_only_enable = false;
++ uses_videoport = currctrl->vp_only_enable;
++ currctrl_u->vp_only_enable = false;
++
++ currctrl->vp_out_ctrl = ((reg & ISPCSI2_CTRL_VP_OUT_CTRL_MASK) >>
++ ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT) + 1;
++ currctrl_u->vp_out_ctrl = false;
++
++ if ((reg & ISPCSI2_CTRL_DBG_EN_MASK) == ISPCSI2_CTRL_DBG_EN_ENABLE)
++ currctrl->debug_enable = true;
++ else
++ currctrl->debug_enable = false;
++ currctrl_u->debug_enable = false;
++
++ currctrl->burst_size = (reg & ISPCSI2_CTRL_BURST_SIZE_MASK) >>
++ ISPCSI2_CTRL_BURST_SIZE_SHIFT;
++ currctrl_u->burst_size = false;
++
++ if ((reg & ISPCSI2_CTRL_ECC_EN_MASK) == ISPCSI2_CTRL_ECC_EN_ENABLE)
++ currctrl->ecc_enable = true;
++ else
++ currctrl->ecc_enable = false;
++ currctrl_u->ecc_enable = false;
++
++ if ((reg & ISPCSI2_CTRL_SECURE_MASK) == ISPCSI2_CTRL_SECURE_ENABLE)
++ currctrl->secure_mode = true;
++ else
++ currctrl->secure_mode = false;
++ currctrl_u->secure_mode = false;
++
++ if ((reg & ISPCSI2_CTRL_IF_EN_MASK) == ISPCSI2_CTRL_IF_EN_ENABLE)
++ currctrl->if_enable = true;
++ else
++ currctrl->if_enable = false;
++ currctrl_u->if_enable = false;
++
++ update_ctrl = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_validate - Validates the context number value
++ * @ctxnum: Pointer to variable containing context number.
++ *
++ * If the value is not in range (3 bits), it is being ANDed with 0x7 to force
++ * it to be on range.
++ **/
++static void isp_csi2_ctx_validate(u8 *ctxnum)
++{
++ if (*ctxnum > 7) {
++ printk(KERN_ERR "Invalid context number. Forcing valid"
++ " value...\n");
++ *ctxnum &= ~(0x7);
++ }
++}
++
++/**
++ * isp_csi2_ctx_config_virtual_id - Maps a virtual ID with a CSI2 Rx context
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @virtual_id: CSI2 Virtual ID to associate with specified context number.
++ *
++ * Returns 0 if successful, or -EINVAL if Virtual ID is not in range (0-3).
++ **/
++int isp_csi2_ctx_config_virtual_id(u8 ctxnum, u8 virtual_id)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ if (virtual_id > 3) {
++ printk(KERN_ERR "Wrong requested virtual_id\n");
++ return -EINVAL;
++ }
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->virtual_id != virtual_id) {
++ selected_ctx->virtual_id = virtual_id;
++ selected_ctx_u->virtual_id = true;
++ update_ctx_ctrl2[ctxnum] = true;
++ }
++
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_frame_count - Sets frame count to be received in CSI2 Rx.
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @frame_count: Number of frames to acquire.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_frame_count(u8 ctxnum, u8 frame_count)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->frame_count != frame_count) {
++ selected_ctx->frame_count = frame_count;
++ selected_ctx_u->frame_count = true;
++ update_ctx_ctrl1[ctxnum] = true;
++ }
++
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_format - Maps a pixel format to a specified context.
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @pixformat: V4L2 structure for pixel format.
++ *
++ * Returns 0 if successful, or -EINVAL if the format is not supported by the
++ * receiver.
++ **/
++int isp_csi2_ctx_config_format(u8 ctxnum, u32 pixformat)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++ struct v4l2_pix_format pix;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ pix.pixelformat = pixformat;
++ switch (pix.pixelformat) {
++ case V4L2_PIX_FMT_RGB565:
++ case V4L2_PIX_FMT_RGB565X:
++ case V4L2_PIX_FMT_YUYV:
++ case V4L2_PIX_FMT_UYVY:
++ case V4L2_PIX_FMT_RGB555:
++ case V4L2_PIX_FMT_RGB555X:
++ case V4L2_PIX_FMT_SGRBG10:
++ break;
++ default:
++ printk(KERN_ERR "Context config pixel format unsupported\n");
++ return -EINVAL;
++ }
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ selected_ctx->format = pix;
++ selected_ctx_u->format = true;
++ update_ctx_ctrl2[ctxnum] = true;
++
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_alpha - Sets the alpha value for pixel format
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @alpha: Alpha value.
++ *
++ * Returns 0 if successful, or -EINVAL if the alpha value is bigger than 16383.
++ **/
++int isp_csi2_ctx_config_alpha(u8 ctxnum, u16 alpha)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ if (alpha > 0x3FFF) {
++ printk(KERN_ERR "Wrong alpha value\n");
++ return -EINVAL;
++ }
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->alpha != alpha) {
++ selected_ctx->alpha = alpha;
++ selected_ctx_u->alpha = true;
++ update_ctx_ctrl3[ctxnum] = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_data_offset - Sets the offset between received lines
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @data_offset: Offset between first pixel of each 2 contiguous lines.
++ *
++ * Returns 0 if successful, or -EINVAL if the line offset is bigger than 1023.
++ **/
++int isp_csi2_ctx_config_data_offset(u8 ctxnum, u16 data_offset)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ if (data_offset > 0x3FF) {
++ printk(KERN_ERR "Wrong line offset\n");
++ return -EINVAL;
++ }
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->data_offset != data_offset) {
++ selected_ctx->data_offset = data_offset;
++ selected_ctx_u->data_offset = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_ping_addr - Sets Ping address for CSI2 Rx. buffer saving
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @ping_addr: 32 bit ISP MMU mapped address.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_ping_addr(u8 ctxnum, u32 ping_addr)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ ping_addr &= ~(0x1F);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->ping_addr != ping_addr) {
++ selected_ctx->ping_addr = ping_addr;
++ selected_ctx_u->ping_addr = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_pong_addr - Sets Pong address for CSI2 Rx. buffer saving
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @pong_addr: 32 bit ISP MMU mapped address.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_pong_addr(u8 ctxnum, u32 pong_addr)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ pong_addr &= ~(0x1F);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->pong_addr != pong_addr) {
++ selected_ctx->pong_addr = pong_addr;
++ selected_ctx_u->pong_addr = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_eof_enabled - Enables EOF signal assertion
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @eof_enabled: Boolean to enable/disable EOF signal assertion on received
++ * packets.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_eof_enabled(u8 ctxnum, bool eof_enabled)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->eof_enabled != eof_enabled) {
++ selected_ctx->eof_enabled = eof_enabled;
++ selected_ctx_u->eof_enabled = true;
++ update_ctx_ctrl1[ctxnum] = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_eol_enabled - Enables EOL signal assertion
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @eol_enabled: Boolean to enable/disable EOL signal assertion on received
++ * packets.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_eol_enabled(u8 ctxnum, bool eol_enabled)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->eol_enabled != eol_enabled) {
++ selected_ctx->eol_enabled = eol_enabled;
++ selected_ctx_u->eol_enabled = true;
++ update_ctx_ctrl1[ctxnum] = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_checksum_enabled - Enables Checksum check in rcvd packets
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @checksum_enabled: Boolean to enable/disable Checksum check on received
++ * packets
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_checksum_enabled(u8 ctxnum, bool checksum_enabled)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->checksum_enabled != checksum_enabled) {
++ selected_ctx->checksum_enabled = checksum_enabled;
++ selected_ctx_u->checksum_enabled = true;
++ update_ctx_ctrl1[ctxnum] = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_config_enabled - Enables specified CSI2 context
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @enabled: Boolean to enable/disable specified context.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_config_enabled(u8 ctxnum, bool enabled)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (selected_ctx->enabled != enabled) {
++ selected_ctx->enabled = enabled;
++ selected_ctx_u->enabled = true;
++ update_ctx_ctrl1[ctxnum] = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_update - Applies CSI2 context configuration.
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_ctx_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_ctx_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_update(u8 ctxnum, bool force_update)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++ u32 reg;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ if (update_ctx_ctrl1[ctxnum] || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL1(ctxnum));
++ if (selected_ctx_u->frame_count || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL1_COUNT_MASK);
++ reg |= selected_ctx->frame_count <<
++ ISPCSI2_CTX_CTRL1_COUNT_SHIFT;
++ selected_ctx_u->frame_count = false;
++ }
++ if (selected_ctx_u->eof_enabled || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL1_EOF_EN_MASK);
++ if (selected_ctx->eof_enabled)
++ reg |= ISPCSI2_CTX_CTRL1_EOF_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTX_CTRL1_EOF_EN_DISABLE;
++ selected_ctx_u->eof_enabled = false;
++ }
++ if (selected_ctx_u->eol_enabled || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL1_EOL_EN_MASK);
++ if (selected_ctx->eol_enabled)
++ reg |= ISPCSI2_CTX_CTRL1_EOL_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTX_CTRL1_EOL_EN_DISABLE;
++ selected_ctx_u->eol_enabled = false;
++ }
++ if (selected_ctx_u->checksum_enabled || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL1_CS_EN_MASK);
++ if (selected_ctx->checksum_enabled)
++ reg |= ISPCSI2_CTX_CTRL1_CS_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTX_CTRL1_CS_EN_DISABLE;
++ selected_ctx_u->checksum_enabled = false;
++ }
++ if (selected_ctx_u->enabled || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL1_CTX_EN_MASK);
++ if (selected_ctx->enabled)
++ reg |= ISPCSI2_CTX_CTRL1_CTX_EN_ENABLE;
++ else
++ reg |= ISPCSI2_CTX_CTRL1_CTX_EN_DISABLE;
++ selected_ctx_u->enabled = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL1(ctxnum));
++ update_ctx_ctrl1[ctxnum] = false;
++ }
++
++ if (update_ctx_ctrl2[ctxnum] || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL2(ctxnum));
++ if (selected_ctx_u->virtual_id || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL2_VIRTUAL_ID_MASK);
++ reg |= selected_ctx->virtual_id <<
++ ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT;
++ selected_ctx_u->virtual_id = false;
++ }
++
++ if (selected_ctx_u->format || force_update) {
++ struct v4l2_pix_format *pix;
++ u16 new_format = 0;
++
++ reg &= ~(ISPCSI2_CTX_CTRL2_FORMAT_MASK);
++ pix = &selected_ctx->format;
++ switch (pix->pixelformat) {
++ case V4L2_PIX_FMT_RGB565:
++ case V4L2_PIX_FMT_RGB565X:
++ new_format = 0x22;
++ break;
++ case V4L2_PIX_FMT_YUYV:
++ case V4L2_PIX_FMT_UYVY:
++ if (uses_videoport)
++ new_format = 0x9E;
++ else
++ new_format = 0x1E;
++ break;
++ case V4L2_PIX_FMT_RGB555:
++ case V4L2_PIX_FMT_RGB555X:
++ new_format = 0xA1;
++ break;
++ case V4L2_PIX_FMT_SGRBG10:
++ if (uses_videoport)
++ new_format = 0x12F;
++ else
++ new_format = 0xAB;
++ break;
++ }
++ reg |= (new_format << ISPCSI2_CTX_CTRL2_FORMAT_SHIFT);
++ selected_ctx_u->format = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL2(ctxnum));
++ update_ctx_ctrl2[ctxnum] = false;
++ }
++
++ if (update_ctx_ctrl3[ctxnum] || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL3(ctxnum));
++ if (selected_ctx_u->alpha || force_update) {
++ reg &= ~(ISPCSI2_CTX_CTRL3_ALPHA_MASK);
++ reg |= (selected_ctx->alpha <<
++ ISPCSI2_CTX_CTRL3_ALPHA_SHIFT);
++ selected_ctx_u->alpha = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL3(ctxnum));
++ update_ctx_ctrl3[ctxnum] = false;
++ }
++
++ if (selected_ctx_u->data_offset) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_OFST(ctxnum));
++ reg &= ~ISPCSI2_CTX_DAT_OFST_OFST_MASK;
++ reg |= selected_ctx->data_offset <<
++ ISPCSI2_CTX_DAT_OFST_OFST_SHIFT;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_OFST(ctxnum));
++ selected_ctx_u->data_offset = false;
++ }
++
++ if (selected_ctx_u->ping_addr) {
++ reg = selected_ctx->ping_addr;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PING_ADDR(ctxnum));
++ selected_ctx_u->ping_addr = false;
++ }
++
++ if (selected_ctx_u->pong_addr) {
++ reg = selected_ctx->pong_addr;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PONG_ADDR(ctxnum));
++ selected_ctx_u->pong_addr = false;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_get - Gets specific CSI2 Context configuration
++ * @ctxnum: Context number, valid between 0 and 7 values.
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_get(u8 ctxnum)
++{
++ struct isp_csi2_ctx_cfg *selected_ctx;
++ struct isp_csi2_ctx_cfg_update *selected_ctx_u;
++ u32 reg;
++
++ isp_csi2_ctx_validate(&ctxnum);
++
++ selected_ctx = &current_csi2_cfg.contexts[ctxnum];
++ selected_ctx_u = &current_csi2_cfg_update.contexts[ctxnum];
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTX_CTRL1(ctxnum));
++ selected_ctx->frame_count = (reg & ISPCSI2_CTX_CTRL1_COUNT_MASK) >>
++ ISPCSI2_CTX_CTRL1_COUNT_SHIFT;
++ selected_ctx_u->frame_count = false;
++
++ if ((reg & ISPCSI2_CTX_CTRL1_EOF_EN_MASK) ==
++ ISPCSI2_CTX_CTRL1_EOF_EN_ENABLE)
++ selected_ctx->eof_enabled = true;
++ else
++ selected_ctx->eof_enabled = false;
++ selected_ctx_u->eof_enabled = false;
++
++ if ((reg & ISPCSI2_CTX_CTRL1_EOL_EN_MASK) ==
++ ISPCSI2_CTX_CTRL1_EOL_EN_ENABLE)
++ selected_ctx->eol_enabled = true;
++ else
++ selected_ctx->eol_enabled = false;
++ selected_ctx_u->eol_enabled = false;
++
++ if ((reg & ISPCSI2_CTX_CTRL1_CS_EN_MASK) ==
++ ISPCSI2_CTX_CTRL1_CS_EN_ENABLE)
++ selected_ctx->checksum_enabled = true;
++ else
++ selected_ctx->checksum_enabled = false;
++ selected_ctx_u->checksum_enabled = false;
++
++ if ((reg & ISPCSI2_CTX_CTRL1_CTX_EN_MASK) ==
++ ISPCSI2_CTX_CTRL1_CTX_EN_ENABLE)
++ selected_ctx->enabled = true;
++ else
++ selected_ctx->enabled = false;
++ selected_ctx_u->enabled = false;
++ update_ctx_ctrl1[ctxnum] = false;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTX_CTRL2(ctxnum));
++
++ selected_ctx->virtual_id = (reg & ISPCSI2_CTX_CTRL2_VIRTUAL_ID_MASK) >>
++ ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT;
++ selected_ctx_u->virtual_id = false;
++
++ switch ((reg & ISPCSI2_CTX_CTRL2_FORMAT_MASK) >>
++ ISPCSI2_CTX_CTRL2_FORMAT_SHIFT) {
++ case 0x22:
++ selected_ctx->format.pixelformat = V4L2_PIX_FMT_RGB565;
++ break;
++ case 0x9E:
++ case 0x1E:
++ selected_ctx->format.pixelformat = V4L2_PIX_FMT_YUYV;
++ break;
++ case 0xA1:
++ selected_ctx->format.pixelformat = V4L2_PIX_FMT_RGB555;
++ break;
++ case 0xAB:
++ case 0x12F:
++ selected_ctx->format.pixelformat = V4L2_PIX_FMT_SGRBG10;
++ break;
++ }
++ selected_ctx_u->format = false;
++ update_ctx_ctrl2[ctxnum] = false;
++
++ selected_ctx->alpha = (isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL3(ctxnum)) &
++ ISPCSI2_CTX_CTRL3_ALPHA_MASK) >>
++ ISPCSI2_CTX_CTRL3_ALPHA_SHIFT;
++ selected_ctx_u->alpha = false;
++ update_ctx_ctrl3[ctxnum] = false;
++
++ selected_ctx->data_offset = (isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_OFST(ctxnum)) &
++ ISPCSI2_CTX_DAT_OFST_OFST_MASK) >>
++ ISPCSI2_CTX_DAT_OFST_OFST_SHIFT;
++ selected_ctx_u->data_offset = false;
++
++ selected_ctx->ping_addr = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PING_ADDR(ctxnum));
++ selected_ctx_u->ping_addr = false;
++
++ selected_ctx->pong_addr = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PONG_ADDR(ctxnum));
++ selected_ctx_u->pong_addr = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_update_all - Applies all CSI2 context configuration.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_ctx_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_ctx_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_update_all(bool force_update)
++{
++ u8 ctxnum;
++
++ for (ctxnum = 0; ctxnum < 8; ctxnum++)
++ isp_csi2_ctx_update(ctxnum, force_update);
++
++ return 0;
++}
++
++/**
++ * isp_csi2_ctx_get_all - Gets all CSI2 Context configurations
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_ctx_get_all(void)
++{
++ u8 ctxnum;
++
++ for (ctxnum = 0; ctxnum < 8; ctxnum++)
++ isp_csi2_ctx_get(ctxnum);
++
++ return 0;
++}
++
++int isp_csi2_phy_config(struct isp_csi2_phy_cfg *desiredphyconfig)
++{
++ struct isp_csi2_phy_cfg *currphy = &current_csi2_cfg.phy;
++ struct isp_csi2_phy_cfg_update *currphy_u =
++ &current_csi2_cfg_update.phy;
++
++ if ((desiredphyconfig->tclk_term > 0x7f) ||
++ (desiredphyconfig->tclk_miss > 0x3)) {
++ printk(KERN_ERR "Invalid PHY configuration sent by the"
++ " driver\n");
++ return -EINVAL;
++ }
++
++ if (currphy->ths_term != desiredphyconfig->ths_term) {
++ currphy->ths_term = desiredphyconfig->ths_term;
++ currphy_u->ths_term = true;
++ update_phy_cfg0 = true;
++ }
++ if (currphy->ths_settle != desiredphyconfig->ths_settle) {
++ currphy->ths_settle = desiredphyconfig->ths_settle;
++ currphy_u->ths_settle = true;
++ update_phy_cfg0 = true;
++ }
++ if (currphy->tclk_term != desiredphyconfig->tclk_term) {
++ currphy->tclk_term = desiredphyconfig->tclk_term;
++ currphy_u->tclk_term = true;
++ update_phy_cfg1 = true;
++ }
++ if (currphy->tclk_miss != desiredphyconfig->tclk_miss) {
++ currphy->tclk_miss = desiredphyconfig->tclk_miss;
++ currphy_u->tclk_miss = true;
++ update_phy_cfg1 = true;
++ }
++ if (currphy->tclk_settle != desiredphyconfig->tclk_settle) {
++ currphy->tclk_settle = desiredphyconfig->tclk_settle;
++ currphy_u->tclk_settle = true;
++ update_phy_cfg1 = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_calc_phy_cfg0 - Calculates D-PHY config based on the MIPIClk speed.
++ * @mipiclk: MIPI clock frequency being used with CSI2 sensor.
++ * @lbound_hs_settle: Lower bound for CSI2 High Speed Settle transition.
++ * @ubound_hs_settle: Upper bound for CSI2 High Speed Settle transition.
++ *
++ * From TRM, we have the same calculation for HS Termination signal.
++ * THS_TERM = ceil( 12.5ns / DDRCLK period ) - 1
++ * But for Settle, we use the mid value between the two passed boundaries from
++ * sensor:
++ * THS_SETTLE = (Upper bound + Lower bound) / 2
++ *
++ * Always returns 0.
++ */
++int isp_csi2_calc_phy_cfg0(u32 mipiclk, u32 lbound_hs_settle,
++ u32 ubound_hs_settle)
++{
++ struct isp_csi2_phy_cfg *currphy = &current_csi2_cfg.phy;
++ struct isp_csi2_phy_cfg_update *currphy_u =
++ &current_csi2_cfg_update.phy;
++ u32 tmp, ddrclk = mipiclk >> 1;
++
++ /* Calculate THS_TERM */
++ tmp = ddrclk / 80000000;
++ if ((ddrclk % 80000000) > 0)
++ tmp++;
++ currphy->ths_term = tmp - 1;
++ currphy_u->ths_term = true;
++
++ /* Calculate THS_SETTLE */
++ currphy->ths_settle = (ubound_hs_settle + lbound_hs_settle) / 2;
++
++ currphy_u->ths_settle = true;
++ isp_csi2_phy_update(true);
++ return 0;
++}
++EXPORT_SYMBOL(isp_csi2_calc_phy_cfg0);
++
++/**
++ * isp_csi2_phy_update - Applies CSI2 D-PHY configuration.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_phy_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_phy_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_phy_update(bool force_update)
++{
++ struct isp_csi2_phy_cfg *currphy = &current_csi2_cfg.phy;
++ struct isp_csi2_phy_cfg_update *currphy_u =
++ &current_csi2_cfg_update.phy;
++ u32 reg;
++
++ if (update_phy_cfg0 || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG0);
++ if (currphy_u->ths_term || force_update) {
++ reg &= ~ISPCSI2PHY_CFG0_THS_TERM_MASK;
++ reg |= (currphy->ths_term <<
++ ISPCSI2PHY_CFG0_THS_TERM_SHIFT);
++ currphy_u->ths_term = false;
++ }
++ if (currphy_u->ths_settle || force_update) {
++ reg &= ~ISPCSI2PHY_CFG0_THS_SETTLE_MASK;
++ reg |= (currphy->ths_settle <<
++ ISPCSI2PHY_CFG0_THS_SETTLE_SHIFT);
++ currphy_u->ths_settle = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG0);
++ update_phy_cfg0 = false;
++ }
++
++ if (update_phy_cfg1 || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG1);
++ if (currphy_u->tclk_term || force_update) {
++ reg &= ~ISPCSI2PHY_CFG1_TCLK_TERM_MASK;
++ reg |= (currphy->tclk_term <<
++ ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT);
++ currphy_u->tclk_term = false;
++ }
++ if (currphy_u->tclk_miss || force_update) {
++ reg &= ~ISPCSI2PHY_CFG1_TCLK_MISS_MASK;
++ reg |= (currphy->tclk_miss <<
++ ISPCSI2PHY_CFG1_TCLK_MISS_SHIFT);
++ currphy_u->tclk_miss = false;
++ }
++ if (currphy_u->tclk_settle || force_update) {
++ reg &= ~ISPCSI2PHY_CFG1_TCLK_SETTLE_MASK;
++ reg |= (currphy->tclk_settle <<
++ ISPCSI2PHY_CFG1_TCLK_SETTLE_SHIFT);
++ currphy_u->tclk_settle = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG1);
++ update_phy_cfg1 = false;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_phy_get - Gets CSI2 D-PHY configuration
++ *
++ * Gets settings from HW registers and fills in the internal driver memory
++ * Always returns 0.
++ **/
++int isp_csi2_phy_get(void)
++{
++ struct isp_csi2_phy_cfg *currphy = &current_csi2_cfg.phy;
++ struct isp_csi2_phy_cfg_update *currphy_u =
++ &current_csi2_cfg_update.phy;
++ u32 reg;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG0);
++ currphy->ths_term = (reg & ISPCSI2PHY_CFG0_THS_TERM_MASK) >>
++ ISPCSI2PHY_CFG0_THS_TERM_SHIFT;
++ currphy_u->ths_term = false;
++
++ currphy->ths_settle = (reg & ISPCSI2PHY_CFG0_THS_SETTLE_MASK) >>
++ ISPCSI2PHY_CFG0_THS_SETTLE_SHIFT;
++ currphy_u->ths_settle = false;
++ update_phy_cfg0 = false;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY, ISPCSI2PHY_CFG1);
++
++ currphy->tclk_term = (reg & ISPCSI2PHY_CFG1_TCLK_TERM_MASK) >>
++ ISPCSI2PHY_CFG1_TCLK_TERM_SHIFT;
++ currphy_u->tclk_term = false;
++
++ currphy->tclk_miss = (reg & ISPCSI2PHY_CFG1_TCLK_MISS_MASK) >>
++ ISPCSI2PHY_CFG1_TCLK_MISS_SHIFT;
++ currphy_u->tclk_miss = false;
++
++ currphy->tclk_settle = (reg & ISPCSI2PHY_CFG1_TCLK_SETTLE_MASK) >>
++ ISPCSI2PHY_CFG1_TCLK_SETTLE_SHIFT;
++ currphy_u->tclk_settle = false;
++
++ update_phy_cfg1 = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_config_forcerxmode - Sets Force Rx mode on stop state count
++ * @force_rx_mode: Boolean to enable/disable forcing Rx mode in CSI2 receiver
++ *
++ * Returns 0 if successful, or -EINVAL if wrong ComplexIO number is selected.
++ **/
++int isp_csi2_timings_config_forcerxmode(u8 io, bool force_rx_mode)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++ if (currtimings->force_rx_mode != force_rx_mode) {
++ currtimings->force_rx_mode = force_rx_mode;
++ currtimings_u->force_rx_mode = true;
++ update_timing = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_config_stopstate_16x - Sets 16x factor for L3 cycles
++ * @stop_state_16x: Boolean to use or not use the 16x multiplier for stop count
++ *
++ * Returns 0 if successful, or -EINVAL if wrong ComplexIO number is selected.
++ **/
++int isp_csi2_timings_config_stopstate_16x(u8 io, bool stop_state_16x)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++ if (currtimings->stop_state_16x != stop_state_16x) {
++ currtimings->stop_state_16x = stop_state_16x;
++ currtimings_u->stop_state_16x = true;
++ update_timing = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_config_stopstate_4x - Sets 4x factor for L3 cycles
++ * @stop_state_4x: Boolean to use or not use the 4x multiplier for stop count
++ *
++ * Returns 0 if successful, or -EINVAL if wrong ComplexIO number is selected.
++ **/
++int isp_csi2_timings_config_stopstate_4x(u8 io, bool stop_state_4x)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++ if (currtimings->stop_state_4x != stop_state_4x) {
++ currtimings->stop_state_4x = stop_state_4x;
++ currtimings_u->stop_state_4x = true;
++ update_timing = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_config_stopstate_cnt - Sets L3 cycles
++ * @stop_state_counter: Stop state counter value for L3 cycles
++ *
++ * Returns 0 if successful, or -EINVAL if wrong ComplexIO number is selected.
++ **/
++int isp_csi2_timings_config_stopstate_cnt(u8 io, u16 stop_state_counter)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++ if (currtimings->stop_state_counter != stop_state_counter) {
++ currtimings->stop_state_counter = (stop_state_counter & 0x1FFF);
++ currtimings_u->stop_state_counter = true;
++ update_timing = true;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_update - Applies specified CSI2 timing configuration.
++ * @io: IO number (1 or 2) which specifies which ComplexIO are we updating
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_timings_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_timings_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Returns 0 if successful, or -EINVAL if invalid IO number is passed.
++ **/
++int isp_csi2_timings_update(u8 io, bool force_update)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++ u32 reg;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++
++ if (update_timing || force_update) {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_TIMING);
++ if (currtimings_u->force_rx_mode || force_update) {
++ reg &= ~ISPCSI2_TIMING_FORCE_RX_MODE_IO_MASK(io);
++ if (currtimings->force_rx_mode)
++ reg |= ISPCSI2_TIMING_FORCE_RX_MODE_IO_ENABLE
++ (io);
++ else
++ reg |= ISPCSI2_TIMING_FORCE_RX_MODE_IO_DISABLE
++ (io);
++ currtimings_u->force_rx_mode = false;
++ }
++ if (currtimings_u->stop_state_16x || force_update) {
++ reg &= ~ISPCSI2_TIMING_STOP_STATE_X16_IO_MASK(io);
++ if (currtimings->stop_state_16x)
++ reg |= ISPCSI2_TIMING_STOP_STATE_X16_IO_ENABLE
++ (io);
++ else
++ reg |= ISPCSI2_TIMING_STOP_STATE_X16_IO_DISABLE
++ (io);
++ currtimings_u->stop_state_16x = false;
++ }
++ if (currtimings_u->stop_state_4x || force_update) {
++ reg &= ~ISPCSI2_TIMING_STOP_STATE_X4_IO_MASK(io);
++ if (currtimings->stop_state_4x) {
++ reg |= ISPCSI2_TIMING_STOP_STATE_X4_IO_ENABLE
++ (io);
++ } else {
++ reg |= ISPCSI2_TIMING_STOP_STATE_X4_IO_DISABLE
++ (io);
++ }
++ currtimings_u->stop_state_4x = false;
++ }
++ if (currtimings_u->stop_state_counter || force_update) {
++ reg &= ~ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_MASK(io);
++ reg |= currtimings->stop_state_counter <<
++ ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(io);
++ currtimings_u->stop_state_counter = false;
++ }
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_TIMING);
++ update_timing = false;
++ }
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_get - Gets specific CSI2 ComplexIO timing configuration
++ * @io: IO number (1 or 2) which specifies which ComplexIO are we getting
++ *
++ * Gets settings from HW registers and fills in the internal driver memory
++ * Returns 0 if successful, or -EINVAL if invalid IO number is passed.
++ **/
++int isp_csi2_timings_get(u8 io)
++{
++ struct isp_csi2_timings_cfg *currtimings;
++ struct isp_csi2_timings_cfg_update *currtimings_u;
++ u32 reg;
++
++ if (io < 1 || io > 2) {
++ printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n");
++ return -EINVAL;
++ }
++
++ currtimings = &current_csi2_cfg.timings[io - 1];
++ currtimings_u = &current_csi2_cfg_update.timings[io - 1];
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_TIMING);
++ if ((reg & ISPCSI2_TIMING_FORCE_RX_MODE_IO_MASK(io)) ==
++ ISPCSI2_TIMING_FORCE_RX_MODE_IO_ENABLE(io))
++ currtimings->force_rx_mode = true;
++ else
++ currtimings->force_rx_mode = false;
++ currtimings_u->force_rx_mode = false;
++
++ if ((reg & ISPCSI2_TIMING_STOP_STATE_X16_IO_MASK(io)) ==
++ ISPCSI2_TIMING_STOP_STATE_X16_IO_ENABLE(io))
++ currtimings->stop_state_16x = true;
++ else
++ currtimings->stop_state_16x = false;
++ currtimings_u->stop_state_16x = false;
++
++ if ((reg & ISPCSI2_TIMING_STOP_STATE_X4_IO_MASK(io)) ==
++ ISPCSI2_TIMING_STOP_STATE_X4_IO_ENABLE(io))
++ currtimings->stop_state_4x = true;
++ else
++ currtimings->stop_state_4x = false;
++ currtimings_u->stop_state_4x = false;
++
++ currtimings->stop_state_counter = (reg &
++ ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_MASK(io)) >>
++ ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(io);
++ currtimings_u->stop_state_counter = false;
++ update_timing = false;
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_update_all - Applies specified CSI2 timing configuration.
++ * @force_update: Flag to force rewrite of registers, even if they haven't been
++ * updated with the isp_csi2_timings_config_*() functions.
++ *
++ * It only saves settings when they were previously updated using the
++ * isp_csi2_timings_config_*() functions, unless the force_update flag is
++ * set to true.
++ * Always returns 0.
++ **/
++int isp_csi2_timings_update_all(bool force_update)
++{
++ int i;
++
++ for (i = 1; i < 3; i++)
++ isp_csi2_timings_update(i, force_update);
++ return 0;
++}
++
++/**
++ * isp_csi2_timings_get_all - Gets all CSI2 ComplexIO timing configurations
++ *
++ * Always returns 0.
++ **/
++int isp_csi2_timings_get_all(void)
++{
++ int i;
++
++ for (i = 1; i < 3; i++)
++ isp_csi2_timings_get(i);
++ return 0;
++}
++
++/**
++ * isp_csi2_isr - CSI2 interrupt handling.
++ **/
++void isp_csi2_isr(void)
++{
++ u32 csi2_irqstatus, cpxio1_irqstatus, ctxirqstatus;
++
++ csi2_irqstatus = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_IRQSTATUS);
++ isp_reg_writel(csi2_irqstatus, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_IRQSTATUS);
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_COMPLEXIO1_ERR_IRQ) {
++ cpxio1_irqstatus = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO1_IRQSTATUS);
++ isp_reg_writel(cpxio1_irqstatus, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO1_IRQSTATUS);
++ printk(KERN_ERR "CSI2: ComplexIO Error IRQ %x\n",
++ cpxio1_irqstatus);
++ }
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_CONTEXT(0)) {
++ ctxirqstatus = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQSTATUS(0));
++ isp_reg_writel(ctxirqstatus, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQSTATUS(0));
++ }
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_OCP_ERR_IRQ)
++ printk(KERN_ERR "CSI2: OCP Transmission Error\n");
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_SHORT_PACKET_IRQ)
++ printk(KERN_ERR "CSI2: Short packet receive error\n");
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_ECC_CORRECTION_IRQ)
++ printk(KERN_DEBUG "CSI2: ECC correction done\n");
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_ECC_NO_CORRECTION_IRQ)
++ printk(KERN_ERR "CSI2: ECC correction failed\n");
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_COMPLEXIO2_ERR_IRQ)
++ printk(KERN_ERR "CSI2: ComplexIO #2 failed\n");
++
++ if (csi2_irqstatus & ISPCSI2_IRQSTATUS_FIFO_OVF_IRQ)
++ printk(KERN_ERR "CSI2: FIFO overflow error\n");
++
++ return;
++}
++EXPORT_SYMBOL(isp_csi2_isr);
++
++/**
++ * isp_csi2_irq_complexio1_set - Enables CSI2 ComplexIO IRQs.
++ * @enable: Enable/disable CSI2 ComplexIO #1 interrupts
++ **/
++void isp_csi2_irq_complexio1_set(int enable)
++{
++ u32 reg;
++ reg = ISPCSI2_COMPLEXIO1_IRQENABLE_STATEALLULPMEXIT |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEALLULPMENTER |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM5 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL5 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC5 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS5 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS5 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM4 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL4 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC4 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS4 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS4 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM3 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL3 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC3 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS3 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS3 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM2 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL2 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC2 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS2 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS2 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_STATEULPM1 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRCONTROL1 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRESC1 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTSYNCHS1 |
++ ISPCSI2_COMPLEXIO1_IRQENABLE_ERRSOTHS1;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO1_IRQSTATUS);
++ if (enable) {
++ reg |= isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO1_IRQENABLE);
++ } else
++ reg = 0;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO1_IRQENABLE);
++}
++EXPORT_SYMBOL(isp_csi2_irq_complexio1_set);
++
++/**
++ * isp_csi2_irq_ctx_set - Enables CSI2 Context IRQs.
++ * @enable: Enable/disable CSI2 Context interrupts
++ **/
++void isp_csi2_irq_ctx_set(int enable)
++{
++ u32 reg;
++ int i;
++
++ reg = ISPCSI2_CTX_IRQSTATUS_FS_IRQ | ISPCSI2_CTX_IRQSTATUS_FE_IRQ;
++ for (i = 0; i < 8; i++) {
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQSTATUS(i));
++ if (enable) {
++ isp_reg_or(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQENABLE(i), reg);
++ } else {
++ isp_reg_writel(0, OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQENABLE(i));
++ }
++ }
++
++}
++EXPORT_SYMBOL(isp_csi2_irq_ctx_set);
++
++/**
++ * isp_csi2_irq_status_set - Enables CSI2 Status IRQs.
++ * @enable: Enable/disable CSI2 Status interrupts
++ **/
++void isp_csi2_irq_status_set(int enable)
++{
++ u32 reg;
++ reg = ISPCSI2_IRQSTATUS_OCP_ERR_IRQ |
++ ISPCSI2_IRQSTATUS_SHORT_PACKET_IRQ |
++ ISPCSI2_IRQSTATUS_ECC_CORRECTION_IRQ |
++ ISPCSI2_IRQSTATUS_ECC_NO_CORRECTION_IRQ |
++ ISPCSI2_IRQSTATUS_COMPLEXIO2_ERR_IRQ |
++ ISPCSI2_IRQSTATUS_COMPLEXIO1_ERR_IRQ |
++ ISPCSI2_IRQSTATUS_FIFO_OVF_IRQ |
++ ISPCSI2_IRQSTATUS_CONTEXT(0);
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_IRQSTATUS);
++ if (enable)
++ reg |= isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_IRQENABLE);
++ else
++ reg = 0;
++
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_IRQENABLE);
++}
++EXPORT_SYMBOL(isp_csi2_irq_status_set);
++
++/**
++ * isp_csi2_irq_status_set - Enables main CSI2 IRQ.
++ * @enable: Enable/disable main CSI2 interrupt
++ **/
++void isp_csi2_irq_set(int enable)
++{
++ isp_reg_writel(IRQ0STATUS_CSIA_IRQ, OMAP3_ISP_IOMEM_MAIN,
++ ISP_IRQ0STATUS);
++ isp_reg_and_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_CSIA_IRQ,
++ (enable ? IRQ0ENABLE_CSIA_IRQ : 0));
++}
++EXPORT_SYMBOL(isp_csi2_irq_set);
++
++/**
++ * isp_csi2_irq_all_set - Enable/disable CSI2 interrupts.
++ * @enable: 0-Disable, 1-Enable.
++ **/
++void isp_csi2_irq_all_set(int enable)
++{
++ if (enable) {
++ isp_csi2_irq_complexio1_set(enable);
++ isp_csi2_irq_ctx_set(enable);
++ isp_csi2_irq_status_set(enable);
++ isp_csi2_irq_set(enable);
++ } else {
++ isp_csi2_irq_set(enable);
++ isp_csi2_irq_status_set(enable);
++ isp_csi2_irq_ctx_set(enable);
++ isp_csi2_irq_complexio1_set(enable);
++ }
++ return;
++}
++EXPORT_SYMBOL(isp_csi2_irq_all_set);
++
++/**
++ * isp_csi2_reset - Resets the CSI2 module.
++ *
++ * Returns 0 if successful, or -EBUSY if power command didn't respond.
++ **/
++int isp_csi2_reset(void)
++{
++ u32 reg;
++ u8 soft_reset_retries = 0;
++ int i;
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_SYSCONFIG);
++ reg |= ISPCSI2_SYSCONFIG_SOFT_RESET_RESET;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_SYSCONFIG);
++
++ do {
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_SYSSTATUS) &
++ ISPCSI2_SYSSTATUS_RESET_DONE_MASK;
++ if (reg == ISPCSI2_SYSSTATUS_RESET_DONE_DONE)
++ break;
++ soft_reset_retries++;
++ if (soft_reset_retries < 5)
++ udelay(100);
++ } while (soft_reset_retries < 5);
++
++ if (soft_reset_retries == 5) {
++ printk(KERN_ERR "CSI2: Soft reset try count exceeded!\n");
++ return -EBUSY;
++ }
++
++ reg = isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_SYSCONFIG);
++ reg &= ~ISPCSI2_SYSCONFIG_MSTANDBY_MODE_MASK;
++ reg |= ISPCSI2_SYSCONFIG_MSTANDBY_MODE_NO;
++ reg &= ~ISPCSI2_SYSCONFIG_AUTO_IDLE_MASK;
++ isp_reg_writel(reg, OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_SYSCONFIG);
++
++ uses_videoport = false;
++ update_complexio_cfg1 = false;
++ update_phy_cfg0 = false;
++ update_phy_cfg1 = false;
++ for (i = 0; i < 8; i++) {
++ update_ctx_ctrl1[i] = false;
++ update_ctx_ctrl2[i] = false;
++ update_ctx_ctrl3[i] = false;
++ }
++ update_timing = false;
++ update_ctrl = false;
++
++ isp_csi2_complexio_lanes_get();
++ isp_csi2_ctrl_get();
++ isp_csi2_ctx_get_all();
++ isp_csi2_phy_get();
++ isp_csi2_timings_get_all();
++
++ isp_csi2_complexio_power_autoswitch(true);
++ isp_csi2_complexio_power(ISP_CSI2_POWER_ON);
++
++ isp_csi2_timings_config_forcerxmode(1, true);
++ isp_csi2_timings_config_stopstate_cnt(1, 0x1FF);
++ isp_csi2_timings_update_all(true);
++
++ return 0;
++}
++
++/**
++ * isp_csi2_enable - Enables the CSI2 module.
++ * @enable: Enables/disables the CSI2 module.
++ **/
++void isp_csi2_enable(int enable)
++{
++ if (enable) {
++ isp_csi2_ctx_config_enabled(0, true);
++ isp_csi2_ctx_config_eof_enabled(0, true);
++ isp_csi2_ctx_config_checksum_enabled(0, true);
++ isp_csi2_ctx_update(0, false);
++
++ isp_csi2_ctrl_config_ecc_enable(true);
++ isp_csi2_ctrl_config_if_enable(true);
++ isp_csi2_ctrl_update(false);
++ } else {
++ isp_csi2_ctx_config_enabled(0, false);
++ isp_csi2_ctx_config_eof_enabled(0, false);
++ isp_csi2_ctx_config_checksum_enabled(0, false);
++ isp_csi2_ctx_update(0, false);
++
++ isp_csi2_ctrl_config_ecc_enable(false);
++ isp_csi2_ctrl_config_if_enable(false);
++ isp_csi2_ctrl_update(false);
++ }
++}
++EXPORT_SYMBOL(isp_csi2_enable);
++
++/**
++ * isp_csi2_regdump - Prints CSI2 debug information.
++ **/
++void isp_csi2_regdump(void)
++{
++ printk(KERN_DEBUG "-------------Register dump-------------\n");
++
++ printk(KERN_DEBUG "ISP_CTRL: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_CTRL));
++ printk(KERN_DEBUG "ISP_TCTRL_CTRL: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL));
++
++ printk(KERN_DEBUG "ISPCCDC_SDR_ADDR: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SDR_ADDR));
++ printk(KERN_DEBUG "ISPCCDC_SYN_MODE: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE));
++ printk(KERN_DEBUG "ISPCCDC_CFG: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG));
++ printk(KERN_DEBUG "ISPCCDC_FMTCFG: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG));
++ printk(KERN_DEBUG "ISPCCDC_HSIZE_OFF: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HSIZE_OFF));
++ printk(KERN_DEBUG "ISPCCDC_HORZ_INFO: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC, ISPCCDC_HORZ_INFO));
++ printk(KERN_DEBUG "ISPCCDC_VERT_START: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_START));
++ printk(KERN_DEBUG "ISPCCDC_VERT_LINES: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CCDC,
++ ISPCCDC_VERT_LINES));
++
++ printk(KERN_DEBUG "ISPCSI2_COMPLEXIO_CFG1: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_COMPLEXIO_CFG1));
++ printk(KERN_DEBUG "ISPCSI2_SYSSTATUS: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_SYSSTATUS));
++ printk(KERN_DEBUG "ISPCSI2_SYSCONFIG: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_SYSCONFIG));
++ printk(KERN_DEBUG "ISPCSI2_IRQENABLE: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_IRQENABLE));
++ printk(KERN_DEBUG "ISPCSI2_IRQSTATUS: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_IRQSTATUS));
++
++ printk(KERN_DEBUG "ISPCSI2_CTX_IRQENABLE(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQENABLE(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_IRQSTATUS(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_IRQSTATUS(0)));
++ printk(KERN_DEBUG "ISPCSI2_TIMING: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_TIMING));
++ printk(KERN_DEBUG "ISPCSI2PHY_CFG0: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY,
++ ISPCSI2PHY_CFG0));
++ printk(KERN_DEBUG "ISPCSI2PHY_CFG1: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2PHY,
++ ISPCSI2PHY_CFG1));
++ printk(KERN_DEBUG "ISPCSI2_CTX_CTRL1(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL1(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_CTRL2(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL2(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_CTRL3(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_CTRL3(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_DAT_OFST(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_OFST(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_DAT_PING_ADDR(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PING_ADDR(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTX_DAT_PONG_ADDR(0): %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A,
++ ISPCSI2_CTX_DAT_PONG_ADDR(0)));
++ printk(KERN_DEBUG "ISPCSI2_CTRL: %x\n",
++ isp_reg_readl(OMAP3_ISP_IOMEM_CSI2A, ISPCSI2_CTRL));
++ printk(KERN_DEBUG "---------------------------------------\n");
++}
++
++/**
++ * isp_csi2_cleanup - Routine for module driver cleanup
++ **/
++void isp_csi2_cleanup(void)
++{
++ return;
++}
++
++/**
++ * isp_csi2_init - Routine for module driver init
++ **/
++int __init isp_csi2_init(void)
++{
++ int i;
++
++ update_complexio_cfg1 = false;
++ update_phy_cfg0 = false;
++ update_phy_cfg1 = false;
++ for (i = 0; i < 8; i++) {
++ update_ctx_ctrl1[i] = false;
++ update_ctx_ctrl2[i] = false;
++ update_ctx_ctrl3[i] = false;
++ }
++ update_timing = false;
++ update_ctrl = false;
++
++ memset(&current_csi2_cfg, 0, sizeof(current_csi2_cfg));
++ memset(&current_csi2_cfg_update, 0, sizeof(current_csi2_cfg_update));
++ return 0;
++}
++
++MODULE_AUTHOR("Texas Instruments");
++MODULE_DESCRIPTION("ISP CSI2 Receiver Module");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/media/video/isp/ispcsi2.h b/drivers/media/video/isp/ispcsi2.h
+new file mode 100644
+index 0000000..4582c96
+--- /dev/null
++++ b/drivers/media/video/isp/ispcsi2.h
+@@ -0,0 +1,232 @@
++/*
++ * ispcsi2.h
++ *
++ * Copyright (C) 2009 Texas Instruments.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Dominic Curran <dcurran@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_ISP_CSI2_API_H
++#define OMAP_ISP_CSI2_API_H
++#include <linux/videodev2.h>
++
++enum isp_csi2_irqevents {
++ OCP_ERR_IRQ = 0x4000,
++ SHORT_PACKET_IRQ = 0x2000,
++ ECC_CORRECTION_IRQ = 0x1000,
++ ECC_NO_CORRECTION_IRQ = 0x800,
++ COMPLEXIO2_ERR_IRQ = 0x400,
++ COMPLEXIO1_ERR_IRQ = 0x200,
++ FIFO_OVF_IRQ = 0x100,
++ CONTEXT7 = 0x80,
++ CONTEXT6 = 0x40,
++ CONTEXT5 = 0x20,
++ CONTEXT4 = 0x10,
++ CONTEXT3 = 0x8,
++ CONTEXT2 = 0x4,
++ CONTEXT1 = 0x2,
++ CONTEXT0 = 0x1,
++};
++
++enum isp_csi2_ctx_irqevents {
++ CTX_ECC_CORRECTION = 0x100,
++ CTX_LINE_NUMBER = 0x80,
++ CTX_FRAME_NUMBER = 0x40,
++ CTX_CS = 0x20,
++ CTX_LE = 0x8,
++ CTX_LS = 0x4,
++ CTX_FE = 0x2,
++ CTX_FS = 0x1,
++};
++
++enum isp_csi2_power_cmds {
++ ISP_CSI2_POWER_OFF,
++ ISP_CSI2_POWER_ON,
++ ISP_CSI2_POWER_ULPW,
++};
++
++enum isp_csi2_frame_mode {
++ ISP_CSI2_FRAME_IMMEDIATE,
++ ISP_CSI2_FRAME_AFTERFEC,
++};
++
++struct csi2_lanecfg {
++ u8 pos;
++ u8 pol;
++};
++
++struct isp_csi2_lanes_cfg {
++ struct csi2_lanecfg data[4];
++ struct csi2_lanecfg clk;
++};
++
++struct isp_csi2_lanes_cfg_update {
++ bool data[4];
++ bool clk;
++};
++
++struct isp_csi2_phy_cfg {
++ u8 ths_term;
++ u8 ths_settle;
++ u8 tclk_term;
++ unsigned tclk_miss:1;
++ u8 tclk_settle;
++};
++
++struct isp_csi2_phy_cfg_update {
++ bool ths_term;
++ bool ths_settle;
++ bool tclk_term;
++ bool tclk_miss;
++ bool tclk_settle;
++};
++
++struct isp_csi2_ctx_cfg {
++ u8 virtual_id;
++ u8 frame_count;
++ struct v4l2_pix_format format;
++ u16 alpha;
++ u16 data_offset;
++ u32 ping_addr;
++ u32 pong_addr;
++ bool eof_enabled;
++ bool eol_enabled;
++ bool checksum_enabled;
++ bool enabled;
++};
++
++struct isp_csi2_ctx_cfg_update {
++ bool virtual_id;
++ bool frame_count;
++ bool format;
++ bool alpha;
++ bool data_offset;
++ bool ping_addr;
++ bool pong_addr;
++ bool eof_enabled;
++ bool eol_enabled;
++ bool checksum_enabled;
++ bool enabled;
++};
++
++struct isp_csi2_timings_cfg {
++ bool force_rx_mode;
++ bool stop_state_16x;
++ bool stop_state_4x;
++ u16 stop_state_counter;
++};
++
++struct isp_csi2_timings_cfg_update {
++ bool force_rx_mode;
++ bool stop_state_16x;
++ bool stop_state_4x;
++ bool stop_state_counter;
++};
++
++struct isp_csi2_ctrl_cfg {
++ bool vp_clk_enable;
++ bool vp_only_enable;
++ u8 vp_out_ctrl;
++ bool debug_enable;
++ u8 burst_size;
++ enum isp_csi2_frame_mode frame_mode;
++ bool ecc_enable;
++ bool secure_mode;
++ bool if_enable;
++};
++
++struct isp_csi2_ctrl_cfg_update {
++ bool vp_clk_enable;
++ bool vp_only_enable;
++ bool vp_out_ctrl;
++ bool debug_enable;
++ bool burst_size;
++ bool frame_mode;
++ bool ecc_enable;
++ bool secure_mode;
++ bool if_enable;
++};
++
++struct isp_csi2_cfg {
++ struct isp_csi2_lanes_cfg lanes;
++ struct isp_csi2_phy_cfg phy;
++ struct isp_csi2_ctx_cfg contexts[8];
++ struct isp_csi2_timings_cfg timings[2];
++ struct isp_csi2_ctrl_cfg ctrl;
++};
++
++struct isp_csi2_cfg_update {
++ struct isp_csi2_lanes_cfg_update lanes;
++ struct isp_csi2_phy_cfg_update phy;
++ struct isp_csi2_ctx_cfg_update contexts[8];
++ struct isp_csi2_timings_cfg_update timings[2];
++ struct isp_csi2_ctrl_cfg_update ctrl;
++};
++
++int isp_csi2_complexio_lanes_config(struct isp_csi2_lanes_cfg *reqcfg);
++int isp_csi2_complexio_lanes_update(bool force_update);
++int isp_csi2_complexio_lanes_get(void);
++int isp_csi2_complexio_power_autoswitch(bool enable);
++int isp_csi2_complexio_power(enum isp_csi2_power_cmds power_cmd);
++int isp_csi2_ctrl_config_frame_mode(enum isp_csi2_frame_mode frame_mode);
++int isp_csi2_ctrl_config_vp_clk_enable(bool vp_clk_enable);
++int isp_csi2_ctrl_config_vp_only_enable(bool vp_only_enable);
++int isp_csi2_ctrl_config_debug_enable(bool debug_enable);
++int isp_csi2_ctrl_config_burst_size(u8 burst_size);
++int isp_csi2_ctrl_config_ecc_enable(bool ecc_enable);
++int isp_csi2_ctrl_config_secure_mode(bool secure_mode);
++int isp_csi2_ctrl_config_if_enable(bool if_enable);
++int isp_csi2_ctrl_config_vp_out_ctrl(u8 vp_out_ctrl);
++int isp_csi2_ctrl_update(bool force_update);
++int isp_csi2_ctrl_get(void);
++int isp_csi2_ctx_config_virtual_id(u8 ctxnum, u8 virtual_id);
++int isp_csi2_ctx_config_frame_count(u8 ctxnum, u8 frame_count);
++int isp_csi2_ctx_config_format(u8 ctxnum, u32 pixformat);
++int isp_csi2_ctx_config_alpha(u8 ctxnum, u16 alpha);
++int isp_csi2_ctx_config_data_offset(u8 ctxnum, u16 data_offset);
++int isp_csi2_ctx_config_ping_addr(u8 ctxnum, u32 ping_addr);
++int isp_csi2_ctx_config_pong_addr(u8 ctxnum, u32 pong_addr);
++int isp_csi2_ctx_config_eof_enabled(u8 ctxnum, bool eof_enabled);
++int isp_csi2_ctx_config_eol_enabled(u8 ctxnum, bool eol_enabled);
++int isp_csi2_ctx_config_checksum_enabled(u8 ctxnum, bool checksum_enabled);
++int isp_csi2_ctx_config_enabled(u8 ctxnum, bool enabled);
++int isp_csi2_ctx_update(u8 ctxnum, bool force_update);
++int isp_csi2_ctx_get(u8 ctxnum);
++int isp_csi2_ctx_update_all(bool force_update);
++int isp_csi2_ctx_get_all(void);
++int isp_csi2_phy_config(struct isp_csi2_phy_cfg *desiredphyconfig);
++int isp_csi2_calc_phy_cfg0(u32 mipiclk, u32 lbound_hs_settle,
++ u32 ubound_hs_settle);
++int isp_csi2_phy_update(bool force_update);
++int isp_csi2_phy_get(void);
++int isp_csi2_timings_config_forcerxmode(u8 io, bool force_rx_mode);
++int isp_csi2_timings_config_stopstate_16x(u8 io, bool stop_state_16x);
++int isp_csi2_timings_config_stopstate_4x(u8 io, bool stop_state_4x);
++int isp_csi2_timings_config_stopstate_cnt(u8 io, u16 stop_state_counter);
++int isp_csi2_timings_update(u8 io, bool force_update);
++int isp_csi2_timings_get(u8 io);
++int isp_csi2_timings_update_all(bool force_update);
++int isp_csi2_timings_get_all(void);
++void isp_csi2_irq_complexio1_set(int enable);
++void isp_csi2_irq_ctx_set(int enable);
++void isp_csi2_irq_status_set(int enable);
++void isp_csi2_irq_set(int enable);
++void isp_csi2_irq_all_set(int enable);
++
++void isp_csi2_isr(void);
++int isp_csi2_reset(void);
++void isp_csi2_enable(int enable);
++void isp_csi2_regdump(void);
++
++#endif /* OMAP_ISP_CSI2_H */
++
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch
new file mode 100644
index 0000000000..db023e514d
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch
@@ -0,0 +1,4018 @@
+From 5de7cb2cac5f7d76cb025ddc8fb09c99a1007e08 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:02 +0200
+Subject: [PATCH] omap3isp: Add ISP tables
+
+* Blue Gamma gain table
+* CFA gain table
+* Green Gamma gain table
+* Luma Enhancement gain table
+* Noise filter gain table
+* Red Gamma gain table
+
+TODO:
+
+- Get rid of this kind of tables. Either generate them at runtime or
+ use a user space program to fill defaults.
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/isp/bluegamma_table.h | 1040 ++++++++++++++++++++++++++
+ drivers/media/video/isp/cfa_coef_table.h | 603 +++++++++++++++
+ drivers/media/video/isp/greengamma_table.h | 1040 ++++++++++++++++++++++++++
+ drivers/media/video/isp/luma_enhance_table.h | 144 ++++
+ drivers/media/video/isp/noise_filter_table.h | 79 ++
+ drivers/media/video/isp/redgamma_table.h | 1040 ++++++++++++++++++++++++++
+ 6 files changed, 3946 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/bluegamma_table.h
+ create mode 100644 drivers/media/video/isp/cfa_coef_table.h
+ create mode 100644 drivers/media/video/isp/greengamma_table.h
+ create mode 100644 drivers/media/video/isp/luma_enhance_table.h
+ create mode 100644 drivers/media/video/isp/noise_filter_table.h
+ create mode 100644 drivers/media/video/isp/redgamma_table.h
+
+diff --git a/drivers/media/video/isp/bluegamma_table.h b/drivers/media/video/isp/bluegamma_table.h
+new file mode 100644
+index 0000000..301382a
+--- /dev/null
++++ b/drivers/media/video/isp/bluegamma_table.h
+@@ -0,0 +1,1040 @@
++/*
++ * bluegamma_table.h
++ *
++ * Gamma Table values for BLUE for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++0,
++0,
++1,
++2,
++3,
++3,
++4,
++5,
++6,
++8,
++10,
++12,
++14,
++16,
++18,
++20,
++22,
++23,
++25,
++26,
++28,
++29,
++31,
++32,
++34,
++35,
++36,
++37,
++39,
++40,
++41,
++42,
++43,
++44,
++45,
++46,
++47,
++48,
++49,
++50,
++51,
++52,
++52,
++53,
++54,
++55,
++56,
++57,
++58,
++59,
++60,
++61,
++62,
++63,
++63,
++64,
++65,
++66,
++66,
++67,
++68,
++69,
++69,
++70,
++71,
++72,
++72,
++73,
++74,
++75,
++75,
++76,
++77,
++78,
++78,
++79,
++80,
++81,
++81,
++82,
++83,
++84,
++84,
++85,
++86,
++87,
++88,
++88,
++89,
++90,
++91,
++91,
++92,
++93,
++94,
++94,
++95,
++96,
++97,
++97,
++98,
++98,
++99,
++99,
++100,
++100,
++101,
++101,
++102,
++103,
++104,
++104,
++105,
++106,
++107,
++108,
++108,
++109,
++110,
++111,
++111,
++112,
++113,
++114,
++114,
++115,
++116,
++117,
++117,
++118,
++119,
++119,
++120,
++120,
++121,
++121,
++122,
++122,
++123,
++123,
++124,
++124,
++125,
++125,
++126,
++126,
++127,
++127,
++128,
++128,
++129,
++129,
++130,
++130,
++131,
++131,
++132,
++132,
++133,
++133,
++134,
++134,
++135,
++135,
++136,
++136,
++137,
++137,
++138,
++138,
++139,
++139,
++140,
++140,
++141,
++141,
++142,
++142,
++143,
++143,
++144,
++144,
++145,
++145,
++146,
++146,
++147,
++147,
++148,
++148,
++149,
++149,
++150,
++150,
++151,
++151,
++152,
++152,
++153,
++153,
++153,
++153,
++154,
++154,
++154,
++154,
++155,
++155,
++156,
++156,
++157,
++157,
++158,
++158,
++158,
++159,
++159,
++159,
++160,
++160,
++160,
++161,
++161,
++162,
++162,
++163,
++163,
++164,
++164,
++164,
++164,
++165,
++165,
++165,
++165,
++166,
++166,
++167,
++167,
++168,
++168,
++169,
++169,
++170,
++170,
++170,
++170,
++171,
++171,
++171,
++171,
++172,
++172,
++173,
++173,
++174,
++174,
++175,
++175,
++176,
++176,
++176,
++176,
++177,
++177,
++177,
++177,
++178,
++178,
++178,
++178,
++179,
++179,
++179,
++179,
++180,
++180,
++180,
++180,
++181,
++181,
++181,
++181,
++182,
++182,
++182,
++182,
++183,
++183,
++183,
++183,
++184,
++184,
++184,
++184,
++185,
++185,
++185,
++185,
++186,
++186,
++186,
++186,
++187,
++187,
++187,
++187,
++188,
++188,
++188,
++188,
++189,
++189,
++189,
++189,
++190,
++190,
++190,
++190,
++191,
++191,
++191,
++191,
++192,
++192,
++192,
++192,
++193,
++193,
++193,
++193,
++194,
++194,
++194,
++194,
++195,
++195,
++195,
++195,
++196,
++196,
++196,
++196,
++197,
++197,
++197,
++197,
++198,
++198,
++198,
++198,
++199,
++199,
++199,
++199,
++200,
++200,
++200,
++200,
++201,
++201,
++201,
++201,
++202,
++202,
++202,
++203,
++203,
++203,
++203,
++204,
++204,
++204,
++204,
++205,
++205,
++205,
++205,
++206,
++206,
++206,
++206,
++207,
++207,
++207,
++207,
++208,
++208,
++208,
++208,
++209,
++209,
++209,
++209,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++212,
++212,
++212,
++212,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++214,
++214,
++214,
++214,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++216,
++216,
++216,
++216,
++217,
++217,
++217,
++217,
++218,
++218,
++218,
++218,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++220,
++220,
++220,
++220,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++222,
++222,
++222,
++222,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++224,
++224,
++224,
++224,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++226,
++226,
++226,
++226,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++228,
++228,
++228,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++230,
++230,
++230,
++230,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++233,
++233,
++233,
++233,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++235,
++235,
++235,
++235,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++237,
++237,
++237,
++237,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++239,
++239,
++239,
++239,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++241,
++241,
++241,
++241,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++243,
++243,
++243,
++243,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++245,
++245,
++245,
++245,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++247,
++247,
++247,
++247,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++249,
++249,
++249,
++249,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++251,
++251,
++251,
++251,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++254,
++254,
++254,
++254,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255
+diff --git a/drivers/media/video/isp/cfa_coef_table.h b/drivers/media/video/isp/cfa_coef_table.h
+new file mode 100644
+index 0000000..8cafa1f
+--- /dev/null
++++ b/drivers/media/video/isp/cfa_coef_table.h
+@@ -0,0 +1,603 @@
++/*
++ * cfa_coef_table.h
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ *
++ * Contact: Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ *
++ * Written by Gjorgji Rosikopulos
++ *
++ * 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.
++ *
++ * 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., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ *
++ */
++
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248,
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248,
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++4,
++250,
++12,
++244,
++250,
++0,
++27,
++0,
++12,
++27,
++36,
++247,
++244,
++0,
++247,
++0,
++0,
++0,
++0,
++248,
++0,
++0,
++40,
++0,
++0,
++247,
++0,
++244,
++247,
++36,
++27,
++12,
++0,
++27,
++0,
++250,
++244,
++12,
++250,
++4,
++0,
++40,
++0,
++0,
++248,
++0,
++0,
++0,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248,
++244,
++12,
++250,
++4,
++0,
++27,
++0,
++250,
++247,
++36,
++27,
++12,
++0,
++247,
++0,
++244,
++248,
++0,
++0,
++0,
++0,
++40,
++0,
++0,
++244,
++0,
++247,
++0,
++12,
++27,
++36,
++247,
++250,
++0,
++27,
++0,
++4,
++250,
++12,
++244,
++0,
++0,
++40,
++0,
++0,
++0,
++0,
++248
++
+diff --git a/drivers/media/video/isp/greengamma_table.h b/drivers/media/video/isp/greengamma_table.h
+new file mode 100644
+index 0000000..0f5c5e4
+--- /dev/null
++++ b/drivers/media/video/isp/greengamma_table.h
+@@ -0,0 +1,1040 @@
++/*
++ * greengamma_table.h
++ *
++ * Gamma Table values for GREEN for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++0,
++0,
++1,
++2,
++3,
++3,
++4,
++5,
++6,
++8,
++10,
++12,
++14,
++16,
++18,
++20,
++22,
++23,
++25,
++26,
++28,
++29,
++31,
++32,
++34,
++35,
++36,
++37,
++39,
++40,
++41,
++42,
++43,
++44,
++45,
++46,
++47,
++48,
++49,
++50,
++51,
++52,
++52,
++53,
++54,
++55,
++56,
++57,
++58,
++59,
++60,
++61,
++62,
++63,
++63,
++64,
++65,
++66,
++66,
++67,
++68,
++69,
++69,
++70,
++71,
++72,
++72,
++73,
++74,
++75,
++75,
++76,
++77,
++78,
++78,
++79,
++80,
++81,
++81,
++82,
++83,
++84,
++84,
++85,
++86,
++87,
++88,
++88,
++89,
++90,
++91,
++91,
++92,
++93,
++94,
++94,
++95,
++96,
++97,
++97,
++98,
++98,
++99,
++99,
++100,
++100,
++101,
++101,
++102,
++103,
++104,
++104,
++105,
++106,
++107,
++108,
++108,
++109,
++110,
++111,
++111,
++112,
++113,
++114,
++114,
++115,
++116,
++117,
++117,
++118,
++119,
++119,
++120,
++120,
++121,
++121,
++122,
++122,
++123,
++123,
++124,
++124,
++125,
++125,
++126,
++126,
++127,
++127,
++128,
++128,
++129,
++129,
++130,
++130,
++131,
++131,
++132,
++132,
++133,
++133,
++134,
++134,
++135,
++135,
++136,
++136,
++137,
++137,
++138,
++138,
++139,
++139,
++140,
++140,
++141,
++141,
++142,
++142,
++143,
++143,
++144,
++144,
++145,
++145,
++146,
++146,
++147,
++147,
++148,
++148,
++149,
++149,
++150,
++150,
++151,
++151,
++152,
++152,
++153,
++153,
++153,
++153,
++154,
++154,
++154,
++154,
++155,
++155,
++156,
++156,
++157,
++157,
++158,
++158,
++158,
++159,
++159,
++159,
++160,
++160,
++160,
++161,
++161,
++162,
++162,
++163,
++163,
++164,
++164,
++164,
++164,
++165,
++165,
++165,
++165,
++166,
++166,
++167,
++167,
++168,
++168,
++169,
++169,
++170,
++170,
++170,
++170,
++171,
++171,
++171,
++171,
++172,
++172,
++173,
++173,
++174,
++174,
++175,
++175,
++176,
++176,
++176,
++176,
++177,
++177,
++177,
++177,
++178,
++178,
++178,
++178,
++179,
++179,
++179,
++179,
++180,
++180,
++180,
++180,
++181,
++181,
++181,
++181,
++182,
++182,
++182,
++182,
++183,
++183,
++183,
++183,
++184,
++184,
++184,
++184,
++185,
++185,
++185,
++185,
++186,
++186,
++186,
++186,
++187,
++187,
++187,
++187,
++188,
++188,
++188,
++188,
++189,
++189,
++189,
++189,
++190,
++190,
++190,
++190,
++191,
++191,
++191,
++191,
++192,
++192,
++192,
++192,
++193,
++193,
++193,
++193,
++194,
++194,
++194,
++194,
++195,
++195,
++195,
++195,
++196,
++196,
++196,
++196,
++197,
++197,
++197,
++197,
++198,
++198,
++198,
++198,
++199,
++199,
++199,
++199,
++200,
++200,
++200,
++200,
++201,
++201,
++201,
++201,
++202,
++202,
++202,
++203,
++203,
++203,
++203,
++204,
++204,
++204,
++204,
++205,
++205,
++205,
++205,
++206,
++206,
++206,
++206,
++207,
++207,
++207,
++207,
++208,
++208,
++208,
++208,
++209,
++209,
++209,
++209,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++212,
++212,
++212,
++212,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++214,
++214,
++214,
++214,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++216,
++216,
++216,
++216,
++217,
++217,
++217,
++217,
++218,
++218,
++218,
++218,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++220,
++220,
++220,
++220,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++222,
++222,
++222,
++222,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++224,
++224,
++224,
++224,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++226,
++226,
++226,
++226,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++228,
++228,
++228,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++230,
++230,
++230,
++230,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++233,
++233,
++233,
++233,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++235,
++235,
++235,
++235,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++237,
++237,
++237,
++237,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++239,
++239,
++239,
++239,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++241,
++241,
++241,
++241,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++243,
++243,
++243,
++243,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++245,
++245,
++245,
++245,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++247,
++247,
++247,
++247,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++249,
++249,
++249,
++249,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++251,
++251,
++251,
++251,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++254,
++254,
++254,
++254,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255
+diff --git a/drivers/media/video/isp/luma_enhance_table.h b/drivers/media/video/isp/luma_enhance_table.h
+new file mode 100644
+index 0000000..99c8b05
+--- /dev/null
++++ b/drivers/media/video/isp/luma_enhance_table.h
+@@ -0,0 +1,144 @@
++/*
++ * luma_enhance_table.h
++ *
++ * Luminance Enhancement table values for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1047552,
++1048575,
++1047551,
++1046527,
++1045503,
++1044479,
++1043455,
++1042431,
++1041407,
++1040383,
++1039359,
++1038335,
++1037311,
++1036287,
++1035263,
++1034239,
++1033215,
++1032191,
++1031167,
++1030143,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028096,
++1028100,
++1032196,
++1036292,
++1040388,
++1044484,
++0,
++0,
++0,
++5,
++5125,
++10245,
++15365,
++20485,
++25605,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++30720,
++31743,
++30719,
++29695,
++28671,
++27647,
++26623,
++25599,
++24575,
++23551,
++22527,
++21503,
++20479,
++19455,
++18431,
++17407,
++16383,
++15359,
++14335,
++13311,
++12287,
++11263,
++10239,
++9215,
++8191,
++7167,
++6143,
++5119,
++4095,
++3071,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024,
++1024
+diff --git a/drivers/media/video/isp/noise_filter_table.h b/drivers/media/video/isp/noise_filter_table.h
+new file mode 100644
+index 0000000..7345f90
+--- /dev/null
++++ b/drivers/media/video/isp/noise_filter_table.h
+@@ -0,0 +1,79 @@
++/*
++ * noise_filter_table.h
++ *
++ * Noise Filter Table values for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++16,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31,
++31
+diff --git a/drivers/media/video/isp/redgamma_table.h b/drivers/media/video/isp/redgamma_table.h
+new file mode 100644
+index 0000000..ad0232a
+--- /dev/null
++++ b/drivers/media/video/isp/redgamma_table.h
+@@ -0,0 +1,1040 @@
++/*
++ * redgamma_table.h
++ *
++ * Gamma Table values for RED for TI's OMAP3 Camera ISP
++ *
++ * Copyright (C) 2009 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++0,
++0,
++1,
++2,
++3,
++3,
++4,
++5,
++6,
++8,
++10,
++12,
++14,
++16,
++18,
++20,
++22,
++23,
++25,
++26,
++28,
++29,
++31,
++32,
++34,
++35,
++36,
++37,
++39,
++40,
++41,
++42,
++43,
++44,
++45,
++46,
++47,
++48,
++49,
++50,
++51,
++52,
++52,
++53,
++54,
++55,
++56,
++57,
++58,
++59,
++60,
++61,
++62,
++63,
++63,
++64,
++65,
++66,
++66,
++67,
++68,
++69,
++69,
++70,
++71,
++72,
++72,
++73,
++74,
++75,
++75,
++76,
++77,
++78,
++78,
++79,
++80,
++81,
++81,
++82,
++83,
++84,
++84,
++85,
++86,
++87,
++88,
++88,
++89,
++90,
++91,
++91,
++92,
++93,
++94,
++94,
++95,
++96,
++97,
++97,
++98,
++98,
++99,
++99,
++100,
++100,
++101,
++101,
++102,
++103,
++104,
++104,
++105,
++106,
++107,
++108,
++108,
++109,
++110,
++111,
++111,
++112,
++113,
++114,
++114,
++115,
++116,
++117,
++117,
++118,
++119,
++119,
++120,
++120,
++121,
++121,
++122,
++122,
++123,
++123,
++124,
++124,
++125,
++125,
++126,
++126,
++127,
++127,
++128,
++128,
++129,
++129,
++130,
++130,
++131,
++131,
++132,
++132,
++133,
++133,
++134,
++134,
++135,
++135,
++136,
++136,
++137,
++137,
++138,
++138,
++139,
++139,
++140,
++140,
++141,
++141,
++142,
++142,
++143,
++143,
++144,
++144,
++145,
++145,
++146,
++146,
++147,
++147,
++148,
++148,
++149,
++149,
++150,
++150,
++151,
++151,
++152,
++152,
++153,
++153,
++153,
++153,
++154,
++154,
++154,
++154,
++155,
++155,
++156,
++156,
++157,
++157,
++158,
++158,
++158,
++159,
++159,
++159,
++160,
++160,
++160,
++161,
++161,
++162,
++162,
++163,
++163,
++164,
++164,
++164,
++164,
++165,
++165,
++165,
++165,
++166,
++166,
++167,
++167,
++168,
++168,
++169,
++169,
++170,
++170,
++170,
++170,
++171,
++171,
++171,
++171,
++172,
++172,
++173,
++173,
++174,
++174,
++175,
++175,
++176,
++176,
++176,
++176,
++177,
++177,
++177,
++177,
++178,
++178,
++178,
++178,
++179,
++179,
++179,
++179,
++180,
++180,
++180,
++180,
++181,
++181,
++181,
++181,
++182,
++182,
++182,
++182,
++183,
++183,
++183,
++183,
++184,
++184,
++184,
++184,
++185,
++185,
++185,
++185,
++186,
++186,
++186,
++186,
++187,
++187,
++187,
++187,
++188,
++188,
++188,
++188,
++189,
++189,
++189,
++189,
++190,
++190,
++190,
++190,
++191,
++191,
++191,
++191,
++192,
++192,
++192,
++192,
++193,
++193,
++193,
++193,
++194,
++194,
++194,
++194,
++195,
++195,
++195,
++195,
++196,
++196,
++196,
++196,
++197,
++197,
++197,
++197,
++198,
++198,
++198,
++198,
++199,
++199,
++199,
++199,
++200,
++200,
++200,
++200,
++201,
++201,
++201,
++201,
++202,
++202,
++202,
++203,
++203,
++203,
++203,
++204,
++204,
++204,
++204,
++205,
++205,
++205,
++205,
++206,
++206,
++206,
++206,
++207,
++207,
++207,
++207,
++208,
++208,
++208,
++208,
++209,
++209,
++209,
++209,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++210,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++211,
++212,
++212,
++212,
++212,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++213,
++214,
++214,
++214,
++214,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++215,
++216,
++216,
++216,
++216,
++217,
++217,
++217,
++217,
++218,
++218,
++218,
++218,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++219,
++220,
++220,
++220,
++220,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++221,
++222,
++222,
++222,
++222,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++223,
++224,
++224,
++224,
++224,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++225,
++226,
++226,
++226,
++226,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++227,
++228,
++228,
++228,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++229,
++230,
++230,
++230,
++230,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++231,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++232,
++233,
++233,
++233,
++233,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++234,
++235,
++235,
++235,
++235,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++236,
++237,
++237,
++237,
++237,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++238,
++239,
++239,
++239,
++239,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++240,
++241,
++241,
++241,
++241,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++242,
++243,
++243,
++243,
++243,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++244,
++245,
++245,
++245,
++245,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++246,
++247,
++247,
++247,
++247,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++248,
++249,
++249,
++249,
++249,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++250,
++251,
++251,
++251,
++251,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++252,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++253,
++254,
++254,
++254,
++254,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255,
++255
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch
new file mode 100644
index 0000000000..22074be148
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch
@@ -0,0 +1,2249 @@
+From 0edf5a50dc0164db5bc71b1a5d1aa8bb1838262c Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+Date: Tue, 10 Mar 2009 10:49:03 +0200
+Subject: [PATCH] omap34xxcam: Add camera driver
+
+This is the camera driver for the OMAP 3 camera ISP and v4l2-int-device
+sensors, lenses and (led) flashes. There are a few connections to OMAP
+3 left but after those have been broken this is hardware independent.
+Namely, the OMAP 3 ISP must offer a standard interface through
+v4l2_subdev (or v4l2-int-device) first.
+
+This driver has originated from the omap24xxcam camera driver written
+specifically for OMAP 2.
+
+TODO:
+
+- Convert to use v4l2_subdev instead of v4l2-int-device.
+
+Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
+---
+ drivers/media/video/Kconfig | 9 +
+ drivers/media/video/Makefile | 2 +
+ drivers/media/video/omap34xxcam.c | 1966 +++++++++++++++++++++++++++++++++++++
+ drivers/media/video/omap34xxcam.h | 207 ++++
+ 4 files changed, 2184 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/omap34xxcam.c
+ create mode 100644 drivers/media/video/omap34xxcam.h
+
+diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
+index 19cf3b8..3cdb5a4 100644
+--- a/drivers/media/video/Kconfig
++++ b/drivers/media/video/Kconfig
+@@ -711,6 +711,15 @@ config VIDEO_CAFE_CCIC
+ CMOS camera controller. This is the controller found on first-
+ generation OLPC systems.
+
++config VIDEO_OMAP3
++ tristate "OMAP 3 Camera support"
++ select VIDEOBUF_GEN
++ select VIDEOBUF_DMA_SG
++ select OMAP_IOMMU
++ depends on VIDEO_V4L2 && ARCH_OMAP34XX
++ ---help---
++ Driver for an OMAP 3 camera controller.
++
+ config SOC_CAMERA
+ tristate "SoC camera support"
+ depends on VIDEO_V4L2 && HAS_DMA
+diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
+index e654270..74a684e 100644
+--- a/drivers/media/video/Makefile
++++ b/drivers/media/video/Makefile
+@@ -108,6 +108,8 @@ obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
+
+ obj-y += isp/
+
++obj-$(CONFIG_VIDEO_OMAP3) += omap34xxcam.o
++
+ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+
+ obj-$(CONFIG_USB_DABUSB) += dabusb.o
+diff --git a/drivers/media/video/omap34xxcam.c b/drivers/media/video/omap34xxcam.c
+new file mode 100644
+index 0000000..00fdbf2
+--- /dev/null
++++ b/drivers/media/video/omap34xxcam.c
+@@ -0,0 +1,1966 @@
++/*
++ * omap34xxcam.c
++ *
++ * Copyright (C) 2006--2009 Nokia Corporation
++ * Copyright (C) 2007--2009 Texas Instruments
++ *
++ * Contact: Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ *
++ * Originally based on the OMAP 2 camera driver.
++ *
++ * Written by Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Mohit Jalori
++ * Sameer Venkatraman
++ * Leonides Martinez
++ *
++ * 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.
++ *
++ * 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., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ *
++ */
++
++#include <linux/io.h>
++#include <linux/clk.h>
++#include <linux/pci.h> /* needed for videobufs */
++#include <linux/delay.h>
++#include <linux/kernel.h>
++#include <linux/interrupt.h>
++#include <linux/videodev2.h>
++#include <linux/version.h>
++#include <linux/platform_device.h>
++
++#include <media/v4l2-common.h>
++#include <media/v4l2-ioctl.h>
++
++#include "omap34xxcam.h"
++#include "isp/isp.h"
++#include "isp/ispmmu.h"
++#include "isp/ispreg.h"
++#include "isp/ispccdc.h"
++#include "isp/isph3a.h"
++#include "isp/isp_af.h"
++#include "isp/isphist.h"
++#include "isp/isppreview.h"
++#include "isp/ispresizer.h"
++
++#define OMAP34XXCAM_VERSION KERNEL_VERSION(0, 0, 0)
++
++/* global variables */
++static struct omap34xxcam_device *omap34xxcam;
++
++/*
++ *
++ * Sensor handling.
++ *
++ */
++
++/**
++ * omap34xxcam_slave_power_set - set slave power state
++ * @vdev: per-video device data structure
++ * @power: new power state
++ */
++static int omap34xxcam_slave_power_set(struct omap34xxcam_videodev *vdev,
++ enum v4l2_power power,
++ int mask)
++{
++ int rval = 0, i = 0;
++
++ BUG_ON(!mutex_is_locked(&vdev->mutex));
++
++#ifdef OMAP34XXCAM_POWEROFF_DELAY
++ vdev->power_state_wish = -1;
++#endif
++
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ if (vdev->slave[i] == v4l2_int_device_dummy())
++ continue;
++
++ if (!(mask & (1 << i))
++ || power == vdev->power_state[i])
++ continue;
++
++ rval = vidioc_int_s_power(vdev->slave[i], power);
++
++ if (rval && power != V4L2_POWER_OFF) {
++ power = V4L2_POWER_OFF;
++ goto out;
++ }
++
++ vdev->power_state[i] = power;
++ }
++
++ return 0;
++
++out:
++ for (i--; i >= 0; i--) {
++ if (vdev->slave[i] == v4l2_int_device_dummy())
++ continue;
++
++ if (!(mask & (1 << i)))
++ continue;
++
++ vidioc_int_s_power(vdev->slave[i], power);
++ vdev->power_state[i] = power;
++ }
++
++ return rval;
++}
++
++#ifdef OMAP34XXCAM_POWEROFF_DELAY
++static void omap34xxcam_slave_power_work(struct work_struct *work)
++{
++ struct omap34xxcam_videodev *vdev =
++ container_of(work, struct omap34xxcam_videodev, poweroff_work);
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->power_state_wish != -1)
++ omap34xxcam_slave_power_set(vdev, vdev->power_state_wish,
++ vdev->power_state_mask);
++
++ mutex_unlock(&vdev->mutex);
++}
++
++static void omap34xxcam_slave_power_timer(unsigned long ptr)
++{
++ struct omap34xxcam_videodev *vdev = (void *)ptr;
++
++ schedule_work(&vdev->poweroff_work);
++}
++
++/**
++ * omap34xxcam_slave_power_suggest - delayed power state change
++ *
++ * @vdev: per-video device data structure
++ * @power: new power state
++ */
++static void omap34xxcam_slave_power_suggest(struct omap34xxcam_videodev *vdev,
++ enum v4l2_power power,
++ int mask)
++{
++ BUG_ON(!mutex_is_locked(&vdev->mutex));
++
++ del_timer(&vdev->poweroff_timer);
++
++ vdev->power_state_wish = power;
++ vdev->power_state_mask = mask;
++
++ mod_timer(&vdev->poweroff_timer, jiffies + OMAP34XXCAM_POWEROFF_DELAY);
++}
++#else /* OMAP34XXCAM_POWEROFF_DELAY */
++#define omap34xxcam_slave_power_suggest(a, b, c) do {} while (0)
++#endif /* OMAP34XXCAM_POWEROFF_DELAY */
++
++/**
++ * omap34xxcam_update_vbq - Updates VBQ with completed input buffer
++ * @vb: ptr. to standard V4L2 video buffer structure
++ *
++ * Updates video buffer queue with completed buffer passed as
++ * input parameter. Also updates ISP H3A timestamp and field count
++ * statistics.
++ */
++void omap34xxcam_vbq_complete(struct videobuf_buffer *vb, void *priv)
++{
++ struct omap34xxcam_fh *fh = priv;
++
++ do_gettimeofday(&vb->ts);
++ vb->field_count = atomic_add_return(2, &fh->field_count);
++
++ wake_up(&vb->done);
++}
++
++/**
++ * omap34xxcam_vbq_setup - Calcs size and num of buffs allowed in queue
++ * @vbq: ptr. to standard V4L2 video buffer queue structure
++ * @cnt: ptr to location to hold the count of buffers to be in the queue
++ * @size: ptr to location to hold the size of a frame
++ *
++ * Calculates the number of buffers of current image size that can be
++ * supported by the available capture memory.
++ */
++static int omap34xxcam_vbq_setup(struct videobuf_queue *vbq, unsigned int *cnt,
++ unsigned int *size)
++{
++ struct omap34xxcam_fh *fh = vbq->priv_data;
++ struct omap34xxcam_videodev *vdev = fh->vdev;
++
++ if (*cnt <= 0)
++ *cnt = VIDEO_MAX_FRAME; /* supply a default number of buffers */
++
++ if (*cnt > VIDEO_MAX_FRAME)
++ *cnt = VIDEO_MAX_FRAME;
++
++ *size = vdev->pix.sizeimage;
++
++ while (*size * *cnt > fh->vdev->vdev_sensor_config.capture_mem)
++ (*cnt)--;
++
++ return isp_vbq_setup(vbq, cnt, size);
++}
++
++/**
++ * omap34xxcam_vbq_release - Free resources for input VBQ and VB
++ * @vbq: ptr. to standard V4L2 video buffer queue structure
++ * @vb: ptr to standard V4L2 video buffer structure
++ *
++ * Unmap and free all memory associated with input VBQ and VB, also
++ * unmap the address in ISP MMU. Reset the VB state.
++ */
++static void omap34xxcam_vbq_release(struct videobuf_queue *vbq,
++ struct videobuf_buffer *vb)
++{
++ if (!vbq->streaming) {
++ isp_vbq_release(vbq, vb);
++ videobuf_dma_unmap(vbq, videobuf_to_dma(vb));
++ videobuf_dma_free(videobuf_to_dma(vb));
++ vb->state = VIDEOBUF_NEEDS_INIT;
++ }
++ return;
++}
++
++/**
++ * omap34xxcam_vbq_prepare - V4L2 video ops buf_prepare handler
++ * @vbq: ptr. to standard V4L2 video buffer queue structure
++ * @vb: ptr to standard V4L2 video buffer structure
++ * @field: standard V4L2 field enum
++ *
++ * Verifies there is sufficient locked memory for the requested
++ * buffer, or if there is not, allocates, locks and initializes
++ * it.
++ */
++static int omap34xxcam_vbq_prepare(struct videobuf_queue *vbq,
++ struct videobuf_buffer *vb,
++ enum v4l2_field field)
++{
++ struct omap34xxcam_fh *fh = vbq->priv_data;
++ struct omap34xxcam_videodev *vdev = fh->vdev;
++ int err = 0;
++
++ /*
++ * Accessing pix here is okay since it's constant while
++ * streaming is on (and we only get called then).
++ */
++ if (vb->baddr) {
++ /* This is a userspace buffer. */
++ if (vdev->pix.sizeimage > vb->bsize)
++ /* The buffer isn't big enough. */
++ return -EINVAL;
++ } else {
++ if (vb->state != VIDEOBUF_NEEDS_INIT
++ && vdev->pix.sizeimage > vb->bsize)
++ /*
++ * We have a kernel bounce buffer that has
++ * already been allocated.
++ */
++ omap34xxcam_vbq_release(vbq, vb);
++ }
++
++ vb->size = vdev->pix.bytesperline * vdev->pix.height;
++ vb->width = vdev->pix.width;
++ vb->height = vdev->pix.height;
++ vb->field = field;
++
++ if (vb->state == VIDEOBUF_NEEDS_INIT) {
++ err = videobuf_iolock(vbq, vb, NULL);
++ if (!err) {
++ /* isp_addr will be stored locally inside isp code */
++ err = isp_vbq_prepare(vbq, vb, field);
++ }
++ }
++
++ if (!err)
++ vb->state = VIDEOBUF_PREPARED;
++ else
++ omap34xxcam_vbq_release(vbq, vb);
++
++ return err;
++}
++
++/**
++ * omap34xxcam_vbq_queue - V4L2 video ops buf_queue handler
++ * @vbq: ptr. to standard V4L2 video buffer queue structure
++ * @vb: ptr to standard V4L2 video buffer structure
++ *
++ * Maps the video buffer to sgdma and through the isp, sets
++ * the isp buffer done callback and sets the video buffer state
++ * to active.
++ */
++static void omap34xxcam_vbq_queue(struct videobuf_queue *vbq,
++ struct videobuf_buffer *vb)
++{
++ struct omap34xxcam_fh *fh = vbq->priv_data;
++
++ vb->state = VIDEOBUF_ACTIVE;
++
++ isp_buf_queue(vb, omap34xxcam_vbq_complete, (void *)fh);
++}
++
++static struct videobuf_queue_ops omap34xxcam_vbq_ops = {
++ .buf_setup = omap34xxcam_vbq_setup,
++ .buf_prepare = omap34xxcam_vbq_prepare,
++ .buf_queue = omap34xxcam_vbq_queue,
++ .buf_release = omap34xxcam_vbq_release,
++};
++
++/*
++ *
++ * IOCTL interface.
++ *
++ */
++
++/**
++ * vidioc_querycap - V4L2 query capabilities IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @cap: ptr to standard V4L2 capability structure
++ *
++ * Fill in the V4L2 capabliity structure for the camera device
++ */
++static int vidioc_querycap(struct file *file, void *fh,
++ struct v4l2_capability *cap)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++
++ strlcpy(cap->driver, CAM_SHORT_NAME, sizeof(cap->driver));
++ strlcpy(cap->card, vdev->vfd->name, sizeof(cap->card));
++ cap->version = OMAP34XXCAM_VERSION;
++ if (vdev->vdev_sensor != v4l2_int_device_dummy())
++ cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
++
++ return 0;
++}
++
++/**
++ * vidioc_enum_fmt_vid_cap - V4L2 enumerate format capabilities IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @f: ptr to standard V4L2 format description structure
++ *
++ * Fills in enumerate format capabilities information for sensor (if SOC
++ * sensor attached) or ISP (if raw sensor attached).
++ */
++static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,
++ struct v4l2_fmtdesc *f)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ if (vdev->vdev_sensor_config.sensor_isp)
++ rval = vidioc_int_enum_fmt_cap(vdev->vdev_sensor, f);
++ else
++ rval = isp_enum_fmt_cap(f);
++
++ return rval;
++}
++
++/**
++ * vidioc_g_fmt_vid_cap - V4L2 get format capabilities IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @f: ptr to standard V4L2 format structure
++ *
++ * Fills in format capabilities for sensor (if SOC sensor attached) or ISP
++ * (if raw sensor attached).
++ */
++static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
++ struct v4l2_format *f)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ f->fmt.pix = vdev->pix;
++ mutex_unlock(&vdev->mutex);
++
++ return 0;
++}
++
++static int try_pix_parm(struct omap34xxcam_videodev *vdev,
++ struct v4l2_pix_format *best_pix_in,
++ struct v4l2_pix_format *wanted_pix_out,
++ struct v4l2_fract *best_ival)
++{
++ int fps;
++ int fmtd_index;
++ int rval;
++ struct v4l2_pix_format best_pix_out;
++
++ if (best_ival->numerator == 0
++ || best_ival->denominator == 0)
++ *best_ival = vdev->vdev_sensor_config.ival_default;
++
++ fps = best_ival->denominator / best_ival->numerator;
++
++ best_ival->denominator = 0;
++ best_pix_out.height = INT_MAX >> 1;
++ best_pix_out.width = best_pix_out.height;
++
++ for (fmtd_index = 0; ; fmtd_index++) {
++ int size_index;
++ struct v4l2_fmtdesc fmtd;
++
++ fmtd.index = fmtd_index;
++ fmtd.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++ rval = vidioc_int_enum_fmt_cap(vdev->vdev_sensor, &fmtd);
++ if (rval)
++ break;
++ dev_info(&vdev->vfd->dev, "trying fmt %8.8x (%d)\n",
++ fmtd.pixelformat, fmtd_index);
++ /*
++ * Get supported resolutions.
++ */
++ for (size_index = 0; ; size_index++) {
++ struct v4l2_frmsizeenum frms;
++ struct v4l2_pix_format pix_tmp_in, pix_tmp_out;
++ int ival_index;
++
++ frms.index = size_index;
++ frms.pixel_format = fmtd.pixelformat;
++
++ rval = vidioc_int_enum_framesizes(vdev->vdev_sensor,
++ &frms);
++ if (rval)
++ break;
++
++ pix_tmp_in.pixelformat = frms.pixel_format;
++ pix_tmp_in.width = frms.discrete.width;
++ pix_tmp_in.height = frms.discrete.height;
++ pix_tmp_out = *wanted_pix_out;
++ /* Don't do upscaling. */
++ if (pix_tmp_out.width > pix_tmp_in.width)
++ pix_tmp_out.width = pix_tmp_in.width;
++ if (pix_tmp_out.height > pix_tmp_in.height)
++ pix_tmp_out.height = pix_tmp_in.height;
++ rval = isp_try_fmt_cap(&pix_tmp_in, &pix_tmp_out);
++ if (rval)
++ return rval;
++
++ dev_info(&vdev->vfd->dev, "this w %d\th %d\tfmt %8.8x\t"
++ "-> w %d\th %d\t fmt %8.8x"
++ "\twanted w %d\th %d\t fmt %8.8x\n",
++ pix_tmp_in.width, pix_tmp_in.height,
++ pix_tmp_in.pixelformat,
++ pix_tmp_out.width, pix_tmp_out.height,
++ pix_tmp_out.pixelformat,
++ wanted_pix_out->width, wanted_pix_out->height,
++ wanted_pix_out->pixelformat);
++
++#define IS_SMALLER_OR_EQUAL(pix1, pix2) \
++ ((pix1)->width + (pix1)->height \
++ < (pix2)->width + (pix2)->height)
++#define SIZE_DIFF(pix1, pix2) \
++ (abs((pix1)->width - (pix2)->width) \
++ + abs((pix1)->height - (pix2)->height))
++
++ /*
++ * Don't use modes that are farther from wanted size
++ * that what we already got.
++ */
++ if (SIZE_DIFF(&pix_tmp_out, wanted_pix_out)
++ > SIZE_DIFF(&best_pix_out, wanted_pix_out)) {
++ dev_info(&vdev->vfd->dev, "size diff bigger: "
++ "w %d\th %d\tw %d\th %d\n",
++ pix_tmp_out.width, pix_tmp_out.height,
++ best_pix_out.width,
++ best_pix_out.height);
++ continue;
++ }
++
++ /*
++ * There's an input mode that can provide output
++ * closer to wanted.
++ */
++ if (SIZE_DIFF(&pix_tmp_out, wanted_pix_out)
++ < SIZE_DIFF(&best_pix_out, wanted_pix_out)) {
++ /* Force renegotation of fps etc. */
++ best_ival->denominator = 0;
++ dev_info(&vdev->vfd->dev, "renegotiate: "
++ "w %d\th %d\tw %d\th %d\n",
++ pix_tmp_out.width, pix_tmp_out.height,
++ best_pix_out.width,
++ best_pix_out.height);
++ }
++
++ for (ival_index = 0; ; ival_index++) {
++ struct v4l2_frmivalenum frmi;
++
++ frmi.index = ival_index;
++ frmi.pixel_format = frms.pixel_format;
++ frmi.width = frms.discrete.width;
++ frmi.height = frms.discrete.height;
++ /* FIXME: try to fix standard... */
++ frmi.reserved[0] = 0xdeafbeef;
++
++ rval = vidioc_int_enum_frameintervals(
++ vdev->vdev_sensor, &frmi);
++ if (rval)
++ break;
++
++ dev_info(&vdev->vfd->dev, "fps %d\n",
++ frmi.discrete.denominator
++ / frmi.discrete.numerator);
++
++ if (best_ival->denominator == 0)
++ goto do_it_now;
++
++ /*
++ * We aim to use maximum resolution
++ * from the sensor, provided that the
++ * fps is at least as close as on the
++ * current mode.
++ */
++#define FPS_ABS_DIFF(fps, ival) abs(fps - (ival).denominator / (ival).numerator)
++
++ /* Select mode with closest fps. */
++ if (FPS_ABS_DIFF(fps, frmi.discrete)
++ < FPS_ABS_DIFF(fps, *best_ival)) {
++ dev_info(&vdev->vfd->dev, "closer fps: "
++ "fps %d\t fps %d\n",
++ FPS_ABS_DIFF(fps,
++ frmi.discrete),
++ FPS_ABS_DIFF(fps, *best_ival));
++ goto do_it_now;
++ }
++
++ /*
++ * Select bigger resolution if it's available
++ * at same fps.
++ */
++ if (frmi.width + frmi.height
++ > best_pix_in->width + best_pix_in->height
++ && FPS_ABS_DIFF(fps, frmi.discrete)
++ <= FPS_ABS_DIFF(fps, *best_ival)) {
++ dev_info(&vdev->vfd->dev, "bigger res, "
++ "same fps: "
++ "w %d\th %d\tw %d\th %d\n",
++ frmi.width, frmi.height,
++ best_pix_in->width,
++ best_pix_in->height);
++ goto do_it_now;
++ }
++
++ dev_info(&vdev->vfd->dev, "falling through\n");
++
++ continue;
++
++do_it_now:
++ *best_ival = frmi.discrete;
++ best_pix_out = pix_tmp_out;
++ best_pix_in->width = frmi.width;
++ best_pix_in->height = frmi.height;
++ best_pix_in->pixelformat = frmi.pixel_format;
++
++ dev_info(&vdev->vfd->dev,
++ "best_pix_in: w %d\th %d\tfmt %8.8x"
++ "\tival %d/%d\n",
++ best_pix_in->width,
++ best_pix_in->height,
++ best_pix_in->pixelformat,
++ best_ival->numerator,
++ best_ival->denominator);
++ }
++ }
++ }
++
++ if (best_ival->denominator == 0)
++ return -EINVAL;
++
++ *wanted_pix_out = best_pix_out;
++
++ dev_info(&vdev->vfd->dev, "w %d, h %d, fmt %8.8x -> w %d, h %d\n",
++ best_pix_in->width, best_pix_in->height,
++ best_pix_in->pixelformat,
++ best_pix_out.width, best_pix_out.height);
++
++ return isp_try_fmt_cap(best_pix_in, wanted_pix_out);
++}
++
++static int s_pix_parm(struct omap34xxcam_videodev *vdev,
++ struct v4l2_pix_format *best_pix,
++ struct v4l2_pix_format *pix,
++ struct v4l2_fract *best_ival)
++{
++ struct v4l2_streamparm a;
++ struct v4l2_format fmt;
++ int rval;
++
++ rval = try_pix_parm(vdev, best_pix, pix, best_ival);
++ if (rval)
++ return rval;
++
++ rval = isp_s_fmt_cap(best_pix, pix);
++ if (rval)
++ return rval;
++
++ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++ fmt.fmt.pix = *best_pix;
++ rval = vidioc_int_s_fmt_cap(vdev->vdev_sensor, &fmt);
++ if (rval)
++ return rval;
++
++ a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++ a.parm.capture.timeperframe = *best_ival;
++ rval = vidioc_int_s_parm(vdev->vdev_sensor, &a);
++
++ return rval;
++}
++
++/**
++ * vidioc_s_fmt_vid_cap - V4L2 set format capabilities IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @f: ptr to standard V4L2 format structure
++ *
++ * Attempts to set input format with the sensor driver (first) and then the
++ * ISP. Returns the return code from vidioc_g_fmt_vid_cap().
++ */
++static int vidioc_s_fmt_vid_cap(struct file *file, void *fh,
++ struct v4l2_format *f)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct v4l2_pix_format pix_tmp;
++ struct v4l2_fract timeperframe;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming) {
++ rval = -EBUSY;
++ goto out;
++ }
++
++ vdev->want_pix = f->fmt.pix;
++
++ timeperframe = vdev->want_timeperframe;
++
++ rval = s_pix_parm(vdev, &pix_tmp, &f->fmt.pix, &timeperframe);
++ if (!rval)
++ vdev->pix = f->fmt.pix;
++
++out:
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_try_fmt_vid_cap - V4L2 try format capabilities IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @f: ptr to standard V4L2 format structure
++ *
++ * Checks if the given format is supported by the sensor driver and
++ * by the ISP.
++ */
++static int vidioc_try_fmt_vid_cap(struct file *file, void *fh,
++ struct v4l2_format *f)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct v4l2_pix_format pix_tmp;
++ struct v4l2_fract timeperframe;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++
++ timeperframe = vdev->want_timeperframe;
++
++ rval = try_pix_parm(vdev, &pix_tmp, &f->fmt.pix, &timeperframe);
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_reqbufs - V4L2 request buffers IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @b: ptr to standard V4L2 request buffers structure
++ *
++ * Attempts to get a buffer from the buffer queue associated with the
++ * fh through the video buffer library API.
++ */
++static int vidioc_reqbufs(struct file *file, void *fh,
++ struct v4l2_requestbuffers *b)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming) {
++ mutex_unlock(&vdev->mutex);
++ return -EBUSY;
++ }
++
++ rval = videobuf_reqbufs(&ofh->vbq, b);
++
++ mutex_unlock(&vdev->mutex);
++
++ /*
++ * Either videobuf_reqbufs failed or the buffers are not
++ * memory-mapped (which would need special attention).
++ */
++ if (rval < 0 || b->memory != V4L2_MEMORY_MMAP)
++ goto out;
++
++out:
++ return rval;
++}
++
++/**
++ * vidioc_querybuf - V4L2 query buffer IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @b: ptr to standard V4L2 buffer structure
++ *
++ * Attempts to fill in the v4l2_buffer structure for the buffer queue
++ * associated with the fh through the video buffer library API.
++ */
++static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *b)
++{
++ struct omap34xxcam_fh *ofh = fh;
++
++ return videobuf_querybuf(&ofh->vbq, b);
++}
++
++/**
++ * vidioc_qbuf - V4L2 queue buffer IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @b: ptr to standard V4L2 buffer structure
++ *
++ * Attempts to queue the v4l2_buffer on the buffer queue
++ * associated with the fh through the video buffer library API.
++ */
++static int vidioc_qbuf(struct file *file, void *fh, struct v4l2_buffer *b)
++{
++ struct omap34xxcam_fh *ofh = fh;
++
++ return videobuf_qbuf(&ofh->vbq, b);
++}
++
++/**
++ * vidioc_dqbuf - V4L2 dequeue buffer IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @b: ptr to standard V4L2 buffer structure
++ *
++ * Attempts to dequeue the v4l2_buffer from the buffer queue
++ * associated with the fh through the video buffer library API. If the
++ * buffer is a user space buffer, then this function will also requeue it,
++ * as user does not expect to do this.
++ */
++static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *b)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ int rval;
++
++videobuf_dqbuf_again:
++ rval = videobuf_dqbuf(&ofh->vbq, b, file->f_flags & O_NONBLOCK);
++
++ /*
++ * This is a hack. We don't want to show -EIO to the user
++ * space. Requeue the buffer and try again if we're not doing
++ * this in non-blocking mode.
++ */
++ if (rval == -EIO) {
++ videobuf_qbuf(&ofh->vbq, b);
++ if (!(file->f_flags & O_NONBLOCK))
++ goto videobuf_dqbuf_again;
++ /*
++ * We don't have a videobuf_buffer now --- maybe next
++ * time...
++ */
++ rval = -EAGAIN;
++ }
++
++ return rval;
++}
++
++/**
++ * vidioc_streamon - V4L2 streamon IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @i: V4L2 buffer type
++ *
++ * Attempts to start streaming by enabling the sensor interface and turning
++ * on video buffer streaming through the video buffer library API. Upon
++ * success the function returns 0, otherwise an error code is returned.
++ */
++static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming) {
++ rval = -EBUSY;
++ goto out;
++ }
++
++ rval = omap34xxcam_slave_power_set(vdev, V4L2_POWER_ON,
++ OMAP34XXCAM_SLAVE_POWER_SENSOR_LENS);
++ if (rval) {
++ dev_dbg(&vdev->vfd->dev,
++ "omap34xxcam_slave_power_set failed\n");
++ goto out;
++ }
++
++ rval = videobuf_streamon(&ofh->vbq);
++ if (rval)
++ omap34xxcam_slave_power_set(
++ vdev, V4L2_POWER_OFF,
++ OMAP34XXCAM_SLAVE_POWER_SENSOR_LENS);
++ else
++ vdev->streaming = file;
++
++out:
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_streamoff - V4L2 streamoff IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @i: V4L2 buffer type
++ *
++ * Attempts to stop streaming by flushing all scheduled work, waiting on
++ * any queued buffers to complete and then stopping the ISP and turning
++ * off video buffer streaming through the video buffer library API. Upon
++ * success the function returns 0, otherwise an error code is returned.
++ */
++static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct videobuf_queue *q = &ofh->vbq;
++ int rval;
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->streaming == file)
++ isp_stop();
++
++ rval = videobuf_streamoff(q);
++ if (!rval) {
++ vdev->streaming = NULL;
++
++ omap34xxcam_slave_power_set(vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_SENSOR);
++ omap34xxcam_slave_power_suggest(vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_LENS);
++ }
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_enum_input - V4L2 enumerate input IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @inp: V4L2 input type information structure
++ *
++ * Fills in v4l2_input structure. Returns 0.
++ */
++static int vidioc_enum_input(struct file *file, void *fh,
++ struct v4l2_input *inp)
++{
++ if (inp->index > 0)
++ return -EINVAL;
++
++ strlcpy(inp->name, "camera", sizeof(inp->name));
++ inp->type = V4L2_INPUT_TYPE_CAMERA;
++
++ return 0;
++}
++
++/**
++ * vidioc_g_input - V4L2 get input IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @i: address to hold index of input supported
++ *
++ * Sets index to 0.
++ */
++static int vidioc_g_input(struct file *file, void *fh, unsigned int *i)
++{
++ *i = 0;
++
++ return 0;
++}
++
++/**
++ * vidioc_s_input - V4L2 set input IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @i: index of input selected
++ *
++ * 0 is only index supported.
++ */
++static int vidioc_s_input(struct file *file, void *fh, unsigned int i)
++{
++ if (i > 0)
++ return -EINVAL;
++
++ return 0;
++}
++
++/**
++ * vidioc_queryctrl - V4L2 query control IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 query control ioctl structure
++ *
++ * If the requested control is supported, returns the control information
++ * in the v4l2_queryctrl structure. Otherwise, returns -EINVAL if the
++ * control is not supported. If the sensor being used is a "smart sensor",
++ * this request is passed to the sensor driver, otherwise the ISP is
++ * queried and if it does not support the requested control, the request
++ * is forwarded to the "raw" sensor driver to see if it supports it.
++ */
++static int vidioc_queryctrl(struct file *file, void *fh,
++ struct v4l2_queryctrl *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct v4l2_queryctrl a_tmp;
++ int best_slave = -1;
++ u32 best_ctrl = (u32)-1;
++ int i;
++
++ if (vdev->vdev_sensor_config.sensor_isp)
++ return vidioc_int_queryctrl(vdev->vdev_sensor, a);
++
++ /* No next flags: try slaves directly. */
++ if (!(a->id & V4L2_CTRL_FLAG_NEXT_CTRL)) {
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ if (!vidioc_int_queryctrl(vdev->slave[i], a))
++ return 0;
++ }
++ return isp_queryctrl(a);
++ }
++
++ /* Find slave with smallest next control id. */
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ a_tmp = *a;
++
++ if (vidioc_int_queryctrl(vdev->slave[i], &a_tmp))
++ continue;
++
++ if (a_tmp.id < best_ctrl) {
++ best_slave = i;
++ best_ctrl = a_tmp.id;
++ }
++ }
++
++ a_tmp = *a;
++ if (!isp_queryctrl(&a_tmp)) {
++ if (a_tmp.id < best_ctrl) {
++ *a = a_tmp;
++
++ return 0;
++ }
++ }
++
++ if (best_slave == -1)
++ return -EINVAL;
++
++ a->id = best_ctrl;
++ return vidioc_int_queryctrl(vdev->slave[best_slave], a);
++}
++
++/**
++ * vidioc_querymenu - V4L2 query menu IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 query menu ioctl structure
++ *
++ * If the requested control is supported, returns the menu information
++ * in the v4l2_querymenu structure. Otherwise, returns -EINVAL if the
++ * control is not supported or is not a menu. If the sensor being used
++ * is a "smart sensor", this request is passed to the sensor driver,
++ * otherwise the ISP is queried and if it does not support the requested
++ * menu control, the request is forwarded to the "raw" sensor driver to
++ * see if it supports it.
++ */
++static int vidioc_querymenu(struct file *file, void *fh,
++ struct v4l2_querymenu *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int i;
++
++ if (vdev->vdev_sensor_config.sensor_isp)
++ return vidioc_int_querymenu(vdev->vdev_sensor, a);
++
++ /* Try slaves directly. */
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ if (!vidioc_int_querymenu(vdev->slave[i], a))
++ return 0;
++ }
++ return isp_querymenu(a);
++}
++
++static int vidioc_g_ext_ctrls(struct file *file, void *fh,
++ struct v4l2_ext_controls *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int i, ctrl_idx, rval = 0;
++
++ mutex_lock(&vdev->mutex);
++
++ for (ctrl_idx = 0; ctrl_idx < a->count; ctrl_idx++) {
++ struct v4l2_control ctrl;
++
++ ctrl.id = a->controls[ctrl_idx].id;
++
++ if (vdev->vdev_sensor_config.sensor_isp) {
++ rval = vidioc_int_g_ctrl(vdev->vdev_sensor, &ctrl);
++ } else {
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ rval = vidioc_int_g_ctrl(vdev->slave[i], &ctrl);
++ if (!rval)
++ break;
++ }
++ }
++
++ if (rval)
++ rval = isp_g_ctrl(&ctrl);
++
++ if (rval) {
++ a->error_idx = ctrl_idx;
++ break;
++ }
++
++ a->controls[ctrl_idx].value = ctrl.value;
++ }
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++static int vidioc_s_ext_ctrls(struct file *file, void *fh,
++ struct v4l2_ext_controls *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int i, ctrl_idx, rval = 0;
++
++ mutex_lock(&vdev->mutex);
++
++ for (ctrl_idx = 0; ctrl_idx < a->count; ctrl_idx++) {
++ struct v4l2_control ctrl;
++
++ ctrl.id = a->controls[ctrl_idx].id;
++ ctrl.value = a->controls[ctrl_idx].value;
++
++ if (vdev->vdev_sensor_config.sensor_isp) {
++ rval = vidioc_int_s_ctrl(vdev->vdev_sensor, &ctrl);
++ } else {
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ rval = vidioc_int_s_ctrl(vdev->slave[i], &ctrl);
++ if (!rval)
++ break;
++ }
++ }
++
++ if (rval)
++ rval = isp_s_ctrl(&ctrl);
++
++ if (rval) {
++ a->error_idx = ctrl_idx;
++ break;
++ }
++
++ a->controls[ctrl_idx].value = ctrl.value;
++ }
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_g_parm - V4L2 get parameters IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 stream parameters structure
++ *
++ * If request is for video capture buffer type, handles request by
++ * forwarding to sensor driver.
++ */
++static int vidioc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval;
++
++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ rval = vidioc_int_g_parm(vdev->vdev_sensor, a);
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_s_parm - V4L2 set parameters IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 stream parameters structure
++ *
++ * If request is for video capture buffer type, handles request by
++ * first getting current stream parameters from sensor, then forwarding
++ * request to set new parameters to sensor driver. It then attempts to
++ * enable the sensor interface with the new parameters. If this fails, it
++ * reverts back to the previous parameters.
++ */
++static int vidioc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct v4l2_pix_format pix_tmp_sensor, pix_tmp;
++ int rval;
++
++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
++ return -EINVAL;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming) {
++ rval = -EBUSY;
++ goto out;
++ }
++
++ vdev->want_timeperframe = a->parm.capture.timeperframe;
++
++ pix_tmp = vdev->want_pix;
++
++ rval = s_pix_parm(vdev, &pix_tmp_sensor, &pix_tmp,
++ &a->parm.capture.timeperframe);
++
++out:
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_cropcap - V4L2 crop capture IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 crop capture structure
++ *
++ * If using a "smart" sensor, just forwards request to the sensor driver,
++ * otherwise fills in the v4l2_cropcap values locally.
++ */
++static int vidioc_cropcap(struct file *file, void *fh, struct v4l2_cropcap *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ struct v4l2_cropcap *cropcap = a;
++ int rval;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++
++ rval = vidioc_int_cropcap(vdev->vdev_sensor, a);
++
++ if (rval && !vdev->vdev_sensor_config.sensor_isp) {
++ struct v4l2_format f;
++
++ /* cropcap failed, try to do this via g_fmt_cap */
++ rval = vidioc_int_g_fmt_cap(vdev->vdev_sensor, &f);
++ if (!rval) {
++ cropcap->bounds.top = 0;
++ cropcap->bounds.left = 0;
++ cropcap->bounds.width = f.fmt.pix.width;
++ cropcap->bounds.height = f.fmt.pix.height;
++ cropcap->defrect = cropcap->bounds;
++ cropcap->pixelaspect.numerator = 1;
++ cropcap->pixelaspect.denominator = 1;
++ }
++ }
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_g_crop - V4L2 get capture crop IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 crop structure
++ *
++ * If using a "smart" sensor, just forwards request to the sensor driver,
++ * otherwise calls the isp functions to fill in current crop values.
++ */
++static int vidioc_g_crop(struct file *file, void *fh, struct v4l2_crop *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval = 0;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->vdev_sensor_config.sensor_isp)
++ rval = vidioc_int_g_crop(vdev->vdev_sensor, a);
++ else
++ rval = isp_g_crop(a);
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++/**
++ * vidioc_s_crop - V4L2 set capture crop IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @a: standard V4L2 crop structure
++ *
++ * If using a "smart" sensor, just forwards request to the sensor driver,
++ * otherwise calls the isp functions to set the current crop values.
++ */
++static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *a)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval = 0;
++
++ if (vdev->vdev_sensor == v4l2_int_device_dummy())
++ return -EINVAL;
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->vdev_sensor_config.sensor_isp)
++ rval = vidioc_int_s_crop(vdev->vdev_sensor, a);
++ else
++ rval = isp_s_crop(a, &vdev->pix);
++
++ mutex_unlock(&vdev->mutex);
++
++ return rval;
++}
++
++static int vidioc_enum_framesizes(struct file *file, void *fh,
++ struct v4l2_frmsizeenum *frms)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ u32 pixel_format;
++ int rval;
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->vdev_sensor_config.sensor_isp) {
++ rval = vidioc_int_enum_framesizes(vdev->vdev_sensor, frms);
++ } else {
++ pixel_format = frms->pixel_format;
++ frms->pixel_format = -1; /* ISP does format conversion */
++ rval = vidioc_int_enum_framesizes(vdev->vdev_sensor, frms);
++ frms->pixel_format = pixel_format;
++ }
++
++ mutex_unlock(&vdev->mutex);
++ return rval;
++}
++
++static int vidioc_enum_frameintervals(struct file *file, void *fh,
++ struct v4l2_frmivalenum *frmi)
++{
++ struct omap34xxcam_fh *ofh = fh;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ u32 pixel_format;
++ int rval;
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->vdev_sensor_config.sensor_isp) {
++ rval = vidioc_int_enum_frameintervals(vdev->vdev_sensor, frmi);
++ } else {
++ pixel_format = frmi->pixel_format;
++ frmi->pixel_format = -1; /* ISP does format conversion */
++ rval = vidioc_int_enum_frameintervals(vdev->vdev_sensor, frmi);
++ frmi->pixel_format = pixel_format;
++ }
++
++ mutex_unlock(&vdev->mutex);
++ return rval;
++}
++
++/**
++ * vidioc_default - private IOCTL handler
++ * @file: ptr. to system file structure
++ * @fh: ptr to hold address of omap34xxcam_fh struct (per-filehandle data)
++ * @cmd: ioctl cmd value
++ * @arg: ioctl arg value
++ *
++ * If the sensor being used is a "smart sensor", this request is returned to
++ * caller with -EINVAL err code. Otherwise if the control id is the private
++ * VIDIOC_PRIVATE_ISP_AEWB_REQ to update the analog gain or exposure,
++ * then this request is forwared directly to the sensor to incorporate the
++ * feedback. The request is then passed on to the ISP private IOCTL handler,
++ * isp_handle_private()
++ */
++static long vidioc_default(struct file *file, void *fh, int cmd, void *arg)
++{
++ struct omap34xxcam_fh *ofh = file->private_data;
++ struct omap34xxcam_videodev *vdev = ofh->vdev;
++ int rval;
++
++ if (vdev->vdev_sensor_config.sensor_isp) {
++ rval = -EINVAL;
++ } else {
++ switch (cmd) {
++ case VIDIOC_PRIVATE_ISP_AEWB_REQ:
++ {
++ /* Need to update sensor first */
++ struct isph3a_aewb_data *data;
++ struct v4l2_control vc;
++
++ data = (struct isph3a_aewb_data *) arg;
++ if (data->update & SET_EXPOSURE) {
++ dev_info(&vdev->vfd->dev, "using "
++ "VIDIOC_PRIVATE_ISP_AEWB_REQ to set "
++ "exposure is deprecated!\n");
++ vc.id = V4L2_CID_EXPOSURE;
++ vc.value = data->shutter;
++ mutex_lock(&vdev->mutex);
++ rval = vidioc_int_s_ctrl(vdev->vdev_sensor,
++ &vc);
++ mutex_unlock(&vdev->mutex);
++ if (rval)
++ goto out;
++ }
++ if (data->update & SET_ANALOG_GAIN) {
++ dev_info(&vdev->vfd->dev, "using "
++ "VIDIOC_PRIVATE_ISP_AEWB_REQ to set "
++ "gain is deprecated!\n");
++ vc.id = V4L2_CID_GAIN;
++ vc.value = data->gain;
++ mutex_lock(&vdev->mutex);
++ rval = vidioc_int_s_ctrl(vdev->vdev_sensor,
++ &vc);
++ mutex_unlock(&vdev->mutex);
++ if (rval)
++ goto out;
++ }
++ }
++ break;
++ case VIDIOC_PRIVATE_ISP_AF_REQ: {
++ /* Need to update lens first */
++ struct isp_af_data *data;
++ struct v4l2_control vc;
++
++ if (!vdev->vdev_lens) {
++ rval = -EINVAL;
++ goto out;
++ }
++ data = (struct isp_af_data *) arg;
++ if (data->update & LENS_DESIRED_POSITION) {
++ dev_info(&vdev->vfd->dev, "using "
++ "VIDIOC_PRIVATE_ISP_AF_REQ to set "
++ "lens position is deprecated!\n");
++ vc.id = V4L2_CID_FOCUS_ABSOLUTE;
++ vc.value = data->desired_lens_direction;
++ mutex_lock(&vdev->mutex);
++ rval = vidioc_int_s_ctrl(vdev->vdev_lens, &vc);
++ mutex_unlock(&vdev->mutex);
++ if (rval)
++ goto out;
++ }
++ }
++ break;
++ }
++
++ mutex_lock(&vdev->mutex);
++ rval = isp_handle_private(cmd, arg);
++ mutex_unlock(&vdev->mutex);
++ }
++out:
++ return rval;
++}
++
++/*
++ *
++ * File operations.
++ *
++ */
++
++/**
++ * omap34xxcam_poll - file operations poll handler
++ * @file: ptr. to system file structure
++ * @wait: system poll table structure
++ *
++ */
++static unsigned int omap34xxcam_poll(struct file *file,
++ struct poll_table_struct *wait)
++{
++ struct omap34xxcam_fh *fh = file->private_data;
++ struct omap34xxcam_videodev *vdev = fh->vdev;
++ struct videobuf_buffer *vb;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming != file) {
++ mutex_unlock(&vdev->mutex);
++ return POLLERR;
++ }
++ mutex_unlock(&vdev->mutex);
++
++ mutex_lock(&fh->vbq.vb_lock);
++ if (list_empty(&fh->vbq.stream)) {
++ mutex_unlock(&fh->vbq.vb_lock);
++ return POLLERR;
++ }
++ vb = list_entry(fh->vbq.stream.next, struct videobuf_buffer, stream);
++ mutex_unlock(&fh->vbq.vb_lock);
++
++ poll_wait(file, &vb->done, wait);
++
++ if (vb->state == VIDEOBUF_DONE || vb->state == VIDEOBUF_ERROR)
++ return POLLIN | POLLRDNORM;
++
++ return 0;
++}
++
++/**
++ * omap34xxcam_mmap - file operations mmap handler
++ * @file: ptr. to system file structure
++ * @vma: system virt. mem. area structure
++ *
++ * Maps a virtual memory area via the video buffer API
++ */
++static int omap34xxcam_mmap(struct file *file, struct vm_area_struct *vma)
++{
++ struct omap34xxcam_fh *fh = file->private_data;
++ return videobuf_mmap_mapper(&fh->vbq, vma);
++}
++
++/**
++ * omap34xxcam_open - file operations open handler
++ * @inode: ptr. to system inode structure
++ * @file: ptr. to system file structure
++ *
++ * Allocates and initializes the per-filehandle data (omap34xxcam_fh),
++ * enables the sensor, opens/initializes the ISP interface and the
++ * video buffer queue. Note that this function will allow multiple
++ * file handles to be open simultaneously, however only the first
++ * handle opened will initialize the ISP. It is the application
++ * responsibility to only use one handle for streaming and the others
++ * for control only.
++ * This function returns 0 upon success and -ENODEV upon error.
++ */
++static int omap34xxcam_open(struct file *file)
++{
++ int rval = 0;
++ struct omap34xxcam_videodev *vdev = NULL;
++ struct omap34xxcam_device *cam = omap34xxcam;
++ struct omap34xxcam_fh *fh;
++ struct v4l2_format format;
++ int i;
++
++ for (i = 0; i < OMAP34XXCAM_VIDEODEVS; i++) {
++ if (cam->vdevs[i].vfd
++ && cam->vdevs[i].vfd->minor ==
++ iminor(file->f_dentry->d_inode)) {
++ vdev = &cam->vdevs[i];
++ break;
++ }
++ }
++
++ if (!vdev || !vdev->vfd)
++ return -ENODEV;
++
++ fh = kzalloc(sizeof(*fh), GFP_KERNEL);
++ if (fh == NULL)
++ return -ENOMEM;
++
++ mutex_lock(&vdev->mutex);
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ if (vdev->slave[i] != v4l2_int_device_dummy()
++ && !try_module_get(vdev->slave[i]->module)) {
++ mutex_unlock(&vdev->mutex);
++ dev_err(&vdev->vfd->dev, "can't try_module_get %s\n",
++ vdev->slave[i]->name);
++ rval = -ENODEV;
++ goto out_try_module_get;
++ }
++ }
++
++ if (atomic_inc_return(&vdev->users) == 1) {
++ rval = isp_get();
++ if (rval < 0) {
++ dev_err(&vdev->vfd->dev, "can't get isp\n");
++ goto out_isp_get;
++ }
++ if (omap34xxcam_slave_power_set(vdev, V4L2_POWER_ON,
++ OMAP34XXCAM_SLAVE_POWER_ALL)) {
++ dev_err(&vdev->vfd->dev, "can't power up slaves\n");
++ rval = -EBUSY;
++ goto out_slave_power_set_standby;
++ }
++ omap34xxcam_slave_power_set(
++ vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_SENSOR);
++ omap34xxcam_slave_power_suggest(
++ vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_LENS);
++ }
++
++ fh->vdev = vdev;
++
++ if (!vdev->pix.width
++ && vdev->vdev_sensor != v4l2_int_device_dummy()) {
++ memset(&format, 0, sizeof(format));
++ if (vidioc_int_g_fmt_cap(vdev->vdev_sensor, &format)) {
++ dev_err(&vdev->vfd->dev,
++ "can't get current pix from sensor!\n");
++ goto out_vidioc_int_g_fmt_cap;
++ }
++ if (!vdev->vdev_sensor_config.sensor_isp) {
++ struct v4l2_pix_format pix = format.fmt.pix;
++ if (isp_s_fmt_cap(&pix, &format.fmt.pix)) {
++ dev_err(&vdev->vfd->dev,
++ "isp doesn't like the sensor!\n");
++ goto out_isp_s_fmt_cap;
++ }
++ }
++ vdev->pix = format.fmt.pix;
++ }
++
++ mutex_unlock(&vdev->mutex);
++
++ file->private_data = fh;
++
++ spin_lock_init(&fh->vbq_lock);
++
++ videobuf_queue_sg_init(&fh->vbq, &omap34xxcam_vbq_ops, NULL,
++ &fh->vbq_lock, V4L2_BUF_TYPE_VIDEO_CAPTURE,
++ V4L2_FIELD_NONE,
++ sizeof(struct videobuf_buffer), fh);
++
++ return 0;
++
++out_isp_s_fmt_cap:
++out_vidioc_int_g_fmt_cap:
++ omap34xxcam_slave_power_set(vdev, V4L2_POWER_OFF,
++ OMAP34XXCAM_SLAVE_POWER_ALL);
++out_slave_power_set_standby:
++ isp_put();
++
++out_isp_get:
++ atomic_dec(&vdev->users);
++ mutex_unlock(&vdev->mutex);
++
++out_try_module_get:
++ for (i--; i >= 0; i--)
++ if (vdev->slave[i] != v4l2_int_device_dummy())
++ module_put(vdev->slave[i]->module);
++
++ kfree(fh);
++
++ return rval;
++}
++
++/**
++ * omap34xxcam_release - file operations release handler
++ * @inode: ptr. to system inode structure
++ * @file: ptr. to system file structure
++ *
++ * Complement of omap34xxcam_open. This function will flush any scheduled
++ * work, disable the sensor, close the ISP interface, stop the
++ * video buffer queue from streaming and free the per-filehandle data
++ * (omap34xxcam_fh). Note that because multiple open file handles
++ * are allowed, this function will only close the ISP and disable the
++ * sensor when the last open file handle (by count) is closed.
++ * This function returns 0.
++ */
++static int omap34xxcam_release(struct file *file)
++{
++ struct omap34xxcam_fh *fh = file->private_data;
++ struct omap34xxcam_videodev *vdev = fh->vdev;
++ int i;
++
++ mutex_lock(&vdev->mutex);
++ if (vdev->streaming == file) {
++ isp_stop();
++ videobuf_streamoff(&fh->vbq);
++ omap34xxcam_slave_power_set(
++ vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_SENSOR);
++ omap34xxcam_slave_power_suggest(
++ vdev, V4L2_POWER_STANDBY,
++ OMAP34XXCAM_SLAVE_POWER_LENS);
++ vdev->streaming = NULL;
++ }
++
++ if (atomic_dec_return(&vdev->users) == 0) {
++ omap34xxcam_slave_power_set(vdev, V4L2_POWER_OFF,
++ OMAP34XXCAM_SLAVE_POWER_ALL);
++ isp_put();
++ }
++ mutex_unlock(&vdev->mutex);
++
++ file->private_data = NULL;
++
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++)
++ if (vdev->slave[i] != v4l2_int_device_dummy())
++ module_put(vdev->slave[i]->module);
++
++ kfree(fh);
++
++ return 0;
++}
++
++static struct v4l2_file_operations omap34xxcam_fops = {
++ .owner = THIS_MODULE,
++ .unlocked_ioctl = video_ioctl2,
++ .poll = omap34xxcam_poll,
++ .mmap = omap34xxcam_mmap,
++ .open = omap34xxcam_open,
++ .release = omap34xxcam_release,
++};
++
++static void omap34xxcam_vfd_name_update(struct omap34xxcam_videodev *vdev)
++{
++ struct video_device *vfd = vdev->vfd;
++ int i;
++
++ strlcpy(vfd->name, CAM_SHORT_NAME, sizeof(vfd->name));
++ for (i = 0; i <= OMAP34XXCAM_SLAVE_FLASH; i++) {
++ strlcat(vfd->name, "/", sizeof(vfd->name));
++ if (vdev->slave[i] == v4l2_int_device_dummy())
++ continue;
++ strlcat(vfd->name, vdev->slave[i]->name, sizeof(vfd->name));
++ }
++ dev_info(&vdev->vfd->dev, "video%d is now %s\n", vfd->num, vfd->name);
++}
++
++/**
++ * omap34xxcam_device_unregister - V4L2 detach handler
++ * @s: ptr. to standard V4L2 device information structure
++ *
++ * Detach sensor and unregister and release the video device.
++ */
++static void omap34xxcam_device_unregister(struct v4l2_int_device *s)
++{
++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
++ struct omap34xxcam_hw_config hwc;
++
++ BUG_ON(vidioc_int_g_priv(s, &hwc) < 0);
++
++ mutex_lock(&vdev->mutex);
++
++ if (vdev->slave[hwc.dev_type] != v4l2_int_device_dummy()) {
++ vdev->slave[hwc.dev_type] = v4l2_int_device_dummy();
++ vdev->slaves--;
++ omap34xxcam_vfd_name_update(vdev);
++ }
++
++ if (vdev->slaves == 0 && vdev->vfd) {
++ if (vdev->vfd->minor == -1) {
++ /*
++ * The device was never registered, so release the
++ * video_device struct directly.
++ */
++ video_device_release(vdev->vfd);
++ } else {
++ /*
++ * The unregister function will release the
++ * video_device struct as well as
++ * unregistering it.
++ */
++ video_unregister_device(vdev->vfd);
++ }
++ vdev->vfd = NULL;
++ }
++
++ mutex_unlock(&vdev->mutex);
++}
++
++static const struct v4l2_ioctl_ops omap34xxcam_ioctl_ops = {
++ .vidioc_querycap = vidioc_querycap,
++ .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
++ .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
++ .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
++ .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
++ .vidioc_reqbufs = vidioc_reqbufs,
++ .vidioc_querybuf = vidioc_querybuf,
++ .vidioc_qbuf = vidioc_qbuf,
++ .vidioc_dqbuf = vidioc_dqbuf,
++ .vidioc_streamon = vidioc_streamon,
++ .vidioc_streamoff = vidioc_streamoff,
++ .vidioc_enum_input = vidioc_enum_input,
++ .vidioc_g_input = vidioc_g_input,
++ .vidioc_s_input = vidioc_s_input,
++ .vidioc_queryctrl = vidioc_queryctrl,
++ .vidioc_querymenu = vidioc_querymenu,
++ .vidioc_g_ext_ctrls = vidioc_g_ext_ctrls,
++ .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls,
++ .vidioc_g_parm = vidioc_g_parm,
++ .vidioc_s_parm = vidioc_s_parm,
++ .vidioc_cropcap = vidioc_cropcap,
++ .vidioc_g_crop = vidioc_g_crop,
++ .vidioc_s_crop = vidioc_s_crop,
++ .vidioc_enum_framesizes = vidioc_enum_framesizes,
++ .vidioc_enum_frameintervals = vidioc_enum_frameintervals,
++ .vidioc_default = vidioc_default,
++};
++
++/**
++ * omap34xxcam_device_register - V4L2 attach handler
++ * @s: ptr. to standard V4L2 device information structure
++ *
++ * Allocates and initializes the V4L2 video_device structure, initializes
++ * the sensor, and finally
++ registers the device with V4L2 based on the
++ * video_device structure.
++ *
++ * Returns 0 on success, otherwise an appropriate error code on
++ * failure.
++ */
++static int omap34xxcam_device_register(struct v4l2_int_device *s)
++{
++ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
++ struct omap34xxcam_hw_config hwc;
++ int rval;
++
++ /* We need to check rval just once. The place is here. */
++ if (vidioc_int_g_priv(s, &hwc))
++ return -ENODEV;
++
++ if (vdev->index != hwc.dev_index)
++ return -ENODEV;
++
++ if (hwc.dev_type < 0 || hwc.dev_type > OMAP34XXCAM_SLAVE_FLASH)
++ return -EINVAL;
++
++ if (vdev->slave[hwc.dev_type] != v4l2_int_device_dummy())
++ return -EBUSY;
++
++ mutex_lock(&vdev->mutex);
++ if (atomic_read(&vdev->users)) {
++ printk(KERN_ERR "%s: we're open (%d), can't register\n",
++ __func__, atomic_read(&vdev->users));
++ mutex_unlock(&vdev->mutex);
++ return -EBUSY;
++ }
++
++ vdev->slaves++;
++ vdev->slave[hwc.dev_type] = s;
++ vdev->slave_config[hwc.dev_type] = hwc;
++
++ if (hwc.dev_type == OMAP34XXCAM_SLAVE_SENSOR) {
++ rval = isp_get();
++ if (rval < 0) {
++ printk(KERN_ERR "%s: can't get ISP, "
++ "sensor init failed\n", __func__);
++ goto err;
++ }
++ }
++ rval = omap34xxcam_slave_power_set(vdev, V4L2_POWER_ON,
++ 1 << hwc.dev_type);
++ if (rval)
++ goto err_omap34xxcam_slave_power_set;
++ if (hwc.dev_type == OMAP34XXCAM_SLAVE_SENSOR) {
++ struct v4l2_format format;
++
++ format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++ rval = vidioc_int_g_fmt_cap(vdev->vdev_sensor, &format);
++ if (rval)
++ rval = -EBUSY;
++
++ vdev->want_pix = format.fmt.pix;
++ }
++ omap34xxcam_slave_power_set(vdev, V4L2_POWER_OFF, 1 << hwc.dev_type);
++ if (hwc.dev_type == OMAP34XXCAM_SLAVE_SENSOR)
++ isp_put();
++
++ if (rval)
++ goto err;
++
++ /* Are we the first slave? */
++ if (vdev->slaves == 1) {
++ /* initialize the video_device struct */
++ vdev->vfd = video_device_alloc();
++ if (!vdev->vfd) {
++ printk(KERN_ERR "%s: could not allocate "
++ "video device struct\n", __func__);
++ rval = -ENOMEM;
++ goto err;
++ }
++ vdev->vfd->release = video_device_release;
++ vdev->vfd->minor = -1;
++ vdev->vfd->fops = &omap34xxcam_fops;
++ vdev->vfd->ioctl_ops = &omap34xxcam_ioctl_ops;
++ video_set_drvdata(vdev->vfd, vdev);
++
++ if (video_register_device(vdev->vfd, VFL_TYPE_GRABBER,
++ hwc.dev_minor) < 0) {
++ printk(KERN_ERR "%s: could not register V4L device\n",
++ __func__);
++ vdev->vfd->minor = -1;
++ rval = -EBUSY;
++ goto err;
++ }
++ }
++
++ omap34xxcam_vfd_name_update(vdev);
++
++ mutex_unlock(&vdev->mutex);
++
++ return 0;
++
++err_omap34xxcam_slave_power_set:
++ if (hwc.dev_type == OMAP34XXCAM_SLAVE_SENSOR)
++ isp_put();
++
++err:
++ if (s == vdev->slave[hwc.dev_type]) {
++ vdev->slave[hwc.dev_type] = v4l2_int_device_dummy();
++ vdev->slaves--;
++ }
++
++ mutex_unlock(&vdev->mutex);
++ omap34xxcam_device_unregister(s);
++
++ return rval;
++}
++
++static struct v4l2_int_master omap34xxcam_master = {
++ .attach = omap34xxcam_device_register,
++ .detach = omap34xxcam_device_unregister,
++};
++
++/*
++ *
++ * Module initialisation and deinitialisation
++ *
++ */
++
++static void omap34xxcam_exit(void)
++{
++ struct omap34xxcam_device *cam = omap34xxcam;
++ int i;
++
++ if (!cam)
++ return;
++
++ for (i = 0; i < OMAP34XXCAM_VIDEODEVS; i++) {
++ if (cam->vdevs[i].cam == NULL)
++ continue;
++
++ v4l2_int_device_unregister(&cam->vdevs[i].master);
++ cam->vdevs[i].cam = NULL;
++ }
++
++ omap34xxcam = NULL;
++
++ kfree(cam);
++}
++
++static int __init omap34xxcam_init(void)
++{
++ struct omap34xxcam_device *cam;
++ int i;
++
++ cam = kzalloc(sizeof(*cam), GFP_KERNEL);
++ if (!cam) {
++ printk(KERN_ERR "%s: could not allocate memory\n", __func__);
++ return -ENOMEM;
++ }
++
++ omap34xxcam = cam;
++
++ for (i = 0; i < OMAP34XXCAM_VIDEODEVS; i++) {
++ struct omap34xxcam_videodev *vdev = &cam->vdevs[i];
++ struct v4l2_int_device *m = &vdev->master;
++
++ m->module = THIS_MODULE;
++ strlcpy(m->name, CAM_NAME, sizeof(m->name));
++ m->type = v4l2_int_type_master;
++ m->u.master = &omap34xxcam_master;
++ m->priv = vdev;
++
++ mutex_init(&vdev->mutex);
++ vdev->index = i;
++ vdev->cam = cam;
++ vdev->vdev_sensor =
++ vdev->vdev_lens =
++ vdev->vdev_flash = v4l2_int_device_dummy();
++#ifdef OMAP34XXCAM_POWEROFF_DELAY
++ setup_timer(&vdev->poweroff_timer,
++ omap34xxcam_slave_power_timer, (unsigned long)vdev);
++ INIT_WORK(&vdev->poweroff_work, omap34xxcam_slave_power_work);
++#endif /* OMAP34XXCAM_POWEROFF_DELAY */
++
++ if (v4l2_int_device_register(m))
++ goto err;
++ }
++
++ return 0;
++
++err:
++ omap34xxcam_exit();
++ return -ENODEV;
++}
++
++MODULE_AUTHOR("Sakari Ailus <sakari.ailus@nokia.com>");
++MODULE_DESCRIPTION("OMAP34xx Video for Linux camera driver");
++MODULE_LICENSE("GPL");
++
++late_initcall(omap34xxcam_init);
++module_exit(omap34xxcam_exit);
+diff --git a/drivers/media/video/omap34xxcam.h b/drivers/media/video/omap34xxcam.h
+new file mode 100644
+index 0000000..9859d15
+--- /dev/null
++++ b/drivers/media/video/omap34xxcam.h
+@@ -0,0 +1,207 @@
++/*
++ * omap34xxcam.h
++ *
++ * Copyright (C) 2006--2009 Nokia Corporation
++ * Copyright (C) 2007--2009 Texas Instruments
++ *
++ * Contact: Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ *
++ * Originally based on the OMAP 2 camera driver.
++ *
++ * Written by Sakari Ailus <sakari.ailus@nokia.com>
++ * Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Mohit Jalori
++ * Sameer Venkatraman
++ * Leonides Martinez
++ *
++ * 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.
++ *
++ * 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., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ *
++ */
++
++#ifndef OMAP34XXCAM_H
++#define OMAP34XXCAM_H
++
++#include <media/v4l2-int-device.h>
++#include "isp/isp.h"
++
++#define CAM_NAME "omap34xxcam"
++#define CAM_SHORT_NAME "omap3"
++
++#define OMAP_ISP_AF (1 << 4)
++#define OMAP_ISP_HIST (1 << 5)
++#define OMAP34XXCAM_XCLK_NONE -1
++#define OMAP34XXCAM_XCLK_A 0
++#define OMAP34XXCAM_XCLK_B 1
++
++#define OMAP34XXCAM_SLAVE_SENSOR 0
++#define OMAP34XXCAM_SLAVE_LENS 1
++#define OMAP34XXCAM_SLAVE_FLASH 2 /* This is the last slave! */
++
++/* mask for omap34xxcam_slave_power_set */
++#define OMAP34XXCAM_SLAVE_POWER_SENSOR (1 << OMAP34XXCAM_SLAVE_SENSOR)
++#define OMAP34XXCAM_SLAVE_POWER_LENS (1 << OMAP34XXCAM_SLAVE_LENS)
++#define OMAP34XXCAM_SLAVE_POWER_SENSOR_LENS \
++ (OMAP34XXCAM_SLAVE_POWER_SENSOR | OMAP34XXCAM_SLAVE_POWER_LENS)
++#define OMAP34XXCAM_SLAVE_POWER_FLASH (1 << OMAP34XXCAM_SLAVE_FLASH)
++#define OMAP34XXCAM_SLAVE_POWER_ALL -1
++
++#define OMAP34XXCAM_VIDEODEVS 4
++
++/* #define OMAP34XXCAM_POWEROFF_DELAY (2 * HZ) */
++
++struct omap34xxcam_device;
++struct omap34xxcam_videodev;
++
++struct omap34xxcam_sensor_config {
++ int xclk;
++ int sensor_isp;
++ u32 capture_mem;
++ struct v4l2_fract ival_default;
++};
++
++struct omap34xxcam_lens_config {
++};
++
++struct omap34xxcam_flash_config {
++};
++
++/**
++ * struct omap34xxcam_hw_config - struct for vidioc_int_g_priv ioctl
++ * @xclk: OMAP34XXCAM_XCLK_A or OMAP34XXCAM_XCLK_B
++ * @sensor_isp: Is sensor smart/SOC or raw
++ * @s_pix_sparm: Access function to set pix and sparm.
++ * Pix will override sparm
++ */
++struct omap34xxcam_hw_config {
++ int dev_index; /* Index in omap34xxcam_sensors */
++ int dev_minor; /* Video device minor number */
++ int dev_type; /* OMAP34XXCAM_SLAVE_* */
++ union {
++ struct omap34xxcam_sensor_config sensor;
++ struct omap34xxcam_lens_config lens;
++ struct omap34xxcam_flash_config flash;
++ } u;
++};
++
++/**
++ * struct omap34xxcam_videodev - per /dev/video* structure
++ * @mutex: serialises access to this structure
++ * @cam: pointer to cam hw structure
++ * @master: we are v4l2_int_device master
++ * @sensor: sensor device
++ * @lens: lens device
++ * @flash: flash device
++ * @slaves: how many slaves we have at the moment
++ * @vfd: our video device
++ * @capture_mem: maximum kernel-allocated capture memory
++ * @if_u: sensor interface stuff
++ * @index: index of this structure in cam->vdevs
++ * @users: how many users we have
++ * @power_state: Current power state
++ * @power_state_wish: New power state when poweroff_timer expires
++ * @power_state_mask: Bitmask of devices to set the new power state
++ * @poweroff_timer: Timer for dispatching poweroff_work
++ * @poweroff_work: Work for slave power state change
++ * @sensor_config: ISP-speicific sensor configuration
++ * @lens_config: ISP-speicific lens configuration
++ * @flash_config: ISP-speicific flash configuration
++ * @want_timeperframe: Desired timeperframe
++ * @want_pix: Desired pix
++ * @pix: Current pix
++ * @streaming: streaming file handle, if streaming is enabled
++ */
++struct omap34xxcam_videodev {
++ struct mutex mutex; /* serialises access to this structure */
++
++ struct omap34xxcam_device *cam;
++ struct v4l2_int_device master;
++
++#define vdev_sensor slave[OMAP34XXCAM_SLAVE_SENSOR]
++#define vdev_lens slave[OMAP34XXCAM_SLAVE_LENS]
++#define vdev_flash slave[OMAP34XXCAM_SLAVE_FLASH]
++ struct v4l2_int_device *slave[OMAP34XXCAM_SLAVE_FLASH + 1];
++
++ /* number of slaves attached */
++ int slaves;
++
++ /*** video device parameters ***/
++ struct video_device *vfd;
++ int capture_mem;
++
++ /*** general driver state information ***/
++ int index;
++ atomic_t users;
++ enum v4l2_power power_state[OMAP34XXCAM_SLAVE_FLASH + 1];
++#ifdef OMAP34XXCAM_POWEROFF_DELAY
++ enum v4l2_power power_state_wish;
++ int power_state_mask;
++ struct timer_list poweroff_timer;
++ struct work_struct poweroff_work;
++#endif /* OMAP34XXCAM_POWEROFF_DELAY */
++
++#define vdev_sensor_config slave_config[OMAP34XXCAM_SLAVE_SENSOR].u.sensor
++#define vdev_lens_config slave_config[OMAP34XXCAM_SLAVE_LENS].u.lens
++#define vdev_flash_config slave_config[OMAP34XXCAM_SLAVE_FLASH].u.flash
++ struct omap34xxcam_hw_config slave_config[OMAP34XXCAM_SLAVE_FLASH + 1];
++
++ /*** capture data ***/
++ struct file *streaming;
++ struct v4l2_fract want_timeperframe;
++ struct v4l2_pix_format want_pix;
++ spinlock_t pix_lock;
++ struct v4l2_pix_format pix;
++};
++
++/**
++ * struct omap34xxcam_device - per-device data structure
++ * @mutex: mutex serialises access to this structure
++ * @sgdma_in_queue: Number or sgdma requests in scatter-gather queue,
++ * protected by the lock above.
++ * @sgdma: ISP sgdma subsystem information structure
++ * @dma_notify: DMA notify flag
++ * @dev: device structure
++ * @vdevs: /dev/video specific structures
++ * @fck: camera module fck clock information
++ * @ick: camera module ick clock information
++ */
++struct omap34xxcam_device {
++ struct mutex mutex; /* serialises access to this structure */
++
++ /*** interfaces and device ***/
++ struct omap34xxcam_videodev vdevs[OMAP34XXCAM_VIDEODEVS];
++
++ /*** camera module clocks ***/
++ struct clk *fck;
++ struct clk *ick;
++ bool sensor_if_enabled;
++};
++
++/**
++ * struct omap34xxcam_fh - per-filehandle data structure
++ * @vbq_lock: spinlock for the videobuf queue
++ * @vbq: V4L2 video buffer queue structure
++ * @field_count: field counter for videobuf_buffer
++ * @vdev: our /dev/video specific structure
++ */
++struct omap34xxcam_fh {
++ spinlock_t vbq_lock; /* spinlock for the videobuf queue */
++ struct videobuf_queue vbq;
++ atomic_t field_count;
++ struct omap34xxcam_videodev *vdev;
++};
++
++#endif /* ifndef OMAP34XXCAM_H */
+--
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch
index f796ce8346..3390599292 100644
--- a/recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch
@@ -1,99 +1,97 @@
-From 3041daa54b49bcb6ab444c7b9e14bc6a1ade6236 Mon Sep 17 00:00:00 2001
-From: Vaibhav Hiremath <hvaibhav@ti.com>
-Date: Fri, 13 Feb 2009 14:44:20 +0530
-Subject: [PATCH 1/2] Resizer and Previewer driver added to commit
+From 38f3cd5564a466e5251fc2ff47e0504148922304 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 17:18:56 +0530
+Subject: [PATCH 23/26] OMAP-Resizer: Basic Resizer refreshed with latest gitorious tree
-The Resizer and Previewer driver added to the commit
-from the patch submitted by Sergio on 12 Dec 2008.
+This is same resizer driver patch posted by Sergio onto
+mailing list quite a some time back. This commit refreshes
+the same patch on top of latest gitorious.org tree.
-The new WTBU code base and Nokia fixes package doesn't contain
-standalone resizer driver support.
+List of New/Modified files:
+ modified: drivers/media/video/Kconfig
+ modified: drivers/media/video/isp/Makefile
+ modified: drivers/media/video/isp/isp.c
+ modified: drivers/media/video/isp/ispreg.h
+ new file: drivers/media/video/isp/omap_resizer.c
+ new file: include/linux/omap_resizer.h
-Following major changes done -
-
- - Added stand-alone resizer driver support
- in isp.c file.
- - Seperate Kconfig file created
- - hardware access of resizer module fixed as per new
- isp.c
-
-Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
+TODO:
+ - Resizer driver needs to be independent from camera and ISP
+ - Custom patches implemented ontop of PSP1.0.2 release
+ to fix some V4L2-buf layer issues.
+ -
---
- drivers/media/video/Kconfig | 5 +-
- drivers/media/video/isp/Kconfig | 16 +
- drivers/media/video/isp/Makefile | 7 +
- drivers/media/video/isp/isp.c | 12 +
- drivers/media/video/isp/ispmmu.c | 1 +
- drivers/media/video/isp/omap_previewer.c | 825 +++++++++++++++
- drivers/media/video/isp/omap_previewer.h | 162 +++
- drivers/media/video/isp/omap_resizer.c | 1634 ++++++++++++++++++++++++++++++
- include/linux/omap_resizer.h | 136 +++
- 9 files changed, 2794 insertions(+), 4 deletions(-)
- create mode 100644 drivers/media/video/isp/Kconfig
- create mode 100644 drivers/media/video/isp/omap_previewer.c
- create mode 100644 drivers/media/video/isp/omap_previewer.h
+ drivers/media/video/Kconfig | 7 +
+ drivers/media/video/isp/Makefile | 4 +
+ drivers/media/video/isp/isp.c | 15 +
+ drivers/media/video/isp/omap_resizer.c | 1634 ++++++++++++++++++++++++++++++++
+ include/linux/omap_resizer.h | 136 +++
+ 5 files changed, 1796 insertions(+), 0 deletions(-)
create mode 100644 drivers/media/video/isp/omap_resizer.c
create mode 100644 include/linux/omap_resizer.h
-diff --git a/drivers/media/video/isp/Kconfig b/drivers/media/video/isp/Kconfig
-new file mode 100644
-index 0000000..acda63b
---- /dev/null
-+++ b/drivers/media/video/isp/Kconfig
-@@ -0,0 +1,16 @@
-+# Kconfig for OMAP3 ISP driver
-+
-+config VIDEO_OMAP3_ISP
-+ tristate
+diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
+index 3cdb5a4..d2b4ae1 100644
+--- a/drivers/media/video/Kconfig
++++ b/drivers/media/video/Kconfig
+@@ -720,6 +720,13 @@ config VIDEO_OMAP3
+ ---help---
+ Driver for an OMAP 3 camera controller.
+
++config VIDEO_OMAP34XX_ISP_RESIZER
++ tristate "OMAP ISP Resizer"
++ depends on VIDEO_V4L2 && ARCH_OMAP34XX
+ select VIDEOBUF_GEN
+ select VIDEOBUF_DMA_SG
++ select OMAP_IOMMU
+
-+config VIDEO_OMAP34XX_ISP_PREVIEWER
-+ tristate "OMAP ISP Previewer"
-+ depends on !ARCH_OMAP3410
-+ select VIDEO_OMAP3_ISP
-+
-+config VIDEO_OMAP34XX_ISP_RESIZER
-+ tristate "OMAP ISP Resizer"
-+ depends on !ARCH_OMAP3410
-+ select VIDEO_OMAP3_ISP
+ config SOC_CAMERA
+ tristate "SoC camera support"
+ depends on VIDEO_V4L2 && HAS_DMA
diff --git a/drivers/media/video/isp/Makefile b/drivers/media/video/isp/Makefile
-index 0f9301c..ed10a51 100644
+index f14d617..d171fb9 100644
--- a/drivers/media/video/isp/Makefile
+++ b/drivers/media/video/isp/Makefile
-@@ -7,6 +7,13 @@ else
+@@ -7,6 +7,10 @@ else
isp-mod-objs += \
isp.o ispccdc.o ispmmu.o \
isppreview.o ispresizer.o isph3a.o isphist.o isp_af.o ispcsi2.o
+
-+obj-$(CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER) += \
-+ omap_previewer.o
-+
+obj-$(CONFIG_VIDEO_OMAP34XX_ISP_RESIZER) += \
+ omap_resizer.o
+
endif
- obj-$(CONFIG_VIDEO_OMAP3_ISP) += isp-mod.o
+ obj-$(CONFIG_VIDEO_OMAP3) += isp-mod.o
diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c
-index 6034a56..09a1792 100644
+index 54c839b..f1f92b4 100644
--- a/drivers/media/video/isp/isp.c
+++ b/drivers/media/video/isp/isp.c
-@@ -521,6 +521,13 @@ int isp_set_callback(enum isp_callback_type type, isp_callback_t callback,
- OMAP3_ISP_IOMEM_MAIN,
- ISP_IRQ0ENABLE);
+@@ -505,6 +505,12 @@ int isp_set_callback(enum isp_callback_type type, isp_callback_t callback,
+ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
+ IRQ0ENABLE_PRV_DONE_IRQ);
break;
+ case CBK_RESZ_DONE:
-+ isp_reg_writel(IRQ0ENABLE_RSZ_DONE_IRQ, OMAP3_ISP_IOMEM_MAIN,
-+ ISP_IRQ0STATUS);
-+ isp_reg_writel(isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE) |
-+ IRQ0ENABLE_RSZ_DONE_IRQ, OMAP3_ISP_IOMEM_MAIN,
-+ ISP_IRQ0ENABLE);
++ isp_reg_writel(IRQ0ENABLE_RSZ_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_RSZ_DONE_IRQ);
+ break;
default:
break;
}
-@@ -996,6 +1003,11 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_isp)
+@@ -556,6 +562,10 @@ int isp_unset_callback(enum isp_callback_type type)
+ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
+ ~IRQ0ENABLE_PRV_DONE_IRQ);
+ break;
++ case CBK_RESZ_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_RSZ_DONE_IRQ);
++ break;
+ default:
+ break;
+ }
+@@ -938,6 +948,11 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_isp)
if (!ispresizer_busy())
ispresizer_config_shadow_registers();
isp_buf_process(bufs);
@@ -105,1017 +103,6 @@ index 6034a56..09a1792 100644
}
}
-diff --git a/drivers/media/video/isp/ispmmu.c b/drivers/media/video/isp/ispmmu.c
-index 076aea1..b943d5b 100644
---- a/drivers/media/video/isp/ispmmu.c
-+++ b/drivers/media/video/isp/ispmmu.c
-@@ -289,6 +289,7 @@ int ispmmu_get_mapeable_space(void)
- return (L2P_TABLE_NR - no_of_l2p_alloted) * ISPMMU_TTB_ENTRIES_NR *
- ISPMMU_L2D_ENTRIES_NR;
- }
-+EXPORT_SYMBOL_GPL(ispmmu_get_mapeable_space);
-
- /**
- * ispmmu_map - Map a physically contiguous buffer to ISP space.
-diff --git a/drivers/media/video/isp/omap_previewer.c b/drivers/media/video/isp/omap_previewer.c
-new file mode 100644
-index 0000000..634a056
---- /dev/null
-+++ b/drivers/media/video/isp/omap_previewer.c
-@@ -0,0 +1,825 @@
-+/*
-+ * drivers/media/video/isp/omap_previewer.c
-+ *
-+ * Wrapper for Preview module in TI's OMAP3430 ISP
-+ *
-+ * Copyright (C) 2008 Texas Instruments, Inc.
-+ *
-+ * Contributors:
-+ * Leonides Martinez <leonides.martinez@ti.com>
-+ * Sergio Aguirre <saaguirre@ti.com>
-+ *
-+ * This package 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.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#include <linux/mutex.h>
-+#include <linux/cdev.h>
-+#include <linux/device.h>
-+#include <linux/delay.h>
-+#include <linux/fs.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/uaccess.h>
-+#include <linux/io.h>
-+#include <media/v4l2-dev.h>
-+#include <asm/cacheflush.h>
-+
-+#include "isp.h"
-+#include "ispmmu.h"
-+#include "ispreg.h"
-+#include "omap_previewer.h"
-+
-+#define OMAP_PREV_NAME "omap-previewer"
-+
-+static int prev_major = -1;
-+static struct device *prev_dev;
-+static struct class *prev_class;
-+static struct prev_device *prevdevice;
-+static struct platform_driver omap_previewer_driver;
-+
-+static u32 prev_bufsize;
-+
-+/**
-+ * prev_calculate_crop - Calculate crop size according to device parameters
-+ * @device: Structure containing ISP preview wrapper global information
-+ * @crop: Structure containing crop size
-+ *
-+ * This function is used to calculate frame size reduction depending on
-+ * the features enabled by the application.
-+ **/
-+static void prev_calculate_crop(struct prev_device *device,
-+ struct prev_cropsize *crop)
-+{
-+ dev_dbg(prev_dev, "prev_calculate_crop E\n");
-+
-+ if (!device || !crop) {
-+ dev_err(prev_dev, "\nErron in argument");
-+ return;
-+ }
-+
-+ isppreview_try_size(device->params->size_params.hsize,
-+ device->params->size_params.vsize,
-+ &crop->hcrop, &crop->vcrop);
-+ crop->hcrop &= PREV_16PIX_ALIGN_MASK;
-+ dev_dbg(prev_dev, "prev_calculate_crop L\n");
-+}
-+
-+/**
-+ * prev_get_status - Get status of ISP preview module
-+ * @status: Structure containing the busy state.
-+ *
-+ * Checks if the ISP preview module is busy.
-+ *
-+ * Returns 0 if successful, or -EINVAL if the status parameter is invalid.
-+ **/
-+static int prev_get_status(struct prev_status *status)
-+{
-+ if (!status) {
-+ dev_err(prev_dev, "get_status: invalid parameter\n");
-+ return -EINVAL;
-+ }
-+ status->hw_busy = (char)isppreview_busy();
-+ return 0;
-+}
-+
-+/**
-+ * prev_hw_setup - Stores the desired configuration in the proper HW registers
-+ * @config: Structure containing the desired configuration for ISP preview
-+ * module.
-+ *
-+ * Reads the structure sent, and modifies the desired registers.
-+ *
-+ * Always returns 0.
-+ **/
-+static int prev_hw_setup(struct prev_params *config)
-+{
-+ dev_dbg(prev_dev, "prev_hw_setup E\n");
-+
-+ if (config->features & PREV_AVERAGER)
-+ isppreview_config_averager(config->average);
-+ else
-+ isppreview_config_averager(0);
-+
-+ if (config->features & PREV_INVERSE_ALAW)
-+ isppreview_enable_invalaw(1);
-+ else
-+ isppreview_enable_invalaw(0);
-+
-+ if (config->features & PREV_HORZ_MEDIAN_FILTER) {
-+ isppreview_config_hmed(config->hmf_params);
-+ isppreview_enable_hmed(1);
-+ } else
-+ isppreview_enable_hmed(0);
-+
-+ if (config->features & PREV_DARK_FRAME_SUBTRACT) {
-+ isppreview_set_darkaddr(config->drkf_params.addr);
-+ isppreview_config_darklineoffset(config->drkf_params.offset);
-+ isppreview_enable_drkframe(1);
-+ } else
-+ isppreview_enable_drkframe(0);
-+
-+ if (config->features & PREV_LENS_SHADING) {
-+ isppreview_config_drkf_shadcomp(config->lens_shading_shift);
-+ isppreview_enable_shadcomp(1);
-+ } else
-+ isppreview_enable_shadcomp(0);
-+
-+ dev_dbg(prev_dev, "prev_hw_setup L\n");
-+ return 0;
-+}
-+
-+/**
-+ * prev_validate_params - Validate configuration parameters for Preview Wrapper
-+ * @params: Structure containing configuration parameters
-+ *
-+ * Validate configuration parameters for Preview Wrapper
-+ *
-+ * Returns 0 if successful, or -EINVAL if a parameter value is invalid.
-+ **/
-+static int prev_validate_params(struct prev_params *params)
-+{
-+ if (!params) {
-+ dev_err(prev_dev, "validate_params: error in argument");
-+ goto err_einval;
-+ }
-+
-+ if ((params->features & PREV_AVERAGER) == PREV_AVERAGER) {
-+ if ((params->average != NO_AVE)
-+ && (params->average != AVE_2_PIX)
-+ && (params->average != AVE_4_PIX)
-+ && (params->average != AVE_8_PIX)) {
-+ dev_err(prev_dev, "validate_params: wrong pix "
-+ "average\n");
-+ goto err_einval;
-+ } else if (((params->average == AVE_2_PIX)
-+ && (params->size_params.hsize % 2))
-+ || ((params->average == AVE_4_PIX)
-+ && (params->size_params.hsize % 4))
-+ || ((params->average == AVE_8_PIX)
-+ && (params->size_params.hsize % 8))) {
-+ dev_err(prev_dev, "validate_params: "
-+ "wrong pix average for input size\n");
-+ goto err_einval;
-+ }
-+ }
-+
-+ if ((params->size_params.pixsize != PREV_INWIDTH_8BIT)
-+ && (params->size_params.pixsize
-+ != PREV_INWIDTH_10BIT)) {
-+ dev_err(prev_dev, "validate_params: wrong pixsize\n");
-+ goto err_einval;
-+ }
-+
-+ if (params->size_params.hsize > MAX_IMAGE_WIDTH
-+ || params->size_params.hsize < 0) {
-+ dev_err(prev_dev, "validate_params: wrong hsize\n");
-+ goto err_einval;
-+ }
-+
-+ if ((params->pix_fmt != YCPOS_YCrYCb)
-+ && (YCPOS_YCbYCr != params->pix_fmt)
-+ && (YCPOS_CbYCrY != params->pix_fmt)
-+ && (YCPOS_CrYCbY != params->pix_fmt)) {
-+ dev_err(prev_dev, "validate_params: wrong pix_fmt");
-+ goto err_einval;
-+ }
-+
-+ if ((params->features & PREV_DARK_FRAME_SUBTRACT)
-+ && (params->features
-+ & PREV_DARK_FRAME_CAPTURE)) {
-+ dev_err(prev_dev, "validate_params: DARK FRAME CAPTURE and "
-+ "SUBSTRACT cannot be enabled "
-+ "at same time\n");
-+ goto err_einval;
-+ }
-+
-+ if (params->features & PREV_DARK_FRAME_SUBTRACT)
-+ if (!params->drkf_params.addr
-+ || (params->drkf_params.offset % 32)) {
-+ dev_err(prev_dev, "validate_params: dark frame "
-+ "address\n");
-+ goto err_einval;
-+ }
-+
-+ if (params->features & PREV_LENS_SHADING)
-+ if ((params->lens_shading_shift > 7)
-+ || !params->drkf_params.addr
-+ || (params->drkf_params.offset % 32)) {
-+ dev_err(prev_dev, "validate_params: lens shading "
-+ "shift\n");
-+ goto err_einval;
-+ }
-+
-+ if ((params->size_params.in_pitch <= 0)
-+ || (params->size_params.in_pitch % 32)) {
-+ params->size_params.in_pitch =
-+ (params->size_params.hsize * 2) & 0xFFE0;
-+ dev_err(prev_dev, "\nError in in_pitch; new value = %d",
-+ params->size_params.in_pitch);
-+ }
-+
-+ return 0;
-+err_einval:
-+ return -EINVAL;
-+}
-+
-+/**
-+ * preview_isr - Callback from ISP driver for ISP Preview Interrupt
-+ * @status: ISP IRQ0STATUS register value
-+ * @arg1: Structure containing ISP preview wrapper global information
-+ * @arg2: Currently not used
-+ **/
-+static void preview_isr(unsigned long status, isp_vbq_callback_ptr arg1,
-+ void *arg2)
-+{
-+ struct prev_device *device = (struct prev_device *)arg1;
-+
-+ if ((status & PREV_DONE) != PREV_DONE)
-+ return;
-+
-+ if (device)
-+ complete(&device->wfc);
-+}
-+
-+/**
-+ * prev_do_preview - Performs the Preview process
-+ * @device: Structure containing ISP preview wrapper global information
-+ * @arg: Currently not used
-+ *
-+ * Returns 0 if successful, or -EINVAL if the sent parameters are invalid.
-+ **/
-+static int prev_do_preview(struct prev_device *device, int *arg)
-+{
-+ int bpp, size;
-+ int ret = 0;
-+ u32 out_hsize, out_vsize, out_line_offset;
-+
-+ dev_dbg(prev_dev, "prev_do_preview E\n");
-+
-+ if (!device) {
-+ dev_err(prev_dev, "preview: invalid parameters\n");
-+ return -EINVAL;
-+ }
-+
-+ if (device->params->size_params.pixsize == PREV_INWIDTH_8BIT)
-+ bpp = 1;
-+ else
-+ bpp = 2;
-+
-+ size = device->params->size_params.hsize *
-+ device->params->size_params.vsize * bpp;
-+
-+ ret = isppreview_set_inaddr(device->isp_addr_read);
-+ if (ret)
-+ goto out;
-+
-+ ret = isppreview_set_outaddr(device->isp_addr_read);
-+ if (ret)
-+ goto out;
-+
-+ isppreview_try_size(device->params->size_params.hsize,
-+ device->params->size_params.vsize,
-+ &out_hsize, &out_vsize);
-+
-+ ret = isppreview_config_inlineoffset(device->params->size_params.hsize
-+ * bpp);
-+ if (ret)
-+ goto out;
-+
-+ out_line_offset = (out_hsize * bpp) & PREV_32BYTES_ALIGN_MASK;
-+
-+ ret = isppreview_config_outlineoffset(out_line_offset);
-+ if (ret)
-+ goto out;
-+
-+ ret = isppreview_config_size(device->params->size_params.hsize,
-+ device->params->size_params.vsize,
-+ out_hsize, out_vsize);
-+ if (ret)
-+ goto out;
-+
-+ isppreview_config_datapath(PRV_RAW_MEM, PREVIEW_MEM);
-+
-+ ret = isp_set_callback(CBK_PREV_DONE, preview_isr, (void *)device,
-+ (void *)NULL);
-+ if (ret) {
-+ dev_err(prev_dev, "ERROR while setting Previewer callback!\n");
-+ goto out;
-+ }
-+ isppreview_enable(1);
-+
-+ wait_for_completion_interruptible(&device->wfc);
-+
-+ if (device->isp_addr_read) {
-+ ispmmu_vunmap(device->isp_addr_read);
-+ device->isp_addr_read = 0;
-+ }
-+
-+ ret = isp_unset_callback(CBK_PREV_DONE);
-+
-+ dev_dbg(prev_dev, "prev_do_preview L\n");
-+out:
-+ return ret;
-+}
-+
-+/**
-+ * previewer_vbq_release - Videobuffer queue release
-+ * @q: Structure containing the videobuffer queue.
-+ * @vb: Structure containing the videobuffer used for previewer processing.
-+ **/
-+static void previewer_vbq_release(struct videobuf_queue *q,
-+ struct videobuf_buffer *vb)
-+{
-+ struct prev_fh *fh = q->priv_data;
-+ struct prev_device *device = fh->device;
-+
-+ ispmmu_vunmap(device->isp_addr_read);
-+ device->isp_addr_read = 0;
-+ spin_lock(&device->vbq_lock);
-+ vb->state = VIDEOBUF_NEEDS_INIT;
-+ spin_unlock(&device->vbq_lock);
-+ dev_dbg(prev_dev, "previewer_vbq_release\n");
-+}
-+
-+/**
-+ * previewer_vbq_setup - Sets up the videobuffer size and validates count.
-+ * @q: Structure containing the videobuffer queue.
-+ * @cnt: Number of buffers requested
-+ * @size: Size in bytes of the buffer used for previewing
-+ *
-+ * Always returns 0.
-+ **/
-+static int previewer_vbq_setup(struct videobuf_queue *q,
-+ unsigned int *cnt,
-+ unsigned int *size)
-+{
-+ struct prev_fh *fh = q->priv_data;
-+ struct prev_device *device = fh->device;
-+ u32 bpp = 1;
-+
-+ spin_lock(&device->vbq_lock);
-+ if (*cnt <= 0)
-+ *cnt = VIDEO_MAX_FRAME;
-+
-+ if (*cnt > VIDEO_MAX_FRAME)
-+ *cnt = VIDEO_MAX_FRAME;
-+
-+ if (!device->params->size_params.hsize ||
-+ !device->params->size_params.vsize) {
-+ dev_err(prev_dev, "Can't setup buffer size\n");
-+ spin_unlock(&device->vbq_lock);
-+ return -EINVAL;
-+ }
-+
-+ if (device->params->size_params.pixsize == PREV_INWIDTH_10BIT)
-+ bpp = 2;
-+ *size = prev_bufsize = bpp * device->params->size_params.hsize
-+ * device->params->size_params.vsize;
-+ spin_unlock(&device->vbq_lock);
-+ dev_dbg(prev_dev, "previewer_vbq_setup\n");
-+ return 0;
-+}
-+
-+/**
-+ * previewer_vbq_prepare - Videobuffer is prepared and mmapped.
-+ * @q: Structure containing the videobuffer queue.
-+ * @vb: Structure containing the videobuffer used for previewer processing.
-+ * @field: Type of field to set in videobuffer device.
-+ *
-+ * Returns 0 if successful, or -EINVAL if buffer couldn't get allocated, or
-+ * -EIO if the ISP MMU mapping fails
-+ **/
-+static int previewer_vbq_prepare(struct videobuf_queue *q,
-+ struct videobuf_buffer *vb,
-+ enum v4l2_field field)
-+{
-+ struct prev_fh *fh = q->priv_data;
-+ struct prev_device *device = fh->device;
-+ int err = -EINVAL;
-+ unsigned int isp_addr;
-+ struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
-+
-+ dev_dbg(prev_dev, "previewer_vbq_prepare E\n");
-+ spin_lock(&device->vbq_lock);
-+ if (vb->baddr) {
-+ vb->size = prev_bufsize;
-+ vb->bsize = prev_bufsize;
-+ } else {
-+ spin_unlock(&device->vbq_lock);
-+ dev_err(prev_dev, "No user buffer allocated\n");
-+ goto out;
-+ }
-+
-+ vb->width = device->params->size_params.hsize;
-+ vb->height = device->params->size_params.vsize;
-+ vb->field = field;
-+ spin_unlock(&device->vbq_lock);
-+
-+ if (vb->state == VIDEOBUF_NEEDS_INIT) {
-+ err = videobuf_iolock(q, vb, NULL);
-+ if (!err) {
-+ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
-+ if (!isp_addr)
-+ err = -EIO;
-+ else
-+ device->isp_addr_read = isp_addr;
-+ }
-+ }
-+
-+ if (!err) {
-+ vb->state = VIDEOBUF_PREPARED;
-+ flush_cache_user_range(NULL, vb->baddr,
-+ (vb->baddr + vb->bsize));
-+ } else
-+ previewer_vbq_release(q, vb);
-+
-+ dev_dbg(prev_dev, "previewer_vbq_prepare L\n");
-+out:
-+ return err;
-+}
-+
-+static void previewer_vbq_queue(struct videobuf_queue *q,
-+ struct videobuf_buffer *vb)
-+{
-+ return;
-+}
-+
-+/**
-+ * previewer_open - Initializes and opens the Preview Wrapper
-+ * @inode: Inode structure associated with the Preview Wrapper
-+ * @filp: File structure associated with the Preview Wrapper
-+ *
-+ * Returns 0 if successful, -EACCES if its unable to initialize default config,
-+ * -EBUSY if its already opened or the ISP module is not available, or -ENOMEM
-+ * if its unable to allocate the device in kernel space memory.
-+ **/
-+static int previewer_open(struct inode *inode, struct file *filp)
-+{
-+ int ret = 0;
-+ struct prev_device *device = prevdevice;
-+ struct prev_params *config = isppreview_get_config();
-+ struct prev_fh *fh;
-+
-+ if (config == NULL) {
-+ dev_err(prev_dev, "Unable to initialize default config "
-+ "from isppreviewer\n\n");
-+ return -EACCES;
-+ }
-+
-+ if (device->opened || (filp->f_flags & O_NONBLOCK)) {
-+ dev_err(prev_dev, "previewer_open: device is already "
-+ "opened\n");
-+ return -EBUSY;
-+ }
-+
-+ fh = kzalloc(sizeof(struct prev_fh), GFP_KERNEL);
-+ if (NULL == fh)
-+ return -ENOMEM;
-+
-+ isp_get();
-+ ret = isppreview_request();
-+ if (ret) {
-+ isp_put();
-+ dev_err(prev_dev, "Can't acquire isppreview\n");
-+ return ret;
-+ }
-+
-+ device->params = config;
-+ device->opened = 1;
-+
-+ filp->private_data = fh;
-+ fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-+ fh->device = device;
-+
-+ videobuf_queue_sg_init(&fh->vbq, &device->vbq_ops, NULL,
-+ &device->vbq_lock, fh->type,
-+ V4L2_FIELD_NONE,
-+ sizeof(struct videobuf_buffer), fh);
-+
-+ init_completion(&device->wfc);
-+ device->wfc.done = 0;
-+ mutex_init(&device->prevwrap_mutex);
-+
-+ return 0;
-+}
-+
-+/**
-+ * previewer_release - Releases Preview Wrapper and frees up allocated memory
-+ * @inode: Inode structure associated with the Preview Wrapper
-+ * @filp: File structure associated with the Preview Wrapper
-+ *
-+ * Always returns 0.
-+ **/
-+static int previewer_release(struct inode *inode, struct file *filp)
-+{
-+ struct prev_fh *fh = filp->private_data;
-+ struct prev_device *device = fh->device;
-+ struct videobuf_queue *q = &fh->vbq;
-+
-+ device->opened = 0;
-+ device->params = NULL;
-+ isppreview_free();
-+ videobuf_mmap_free(q);
-+ isp_put();
-+ prev_bufsize = 0;
-+ filp->private_data = NULL;
-+ kfree(fh);
-+
-+ dev_dbg(prev_dev, "previewer_release\n");
-+ return 0;
-+}
-+
-+/**
-+ * previewer_mmap - Memory maps the Preview Wrapper module.
-+ * @file: File structure associated with the Preview Wrapper
-+ * @vma: Virtual memory area structure.
-+ *
-+ * Returns 0 if successful, or returned value by the videobuf_mmap_mapper()
-+ * function.
-+ **/
-+static int previewer_mmap(struct file *file, struct vm_area_struct *vma)
-+{
-+ struct prev_fh *fh = file->private_data;
-+ dev_dbg(prev_dev, "previewer_mmap\n");
-+
-+ return videobuf_mmap_mapper(&fh->vbq, vma);
-+}
-+
-+/**
-+ * previewer_ioctl - I/O control function for Preview Wrapper
-+ * @inode: Inode structure associated with the Preview Wrapper.
-+ * @file: File structure associated with the Preview Wrapper.
-+ * @cmd: Type of command to execute.
-+ * @arg: Argument to send to requested command.
-+ *
-+ * Returns 0 if successful, -1 if bad command passed or access is denied,
-+ * -EFAULT if copy_from_user() or copy_to_user() fails, -EINVAL if parameter
-+ * validation fails or parameter structure is not present
-+ **/
-+static int previewer_ioctl(struct inode *inode, struct file *file,
-+ unsigned int cmd, unsigned long arg)
-+{
-+ int ret = 0;
-+ struct prev_params params;
-+ struct prev_fh *fh = file->private_data;
-+ struct prev_device *device = fh->device;
-+
-+ dev_dbg(prev_dev, "Entering previewer_ioctl()\n");
-+
-+ if ((_IOC_TYPE(cmd) != PREV_IOC_BASE)
-+ || (_IOC_NR(cmd) > PREV_IOC_MAXNR)) {
-+ dev_err(prev_dev, "Bad command Value \n");
-+ goto err_minusone;
-+ }
-+
-+ if (_IOC_DIR(cmd) & _IOC_READ)
-+ ret = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
-+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
-+ ret = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
-+ if (ret) {
-+ dev_err(prev_dev, "access denied\n");
-+ goto err_minusone;
-+ }
-+
-+ switch (cmd) {
-+ case PREV_REQBUF:
-+ if (mutex_lock_interruptible(&device->prevwrap_mutex))
-+ goto err_eintr;
-+ ret = videobuf_reqbufs(&fh->vbq, (void *)arg);
-+ mutex_unlock(&device->prevwrap_mutex);
-+ break;
-+
-+ case PREV_QUERYBUF:
-+ if (mutex_lock_interruptible(&device->prevwrap_mutex))
-+ goto err_eintr;
-+ ret = videobuf_querybuf(&fh->vbq, (void *)arg);
-+ mutex_unlock(&device->prevwrap_mutex);
-+ break;
-+
-+ case PREV_QUEUEBUF:
-+ if (mutex_lock_interruptible(&device->prevwrap_mutex))
-+ goto err_eintr;
-+ ret = videobuf_qbuf(&fh->vbq, (void *)arg);
-+ mutex_unlock(&device->prevwrap_mutex);
-+ break;
-+
-+ case PREV_SET_PARAM:
-+ if (mutex_lock_interruptible(&device->prevwrap_mutex))
-+ goto err_eintr;
-+ if (copy_from_user(&params, (struct prev_params *)arg,
-+ sizeof(struct prev_params))) {
-+ mutex_unlock(&device->prevwrap_mutex);
-+ return -EFAULT;
-+ }
-+ ret = prev_validate_params(&params);
-+ if (ret < 0) {
-+ dev_err(prev_dev, "Error validating parameters!\n");
-+ mutex_unlock(&device->prevwrap_mutex);
-+ goto out;
-+ }
-+ if (device->params)
-+ memcpy(device->params, &params,
-+ sizeof(struct prev_params));
-+ else {
-+ mutex_unlock(&device->prevwrap_mutex);
-+ return -EINVAL;
-+ }
-+
-+ ret = prev_hw_setup(device->params);
-+ mutex_unlock(&device->prevwrap_mutex);
-+ break;
-+
-+ case PREV_GET_PARAM:
-+ if (copy_to_user((struct prev_params *)arg, device->params,
-+ sizeof(struct prev_params)))
-+ ret = -EFAULT;
-+ break;
-+
-+ case PREV_GET_STATUS:
-+ ret = prev_get_status((struct prev_status *)arg);
-+ break;
-+
-+ case PREV_PREVIEW:
-+ if (mutex_lock_interruptible(&device->prevwrap_mutex))
-+ goto err_eintr;
-+ ret = prev_do_preview(device, (int *)arg);
-+ mutex_unlock(&device->prevwrap_mutex);
-+ break;
-+
-+ case PREV_GET_CROPSIZE:
-+ {
-+ struct prev_cropsize outputsize;
-+ prev_calculate_crop(device, &outputsize);
-+ if (copy_to_user((struct prev_cropsize *)arg, &outputsize,
-+ sizeof(struct prev_cropsize)))
-+ ret = -EFAULT;
-+ }
-+ break;
-+
-+ default:
-+ dev_err(prev_dev, "previewer_ioctl: Invalid Command Value\n");
-+ ret = -EINVAL;
-+ }
-+out:
-+ return ret;
-+err_minusone:
-+ return -1;
-+err_eintr:
-+ return -EINTR;
-+}
-+
-+/**
-+ * previewer_platform_release - Acts when Reference count is zero
-+ * @device: Structure containing ISP preview wrapper global information
-+ *
-+ * This is called when the reference count goes to zero
-+ **/
-+static void previewer_platform_release(struct device *device)
-+{
-+ dev_dbg(prev_dev, "previewer_platform_release()\n");
-+}
-+
-+static struct file_operations prev_fops = {
-+ .owner = THIS_MODULE,
-+ .open = previewer_open,
-+ .release = previewer_release,
-+ .mmap = previewer_mmap,
-+ .ioctl = previewer_ioctl,
-+};
-+
-+static struct platform_device omap_previewer_device = {
-+ .name = OMAP_PREV_NAME,
-+ .id = -1,
-+ .dev = {
-+ .release = previewer_platform_release,
-+ }
-+};
-+
-+/**
-+ * previewer_probe - Checks for device presence
-+ * @pdev: Structure containing details of the current device.
-+ *
-+ * Always returns 0
-+ **/
-+static int __init previewer_probe(struct platform_device *pdev)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * previewer_remove - Handles the removal of the driver
-+ * @pdev: Structure containing details of the current device.
-+ *
-+ * Always returns 0.
-+ **/
-+static int previewer_remove(struct platform_device *pdev)
-+{
-+ dev_dbg(prev_dev, "previewer_remove()\n");
-+
-+ platform_device_unregister(&omap_previewer_device);
-+ platform_driver_unregister(&omap_previewer_driver);
-+ unregister_chrdev(prev_major, OMAP_PREV_NAME);
-+ return 0;
-+}
-+
-+static struct platform_driver omap_previewer_driver = {
-+ .probe = previewer_probe,
-+ .remove = previewer_remove,
-+ .driver = {
-+ .owner = THIS_MODULE,
-+ .name = OMAP_PREV_NAME,
-+ },
-+};
-+
-+/**
-+ * omap_previewer_init - Initialization of Preview Wrapper
-+ *
-+ * Returns 0 if successful, -ENOMEM if could not allocate memory, -ENODEV if
-+ * could not register the wrapper as a character device, or other errors if the
-+ * device or driver can't register.
-+ **/
-+static int __init omap_previewer_init(void)
-+{
-+ int ret;
-+ struct prev_device *device;
-+
-+ device = kzalloc(sizeof(struct prev_device), GFP_KERNEL);
-+ if (!device) {
-+ dev_err(prev_dev, OMAP_PREV_NAME ": could not allocate"
-+ " memory\n");
-+ return -ENOMEM;
-+ }
-+ prev_major = register_chrdev(0, OMAP_PREV_NAME, &prev_fops);
-+
-+ if (prev_major < 0) {
-+ dev_err(prev_dev, OMAP_PREV_NAME ": initialization "
-+ "failed. could not register character "
-+ "device\n");
-+ return -ENODEV;
-+ }
-+
-+ ret = platform_driver_register(&omap_previewer_driver);
-+ if (ret) {
-+ dev_err(prev_dev, OMAP_PREV_NAME
-+ ": failed to register platform driver!\n");
-+ goto fail2;
-+ }
-+ ret = platform_device_register(&omap_previewer_device);
-+ if (ret) {
-+ dev_err(prev_dev, OMAP_PREV_NAME
-+ ": failed to register platform device!\n");
-+ goto fail3;
-+ }
-+
-+ prev_class = class_create(THIS_MODULE, OMAP_PREV_NAME);
-+ if (!prev_class)
-+ goto fail4;
-+
-+ prev_dev = device_create(prev_class, prev_dev,
-+ (MKDEV(prev_major, 0)), NULL,
-+ OMAP_PREV_NAME);
-+ dev_dbg(prev_dev, OMAP_PREV_NAME ": Registered Previewer Wrapper\n");
-+ device->opened = 0;
-+
-+ device->vbq_ops.buf_setup = previewer_vbq_setup;
-+ device->vbq_ops.buf_prepare = previewer_vbq_prepare;
-+ device->vbq_ops.buf_release = previewer_vbq_release;
-+ device->vbq_ops.buf_queue = previewer_vbq_queue;
-+ spin_lock_init(&device->vbq_lock);
-+
-+ prevdevice = device;
-+ return 0;
-+
-+fail4:
-+ platform_device_unregister(&omap_previewer_device);
-+fail3:
-+ platform_driver_unregister(&omap_previewer_driver);
-+fail2:
-+ unregister_chrdev(prev_major, OMAP_PREV_NAME);
-+
-+ return ret;
-+}
-+
-+/**
-+ * omap_previewer_exit - Close of Preview Wrapper
-+ **/
-+static void __exit omap_previewer_exit(void)
-+{
-+ previewer_remove(&omap_previewer_device);
-+ kfree(prevdevice);
-+ prev_major = -1;
-+}
-+
-+module_init(omap_previewer_init);
-+module_exit(omap_previewer_exit);
-+
-+MODULE_AUTHOR("Texas Instruments");
-+MODULE_DESCRIPTION("OMAP ISP Previewer");
-+MODULE_LICENSE("GPL");
-diff --git a/drivers/media/video/isp/omap_previewer.h b/drivers/media/video/isp/omap_previewer.h
-new file mode 100644
-index 0000000..0bb31cd
---- /dev/null
-+++ b/drivers/media/video/isp/omap_previewer.h
-@@ -0,0 +1,162 @@
-+/*
-+ * drivers/media/video/isp/omap_previewer.h
-+ *
-+ * Header file for Preview module wrapper in TI's OMAP3430 ISP
-+ *
-+ * Copyright (C) 2008 Texas Instruments, Inc.
-+ *
-+ * Contributors:
-+ * Leonides Martinez <leonides.martinez@ti.com>
-+ * Sergio Aguirre <saaguirre@ti.com>
-+ *
-+ * This package 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.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#include "isppreview.h"
-+
-+#ifndef OMAP_ISP_PREVIEW_WRAP_H
-+#define OMAP_ISP_PREVIEW_WRAP_H
-+
-+#define PREV_IOC_BASE 'P'
-+#define PREV_REQBUF _IOWR(PREV_IOC_BASE, 1,\
-+ struct v4l2_requestbuffers)
-+#define PREV_QUERYBUF _IOWR(PREV_IOC_BASE, 2,\
-+ struct v4l2_buffer)
-+#define PREV_SET_PARAM _IOW(PREV_IOC_BASE, 3,\
-+ struct prev_params)
-+#define PREV_GET_PARAM _IOWR(PREV_IOC_BASE, 4,\
-+ struct prev_params)
-+#define PREV_PREVIEW _IOR(PREV_IOC_BASE, 5, int)
-+#define PREV_GET_STATUS _IOR(PREV_IOC_BASE, 6, char)
-+#define PREV_GET_CROPSIZE _IOR(PREV_IOC_BASE, 7,\
-+ struct prev_cropsize)
-+#define PREV_QUEUEBUF _IOWR(PREV_IOC_BASE, 8,\
-+ struct v4l2_buffer)
-+#define PREV_IOC_MAXNR 8
-+
-+#define LUMA_TABLE_SIZE 128
-+#define GAMMA_TABLE_SIZE 1024
-+#define CFA_COEFF_TABLE_SIZE 576
-+#define NOISE_FILTER_TABLE_SIZE 256
-+
-+#define MAX_IMAGE_WIDTH 3300
-+
-+#define PREV_INWIDTH_8BIT 0 /* pixel width of 8 bits */
-+#define PREV_INWIDTH_10BIT 1 /* pixel width of 10 bits */
-+
-+#define PREV_32BYTES_ALIGN_MASK 0xFFFFFFE0
-+#define PREV_16PIX_ALIGN_MASK 0xFFFFFFF0
-+
-+/**
-+ * struct prev_rgbblending - Structure for RGB2RGB blending parameters
-+ * @blending: Color correlation 3x3 matrix.
-+ * @offset: Color correlation offsets.
-+ */
-+struct prev_rgbblending {
-+ short blending[RGB_MAX][RGB_MAX]; /* color correlation 3x3
-+ * matrix.
-+ */
-+ short offset[RGB_MAX]; /* color correlation offsets */
-+};
-+
-+/**
-+ * struct prev_cfa_coeffs - Structure for CFA coefficients
-+ * @hthreshold: Horizontal threshold.
-+ * @vthreshold: Vertical threshold.
-+ * @coeffs: CFA coefficients
-+ */
-+struct prev_cfa_coeffs {
-+ char hthreshold, vthreshold;
-+ int coeffs[CFA_COEFF_TABLE_SIZE];
-+};
-+
-+/**
-+ * struct prev_gamma_coeffs - Structure for Gamma Coefficients
-+ * @red: Table of gamma correction values for red color.
-+ * @green: Table of gamma correction values for green color.
-+ * @blue: Table of gamma correction values for blue color.
-+ */
-+struct prev_gamma_coeffs {
-+ unsigned char red[GAMMA_TABLE_SIZE];
-+ unsigned char green[GAMMA_TABLE_SIZE];
-+ unsigned char blue[GAMMA_TABLE_SIZE];
-+};
-+
-+/**
-+ * struct prev_noiseflt_coeffs - Structure for Noise Filter Coefficients.
-+ * @noise: Noise filter table.
-+ * @strength: Used to find out weighted average.
-+ */
-+struct prev_noiseflt_coeffs {
-+ unsigned char noise[NOISE_FILTER_TABLE_SIZE];
-+ unsigned char strength;
-+};
-+
-+/**
-+ * struct prev_chroma_spr - Structure for Chroma Suppression.
-+ * @hpfy: High passed version of Y or normal Y.
-+ * @threshold: Threshold for chroma suppress.
-+ * @gain: Chroma suppression gain
-+ */
-+struct prev_chroma_spr {
-+ unsigned char hpfy;
-+ char threshold;
-+ unsigned char gain;
-+};
-+
-+/**
-+ * struct prev_status - Structure to know status of the hardware
-+ * @hw_busy: Flag to indicate if Hardware is Busy.
-+ */
-+struct prev_status {
-+ char hw_busy;
-+};
-+
-+/**
-+ * struct prev_cropsize - Structure to know crop size.
-+ * @hcrop: Horizontal size of crop window.
-+ * @vcrop: Vertical size of crop window.
-+ */
-+struct prev_cropsize {
-+ int hcrop;
-+ int vcrop;
-+};
-+
-+/**
-+ * struct prev_device - Global device information structure.
-+ * @params: Pointer to structure containing preview parameters.
-+ * @opened: State of the device.
-+ * @wfc: Wait for completion. Used for locking operations.
-+ * @prevwrap_mutex: Mutex for preview wrapper use.
-+ * @vbq_lock: Spinlock for videobuf queues.
-+ * @vbq_ops: Videobuf queue operations
-+ * @isp_addr_read: Input/Output address
-+ */
-+struct prev_device {
-+ struct prev_params *params;
-+ unsigned char opened;
-+ struct completion wfc;
-+ struct mutex prevwrap_mutex; /* For generic internal use */
-+ spinlock_t vbq_lock; /* For videobuffer queue handling */
-+ struct videobuf_queue_ops vbq_ops;
-+ dma_addr_t isp_addr_read;
-+};
-+
-+/**
-+ * struct prev_fh - Per-filehandle data structure
-+ * @type: Used buffer type.
-+ * @vbq: Videobuffer queue.
-+ * @device: Pointer to device information structure.
-+ */
-+struct prev_fh {
-+ enum v4l2_buf_type type;
-+ struct videobuf_queue vbq;
-+ struct prev_device *device;
-+};
-+#endif
diff --git a/drivers/media/video/isp/omap_resizer.c b/drivers/media/video/isp/omap_resizer.c
new file mode 100644
index 0000000..54bc425
@@ -1450,11 +437,11 @@ index 0000000..54bc425
+ }
+
+ if (fh->isp_addr_read) {
-+ ispmmu_vunmap(fh->isp_addr_read);
++ ispmmu_unmap(fh->isp_addr_read);
+ fh->isp_addr_read = 0;
+ }
+ if (fh->isp_addr_write) {
-+ ispmmu_vunmap(fh->isp_addr_write);
++ ispmmu_unmap(fh->isp_addr_write);
+ fh->isp_addr_write = 0;
+ }
+
@@ -2128,8 +1115,8 @@ index 0000000..54bc425
+ videobuf_dma_free(dma);
+ }
+
-+ ispmmu_vunmap(fh->isp_addr_read);
-+ ispmmu_vunmap(fh->isp_addr_write);
++ ispmmu_unmap(fh->isp_addr_read);
++ ispmmu_unmap(fh->isp_addr_write);
+ fh->isp_addr_read = 0;
+ fh->isp_addr_write = 0;
+ spin_lock(&fh->vbq_lock);
@@ -2231,7 +1218,7 @@ index 0000000..54bc425
+ if (vb->state == VIDEOBUF_NEEDS_INIT) {
+ err = videobuf_iolock(q, vb, NULL);
+ if (!err) {
-+ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
++ isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
+ if (!isp_addr)
+ err = -EIO;
+ else {
@@ -2899,17 +1886,5 @@ index 0000000..5ac0c88
+
+#endif
--
-1.6.0.3
+1.6.2.4
---- /tmp/Kconfig 2009-04-06 10:56:27.000000000 +0200
-+++ git/drivers/media/video/Kconfig 2009-04-06 10:57:25.000000000 +0200
-@@ -711,6 +711,9 @@
- CMOS camera controller. This is the controller found on first-
- generation OLPC systems.
-
-+
-+source "drivers/media/video/isp/Kconfig"
-+
- config VIDEO_OMAP3
- tristate "OMAP 3 Camera support"
- select VIDEOBUF_GEN
diff --git a/recipes/linux/linux-omap-2.6.29/isp/standalone/0002-Resizer-bug-fixes-on-top-of-1.0.2-release.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch
index 631b05f417..2c3023643e 100644
--- a/recipes/linux/linux-omap-2.6.29/isp/standalone/0002-Resizer-bug-fixes-on-top-of-1.0.2-release.patch
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch
@@ -1,15 +1,14 @@
-From 20d79137ecaa6c7dad007d9ea1d7be5550db4839 Mon Sep 17 00:00:00 2001
-From: Vaibhav Hiremath <hvaibhav@ti.com>
-Date: Fri, 13 Feb 2009 15:40:25 +0530
-Subject: [PATCH 2/2] Resizer bug fixes on top of 1.0.2 release
+From ad3bbadb7fc39a946dfd0cdac19e2ec8647b2c2c Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 17:20:27 +0530
+Subject: [PATCH 24/26] OMAP3-Resizer: V4L2-buf layer issues fixed
-This commit contains resizer bug fixes on top of
- PSP1.0.2 release -
- - 4096 aligned address constraint
- - workaround for extra page allocation for page aligned
- size buffers
+V4L2-Buffer layer issues fixed under this commit.
+This patch is same as available with PSP1.0.2 release
-Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
+The discussion is initiated on this with V4L2 mailing list.
+
+Please note that this patch is not being tested.
---
drivers/media/video/isp/omap_resizer.c | 417 ++++++++++++++++++++++++--------
include/linux/omap_resizer.h | 3 +-
@@ -125,11 +124,11 @@ index 54bc425..8059c70 100644
}
- if (fh->isp_addr_read) {
-- ispmmu_vunmap(fh->isp_addr_read);
+- ispmmu_unmap(fh->isp_addr_read);
- fh->isp_addr_read = 0;
- }
- if (fh->isp_addr_write) {
-- ispmmu_vunmap(fh->isp_addr_write);
+- ispmmu_unmap(fh->isp_addr_write);
- fh->isp_addr_write = 0;
- }
-
@@ -270,11 +269,11 @@ index 54bc425..8059c70 100644
+ dma = videobuf_to_dma(q->bufs[vb->i]);
+ videobuf_dma_unmap(q, dma);
+ videobuf_dma_free(dma);
-+ ispmmu_vunmap(fh->config->buf_address[vb->i]);
++ ispmmu_unmap(fh->config->buf_address[vb->i]);
+ fh->config->buf_address[vb->i] = 0;
-- ispmmu_vunmap(fh->isp_addr_read);
-- ispmmu_vunmap(fh->isp_addr_write);
+- ispmmu_unmap(fh->isp_addr_read);
+- ispmmu_unmap(fh->isp_addr_write);
- fh->isp_addr_read = 0;
- fh->isp_addr_write = 0;
spin_lock(&fh->vbq_lock);
@@ -429,7 +428,7 @@ index 54bc425..8059c70 100644
if (vb->state == VIDEOBUF_NEEDS_INIT) {
- err = videobuf_iolock(q, vb, NULL);
- if (!err) {
-- isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
+- isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
- if (!isp_addr)
- err = -EIO;
- else {
@@ -491,7 +490,7 @@ index 54bc425..8059c70 100644
+ goto buf_release;
+ spin_unlock(&fh->vbq_lock);
+ }
-+ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
++ isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
+ if (!isp_addr)
+ err = -EIO;
+ else {
@@ -726,5 +725,5 @@ index 5ac0c88..47b8dd8 100644
#define RSZ_INTYPE_YCBCR422_16BIT 0
#define RSZ_INTYPE_PLANAR_8BIT 1
--
-1.6.0.3
+1.6.2.4
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch
new file mode 100644
index 0000000000..143a846e3c
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch
@@ -0,0 +1,36 @@
+From 9fec955e98b4ef7922f629e3a81d2d1af216e028 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 18:12:42 +0530
+Subject: [PATCH 25/26] OMAP3-Resizer: Build issues fixed
+
+There were some building issues with latest gitorious tree,
+fixed them.
+---
+ drivers/media/video/isp/omap_resizer.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/video/isp/omap_resizer.c b/drivers/media/video/isp/omap_resizer.c
+index 8059c70..dd90b24 100644
+--- a/drivers/media/video/isp/omap_resizer.c
++++ b/drivers/media/video/isp/omap_resizer.c
+@@ -1033,7 +1033,7 @@ static void rsz_vbq_release(struct videobuf_queue *q,
+ dma = videobuf_to_dma(q->bufs[vb->i]);
+ videobuf_dma_unmap(q, dma);
+ videobuf_dma_free(dma);
+- ispmmu_unmap(fh->config->buf_address[vb->i]);
++ ispmmu_vunmap(fh->config->buf_address[vb->i]);
+ fh->config->buf_address[vb->i] = 0;
+
+ spin_lock(&fh->vbq_lock);
+@@ -1293,7 +1293,7 @@ static int rsz_vbq_prepare(struct videobuf_queue *q,
+ goto buf_release;
+ spin_unlock(&fh->vbq_lock);
+ }
+- isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
++ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
+ if (!isp_addr)
+ err = -EIO;
+ else {
+--
+1.6.2.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0001-V4L2-Add-COLORFX-user-control.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0001-V4L2-Add-COLORFX-user-control.patch
new file mode 100644
index 0000000000..d9e4243b4a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0001-V4L2-Add-COLORFX-user-control.patch
@@ -0,0 +1,44 @@
+From ad422f476ce04636f911557bbfd066c516e9b472 Mon Sep 17 00:00:00 2001
+From: Aguirre Rodriguez, Sergio Alberto <saaguirre@ti.com>
+Date: Tue, 20 Jan 2009 16:29:26 -0600
+Subject: [PATCH] V4L2: Add COLORFX user control
+
+From 07396d67b39bf7bcc81440d3e72d253ad6c54f11 Mon Sep 17 00:00:00 2001
+From: Sergio Aguirre <saaguirre@ti.com>
+Date: Tue, 20 Jan 2009 15:34:43 -0600
+Subject: [PATCH v2] V4L2: Add COLORFX user control
+
+This is a common feature on many cameras. the options are:
+Default colors,
+B & W,
+Sepia
+
+Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
+---
+ include/linux/videodev2.h | 9 ++++++++-
+ 1 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
+index 5571dbe..8e4e25e 100644
+--- a/include/linux/videodev2.h
++++ b/include/linux/videodev2.h
+@@ -879,8 +879,15 @@ enum v4l2_power_line_frequency {
+ #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
+ #define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
+ #define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
++#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
++enum v4l2_colorfx {
++ V4L2_COLORFX_NONE = 0,
++ V4L2_COLORFX_BW = 1,
++ V4L2_COLORFX_SEPIA = 2,
++};
++
+ /* last CID + 1 */
+-#define V4L2_CID_LASTP1 (V4L2_CID_BASE+31)
++#define V4L2_CID_LASTP1 (V4L2_CID_BASE+32)
+
+ /* MPEG-class control IDs defined by V4L2 */
+ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0002-V4L-Int-if-v4l2_int_device_try_attach_all-requires.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0002-V4L-Int-if-v4l2_int_device_try_attach_all-requires.patch
new file mode 100644
index 0000000000..45e27a2fda
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0002-V4L-Int-if-v4l2_int_device_try_attach_all-requires.patch
@@ -0,0 +1,50 @@
+From 5b007183d51543624bc9f582966f245a64157b57 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@nokia.com>
+Date: Fri, 31 Oct 2008 11:51:30 +0200
+Subject: [PATCH] V4L: Int if: v4l2_int_device_try_attach_all requires mutex
+
+Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
+---
+ drivers/media/video/v4l2-int-device.c | 12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
+index a935bae..eb8dc84 100644
+--- a/drivers/media/video/v4l2-int-device.c
++++ b/drivers/media/video/v4l2-int-device.c
+@@ -32,7 +32,7 @@
+ static DEFINE_MUTEX(mutex);
+ static LIST_HEAD(int_list);
+
+-void v4l2_int_device_try_attach_all(void)
++static void __v4l2_int_device_try_attach_all(void)
+ {
+ struct v4l2_int_device *m, *s;
+
+@@ -66,6 +66,14 @@ void v4l2_int_device_try_attach_all(void)
+ }
+ }
+ }
++
++void v4l2_int_device_try_attach_all(void)
++{
++ mutex_lock(&mutex);
++ __v4l2_int_device_try_attach_all();
++ mutex_unlock(&mutex);
++}
++
+ EXPORT_SYMBOL_GPL(v4l2_int_device_try_attach_all);
+
+ static int ioctl_sort_cmp(const void *a, const void *b)
+@@ -89,7 +97,7 @@ int v4l2_int_device_register(struct v4l2_int_device *d)
+ &ioctl_sort_cmp, NULL);
+ mutex_lock(&mutex);
+ list_add(&d->head, &int_list);
+- v4l2_int_device_try_attach_all();
++ __v4l2_int_device_try_attach_all();
+ mutex_unlock(&mutex);
+
+ return 0;
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch
new file mode 100644
index 0000000000..829810fab0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch
@@ -0,0 +1,61 @@
+From cc1d76e0f50321e80f7f50e9e214de2c9a45628a Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@nokia.com>
+Date: Wed, 22 Oct 2008 18:41:20 +0300
+Subject: [PATCH] V4L: Int if: Dummy slave
+
+This patch implements a dummy slave that has no functionality. Helps
+managing slaves in the OMAP 3 camera driver; no need to check for NULL
+pointers.
+
+Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
+---
+ drivers/media/video/v4l2-int-device.c | 19 +++++++++++++++++++
+ include/media/v4l2-int-device.h | 2 ++
+ 2 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
+index eb8dc84..483ee2e 100644
+--- a/drivers/media/video/v4l2-int-device.c
++++ b/drivers/media/video/v4l2-int-device.c
+@@ -67,6 +67,25 @@ static void __v4l2_int_device_try_attach_all(void)
+ }
+ }
+
++static struct v4l2_int_slave dummy_slave = {
++ /* Dummy pointer to avoid underflow in find_ioctl. */
++ .ioctls = (void *)sizeof(struct v4l2_int_ioctl_desc),
++ .num_ioctls = 0,
++};
++
++static struct v4l2_int_device dummy = {
++ .type = v4l2_int_type_slave,
++ .u = {
++ .slave = &dummy_slave,
++ },
++};
++
++struct v4l2_int_device *v4l2_int_device_dummy()
++{
++ return &dummy;
++}
++EXPORT_SYMBOL_GPL(v4l2_int_device_dummy);
++
+ void v4l2_int_device_try_attach_all(void)
+ {
+ mutex_lock(&mutex);
+diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
+index fbf5855..5d254c4 100644
+--- a/include/media/v4l2-int-device.h
++++ b/include/media/v4l2-int-device.h
+@@ -84,6 +84,8 @@ struct v4l2_int_device {
+ void *priv;
+ };
+
++struct v4l2_int_device *v4l2_int_device_dummy(void);
++
+ void v4l2_int_device_try_attach_all(void);
+
+ int v4l2_int_device_register(struct v4l2_int_device *d);
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0004-V4L-int-device-add-support-for-VIDIOC_QUERYMENU.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0004-V4L-int-device-add-support-for-VIDIOC_QUERYMENU.patch
new file mode 100644
index 0000000000..b81b20419e
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0004-V4L-int-device-add-support-for-VIDIOC_QUERYMENU.patch
@@ -0,0 +1,33 @@
+From e041e57cafca24cf92430cdf3cc091060a271e19 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@nokia.com>
+Date: Fri, 31 Oct 2008 10:20:31 +0200
+Subject: [PATCH] V4L: int device: add support for VIDIOC_QUERYMENU
+
+Signed-off-by: Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
+---
+ include/media/v4l2-int-device.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
+index 5d254c4..81f4863 100644
+--- a/include/media/v4l2-int-device.h
++++ b/include/media/v4l2-int-device.h
+@@ -178,6 +178,7 @@ enum v4l2_int_ioctl_num {
+ vidioc_int_s_fmt_cap_num,
+ vidioc_int_try_fmt_cap_num,
+ vidioc_int_queryctrl_num,
++ vidioc_int_querymenu_num,
+ vidioc_int_g_ctrl_num,
+ vidioc_int_s_ctrl_num,
+ vidioc_int_cropcap_num,
+@@ -282,6 +283,7 @@ V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *);
+ V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *);
+ V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *);
+ V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
++V4L2_INT_WRAPPER_1(querymenu, struct v4l2_querymenu, *);
+ V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
+ V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
+ V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *);
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0005-V4L-Int-if-Add-vidioc_int_querycap.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0005-V4L-Int-if-Add-vidioc_int_querycap.patch
new file mode 100644
index 0000000000..a9e06290fa
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/isp/v4l/0005-V4L-Int-if-Add-vidioc_int_querycap.patch
@@ -0,0 +1,35 @@
+From dc05ee10583dca44e0f8d4109bd1397ee3c5ffae Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sakari.ailus@nokia.com>
+Date: Thu, 2 Oct 2008 11:55:07 +0300
+Subject: [PATCH] V4L: Int if: Add vidioc_int_querycap
+
+Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
+---
+ include/media/v4l2-int-device.h | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
+index 81f4863..2830ae1 100644
+--- a/include/media/v4l2-int-device.h
++++ b/include/media/v4l2-int-device.h
+@@ -173,7 +173,8 @@ enum v4l2_int_ioctl_num {
+ * "Proper" V4L ioctls, as in struct video_device.
+ *
+ */
+- vidioc_int_enum_fmt_cap_num = 1,
++ vidioc_int_querycap_num = 1,
++ vidioc_int_enum_fmt_cap_num,
+ vidioc_int_g_fmt_cap_num,
+ vidioc_int_s_fmt_cap_num,
+ vidioc_int_try_fmt_cap_num,
+@@ -278,6 +279,7 @@ enum v4l2_int_ioctl_num {
+ return desc; \
+ }
+
++V4L2_INT_WRAPPER_1(querycap, struct v4l2_capability, *);
+ V4L2_INT_WRAPPER_1(enum_fmt_cap, struct v4l2_fmtdesc, *);
+ V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *);
+ V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *);
+--
+1.5.6.5
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/make-alignment-visible.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/make-alignment-visible.diff
new file mode 100644
index 0000000000..9b3958f82a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/make-alignment-visible.diff
@@ -0,0 +1,26 @@
+From: Mans Rullgard <mans@mansr.com>
+Date: Mon, 13 Oct 2008 19:32:16 +0000 (+0100)
+Subject: ARM: Add prompt for CONFIG_ALIGNMENT_TRAP
+X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=60d60f0ca47fcf4fbb649e45aa64f5a0a4c2f2c8
+
+ARM: Add prompt for CONFIG_ALIGNMENT_TRAP
+
+This adds a prompt text for CONFIG_ALIGNMENT_TRAP, thus making it
+visible in make *config.
+
+Signed-off-by: Mans Rullgard <mans@mansr.com>
+---
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 61314f6..18d3119 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -971,7 +971,7 @@ config LEDS_CPU
+ will overrule the CPU usage LED.
+
+ config ALIGNMENT_TRAP
+- bool
++ bool "Enable alignment trap"
+ depends on CPU_CP15_MMU
+ default y if !ARCH_EBSA110
+ help
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/mmctiming.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/mmctiming.patch
new file mode 100644
index 0000000000..ec540ab3cb
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/mmctiming.patch
@@ -0,0 +1,16 @@
+Index: git/drivers/mmc/core/core.c
+===================================================================
+--- git.orig/drivers/mmc/core/core.c
++++ git/drivers/mmc/core/core.c
+@@ -284,9 +284,9 @@ void mmc_set_data_timeout(struct mmc_dat
+ * The limit is really 250 ms, but that is
+ * insufficient for some crappy cards.
+ */
+- limit_us = 300000;
++ limit_us = 500000;
+ else
+- limit_us = 100000;
++ limit_us = 200000;
+
+ /*
+ * SDHC cards always use these fixed values.
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/modedb-hd720.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/modedb-hd720.patch
new file mode 100644
index 0000000000..0166de651a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/modedb-hd720.patch
@@ -0,0 +1,13 @@
+--- orig/drivers/video/modedb.c.orig 2009-04-07 11:40:10.000000000 +0200
++++ git/drivers/video/modedb.c 2009-04-07 10:35:29.000000000 +0200
+@@ -44,6 +44,10 @@
+ NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
+ 0, FB_VMODE_NONINTERLACED
+ }, {
++ /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */
++ "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5,
++ 0, FB_VMODE_NONINTERLACED
++ }, {
+ /* 800x600 @ 56 Hz, 35.15 kHz hsync */
+ NULL, 56, 800, 600, 27777, 128, 24, 22, 1, 72, 2,
+ 0, FB_VMODE_NONINTERLACED
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0001-USB-musb-only-turn-off-vbus-in-OTG-hosts.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0001-USB-musb-only-turn-off-vbus-in-OTG-hosts.patch
new file mode 100644
index 0000000000..a7898d1440
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0001-USB-musb-only-turn-off-vbus-in-OTG-hosts.patch
@@ -0,0 +1,43 @@
+From a9199e8ab6d6fb105aa251d6bf2192e7eafac8ee Mon Sep 17 00:00:00 2001
+From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:22:53 -0700
+Subject: [PATCH] USB: musb: only turn off vbus in OTG hosts
+
+Except on DaVinci, VBUS is now switched off as part of idling the
+USB link (after a_wait_bcon) whenever a device is disconnected
+from host. This is correct for OTG hosts, where either SRP or
+an ID interrupt could turn VBUS on again.
+
+However, for non-OTG hosts there's no way to turn VBUS on again,
+so the host becomes unusable. And the procfs entry which once
+allowed a manual workaround for this is now gone.
+
+This patch adds an is_otg_enabled() check before scheduling the
+switch-off timer in disconnect path, supporting a "classic host"
+mode where SRP is unavailable.
+
+[ dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: tweak patch description ]
+
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index af77e46..338cd16 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -769,7 +769,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ case OTG_STATE_A_SUSPEND:
+ usb_hcd_resume_root_hub(musb_to_hcd(musb));
+ musb_root_disconnect(musb);
+- if (musb->a_wait_bcon != 0)
++ if (musb->a_wait_bcon != 0 && is_otg_enabled(musb))
+ musb_platform_try_idle(musb, jiffies
+ + msecs_to_jiffies(musb->a_wait_bcon));
+ break;
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch
new file mode 100644
index 0000000000..5cb7bcb065
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0002-USB-composite-avoid-inconsistent-lock-state.patch
@@ -0,0 +1,76 @@
+From 83eb44b1c84f99d9a5c67612bd94b4ed7c43f64c Mon Sep 17 00:00:00 2001
+From: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:22:49 -0700
+Subject: [PATCH] USB: composite: avoid inconsistent lock state
+
+Avoid the following INFO from lock debugging:
+
+[ 369.126112] =================================
+[ 369.132063] [ INFO: inconsistent lock state ]
+[ 369.136457] 2.6.28-maemo1 #1
+[ 369.139387] ---------------------------------
+[ 369.143782] inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
+[ 369.149855] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
+[ 369.154890] (&cdev->lock){+-..}, at: [<bf1979f0>] composite_disconnect+0x1c/0]
+[ 369.163404] {hardirq-on-W} state was registered at:
+[ 369.168348] [<c00788a8>] __lock_acquire+0x5d0/0x7d8
+[ 369.173506] [<c0078b14>] lock_acquire+0x64/0x78
+[ 369.178266] [<c0263a34>] _spin_lock+0x4c/0x80
+[ 369.182905] [<bf19597c>] usb_function_deactivate+0x20/0x70 [g_nokia]
+[ 369.189527] [<bf1a0a88>] 0xbf1a0a88
+[ 369.193281] [<bf19f450>] 0xbf19f450
+[ 369.197004] [<bf19fa3c>] 0xbf19fa3c
+[ 369.200758] [<bf1a03a0>] 0xbf1a03a0
+[ 369.204481] [<bf19f254>] 0xbf19f254
+[ 369.208204] [<bf1a0158>] 0xbf1a0158
+[ 369.211927] [<bf1a130c>] 0xbf1a130c
+[ 369.215650] [<c01c21f0>] usb_gadget_register_driver+0x12c/0x28c
+[ 369.221846] [<bf1a06bc>] 0xbf1a06bc
+[ 369.225569] [<bf1a06e8>] 0xbf1a06e8
+[ 369.229322] [<c002c2dc>] __exception_text_end+0x64/0x19c
+[ 369.234877] [<c0081628>] sys_init_module+0x9c/0x194
+[ 369.240004] [<c002c8e0>] ret_fast_syscall+0x0/0x2c
+[ 369.245039] [<ffffffff>] 0xffffffff
+[ 369.248793] irq event stamp: 218356
+[ 369.252302] hardirqs last enabled at (218355): [<c003a77c>] omap3_enter_idle+8
+[ 369.260420] hardirqs last disabled at (218356): [<c0264774>] __irq_svc+0x34/0x0
+[ 369.267927] softirqs last enabled at (218348): [<c00585a4>] __do_softirq+0x134
+[ 369.275892] softirqs last disabled at (218335): [<c005899c>] irq_exit+0x60/0xb0
+[ 369.283308]
+[ 369.283308] other info that might help us debug this:
+[ 369.289930] no locks held by swapper/0.
+
+Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
+Signed-off-by: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/gadget/composite.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
+index 5d11c29..40f1da7 100644
+--- a/drivers/usb/gadget/composite.c
++++ b/drivers/usb/gadget/composite.c
+@@ -149,16 +149,17 @@ done:
+ int usb_function_deactivate(struct usb_function *function)
+ {
+ struct usb_composite_dev *cdev = function->config->cdev;
++ unsigned long flags;
+ int status = 0;
+
+- spin_lock(&cdev->lock);
++ spin_lock_irqsave(&cdev->lock, flags);
+
+ if (cdev->deactivations == 0)
+ status = usb_gadget_disconnect(cdev->gadget);
+ if (status == 0)
+ cdev->deactivations++;
+
+- spin_unlock(&cdev->lock);
++ spin_unlock_irqrestore(&cdev->lock, flags);
+ return status;
+ }
+
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0003-USB-musb-NAK-timeout-scheme-on-bulk-RX-endpoint.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0003-USB-musb-NAK-timeout-scheme-on-bulk-RX-endpoint.patch
new file mode 100644
index 0000000000..fadad9e44a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0003-USB-musb-NAK-timeout-scheme-on-bulk-RX-endpoint.patch
@@ -0,0 +1,218 @@
+From ba7b26e69f4bb41f10be444c5fded853330f82b5 Mon Sep 17 00:00:00 2001
+From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:22:51 -0700
+Subject: [PATCH] USB: musb: NAK timeout scheme on bulk RX endpoint
+
+Fixes endpoint starvation issue when more than one bulk QH is
+multiplexed on the reserved bulk RX endpoint, which is normal
+for cases like serial and ethernet adapters.
+
+This patch sets the NAK timeout interval for such QHs, and when
+a timeout triggers the next QH will be scheduled. (This resembles
+the bulk scheduling done in hardware by EHCI, OHCI, and UHCI.)
+
+This scheme doesn't work for devices which are connected to a
+high to full speed tree (transaction translator) as there is
+no NAK timeout interrupt from the musb controller from such
+devices.
+
+Tested with PIO, Inventra DMA, CPPI DMA.
+
+[ dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: fold in start_urb() update;
+ clarify only for bulk RX; don't accidentally clear WZC bits ]
+
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 112 ++++++++++++++++++++++++++++++++----------
+ 1 files changed, 85 insertions(+), 27 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index 6dbbd07..bd1d5ae 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -64,11 +64,8 @@
+ *
+ * - DMA (Mentor/OMAP) ...has at least toggle update problems
+ *
+- * - Still no traffic scheduling code to make NAKing for bulk or control
+- * transfers unable to starve other requests; or to make efficient use
+- * of hardware with periodic transfers. (Note that network drivers
+- * commonly post bulk reads that stay pending for a long time; these
+- * would make very visible trouble.)
++ * - [23-feb-2009] minimal traffic scheduling to avoid bulk RX packet
++ * starvation ... nothing yet for TX, interrupt, or bulk.
+ *
+ * - Not tested with HNP, but some SRP paths seem to behave.
+ *
+@@ -88,11 +85,8 @@
+ *
+ * CONTROL transfers all go through ep0. BULK ones go through dedicated IN
+ * and OUT endpoints ... hardware is dedicated for those "async" queue(s).
+- *
+ * (Yes, bulk _could_ use more of the endpoints than that, and would even
+- * benefit from it ... one remote device may easily be NAKing while others
+- * need to perform transfers in that same direction. The same thing could
+- * be done in software though, assuming dma cooperates.)
++ * benefit from it.)
+ *
+ * INTERUPPT and ISOCHRONOUS transfers are scheduled to the other endpoints.
+ * So far that scheduling is both dumb and optimistic: the endpoint will be
+@@ -201,8 +195,9 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ len = urb->iso_frame_desc[0].length;
+ break;
+ default: /* bulk, interrupt */
+- buf = urb->transfer_buffer;
+- len = urb->transfer_buffer_length;
++ /* actual_length may be nonzero on retry paths */
++ buf = urb->transfer_buffer + urb->actual_length;
++ len = urb->transfer_buffer_length - urb->actual_length;
+ }
+
+ DBG(4, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d\n",
+@@ -1045,7 +1040,8 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
+
+ /* NOTE: this code path would be a good place to PAUSE a
+ * control transfer, if another one is queued, so that
+- * ep0 is more likely to stay busy.
++ * ep0 is more likely to stay busy. That's already done
++ * for bulk RX transfers.
+ *
+ * if (qh->ring.next != &musb->control), then
+ * we have a candidate... NAKing is *NOT* an error
+@@ -1197,6 +1193,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ /* NOTE: this code path would be a good place to PAUSE a
+ * transfer, if there's some other (nonperiodic) tx urb
+ * that could use this fifo. (dma complicates it...)
++ * That's already done for bulk RX transfers.
+ *
+ * if (bulk && qh->ring.next != &musb->out_bulk), then
+ * we have a candidate... NAKing is *NOT* an error
+@@ -1358,6 +1355,50 @@ finish:
+
+ #endif
+
++/* Schedule next QH from musb->in_bulk and move the current qh to
++ * the end; avoids starvation for other endpoints.
++ */
++static void musb_bulk_rx_nak_timeout(struct musb *musb, struct musb_hw_ep *ep)
++{
++ struct dma_channel *dma;
++ struct urb *urb;
++ void __iomem *mbase = musb->mregs;
++ void __iomem *epio = ep->regs;
++ struct musb_qh *cur_qh, *next_qh;
++ u16 rx_csr;
++
++ musb_ep_select(mbase, ep->epnum);
++ dma = is_dma_capable() ? ep->rx_channel : NULL;
++
++ /* clear nak timeout bit */
++ rx_csr = musb_readw(epio, MUSB_RXCSR);
++ rx_csr |= MUSB_RXCSR_H_WZC_BITS;
++ rx_csr &= ~MUSB_RXCSR_DATAERROR;
++ musb_writew(epio, MUSB_RXCSR, rx_csr);
++
++ cur_qh = first_qh(&musb->in_bulk);
++ if (cur_qh) {
++ urb = next_urb(cur_qh);
++ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
++ dma->status = MUSB_DMA_STATUS_CORE_ABORT;
++ musb->dma_controller->channel_abort(dma);
++ urb->actual_length += dma->actual_len;
++ dma->actual_len = 0L;
++ }
++ musb_save_toggle(ep, 1, urb);
++
++ /* move cur_qh to end of queue */
++ list_move_tail(&cur_qh->ring, &musb->in_bulk);
++
++ /* get the next qh from musb->in_bulk */
++ next_qh = first_qh(&musb->in_bulk);
++
++ /* set rx_reinit and schedule the next qh */
++ ep->rx_reinit = 1;
++ musb_start_urb(musb, 1, next_qh);
++ }
++}
++
+ /*
+ * Service an RX interrupt for the given IN endpoint; docs cover bulk, iso,
+ * and high-bandwidth IN transfer cases.
+@@ -1421,18 +1462,26 @@ void musb_host_rx(struct musb *musb, u8 epnum)
+ } else if (rx_csr & MUSB_RXCSR_DATAERROR) {
+
+ if (USB_ENDPOINT_XFER_ISOC != qh->type) {
+- /* NOTE this code path would be a good place to PAUSE a
+- * transfer, if there's some other (nonperiodic) rx urb
+- * that could use this fifo. (dma complicates it...)
++ DBG(6, "RX end %d NAK timeout\n", epnum);
++
++ /* NOTE: NAKing is *NOT* an error, so we want to
++ * continue. Except ... if there's a request for
++ * another QH, use that instead of starving it.
+ *
+- * if (bulk && qh->ring.next != &musb->in_bulk), then
+- * we have a candidate... NAKing is *NOT* an error
++ * Devices like Ethernet and serial adapters keep
++ * reads posted at all times, which will starve
++ * other devices without this logic.
+ */
+- DBG(6, "RX end %d NAK timeout\n", epnum);
++ if (usb_pipebulk(urb->pipe)
++ && qh->mux == 1
++ && !list_is_singular(&musb->in_bulk)) {
++ musb_bulk_rx_nak_timeout(musb, hw_ep);
++ return;
++ }
+ musb_ep_select(mbase, epnum);
+- musb_writew(epio, MUSB_RXCSR,
+- MUSB_RXCSR_H_WZC_BITS
+- | MUSB_RXCSR_H_REQPKT);
++ rx_csr |= MUSB_RXCSR_H_WZC_BITS;
++ rx_csr &= ~MUSB_RXCSR_DATAERROR;
++ musb_writew(epio, MUSB_RXCSR, rx_csr);
+
+ goto finish;
+ } else {
+@@ -1756,6 +1805,17 @@ static int musb_schedule(
+ head = &musb->in_bulk;
+ else
+ head = &musb->out_bulk;
++
++ /* Enable bulk RX NAK timeout scheme when bulk requests are
++ * multiplexed. This scheme doen't work in high speed to full
++ * speed scenario as NAK interrupts are not coming from a
++ * full speed device connected to a high speed device.
++ * NAK timeout interval is 8 (128 uframe or 16ms) for HS and
++ * 4 (8 frame or 8ms) for FS device.
++ */
++ if (is_in && qh->dev)
++ qh->intv_reg =
++ (USB_SPEED_HIGH == qh->dev->speed) ? 8 : 4;
+ goto success;
+ } else if (best_end < 0) {
+ return -ENOSPC;
+@@ -1888,13 +1948,11 @@ static int musb_urb_enqueue(
+ *
+ * The downside of disabling this is that transfer scheduling
+ * gets VERY unfair for nonperiodic transfers; a misbehaving
+- * peripheral could make that hurt. Or for reads, one that's
+- * perfectly normal: network and other drivers keep reads
+- * posted at all times, having one pending for a week should
+- * be perfectly safe.
++ * peripheral could make that hurt. That's perfectly normal
++ * for reads from network or serial adapters ... so we have
++ * partial NAKlimit support for bulk RX.
+ *
+- * The upside of disabling it is avoidng transfer scheduling
+- * code to put this aside for while.
++ * The upside of disabling it is simpler transfer scheduling.
+ */
+ interval = 0;
+ }
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0004-USB-musb-rewrite-host-periodic-endpoint-allocation.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0004-USB-musb-rewrite-host-periodic-endpoint-allocation.patch
new file mode 100644
index 0000000000..438f11cf7a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0004-USB-musb-rewrite-host-periodic-endpoint-allocation.patch
@@ -0,0 +1,106 @@
+From 9ebf351bcd28a89a0b1ba8d0496fffbc72421611 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:22:50 -0700
+Subject: [PATCH] USB: musb: rewrite host periodic endpoint allocation
+
+The current MUSB host code doesn't make use of all the available
+FIFOs in for periodic transfers since it wrongly assumes the RX
+and TX sides of any given hw_ep always share one FIFO.
+
+Change: use 'in_qh' and 'out_qh' fields of the 'struct musb_hw_ep'
+to check the endpoint's business; get rid of the now-unused 'periodic'
+array in the 'struct musb'. Also optimize a loop induction variable
+in the endpoint lookup code.
+
+(Based on a previous patch from Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>)
+
+[ dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: clarify description and origin
+ of this fix; whitespace ]
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.h | 1 -
+ drivers/usb/musb/musb_host.c | 28 +++++++++++-----------------
+ 2 files changed, 11 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
+index 630946a..adf1806 100644
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -331,7 +331,6 @@ struct musb {
+ struct list_head control; /* of musb_qh */
+ struct list_head in_bulk; /* of musb_qh */
+ struct list_head out_bulk; /* of musb_qh */
+- struct musb_qh *periodic[32]; /* tree of interrupt+iso */
+ #endif
+
+ /* called with IRQs blocked; ON/nonzero implies starting a session,
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index bd1d5ae..499c431 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -390,7 +390,6 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
+ * de-allocated if it's tracked and allocated;
+ * and where we'd update the schedule tree...
+ */
+- musb->periodic[ep->epnum] = NULL;
+ kfree(qh);
+ qh = NULL;
+ break;
+@@ -1760,31 +1759,27 @@ static int musb_schedule(
+
+ /* else, periodic transfers get muxed to other endpoints */
+
+- /* FIXME this doesn't consider direction, so it can only
+- * work for one half of the endpoint hardware, and assumes
+- * the previous cases handled all non-shared endpoints...
+- */
+-
+- /* we know this qh hasn't been scheduled, so all we need to do
++ /*
++ * We know this qh hasn't been scheduled, so all we need to do
+ * is choose which hardware endpoint to put it on ...
+ *
+ * REVISIT what we really want here is a regular schedule tree
+- * like e.g. OHCI uses, but for now musb->periodic is just an
+- * array of the _single_ logical endpoint associated with a
+- * given physical one (identity mapping logical->physical).
+- *
+- * that simplistic approach makes TT scheduling a lot simpler;
+- * there is none, and thus none of its complexity...
++ * like e.g. OHCI uses.
+ */
+ best_diff = 4096;
+ best_end = -1;
+
+- for (epnum = 1; epnum < musb->nr_endpoints; epnum++) {
++ for (epnum = 1, hw_ep = musb->endpoints + 1;
++ epnum < musb->nr_endpoints;
++ epnum++, hw_ep++) {
+ int diff;
+
+- if (musb->periodic[epnum])
++ if (is_in || hw_ep->is_shared_fifo) {
++ if (hw_ep->in_qh != NULL)
++ continue;
++ } else if (hw_ep->out_qh != NULL)
+ continue;
+- hw_ep = &musb->endpoints[epnum];
++
+ if (hw_ep == musb->bulk_ep)
+ continue;
+
+@@ -1824,7 +1819,6 @@ static int musb_schedule(
+ idle = 1;
+ qh->mux = 0;
+ hw_ep = musb->endpoints + best_end;
+- musb->periodic[best_end] = qh;
+ DBG(4, "qh %p periodic slot %d\n", qh, best_end);
+ success:
+ if (head) {
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0005-USB-TWL-disable-VUSB-regulators-when-cable-unplugg.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0005-USB-TWL-disable-VUSB-regulators-when-cable-unplugg.patch
new file mode 100644
index 0000000000..db3481b87b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0005-USB-TWL-disable-VUSB-regulators-when-cable-unplugg.patch
@@ -0,0 +1,181 @@
+From 60e7ce93befe795357db05001fe4caab522a421d Mon Sep 17 00:00:00 2001
+From: Jouni Hogander <jouni.hogander-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:22:57 -0700
+Subject: [PATCH] USB: TWL: disable VUSB regulators when cable unplugged
+
+This patch disables USB regulators VUSB1V5, VUSB1V8, and VUSB3V1
+when the USB cable is unplugged to reduce power consumption.
+Added a depencency from twl4030 usb driver to TWL_REGULATOR.
+
+Signed-off-by: Jouni Hogander <jouni.hogander-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi-sMOQStClEysAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/otg/Kconfig | 2 +-
+ drivers/usb/otg/twl4030-usb.c | 73 ++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 65 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
+index ee55b44..5790a5b 100644
+--- a/drivers/usb/otg/Kconfig
++++ b/drivers/usb/otg/Kconfig
+@@ -43,7 +43,7 @@ config ISP1301_OMAP
+
+ config TWL4030_USB
+ tristate "TWL4030 USB Transceiver Driver"
+- depends on TWL4030_CORE
++ depends on TWL4030_CORE && REGULATOR_TWL4030
+ select USB_OTG_UTILS
+ help
+ Enable this to support the USB OTG transceiver on TWL4030
+diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
+index 416e441..d9478d0 100644
+--- a/drivers/usb/otg/twl4030-usb.c
++++ b/drivers/usb/otg/twl4030-usb.c
+@@ -34,6 +34,8 @@
+ #include <linux/delay.h>
+ #include <linux/usb/otg.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/regulator/consumer.h>
++#include <linux/err.h>
+
+
+ /* Register defines */
+@@ -246,6 +248,11 @@ struct twl4030_usb {
+ struct otg_transceiver otg;
+ struct device *dev;
+
++ /* TWL4030 internal USB regulator supplies */
++ struct regulator *usb1v5;
++ struct regulator *usb1v8;
++ struct regulator *usb3v1;
++
+ /* for vbus reporting with irqs disabled */
+ spinlock_t lock;
+
+@@ -434,6 +441,18 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
+
+ pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);
+ if (on) {
++ regulator_enable(twl->usb3v1);
++ regulator_enable(twl->usb1v8);
++ /*
++ * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP
++ * in twl4030) resets the VUSB_DEDICATED2 register. This reset
++ * enables VUSB3V1_SLEEP bit that remaps usb3v1 ACTIVE state to
++ * SLEEP. We work around this by clearing the bit after usv3v1
++ * is re-activated. This ensures that VUSB3V1 is really active.
++ */
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0,
++ VUSB_DEDICATED2);
++ regulator_enable(twl->usb1v5);
+ pwr &= ~PHY_PWR_PHYPWD;
+ WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
+ twl4030_usb_write(twl, PHY_CLK_CTRL,
+@@ -443,6 +462,9 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
+ } else {
+ pwr |= PHY_PWR_PHYPWD;
+ WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
++ regulator_disable(twl->usb1v5);
++ regulator_disable(twl->usb1v8);
++ regulator_disable(twl->usb3v1);
+ }
+ }
+
+@@ -468,7 +490,7 @@ static void twl4030_phy_resume(struct twl4030_usb *twl)
+ twl->asleep = 0;
+ }
+
+-static void twl4030_usb_ldo_init(struct twl4030_usb *twl)
++static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
+ {
+ /* Enable writing to power configuration registers */
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY);
+@@ -480,20 +502,45 @@ static void twl4030_usb_ldo_init(struct twl4030_usb *twl)
+ /* input to VUSB3V1 LDO is from VBAT, not VBUS */
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1);
+
+- /* turn on 3.1V regulator */
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x20, VUSB3V1_DEV_GRP);
++ /* Initialize 3.1V regulator */
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_DEV_GRP);
++
++ twl->usb3v1 = regulator_get(twl->dev, "usb3v1");
++ if (IS_ERR(twl->usb3v1))
++ return -ENODEV;
++
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE);
+
+- /* turn on 1.5V regulator */
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x20, VUSB1V5_DEV_GRP);
++ /* Initialize 1.5V regulator */
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_DEV_GRP);
++
++ twl->usb1v5 = regulator_get(twl->dev, "usb1v5");
++ if (IS_ERR(twl->usb1v5))
++ goto fail1;
++
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE);
+
+- /* turn on 1.8V regulator */
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x20, VUSB1V8_DEV_GRP);
++ /* Initialize 1.8V regulator */
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_DEV_GRP);
++
++ twl->usb1v8 = regulator_get(twl->dev, "usb1v8");
++ if (IS_ERR(twl->usb1v8))
++ goto fail2;
++
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE);
+
+ /* disable access to power configuration registers */
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, PROTECT_KEY);
++
++ return 0;
++
++fail2:
++ regulator_put(twl->usb1v5);
++ twl->usb1v5 = NULL;
++fail1:
++ regulator_put(twl->usb3v1);
++ twl->usb3v1 = NULL;
++ return -ENODEV;
+ }
+
+ static ssize_t twl4030_usb_vbus_show(struct device *dev,
+@@ -598,7 +645,7 @@ static int __init twl4030_usb_probe(struct platform_device *pdev)
+ {
+ struct twl4030_usb_data *pdata = pdev->dev.platform_data;
+ struct twl4030_usb *twl;
+- int status;
++ int status, err;
+
+ if (!pdata) {
+ dev_dbg(&pdev->dev, "platform_data not available\n");
+@@ -622,7 +669,12 @@ static int __init twl4030_usb_probe(struct platform_device *pdev)
+ /* init spinlock for workqueue */
+ spin_lock_init(&twl->lock);
+
+- twl4030_usb_ldo_init(twl);
++ err = twl4030_usb_ldo_init(twl);
++ if (err) {
++ dev_err(&pdev->dev, "ldo init failed\n");
++ kfree(twl);
++ return err;
++ }
+ otg_set_transceiver(&twl->otg);
+
+ platform_set_drvdata(pdev, twl);
+@@ -688,6 +740,9 @@ static int __exit twl4030_usb_remove(struct platform_device *pdev)
+ twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB);
+
+ twl4030_phy_power(twl, 0);
++ regulator_put(twl->usb1v5);
++ regulator_put(twl->usb1v8);
++ regulator_put(twl->usb3v1);
+
+ kfree(twl);
+
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0006-USB-gadget-composite-device-level-suspend-resume-h.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0006-USB-gadget-composite-device-level-suspend-resume-h.patch
new file mode 100644
index 0000000000..3f49a4d636
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0006-USB-gadget-composite-device-level-suspend-resume-h.patch
@@ -0,0 +1,84 @@
+From 7eef82d231578140c6000d04846a48bdaf341a65 Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 24 Mar 2009 17:23:19 -0700
+Subject: [PATCH] USB: gadget: composite device-level suspend/resume hooks
+
+Address one open question in the composite gadget framework:
+Yes, we should have device-level suspend/resume callbacks
+in addition to the function-level ones. We have at least one
+scenario (with gadget zero in OTG test mode) that's awkward
+to handle without it.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
+---
+ drivers/usb/gadget/composite.c | 8 ++++++--
+ include/linux/usb/composite.h | 8 ++++++++
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
+index 40f1da7..59e8523 100644
+--- a/drivers/usb/gadget/composite.c
++++ b/drivers/usb/gadget/composite.c
+@@ -1014,7 +1014,7 @@ composite_suspend(struct usb_gadget *gadget)
+ struct usb_composite_dev *cdev = get_gadget_data(gadget);
+ struct usb_function *f;
+
+- /* REVISIT: should we have config and device level
++ /* REVISIT: should we have config level
+ * suspend/resume callbacks?
+ */
+ DBG(cdev, "suspend\n");
+@@ -1024,6 +1024,8 @@ composite_suspend(struct usb_gadget *gadget)
+ f->suspend(f);
+ }
+ }
++ if (composite->suspend)
++ composite->suspend(cdev);
+ }
+
+ static void
+@@ -1032,10 +1034,12 @@ composite_resume(struct usb_gadget *gadget)
+ struct usb_composite_dev *cdev = get_gadget_data(gadget);
+ struct usb_function *f;
+
+- /* REVISIT: should we have config and device level
++ /* REVISIT: should we have config level
+ * suspend/resume callbacks?
+ */
+ DBG(cdev, "resume\n");
++ if (composite->resume)
++ composite->resume(cdev);
+ if (cdev->config) {
+ list_for_each_entry(f, &cdev->config->functions, list) {
+ if (f->resume)
+diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
+index 935c380..acd7b0f 100644
+--- a/include/linux/usb/composite.h
++++ b/include/linux/usb/composite.h
+@@ -244,6 +244,10 @@ int usb_add_config(struct usb_composite_dev *,
+ * value; it should return zero on successful initialization.
+ * @unbind: Reverses @bind(); called as a side effect of unregistering
+ * this driver.
++ * @suspend: Notifies when the host stops sending USB traffic,
++ * after function notifications
++ * @resume: Notifies configuration when the host restarts USB traffic,
++ * before function notifications
+ *
+ * Devices default to reporting self powered operation. Devices which rely
+ * on bus powered operation should report this in their @bind() method.
+@@ -268,6 +272,10 @@ struct usb_composite_driver {
+
+ int (*bind)(struct usb_composite_dev *);
+ int (*unbind)(struct usb_composite_dev *);
++
++ /* global suspend hooks */
++ void (*suspend)(struct usb_composite_dev *);
++ void (*resume)(struct usb_composite_dev *);
+ };
+
+ extern int usb_composite_register(struct usb_composite_driver *);
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0007-usb-gadget-fix-ethernet-link-reports-to-ethtool.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0007-usb-gadget-fix-ethernet-link-reports-to-ethtool.patch
new file mode 100644
index 0000000000..a89bc2ff5c
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0007-usb-gadget-fix-ethernet-link-reports-to-ethtool.patch
@@ -0,0 +1,47 @@
+From 00c4bd07a64061ec9ab9c35f5bf01ec6187138f4 Mon Sep 17 00:00:00 2001
+From: Jonathan McDowell <noodles-4QvXXjU8Dv4@public.gmane.org>
+Date: Thu, 26 Mar 2009 00:45:27 -0700
+Subject: [PATCH] usb gadget: fix ethernet link reports to ethtool
+
+The g_ether USB gadget driver currently decides whether or not there's a
+link to report back for eth_get_link based on if the USB link speed is
+set. The USB gadget speed is however often set even before the device is
+enumerated. It seems more sensible to only report a "link" if we're
+actually connected to a host that wants to talk to us. The patch below
+does this for me - tested with the PXA27x UDC driver.
+
+Signed-Off-By: Jonathan McDowell <noodles-4QvXXjU8Dv4@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/gadget/u_ether.c | 8 +-------
+ 1 files changed, 1 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
+index 96d65ca..4007770 100644
+--- a/drivers/usb/gadget/u_ether.c
++++ b/drivers/usb/gadget/u_ether.c
+@@ -175,12 +175,6 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)
+ strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info);
+ }
+
+-static u32 eth_get_link(struct net_device *net)
+-{
+- struct eth_dev *dev = netdev_priv(net);
+- return dev->gadget->speed != USB_SPEED_UNKNOWN;
+-}
+-
+ /* REVISIT can also support:
+ * - WOL (by tracking suspends and issuing remote wakeup)
+ * - msglevel (implies updated messaging)
+@@ -189,7 +183,7 @@ static u32 eth_get_link(struct net_device *net)
+
+ static struct ethtool_ops ops = {
+ .get_drvinfo = eth_get_drvinfo,
+- .get_link = eth_get_link
++ .get_link = ethtool_op_get_link,
+ };
+
+ static void defer_kevent(struct eth_dev *dev, int flag)
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0008-usb-musb_host-minor-enqueue-locking-fix-v2.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0008-usb-musb_host-minor-enqueue-locking-fix-v2.patch
new file mode 100644
index 0000000000..8627825b5a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0008-usb-musb_host-minor-enqueue-locking-fix-v2.patch
@@ -0,0 +1,60 @@
+From c3b527a21104b6bb61558fba6c65aa80f63e0772 Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Thu, 26 Mar 2009 17:36:57 -0700
+Subject: [PATCH] usb: musb_host, minor enqueue locking fix (v2)
+
+Someone noted that the enqueue path used an unlocked access
+for usb_host_endpoint->hcpriv ... fix that, by being safe
+and always accessing it under spinlock protection.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 17 ++++++++---------
+ 1 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index 499c431..ff09595 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -1841,7 +1841,7 @@ static int musb_urb_enqueue(
+ unsigned long flags;
+ struct musb *musb = hcd_to_musb(hcd);
+ struct usb_host_endpoint *hep = urb->ep;
+- struct musb_qh *qh = hep->hcpriv;
++ struct musb_qh *qh;
+ struct usb_endpoint_descriptor *epd = &hep->desc;
+ int ret;
+ unsigned type_reg;
+@@ -1853,22 +1853,21 @@ static int musb_urb_enqueue(
+
+ spin_lock_irqsave(&musb->lock, flags);
+ ret = usb_hcd_link_urb_to_ep(hcd, urb);
++ qh = ret ? NULL : hep->hcpriv;
++ if (qh)
++ urb->hcpriv = qh;
+ spin_unlock_irqrestore(&musb->lock, flags);
+- if (ret)
+- return ret;
+
+ /* DMA mapping was already done, if needed, and this urb is on
+- * hep->urb_list ... so there's little to do unless hep wasn't
+- * yet scheduled onto a live qh.
++ * hep->urb_list now ... so we're done, unless hep wasn't yet
++ * scheduled onto a live qh.
+ *
+ * REVISIT best to keep hep->hcpriv valid until the endpoint gets
+ * disabled, testing for empty qh->ring and avoiding qh setup costs
+ * except for the first urb queued after a config change.
+ */
+- if (qh) {
+- urb->hcpriv = qh;
+- return 0;
+- }
++ if (qh || ret)
++ return ret;
+
+ /* Allocate and initialize qh, minimizing the work done each time
+ * hw_ep gets reprogrammed, or with irqs blocked. Then schedule it.
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0009-usb-musb_host-fix-ep0-fifo-flushing.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0009-usb-musb_host-fix-ep0-fifo-flushing.patch
new file mode 100644
index 0000000000..09fc0a17d0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0009-usb-musb_host-fix-ep0-fifo-flushing.patch
@@ -0,0 +1,93 @@
+From 48ce47b15bfd420982ee275c595a9139eb6fabf7 Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Thu, 26 Mar 2009 17:38:30 -0700
+Subject: [PATCH] usb: musb_host, fix ep0 fifo flushing
+
+The MUSB host side can't share generic TX FIFO flush logic
+with EP0; the EP0 TX status register bits are different
+from those for other entpoints.
+
+Resolve this issue by providing a new EP0-specific routine
+to flush and reset the FIFO, which pays careful attention to
+restrictions listed in the latest programmer's guide. This
+gets rid of an open issue whereby the usbtest control write
+test (#14) failed.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 38 +++++++++++++++++++++++++-------------
+ 1 files changed, 25 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index ff09595..a5d75aa 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -125,6 +125,29 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep)
+ }
+ }
+
++static void musb_h_ep0_flush_fifo(struct musb_hw_ep *ep)
++{
++ void __iomem *epio = ep->regs;
++ u16 csr;
++ int retries = 5;
++
++ /* scrub any data left in the fifo */
++ do {
++ csr = musb_readw(epio, MUSB_TXCSR);
++ if (!(csr & (MUSB_CSR0_TXPKTRDY | MUSB_CSR0_RXPKTRDY)))
++ break;
++ musb_writew(epio, MUSB_TXCSR, MUSB_CSR0_FLUSHFIFO);
++ csr = musb_readw(epio, MUSB_TXCSR);
++ udelay(10);
++ } while (--retries);
++
++ WARN(!retries, "Could not flush host TX%d fifo: csr: %04x\n",
++ ep->epnum, csr);
++
++ /* and reset for the next transfer */
++ musb_writew(epio, MUSB_TXCSR, 0);
++}
++
+ /*
+ * Start transmit. Caller is responsible for locking shared resources.
+ * musb must be locked.
+@@ -693,11 +716,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ musb_writew(epio, MUSB_TXCSR, csr);
+ csr = musb_readw(epio, MUSB_TXCSR);
+ } else {
+- /* endpoint 0: just flush */
+- musb_writew(epio, MUSB_CSR0,
+- csr | MUSB_CSR0_FLUSHFIFO);
+- musb_writew(epio, MUSB_CSR0,
+- csr | MUSB_CSR0_FLUSHFIFO);
++ musb_h_ep0_flush_fifo(hw_ep);
+ }
+
+ /* target addr and (for multipoint) hub addr/port */
+@@ -1063,11 +1082,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
+ csr &= ~MUSB_CSR0_H_NAKTIMEOUT;
+ musb_writew(epio, MUSB_CSR0, csr);
+ } else {
+- csr |= MUSB_CSR0_FLUSHFIFO;
+- musb_writew(epio, MUSB_CSR0, csr);
+- musb_writew(epio, MUSB_CSR0, csr);
+- csr &= ~MUSB_CSR0_H_NAKTIMEOUT;
+- musb_writew(epio, MUSB_CSR0, csr);
++ musb_h_ep0_flush_fifo(hw_ep);
+ }
+
+ musb_writeb(epio, MUSB_NAKLIMIT0, 0);
+@@ -1081,9 +1096,6 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
+ * SHOULD NEVER HAPPEN! */
+ ERR("no URB for end 0\n");
+
+- musb_writew(epio, MUSB_CSR0, MUSB_CSR0_FLUSHFIFO);
+- musb_writew(epio, MUSB_CSR0, MUSB_CSR0_FLUSHFIFO);
+- musb_writew(epio, MUSB_CSR0, 0);
+
+ goto done;
+ }
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0010-musb-sanitize-clearing-TXCSR-DMA-bits-take-2.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0010-musb-sanitize-clearing-TXCSR-DMA-bits-take-2.patch
new file mode 100644
index 0000000000..bcbe3bbe39
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0010-musb-sanitize-clearing-TXCSR-DMA-bits-take-2.patch
@@ -0,0 +1,361 @@
+From c99f4a68268801a2e2ffbef9766c3ac89e4fb22c Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Thu, 26 Mar 2009 18:27:47 -0700
+Subject: [PATCH] musb: sanitize clearing TXCSR DMA bits (take 2)
+
+The MUSB code clears TXCSR_DMAMODE incorrectly in several
+places, either asserting that TXCSR_DMAENAB is clear (when
+sometimes it isn't) or clearing both bits together. Recent
+versions of the programmer's guide require DMAENAB to be
+cleared first, although some older ones didn't.
+
+Fix this and while at it:
+
+ - In musb_gadget::txstate(), stop clearing the AUTOSET
+ and DMAMODE bits for the CPPI case since they never
+ get set anyway (the former bit is reserved on DaVinci);
+ but do clear the DMAENAB bit on the DMA error path.
+
+ - In musb_host::musb_ep_program(), remove the duplicate
+ DMA controller specific code code clearing the TXCSR
+ previous state, add the code to clear TXCSR DMA bits
+ on the Inventra DMA error path, to replace such code
+ (executed late) on the PIO path.
+
+ - In musbhsdma::dma_channel_abort()/dma_controller_irq(),
+ add/use the 'offset' variable to avoid MUSB_EP_OFFSET()
+ invocations on every RXCSR/TXCSR access.
+
+[dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: don't introduce CamelCase,
+shrink diff]
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_gadget.c | 33 +++++++++++------
+ drivers/usb/musb/musb_host.c | 79 ++++++++++++++++------------------------
+ drivers/usb/musb/musbhsdma.c | 59 ++++++++++++++++++------------
+ 3 files changed, 90 insertions(+), 81 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index c7ebd08..f79440c 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -165,9 +165,15 @@ static void nuke(struct musb_ep *ep, const int status)
+ if (is_dma_capable() && ep->dma) {
+ struct dma_controller *c = ep->musb->dma_controller;
+ int value;
++
+ if (ep->is_in) {
++ /*
++ * The programming guide says that we must not clear
++ * the DMAMODE bit before DMAENAB, so we only
++ * clear it in the second write...
++ */
+ musb_writew(epio, MUSB_TXCSR,
+- 0 | MUSB_TXCSR_FLUSHFIFO);
++ MUSB_TXCSR_DMAMODE | MUSB_TXCSR_FLUSHFIFO);
+ musb_writew(epio, MUSB_TXCSR,
+ 0 | MUSB_TXCSR_FLUSHFIFO);
+ } else {
+@@ -230,7 +236,7 @@ static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep)
+ | IN token(s) are recd from Host.
+ | -> DMA interrupt on completion
+ | calls TxAvail.
+- | -> stop DMA, ~DmaEenab,
++ | -> stop DMA, ~DMAENAB,
+ | -> set TxPktRdy for last short pkt or zlp
+ | -> Complete Request
+ | -> Continue next request (call txstate)
+@@ -315,9 +321,17 @@ static void txstate(struct musb *musb, struct musb_request *req)
+ request->dma, request_size);
+ if (use_dma) {
+ if (musb_ep->dma->desired_mode == 0) {
+- /* ASSERT: DMAENAB is clear */
+- csr &= ~(MUSB_TXCSR_AUTOSET |
+- MUSB_TXCSR_DMAMODE);
++ /*
++ * We must not clear the DMAMODE bit
++ * before the DMAENAB bit -- and the
++ * latter doesn't always get cleared
++ * before we get here...
++ */
++ csr &= ~(MUSB_TXCSR_AUTOSET
++ | MUSB_TXCSR_DMAENAB);
++ musb_writew(epio, MUSB_TXCSR, csr
++ | MUSB_TXCSR_P_WZC_BITS);
++ csr &= ~MUSB_TXCSR_DMAMODE;
+ csr |= (MUSB_TXCSR_DMAENAB |
+ MUSB_TXCSR_MODE);
+ /* against programming guide */
+@@ -334,10 +348,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
+
+ #elif defined(CONFIG_USB_TI_CPPI_DMA)
+ /* program endpoint CSR first, then setup DMA */
+- csr &= ~(MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAMODE
+- | MUSB_TXCSR_P_UNDERRUN
+- | MUSB_TXCSR_TXPKTRDY);
++ csr &= ~(MUSB_TXCSR_P_UNDERRUN | MUSB_TXCSR_TXPKTRDY);
+ csr |= MUSB_TXCSR_MODE | MUSB_TXCSR_DMAENAB;
+ musb_writew(epio, MUSB_TXCSR,
+ (MUSB_TXCSR_P_WZC_BITS & ~MUSB_TXCSR_P_UNDERRUN)
+@@ -364,8 +375,8 @@ static void txstate(struct musb *musb, struct musb_request *req)
+ if (!use_dma) {
+ c->channel_release(musb_ep->dma);
+ musb_ep->dma = NULL;
+- /* ASSERT: DMAENAB clear */
+- csr &= ~(MUSB_TXCSR_DMAMODE | MUSB_TXCSR_MODE);
++ csr &= ~MUSB_TXCSR_DMAENAB;
++ musb_writew(epio, MUSB_TXCSR, csr);
+ /* invariant: prequest->buf is non-null */
+ }
+ #elif defined(CONFIG_USB_TUSB_OMAP_DMA)
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index a5d75aa..6591282 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -590,10 +590,17 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep)
+ csr = musb_readw(ep->regs, MUSB_TXCSR);
+ if (csr & MUSB_TXCSR_MODE) {
+ musb_h_tx_flush_fifo(ep);
++ csr = musb_readw(ep->regs, MUSB_TXCSR);
+ musb_writew(ep->regs, MUSB_TXCSR,
+- MUSB_TXCSR_FRCDATATOG);
++ csr | MUSB_TXCSR_FRCDATATOG);
+ }
+- /* clear mode (and everything else) to enable Rx */
++
++ /*
++ * Clear the MODE bit (and everything else) to enable Rx.
++ * NOTE: we mustn't clear the DMAMODE bit before DMAENAB.
++ */
++ if (csr & MUSB_TXCSR_DMAMODE)
++ musb_writew(ep->regs, MUSB_TXCSR, MUSB_TXCSR_DMAMODE);
+ musb_writew(ep->regs, MUSB_TXCSR, 0);
+
+ /* scrub all previous state, clearing toggle */
+@@ -690,12 +697,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+
+ /* general endpoint setup */
+ if (epnum) {
+- /* ASSERT: TXCSR_DMAENAB was already cleared */
+-
+ /* flush all old state, set default */
+ musb_h_tx_flush_fifo(hw_ep);
++
++ /*
++ * We must not clear the DMAMODE bit before or in
++ * the same cycle with the DMAENAB bit, so we clear
++ * the latter first...
++ */
+ csr &= ~(MUSB_TXCSR_H_NAKTIMEOUT
+- | MUSB_TXCSR_DMAMODE
++ | MUSB_TXCSR_AUTOSET
++ | MUSB_TXCSR_DMAENAB
+ | MUSB_TXCSR_FRCDATATOG
+ | MUSB_TXCSR_H_RXSTALL
+ | MUSB_TXCSR_H_ERROR
+@@ -703,16 +715,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ );
+ csr |= MUSB_TXCSR_MODE;
+
+- if (usb_gettoggle(urb->dev,
+- qh->epnum, 1))
++ if (usb_gettoggle(urb->dev, qh->epnum, 1))
+ csr |= MUSB_TXCSR_H_WR_DATATOGGLE
+ | MUSB_TXCSR_H_DATATOGGLE;
+ else
+ csr |= MUSB_TXCSR_CLRDATATOG;
+
+- /* twice in case of double packet buffering */
+ musb_writew(epio, MUSB_TXCSR, csr);
+ /* REVISIT may need to clear FLUSHFIFO ... */
++ csr &= ~MUSB_TXCSR_DMAMODE;
+ musb_writew(epio, MUSB_TXCSR, csr);
+ csr = musb_readw(epio, MUSB_TXCSR);
+ } else {
+@@ -755,34 +766,19 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+
+ #ifdef CONFIG_USB_INVENTRA_DMA
+ if (dma_channel) {
+-
+- /* clear previous state */
+- csr = musb_readw(epio, MUSB_TXCSR);
+- csr &= ~(MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAMODE
+- | MUSB_TXCSR_DMAENAB);
+- csr |= MUSB_TXCSR_MODE;
+- musb_writew(epio, MUSB_TXCSR,
+- csr | MUSB_TXCSR_MODE);
+-
+ qh->segsize = min(len, dma_channel->max_len);
+-
+ if (qh->segsize <= packet_sz)
+ dma_channel->desired_mode = 0;
+ else
+ dma_channel->desired_mode = 1;
+
+-
+ if (dma_channel->desired_mode == 0) {
+- csr &= ~(MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAMODE);
++ /* Against the programming guide */
+ csr |= (MUSB_TXCSR_DMAENAB);
+- /* against programming guide */
+ } else
+ csr |= (MUSB_TXCSR_AUTOSET
+ | MUSB_TXCSR_DMAENAB
+ | MUSB_TXCSR_DMAMODE);
+-
+ musb_writew(epio, MUSB_TXCSR, csr);
+
+ dma_ok = dma_controller->channel_program(
+@@ -799,6 +795,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ else
+ hw_ep->rx_channel = NULL;
+ dma_channel = NULL;
++
++ /*
++ * The programming guide says that we must
++ * clear the DMAENAB bit before DMAMODE...
++ */
++ csr = musb_readw(epio, MUSB_TXCSR);
++ csr &= ~(MUSB_TXCSR_DMAENAB
++ | MUSB_TXCSR_AUTOSET);
++ musb_writew(epio, MUSB_TXCSR, csr);
++ csr &= ~MUSB_TXCSR_DMAMODE;
++ musb_writew(epio, MUSB_TXCSR, csr);
+ }
+ }
+ #endif
+@@ -806,18 +813,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ /* candidate for DMA */
+ if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
+
+- /* program endpoint CSRs first, then setup DMA.
+- * assume CPPI setup succeeds.
+- * defer enabling dma.
+- */
+- csr = musb_readw(epio, MUSB_TXCSR);
+- csr &= ~(MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAMODE
+- | MUSB_TXCSR_DMAENAB);
+- csr |= MUSB_TXCSR_MODE;
+- musb_writew(epio, MUSB_TXCSR,
+- csr | MUSB_TXCSR_MODE);
+-
++ /* Defer enabling DMA */
+ dma_channel->actual_len = 0L;
+ qh->segsize = len;
+
+@@ -846,20 +842,9 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ }
+
+ if (load_count) {
+- /* ASSERT: TXCSR_DMAENAB was already cleared */
+-
+ /* PIO to load FIFO */
+ qh->segsize = load_count;
+ musb_write_fifo(hw_ep, load_count, buf);
+- csr = musb_readw(epio, MUSB_TXCSR);
+- csr &= ~(MUSB_TXCSR_DMAENAB
+- | MUSB_TXCSR_DMAMODE
+- | MUSB_TXCSR_AUTOSET);
+- /* write CSR */
+- csr |= MUSB_TXCSR_MODE;
+-
+- if (epnum)
+- musb_writew(epio, MUSB_TXCSR, csr);
+ }
+
+ /* re-enable interrupt */
+diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
+index 8662e9e..40709c3 100644
+--- a/drivers/usb/musb/musbhsdma.c
++++ b/drivers/usb/musb/musbhsdma.c
+@@ -195,30 +195,32 @@ static int dma_channel_abort(struct dma_channel *channel)
+ void __iomem *mbase = musb_channel->controller->base;
+
+ u8 bchannel = musb_channel->idx;
++ int offset;
+ u16 csr;
+
+ if (channel->status == MUSB_DMA_STATUS_BUSY) {
+ if (musb_channel->transmit) {
+-
+- csr = musb_readw(mbase,
+- MUSB_EP_OFFSET(musb_channel->epnum,
+- MUSB_TXCSR));
+- csr &= ~(MUSB_TXCSR_AUTOSET |
+- MUSB_TXCSR_DMAENAB |
+- MUSB_TXCSR_DMAMODE);
+- musb_writew(mbase,
+- MUSB_EP_OFFSET(musb_channel->epnum, MUSB_TXCSR),
+- csr);
++ offset = MUSB_EP_OFFSET(musb_channel->epnum,
++ MUSB_TXCSR);
++
++ /*
++ * The programming guide says that we must clear
++ * the DMAENAB bit before the DMAMODE bit...
++ */
++ csr = musb_readw(mbase, offset);
++ csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAENAB);
++ musb_writew(mbase, offset, csr);
++ csr &= ~MUSB_TXCSR_DMAMODE;
++ musb_writew(mbase, offset, csr);
+ } else {
+- csr = musb_readw(mbase,
+- MUSB_EP_OFFSET(musb_channel->epnum,
+- MUSB_RXCSR));
++ offset = MUSB_EP_OFFSET(musb_channel->epnum,
++ MUSB_RXCSR);
++
++ csr = musb_readw(mbase, offset);
+ csr &= ~(MUSB_RXCSR_AUTOCLEAR |
+ MUSB_RXCSR_DMAENAB |
+ MUSB_RXCSR_DMAMODE);
+- musb_writew(mbase,
+- MUSB_EP_OFFSET(musb_channel->epnum, MUSB_RXCSR),
+- csr);
++ musb_writew(mbase, offset, csr);
+ }
+
+ musb_writew(mbase,
+@@ -296,14 +298,25 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
+ && ((channel->desired_mode == 0)
+ || (channel->actual_len &
+ (musb_channel->max_packet_sz - 1)))
+- ) {
++ ) {
++ u8 epnum = musb_channel->epnum;
++ int offset = MUSB_EP_OFFSET(epnum,
++ MUSB_TXCSR);
++ u16 txcsr;
++
++ /*
++ * The programming guide says that we
++ * must clear DMAENAB before DMAMODE.
++ */
++ musb_ep_select(mbase, epnum);
++ txcsr = musb_readw(mbase, offset);
++ txcsr &= ~(MUSB_TXCSR_DMAENAB
++ | MUSB_TXCSR_AUTOSET);
++ musb_writew(mbase, offset, txcsr);
+ /* Send out the packet */
+- musb_ep_select(mbase,
+- musb_channel->epnum);
+- musb_writew(mbase, MUSB_EP_OFFSET(
+- musb_channel->epnum,
+- MUSB_TXCSR),
+- MUSB_TXCSR_TXPKTRDY);
++ txcsr &= ~MUSB_TXCSR_DMAMODE;
++ txcsr |= MUSB_TXCSR_TXPKTRDY;
++ musb_writew(mbase, offset, txcsr);
+ } else {
+ musb_dma_completion(
+ musb,
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0011-musb-fix-isochronous-TXDMA-take-2.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0011-musb-fix-isochronous-TXDMA-take-2.patch
new file mode 100644
index 0000000000..7d546e10b0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0011-musb-fix-isochronous-TXDMA-take-2.patch
@@ -0,0 +1,417 @@
+From 035cd4a26e9b1638b4b0419b98409026176563ca Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Thu, 26 Mar 2009 18:29:19 -0700
+Subject: [PATCH] musb: fix isochronous TXDMA (take 2)
+
+Multi-frame isochronous TX URBs transfers in DMA mode never
+complete with CPPI DMA because musb_host_tx() doesn't restart
+DMA on the second frame, only emitting a debug message.
+With Inventra DMA they complete, but in PIO mode. To fix:
+
+ - Factor out programming of the DMA transfer from
+ musb_ep_program() into musb_tx_dma_program();
+
+ - Reorder the code at the end of musb_host_tx() to
+ facilitate the fallback to PIO iff DMA fails;
+
+ - Handle the buffer offset consistently for both
+ PIO and DMA modes;
+
+ - Add an argument to musb_ep_program() for the same
+ reason (it only worked correctly with non-zero
+ offset of the first frame in PIO mode);
+
+ - Set the completed isochronous frame descriptor's
+ 'actual_length' and 'status' fields correctly in
+ DMA mode.
+
+Also, since CPPI reportedly doesn't like sending isochronous
+packets in the RNDIS mode, change the criterion for this
+mode to be used only for multi-packet transfers. (There's
+no need for that mode in the single-packet case anyway.)
+
+[ dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: split comment paragraph
+into bullet list, shrink patch delta, style tweaks ]
+
+Signed-off-by: Pavel Kiryukhin <pkiryukhin-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/cppi_dma.c | 1 +
+ drivers/usb/musb/musb_host.c | 227 +++++++++++++++++++-----------------------
+ 2 files changed, 105 insertions(+), 123 deletions(-)
+
+diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
+index 569ef0f..ac7227c 100644
+--- a/drivers/usb/musb/cppi_dma.c
++++ b/drivers/usb/musb/cppi_dma.c
+@@ -579,6 +579,7 @@ cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx)
+ * trigger the "send a ZLP?" confusion.
+ */
+ rndis = (maxpacket & 0x3f) == 0
++ && length > maxpacket
+ && length < 0xffff
+ && (length % maxpacket) != 0;
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index 6591282..f6e84a0 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -96,8 +96,8 @@
+
+
+ static void musb_ep_program(struct musb *musb, u8 epnum,
+- struct urb *urb, unsigned int nOut,
+- u8 *buf, u32 len);
++ struct urb *urb, int is_out,
++ u8 *buf, u32 offset, u32 len);
+
+ /*
+ * Clear TX fifo. Needed to avoid BABBLE errors.
+@@ -189,9 +189,10 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ {
+ u16 frame;
+ u32 len;
+- void *buf;
+ void __iomem *mbase = musb->mregs;
+ struct urb *urb = next_urb(qh);
++ void *buf = urb->transfer_buffer;
++ u32 offset = 0;
+ struct musb_hw_ep *hw_ep = qh->hw_ep;
+ unsigned pipe = urb->pipe;
+ u8 address = usb_pipedevice(pipe);
+@@ -214,7 +215,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ case USB_ENDPOINT_XFER_ISOC:
+ qh->iso_idx = 0;
+ qh->frame = 0;
+- buf = urb->transfer_buffer + urb->iso_frame_desc[0].offset;
++ offset = urb->iso_frame_desc[0].offset;
+ len = urb->iso_frame_desc[0].length;
+ break;
+ default: /* bulk, interrupt */
+@@ -232,14 +233,14 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ case USB_ENDPOINT_XFER_ISOC: s = "-iso"; break;
+ default: s = "-intr"; break;
+ }; s; }),
+- epnum, buf, len);
++ epnum, buf + offset, len);
+
+ /* Configure endpoint */
+ if (is_in || hw_ep->is_shared_fifo)
+ hw_ep->in_qh = qh;
+ else
+ hw_ep->out_qh = qh;
+- musb_ep_program(musb, epnum, urb, !is_in, buf, len);
++ musb_ep_program(musb, epnum, urb, !is_in, buf, offset, len);
+
+ /* transmit may have more work: start it when it is time */
+ if (is_in)
+@@ -250,7 +251,6 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ case USB_ENDPOINT_XFER_ISOC:
+ case USB_ENDPOINT_XFER_INT:
+ DBG(3, "check whether there's still time for periodic Tx\n");
+- qh->iso_idx = 0;
+ frame = musb_readw(mbase, MUSB_FRAME);
+ /* FIXME this doesn't implement that scheduling policy ...
+ * or handle framecounter wrapping
+@@ -631,14 +631,68 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep)
+ ep->rx_reinit = 0;
+ }
+
++static bool musb_tx_dma_program(struct dma_controller *dma,
++ struct musb_hw_ep *hw_ep, struct musb_qh *qh,
++ struct urb *urb, u32 offset, u32 length)
++{
++ struct dma_channel *channel = hw_ep->tx_channel;
++ void __iomem *epio = hw_ep->regs;
++ u16 pkt_size = qh->maxpacket;
++ u16 csr;
++ u8 mode;
++
++#ifdef CONFIG_USB_INVENTRA_DMA
++ if (length > channel->max_len)
++ length = channel->max_len;
++
++ csr = musb_readw(epio, MUSB_TXCSR);
++ if (length > pkt_size) {
++ mode = 1;
++ csr |= MUSB_TXCSR_AUTOSET
++ | MUSB_TXCSR_DMAMODE
++ | MUSB_TXCSR_DMAENAB;
++ } else {
++ mode = 0;
++ csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAMODE);
++ csr |= MUSB_TXCSR_DMAENAB; /* against programmer's guide */
++ }
++ channel->desired_mode = mode;
++ musb_writew(epio, MUSB_TXCSR, csr);
++#else
++ if (!is_cppi_enabled() && !tusb_dma_omap())
++ return false;
++
++ channel->actual_len = 0;
++
++ /*
++ * TX uses "RNDIS" mode automatically but needs help
++ * to identify the zero-length-final-packet case.
++ */
++ mode = (urb->transfer_flags & URB_ZERO_PACKET) ? 1 : 0;
++#endif
++
++ qh->segsize = length;
++
++ if (!dma->channel_program(channel, pkt_size, mode,
++ urb->transfer_dma + offset, length)) {
++ dma->channel_release(channel);
++ hw_ep->tx_channel = NULL;
++
++ csr = musb_readw(epio, MUSB_TXCSR);
++ csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAENAB);
++ musb_writew(epio, MUSB_TXCSR, csr | MUSB_TXCSR_H_WZC_BITS);
++ return false;
++ }
++ return true;
++}
+
+ /*
+ * Program an HDRC endpoint as per the given URB
+ * Context: irqs blocked, controller lock held
+ */
+ static void musb_ep_program(struct musb *musb, u8 epnum,
+- struct urb *urb, unsigned int is_out,
+- u8 *buf, u32 len)
++ struct urb *urb, int is_out,
++ u8 *buf, u32 offset, u32 len)
+ {
+ struct dma_controller *dma_controller;
+ struct dma_channel *dma_channel;
+@@ -764,82 +818,9 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ else
+ load_count = min((u32) packet_sz, len);
+
+-#ifdef CONFIG_USB_INVENTRA_DMA
+- if (dma_channel) {
+- qh->segsize = min(len, dma_channel->max_len);
+- if (qh->segsize <= packet_sz)
+- dma_channel->desired_mode = 0;
+- else
+- dma_channel->desired_mode = 1;
+-
+- if (dma_channel->desired_mode == 0) {
+- /* Against the programming guide */
+- csr |= (MUSB_TXCSR_DMAENAB);
+- } else
+- csr |= (MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAENAB
+- | MUSB_TXCSR_DMAMODE);
+- musb_writew(epio, MUSB_TXCSR, csr);
+-
+- dma_ok = dma_controller->channel_program(
+- dma_channel, packet_sz,
+- dma_channel->desired_mode,
+- urb->transfer_dma,
+- qh->segsize);
+- if (dma_ok) {
+- load_count = 0;
+- } else {
+- dma_controller->channel_release(dma_channel);
+- if (is_out)
+- hw_ep->tx_channel = NULL;
+- else
+- hw_ep->rx_channel = NULL;
+- dma_channel = NULL;
+-
+- /*
+- * The programming guide says that we must
+- * clear the DMAENAB bit before DMAMODE...
+- */
+- csr = musb_readw(epio, MUSB_TXCSR);
+- csr &= ~(MUSB_TXCSR_DMAENAB
+- | MUSB_TXCSR_AUTOSET);
+- musb_writew(epio, MUSB_TXCSR, csr);
+- csr &= ~MUSB_TXCSR_DMAMODE;
+- musb_writew(epio, MUSB_TXCSR, csr);
+- }
+- }
+-#endif
+-
+- /* candidate for DMA */
+- if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
+-
+- /* Defer enabling DMA */
+- dma_channel->actual_len = 0L;
+- qh->segsize = len;
+-
+- /* TX uses "rndis" mode automatically, but needs help
+- * to identify the zero-length-final-packet case.
+- */
+- dma_ok = dma_controller->channel_program(
+- dma_channel, packet_sz,
+- (urb->transfer_flags
+- & URB_ZERO_PACKET)
+- == URB_ZERO_PACKET,
+- urb->transfer_dma,
+- qh->segsize);
+- if (dma_ok) {
+- load_count = 0;
+- } else {
+- dma_controller->channel_release(dma_channel);
+- hw_ep->tx_channel = NULL;
+- dma_channel = NULL;
+-
+- /* REVISIT there's an error path here that
+- * needs handling: can't do dma, but
+- * there's no pio buffer address...
+- */
+- }
+- }
++ if (dma_channel && musb_tx_dma_program(dma_controller,
++ hw_ep, qh, urb, offset, len))
++ load_count = 0;
+
+ if (load_count) {
+ /* PIO to load FIFO */
+@@ -899,7 +880,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ dma_channel, packet_sz,
+ !(urb->transfer_flags
+ & URB_SHORT_NOT_OK),
+- urb->transfer_dma,
++ urb->transfer_dma + offset,
+ qh->segsize);
+ if (!dma_ok) {
+ dma_controller->channel_release(
+@@ -1142,8 +1123,8 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ int pipe;
+ bool done = false;
+ u16 tx_csr;
+- size_t wLength = 0;
+- u8 *buf = NULL;
++ size_t length = 0;
++ size_t offset = 0;
+ struct urb *urb;
+ struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
+ void __iomem *epio = hw_ep->regs;
+@@ -1161,7 +1142,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ /* with CPPI, DMA sometimes triggers "extra" irqs */
+ if (!urb) {
+ DBG(4, "extra TX%d ready, csr %04x\n", epnum, tx_csr);
+- goto finish;
++ return;
+ }
+
+ pipe = urb->pipe;
+@@ -1198,7 +1179,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ musb_writew(epio, MUSB_TXCSR,
+ MUSB_TXCSR_H_WZC_BITS
+ | MUSB_TXCSR_TXPKTRDY);
+- goto finish;
++ return;
+ }
+
+ if (status) {
+@@ -1230,29 +1211,28 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ /* second cppi case */
+ if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
+ DBG(4, "extra TX%d ready, csr %04x\n", epnum, tx_csr);
+- goto finish;
+-
++ return;
+ }
+
+- /* REVISIT this looks wrong... */
+ if (!status || dma || usb_pipeisoc(pipe)) {
+ if (dma)
+- wLength = dma->actual_len;
++ length = dma->actual_len;
+ else
+- wLength = qh->segsize;
+- qh->offset += wLength;
++ length = qh->segsize;
++ qh->offset += length;
+
+ if (usb_pipeisoc(pipe)) {
+ struct usb_iso_packet_descriptor *d;
+
+ d = urb->iso_frame_desc + qh->iso_idx;
+- d->actual_length = qh->segsize;
++ d->actual_length = length;
++ d->status = status;
+ if (++qh->iso_idx >= urb->number_of_packets) {
+ done = true;
+ } else {
+ d++;
+- buf = urb->transfer_buffer + d->offset;
+- wLength = d->length;
++ offset = d->offset;
++ length = d->length;
+ }
+ } else if (dma) {
+ done = true;
+@@ -1265,10 +1245,8 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ & URB_ZERO_PACKET))
+ done = true;
+ if (!done) {
+- buf = urb->transfer_buffer
+- + qh->offset;
+- wLength = urb->transfer_buffer_length
+- - qh->offset;
++ offset = qh->offset;
++ length = urb->transfer_buffer_length - offset;
+ }
+ }
+ }
+@@ -1287,28 +1265,31 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ urb->status = status;
+ urb->actual_length = qh->offset;
+ musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT);
++ return;
++ } else if (usb_pipeisoc(pipe) && dma) {
++ if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
++ offset, length))
++ return;
++ } else if (tx_csr & MUSB_TXCSR_DMAENAB) {
++ DBG(1, "not complete, but DMA enabled?\n");
++ return;
++ }
+
+- } else if (!(tx_csr & MUSB_TXCSR_DMAENAB)) {
+- /* WARN_ON(!buf); */
+-
+- /* REVISIT: some docs say that when hw_ep->tx_double_buffered,
+- * (and presumably, fifo is not half-full) we should write TWO
+- * packets before updating TXCSR ... other docs disagree ...
+- */
+- /* PIO: start next packet in this URB */
+- if (wLength > qh->maxpacket)
+- wLength = qh->maxpacket;
+- musb_write_fifo(hw_ep, wLength, buf);
+- qh->segsize = wLength;
+-
+- musb_ep_select(mbase, epnum);
+- musb_writew(epio, MUSB_TXCSR,
+- MUSB_TXCSR_H_WZC_BITS | MUSB_TXCSR_TXPKTRDY);
+- } else
+- DBG(1, "not complete, but dma enabled?\n");
++ /*
++ * PIO: start next packet in this URB.
++ *
++ * REVISIT: some docs say that when hw_ep->tx_double_buffered,
++ * (and presumably, FIFO is not half-full) we should write *two*
++ * packets before updating TXCSR; other docs disagree...
++ */
++ if (length > qh->maxpacket)
++ length = qh->maxpacket;
++ musb_write_fifo(hw_ep, length, urb->transfer_buffer + offset);
++ qh->segsize = length;
+
+-finish:
+- return;
++ musb_ep_select(mbase, epnum);
++ musb_writew(epio, MUSB_TXCSR,
++ MUSB_TXCSR_H_WZC_BITS | MUSB_TXCSR_TXPKTRDY);
+ }
+
+
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0012-musb-fix-possible-panic-while-resuming.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0012-musb-fix-possible-panic-while-resuming.patch
new file mode 100644
index 0000000000..2bbde84c16
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0012-musb-fix-possible-panic-while-resuming.patch
@@ -0,0 +1,56 @@
+From b9a61b80ea89d9d6d78a23d96a28df94fd612298 Mon Sep 17 00:00:00 2001
+From: Kim Kyuwon <q1.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
+Date: Thu, 26 Mar 2009 18:56:51 -0700
+Subject: [PATCH] musb: fix possible panic while resuming
+
+During driver resume processing, musb could cause a kernel panic.
+Fix by enabling the clock earlier, with the resume_early method.
+
+Signed-off-by: Kim Kyuwon <q1.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index 338cd16..3019725 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -2170,16 +2170,13 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
+ return 0;
+ }
+
+-static int musb_resume(struct platform_device *pdev)
++static int musb_resume_early(struct platform_device *pdev)
+ {
+- unsigned long flags;
+ struct musb *musb = dev_to_musb(&pdev->dev);
+
+ if (!musb->clock)
+ return 0;
+
+- spin_lock_irqsave(&musb->lock, flags);
+-
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 1);
+ else
+@@ -2189,7 +2186,6 @@ static int musb_resume(struct platform_device *pdev)
+ * unless for some reason the whole soc powered down and we're
+ * not treating that as a whole-system restart (e.g. swsusp)
+ */
+- spin_unlock_irqrestore(&musb->lock, flags);
+ return 0;
+ }
+
+@@ -2207,7 +2203,7 @@ static struct platform_driver musb_driver = {
+ .remove = __devexit_p(musb_remove),
+ .shutdown = musb_shutdown,
+ .suspend = musb_suspend,
+- .resume = musb_resume,
++ .resume_early = musb_resume_early,
+ };
+
+ /*-------------------------------------------------------------------------*/
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch
new file mode 100644
index 0000000000..0202871d41
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch
@@ -0,0 +1,91 @@
+From 2658f7c9029967501cd4d749364f2e02d02eebd5 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:54:21 -0700
+Subject: [PATCH] musb_host: refactor musb_save_toggle() (take 2)
+
+Refactor musb_save_toggle() as follows:
+
+ - replace 'struct musb_hw_ep *ep' parameter by 'struct
+ musb_qh *qh' to avoid re-calculating this value
+
+ - move usb_settogle() call out of the *if* operator.
+
+This is a net minor shrink of source and object code.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 35 ++++++++++++-----------------------
+ 1 files changed, 12 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index f6e84a0..dc32ce4 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -318,35 +318,24 @@ __acquires(musb->lock)
+ spin_lock(&musb->lock);
+ }
+
+-/* for bulk/interrupt endpoints only */
+-static inline void
+-musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb *urb)
++/* For bulk/interrupt endpoints only */
++static inline void musb_save_toggle(struct musb_qh *qh, int is_in,
++ struct urb *urb)
+ {
+- struct usb_device *udev = urb->dev;
++ void __iomem *epio = qh->hw_ep->regs;
+ u16 csr;
+- void __iomem *epio = ep->regs;
+- struct musb_qh *qh;
+
+- /* FIXME: the current Mentor DMA code seems to have
++ /*
++ * FIXME: the current Mentor DMA code seems to have
+ * problems getting toggle correct.
+ */
+
+- if (is_in || ep->is_shared_fifo)
+- qh = ep->in_qh;
++ if (is_in)
++ csr = musb_readw(epio, MUSB_RXCSR) & MUSB_RXCSR_H_DATATOGGLE;
+ else
+- qh = ep->out_qh;
++ csr = musb_readw(epio, MUSB_TXCSR) & MUSB_TXCSR_H_DATATOGGLE;
+
+- if (!is_in) {
+- csr = musb_readw(epio, MUSB_TXCSR);
+- usb_settoggle(udev, qh->epnum, 1,
+- (csr & MUSB_TXCSR_H_DATATOGGLE)
+- ? 1 : 0);
+- } else {
+- csr = musb_readw(epio, MUSB_RXCSR);
+- usb_settoggle(udev, qh->epnum, 0,
+- (csr & MUSB_RXCSR_H_DATATOGGLE)
+- ? 1 : 0);
+- }
++ usb_settoggle(urb->dev, qh->epnum, !is_in, csr ? 1 : 0);
+ }
+
+ /* caller owns controller lock, irqs are blocked */
+@@ -362,7 +351,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
+ switch (qh->type) {
+ case USB_ENDPOINT_XFER_BULK:
+ case USB_ENDPOINT_XFER_INT:
+- musb_save_toggle(ep, is_in, urb);
++ musb_save_toggle(qh, is_in, urb);
+ break;
+ case USB_ENDPOINT_XFER_ISOC:
+ if (status == 0 && urb->error_count)
+@@ -1362,7 +1351,7 @@ static void musb_bulk_rx_nak_timeout(struct musb *musb, struct musb_hw_ep *ep)
+ urb->actual_length += dma->actual_len;
+ dma->actual_len = 0L;
+ }
+- musb_save_toggle(ep, 1, urb);
++ musb_save_toggle(cur_qh, 1, urb);
+
+ /* move cur_qh to end of queue */
+ list_move_tail(&cur_qh->ring, &musb->in_bulk);
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0014-musb_gadget-suppress-parasitic-TX-interrupts-with.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0014-musb_gadget-suppress-parasitic-TX-interrupts-with.patch
new file mode 100644
index 0000000000..08e08a8538
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0014-musb_gadget-suppress-parasitic-TX-interrupts-with.patch
@@ -0,0 +1,32 @@
+From 7766f2ea909b73f56d21746485069e02839b75f1 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:53:32 -0700
+Subject: [PATCH] musb_gadget: suppress "parasitic" TX interrupts with CPPI
+
+Suppress "parasitic" endpoint interrupts in the DMA mode
+when using CPPI DMA driver; they're caused by the MUSB gadget
+driver using the DMA request mode 0 instead of the mode 1.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_gadget.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index f79440c..bc197b2 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -349,7 +349,8 @@ static void txstate(struct musb *musb, struct musb_request *req)
+ #elif defined(CONFIG_USB_TI_CPPI_DMA)
+ /* program endpoint CSR first, then setup DMA */
+ csr &= ~(MUSB_TXCSR_P_UNDERRUN | MUSB_TXCSR_TXPKTRDY);
+- csr |= MUSB_TXCSR_MODE | MUSB_TXCSR_DMAENAB;
++ csr |= MUSB_TXCSR_DMAENAB | MUSB_TXCSR_DMAMODE |
++ MUSB_TXCSR_MODE;
+ musb_writew(epio, MUSB_TXCSR,
+ (MUSB_TXCSR_P_WZC_BITS & ~MUSB_TXCSR_P_UNDERRUN)
+ | csr);
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0015-musb_gadget-fix-unhandled-endpoint-0-IRQs.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0015-musb_gadget-fix-unhandled-endpoint-0-IRQs.patch
new file mode 100644
index 0000000000..7115b152d9
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0015-musb_gadget-fix-unhandled-endpoint-0-IRQs.patch
@@ -0,0 +1,202 @@
+From 5424305125492a2417bde7c6d23ee4b84e25f6be Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:52:43 -0700
+Subject: [PATCH] musb_gadget: fix unhandled endpoint 0 IRQs
+
+The gadget EP0 code routinely ignores an interrupt at end of
+the data phase because of musb_g_ep0_giveback() resetting the
+state machine to "idle, waiting for SETUP" phase prematurely.
+
+The driver also prematurely leaves the status phase on
+receiving the SetupEnd interrupt.
+
+As there were still unhandled endpoint 0 interrupts happening
+from time to time after fixing these issues, there turned to
+be yet another culprit: two distinct gadget states collapsed
+into one.
+
+The (missing) state that comes after STATUS IN/OUT states was
+typically indiscernible from them since the corresponding
+interrupts tend to happen within too little period of time
+(due to only a zero-length status packet in between) and so
+they got coalesced; yet this state is not the same as the next
+one which is associated with the reception of a SETUP packet.
+
+Adding this extra state seems to have fixed the rest of the
+unhandled interrupts that generic_interrupt() and
+davinci_interrupt() hid by faking their result and only
+emitting a debug message -- so, stop doing that.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/davinci.c | 7 +----
+ drivers/usb/musb/musb_core.c | 8 +-----
+ drivers/usb/musb/musb_core.h | 3 +-
+ drivers/usb/musb/musb_gadget_ep0.c | 45 +++++++++++++++++++++++++++++++----
+ 4 files changed, 43 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
+index 2dc7606..399c435 100644
+--- a/drivers/usb/musb/davinci.c
++++ b/drivers/usb/musb/davinci.c
+@@ -357,12 +357,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
+
+ spin_unlock_irqrestore(&musb->lock, flags);
+
+- /* REVISIT we sometimes get unhandled IRQs
+- * (e.g. ep0). not clear why...
+- */
+- if (retval != IRQ_HANDLED)
+- DBG(5, "unhandled? %08x\n", tmp);
+- return IRQ_HANDLED;
++ return retval;
+ }
+
+ int musb_platform_set_mode(struct musb *musb, u8 mode)
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index 3019725..a1de43b 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -1481,13 +1481,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci)
+
+ spin_unlock_irqrestore(&musb->lock, flags);
+
+- /* REVISIT we sometimes get spurious IRQs on g_ep0
+- * not clear why...
+- */
+- if (retval != IRQ_HANDLED)
+- DBG(5, "spurious?\n");
+-
+- return IRQ_HANDLED;
++ return retval;
+ }
+
+ #else
+diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
+index adf1806..f56a56c 100644
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -171,7 +171,8 @@ enum musb_h_ep0_state {
+
+ /* peripheral side ep0 states */
+ enum musb_g_ep0_state {
+- MUSB_EP0_STAGE_SETUP, /* idle, waiting for setup */
++ MUSB_EP0_STAGE_IDLE, /* idle, waiting for SETUP */
++ MUSB_EP0_STAGE_SETUP, /* received SETUP */
+ MUSB_EP0_STAGE_TX, /* IN data */
+ MUSB_EP0_STAGE_RX, /* OUT data */
+ MUSB_EP0_STAGE_STATUSIN, /* (after OUT data) */
+diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
+index 3f5e30d..ec0e899 100644
+--- a/drivers/usb/musb/musb_gadget_ep0.c
++++ b/drivers/usb/musb/musb_gadget_ep0.c
+@@ -4,6 +4,7 @@
+ * Copyright 2005 Mentor Graphics Corporation
+ * Copyright (C) 2005-2006 by Texas Instruments
+ * Copyright (C) 2006-2007 Nokia Corporation
++ * Copyright (C) 2008-2009 MontaVista Software, Inc. <source-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+@@ -58,7 +59,8 @@
+ static char *decode_ep0stage(u8 stage)
+ {
+ switch (stage) {
+- case MUSB_EP0_STAGE_SETUP: return "idle";
++ case MUSB_EP0_STAGE_IDLE: return "idle";
++ case MUSB_EP0_STAGE_SETUP: return "setup";
+ case MUSB_EP0_STAGE_TX: return "in";
+ case MUSB_EP0_STAGE_RX: return "out";
+ case MUSB_EP0_STAGE_ACKWAIT: return "wait";
+@@ -628,7 +630,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
+ musb_writew(regs, MUSB_CSR0,
+ csr & ~MUSB_CSR0_P_SENTSTALL);
+ retval = IRQ_HANDLED;
+- musb->ep0_state = MUSB_EP0_STAGE_SETUP;
++ musb->ep0_state = MUSB_EP0_STAGE_IDLE;
+ csr = musb_readw(regs, MUSB_CSR0);
+ }
+
+@@ -636,7 +638,18 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
+ if (csr & MUSB_CSR0_P_SETUPEND) {
+ musb_writew(regs, MUSB_CSR0, MUSB_CSR0_P_SVDSETUPEND);
+ retval = IRQ_HANDLED;
+- musb->ep0_state = MUSB_EP0_STAGE_SETUP;
++ /* Transition into the early status phase */
++ switch (musb->ep0_state) {
++ case MUSB_EP0_STAGE_TX:
++ musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT;
++ break;
++ case MUSB_EP0_STAGE_RX:
++ musb->ep0_state = MUSB_EP0_STAGE_STATUSIN;
++ break;
++ default:
++ ERR("SetupEnd came in a wrong ep0stage %s",
++ decode_ep0stage(musb->ep0_state));
++ }
+ csr = musb_readw(regs, MUSB_CSR0);
+ /* NOTE: request may need completion */
+ }
+@@ -697,11 +710,31 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
+ if (req)
+ musb_g_ep0_giveback(musb, req);
+ }
++
++ /*
++ * In case when several interrupts can get coalesced,
++ * check to see if we've already received a SETUP packet...
++ */
++ if (csr & MUSB_CSR0_RXPKTRDY)
++ goto setup;
++
++ retval = IRQ_HANDLED;
++ musb->ep0_state = MUSB_EP0_STAGE_IDLE;
++ break;
++
++ case MUSB_EP0_STAGE_IDLE:
++ /*
++ * This state is typically (but not always) indiscernible
++ * from the status states since the corresponding interrupts
++ * tend to happen within too little period of time (with only
++ * a zero-length packet in between) and so get coalesced...
++ */
+ retval = IRQ_HANDLED;
+ musb->ep0_state = MUSB_EP0_STAGE_SETUP;
+ /* FALLTHROUGH */
+
+ case MUSB_EP0_STAGE_SETUP:
++setup:
+ if (csr & MUSB_CSR0_RXPKTRDY) {
+ struct usb_ctrlrequest setup;
+ int handled = 0;
+@@ -783,7 +816,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
+ stall:
+ DBG(3, "stall (%d)\n", handled);
+ musb->ackpend |= MUSB_CSR0_P_SENDSTALL;
+- musb->ep0_state = MUSB_EP0_STAGE_SETUP;
++ musb->ep0_state = MUSB_EP0_STAGE_IDLE;
+ finish:
+ musb_writew(regs, MUSB_CSR0,
+ musb->ackpend);
+@@ -803,7 +836,7 @@ finish:
+ /* "can't happen" */
+ WARN_ON(1);
+ musb_writew(regs, MUSB_CSR0, MUSB_CSR0_P_SENDSTALL);
+- musb->ep0_state = MUSB_EP0_STAGE_SETUP;
++ musb->ep0_state = MUSB_EP0_STAGE_IDLE;
+ break;
+ }
+
+@@ -959,7 +992,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value)
+
+ csr |= MUSB_CSR0_P_SENDSTALL;
+ musb_writew(regs, MUSB_CSR0, csr);
+- musb->ep0_state = MUSB_EP0_STAGE_SETUP;
++ musb->ep0_state = MUSB_EP0_STAGE_IDLE;
+ musb->ackpend = 0;
+ break;
+ default:
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0016-musb_host-factor-out-musb_ep_-get-set-_qh.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0016-musb_host-factor-out-musb_ep_-get-set-_qh.patch
new file mode 100644
index 0000000000..a2f54ff47b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0016-musb_host-factor-out-musb_ep_-get-set-_qh.patch
@@ -0,0 +1,146 @@
+From f9ca8154cf395ec00129f12016697ef610a826ff Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:55:16 -0700
+Subject: [PATCH] musb_host: factor out musb_ep_{get|set}_qh()
+
+Factor out the often used code to get/set the active 'qh'
+pointer for the hardware endpoint. Change the way the case
+of a shared FIFO is handled by setting *both* 'in_qh' and
+'out_qh' fields of 'struct musb_hw_ep'. That seems more
+consistent and makes getting to the current 'qh' easy when
+the code knows the direction beforehand.
+
+While at it, turn some assignments into intializers and
+fix declaration style in the vicinity.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 56 ++++++++++++++++-------------------------
+ 1 files changed, 22 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index dc32ce4..bc89079 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -178,6 +178,19 @@ static inline void cppi_host_txdma_start(struct musb_hw_ep *ep)
+ musb_writew(ep->regs, MUSB_TXCSR, txcsr);
+ }
+
++static void musb_ep_set_qh(struct musb_hw_ep *ep, int is_in, struct musb_qh *qh)
++{
++ if (is_in != 0 || ep->is_shared_fifo)
++ ep->in_qh = qh;
++ if (is_in == 0 || ep->is_shared_fifo)
++ ep->out_qh = qh;
++}
++
++static struct musb_qh *musb_ep_get_qh(struct musb_hw_ep *ep, int is_in)
++{
++ return is_in ? ep->in_qh : ep->out_qh;
++}
++
+ /*
+ * Start the URB at the front of an endpoint's queue
+ * end must be claimed from the caller.
+@@ -207,7 +220,6 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ case USB_ENDPOINT_XFER_CONTROL:
+ /* control transfers always start with SETUP */
+ is_in = 0;
+- hw_ep->out_qh = qh;
+ musb->ep0_stage = MUSB_EP0_START;
+ buf = urb->setup_packet;
+ len = 8;
+@@ -236,10 +248,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh)
+ epnum, buf + offset, len);
+
+ /* Configure endpoint */
+- if (is_in || hw_ep->is_shared_fifo)
+- hw_ep->in_qh = qh;
+- else
+- hw_ep->out_qh = qh;
++ musb_ep_set_qh(hw_ep, is_in, qh);
+ musb_ep_program(musb, epnum, urb, !is_in, buf, offset, len);
+
+ /* transmit may have more work: start it when it is time */
+@@ -374,11 +383,8 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
+ else
+ ep->tx_reinit = 1;
+
+- /* clobber old pointers to this qh */
+- if (is_in || ep->is_shared_fifo)
+- ep->in_qh = NULL;
+- else
+- ep->out_qh = NULL;
++ /* Clobber old pointers to this qh */
++ musb_ep_set_qh(ep, is_in, NULL);
+ qh->hep->hcpriv = NULL;
+
+ switch (qh->type) {
+@@ -421,12 +427,7 @@ static void
+ musb_advance_schedule(struct musb *musb, struct urb *urb,
+ struct musb_hw_ep *hw_ep, int is_in)
+ {
+- struct musb_qh *qh;
+-
+- if (is_in || hw_ep->is_shared_fifo)
+- qh = hw_ep->in_qh;
+- else
+- qh = hw_ep->out_qh;
++ struct musb_qh *qh = musb_ep_get_qh(hw_ep, is_in);
+
+ if (urb->status == -EINPROGRESS)
+ qh = musb_giveback(qh, urb, 0);
+@@ -689,15 +690,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
+ void __iomem *mbase = musb->mregs;
+ struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
+ void __iomem *epio = hw_ep->regs;
+- struct musb_qh *qh;
+- u16 packet_sz;
+-
+- if (!is_out || hw_ep->is_shared_fifo)
+- qh = hw_ep->in_qh;
+- else
+- qh = hw_ep->out_qh;
+-
+- packet_sz = qh->maxpacket;
++ struct musb_qh *qh = musb_ep_get_qh(hw_ep, !is_out);
++ u16 packet_sz = qh->maxpacket;
+
+ DBG(3, "%s hw%d urb %p spd%d dev%d ep%d%s "
+ "h_addr%02x h_port%02x bytes %d\n",
+@@ -1114,17 +1108,14 @@ void musb_host_tx(struct musb *musb, u8 epnum)
+ u16 tx_csr;
+ size_t length = 0;
+ size_t offset = 0;
+- struct urb *urb;
+ struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
+ void __iomem *epio = hw_ep->regs;
+- struct musb_qh *qh = hw_ep->is_shared_fifo ? hw_ep->in_qh
+- : hw_ep->out_qh;
++ struct musb_qh *qh = hw_ep->out_qh;
++ struct urb *urb = next_urb(qh);
+ u32 status = 0;
+ void __iomem *mbase = musb->mregs;
+ struct dma_channel *dma;
+
+- urb = next_urb(qh);
+-
+ musb_ep_select(mbase, epnum);
+ tx_csr = musb_readw(epio, MUSB_TXCSR);
+
+@@ -1741,10 +1732,7 @@ static int musb_schedule(
+ epnum++, hw_ep++) {
+ int diff;
+
+- if (is_in || hw_ep->is_shared_fifo) {
+- if (hw_ep->in_qh != NULL)
+- continue;
+- } else if (hw_ep->out_qh != NULL)
++ if (musb_ep_get_qh(hw_ep, is_in) != NULL)
+ continue;
+
+ if (hw_ep == musb->bulk_ep)
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0017-musb_host-refactor-URB-giveback.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0017-musb_host-refactor-URB-giveback.patch
new file mode 100644
index 0000000000..4a520dff87
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0017-musb_host-refactor-URB-giveback.patch
@@ -0,0 +1,132 @@
+From 013056a09afd324e729d64b9a0e66a004604e1d6 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:58:31 -0700
+Subject: [PATCH] musb_host: refactor URB giveback
+
+As musb_advance_schedule() is now the only remaning
+caller of musb_giveback() (and the only valid context
+of such call), just fold the latter into the former
+and then rename __musb_giveback() into musb_giveback().
+
+This is a net minor shrink.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 54 +++++++++++++++--------------------------
+ 1 files changed, 20 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index bc89079..e833959 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -292,9 +292,8 @@ start:
+ }
+ }
+
+-/* caller owns controller lock, irqs are blocked */
+-static void
+-__musb_giveback(struct musb *musb, struct urb *urb, int status)
++/* Context: caller owns controller lock, IRQs are blocked */
++static void musb_giveback(struct musb *musb, struct urb *urb, int status)
+ __releases(musb->lock)
+ __acquires(musb->lock)
+ {
+@@ -347,14 +346,22 @@ static inline void musb_save_toggle(struct musb_qh *qh, int is_in,
+ usb_settoggle(urb->dev, qh->epnum, !is_in, csr ? 1 : 0);
+ }
+
+-/* caller owns controller lock, irqs are blocked */
+-static struct musb_qh *
+-musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
++/*
++ * Advance this hardware endpoint's queue, completing the specified URB and
++ * advancing to either the next URB queued to that qh, or else invalidating
++ * that qh and advancing to the next qh scheduled after the current one.
++ *
++ * Context: caller owns controller lock, IRQs are blocked
++ */
++static void musb_advance_schedule(struct musb *musb, struct urb *urb,
++ struct musb_hw_ep *hw_ep, int is_in)
+ {
++ struct musb_qh *qh = musb_ep_get_qh(hw_ep, is_in);
+ struct musb_hw_ep *ep = qh->hw_ep;
+- struct musb *musb = ep->musb;
+- int is_in = usb_pipein(urb->pipe);
+ int ready = qh->is_ready;
++ int status;
++
++ status = (urb->status == -EINPROGRESS) ? 0 : urb->status;
+
+ /* save toggle eagerly, for paranoia */
+ switch (qh->type) {
+@@ -363,13 +370,13 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
+ musb_save_toggle(qh, is_in, urb);
+ break;
+ case USB_ENDPOINT_XFER_ISOC:
+- if (status == 0 && urb->error_count)
++ if (urb->error_count)
+ status = -EXDEV;
+ break;
+ }
+
+ qh->is_ready = 0;
+- __musb_giveback(musb, urb, status);
++ musb_giveback(musb, urb, status);
+ qh->is_ready = ready;
+
+ /* reclaim resources (and bandwidth) ASAP; deschedule it, and
+@@ -413,31 +420,10 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
+ break;
+ }
+ }
+- return qh;
+-}
+-
+-/*
+- * Advance this hardware endpoint's queue, completing the specified urb and
+- * advancing to either the next urb queued to that qh, or else invalidating
+- * that qh and advancing to the next qh scheduled after the current one.
+- *
+- * Context: caller owns controller lock, irqs are blocked
+- */
+-static void
+-musb_advance_schedule(struct musb *musb, struct urb *urb,
+- struct musb_hw_ep *hw_ep, int is_in)
+-{
+- struct musb_qh *qh = musb_ep_get_qh(hw_ep, is_in);
+-
+- if (urb->status == -EINPROGRESS)
+- qh = musb_giveback(qh, urb, 0);
+- else
+- qh = musb_giveback(qh, urb, urb->status);
+
+ if (qh != NULL && qh->is_ready) {
+ DBG(4, "... next ep%d %cX urb %p\n",
+- hw_ep->epnum, is_in ? 'R' : 'T',
+- next_urb(qh));
++ hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh));
+ musb_start_urb(musb, is_in, qh);
+ }
+ }
+@@ -2080,7 +2066,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+
+ ret = 0;
+ qh->is_ready = 0;
+- __musb_giveback(musb, urb, 0);
++ musb_giveback(musb, urb, 0);
+ qh->is_ready = ready;
+
+ /* If nothing else (usually musb_giveback) is using it
+@@ -2164,7 +2150,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
+ * will activate any of these as it advances.
+ */
+ while (!list_empty(&hep->urb_list))
+- __musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
++ musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
+
+ hep->hcpriv = NULL;
+ list_del(&qh->ring);
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0018-musb-split-out-CPPI-interrupt-handler.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0018-musb-split-out-CPPI-interrupt-handler.patch
new file mode 100644
index 0000000000..bf3d6e7021
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0018-musb-split-out-CPPI-interrupt-handler.patch
@@ -0,0 +1,167 @@
+From b91b067c531c9322f3719951b07303e790b13475 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:59:46 -0700
+Subject: [PATCH] musb: split out CPPI interrupt handler
+
+As DaVinci DM646x has a dedicated CPPI DMA interrupt, replace
+cppi_completion() (which has always been kind of layering
+violation) by a complete CPPI interrupt handler.
+
+[ dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org: only cppi_dma.c needs platform
+device header, not cppi_dma.h ]
+
+Signed-off-by: Dmitry Krivoschekov <dkrivoschekov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/cppi_dma.c | 34 +++++++++++++++++++++++++++++++---
+ drivers/usb/musb/cppi_dma.h | 6 ++++--
+ drivers/usb/musb/davinci.c | 14 ++++----------
+ 3 files changed, 39 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
+index ac7227c..6ff3c67 100644
+--- a/drivers/usb/musb/cppi_dma.c
++++ b/drivers/usb/musb/cppi_dma.c
+@@ -6,6 +6,7 @@
+ * The TUSB6020, using VLYNQ, has CPPI that looks much like DaVinci.
+ */
+
++#include <linux/platform_device.h>
+ #include <linux/usb.h>
+
+ #include "musb_core.h"
+@@ -1145,17 +1146,27 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch)
+ return completed;
+ }
+
+-void cppi_completion(struct musb *musb, u32 rx, u32 tx)
++irqreturn_t cppi_interrupt(int irq, void *dev_id)
+ {
+- void __iomem *tibase;
+- int i, index;
++ struct musb *musb = dev_id;
+ struct cppi *cppi;
++ void __iomem *tibase;
+ struct musb_hw_ep *hw_ep = NULL;
++ u32 rx, tx;
++ int i, index;
+
+ cppi = container_of(musb->dma_controller, struct cppi, controller);
+
+ tibase = musb->ctrl_base;
+
++ tx = musb_readl(tibase, DAVINCI_TXCPPI_MASKED_REG);
++ rx = musb_readl(tibase, DAVINCI_RXCPPI_MASKED_REG);
++
++ if (!tx && !rx)
++ return IRQ_NONE;
++
++ DBG(4, "CPPI IRQ Tx%x Rx%x\n", tx, rx);
++
+ /* process TX channels */
+ for (index = 0; tx; tx = tx >> 1, index++) {
+ struct cppi_channel *tx_ch;
+@@ -1293,6 +1304,8 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx)
+
+ /* write to CPPI EOI register to re-enable interrupts */
+ musb_writel(tibase, DAVINCI_CPPI_EOI_REG, 0);
++
++ return IRQ_HANDLED;
+ }
+
+ /* Instantiate a software object representing a DMA controller. */
+@@ -1300,6 +1313,9 @@ struct dma_controller *__init
+ dma_controller_create(struct musb *musb, void __iomem *mregs)
+ {
+ struct cppi *controller;
++ struct device *dev = musb->controller;
++ struct platform_device *pdev = to_platform_device(dev);
++ int irq = platform_get_irq(pdev, 1);
+
+ controller = kzalloc(sizeof *controller, GFP_KERNEL);
+ if (!controller)
+@@ -1330,6 +1346,15 @@ dma_controller_create(struct musb *musb, void __iomem *mregs)
+ return NULL;
+ }
+
++ if (irq > 0) {
++ if (request_irq(irq, cppi_interrupt, 0, "cppi-dma", musb)) {
++ dev_err(dev, "request_irq %d failed!\n", irq);
++ dma_controller_destroy(&controller->controller);
++ return NULL;
++ }
++ controller->irq = irq;
++ }
++
+ return &controller->controller;
+ }
+
+@@ -1342,6 +1367,9 @@ void dma_controller_destroy(struct dma_controller *c)
+
+ cppi = container_of(c, struct cppi, controller);
+
++ if (cppi->irq)
++ free_irq(cppi->irq, cppi->musb);
++
+ /* assert: caller stopped the controller first */
+ dma_pool_destroy(cppi->pool);
+
+diff --git a/drivers/usb/musb/cppi_dma.h b/drivers/usb/musb/cppi_dma.h
+index 729b407..8a39de3 100644
+--- a/drivers/usb/musb/cppi_dma.h
++++ b/drivers/usb/musb/cppi_dma.h
+@@ -119,6 +119,8 @@ struct cppi {
+ void __iomem *mregs; /* Mentor regs */
+ void __iomem *tibase; /* TI/CPPI regs */
+
++ int irq;
++
+ struct cppi_channel tx[4];
+ struct cppi_channel rx[4];
+
+@@ -127,7 +129,7 @@ struct cppi {
+ struct list_head tx_complete;
+ };
+
+-/* irq handling hook */
+-extern void cppi_completion(struct musb *, u32 rx, u32 tx);
++/* CPPI IRQ handler */
++extern irqreturn_t cppi_interrupt(int, void *);
+
+ #endif /* end of ifndef _CPPI_DMA_H_ */
+diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
+index 399c435..9fd74bf 100644
+--- a/drivers/usb/musb/davinci.c
++++ b/drivers/usb/musb/davinci.c
+@@ -250,6 +250,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
+ irqreturn_t retval = IRQ_NONE;
+ struct musb *musb = __hci;
+ void __iomem *tibase = musb->ctrl_base;
++ struct cppi *cppi;
+ u32 tmp;
+
+ spin_lock_irqsave(&musb->lock, flags);
+@@ -266,16 +267,9 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
+ /* CPPI interrupts share the same IRQ line, but have their own
+ * mask, state, "vector", and EOI registers.
+ */
+- if (is_cppi_enabled()) {
+- u32 cppi_tx = musb_readl(tibase, DAVINCI_TXCPPI_MASKED_REG);
+- u32 cppi_rx = musb_readl(tibase, DAVINCI_RXCPPI_MASKED_REG);
+-
+- if (cppi_tx || cppi_rx) {
+- DBG(4, "CPPI IRQ t%x r%x\n", cppi_tx, cppi_rx);
+- cppi_completion(musb, cppi_rx, cppi_tx);
+- retval = IRQ_HANDLED;
+- }
+- }
++ cppi = container_of(musb->dma_controller, struct cppi, controller);
++ if (is_cppi_enabled() && musb->dma_controller && !cppi->irq)
++ retval = cppi_interrupt(irq, __hci);
+
+ /* ack and handle non-CPPI interrupts */
+ tmp = musb_readl(tibase, DAVINCI_USB_INT_SRC_MASKED_REG);
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0019-musb_host-simplify-check-for-active-URB.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0019-musb_host-simplify-check-for-active-URB.patch
new file mode 100644
index 0000000000..c0e57155c8
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0019-musb_host-simplify-check-for-active-URB.patch
@@ -0,0 +1,158 @@
+From 69242ddd26151d45f46011cf7abc581b14699fb2 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:56:26 -0700
+Subject: [PATCH] musb_host: simplify check for active URB
+
+The existance of the scheduling list shouldn't matter in
+determining whether there's currectly an URB executing on a
+hardware endpoint. What should actually matter is the 'in_qh'
+or 'out_qh' fields of the 'struct musb_hw_ep' -- those are
+set in musb_start_urb() and cleared in musb_giveback() when
+the endpoint's URB list drains. Hence we should be able to
+replace the big *switch* statements in musb_urb_dequeue()
+and musb_h_disable() with mere musb_ep_get_qh() calls...
+
+While at it, do some more changes:
+
+ - add 'is_in' variable to musb_urb_dequeue();
+
+ - remove the unnecessary 'epnum' variable from musb_h_disable();
+
+ - fix the comment style in the vicinity.
+
+This is a minor shrink of source and object code.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 72 ++++++++---------------------------------
+ 1 files changed, 14 insertions(+), 58 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index e833959..e121e0e 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -2008,14 +2008,14 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+ {
+ struct musb *musb = hcd_to_musb(hcd);
+ struct musb_qh *qh;
+- struct list_head *sched;
+ unsigned long flags;
++ int is_in = usb_pipein(urb->pipe);
+ int ret;
+
+ DBG(4, "urb=%p, dev%d ep%d%s\n", urb,
+ usb_pipedevice(urb->pipe),
+ usb_pipeendpoint(urb->pipe),
+- usb_pipein(urb->pipe) ? "in" : "out");
++ is_in ? "in" : "out");
+
+ spin_lock_irqsave(&musb->lock, flags);
+ ret = usb_hcd_check_unlink_urb(hcd, urb, status);
+@@ -2026,45 +2026,23 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+ if (!qh)
+ goto done;
+
+- /* Any URB not actively programmed into endpoint hardware can be
++ /*
++ * Any URB not actively programmed into endpoint hardware can be
+ * immediately given back; that's any URB not at the head of an
+ * endpoint queue, unless someday we get real DMA queues. And even
+ * if it's at the head, it might not be known to the hardware...
+ *
+- * Otherwise abort current transfer, pending dma, etc.; urb->status
++ * Otherwise abort current transfer, pending DMA, etc.; urb->status
+ * has already been updated. This is a synchronous abort; it'd be
+ * OK to hold off until after some IRQ, though.
++ *
++ * NOTE: qh is invalid unless !list_empty(&hep->urb_list)
+ */
+- if (!qh->is_ready || urb->urb_list.prev != &qh->hep->urb_list)
+- ret = -EINPROGRESS;
+- else {
+- switch (qh->type) {
+- case USB_ENDPOINT_XFER_CONTROL:
+- sched = &musb->control;
+- break;
+- case USB_ENDPOINT_XFER_BULK:
+- if (qh->mux == 1) {
+- if (usb_pipein(urb->pipe))
+- sched = &musb->in_bulk;
+- else
+- sched = &musb->out_bulk;
+- break;
+- }
+- default:
+- /* REVISIT when we get a schedule tree, periodic
+- * transfers won't always be at the head of a
+- * singleton queue...
+- */
+- sched = NULL;
+- break;
+- }
+- }
+-
+- /* NOTE: qh is invalid unless !list_empty(&hep->urb_list) */
+- if (ret < 0 || (sched && qh != first_qh(sched))) {
++ if (!qh->is_ready
++ || urb->urb_list.prev != &qh->hep->urb_list
++ || musb_ep_get_qh(qh->hw_ep, is_in) != qh) {
+ int ready = qh->is_ready;
+
+- ret = 0;
+ qh->is_ready = 0;
+ musb_giveback(musb, urb, 0);
+ qh->is_ready = ready;
+@@ -2088,13 +2066,11 @@ done:
+ static void
+ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
+ {
+- u8 epnum = hep->desc.bEndpointAddress;
++ u8 is_in = hep->desc.bEndpointAddress & USB_DIR_IN;
+ unsigned long flags;
+ struct musb *musb = hcd_to_musb(hcd);
+- u8 is_in = epnum & USB_DIR_IN;
+ struct musb_qh *qh;
+ struct urb *urb;
+- struct list_head *sched;
+
+ spin_lock_irqsave(&musb->lock, flags);
+
+@@ -2102,31 +2078,11 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
+ if (qh == NULL)
+ goto exit;
+
+- switch (qh->type) {
+- case USB_ENDPOINT_XFER_CONTROL:
+- sched = &musb->control;
+- break;
+- case USB_ENDPOINT_XFER_BULK:
+- if (qh->mux == 1) {
+- if (is_in)
+- sched = &musb->in_bulk;
+- else
+- sched = &musb->out_bulk;
+- break;
+- }
+- default:
+- /* REVISIT when we get a schedule tree, periodic transfers
+- * won't always be at the head of a singleton queue...
+- */
+- sched = NULL;
+- break;
+- }
+-
+- /* NOTE: qh is invalid unless !list_empty(&hep->urb_list) */
++ /* NOTE: qh is invalid unless !list_empty(&hep->urb_list) */
+
+- /* kick first urb off the hardware, if needed */
++ /* Kick the first URB off the hardware, if needed */
+ qh->is_ready = 0;
+- if (!sched || qh == first_qh(sched)) {
++ if (musb_ep_get_qh(qh->hw_ep, is_in) == qh) {
+ urb = next_urb(qh);
+
+ /* make software (then hardware) stop ASAP */
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0020-musb_host-streamline-musb_cleanup_urb-calls.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0020-musb_host-streamline-musb_cleanup_urb-calls.patch
new file mode 100644
index 0000000000..d89eaadd61
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0020-musb_host-streamline-musb_cleanup_urb-calls.patch
@@ -0,0 +1,58 @@
+From d408894fa4263440ed8a9e68566bacea7e6f6bed Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Date: Fri, 27 Mar 2009 12:57:50 -0700
+Subject: [PATCH] musb_host: streamline musb_cleanup_urb() calls
+
+The argument for the 'is_in' parameter of musb_cleanup_urb()
+is always extracted from an URB that's passed to the function.
+So that parameter is superfluous; remove it.
+
+Signed-off-by: Sergei Shtylyov <sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_host.c | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index e121e0e..71e835e 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -1950,14 +1950,15 @@ done:
+ * called with controller locked, irqs blocked
+ * that hardware queue advances to the next transfer, unless prevented
+ */
+-static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in)
++static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh)
+ {
+ struct musb_hw_ep *ep = qh->hw_ep;
+ void __iomem *epio = ep->regs;
+ unsigned hw_end = ep->epnum;
+ void __iomem *regs = ep->musb->mregs;
+- u16 csr;
++ int is_in = usb_pipein(urb->pipe);
+ int status = 0;
++ u16 csr;
+
+ musb_ep_select(regs, hw_end);
+
+@@ -2056,7 +2057,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
+ kfree(qh);
+ }
+ } else
+- ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
++ ret = musb_cleanup_urb(urb, qh);
+ done:
+ spin_unlock_irqrestore(&musb->lock, flags);
+ return ret;
+@@ -2090,7 +2091,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
+ urb->status = -ESHUTDOWN;
+
+ /* cleanup */
+- musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
++ musb_cleanup_urb(urb, qh);
+
+ /* Then nuke all the others ... and advance the
+ * queue on hw_ep (e.g. bulk ring) when we're done.
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch
new file mode 100644
index 0000000000..d9733f92b0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch
@@ -0,0 +1,70 @@
+From c4804e5a447275553c55bbb0ab1748954cb8fbfc Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 31 Mar 2009 12:26:10 -0700
+Subject: [PATCH] twl4030-usb: fix minor reporting goofage
+
+Fix a reporting glitch in the twl4030 USB transceiver code.
+It wasn't properly distinguishing the two types of active
+USB link: ID grounded, vs not. In the current code that
+distinction doesn't much matter; in the future this bugfix
+should help support better USB controller communications.
+
+Provide a comment sorting out some of the cryptic bits of
+the manual: different sections use different names for
+key signals, and the register definitions don't help much
+without the explanations and diagrams.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/otg/twl4030-usb.c | 26 +++++++++++++++++++-------
+ 1 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
+index d9478d0..f740390 100644
+--- a/drivers/usb/otg/twl4030-usb.c
++++ b/drivers/usb/otg/twl4030-usb.c
+@@ -217,6 +217,7 @@
+
+ /* In module TWL4030_MODULE_PM_MASTER */
+ #define PROTECT_KEY 0x0E
++#define STS_HW_CONDITIONS 0x0F
+
+ /* In module TWL4030_MODULE_PM_RECEIVER */
+ #define VUSB_DEDICATED1 0x7D
+@@ -351,15 +352,26 @@ static enum linkstat twl4030_usb_linkstat(struct twl4030_usb *twl)
+ int status;
+ int linkstat = USB_LINK_UNKNOWN;
+
+- /* STS_HW_CONDITIONS */
+- status = twl4030_readb(twl, TWL4030_MODULE_PM_MASTER, 0x0f);
++ /*
++ * For ID/VBUS sensing, see manual section 15.4.8 ...
++ * except when using only battery backup power, two
++ * comparators produce VBUS_PRES and ID_PRES signals,
++ * which don't match docs elsewhere. But ... BIT(7)
++ * and BIT(2) of STS_HW_CONDITIONS, respectively, do
++ * seem to match up. If either is true the USB_PRES
++ * signal is active, the OTG module is activated, and
++ * its interrupt may be raised (may wake the system).
++ */
++ status = twl4030_readb(twl, TWL4030_MODULE_PM_MASTER,
++ STS_HW_CONDITIONS);
+ if (status < 0)
+ dev_err(twl->dev, "USB link status err %d\n", status);
+- else if (status & BIT(7))
+- linkstat = USB_LINK_VBUS;
+- else if (status & BIT(2))
+- linkstat = USB_LINK_ID;
+- else
++ else if (status & (BIT(7) | BIT(2))) {
++ if (status & BIT(2))
++ linkstat = USB_LINK_ID;
++ else
++ linkstat = USB_LINK_VBUS;
++ } else
+ linkstat = USB_LINK_NONE;
+
+ dev_dbg(twl->dev, "HW_CONDITIONS 0x%02x/%d; link %d\n",
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0022-musb-use-dma-mode-1-for-TX-if-transfer-size-equals.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0022-musb-use-dma-mode-1-for-TX-if-transfer-size-equals.patch
new file mode 100644
index 0000000000..16b5b9908b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0022-musb-use-dma-mode-1-for-TX-if-transfer-size-equals.patch
@@ -0,0 +1,38 @@
+From ba59a0812ba0e223bd0af8f4dea6c971b6289696 Mon Sep 17 00:00:00 2001
+From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
+Date: Thu, 2 Apr 2009 12:07:08 -0700
+Subject: [PATCH] musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)
+
+Currently, with Inventra DMA, we use Mode 0 if transfer size is less
+than or equal to the endpoint's maxpacket size. This requires that
+we explicitly set TXPKTRDY for that transfer.
+
+However the musb_g_tx code will not set TXPKTRDY twice if the last
+transfer is exactly equal to maxpacket, even if request->zero is set.
+Using Mode 1 will solve this; a better fix might be in musb_g_tx().
+
+Without this change, musb will not correctly send out a ZLP if the
+last transfer is the maxpacket size and request->zero is set.
+
+Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_gadget.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index bc197b2..e8f920c 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -310,7 +310,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
+ /* setup DMA, then program endpoint CSR */
+ request_size = min(request->length,
+ musb_ep->dma->max_len);
+- if (request_size <= musb_ep->packet_sz)
++ if (request_size < musb_ep->packet_sz)
+ musb_ep->dma->desired_mode = 0;
+ else
+ musb_ep->dma->desired_mode = 1;
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0023-musb-add-high-bandwidth-ISO-support.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0023-musb-add-high-bandwidth-ISO-support.patch
new file mode 100644
index 0000000000..3038dd171d
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0023-musb-add-high-bandwidth-ISO-support.patch
@@ -0,0 +1,187 @@
+From 2e049a88b729ae2fdc0ecdabad1857810bd62737 Mon Sep 17 00:00:00 2001
+From: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Date: Fri, 3 Apr 2009 16:16:17 -0700
+Subject: [PATCH] musb: add high bandwidth ISO support
+
+Tested on OMAP3 host side with Creative (Live! Cam Optia) USB camera
+which uses high bandwidth isochronous IN endpoints. FIFO mode 4 is
+updated to provide the needed 4K endpoint buffer without breaking
+the g_nokia composite gadget configuration. (This is the only
+gadget driver known to use enough endpoints to notice the change.)
+
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 19 ++++++++---------
+ drivers/usb/musb/musb_core.h | 3 ++
+ drivers/usb/musb/musb_host.c | 47 +++++++++++++++++++++++++++++++----------
+ drivers/usb/musb/musb_host.h | 1 +
+ 4 files changed, 48 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index a1de43b..d953305 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -1068,14 +1068,13 @@ static struct fifo_cfg __initdata mode_4_cfg[] = {
+ { .hw_ep_num = 8, .style = FIFO_RX, .maxpacket = 512, },
+ { .hw_ep_num = 9, .style = FIFO_TX, .maxpacket = 512, },
+ { .hw_ep_num = 9, .style = FIFO_RX, .maxpacket = 512, },
+-{ .hw_ep_num = 10, .style = FIFO_TX, .maxpacket = 512, },
+-{ .hw_ep_num = 10, .style = FIFO_RX, .maxpacket = 512, },
+-{ .hw_ep_num = 11, .style = FIFO_TX, .maxpacket = 512, },
+-{ .hw_ep_num = 11, .style = FIFO_RX, .maxpacket = 512, },
+-{ .hw_ep_num = 12, .style = FIFO_TX, .maxpacket = 512, },
+-{ .hw_ep_num = 12, .style = FIFO_RX, .maxpacket = 512, },
+-{ .hw_ep_num = 13, .style = FIFO_TX, .maxpacket = 512, },
+-{ .hw_ep_num = 13, .style = FIFO_RX, .maxpacket = 512, },
++{ .hw_ep_num = 10, .style = FIFO_TX, .maxpacket = 256, },
++{ .hw_ep_num = 10, .style = FIFO_RX, .maxpacket = 64, },
++{ .hw_ep_num = 11, .style = FIFO_TX, .maxpacket = 256, },
++{ .hw_ep_num = 11, .style = FIFO_RX, .maxpacket = 64, },
++{ .hw_ep_num = 12, .style = FIFO_TX, .maxpacket = 256, },
++{ .hw_ep_num = 12, .style = FIFO_RX, .maxpacket = 64, },
++{ .hw_ep_num = 13, .style = FIFO_RXTX, .maxpacket = 4096, },
+ { .hw_ep_num = 14, .style = FIFO_RXTX, .maxpacket = 1024, },
+ { .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
+ };
+@@ -1335,11 +1334,11 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
+ }
+ if (reg & MUSB_CONFIGDATA_HBRXE) {
+ strcat(aInfo, ", HB-ISO Rx");
+- strcat(aInfo, " (X)"); /* no driver support */
++ musb->hb_iso_rx = true;
+ }
+ if (reg & MUSB_CONFIGDATA_HBTXE) {
+ strcat(aInfo, ", HB-ISO Tx");
+- strcat(aInfo, " (X)"); /* no driver support */
++ musb->hb_iso_tx = true;
+ }
+ if (reg & MUSB_CONFIGDATA_SOFTCONE)
+ strcat(aInfo, ", SoftConn");
+diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
+index f56a56c..0ac4faf 100644
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -387,6 +387,9 @@ struct musb {
+ unsigned is_multipoint:1;
+ unsigned ignore_disconnect:1; /* during bus resets */
+
++ unsigned hb_iso_rx:1; /* high bandwidth iso rx? */
++ unsigned hb_iso_tx:1; /* high bandwidth iso tx? */
++
+ #ifdef C_MP_TX
+ unsigned bulk_split:1;
+ #define can_bulk_split(musb,type) \
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index 71e835e..ece5122 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -602,7 +602,8 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep)
+ musb_writeb(ep->regs, MUSB_RXTYPE, qh->type_reg);
+ musb_writeb(ep->regs, MUSB_RXINTERVAL, qh->intv_reg);
+ /* NOTE: bulk combining rewrites high bits of maxpacket */
+- musb_writew(ep->regs, MUSB_RXMAXP, qh->maxpacket);
++ musb_writew(ep->regs, MUSB_RXMAXP,
++ qh->maxpacket | ((qh->hb_mult - 1) << 11));
+
+ ep->rx_reinit = 0;
+ }
+@@ -624,9 +625,10 @@ static bool musb_tx_dma_program(struct dma_controller *dma,
+ csr = musb_readw(epio, MUSB_TXCSR);
+ if (length > pkt_size) {
+ mode = 1;
+- csr |= MUSB_TXCSR_AUTOSET
+- | MUSB_TXCSR_DMAMODE
+- | MUSB_TXCSR_DMAENAB;
++ csr |= MUSB_TXCSR_DMAMODE | MUSB_TXCSR_DMAENAB;
++ /* autoset shouldn't be set in high bandwidth */
++ if (qh->hb_mult == 1)
++ csr |= MUSB_TXCSR_AUTOSET;
+ } else {
+ mode = 0;
+ csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAMODE);
+@@ -1432,6 +1434,10 @@ void musb_host_rx(struct musb *musb, u8 epnum)
+ /* packet error reported later */
+ iso_err = true;
+ }
++ } else if (rx_csr & MUSB_RXCSR_INCOMPRX) {
++ DBG(3, "end %d high bandwidth incomplete ISO packet RX\n",
++ epnum);
++ status = -EPROTO;
+ }
+
+ /* faults abort the transfer */
+@@ -1639,7 +1645,11 @@ void musb_host_rx(struct musb *musb, u8 epnum)
+ val &= ~MUSB_RXCSR_H_AUTOREQ;
+ else
+ val |= MUSB_RXCSR_H_AUTOREQ;
+- val |= MUSB_RXCSR_AUTOCLEAR | MUSB_RXCSR_DMAENAB;
++ val |= MUSB_RXCSR_DMAENAB;
++
++ /* autoclear shouldn't be set in high bandwidth */
++ if (qh->hb_mult == 1)
++ val |= MUSB_RXCSR_AUTOCLEAR;
+
+ musb_writew(epio, MUSB_RXCSR,
+ MUSB_RXCSR_H_WZC_BITS | val);
+@@ -1725,9 +1735,10 @@ static int musb_schedule(
+ continue;
+
+ if (is_in)
+- diff = hw_ep->max_packet_sz_rx - qh->maxpacket;
++ diff = hw_ep->max_packet_sz_rx;
+ else
+- diff = hw_ep->max_packet_sz_tx - qh->maxpacket;
++ diff = hw_ep->max_packet_sz_tx;
++ diff -= (qh->maxpacket * qh->hb_mult);
+
+ if (diff >= 0 && best_diff > diff) {
+ best_diff = diff;
+@@ -1830,15 +1841,27 @@ static int musb_urb_enqueue(
+ qh->is_ready = 1;
+
+ qh->maxpacket = le16_to_cpu(epd->wMaxPacketSize);
++ qh->type = usb_endpoint_type(epd);
+
+- /* no high bandwidth support yet */
+- if (qh->maxpacket & ~0x7ff) {
+- ret = -EMSGSIZE;
+- goto done;
++ /* Bits 11 & 12 of wMaxPacketSize encode high bandwidth multiplier.
++ * Some musb cores don't support high bandwidth ISO transfers; and
++ * we don't (yet!) support high bandwidth interrupt transfers.
++ */
++ qh->hb_mult = 1 + ((qh->maxpacket >> 11) & 0x03);
++ if (qh->hb_mult > 1) {
++ int ok = (qh->type == USB_ENDPOINT_XFER_ISOC);
++
++ if (ok)
++ ok = (usb_pipein(urb->pipe) && musb->hb_iso_rx)
++ || (usb_pipeout(urb->pipe) && musb->hb_iso_tx);
++ if (!ok) {
++ ret = -EMSGSIZE;
++ goto done;
++ }
++ qh->maxpacket &= 0x7ff;
+ }
+
+ qh->epnum = usb_endpoint_num(epd);
+- qh->type = usb_endpoint_type(epd);
+
+ /* NOTE: urb->dev->devnum is wrong during SET_ADDRESS */
+ qh->addr_reg = (u8) usb_pipedevice(urb->pipe);
+diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
+index 0b7fbcd..14b0077 100644
+--- a/drivers/usb/musb/musb_host.h
++++ b/drivers/usb/musb/musb_host.h
+@@ -67,6 +67,7 @@ struct musb_qh {
+ u8 is_ready; /* safe to modify hw_ep */
+ u8 type; /* XFERTYPE_* */
+ u8 epnum;
++ u8 hb_mult; /* high bandwidth pkts per uf */
+ u16 maxpacket;
+ u16 frame; /* for periodic schedule */
+ unsigned iso_idx; /* in urb->iso_frame_desc[] */
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0024-USB-otg-adding-nop-usb-transceiver.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0024-USB-otg-adding-nop-usb-transceiver.patch
new file mode 100644
index 0000000000..67004d7ec6
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0024-USB-otg-adding-nop-usb-transceiver.patch
@@ -0,0 +1,259 @@
+From de835357b3597af5304742cbd89771d70533292a Mon Sep 17 00:00:00 2001
+From: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Date: Fri, 6 Feb 2009 17:32:35 +0530
+Subject: [PATCH] USB: otg: adding nop usb transceiver
+
+NOP transceiver is used by all the usb transceiver which are mostly
+autonomous and doesn't require any programming or which are built
+into the usb ip itself.NOP transceiver only allocates the memory
+for struct xceiv and calls otg_set_transceiver() so function call
+to otg_get_transceiver() will return a valid transceiver.
+
+NOP transceiver device should be registered by calling
+usb_nop_xceiv_register() from platform files.
+
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Cc: Felipe Balbi <felipe.balbi@nokia.com>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/usb/otg/Kconfig | 8 ++
+ drivers/usb/otg/Makefile | 1 +
+ drivers/usb/otg/nop-usb-xceiv.c | 180 +++++++++++++++++++++++++++++++++++++++
+ include/linux/usb/otg.h | 4 +
+ 4 files changed, 193 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/usb/otg/nop-usb-xceiv.c
+
+diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
+index 5790a5b..aa884d0 100644
+--- a/drivers/usb/otg/Kconfig
++++ b/drivers/usb/otg/Kconfig
+@@ -51,4 +51,12 @@ config TWL4030_USB
+ This transceiver supports high and full speed devices plus,
+ in host mode, low speed.
+
++config NOP_USB_XCEIV
++ tristate "NOP USB Transceiver Driver"
++ select USB_OTG_UTILS
++ help
++ this driver is to be used by all the usb transceiver which are either
++ built-in with usb ip or which are autonomous and doesn't require any
++ phy programming such as ISP1x04 etc.
++
+ endif # USB || OTG
+diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
+index d73c7cf..2081678 100644
+--- a/drivers/usb/otg/Makefile
++++ b/drivers/usb/otg/Makefile
+@@ -9,6 +9,7 @@ obj-$(CONFIG_USB_OTG_UTILS) += otg.o
+ obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
+ obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
+ obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o
++obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o
+
+ ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG
+ ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG
+diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
+new file mode 100644
+index 0000000..4b933f6
+--- /dev/null
++++ b/drivers/usb/otg/nop-usb-xceiv.c
+@@ -0,0 +1,180 @@
++/*
++ * drivers/usb/otg/nop-usb-xceiv.c
++ *
++ * NOP USB transceiver for all USB transceiver which are either built-in
++ * into USB IP or which are mostly autonomous.
++ *
++ * Copyright (C) 2009 Texas Instruments Inc
++ * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
++ *
++ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ * Current status:
++ * this is to add "nop" transceiver for all those phy which is
++ * autonomous such as isp1504 etc.
++ */
++
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/dma-mapping.h>
++#include <linux/usb/otg.h>
++
++struct nop_usb_xceiv {
++ struct otg_transceiver otg;
++ struct device *dev;
++};
++
++static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
++
++static struct platform_device nop_xceiv_device = {
++ .name = "nop_usb_xceiv",
++ .id = -1,
++ .dev = {
++ .dma_mask = &nop_xceiv_dmamask,
++ .coherent_dma_mask = DMA_32BIT_MASK,
++ .platform_data = NULL,
++ },
++};
++
++void usb_nop_xceiv_register(void)
++{
++ if (platform_device_register(&nop_xceiv_device) < 0) {
++ printk(KERN_ERR "Unable to register usb nop transceiver\n");
++ return;
++ }
++}
++
++void usb_nop_xceiv_unregister(void)
++{
++ platform_device_unregister(&nop_xceiv_device);
++}
++
++static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x)
++{
++ return container_of(x, struct nop_usb_xceiv, otg);
++}
++
++static int nop_set_suspend(struct otg_transceiver *x, int suspend)
++{
++ return 0;
++}
++
++static int nop_set_peripheral(struct otg_transceiver *x,
++ struct usb_gadget *gadget)
++{
++ struct nop_usb_xceiv *nop;
++
++ if (!x)
++ return -ENODEV;
++
++ nop = xceiv_to_nop(x);
++
++ if (!gadget) {
++ nop->otg.gadget = NULL;
++ return -ENODEV;
++ }
++
++ nop->otg.gadget = gadget;
++ nop->otg.state = OTG_STATE_B_IDLE;
++ return 0;
++}
++
++static int nop_set_host(struct otg_transceiver *x, struct usb_bus *host)
++{
++ struct nop_usb_xceiv *nop;
++
++ if (!x)
++ return -ENODEV;
++
++ nop = xceiv_to_nop(x);
++
++ if (!host) {
++ nop->otg.host = NULL;
++ return -ENODEV;
++ }
++
++ nop->otg.host = host;
++ return 0;
++}
++
++static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev)
++{
++ struct nop_usb_xceiv *nop;
++ int err;
++
++ nop = kzalloc(sizeof *nop, GFP_KERNEL);
++ if (!nop)
++ return -ENOMEM;
++
++ nop->dev = &pdev->dev;
++ nop->otg.dev = nop->dev;
++ nop->otg.label = "nop-xceiv";
++ nop->otg.state = OTG_STATE_UNDEFINED;
++ nop->otg.set_host = nop_set_host;
++ nop->otg.set_peripheral = nop_set_peripheral;
++ nop->otg.set_suspend = nop_set_suspend;
++
++ err = otg_set_transceiver(&nop->otg);
++ if (err) {
++ dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
++ err);
++ goto exit;
++ }
++
++ platform_set_drvdata(pdev, nop);
++
++ return 0;
++exit:
++ kfree(nop);
++ return err;
++}
++
++static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev)
++{
++ struct nop_usb_xceiv *nop = platform_get_drvdata(pdev);
++
++ otg_set_transceiver(NULL);
++
++ platform_set_drvdata(pdev, NULL);
++ kfree(nop);
++
++ return 0;
++}
++
++static struct platform_driver nop_usb_xceiv_driver = {
++ .probe = nop_usb_xceiv_probe,
++ .remove = __devexit_p(nop_usb_xceiv_remove),
++ .driver = {
++ .name = "nop_usb_xceiv",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init nop_usb_xceiv_init(void)
++{
++ return platform_driver_register(&nop_usb_xceiv_driver);
++}
++subsys_initcall(nop_usb_xceiv_init);
++
++static void __exit nop_usb_xceiv_exit(void)
++{
++ platform_driver_unregister(&nop_usb_xceiv_driver);
++}
++module_exit(nop_usb_xceiv_exit);
++
++MODULE_ALIAS("platform:nop_usb_xceiv");
++MODULE_AUTHOR("Texas Instruments Inc");
++MODULE_DESCRIPTION("NOP USB Transceiver driver");
++MODULE_LICENSE("GPL");
+diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
+index 94df4fe..54f2424 100644
+--- a/include/linux/usb/otg.h
++++ b/include/linux/usb/otg.h
+@@ -80,6 +80,10 @@ struct otg_transceiver {
+
+ /* for board-specific init logic */
+ extern int otg_set_transceiver(struct otg_transceiver *);
++#ifdef CONFIG_NOP_USB_XCEIV
++extern void usb_nop_xceiv_register(void);
++extern void usb_nop_xceiv_unregister(void);
++#endif
+
+
+ /* for usb host and peripheral controller drivers */
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch
new file mode 100644
index 0000000000..21fe7bea17
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch
@@ -0,0 +1,90 @@
+From ae4f027580168814f734cf3c41a662a7f10c744c Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 31 Mar 2009 12:28:31 -0700
+Subject: [PATCH] nop-usb-xceiv: behave when linked as a module
+
+The NOP OTG transceiver driver needs to be usable from modules.
+Make sure its symbols are always accessible at both compile and
+link time, and make sure the device instance is allocated from
+the heap so that device lifetime rules are obeyed.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/otg/nop-usb-xceiv.c | 25 ++++++++++---------------
+ include/linux/usb/otg.h | 4 ++--
+ 2 files changed, 12 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
+index 4b933f6..9ed5ea5 100644
+--- a/drivers/usb/otg/nop-usb-xceiv.c
++++ b/drivers/usb/otg/nop-usb-xceiv.c
+@@ -22,8 +22,8 @@
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Current status:
+- * this is to add "nop" transceiver for all those phy which is
+- * autonomous such as isp1504 etc.
++ * This provides a "nop" transceiver for PHYs which are
++ * autonomous such as isp1504, isp1707, etc.
+ */
+
+ #include <linux/module.h>
+@@ -36,30 +36,25 @@ struct nop_usb_xceiv {
+ struct device *dev;
+ };
+
+-static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
+-
+-static struct platform_device nop_xceiv_device = {
+- .name = "nop_usb_xceiv",
+- .id = -1,
+- .dev = {
+- .dma_mask = &nop_xceiv_dmamask,
+- .coherent_dma_mask = DMA_32BIT_MASK,
+- .platform_data = NULL,
+- },
+-};
++static struct platform_device *pd;
+
+ void usb_nop_xceiv_register(void)
+ {
+- if (platform_device_register(&nop_xceiv_device) < 0) {
++ if (pd)
++ return;
++ pd = platform_device_register_simple("nop_usb_xceiv", -1, NULL, 0);
++ if (!pd) {
+ printk(KERN_ERR "Unable to register usb nop transceiver\n");
+ return;
+ }
+ }
++EXPORT_SYMBOL(usb_nop_xceiv_register);
+
+ void usb_nop_xceiv_unregister(void)
+ {
+- platform_device_unregister(&nop_xceiv_device);
++ platform_device_unregister(pd);
+ }
++EXPORT_SYMBOL(usb_nop_xceiv_unregister);
+
+ static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x)
+ {
+diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
+index 54f2424..7df8bae 100644
+--- a/include/linux/usb/otg.h
++++ b/include/linux/usb/otg.h
+@@ -80,10 +80,10 @@ struct otg_transceiver {
+
+ /* for board-specific init logic */
+ extern int otg_set_transceiver(struct otg_transceiver *);
+-#ifdef CONFIG_NOP_USB_XCEIV
++
++/* sometimes transceivers are accessed only through e.g. ULPI */
+ extern void usb_nop_xceiv_register(void);
+ extern void usb_nop_xceiv_unregister(void);
+-#endif
+
+
+ /* for usb host and peripheral controller drivers */
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0026-musb-proper-hookup-to-transceiver-drivers.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0026-musb-proper-hookup-to-transceiver-drivers.patch
new file mode 100644
index 0000000000..035a6c7676
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0026-musb-proper-hookup-to-transceiver-drivers.patch
@@ -0,0 +1,1109 @@
+From 43ee46723ffa9dd43d611362064d235440aa04e7 Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 31 Mar 2009 12:30:04 -0700
+Subject: [PATCH] musb: proper hookup to transceiver drivers
+
+Let the otg_transceiver in MUSB be managed by an external driver;
+don't assume it's integrated. OMAP3 chips need it to be external,
+and there may be ways to interact with the transceiver which add
+functionality to the system.
+
+Platform init code is responsible for setting up the transeciver,
+probably using the NOP transceiver for integrated transceivers.
+External ones will use whatever the board init code provided,
+such as twl4030 or something more hands-off.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/Kconfig | 2 +
+ drivers/usb/musb/blackfin.c | 11 +++-
+ drivers/usb/musb/davinci.c | 33 +++++++++-----
+ drivers/usb/musb/musb_core.c | 96 +++++++++++++++++++++------------------
+ drivers/usb/musb/musb_core.h | 2 +-
+ drivers/usb/musb/musb_gadget.c | 38 +++++++--------
+ drivers/usb/musb/musb_host.c | 2 +-
+ drivers/usb/musb/musb_virthub.c | 20 ++++----
+ drivers/usb/musb/omap2430.c | 62 +++++++++----------------
+ drivers/usb/musb/tusb6010.c | 70 ++++++++++++++++++-----------
+ 10 files changed, 181 insertions(+), 155 deletions(-)
+
+diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
+index 9985db0..9eea991 100644
+--- a/drivers/usb/musb/Kconfig
++++ b/drivers/usb/musb/Kconfig
+@@ -10,6 +10,7 @@ comment "Enable Host or Gadget support to see Inventra options"
+ config USB_MUSB_HDRC
+ depends on (USB || USB_GADGET) && HAVE_CLK
+ depends on !SUPERH
++ select NOP_USB_XCEIV if ARCH_DAVINCI
+ select TWL4030_USB if MACH_OMAP_3430SDP
+ select USB_OTG_UTILS
+ tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
+@@ -55,6 +56,7 @@ comment "Blackfin high speed USB Support"
+ config USB_TUSB6010
+ boolean "TUSB 6010 support"
+ depends on USB_MUSB_HDRC && !USB_MUSB_SOC
++ select NOP_USB_XCEIV
+ default y
+ help
+ The TUSB 6010 chip, from Texas Instruments, connects a discrete
+diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
+index 7861348..f2f66eb 100644
+--- a/drivers/usb/musb/blackfin.c
++++ b/drivers/usb/musb/blackfin.c
+@@ -143,7 +143,7 @@ static void musb_conn_timer_handler(unsigned long _musb)
+ u16 val;
+
+ spin_lock_irqsave(&musb->lock, flags);
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_IDLE:
+ case OTG_STATE_A_WAIT_BCON:
+ /* Start a new session */
+@@ -154,7 +154,7 @@ static void musb_conn_timer_handler(unsigned long _musb)
+ val = musb_readw(musb->mregs, MUSB_DEVCTL);
+ if (!(val & MUSB_DEVCTL_BDEVICE)) {
+ gpio_set_value(musb->config->gpio_vrsel, 1);
+- musb->xceiv.state = OTG_STATE_A_WAIT_BCON;
++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ } else {
+ gpio_set_value(musb->config->gpio_vrsel, 0);
+
+@@ -247,6 +247,11 @@ int __init musb_platform_init(struct musb *musb)
+ }
+ gpio_direction_output(musb->config->gpio_vrsel, 0);
+
++ usb_nop_xceiv_register();
++ musb->xceiv = otg_get_transceiver();
++ if (!musb->xceiv)
++ return -ENODEV;
++
+ if (ANOMALY_05000346) {
+ bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
+ SSYNC();
+@@ -291,7 +296,7 @@ int __init musb_platform_init(struct musb *musb)
+ musb_conn_timer_handler, (unsigned long) musb);
+ }
+ if (is_peripheral_enabled(musb))
+- musb->xceiv.set_power = bfin_set_power;
++ musb->xceiv->set_power = bfin_set_power;
+
+ musb->isr = blackfin_interrupt;
+
+diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
+index 9fd74bf..81de742 100644
+--- a/drivers/usb/musb/davinci.c
++++ b/drivers/usb/musb/davinci.c
+@@ -200,7 +200,7 @@ static void otg_timer(unsigned long _musb)
+ DBG(7, "poll devctl %02x (%s)\n", devctl, otg_state_string(musb));
+
+ spin_lock_irqsave(&musb->lock, flags);
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_WAIT_VFALL:
+ /* Wait till VBUS falls below SessionEnd (~0.2V); the 1.3 RTL
+ * seems to mis-handle session "start" otherwise (or in our
+@@ -211,7 +211,7 @@ static void otg_timer(unsigned long _musb)
+ mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
+ break;
+ }
+- musb->xceiv.state = OTG_STATE_A_WAIT_VRISE;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
+ musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG,
+ MUSB_INTR_VBUSERROR << DAVINCI_USB_USBINT_SHIFT);
+ break;
+@@ -236,7 +236,7 @@ static void otg_timer(unsigned long _musb)
+ if (devctl & MUSB_DEVCTL_BDEVICE)
+ mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
+ else
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ break;
+ default:
+ break;
+@@ -310,21 +310,21 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
+ * to stop registering in devctl.
+ */
+ musb->int_usb &= ~MUSB_INTR_VBUSERROR;
+- musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
+ mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
+ WARNING("VBUS error workaround (delay coming)\n");
+ } else if (is_host_enabled(musb) && drvvbus) {
+ musb->is_active = 1;
+ MUSB_HST_MODE(musb);
+- musb->xceiv.default_a = 1;
+- musb->xceiv.state = OTG_STATE_A_WAIT_VRISE;
++ musb->xceiv->default_a = 1;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
+ portstate(musb->port1_status |= USB_PORT_STAT_POWER);
+ del_timer(&otg_workaround);
+ } else {
+ musb->is_active = 0;
+ MUSB_DEV_MODE(musb);
+- musb->xceiv.default_a = 0;
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->default_a = 0;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
+ }
+
+@@ -346,7 +346,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
+
+ /* poll for ID change */
+ if (is_otg_enabled(musb)
+- && musb->xceiv.state == OTG_STATE_B_IDLE)
++ && musb->xceiv->state == OTG_STATE_B_IDLE)
+ mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
+
+ spin_unlock_irqrestore(&musb->lock, flags);
+@@ -365,6 +365,11 @@ int __init musb_platform_init(struct musb *musb)
+ void __iomem *tibase = musb->ctrl_base;
+ u32 revision;
+
++ usb_nop_xceiv_register();
++ musb->xceiv = otg_get_transceiver();
++ if (!musb->xceiv)
++ return -ENODEV;
++
+ musb->mregs += DAVINCI_BASE_OFFSET;
+
+ clk_enable(musb->clock);
+@@ -372,7 +377,7 @@ int __init musb_platform_init(struct musb *musb)
+ /* returns zero if e.g. not clocked */
+ revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
+ if (revision == 0)
+- return -ENODEV;
++ goto fail;
+
+ if (is_host_enabled(musb))
+ setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
+@@ -396,6 +401,10 @@ int __init musb_platform_init(struct musb *musb)
+
+ musb->isr = davinci_interrupt;
+ return 0;
++
++fail:
++ usb_nop_xceiv_unregister();
++ return -ENODEV;
+ }
+
+ int musb_platform_exit(struct musb *musb)
+@@ -406,7 +415,7 @@ int musb_platform_exit(struct musb *musb)
+ davinci_source_power(musb, 0 /*off*/, 1);
+
+ /* delay, to avoid problems with module reload */
+- if (is_host_enabled(musb) && musb->xceiv.default_a) {
++ if (is_host_enabled(musb) && musb->xceiv->default_a) {
+ int maxdelay = 30;
+ u8 devctl, warn = 0;
+
+@@ -435,5 +444,7 @@ int musb_platform_exit(struct musb *musb)
+
+ clk_disable(musb->clock);
+
++ usb_nop_xceiv_unregister();
++
+ return 0;
+ }
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index d953305..ac150af 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -267,7 +267,7 @@ void musb_load_testpacket(struct musb *musb)
+
+ const char *otg_state_string(struct musb *musb)
+ {
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_IDLE: return "a_idle";
+ case OTG_STATE_A_WAIT_VRISE: return "a_wait_vrise";
+ case OTG_STATE_A_WAIT_BCON: return "a_wait_bcon";
+@@ -302,11 +302,11 @@ void musb_otg_timer_func(unsigned long data)
+ unsigned long flags;
+
+ spin_lock_irqsave(&musb->lock, flags);
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_B_WAIT_ACON:
+ DBG(1, "HNP: b_wait_acon timeout; back to b_peripheral\n");
+ musb_g_disconnect(musb);
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ musb->is_active = 0;
+ break;
+ case OTG_STATE_A_WAIT_BCON:
+@@ -331,20 +331,20 @@ void musb_hnp_stop(struct musb *musb)
+ void __iomem *mbase = musb->mregs;
+ u8 reg;
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_PERIPHERAL:
+ case OTG_STATE_A_WAIT_VFALL:
+ case OTG_STATE_A_WAIT_BCON:
+ DBG(1, "HNP: Switching back to A-host\n");
+ musb_g_disconnect(musb);
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ MUSB_HST_MODE(musb);
+ musb->is_active = 0;
+ break;
+ case OTG_STATE_B_HOST:
+ DBG(1, "HNP: Disabling HR\n");
+ hcd->self.is_b_host = 0;
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ MUSB_DEV_MODE(musb);
+ reg = musb_readb(mbase, MUSB_POWER);
+ reg |= MUSB_POWER_SUSPENDM;
+@@ -402,7 +402,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+
+ if (devctl & MUSB_DEVCTL_HM) {
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_SUSPEND:
+ /* remote wakeup? later, GetPortStatus
+ * will stop RESUME signaling
+@@ -425,12 +425,12 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ musb->rh_timer = jiffies
+ + msecs_to_jiffies(20);
+
+- musb->xceiv.state = OTG_STATE_A_HOST;
++ musb->xceiv->state = OTG_STATE_A_HOST;
+ musb->is_active = 1;
+ usb_hcd_resume_root_hub(musb_to_hcd(musb));
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ musb->is_active = 1;
+ MUSB_DEV_MODE(musb);
+ break;
+@@ -441,11 +441,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ }
+ #endif
+ } else {
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+ case OTG_STATE_A_SUSPEND:
+ /* possibly DISCONNECT is upcoming */
+- musb->xceiv.state = OTG_STATE_A_HOST;
++ musb->xceiv->state = OTG_STATE_A_HOST;
+ usb_hcd_resume_root_hub(musb_to_hcd(musb));
+ break;
+ #endif
+@@ -490,7 +490,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ */
+ musb_writeb(mbase, MUSB_DEVCTL, MUSB_DEVCTL_SESSION);
+ musb->ep0_stage = MUSB_EP0_START;
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ MUSB_HST_MODE(musb);
+ musb_set_vbus(musb, 1);
+
+@@ -516,7 +516,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ * REVISIT: do delays from lots of DEBUG_KERNEL checks
+ * make trouble here, keeping VBUS < 4.4V ?
+ */
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_HOST:
+ /* recovery is dicey once we've gotten past the
+ * initial stages of enumeration, but if VBUS
+@@ -602,11 +602,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ MUSB_HST_MODE(musb);
+
+ /* indicate new connection to OTG machine */
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_B_PERIPHERAL:
+ if (int_usb & MUSB_INTR_SUSPEND) {
+ DBG(1, "HNP: SUSPEND+CONNECT, now b_host\n");
+- musb->xceiv.state = OTG_STATE_B_HOST;
++ musb->xceiv->state = OTG_STATE_B_HOST;
+ hcd->self.is_b_host = 1;
+ int_usb &= ~MUSB_INTR_SUSPEND;
+ } else
+@@ -614,13 +614,13 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ DBG(1, "HNP: Waiting to switch to b_host state\n");
+- musb->xceiv.state = OTG_STATE_B_HOST;
++ musb->xceiv->state = OTG_STATE_B_HOST;
+ hcd->self.is_b_host = 1;
+ break;
+ default:
+ if ((devctl & MUSB_DEVCTL_VBUS)
+ == (3 << MUSB_DEVCTL_VBUS_SHIFT)) {
+- musb->xceiv.state = OTG_STATE_A_HOST;
++ musb->xceiv->state = OTG_STATE_A_HOST;
+ hcd->self.is_b_host = 0;
+ }
+ break;
+@@ -650,7 +650,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ }
+ } else if (is_peripheral_capable()) {
+ DBG(1, "BUS RESET as %s\n", otg_state_string(musb));
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ #ifdef CONFIG_USB_OTG
+ case OTG_STATE_A_SUSPEND:
+ /* We need to ignore disconnect on suspend
+@@ -673,12 +673,12 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ case OTG_STATE_B_WAIT_ACON:
+ DBG(1, "HNP: RESET (%s), to b_peripheral\n",
+ otg_state_string(musb));
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ musb_g_reset(musb);
+ break;
+ #endif
+ case OTG_STATE_B_IDLE:
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ /* FALLTHROUGH */
+ case OTG_STATE_B_PERIPHERAL:
+ musb_g_reset(musb);
+@@ -763,7 +763,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ MUSB_MODE(musb), devctl);
+ handled = IRQ_HANDLED;
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+ case OTG_STATE_A_HOST:
+ case OTG_STATE_A_SUSPEND:
+@@ -805,7 +805,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ otg_state_string(musb), devctl, power);
+ handled = IRQ_HANDLED;
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ #ifdef CONFIG_USB_MUSB_OTG
+ case OTG_STATE_A_PERIPHERAL:
+ /*
+@@ -817,10 +817,10 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ case OTG_STATE_B_PERIPHERAL:
+ musb_g_suspend(musb);
+ musb->is_active = is_otg_enabled(musb)
+- && musb->xceiv.gadget->b_hnp_enable;
++ && musb->xceiv->gadget->b_hnp_enable;
+ if (musb->is_active) {
+ #ifdef CONFIG_USB_MUSB_OTG
+- musb->xceiv.state = OTG_STATE_B_WAIT_ACON;
++ musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
+ DBG(1, "HNP: Setting timer for b_ase0_brst\n");
+ musb_otg_timer.data = (unsigned long)musb;
+ mod_timer(&musb_otg_timer, jiffies
+@@ -834,9 +834,9 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ + msecs_to_jiffies(musb->a_wait_bcon));
+ break;
+ case OTG_STATE_A_HOST:
+- musb->xceiv.state = OTG_STATE_A_SUSPEND;
++ musb->xceiv->state = OTG_STATE_A_SUSPEND;
+ musb->is_active = is_otg_enabled(musb)
+- && musb->xceiv.host->b_hnp_enable;
++ && musb->xceiv->host->b_hnp_enable;
+ break;
+ case OTG_STATE_B_HOST:
+ /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */
+@@ -1681,7 +1681,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
+
+ spin_lock_irqsave(&musb->lock, flags);
+ musb->a_wait_bcon = val;
+- if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
++ if (musb->xceiv->state == OTG_STATE_A_WAIT_BCON)
+ musb->is_active = 0;
+ musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val));
+ spin_unlock_irqrestore(&musb->lock, flags);
+@@ -1742,8 +1742,8 @@ static void musb_irq_work(struct work_struct *data)
+ struct musb *musb = container_of(data, struct musb, irq_work);
+ static int old_state;
+
+- if (musb->xceiv.state != old_state) {
+- old_state = musb->xceiv.state;
++ if (musb->xceiv->state != old_state) {
++ old_state = musb->xceiv->state;
+ sysfs_notify(&musb->controller->kobj, NULL, "mode");
+ }
+ }
+@@ -1840,7 +1840,7 @@ static void musb_free(struct musb *musb)
+ }
+
+ #ifdef CONFIG_USB_MUSB_OTG
+- put_device(musb->xceiv.dev);
++ put_device(musb->xceiv->dev);
+ #endif
+
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+@@ -1921,10 +1921,18 @@ bad_config:
+ }
+ }
+
+- /* assume vbus is off */
+-
+- /* platform adjusts musb->mregs and musb->isr if needed,
+- * and activates clocks
++ /* The musb_platform_init() call:
++ * - adjusts musb->mregs and musb->isr if needed,
++ * - may initialize an integrated tranceiver
++ * - initializes musb->xceiv, usually by otg_get_transceiver()
++ * - activates clocks.
++ * - stops powering VBUS
++ * - assigns musb->board_set_vbus if host mode is enabled
++ *
++ * There are various transciever configurations. Blackfin,
++ * DaVinci, TUSB60x0, and others integrate them. OMAP3 uses
++ * external/discrete ones in various flavors (twl4030 family,
++ * isp1504, non-OTG, etc) mostly hooking up through ULPI.
+ */
+ musb->isr = generic_interrupt;
+ status = musb_platform_init(musb);
+@@ -1992,17 +2000,17 @@ bad_config:
+ ? "DMA" : "PIO",
+ musb->nIrq);
+
+-#ifdef CONFIG_USB_MUSB_HDRC_HCD
+- /* host side needs more setup, except for no-host modes */
+- if (musb->board_mode != MUSB_PERIPHERAL) {
++ /* host side needs more setup */
++ if (is_host_enabled(musb)) {
+ struct usb_hcd *hcd = musb_to_hcd(musb);
+
+- if (musb->board_mode == MUSB_OTG)
++ otg_set_host(musb->xceiv, &hcd->self);
++
++ if (is_otg_enabled(musb))
+ hcd->self.otg_port = 1;
+- musb->xceiv.host = &hcd->self;
++ musb->xceiv->host = &hcd->self;
+ hcd->power_budget = 2 * (plat->power ? : 250);
+ }
+-#endif /* CONFIG_USB_MUSB_HDRC_HCD */
+
+ /* For the host-only role, we can activate right away.
+ * (We expect the ID pin to be forcibly grounded!!)
+@@ -2010,8 +2018,8 @@ bad_config:
+ */
+ if (!is_otg_enabled(musb) && is_host_enabled(musb)) {
+ MUSB_HST_MODE(musb);
+- musb->xceiv.default_a = 1;
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->default_a = 1;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+
+ status = usb_add_hcd(musb_to_hcd(musb), -1, 0);
+ if (status)
+@@ -2026,8 +2034,8 @@ bad_config:
+
+ } else /* peripheral is enabled */ {
+ MUSB_DEV_MODE(musb);
+- musb->xceiv.default_a = 0;
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->default_a = 0;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+
+ status = musb_gadget_setup(musb);
+ if (status)
+diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
+index 0ac4faf..c3ee348 100644
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -356,7 +356,7 @@ struct musb {
+ u16 int_rx;
+ u16 int_tx;
+
+- struct otg_transceiver xceiv;
++ struct otg_transceiver *xceiv;
+
+ int nIrq;
+ unsigned irq_wake:1;
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index e8f920c..2fbfba5 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -1406,7 +1406,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget)
+
+ spin_lock_irqsave(&musb->lock, flags);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_B_PERIPHERAL:
+ /* NOTE: OTG state machine doesn't include B_SUSPENDED;
+ * that's part of the standard usb 1.1 state machine, and
+@@ -1508,9 +1508,9 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
+ {
+ struct musb *musb = gadget_to_musb(gadget);
+
+- if (!musb->xceiv.set_power)
++ if (!musb->xceiv->set_power)
+ return -EOPNOTSUPP;
+- return otg_set_power(&musb->xceiv, mA);
++ return otg_set_power(musb->xceiv, mA);
+ }
+
+ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
+@@ -1733,11 +1733,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+
+ spin_lock_irqsave(&musb->lock, flags);
+
+- /* REVISIT always use otg_set_peripheral(), handling
+- * issues including the root hub one below ...
+- */
+- musb->xceiv.gadget = &musb->g;
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ otg_set_peripheral(musb->xceiv, &musb->g);
+ musb->is_active = 1;
+
+ /* FIXME this ignores the softconnect flag. Drivers are
+@@ -1749,6 +1745,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+ if (!is_otg_enabled(musb))
+ musb_start(musb);
+
++ otg_set_peripheral(musb->xceiv, &musb->g);
++
+ spin_unlock_irqrestore(&musb->lock, flags);
+
+ if (is_otg_enabled(musb)) {
+@@ -1762,8 +1760,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+ if (retval < 0) {
+ DBG(1, "add_hcd failed, %d\n", retval);
+ spin_lock_irqsave(&musb->lock, flags);
+- musb->xceiv.gadget = NULL;
+- musb->xceiv.state = OTG_STATE_UNDEFINED;
++ otg_set_peripheral(musb->xceiv, NULL);
+ musb->gadget_driver = NULL;
+ musb->g.dev.driver = NULL;
+ spin_unlock_irqrestore(&musb->lock, flags);
+@@ -1846,8 +1843,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+
+ (void) musb_gadget_vbus_draw(&musb->g, 0);
+
+- musb->xceiv.state = OTG_STATE_UNDEFINED;
++ musb->xceiv->state = OTG_STATE_UNDEFINED;
+ stop_activity(musb, driver);
++ otg_set_peripheral(musb->xceiv, NULL);
+
+ DBG(3, "unregistering driver %s\n", driver->function);
+ spin_unlock_irqrestore(&musb->lock, flags);
+@@ -1883,7 +1881,7 @@ EXPORT_SYMBOL(usb_gadget_unregister_driver);
+ void musb_g_resume(struct musb *musb)
+ {
+ musb->is_suspended = 0;
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_B_IDLE:
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+@@ -1909,10 +1907,10 @@ void musb_g_suspend(struct musb *musb)
+ devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+ DBG(3, "devctl %02x\n", devctl);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_B_IDLE:
+ if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ break;
+ case OTG_STATE_B_PERIPHERAL:
+ musb->is_suspended = 1;
+@@ -1958,22 +1956,22 @@ void musb_g_disconnect(struct musb *musb)
+ spin_lock(&musb->lock);
+ }
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ default:
+ #ifdef CONFIG_USB_MUSB_OTG
+ DBG(2, "Unhandled disconnect %s, setting a_idle\n",
+ otg_state_string(musb));
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+- musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ case OTG_STATE_B_HOST:
+ #endif
+ case OTG_STATE_B_PERIPHERAL:
+ case OTG_STATE_B_IDLE:
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ break;
+ case OTG_STATE_B_SRP_INIT:
+ break;
+@@ -2029,10 +2027,10 @@ __acquires(musb->lock)
+ * or else after HNP, as A-Device
+ */
+ if (devctl & MUSB_DEVCTL_BDEVICE) {
+- musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ musb->g.is_a_peripheral = 0;
+ } else if (is_otg_enabled(musb)) {
+- musb->xceiv.state = OTG_STATE_A_PERIPHERAL;
++ musb->xceiv->state = OTG_STATE_A_PERIPHERAL;
+ musb->g.is_a_peripheral = 1;
+ } else
+ WARN_ON(1);
+diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
+index ece5122..795dabe 100644
+--- a/drivers/usb/musb/musb_host.c
++++ b/drivers/usb/musb/musb_host.c
+@@ -2169,7 +2169,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
+ {
+ struct musb *musb = hcd_to_musb(hcd);
+
+- if (musb->xceiv.state == OTG_STATE_A_SUSPEND)
++ if (musb->xceiv->state == OTG_STATE_A_SUSPEND)
+ return 0;
+
+ if (is_host_active(musb) && musb->is_active) {
+diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
+index e0e9ce5..7e7900f 100644
+--- a/drivers/usb/musb/musb_virthub.c
++++ b/drivers/usb/musb/musb_virthub.c
+@@ -78,18 +78,18 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
+ DBG(3, "Root port suspended, power %02x\n", power);
+
+ musb->port1_status |= USB_PORT_STAT_SUSPEND;
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_HOST:
+- musb->xceiv.state = OTG_STATE_A_SUSPEND;
++ musb->xceiv->state = OTG_STATE_A_SUSPEND;
+ musb->is_active = is_otg_enabled(musb)
+- && musb->xceiv.host->b_hnp_enable;
++ && musb->xceiv->host->b_hnp_enable;
+ musb_platform_try_idle(musb, 0);
+ break;
+ #ifdef CONFIG_USB_MUSB_OTG
+ case OTG_STATE_B_HOST:
+- musb->xceiv.state = OTG_STATE_B_WAIT_ACON;
++ musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
+ musb->is_active = is_otg_enabled(musb)
+- && musb->xceiv.host->b_hnp_enable;
++ && musb->xceiv->host->b_hnp_enable;
+ musb_platform_try_idle(musb, 0);
+ break;
+ #endif
+@@ -116,7 +116,7 @@ static void musb_port_reset(struct musb *musb, bool do_reset)
+ void __iomem *mbase = musb->mregs;
+
+ #ifdef CONFIG_USB_MUSB_OTG
+- if (musb->xceiv.state == OTG_STATE_B_IDLE) {
++ if (musb->xceiv->state == OTG_STATE_B_IDLE) {
+ DBG(2, "HNP: Returning from HNP; no hub reset from b_idle\n");
+ musb->port1_status &= ~USB_PORT_STAT_RESET;
+ return;
+@@ -186,14 +186,14 @@ void musb_root_disconnect(struct musb *musb)
+ usb_hcd_poll_rh_status(musb_to_hcd(musb));
+ musb->is_active = 0;
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_HOST:
+ case OTG_STATE_A_SUSPEND:
+- musb->xceiv.state = OTG_STATE_A_WAIT_BCON;
++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ musb->is_active = 0;
+ break;
+ case OTG_STATE_A_WAIT_VFALL:
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ break;
+ default:
+ DBG(1, "host disconnect (%s)\n", otg_state_string(musb));
+@@ -332,7 +332,7 @@ int musb_hub_control(
+ musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16;
+ usb_hcd_poll_rh_status(musb_to_hcd(musb));
+ /* NOTE: it might really be A_WAIT_BCON ... */
+- musb->xceiv.state = OTG_STATE_A_HOST;
++ musb->xceiv->state = OTG_STATE_A_HOST;
+ }
+
+ put_unaligned(cpu_to_le32(musb->port1_status
+diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
+index 901dffd..5f67b03 100644
+--- a/drivers/usb/musb/omap2430.c
++++ b/drivers/usb/musb/omap2430.c
+@@ -62,17 +62,17 @@ static void musb_do_idle(unsigned long _musb)
+
+ devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_WAIT_BCON:
+ devctl &= ~MUSB_DEVCTL_SESSION;
+ musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
+
+ devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+ if (devctl & MUSB_DEVCTL_BDEVICE) {
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ MUSB_DEV_MODE(musb);
+ } else {
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ MUSB_HST_MODE(musb);
+ }
+ break;
+@@ -90,7 +90,7 @@ static void musb_do_idle(unsigned long _musb)
+ musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16;
+ usb_hcd_poll_rh_status(musb_to_hcd(musb));
+ /* NOTE: it might really be A_WAIT_BCON ... */
+- musb->xceiv.state = OTG_STATE_A_HOST;
++ musb->xceiv->state = OTG_STATE_A_HOST;
+ }
+ break;
+ #endif
+@@ -98,9 +98,9 @@ static void musb_do_idle(unsigned long _musb)
+ case OTG_STATE_A_HOST:
+ devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+ if (devctl & MUSB_DEVCTL_BDEVICE)
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ else
+- musb->xceiv.state = OTG_STATE_A_WAIT_BCON;
++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ #endif
+ default:
+ break;
+@@ -119,7 +119,7 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout)
+
+ /* Never idle if active, or when VBUS timeout is not set as host */
+ if (musb->is_active || ((musb->a_wait_bcon == 0)
+- && (musb->xceiv.state == OTG_STATE_A_WAIT_BCON))) {
++ && (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
+ DBG(4, "%s active, deleting timer\n", otg_state_string(musb));
+ del_timer(&musb_idle_timer);
+ last_timer = jiffies;
+@@ -164,8 +164,8 @@ static void omap_set_vbus(struct musb *musb, int is_on)
+
+ if (is_on) {
+ musb->is_active = 1;
+- musb->xceiv.default_a = 1;
+- musb->xceiv.state = OTG_STATE_A_WAIT_VRISE;
++ musb->xceiv->default_a = 1;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
+ devctl |= MUSB_DEVCTL_SESSION;
+
+ MUSB_HST_MODE(musb);
+@@ -176,8 +176,8 @@ static void omap_set_vbus(struct musb *musb, int is_on)
+ * jumping right to B_IDLE...
+ */
+
+- musb->xceiv.default_a = 0;
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->default_a = 0;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ devctl &= ~MUSB_DEVCTL_SESSION;
+
+ MUSB_DEV_MODE(musb);
+@@ -189,10 +189,6 @@ static void omap_set_vbus(struct musb *musb, int is_on)
+ otg_state_string(musb),
+ musb_readb(musb->mregs, MUSB_DEVCTL));
+ }
+-static int omap_set_power(struct otg_transceiver *x, unsigned mA)
+-{
+- return 0;
+-}
+
+ static int musb_platform_resume(struct musb *musb);
+
+@@ -203,24 +199,6 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
+ devctl |= MUSB_DEVCTL_SESSION;
+ musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
+
+- switch (musb_mode) {
+-#ifdef CONFIG_USB_MUSB_HDRC_HCD
+- case MUSB_HOST:
+- otg_set_host(&musb->xceiv, musb->xceiv.host);
+- break;
+-#endif
+-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+- case MUSB_PERIPHERAL:
+- otg_set_peripheral(&musb->xceiv, musb->xceiv.gadget);
+- break;
+-#endif
+-#ifdef CONFIG_USB_MUSB_OTG
+- case MUSB_OTG:
+- break;
+-#endif
+- default:
+- return -EINVAL;
+- }
+ return 0;
+ }
+
+@@ -232,6 +210,16 @@ int __init musb_platform_init(struct musb *musb)
+ omap_cfg_reg(AE5_2430_USB0HS_STP);
+ #endif
+
++ /* We require some kind of external transceiver, hooked
++ * up through ULPI. TWL4030-family PMICs include one,
++ * which needs a driver, drivers aren't always needed.
++ */
++ musb->xceiv = otg_get_transceiver();
++ if (!musb->xceiv) {
++ pr_err("HS USB OTG: no transceiver configured\n");
++ return -ENODEV;
++ }
++
+ musb_platform_resume(musb);
+
+ l = omap_readl(OTG_SYSCONFIG);
+@@ -258,8 +246,6 @@ int __init musb_platform_init(struct musb *musb)
+
+ if (is_host_enabled(musb))
+ musb->board_set_vbus = omap_set_vbus;
+- if (is_peripheral_enabled(musb))
+- musb->xceiv.set_power = omap_set_power;
+ musb->a_wait_bcon = MUSB_TIMEOUT_A_WAIT_BCON;
+
+ setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
+@@ -283,8 +269,7 @@ int musb_platform_suspend(struct musb *musb)
+ l |= ENABLEWAKEUP; /* enable wakeup */
+ omap_writel(l, OTG_SYSCONFIG);
+
+- if (musb->xceiv.set_suspend)
+- musb->xceiv.set_suspend(&musb->xceiv, 1);
++ otg_set_suspend(musb->xceiv, 1);
+
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 0);
+@@ -301,8 +286,7 @@ static int musb_platform_resume(struct musb *musb)
+ if (!musb->clock)
+ return 0;
+
+- if (musb->xceiv.set_suspend)
+- musb->xceiv.set_suspend(&musb->xceiv, 0);
++ otg_set_suspend(musb->xceiv, 0);
+
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 1);
+diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
+index 9e20fd0..c473dec 100644
+--- a/drivers/usb/musb/tusb6010.c
++++ b/drivers/usb/musb/tusb6010.c
+@@ -260,6 +260,8 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
+ tusb_fifo_read_unaligned(fifo, buf, len);
+ }
+
++static struct musb *the_musb;
++
+ #ifdef CONFIG_USB_GADGET_MUSB_HDRC
+
+ /* This is used by gadget drivers, and OTG transceiver logic, allowing
+@@ -270,7 +272,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
+ */
+ static int tusb_draw_power(struct otg_transceiver *x, unsigned mA)
+ {
+- struct musb *musb = container_of(x, struct musb, xceiv);
++ struct musb *musb = the_musb;
+ void __iomem *tbase = musb->ctrl_base;
+ u32 reg;
+
+@@ -420,7 +422,7 @@ static void musb_do_idle(unsigned long _musb)
+
+ spin_lock_irqsave(&musb->lock, flags);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_WAIT_BCON:
+ if ((musb->a_wait_bcon != 0)
+ && (musb->idle_timeout == 0
+@@ -484,7 +486,7 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout)
+
+ /* Never idle if active, or when VBUS timeout is not set as host */
+ if (musb->is_active || ((musb->a_wait_bcon == 0)
+- && (musb->xceiv.state == OTG_STATE_A_WAIT_BCON))) {
++ && (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
+ DBG(4, "%s active, deleting timer\n", otg_state_string(musb));
+ del_timer(&musb_idle_timer);
+ last_timer = jiffies;
+@@ -533,8 +535,8 @@ static void tusb_source_power(struct musb *musb, int is_on)
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 1);
+ timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE);
+- musb->xceiv.default_a = 1;
+- musb->xceiv.state = OTG_STATE_A_WAIT_VRISE;
++ musb->xceiv->default_a = 1;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
+ devctl |= MUSB_DEVCTL_SESSION;
+
+ conf |= TUSB_DEV_CONF_USB_HOST_MODE;
+@@ -547,24 +549,24 @@ static void tusb_source_power(struct musb *musb, int is_on)
+ /* If ID pin is grounded, we want to be a_idle */
+ otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT);
+ if (!(otg_stat & TUSB_DEV_OTG_STAT_ID_STATUS)) {
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_WAIT_VRISE:
+ case OTG_STATE_A_WAIT_BCON:
+- musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
++ musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
+ break;
+ case OTG_STATE_A_WAIT_VFALL:
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ break;
+ default:
+- musb->xceiv.state = OTG_STATE_A_IDLE;
++ musb->xceiv->state = OTG_STATE_A_IDLE;
+ }
+ musb->is_active = 0;
+- musb->xceiv.default_a = 1;
++ musb->xceiv->default_a = 1;
+ MUSB_HST_MODE(musb);
+ } else {
+ musb->is_active = 0;
+- musb->xceiv.default_a = 0;
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->default_a = 0;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ MUSB_DEV_MODE(musb);
+ }
+
+@@ -675,7 +677,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+ else
+ default_a = is_host_enabled(musb);
+ DBG(2, "Default-%c\n", default_a ? 'A' : 'B');
+- musb->xceiv.default_a = default_a;
++ musb->xceiv->default_a = default_a;
+ tusb_source_power(musb, default_a);
+
+ /* Don't allow idling immediately */
+@@ -687,7 +689,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+ if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) {
+
+ /* B-dev state machine: no vbus ~= disconnect */
+- if ((is_otg_enabled(musb) && !musb->xceiv.default_a)
++ if ((is_otg_enabled(musb) && !musb->xceiv->default_a)
+ || !is_host_enabled(musb)) {
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+ /* ? musb_root_disconnect(musb); */
+@@ -702,9 +704,9 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+
+ if (otg_stat & TUSB_DEV_OTG_STAT_SESS_END) {
+ DBG(1, "Forcing disconnect (no interrupt)\n");
+- if (musb->xceiv.state != OTG_STATE_B_IDLE) {
++ if (musb->xceiv->state != OTG_STATE_B_IDLE) {
+ /* INTR_DISCONNECT can hide... */
+- musb->xceiv.state = OTG_STATE_B_IDLE;
++ musb->xceiv->state = OTG_STATE_B_IDLE;
+ musb->int_usb |= MUSB_INTR_DISCONNECT;
+ }
+ musb->is_active = 0;
+@@ -718,7 +720,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+ DBG(2, "vbus change, %s, otg %03x\n",
+ otg_state_string(musb), otg_stat);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_IDLE:
+ DBG(2, "Got SRP, turning on VBUS\n");
+ musb_set_vbus(musb, 1);
+@@ -766,7 +768,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+
+ DBG(4, "%s timer, %03x\n", otg_state_string(musb), otg_stat);
+
+- switch (musb->xceiv.state) {
++ switch (musb->xceiv->state) {
+ case OTG_STATE_A_WAIT_VRISE:
+ /* VBUS has probably been valid for a while now,
+ * but may well have bounced out of range a bit
+@@ -778,7 +780,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
+ DBG(2, "devctl %02x\n", devctl);
+ break;
+ }
+- musb->xceiv.state = OTG_STATE_A_WAIT_BCON;
++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ musb->is_active = 0;
+ idle_timeout = jiffies
+ + msecs_to_jiffies(musb->a_wait_bcon);
+@@ -1094,9 +1096,14 @@ int __init musb_platform_init(struct musb *musb)
+ {
+ struct platform_device *pdev;
+ struct resource *mem;
+- void __iomem *sync;
++ void __iomem *sync = NULL;
+ int ret;
+
++ usb_nop_xceiv_register();
++ musb->xceiv = otg_get_transceiver();
++ if (!musb->xceiv)
++ return -ENODEV;
++
+ pdev = to_platform_device(musb->controller);
+
+ /* dma address for async dma */
+@@ -1107,14 +1114,16 @@ int __init musb_platform_init(struct musb *musb)
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ if (!mem) {
+ pr_debug("no sync dma resource?\n");
+- return -ENODEV;
++ ret = -ENODEV;
++ goto done;
+ }
+ musb->sync = mem->start;
+
+ sync = ioremap(mem->start, mem->end - mem->start + 1);
+ if (!sync) {
+ pr_debug("ioremap for sync failed\n");
+- return -ENOMEM;
++ ret = -ENOMEM;
++ goto done;
+ }
+ musb->sync_va = sync;
+
+@@ -1127,28 +1136,37 @@ int __init musb_platform_init(struct musb *musb)
+ if (ret) {
+ printk(KERN_ERR "Could not start tusb6010 (%d)\n",
+ ret);
+- return -ENODEV;
++ goto done;
+ }
+ musb->isr = tusb_interrupt;
+
+ if (is_host_enabled(musb))
+ musb->board_set_vbus = tusb_source_power;
+- if (is_peripheral_enabled(musb))
+- musb->xceiv.set_power = tusb_draw_power;
++ if (is_peripheral_enabled(musb)) {
++ musb->xceiv->set_power = tusb_draw_power;
++ the_musb = musb;
++ }
+
+ setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
+
++done:
++ if (ret < 0) {
++ if (sync)
++ iounmap(sync);
++ usb_nop_xceiv_unregister();
++ }
+ return ret;
+ }
+
+ int musb_platform_exit(struct musb *musb)
+ {
+ del_timer_sync(&musb_idle_timer);
++ the_musb = NULL;
+
+ if (musb->board_set_power)
+ musb->board_set_power(0);
+
+ iounmap(musb->sync_va);
+-
++ usb_nop_xceiv_unregister();
+ return 0;
+ }
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0027-musb-otg-timer-cleanup.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0027-musb-otg-timer-cleanup.patch
new file mode 100644
index 0000000000..f41b766cfe
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0027-musb-otg-timer-cleanup.patch
@@ -0,0 +1,198 @@
+From b4b8c1e7604784b9877f07400ff2a718118ef05c Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 31 Mar 2009 12:32:12 -0700
+Subject: [PATCH] musb: otg timer cleanup
+
+Minor cleanup of OTG timer handling:
+ * unify decls for OTG time constants, in the core header
+ * set up and use that timer in a more normal way
+ * move to the driver struct, so it's usable outside core
+
+And tighten use and setup of T(a_wait_bcon) so that if it's used,
+it's always valid. (If that timer expires, the A-device will
+stop powering VBUS. For non-OTG systems, that will be a surprise.)
+No behavioral changes, other than more consistency when applying
+that core HNP timeout.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 41 ++++++++++++++++++++++-------------------
+ drivers/usb/musb/musb_core.h | 14 +++++++++++---
+ drivers/usb/musb/omap2430.c | 2 --
+ 3 files changed, 33 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index ac150af..05c5dd3 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -112,6 +112,7 @@
+ #include "davinci.h"
+ #endif
+
++#define TA_WAIT_BCON(m) max_t(int, (m)->a_wait_bcon, OTG_TIME_A_WAIT_BCON)
+
+
+ unsigned musb_debug;
+@@ -288,12 +289,6 @@ const char *otg_state_string(struct musb *musb)
+ #ifdef CONFIG_USB_MUSB_OTG
+
+ /*
+- * See also USB_OTG_1-3.pdf 6.6.5 Timers
+- * REVISIT: Are the other timers done in the hardware?
+- */
+-#define TB_ASE0_BRST 100 /* Min 3.125 ms */
+-
+-/*
+ * Handles OTG hnp timeouts, such as b_ase0_brst
+ */
+ void musb_otg_timer_func(unsigned long data)
+@@ -320,10 +315,8 @@ void musb_otg_timer_func(unsigned long data)
+ spin_unlock_irqrestore(&musb->lock, flags);
+ }
+
+-static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0);
+-
+ /*
+- * Stops the B-device HNP state. Caller must take care of locking.
++ * Stops the HNP transition. Caller must take care of locking.
+ */
+ void musb_hnp_stop(struct musb *musb)
+ {
+@@ -661,11 +654,12 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ musb_g_reset(musb);
+ /* FALLTHROUGH */
+ case OTG_STATE_A_WAIT_BCON: /* OPT TD.4.7-900ms */
+- DBG(1, "HNP: Setting timer as %s\n",
+- otg_state_string(musb));
+- musb_otg_timer.data = (unsigned long)musb;
+- mod_timer(&musb_otg_timer, jiffies
+- + msecs_to_jiffies(100));
++ /* never use invalid T(a_wait_bcon) */
++ DBG(1, "HNP: in %s, %d msec timeout\n",
++ otg_state_string(musb),
++ TA_WAIT_BCON(musb));
++ mod_timer(&musb->otg_timer, jiffies
++ + msecs_to_jiffies(TA_WAIT_BCON(musb)));
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+ musb_hnp_stop(musb);
+@@ -822,9 +816,9 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ #ifdef CONFIG_USB_MUSB_OTG
+ musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
+ DBG(1, "HNP: Setting timer for b_ase0_brst\n");
+- musb_otg_timer.data = (unsigned long)musb;
+- mod_timer(&musb_otg_timer, jiffies
+- + msecs_to_jiffies(TB_ASE0_BRST));
++ mod_timer(&musb->otg_timer, jiffies
++ + msecs_to_jiffies(
++ OTG_TIME_B_ASE0_BRST));
+ #endif
+ }
+ break;
+@@ -1680,7 +1674,8 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
+ }
+
+ spin_lock_irqsave(&musb->lock, flags);
+- musb->a_wait_bcon = val;
++ /* force T(a_wait_bcon) to be zero/unlimited *OR* valid */
++ musb->a_wait_bcon = val ? max_t(int, val, OTG_TIME_A_WAIT_BCON) : 0 ;
+ if (musb->xceiv->state == OTG_STATE_A_WAIT_BCON)
+ musb->is_active = 0;
+ musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val));
+@@ -1699,10 +1694,13 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf)
+
+ spin_lock_irqsave(&musb->lock, flags);
+ val = musb->a_wait_bcon;
++ /* FIXME get_vbus_status() is normally #defined as false...
++ * and is effectively TUSB-specific.
++ */
+ vbus = musb_platform_get_vbus_status(musb);
+ spin_unlock_irqrestore(&musb->lock, flags);
+
+- return sprintf(buf, "Vbus %s, timeout %lu\n",
++ return sprintf(buf, "Vbus %s, timeout %lu msec\n",
+ vbus ? "on" : "off", val);
+ }
+ static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store);
+@@ -1775,6 +1773,7 @@ allocate_instance(struct device *dev,
+ hcd->uses_new_polling = 1;
+
+ musb->vbuserr_retry = VBUSERR_RETRY_COUNT;
++ musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON;
+ #else
+ musb = kzalloc(sizeof *musb, GFP_KERNEL);
+ if (!musb)
+@@ -1969,6 +1968,10 @@ bad_config:
+ if (status < 0)
+ goto fail2;
+
++#ifdef CONFIG_USB_OTG
++ setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb);
++#endif
++
+ /* Init IRQ workqueue before request_irq */
+ INIT_WORK(&musb->irq_work, musb_irq_work);
+
+diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
+index c3ee348..cf3ccb0 100644
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -40,6 +40,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/smp_lock.h>
+ #include <linux/errno.h>
++#include <linux/timer.h>
+ #include <linux/clk.h>
+ #include <linux/device.h>
+ #include <linux/usb/ch9.h>
+@@ -180,10 +181,15 @@ enum musb_g_ep0_state {
+ MUSB_EP0_STAGE_ACKWAIT, /* after zlp, before statusin */
+ } __attribute__ ((packed));
+
+-/* OTG protocol constants */
++/*
++ * OTG protocol constants. See USB OTG 1.3 spec,
++ * sections 5.5 "Device Timings" and 6.6.5 "Timers".
++ */
+ #define OTG_TIME_A_WAIT_VRISE 100 /* msec (max) */
+-#define OTG_TIME_A_WAIT_BCON 0 /* 0=infinite; min 1000 msec */
+-#define OTG_TIME_A_IDLE_BDIS 200 /* msec (min) */
++#define OTG_TIME_A_WAIT_BCON 1100 /* min 1 second */
++#define OTG_TIME_A_AIDL_BDIS 200 /* min 200 msec */
++#define OTG_TIME_B_ASE0_BRST 100 /* min 3.125 ms */
++
+
+ /*************************** REGISTER ACCESS ********************************/
+
+@@ -332,6 +338,8 @@ struct musb {
+ struct list_head control; /* of musb_qh */
+ struct list_head in_bulk; /* of musb_qh */
+ struct list_head out_bulk; /* of musb_qh */
++
++ struct timer_list otg_timer;
+ #endif
+
+ /* called with IRQs blocked; ON/nonzero implies starting a session,
+diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
+index 5f67b03..3fbc807 100644
+--- a/drivers/usb/musb/omap2430.c
++++ b/drivers/usb/musb/omap2430.c
+@@ -45,7 +45,6 @@
+ #define get_cpu_rev() 2
+ #endif
+
+-#define MUSB_TIMEOUT_A_WAIT_BCON 1100
+
+ static struct timer_list musb_idle_timer;
+
+@@ -246,7 +245,6 @@ int __init musb_platform_init(struct musb *musb)
+
+ if (is_host_enabled(musb))
+ musb->board_set_vbus = omap_set_vbus;
+- musb->a_wait_bcon = MUSB_TIMEOUT_A_WAIT_BCON;
+
+ setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
+
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0028-musb-make-initial-HNP-roleswitch-work-v2.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0028-musb-make-initial-HNP-roleswitch-work-v2.patch
new file mode 100644
index 0000000000..6269016223
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0028-musb-make-initial-HNP-roleswitch-work-v2.patch
@@ -0,0 +1,133 @@
+From a637c5056ef52fbb7c41eb7537a9ec3d150231ad Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Thu, 2 Apr 2009 10:16:11 -0700
+Subject: [PATCH] musb: make initial HNP roleswitch work (v2)
+
+Minor HNP bugfixes, so the initial role switch works:
+
+ - A-Device:
+ * disconnect-during-suspend enters A_PERIPHERAL state
+ * kill OTG timer after reset as A_PERIPHERAL ...
+ * ... and also pass that reset to the gadget
+ * once HNP succeeds, clear the "ignore_disconnect" flag
+ * from A_PERIPHERAL, disconnect transitions to A_WAIT_BCON
+
+ - B-Device:
+ * kill OTG timer on entry to B_HOST state (HNP succeeded)
+ * once HNP succeeds, clear "ignore_disconnect" flag
+ * kick the root hub only _after_ the state is adjusted
+
+Other state transitions are left alone. Notably, exit paths from
+the "roles have switched" state ... A_PERIPHERAL handling of that
+stays seriously broken.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 27 ++++++++++++++++-----------
+ drivers/usb/musb/musb_gadget.c | 2 +-
+ drivers/usb/musb/musb_virthub.c | 11 ++++++++++-
+ 3 files changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index 05c5dd3..9dc995a 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -587,28 +587,23 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ if (devctl & MUSB_DEVCTL_LSDEV)
+ musb->port1_status |= USB_PORT_STAT_LOW_SPEED;
+
+- if (hcd->status_urb)
+- usb_hcd_poll_rh_status(hcd);
+- else
+- usb_hcd_resume_root_hub(hcd);
+-
+- MUSB_HST_MODE(musb);
+-
+ /* indicate new connection to OTG machine */
+ switch (musb->xceiv->state) {
+ case OTG_STATE_B_PERIPHERAL:
+ if (int_usb & MUSB_INTR_SUSPEND) {
+ DBG(1, "HNP: SUSPEND+CONNECT, now b_host\n");
+- musb->xceiv->state = OTG_STATE_B_HOST;
+- hcd->self.is_b_host = 1;
+ int_usb &= ~MUSB_INTR_SUSPEND;
++ goto b_host;
+ } else
+ DBG(1, "CONNECT as b_peripheral???\n");
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+- DBG(1, "HNP: Waiting to switch to b_host state\n");
++ DBG(1, "HNP: CONNECT, now b_host\n");
++b_host:
+ musb->xceiv->state = OTG_STATE_B_HOST;
+ hcd->self.is_b_host = 1;
++ musb->ignore_disconnect = 0;
++ del_timer(&musb->otg_timer);
+ break;
+ default:
+ if ((devctl & MUSB_DEVCTL_VBUS)
+@@ -618,6 +613,14 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ }
+ break;
+ }
++
++ /* poke the root hub */
++ MUSB_HST_MODE(musb);
++ if (hcd->status_urb)
++ usb_hcd_poll_rh_status(hcd);
++ else
++ usb_hcd_resume_root_hub(hcd);
++
+ DBG(1, "CONNECT (%s) devctl %02x\n",
+ otg_state_string(musb), devctl);
+ }
+@@ -662,7 +665,9 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
+ + msecs_to_jiffies(TA_WAIT_BCON(musb)));
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+- musb_hnp_stop(musb);
++ musb->ignore_disconnect = 0;
++ del_timer(&musb->otg_timer);
++ musb_g_reset(musb);
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ DBG(1, "HNP: RESET (%s), to b_peripheral\n",
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index 2fbfba5..7dd3d59 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -1964,7 +1964,7 @@ void musb_g_disconnect(struct musb *musb)
+ musb->xceiv->state = OTG_STATE_A_IDLE;
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+- musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ case OTG_STATE_B_HOST:
+diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
+index 7e7900f..14f7cf3 100644
+--- a/drivers/usb/musb/musb_virthub.c
++++ b/drivers/usb/musb/musb_virthub.c
+@@ -187,8 +187,17 @@ void musb_root_disconnect(struct musb *musb)
+ musb->is_active = 0;
+
+ switch (musb->xceiv->state) {
+- case OTG_STATE_A_HOST:
+ case OTG_STATE_A_SUSPEND:
++#ifdef CONFIG_USB_MUSB_OTG
++ if (is_otg_enabled(musb)
++ && musb->xceiv->host->b_hnp_enable) {
++ musb->xceiv->state = OTG_STATE_A_PERIPHERAL;
++ musb->g.is_a_peripheral = 1;
++ break;
++ }
++#endif
++ /* FALLTHROUGH */
++ case OTG_STATE_A_HOST:
+ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+ musb->is_active = 0;
+ break;
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0029-musb-support-disconnect-after-HNP-roleswitch.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0029-musb-support-disconnect-after-HNP-roleswitch.patch
new file mode 100644
index 0000000000..fc34fb983e
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/musb/0029-musb-support-disconnect-after-HNP-roleswitch.patch
@@ -0,0 +1,145 @@
+From 4288b7df4ae6629a4fb14aca2c489da01d4d19c3 Mon Sep 17 00:00:00 2001
+From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+Date: Tue, 31 Mar 2009 12:35:09 -0700
+Subject: [PATCH] musb: support disconnect after HNP roleswitch
+
+Adjust HNP state machines in MUSB driver so that they handle the
+case where the cable is disconnected. The A-side machine was
+very wrong (unrecoverable); the B-Side was much less so.
+
+ - A_PERIPHERAL ... as usual, the non-observability of the ID
+ pin through Mentor's registers makes trouble. We can't go
+ directly to A_WAIT_VFALL to end the session and start the
+ disconnect processing. We can however sense link suspending,
+ go to A_WAIT_BCON, and from there use OTG timeouts to finally
+ trigger that A_WAIT_VFALL transition. (Hoping that nobody
+ reconnects quickly to that port and notices the wrong state.)
+
+ - B_HOST ... actually clear the Host Request (HR) bit as the
+ messages say, disconnect the peripheral from the root hub,
+ and don't detour through a suspend state. (In some cases
+ this would eventually have cleaned up.)
+
+Also adjust the A_SUSPEND transition to respect the A_AIDL_BDIS
+timeout, so if HNP doesn't trigger quickly enough the A_WAIT_VFALL
+transition happens as it should.
+
+Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
+---
+ drivers/usb/musb/musb_core.c | 41 +++++++++++++++++++++++++++-----------
+ drivers/usb/musb/musb_gadget.c | 2 +
+ drivers/usb/musb/musb_virthub.c | 4 +++
+ 3 files changed, 35 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index 9dc995a..5770ccb 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -304,9 +304,11 @@ void musb_otg_timer_func(unsigned long data)
+ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+ musb->is_active = 0;
+ break;
++ case OTG_STATE_A_SUSPEND:
+ case OTG_STATE_A_WAIT_BCON:
+- DBG(1, "HNP: a_wait_bcon timeout; back to a_host\n");
+- musb_hnp_stop(musb);
++ DBG(1, "HNP: %s timeout\n", otg_state_string(musb));
++ musb_set_vbus(musb, 0);
++ musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
+ break;
+ default:
+ DBG(1, "HNP: Unhandled mode %s\n", otg_state_string(musb));
+@@ -324,15 +326,12 @@ void musb_hnp_stop(struct musb *musb)
+ void __iomem *mbase = musb->mregs;
+ u8 reg;
+
++ DBG(1, "HNP: stop from %s\n", otg_state_string(musb));
++
+ switch (musb->xceiv->state) {
+ case OTG_STATE_A_PERIPHERAL:
+- case OTG_STATE_A_WAIT_VFALL:
+- case OTG_STATE_A_WAIT_BCON:
+- DBG(1, "HNP: Switching back to A-host\n");
+ musb_g_disconnect(musb);
+- musb->xceiv->state = OTG_STATE_A_IDLE;
+- MUSB_HST_MODE(musb);
+- musb->is_active = 0;
++ DBG(1, "HNP: back to %s\n", otg_state_string(musb));
+ break;
+ case OTG_STATE_B_HOST:
+ DBG(1, "HNP: Disabling HR\n");
+@@ -775,7 +774,16 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ #endif /* HOST */
+ #ifdef CONFIG_USB_MUSB_OTG
+ case OTG_STATE_B_HOST:
+- musb_hnp_stop(musb);
++ /* REVISIT this behaves for "real disconnect"
++ * cases; make sure the other transitions from
++ * from B_HOST act right too. The B_HOST code
++ * in hnp_stop() is currently not used...
++ */
++ musb_root_disconnect(musb);
++ musb_to_hcd(musb)->self.is_b_host = 0;
++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
++ MUSB_DEV_MODE(musb);
++ musb_g_disconnect(musb);
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+ musb_hnp_stop(musb);
+@@ -807,10 +815,19 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
+ switch (musb->xceiv->state) {
+ #ifdef CONFIG_USB_MUSB_OTG
+ case OTG_STATE_A_PERIPHERAL:
+- /*
+- * We cannot stop HNP here, devctl BDEVICE might be
+- * still set.
++ /* We also come here if the cable is removed, since
++ * this silicon doesn't report ID-no-longer-grounded.
++ *
++ * We depend on T(a_wait_bcon) to shut us down, and
++ * hope users don't do anything dicey during this
++ * undesired detour through A_WAIT_BCON.
+ */
++ musb_hnp_stop(musb);
++ usb_hcd_resume_root_hub(musb_to_hcd(musb));
++ musb_root_disconnect(musb);
++ musb_platform_try_idle(musb, jiffies
++ + msecs_to_jiffies(musb->a_wait_bcon
++ ? : OTG_TIME_A_WAIT_BCON));
+ break;
+ #endif
+ case OTG_STATE_B_PERIPHERAL:
+diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
+index 7dd3d59..8b3c4e2 100644
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -1962,9 +1962,11 @@ void musb_g_disconnect(struct musb *musb)
+ DBG(2, "Unhandled disconnect %s, setting a_idle\n",
+ otg_state_string(musb));
+ musb->xceiv->state = OTG_STATE_A_IDLE;
++ MUSB_HST_MODE(musb);
+ break;
+ case OTG_STATE_A_PERIPHERAL:
+ musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
++ MUSB_HST_MODE(musb);
+ break;
+ case OTG_STATE_B_WAIT_ACON:
+ case OTG_STATE_B_HOST:
+diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
+index 14f7cf3..e8ef925 100644
+--- a/drivers/usb/musb/musb_virthub.c
++++ b/drivers/usb/musb/musb_virthub.c
+@@ -83,6 +83,10 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
+ musb->xceiv->state = OTG_STATE_A_SUSPEND;
+ musb->is_active = is_otg_enabled(musb)
+ && musb->xceiv->host->b_hnp_enable;
++ if (musb->is_active)
++ mod_timer(&musb->otg_timer, jiffies
++ + msecs_to_jiffies(
++ OTG_TIME_A_AIDL_BDIS));
+ musb_platform_try_idle(musb, 0);
+ break;
+ #ifdef CONFIG_USB_MUSB_OTG
+--
+1.6.0.4
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/no-cortex-deadlock.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/no-cortex-deadlock.patch
new file mode 100644
index 0000000000..78547c8969
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/no-cortex-deadlock.patch
@@ -0,0 +1,77 @@
+From: Mans Rullgard <mans@mansr.com>
+Date: Sat, 16 Aug 2008 23:03:06 +0000 (+0100)
+Subject: ARM: Workaround for erratum 451034
+X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=b84fa87873ffb68ad23930cf6cddeea8bec43ede
+
+ARM: Workaround for erratum 451034
+
+On Cortex-A8 r1p0 and r1p1, executing a NEON store with an integer
+store in the store buffer, can cause a processor deadlock under
+certain conditions.
+
+Executing a DMB instruction before saving NEON/VFP registers and before
+return to userspace makes it safe to run code which includes similar
+counter-measures. Userspace code can still trigger the deadlock, so
+a different workaround is required to safely run untrusted code.
+
+See ARM Cortex-A8 Errata Notice (PR120-PRDC-008070) for full details.
+
+Signed-off-by: Mans Rullgard <mans@mansr.com>
+---
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index aa475d9..41d536e 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1117,6 +1117,22 @@ config NEON
+ Say Y to include support code for NEON, the ARMv7 Advanced SIMD
+ Extension.
+
++config ARM_ERRATUM_451034
++ bool "Enable workaround for ARM erratum 451034"
++ depends on VFPv3
++ help
++ On Cortex-A8 r1p0 and r1p1, executing a NEON store with an integer
++ store in the store buffer, can cause a processor deadlock under
++ certain conditions.
++
++ See ARM Cortex-A8 Errata Notice (PR120-PRDC-008070) for full details.
++
++ Say Y to include a partial workaround.
++
++ WARNING: Even with this option enabled, userspace code can trigger
++ the deadlock. To safely run untrusted code, a different fix is
++ required.
++
+ endmenu
+
+ menu "Userspace binary formats"
+diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
+index 422f3cc..934798b 100644
+--- a/arch/arm/include/asm/vfpmacros.h
++++ b/arch/arm/include/asm/vfpmacros.h
+@@ -32,6 +32,9 @@
+
+ @ write all the working registers out of the VFP
+ .macro VFPFSTMIA, base, tmp
++#ifdef CONFIG_ARM_ERRATUM_451034
++ dmb
++#endif
+ #if __LINUX_ARM_ARCH__ < 6
+ STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15}
+ #else
+diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
+index 060d7e2..9799a35 100644
+--- a/arch/arm/kernel/entry-common.S
++++ b/arch/arm/kernel/entry-common.S
+@@ -69,6 +69,10 @@ no_work_pending:
+ /* perform architecture specific actions before user return */
+ arch_ret_to_user r1, lr
+
++#ifdef CONFIG_ARM_ERRATUM_451034
++ dmb
++#endif
++
+ @ slow_restore_user_regs
+ ldr r1, [sp, #S_PSR] @ get calling cpsr
+ ldr lr, [sp, #S_PC]! @ get pc
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/no-empty-flash-warnings.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/no-empty-flash-warnings.patch
new file mode 100644
index 0000000000..ab344b0449
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/no-empty-flash-warnings.patch
@@ -0,0 +1,15 @@
+diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
+index 1d437de..33b3feb 100644
+--- a/fs/jffs2/scan.c
++++ b/fs/jffs2/scan.c
+@@ -647,8 +647,8 @@ scan_more:
+ inbuf_ofs = ofs - buf_ofs;
+ while (inbuf_ofs < scan_end) {
+ if (unlikely(*(uint32_t *)(&buf[inbuf_ofs]) != 0xffffffff)) {
+- printk(KERN_WARNING "Empty flash at 0x%08x ends at 0x%08x\n",
+- empty_start, ofs);
++// printk(KERN_WARNING "Empty flash at 0x%08x ends at 0x%08x\n",
++// empty_start, ofs);
+ if ((err = jffs2_scan_dirty_space(c, jeb, ofs-empty_start)))
+ return err;
+ goto scan_more;
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/no-harry-potter.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/no-harry-potter.diff
new file mode 100644
index 0000000000..2bb20ab9c0
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/no-harry-potter.diff
@@ -0,0 +1,11 @@
+--- /tmp/Makefile 2008-04-24 14:36:20.509598016 +0200
++++ git/arch/arm/Makefile 2008-04-24 14:36:31.949546584 +0200
+@@ -47,7 +47,7 @@
+ # Note that GCC does not numerically define an architecture version
+ # macro, but instead defines a whole series of macros which makes
+ # testing for a specific architecture or later rather impossible.
+-arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7a,-march=armv5t -Wa$(comma)-march=armv7a)
++arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
+ arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
+ # Only override the compiler option if ARMv6. The ARMv6K extensions are
+ # always available in ARMv7
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap-2430-lcd.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/omap-2430-lcd.patch
new file mode 100644
index 0000000000..8f8a687c06
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap-2430-lcd.patch
@@ -0,0 +1,11 @@
+--- git/drivers/video/omap/lcd_2430sdp.c.orig 2007-08-13 14:35:17.000000000 -0700
++++ git/drivers/video/omap/lcd_2430sdp.c 2007-08-13 14:35:55.000000000 -0700
+@@ -32,7 +32,7 @@
+ #define LCD_PANEL_BACKLIGHT_GPIO 91
+ #define LCD_PANEL_ENABLE_GPIO 154
+ #define LCD_PIXCLOCK_MAX 5400 /* freq 5.4 MHz */
+-#define PM_RECEIVER TWL4030_MODULE_PM_RECIEVER
++#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
+ #define ENABLE_VAUX2_DEDICATED 0x09
+ #define ENABLE_VAUX2_DEV_GRP 0x20
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap1710h3/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap1710h3/defconfig
new file mode 100644
index 0000000000..21f7c54e4e
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap1710h3/defconfig
@@ -0,0 +1,1224 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc2-omap1
+# Tue Aug 21 23:10: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_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+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 is not set
+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 is not set
+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_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=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 is not set
+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 is not set
+# 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=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+CONFIG_ARCH_OMAP1=y
+# CONFIG_ARCH_OMAP2 is not set
+# CONFIG_ARCH_OMAP3 is not set
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_RESET_CLOCKS is not set
+# CONFIG_OMAP_BOOT_TAG is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+# CONFIG_OMAP_MUX_DEBUG is not set
+CONFIG_OMAP_MUX_WARNINGS=y
+# CONFIG_OMAP_STI is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MMU_FWK is not set
+# CONFIG_OMAP_MBOX_FWK is not set
+CONFIG_OMAP_MPU_TIMER=y
+# CONFIG_OMAP_32K_TIMER is not set
+# CONFIG_OMAP_DM_TIMER is not set
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_SERIAL_WAKE=y
+# CONFIG_OMAP_DSP is not set
+
+#
+# OMAP Core Type
+#
+# CONFIG_ARCH_OMAP730 is not set
+# CONFIG_ARCH_OMAP15XX is not set
+CONFIG_ARCH_OMAP16XX=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_OMAP_INNOVATOR is not set
+# CONFIG_MACH_OMAP_H2 is not set
+CONFIG_MACH_OMAP_H3=y
+# CONFIG_MACH_OMAP_OSK is not set
+# CONFIG_MACH_NOKIA770 is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP CPU Speed
+#
+# CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER is not set
+# CONFIG_OMAP_ARM_216MHZ is not set
+# CONFIG_OMAP_ARM_192MHZ is not set
+CONFIG_OMAP_ARM_168MHZ=y
+# CONFIG_OMAP_ARM_120MHZ is not set
+# CONFIG_OMAP_ARM_60MHZ is not set
+# CONFIG_OMAP_ARM_30MHZ is not set
+# CONFIG_MACH_OMAP_APOLLON_PLUS is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# 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 is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+# CONFIG_PREEMPT 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_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x10C08000
+CONFIG_ZBOOT_ROM_BSS=0x10200000
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_CMDLINE="mem=32M console=ttyS0,115200n8 initrd=0x10A00000,8M root=/dev/ram0 rw ip=dhcp devfs=mount"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ 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
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=y
+# 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_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_APM_EMULATION is not set
+
+#
+# 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=y
+# 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_IP_MROUTE 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=y
+
+#
+# IrDA protocols
+#
+# CONFIG_IRLAN is not set
+# CONFIG_IRNET is not set
+# CONFIG_IRCOMM is not set
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+# CONFIG_IRDA_CACHE_LAST_LSAP is not set
+# CONFIG_IRDA_FAST_RR is not set
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+
+#
+# Dongle support
+#
+# CONFIG_KINGSUN_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+# CONFIG_USB_IRDA is not set
+# CONFIG_SIGMATEL_FIR is not set
+# CONFIG_MCS_FIR is not set
+# CONFIG_OMAP_IR 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 is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP 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
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK 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=y
+# CONFIG_DM9000 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 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_WAN is not set
+CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
+CONFIG_SLIP=y
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=y
+# CONFIG_SLIP_SMART is not set
+# CONFIG_SLIP_MODE_SLIP6 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=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP=y
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=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=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+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=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_OMAP_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_HW_RANDOM=m
+CONFIG_HW_RANDOM_OMAP=m
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# 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_OCORES is not set
+CONFIG_I2C_OMAP=y
+# 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_ISP1301_OMAP=m
+CONFIG_TPS65010=y
+# CONFIG_SENSORS_TLV320AIC23 is not set
+CONFIG_GPIOEXPANDER_OMAP=y
+# 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=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_OMAP_UWIRE=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_TSC2101 is not set
+# CONFIG_SPI_TSC2102 is not set
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 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_LM70 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_SENSORS_TSC210X 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 is not set
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_TUNER_TEA5761 is not set
+# CONFIG_VIDEO_OMAP_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_USBVISION is not set
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_QUICKCAM_MESSENGER is not set
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_ZC0301 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_USB_ZR364XX is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_RADIO_TEA5761 is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB 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=m
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# 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=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_OMAP=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
+# CONFIG_FB_OMAP_DMA_TUNE 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=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+# CONFIG_SND is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE 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=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
+# 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
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# 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
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+# CONFIG_USB_MUSB_HDRC 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_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 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
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_OMAP=y
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# 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
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_OMAP=y
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS 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=y
+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_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS 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_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_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 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 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=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
+# 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_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
+CONFIG_DEBUG_BUGVERBOSE=y
+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 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=y
+# 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_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap2420h4/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap2420h4/defconfig
new file mode 100644
index 0000000000..c1133eef9a
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap2420h4/defconfig
@@ -0,0 +1,1119 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc2-omap1
+# Tue Aug 21 22:58:34 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_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+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_ALL is not set
+CONFIG_KALLSYMS_EXTRA_PASS=y
+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_TIMERFD=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=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+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=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_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 is not set
+# 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=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+CONFIG_ARCH_OMAP2=y
+# CONFIG_ARCH_OMAP3 is not set
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_DEBUG_DEVICES=y
+# CONFIG_OMAP_RESET_CLOCKS is not set
+CONFIG_OMAP_BOOT_TAG=y
+# CONFIG_OMAP_BOOT_REASON is not set
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+CONFIG_OMAP_MUX_DEBUG=y
+CONFIG_OMAP_MUX_WARNINGS=y
+# CONFIG_OMAP_STI is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MMU_FWK is not set
+# CONFIG_OMAP_MBOX_FWK is not set
+CONFIG_OMAP_MPU_TIMER=y
+# CONFIG_OMAP_32K_TIMER is not set
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_SERIAL_WAKE=y
+# CONFIG_OMAP_DSP is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP Core Type
+#
+CONFIG_ARCH_OMAP24XX=y
+CONFIG_ARCH_OMAP2420=y
+# CONFIG_ARCH_OMAP2430 is not set
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_N800 is not set
+CONFIG_MACH_OMAP_H4=y
+# CONFIG_MACH_OMAP_H4_TUSB is not set
+# CONFIG_MACH_OMAP_H4_OTG is not set
+# CONFIG_MACH_OMAP2_H4_USB1 is not set
+# CONFIG_MACH_OMAP_APOLLON is not set
+# CONFIG_MACH_OMAP_APOLLON_PLUS is not set
+# CONFIG_MACH_OMAP_2430SDP is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_V6=y
+# CONFIG_CPU_32v6K is not set
+CONFIG_CPU_32v6=y
+CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_V6=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# 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 is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+# CONFIG_PREEMPT is not set
+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=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="root=/dev/ram0 rw console=ttyS0,115200n8 initrd=0x80600000,8M ramdisk_size=8192"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ 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
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+
+#
+# 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=y
+# CONFIG_NET_KEY_MIGRATE 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 is not set
+# 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=y
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=y
+CONFIG_IRCOMM=y
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+# CONFIG_IRDA_CACHE_LAST_LSAP is not set
+# CONFIG_IRDA_FAST_RR is not set
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+
+#
+# Dongle support
+#
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_OMAP_IR=y
+# 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 is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+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=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# 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 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_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK 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=y
+# CONFIG_DM9000 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 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 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=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP=y
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# 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=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+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=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_HW_RANDOM=m
+CONFIG_HW_RANDOM_OMAP=m
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# 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_OCORES is not set
+CONFIG_I2C_OMAP=y
+# 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
+
+#
+# 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_ISP1301_OMAP is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_TLV320AIC23 is not set
+CONFIG_GPIOEXPANDER_OMAP=y
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+CONFIG_MENELAUS=y
+# 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 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 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# 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=m
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# 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_OMAP=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
+# 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=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG 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 is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_OMAP=y
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# 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=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+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 is not set
+# 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=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# 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_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+
+#
+# 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 is not set
+# 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_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# 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=y
+# 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
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# 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 is not set
+# CONFIG_DEBUG_ERRORS is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# 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=y
+# 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=y
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# 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 is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# 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
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+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/recipes/linux/mx31ads-kernel/imx31ads_defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap2430sdp/defconfig
index 83cd5f933d..f3897e48a3 100644
--- a/recipes/linux/mx31ads-kernel/imx31ads_defconfig
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap2430sdp/defconfig
@@ -1,45 +1,53 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc6
-# Mon Nov 20 18:11:58 2006
+# Linux kernel version: 2.6.23-rc2-omap1
+# Sun Aug 12 17:38:46 2007
#
CONFIG_ARM=y
-# CONFIG_GENERIC_TIME is not set
+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_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=""
CONFIG_LOCALVERSION_AUTO=y
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_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 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=y
-CONFIG_IKCONFIG_PROC=y
+# CONFIG_IKCONFIG is not set
+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
@@ -47,37 +55,38 @@ CONFIG_EMBEDDED=y
CONFIG_UID16=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_KALLSYMS_EXTRA_PASS=y
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_TIMERFD=y
+CONFIG_EVENTFD=y
CONFIG_SHMEM=y
-CONFIG_SLAB=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_SLOB is not set
-
-#
-# Loadable module support
-#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
-# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_MODULE_SRCVERSION_ALL=y
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
@@ -109,33 +118,81 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
# 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_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 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_MXC=y
# CONFIG_ARCH_PXA is not set
# 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_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
#
-# Freescale MXC Implementations
+# TI OMAP Implementations
#
-CONFIG_ARCH_MX3=y
+# CONFIG_ARCH_OMAP1 is not set
+CONFIG_ARCH_OMAP2=y
+# CONFIG_ARCH_OMAP3 is not set
#
-# MX3 Options
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_RESET_CLOCKS is not set
+CONFIG_OMAP_BOOT_TAG=y
+# CONFIG_OMAP_BOOT_REASON is not set
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+# CONFIG_OMAP_MUX_DEBUG is not set
+# CONFIG_OMAP_MUX_WARNINGS is not set
+# CONFIG_OMAP_STI is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MMU_FWK is not set
+# CONFIG_OMAP_MBOX_FWK is not set
+CONFIG_OMAP_MPU_TIMER=y
+# CONFIG_OMAP_32K_TIMER is not set
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_SERIAL_WAKE=y
+# CONFIG_OMAP_DSP is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP Core Type
+#
+CONFIG_ARCH_OMAP24XX=y
+# CONFIG_ARCH_OMAP2420 is not set
+CONFIG_ARCH_OMAP2430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_N800 is not set
+# CONFIG_MACH_OMAP_H4 is not set
+# CONFIG_MACH_OMAP_APOLLON is not set
+# CONFIG_MACH_OMAP_APOLLON_PLUS is not set
+CONFIG_MACH_OMAP_2430SDP=y
+
+#
+# Boot options
+#
+
+#
+# Power management
#
-CONFIG_MACH_MX31ADS=y
-# CONFIG_MX3_DOZE_DURING_IDLE is not set
-CONFIG_ISP1504_MXC=m
#
# Processor Type
@@ -145,13 +202,14 @@ CONFIG_CPU_V6=y
# CONFIG_CPU_32v6K is not set
CONFIG_CPU_32v6=y
CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_PABRT_NOIFAR=y
CONFIG_CPU_CACHE_V6=y
CONFIG_CPU_CACHE_VIPT=y
CONFIG_CPU_COPY_V6=y
CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_HAS_ASID=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
-CONFIG_CPU_CACHE_L210=y
#
# Processor Features
@@ -159,39 +217,30 @@ CONFIG_CPU_CACHE_L210=y
CONFIG_ARM_THUMB=y
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
#
# Bus support
#
-CONFIG_ISA=y
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
#
# PCCARD (PCMCIA/CardBus) support
#
-CONFIG_PCCARD=m
-# CONFIG_PCMCIA_DEBUG is not set
-CONFIG_PCMCIA=m
-CONFIG_PCMCIA_LOAD_CIS=y
-CONFIG_PCMCIA_IOCTL=y
-
-#
-# PC-card bridges
-#
-# CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
-CONFIG_PCMCIA_MX31ADS=m
-CONFIG_PCMCIA_PROBE=y
+# CONFIG_PCCARD is not set
#
# Kernel Features
#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
CONFIG_PREEMPT=y
-# CONFIG_NO_IDLE_HZ is not set
CONFIG_HZ=100
CONFIG_AEABI=y
-# CONFIG_OABI_COMPAT is not set
+CONFIG_OABI_COMPAT=y
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
@@ -202,6 +251,10 @@ CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_LEDS is not set
CONFIG_ALIGNMENT_TRAP=y
#
@@ -209,107 +262,43 @@ CONFIG_ALIGNMENT_TRAP=y
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="noinitrd console=ttymxc0 root=/dev/mtdblock2 rw ip=off"
+CONFIG_CMDLINE="root=/dev/ram0 rw console=ttyS0,115200n8 initrd=0x80600000,8M ramdisk_size=8192"
# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
-CONFIG_VFP=y
-
-#
-# MXC support drivers
-#
-
-#
-# MXC IPU
-#
-CONFIG_MXC_IPU=y
-CONFIG_MXC_IPU_PF=y
-
-#
-# MXC SPI support
-#
-CONFIG_MXC_SPI=y
-CONFIG_MXC_SPI_SELECT1=y
-CONFIG_MXC_SPI_SELECT2=y
-CONFIG_MXC_SPI_SELECT3=y
-
-#
-# MXC SSI support
+# CPU Frequency scaling
#
-CONFIG_MXC_SSI=y
+# CONFIG_CPU_FREQ is not set
#
-# MXC Digital Audio Multiplexer support
-#
-CONFIG_MXC_DAM=y
-
-#
-# MC13783_LEGACY support
-#
-CONFIG_MXC_MC13783_LEGACY=y
-CONFIG_MXC_MC13783_ADC=y
-CONFIG_MXC_MC13783_AUDIO=y
-CONFIG_MXC_MC13783_RTC=y
-CONFIG_MXC_MC13783_LIGHT=y
-CONFIG_MXC_MC13783_BATTERY=y
-CONFIG_MXC_MC13783_CONNECTIVITY=y
-CONFIG_MXC_MC13783_POWER=y
-
-#
-# Advanced Power Management devices
-#
-CONFIG_MXC_DPTC=y
-CONFIG_MXC_DVFS=y
-CONFIG_MXC_DVFS_SDMA=y
-
-#
-# MXC Security Drivers
-#
-CONFIG_MXC_SECURITY_SCC=y
-CONFIG_MXC_SECURITY_RNGA=y
-# CONFIG_MXC_RNGA_TEST_DEBUG is not set
-CONFIG_MXC_SECURITY_RTIC=y
-# CONFIG_MXC_RTIC_TEST_DEBUG is not set
-CONFIG_MXC_SECURITY_CORE=y
-
-#
-# SDMA
+# Floating point emulation
#
-CONFIG_MXC_SDMA_API=y
#
-# MXC MPEG4 Encoder Kernel module support
+# At least one emulation must be selected
#
-CONFIG_MXC_HMP4E=y
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
#
# Userspace binary formats
#
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_AOUT is not set
-# CONFIG_BINFMT_MISC is not set
+CONFIG_BINFMT_MISC=y
#
# Power management options
#
CONFIG_PM=y
-CONFIG_PM_LEGACY=y
+# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
-# CONFIG_APM is not set
-
-#
-# Dynamic Power Management
-#
-CONFIG_DPM=y
-CONFIG_DPM_STATS=y
-CONFIG_DPM_PROCFS=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_APM_EMULATION is not set
#
# Networking
@@ -319,25 +308,25 @@ CONFIG_NET=y
#
# Networking options
#
-# CONFIG_NETDEBUG is not set
CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=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_NET_KEY is not set
+# CONFIG_XFRM_MIGRATE is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
-CONFIG_IP_MULTICAST=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_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
@@ -353,62 +342,14 @@ CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
-
-#
-# IP: Virtual Server Configuration
-#
-# CONFIG_IP_VS is not set
-CONFIG_IPV6=m
-# CONFIG_IPV6_PRIVACY is not set
-# CONFIG_IPV6_ROUTER_PREF is not set
-# CONFIG_INET6_AH is not set
-# CONFIG_INET6_ESP is not set
-# CONFIG_INET6_IPCOMP is not set
-# CONFIG_IPV6_MIP6 is not set
+# 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_INET6_XFRM_MODE_TRANSPORT=m
-CONFIG_INET6_XFRM_MODE_TUNNEL=m
-CONFIG_INET6_XFRM_MODE_BEET=m
-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
-CONFIG_IPV6_SIT=m
-# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-
-#
-# Core Netfilter Configuration
-#
-# CONFIG_NETFILTER_NETLINK is not set
-# CONFIG_NF_CONNTRACK is not set
-# CONFIG_NETFILTER_XTABLES is not set
-
-#
-# IP: Netfilter Configuration
-#
-# CONFIG_IP_NF_CONNTRACK is not set
-# CONFIG_IP_NF_QUEUE is not set
-
-#
-# IPv6: Netfilter Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP6_NF_QUEUE is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
+# CONFIG_NETFILTER is not set
# 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
@@ -432,61 +373,19 @@ CONFIG_NETFILTER=y
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
-CONFIG_IRDA=m
-
-#
-# IrDA protocols
-#
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-# CONFIG_IRDA_ULTRA is not set
-
-#
-# IrDA options
-#
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-# CONFIG_IRDA_DEBUG is not set
-
-#
-# Infrared-port device drivers
-#
-
-#
-# SIR device drivers
-#
-CONFIG_IRTTY_SIR=m
-
-#
-# Dongle support
-#
-# CONFIG_DONGLE is not set
-
-#
-# Old SIR device drivers
-#
-# CONFIG_IRPORT_SIR is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
#
-# Old Serial dongle support
+# Wireless
#
-
-#
-# FIR device drivers
-#
-# CONFIG_USB_IRDA is not set
-# CONFIG_SIGMATEL_FIR is not set
-CONFIG_MXC_FIR=m
-# CONFIG_MCS_FIR 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
+# 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
@@ -497,25 +396,16 @@ CONFIG_WIRELESS_EXT=y
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=m
+# CONFIG_FW_LOADER is not set
+# 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=y
# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_REDBOOT_PARTS=y
-CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
-# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
-# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_AFS_PARTS is not set
@@ -523,6 +413,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
# 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
@@ -536,30 +427,24 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+# 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 is not set
+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 is not set
+CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_OTP is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_RAM=y
+# 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
@@ -567,8 +452,8 @@ CONFIG_MTD_RAM=y
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
# CONFIG_MTD_PLATRAM is not set
-CONFIG_MTD_MXC=y
#
# Self-contained MTD device drivers
@@ -586,40 +471,19 @@ CONFIG_MTD_MXC=y
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+CONFIG_MTD_ONENAND=y
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_GENERIC is not set
+CONFIG_MTD_ONENAND_OMAP2=y
+# CONFIG_MTD_ONENAND_OTP is not set
#
-# NAND Flash Device Drivers
-#
-CONFIG_MTD_NAND=y
-# CONFIG_MTD_NAND_VERIFY_WRITE is not set
-# CONFIG_MTD_NAND_ECC_SMC is not set
-CONFIG_MTD_NAND_IDS=y
-# CONFIG_MTD_NAND_DISKONCHIP is not set
-# CONFIG_MTD_NAND_NANDSIM is not set
-CONFIG_MTD_NAND_MXC=y
-CONFIG_MTD_NAND_MXC_SWECC=y
-CONFIG_MTD_NAND_MXC_FORCE_CE=y
-CONFIG_MTD_NAND_MXC_ECC_CORRECTION_OPTION2=y
-CONFIG_CONFIG_MXC_NAND_LOW_LEVEL_ERASE=y
-
-#
-# OneNAND Flash Device Drivers
-#
-# CONFIG_MTD_ONENAND is not set
-
-#
-# Parallel port support
+# UBI - Unsorted block images
#
+# CONFIG_MTD_UBI is not set
# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNP is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -629,65 +493,37 @@ CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
#
-# ATA/ATAPI/MFM/RLL support
-#
-CONFIG_IDE=y
-CONFIG_IDE_MAX_HWIFS=4
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-CONFIG_BLK_DEV_IDECS=m
-# CONFIG_BLK_DEV_IDECD is not set
-# 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=y
-# CONFIG_IDE_ARM is not set
-CONFIG_BLK_DEV_IDE_MXC=m
-# CONFIG_IDE_CHIPSETS is not set
-CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_AUTO is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
+CONFIG_SCSI=m
+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_BLK_DEV_SD=m
# 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_SG=m
# CONFIG_CHR_DEV_SCH is not set
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
-CONFIG_SCSI_MULTI_LUN=y
+# 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
@@ -695,177 +531,50 @@ CONFIG_SCSI_MULTI_LUN=y
# 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_AHA152X is not set
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_DTC3280 is not set
-# CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
-# CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_SYM53C416 is not set
-# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_DEBUG 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
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_ATA is not set
# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# 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
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
+# CONFIG_TUN is not set
# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_SMC91X is not set
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
# CONFIG_DM9000 is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
-CONFIG_NET_PCI=y
-# CONFIG_AC3200 is not set
-# CONFIG_APRICOT is not set
-CONFIG_CS89x0=y
-
-#
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
#
-# Wireless LAN (non-hamradio)
+# Wireless LAN
#
-CONFIG_NET_RADIO=y
-# CONFIG_NET_WIRELESS_RTNETLINK is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
#
-# Obsolete Wireless cards support (pre-802.11)
-#
-# CONFIG_STRIP is not set
-# CONFIG_ARLAN is not set
-# CONFIG_WAVELAN 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_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
-# 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
+# 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_WAN is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_PPP_MPPE is not set
-# CONFIG_PPPOE is not set
+# CONFIG_PPP 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
#
@@ -873,6 +582,7 @@ CONFIG_SLHC=m
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
#
# Userland interfaces
@@ -893,10 +603,26 @@ CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
-CONFIG_KEYBOARD_MXC=y
+# CONFIG_KEYBOARD_OMAP is not set
+CONFIG_KEYBOARD_TWL4030=y
+# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=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 is not set
+# CONFIG_TOUCHSCREEN_TSC2102 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_INPUT_MISC is not set
#
@@ -913,32 +639,28 @@ CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
# CONFIG_SERIAL_NONSTANDARD is not set
-CONFIG_MXC_RTC=y
#
# Serial drivers
#
-# CONFIG_SERIAL_8250 is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_SERIAL_MXC=y
-CONFIG_SERIAL_MXC_CONSOLE=y
CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
+# CONFIG_LEGACY_PTYS is not set
# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y
@@ -946,46 +668,21 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_MXC_WATCHDOG=y
-
-#
-# ISA-based Watchdog Cards
-#
-# CONFIG_PCWATCHDOG is not set
-# CONFIG_MIXCOMWD is not set
-# CONFIG_WDT is not set
+CONFIG_OMAP_WATCHDOG=y
#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_OMAP=y
# CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-
-#
-# 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=y
-# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
#
# I2C Algorithms
@@ -997,24 +694,33 @@ CONFIG_I2C=y
#
# I2C Hardware Bus support
#
-# CONFIG_I2C_ELEKTOR is not set
-CONFIG_I2C_MXC=y
+# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
# 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_PCA_ISA 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_TPS65010 is not set
+# CONFIG_SENSORS_TLV320AIC23 is not set
+# CONFIG_GPIOEXPANDER_OMAP is not set
+# CONFIG_MENELAUS is not set
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_GPIO=y
# CONFIG_SENSORS_MAX6875 is not set
-CONFIG_MXC_I2C_CLIENT=y
+# 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
@@ -1024,296 +730,160 @@ CONFIG_MXC_I2C_CLIENT=y
# SPI support
#
CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
#
# SPI Master Controller Drivers
#
# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_OMAP24XX is not set
#
# SPI Protocol Masters
#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_TSC2101 is not set
+# CONFIG_SPI_TSC2102 is not set
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_HWMON is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
#
-# Dallas's 1-wire bus
-#
-CONFIG_W1=y
-
-#
-# 1-wire Bus Masters
-#
-# CONFIG_W1_MASTER_DS2490 is not set
-# CONFIG_W1_MASTER_DS2482 is not set
-
-#
-# 1-wire Slaves
-#
-# CONFIG_W1_SLAVE_THERM is not set
-# CONFIG_W1_SLAVE_SMEM is not set
-# CONFIG_W1_SLAVE_DS2433 is not set
-CONFIG_W1_MXC=y
-
-#
-# Hardware Monitoring support
-#
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 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_LM70 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_MAX1619 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 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_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Misc devices
-#
-# CONFIG_TIFM_CORE is not set
-
-#
-# LED devices
+# Multifunction device drivers
#
+# CONFIG_MFD_SM501 is not set
# CONFIG_NEW_LEDS is not set
#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
# Multimedia devices
#
-CONFIG_VIDEO_DEV=y
-CONFIG_VIDEO_V4L1=y
-CONFIG_VIDEO_V4L1_COMPAT=y
-CONFIG_VIDEO_V4L2=y
-
-#
-# Video Capture Adapters
-#
-
-#
-# Video Capture Adapters
-#
-# CONFIG_VIDEO_ADV_DEBUG is not set
-CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
-# CONFIG_VIDEO_VIVI is not set
-# CONFIG_VIDEO_PMS is not set
-CONFIG_VIDEO_MXC_CAMERA=y
-
-#
-# MXC Camera/V4L2 PRP Features support
-#
-CONFIG_VIDEO_MXC_IPU_CAMERA=y
-CONFIG_MXC_CAMERA_MICRON111=y
-CONFIG_MXC_IPU_PRP_VF_SDC=y
-CONFIG_MXC_IPU_PRP_ENC=y
-CONFIG_VIDEO_MXC_OUTPUT=y
-CONFIG_VIDEO_MXC_IPU_OUTPUT=y
-# CONFIG_VIDEO_CPIA is not set
-# CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_SAA5246A is not set
-# CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_TUNER_3036 is not set
-
-#
-# V4L USB devices
-#
-# CONFIG_VIDEO_PVRUSB2 is not set
-# CONFIG_VIDEO_EM28XX is not set
-# CONFIG_USB_VICAM is not set
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_KONICAWC is not set
-# CONFIG_USB_QUICKCAM_MESSENGER is not set
-# CONFIG_USB_ET61X251 is not set
-# CONFIG_VIDEO_OVCAMCHIP is not set
-# CONFIG_USB_W9968CF is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_SE401 is not set
-# CONFIG_USB_SN9C102 is not set
-# CONFIG_USB_STV680 is not set
-# CONFIG_USB_ZC0301 is not set
-# CONFIG_USB_PWC is not set
-
-#
-# Radio Adapters
-#
-# CONFIG_RADIO_CADET is not set
-# CONFIG_RADIO_RTRACK is not set
-# CONFIG_RADIO_RTRACK2 is not set
-# CONFIG_RADIO_AZTECH is not set
-# CONFIG_RADIO_GEMTEK is not set
-# CONFIG_RADIO_SF16FMI is not set
-# CONFIG_RADIO_SF16FMR2 is not set
-# CONFIG_RADIO_TERRATEC is not set
-# CONFIG_RADIO_TRUST is not set
-# CONFIG_RADIO_TYPHOON is not set
-# CONFIG_RADIO_ZOLTRIX is not set
-# CONFIG_USB_DSBR is not set
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
#
-# Digital Video Broadcasting Devices
+# Graphics support
#
-# CONFIG_DVB is not set
-# CONFIG_USB_DABUSB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
-# Graphics support
+# Display device support
#
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
-CONFIG_FB_CFB_FILLRECT=y
-CONFIG_FB_CFB_COPYAREA=y
-CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# 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
-CONFIG_FB_MXC=y
-CONFIG_FB_MXC_16BPP=y
-# CONFIG_FB_MXC_24BPP is not set
-# CONFIG_FB_MXC_32BPP is not set
-CONFIG_FB_MXC_SYNC_PANEL=y
-CONFIG_FB_MXC_SHARP_QVGA_PANEL=y
-# CONFIG_FB_MXC_VGA_PANEL is not set
-# CONFIG_FB_MXC_TVOUT is not set
-# CONFIG_FB_MXC_OVERLAY is not set
-# CONFIG_FB_MXC_ASYNC_PANEL is not set
+
+#
+# Frame buffer hardware drivers
+#
# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_OMAP=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_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
-
-#
-# Logo configuration
-#
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_LOGO_LINUX_CLUT224=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
# Sound
#
-CONFIG_SOUND=y
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
#
-# Advanced Linux Sound Architecture
-#
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
-# CONFIG_SND_SEQUENCER is not set
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-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_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_MXC=y
-
-#
-# USB devices
-#
-# CONFIG_SND_USB_AUDIO is not set
-
-#
-# PCMCIA devices
-#
-# CONFIG_SND_VXPOCKET is not set
-# CONFIG_SND_PDAUDIOCF is not set
-
-#
-# Open Sound System
+# USB Input Devices
#
-# CONFIG_SOUND_PRIME is not set
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
#
-# USB support
+# USB HID Boot Protocol drivers
#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
+CONFIG_USB_ARCH_HAS_OHCI=y
# CONFIG_USB_ARCH_HAS_EHCI is not set
-CONFIG_USB=y
+CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
#
# Miscellaneous USB options
#
-CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_OTG is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_PERSIST is not set
+CONFIG_USB_OTG=y
+CONFIG_USB_OTG_WHITELIST=y
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
#
# USB Host Controller Drivers
#
# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+CONFIG_USB_MUSB_HDRC=m
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 243x high speed USB support
+#
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_USB_INVENTRA_FIFO is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+CONFIG_USB_INVENTRA_HCD_LOGGING=1
#
# USB Device Class drivers
@@ -1328,11 +898,10 @@ CONFIG_USB_DEVICEFS=y
#
# may also be needed; see USB_STORAGE Help for more information
#
-CONFIG_USB_STORAGE=y
+CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_DPCM is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
@@ -1343,43 +912,10 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_LIBUSUAL is not set
#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE 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
-
-#
# 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
#
@@ -1401,6 +937,7 @@ CONFIG_USB_MON=y
# 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
@@ -1410,7 +947,7 @@ CONFIG_USB_MON=y
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_TEST is not set
+# CONFIG_USB_IOWARRIOR is not set
#
# USB DSL modem support
@@ -1420,21 +957,23 @@ CONFIG_USB_MON=y
# USB Gadget Support
#
CONFIG_USB_GADGET=m
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG is not set
+CONFIG_USB_GADGET_DEBUG_FILES=y
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
-CONFIG_USB_GADGET_ARC=y
-CONFIG_USB_ARC=m
+# CONFIG_USB_GADGET_S3C2410 is not set
# CONFIG_USB_GADGET_AT91 is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
CONFIG_USB_GADGET_DUALSPEED=y
-# CONFIG_USB_GADGET_ARC_OTGFS is not set
-CONFIG_USB_GADGET_ARC_OTGHS=y
-# CONFIG_USB_ZERO is not set
+CONFIG_USB_ZERO=m
+# CONFIG_USB_ZERO_HNPTEST is not set
CONFIG_USB_ETH=m
CONFIG_USB_ETH_RNDIS=y
CONFIG_USB_GADGETFS=m
@@ -1442,50 +981,40 @@ CONFIG_USB_FILE_STORAGE=m
# CONFIG_USB_FILE_STORAGE_TEST is not set
CONFIG_USB_G_SERIAL=m
# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
#
-# MMC/SD Card support
+# MMC/SD Card Drivers
#
-CONFIG_MMC=m
-# CONFIG_MMC_DEBUG is not set
-CONFIG_MMC_BLOCK=m
-# CONFIG_MMC_TIFM_SD is not set
-CONFIG_MMC_MXC=m
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
#
-# Real Time Clock
+# MMC/SD Host Controller Drivers
#
+CONFIG_MMC_OMAP=y
CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_HCTOSYS=y
-CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
-# CONFIG_RTC_DEBUG is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
#
-# RTC interfaces
+# DMA Clients
#
-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
+# DMA Devices
#
-# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_DS1307 is not set
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
-# CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
-# CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_RS5C348 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_TEST is not set
-# CONFIG_RTC_DRV_MAX6902 is not set
-# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
#
# File systems
@@ -1493,14 +1022,11 @@ CONFIG_RTC_INTF_DEV=y
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
-CONFIG_EXT3_FS=m
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_FS_XATTR is not set
# CONFIG_EXT4DEV_FS is not set
-CONFIG_JBD=m
+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
@@ -1511,10 +1037,13 @@ CONFIG_FS_MBCACHE=y
# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
-CONFIG_AUTOFS4_FS=m
+# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
#
@@ -1555,17 +1084,19 @@ CONFIG_RAMFS=y
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
# CONFIG_JFFS2_SUMMARY is not set
# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
-CONFIG_CRAMFS=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE 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
@@ -1580,17 +1111,13 @@ 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=m
-CONFIG_NFSD_V3=y
-# CONFIG_NFSD_V3_ACL is not set
-# CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
+# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
@@ -1598,7 +1125,6 @@ CONFIG_SUNRPC=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
@@ -1620,6 +1146,7 @@ CONFIG_MSDOS_PARTITION=y
# CONFIG_SUN_PARTITION is not set
# CONFIG_KARMA_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
#
# Native Language Support
@@ -1649,8 +1176,8 @@ CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ASCII is not set
+# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
@@ -1663,80 +1190,114 @@ CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=m
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
#
# Profiling support
#
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
+# 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_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_FS is not set
-CONFIG_FRAME_POINTER=y
# CONFIG_HEADERS_CHECK is not set
-CONFIG_DEBUG_USER=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=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# 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 is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_LL 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_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
# 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_MD5=y
# 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_DES is not set
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# 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_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
-CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_ARC4 is not set
# 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
-#
+CONFIG_CRYPTO_HW=y
#
# Library routines
#
-CONFIG_CRC_CCITT=m
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
-# CONFIG_LIBCRC32C is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
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/recipes/kexecboot/linux-kexecboot-2.6.29/omap3-pandora/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3-pandora/defconfig
new file mode 100644
index 0000000000..8ac420cc31
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3-pandora/defconfig
@@ -0,0 +1,2186 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28-rc7-omap1
+# Fri Dec 12 19:50:40 2008
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=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=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES 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 is not set
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_LSF=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
+
+#
+# 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_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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# 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=y
+# CONFIG_ARCH_MSM is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+CONFIG_OMAP_SMARTREFLEX=y
+# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MMU_FWK is not set
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_DEBUG=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+# CONFIG_OMAP2_DSS_USE_DSI_PLL is not set
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+CONFIG_MACH_OMAP3_PANDORA=y
+CONFIG_OMAP_TICK_GPTIMER=12
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=n
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+CONFIG_ARM_ERRATUM_451034=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+# 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=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE 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_NET_DSA 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
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=y
+CONFIG_BT_HCIUSB_SCO=y
+# CONFIG_BT_HCIBTUSB is not set
+CONFIG_BT_HCIBTSDIO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_IEEE80211=y
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=y
+CONFIG_IEEE80211_CRYPT_CCMP=y
+CONFIG_IEEE80211_CRYPT_TKIP=y
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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 is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ALAUDA is not set
+CONFIG_MTD_ONENAND=y
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_GENERIC is not set
+CONFIG_MTD_ONENAND_OMAP2=y
+# CONFIG_MTD_ONENAND_OTP is not set
+# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
+# CONFIG_MTD_ONENAND_SIM 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+CONFIG_EEPROM_93CX6=m
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+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=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+CONFIG_DAVICOM_PHY=y
+CONFIG_QSEMI_PHY=y
+CONFIG_LXT_PHY=y
+CONFIG_CICADA_PHY=y
+CONFIG_VITESSE_PHY=y
+CONFIG_SMSC_PHY=y
+CONFIG_BROADCOM_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+CONFIG_REALTEK_PHY=y
+CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BITBANG=y
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=m
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_RTL8187 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_ZD1211RW is not set
+# CONFIG_RT2X00 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=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_SMSC95XX 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=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# 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_TWL4030=y
+# CONFIG_KEYBOARD_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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=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_INEXIO 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_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+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_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=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_AT24 is not set
+CONFIG_SENSORS_EEPROM=y
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_ISP1301_OMAP is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_USB=y
+CONFIG_TWL4030_PWRBUTTON=y
+CONFIG_TWL4030_POWEROFF=y
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_TSL2563 is not set
+# CONFIG_LP5521 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
+CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_TWL4030_BCI_BATTERY is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S 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_LM70 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_MAX1111 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_ADS7828 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+# CONFIG_USB_GSPCA is not set
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+# CONFIG_USB_ET61X251 is not set
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+# CONFIG_USB_ZC0301 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+# CONFIG_DVB_USB_DW2102 is not set
+# CONFIG_DVB_USB_CINERGY_T2 is not set
+# CONFIG_DVB_USB_ANYSEE is not set
+# CONFIG_DVB_USB_DTV5100 is not set
+# CONFIG_DVB_USB_AF9015 is not set
+CONFIG_DVB_TTUSB_BUDGET=m
+CONFIG_DVB_TTUSB_DEC=m
+# CONFIG_DVB_SIANO_SMS1XXX is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_FLEXCOP is not set
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+# CONFIG_DVB_STV0288 is not set
+# CONFIG_DVB_STB6000 is not set
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+# CONFIG_DVB_CX24116 is not set
+# CONFIG_DVB_SI21XX is not set
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+# CONFIG_DVB_DRX397XD is not set
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+# CONFIG_DVB_OR51211 is not set
+# CONFIG_DVB_OR51132 is not set
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+# CONFIG_DVB_ISL6405 is not set
+CONFIG_DVB_ISL6421=m
+# CONFIG_DVB_LGS8GL5 is not set
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+# CONFIG_DVB_AF9013 is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
+CONFIG_FB_OMAP2=y
+# CONFIG_FB_OMAP2_DEBUG is not set
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_DVI=y
+# CONFIG_PANEL_DVI_640X480 is not set
+# CONFIG_PANEL_DVI_800X600 is not set
+CONFIG_PANEL_DVI_1024X768=y
+# CONFIG_PANEL_DVI_1280X1024 is not set
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_LTV350QV=y
+CONFIG_LCD_ILI9320=y
+# CONFIG_LCD_TDO24M is not set
+CONFIG_LCD_VGG2432A4=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CORGI=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_BRIGHT=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_DELL=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_HOST=y
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+# CONFIG_USB_MUSB_OTG is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+# CONFIG_USB_BERRY_CHARGE is not set
+CONFIG_USB_LED=m
+# 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+# CONFIG_LEDS_OMAP is not set
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# 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=m
+# 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_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_CRAMFS=m
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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=m
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACER_MAX_TRACE=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+CONFIG_PREEMPT_TRACER=y
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=m
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/defconfig
new file mode 100644
index 0000000000..05f1dddaad
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/defconfig
@@ -0,0 +1,2126 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Thu Jul 16 16:20:40 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=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=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+CONFIG_OMAP_SMARTREFLEX=y
+# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_IOMMU is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=12
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+CONFIG_MACH_OMAP3EVM=y
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_LEDS=y
+# CONFIG_ALIGNMENT_TRAP is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+CONFIG_ARM_ERRATUM_451034=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+# 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=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE 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_NET_DSA 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTUSB is not set
+CONFIG_BT_HCIBTSDIO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=m
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+CONFIG_EEPROM_93CX6=m
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+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=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+CONFIG_DAVICOM_PHY=y
+CONFIG_QSEMI_PHY=y
+CONFIG_LXT_PHY=y
+CONFIG_CICADA_PHY=y
+CONFIG_VITESSE_PHY=y
+CONFIG_SMSC_PHY=y
+CONFIG_BROADCOM_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+CONFIG_REALTEK_PHY=y
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BITBANG=y
+# CONFIG_MDIO_GPIO is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=m
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_RTL8187 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_ZD1211RW is not set
+# CONFIG_RT2X00 is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_SMSC95XX 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=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# 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_TWL4030=y
+# CONFIG_KEYBOARD_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWEROFF=y
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_TSL2563 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
+CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_TWL4030_BCI_BATTERY is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S 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_LM70 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_LTC4245 is not set
+# CONFIG_SENSORS_MAX1111 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_ADS7828 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+# CONFIG_VIDEO_OMAP3 is not set
+# CONFIG_VIDEO_OMAP34XX_ISP_RESIZER is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+# CONFIG_USB_GSPCA is not set
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+# CONFIG_USB_ET61X251 is not set
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+# CONFIG_USB_ZC0301 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+# CONFIG_DVB_DYNAMIC_MINORS is not set
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+# CONFIG_DVB_USB_DW2102 is not set
+# CONFIG_DVB_USB_CINERGY_T2 is not set
+# CONFIG_DVB_USB_ANYSEE is not set
+# CONFIG_DVB_USB_DTV5100 is not set
+# CONFIG_DVB_USB_AF9015 is not set
+# CONFIG_DVB_SIANO_SMS1XXX is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_FLEXCOP is not set
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+# CONFIG_DVB_STB0899 is not set
+# CONFIG_DVB_STB6100 is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+# CONFIG_DVB_STV0288 is not set
+# CONFIG_DVB_STB6000 is not set
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+# CONFIG_DVB_TDA8261 is not set
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+# CONFIG_DVB_TUNER_CX24113 is not set
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+# CONFIG_DVB_CX24116 is not set
+# CONFIG_DVB_SI21XX is not set
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+# CONFIG_DVB_DRX397XD is not set
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+# CONFIG_DVB_OR51211 is not set
+# CONFIG_DVB_OR51132 is not set
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+# CONFIG_DVB_LGDT3304 is not set
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+# CONFIG_DVB_S921 is not set
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+# CONFIG_DVB_ISL6405 is not set
+CONFIG_DVB_ISL6421=m
+# CONFIG_DVB_LGS8GL5 is not set
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+# CONFIG_DVB_AF9013 is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_VRAM_SIZE=4
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+# CONFIG_PANEL_N800 is not set
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_LTV350QV=y
+CONFIG_LCD_ILI9320=y
+# CONFIG_LCD_TDO24M is not set
+CONFIG_LCD_VGG2432A4=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_HRTIMER 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=y
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_NTRIG is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_HOST=y
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+# CONFIG_USB_MUSB_OTG is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+# CONFIG_USB_SERIAL_OPTICON is not set
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+# CONFIG_USB_BERRY_CHARGE is not set
+CONFIG_USB_LED=m
+# 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+# CONFIG_LEDS_OMAP is not set
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+CONFIG_HFSPLUS_FS=m
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=m
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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=m
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACER_MAX_TRACE=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+CONFIG_PREEMPT_TRACER=y
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=m
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-dss2.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-dss2.diff
new file mode 100644
index 0000000000..60832e72ca
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-dss2.diff
@@ -0,0 +1,443 @@
+From: hvaibhav@ti.com
+To: linux-fbdev-devel@lists.sourceforge.net, linux-omap@vger.kernel.org
+Cc: Vaibhav Hiremath <hvaibhav@ti.com>
+Subject: [REVIEW PATCH] Added OMAP3EVM support on Tomis FBDEV/DSS Patches
+Date: Fri, 14 Nov 2008 12:02:32 +0530
+
+From: Vaibhav Hiremath <hvaibhav@ti.com>
+
+Tested LCD, TV, DVI (480P) out on OMAP3EVM board.
+
+Please make sure that you change the option
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=7 and apply the
+Mans Rullgard clock patches to support set_rate and round_rate API.
+
+Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
+---
+ arch/arm/mach-omap2/board-omap3evm.c | 224 ++++++++++++++++++++++++++++++++--
+ drivers/video/omap2/Kconfig | 5 +
+ drivers/video/omap2/Makefile | 1 +
+ drivers/video/omap2/panel-omap3evm.c | 110 +++++++++++++++++
+ 5 files changed, 341 insertions(+), 53 deletions(-)
+ create mode 100644 drivers/video/omap2/panel-omap3evm.c
+
+diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
+index 42ab826..e244fa7 100644
+--- a/arch/arm/mach-omap2/board-omap3evm.c
++++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -37,6 +37,8 @@
+ #include <mach/usb-ehci.h>
+ #include <mach/common.h>
+ #include <mach/mcspi.h>
++#include <mach/omapfb.h>
++#include <mach/display.h>
+
+ #include "sdram-micron-mt46h32m32lf-6.h"
+ #include "twl4030-generic-scripts.h"
+@@ -161,14 +163,215 @@ static int __init omap3_evm_i2c_init(void)
+ omap_register_i2c_bus(3, 400, NULL, 0);
+ return 0;
+ }
++static struct omap_fbmem_config evm_fbmem0_config = {
++ .size = 480*720*4,
++ .start = OMAPFB_MEMTYPE_SDRAM,
++};
+
+-static struct platform_device omap3_evm_lcd_device = {
+- .name = "omap3evm_lcd",
+- .id = -1,
++static struct omap_fbmem_config evm_fbmem1_config = {
++ .size = 480*720*4,
++ .start = OMAPFB_MEMTYPE_SDRAM,
+ };
+
+-static struct omap_lcd_config omap3_evm_lcd_config __initdata = {
+- .ctrl_name = "internal",
++static struct omap_fbmem_config evm_fbmem2_config = {
++ .size = 480*720*4,
++ .start = OMAPFB_MEMTYPE_SDRAM,
++};
++#define LCD_PANEL_LR 2
++#define LCD_PANEL_UD 3
++#define LCD_PANEL_INI 152
++#define LCD_PANEL_ENABLE_GPIO 153
++#define LCD_PANEL_QVGA 154
++#define LCD_PANEL_RESB 155
++
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++#define ENABLE_VPLL2_DEDICATED 0x05
++#define ENABLE_VPLL2_DEV_GRP 0xE0
++
++#define TWL4030_GPIODATA_IN3 0x03
++#define TWL4030_GPIODATA_DIR3 0x06
++#define TWL4030_VPLL2_DEV_GRP 0x33
++#define TWL4030_VPLL2_DEDICATED 0x36
++
++static int lcd_enabled;
++static int dvi_enabled;
++
++static void __init evm_display_init(void)
++{
++ int r;
++ r = gpio_request(LCD_PANEL_LR, "lcd_panel_lr");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_LR\n");
++ return;
++ }
++ r = gpio_request(LCD_PANEL_UD, "lcd_panel_ud");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_UD\n");
++ goto err_1;
++ }
++
++ r = gpio_request(LCD_PANEL_INI, "lcd_panel_ini");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_INI\n");
++ goto err_2;
++ }
++ r = gpio_request(LCD_PANEL_RESB, "lcd_panel_resb");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_RESB\n");
++ goto err_3;
++ }
++ r = gpio_request(LCD_PANEL_QVGA, "lcd_panel_qvga");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_QVGA\n");
++ goto err_4;
++ }
++
++ gpio_direction_output(LCD_PANEL_LR, 0);
++ gpio_direction_output(LCD_PANEL_UD, 0);
++ gpio_direction_output(LCD_PANEL_INI, 0);
++ gpio_direction_output(LCD_PANEL_RESB, 0);
++ gpio_direction_output(LCD_PANEL_QVGA, 0);
++
++#define TWL_LED_LEDEN 0x00
++#define TWL_PWMA_PWMAON 0x00
++#define TWL_PWMA_PWMAOFF 0x01
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF);
++
++ gpio_direction_output(LCD_PANEL_RESB, 1);
++ gpio_direction_output(LCD_PANEL_INI, 1);
++ gpio_direction_output(LCD_PANEL_QVGA, 0);
++ gpio_direction_output(LCD_PANEL_LR, 1);
++ gpio_direction_output(LCD_PANEL_UD, 1);
++
++ return;
++
++err_4:
++ gpio_free(LCD_PANEL_RESB);
++err_3:
++ gpio_free(LCD_PANEL_INI);
++err_2:
++ gpio_free(LCD_PANEL_UD);
++err_1:
++ gpio_free(LCD_PANEL_LR);
++
++}
++
++static int panel_enable_lcd(struct omap_display *display)
++{
++ if (dvi_enabled) {
++ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
++ return -EINVAL;
++ }
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
++ }
++ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
++ lcd_enabled = 1;
++ return 0;
++}
++
++static void panel_disable_lcd(struct omap_display *display)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEV_GRP);
++ }
++ gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
++ lcd_enabled = 0;
++}
++
++static struct omap_display_data evm_display_data = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "lcd",
++ .panel_name = "panel-sdp3430",
++ .u.dpi.data_lines = 16,
++ .panel_enable = panel_enable_lcd,
++ .panel_disable = panel_disable_lcd,
++};
++
++static int panel_enable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED, TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++ return 0;
++}
++
++static void panel_disable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_display_data evm_display_data_tv = {
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .name = "tv",
++ .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .panel_enable = panel_enable_tv,
++ .panel_disable = panel_disable_tv,
++};
++
++
++static int panel_enable_dvi(struct omap_display *display)
++{
++ if (lcd_enabled) {
++ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
++ return -EINVAL;
++ }
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
++ TWL4030_GPIODATA_IN3);
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
++ TWL4030_GPIODATA_DIR3);
++ dvi_enabled = 1;
++
++ return 0;
++}
++
++static void panel_disable_dvi(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
++ TWL4030_GPIODATA_IN3);
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
++ TWL4030_GPIODATA_DIR3);
++ dvi_enabled = 0;
++}
++
++
++static struct omap_display_data evm_display_data_dvi = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .panel_name = "panel-dvi",
++ .u.dpi.data_lines = 24,
++ .panel_enable = panel_enable_dvi,
++ .panel_disable = panel_disable_dvi,
++};
++
++static struct omap_dss_platform_data evm_dss_data = {
++ .num_displays = 3,
++ .displays = {
++ &evm_display_data,
++ &evm_display_data_dvi,
++ &evm_display_data_tv,
++ }
++};
++static struct platform_device evm_dss_device = {
++ .name = "omap-dss",
++ .id = -1,
++ .dev = {
++ .platform_data = &evm_dss_data,
++ },
+ };
+
+ static void ads7846_dev_init(void)
+@@ -227,11 +430,13 @@ static void __init omap3_evm_init_irq(void)
+
+ static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
+ { OMAP_TAG_UART, &omap3_evm_uart_config },
+- { OMAP_TAG_LCD, &omap3_evm_lcd_config },
++ { OMAP_TAG_FBMEM, &evm_fbmem0_config },
++ { OMAP_TAG_FBMEM, &evm_fbmem1_config },
++ { OMAP_TAG_FBMEM, &evm_fbmem2_config },
+ };
+
+ static struct platform_device *omap3_evm_devices[] __initdata = {
+- &omap3_evm_lcd_device,
++ &evm_dss_device,
+ &omap3evm_smc911x_device,
+ };
+
+@@ -250,8 +455,6 @@ static void __init omap3_evm_init(void)
+ omap3_evm_i2c_init();
+
+ platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
+- omap_board_config = omap3_evm_config;
+- omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
+
+ spi_register_board_info(omap3evm_spi_board_info,
+ ARRAY_SIZE(omap3evm_spi_board_info));
+@@ -262,10 +465,13 @@ static void __init omap3_evm_init(void)
+ usb_ehci_init();
+ omap3evm_flash_init();
+ ads7846_dev_init();
++ evm_display_init();
+ }
+
+ static void __init omap3_evm_map_io(void)
+ {
++ omap_board_config = omap3_evm_config;
++ omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
+ omap2_set_globals_343x();
+ omap2_map_common_io();
+ }
+diff --git a/drivers/video/omap2/Kconfig b/drivers/video/omap2/Kconfig
+index 95691ad..8211ffd 100644
+--- a/drivers/video/omap2/Kconfig
++++ b/drivers/video/omap2/Kconfig
+@@ -51,4 +51,9 @@ config PANEL_SDP3430
+ help
+ SDP3430 LCD
+
++config PANEL_OMAP3EVM
++ tristate "OMAP3EVM Panel"
++ depends on OMAP2_DSS
++ help
++ OMAP3EVM LCD Panel
+ endmenu
+diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile
+index 73ab1c0..668e8c6 100644
+--- a/drivers/video/omap2/Makefile
++++ b/drivers/video/omap2/Makefile
+@@ -3,3 +3,4 @@ omapfb-y := omapfb-main.o omapfb-sysfs.o omapfb-ioctl.o
+
+ obj-$(CONFIG_PANEL_DVI) += panel-dvi.o
+ obj-$(CONFIG_PANEL_SDP3430) += panel-sdp3430.o
++obj-$(CONFIG_PANEL_OMAP3EVM) += panel-omap3evm.o
+diff --git a/drivers/video/omap2/panel-omap3evm.c b/drivers/video/omap2/panel-omap3evm.c
+new file mode 100644
+index 0000000..4a00b02
+--- /dev/null
++++ b/drivers/video/omap2/panel-omap3evm.c
+@@ -0,0 +1,110 @@
++/*
++ * LCD panel support for the TI OMAP3EVM board
++ *
++ * Copyright (C) 2008 Texas Instruments, Inc.
++ * Author: Vaibhav Hiremath <hvaibhav@ti.com>
++ *
++ * Derived from drivers/video/omap2/panel-sdp3430.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++
++#include <mach/display.h>
++
++static int omap3evm_panel_init(struct omap_display *display)
++{
++ return 0;
++}
++
++static void omap3evm_panel_cleanup(struct omap_display *display)
++{
++}
++
++static int omap3evm_panel_enable(struct omap_display *display)
++{
++ int r = 0;
++
++ if (display->hw_config.panel_enable)
++ r = display->hw_config.panel_enable(display);
++
++ return r;
++}
++
++static void omap3evm_panel_disable(struct omap_display *display)
++{
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++}
++
++static int omap3evm_panel_suspend(struct omap_display *display)
++{
++ omap3evm_panel_disable(display);
++ return 0;
++}
++
++static int omap3evm_panel_resume(struct omap_display *display)
++{
++ return omap3evm_panel_enable(display);
++}
++
++static struct omap_panel omap3evm_panel = {
++ .owner = THIS_MODULE,
++ .name = "panel-evm",
++ .init = omap3evm_panel_init,
++ .cleanup = omap3evm_panel_cleanup,
++ .enable = omap3evm_panel_enable,
++ .disable = omap3evm_panel_disable,
++ .suspend = omap3evm_panel_suspend,
++ .resume = omap3evm_panel_resume,
++ /*.set_mode = omap3evm_set_mode, */
++
++ .timings = {
++ .pixel_clock = 26000,
++
++ .hsw = 4,
++ .hfp = 4,
++ .hbp = 40,
++
++ .vsw = 2,
++ .vfp = 2,
++ .vbp = 7,
++ },
++
++ .acb = 0x28,
++
++ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
++ OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IPC,
++
++ .x_res = 480,
++ .y_res = 640,
++ .bpp = 18,
++};
++
++
++static int __init omap3evm_panel_drv_init(void)
++{
++ omap_dss_register_panel(&omap3evm_panel);
++ return 0;
++}
++
++static void __exit omap3evm_panel_drv_exit(void)
++{
++ omap_dss_unregister_panel(&omap3evm_panel);
++}
++
++module_init(omap3evm_panel_drv_init);
++module_exit(omap3evm_panel_drv_exit);
++MODULE_LICENSE("GPL");
+--
+1.5.6
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-omap" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-lcd-redtint.diff b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-lcd-redtint.diff
new file mode 100644
index 0000000000..54ea3c9f68
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap3evm/omap3evm-lcd-redtint.diff
@@ -0,0 +1,66 @@
+Message-ID: <c656a4d20809270046u341aec27k6d896d4b42e799d4@mail.gmail.com>
+Date: Sat, 27 Sep 2008 03:46:18 -0400
+From: "arun c" <arun.edarath@gmail.com>
+To: "Daniel Schaeffer" <daniel.schaeffer@timesys.com>
+Subject: Re: OMAP3EVM LCD red tint
+
+Hi Daniel Schaeffer
+
+On Fri, Sep 26, 2008 at 4:20 PM, Daniel Schaeffer
+<daniel.schaeffer@timesys.com> wrote:
+> Has anyone looked into why the LCD display on the OMAP3EVM is always tinted
+> red? I created a couple of color test images that I cat'ed to /dev/fb and it
+> looks like the blue color channel is completely ignored. I was testing on
+> v2.6.26-omap2 but is doesn't look like there have been any changes to the fb
+> driver since then so I'm assuming the issue is also present in the head of
+> the git tree.
+>
+> Regards,
+>
+> Daniel Schaeffer
+>
+
+Try the patch below(Remember that you may have to manually edit because
+this patch is against current HEAD)
+
+
+diff --git a/drivers/video/omap/lcd_omap3evm.c
+b/drivers/video/omap/lcd_omap3evm.c
+index a564ca5..821bafe 100644
+--- a/drivers/video/omap/lcd_omap3evm.c
++++ b/drivers/video/omap/lcd_omap3evm.c
+@@ -44,6 +44,8 @@
+ #define ENABLE_VDAC_DEV_GRP 0x20
+ #define ENABLE_VPLL2_DEDICATED 0x05
+ #define ENABLE_VPLL2_DEV_GRP 0xE0
++#define TWL4030_VPLL2_DEV_GRP 0x33
++#define TWL4030_VPLL2_DEDICATED 0x36
+
+ #define TWL_LED_LEDEN 0x00
+ #define TWL_PWMA_PWMAON 0x00
+@@ -86,12 +88,24 @@ static void omap3evm_panel_cleanup(struct lcd_panel *panel)
+
+ static int omap3evm_panel_enable(struct lcd_panel *panel)
+ {
++ if (omap_rev > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
++ }
+ omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
+ return 0;
+ }
+
+ static void omap3evm_panel_disable(struct lcd_panel *panel)
+ {
++ if (omap_rev > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEV_GRP);
++ }
+ omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
+ }
+
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/omap5912osk/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omap5912osk/defconfig
new file mode 100644
index 0000000000..3c334868ea
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omap5912osk/defconfig
@@ -0,0 +1,1098 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc2-omap1
+# Tue Aug 21 23:22:37 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_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+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 is not set
+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 is not set
+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_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# 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 is not set
+# 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=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+CONFIG_ARCH_OMAP1=y
+# CONFIG_ARCH_OMAP2 is not set
+# CONFIG_ARCH_OMAP3 is not set
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_RESET_CLOCKS=y
+# CONFIG_OMAP_BOOT_TAG is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+# CONFIG_OMAP_MUX_DEBUG is not set
+CONFIG_OMAP_MUX_WARNINGS=y
+# CONFIG_OMAP_STI is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MMU_FWK is not set
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+# CONFIG_OMAP_DM_TIMER is not set
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_SERIAL_WAKE=y
+# CONFIG_OMAP_DSP is not set
+
+#
+# OMAP Core Type
+#
+# CONFIG_ARCH_OMAP730 is not set
+# CONFIG_ARCH_OMAP15XX is not set
+CONFIG_ARCH_OMAP16XX=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_OMAP_INNOVATOR is not set
+# CONFIG_MACH_OMAP_H2 is not set
+# CONFIG_MACH_OMAP_H3 is not set
+CONFIG_MACH_OMAP_OSK=y
+# CONFIG_OMAP_OSK_MISTRAL is not set
+# CONFIG_MACH_NOKIA770 is not set
+# CONFIG_MACH_OMAP_GENERIC is not set
+
+#
+# OMAP CPU Speed
+#
+# CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER is not set
+# CONFIG_OMAP_ARM_216MHZ is not set
+CONFIG_OMAP_ARM_192MHZ=y
+# CONFIG_OMAP_ARM_168MHZ is not set
+# CONFIG_OMAP_ARM_120MHZ is not set
+# CONFIG_OMAP_ARM_60MHZ is not set
+# CONFIG_OMAP_ARM_30MHZ is not set
+# CONFIG_MACH_OMAP_APOLLON_PLUS is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+
+#
+# PC-card bridges
+#
+CONFIG_OMAP_CF=y
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+# 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_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x10400000,8M root=/dev/ram0 rw"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ 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
+# CONFIG_VFP 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_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_APM_EMULATION is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=m
+# 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=y
+# 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_IP_MROUTE 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=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# 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 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_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_IDE=m
+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_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_IDE_GENERIC is not set
+# CONFIG_IDEPCI_PCIBUS_ORDER is not set
+# CONFIG_IDE_ARM is not set
+# 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 is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK 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=y
+# CONFIG_DM9000 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_NET_PCMCIA is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=y
+# 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 is not set
+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=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP=y
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE 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 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# 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=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_CS is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=m
+CONFIG_HW_RANDOM_OMAP=m
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 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
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# 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_OCORES is not set
+CONFIG_I2C_OMAP=y
+# 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
+
+#
+# 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_ISP1301_OMAP is not set
+CONFIG_TPS65010=y
+# CONFIG_SENSORS_TLV320AIC23 is not set
+# CONFIG_GPIOEXPANDER_OMAP 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 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# 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=m
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# 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=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_OMAP=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
+# CONFIG_FB_OMAP_DMA_TUNE 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=y
+CONFIG_FONT_8x8=y
+# CONFIG_FONT_8x16 is not set
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+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 is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# 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=y
+CONFIG_AUTOFS4_FS=y
+# 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=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+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 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 is not set
+# 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=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_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 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=m
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+# 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=m
+# 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_SLUB_DEBUG_ON is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+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/recipes/kexecboot/linux-kexecboot-2.6.29/omapzoom/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/omapzoom/defconfig
new file mode 100644
index 0000000000..aa11eb04fc
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/omapzoom/defconfig
@@ -0,0 +1,1951 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Mon Mar 30 15:25:29 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+CONFIG_BLK_DEV_IO_TRACE=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+# CONFIG_FREEZER is not set
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+CONFIG_OMAP_SMARTREFLEX=y
+# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+CONFIG_OMAP_MUX_DEBUG=y
+CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=1
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_OMAP_SERIAL_WAKE=y
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+CONFIG_MACH_OMAP_LDP=y
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=n
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_ARM_ERRATUM_451034 is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SUSPEND is not set
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+CONFIG_NET_IPIP=m
+# 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=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE 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_STP=m
+CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTSDIO=y
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_LL=y
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=y
+CONFIG_LIB80211_CRYPT_WEP=y
+CONFIG_LIB80211_CRYPT_CCMP=y
+CONFIG_LIB80211_CRYPT_TKIP=y
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+CONFIG_MTD_NAND_ECC_SMC=y
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+CONFIG_EEPROM_93CX6=y
+CONFIG_HAVE_IDE=y
+# 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=m
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# 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_VETH 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 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+# CONFIG_LIBERTAS is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=y
+CONFIG_USB_NET_RNDIS_WLAN=y
+CONFIG_RTL8187=y
+# CONFIG_MAC80211_HWSIM is not set
+CONFIG_P54_COMMON=y
+CONFIG_P54_USB=y
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=y
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_ZD1211RW=y
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_RT2X00=y
+CONFIG_RT2500USB=y
+CONFIG_RT73USB=y
+CONFIG_RT2X00_LIB_USB=y
+CONFIG_RT2X00_LIB=y
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+# CONFIG_USB_NET_DM9601 is not set
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=y
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_MCS7830 is not set
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+# CONFIG_USB_ALI_M5632 is not set
+# CONFIG_USB_AN2720 is not set
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_EPSON2888 is not set
+# CONFIG_USB_KC2190 is not set
+CONFIG_USB_NET_ZAURUS=y
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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 is not set
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_EVDEV=y
+# 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_TWL4030=y
+CONFIG_KEYBOARD_GPIO=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=y
+# CONFIG_TWL4030_POWEROFF 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+CONFIG_W1=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2490 is not set
+# CONFIG_W1_MASTER_DS2482 is not set
+# CONFIG_W1_MASTER_DS1WM is not set
+# CONFIG_W1_MASTER_GPIO is not set
+CONFIG_HDQ_MASTER_OMAP=y
+
+#
+# 1-wire Slaves
+#
+# CONFIG_W1_SLAVE_THERM is not set
+# CONFIG_W1_SLAVE_SMEM is not set
+# CONFIG_W1_SLAVE_DS2431 is not set
+# CONFIG_W1_SLAVE_DS2433 is not set
+# CONFIG_W1_SLAVE_DS2760 is not set
+CONFIG_W1_SLAVE_BQ27000=y
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+CONFIG_TWL4030_BCI_BATTERY=y
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+# CONFIG_TWL4030_POWER is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+# CONFIG_VIDEO_ALLOW_V4L1 is not set
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=y
+
+#
+# Multimedia drivers
+#
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=y
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=y
+CONFIG_MEDIA_TUNER_TDA8290=y
+CONFIG_MEDIA_TUNER_TDA9887=y
+CONFIG_MEDIA_TUNER_TEA5761=y
+CONFIG_MEDIA_TUNER_TEA5767=y
+CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER_XC2028=y
+CONFIG_MEDIA_TUNER_XC5000=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TDA9875 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+# CONFIG_VIDEO_MSP3400 is not set
+# CONFIG_VIDEO_CS5345 is not set
+# CONFIG_VIDEO_CS53L32A is not set
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+# CONFIG_VIDEO_WM8775 is not set
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# Video decoders
+#
+# CONFIG_VIDEO_OV7670 is not set
+# CONFIG_VIDEO_TCM825X is not set
+# CONFIG_VIDEO_SAA711X is not set
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_TVP514X is not set
+# CONFIG_VIDEO_TVP5150 is not set
+
+#
+# Video and audio decoders
+#
+# CONFIG_VIDEO_CX25840 is not set
+
+#
+# MPEG video encoders
+#
+# CONFIG_VIDEO_CX2341X is not set
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_USB_VIDEO_CLASS is not set
+# CONFIG_USB_GSPCA is not set
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_USBVISION is not set
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_ZC0301 is not set
+# CONFIG_USB_ZR364XX is not set
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+CONFIG_FB_FOREIGN_ENDIAN=y
+CONFIG_FB_BOTH_ENDIAN=y
+# CONFIG_FB_BIG_ENDIAN is not set
+# CONFIG_FB_LITTLE_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_FB_OMAP=y
+CONFIG_FB_OMAP_LCD_VGA=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
+# CONFIG_OMAP2_DSS is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_LTV350QV=y
+CONFIG_LCD_ILI9320=y
+# CONFIG_LCD_TDO24M is not set
+CONFIG_LCD_VGG2432A4=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT 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=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_HRTIMER 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
+CONFIG_SND_DRIVERS=y
+# 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
+CONFIG_SND_ARM=y
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=y
+# CONFIG_SND_USB_CAIAQ_INPUT is not set
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MICROSOFT is not set
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SONY is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_HOST=y
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+# CONFIG_USB_MUSB_OTG is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+CONFIG_LEDS_OMAP=y
+CONFIG_LEDS_OMAP_PWM=y
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+CONFIG_REGULATOR_BQ24022=y
+CONFIG_REGULATOR_TWL4030=y
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS 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=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+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/recipes/kexecboot/linux-kexecboot-2.6.29/overo/defconfig b/recipes/kexecboot/linux-kexecboot-2.6.29/overo/defconfig
new file mode 100644
index 0000000000..0101ca5099
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/overo/defconfig
@@ -0,0 +1,2248 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Wed Apr 8 18:20:57 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+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 is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+CONFIG_BLK_DEV_IO_TRACE=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+CONFIG_OMAP_SMARTREFLEX=y
+# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+# CONFIG_OMAP_RESET_CLOCKS is not set
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_IOMMU is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=1
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+CONFIG_MACH_OVERO=y
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_ARM_ERRATUM_451034 is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+CONFIG_NET_IPIP=m
+# 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=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE 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_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTSDIO=y
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+# CONFIG_BT_HCIUART_LL is not set
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=m
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+CONFIG_MTD_UBI_GLUEBI=y
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_EEPROM_93CX6=m
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+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=m
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=m
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+CONFIG_LIBERTAS_SDIO=m
+CONFIG_LIBERTAS_DEBUG=y
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=m
+CONFIG_USB_NET_RNDIS_WLAN=m
+CONFIG_RTL8187=m
+# CONFIG_MAC80211_HWSIM is not set
+CONFIG_P54_COMMON=m
+CONFIG_P54_USB=m
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_RT2X00=m
+CONFIG_RT2500USB=m
+CONFIG_RT73USB=m
+CONFIG_RT2X00_LIB_USB=m
+CONFIG_RT2X00_LIB=m
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SMSC95XX=m
+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=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_TWL4030 is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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=m
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWEROFF=y
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_TSL2563 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+CONFIG_DEBUG_GPIO=y
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_TWL4030_BCI_BATTERY is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S 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_LM70 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_LTC4245 is not set
+# CONFIG_SENSORS_MAX1111 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_ADS7828 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+# CONFIG_TWL4030_POWER is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+# CONFIG_VIDEO_OMAP3 is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+# CONFIG_USB_GSPCA is not set
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+# CONFIG_USB_ET61X251 is not set
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+# CONFIG_USB_ZC0301 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+# CONFIG_DVB_DYNAMIC_MINORS is not set
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+# CONFIG_DVB_USB_DW2102 is not set
+# CONFIG_DVB_USB_CINERGY_T2 is not set
+# CONFIG_DVB_USB_ANYSEE is not set
+# CONFIG_DVB_USB_DTV5100 is not set
+# CONFIG_DVB_USB_AF9015 is not set
+# CONFIG_DVB_SIANO_SMS1XXX is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_FLEXCOP is not set
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+# CONFIG_DVB_STB0899 is not set
+# CONFIG_DVB_STB6100 is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+# CONFIG_DVB_STV0288 is not set
+# CONFIG_DVB_STB6000 is not set
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+# CONFIG_DVB_TDA8261 is not set
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+# CONFIG_DVB_TUNER_CX24113 is not set
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+# CONFIG_DVB_CX24116 is not set
+# CONFIG_DVB_SI21XX is not set
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+# CONFIG_DVB_DRX397XD is not set
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+# CONFIG_DVB_OR51211 is not set
+# CONFIG_DVB_OR51132 is not set
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+# CONFIG_DVB_LGDT3304 is not set
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+# CONFIG_DVB_S921 is not set
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+# CONFIG_DVB_ISL6405 is not set
+CONFIG_DVB_ISL6421=m
+# CONFIG_DVB_LGS8GL5 is not set
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+# CONFIG_DVB_AF9013 is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# 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_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_VRAM_SIZE=10
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C=y
+# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
+# CONFIG_PANEL_N800 is not set
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+# 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_HRTIMER=m
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+CONFIG_SND_DEBUG=y
+# CONFIG_SND_DEBUG_VERBOSE is not set
+# CONFIG_SND_PCM_XRUN_DEBUG is not set
+# CONFIG_SND_DRIVERS is not set
+# CONFIG_SND_ARM is not set
+# CONFIG_SND_SPI is not set
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_OVERO=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL4030=y
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_NTRIG is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_OMAP_EHCI_PHY_MODE=y
+# CONFIG_OMAP_EHCI_TLL_MODE is not set
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_HOST=y
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+# CONFIG_USB_MUSB_OTG is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+CONFIG_USB_MUSB_DEBUG=y
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=y
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_CP2101 is not set
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+CONFIG_USB_SERIAL_FTDI_SIO=m
+# CONFIG_USB_SERIAL_FUNSOFT is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+# CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_IUU is not set
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+CONFIG_USB_SERIAL_OPTION=m
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_DEBUG is not set
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+# CONFIG_USB_BERRY_CHARGE is not set
+CONFIG_USB_LED=m
+# 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_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+CONFIG_USB_GADGET_OMAP=y
+CONFIG_USB_OMAP=y
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_USB_G_PRINTER=m
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+# CONFIG_LEDS_OMAP is not set
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DEBUG=y
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+CONFIG_REGULATOR_TWL4030=y
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_XATTR is not set
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS 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=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/overo/ehci.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/overo/ehci.patch
new file mode 100644
index 0000000000..72c6b9bec3
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/overo/ehci.patch
@@ -0,0 +1,113 @@
+diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
+index 489439d..2c6305b 100644
+--- a/arch/arm/mach-omap2/usb-ehci.c
++++ b/arch/arm/mach-omap2/usb-ehci.c
+@@ -152,9 +152,7 @@ static void setup_ehci_io_mux(void)
+
+ void __init usb_ehci_init(void)
+ {
+- /* Setup Pin IO MUX for EHCI */
+- if (cpu_is_omap34xx())
+- setup_ehci_io_mux();
++ /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
+
+ if (platform_device_register(&ehci_device) < 0) {
+ printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
+
+diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
+index 1b3266c..8472996 100644
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -48,16 +48,26 @@
+ * to get the PHY state machine in working state
+ */
+ #define EXTERNAL_PHY_RESET
++#ifdef CONFIG_MACH_OVERO
++#define EXT_PHY_RESET_GPIO_PORT2 (183)
++#else
+ #define EXT_PHY_RESET_GPIO_PORT1 (57)
+ #define EXT_PHY_RESET_GPIO_PORT2 (61)
++#endif
+ #define EXT_PHY_RESET_DELAY (10)
+
++#define PHY_STP_PULLUP_ENABLE (0x10)
++#define PHY_STP_PULLUP_DISABLE (0x90)
++
++
+ /* ISSUE2:
+ * USBHOST supports External charge pump PHYs only
+ * Use the VBUS from Port1 to power VBUS of Port2 externally
+ * So use Port2 as the working ULPI port
+ */
++#ifndef CONFIG_MACH_OVERO
+ #define VBUS_INTERNAL_CHARGEPUMP_HACK
++#endif
+
+ #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
+
+@@ -225,14 +235,43 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+
+ #ifdef EXTERNAL_PHY_RESET
+ /* Refer: ISSUE1 */
++#ifndef CONFIG_MACH_OVERO
+ gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
++#endif
+ gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
+ gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
++ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
+ /* Hold the PHY in RESET for enough time till DIR is high */
+ udelay(EXT_PHY_RESET_DELAY);
+ #endif
+
++ /*
++ * The PHY register 0x7 - Interface Control register is
++ * configured to disable the integrated STP pull-up resistor
++ * used for interface protection.
++ *
++ * May not need to be here.
++ */
++ omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (PHY_STP_PULLUP_DISABLE),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
++ /* Force PHY to HS */
++ omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
++ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
++ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
++ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
++ (0x40),
++ EHCI_INSNREG05_ULPI);
++
++ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
++
+ /* Configure TLL for 60Mhz clk for ULPI */
+ ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
+ if (IS_ERR(ehci_clocks->usbtll_fck_clk))
+@@ -307,7 +346,9 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+ * Hold the PHY in RESET for enough time till PHY is settled and ready
+ */
+ udelay(EXT_PHY_RESET_DELAY);
++#ifndef CONFIG_MACH_OVERO
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
++#endif
+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
+ #endif
+
+@@ -393,7 +434,9 @@ static void omap_stop_ehc(struct platform_device *dev, struct usb_hcd *hcd)
+
+
+ #ifdef EXTERNAL_PHY_RESET
++#ifndef CONFIG_MACH_OVERO
+ gpio_free(EXT_PHY_RESET_GPIO_PORT1);
++#endif
+ gpio_free(EXT_PHY_RESET_GPIO_PORT2);
+ #endif
+
+--
+1.6.0.4.790.gaa14a
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/read_die_ids.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/read_die_ids.patch
new file mode 100644
index 0000000000..3f6c930cc1
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/read_die_ids.patch
@@ -0,0 +1,23 @@
+OMAP2/3 TAP: enable debug messages
+
+From: Paul Walmsley <paul@pwsan.com>
+
+This patch causes the OMAP2/3 chip ID code to display the full DIE_ID registers at boot.
+
+---
+
+ arch/arm/mach-omap2/id.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
+index c7f9ab7..a154b5e 100644
+--- a/arch/arm/mach-omap2/id.c
++++ b/arch/arm/mach-omap2/id.c
+@@ -10,6 +10,7 @@
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
++#define DEBUG
+
+ #include <linux/module.h>
+ #include <linux/kernel.h>
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/timer-suppression.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/timer-suppression.patch
new file mode 100644
index 0000000000..04362c96e3
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/timer-suppression.patch
@@ -0,0 +1,43 @@
+diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
+index b854a89..26f5569 100644
+--- a/kernel/time/tick-sched.c
++++ b/kernel/time/tick-sched.c
+@@ -253,6 +253,16 @@ void tick_nohz_stop_sched_tick(void)
+
+ /* Schedule the tick, if we are at least one jiffie off */
+ if ((long)delta_jiffies >= 1) {
++ /*
++ * calculate the expiry time for the next timer wheel
++ * timer
++ */
++ expires = ktime_add_ns(last_update, tick_period.tv64 *
++ delta_jiffies);
++
++ /* Skip reprogram of event if its not changed */
++ if(ts->tick_stopped && ktime_equal(expires, dev->next_event))
++ goto out2;
+
+ if (delta_jiffies > 1)
+ cpu_set(cpu, nohz_cpu_mask);
+@@ -304,12 +314,7 @@ void tick_nohz_stop_sched_tick(void)
+ goto out;
+ }
+
+- /*
+- * calculate the expiry time for the next timer wheel
+- * timer
+- */
+- expires = ktime_add_ns(last_update, tick_period.tv64 *
+- delta_jiffies);
++ /* Mark expiries */
+ ts->idle_expires = expires;
+
+ if (ts->nohz_mode == NOHZ_MODE_HIGHRES) {
+@@ -328,6 +333,7 @@ void tick_nohz_stop_sched_tick(void)
+ tick_do_update_jiffies64(ktime_get());
+ cpu_clear(cpu, nohz_cpu_mask);
+ }
++out2:
+ raise_softirq_irqoff(TIMER_SOFTIRQ);
+ out:
+ ts->next_jiffies = next_jiffies;
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/touchscreen.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/touchscreen.patch
new file mode 100644
index 0000000000..2325c401e4
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/touchscreen.patch
@@ -0,0 +1,22 @@
+diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
+index d8109ae..f8ce669 100644
+--- a/arch/arm/mach-omap2/board-omap3evm.c
++++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -128,8 +128,16 @@ static int ads7846_get_pendown_state(void)
+ }
+
+ struct ads7846_platform_data ads7846_config = {
++ .x_max = 0x0fff,
++ .y_max = 0x0fff,
++ .x_plate_ohms = 180,
++ .pressure_max = 255,
++ .debounce_max = 10,
++ .debounce_tol = 3,
++ .debounce_rep = 1,
+ .get_pendown_state = ads7846_get_pendown_state,
+ .keep_vref_on = 1,
++ .settle_delay_usecs = 150,
+ };
+
+ static struct omap2_mcspi_device_config ads7846_mcspi_config = {
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/usbttyfix.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/usbttyfix.patch
new file mode 100644
index 0000000000..997705a31b
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/usbttyfix.patch
@@ -0,0 +1,29 @@
+To get USB HOST mode working on USB OTG Port with USB TTY enabled U-boot
+
+Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
+---
+--- linux-2.6.git/drivers/usb/musb/omap2430.c 2009-01-19 22:42:18.000000000 +0530
++++ linux-2.6.git/drivers/usb/musb/omap2430.c 2009-02-19 12:45:22.000000000 +0530
+@@ -33,6 +33,7 @@
+ #include <linux/list.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
++#include <linux/i2c/twl4030.h>
+
+ #include <asm/mach-types.h>
+ #include <mach/hardware.h>
+@@ -233,6 +234,14 @@ int __init musb_platform_init(struct mus
+ omap_cfg_reg(AE5_2430_USB0HS_STP);
+ #endif
+
++ /* Reset MUSB Controller */
++ omap_writel(SOFTRST,OTG_SYSCONFIG);
++
++#if defined(CONFIG_TWL4030_USB)
++ /* Reset the TWL USB PHY */
++ twl4030_i2c_write_u8(TWL4030_MODULE_USB, 0x60, 0x4);
++#endif
++
+ musb->xceiv = *x;
+ musb_platform_resume(musb);
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/01-vfp-pm.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/01-vfp-pm.patch
new file mode 100644
index 0000000000..70d4d1efc5
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/01-vfp-pm.patch
@@ -0,0 +1,128 @@
+From: Ben Dooks <ben-linux@fluff.org>
+Date: Thu, 18 Dec 2008 10:26:54 +0000 (+0100)
+Subject: 5349/1: VFP: Add PM code to save and restore current VFP state
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=d504d72ad38e54b5feda67e956834348d6a500e1
+
+5349/1: VFP: Add PM code to save and restore current VFP state
+
+[ARM] 5349/1: VFP: Add PM code to save and restore current VFP state
+
+When CONFIG_PM is selected, the VFP code does not have any handler
+installed to deal with either saving the VFP state of the current
+task, nor does it do anything to try and restore the VFP after a
+resume.
+
+On resume, the VFP will have been reset and the co-processor access
+control registers are in an indeterminate state (very probably the
+CP10 and CP11 the VFP uses will have been disabled by the ARM core
+reset). When this happens, resume will break as soon as it tries to
+unfreeze the tasks and restart scheduling.
+
+Add a sys device to allow us to hook the suspend call to save the
+current thread state if the thread is using VFP and a resume hook
+which restores the CP10/CP11 access and ensures the VFP is disabled
+so that the lazy swapping will take place on next access.
+
+Signed-off-by: Ben Dooks <ben-linux@fluff.org>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
+index c85860b..8de86e4 100644
+--- a/arch/arm/vfp/vfp.h
++++ b/arch/arm/vfp/vfp.h
+@@ -377,6 +377,6 @@ struct op {
+ u32 flags;
+ };
+
+-#ifdef CONFIG_SMP
++#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ extern void vfp_save_state(void *location, u32 fpexc);
+ #endif
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index a62dcf7..b21f43f 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -166,7 +166,7 @@ process_exception:
+ @ retry the faulted instruction
+ ENDPROC(vfp_support_entry)
+
+-#ifdef CONFIG_SMP
++#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ ENTRY(vfp_save_state)
+ @ Save the current VFP state
+ @ r0 - save location
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 67ca340..9f476a1 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -322,6 +322,61 @@ static void vfp_enable(void *unused)
+ set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
+ }
+
++#ifdef CONFIG_PM
++#include <linux/sysdev.h>
++
++static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
++{
++ struct thread_info *ti = current_thread_info();
++ u32 fpexc = fmrx(FPEXC);
++
++ /* if vfp is on, then save state for resumption */
++ if (fpexc & FPEXC_EN) {
++ printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
++ vfp_save_state(&ti->vfpstate, fpexc);
++
++ /* disable, just in case */
++ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
++ }
++
++ /* clear any information we had about last context state */
++ memset(last_VFP_context, 0, sizeof(last_VFP_context));
++
++ return 0;
++}
++
++static int vfp_pm_resume(struct sys_device *dev)
++{
++ /* ensure we have access to the vfp */
++ vfp_enable(NULL);
++
++ /* and disable it to ensure the next usage restores the state */
++ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
++
++ return 0;
++}
++
++static struct sysdev_class vfp_pm_sysclass = {
++ .name = "vfp",
++ .suspend = vfp_pm_suspend,
++ .resume = vfp_pm_resume,
++};
++
++static struct sys_device vfp_pm_sysdev = {
++ .cls = &vfp_pm_sysclass,
++};
++
++static void vfp_pm_init(void)
++{
++ sysdev_class_register(&vfp_pm_sysclass);
++ sysdev_register(&vfp_pm_sysdev);
++}
++
++
++#else
++static inline void vfp_pm_init(void) { }
++#endif /* CONFIG_PM */
++
+ #include <linux/smp.h>
+
+ /*
+@@ -365,6 +420,7 @@ static int __init vfp_init(void)
+ vfp_vector = vfp_support_entry;
+
+ thread_register_notifier(&vfp_notifier_block);
++ vfp_pm_init();
+
+ /*
+ * We detected VFP, and the support code is
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/02-vfp-ptrace.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/02-vfp-ptrace.patch
new file mode 100644
index 0000000000..feba206f95
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/02-vfp-ptrace.patch
@@ -0,0 +1,231 @@
+From: Catalin Marinas <catalin.marinas@arm.com>
+Date: Wed, 11 Feb 2009 11:12:56 +0000 (+0100)
+Subject: 5387/1: Add ptrace VFP support on ARM
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4dd5beb2244f15c895aba46474bd89545327d1a6
+
+5387/1: Add ptrace VFP support on ARM
+
+[ARM] 5387/1: Add ptrace VFP support on ARM
+
+This patch adds ptrace support for setting and getting the VFP registers
+using PTRACE_SETVFPREGS and PTRACE_GETVFPREGS. The user_vfp structure
+defined in asm/user.h contains 32 double registers (to cover VFPv3 and
+Neon hardware) and the FPSCR register.
+
+Cc: Paul Brook <paul@codesourcery.com>
+Cc: Daniel Jacobowitz <dan@codesourcery.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
+index 7319261..236a06b 100644
+--- a/arch/arm/include/asm/ptrace.h
++++ b/arch/arm/include/asm/ptrace.h
+@@ -27,6 +27,8 @@
+ /* PTRACE_SYSCALL is 24 */
+ #define PTRACE_GETCRUNCHREGS 25
+ #define PTRACE_SETCRUNCHREGS 26
++#define PTRACE_GETVFPREGS 27
++#define PTRACE_SETVFPREGS 28
+
+ /*
+ * PSR bits
+diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
+index 68b9ec8..b9dc8a8 100644
+--- a/arch/arm/include/asm/thread_info.h
++++ b/arch/arm/include/asm/thread_info.h
+@@ -113,6 +113,8 @@ extern void iwmmxt_task_restore(struct thread_info *, void *);
+ extern void iwmmxt_task_release(struct thread_info *);
+ extern void iwmmxt_task_switch(struct thread_info *);
+
++extern void vfp_sync_state(struct thread_info *thread);
++
+ #endif
+
+ /*
+diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
+index 825c1e7..df95e05 100644
+--- a/arch/arm/include/asm/user.h
++++ b/arch/arm/include/asm/user.h
+@@ -81,4 +81,13 @@ struct user{
+ #define HOST_TEXT_START_ADDR (u.start_code)
+ #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
++/*
++ * User specific VFP registers. If only VFPv2 is present, registers 16 to 31
++ * are ignored by the ptrace system call.
++ */
++struct user_vfp {
++ unsigned long long fpregs[32];
++ unsigned long fpscr;
++};
++
+ #endif /* _ARM_USER_H */
+diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
+index df653ea..89882a1 100644
+--- a/arch/arm/kernel/ptrace.c
++++ b/arch/arm/kernel/ptrace.c
+@@ -653,6 +653,54 @@ static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp)
+ }
+ #endif
+
++#ifdef CONFIG_VFP
++/*
++ * Get the child VFP state.
++ */
++static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
++{
++ struct thread_info *thread = task_thread_info(tsk);
++ union vfp_state *vfp = &thread->vfpstate;
++ struct user_vfp __user *ufp = data;
++
++ vfp_sync_state(thread);
++
++ /* copy the floating point registers */
++ if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
++ sizeof(vfp->hard.fpregs)))
++ return -EFAULT;
++
++ /* copy the status and control register */
++ if (put_user(vfp->hard.fpscr, &ufp->fpscr))
++ return -EFAULT;
++
++ return 0;
++}
++
++/*
++ * Set the child VFP state.
++ */
++static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
++{
++ struct thread_info *thread = task_thread_info(tsk);
++ union vfp_state *vfp = &thread->vfpstate;
++ struct user_vfp __user *ufp = data;
++
++ vfp_sync_state(thread);
++
++ /* copy the floating point registers */
++ if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
++ sizeof(vfp->hard.fpregs)))
++ return -EFAULT;
++
++ /* copy the status and control register */
++ if (get_user(vfp->hard.fpscr, &ufp->fpscr))
++ return -EFAULT;
++
++ return 0;
++}
++#endif
++
+ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
+ {
+ int ret;
+@@ -775,6 +823,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
+ break;
+ #endif
+
++#ifdef CONFIG_VFP
++ case PTRACE_GETVFPREGS:
++ ret = ptrace_getvfpregs(child, (void __user *)data);
++ break;
++
++ case PTRACE_SETVFPREGS:
++ ret = ptrace_setvfpregs(child, (void __user *)data);
++ break;
++#endif
++
+ default:
+ ret = ptrace_request(child, request, addr, data);
+ break;
+diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
+index 8de86e4..c8c98dd 100644
+--- a/arch/arm/vfp/vfp.h
++++ b/arch/arm/vfp/vfp.h
+@@ -377,6 +377,4 @@ struct op {
+ u32 flags;
+ };
+
+-#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ extern void vfp_save_state(void *location, u32 fpexc);
+-#endif
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index b21f43f..902d396 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -166,7 +166,6 @@ process_exception:
+ @ retry the faulted instruction
+ ENDPROC(vfp_support_entry)
+
+-#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ ENTRY(vfp_save_state)
+ @ Save the current VFP state
+ @ r0 - save location
+@@ -181,7 +180,6 @@ ENTRY(vfp_save_state)
+ stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2
+ mov pc, lr
+ ENDPROC(vfp_save_state)
+-#endif
+
+ last_VFP_context_address:
+ .word last_VFP_context
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 9f476a1..7e12390 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -377,6 +377,55 @@ static void vfp_pm_init(void)
+ static inline void vfp_pm_init(void) { }
+ #endif /* CONFIG_PM */
+
++/*
++ * Synchronise the hardware VFP state of a thread other than current with the
++ * saved one. This function is used by the ptrace mechanism.
++ */
++#ifdef CONFIG_SMP
++void vfp_sync_state(struct thread_info *thread)
++{
++ /*
++ * On SMP systems, the VFP state is automatically saved at every
++ * context switch. We mark the thread VFP state as belonging to a
++ * non-existent CPU so that the saved one will be reloaded when
++ * needed.
++ */
++ thread->vfpstate.hard.cpu = NR_CPUS;
++}
++#else
++void vfp_sync_state(struct thread_info *thread)
++{
++ unsigned int cpu = get_cpu();
++ u32 fpexc = fmrx(FPEXC);
++
++ /*
++ * If VFP is enabled, the previous state was already saved and
++ * last_VFP_context updated.
++ */
++ if (fpexc & FPEXC_EN)
++ goto out;
++
++ if (!last_VFP_context[cpu])
++ goto out;
++
++ /*
++ * Save the last VFP state on this CPU.
++ */
++ fmxr(FPEXC, fpexc | FPEXC_EN);
++ vfp_save_state(last_VFP_context[cpu], fpexc);
++ fmxr(FPEXC, fpexc);
++
++ /*
++ * Set the context to NULL to force a reload the next time the thread
++ * uses the VFP.
++ */
++ last_VFP_context[cpu] = NULL;
++
++out:
++ put_cpu();
++}
++#endif
++
+ #include <linux/smp.h>
+
+ /*
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/03-vfp-corruption.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/03-vfp-corruption.patch
new file mode 100644
index 0000000000..216d4f5eaa
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/03-vfp-corruption.patch
@@ -0,0 +1,136 @@
+From: George G. Davis <gdavis@mvista.com>
+Date: Wed, 1 Apr 2009 18:27:18 +0000 (+0100)
+Subject: 5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4f7720780dc4a298a6d59c0ec39f7687022cc36f
+
+5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+
+[ARM] 5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+
+We've observed that ARM VFP state can be corrupted during VFP exception
+handling when PREEMPT is enabled. The exact conditions are difficult
+to reproduce but appear to occur during VFP exception handling when a
+task causes a VFP exception which is handled via VFP_bounce and is then
+preempted by yet another task which in turn causes yet another VFP
+exception. Since the VFP_bounce code is not preempt safe, VFP state then
+becomes corrupt. In order to prevent preemption from occuring while
+handling a VFP exception, this patch disables preemption while handling
+VFP exceptions.
+
+Signed-off-by: George G. Davis <gdavis@mvista.com>
+Acked-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
+index ba592a9..a2bed62 100644
+--- a/arch/arm/vfp/entry.S
++++ b/arch/arm/vfp/entry.S
+@@ -15,13 +15,16 @@
+ * r10 = thread_info structure
+ * lr = failure return
+ */
+-#include <linux/linkage.h>
+-#include <linux/init.h>
+-#include <asm/asm-offsets.h>
+-#include <asm/assembler.h>
++#include <asm/thread_info.h>
+ #include <asm/vfpmacros.h>
++#include "../kernel/entry-header.S"
+
+ ENTRY(do_vfp)
++#ifdef CONFIG_PREEMPT
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ add r11, r4, #1 @ increment it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ enable_irq
+ ldr r4, .LCvfp
+ ldr r11, [r10, #TI_CPU] @ CPU number
+@@ -30,6 +33,12 @@ ENTRY(do_vfp)
+ ENDPROC(do_vfp)
+
+ ENTRY(vfp_null_entry)
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, lr
+ ENDPROC(vfp_null_entry)
+
+@@ -41,6 +50,12 @@ ENDPROC(vfp_null_entry)
+
+ __INIT
+ ENTRY(vfp_testing_entry)
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ ldr r0, VFP_arch_address
+ str r5, [r0] @ known non-zero value
+ mov pc, r9 @ we have handled the fault
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index 902d396..ea0a156 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -131,6 +131,12 @@ check_for_exception:
+ VFPFMXR FPEXC, r1 @ restore FPEXC last
+ sub r2, r2, #4
+ str r2, [sp, #S_PC] @ retry the instruction
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, r9 @ we think we have handled things
+
+
+@@ -149,6 +155,12 @@ look_for_VFP_exceptions:
+ @ not recognised by VFP
+
+ DBGSTR "not VFP"
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, lr
+
+ process_exception:
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 75457b3..01599c4 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -266,7 +266,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ * on VFP subarch 1.
+ */
+ vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs);
+- return;
++ goto exit;
+ }
+
+ /*
+@@ -297,7 +297,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1.
+ */
+ if (fpexc ^ (FPEXC_EX | FPEXC_FP2V))
+- return;
++ goto exit;
+
+ /*
+ * The barrier() here prevents fpinst2 being read
+@@ -310,6 +310,8 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs);
+ if (exceptions)
+ vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs);
++ exit:
++ preempt_enable();
+ }
+
+ static void vfp_enable(void *unused)
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/04-vfp-threads.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/04-vfp-threads.patch
new file mode 100644
index 0000000000..221b2774a1
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/04-vfp-threads.patch
@@ -0,0 +1,98 @@
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 1 Jul 2009 21:20:59 +0000 (+0300)
+Subject: So far vfp_sync_state worked only for threads other than the current one. This worked...
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=23671113997664ae55c8132fc4a56e676d5b46c7
+
+So far vfp_sync_state worked only for threads other than the current one. This worked for tracing other threads, but not for PTRACE_TRACEME. Syncing for the current thread will also be needed by an upcoming patch adding support for VFP context save / restore around signal handlers.
+
+For SMP we need get_cpu now, since we have to protect the FPEXC
+register, other than this things remained the same for threads other
+than the current.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 01599c4..969b77a 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -380,12 +380,19 @@ static inline void vfp_pm_init(void) { }
+ #endif /* CONFIG_PM */
+
+ /*
+- * Synchronise the hardware VFP state of a thread other than current with the
+- * saved one. This function is used by the ptrace mechanism.
++ * Synchronise the hardware VFP state of a thread with the saved one.
++ * This function is used by the ptrace mechanism and the signal handler path.
+ */
+-#ifdef CONFIG_SMP
+ void vfp_sync_state(struct thread_info *thread)
+ {
++ unsigned int cpu = get_cpu();
++ u32 fpexc = fmrx(FPEXC);
++ int vfp_enabled;
++ int self;
++
++ vfp_enabled = fpexc & FPEXC_EN;
++ self = thread == current_thread_info();
++#ifdef CONFIG_SMP
+ /*
+ * On SMP systems, the VFP state is automatically saved at every
+ * context switch. We mark the thread VFP state as belonging to a
+@@ -393,18 +400,22 @@ void vfp_sync_state(struct thread_info *thread)
+ * needed.
+ */
+ thread->vfpstate.hard.cpu = NR_CPUS;
+-}
+-#else
+-void vfp_sync_state(struct thread_info *thread)
+-{
+- unsigned int cpu = get_cpu();
+- u32 fpexc = fmrx(FPEXC);
+-
+ /*
+- * If VFP is enabled, the previous state was already saved and
+- * last_VFP_context updated.
++ * Only the current thread's saved VFP context can be out-of-date.
++ * For others there is nothing else to do, since we already ensured
++ * force loading above.
+ */
+- if (fpexc & FPEXC_EN)
++ if (!self)
++ goto out;
++#endif
++ /*
++ * If the VFP is enabled only the current thread's saved VFP
++ * context can get out-of-date. For other threads the context
++ * was updated when the current thread started to use the VFP.
++ * This also means that the context will be reloaded next time
++ * the thread uses the VFP, so no need to enforce it.
++ */
++ if (vfp_enabled && !self)
+ goto out;
+
+ if (!last_VFP_context[cpu])
+@@ -413,8 +424,14 @@ void vfp_sync_state(struct thread_info *thread)
+ /*
+ * Save the last VFP state on this CPU.
+ */
+- fmxr(FPEXC, fpexc | FPEXC_EN);
++ if (!vfp_enabled)
++ fmxr(FPEXC, fpexc | FPEXC_EN);
+ vfp_save_state(last_VFP_context[cpu], fpexc);
++ /*
++ * Disable VFP in case it was enabled so that the force reload
++ * can happen.
++ */
++ fpexc &= ~FPEXC_EN;
+ fmxr(FPEXC, fpexc);
+
+ /*
+@@ -426,7 +443,6 @@ void vfp_sync_state(struct thread_info *thread)
+ out:
+ put_cpu();
+ }
+-#endif
+
+ #include <linux/smp.h>
+
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/05-vfp-signal-handlers.patch b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/05-vfp-signal-handlers.patch
new file mode 100644
index 0000000000..f648188584
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot-2.6.29/vfp/05-vfp-signal-handlers.patch
@@ -0,0 +1,148 @@
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 1 Jul 2009 21:21:06 +0000 (+0300)
+Subject: Signal handlers can use floating point, so prevent them to corrupt the main thread...
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4daa6b5d833c401a9de6f136ea23daa971fc4fdc
+
+Signal handlers can use floating point, so prevent them to corrupt the main thread's VFP context. So far there were two signal stack frame formats defined based on the VFP implementation, but recently a new user struct was added for ptrace that covers all possibilities, so use it for the signal stack too.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+
+diff --git a/arch/arm/include/asm/ucontext.h b/arch/arm/include/asm/ucontext.h
+index bf65e9f..5534653 100644
+--- a/arch/arm/include/asm/ucontext.h
++++ b/arch/arm/include/asm/ucontext.h
+@@ -59,23 +59,19 @@ struct iwmmxt_sigframe {
+ #endif /* CONFIG_IWMMXT */
+
+ #ifdef CONFIG_VFP
+-#if __LINUX_ARM_ARCH__ < 6
+-/* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
+- * word after the registers, and a word of padding at the end for
+- * alignment. */
+ #define VFP_MAGIC 0x56465001
+-#define VFP_STORAGE_SIZE 152
+-#else
+-#define VFP_MAGIC 0x56465002
+-#define VFP_STORAGE_SIZE 144
+-#endif
+
+ struct vfp_sigframe
+ {
+ unsigned long magic;
+ unsigned long size;
+- union vfp_state storage;
+-};
++ struct user_vfp ufp;
++ unsigned long reserved;
++} __attribute__((__aligned__(8)));
++
++/* 8 byte for magic and size, 260 byte for ufp and 4 byte padding */
++#define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
++
+ #endif /* CONFIG_VFP */
+
+ /*
+@@ -91,7 +87,7 @@ struct aux_sigframe {
+ #ifdef CONFIG_IWMMXT
+ struct iwmmxt_sigframe iwmmxt;
+ #endif
+-#if 0 && defined CONFIG_VFP /* Not yet saved. */
++#ifdef CONFIG_VFP
+ struct vfp_sigframe vfp;
+ #endif
+ /* Something that isn't a valid magic number for any coprocessor. */
+diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
+index 80b8b5c..a5ef7f5 100644
+--- a/arch/arm/kernel/signal.c
++++ b/arch/arm/kernel/signal.c
+@@ -196,6 +196,67 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
+
+ #endif
+
++#ifdef CONFIG_VFP
++
++static int preserve_vfp_context(struct vfp_sigframe __user *frame)
++{
++ struct thread_info *thread = current_thread_info();
++ struct vfp_hard_struct *h = &thread->vfpstate.hard;
++ const unsigned long magic = VFP_MAGIC;
++ const unsigned long size = VFP_STORAGE_SIZE;
++ int err = 0;
++
++ vfp_sync_state(thread);
++ __put_user_error(magic, &frame->magic, err);
++ __put_user_error(size, &frame->size, err);
++
++ /*
++ * Copy the floating point registers. There can be unused
++ * registers see asm/hwcap.h for details.
++ */
++ err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs,
++ sizeof(h->fpregs));
++ /*
++ * Copy the status and control register.
++ */
++ __put_user_error(h->fpscr, &frame->ufp.fpscr, err);
++
++ return err ? -EFAULT : 0;
++}
++
++static int restore_vfp_context(struct vfp_sigframe __user *frame)
++{
++ struct thread_info *thread = current_thread_info();
++ struct vfp_hard_struct *h = &thread->vfpstate.hard;
++ unsigned long magic;
++ unsigned long size;
++ int err = 0;
++
++ vfp_sync_state(thread);
++ __get_user_error(magic, &frame->magic, err);
++ __get_user_error(size, &frame->size, err);
++
++ if (err)
++ return -EFAULT;
++ if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
++ return -EINVAL;
++
++ /*
++ * Copy the floating point registers. There can be unused
++ * registers see asm/hwcap.h for details.
++ */
++ err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs,
++ sizeof(h->fpregs));
++ /*
++ * Copy the status and control register.
++ */
++ __get_user_error(h->fpscr, &frame->ufp.fpscr, err);
++
++ return err ? -EFAULT : 0;
++}
++
++#endif
++
+ /*
+ * Do a signal return; undo the signal stack. These are aligned to 64-bit.
+ */
+@@ -254,8 +315,8 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
+ err |= restore_iwmmxt_context(&aux->iwmmxt);
+ #endif
+ #ifdef CONFIG_VFP
+-// if (err == 0)
+-// err |= vfp_restore_state(&sf->aux.vfp);
++ if (err == 0)
++ err |= restore_vfp_context(&aux->vfp);
+ #endif
+
+ return err;
+@@ -369,8 +430,8 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
+ err |= preserve_iwmmxt_context(&aux->iwmmxt);
+ #endif
+ #ifdef CONFIG_VFP
+-// if (err == 0)
+-// err |= vfp_save_state(&sf->aux.vfp);
++ if (err == 0)
++ err |= preserve_vfp_context(&aux->vfp);
+ #endif
+ __put_user_error(0, &aux->end_magic, err);
+
diff --git a/recipes/kexecboot/linux-kexecboot_2.6.29.bb b/recipes/kexecboot/linux-kexecboot_2.6.29.bb
new file mode 100644
index 0000000000..37fee558dd
--- /dev/null
+++ b/recipes/kexecboot/linux-kexecboot_2.6.29.bb
@@ -0,0 +1,171 @@
+require linux-kexecboot.inc
+
+COMPATIBLE_MACHINE = "omap5912osk|omap1710h3|omap2430sdp|omap2420h4|beagleboard|omap3evm|omap3-pandora|overo|omapzoom"
+
+SRCREV = "58cf2f1425abfd3a449f9fe985e48be2d2555022"
+
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
+PR_append = "+gitr${SRCREV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git;protocol=git \
+ file://defconfig"
+
+SRC_URI_append = " \
+ file://no-empty-flash-warnings.patch;patch=1 \
+ file://no-cortex-deadlock.patch;patch=1 \
+ file://read_die_ids.patch;patch=1 \
+ file://fix-install.patch;patch=1 \
+ file://dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch;patch=1 \
+ file://dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch;patch=1 \
+ file://dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch;patch=1 \
+ file://dss2/0004-DSS2-OMAP-framebuffer-driver.patch;patch=1 \
+ file://dss2/0005-DSS2-Add-panel-drivers.patch;patch=1 \
+ file://dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch;patch=1 \
+ file://dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch;patch=1 \
+ file://dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch;patch=1 \
+ file://dss2/0009-DSS2-Add-acx565akm-panel.patch;patch=1 \
+ file://dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch;patch=1 \
+ file://dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch;patch=1 \
+ file://dss2/0012-DSS2-Fix-DMA-rotation.patch;patch=1 \
+ file://dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch;patch=1 \
+ file://dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch;patch=1 \
+ file://dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch;patch=1 \
+ file://dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch;patch=1 \
+ file://dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch;patch=1 \
+ file://dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch;patch=1 \
+ file://dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch;patch=1 \
+ file://dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch;patch=1 \
+ file://dss2/0021-DSS2-Add-venc-register-dump.patch;patch=1 \
+ file://dss2/0022-DSS2-FB-remove-unused-var-warning.patch;patch=1 \
+ file://dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch;patch=1 \
+ file://dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch;patch=1 \
+ file://dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch;patch=1 \
+ file://dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch;patch=1 \
+ file://dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch;patch=1 \
+ file://dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch;patch=1 \
+ file://dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch;patch=1 \
+ file://dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch;patch=1 \
+ file://dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch;patch=1 \
+ file://dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch;patch=1 \
+ file://dss2/0033-DSS2-Prefer-3-tap-filter.patch;patch=1 \
+ file://dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch;patch=1 \
+ file://dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch;patch=1 \
+ file://dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch;patch=1 \
+ file://dss2/0037-DSS2-Added-support-for-querying-color-keying.patch;patch=1 \
+ file://dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch;patch=1 \
+ file://dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch;patch=1 \
+ file://dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch;patch=1 \
+ file://dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch;patch=1 \
+ file://dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch;patch=1 \
+ file://dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch;patch=1 \
+ file://dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch;patch=1 \
+ file://dss2/0045-DSS2-Fixed-line-endings-from-to.patch;patch=1 \
+ file://dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch;patch=1 \
+ file://dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch;patch=1 \
+ file://dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch;patch=1 \
+ file://dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch;patch=1 \
+ file://dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch;patch=1 \
+ file://dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch;patch=1 \
+ file://dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch;patch=1 \
+ file://dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch;patch=1 \
+ file://dss2/0054-DSS2-DSI-more-error-handling.patch;patch=1 \
+ file://dss2/0055-DSS2-Added-global-alpha-support.patch;patch=1 \
+ file://dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch;patch=1 \
+ file://dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch;patch=1 \
+ file://dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch;patch=1 \
+ file://dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch;patch=1 \
+ file://dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch;patch=1 \
+ file://dss2/0061-DSS2-VRFB-save-restore-context.patch;patch=1 \
+ file://dss2/0062-DSS2-VRAM-Fix-indentation.patch;patch=1 \
+ file://dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch;patch=1 \
+ file://dss2/0064-VRFB-fix-debug-messages.patch;patch=1 \
+ file://dss2/0065-VRFB-add-suspend-resume-functionality.patch;patch=1 \
+ file://dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch;patch=1 \
+ file://dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch;patch=1 \
+ file://dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch;patch=1 \
+ file://dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch;patch=1 \
+ file://dss2/0070-DSS2-fix-irq1.diff;patch=1 \
+ file://dss2/0071-DSS2-fix-irq2.diff;patch=1 \
+ file://0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch;patch=1 \
+ file://fix-unaligned-access.diff;patch=1 \
+ file://make-alignment-visible.diff;patch=1 \
+ file://mmctiming.patch;patch=1 \
+ file://ehci.patch;patch=1 \
+ file://fix-audio-capture.patch;patch=1 \
+ file://ads7846-detection.patch;patch=1 \
+ file://musb/0001-USB-musb-only-turn-off-vbus-in-OTG-hosts.patch;patch=1 \
+ file://musb/0002-USB-composite-avoid-inconsistent-lock-state.patch;patch=1 \
+ file://musb/0003-USB-musb-NAK-timeout-scheme-on-bulk-RX-endpoint.patch;patch=1 \
+ file://musb/0004-USB-musb-rewrite-host-periodic-endpoint-allocation.patch;patch=1 \
+ file://musb/0005-USB-TWL-disable-VUSB-regulators-when-cable-unplugg.patch;patch=1 \
+ file://musb/0006-USB-gadget-composite-device-level-suspend-resume-h.patch;patch=1 \
+ file://musb/0007-usb-gadget-fix-ethernet-link-reports-to-ethtool.patch;patch=1 \
+ file://musb/0008-usb-musb_host-minor-enqueue-locking-fix-v2.patch;patch=1 \
+ file://musb/0009-usb-musb_host-fix-ep0-fifo-flushing.patch;patch=1 \
+ file://musb/0010-musb-sanitize-clearing-TXCSR-DMA-bits-take-2.patch;patch=1 \
+ file://musb/0011-musb-fix-isochronous-TXDMA-take-2.patch;patch=1 \
+ file://musb/0012-musb-fix-possible-panic-while-resuming.patch;patch=1 \
+ file://musb/0013-musb_host-refactor-musb_save_toggle-take-2.patch;patch=1 \
+ file://musb/0014-musb_gadget-suppress-parasitic-TX-interrupts-with.patch;patch=1 \
+ file://musb/0015-musb_gadget-fix-unhandled-endpoint-0-IRQs.patch;patch=1 \
+ file://musb/0016-musb_host-factor-out-musb_ep_-get-set-_qh.patch;patch=1 \
+ file://musb/0017-musb_host-refactor-URB-giveback.patch;patch=1 \
+ file://musb/0018-musb-split-out-CPPI-interrupt-handler.patch;patch=1 \
+ file://musb/0019-musb_host-simplify-check-for-active-URB.patch;patch=1 \
+ file://musb/0020-musb_host-streamline-musb_cleanup_urb-calls.patch;patch=1 \
+ file://musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch;patch=1 \
+ file://musb/0022-musb-use-dma-mode-1-for-TX-if-transfer-size-equals.patch;patch=1 \
+ file://musb/0023-musb-add-high-bandwidth-ISO-support.patch;patch=1 \
+ file://musb/0024-USB-otg-adding-nop-usb-transceiver.patch;patch=1 \
+ file://musb/0025-nop-usb-xceiv-behave-when-linked-as-a-module.patch;patch=1 \
+ file://musb/0026-musb-proper-hookup-to-transceiver-drivers.patch;patch=1 \
+ file://musb/0027-musb-otg-timer-cleanup.patch;patch=1 \
+ file://musb/0028-musb-make-initial-HNP-roleswitch-work-v2.patch;patch=1 \
+ file://musb/0029-musb-support-disconnect-after-HNP-roleswitch.patch;patch=1 \
+ file://isp/v4l/0001-V4L2-Add-COLORFX-user-control.patch;patch=1 \
+ file://isp/v4l/0002-V4L-Int-if-v4l2_int_device_try_attach_all-requires.patch;patch=1 \
+ file://isp/v4l/0003-V4L-Int-if-Dummy-slave.patch;patch=1 \
+ file://isp/v4l/0004-V4L-int-device-add-support-for-VIDIOC_QUERYMENU.patch;patch=1 \
+ file://isp/v4l/0005-V4L-Int-if-Add-vidioc_int_querycap.patch;patch=1 \
+ file://isp/iommu/0001-omap-iommu-tlb-and-pagetable-primitives.patch;patch=1 \
+ file://isp/iommu/0002-omap-iommu-omap2-architecture-specific-functions.patch;patch=1 \
+ file://isp/iommu/0003-omap-iommu-omap3-iommu-device-registration.patch;patch=1 \
+ file://isp/iommu/0004-omap-iommu-simple-virtual-address-space-management.patch;patch=1 \
+ file://isp/iommu/0005-omap-iommu-entries-for-Kconfig-and-Makefile.patch;patch=1 \
+ file://isp/iommu/0006-omap-iommu-Don-t-try-BUG_ON-in_interrupt.patch;patch=1 \
+ file://isp/iommu/0007-omap-iommu-We-support-chained-scatterlists-probabl.patch;patch=1 \
+ file://isp/iommu/0008-omap2-iommu-entries-for-Kconfig-and-Makefile.patch;patch=1 \
+ file://isp/omap3camera/0001-omap3isp-Add-ISP-main-driver-and-register-definitio.patch;patch=1 \
+ file://isp/omap3camera/0002-omap3isp-Add-ISP-MMU-wrapper.patch;patch=1 \
+ file://isp/omap3camera/0003-omap3isp-Add-userspace-header.patch;patch=1 \
+ file://isp/omap3camera/0004-omap3isp-Add-ISP-frontend-CCDC.patch;patch=1 \
+ file://isp/omap3camera/0005-omap3isp-Add-ISP-backend-PRV-and-RSZ.patch;patch=1 \
+ file://isp/omap3camera/0006-omap3isp-Add-statistics-collection-modules-H3A-and.patch;patch=1 \
+ file://isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch;patch=1 \
+ file://isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch;patch=1 \
+ file://isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch;patch=1 \
+ file://isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch;patch=1 \
+ file://isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch;patch=1 \
+ file://isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch;patch=1 \
+ file://0124-leds-gpio-broken-with-current-git.patch;patch=1 \
+ file://modedb-hd720.patch;patch=1 \
+ file://0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch;patch=1 \
+ file://vfp/02-vfp-ptrace.patch;patch=1 \
+ file://vfp/03-vfp-corruption.patch;patch=1 \
+ file://vfp/04-vfp-threads.patch;patch=1 \
+ file://vfp/05-vfp-signal-handlers.patch;patch=1 \
+"
+
+
+SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
+ file://beagle-asoc.patch;patch=1 \
+ file://tincantools-puppy.diff;patch=1 \
+"
+
+SRC_URI_append_omap3evm = " \
+ file://evm-mcspi-ts.diff;patch=1 \
+"
+
+S = "${WORKDIR}/git"
+
+
diff --git a/recipes/lcd4linux/lcd4linux_0.10.0.bb b/recipes/lcd4linux/lcd4linux_0.10.0.bb
index fe73954fe5..7764f2b98b 100644
--- a/recipes/lcd4linux/lcd4linux_0.10.0.bb
+++ b/recipes/lcd4linux/lcd4linux_0.10.0.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "LCD4Linux is a small program that grabs information from the kernel and some subsystems and displays it on an external liquid crystal display."
LICENSE = "GPLv2"
-DEPENDS = "libusb-compat ncurses readline virtual/libx11"
+DEPENDS = "virtual/libusb0 ncurses readline virtual/libx11"
PV = "0.10.0+0.10.1-RC2"
PR = "r4"
diff --git a/recipes/lcd4linux/lcd4linux_0.11.0-SVN.bb b/recipes/lcd4linux/lcd4linux_0.11.0-SVN.bb
index 01471bdfc1..b105aea8c7 100644
--- a/recipes/lcd4linux/lcd4linux_0.11.0-SVN.bb
+++ b/recipes/lcd4linux/lcd4linux_0.11.0-SVN.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "LCD4Linux is a small program that grabs information from the kernel and some subsystems and displays it on an external liquid crystal display."
LICENSE = "GPLv2"
-DEPENDS = "libusb-compat ncurses readline virtual/libx11"
+DEPENDS = "virtual/libusb0 ncurses readline virtual/libx11"
PV = "0.11.0-SVN"
PR = "r0"
diff --git a/recipes/lcdproc/lcdproc5.inc b/recipes/lcdproc/lcdproc5.inc
index de704bcad0..8aeba901c6 100644
--- a/recipes/lcdproc/lcdproc5.inc
+++ b/recipes/lcdproc/lcdproc5.inc
@@ -4,7 +4,7 @@ HOMEPAGE = "http://lcdproc.org"
SECTION = "utils"
PRIORITY = "optional"
LICENSE = "GPL"
-DEPENDS = "libusb ncurses"
+DEPENDS = "virtual/libusb0 ncurses"
RRECOMMENDS_lcdproc = "lcdd"
SRC_URI = "${SOURCEFORGE_MIRROR}/lcdproc/${P}.tar.gz"
diff --git a/recipes/libdbi/libdbi-drivers.inc b/recipes/libdbi/libdbi-drivers.inc
new file mode 100644
index 0000000000..b5875eb893
--- /dev/null
+++ b/recipes/libdbi/libdbi-drivers.inc
@@ -0,0 +1,47 @@
+# libdbi-drivers OE build file
+# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+DESCRIPTION = "Database Drivers for libdbi"
+HOMEPAGE = "http://libdbi-drivers.sourceforge.net/"
+LICENSE = "LGPL"
+SECTION = "libs"
+
+PROVIDES = "libdbd-sqlite"
+DEPENDS = "libdbi sqlite sqlite3 mysql postgresql"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi-drivers/libdbi-drivers-${PV}.tar.gz"
+
+inherit autotools
+
+PACKAGES += "libdbd-sqlite3 libdbd-sqlite libdbd-pgsql libdbd-mysql"
+
+EXTRA_OECONF = "--with-dbi-incdir=${STAGING_INCDIR} \
+ --with-sqlite \
+ --with-sqlite3 \
+ --with-pgsql \
+ --with-mysql \
+ --with-sqlite-libdir=${STAGING_LIBDIR} \
+ --with-sqlite-incdir=${STAGING_INCDIR} \
+ --with-sqlite3-incdir=${STAGING_INCDIR} \
+ --with-sqlite3-libdir=${STAGING_LIBDIR} \
+ --with-mysql-incdir=${STAGING_INCDIR} \
+ --with-mysql-libdir=${STAGING_LIBDIR} \
+ --with-pgsql-incdir=${STAGING_INCDIR} \
+ --with-pgsql-libdir=${STAGING_LIBDIR}"
+
+FILES_${PN}-dbg += " ${libdir}/dbd/.debug/*.so"
+FILES_${PN}-dev += " ${libdir}/dbd/*.la ${libdir}/dbd/*.a"
+
+DESCRIPTION_libdbd-sqlite = "SQLite database driver for libdbi"
+FILES_libdbd-sqlite = "${libdir}/dbd/libdbdsqlite.so"
+
+DESCRIPTION_libdbd-sqlite3 = "SQLite3 database driver for libdbi"
+FILES_libdbd-sqlite3 = "${libdir}/dbd/libdbdsqlite3.so"
+
+DESCRIPTION_libdbd-mysql = "MySQL4 database driver for libdbi"
+FILES_libdbd-mysql = "${libdir}/dbd/libdbdmysql.so"
+
+DESCRIPTION_libdbd-psql = "Postgres SQL database driver for libdbi"
+FILES_libdbd-pgsql = "${libdir}/dbd/libdbdpgsql.so"
+
diff --git a/recipes/libdbi/libdbi-drivers_0.7.1.bb b/recipes/libdbi/libdbi-drivers_0.7.1.bb
deleted file mode 100644
index eea45ca4bb..0000000000
--- a/recipes/libdbi/libdbi-drivers_0.7.1.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-# libdbi-drivers OE build file
-# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-
-DESCRIPTION = "Database Drivers for libdbi"
-HOMEPAGE = "http://libdbi-drivers.sourceforge.net/"
-LICENSE = "GPLv2"
-SECTION = "libs"
-
-PROVIDES = "libdbd-sqlite"
-DEPENDS = "libdbi sqlite"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi-drivers/libdbi-drivers-${PV}.tar.gz"
-
-inherit autotools
-
-PACKAGES = "${PN}-dbg libdbd-sqlite ${PN}"
-
-EXTRA_OECONF = "--with-dbi-incdir=${STAGING_INCDIR} \
- --with-sqlite \
- --with-sqlite-libdir=${STAGING_LIBDIR} \
- --with-sqlite-incdir=${STAGING_INCDIR}"
-
-FILES_libdbd-sqlite = "/usr/lib/dbd/libsqlite.so \
- /usr/lib/dbd/libsqlite.la \
- /usr/lib/dbd/libsqlite.a"
-
-DESCRIPTION_libdbd-sqlite = "SQLite database driver for libdbi"
-
-do_configure_old () {
- ./configure \
- --build=${BUILD_SYS} \
- --host=${HOST_SYS} \
- --target=${TARGET_SYS} \
- --prefix=${prefix} \
- --with-sqlite \
- --with-sqlite-libdir=${STAGING_LIBDIR} \
- --with-sqlite-incdir=${STAGING_INCDIR}
-}
-
diff --git a/recipes/libdbi/libdbi-drivers_0.8.3-1.bb b/recipes/libdbi/libdbi-drivers_0.8.3-1.bb
new file mode 100644
index 0000000000..efbc61f5c0
--- /dev/null
+++ b/recipes/libdbi/libdbi-drivers_0.8.3-1.bb
@@ -0,0 +1,2 @@
+require ${PN}.inc
+LICENSE = "LGPL"
diff --git a/recipes/libdbi/libdbi.inc b/recipes/libdbi/libdbi.inc
new file mode 100644
index 0000000000..9d533d94b0
--- /dev/null
+++ b/recipes/libdbi/libdbi.inc
@@ -0,0 +1,22 @@
+# libdbi OE build file
+# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+DESCRIPTION = "Database Independent Abstraction Layer for C"
+HOMEPAGE = "http://libdbi.sourceforge.net/"
+LICENSE = "LGPL"
+SECTION = "libs"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi/libdbi-${PV}.tar.gz"
+
+inherit autotools
+
+do_stage () {
+ autotools_stage_includes
+ cd ./src/.libs/
+ oe_libinstall -so libdbi ${STAGING_LIBDIR}
+}
+
+do_configure () {
+ autotools_do_configure
+}
diff --git a/recipes/libdbi/libdbi_0.7.2.bb b/recipes/libdbi/libdbi_0.7.2.bb
index 8737890368..bd54419686 100644
--- a/recipes/libdbi/libdbi_0.7.2.bb
+++ b/recipes/libdbi/libdbi_0.7.2.bb
@@ -1,22 +1 @@
-# libdbi OE build file
-# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-
-DESCRIPTION = "Database Independent Abstraction Layer for C"
-HOMEPAGE = "http://libdbi.sourceforge.net/"
-LICENSE = "LGPL"
-SECTION = "libs"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi/libdbi-${PV}.tar.gz"
-
-inherit autotools
-
-do_stage () {
- autotools_stage_includes
- cd ./src/.libs/
- oe_libinstall -so libdbi ${STAGING_LIBDIR}
-}
-
-do_configure () {
- autotools_do_configure
-} \ No newline at end of file
+require ${PN}.inc
diff --git a/recipes/libdbi/libdbi_0.8.3.bb b/recipes/libdbi/libdbi_0.8.3.bb
new file mode 100644
index 0000000000..bd54419686
--- /dev/null
+++ b/recipes/libdbi/libdbi_0.8.3.bb
@@ -0,0 +1 @@
+require ${PN}.inc
diff --git a/recipes/libftdi/libftdi-native_0.13.bb b/recipes/libftdi/libftdi-native_0.13.bb
index 24f82778e5..e69e3202e5 100644
--- a/recipes/libftdi/libftdi-native_0.13.bb
+++ b/recipes/libftdi/libftdi-native_0.13.bb
@@ -2,4 +2,4 @@ require libftdi_${PV}.bb
inherit native
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
diff --git a/recipes/libftdi/libftdi-native_0.9.bb b/recipes/libftdi/libftdi-native_0.9.bb
index 24f82778e5..e69e3202e5 100644
--- a/recipes/libftdi/libftdi-native_0.9.bb
+++ b/recipes/libftdi/libftdi-native_0.9.bb
@@ -2,4 +2,4 @@ require libftdi_${PV}.bb
inherit native
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
diff --git a/recipes/libftdi/libftdi_0.13.bb b/recipes/libftdi/libftdi_0.13.bb
index 3e787ca512..b336454ef1 100644
--- a/recipes/libftdi/libftdi_0.13.bb
+++ b/recipes/libftdi/libftdi_0.13.bb
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.intra2net.com/de/produkte/opensource/ftdi/"
LICENSE = "LGPL"
SECTION = "libs"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
SRC_URI = "http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/libftdi-${PV}.tar.gz \
file://autotools.patch;patch=1 \
diff --git a/recipes/libftdi/libftdi_0.9.bb b/recipes/libftdi/libftdi_0.9.bb
index f7426ceb1a..a8cab451ab 100644
--- a/recipes/libftdi/libftdi_0.9.bb
+++ b/recipes/libftdi/libftdi_0.9.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "libftdi is a library (using libusb) to talk to FTDI's \
FT232BM, FT245BM and FT2232C type chips including the popular bitbang mode."
HOMEPAGE = "http://www.intra2net.com/de/produkte/opensource/ftdi"
LICENSE = "GPL"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
SRC_URI = "http://www.intra2net.com/de/produkte/opensource/ftdi/TGZ/libftdi-${PV}.tar.gz \
file://doxygen-configure.patch;patch=1"
diff --git a/recipes/libg15/libg15_1.2.1.bb b/recipes/libg15/libg15_1.2.1.bb
index 930cfe8640..85b02a3f9b 100644
--- a/recipes/libg15/libg15_1.2.1.bb
+++ b/recipes/libg15/libg15_1.2.1.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://g15tools.sourceforge.net"
LICENSE = "GPLv2"
SECTION = "libs"
PRIORITY = "optional"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
PR = "r3"
SRC_URI = "${SOURCEFORGE_MIRROR}/g15tools/libg15-${PV}.tar.bz2"
diff --git a/recipes/libgmime/files/configure-cross.patch b/recipes/libgmime/files/configure-cross.patch
new file mode 100644
index 0000000000..3b63d0b2e9
--- /dev/null
+++ b/recipes/libgmime/files/configure-cross.patch
@@ -0,0 +1,42 @@
+Index: gmime-2.2.23/configure.in
+===================================================================
+--- gmime-2.2.23.orig/configure.in 2008-09-14 15:28:35.000000000 +0000
++++ gmime-2.2.23/configure.in 2009-06-30 20:36:00.000000000 +0000
+@@ -169,14 +169,21 @@
+ LIBS_save="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+
+-AC_MSG_CHECKING(preferred charset formats for system iconv)
+-AC_TRY_RUN([
+-#define CONFIGURE_IN
+-#include "iconv-detect.c"
+-],[
+- AC_MSG_RESULT(found)
++AC_CACHE_CHECK([preferred charset formats for system iconv], [ac_cv_have_iconv_detect_h], [
++ AC_RUN_IFELSE([AC_LANG_SOURCE([
++ #define CONFIGURE_IN
++ #include "iconv-detect.c"
++ ])],
++ [ac_cv_have_iconv_detect_h=yes], [ac_cv_have_iconv_detect_h=no],
++ [
++ AC_MSG_RESULT([cannot run test program while cross compiling])
++ AC_MSG_ERROR([Please set ac_cv_have_iconv_detect_h to yes iconv-detect.h file.])
++ ])
++])
++if test "x$ac_cv_have_iconv_detect_h" = xyes; then
++ AC_MSG_RESULT([found])
+ AC_DEFINE(HAVE_ICONV_DETECT_H, 1, [Define to 1 to use auto-detected iconv-friendly charset names.])
+-],[
++else
+ AC_MSG_RESULT([not found
+ *** The iconv-detect program was unable to determine the
+ *** preferred charset formats recognized by your system
+@@ -186,7 +193,7 @@
+ ***
+ *** Default charset formats will be used.
+ ])
+-])
++fi
+
+ CFLAGS="$CFLAGS_save"
+ LIBS="$LIBS_save"
diff --git a/recipes/libgmime/files/iconv-detect.h b/recipes/libgmime/files/iconv-detect.h
new file mode 100644
index 0000000000..714cb5aa9d
--- /dev/null
+++ b/recipes/libgmime/files/iconv-detect.h
@@ -0,0 +1,5 @@
+/* This is an auto-generated header, DO NOT EDIT! */
+
+#define ICONV_ISO_INT_FORMAT "iso-%u-%u"
+#define ICONV_ISO_STR_FORMAT "iso-%u-%s"
+#define ICONV_10646 "iso-10646"
diff --git a/recipes/libgmime/libgmime-2.4_2.4.7.bb b/recipes/libgmime/libgmime-2.4_2.4.7.bb
new file mode 100644
index 0000000000..43b1c9c0a3
--- /dev/null
+++ b/recipes/libgmime/libgmime-2.4_2.4.7.bb
@@ -0,0 +1,15 @@
+LICENSE = "LGPL"
+DESCRIPTION = "Runtime libraries for parsing and creating MIME mail"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 zlib"
+SRC_URI = "http://ftp.acc.umu.se/pub/GNOME/sources/gmime/2.4/gmime-${PV}.tar.bz2 \
+ file://configure-cross.patch;patch=1 \
+ file://iconv-detect.h"
+EXTRA_OECONF += "--disable-mono"
+S = "${WORKDIR}/gmime-${PV}"
+
+inherit autotools_stage lib_package
+
+export ac_cv_have_iconv_detect_h=yes
+do_configure_append = "cp ${WORKDIR}/iconv-detect.h ${S}"
diff --git a/recipes/libgmime/libgmime_2.2.23.bb b/recipes/libgmime/libgmime_2.2.23.bb
new file mode 100644
index 0000000000..2f2d320dac
--- /dev/null
+++ b/recipes/libgmime/libgmime_2.2.23.bb
@@ -0,0 +1,20 @@
+LICENSE = "LGPL"
+DESCRIPTION = "Runtime libraries for parsing and creating MIME mail"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 zlib"
+SRC_URI = "http://ftp.acc.umu.se/pub/GNOME/sources/gmime/2.2/gmime-${PV}.tar.bz2 \
+ file://configure-cross.patch;patch=1 \
+ file://iconv-detect.h"
+EXTRA_OECONF += "--disable-mono"
+S = "${WORKDIR}/gmime-${PV}"
+
+inherit autotools_stage lib_package binconfig
+
+export ac_cv_have_iconv_detect_h=yes
+do_configure_append = "cp ${WORKDIR}/iconv-detect.h ${S}"
+
+# we do not need GNOME 1 gnome-config support
+do_install_append () {
+ rm -f ${D}${libdir}/gmimeConf.sh
+}
diff --git a/recipes/libgpg-error/libgpg-error.inc b/recipes/libgpg-error/libgpg-error.inc
index 6fcc9202b2..400c1668a6 100644
--- a/recipes/libgpg-error/libgpg-error.inc
+++ b/recipes/libgpg-error/libgpg-error.inc
@@ -8,6 +8,8 @@ DEPENDS += "virtual/libiconv"
SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-${PV}.tar.gz \
file://pkgconfig.patch;patch=1"
+INC_PR = "r6"
+
# move libgpg-error-config into -dev package
FILES_${PN} = "${libdir}/lib*.so.*"
FILES_${PN}-dev += "${bindir}/*"
diff --git a/recipes/libgpg-error/libgpg-error_0.6.bb b/recipes/libgpg-error/libgpg-error_0.6.bb
index 4929121167..69577e003a 100644
--- a/recipes/libgpg-error/libgpg-error_0.6.bb
+++ b/recipes/libgpg-error/libgpg-error_0.6.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "GPG-Error library"
SECTION = "libs"
PRIORITY = "optional"
LICENSE = "GPL LGPL FDL"
-PR = "r1"
+PR = "${INC_PR}.1"
SRC_URI = "ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/libgpg-error-${PV}.tar.gz"
diff --git a/recipes/libgpg-error/libgpg-error_0.7.bb b/recipes/libgpg-error/libgpg-error_0.7.bb
index 0f28ed00d4..526a2a401b 100644
--- a/recipes/libgpg-error/libgpg-error_0.7.bb
+++ b/recipes/libgpg-error/libgpg-error_0.7.bb
@@ -1,6 +1,6 @@
require libgpg-error.inc
-PR = "r5"
+PR = "${INC_PR}.1"
SRC_URI = "ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/libgpg-error-${PV}.tar.gz \
file://pkgconfig.patch;patch=1"
diff --git a/recipes/libgpg-error/libgpg-error_1.0.bb b/recipes/libgpg-error/libgpg-error_1.0.bb
index b81d4b9da7..6e7c0e6adb 100644
--- a/recipes/libgpg-error/libgpg-error_1.0.bb
+++ b/recipes/libgpg-error/libgpg-error_1.0.bb
@@ -1,3 +1,3 @@
require libgpg-error.inc
-PR = "r2"
+PR = "${INC_PR}.1"
diff --git a/recipes/libgpg-error/libgpg-error_1.3.bb b/recipes/libgpg-error/libgpg-error_1.3.bb
index b81d4b9da7..6e7c0e6adb 100644
--- a/recipes/libgpg-error/libgpg-error_1.3.bb
+++ b/recipes/libgpg-error/libgpg-error_1.3.bb
@@ -1,3 +1,3 @@
require libgpg-error.inc
-PR = "r2"
+PR = "${INC_PR}.1"
diff --git a/recipes/libgpg-error/libgpg-error_1.4.bb b/recipes/libgpg-error/libgpg-error_1.4.bb
index b81d4b9da7..6e7c0e6adb 100644
--- a/recipes/libgpg-error/libgpg-error_1.4.bb
+++ b/recipes/libgpg-error/libgpg-error_1.4.bb
@@ -1,3 +1,3 @@
require libgpg-error.inc
-PR = "r2"
+PR = "${INC_PR}.1"
diff --git a/recipes/libgphoto2/libgphoto2_2.4.0.bb b/recipes/libgphoto2/libgphoto2_2.4.0.bb
index c6f63374cc..ca51f98e64 100644
--- a/recipes/libgphoto2/libgphoto2_2.4.0.bb
+++ b/recipes/libgphoto2/libgphoto2_2.4.0.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "libgphoto2 allows you to access digital cameras"
SECTION = "libs"
LICENSE = "GPL"
-DEPENDS = "libtool jpeg libusb libexif"
+DEPENDS = "libtool jpeg virtual/libusb0 libexif"
PR = "r0"
diff --git a/recipes/libmrss/libmrss.inc b/recipes/libmrss/libmrss.inc
new file mode 100644
index 0000000000..de4b705502
--- /dev/null
+++ b/recipes/libmrss/libmrss.inc
@@ -0,0 +1,15 @@
+DESCRIPTION = "mRSS is a C library for parsing, writing and creating RSS (0.91, 0.92, 1.0, 2.0) files or streams"
+LICENSE = "LGPL"
+HOMEPAGE = "http://www.autistici.org/bakunin/libmrss/"
+
+DEPENDS = "libnxml curl"
+INC_PR = "r1"
+
+inherit autotools pkgconfig
+
+SRC_URI = "http://www.autistici.org/bakunin/libmrss/libmrss-${PV}.tar.gz \
+ "
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/libmrss/libmrss_0.17.2.bb b/recipes/libmrss/libmrss_0.17.2.bb
index f536468479..38fb2997b0 100644
--- a/recipes/libmrss/libmrss_0.17.2.bb
+++ b/recipes/libmrss/libmrss_0.17.2.bb
@@ -1,15 +1,6 @@
-DESCRIPTION = "mRSS is a C library for parsing, writing and creating RSS (0.91, 0.92, 1.0, 2.0) files or streams"
-LICENSE = "LGPL"
-HOMEPAGE = "http://www2.autistici.org/bakunin/codes.php"
+require libmrss.inc
-DEPENDS = "libnxml curl"
-PR = "r1"
+PR = "${INC_PR}.2"
-inherit autotools pkgconfig
+SRC_URI += "file://better-parse-url-r0.patch;patch=1"
-SRC_URI = "http://www2.autistici.org/bakunin/libmrss/libmrss-${PV}.tar.gz \
- file://better-parse-url-r0.patch;patch=1 "
-
-do_stage() {
- autotools_stage_all
-}
diff --git a/recipes/libmrss/libmrss_0.19.2.bb b/recipes/libmrss/libmrss_0.19.2.bb
new file mode 100644
index 0000000000..ce978432b6
--- /dev/null
+++ b/recipes/libmrss/libmrss_0.19.2.bb
@@ -0,0 +1,7 @@
+require libmrss.inc
+
+# this version misses the patch applied to 0.17.2 - needs patch rebase
+DEFAULT_PREFERENCE = "-1"
+
+PR = "${INC_PR}.1"
+
diff --git a/recipes/libnxml/libnxml.inc b/recipes/libnxml/libnxml.inc
new file mode 100644
index 0000000000..7a777dab1a
--- /dev/null
+++ b/recipes/libnxml/libnxml.inc
@@ -0,0 +1,15 @@
+HOMEPAGE = "http://www2.autistici.org/bakunin/codes.php"
+DESCRIPTION = "nXML is a C library for parsing, writing and creating XML 1.0 and 1.1 files or streams. It supports utf-8, utf-16be and utf-16le, ucs-4 (1234, 4321, 2143, 2312)"
+LICENSE = "LGPL"
+
+DEPENDS = "curl"
+
+INC_PR = "r0"
+
+inherit autotools pkgconfig
+
+SRC_URI = "http://www.autistici.org/bakunin/libnxml/libnxml-${PV}.tar.gz"
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/libnxml/libnxml_0.16.bb b/recipes/libnxml/libnxml_0.16.bb
index 6f836d226d..b233795023 100644
--- a/recipes/libnxml/libnxml_0.16.bb
+++ b/recipes/libnxml/libnxml_0.16.bb
@@ -1,14 +1,4 @@
-HOMEPAGE = "http://www2.autistici.org/bakunin/codes.php"
-DESCRIPTION = "nXML is a C library for parsing, writing and creating XML 1.0 and 1.1 files or streams. It supports utf-8, utf-16be and utf-16le, ucs-4 (1234, 4321, 2143, 2312)"
-LICENSE = "LGPL"
+require libnxml.inc
-DEPENDS = "curl"
+PR = "${INC_PR}.0"
-inherit autotools pkgconfig
-
-SRC_URI = "http://www2.autistici.org/bakunin/libnxml/libnxml-${PV}.tar.gz"
-
-
-do_stage() {
- autotools_stage_all
-}
diff --git a/recipes/libnxml/libnxml_0.18.3.bb b/recipes/libnxml/libnxml_0.18.3.bb
new file mode 100644
index 0000000000..b233795023
--- /dev/null
+++ b/recipes/libnxml/libnxml_0.18.3.bb
@@ -0,0 +1,4 @@
+require libnxml.inc
+
+PR = "${INC_PR}.0"
+
diff --git a/recipes/libopie/libopie2_cvs.bb b/recipes/libopie/libopie2_cvs.bb
index c9f11b23e2..427f83b786 100644
--- a/recipes/libopie/libopie2_cvs.bb
+++ b/recipes/libopie/libopie2_cvs.bb
@@ -1,17 +1,18 @@
require ${PN}.inc
PV = "${OPIE_CVS_PV}"
-PR = "r12"
+PR = "r13"
DEFAULT_PREFERENCE = "-1"
SRC_URI = "${HANDHELDS_CVS};module=opie/libopie2 \
- file://c7x0_w100_disable.patch;patch=1 \
file://include.pro"
-# Patches merged upstream, keep for reference (for 1.2.2)
-# file://ipaq-lcd-rotate-cleanup.patch;patch=1 \
-# file://exports.patch;patch=1 \
-# file://wireless.patch;patch=1"
-
+# FIXME remove this!
SRC_URI_append_poodle = " file://poodle-2.6-hotkeys.patch;patch=1"
+
+do_stage_append() {
+ # special case for uic-created header files
+ install -m 0644 opiepim/ui/opimalarmdlgbase.h ${STAGING_INCDIR}/opie2/
+}
+
diff --git a/recipes/libqpe/libqpe-opie_cvs.bb b/recipes/libqpe/libqpe-opie_cvs.bb
index d3b17ac7ee..49c1a934e3 100644
--- a/recipes/libqpe/libqpe-opie_cvs.bb
+++ b/recipes/libqpe/libqpe-opie_cvs.bb
@@ -1,11 +1,11 @@
require ${PN}.inc
PV = "${OPIE_CVS_PV}"
-PR = "r5"
+PR = "r6"
SRC_URI = "${HANDHELDS_CVS};module=opie/library \
file://fix-titleheight.patch;patch=1 \
file://unbreak-logging.patch;patch=1 \
file://citytime-path-2.patch;patch=1 \
+ file://no-include-pro.patch;patch=1 \
"
-
diff --git a/recipes/librfid/librfid_svn.bb b/recipes/librfid/librfid_svn.bb
index 78800de3eb..f687985c79 100644
--- a/recipes/librfid/librfid_svn.bb
+++ b/recipes/librfid/librfid_svn.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "RFID library"
SECTION = "devel"
PRIORITY = "optional"
LICENSE = "GPL"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
SRCNAME = "librfid"
PV = "0.2.0+svnr${SRCREV}"
diff --git a/recipes/libsndfile/libsndfile1_1.0.20.bb b/recipes/libsndfile/libsndfile1_1.0.20.bb
index 2562271af2..1458b7acfa 100644
--- a/recipes/libsndfile/libsndfile1_1.0.20.bb
+++ b/recipes/libsndfile/libsndfile1_1.0.20.bb
@@ -3,6 +3,9 @@ HOMEPAGE = "http://www.mega-nerd.com/libsndfile"
AUTHOR = "Erik de Castro Lopo"
SECTION = "libs/multimedia"
LICENSE = "LGPL"
+DEPENDS = "sqlite3"
+PR = "r1"
+
SRC_URI = "http://www.mega-nerd.com/libsndfile/libsndfile-${PV}.tar.gz \
"
@@ -17,5 +20,13 @@ do_configure_prepend_arm() {
ac_cv_sizeof_off_t=8
}
+do_configure_prepend_chinook-compat () {
+
+ for i in lt~obsolete.m4 ltsugar.m4 libtool.m4 ltoptions.m4 ltversion.m4
+ do
+ rm ${S}/M4/${i}
+ done
+}
+
PACKAGES =+ "${PN}-octave"
FILES_${PN}-octave += "/usr/share/octave/site/m"
diff --git a/recipes/libtool/libtool-2.2.6a/cross_compile.patch b/recipes/libtool/libtool-2.2.6a/cross_compile.patch
new file mode 100644
index 0000000000..b4bacbd12f
--- /dev/null
+++ b/recipes/libtool/libtool-2.2.6a/cross_compile.patch
@@ -0,0 +1,55 @@
+Tweaks to make cross-compiling work combined and updated from various
+older patches, some by Chris Larson.
+Not upstreable in this form.
+
+RP - 01/05/2008
+
+Index: libtool-2.2.2/libltdl/config/ltmain.m4sh
+===================================================================
+--- libtool-2.2.2.orig/libltdl/config/ltmain.m4sh 2008-05-01 21:48:42.000000000 +0100
++++ libtool-2.2.2/libltdl/config/ltmain.m4sh 2008-05-01 21:51:41.000000000 +0100
+@@ -4454,8 +4454,14 @@
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+- dir="$libdir"
+- absdir="$libdir"
++ # Adding 'libdir' from the .la file to our library search paths
++ # breaks crosscompilation horribly. We cheat here and don't add
++ # it, instead adding the path where we found the .la. -CL
++ dir="$abs_ladir"
++ absdir="$abs_ladir"
++ libdir="$abs_ladir"
++ #dir="$libdir"
++ #absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+@@ -4825,8 +4831,6 @@
+ add="$libdir/$linklib"
+ fi
+ else
+- # We cannot seem to hardcode it, guess we'll fake it.
+- add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+@@ -4972,7 +4976,17 @@
+ fi
+ ;;
+ *)
+- path="-L$absdir/$objdir"
++ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
++ # preferring $objdir. RP 31/04/2008
++ if test -f "$absdir/$objdir/$depdepl" ; then
++ depdepl="$absdir/$objdir/$depdepl"
++ path="-L$absdir/$objdir"
++ elif test -f "$absdir/$depdepl" ; then
++ depdepl="$absdir/$depdepl"
++ path="-L$absdir"
++ else
++ path="-L$absdir/$objdir"
++ fi
+ ;;
+ esac
+ else
diff --git a/recipes/libtool/libtool-2.2.6a/prefix.patch b/recipes/libtool/libtool-2.2.6a/prefix.patch
new file mode 100644
index 0000000000..639feb7456
--- /dev/null
+++ b/recipes/libtool/libtool-2.2.6a/prefix.patch
@@ -0,0 +1,103 @@
+Renames "libtool" -> "${TARGET_PREFIX}libtool" which makes sure
+it can't be confused with the host libtool.
+
+Index: libtool-2.2.2/libltdl/m4/libtool.m4
+===================================================================
+--- libtool-2.2.2.orig/libltdl/m4/libtool.m4 2008-04-13 22:43:05.000000000 +0100
++++ libtool-2.2.2/libltdl/m4/libtool.m4 2008-04-13 22:43:05.000000000 +0100
+@@ -89,7 +89,8 @@
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/$host_alias-libtool"
+ AC_SUBST(LIBTOOL)dnl
+
+ _LT_SETUP
+@@ -211,7 +212,7 @@
+ no_glob_subst='s/\*/\\\*/g'
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+Index: libtool-2.2.2/Makefile.am
+===================================================================
+--- libtool-2.2.2.orig/Makefile.am 2008-04-01 19:06:08.000000000 +0100
++++ libtool-2.2.2/Makefile.am 2008-04-13 22:49:17.000000000 +0100
+@@ -31,7 +31,7 @@
+ DIST_SUBDIRS = .
+ EXTRA_DIST =
+
+-BUILT_SOURCES = libtool
++BUILT_SOURCES = $(host_alias)-libtool
+
+ CLEANFILES =
+ MOSTLYCLEANFILES =
+@@ -64,7 +64,7 @@
+ ## ---------------- ##
+
+ # The libtool distributor and the standalone libtool script.
+-bin_SCRIPTS = libtoolize libtool
++bin_SCRIPTS = libtoolize $(host_alias)-libtool
+
+ libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
+ rm -f libtoolize.tmp libtoolize
+@@ -90,8 +90,8 @@
+ # We used to do this with a 'stamp-vcl' file, but non-gmake builds
+ # would rerun configure on every invocation, so now we manually
+ # check the version numbers from the build rule when necessary.
+-libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh ChangeLog
+- @target=libtool; $(rebuild); \
++$(host_alias)-libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh ChangeLog
++ @target=$(host_alias)-libtool; $(rebuild); \
+ if test -f "$$target"; then \
+ set dummy `./$$target --version | sed 1q`; actualver="$$5"; \
+ test "$$actualver" = "$$correctver" && rebuild=false; \
+@@ -100,8 +100,8 @@
+ case $$prereq in *ChangeLog);; *) rebuild=:;; esac; \
+ done; \
+ if $$rebuild; then \
+- echo $(SHELL) ./config.status $$target; \
+- cd $(top_builddir) && $(SHELL) ./config.status $$target; \
++ echo $(SHELL) ./config.status libtool; \
++ cd $(top_builddir) && $(SHELL) ./config.status libtool; \
+ fi
+
+ .PHONY: configure-subdirs
+@@ -145,7 +145,7 @@
+ ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \
+ ChangeLog.2002 ChangeLog.2003 ChangeLog.2004 \
+ ChangeLog.2005 ChangeLog.2006 ChangeLog.2007
+-CLEANFILES += libtool libtoolize libtoolize.tmp \
++CLEANFILES += $(host_alias)-libtool libtoolize libtoolize.tmp \
+ $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
+
+ ## We build ltversion.m4 here, instead of from config.status,
+@@ -483,12 +483,12 @@
+
+ BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
+ LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
+- LIBTOOL="$(abs_top_builddir)/libtool" \
++ LIBTOOL="$(abs_top_builddir)/$(host_alias)-libtool" \
+ tst_aclocaldir="$(abs_top_srcdir)/libltdl/m4"
+
+ INSTALLCHECK_ENVIRONMENT = \
+ LIBTOOLIZE="$(bindir)/`echo libtoolize | sed '$(program_transform_name)'`" \
+- LIBTOOL="$(bindir)/`echo libtool | sed '$(program_transform_name)'`" \
++ LIBTOOL="$(bindir)/`echo $(host_alias)-libtool | sed '$(program_transform_name)'`" \
+ LTDLINCL="-I$(includedir)" \
+ LIBLTDL="$(libdir)/libltdl.la" \
+ tst_aclocaldir="$(aclocaldir)"
+@@ -620,7 +620,7 @@
+ TESTS += $(FC_TESTS)
+ endif
+
+-tests/demo-conf.test: libtool
++tests/demo-conf.test: $(host_alias)-libtool
+
+ EXTRA_DIST += $(srcdir)/tests/defs.in tests/defs.m4sh \
+ $(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS) $(FC_TESTS)
diff --git a/recipes/libtool/libtool-cross_2.2.4.bb b/recipes/libtool/libtool-cross_2.2.4.bb
index fab8aa4d42..dd8b598fde 100644
--- a/recipes/libtool/libtool-cross_2.2.4.bb
+++ b/recipes/libtool/libtool-cross_2.2.4.bb
@@ -1,6 +1,6 @@
require libtool.inc
require libtool_${PV}.bb
-PR = "r23"
+PR = "r24"
SRC_URI += "\
file://cross_compile.patch;patch=1 \
@@ -22,6 +22,11 @@ prefix = "${STAGING_DIR_NATIVE}${layout_prefix}"
exec_prefix = "${STAGING_DIR_NATIVE}${layout_exec_prefix}"
bindir = "${STAGING_BINDIR_NATIVE}"
+# skip ac_cv_... setting for cross build: host paths must be used
+do_configure_prepend () {
+ export LIBTOOL_BB_DO_NOT_SET_PATHS=1
+}
+
do_compile () {
:
}
diff --git a/recipes/libtool/libtool-cross_2.2.6a.bb b/recipes/libtool/libtool-cross_2.2.6a.bb
new file mode 100644
index 0000000000..1b2defb43f
--- /dev/null
+++ b/recipes/libtool/libtool-cross_2.2.6a.bb
@@ -0,0 +1,50 @@
+require libtool.inc
+require libtool_${PV}.bb
+PR = "r1"
+
+SRC_URI += "\
+ file://cross_compile.patch;patch=1 \
+ file://prefix.patch;patch=1 \
+"
+
+DEPENDS += "libtool-native"
+
+DOLT_PATCH = ""
+DOLT_PATCH_arm = " file://add_dolt.patch;patch=1"
+DOLT_PATCH_i586 = " file://add_dolt.patch;patch=1"
+
+#SRC_URI_append_linux = "${DOLT_PATCH}"
+#SRC_URI_append_linux-gnueabi = "${DOLT_PATCH}"
+
+prefix = "${STAGING_DIR_NATIVE}${layout_prefix}"
+exec_prefix = "${STAGING_DIR_NATIVE}${layout_exec_prefix}"
+bindir = "${STAGING_BINDIR_NATIVE}"
+
+# skip ac_cv_... setting for cross build: host paths must be used
+do_configure_prepend () {
+ export LIBTOOL_BB_DO_NOT_SET_PATHS=1
+}
+
+do_compile () {
+ :
+}
+
+do_stage () {
+ install -m 0755 ${HOST_SYS}-libtool ${bindir}/${HOST_SYS}-libtool
+ install -d ${STAGING_DATADIR}/libtool ${STAGING_DATADIR}/aclocal
+ install -c ${S}/libltdl/config/config.guess ${STAGING_DATADIR}/libtool/
+ install -c ${S}/libltdl/config/config.sub ${STAGING_DATADIR}/libtool/
+ install -c -m 0644 ${S}/libltdl/config/ltmain.sh ${STAGING_DATADIR}/libtool/
+ install -c -m 0644 ${S}/libltdl/m4/libtool.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltdl.m4 ${STAGING_DATADIR}/aclocal/
+ if [ -e ${WORKDIR}/dolt.m4 ] ; then
+ install -c -m 0644 ${WORKDIR}/dolt.m4 ${STAGING_DATADIR}/aclocal/
+ fi
+}
+
+
+do_install () {
+ :
+}
+
+PACKAGES = ""
diff --git a/recipes/libtool/libtool-native_2.2.6a.bb b/recipes/libtool/libtool-native_2.2.6a.bb
new file mode 100644
index 0000000000..c5a4a99db0
--- /dev/null
+++ b/recipes/libtool/libtool-native_2.2.6a.bb
@@ -0,0 +1,46 @@
+require libtool.inc
+require libtool_${PV}.bb
+PR = "r0"
+
+SRC_URI += "\
+ file://cross_compile.patch;patch=1 \
+ file://prefix.patch;patch=1 \
+"
+
+inherit native
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_stage () {
+ install -m 0755 ${HOST_SYS}-libtool ${STAGING_BINDIR}/${HOST_SYS}-libtool
+ install -m 0755 libtoolize ${STAGING_BINDIR}/libtoolize
+ oe_libinstall -a -so -C libltdl libltdl ${STAGING_LIBDIR}
+ install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/
+ install -d ${STAGING_INCDIR}/libltdl/
+ install -m 0644 libltdl/libltdl/*.h ${STAGING_INCDIR}/libltdl/
+ install -d ${STAGING_DATADIR}/libtool/config/ ${STAGING_DATADIR}/aclocal/
+ install -c ${S}/libltdl/config/config.guess ${STAGING_DATADIR}/libtool/
+ install -c ${S}/libltdl/config/config.sub ${STAGING_DATADIR}/libtool/
+ for i in config.guess config.sub compile depcomp general.m4sh getopt.m4sh install-sh ltmain.m4sh ltmain.sh mdate-sh missing mkstamp ; do \
+ install -c -m 0644 ${S}/libltdl/config/$i ${STAGING_DATADIR}/libtool/config/
+ done
+ install -c -m 0644 ${S}/libltdl/m4/libtool.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltdl.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltoptions.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltversion.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltsugar.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/lt~obsolete.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/argz.m4 ${STAGING_DATADIR}/aclocal/
+
+ install -d ${STAGING_DATADIR}/libtool/libltdl
+ cp -pfPr ${S}/libltdl/* ${STAGING_DATADIR}/libtool/libltdl/
+}
+
+do_install () {
+ :
+}
diff --git a/recipes/libtool/libtool-sdk_2.2.4.bb b/recipes/libtool/libtool-sdk_2.2.4.bb
index e92c4dbfaf..f2c3c628b0 100644
--- a/recipes/libtool/libtool-sdk_2.2.4.bb
+++ b/recipes/libtool/libtool-sdk_2.2.4.bb
@@ -1,7 +1,7 @@
require libtool.inc
require libtool_${PV}.bb
-PR = "r1"
+PR = "r2"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/libtool-${PV}"
SRC_URI_append = " file://cross_compile.patch;patch=1"
@@ -9,6 +9,11 @@ S = "${WORKDIR}/libtool-${PV}"
inherit sdk
+# skip ac_cv_... setting for cross build: host paths must be used
+do_configure_prepend () {
+ export LIBTOOL_BB_DO_NOT_SET_PATHS=1
+}
+
do_install () {
install -d ${D}${bindir}/
install -m 0755 libtool ${D}${bindir}/
diff --git a/recipes/libtool/libtool-sdk_2.2.6a.bb b/recipes/libtool/libtool-sdk_2.2.6a.bb
new file mode 100644
index 0000000000..88ec4df8c0
--- /dev/null
+++ b/recipes/libtool/libtool-sdk_2.2.6a.bb
@@ -0,0 +1,60 @@
+require libtool.inc
+require libtool_${PV}.bb
+
+PR = "r1"
+SRC_URI_append = " file://cross_compile.patch;patch=1"
+
+inherit sdk
+
+# skip ac_cv_... setting for cross build: host paths must be used
+do_configure_prepend () {
+ export LIBTOOL_BB_DO_NOT_SET_PATHS=1
+}
+
+do_install () {
+ install -d ${D}${bindir}/
+ install -m 0755 libtool ${D}${bindir}/
+ install -m 0755 libtoolize ${D}${bindir}/
+
+ install -d ${D}${libdir}/
+ oe_libinstall -a -so -C libltdl libltdl ${D}${libdir}
+
+ install -d ${D}${includedir}/
+ install -m 0644 libltdl/ltdl.h ${D}${includedir}
+
+ install -d ${D}${datadir}/libtool/config/
+ install -c ${S}/libltdl/config/config.guess ${D}${datadir}/libtool/
+ install -c ${S}/libltdl/config/config.sub ${D}${datadir}/libtool/
+ install -c -m 0644 ${S}/libltdl/config/ltmain.sh ${D}${datadir}/libtool/config/
+
+ install -d ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/libtool.m4 ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltdl.m4 ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltoptions.m4 ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltversion.m4 ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltsugar.m4 ${D}${datadir}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/lt~obsolete.m4 ${D}${datadir}/aclocal/
+}
+
+do_stage () {
+ install -d ${STAGING_BINDIR}/
+ install -m 0755 libtool ${STAGING_BINDIR}/${HOST_SYS}-libtool
+ install -m 0755 libtoolize ${STAGING_BINDIR}/libtoolize
+
+ oe_libinstall -a -so -C libltdl libltdl ${STAGING_LIBDIR}
+ install -d ${STAGING_INCDIR}
+ install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/
+
+ install -d ${STAGING_DATADIR}/libtool/config/
+ install -c ${S}/libltdl/config/config.guess ${STAGING_DATADIR}/libtool/
+ install -c ${S}/libltdl/config/config.sub ${STAGING_DATADIR}/libtool/
+ install -c -m 0644 ${S}/libltdl/config/ltmain.sh ${STAGING_DATADIR}/libtool/config/
+
+ install -d ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/libtool.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltdl.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltoptions.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltversion.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/ltsugar.m4 ${STAGING_DATADIR}/aclocal/
+ install -c -m 0644 ${S}/libltdl/m4/lt~obsolete.m4 ${STAGING_DATADIR}/aclocal/
+}
diff --git a/recipes/libtool/libtool_2.2.4.bb b/recipes/libtool/libtool_2.2.4.bb
index f4b1ab824f..8e6682f096 100644
--- a/recipes/libtool/libtool_2.2.4.bb
+++ b/recipes/libtool/libtool_2.2.4.bb
@@ -1,5 +1,5 @@
require libtool.inc
-PR = "r15"
+PR = "r17"
SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz"
S = "${WORKDIR}/libtool-${PV}"
@@ -14,6 +14,18 @@ inherit autotools
EXTRA_AUTORECONF = "--exclude=libtoolize"
+do_configure_prepend () {
+ # Skip this for native build:
+ if test -n "$CONFIG_SITE" ; then
+ if test -z "$LIBTOOL_BB_DO_NOT_SET_PATHS" ; then
+ export ac_cv_path_SED="${ac_cv_path_SED=/bin/sed}"
+ export ac_cv_path_GREP="${ac_cv_path_GREP=/bin/grep}"
+ export ac_cv_path_EGREP="${ac_cv_path_EGREP=/bin/grep -E}"
+ export ac_cv_path_FGREP="${ac_cv_path_FGREP=/bin/grep -F}"
+ fi
+ fi
+}
+
do_stage () {
install -d ${STAGING_INCDIR}/libltdl
install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/
diff --git a/recipes/libtool/libtool_2.2.6a.bb b/recipes/libtool/libtool_2.2.6a.bb
new file mode 100644
index 0000000000..e2996c7198
--- /dev/null
+++ b/recipes/libtool/libtool_2.2.6a.bb
@@ -0,0 +1,36 @@
+require libtool.inc
+PR = "r2"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz"
+S = "${WORKDIR}/${BPN}-2.2.6"
+
+PACKAGES =+ "libltdl libltdl-dev libltdl-dbg"
+FILES_${PN} += "${datadir}/aclocal*"
+FILES_libltdl = "${libdir}/libltdl.so.*"
+FILES_libltdl-dev = "${libdir}/libltdl.* ${includedir}/ltdl.h"
+FILES_libltdl-dbg = "${libdir}/.debug/"
+
+inherit autotools
+
+EXTRA_AUTORECONF = "--exclude=libtoolize"
+
+do_configure_prepend () {
+ # Skip this for native build:
+ if test -n "$CONFIG_SITE" ; then
+ if test -z "$LIBTOOL_BB_DO_NOT_SET_PATHS" ; then
+ export ac_cv_path_SED="${ac_cv_path_SED=/bin/sed}"
+ export ac_cv_path_GREP="${ac_cv_path_GREP=/bin/grep}"
+ export ac_cv_path_EGREP="${ac_cv_path_EGREP=/bin/grep -E}"
+ export ac_cv_path_FGREP="${ac_cv_path_FGREP=/bin/grep -F}"
+ fi
+ fi
+}
+
+do_stage () {
+ install -d ${STAGING_INCDIR}/libltdl
+ install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/
+ install -m 0644 libltdl/libltdl/*.h ${STAGING_INCDIR}/libltdl/
+ oe_libinstall -a -so -C libltdl libltdl ${STAGING_LIBDIR}
+}
diff --git a/recipes/libusb/libusb-0.1.10a/ARMfix.patch b/recipes/libusb/libusb-0.1.10a/ARMfix.patch
deleted file mode 100644
index 803bd99bab..0000000000
--- a/recipes/libusb/libusb-0.1.10a/ARMfix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- /tmp/usb.c 2005-07-22 01:45:43.606167000 +0200
-+++ libusb-0.1.10a/usb.c 2005-07-22 01:47:22.527128728 +0200
-@@ -156,7 +156,7 @@
- * Some ports fetch the descriptors on scanning (like Linux) so we don't
- * need to fetch them again.
- */
-- if (!dev->config) {
-+/* if (!dev->config) { */
- usb_dev_handle *udev;
-
- udev = usb_open(dev);
-@@ -165,7 +165,7 @@
-
- usb_close(udev);
- }
-- }
-+/* }*/
-
- changes++;
-
diff --git a/recipes/libusb/libusb-0.1.10a/debian-changes.patch b/recipes/libusb/libusb-0.1.10a/debian-changes.patch
deleted file mode 100644
index 6f79bc7950..0000000000
--- a/recipes/libusb/libusb-0.1.10a/debian-changes.patch
+++ /dev/null
@@ -1,407 +0,0 @@
-diff -urN libusb_0.1.10a.orig/bsd.c libusb-0.1.10a/bsd.c
---- libusb_0.1.10a.orig/bsd.c 2004-02-18 08:34:52.000000000 +0100
-+++ libusb-0.1.10a/bsd.c 2005-06-30 19:40:00.000000000 +0200
-@@ -25,6 +25,10 @@
- * for both read and write.
- */
-
-+#if defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
-+#define __FreeBSD_kernel__ __FreeBSD__
-+#endif
-+
- #include <stdlib.h>
- #include <unistd.h>
- #include <string.h>
-@@ -142,7 +146,7 @@
- USB_ERROR(-ENOMEM);
- dev->impl_info = info;
-
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- snprintf(ctlpath, PATH_MAX, "%s", dev->device->filename);
- #else
- snprintf(ctlpath, PATH_MAX, "%s.00", dev->device->filename);
-@@ -255,7 +259,7 @@
- ep = UE_GET_ADDR(ep);
-
- if (info->ep_fd[ep] < 0) {
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->device->filename, ep);
- #else
- snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->device->filename, ep);
-@@ -286,7 +290,7 @@
- fd = ensure_ep_open(dev, ep, O_WRONLY);
- if (fd < 0) {
- if (usb_debug >= 2) {
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- fprintf (stderr, "usb_bulk_write: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
- #else
- fprintf (stderr, "usb_bulk_write: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
-@@ -302,7 +306,7 @@
-
- ret = write(fd, bytes, size);
- if (ret < 0)
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- USB_ERROR_STR(-errno, "error writing to bulk endpoint %s.%d: %s",
- dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
- #else
-@@ -324,7 +328,7 @@
- fd = ensure_ep_open(dev, ep, O_RDONLY);
- if (fd < 0) {
- if (usb_debug >= 2) {
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- fprintf (stderr, "usb_bulk_read: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
- #else
- fprintf (stderr, "usb_bulk_read: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
-@@ -343,7 +347,7 @@
-
- ret = read(fd, bytes, size);
- if (ret < 0)
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- USB_ERROR_STR(-errno, "error reading from bulk endpoint %s.%d: %s",
- dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
- #else
-@@ -365,7 +369,7 @@
- fd = ensure_ep_open(dev, ep, O_WRONLY);
- if (fd < 0) {
- if (usb_debug >= 2) {
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- fprintf (stderr, "usb_interrupt_write: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
- #else
- fprintf (stderr, "usb_interrupt_write: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
-@@ -382,7 +386,7 @@
- do {
- ret = write(fd, bytes+sent, size-sent);
- if (ret < 0)
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%d: %s",
- dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
- #else
-@@ -407,7 +411,7 @@
- fd = ensure_ep_open(dev, ep, O_RDONLY);
- if (fd < 0) {
- if (usb_debug >= 2) {
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
- #else
- fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
-@@ -427,7 +431,7 @@
- do {
- ret = read(fd, bytes+retrieved, size-retrieved);
- if (ret < 0)
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%d: %s",
- dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
- #else
-@@ -543,7 +547,7 @@
- /* best not to play with things we don't understand */
- continue;
-
--#if __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.udi_devnames[0]);
- #else
- snprintf(buf, sizeof(buf) - 1, "/dev/%s.00", di.udi_devnames[0]);
-diff -urN libusb_0.1.10a.orig/linux.c libusb-0.1.10a/linux.c
---- libusb_0.1.10a.orig/linux.c 2005-02-11 03:16:10.000000000 +0100
-+++ libusb-0.1.10a/linux.c 2005-06-30 19:40:00.000000000 +0200
-@@ -156,6 +156,8 @@
- return ret;
- }
-
-+#define URB_USERCONTEXT_COOKIE ((void *)0x1)
-+
- /* Reading and writing are the same except for the endpoint */
- static int usb_urb_transfer(usb_dev_handle *dev, int ep, int urbtype,
- char *bytes, int size, int timeout)
-@@ -163,14 +165,16 @@
- struct usb_urb urb;
- unsigned int bytesdone = 0, requested;
- struct timeval tv, tv_ref, tv_now;
-- void *context;
-+ struct usb_urb *context;
- int ret, waiting;
-
- /*
-- * FIXME: The use of the URB interface is incorrect here if there are
-- * multiple callers at the same time. We assume we're the only caller
-- * and if we get completions from another caller, this code will fail
-- * in interesting ways.
-+ * HACK: The use of urb.usercontext is a hack to get threaded applications
-+ * sort of working again. Threaded support is still not recommended, but
-+ * this should allow applications to work in the common cases. Basically,
-+ * if we get the completion for an URB we're not waiting for, then we update
-+ * the usercontext pointer to 1 for the other threads URB and it will see
-+ * the change after it wakes up from the the timeout. Ugly, but it works.
- */
-
- /*
-@@ -198,10 +202,10 @@
- urb.flags = 0;
- urb.buffer = bytes + bytesdone;
- urb.buffer_length = requested;
-- urb.usercontext = (void *)ep;
- urb.signr = 0;
- urb.actual_length = 0;
- urb.number_of_packets = 0; /* don't do isochronous yet */
-+ urb.usercontext = NULL;
-
- ret = ioctl(dev->fd, IOCTL_USB_SUBMITURB, &urb);
- if (ret < 0) {
-@@ -212,18 +216,28 @@
- FD_ZERO(&writefds);
- FD_SET(dev->fd, &writefds);
-
-+restart:
- waiting = 1;
-- while (((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) {
-+ context = NULL;
-+ while (!urb.usercontext && ((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) {
- tv.tv_sec = 0;
- tv.tv_usec = 1000; // 1 msec
- select(dev->fd + 1, NULL, &writefds, NULL, &tv); //sub second wait
-
-- /* compare with actual time, as the select timeout is not that precise */
-- gettimeofday(&tv_now, NULL);
-+ if (timeout) {
-+ /* compare with actual time, as the select timeout is not that precise */
-+ gettimeofday(&tv_now, NULL);
-+
-+ if ((tv_now.tv_sec > tv_ref.tv_sec) ||
-+ ((tv_now.tv_sec == tv_ref.tv_sec) && (tv_now.tv_usec >= tv_ref.tv_usec)))
-+ waiting = 0;
-+ }
-+ }
-
-- if ((tv_now.tv_sec > tv_ref.tv_sec) ||
-- ((tv_now.tv_sec == tv_ref.tv_sec) && (tv_now.tv_usec >= tv_ref.tv_usec)))
-- waiting = 0;
-+ if (context && context != &urb) {
-+ context->usercontext = URB_USERCONTEXT_COOKIE;
-+ /* We need to restart since we got a successful URB, but not ours */
-+ goto restart;
- }
-
- /*
-@@ -231,14 +245,14 @@
- * something happened during the reaping and we should return that
- * error now
- */
-- if (ret < 0 && errno != EAGAIN)
-+ if (ret < 0 && !urb.usercontext && errno != EAGAIN)
- USB_ERROR_STR(-errno, "error reaping URB: %s", strerror(errno));
-
- bytesdone += urb.actual_length;
-- } while (ret == 0 && bytesdone < size && urb.actual_length == requested);
-+ } while ((ret == 0 || urb.usercontext) && bytesdone < size && urb.actual_length == requested);
-
- /* If the URB didn't complete in success or error, then let's unlink it */
-- if (ret < 0) {
-+ if (ret < 0 && !urb.usercontext) {
- int rc;
-
- if (!waiting)
-diff -urN libusb_0.1.10a.orig/usb.h.in libusb-0.1.10a/usb.h.in
---- libusb_0.1.10a.orig/usb.h.in 2004-08-03 20:20:38.000000000 +0200
-+++ libusb-0.1.10a/usb.h.in 2005-06-30 19:40:00.000000000 +0200
-@@ -13,8 +13,9 @@
-
- #include <unistd.h>
- #include <stdlib.h>
-+#include <stdint.h>
- #include <limits.h>
--
-+#include <sys/param.h>
- #include <dirent.h>
-
- /*
-@@ -63,40 +64,40 @@
-
- /* All standard descriptors have these 2 fields in common */
- struct usb_descriptor_header {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
--};
-+ uint8_t bLength;
-+ uint8_t bDescriptorType;
-+} __attribute__ ((packed));
-
- /* String descriptor */
- struct usb_string_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int16_t wData[1];
--};
-+ uint8_t bLength;
-+ uint8_t bDescriptorType;
-+ uint16_t wData[1];
-+} __attribute__ ((packed));
-
- /* HID descriptor */
- struct usb_hid_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int16_t bcdHID;
-- u_int8_t bCountryCode;
-- u_int8_t bNumDescriptors;
-- /* u_int8_t bReportDescriptorType; */
-- /* u_int16_t wDescriptorLength; */
-+ uint8_t bLength;
-+ uint8_t bDescriptorType;
-+ uint16_t bcdHID;
-+ uint8_t bCountryCode;
-+ uint8_t bNumDescriptors;
-+ /* uint8_t bReportDescriptorType; */
-+ /* uint16_t wDescriptorLength; */
- /* ... */
--};
-+} __attribute__ ((packed));
-
- /* Endpoint descriptor */
- #define USB_MAXENDPOINTS 32
- struct usb_endpoint_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int8_t bEndpointAddress;
-- u_int8_t bmAttributes;
-- u_int16_t wMaxPacketSize;
-- u_int8_t bInterval;
-- u_int8_t bRefresh;
-- u_int8_t bSynchAddress;
-+ uint8_t bLength __attribute__ ((packed));
-+ uint8_t bDescriptorType __attribute__ ((packed));
-+ uint8_t bEndpointAddress __attribute__ ((packed));
-+ uint8_t bmAttributes __attribute__ ((packed));
-+ uint16_t wMaxPacketSize __attribute__ ((packed));
-+ uint8_t bInterval __attribute__ ((packed));
-+ uint8_t bRefresh __attribute__ ((packed));
-+ uint8_t bSynchAddress __attribute__ ((packed));
-
- unsigned char *extra; /* Extra descriptors */
- int extralen;
-@@ -114,15 +115,15 @@
- /* Interface descriptor */
- #define USB_MAXINTERFACES 32
- struct usb_interface_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int8_t bInterfaceNumber;
-- u_int8_t bAlternateSetting;
-- u_int8_t bNumEndpoints;
-- u_int8_t bInterfaceClass;
-- u_int8_t bInterfaceSubClass;
-- u_int8_t bInterfaceProtocol;
-- u_int8_t iInterface;
-+ uint8_t bLength __attribute__ ((packed));;
-+ uint8_t bDescriptorType __attribute__ ((packed));;
-+ uint8_t bInterfaceNumber __attribute__ ((packed));;
-+ uint8_t bAlternateSetting __attribute__ ((packed));;
-+ uint8_t bNumEndpoints __attribute__ ((packed));;
-+ uint8_t bInterfaceClass __attribute__ ((packed));;
-+ uint8_t bInterfaceSubClass __attribute__ ((packed));;
-+ uint8_t bInterfaceProtocol __attribute__ ((packed));;
-+ uint8_t iInterface __attribute__ ((packed));;
-
- struct usb_endpoint_descriptor *endpoint;
-
-@@ -140,14 +141,14 @@
- /* Configuration descriptor information.. */
- #define USB_MAXCONFIG 8
- struct usb_config_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int16_t wTotalLength;
-- u_int8_t bNumInterfaces;
-- u_int8_t bConfigurationValue;
-- u_int8_t iConfiguration;
-- u_int8_t bmAttributes;
-- u_int8_t MaxPower;
-+ uint8_t bLength __attribute__ ((packed));
-+ uint8_t bDescriptorType __attribute__ ((packed));
-+ uint16_t wTotalLength __attribute__ ((packed));
-+ uint8_t bNumInterfaces __attribute__ ((packed));
-+ uint8_t bConfigurationValue __attribute__ ((packed));
-+ uint8_t iConfiguration __attribute__ ((packed));
-+ uint8_t bmAttributes __attribute__ ((packed));
-+ uint8_t MaxPower __attribute__ ((packed));
-
- struct usb_interface *interface;
-
-@@ -157,29 +158,29 @@
-
- /* Device descriptor */
- struct usb_device_descriptor {
-- u_int8_t bLength;
-- u_int8_t bDescriptorType;
-- u_int16_t bcdUSB;
-- u_int8_t bDeviceClass;
-- u_int8_t bDeviceSubClass;
-- u_int8_t bDeviceProtocol;
-- u_int8_t bMaxPacketSize0;
-- u_int16_t idVendor;
-- u_int16_t idProduct;
-- u_int16_t bcdDevice;
-- u_int8_t iManufacturer;
-- u_int8_t iProduct;
-- u_int8_t iSerialNumber;
-- u_int8_t bNumConfigurations;
--};
-+ uint8_t bLength;
-+ uint8_t bDescriptorType;
-+ uint16_t bcdUSB;
-+ uint8_t bDeviceClass;
-+ uint8_t bDeviceSubClass;
-+ uint8_t bDeviceProtocol;
-+ uint8_t bMaxPacketSize0;
-+ uint16_t idVendor;
-+ uint16_t idProduct;
-+ uint16_t bcdDevice;
-+ uint8_t iManufacturer;
-+ uint8_t iProduct;
-+ uint8_t iSerialNumber;
-+ uint8_t bNumConfigurations;
-+} __attribute__ ((packed));
-
- struct usb_ctrl_setup {
-- u_int8_t bRequestType;
-- u_int8_t bRequest;
-- u_int16_t wValue;
-- u_int16_t wIndex;
-- u_int16_t wLength;
--};
-+ uint8_t bRequestType;
-+ uint8_t bRequest;
-+ uint16_t wValue;
-+ uint16_t wIndex;
-+ uint16_t wLength;
-+} __attribute__ ((packed));
-
- /*
- * Standard requests
-@@ -249,7 +250,7 @@
-
- void *dev; /* Darwin support */
-
-- u_int8_t devnum;
-+ uint8_t devnum;
-
- unsigned char num_children;
- struct usb_device **children;
-@@ -261,7 +262,7 @@
- char dirname[PATH_MAX + 1];
-
- struct usb_device *devices;
-- u_int32_t location;
-+ uint32_t location;
-
- struct usb_device *root_dev;
- };
diff --git a/recipes/libusb/libusb-0.1.8/amd64-fPIC.patch b/recipes/libusb/libusb-0.1.8/amd64-fPIC.patch
deleted file mode 100644
index b8cfdbe697..0000000000
--- a/recipes/libusb/libusb-0.1.8/amd64-fPIC.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile.in.orig 2004-03-27 16:34:18.371955584 +0100
-+++ Makefile.in 2004-03-27 16:34:07.796563288 +0100
-@@ -54,7 +54,7 @@
- CC = @CC@
- CCDEPMODE = @CCDEPMODE@
-
--CFLAGS = $(CFLAGS_EXT)
-+CFLAGS = $(CFLAGS_EXT) -fPIC
- CPP = @CPP@
- CPPFLAGS = @CPPFLAGS@
- CXX = @CXX@
diff --git a/recipes/libusb/libusb-0.1.8/configure.patch b/recipes/libusb/libusb-0.1.8/configure.patch
deleted file mode 100644
index 6f014a9dcd..0000000000
--- a/recipes/libusb/libusb-0.1.8/configure.patch
+++ /dev/null
@@ -1,99 +0,0 @@
---- libusb-0.1.8/configure.in~configure.patch 2004-02-12 03:27:18.000000000 +1100
-+++ libusb-0.1.8/configure.in 2004-11-03 20:17:45.949802575 +1100
-@@ -1,10 +1,11 @@
- # This configure.in is based off of the one that glib uses
-
- # require atleast autoconf 2.13
--AC_PREREQ(2.13)
-+AC_PREREQ(2.57)
-
- # init autoconf (and check for presence of usb.c)
--AC_INIT(usb.c)
-+AC_INIT
-+AC_CONFIG_SRCDIR([usb.c])
-
- AH_TOP(
- #undef LINUX_API
-@@ -29,8 +30,8 @@
-
- dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
- dnl are available for $ac_help expansion (don't we all *love* autoconf?)
--ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-- [AC_DIVERT_PUSH(NOTICE)])
-+dnl ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-+dnl [AC_DIVERT_PUSH(NOTICE)])
-
- #
- # The following version number definitions apply to libusb
-@@ -52,7 +53,7 @@
- LIBUSB_BINARY_AGE=4
- LIBUSB_VERSION=$LIBUSB_MAJOR_VERSION.$LIBUSB_MINOR_VERSION.$LIBUSB_MICRO_VERSION
- dnl
--AC_DIVERT_POP()dnl
-+dnl AC_DIVERT_POP()dnl
-
- AC_SUBST(LIBUSB_MAJOR_VERSION)
- AC_SUBST(LIBUSB_MINOR_VERSION)
-@@ -81,7 +82,7 @@
- AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
-
- # Specify a configuration file
--AM_CONFIG_HEADER(config.h)
-+AC_CONFIG_HEADERS([config.h])
-
- AC_DEFINE_UNQUOTED(LIBUSB_MAJOR_VERSION, $LIBUSB_MAJOR_VERSION)
- AC_DEFINE_UNQUOTED(LIBUSB_MINOR_VERSION, $LIBUSB_MINOR_VERSION)
-@@ -149,14 +150,14 @@
-
- dnl figure debugging default, prior to $ac_help setup
- dnl
--ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-- [AC_DIVERT_PUSH(NOTICE)])
-+dnl ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-+dnl [AC_DIVERT_PUSH(NOTICE)])
- if test `expr $LIBUSB_MINOR_VERSION \% 2` = 1 ; then
- debug_default=yes
- else
- debug_default=minimum
- fi
--AC_DIVERT_POP()dnl
-+dnl AC_DIVERT_POP()dnl
-
- dnl declare --enable-* args and collect ac_help strings
- AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
-@@ -207,15 +208,11 @@
-
- if test "$os_support" = "bsd"; then
- AC_MSG_CHECKING(if dev/usb/usb.h uses new naming convention)
-- AC_TRY_COMPILE(
-- [#include <dev/usb/usb.h>],
-- [int main(void)
-+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dev/usb/usb.h>]], [[int main(void)
- {
- int a = ((struct usb_ctl_request *)0L)->ucr_addr;
- return 0;
-- }],
-- [AC_MSG_RESULT(yes)],
-- [AC_MSG_RESULT(no)
-+ }]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
- AC_DEFINE_UNQUOTED(HAVE_OLD_DEV_USB_USB_H)])
- fi
-
-@@ -246,7 +243,7 @@
-
- AM_CONDITIONAL(BUILD_DOCS, test "$build_docs" != "no")
-
--AC_OUTPUT([
-+AC_CONFIG_FILES([
- Makefile
- doc/Makefile
- libusb.spec
-@@ -255,5 +252,6 @@
- README
- INSTALL.libusb
- usb.h
--],[chmod +x libusb-config])
--
-+])
-+AC_CONFIG_COMMANDS([default],[[chmod +x libusb-config]],[[]])
-+AC_OUTPUT
diff --git a/recipes/libusb/libusb-0.1.8/pkgconfig.patch b/recipes/libusb/libusb-0.1.8/pkgconfig.patch
deleted file mode 100644
index 737c89edb0..0000000000
--- a/recipes/libusb/libusb-0.1.8/pkgconfig.patch
+++ /dev/null
@@ -1,68 +0,0 @@
---- libusb-0.1.8.orig/libusb.pc.in
-+++ libusb-0.1.8/libusb.pc.in
-@@ -0,0 +1,11 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+
-+Name: libusb
-+Description: USB access library
-+Version: @VERSION@
-+Libs: -L${libdir} -lusb
-+Cflags: -I${includedir}
-+
---- libusb-0.1.8.orig/configure.in
-+++ libusb-0.1.8/configure.in
-@@ -219,6 +219,26 @@
- AC_DEFINE_UNQUOTED(HAVE_OLD_DEV_USB_USB_H)])
- fi
-
-+#pkg-config: pkg-config is a tool to simplify checks for libraries and versions.
-+pkgconfig_msg="no (http://www.freedesktop.org/software/pkgconfig)"
-+try_pkgconfig=true
-+have_pkgconfig=false
-+AC_ARG_WITH(pkgconfig, [ --without-pkgconfig don't use pkg-config],[
-+ if test x$withval = xno; then
-+ try_pkgconfig=false
-+ pkgconfig_msg="no (not requested)"
-+ fi])
-+if $try_pkgconfig; then
-+ AC_PATH_PROG(PKG_CONFIG,pkg-config)
-+ if test -n "${PKG_CONFIG}"; then
-+ have_pkgconfig=true
-+ pkgconfig_msg="yes"
-+ fi
-+fi
-+# guessing directory to install *.pc into
-+pkgconfigdir='${libdir}/pkgconfig'
-+AC_SUBST(pkgconfigdir)
-+
- # Check if the user wants to enable documentation
- AC_MSG_CHECKING(if we should build the documentation)
- AC_ARG_ENABLE(build-docs, [ --disable-build-docs turn off building documentation],
-@@ -249,6 +269,7 @@
- AC_OUTPUT([
- Makefile
- doc/Makefile
-+ libusb.pc
- libusb.spec
- libusb-config
- tests/Makefile
---- libusb-0.1.8.orig/Makefile.am
-+++ libusb-0.1.8/Makefile.am
-@@ -12,11 +12,13 @@
-
- bin_SCRIPTS = libusb-config
-
--EXTRA_DIST = LICENSE libusb.spec.in libusb.spec libusb-config.in README.in README INSTALL.libusb.in INSTALL.libusb
-+EXTRA_DIST = LICENSE libusb.spec.in libusb.spec libusb-config.in README.in README INSTALL.libusb.in INSTALL.libusb libusb.pc.in
- EXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c
-
- lib_LTLIBRARIES = libusb.la
-
-+pkgconfig_DATA= libusb.pc
-+
- if LINUX_API
- OS_SUPPORT = linux.c linux.h
- else
diff --git a/recipes/libusb/libusb-compat-0.0.9+0.1.0-beta2/0.1.0-beta1-gcc3.4-fix.patch b/recipes/libusb/libusb-compat-0.0.9+0.1.0-beta2/0.1.0-beta1-gcc3.4-fix.patch
deleted file mode 100644
index 501ba3fb29..0000000000
--- a/recipes/libusb/libusb-compat-0.0.9+0.1.0-beta2/0.1.0-beta1-gcc3.4-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libusb-compat-0.1.0-beta1/configure.ac
-===================================================================
---- libusb-compat-0.1.0-beta1.orig/configure.ac 2008-07-21 13:14:42.000000000 +0200
-+++ libusb-compat-0.1.0-beta1/configure.ac 2008-07-21 13:15:03.000000000 +0200
-@@ -55,7 +55,7 @@
- CFLAGS="$saved_cflags"
-
- AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
--AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
-+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow"
- AC_SUBST(AM_CFLAGS)
-
- AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile])
diff --git a/recipes/libusb/libusb-compat-0.1.0/gcc-3-compatibility.patch b/recipes/libusb/libusb-compat-0.1.2/gcc-3-compatibility.patch
index f07b5383bf..e6142f735c 100644
--- a/recipes/libusb/libusb-compat-0.1.0/gcc-3-compatibility.patch
+++ b/recipes/libusb/libusb-compat-0.1.2/gcc-3-compatibility.patch
@@ -1,6 +1,8 @@
---- libusb-compat-0.1.0/configure.ac-orig 2009-02-26 15:30:51.000000000 +0100
-+++ libusb-compat-0.1.0/configure.ac 2009-02-26 15:31:04.000000000 +0100
-@@ -55,7 +55,7 @@
+Index: libusb-compat-0.1.2/configure.ac
+===================================================================
+--- libusb-compat-0.1.2.orig/configure.ac 2009-06-11 22:49:08.000000000 +0000
++++ libusb-compat-0.1.2/configure.ac 2009-06-26 21:44:08.000000000 +0000
+@@ -56,7 +56,7 @@
CFLAGS="$saved_cflags"
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
@@ -9,8 +11,10 @@
AC_SUBST(AM_CFLAGS)
AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile])
---- libusb-compat-0.1.0/libusb/Makefile.am-orig 2009-02-26 15:33:30.000000000 +0100
-+++ libusb-compat-0.1.0/libusb/Makefile.am 2009-02-26 15:33:40.000000000 +0100
+Index: libusb-compat-0.1.2/libusb/Makefile.am
+===================================================================
+--- libusb-compat-0.1.2.orig/libusb/Makefile.am 2008-06-17 23:13:02.000000000 +0000
++++ libusb-compat-0.1.2/libusb/Makefile.am 2009-06-26 21:44:08.000000000 +0000
@@ -2,7 +2,7 @@
lib_LTLIBRARIES = libusb.la
diff --git a/recipes/libusb/libusb-compat_0.0.9+0.1.0-beta2.bb b/recipes/libusb/libusb-compat_0.0.9+0.1.0-beta2.bb
deleted file mode 100644
index 34cc1ac50d..0000000000
--- a/recipes/libusb/libusb-compat_0.0.9+0.1.0-beta2.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-HOMEPAGE = "http://libusb.sf.net"
-SECTION = "libs"
-LICENSE = "LGPL"
-
-PE = "1"
-PR = "r0"
-
-DEPENDS = "libusb1"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-compat-0.1.0-beta2.tar.bz2 \
- file://0.1.0-beta1-gcc3.4-fix.patch;patch=1 \
- "
-
-S = "${WORKDIR}/libusb-compat-0.1.0-beta2"
-
-inherit autotools pkgconfig binconfig lib_package
-
-PARALLEL_MAKE = ""
-EXTRA_OECONF = "--disable-build-docs"
-
-export CXXFLAGS += "-lstdc++ -I${STAGING_INCDIR}"
-
-do_stage() {
- autotools_stage_all
- install -m 755 ${S}/libusb-config ${STAGING_BINDIR}
- # can we get rid of that? wouldn't a sed statement do as well?
- sed -i 's:\-L${libdir} :-L${STAGING_LIBDIR} :' ${STAGING_BINDIR}/libusb-config
-
- if [ "${STAGING_BINDIR}" != "${STAGING_BINDIR_CROSS}" ]; then
- install -d ${STAGING_BINDIR_CROSS}/
- mv ${STAGING_BINDIR}/libusb-config ${STAGING_BINDIR_CROSS}/libusb-config
- fi
-}
-
-PACKAGES =+ "libusbpp"
-
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb-compat_0.1.0.bb b/recipes/libusb/libusb-compat_0.1.0.bb
deleted file mode 100644
index 48694403e5..0000000000
--- a/recipes/libusb/libusb-compat_0.1.0.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-HOMEPAGE = "http://libusb.sf.net"
-SECTION = "libs"
-LICENSE = "LGPL"
-
-PE = "1"
-PR = "r0"
-
-DEPENDS = "libusb1"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-compat-${PV}.tar.bz2 \
- "
-SRC_URI_append_nylon = " file://gcc-3-compatibility.patch;patch=1 \
-"
-inherit autotools pkgconfig binconfig lib_package
-
-PARALLEL_MAKE = ""
-EXTRA_OECONF = "--disable-build-docs"
-
-export CXXFLAGS += "-lstdc++ -I${STAGING_INCDIR}"
-
-do_stage() {
- autotools_stage_all
- install -m 755 ${S}/libusb-config ${STAGING_BINDIR}
- # can we get rid of that? wouldn't a sed statement do as well?
- sed -i 's:\-L${libdir} :-L${STAGING_LIBDIR} :' ${STAGING_BINDIR}/libusb-config
-
- if [ "${STAGING_BINDIR}" != "${STAGING_BINDIR_CROSS}" ]; then
- install -d ${STAGING_BINDIR_CROSS}/
- mv ${STAGING_BINDIR}/libusb-config ${STAGING_BINDIR_CROSS}/libusb-config
- fi
-}
-
-PACKAGES =+ "libusbpp"
-
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb-compat_0.1.2.bb b/recipes/libusb/libusb-compat_0.1.2.bb
new file mode 100644
index 0000000000..8ce111f2d8
--- /dev/null
+++ b/recipes/libusb/libusb-compat_0.1.2.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "libusb-0 compatibility library using libusb-1"
+HOMEPAGE = "http://libusb.sf.net"
+SECTION = "libs"
+LICENSE = "LGPL"
+PROVIDES = "virtual/libusb0"
+PE = "1"
+PR = "r0"
+
+DEPENDS = "libusb1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/${P}.tar.bz2"
+SRC_URI_append_nylon = " file://gcc-3-compatibility.patch;patch=1"
+
+inherit autotools_stage binconfig lib_package
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+EXTRA_OECONF = "--disable-build-docs"
diff --git a/recipes/libusb/libusb-native_0.1.10a.bb b/recipes/libusb/libusb-native_0.1.10a.bb
deleted file mode 100644
index a76768c3b6..0000000000
--- a/recipes/libusb/libusb-native_0.1.10a.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require libusb_${PV}.bb
-inherit native
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/libusb-0.1.10a"
diff --git a/recipes/libusb/libusb-native_0.1.12.bb b/recipes/libusb/libusb-native_0.1.12.bb
index 637ded28e4..2efe2eee89 100644
--- a/recipes/libusb/libusb-native_0.1.12.bb
+++ b/recipes/libusb/libusb-native_0.1.12.bb
@@ -1,3 +1,3 @@
require libusb_${PV}.bb
inherit native
-
+PROVIDES = "virtual/libusb0-native"
diff --git a/recipes/libusb/libusb1-0.9.2/0.9.0-gcc3.4-compat-fix.patch b/recipes/libusb/libusb1-0.9.2/0.9.0-gcc3.4-compat-fix.patch
deleted file mode 100644
index 1b06945d1a..0000000000
--- a/recipes/libusb/libusb1-0.9.2/0.9.0-gcc3.4-compat-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libusb-0.9.0/configure.ac
-===================================================================
---- libusb-0.9.0.orig/configure.ac 2008-07-21 08:04:03.000000000 +0200
-+++ libusb-0.9.0/configure.ac 2008-07-21 08:04:16.000000000 +0200
-@@ -62,7 +62,7 @@
- CFLAGS="$saved_cflags"
-
- AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
--AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
-+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow"
- AC_SUBST(AM_CFLAGS)
-
- AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile] [doc/Makefile])
diff --git a/recipes/libusb/libusb1-1.0.0/gcc-3-compatibility.patch b/recipes/libusb/libusb1-1.0.0/gcc-3-compatibility.patch
deleted file mode 100644
index d1bc6803d8..0000000000
--- a/recipes/libusb/libusb1-1.0.0/gcc-3-compatibility.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- libusb-1.0.0/configure.ac-orig 2009-02-26 13:18:31.000000000 +0100
-+++ libusb-1.0.0/configure.ac 2009-02-26 13:18:43.000000000 +0100
-@@ -62,7 +62,7 @@
- CFLAGS="$saved_cflags"
-
- AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
--AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
-+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow"
- AC_SUBST(AM_CFLAGS)
-
- AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile] [doc/Makefile] [doc/doxygen.cfg])
---- libusb-1.0.0/libusb/Makefile.am-orig 2009-02-26 13:18:11.000000000 +0100
-+++ libusb-1.0.0/libusb/Makefile.am 2009-02-26 13:18:23.000000000 +0100
-@@ -8,7 +8,7 @@
- OS_SRC = $(LINUX_USBFS_SRC)
- endif
-
--libusb_1_0_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) -pthread
-+libusb_1_0_la_CFLAGS = $(AM_CFLAGS) -pthread
- libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)
- libusb_1_0_la_LIBADD = -lrt
-
diff --git a/recipes/libusb/libusb1-1.0.1/gcc-3-compatibility.patch b/recipes/libusb/libusb1-1.0.1/gcc-3-compatibility.patch
deleted file mode 100644
index 98c3674bca..0000000000
--- a/recipes/libusb/libusb1-1.0.1/gcc-3-compatibility.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- libusb-1.0.1/libusb/Makefile.am-orig 2009-05-19 22:41:07.000000000 +0200
-+++ libusb-1.0.1/libusb/Makefile.am 2009-05-19 22:41:27.000000000 +0200
-@@ -14,7 +14,7 @@
- AM_CFLAGS_EXT = -no-cpp-precomp
- endif
-
--libusb_1_0_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) -pthread
-+libusb_1_0_la_CFLAGS = $(AM_CFLAGS) -pthread
- libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)
-
- hdrdir = $(includedir)/libusb-1.0
---- libusb-1.0.1/libusb/Makefile.in-orig 2009-05-19 22:41:13.000000000 +0200
-+++ libusb-1.0.1/libusb/Makefile.in 2009-05-19 22:41:42.000000000 +0200
-@@ -210,7 +210,7 @@
- @OS_DARWIN_TRUE@OS_SRC = $(DARWIN_USB_SRC)
- @OS_LINUX_TRUE@OS_SRC = $(LINUX_USBFS_SRC)
- @OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp
--libusb_1_0_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) -pthread
-+libusb_1_0_la_CFLAGS = $(AM_CFLAGS) -pthread
- libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)
- hdrdir = $(includedir)/libusb-1.0
- hdr_HEADERS = libusb.h
---- libusb-1.0.1/configure.ac-orig 2009-05-19 22:44:06.000000000 +0200
-+++ libusb-1.0.1/configure.ac 2009-05-19 22:44:16.000000000 +0200
-@@ -72,7 +72,7 @@
- CFLAGS="$saved_cflags"
-
- AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
--AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
-+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow"
-
- AC_SUBST(AM_CFLAGS)
- AC_SUBST(AM_LDFLAGS)
diff --git a/recipes/libusb/libusb1_0.9.2.bb b/recipes/libusb/libusb1_0.9.2.bb
deleted file mode 100644
index 2c144f053d..0000000000
--- a/recipes/libusb/libusb1_0.9.2.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-HOMEPAGE = "http://libusb.sf.net"
-SECTION = "libs"
-LICENSE = "LGPL"
-
-PR = "r0"
-
-SRC_URI = "\
- ${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
- file://0.9.0-gcc3.4-compat-fix.patch;patch=1 \
-"
-S = "${WORKDIR}/libusb-${PV}"
-
-inherit autotools pkgconfig binconfig lib_package
-
-PARALLEL_MAKE = ""
-EXTRA_OECONF = "--disable-build-docs"
-
-export CXXFLAGS += "-lstdc++ -I${STAGING_INCDIR}"
-
-LIBTOOL = "${HOST_SYS}-libtool"
-EXTRA_OEMAKE = "'LIBTOOL=${LIBTOOL}'"
-
-do_stage() {
- autotools_stage_all
-}
-
-PACKAGES =+ "libusbpp"
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb1_1.0.0.bb b/recipes/libusb/libusb1_1.0.0.bb
deleted file mode 100644
index 978d819a6f..0000000000
--- a/recipes/libusb/libusb1_1.0.0.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-HOMEPAGE = "http://libusb.sf.net"
-SECTION = "libs"
-LICENSE = "LGPL"
-
-PR = "r0"
-
-SRC_URI = "\
- ${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
-"
-SRC_URI_append_nylon = " file://gcc-3-compatibility.patch;patch=1 \
-"
-S = "${WORKDIR}/libusb-${PV}"
-
-inherit autotools pkgconfig binconfig lib_package
-
-PARALLEL_MAKE = ""
-EXTRA_OECONF = "--disable-build-docs"
-
-export CXXFLAGS += "-lstdc++ -I${STAGING_INCDIR}"
-
-LIBTOOL = "${HOST_SYS}-libtool"
-EXTRA_OEMAKE = "'LIBTOOL=${LIBTOOL}'"
-
-do_stage() {
- autotools_stage_all
-}
-
-PACKAGES =+ "libusbpp"
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb1_1.0.1.bb b/recipes/libusb/libusb1_1.0.1.bb
deleted file mode 100644
index 3856812965..0000000000
--- a/recipes/libusb/libusb1_1.0.1.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-HOMEPAGE = "http://libusb.sf.net"
-SECTION = "libs"
-LICENSE = "LGPL"
-
-
-SRC_URI = "\
- ${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
-"
-SRC_URI_append_nylon = " file://gcc-3-compatibility.patch;patch=1 \
-"
-S = "${WORKDIR}/libusb-${PV}"
-
-inherit autotools_stage binconfig lib_package
-
-PARALLEL_MAKE = ""
-EXTRA_OECONF = "--disable-build-docs"
-
-export CXXFLAGS += "-lstdc++ -I${STAGING_INCDIR}"
-
-LIBTOOL = "${HOST_SYS}-libtool"
-EXTRA_OEMAKE = "'LIBTOOL=${LIBTOOL}'"
-
-AUTOTOOLS_STAGE_PKGCONFIG = "1"
-
-PACKAGES =+ "libusbpp"
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb1_1.0.2.bb b/recipes/libusb/libusb1_1.0.2.bb
new file mode 100644
index 0000000000..145e4cbe97
--- /dev/null
+++ b/recipes/libusb/libusb1_1.0.2.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "library to provide userspace access to USB devices"
+HOMEPAGE = "http://libusb.sf.net"
+SECTION = "libs"
+LICENSE = "LGPL"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2"
+S = "${WORKDIR}/libusb-${PV}"
+
+inherit autotools_stage
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+EXTRA_OECONF = "--disable-build-docs"
diff --git a/recipes/libusb/libusb_0.0.0.bb b/recipes/libusb/libusb_0.0.0.bb
deleted file mode 100644
index fe4595611d..0000000000
--- a/recipes/libusb/libusb_0.0.0.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace access to USB \
-devices. This version is a metapackage that pulls in libusb-compat, \
-the replacement for libusb."
-
-# This version of libusb will never be pulled in automagically. The
-# intention is that a distro wishing to use libusb1 and libusb-compat
-# will place the following in the appropriate conf file:
-#
-# PREFERRED_VERSION_libusb = "0.0.0"
-#
-# This essentially results in the replacement of libusb by libusb-compat,
-# and resolves the issues of some packages depending on libusb, while
-# other (newer) ones depend on libusb-compat.
-#
-# Note that using this version of libusb will break certain packages
-# that cannot work with libusb-compat (gnuradio is said to be such a
-# packages, as is dfu-util). Unfortunately other packages (such as bluez)
-# require libusb-compat -- there's no good solution for this conflict
-# at this time. The fundamental problem is that both libusb and
-# libusb-compat stage to the same libs (/usr/lib/libusb.a, for example),
-# so if you have built both, the last one staged wins.
-#
-# This "hack" seems to be the most flexible and least intrusive workaround.
-
-DEFAULT_PREFERENCE = "-1"
-
-DEPENDS = "libusb-compat"
diff --git a/recipes/libusb/libusb_0.1.10a.bb b/recipes/libusb/libusb_0.1.10a.bb
deleted file mode 100644
index 8648f96571..0000000000
--- a/recipes/libusb/libusb_0.1.10a.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
-SECTION = "libs"
-LICENSE = "LGPL"
-PR = "r7"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.gz \
- file://debian-changes.patch;patch=1"
-
-S = "${WORKDIR}/libusb-${PV}"
-
-inherit autotools pkgconfig
-
-PARALLEL_MAKE = ""
-
-EXTRA_OECONF = "--disable-build-docs"
-
-do_stage() {
- oe_libinstall -a -so libusb ${STAGING_LIBDIR}
-
- install -d ${STAGING_BINDIR}
- install -m 755 ${S}/libusb-config ${STAGING_BINDIR}
- perl -pi -e 's:\-L${libdir} :-L${STAGING_LIBDIR} :' ${STAGING_BINDIR}/libusb-config
-
- if [ "${STAGING_BINDIR}" != "${STAGING_BINDIR_CROSS}" ]; then
- install -d ${STAGING_BINDIR_CROSS}/
- mv ${STAGING_BINDIR}/libusb-config ${STAGING_BINDIR_CROSS}/libusb-config
- fi
-
- install -d ${STAGING_INCDIR}/
- for X in usb.h
- do
- install -m 0644 ${S}/$X ${STAGING_INCDIR}/$X
- done
-}
-
-PACKAGES =+ "libusbpp"
-
-FILES_libusbpp = "${libdir}/libusbpp*.so.*"
diff --git a/recipes/libusb/libusb_0.1.12.bb b/recipes/libusb/libusb_0.1.12.bb
index 3d6a213b45..ccf4a5850e 100644
--- a/recipes/libusb/libusb_0.1.12.bb
+++ b/recipes/libusb/libusb_0.1.12.bb
@@ -1,8 +1,8 @@
-DESCRIPTION = "libusb is a library to provide userspace \
-access to USB devices."
+DESCRIPTION = "libusb is a library to provide userspace access to USB devices."
HOMEPAGE = "http://libusb.sf.net"
SECTION = "libs"
LICENSE = "LGPL"
+PROVIDES = "virtual/libusb0"
PR = "r3"
SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.gz \
diff --git a/recipes/libxine/libxine-1.1.16/ffmpeg_headers.patch b/recipes/libxine/libxine-1.1.16/ffmpeg_headers.patch
new file mode 100644
index 0000000000..be20fe6df4
--- /dev/null
+++ b/recipes/libxine/libxine-1.1.16/ffmpeg_headers.patch
@@ -0,0 +1,19 @@
+Index: xine-lib-1.1.16.3/configure.ac
+===================================================================
+--- xine-lib-1.1.16.3.orig/configure.ac 2009-07-29 01:27:23.448366991 +0200
++++ xine-lib-1.1.16.3/configure.ac 2009-07-29 01:29:12.556348147 +0200
+@@ -350,14 +350,6 @@
+ AC_SUBST([FFMPEG_POSTPROC_LIBS])
+ AC_DEFINE([HAVE_FFMPEG], [1], [Define this if you have ffmpeg library])
+
+- dnl Check presence of ffmpeg/avutil.h to see if it's old or new
+- dnl style for headers. The new style would be preferred actually...
+- AC_CHECK_HEADERS([ffmpeg/avutil.h])
+- AC_CHECK_HEADERS([libavutil/avutil.h])
+- if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then
+- AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!])
+- fi
+-
+ AC_MSG_RESULT([using external ffmpeg])
+ else
+ AC_MSG_NOTICE([
diff --git a/recipes/libxine/libxine_1.1.16.3.bb b/recipes/libxine/libxine_1.1.16.3.bb
index 21e5a6bd21..1d7ccb2137 100644
--- a/recipes/libxine/libxine_1.1.16.3.bb
+++ b/recipes/libxine/libxine_1.1.16.3.bb
@@ -1,13 +1,14 @@
require libxine.inc
PPDIR = "1.26"
-PR = "r0"
+PR = "r1"
FILESPATHPKG .= ":libxine-1.1.16"
SRC_URI += " \
file://libxine-arm-configure.patch;patch=1 \
file://iconv.patch;patch=1 \
+ file://ffmpeg_headers.patch;patch=1 \
"
python populate_packages_prepend () {
diff --git a/recipes/linux/linux-2.6.24/hipox/defconfig b/recipes/linux/linux-2.6.24/hipox/defconfig
index 53a97a04e3..442bf3c651 100644
--- a/recipes/linux/linux-2.6.24/hipox/defconfig
+++ b/recipes/linux/linux-2.6.24/hipox/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24.4
-# Wed Apr 29 08:34:25 2009
+# Wed Jul 29 12:54:46 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -166,8 +166,8 @@ CONFIG_ARCH_HIPOX_UART2_DEBUG=y
CONFIG_ARCH_HIPOX_UART2_BOOTPROGRESS=y
# CONFIG_ARCH_HIPOX_UART2_MODEM is not set
# CONFIG_ARCH_HIPOX_UART3 is not set
-# CONFIG_ARCH_HIPOX_PCI_REQGNT_0 is not set
-CONFIG_ARCH_HIPOX_PCI_REQGNT_1=y
+CONFIG_ARCH_HIPOX_PCI_REQGNT_0=y
+# CONFIG_ARCH_HIPOX_PCI_REQGNT_1 is not set
# CONFIG_ARCH_HIPOX_PCI_REQGNT_2 is not set
# CONFIG_ARCH_HIPOX_PCI_REQGNT_3 is not set
# CONFIG_ARCH_HIPOX_PCI_CLKOUT_0 is not set
@@ -175,7 +175,7 @@ CONFIG_ARCH_HIPOX_PCI_REQGNT_1=y
CONFIG_ARCH_HIPOX_PCI_CLKOUT_2=y
CONFIG_ARCH_HIPOX_PCI_CLKOUT_3=y
CONFIG_HIPOX_PCI_RESET=y
-CONFIG_HIPOX_PCI_RESET_GPIO=2
+CONFIG_HIPOX_PCI_RESET_GPIO=27
# CONFIG_HIPOX_SATA_POWER_1 is not set
# CONFIG_HIPOX_SATA_POWER_2 is not set
CONFIG_FORCE_MAX_ZONEORDER=10
diff --git a/recipes/linux/linux-2.6.24/hipox/hipox-nand.patch b/recipes/linux/linux-2.6.24/hipox/hipox-nand.patch
index 1e37d12774..a0a940f8a5 100644
--- a/recipes/linux/linux-2.6.24/hipox/hipox-nand.patch
+++ b/recipes/linux/linux-2.6.24/hipox/hipox-nand.patch
@@ -141,7 +141,7 @@ diff -Nurd linux-2.6.24-base/drivers/mtd/nand/hipox_nand.c linux-2.6.24/drivers/
+ }, {
+ .name = "system",
+ .offset = 0x02000000,
-+ .size = 0x0e000000,
++ .size = 0x1e000000,
+ },
+};
+#endif
diff --git a/recipes/linux/linux-2.6.27/mpc8315e-rdb/defconfig b/recipes/linux/linux-2.6.27/mpc8315e-rdb/defconfig
new file mode 100644
index 0000000000..84caff7550
--- /dev/null
+++ b/recipes/linux/linux-2.6.27/mpc8315e-rdb/defconfig
@@ -0,0 +1,1766 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.30-rc6
+# Sat Jun 6 23:57:35 2009
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_PPC_BOOK3S=y
+CONFIG_PPC_FPU=y
+CONFIG_FSL_EMB_PERFMON=y
+# CONFIG_ALTIVEC is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DTC=y
+CONFIG_DEFAULT_UIMAGE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+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_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_GROUP_SCHED=y
+# CONFIG_FAIR_GROUP_SCHED is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+# CONFIG_STRIP_ASM_SYMS 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 is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_SLOW_WORK is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+# CONFIG_FREEZER is not set
+CONFIG_PPC_MSI_BITMAP=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_CHRP is not set
+# CONFIG_MPC5121_ADS is not set
+# CONFIG_MPC5121_GENERIC is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_PMAC is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_PPC_83xx=y
+CONFIG_MPC831x_RDB=y
+# CONFIG_MPC832x_MDS is not set
+# CONFIG_MPC832x_RDB is not set
+# CONFIG_MPC834x_MDS is not set
+# CONFIG_MPC834x_ITX is not set
+# CONFIG_MPC836x_MDS is not set
+# CONFIG_MPC836x_RDK is not set
+# CONFIG_MPC837x_MDS is not set
+# CONFIG_MPC837x_RDB is not set
+# CONFIG_SBC834x is not set
+# CONFIG_ASP834x is not set
+CONFIG_PPC_MPC831x=y
+# CONFIG_PPC_86xx is not set
+# CONFIG_EMBEDDED6xx is not set
+# CONFIG_AMIGAONE is not set
+CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
+CONFIG_IPIC=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_TAU is not set
+# CONFIG_QUICC_ENGINE is not set
+# CONFIG_FSL_ULI1575 is not set
+# CONFIG_MPC8xxx_GPIO is not set
+# CONFIG_SIMPLE_GPIO is not set
+# CONFIG_MCU_MPC8349EMITX is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_SCHED_HRTICK=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
+# CONFIG_PPC_256K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_EXTRA_TARGETS=""
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_FSL_PCI=y
+CONFIG_PPC_PCI_CHOICE=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+# CONFIG_PCIEASPM is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_LEGACY is not set
+CONFIG_PCI_DEBUG=y
+# CONFIG_PCI_STUB is not set
+# CONFIG_PCI_IOV is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_PAGE_OFFSET=0xc0000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_PHYSICAL_START=0x00000000
+CONFIG_TASK_SIZE=0xc0000000
+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_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# 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_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# 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_LRO is not set
+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_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_NET_DSA 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
+# CONFIG_PHONET is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_LIB80211 is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+CONFIG_MTD_DEBUG=y
+CONFIG_MTD_DEBUG_VERBOSE=1
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_OF_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+CONFIG_MTD_NAND_FSL_ELBC=y
+# CONFIG_MTD_NAND_FSL_UPM is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=m
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
+CONFIG_OF_SPI=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# 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=32768
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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=y
+# 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=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_CXGB3_ISCSI 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_ADVANSYS 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_MPT2SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_FCOE is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR 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
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_SATA_FSL=y
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_AUTODETECT=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+# CONFIG_MD_RAID10 is not set
+# CONFIG_MD_RAID456 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_MD_FAULTY is not set
+# CONFIG_BLK_DEV_DM is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+CONFIG_COMPAT_NET_DEV_OPS=y
+# 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_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+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_ENC28J60 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR 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_E100=y
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SMSC9420 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_IGBVF 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_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_FSL_PQ_MDIO=y
+CONFIG_GIANFAR=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+# CONFIG_JME is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+CONFIG_CHELSIO_T3_DEPENDS=y
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_ENIC is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_VXGE is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
+# CONFIG_SFC is not set
+# CONFIG_BE2NET is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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 is not set
+# 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_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE 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 is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# 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_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+# CONFIG_SERIAL_OF_PLATFORM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_ALTPCIESGDMA=m
+# CONFIG_HVC_UDBG is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_ISCH is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Graphics adapter I2C/DDC channel drivers
+#
+# CONFIG_I2C_VOODOO3 is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_MPC83xx=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_I5K_AMB is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_G760A 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_LM70 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_LTC4215 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_LM95241 is not set
+# CONFIG_SENSORS_MAX1111 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_PCF8591 is not set
+# CONFIG_SENSORS_SIS5595 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_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_8xxx_WDT is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+# CONFIG_HID_PID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# Special HID drivers
+#
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_EHCI_HCD_PPC_OF=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PPC_OF=y
+CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
+# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
+CONFIG_USB_OHCI_HCD_PCI=y
+CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
+CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+CONFIG_USB_GADGET_NET2280=y
+CONFIG_USB_NET2280=y
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+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=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_GENERIC is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_BTRFS_FS=y
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_UBIFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
+CONFIG_NLATTR=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+# 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=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS 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=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_TRACING_SUPPORT=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_EVENT_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_KMEMTRACE is not set
+# CONFIG_WORKQUEUE_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_CODE_PATCHING_SELFTEST is not set
+# CONFIG_FTR_FIXUP_SELFTEST is not set
+# CONFIG_MSI_BITMAP_SELFTEST is not set
+# CONFIG_XMON is not set
+# CONFIG_IRQSTACKS is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+# CONFIG_CRYPTO_DEV_TALITOS is not set
+# CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
diff --git a/recipes/linux/linux-2.6.27/mpc8315e-rdb/mpc8315erdb-add-msi-to-dts.patch b/recipes/linux/linux-2.6.27/mpc8315e-rdb/mpc8315erdb-add-msi-to-dts.patch
new file mode 100644
index 0000000000..149ad3c1c5
--- /dev/null
+++ b/recipes/linux/linux-2.6.27/mpc8315e-rdb/mpc8315erdb-add-msi-to-dts.patch
@@ -0,0 +1,29 @@
+Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
+Tested-by: Leon Woestenberg <leon@sidebranch.com>
+
+diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
+index 3f4c5fb..4f04667 100644
+--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
++++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
+@@ -322,6 +322,21 @@
+ reg = <0x700 0x100>;
+ device_type = "ipic";
+ };
++
++ ipic-msi@7c0 {
++ compatible = "fsl,ipic-msi";
++ reg = <0x7c0 0x40>;
++ msi-available-ranges = <0 0x100>;
++ interrupts = < 0x43 0x8
++ 0x4 0x8
++ 0x51 0x8
++ 0x52 0x8
++ 0x56 0x8
++ 0x57 0x8
++ 0x58 0x8
++ 0x59 0x8 >;
++ interrupt-parent = < &ipic >;
++ };
+ };
+
+ pci0: pci@e0008500 {
diff --git a/recipes/linux/linux-2.6.28/at91sam9263ek/defconfig b/recipes/linux/linux-2.6.28/at91sam9263ek/defconfig
index 72a8bb8e21..772522a096 100644
--- a/recipes/linux/linux-2.6.28/at91sam9263ek/defconfig
+++ b/recipes/linux/linux-2.6.28/at91sam9263ek/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.28
-# Wed Jan 28 15:11:30 2009
+# Tue Jul 14 22:07:16 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -34,8 +34,8 @@ CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-# CONFIG_SWAP is not set
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
@@ -53,8 +53,7 @@ CONFIG_NAMESPACES=y
# CONFIG_IPC_NS is not set
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_BLK_DEV_INITRD is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
@@ -81,8 +80,9 @@ CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
-# CONFIG_PROFILING is not set
+CONFIG_PROFILING=y
# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_HAVE_KPROBES=y
@@ -111,16 +111,16 @@ CONFIG_BLOCK=y
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_DEFAULT_AS=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_CLASSIC_RCU=y
-# CONFIG_FREEZER is not set
+CONFIG_FREEZER=y
#
# System Type
@@ -203,6 +203,7 @@ CONFIG_MTD_AT91_DATAFLASH_CARD=y
# AT91 Feature Selections
#
CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_AT91_SLOW_CLOCK is not set
CONFIG_AT91_TIMER_HZ=100
CONFIG_AT91_EARLY_DBGU=y
# CONFIG_AT91_EARLY_USART0 is not set
@@ -301,7 +302,7 @@ CONFIG_CPU_IDLE_GOV_MENU=y
#
# At least one emulation must be selected
#
-CONFIG_VFP=y
+# CONFIG_VFP is not set
#
# Userspace binary formats
@@ -315,7 +316,12 @@ CONFIG_HAVE_AOUT=y
#
# Power management options
#
-# CONFIG_PM is not set
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_APM_EMULATION=m
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y
@@ -325,6 +331,11 @@ CONFIG_NET=y
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_XFRM_STATISTICS is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
@@ -342,7 +353,7 @@ CONFIG_IP_PNP_BOOTP=y
# 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_TUNNEL=m
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
@@ -353,7 +364,25 @@ CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
# CONFIG_NETLABEL is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
@@ -504,12 +533,7 @@ CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_ALAUDA is not set
-CONFIG_MTD_ONENAND=y
-# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
-CONFIG_MTD_ONENAND_GENERIC=y
-# CONFIG_MTD_ONENAND_OTP is not set
-# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
-# CONFIG_MTD_ONENAND_SIM is not set
+# CONFIG_MTD_ONENAND is not set
#
# UBI - Unsorted block images
@@ -526,18 +550,21 @@ CONFIG_MTD_UBI_GLUEBI=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_COW_COMMON is not set
-# CONFIG_BLK_DEV_LOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_UB is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
+CONFIG_ATA_OVER_ETH=m
CONFIG_MISC_DEVICES=y
-# CONFIG_ATMEL_PWM is not set
-# CONFIG_ATMEL_TCLIB is not set
+CONFIG_ATMEL_PWM=y
+CONFIG_ATMEL_TCLIB=y
+CONFIG_ATMEL_TCB_CLKSRC=y
+CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_ICS932S401 is not set
-# CONFIG_ATMEL_SSC is not set
+CONFIG_ATMEL_SSC=y
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_C2PORT is not set
CONFIG_HAVE_IDE=y
@@ -551,7 +578,7 @@ CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
+# CONFIG_SCSI_PROC_FS is not set
#
# SCSI support type (disk, tape, CD-ROM)
@@ -589,7 +616,7 @@ CONFIG_NETDEVICES=y
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
+CONFIG_TUN=m
# CONFIG_VETH is not set
CONFIG_PHYLIB=y
@@ -661,18 +688,18 @@ CONFIG_USB_ARMLINUX=y
# CONFIG_USB_KC2190 is not set
CONFIG_USB_NET_ZAURUS=m
# CONFIG_WAN is not set
-CONFIG_PPP=y
+CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=y
+CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PPP_DEFLATE is not set
-# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
# CONFIG_PPP_MPPE is not set
# CONFIG_PPPOE is not set
# CONFIG_PPPOL2TP is not set
# CONFIG_SLIP is not set
-CONFIG_SLHC=y
+CONFIG_SLHC=m
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
@@ -683,7 +710,7 @@ CONFIG_SLHC=y
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
+CONFIG_INPUT_POLLDEV=m
#
# Userland interfaces
@@ -706,7 +733,7 @@ CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
@@ -724,7 +751,14 @@ CONFIG_TOUCHSCREEN_ADS7846=y
# CONFIG_TOUCHSCREEN_WM97XX is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
-# CONFIG_INPUT_MISC is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=m
#
# Hardware I/O ports
@@ -771,6 +805,7 @@ CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=y
#
# I2C Hardware Bus support
@@ -779,7 +814,8 @@ CONFIG_I2C_HELPER_AUTO=y
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
-# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_AT91 is not set
+CONFIG_I2C_GPIO=y
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_SIMTEC is not set
@@ -800,7 +836,7 @@ CONFIG_I2C_HELPER_AUTO=y
# Miscellaneous I2C Chip support
#
# CONFIG_DS1682 is not set
-# CONFIG_AT24 is not set
+CONFIG_AT24=y
# CONFIG_SENSORS_EEPROM is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_PCF8575 is not set
@@ -825,66 +861,12 @@ CONFIG_SPI_ATMEL=y
#
# SPI Protocol Masters
#
-# CONFIG_SPI_AT25 is not set
+CONFIG_SPI_AT25=m
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_AD7414 is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ADT7473 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_F71882FG is not set
-# CONFIG_SENSORS_F75375S 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_LM70 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_MAX1111 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_ADS7828 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_W83L786NG is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_THERMAL_HWMON is not set
CONFIG_WATCHDOG=y
@@ -969,7 +951,17 @@ CONFIG_FB_ATMEL=y
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_ATMEL_LCDC=y
+CONFIG_BACKLIGHT_ATMEL_PWM=y
+# CONFIG_BACKLIGHT_CORGI is not set
#
# Display device support
@@ -1002,9 +994,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
-CONFIG_SND_DEBUG=y
-CONFIG_SND_DEBUG_VERBOSE=y
-CONFIG_SND_PCM_XRUN_DEBUG=y
+# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_AC97_CODEC=y
# CONFIG_SND_DRIVERS is not set
@@ -1032,7 +1022,7 @@ CONFIG_USB_HID=y
#
# Special HID drivers
#
-CONFIG_HID_COMPAT=y
+# CONFIG_HID_COMPAT is not set
CONFIG_HID_A4TECH=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
@@ -1070,6 +1060,7 @@ CONFIG_USB=y
CONFIG_USB_DEVICEFS=y
# CONFIG_USB_DEVICE_CLASS is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=y
# CONFIG_USB_WUSB is not set
@@ -1130,8 +1121,7 @@ CONFIG_USB_STORAGE=y
#
# USB port drivers
#
-CONFIG_USB_SERIAL=y
-# CONFIG_USB_SERIAL_CONSOLE is not set
+CONFIG_USB_SERIAL=m
# CONFIG_USB_EZUSB is not set
CONFIG_USB_SERIAL_GENERIC=y
# CONFIG_USB_SERIAL_AIRCABLE is not set
@@ -1199,14 +1189,14 @@ CONFIG_USB_SERIAL_PL2303=m
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_VST is not set
-CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET=m
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_SELECTED=y
CONFIG_USB_GADGET_AT91=y
-CONFIG_USB_AT91=y
+CONFIG_USB_AT91=m
# CONFIG_USB_GADGET_ATMEL_USBA is not set
# CONFIG_USB_GADGET_FSL_USB2 is not set
# CONFIG_USB_GADGET_LH7A40X is not set
@@ -1230,7 +1220,7 @@ CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_G_SERIAL=m
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
-# CONFIG_USB_CDC_COMPOSITE is not set
+CONFIG_USB_CDC_COMPOSITE=m
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
@@ -1251,7 +1241,25 @@ CONFIG_MMC_AT91=y
# CONFIG_MMC_SPI is not set
# CONFIG_MEMSTICK is not set
# CONFIG_ACCESSIBILITY is not set
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_ATMEL_PWM=y
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
@@ -1610,6 +1618,7 @@ CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=m
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_MANAGER=y
@@ -1647,7 +1656,7 @@ CONFIG_CRYPTO_CBC=y
#
# Digest
#
-# CONFIG_CRYPTO_CRC32C is not set
+CONFIG_CRYPTO_CRC32C=m
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/recipes/linux/linux-2.6.30/tx25/defconfig b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig
index db27e0251f..0fd0163521 100644
--- a/recipes/linux/linux-2.6.30/tx25/defconfig
+++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.30-rc4
-# Tue Jun 2 15:46:43 2009
+# Thu Jul 16 17:08:59 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -35,7 +35,7 @@ CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
@@ -238,7 +238,7 @@ CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PREEMPT=y
CONFIG_HZ=100
CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
+# CONFIG_OABI_COMPAT is not set
CONFIG_ARCH_FLATMEM_HAS_HOLES=y
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
@@ -264,7 +264,7 @@ CONFIG_ALIGNMENT_TRAP=y
#
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_CMDLINE="init=/linuxrc root=1f01 rootfstype=jffs2 ro console=ttymxc0,115200 panic=1"
+CONFIG_CMDLINE=" debug "
# CONFIG_XIP_KERNEL is not set
# CONFIG_KEXEC is not set
@@ -282,9 +282,6 @@ CONFIG_CPU_IDLE_GOV_MENU=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
CONFIG_VFP=y
#
@@ -369,7 +366,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+
+#
+# CAN Device Drivers
+#
+# CONFIG_CAN_VCAN is not set
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_CAN_FLEXCAN=y
+CONFIG_CAN_FLEXCAN_CAN2=y
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
@@ -396,8 +403,7 @@ CONFIG_EXTRA_FIRMWARE=""
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
CONFIG_MTD=y
-CONFIG_MTD_DEBUG=y
-CONFIG_MTD_DEBUG_VERBOSE=0
+# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_TESTS=m
@@ -462,7 +468,7 @@ CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=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_GPIO is not set
@@ -470,9 +476,11 @@ CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
-# CONFIG_MTD_NAND_MXC is not set
-CONFIG_ARCH_MXC_HAS_NFC_V2=y
-CONFIG_ARCH_MXC_HAS_NFC_V2_1=y
+# CONFIG_MTD_ALAUDA is not set
+CONFIG_MTD_NAND_MXC=y
+CONFIG_MTD_NAND_MXC_FLASH_BBT=y
+CONFIG_ARCH_MXC_HAS_NFC_V1=y
+CONFIG_ARCH_MXC_HAS_NFC_V1_1=y
# CONFIG_MTD_ONENAND is not set
#
@@ -490,6 +498,7 @@ CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_LOOP=m
# 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=8192
@@ -511,9 +520,46 @@ CONFIG_HAVE_IDE=y
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
-# CONFIG_SCSI is not set
-# CONFIG_SCSI_DMA 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=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
# CONFIG_ATA is not set
# CONFIG_MD is not set
CONFIG_NETDEVICES=y
@@ -522,7 +568,7 @@ CONFIG_COMPAT_NET_DEV_OPS=y
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
+CONFIG_TUN=m
# CONFIG_VETH is not set
CONFIG_PHYLIB=y
@@ -575,9 +621,28 @@ CONFIG_FEC=y
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
+
+#
+# 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 is not set
# CONFIG_WAN is not set
-# CONFIG_PPP is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOL2TP=m
# CONFIG_SLIP is not set
+CONFIG_SLHC=m
CONFIG_NETCONSOLE=y
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
@@ -595,12 +660,12 @@ CONFIG_INPUT=y
#
# Userland interfaces
#
-CONFIG_INPUT_MOUSEDEV=m
+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_EVDEV=m
+CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
# CONFIG_INPUT_APMPOWER is not set
@@ -618,11 +683,27 @@ CONFIG_KEYBOARD_GPIO=m
CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set
# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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 is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_MXC_TSADCC=y
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_INPUT_MISC is not set
#
@@ -778,14 +859,211 @@ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO is not set
# CONFIG_SOUND is not set
-# CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
-# CONFIG_MMC is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_DRAGONRISE_FF is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MICROSOFT is not set
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SONY is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+CONFIG_USB_EHCI_MXC=y
+CONFIG_ARCH_MXC_EHCI_USBH2=y
+CONFIG_ARCH_MXC_EHCI_USBOTG=y
+CONFIG_ARCH_MXC_HAS_USBH2=y
+CONFIG_ARCH_MXC_HAS_USBOTG=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=m
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_USB_G_PRINTER=m
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_MXC is not set
# CONFIG_MEMSTICK is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_NEW_LEDS=y
@@ -824,17 +1102,17 @@ CONFIG_RTC_LIB=y
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
-CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
-CONFIG_EXT3_FS_POSIX_ACL=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
# CONFIG_EXT4_FS is not set
-CONFIG_JBD=m
-CONFIG_FS_MBCACHE=m
+CONFIG_JBD=y
+CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
+# CONFIG_FS_POSIX_ACL is not set
CONFIG_FILE_LOCKING=y
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
@@ -1143,7 +1421,7 @@ CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
-# CONFIG_CRYPTO_SHA1 is not set
+CONFIG_CRYPTO_SHA1=m
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
@@ -1187,7 +1465,7 @@ CONFIG_CRYPTO_HW=y
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_LAST_BIT=y
-# CONFIG_CRC_CCITT is not set
+CONFIG_CRC_CCITT=m
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC_ITU_T is not set
diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch
new file mode 100644
index 0000000000..b030555df6
--- /dev/null
+++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch
@@ -0,0 +1,55110 @@
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/include/asm/barrier.h linux-2.6.30-rc4-git/arch/alpha/include/asm/barrier.h
+--- linux-2.6.30-rc4/arch/alpha/include/asm/barrier.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/include/asm/barrier.h 2009-05-13 09:46:19.000000000 +0200
+@@ -16,11 +16,13 @@ __asm__ __volatile__("wmb": : :"memory")
+ __asm__ __volatile__("mb": : :"memory")
+
+ #ifdef CONFIG_SMP
++#define __ASM_SMP_MB "\tmb\n"
+ #define smp_mb() mb()
+ #define smp_rmb() rmb()
+ #define smp_wmb() wmb()
+ #define smp_read_barrier_depends() read_barrier_depends()
+ #else
++#define __ASM_SMP_MB
+ #define smp_mb() barrier()
+ #define smp_rmb() barrier()
+ #define smp_wmb() barrier()
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/include/asm/futex.h linux-2.6.30-rc4-git/arch/alpha/include/asm/futex.h
+--- linux-2.6.30-rc4/arch/alpha/include/asm/futex.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/include/asm/futex.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,6 +1,116 @@
+-#ifndef _ASM_FUTEX_H
+-#define _ASM_FUTEX_H
++#ifndef _ASM_ALPHA_FUTEX_H
++#define _ASM_ALPHA_FUTEX_H
+
+-#include <asm-generic/futex.h>
++#ifdef __KERNEL__
+
+-#endif
++#include <linux/futex.h>
++#include <linux/uaccess.h>
++#include <asm/errno.h>
++#include <asm/barrier.h>
++
++#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
++ __asm__ __volatile__( \
++ __ASM_SMP_MB \
++ "1: ldl_l %0,0(%2)\n" \
++ insn \
++ "2: stl_c %1,0(%2)\n" \
++ " beq %1,4f\n" \
++ " mov $31,%1\n" \
++ "3: .subsection 2\n" \
++ "4: br 1b\n" \
++ " .previous\n" \
++ " .section __ex_table,\"a\"\n" \
++ " .long 1b-.\n" \
++ " lda $31,3b-1b(%1)\n" \
++ " .long 2b-.\n" \
++ " lda $31,3b-2b(%1)\n" \
++ " .previous\n" \
++ : "=&r" (oldval), "=&r"(ret) \
++ : "r" (uaddr), "r"(oparg) \
++ : "memory")
++
++static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
++{
++ int op = (encoded_op >> 28) & 7;
++ int cmp = (encoded_op >> 24) & 15;
++ int oparg = (encoded_op << 8) >> 20;
++ int cmparg = (encoded_op << 20) >> 20;
++ int oldval = 0, ret;
++ if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
++ oparg = 1 << oparg;
++
++ if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
++ return -EFAULT;
++
++ pagefault_disable();
++
++ switch (op) {
++ case FUTEX_OP_SET:
++ __futex_atomic_op("mov %3,%1\n", ret, oldval, uaddr, oparg);
++ break;
++ case FUTEX_OP_ADD:
++ __futex_atomic_op("addl %0,%3,%1\n", ret, oldval, uaddr, oparg);
++ break;
++ case FUTEX_OP_OR:
++ __futex_atomic_op("or %0,%3,%1\n", ret, oldval, uaddr, oparg);
++ break;
++ case FUTEX_OP_ANDN:
++ __futex_atomic_op("andnot %0,%3,%1\n", ret, oldval, uaddr, oparg);
++ break;
++ case FUTEX_OP_XOR:
++ __futex_atomic_op("xor %0,%3,%1\n", ret, oldval, uaddr, oparg);
++ break;
++ default:
++ ret = -ENOSYS;
++ }
++
++ pagefault_enable();
++
++ if (!ret) {
++ switch (cmp) {
++ case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
++ case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
++ case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
++ case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
++ case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
++ case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
++ default: ret = -ENOSYS;
++ }
++ }
++ return ret;
++}
++
++static inline int
++futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
++{
++ int prev, cmp;
++
++ if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
++ return -EFAULT;
++
++ __asm__ __volatile__ (
++ __ASM_SMP_MB
++ "1: ldl_l %0,0(%2)\n"
++ " cmpeq %0,%3,%1\n"
++ " beq %1,3f\n"
++ " mov %4,%1\n"
++ "2: stl_c %1,0(%2)\n"
++ " beq %1,4f\n"
++ "3: .subsection 2\n"
++ "4: br 1b\n"
++ " .previous\n"
++ " .section __ex_table,\"a\"\n"
++ " .long 1b-.\n"
++ " lda $31,3b-1b(%0)\n"
++ " .long 2b-.\n"
++ " lda $31,3b-2b(%0)\n"
++ " .previous\n"
++ : "=&r"(prev), "=&r"(cmp)
++ : "r"(uaddr), "r"((long)oldval), "r"(newval)
++ : "memory");
++
++ return prev;
++}
++
++#endif /* __KERNEL__ */
++#endif /* _ASM_ALPHA_FUTEX_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/include/asm/uaccess.h linux-2.6.30-rc4-git/arch/alpha/include/asm/uaccess.h
+--- linux-2.6.30-rc4/arch/alpha/include/asm/uaccess.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/include/asm/uaccess.h 2009-05-13 09:46:19.000000000 +0200
+@@ -507,5 +507,7 @@ struct exception_table_entry
+ (pc) + (_fixup)->fixup.bits.nextinsn; \
+ })
+
++#define ARCH_HAS_SORT_EXTABLE
++#define ARCH_HAS_SEARCH_EXTABLE
+
+ #endif /* __ALPHA_UACCESS_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/binfmt_loader.c linux-2.6.30-rc4-git/arch/alpha/kernel/binfmt_loader.c
+--- linux-2.6.30-rc4/arch/alpha/kernel/binfmt_loader.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/binfmt_loader.c 2009-05-13 09:46:19.000000000 +0200
+@@ -46,6 +46,6 @@ static struct linux_binfmt loader_format
+
+ static int __init init_loader_binfmt(void)
+ {
+- return register_binfmt(&loader_format);
++ return insert_binfmt(&loader_format);
+ }
+ arch_initcall(init_loader_binfmt);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/err_ev6.c linux-2.6.30-rc4-git/arch/alpha/kernel/err_ev6.c
+--- linux-2.6.30-rc4/arch/alpha/kernel/err_ev6.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/err_ev6.c 2009-05-13 09:46:19.000000000 +0200
+@@ -229,7 +229,7 @@ ev6_process_logout_frame(struct el_commo
+ }
+
+ void
+-ev6_machine_check(u64 vector, u64 la_ptr)
++ev6_machine_check(unsigned long vector, unsigned long la_ptr)
+ {
+ struct el_common *mchk_header = (struct el_common *)la_ptr;
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/err_ev7.c linux-2.6.30-rc4-git/arch/alpha/kernel/err_ev7.c
+--- linux-2.6.30-rc4/arch/alpha/kernel/err_ev7.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/err_ev7.c 2009-05-13 09:46:19.000000000 +0200
+@@ -117,7 +117,7 @@ ev7_collect_logout_frame_subpackets(stru
+ }
+
+ void
+-ev7_machine_check(u64 vector, u64 la_ptr)
++ev7_machine_check(unsigned long vector, unsigned long la_ptr)
+ {
+ struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr;
+ char *saved_err_prefix = err_print_prefix;
+@@ -246,7 +246,7 @@ ev7_process_pal_subpacket(struct el_subp
+
+ switch(header->type) {
+ case EL_TYPE__PAL__LOGOUT_FRAME:
+- printk("%s*** MCHK occurred on LPID %ld (RBOX %llx)\n",
++ printk("%s*** MCHK occurred on LPID %lld (RBOX %llx)\n",
+ err_print_prefix,
+ packet->by_type.logout.whami,
+ packet->by_type.logout.rbox_whami);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/err_impl.h linux-2.6.30-rc4-git/arch/alpha/kernel/err_impl.h
+--- linux-2.6.30-rc4/arch/alpha/kernel/err_impl.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/err_impl.h 2009-05-13 09:46:19.000000000 +0200
+@@ -60,26 +60,26 @@ extern struct ev7_lf_subpackets *
+ ev7_collect_logout_frame_subpackets(struct el_subpacket *,
+ struct ev7_lf_subpackets *);
+ extern void ev7_register_error_handlers(void);
+-extern void ev7_machine_check(u64, u64);
++extern void ev7_machine_check(unsigned long, unsigned long);
+
+ /*
+ * err_ev6.c
+ */
+ extern void ev6_register_error_handlers(void);
+ extern int ev6_process_logout_frame(struct el_common *, int);
+-extern void ev6_machine_check(u64, u64);
++extern void ev6_machine_check(unsigned long, unsigned long);
+
+ /*
+ * err_marvel.c
+ */
+-extern void marvel_machine_check(u64, u64);
++extern void marvel_machine_check(unsigned long, unsigned long);
+ extern void marvel_register_error_handlers(void);
+
+ /*
+ * err_titan.c
+ */
+ extern int titan_process_logout_frame(struct el_common *, int);
+-extern void titan_machine_check(u64, u64);
++extern void titan_machine_check(unsigned long, unsigned long);
+ extern void titan_register_error_handlers(void);
+ extern int privateer_process_logout_frame(struct el_common *, int);
+-extern void privateer_machine_check(u64, u64);
++extern void privateer_machine_check(unsigned long, unsigned long);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/err_marvel.c linux-2.6.30-rc4-git/arch/alpha/kernel/err_marvel.c
+--- linux-2.6.30-rc4/arch/alpha/kernel/err_marvel.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/err_marvel.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1042,7 +1042,7 @@ marvel_process_logout_frame(struct ev7_l
+ }
+
+ void
+-marvel_machine_check(u64 vector, u64 la_ptr)
++marvel_machine_check(unsigned long vector, unsigned long la_ptr)
+ {
+ struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr;
+ int (*process_frame)(struct ev7_lf_subpackets *, int) = NULL;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/err_titan.c linux-2.6.30-rc4-git/arch/alpha/kernel/err_titan.c
+--- linux-2.6.30-rc4/arch/alpha/kernel/err_titan.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/err_titan.c 2009-05-13 09:46:19.000000000 +0200
+@@ -380,7 +380,7 @@ titan_process_logout_frame(struct el_com
+ }
+
+ void
+-titan_machine_check(u64 vector, u64 la_ptr)
++titan_machine_check(unsigned long vector, unsigned long la_ptr)
+ {
+ struct el_common *mchk_header = (struct el_common *)la_ptr;
+ struct el_TITAN_sysdata_mcheck *tmchk =
+@@ -702,7 +702,7 @@ privateer_process_logout_frame(struct el
+ }
+
+ void
+-privateer_machine_check(u64 vector, u64 la_ptr)
++privateer_machine_check(unsigned long vector, unsigned long la_ptr)
+ {
+ struct el_common *mchk_header = (struct el_common *)la_ptr;
+ struct el_TITAN_sysdata_mcheck *tmchk =
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/Makefile linux-2.6.30-rc4-git/arch/alpha/kernel/Makefile
+--- linux-2.6.30-rc4/arch/alpha/kernel/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror -Wno-sign-compar
+
+ obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
+ irq_alpha.o signal.o setup.o ptrace.o time.o \
+- alpha_ksyms.o systbls.o err_common.o io.o binfmt_loader.o
++ alpha_ksyms.o systbls.o err_common.o io.o
+
+ obj-$(CONFIG_VGA_HOSE) += console.o
+ obj-$(CONFIG_SMP) += smp.o
+@@ -43,6 +43,10 @@ else
+ # Misc support
+ obj-$(CONFIG_ALPHA_SRM) += srmcons.o
+
++ifdef CONFIG_BINFMT_AOUT
++obj-y += binfmt_loader.o
++endif
++
+ # Core logic support
+ obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
+ obj-$(CONFIG_ALPHA_CIA) += core_cia.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/kernel/proto.h linux-2.6.30-rc4-git/arch/alpha/kernel/proto.h
+--- linux-2.6.30-rc4/arch/alpha/kernel/proto.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/kernel/proto.h 2009-05-13 09:46:19.000000000 +0200
+@@ -36,7 +36,6 @@ extern void cia_pci_tbi(struct pci_contr
+ extern struct pci_ops irongate_pci_ops;
+ extern int irongate_pci_clr_err(void);
+ extern void irongate_init_arch(void);
+-extern void irongate_machine_check(u64, u64);
+ #define irongate_pci_tbi ((void *)0)
+
+ /* core_lca.c */
+@@ -49,7 +48,7 @@ extern void lca_pci_tbi(struct pci_contr
+ extern struct pci_ops marvel_pci_ops;
+ extern void marvel_init_arch(void);
+ extern void marvel_kill_arch(int);
+-extern void marvel_machine_check(u64, u64);
++extern void marvel_machine_check(unsigned long, unsigned long);
+ extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
+ extern int marvel_pa_to_nid(unsigned long);
+ extern int marvel_cpuid_to_nid(int);
+@@ -86,7 +85,7 @@ extern void t2_pci_tbi(struct pci_contro
+ extern struct pci_ops titan_pci_ops;
+ extern void titan_init_arch(void);
+ extern void titan_kill_arch(int);
+-extern void titan_machine_check(u64, u64);
++extern void titan_machine_check(unsigned long, unsigned long);
+ extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
+ extern struct _alpha_agp_info *titan_agp_info(void);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/alpha/mm/extable.c linux-2.6.30-rc4-git/arch/alpha/mm/extable.c
+--- linux-2.6.30-rc4/arch/alpha/mm/extable.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/alpha/mm/extable.c 2009-05-13 09:46:19.000000000 +0200
+@@ -3,11 +3,49 @@
+ */
+
+ #include <linux/module.h>
++#include <linux/sort.h>
+ #include <asm/uaccess.h>
+
++static inline unsigned long ex_to_addr(const struct exception_table_entry *x)
++{
++ return (unsigned long)&x->insn + x->insn;
++}
++
++static void swap_ex(void *a, void *b, int size)
++{
++ struct exception_table_entry *ex_a = a, *ex_b = b;
++ unsigned long addr_a = ex_to_addr(ex_a), addr_b = ex_to_addr(ex_b);
++ unsigned int t = ex_a->fixup.unit;
++
++ ex_a->fixup.unit = ex_b->fixup.unit;
++ ex_b->fixup.unit = t;
++ ex_a->insn = (int)(addr_b - (unsigned long)&ex_a->insn);
++ ex_b->insn = (int)(addr_a - (unsigned long)&ex_b->insn);
++}
++
++/*
++ * The exception table needs to be sorted so that the binary
++ * search that we use to find entries in it works properly.
++ * This is used both for the kernel exception table and for
++ * the exception tables of modules that get loaded.
++ */
++static int cmp_ex(const void *a, const void *b)
++{
++ const struct exception_table_entry *x = a, *y = b;
++
++ /* avoid overflow */
++ if (ex_to_addr(x) > ex_to_addr(y))
++ return 1;
++ if (ex_to_addr(x) < ex_to_addr(y))
++ return -1;
++ return 0;
++}
++
+ void sort_extable(struct exception_table_entry *start,
+ struct exception_table_entry *finish)
+ {
++ sort(start, finish - start, sizeof(struct exception_table_entry),
++ cmp_ex, swap_ex);
+ }
+
+ const struct exception_table_entry *
+@@ -20,7 +58,7 @@ search_extable(const struct exception_ta
+ unsigned long mid_value;
+
+ mid = (last - first) / 2 + first;
+- mid_value = (unsigned long)&mid->insn + mid->insn;
++ mid_value = ex_to_addr(mid);
+ if (mid_value == value)
+ return mid;
+ else if (mid_value < value)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/configs/davinci_all_defconfig linux-2.6.30-rc4-git/arch/arm/configs/davinci_all_defconfig
+--- linux-2.6.30-rc4/arch/arm/configs/davinci_all_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/configs/davinci_all_defconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,1784 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.30-rc2
++# Wed Apr 15 08:16:53 2009
++#
++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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
++CONFIG_LOCALVERSION_AUTO=y
++# CONFIG_SWAP is not set
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++CONFIG_POSIX_MQUEUE=y
++CONFIG_POSIX_MQUEUE_SYSCTL=y
++# CONFIG_BSD_PROCESS_ACCT is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
++CONFIG_LOG_BUF_SHIFT=14
++CONFIG_GROUP_SCHED=y
++CONFIG_FAIR_GROUP_SCHED=y
++# CONFIG_RT_GROUP_SCHED is not set
++CONFIG_USER_SCHED=y
++# CONFIG_CGROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++# CONFIG_NAMESPACES is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++# CONFIG_RD_BZIP2 is not set
++# CONFIG_RD_LZMA is not set
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=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_STRIP_ASM_SYMS 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_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_SLUB_DEBUG=y
++CONFIG_COMPAT_BRK=y
++# CONFIG_SLAB is not set
++CONFIG_SLUB=y
++# CONFIG_SLOB is not set
++# CONFIG_PROFILING is not set
++# CONFIG_MARKERS is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_CLK=y
++# CONFIG_SLOW_WORK is not set
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++CONFIG_MODVERSIONS=y
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++CONFIG_IOSCHED_AS=y
++# CONFIG_IOSCHED_DEADLINE is not set
++# CONFIG_IOSCHED_CFQ is not set
++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"
++# CONFIG_FREEZER is not set
++
++#
++# 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_CLPS711X is not set
++# CONFIG_ARCH_EBSA110 is not set
++# CONFIG_ARCH_EP93XX is not set
++# CONFIG_ARCH_GEMINI 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_LH7A40X is not set
++CONFIG_ARCH_DAVINCI=y
++# CONFIG_ARCH_OMAP is not set
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# TI DaVinci Implementations
++#
++
++#
++# DaVinci Core Type
++#
++CONFIG_ARCH_DAVINCI_DM644x=y
++
++#
++# DaVinci Board Type
++#
++CONFIG_MACH_DAVINCI_EVM=y
++CONFIG_DAVINCI_MUX=y
++CONFIG_DAVINCI_MUX_DEBUG=y
++CONFIG_DAVINCI_MUX_WARNINGS=y
++CONFIG_DAVINCI_RESET_CLOCKS=y
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_ARM926T=y
++CONFIG_CPU_32v5=y
++CONFIG_CPU_ABRT_EV5TJ=y
++CONFIG_CPU_PABRT_NOIFAR=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_COPY_V4WB=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
++# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
++# CONFIG_OUTER_CACHE is not set
++CONFIG_COMMON_CLKDEV=y
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++CONFIG_PREEMPT=y
++CONFIG_HZ=100
++CONFIG_AEABI=y
++# CONFIG_OABI_COMPAT is not set
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4096
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=1
++CONFIG_BOUNCE=y
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++CONFIG_HAVE_MLOCK=y
++CONFIG_HAVE_MLOCKED_PAGE_BIT=y
++CONFIG_LEDS=y
++# CONFIG_LEDS_CPU is not set
++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
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_IDLE is not set
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++# CONFIG_VFP is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++
++#
++# Power management options
++#
++# CONFIG_PM is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++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_XFRM_STATISTICS 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 is not set
++# 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=m
++CONFIG_INET_XFRM_MODE_TRANSPORT=y
++CONFIG_INET_XFRM_MODE_TUNNEL=y
++CONFIG_INET_XFRM_MODE_BEET=y
++# CONFIG_INET_LRO is not set
++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=m
++# CONFIG_IPV6_PRIVACY is not set
++# CONFIG_IPV6_ROUTER_PREF is not set
++# CONFIG_IPV6_OPTIMISTIC_DAD is not set
++# CONFIG_INET6_AH is not set
++# CONFIG_INET6_ESP is not set
++# CONFIG_INET6_IPCOMP is not set
++# CONFIG_IPV6_MIP6 is not set
++# CONFIG_INET6_XFRM_TUNNEL is not set
++# CONFIG_INET6_TUNNEL is not set
++CONFIG_INET6_XFRM_MODE_TRANSPORT=m
++CONFIG_INET6_XFRM_MODE_TUNNEL=m
++CONFIG_INET6_XFRM_MODE_BEET=m
++# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
++CONFIG_IPV6_SIT=m
++CONFIG_IPV6_NDISC_NODETYPE=y
++# CONFIG_IPV6_TUNNEL is not set
++# CONFIG_IPV6_MULTIPLE_TABLES is not set
++# CONFIG_IPV6_MROUTE is not set
++# CONFIG_NETWORK_SECMARK is not set
++CONFIG_NETFILTER=y
++# CONFIG_NETFILTER_DEBUG is not set
++CONFIG_NETFILTER_ADVANCED=y
++
++#
++# Core Netfilter Configuration
++#
++# CONFIG_NETFILTER_NETLINK_QUEUE is not set
++# CONFIG_NETFILTER_NETLINK_LOG is not set
++# CONFIG_NF_CONNTRACK is not set
++# CONFIG_NETFILTER_XTABLES is not set
++# CONFIG_IP_VS is not set
++
++#
++# IP: Netfilter Configuration
++#
++# CONFIG_NF_DEFRAG_IPV4 is not set
++# CONFIG_IP_NF_QUEUE is not set
++# CONFIG_IP_NF_IPTABLES is not set
++# CONFIG_IP_NF_ARPTABLES is not set
++
++#
++# IPv6: Netfilter Configuration
++#
++# CONFIG_IP6_NF_QUEUE is not set
++# CONFIG_IP6_NF_IPTABLES 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_NET_DSA 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
++# CONFIG_PHONET is not set
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++# CONFIG_AF_RXRPC is not set
++# CONFIG_WIRELESS is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++# CONFIG_FW_LOADER is not set
++# CONFIG_DEBUG_DRIVER is not set
++# CONFIG_DEBUG_DEVRES is not set
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=m
++# CONFIG_MTD_DEBUG is not set
++# CONFIG_MTD_CONCAT is not set
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_TESTS is not set
++# CONFIG_MTD_REDBOOT_PARTS is not set
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS is not set
++
++#
++# RAM/ROM/Flash chip drivers
++#
++CONFIG_MTD_CFI=m
++# CONFIG_MTD_JEDECPROBE is not set
++CONFIG_MTD_GEN_PROBE=m
++# 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=m
++# CONFIG_MTD_CFI_STAA is not set
++CONFIG_MTD_CFI_UTIL=m
++# CONFIG_MTD_RAM is not set
++# CONFIG_MTD_ROM is not set
++# CONFIG_MTD_ABSENT is not set
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++CONFIG_MTD_PHYSMAP=m
++# CONFIG_MTD_PHYSMAP_COMPAT is not set
++# CONFIG_MTD_ARM_INTEGRATOR 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=m
++# 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_GPIO is not set
++CONFIG_MTD_NAND_IDS=m
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ALAUDA is not set
++CONFIG_MTD_NAND_DAVINCI=m
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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=m
++# 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=1
++CONFIG_BLK_DEV_RAM_SIZE=32768
++# CONFIG_BLK_DEV_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++CONFIG_MISC_DEVICES=y
++# CONFIG_ICS932S401 is not set
++# CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_ISL29003 is not set
++# CONFIG_C2PORT is not set
++
++#
++# EEPROM support
++#
++CONFIG_EEPROM_AT24=y
++# CONFIG_EEPROM_LEGACY is not set
++# CONFIG_EEPROM_93CX6 is not set
++CONFIG_HAVE_IDE=y
++CONFIG_IDE=m
++
++#
++# Please see Documentation/ide/ide.txt for help/info on IDE drives
++#
++CONFIG_IDE_XFER_MODE=y
++CONFIG_IDE_TIMINGS=y
++# CONFIG_BLK_DEV_IDE_SATA is not set
++CONFIG_IDE_GD=m
++CONFIG_IDE_GD_ATA=y
++# CONFIG_IDE_GD_ATAPI is not set
++# CONFIG_BLK_DEV_IDECD is not set
++# CONFIG_BLK_DEV_IDETAPE is not set
++# CONFIG_IDE_TASK_IOCTL is not set
++CONFIG_IDE_PROC_FS=y
++
++#
++# IDE chipset support/bugfixes
++#
++# CONFIG_BLK_DEV_PLATFORM is not set
++CONFIG_BLK_DEV_IDEDMA_SFF=y
++CONFIG_BLK_DEV_PALMCHIP_BK3710=m
++CONFIG_BLK_DEV_IDEDMA=y
++
++#
++# SCSI device support
++#
++# 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
++
++#
++# SCSI support type (disk, tape, CD-ROM)
++#
++CONFIG_BLK_DEV_SD=m
++# 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_SRP_ATTRS is not set
++CONFIG_SCSI_LOWLEVEL=y
++# CONFIG_ISCSI_TCP is not set
++# CONFIG_LIBFC is not set
++# CONFIG_LIBFCOE is not set
++# CONFIG_SCSI_DEBUG is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_SCSI_OSD_INITIATOR is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++CONFIG_COMPAT_NET_DEV_OPS=y
++# CONFIG_DUMMY is not set
++# CONFIG_BONDING is not set
++# CONFIG_MACVLAN is not set
++# CONFIG_EQUALIZER is not set
++CONFIG_TUN=m
++# CONFIG_VETH is not set
++CONFIG_PHYLIB=y
++
++#
++# MII PHY device drivers
++#
++# CONFIG_MARVELL_PHY is not set
++# CONFIG_DAVICOM_PHY is not set
++# CONFIG_QSEMI_PHY is not set
++CONFIG_LXT_PHY=y
++# CONFIG_CICADA_PHY is not set
++# CONFIG_VITESSE_PHY is not set
++# CONFIG_SMSC_PHY is not set
++# CONFIG_BROADCOM_PHY is not set
++# CONFIG_ICPLUS_PHY is not set
++# CONFIG_REALTEK_PHY is not set
++# CONFIG_NATIONAL_PHY is not set
++# CONFIG_STE10XP is not set
++CONFIG_LSI_ET1011C_PHY=y
++# CONFIG_FIXED_PHY is not set
++# CONFIG_MDIO_BITBANG is not set
++CONFIG_NET_ETHERNET=y
++CONFIG_MII=y
++# CONFIG_AX88796 is not set
++# CONFIG_SMC91X is not set
++# CONFIG_DM9000 is not set
++# CONFIG_ETHOC is not set
++# CONFIG_SMC911X is not set
++# CONFIG_SMSC911X is not set
++# CONFIG_DNET is not set
++# CONFIG_IBM_NEW_EMAC_ZMII is not set
++# CONFIG_IBM_NEW_EMAC_RGMII is not set
++# CONFIG_IBM_NEW_EMAC_TAH is not set
++# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
++# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
++# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
++# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
++# CONFIG_B44 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
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++
++#
++# 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 is not set
++# CONFIG_WAN is not set
++CONFIG_PPP=m
++# CONFIG_PPP_MULTILINK is not set
++# CONFIG_PPP_FILTER is not set
++CONFIG_PPP_ASYNC=m
++CONFIG_PPP_SYNC_TTY=m
++CONFIG_PPP_DEFLATE=m
++# CONFIG_PPP_BSDCOMP is not set
++# CONFIG_PPP_MPPE is not set
++# CONFIG_PPPOE is not set
++# CONFIG_PPPOL2TP is not set
++# CONFIG_SLIP is not set
++CONFIG_SLHC=m
++CONFIG_NETCONSOLE=y
++# CONFIG_NETCONSOLE_DYNAMIC is not set
++CONFIG_NETPOLL=y
++CONFIG_NETPOLL_TRAP=y
++CONFIG_NET_POLL_CONTROLLER=y
++# 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=m
++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_EVDEV=m
++CONFIG_INPUT_EVBUG=m
++
++#
++# Input Device Drivers
++#
++CONFIG_INPUT_KEYBOARD=y
++CONFIG_KEYBOARD_ATKBD=m
++# CONFIG_KEYBOARD_SUNKBD is not set
++# CONFIG_KEYBOARD_LKKBD is not set
++CONFIG_KEYBOARD_XTKBD=m
++# CONFIG_KEYBOARD_NEWTON is not set
++# CONFIG_KEYBOARD_STOWAWAY is not set
++CONFIG_KEYBOARD_GPIO=y
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_INPUT_JOYSTICK is not set
++# CONFIG_INPUT_TABLET is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
++# CONFIG_TOUCHSCREEN_AD7879 is not set
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO 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_USB_COMPOSITE is not set
++# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
++# CONFIG_TOUCHSCREEN_TSC2007 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_CONSOLE_TRANSLATIONS=y
++# CONFIG_VT_CONSOLE is not set
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++CONFIG_DEVKMEM=y
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_NR_UARTS=3
++CONFIG_SERIAL_8250_RUNTIME_UARTS=3
++# CONFIG_SERIAL_8250_EXTENDED is not set
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++CONFIG_LEGACY_PTYS=y
++CONFIG_LEGACY_PTY_COUNT=256
++# CONFIG_IPMI_HANDLER is not set
++CONFIG_HW_RANDOM=m
++# CONFIG_HW_RANDOM_TIMERIOMEM is not set
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_HELPER_AUTO=y
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++CONFIG_I2C_DAVINCI=y
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++# CONFIG_I2C_SIMTEC is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++# CONFIG_I2C_TINY_USB is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_PCA_PLATFORM is not set
++# CONFIG_I2C_STUB is not set
++
++#
++# Miscellaneous I2C Chip support
++#
++# CONFIG_DS1682 is not set
++# CONFIG_SENSORS_PCA9539 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
++# CONFIG_SPI is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++# CONFIG_DEBUG_GPIO is not set
++# CONFIG_GPIO_SYSFS is not set
++
++#
++# Memory mapped GPIO expanders:
++#
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++CONFIG_GPIO_PCF857X=m
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_W1 is not set
++# CONFIG_POWER_SUPPLY is not set
++CONFIG_HWMON=y
++# CONFIG_HWMON_VID is not set
++# CONFIG_SENSORS_AD7414 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_ADT7462 is not set
++# CONFIG_SENSORS_ADT7470 is not set
++# CONFIG_SENSORS_ADT7473 is not set
++# CONFIG_SENSORS_ADT7475 is not set
++# CONFIG_SENSORS_ATXP1 is not set
++# CONFIG_SENSORS_DS1621 is not set
++# CONFIG_SENSORS_F71805F is not set
++# CONFIG_SENSORS_F71882FG is not set
++# CONFIG_SENSORS_F75375S is not set
++# CONFIG_SENSORS_G760A 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_LTC4215 is not set
++# CONFIG_SENSORS_LTC4245 is not set
++# CONFIG_SENSORS_LM95241 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_PCF8591 is not set
++# CONFIG_SENSORS_SHT15 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_ADS7828 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_W83L786NG is not set
++# CONFIG_SENSORS_W83627HF is not set
++# CONFIG_SENSORS_W83627EHF is not set
++# CONFIG_HWMON_DEBUG_CHIP is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++CONFIG_WATCHDOG=y
++# CONFIG_WATCHDOG_NOWAYOUT is not set
++
++#
++# Watchdog Device Drivers
++#
++# CONFIG_SOFT_WATCHDOG is not set
++CONFIG_DAVINCI_WATCHDOG=m
++
++#
++# USB-based Watchdog Cards
++#
++# CONFIG_USBPCWATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_TPS65010 is not set
++# CONFIG_TWL4030_CORE is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_PCF50633 is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++CONFIG_VIDEO_DEV=y
++CONFIG_VIDEO_V4L2_COMMON=y
++CONFIG_VIDEO_ALLOW_V4L1=y
++CONFIG_VIDEO_V4L1_COMPAT=y
++# CONFIG_DVB_CORE is not set
++CONFIG_VIDEO_MEDIA=y
++
++#
++# Multimedia drivers
++#
++# CONFIG_MEDIA_ATTACH is not set
++CONFIG_MEDIA_TUNER=y
++# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
++CONFIG_MEDIA_TUNER_SIMPLE=y
++CONFIG_MEDIA_TUNER_TDA8290=y
++CONFIG_MEDIA_TUNER_TDA9887=y
++CONFIG_MEDIA_TUNER_TEA5761=y
++CONFIG_MEDIA_TUNER_TEA5767=y
++CONFIG_MEDIA_TUNER_MT20XX=y
++CONFIG_MEDIA_TUNER_XC2028=y
++CONFIG_MEDIA_TUNER_XC5000=y
++CONFIG_MEDIA_TUNER_MC44S803=y
++CONFIG_VIDEO_V4L2=y
++CONFIG_VIDEO_V4L1=y
++CONFIG_VIDEO_CAPTURE_DRIVERS=y
++# CONFIG_VIDEO_ADV_DEBUG is not set
++# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
++CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
++# CONFIG_VIDEO_VIVI is not set
++# CONFIG_VIDEO_CPIA is not set
++# CONFIG_VIDEO_CPIA2 is not set
++# CONFIG_VIDEO_SAA5246A is not set
++# CONFIG_VIDEO_SAA5249 is not set
++# CONFIG_SOC_CAMERA is not set
++# CONFIG_V4L_USB_DRIVERS is not set
++# CONFIG_RADIO_ADAPTERS is not set
++CONFIG_DAB=y
++# CONFIG_USB_DABUSB is not set
++
++#
++# Graphics support
++#
++# CONFIG_VGASTATE is not set
++CONFIG_VIDEO_OUTPUT_CONTROL=m
++CONFIG_FB=y
++CONFIG_FIRMWARE_EDID=y
++# CONFIG_FB_DDC is not set
++# CONFIG_FB_BOOT_VESA_SUPPORT is not set
++# CONFIG_FB_CFB_FILLRECT is not set
++# CONFIG_FB_CFB_COPYAREA is not set
++# CONFIG_FB_CFB_IMAGEBLIT is not set
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# 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_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT 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=y
++CONFIG_LOGO_LINUX_MONO=y
++CONFIG_LOGO_LINUX_VGA16=y
++CONFIG_LOGO_LINUX_CLUT224=y
++CONFIG_SOUND=m
++# CONFIG_SOUND_OSS_CORE is not set
++CONFIG_SND=m
++CONFIG_SND_TIMER=m
++CONFIG_SND_PCM=m
++CONFIG_SND_JACK=y
++# CONFIG_SND_SEQUENCER is not set
++# CONFIG_SND_MIXER_OSS is not set
++# CONFIG_SND_PCM_OSS is not set
++# CONFIG_SND_HRTIMER 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
++CONFIG_SND_DRIVERS=y
++# 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
++CONFIG_SND_ARM=y
++CONFIG_SND_USB=y
++# CONFIG_SND_USB_AUDIO is not set
++# CONFIG_SND_USB_CAIAQ is not set
++CONFIG_SND_SOC=m
++# CONFIG_SND_DAVINCI_SOC is not set
++CONFIG_SND_SOC_I2C_AND_SPI=m
++# CONFIG_SND_SOC_ALL_CODECS is not set
++# CONFIG_SOUND_PRIME is not set
++CONFIG_HID_SUPPORT=y
++CONFIG_HID=m
++# CONFIG_HID_DEBUG is not set
++# CONFIG_HIDRAW is not set
++
++#
++# USB Input Devices
++#
++CONFIG_USB_HID=m
++# CONFIG_HID_PID is not set
++# CONFIG_USB_HIDDEV is not set
++
++#
++# USB HID Boot Protocol drivers
++#
++# CONFIG_USB_KBD is not set
++# CONFIG_USB_MOUSE is not set
++
++#
++# Special HID drivers
++#
++CONFIG_HID_A4TECH=m
++CONFIG_HID_APPLE=m
++CONFIG_HID_BELKIN=m
++CONFIG_HID_CHERRY=m
++CONFIG_HID_CHICONY=m
++CONFIG_HID_CYPRESS=m
++# CONFIG_DRAGONRISE_FF is not set
++CONFIG_HID_EZKEY=m
++# CONFIG_HID_KYE is not set
++CONFIG_HID_GYRATION=m
++# CONFIG_HID_KENSINGTON is not set
++CONFIG_HID_LOGITECH=m
++# CONFIG_LOGITECH_FF is not set
++# CONFIG_LOGIRUMBLEPAD2_FF is not set
++CONFIG_HID_MICROSOFT=m
++CONFIG_HID_MONTEREY=m
++# CONFIG_HID_NTRIG is not set
++CONFIG_HID_PANTHERLORD=m
++# CONFIG_PANTHERLORD_FF is not set
++CONFIG_HID_PETALYNX=m
++CONFIG_HID_SAMSUNG=m
++CONFIG_HID_SONY=m
++CONFIG_HID_SUNPLUS=m
++# CONFIG_GREENASIA_FF is not set
++# CONFIG_HID_TOPSEED is not set
++# CONFIG_THRUSTMASTER_FF is not set
++# CONFIG_ZEROPLUS_FF is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++# CONFIG_USB_ARCH_HAS_OHCI is not set
++# CONFIG_USB_ARCH_HAS_EHCI is not set
++CONFIG_USB=m
++# CONFIG_USB_DEBUG is not set
++# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
++
++#
++# Miscellaneous USB options
++#
++CONFIG_USB_DEVICEFS=y
++CONFIG_USB_DEVICE_CLASS=y
++# CONFIG_USB_DYNAMIC_MINORS is not set
++# CONFIG_USB_OTG is not set
++# CONFIG_USB_OTG_WHITELIST is not set
++# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_MON=m
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++# CONFIG_USB_OXU210HP_HCD is not set
++# CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_ISP1760_HCD is not set
++# CONFIG_USB_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++CONFIG_USB_MUSB_HDRC=m
++CONFIG_USB_MUSB_SOC=y
++
++#
++# DaVinci 35x and 644x USB support
++#
++# CONFIG_USB_MUSB_HOST is not set
++CONFIG_USB_MUSB_PERIPHERAL=y
++# CONFIG_USB_MUSB_OTG is not set
++CONFIG_USB_GADGET_MUSB_HDRC=y
++CONFIG_MUSB_PIO_ONLY=y
++# CONFIG_USB_MUSB_DEBUG is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
++#
++
++#
++# also be needed; see USB_STORAGE Help for more info
++#
++CONFIG_USB_STORAGE=m
++# CONFIG_USB_STORAGE_DEBUG is not set
++# CONFIG_USB_STORAGE_DATAFAB is not set
++# CONFIG_USB_STORAGE_FREECOM is not set
++# CONFIG_USB_STORAGE_ISD200 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_STORAGE_CYPRESS_ATACB is not set
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++# CONFIG_USB_MICROTEK is not set
++
++#
++# USB port drivers
++#
++# 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_SEVSEG 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_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=m
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_VST is not set
++CONFIG_USB_GADGET=m
++# CONFIG_USB_GADGET_DEBUG is not set
++CONFIG_USB_GADGET_DEBUG_FILES=y
++CONFIG_USB_GADGET_DEBUG_FS=y
++CONFIG_USB_GADGET_VBUS_DRAW=2
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_AT91 is not set
++# CONFIG_USB_GADGET_ATMEL_USBA is not set
++# CONFIG_USB_GADGET_FSL_USB2 is not set
++# CONFIG_USB_GADGET_LH7A40X is not set
++# CONFIG_USB_GADGET_OMAP is not set
++# CONFIG_USB_GADGET_PXA25X is not set
++# CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C2410 is not set
++# CONFIG_USB_GADGET_IMX is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_AMD5536UDC is not set
++# CONFIG_USB_GADGET_FSL_QE is not set
++# CONFIG_USB_GADGET_CI13XXX is not set
++# CONFIG_USB_GADGET_NET2280 is not set
++# CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++CONFIG_USB_GADGET_DUALSPEED=y
++CONFIG_USB_ZERO=m
++CONFIG_USB_ETH=m
++CONFIG_USB_ETH_RNDIS=y
++CONFIG_USB_GADGETFS=m
++CONFIG_USB_FILE_STORAGE=m
++# CONFIG_USB_FILE_STORAGE_TEST is not set
++CONFIG_USB_G_SERIAL=m
++# CONFIG_USB_MIDI_GADGET is not set
++CONFIG_USB_G_PRINTER=m
++CONFIG_USB_CDC_COMPOSITE=m
++
++#
++# OTG and related infrastructure
++#
++CONFIG_USB_OTG_UTILS=y
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_NOP_USB_XCEIV is not set
++CONFIG_MMC=m
++# CONFIG_MMC_DEBUG is not set
++# CONFIG_MMC_UNSAFE_RESUME is not set
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=m
++# CONFIG_MMC_BLOCK_BOUNCE is not set
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=m
++
++#
++# LED drivers
++#
++# CONFIG_LEDS_PCA9532 is not set
++CONFIG_LEDS_GPIO=m
++CONFIG_LEDS_GPIO_PLATFORM=y
++# CONFIG_LEDS_LP5521 is not set
++# CONFIG_LEDS_PCA955X is not set
++# CONFIG_LEDS_BD2802 is not set
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGERS=y
++CONFIG_LEDS_TRIGGER_TIMER=m
++# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
++CONFIG_LEDS_TRIGGER_HEARTBEAT=m
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_GPIO is not set
++# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++
++#
++# iptables trigger is under Netfilter config (LED target)
++#
++CONFIG_RTC_LIB=y
++CONFIG_RTC_CLASS=m
++
++#
++# 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
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# 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
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++
++#
++# SPI RTC drivers
++#
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
++# CONFIG_REGULATOR is not set
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# 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_DEFAULTS_TO_ORDERED is not set
++CONFIG_EXT3_FS_XATTR=y
++# CONFIG_EXT3_FS_POSIX_ACL is not set
++# CONFIG_EXT3_FS_SECURITY is not set
++# CONFIG_EXT4_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_FILE_LOCKING=y
++CONFIG_XFS_FS=m
++# CONFIG_XFS_QUOTA is not set
++# CONFIG_XFS_POSIX_ACL is not set
++# CONFIG_XFS_RT is not set
++# CONFIG_XFS_DEBUG is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++CONFIG_DNOTIFY=y
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++# CONFIG_QUOTA is not set
++# CONFIG_AUTOFS_FS is not set
++CONFIG_AUTOFS4_FS=m
++# CONFIG_FUSE_FS is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE 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_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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=m
++CONFIG_JFFS2_FS_DEBUG=0
++CONFIG_JFFS2_FS_WRITEBUFFER=y
++# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
++# CONFIG_JFFS2_SUMMARY is not set
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++CONFIG_CRAMFS=y
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++CONFIG_MINIX_FS=m
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++# CONFIG_NILFS2_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++# CONFIG_NFS_V4 is not set
++CONFIG_ROOT_NFS=y
++CONFIG_NFSD=m
++CONFIG_NFSD_V3=y
++# CONFIG_NFSD_V3_ACL is not set
++# CONFIG_NFSD_V4 is not set
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_EXPORTFS=m
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++# CONFIG_RPCSEC_GSS_KRB5 is not set
++# CONFIG_RPCSEC_GSS_SPKM3 is not set
++CONFIG_SMB_FS=m
++# 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
++
++#
++# Partition Types
++#
++CONFIG_PARTITION_ADVANCED=y
++# CONFIG_ACORN_PARTITION is not set
++# CONFIG_OSF_PARTITION is not set
++# CONFIG_AMIGA_PARTITION is not set
++# CONFIG_ATARI_PARTITION is not set
++# CONFIG_MAC_PARTITION is not set
++CONFIG_MSDOS_PARTITION=y
++# CONFIG_BSD_DISKLABEL is not set
++# CONFIG_MINIX_SUBPARTITION is not set
++# CONFIG_SOLARIS_X86_PARTITION is not set
++# CONFIG_UNIXWARE_DISKLABEL is not set
++# CONFIG_LDM_PARTITION is not set
++# CONFIG_SGI_PARTITION is not set
++# CONFIG_ULTRIX_PARTITION is not set
++# CONFIG_SUN_PARTITION is not set
++# CONFIG_KARMA_PARTITION is not set
++# CONFIG_EFI_PARTITION is not set
++# CONFIG_SYSV68_PARTITION is not set
++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=m
++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=m
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_WARN_DEPRECATED=y
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++# CONFIG_MAGIC_SYSRQ is not set
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++CONFIG_DEBUG_KERNEL=y
++# CONFIG_DEBUG_SHIRQ is not set
++CONFIG_DETECT_SOFTLOCKUP=y
++# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
++CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_DETECT_HUNG_TASK=y
++# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
++CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
++CONFIG_SCHED_DEBUG=y
++# CONFIG_SCHEDSTATS is not set
++CONFIG_TIMER_STATS=y
++# CONFIG_DEBUG_OBJECTS is not set
++# CONFIG_SLUB_DEBUG_ON is not set
++# CONFIG_SLUB_STATS is not set
++CONFIG_DEBUG_PREEMPT=y
++CONFIG_DEBUG_RT_MUTEXES=y
++CONFIG_DEBUG_PI_LIST=y
++# CONFIG_RT_MUTEX_TESTER is not set
++# CONFIG_DEBUG_SPINLOCK is not set
++CONFIG_DEBUG_MUTEXES=y
++# 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
++CONFIG_DEBUG_BUGVERBOSE=y
++# CONFIG_DEBUG_INFO is not set
++# CONFIG_DEBUG_VM is not set
++# CONFIG_DEBUG_WRITECOUNT is not set
++# CONFIG_DEBUG_MEMORY_INIT is not set
++# CONFIG_DEBUG_LIST is not set
++# CONFIG_DEBUG_SG is not set
++# CONFIG_DEBUG_NOTIFIERS is not set
++# CONFIG_BOOT_PRINTK_DELAY is not set
++# CONFIG_RCU_TORTURE_TEST is not set
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_BACKTRACE_SELF_TEST is not set
++# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
++# CONFIG_FAULT_INJECTION is not set
++# CONFIG_LATENCYTOP is not set
++# CONFIG_SYSCTL_SYSCALL_CHECK is not set
++# CONFIG_PAGE_POISONING is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++CONFIG_TRACING_SUPPORT=y
++
++#
++# Tracers
++#
++# CONFIG_FUNCTION_TRACER is not set
++# CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_PREEMPT_TRACER is not set
++# CONFIG_SCHED_TRACER is not set
++# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_EVENT_TRACER is not set
++# CONFIG_BOOT_TRACER is not set
++# CONFIG_TRACE_BRANCH_PROFILING is not set
++# CONFIG_STACK_TRACER is not set
++# CONFIG_KMEMTRACE is not set
++# CONFIG_WORKQUEUE_TRACER is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_DYNAMIC_DEBUG is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_KGDB is not set
++CONFIG_ARM_UNWIND=y
++CONFIG_DEBUG_USER=y
++CONFIG_DEBUG_ERRORS=y
++# CONFIG_DEBUG_STACK_USAGE is not set
++# CONFIG_DEBUG_LL is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++# CONFIG_CRYPTO_MANAGER is not set
++# CONFIG_CRYPTO_MANAGER2 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++# CONFIG_CRYPTO_CBC is not set
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++
++#
++# Digest
++#
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_MD4 is not set
++# CONFIG_CRYPTO_MD5 is not set
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_ZLIB is not set
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++# CONFIG_CRYPTO_HW is not set
++# CONFIG_BINARY_PRINTF is not set
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=m
++# CONFIG_CRC16 is not set
++CONFIG_CRC_T10DIF=m
++# 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=m
++CONFIG_DECOMPRESS_GZIP=y
++CONFIG_HAS_IOMEM=y
++CONFIG_HAS_IOPORT=y
++CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/configs/mx21_defconfig linux-2.6.30-rc4-git/arch/arm/configs/mx21_defconfig
+--- linux-2.6.30-rc4/arch/arm/configs/mx21_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/configs/mx21_defconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,1170 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.30-rc1
++# Tue Apr 14 16:58:09 2009
++#
++CONFIG_ARM=y
++CONFIG_HAVE_PWM=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_HAVE_LATENCYTOP_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_ARCH_MTD_XIP=y
++CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
++CONFIG_LOCALVERSION_AUTO=y
++# CONFIG_SWAP is not set
++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_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=14
++# CONFIG_GROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++# CONFIG_NAMESPACES is not set
++# CONFIG_BLK_DEV_INITRD is not set
++# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++CONFIG_EMBEDDED=y
++CONFIG_UID16=y
++CONFIG_SYSCTL_SYSCALL=y
++CONFIG_KALLSYMS=y
++CONFIG_KALLSYMS_EXTRA_PASS=y
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_SLOB is not set
++# CONFIG_PROFILING is not set
++# CONFIG_MARKERS is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++# CONFIG_SLOW_WORK is not set
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++# CONFIG_MODULE_FORCE_UNLOAD is not set
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++# CONFIG_IOSCHED_AS is not set
++# CONFIG_IOSCHED_DEADLINE is not set
++# CONFIG_IOSCHED_CFQ is not set
++# CONFIG_DEFAULT_AS is not set
++# CONFIG_DEFAULT_DEADLINE is not set
++# CONFIG_DEFAULT_CFQ is not set
++CONFIG_DEFAULT_NOOP=y
++CONFIG_DEFAULT_IOSCHED="noop"
++# CONFIG_FREEZER is not set
++
++#
++# 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_CLPS711X is not set
++# CONFIG_ARCH_EBSA110 is not set
++# CONFIG_ARCH_EP93XX is not set
++# CONFIG_ARCH_GEMINI is not set
++# CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_NETX is not set
++# CONFIG_ARCH_H720X 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++CONFIG_ARCH_MXC=y
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX 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
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# Freescale MXC Implementations
++#
++# CONFIG_ARCH_MX1 is not set
++CONFIG_ARCH_MX2=y
++# CONFIG_ARCH_MX3 is not set
++CONFIG_MACH_MX21=y
++# CONFIG_MACH_MX27 is not set
++
++#
++# MX2 platforms:
++#
++CONFIG_MACH_MX21ADS=y
++# CONFIG_MXC_IRQ_PRIOR is not set
++CONFIG_MXC_PWM=y
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_ARM926T=y
++CONFIG_CPU_32v5=y
++CONFIG_CPU_ABRT_EV5TJ=y
++CONFIG_CPU_PABRT_NOIFAR=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_COPY_V4WB=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
++# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
++# CONFIG_OUTER_CACHE is not set
++CONFIG_COMMON_CLKDEV=y
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++CONFIG_PREEMPT=y
++CONFIG_HZ=100
++CONFIG_AEABI=y
++CONFIG_OABI_COMPAT=y
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4096
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++CONFIG_HAVE_MLOCK=y
++CONFIG_HAVE_MLOCKED_PAGE_BIT=y
++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
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_IDLE 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
++# CONFIG_VFP is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++
++#
++# Power management options
++#
++# CONFIG_PM is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++# CONFIG_PACKET is not set
++# CONFIG_UNIX is not set
++CONFIG_XFRM=y
++# CONFIG_XFRM_USER is not set
++# CONFIG_XFRM_SUB_POLICY is not set
++# CONFIG_XFRM_MIGRATE is not set
++# CONFIG_XFRM_STATISTICS 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 is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_INET_LRO is not set
++# CONFIG_INET_DIAG is not set
++# 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_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_NET_DSA 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
++# CONFIG_PHONET is not set
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++# CONFIG_AF_RXRPC is not set
++CONFIG_WIRELESS=y
++# CONFIG_CFG80211 is not set
++# CONFIG_WIRELESS_OLD_REGULATORY is not set
++# CONFIG_WIRELESS_EXT is not set
++# CONFIG_LIB80211 is not set
++# CONFIG_MAC80211 is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++# CONFIG_FW_LOADER is not set
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++CONFIG_MTD_DEBUG=y
++CONFIG_MTD_DEBUG_VERBOSE=3
++# CONFIG_MTD_CONCAT is not set
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_TESTS is not set
++CONFIG_MTD_REDBOOT_PARTS=y
++CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
++# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
++# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
++CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS 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=y
++CONFIG_MTD_CFI_NOSWAP=y
++# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
++# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
++CONFIG_MTD_CFI_GEOMETRY=y
++# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
++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_OTP 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_COMPAT is not set
++# CONFIG_MTD_ARM_INTEGRATOR is not set
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_DATAFLASH is not set
++# CONFIG_MTD_M25P80 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
++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_GPIO is not set
++CONFIG_MTD_NAND_IDS=y
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++CONFIG_MTD_NAND_MXC=y
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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 is not set
++# CONFIG_BLK_DEV_NBD is not set
++# CONFIG_BLK_DEV_RAM is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++CONFIG_MISC_DEVICES=y
++# CONFIG_ICS932S401 is not set
++# CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_ISL29003 is not set
++# CONFIG_C2PORT is not set
++
++#
++# EEPROM support
++#
++# CONFIG_EEPROM_AT24 is not set
++# CONFIG_EEPROM_AT25 is not set
++# CONFIG_EEPROM_LEGACY is not set
++# CONFIG_EEPROM_93CX6 is not set
++CONFIG_HAVE_IDE=y
++# CONFIG_IDE is not set
++
++#
++# SCSI device support
++#
++# CONFIG_RAID_ATTRS is not set
++# CONFIG_SCSI is not set
++# CONFIG_SCSI_DMA is not set
++# CONFIG_SCSI_NETLINK is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++CONFIG_COMPAT_NET_DEV_OPS=y
++# 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_VETH 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 is not set
++# CONFIG_ENC28J60 is not set
++# CONFIG_ETHOC is not set
++# CONFIG_SMC911X is not set
++# CONFIG_SMSC911X is not set
++# CONFIG_DNET is not set
++# CONFIG_IBM_NEW_EMAC_ZMII is not set
++# CONFIG_IBM_NEW_EMAC_RGMII is not set
++# CONFIG_IBM_NEW_EMAC_TAH is not set
++# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
++# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
++# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
++# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
++# CONFIG_B44 is not set
++CONFIG_CS89x0=y
++CONFIG_CS89x0_NONISA_IRQ=y
++# 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
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++# CONFIG_WAN is not set
++# CONFIG_PPP is not set
++# CONFIG_SLIP 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 is not set
++# CONFIG_INPUT_JOYDEV 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_TABLET is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_ADS7846 is not set
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO 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_TOUCHIT213 is not set
++# CONFIG_TOUCHSCREEN_TSC2007 is not set
++# 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_CONSOLE_TRANSLATIONS is not set
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++CONFIG_DEVKMEM=y
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_NR_UARTS=1
++CONFIG_SERIAL_8250_RUNTIME_UARTS=1
++# CONFIG_SERIAL_8250_EXTENDED is not set
++
++#
++# Non-8250 serial port support
++#
++# CONFIG_SERIAL_MAX3100 is not set
++CONFIG_SERIAL_IMX=y
++CONFIG_SERIAL_IMX_CONSOLE=y
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++# CONFIG_HW_RANDOM is not set
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_HELPER_AUTO=y
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_GPIO is not set
++CONFIG_I2C_IMX=y
++# CONFIG_I2C_OCORES is not set
++# CONFIG_I2C_SIMTEC is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_PCA_PLATFORM is not set
++# CONFIG_I2C_STUB is not set
++
++#
++# Miscellaneous I2C Chip support
++#
++# CONFIG_DS1682 is not set
++# CONFIG_SENSORS_PCF8574 is not set
++# CONFIG_PCF8575 is not set
++# CONFIG_SENSORS_PCA9539 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
++CONFIG_SPI=y
++CONFIG_SPI_MASTER=y
++
++#
++# SPI Master Controller Drivers
++#
++# CONFIG_SPI_BITBANG is not set
++# CONFIG_SPI_GPIO is not set
++
++#
++# SPI Protocol Masters
++#
++# CONFIG_SPI_SPIDEV is not set
++# CONFIG_SPI_TLE62X0 is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++# CONFIG_GPIO_SYSFS is not set
++
++#
++# Memory mapped GPIO expanders:
++#
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_GPIO_MAX7301 is not set
++# CONFIG_GPIO_MCP23S08 is not set
++# CONFIG_W1 is not set
++# CONFIG_POWER_SUPPLY is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++# CONFIG_WATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_TPS65010 is not set
++# CONFIG_TWL4030_CORE is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_PCF50633 is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++# CONFIG_VIDEO_DEV is not set
++# CONFIG_DVB_CORE is not set
++# CONFIG_VIDEO_MEDIA is not set
++
++#
++# Multimedia drivers
++#
++# CONFIG_DAB is not set
++
++#
++# Graphics support
++#
++# 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_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=y
++CONFIG_FB_CFB_COPYAREA=y
++CONFIG_FB_CFB_IMAGEBLIT=y
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# 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_IMX=y
++# CONFIG_FB_S1D13XXX is not set
++# CONFIG_FB_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT 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=y
++CONFIG_FONT_8x8=y
++# CONFIG_FONT_8x16 is not set
++# CONFIG_FONT_6x11 is not set
++# CONFIG_FONT_7x14 is not set
++# CONFIG_FONT_PEARL_8x8 is not set
++# CONFIG_FONT_ACORN_8x8 is not set
++# CONFIG_FONT_MINI_4x6 is not set
++# CONFIG_FONT_SUN8x16 is not set
++# CONFIG_FONT_SUN12x22 is not set
++# CONFIG_FONT_10x18 is not set
++CONFIG_LOGO=y
++CONFIG_LOGO_LINUX_MONO=y
++CONFIG_LOGO_LINUX_VGA16=y
++CONFIG_LOGO_LINUX_CLUT224=y
++# CONFIG_SOUND is not set
++# CONFIG_HID_SUPPORT is not set
++# CONFIG_USB_SUPPORT is not set
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++# CONFIG_MMC_UNSAFE_RESUME is not set
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_BOUNCE=y
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++CONFIG_MMC_MXC=y
++# CONFIG_MMC_SPI is not set
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++# CONFIG_NEW_LEDS is not set
++CONFIG_RTC_LIB=y
++# CONFIG_RTC_CLASS is not set
++# CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
++# CONFIG_REGULATOR is not set
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# File systems
++#
++# CONFIG_EXT2_FS is not set
++# CONFIG_EXT3_FS is not set
++# CONFIG_EXT4_FS is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++CONFIG_FILE_LOCKING=y
++# CONFIG_XFS_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++# CONFIG_DNOTIFY is not set
++# CONFIG_INOTIFY is not set
++# CONFIG_QUOTA is not set
++# CONFIG_AUTOFS_FS is not set
++# CONFIG_AUTOFS4_FS is not set
++# CONFIG_FUSE_FS is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE 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 is not set
++CONFIG_FAT_DEFAULT_CODEPAGE=437
++# CONFIG_NTFS_FS is not set
++
++#
++# Pseudo filesystems
++#
++CONFIG_PROC_FS=y
++CONFIG_PROC_SYSCTL=y
++CONFIG_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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_FS_WBUF_VERIFY is not set
++# CONFIG_JFFS2_SUMMARY is not set
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++# CONFIG_NILFS2_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++# CONFIG_NFS_V4 is not set
++CONFIG_ROOT_NFS=y
++# CONFIG_NFSD is not set
++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 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
++CONFIG_NLS=y
++CONFIG_NLS_DEFAULT="iso8859-1"
++# CONFIG_NLS_CODEPAGE_437 is not set
++# 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 is not set
++# 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
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_WARN_DEPRECATED=y
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++# 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_DEBUG_MEMORY_INIT is not set
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_LATENCYTOP is not set
++CONFIG_SYSCTL_SYSCALL_CHECK=y
++CONFIG_HAVE_FUNCTION_TRACER=y
++CONFIG_TRACING_SUPPORT=y
++
++#
++# Tracers
++#
++# CONFIG_FUNCTION_TRACER is not set
++# CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_PREEMPT_TRACER is not set
++# CONFIG_SCHED_TRACER is not set
++# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_EVENT_TRACER is not set
++# CONFIG_BOOT_TRACER is not set
++# CONFIG_TRACE_BRANCH_PROFILING is not set
++# CONFIG_STACK_TRACER is not set
++# CONFIG_KMEMTRACE is not set
++# CONFIG_WORKQUEUE_TRACER is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++CONFIG_ARM_UNWIND=y
++# CONFIG_DEBUG_USER is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++# CONFIG_CRYPTO_MANAGER is not set
++# CONFIG_CRYPTO_MANAGER2 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++# CONFIG_CRYPTO_CBC is not set
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++
++#
++# Digest
++#
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_MD4 is not set
++# CONFIG_CRYPTO_MD5 is not set
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_ZLIB is not set
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_HW=y
++# CONFIG_BINARY_PRINTF is not set
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++# CONFIG_CRC_CCITT is not set
++# CONFIG_CRC16 is not set
++# CONFIG_CRC_T10DIF 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_HAS_IOMEM=y
++CONFIG_HAS_IOPORT=y
++CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/configs/mx31moboard_defconfig linux-2.6.30-rc4-git/arch/arm/configs/mx31moboard_defconfig
+--- linux-2.6.30-rc4/arch/arm/configs/mx31moboard_defconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/configs/mx31moboard_defconfig 1970-01-01 01:00:00.000000000 +0100
+@@ -1,790 +0,0 @@
+-#
+-# Automatically generated make config: don't edit
+-# Linux kernel version: 2.6.27-rc5
+-# Fri Oct 24 11:41:22 2008
+-#
+-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_HAVE_LATENCYTOP_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_ARCH_SUPPORTS_AOUT=y
+-CONFIG_ZONE_DMA=y
+-CONFIG_ARCH_MTD_XIP=y
+-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
+-CONFIG_LOCALVERSION_AUTO=y
+-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_AUDIT is not set
+-CONFIG_IKCONFIG=y
+-CONFIG_IKCONFIG_PROC=y
+-CONFIG_LOG_BUF_SHIFT=14
+-# CONFIG_CGROUPS is not set
+-CONFIG_GROUP_SCHED=y
+-CONFIG_FAIR_GROUP_SCHED=y
+-# CONFIG_RT_GROUP_SCHED is not set
+-CONFIG_USER_SCHED=y
+-# CONFIG_CGROUP_SCHED is not set
+-CONFIG_SYSFS_DEPRECATED=y
+-CONFIG_SYSFS_DEPRECATED_V2=y
+-# CONFIG_RELAY is not set
+-# CONFIG_NAMESPACES is not set
+-# CONFIG_BLK_DEV_INITRD is not set
+-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_COMPAT_BRK=y
+-CONFIG_BASE_FULL=y
+-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
+-CONFIG_SLAB=y
+-# CONFIG_SLUB is not set
+-# CONFIG_SLOB is not set
+-# CONFIG_PROFILING is not set
+-# CONFIG_MARKERS is not set
+-CONFIG_HAVE_OPROFILE=y
+-# CONFIG_KPROBES is not set
+-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
+-# CONFIG_HAVE_IOREMAP_PROT is not set
+-CONFIG_HAVE_KPROBES=y
+-CONFIG_HAVE_KRETPROBES=y
+-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+-# CONFIG_HAVE_DMA_ATTRS is not set
+-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
+-# CONFIG_HAVE_CLK is not set
+-CONFIG_PROC_PAGE_MONITOR=y
+-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+-CONFIG_SLABINFO=y
+-CONFIG_RT_MUTEXES=y
+-# CONFIG_TINY_SHMEM is not set
+-CONFIG_BASE_SMALL=0
+-CONFIG_MODULES=y
+-# CONFIG_MODULE_FORCE_LOAD is not set
+-CONFIG_MODULE_UNLOAD=y
+-CONFIG_MODULE_FORCE_UNLOAD=y
+-CONFIG_MODVERSIONS=y
+-# 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
+-# CONFIG_BLK_DEV_INTEGRITY 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"
+-CONFIG_CLASSIC_RCU=y
+-
+-#
+-# 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_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_KIRKWOOD is not set
+-# CONFIG_ARCH_KS8695 is not set
+-# CONFIG_ARCH_NS9XXX is not set
+-# CONFIG_ARCH_LOKI is not set
+-# CONFIG_ARCH_MV78XX0 is not set
+-CONFIG_ARCH_MXC=y
+-# CONFIG_ARCH_ORION5X is not set
+-# CONFIG_ARCH_PNX4008 is not set
+-# CONFIG_ARCH_PXA is not set
+-# 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
+-# CONFIG_ARCH_MSM7X00A is not set
+-
+-#
+-# Boot options
+-#
+-
+-#
+-# Power management
+-#
+-
+-#
+-# Freescale MXC Implementations
+-#
+-# CONFIG_ARCH_MX2 is not set
+-CONFIG_ARCH_MX3=y
+-
+-#
+-# MX3 Options
+-#
+-# CONFIG_MACH_MX31ADS is not set
+-# CONFIG_MACH_PCM037 is not set
+-# CONFIG_MACH_MX31LITE is not set
+-CONFIG_MACH_MX31MOBOARD=y
+-# CONFIG_MXC_IRQ_PRIOR is not set
+-
+-#
+-# Processor Type
+-#
+-CONFIG_CPU_32=y
+-CONFIG_CPU_V6=y
+-# CONFIG_CPU_32v6K is not set
+-CONFIG_CPU_32v6=y
+-CONFIG_CPU_ABRT_EV6=y
+-CONFIG_CPU_PABRT_NOIFAR=y
+-CONFIG_CPU_CACHE_V6=y
+-CONFIG_CPU_CACHE_VIPT=y
+-CONFIG_CPU_COPY_V6=y
+-CONFIG_CPU_TLB_V6=y
+-CONFIG_CPU_HAS_ASID=y
+-CONFIG_CPU_CP15=y
+-CONFIG_CPU_CP15_MMU=y
+-
+-#
+-# Processor Features
+-#
+-CONFIG_ARM_THUMB=y
+-# CONFIG_CPU_ICACHE_DISABLE is not set
+-# CONFIG_CPU_DCACHE_DISABLE is not set
+-# CONFIG_CPU_BPREDICT_DISABLE is not set
+-# CONFIG_OUTER_CACHE is not set
+-
+-#
+-# Bus support
+-#
+-# CONFIG_PCI_SYSCALL is not set
+-# CONFIG_ARCH_SUPPORTS_MSI is not set
+-# CONFIG_PCCARD is not set
+-
+-#
+-# Kernel Features
+-#
+-CONFIG_TICK_ONESHOT=y
+-CONFIG_NO_HZ=y
+-CONFIG_HIGH_RES_TIMERS=y
+-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+-CONFIG_PREEMPT=y
+-CONFIG_HZ=100
+-CONFIG_AEABI=y
+-# CONFIG_OABI_COMPAT is not set
+-CONFIG_ARCH_FLATMEM_HAS_HOLES=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_SPARSEMEM_VMEMMAP_ENABLE is not set
+-CONFIG_PAGEFLAGS_EXTENDED=y
+-CONFIG_SPLIT_PTLOCK_CPUS=4
+-# 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="noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw ip=off"
+-# CONFIG_XIP_KERNEL is not set
+-# CONFIG_KEXEC is not set
+-
+-#
+-# Floating point emulation
+-#
+-
+-#
+-# At least one emulation must be selected
+-#
+-CONFIG_VFP=y
+-
+-#
+-# 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_ARCH_SUSPEND_POSSIBLE=y
+-CONFIG_NET=y
+-
+-#
+-# Networking options
+-#
+-CONFIG_PACKET=y
+-# CONFIG_PACKET_MMAP is not set
+-CONFIG_UNIX=y
+-# 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 is not set
+-# 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 is not set
+-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+-# CONFIG_INET_XFRM_MODE_BEET is not set
+-# CONFIG_INET_LRO is not set
+-# CONFIG_INET_DIAG is not set
+-# 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_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
+-# CONFIG_NET_SCHED is not set
+-
+-#
+-# Network testing
+-#
+-# CONFIG_NET_PKTGEN is not set
+-# CONFIG_HAMRADIO is not set
+-# CONFIG_CAN 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_UEVENT_HELPER_PATH="/sbin/hotplug"
+-CONFIG_STANDALONE=y
+-CONFIG_PREVENT_FIRMWARE_BUILD=y
+-CONFIG_FW_LOADER=m
+-CONFIG_FIRMWARE_IN_KERNEL=y
+-CONFIG_EXTRA_FIRMWARE=""
+-# 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=y
+-CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
+-# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
+-CONFIG_MTD_REDBOOT_PARTS_READONLY=y
+-# CONFIG_MTD_CMDLINE_PARTS is not set
+-# CONFIG_MTD_AFS_PARTS is not set
+-# CONFIG_MTD_AR7_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
+-# CONFIG_MTD_OOPS 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=y
+-CONFIG_MTD_CFI_NOSWAP=y
+-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+-CONFIG_MTD_CFI_GEOMETRY=y
+-# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+-CONFIG_MTD_MAP_BANK_WIDTH_2=y
+-# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
+-# 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 is not set
+-# CONFIG_MTD_CFI_I4 is not set
+-# CONFIG_MTD_CFI_I8 is not set
+-# CONFIG_MTD_OTP 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=0x0
+-CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+-# CONFIG_MTD_ARM_INTEGRATOR 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 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 is not set
+-# CONFIG_MISC_DEVICES is not set
+-CONFIG_HAVE_IDE=y
+-# CONFIG_IDE is not set
+-
+-#
+-# SCSI device support
+-#
+-# CONFIG_RAID_ATTRS is not set
+-# CONFIG_SCSI is not set
+-# CONFIG_SCSI_DMA is not set
+-# CONFIG_SCSI_NETLINK is not set
+-# CONFIG_ATA is not set
+-# CONFIG_MD is not set
+-CONFIG_NETDEVICES=y
+-# 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_VETH is not set
+-# CONFIG_PHYLIB is not set
+-CONFIG_NET_ETHERNET=y
+-CONFIG_MII=y
+-# CONFIG_AX88796 is not set
+-CONFIG_SMC91X=y
+-# CONFIG_DM9000 is not set
+-# CONFIG_IBM_NEW_EMAC_ZMII is not set
+-# CONFIG_IBM_NEW_EMAC_RGMII is not set
+-# CONFIG_IBM_NEW_EMAC_TAH is not set
+-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+-# CONFIG_B44 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
+-# CONFIG_IWLWIFI_LEDS is not set
+-# CONFIG_WAN is not set
+-# CONFIG_PPP is not set
+-# CONFIG_SLIP 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 is not set
+-
+-#
+-# Hardware I/O ports
+-#
+-# CONFIG_SERIO is not set
+-# CONFIG_GAMEPORT is not set
+-
+-#
+-# Character devices
+-#
+-# CONFIG_VT is not set
+-CONFIG_DEVKMEM=y
+-# CONFIG_SERIAL_NONSTANDARD is not set
+-
+-#
+-# Serial drivers
+-#
+-# CONFIG_SERIAL_8250 is not set
+-
+-#
+-# Non-8250 serial port support
+-#
+-CONFIG_SERIAL_IMX=y
+-CONFIG_SERIAL_IMX_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_HW_RANDOM is not set
+-# CONFIG_NVRAM is not set
+-# CONFIG_R3964 is not set
+-# CONFIG_RAW_DRIVER is not set
+-# CONFIG_TCG_TPM is not set
+-# CONFIG_I2C is not set
+-# CONFIG_SPI is not set
+-CONFIG_ARCH_REQUIRE_GPIOLIB=y
+-CONFIG_GPIOLIB=y
+-# CONFIG_GPIO_SYSFS is not set
+-
+-#
+-# I2C GPIO expanders:
+-#
+-
+-#
+-# PCI GPIO expanders:
+-#
+-
+-#
+-# SPI GPIO expanders:
+-#
+-# CONFIG_W1 is not set
+-# CONFIG_POWER_SUPPLY is not set
+-# CONFIG_HWMON is not set
+-# CONFIG_WATCHDOG is not set
+-
+-#
+-# Sonics Silicon Backplane
+-#
+-CONFIG_SSB_POSSIBLE=y
+-# CONFIG_SSB is not set
+-
+-#
+-# Multifunction device drivers
+-#
+-# CONFIG_MFD_CORE is not set
+-# CONFIG_MFD_SM501 is not set
+-# CONFIG_HTC_EGPIO is not set
+-# CONFIG_HTC_PASIC3 is not set
+-# CONFIG_MFD_TMIO is not set
+-# CONFIG_MFD_T7L66XB is not set
+-# CONFIG_MFD_TC6387XB is not set
+-# CONFIG_MFD_TC6393XB is not set
+-
+-#
+-# Multimedia devices
+-#
+-
+-#
+-# Multimedia core support
+-#
+-# CONFIG_VIDEO_DEV is not set
+-# CONFIG_DVB_CORE is not set
+-# CONFIG_VIDEO_MEDIA is not set
+-
+-#
+-# Multimedia drivers
+-#
+-# CONFIG_DAB is not set
+-
+-#
+-# Graphics support
+-#
+-# CONFIG_VGASTATE is not set
+-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+-# CONFIG_FB is not set
+-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+-
+-#
+-# Display device support
+-#
+-# CONFIG_DISPLAY_SUPPORT is not set
+-# CONFIG_SOUND is not set
+-# CONFIG_USB_SUPPORT is not set
+-# CONFIG_MMC is not set
+-# CONFIG_NEW_LEDS is not set
+-CONFIG_RTC_LIB=y
+-# CONFIG_RTC_CLASS is not set
+-# CONFIG_DMADEVICES is not set
+-
+-#
+-# Voltage and Current regulators
+-#
+-# CONFIG_REGULATOR is not set
+-# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+-# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+-# CONFIG_REGULATOR_BQ24022 is not set
+-# CONFIG_UIO is not set
+-
+-#
+-# File systems
+-#
+-# CONFIG_EXT2_FS is not set
+-# CONFIG_EXT3_FS is not set
+-# CONFIG_EXT4DEV_FS is not set
+-# 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_OCFS2_FS is not set
+-# CONFIG_DNOTIFY is not set
+-CONFIG_INOTIFY=y
+-CONFIG_INOTIFY_USER=y
+-# CONFIG_QUOTA is not set
+-# 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_MSDOS_FS is not set
+-# CONFIG_VFAT_FS is not set
+-# 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_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_FS_WBUF_VERIFY is not set
+-# CONFIG_JFFS2_SUMMARY is not set
+-# CONFIG_JFFS2_FS_XATTR is not set
+-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+-CONFIG_JFFS2_ZLIB=y
+-# CONFIG_JFFS2_LZO is not set
+-CONFIG_JFFS2_RTIME=y
+-# CONFIG_JFFS2_RUBIN is not set
+-# CONFIG_CRAMFS is not set
+-# CONFIG_VXFS_FS is not set
+-# CONFIG_MINIX_FS is not set
+-# CONFIG_OMFS_FS is not set
+-# CONFIG_HPFS_FS is not set
+-# CONFIG_QNX4FS_FS is not set
+-# CONFIG_ROMFS_FS is not set
+-# CONFIG_SYSV_FS is not set
+-# CONFIG_UFS_FS is not set
+-CONFIG_NETWORK_FILESYSTEMS=y
+-CONFIG_NFS_FS=y
+-# CONFIG_NFS_V3 is not set
+-# CONFIG_NFS_V4 is not set
+-CONFIG_ROOT_NFS=y
+-# CONFIG_NFSD is not set
+-CONFIG_LOCKD=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 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
+-# CONFIG_NLS is not set
+-# CONFIG_DLM is not set
+-
+-#
+-# Kernel hacking
+-#
+-# CONFIG_PRINTK_TIME is not set
+-# CONFIG_ENABLE_WARN_DEPRECATED is not set
+-# CONFIG_ENABLE_MUST_CHECK is not set
+-CONFIG_FRAME_WARN=1024
+-# 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_DEBUG_MEMORY_INIT is not set
+-CONFIG_FRAME_POINTER=y
+-# CONFIG_LATENCYTOP is not set
+-CONFIG_SYSCTL_SYSCALL_CHECK=y
+-CONFIG_HAVE_FTRACE=y
+-CONFIG_HAVE_DYNAMIC_FTRACE=y
+-# CONFIG_FTRACE is not set
+-# CONFIG_IRQSOFF_TRACER is not set
+-# CONFIG_PREEMPT_TRACER is not set
+-# CONFIG_SCHED_TRACER is not set
+-# CONFIG_CONTEXT_SWITCH_TRACER is not set
+-# CONFIG_SAMPLES is not set
+-CONFIG_HAVE_ARCH_KGDB=y
+-# CONFIG_DEBUG_USER is not set
+-
+-#
+-# Security options
+-#
+-# CONFIG_KEYS is not set
+-# CONFIG_SECURITY is not set
+-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+-# CONFIG_CRYPTO is not set
+-
+-#
+-# Library routines
+-#
+-CONFIG_BITREVERSE=y
+-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
+-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
+-# CONFIG_CRC_CCITT is not set
+-# CONFIG_CRC16 is not set
+-# CONFIG_CRC_T10DIF 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 -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/configs/mx3_defconfig linux-2.6.30-rc4-git/arch/arm/configs/mx3_defconfig
+--- linux-2.6.30-rc4/arch/arm/configs/mx3_defconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/configs/mx3_defconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -197,7 +197,7 @@ CONFIG_MXC_PWM=y
+ #
+ CONFIG_CPU_32=y
+ CONFIG_CPU_V6=y
+-CONFIG_CPU_32v6K=y
++# CONFIG_CPU_32v6K is not set
+ CONFIG_CPU_32v6=y
+ CONFIG_CPU_ABRT_EV6=y
+ CONFIG_CPU_PABRT_NOIFAR=y
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/configs/viper_defconfig linux-2.6.30-rc4-git/arch/arm/configs/viper_defconfig
+--- linux-2.6.30-rc4/arch/arm/configs/viper_defconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/configs/viper_defconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -298,7 +298,6 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+ CONFIG_CPU_FREQ_GOV_USERSPACE=m
+ CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+-CONFIG_CPU_FREQ_PXA=y
+
+ #
+ # Floating point emulation
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/Kconfig linux-2.6.30-rc4-git/arch/arm/Kconfig
+--- linux-2.6.30-rc4/arch/arm/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -308,15 +308,6 @@ config ARCH_H720X
+ help
+ This enables support for systems based on the Hynix HMS720x
+
+-config ARCH_IMX
+- bool "IMX"
+- select CPU_ARM920T
+- select GENERIC_GPIO
+- select GENERIC_TIME
+- select GENERIC_CLOCKEVENTS
+- help
+- Support for Motorola's i.MX family of processors (MX1, MXL).
+-
+ config ARCH_IOP13XX
+ bool "IOP13xx-based"
+ depends on MMU
+@@ -454,6 +445,7 @@ config ARCH_MXC
+ select ARCH_MTD_XIP
+ select GENERIC_GPIO
+ select ARCH_REQUIRE_GPIOLIB
++ select HAVE_CLK
+ help
+ Support for Freescale MXC/iMX-based family of processors
+
+@@ -486,8 +478,6 @@ config ARCH_PXA
+ select HAVE_CLK
+ select COMMON_CLKDEV
+ select ARCH_REQUIRE_GPIOLIB
+- select HAVE_CLK
+- select COMMON_CLKDEV
+ select GENERIC_TIME
+ select GENERIC_CLOCKEVENTS
+ select TICK_ONESHOT
+@@ -585,6 +575,8 @@ config ARCH_DAVINCI
+ select ARCH_REQUIRE_GPIOLIB
+ select HAVE_CLK
+ select ZONE_DMA
++ select HAVE_IDE
++ select COMMON_CLKDEV
+ help
+ Support for TI's DaVinci platform.
+
+@@ -681,8 +673,6 @@ endif
+
+ source "arch/arm/mach-lh7a40x/Kconfig"
+
+-source "arch/arm/mach-imx/Kconfig"
+-
+ source "arch/arm/mach-h720x/Kconfig"
+
+ source "arch/arm/mach-versatile/Kconfig"
+@@ -740,6 +730,56 @@ if !MMU
+ source "arch/arm/Kconfig-nommu"
+ endif
+
++config ARM_ERRATA_411920
++ bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
++ depends on CPU_V6 && !SMP
++ help
++ Invalidation of the Instruction Cache operation can
++ fail. This erratum is present in 1136 (before r1p4), 1156 and 1176.
++ It does not affect the MPCore. This option enables the ARM Ltd.
++ recommended workaround.
++
++config ARM_ERRATA_430973
++ bool "ARM errata: Stale prediction on replaced interworking branch"
++ depends on CPU_V7
++ help
++ This option enables the workaround for the 430973 Cortex-A8
++ (r1p0..r1p2) erratum. If a code sequence containing an ARM/Thumb
++ interworking branch is replaced with another code sequence at the
++ same virtual address, whether due to self-modifying code or virtual
++ to physical address re-mapping, Cortex-A8 does not recover from the
++ stale interworking branch prediction. This results in Cortex-A8
++ executing the new code sequence in the incorrect ARM or Thumb state.
++ The workaround enables the BTB/BTAC operations by setting ACTLR.IBE
++ and also flushes the branch target cache at every context switch.
++ Note that setting specific bits in the ACTLR register may not be
++ available in non-secure mode.
++
++config ARM_ERRATA_458693
++ bool "ARM errata: Processor deadlock when a false hazard is created"
++ depends on CPU_V7
++ help
++ This option enables the workaround for the 458693 Cortex-A8 (r2p0)
++ erratum. For very specific sequences of memory operations, it is
++ possible for a hazard condition intended for a cache line to instead
++ be incorrectly associated with a different cache line. This false
++ hazard might then cause a processor deadlock. The workaround enables
++ the L1 caching of the NEON accesses and disables the PLD instruction
++ in the ACTLR register. Note that setting specific bits in the ACTLR
++ register may not be available in non-secure mode.
++
++config ARM_ERRATA_460075
++ bool "ARM errata: Data written to the L2 cache can be overwritten with stale data"
++ depends on CPU_V7
++ help
++ This option enables the workaround for the 460075 Cortex-A8 (r2p0)
++ erratum. Any asynchronous access to the L2 cache may encounter a
++ situation in which recent store transactions to the L2 cache are lost
++ and overwritten with stale memory contents from external memory. The
++ workaround disables the write-allocate mode for the L2 cache via the
++ ACTLR register. Note that setting specific bits in the ACTLR register
++ may not be available in non-secure mode.
++
+ endmenu
+
+ source "arch/arm/common/Kconfig"
+@@ -971,7 +1011,7 @@ source "mm/Kconfig"
+ config LEDS
+ bool "Timer and CPU usage LEDs"
+ depends on ARCH_CDB89712 || ARCH_EBSA110 || \
+- ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \
++ ARCH_EBSA285 || ARCH_INTEGRATOR || \
+ ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
+ ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
+ ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
+@@ -1137,7 +1177,7 @@ endmenu
+
+ menu "CPU Power Management"
+
+-if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA)
++if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_PXA)
+
+ source "drivers/cpufreq/Kconfig"
+
+@@ -1162,15 +1202,6 @@ config CPU_FREQ_INTEGRATOR
+
+ If in doubt, say Y.
+
+-config CPU_FREQ_IMX
+- tristate "CPUfreq driver for i.MX CPUs"
+- depends on ARCH_IMX && CPU_FREQ
+- default n
+- help
+- This enables the CPUfreq driver for i.MX CPUs.
+-
+- If in doubt, say N.
+-
+ config CPU_FREQ_PXA
+ bool
+ depends on CPU_FREQ && ARCH_PXA && PXA25x
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/board-dm644x-evm.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/board-dm644x-evm.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/board-dm644x-evm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/board-dm644x-evm.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,696 @@
++/*
++ * TI DaVinci EVM board support
++ *
++ * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
++ *
++ * 2007 (c) MontaVista Software, Inc. This file is licensed under
++ * the terms of the GNU General Public License version 2. This program
++ * is licensed "as is" without any warranty of any kind, whether express
++ * or implied.
++ */
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/dma-mapping.h>
++#include <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <linux/leds.h>
++#include <linux/memory.h>
++#include <linux/etherdevice.h>
++
++#include <linux/i2c.h>
++#include <linux/i2c/pcf857x.h>
++#include <linux/i2c/at24.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/partitions.h>
++#include <linux/mtd/physmap.h>
++#include <linux/io.h>
++#include <linux/phy.h>
++#include <linux/clk.h>
++
++#include <asm/setup.h>
++#include <asm/mach-types.h>
++
++#include <asm/mach/arch.h>
++#include <asm/mach/map.h>
++#include <asm/mach/flash.h>
++
++#include <mach/dm644x.h>
++#include <mach/common.h>
++#include <mach/i2c.h>
++#include <mach/serial.h>
++#include <mach/mux.h>
++#include <mach/psc.h>
++#include <mach/nand.h>
++
++#define DM644X_EVM_PHY_MASK (0x2)
++#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
++
++#define DAVINCI_CFC_ATA_BASE 0x01C66000
++
++#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e00000
++#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
++#define DAVINCI_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
++#define DAVINCI_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
++#define DAVINCI_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
++
++#define LXT971_PHY_ID (0x001378e2)
++#define LXT971_PHY_MASK (0xfffffff0)
++
++static struct mtd_partition davinci_evm_norflash_partitions[] = {
++ /* bootloader (UBL, U-Boot, etc) in first 5 sectors */
++ {
++ .name = "bootloader",
++ .offset = 0,
++ .size = 5 * SZ_64K,
++ .mask_flags = MTD_WRITEABLE, /* force read-only */
++ },
++ /* bootloader params in the next 1 sectors */
++ {
++ .name = "params",
++ .offset = MTDPART_OFS_APPEND,
++ .size = SZ_64K,
++ .mask_flags = 0,
++ },
++ /* kernel */
++ {
++ .name = "kernel",
++ .offset = MTDPART_OFS_APPEND,
++ .size = SZ_2M,
++ .mask_flags = 0
++ },
++ /* file system */
++ {
++ .name = "filesystem",
++ .offset = MTDPART_OFS_APPEND,
++ .size = MTDPART_SIZ_FULL,
++ .mask_flags = 0
++ }
++};
++
++static struct physmap_flash_data davinci_evm_norflash_data = {
++ .width = 2,
++ .parts = davinci_evm_norflash_partitions,
++ .nr_parts = ARRAY_SIZE(davinci_evm_norflash_partitions),
++};
++
++/* NOTE: CFI probe will correctly detect flash part as 32M, but EMIF
++ * limits addresses to 16M, so using addresses past 16M will wrap */
++static struct resource davinci_evm_norflash_resource = {
++ .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
++ .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct platform_device davinci_evm_norflash_device = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &davinci_evm_norflash_data,
++ },
++ .num_resources = 1,
++ .resource = &davinci_evm_norflash_resource,
++};
++
++/* DM644x EVM includes a 64 MByte small-page NAND flash (16K blocks).
++ * It may used instead of the (default) NOR chip to boot, using TI's
++ * tools to install the secondary boot loader (UBL) and U-Boot.
++ */
++struct mtd_partition davinci_evm_nandflash_partition[] = {
++ /* Bootloader layout depends on whose u-boot is installed, but we
++ * can hide all the details.
++ * - block 0 for u-boot environment ... in mainline u-boot
++ * - block 1 for UBL (plus up to four backup copies in blocks 2..5)
++ * - blocks 6...? for u-boot
++ * - blocks 16..23 for u-boot environment ... in TI's u-boot
++ */
++ {
++ .name = "bootloader",
++ .offset = 0,
++ .size = SZ_256K + SZ_128K,
++ .mask_flags = MTD_WRITEABLE, /* force read-only */
++ },
++ /* Kernel */
++ {
++ .name = "kernel",
++ .offset = MTDPART_OFS_APPEND,
++ .size = SZ_4M,
++ .mask_flags = 0,
++ },
++ /* File system (older GIT kernels started this on the 5MB mark) */
++ {
++ .name = "filesystem",
++ .offset = MTDPART_OFS_APPEND,
++ .size = MTDPART_SIZ_FULL,
++ .mask_flags = 0,
++ }
++ /* A few blocks at end hold a flash BBT ... created by TI's CCS
++ * using flashwriter_nand.out, but ignored by TI's versions of
++ * Linux and u-boot. We boot faster by using them.
++ */
++};
++
++static struct davinci_nand_pdata davinci_evm_nandflash_data = {
++ .parts = davinci_evm_nandflash_partition,
++ .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
++ .ecc_mode = NAND_ECC_HW,
++ .options = NAND_USE_FLASH_BBT,
++};
++
++static struct resource davinci_evm_nandflash_resource[] = {
++ {
++ .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
++ .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
++ .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++static struct platform_device davinci_evm_nandflash_device = {
++ .name = "davinci_nand",
++ .id = 0,
++ .dev = {
++ .platform_data = &davinci_evm_nandflash_data,
++ },
++ .num_resources = ARRAY_SIZE(davinci_evm_nandflash_resource),
++ .resource = davinci_evm_nandflash_resource,
++};
++
++static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32);
++
++static struct platform_device davinci_fb_device = {
++ .name = "davincifb",
++ .id = -1,
++ .dev = {
++ .dma_mask = &davinci_fb_dma_mask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++ .num_resources = 0,
++};
++
++static struct platform_device rtc_dev = {
++ .name = "rtc_davinci_evm",
++ .id = -1,
++};
++
++static struct resource ide_resources[] = {
++ {
++ .start = DAVINCI_CFC_ATA_BASE,
++ .end = DAVINCI_CFC_ATA_BASE + 0x7ff,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = IRQ_IDE,
++ .end = IRQ_IDE,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 ide_dma_mask = DMA_32BIT_MASK;
++
++static struct platform_device ide_dev = {
++ .name = "palm_bk3710",
++ .id = -1,
++ .resource = ide_resources,
++ .num_resources = ARRAY_SIZE(ide_resources),
++ .dev = {
++ .dma_mask = &ide_dma_mask,
++ .coherent_dma_mask = DMA_32BIT_MASK,
++ },
++};
++
++/*----------------------------------------------------------------------*/
++
++/*
++ * I2C GPIO expanders
++ */
++
++#define PCF_Uxx_BASE(x) (DAVINCI_N_GPIO + ((x) * 8))
++
++
++/* U2 -- LEDs */
++
++static struct gpio_led evm_leds[] = {
++ { .name = "DS8", .active_low = 1,
++ .default_trigger = "heartbeat", },
++ { .name = "DS7", .active_low = 1, },
++ { .name = "DS6", .active_low = 1, },
++ { .name = "DS5", .active_low = 1, },
++ { .name = "DS4", .active_low = 1, },
++ { .name = "DS3", .active_low = 1, },
++ { .name = "DS2", .active_low = 1,
++ .default_trigger = "mmc0", },
++ { .name = "DS1", .active_low = 1,
++ .default_trigger = "ide-disk", },
++};
++
++static const struct gpio_led_platform_data evm_led_data = {
++ .num_leds = ARRAY_SIZE(evm_leds),
++ .leds = evm_leds,
++};
++
++static struct platform_device *evm_led_dev;
++
++static int
++evm_led_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ struct gpio_led *leds = evm_leds;
++ int status;
++
++ while (ngpio--) {
++ leds->gpio = gpio++;
++ leds++;
++ }
++
++ /* what an extremely annoying way to be forced to handle
++ * device unregistration ...
++ */
++ evm_led_dev = platform_device_alloc("leds-gpio", 0);
++ platform_device_add_data(evm_led_dev,
++ &evm_led_data, sizeof evm_led_data);
++
++ evm_led_dev->dev.parent = &client->dev;
++ status = platform_device_add(evm_led_dev);
++ if (status < 0) {
++ platform_device_put(evm_led_dev);
++ evm_led_dev = NULL;
++ }
++ return status;
++}
++
++static int
++evm_led_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ if (evm_led_dev) {
++ platform_device_unregister(evm_led_dev);
++ evm_led_dev = NULL;
++ }
++ return 0;
++}
++
++static struct pcf857x_platform_data pcf_data_u2 = {
++ .gpio_base = PCF_Uxx_BASE(0),
++ .setup = evm_led_setup,
++ .teardown = evm_led_teardown,
++};
++
++
++/* U18 - A/V clock generator and user switch */
++
++static int sw_gpio;
++
++static ssize_t
++sw_show(struct device *d, struct device_attribute *a, char *buf)
++{
++ char *s = gpio_get_value_cansleep(sw_gpio) ? "on\n" : "off\n";
++
++ strcpy(buf, s);
++ return strlen(s);
++}
++
++static DEVICE_ATTR(user_sw, S_IRUGO, sw_show, NULL);
++
++static int
++evm_u18_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ int status;
++
++ /* export dip switch option */
++ sw_gpio = gpio + 7;
++ status = gpio_request(sw_gpio, "user_sw");
++ if (status == 0)
++ status = gpio_direction_input(sw_gpio);
++ if (status == 0)
++ status = device_create_file(&client->dev, &dev_attr_user_sw);
++ else
++ gpio_free(sw_gpio);
++ if (status != 0)
++ sw_gpio = -EINVAL;
++
++ /* audio PLL: 48 kHz (vs 44.1 or 32), single rate (vs double) */
++ gpio_request(gpio + 3, "pll_fs2");
++ gpio_direction_output(gpio + 3, 0);
++
++ gpio_request(gpio + 2, "pll_fs1");
++ gpio_direction_output(gpio + 2, 0);
++
++ gpio_request(gpio + 1, "pll_sr");
++ gpio_direction_output(gpio + 1, 0);
++
++ return 0;
++}
++
++static int
++evm_u18_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ gpio_free(gpio + 1);
++ gpio_free(gpio + 2);
++ gpio_free(gpio + 3);
++
++ if (sw_gpio > 0) {
++ device_remove_file(&client->dev, &dev_attr_user_sw);
++ gpio_free(sw_gpio);
++ }
++ return 0;
++}
++
++static struct pcf857x_platform_data pcf_data_u18 = {
++ .gpio_base = PCF_Uxx_BASE(1),
++ .n_latch = (1 << 3) | (1 << 2) | (1 << 1),
++ .setup = evm_u18_setup,
++ .teardown = evm_u18_teardown,
++};
++
++
++/* U35 - various I/O signals used to manage USB, CF, ATA, etc */
++
++static int
++evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ /* p0 = nDRV_VBUS (initial: don't supply it) */
++ gpio_request(gpio + 0, "nDRV_VBUS");
++ gpio_direction_output(gpio + 0, 1);
++
++ /* p1 = VDDIMX_EN */
++ gpio_request(gpio + 1, "VDDIMX_EN");
++ gpio_direction_output(gpio + 1, 1);
++
++ /* p2 = VLYNQ_EN */
++ gpio_request(gpio + 2, "VLYNQ_EN");
++ gpio_direction_output(gpio + 2, 1);
++
++ /* p3 = n3V3_CF_RESET (initial: stay in reset) */
++ gpio_request(gpio + 3, "nCF_RESET");
++ gpio_direction_output(gpio + 3, 0);
++
++ /* (p4 unused) */
++
++ /* p5 = 1V8_WLAN_RESET (initial: stay in reset) */
++ gpio_request(gpio + 5, "WLAN_RESET");
++ gpio_direction_output(gpio + 5, 1);
++
++ /* p6 = nATA_SEL (initial: select) */
++ gpio_request(gpio + 6, "nATA_SEL");
++ gpio_direction_output(gpio + 6, 0);
++
++ /* p7 = nCF_SEL (initial: deselect) */
++ gpio_request(gpio + 7, "nCF_SEL");
++ gpio_direction_output(gpio + 7, 1);
++
++ /* irlml6401 switches over 1A, in under 8 msec;
++ * now it can be managed by nDRV_VBUS ...
++ */
++ setup_usb(500, 8);
++
++ return 0;
++}
++
++static int
++evm_u35_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
++{
++ gpio_free(gpio + 7);
++ gpio_free(gpio + 6);
++ gpio_free(gpio + 5);
++ gpio_free(gpio + 3);
++ gpio_free(gpio + 2);
++ gpio_free(gpio + 1);
++ gpio_free(gpio + 0);
++ return 0;
++}
++
++static struct pcf857x_platform_data pcf_data_u35 = {
++ .gpio_base = PCF_Uxx_BASE(2),
++ .setup = evm_u35_setup,
++ .teardown = evm_u35_teardown,
++};
++
++/*----------------------------------------------------------------------*/
++
++/* Most of this EEPROM is unused, but U-Boot uses some data:
++ * - 0x7f00, 6 bytes Ethernet Address
++ * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
++ * - ... newer boards may have more
++ */
++static struct memory_accessor *at24_mem_acc;
++
++static void at24_setup(struct memory_accessor *mem_acc, void *context)
++{
++ DECLARE_MAC_BUF(mac_str);
++ char mac_addr[6];
++
++ at24_mem_acc = mem_acc;
++
++ /* Read MAC addr from EEPROM */
++ if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, 6) == 6) {
++ printk(KERN_INFO "Read MAC addr from EEPROM: %s\n",
++ print_mac(mac_str, mac_addr));
++ }
++}
++
++static struct at24_platform_data eeprom_info = {
++ .byte_len = (256*1024) / 8,
++ .page_size = 64,
++ .flags = AT24_FLAG_ADDR16,
++ .setup = at24_setup,
++};
++
++int dm6446evm_eeprom_read(void *buf, off_t off, size_t count)
++{
++ if (at24_mem_acc)
++ return at24_mem_acc->read(at24_mem_acc, buf, off, count);
++ return -ENODEV;
++}
++EXPORT_SYMBOL(dm6446evm_eeprom_read);
++
++int dm6446evm_eeprom_write(void *buf, off_t off, size_t count)
++{
++ if (at24_mem_acc)
++ return at24_mem_acc->write(at24_mem_acc, buf, off, count);
++ return -ENODEV;
++}
++EXPORT_SYMBOL(dm6446evm_eeprom_write);
++
++/*
++ * MSP430 supports RTC, card detection, input from IR remote, and
++ * a bit more. It triggers interrupts on GPIO(7) from pressing
++ * buttons on the IR remote, and for card detect switches.
++ */
++static struct i2c_client *dm6446evm_msp;
++
++static int dm6446evm_msp_probe(struct i2c_client *client,
++ const struct i2c_device_id *id)
++{
++ dm6446evm_msp = client;
++ return 0;
++}
++
++static int dm6446evm_msp_remove(struct i2c_client *client)
++{
++ dm6446evm_msp = NULL;
++ return 0;
++}
++
++static const struct i2c_device_id dm6446evm_msp_ids[] = {
++ { "dm6446evm_msp", 0, },
++ { /* end of list */ },
++};
++
++static struct i2c_driver dm6446evm_msp_driver = {
++ .driver.name = "dm6446evm_msp",
++ .id_table = dm6446evm_msp_ids,
++ .probe = dm6446evm_msp_probe,
++ .remove = dm6446evm_msp_remove,
++};
++
++static int dm6444evm_msp430_get_pins(void)
++{
++ static const char txbuf[2] = { 2, 4, };
++ char buf[4];
++ struct i2c_msg msg[2] = {
++ {
++ .addr = dm6446evm_msp->addr,
++ .flags = 0,
++ .len = 2,
++ .buf = (void __force *)txbuf,
++ },
++ {
++ .addr = dm6446evm_msp->addr,
++ .flags = I2C_M_RD,
++ .len = 4,
++ .buf = buf,
++ },
++ };
++ int status;
++
++ if (!dm6446evm_msp)
++ return -ENXIO;
++
++ /* Command 4 == get input state, returns port 2 and port3 data
++ * S Addr W [A] len=2 [A] cmd=4 [A]
++ * RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P
++ */
++ status = i2c_transfer(dm6446evm_msp->adapter, msg, 2);
++ if (status < 0)
++ return status;
++
++ dev_dbg(&dm6446evm_msp->dev,
++ "PINS: %02x %02x %02x %02x\n",
++ buf[0], buf[1], buf[2], buf[3]);
++
++ return (buf[3] << 8) | buf[2];
++}
++
++static struct i2c_board_info __initdata i2c_info[] = {
++ {
++ I2C_BOARD_INFO("dm6446evm_msp", 0x23),
++ },
++ {
++ I2C_BOARD_INFO("pcf8574", 0x38),
++ .platform_data = &pcf_data_u2,
++ },
++ {
++ I2C_BOARD_INFO("pcf8574", 0x39),
++ .platform_data = &pcf_data_u18,
++ },
++ {
++ I2C_BOARD_INFO("pcf8574", 0x3a),
++ .platform_data = &pcf_data_u35,
++ },
++ {
++ I2C_BOARD_INFO("24c256", 0x50),
++ .platform_data = &eeprom_info,
++ },
++ /* ALSO:
++ * - tvl320aic33 audio codec (0x1b)
++ * - tvp5146 video decoder (0x5d)
++ */
++};
++
++/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
++ * which requires 100 usec of idle bus after i2c writes sent to it.
++ */
++static struct davinci_i2c_platform_data i2c_pdata = {
++ .bus_freq = 20 /* kHz */,
++ .bus_delay = 100 /* usec */,
++};
++
++static void __init evm_init_i2c(void)
++{
++ davinci_init_i2c(&i2c_pdata);
++ i2c_add_driver(&dm6446evm_msp_driver);
++ i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
++}
++
++static struct platform_device *davinci_evm_devices[] __initdata = {
++ &davinci_fb_device,
++ &rtc_dev,
++};
++
++static struct davinci_uart_config uart_config __initdata = {
++ .enabled_uarts = (1 << 0),
++};
++
++static void __init
++davinci_evm_map_io(void)
++{
++ davinci_map_common_io();
++ dm644x_init();
++}
++
++static int davinci_phy_fixup(struct phy_device *phydev)
++{
++ unsigned int control;
++ /* CRITICAL: Fix for increasing PHY signal drive strength for
++ * TX lockup issue. On DaVinci EVM, the Intel LXT971 PHY
++ * signal strength was low causing TX to fail randomly. The
++ * fix is to Set bit 11 (Increased MII drive strength) of PHY
++ * register 26 (Digital Config register) on this phy. */
++ control = phy_read(phydev, 26);
++ phy_write(phydev, 26, (control | 0x800));
++ return 0;
++}
++
++#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
++ defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
++#define HAS_ATA 1
++#else
++#define HAS_ATA 0
++#endif
++
++#if defined(CONFIG_MTD_PHYSMAP) || \
++ defined(CONFIG_MTD_PHYSMAP_MODULE)
++#define HAS_NOR 1
++#else
++#define HAS_NOR 0
++#endif
++
++#if defined(CONFIG_MTD_NAND_DAVINCI) || \
++ defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
++#define HAS_NAND 1
++#else
++#define HAS_NAND 0
++#endif
++
++static __init void davinci_evm_init(void)
++{
++ struct clk *aemif_clk;
++
++ aemif_clk = clk_get(NULL, "aemif");
++ clk_enable(aemif_clk);
++
++ if (HAS_ATA) {
++ if (HAS_NAND || HAS_NOR)
++ pr_warning("WARNING: both IDE and Flash are "
++ "enabled, but they share AEMIF pins.\n"
++ "\tDisable IDE for NAND/NOR support.\n");
++ davinci_cfg_reg(DM644X_HPIEN_DISABLE);
++ davinci_cfg_reg(DM644X_ATAEN);
++ davinci_cfg_reg(DM644X_HDIREN);
++ platform_device_register(&ide_dev);
++ } else if (HAS_NAND || HAS_NOR) {
++ davinci_cfg_reg(DM644X_HPIEN_DISABLE);
++ davinci_cfg_reg(DM644X_ATAEN_DISABLE);
++
++ /* only one device will be jumpered and detected */
++ if (HAS_NAND) {
++ platform_device_register(&davinci_evm_nandflash_device);
++ evm_leds[7].default_trigger = "nand-disk";
++ if (HAS_NOR)
++ pr_warning("WARNING: both NAND and NOR flash "
++ "are enabled; disable one of them.\n");
++ } else if (HAS_NOR)
++ platform_device_register(&davinci_evm_norflash_device);
++ }
++
++ platform_add_devices(davinci_evm_devices,
++ ARRAY_SIZE(davinci_evm_devices));
++ evm_init_i2c();
++
++ davinci_serial_init(&uart_config);
++
++ /* Register the fixup for PHY on DaVinci */
++ phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
++ davinci_phy_fixup);
++
++}
++
++static __init void davinci_evm_irq_init(void)
++{
++ davinci_irq_init();
++}
++
++MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
++ /* Maintainer: MontaVista Software <source@mvista.com> */
++ .phys_io = IO_PHYS,
++ .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
++ .boot_params = (DAVINCI_DDR_BASE + 0x100),
++ .map_io = davinci_evm_map_io,
++ .init_irq = davinci_evm_irq_init,
++ .timer = &davinci_timer,
++ .init_machine = davinci_evm_init,
++MACHINE_END
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/board-evm.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/board-evm.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/board-evm.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/board-evm.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,440 +0,0 @@
+-/*
+- * TI DaVinci EVM board support
+- *
+- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
+- *
+- * 2007 (c) MontaVista Software, Inc. This file is licensed under
+- * the terms of the GNU General Public License version 2. This program
+- * is licensed "as is" without any warranty of any kind, whether express
+- * or implied.
+- */
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-#include <linux/init.h>
+-#include <linux/dma-mapping.h>
+-#include <linux/platform_device.h>
+-#include <linux/gpio.h>
+-#include <linux/leds.h>
+-
+-#include <linux/i2c.h>
+-#include <linux/i2c/pcf857x.h>
+-#include <linux/i2c/at24.h>
+-
+-#include <linux/mtd/mtd.h>
+-#include <linux/mtd/partitions.h>
+-#include <linux/mtd/physmap.h>
+-#include <linux/io.h>
+-
+-#include <asm/setup.h>
+-#include <asm/mach-types.h>
+-
+-#include <asm/mach/arch.h>
+-#include <asm/mach/map.h>
+-#include <asm/mach/flash.h>
+-
+-#include <mach/hardware.h>
+-#include <mach/common.h>
+-#include <mach/i2c.h>
+-
+-/* other misc. init functions */
+-void __init davinci_psc_init(void);
+-void __init davinci_irq_init(void);
+-void __init davinci_map_common_io(void);
+-void __init davinci_init_common_hw(void);
+-
+-#if defined(CONFIG_MTD_PHYSMAP) || \
+- defined(CONFIG_MTD_PHYSMAP_MODULE)
+-
+-static struct mtd_partition davinci_evm_norflash_partitions[] = {
+- /* bootloader (U-Boot, etc) in first 4 sectors */
+- {
+- .name = "bootloader",
+- .offset = 0,
+- .size = 4 * SZ_64K,
+- .mask_flags = MTD_WRITEABLE, /* force read-only */
+- },
+- /* bootloader params in the next 1 sectors */
+- {
+- .name = "params",
+- .offset = MTDPART_OFS_APPEND,
+- .size = SZ_64K,
+- .mask_flags = 0,
+- },
+- /* kernel */
+- {
+- .name = "kernel",
+- .offset = MTDPART_OFS_APPEND,
+- .size = SZ_2M,
+- .mask_flags = 0
+- },
+- /* file system */
+- {
+- .name = "filesystem",
+- .offset = MTDPART_OFS_APPEND,
+- .size = MTDPART_SIZ_FULL,
+- .mask_flags = 0
+- }
+-};
+-
+-static struct physmap_flash_data davinci_evm_norflash_data = {
+- .width = 2,
+- .parts = davinci_evm_norflash_partitions,
+- .nr_parts = ARRAY_SIZE(davinci_evm_norflash_partitions),
+-};
+-
+-/* NOTE: CFI probe will correctly detect flash part as 32M, but EMIF
+- * limits addresses to 16M, so using addresses past 16M will wrap */
+-static struct resource davinci_evm_norflash_resource = {
+- .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
+- .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
+- .flags = IORESOURCE_MEM,
+-};
+-
+-static struct platform_device davinci_evm_norflash_device = {
+- .name = "physmap-flash",
+- .id = 0,
+- .dev = {
+- .platform_data = &davinci_evm_norflash_data,
+- },
+- .num_resources = 1,
+- .resource = &davinci_evm_norflash_resource,
+-};
+-
+-#endif
+-
+-#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
+- defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
+-
+-static struct resource ide_resources[] = {
+- {
+- .start = DAVINCI_CFC_ATA_BASE,
+- .end = DAVINCI_CFC_ATA_BASE + 0x7ff,
+- .flags = IORESOURCE_MEM,
+- },
+- {
+- .start = IRQ_IDE,
+- .end = IRQ_IDE,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static u64 ide_dma_mask = DMA_BIT_MASK(32);
+-
+-static struct platform_device ide_dev = {
+- .name = "palm_bk3710",
+- .id = -1,
+- .resource = ide_resources,
+- .num_resources = ARRAY_SIZE(ide_resources),
+- .dev = {
+- .dma_mask = &ide_dma_mask,
+- .coherent_dma_mask = DMA_BIT_MASK(32),
+- },
+-};
+-
+-#endif
+-
+-/*----------------------------------------------------------------------*/
+-
+-/*
+- * I2C GPIO expanders
+- */
+-
+-#define PCF_Uxx_BASE(x) (DAVINCI_N_GPIO + ((x) * 8))
+-
+-
+-/* U2 -- LEDs */
+-
+-static struct gpio_led evm_leds[] = {
+- { .name = "DS8", .active_low = 1,
+- .default_trigger = "heartbeat", },
+- { .name = "DS7", .active_low = 1, },
+- { .name = "DS6", .active_low = 1, },
+- { .name = "DS5", .active_low = 1, },
+- { .name = "DS4", .active_low = 1, },
+- { .name = "DS3", .active_low = 1, },
+- { .name = "DS2", .active_low = 1,
+- .default_trigger = "mmc0", },
+- { .name = "DS1", .active_low = 1,
+- .default_trigger = "ide-disk", },
+-};
+-
+-static const struct gpio_led_platform_data evm_led_data = {
+- .num_leds = ARRAY_SIZE(evm_leds),
+- .leds = evm_leds,
+-};
+-
+-static struct platform_device *evm_led_dev;
+-
+-static int
+-evm_led_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- struct gpio_led *leds = evm_leds;
+- int status;
+-
+- while (ngpio--) {
+- leds->gpio = gpio++;
+- leds++;
+- }
+-
+- /* what an extremely annoying way to be forced to handle
+- * device unregistration ...
+- */
+- evm_led_dev = platform_device_alloc("leds-gpio", 0);
+- platform_device_add_data(evm_led_dev,
+- &evm_led_data, sizeof evm_led_data);
+-
+- evm_led_dev->dev.parent = &client->dev;
+- status = platform_device_add(evm_led_dev);
+- if (status < 0) {
+- platform_device_put(evm_led_dev);
+- evm_led_dev = NULL;
+- }
+- return status;
+-}
+-
+-static int
+-evm_led_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- if (evm_led_dev) {
+- platform_device_unregister(evm_led_dev);
+- evm_led_dev = NULL;
+- }
+- return 0;
+-}
+-
+-static struct pcf857x_platform_data pcf_data_u2 = {
+- .gpio_base = PCF_Uxx_BASE(0),
+- .setup = evm_led_setup,
+- .teardown = evm_led_teardown,
+-};
+-
+-
+-/* U18 - A/V clock generator and user switch */
+-
+-static int sw_gpio;
+-
+-static ssize_t
+-sw_show(struct device *d, struct device_attribute *a, char *buf)
+-{
+- char *s = gpio_get_value_cansleep(sw_gpio) ? "on\n" : "off\n";
+-
+- strcpy(buf, s);
+- return strlen(s);
+-}
+-
+-static DEVICE_ATTR(user_sw, S_IRUGO, sw_show, NULL);
+-
+-static int
+-evm_u18_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- int status;
+-
+- /* export dip switch option */
+- sw_gpio = gpio + 7;
+- status = gpio_request(sw_gpio, "user_sw");
+- if (status == 0)
+- status = gpio_direction_input(sw_gpio);
+- if (status == 0)
+- status = device_create_file(&client->dev, &dev_attr_user_sw);
+- else
+- gpio_free(sw_gpio);
+- if (status != 0)
+- sw_gpio = -EINVAL;
+-
+- /* audio PLL: 48 kHz (vs 44.1 or 32), single rate (vs double) */
+- gpio_request(gpio + 3, "pll_fs2");
+- gpio_direction_output(gpio + 3, 0);
+-
+- gpio_request(gpio + 2, "pll_fs1");
+- gpio_direction_output(gpio + 2, 0);
+-
+- gpio_request(gpio + 1, "pll_sr");
+- gpio_direction_output(gpio + 1, 0);
+-
+- return 0;
+-}
+-
+-static int
+-evm_u18_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- gpio_free(gpio + 1);
+- gpio_free(gpio + 2);
+- gpio_free(gpio + 3);
+-
+- if (sw_gpio > 0) {
+- device_remove_file(&client->dev, &dev_attr_user_sw);
+- gpio_free(sw_gpio);
+- }
+- return 0;
+-}
+-
+-static struct pcf857x_platform_data pcf_data_u18 = {
+- .gpio_base = PCF_Uxx_BASE(1),
+- .n_latch = (1 << 3) | (1 << 2) | (1 << 1),
+- .setup = evm_u18_setup,
+- .teardown = evm_u18_teardown,
+-};
+-
+-
+-/* U35 - various I/O signals used to manage USB, CF, ATA, etc */
+-
+-static int
+-evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- /* p0 = nDRV_VBUS (initial: don't supply it) */
+- gpio_request(gpio + 0, "nDRV_VBUS");
+- gpio_direction_output(gpio + 0, 1);
+-
+- /* p1 = VDDIMX_EN */
+- gpio_request(gpio + 1, "VDDIMX_EN");
+- gpio_direction_output(gpio + 1, 1);
+-
+- /* p2 = VLYNQ_EN */
+- gpio_request(gpio + 2, "VLYNQ_EN");
+- gpio_direction_output(gpio + 2, 1);
+-
+- /* p3 = n3V3_CF_RESET (initial: stay in reset) */
+- gpio_request(gpio + 3, "nCF_RESET");
+- gpio_direction_output(gpio + 3, 0);
+-
+- /* (p4 unused) */
+-
+- /* p5 = 1V8_WLAN_RESET (initial: stay in reset) */
+- gpio_request(gpio + 5, "WLAN_RESET");
+- gpio_direction_output(gpio + 5, 1);
+-
+- /* p6 = nATA_SEL (initial: select) */
+- gpio_request(gpio + 6, "nATA_SEL");
+- gpio_direction_output(gpio + 6, 0);
+-
+- /* p7 = nCF_SEL (initial: deselect) */
+- gpio_request(gpio + 7, "nCF_SEL");
+- gpio_direction_output(gpio + 7, 1);
+-
+- /* irlml6401 sustains over 3A, switches 5V in under 8 msec */
+- setup_usb(500, 8);
+-
+- return 0;
+-}
+-
+-static int
+-evm_u35_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
+-{
+- gpio_free(gpio + 7);
+- gpio_free(gpio + 6);
+- gpio_free(gpio + 5);
+- gpio_free(gpio + 3);
+- gpio_free(gpio + 2);
+- gpio_free(gpio + 1);
+- gpio_free(gpio + 0);
+- return 0;
+-}
+-
+-static struct pcf857x_platform_data pcf_data_u35 = {
+- .gpio_base = PCF_Uxx_BASE(2),
+- .setup = evm_u35_setup,
+- .teardown = evm_u35_teardown,
+-};
+-
+-/*----------------------------------------------------------------------*/
+-
+-/* Most of this EEPROM is unused, but U-Boot uses some data:
+- * - 0x7f00, 6 bytes Ethernet Address
+- * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
+- * - ... newer boards may have more
+- */
+-static struct at24_platform_data eeprom_info = {
+- .byte_len = (256*1024) / 8,
+- .page_size = 64,
+- .flags = AT24_FLAG_ADDR16,
+-};
+-
+-static struct i2c_board_info __initdata i2c_info[] = {
+- {
+- I2C_BOARD_INFO("pcf8574", 0x38),
+- .platform_data = &pcf_data_u2,
+- },
+- {
+- I2C_BOARD_INFO("pcf8574", 0x39),
+- .platform_data = &pcf_data_u18,
+- },
+- {
+- I2C_BOARD_INFO("pcf8574", 0x3a),
+- .platform_data = &pcf_data_u35,
+- },
+- {
+- I2C_BOARD_INFO("24c256", 0x50),
+- .platform_data = &eeprom_info,
+- },
+- /* ALSO:
+- * - tvl320aic33 audio codec (0x1b)
+- * - msp430 microcontroller (0x23)
+- * - tvp5146 video decoder (0x5d)
+- */
+-};
+-
+-/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
+- * which requires 100 usec of idle bus after i2c writes sent to it.
+- */
+-static struct davinci_i2c_platform_data i2c_pdata = {
+- .bus_freq = 20 /* kHz */,
+- .bus_delay = 100 /* usec */,
+-};
+-
+-static void __init evm_init_i2c(void)
+-{
+- davinci_init_i2c(&i2c_pdata);
+- i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
+-}
+-
+-static struct platform_device *davinci_evm_devices[] __initdata = {
+-#if defined(CONFIG_MTD_PHYSMAP) || \
+- defined(CONFIG_MTD_PHYSMAP_MODULE)
+- &davinci_evm_norflash_device,
+-#endif
+-#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
+- defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
+- &ide_dev,
+-#endif
+-};
+-
+-static void __init
+-davinci_evm_map_io(void)
+-{
+- davinci_map_common_io();
+-}
+-
+-static __init void davinci_evm_init(void)
+-{
+- davinci_psc_init();
+-
+-#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
+- defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
+-#if defined(CONFIG_MTD_PHYSMAP) || \
+- defined(CONFIG_MTD_PHYSMAP_MODULE)
+- printk(KERN_WARNING "WARNING: both IDE and NOR flash are enabled, "
+- "but share pins.\n\t Disable IDE for NOR support.\n");
+-#endif
+-#endif
+-
+- platform_add_devices(davinci_evm_devices,
+- ARRAY_SIZE(davinci_evm_devices));
+- evm_init_i2c();
+-}
+-
+-static __init void davinci_evm_irq_init(void)
+-{
+- davinci_init_common_hw();
+- davinci_irq_init();
+-}
+-
+-MACHINE_START(DAVINCI_EVM, "DaVinci EVM")
+- /* Maintainer: MontaVista Software <source@mvista.com> */
+- .phys_io = IO_PHYS,
+- .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
+- .boot_params = (DAVINCI_DDR_BASE + 0x100),
+- .map_io = davinci_evm_map_io,
+- .init_irq = davinci_evm_irq_init,
+- .timer = &davinci_timer,
+- .init_machine = davinci_evm_init,
+-MACHINE_END
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/clock.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/clock.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/clock.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/clock.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1,7 +1,8 @@
+ /*
+- * TI DaVinci clock config file
++ * Clock and PLL control for DaVinci devices
+ *
+- * Copyright (C) 2006 Texas Instruments.
++ * Copyright (C) 2006-2007 Texas Instruments.
++ * Copyright (C) 2008-2009 Deep Root Systems, LLC
+ *
+ * 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
+@@ -13,6 +14,7 @@
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/errno.h>
++#include <linux/clk.h>
+ #include <linux/err.h>
+ #include <linux/mutex.h>
+ #include <linux/platform_device.h>
+@@ -21,98 +23,50 @@
+ #include <mach/hardware.h>
+
+ #include <mach/psc.h>
++#include <mach/cputype.h>
+ #include "clock.h"
+
+-/* PLL/Reset register offsets */
+-#define PLLM 0x110
+-
+ static LIST_HEAD(clocks);
+ static DEFINE_MUTEX(clocks_mutex);
+ static DEFINE_SPINLOCK(clockfw_lock);
+
+-static unsigned int commonrate;
+-static unsigned int armrate;
+-static unsigned int fixedrate = 27000000; /* 27 MHZ */
+-
+-extern void davinci_psc_config(unsigned int domain, unsigned int id, char enable);
+-
+-/*
+- * Returns a clock. Note that we first try to use device id on the bus
+- * and clock name. If this fails, we try to use clock name only.
+- */
+-struct clk *clk_get(struct device *dev, const char *id)
++static unsigned psc_domain(struct clk *clk)
+ {
+- struct clk *p, *clk = ERR_PTR(-ENOENT);
+- int idno;
+-
+- if (dev == NULL || dev->bus != &platform_bus_type)
+- idno = -1;
+- else
+- idno = to_platform_device(dev)->id;
+-
+- mutex_lock(&clocks_mutex);
+-
+- list_for_each_entry(p, &clocks, node) {
+- if (p->id == idno &&
+- strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
+- clk = p;
+- goto found;
+- }
+- }
+-
+- list_for_each_entry(p, &clocks, node) {
+- if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
+- clk = p;
+- break;
+- }
+- }
+-
+-found:
+- mutex_unlock(&clocks_mutex);
+-
+- return clk;
++ return (clk->flags & PSC_DSP)
++ ? DAVINCI_GPSC_DSPDOMAIN
++ : DAVINCI_GPSC_ARMDOMAIN;
+ }
+-EXPORT_SYMBOL(clk_get);
+
+-void clk_put(struct clk *clk)
++static void __clk_enable(struct clk *clk)
+ {
+- if (clk && !IS_ERR(clk))
+- module_put(clk->owner);
+-}
+-EXPORT_SYMBOL(clk_put);
+-
+-static int __clk_enable(struct clk *clk)
+-{
+- if (clk->flags & ALWAYS_ENABLED)
+- return 0;
+-
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, clk->lpsc, 1);
+- return 0;
++ if (clk->parent)
++ __clk_enable(clk->parent);
++ if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
++ davinci_psc_config(psc_domain(clk), clk->lpsc, 1);
+ }
+
+ static void __clk_disable(struct clk *clk)
+ {
+- if (clk->usecount)
++ if (WARN_ON(clk->usecount == 0))
+ return;
+-
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, clk->lpsc, 0);
++ if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
++ davinci_psc_config(psc_domain(clk), clk->lpsc, 0);
++ if (clk->parent)
++ __clk_disable(clk->parent);
+ }
+
+ int clk_enable(struct clk *clk)
+ {
+ unsigned long flags;
+- int ret = 0;
+
+ if (clk == NULL || IS_ERR(clk))
+ return -EINVAL;
+
+- if (clk->usecount++ == 0) {
+- spin_lock_irqsave(&clockfw_lock, flags);
+- ret = __clk_enable(clk);
+- spin_unlock_irqrestore(&clockfw_lock, flags);
+- }
++ spin_lock_irqsave(&clockfw_lock, flags);
++ __clk_enable(clk);
++ spin_unlock_irqrestore(&clockfw_lock, flags);
+
+- return ret;
++ return 0;
+ }
+ EXPORT_SYMBOL(clk_enable);
+
+@@ -123,11 +77,9 @@ void clk_disable(struct clk *clk)
+ if (clk == NULL || IS_ERR(clk))
+ return;
+
+- if (clk->usecount > 0 && !(--clk->usecount)) {
+- spin_lock_irqsave(&clockfw_lock, flags);
+- __clk_disable(clk);
+- spin_unlock_irqrestore(&clockfw_lock, flags);
+- }
++ spin_lock_irqsave(&clockfw_lock, flags);
++ __clk_disable(clk);
++ spin_unlock_irqrestore(&clockfw_lock, flags);
+ }
+ EXPORT_SYMBOL(clk_disable);
+
+@@ -136,7 +88,7 @@ unsigned long clk_get_rate(struct clk *c
+ if (clk == NULL || IS_ERR(clk))
+ return -EINVAL;
+
+- return *(clk->rate);
++ return clk->rate;
+ }
+ EXPORT_SYMBOL(clk_get_rate);
+
+@@ -145,7 +97,7 @@ long clk_round_rate(struct clk *clk, uns
+ if (clk == NULL || IS_ERR(clk))
+ return -EINVAL;
+
+- return *(clk->rate);
++ return clk->rate;
+ }
+ EXPORT_SYMBOL(clk_round_rate);
+
+@@ -164,10 +116,23 @@ int clk_register(struct clk *clk)
+ if (clk == NULL || IS_ERR(clk))
+ return -EINVAL;
+
++ if (WARN(clk->parent && !clk->parent->rate,
++ "CLK: %s parent %s has no rate!\n",
++ clk->name, clk->parent->name))
++ return -EINVAL;
++
+ mutex_lock(&clocks_mutex);
+- list_add(&clk->node, &clocks);
++ list_add_tail(&clk->node, &clocks);
+ mutex_unlock(&clocks_mutex);
+
++ /* If rate is already set, use it */
++ if (clk->rate)
++ return 0;
++
++ /* Otherwise, default to parent rate */
++ if (clk->parent)
++ clk->rate = clk->parent->rate;
++
+ return 0;
+ }
+ EXPORT_SYMBOL(clk_register);
+@@ -183,84 +148,150 @@ void clk_unregister(struct clk *clk)
+ }
+ EXPORT_SYMBOL(clk_unregister);
+
+-static struct clk davinci_clks[] = {
+- {
+- .name = "ARMCLK",
+- .rate = &armrate,
+- .lpsc = -1,
+- .flags = ALWAYS_ENABLED,
+- },
+- {
+- .name = "UART",
+- .rate = &fixedrate,
+- .lpsc = DAVINCI_LPSC_UART0,
+- },
+- {
+- .name = "EMACCLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_EMAC_WRAPPER,
+- },
+- {
+- .name = "I2CCLK",
+- .rate = &fixedrate,
+- .lpsc = DAVINCI_LPSC_I2C,
+- },
+- {
+- .name = "IDECLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_ATA,
+- },
+- {
+- .name = "McBSPCLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_McBSP,
+- },
+- {
+- .name = "MMCSDCLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_MMC_SD,
+- },
+- {
+- .name = "SPICLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_SPI,
+- },
+- {
+- .name = "gpio",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_GPIO,
+- },
+- {
+- .name = "usb",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_USB,
+- },
+- {
+- .name = "AEMIFCLK",
+- .rate = &commonrate,
+- .lpsc = DAVINCI_LPSC_AEMIF,
+- .usecount = 1,
++#ifdef CONFIG_DAVINCI_RESET_CLOCKS
++/*
++ * Disable any unused clocks left on by the bootloader
++ */
++static int __init clk_disable_unused(void)
++{
++ struct clk *ck;
++
++ spin_lock_irq(&clockfw_lock);
++ list_for_each_entry(ck, &clocks, node) {
++ if (ck->usecount > 0)
++ continue;
++ if (!(ck->flags & CLK_PSC))
++ continue;
++
++ /* ignore if in Disabled or SwRstDisable states */
++ if (!davinci_psc_is_clk_active(ck->lpsc))
++ continue;
++
++ pr_info("Clocks: disable unused %s\n", ck->name);
++ davinci_psc_config(psc_domain(ck), ck->lpsc, 0);
+ }
+-};
++ spin_unlock_irq(&clockfw_lock);
++
++ return 0;
++}
++late_initcall(clk_disable_unused);
++#endif
+
+-int __init davinci_clk_init(void)
++static void clk_sysclk_recalc(struct clk *clk)
+ {
+- struct clk *clkp;
+- int count = 0;
+- u32 pll_mult;
+-
+- pll_mult = davinci_readl(DAVINCI_PLL_CNTRL0_BASE + PLLM);
+- commonrate = ((pll_mult + 1) * 27000000) / 6;
+- armrate = ((pll_mult + 1) * 27000000) / 2;
+-
+- for (clkp = davinci_clks; count < ARRAY_SIZE(davinci_clks);
+- count++, clkp++) {
+- clk_register(clkp);
+-
+- /* Turn on clocks that have been enabled in the
+- * table above */
+- if (clkp->usecount)
+- clk_enable(clkp);
++ u32 v, plldiv;
++ struct pll_data *pll;
++
++ /* If this is the PLL base clock, no more calculations needed */
++ if (clk->pll_data)
++ return;
++
++ if (WARN_ON(!clk->parent))
++ return;
++
++ clk->rate = clk->parent->rate;
++
++ /* Otherwise, the parent must be a PLL */
++ if (WARN_ON(!clk->parent->pll_data))
++ return;
++
++ pll = clk->parent->pll_data;
++
++ /* If pre-PLL, source clock is before the multiplier and divider(s) */
++ if (clk->flags & PRE_PLL)
++ clk->rate = pll->input_rate;
++
++ if (!clk->div_reg)
++ return;
++
++ v = __raw_readl(pll->base + clk->div_reg);
++ if (v & PLLDIV_EN) {
++ plldiv = (v & PLLDIV_RATIO_MASK) + 1;
++ if (plldiv)
++ clk->rate /= plldiv;
++ }
++}
++
++static void __init clk_pll_init(struct clk *clk)
++{
++ u32 ctrl, mult = 1, prediv = 1, postdiv = 1;
++ u8 bypass;
++ struct pll_data *pll = clk->pll_data;
++
++ pll->base = IO_ADDRESS(pll->phys_base);
++ ctrl = __raw_readl(pll->base + PLLCTL);
++ clk->rate = pll->input_rate = clk->parent->rate;
++
++ if (ctrl & PLLCTL_PLLEN) {
++ bypass = 0;
++ mult = __raw_readl(pll->base + PLLM);
++ mult = (mult & PLLM_PLLM_MASK) + 1;
++ } else
++ bypass = 1;
++
++ if (pll->flags & PLL_HAS_PREDIV) {
++ prediv = __raw_readl(pll->base + PREDIV);
++ if (prediv & PLLDIV_EN)
++ prediv = (prediv & PLLDIV_RATIO_MASK) + 1;
++ else
++ prediv = 1;
++ }
++
++ /* pre-divider is fixed, but (some?) chips won't report that */
++ if (cpu_is_davinci_dm355() && pll->num == 1)
++ prediv = 8;
++
++ if (pll->flags & PLL_HAS_POSTDIV) {
++ postdiv = __raw_readl(pll->base + POSTDIV);
++ if (postdiv & PLLDIV_EN)
++ postdiv = (postdiv & PLLDIV_RATIO_MASK) + 1;
++ else
++ postdiv = 1;
++ }
++
++ if (!bypass) {
++ clk->rate /= prediv;
++ clk->rate *= mult;
++ clk->rate /= postdiv;
++ }
++
++ pr_debug("PLL%d: input = %lu MHz [ ",
++ pll->num, clk->parent->rate / 1000000);
++ if (bypass)
++ pr_debug("bypass ");
++ if (prediv > 1)
++ pr_debug("/ %d ", prediv);
++ if (mult > 1)
++ pr_debug("* %d ", mult);
++ if (postdiv > 1)
++ pr_debug("/ %d ", postdiv);
++ pr_debug("] --> %lu MHz output.\n", clk->rate / 1000000);
++}
++
++int __init davinci_clk_init(struct davinci_clk *clocks)
++ {
++ struct davinci_clk *c;
++ struct clk *clk;
++
++ for (c = clocks; c->lk.clk; c++) {
++ clk = c->lk.clk;
++
++ if (clk->pll_data)
++ clk_pll_init(clk);
++
++ /* Calculate rates for PLL-derived clocks */
++ else if (clk->flags & CLK_PLL)
++ clk_sysclk_recalc(clk);
++
++ if (clk->lpsc)
++ clk->flags |= CLK_PSC;
++
++ clkdev_add(&c->lk);
++ clk_register(clk);
++
++ /* Turn on clocks that Linux doesn't otherwise manage */
++ if (clk->flags & ALWAYS_ENABLED)
++ clk_enable(clk);
+ }
+
+ return 0;
+@@ -285,12 +316,52 @@ static void davinci_ck_stop(struct seq_f
+ {
+ }
+
++#define CLKNAME_MAX 10 /* longest clock name */
++#define NEST_DELTA 2
++#define NEST_MAX 4
++
++static void
++dump_clock(struct seq_file *s, unsigned nest, struct clk *parent)
++{
++ char *state;
++ char buf[CLKNAME_MAX + NEST_DELTA * NEST_MAX];
++ struct clk *clk;
++ unsigned i;
++
++ if (parent->flags & CLK_PLL)
++ state = "pll";
++ else if (parent->flags & CLK_PSC)
++ state = "psc";
++ else
++ state = "";
++
++ /* <nest spaces> name <pad to end> */
++ memset(buf, ' ', sizeof(buf) - 1);
++ buf[sizeof(buf) - 1] = 0;
++ i = strlen(parent->name);
++ memcpy(buf + nest, parent->name,
++ min(i, (unsigned)(sizeof(buf) - 1 - nest)));
++
++ seq_printf(s, "%s users=%2d %-3s %9ld Hz\n",
++ buf, parent->usecount, state, clk_get_rate(parent));
++ /* REVISIT show device associations too */
++
++ /* cost is now small, but not linear... */
++ list_for_each_entry(clk, &clocks, node) {
++ if (clk->parent == parent)
++ dump_clock(s, nest + NEST_DELTA, clk);
++ }
++}
++
+ static int davinci_ck_show(struct seq_file *m, void *v)
+ {
+- struct clk *cp;
+-
+- list_for_each_entry(cp, &clocks, node)
+- seq_printf(m,"%s %d %d\n", cp->name, *(cp->rate), cp->usecount);
++ /* Show clock tree; we know the main oscillator is first.
++ * We trust nonzero usecounts equate to PSC enables...
++ */
++ mutex_lock(&clocks_mutex);
++ if (!list_empty(&clocks))
++ dump_clock(m, 0, list_first_entry(&clocks, struct clk, node));
++ mutex_unlock(&clocks_mutex);
+
+ return 0;
+ }
+@@ -321,4 +392,4 @@ static int __init davinci_ck_proc_init(v
+
+ }
+ __initcall(davinci_ck_proc_init);
+-#endif /* CONFIG_DEBUG_PROC_FS */
++#endif /* CONFIG_DEBUG_PROC_FS */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/clock.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/clock.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/clock.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/clock.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,7 +1,8 @@
+ /*
+ * TI DaVinci clock definitions
+ *
+- * Copyright (C) 2006 Texas Instruments.
++ * Copyright (C) 2006-2007 Texas Instruments.
++ * Copyright (C) 2008-2009 Deep Root Systems, LLC
+ *
+ * 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
+@@ -11,23 +12,85 @@
+ #ifndef __ARCH_ARM_DAVINCI_CLOCK_H
+ #define __ARCH_ARM_DAVINCI_CLOCK_H
+
++#include <linux/list.h>
++#include <asm/clkdev.h>
++
++#define DAVINCI_PLL1_BASE 0x01c40800
++#define DAVINCI_PLL2_BASE 0x01c40c00
++#define MAX_PLL 2
++
++/* PLL/Reset register offsets */
++#define PLLCTL 0x100
++#define PLLCTL_PLLEN BIT(0)
++#define PLLCTL_CLKMODE BIT(8)
++
++#define PLLM 0x110
++#define PLLM_PLLM_MASK 0xff
++
++#define PREDIV 0x114
++#define PLLDIV1 0x118
++#define PLLDIV2 0x11c
++#define PLLDIV3 0x120
++#define POSTDIV 0x128
++#define BPDIV 0x12c
++#define PLLCMD 0x138
++#define PLLSTAT 0x13c
++#define PLLALNCTL 0x140
++#define PLLDCHANGE 0x144
++#define PLLCKEN 0x148
++#define PLLCKSTAT 0x14c
++#define PLLSYSTAT 0x150
++#define PLLDIV4 0x160
++#define PLLDIV5 0x164
++#define PLLDIV6 0x168
++#define PLLDIV7 0x16c
++#define PLLDIV8 0x170
++#define PLLDIV9 0x174
++#define PLLDIV_EN BIT(15)
++#define PLLDIV_RATIO_MASK 0x1f
++
++struct pll_data {
++ u32 phys_base;
++ void __iomem *base;
++ u32 num;
++ u32 flags;
++ u32 input_rate;
++};
++#define PLL_HAS_PREDIV 0x01
++#define PLL_HAS_POSTDIV 0x02
++
+ struct clk {
+ struct list_head node;
+ struct module *owner;
+ const char *name;
+- unsigned int *rate;
+- int id;
+- __s8 usecount;
+- __u8 flags;
+- __u8 lpsc;
++ unsigned long rate;
++ u8 usecount;
++ u8 flags;
++ u8 lpsc;
++ struct clk *parent;
++ struct pll_data *pll_data;
++ u32 div_reg;
+ };
+
+ /* Clock flags */
+-#define RATE_CKCTL 1
+-#define RATE_FIXED 2
+-#define RATE_PROPAGATES 4
+-#define VIRTUAL_CLOCK 8
+-#define ALWAYS_ENABLED 16
+-#define ENABLE_REG_32BIT 32
++#define ALWAYS_ENABLED BIT(1)
++#define CLK_PSC BIT(2)
++#define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */
++#define CLK_PLL BIT(4) /* PLL-derived clock */
++#define PRE_PLL BIT(5) /* source is before PLL mult/div */
++
++struct davinci_clk {
++ struct clk_lookup lk;
++};
++
++#define CLK(dev, con, ck) \
++ { \
++ .lk = { \
++ .dev_id = dev, \
++ .con_id = con, \
++ .clk = ck, \
++ }, \
++ }
+
++int davinci_clk_init(struct davinci_clk *clocks);
+ #endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/devices.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/devices.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/devices.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/devices.c 2009-05-13 09:46:19.000000000 +0200
+@@ -21,6 +21,10 @@
+ #include <mach/hardware.h>
+ #include <mach/i2c.h>
+ #include <mach/irqs.h>
++#include <mach/cputype.h>
++#include <mach/mux.h>
++
++#define DAVINCI_I2C_BASE 0x01C21000
+
+ static struct resource i2c_resources[] = {
+ {
+@@ -43,6 +47,9 @@ static struct platform_device davinci_i2
+
+ void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata)
+ {
++ if (cpu_is_davinci_dm644x())
++ davinci_cfg_reg(DM644X_I2C);
++
+ davinci_i2c_device.dev.platform_data = pdata;
+ (void) platform_device_register(&davinci_i2c_device);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/dm644x.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/dm644x.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/dm644x.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/dm644x.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,461 @@
++/*
++ * TI DaVinci DM644x chip specific setup
++ *
++ * Author: Kevin Hilman, Deep Root Systems, LLC
++ *
++ * 2007 (c) Deep Root Systems, LLC. This file is licensed under
++ * the terms of the GNU General Public License version 2. This program
++ * is licensed "as is" without any warranty of any kind, whether express
++ * or implied.
++ */
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++
++#include <mach/dm644x.h>
++#include <mach/clock.h>
++#include <mach/cputype.h>
++#include <mach/edma.h>
++#include <mach/irqs.h>
++#include <mach/psc.h>
++#include <mach/mux.h>
++
++#include "clock.h"
++#include "mux.h"
++
++/*
++ * Device specific clocks
++ */
++#define DM644X_REF_FREQ 27000000
++
++static struct pll_data pll1_data = {
++ .num = 1,
++ .phys_base = DAVINCI_PLL1_BASE,
++};
++
++static struct pll_data pll2_data = {
++ .num = 2,
++ .phys_base = DAVINCI_PLL2_BASE,
++};
++
++static struct clk ref_clk = {
++ .name = "ref_clk",
++ .rate = DM644X_REF_FREQ,
++};
++
++static struct clk pll1_clk = {
++ .name = "pll1",
++ .parent = &ref_clk,
++ .pll_data = &pll1_data,
++ .flags = CLK_PLL,
++};
++
++static struct clk pll1_sysclk1 = {
++ .name = "pll1_sysclk1",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV1,
++};
++
++static struct clk pll1_sysclk2 = {
++ .name = "pll1_sysclk2",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV2,
++};
++
++static struct clk pll1_sysclk3 = {
++ .name = "pll1_sysclk3",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV3,
++};
++
++static struct clk pll1_sysclk5 = {
++ .name = "pll1_sysclk5",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV5,
++};
++
++static struct clk pll1_aux_clk = {
++ .name = "pll1_aux_clk",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL | PRE_PLL,
++};
++
++static struct clk pll1_sysclkbp = {
++ .name = "pll1_sysclkbp",
++ .parent = &pll1_clk,
++ .flags = CLK_PLL | PRE_PLL,
++ .div_reg = BPDIV
++};
++
++static struct clk pll2_clk = {
++ .name = "pll2",
++ .parent = &ref_clk,
++ .pll_data = &pll2_data,
++ .flags = CLK_PLL,
++};
++
++static struct clk pll2_sysclk1 = {
++ .name = "pll2_sysclk1",
++ .parent = &pll2_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV1,
++};
++
++static struct clk pll2_sysclk2 = {
++ .name = "pll2_sysclk2",
++ .parent = &pll2_clk,
++ .flags = CLK_PLL,
++ .div_reg = PLLDIV2,
++};
++
++static struct clk pll2_sysclkbp = {
++ .name = "pll2_sysclkbp",
++ .parent = &pll2_clk,
++ .flags = CLK_PLL | PRE_PLL,
++ .div_reg = BPDIV
++};
++
++static struct clk dsp_clk = {
++ .name = "dsp",
++ .parent = &pll1_sysclk1,
++ .lpsc = DAVINCI_LPSC_GEM,
++ .flags = PSC_DSP,
++ .usecount = 1, /* REVISIT how to disable? */
++};
++
++static struct clk arm_clk = {
++ .name = "arm",
++ .parent = &pll1_sysclk2,
++ .lpsc = DAVINCI_LPSC_ARM,
++ .flags = ALWAYS_ENABLED,
++};
++
++static struct clk vicp_clk = {
++ .name = "vicp",
++ .parent = &pll1_sysclk2,
++ .lpsc = DAVINCI_LPSC_IMCOP,
++ .flags = PSC_DSP,
++ .usecount = 1, /* REVISIT how to disable? */
++};
++
++static struct clk vpss_master_clk = {
++ .name = "vpss_master",
++ .parent = &pll1_sysclk3,
++ .lpsc = DAVINCI_LPSC_VPSSMSTR,
++ .flags = CLK_PSC,
++};
++
++static struct clk vpss_slave_clk = {
++ .name = "vpss_slave",
++ .parent = &pll1_sysclk3,
++ .lpsc = DAVINCI_LPSC_VPSSSLV,
++};
++
++static struct clk uart0_clk = {
++ .name = "uart0",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_UART0,
++};
++
++static struct clk uart1_clk = {
++ .name = "uart1",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_UART1,
++};
++
++static struct clk uart2_clk = {
++ .name = "uart2",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_UART2,
++};
++
++static struct clk emac_clk = {
++ .name = "emac",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_EMAC_WRAPPER,
++};
++
++static struct clk i2c_clk = {
++ .name = "i2c",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_I2C,
++};
++
++static struct clk ide_clk = {
++ .name = "ide",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_ATA,
++};
++
++static struct clk asp_clk = {
++ .name = "asp0",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_McBSP,
++};
++
++static struct clk mmcsd_clk = {
++ .name = "mmcsd",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_MMC_SD,
++};
++
++static struct clk spi_clk = {
++ .name = "spi",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_SPI,
++};
++
++static struct clk gpio_clk = {
++ .name = "gpio",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_GPIO,
++};
++
++static struct clk usb_clk = {
++ .name = "usb",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_USB,
++};
++
++static struct clk vlynq_clk = {
++ .name = "vlynq",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_VLYNQ,
++};
++
++static struct clk aemif_clk = {
++ .name = "aemif",
++ .parent = &pll1_sysclk5,
++ .lpsc = DAVINCI_LPSC_AEMIF,
++};
++
++static struct clk pwm0_clk = {
++ .name = "pwm0",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_PWM0,
++};
++
++static struct clk pwm1_clk = {
++ .name = "pwm1",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_PWM1,
++};
++
++static struct clk pwm2_clk = {
++ .name = "pwm2",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_PWM2,
++};
++
++static struct clk timer0_clk = {
++ .name = "timer0",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_TIMER0,
++};
++
++static struct clk timer1_clk = {
++ .name = "timer1",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_TIMER1,
++};
++
++static struct clk timer2_clk = {
++ .name = "timer2",
++ .parent = &pll1_aux_clk,
++ .lpsc = DAVINCI_LPSC_TIMER2,
++ .usecount = 1, /* REVISIT: why cant' this be disabled? */
++};
++
++struct davinci_clk dm644x_clks[] = {
++ CLK(NULL, "ref", &ref_clk),
++ CLK(NULL, "pll1", &pll1_clk),
++ CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
++ CLK(NULL, "pll1_sysclk2", &pll1_sysclk2),
++ CLK(NULL, "pll1_sysclk3", &pll1_sysclk3),
++ CLK(NULL, "pll1_sysclk5", &pll1_sysclk5),
++ CLK(NULL, "pll1_aux", &pll1_aux_clk),
++ CLK(NULL, "pll1_sysclkbp", &pll1_sysclkbp),
++ CLK(NULL, "pll2", &pll2_clk),
++ CLK(NULL, "pll2_sysclk1", &pll2_sysclk1),
++ CLK(NULL, "pll2_sysclk2", &pll2_sysclk2),
++ CLK(NULL, "pll2_sysclkbp", &pll2_sysclkbp),
++ CLK(NULL, "dsp", &dsp_clk),
++ CLK(NULL, "arm", &arm_clk),
++ CLK(NULL, "vicp", &vicp_clk),
++ CLK(NULL, "vpss_master", &vpss_master_clk),
++ CLK(NULL, "vpss_slave", &vpss_slave_clk),
++ CLK(NULL, "arm", &arm_clk),
++ CLK(NULL, "uart0", &uart0_clk),
++ CLK(NULL, "uart1", &uart1_clk),
++ CLK(NULL, "uart2", &uart2_clk),
++ CLK("davinci_emac.1", NULL, &emac_clk),
++ CLK("i2c_davinci.1", NULL, &i2c_clk),
++ CLK("palm_bk3710", NULL, &ide_clk),
++ CLK("soc-audio.0", NULL, &asp_clk),
++ CLK("davinci_mmc.0", NULL, &mmcsd_clk),
++ CLK(NULL, "spi", &spi_clk),
++ CLK(NULL, "gpio", &gpio_clk),
++ CLK(NULL, "usb", &usb_clk),
++ CLK(NULL, "vlynq", &vlynq_clk),
++ CLK(NULL, "aemif", &aemif_clk),
++ CLK(NULL, "pwm0", &pwm0_clk),
++ CLK(NULL, "pwm1", &pwm1_clk),
++ CLK(NULL, "pwm2", &pwm2_clk),
++ CLK(NULL, "timer0", &timer0_clk),
++ CLK(NULL, "timer1", &timer1_clk),
++ CLK("watchdog", NULL, &timer2_clk),
++ CLK(NULL, NULL, NULL),
++};
++
++#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
++
++static struct resource dm644x_emac_resources[] = {
++ {
++ .start = DM644X_EMAC_BASE,
++ .end = DM644X_EMAC_BASE + 0x47ff,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = IRQ_EMACINT,
++ .end = IRQ_EMACINT,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device dm644x_emac_device = {
++ .name = "davinci_emac",
++ .id = 1,
++ .num_resources = ARRAY_SIZE(dm644x_emac_resources),
++ .resource = dm644x_emac_resources,
++};
++
++#endif
++
++/*
++ * Device specific mux setup
++ *
++ * soc description mux mode mode mux dbg
++ * reg offset mask mode
++ */
++static const struct mux_config dm644x_pins[] = {
++MUX_CFG(DM644X, HDIREN, 0, 16, 1, 1, true)
++MUX_CFG(DM644X, ATAEN, 0, 17, 1, 1, true)
++MUX_CFG(DM644X, ATAEN_DISABLE, 0, 17, 1, 0, true)
++
++MUX_CFG(DM644X, HPIEN_DISABLE, 0, 29, 1, 0, true)
++
++MUX_CFG(DM644X, AEAW, 0, 0, 31, 31, true)
++
++MUX_CFG(DM644X, MSTK, 1, 9, 1, 0, false)
++
++MUX_CFG(DM644X, I2C, 1, 7, 1, 1, false)
++
++MUX_CFG(DM644X, MCBSP, 1, 10, 1, 1, false)
++
++MUX_CFG(DM644X, UART1, 1, 1, 1, 1, true)
++MUX_CFG(DM644X, UART2, 1, 2, 1, 1, true)
++
++MUX_CFG(DM644X, PWM0, 1, 4, 1, 1, false)
++
++MUX_CFG(DM644X, PWM1, 1, 5, 1, 1, false)
++
++MUX_CFG(DM644X, PWM2, 1, 6, 1, 1, false)
++
++MUX_CFG(DM644X, VLYNQEN, 0, 15, 1, 1, false)
++MUX_CFG(DM644X, VLSCREN, 0, 14, 1, 1, false)
++MUX_CFG(DM644X, VLYNQWD, 0, 12, 3, 3, false)
++
++MUX_CFG(DM644X, EMACEN, 0, 31, 1, 1, true)
++
++MUX_CFG(DM644X, GPIO3V, 0, 31, 1, 0, true)
++
++MUX_CFG(DM644X, GPIO0, 0, 24, 1, 0, true)
++MUX_CFG(DM644X, GPIO3, 0, 25, 1, 0, false)
++MUX_CFG(DM644X, GPIO43_44, 1, 7, 1, 0, false)
++MUX_CFG(DM644X, GPIO46_47, 0, 22, 1, 0, true)
++
++MUX_CFG(DM644X, RGB666, 0, 22, 1, 1, true)
++
++MUX_CFG(DM644X, LOEEN, 0, 24, 1, 1, true)
++MUX_CFG(DM644X, LFLDEN, 0, 25, 1, 1, false)
++};
++
++
++/*----------------------------------------------------------------------*/
++
++static const s8 dma_chan_dm644x_no_event[] = {
++ 0, 1, 12, 13, 14,
++ 15, 25, 30, 31, 45,
++ 46, 47, 55, 56, 57,
++ 58, 59, 60, 61, 62,
++ 63,
++ -1
++};
++
++static struct edma_soc_info dm644x_edma_info = {
++ .n_channel = 64,
++ .n_region = 4,
++ .n_slot = 128,
++ .n_tc = 2,
++ .noevent = dma_chan_dm644x_no_event,
++};
++
++static struct resource edma_resources[] = {
++ {
++ .name = "edma_cc",
++ .start = 0x01c00000,
++ .end = 0x01c00000 + SZ_64K - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .name = "edma_tc0",
++ .start = 0x01c10000,
++ .end = 0x01c10000 + SZ_1K - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .name = "edma_tc1",
++ .start = 0x01c10400,
++ .end = 0x01c10400 + SZ_1K - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = IRQ_CCINT0,
++ .flags = IORESOURCE_IRQ,
++ },
++ {
++ .start = IRQ_CCERRINT,
++ .flags = IORESOURCE_IRQ,
++ },
++ /* not using TC*_ERR */
++};
++
++static struct platform_device dm644x_edma_device = {
++ .name = "edma",
++ .id = -1,
++ .dev.platform_data = &dm644x_edma_info,
++ .num_resources = ARRAY_SIZE(edma_resources),
++ .resource = edma_resources,
++};
++
++/*----------------------------------------------------------------------*/
++void __init dm644x_init(void)
++{
++ davinci_clk_init(dm644x_clks);
++ davinci_mux_register(dm644x_pins, ARRAY_SIZE(dm644x_pins));
++}
++
++static int __init dm644x_init_devices(void)
++{
++ if (!cpu_is_davinci_dm644x())
++ return 0;
++
++ platform_device_register(&dm644x_edma_device);
++ return 0;
++}
++postcore_initcall(dm644x_init_devices);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/dma.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/dma.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/dma.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/dma.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,1135 @@
++/*
++ * EDMA3 support for DaVinci
++ *
++ * Copyright (C) 2006-2009 Texas Instruments.
++ *
++ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/interrupt.h>
++#include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/compiler.h>
++#include <linux/io.h>
++
++#include <mach/cputype.h>
++#include <mach/memory.h>
++#include <mach/hardware.h>
++#include <mach/irqs.h>
++#include <mach/edma.h>
++#include <mach/mux.h>
++
++
++/* Offsets matching "struct edmacc_param" */
++#define PARM_OPT 0x00
++#define PARM_SRC 0x04
++#define PARM_A_B_CNT 0x08
++#define PARM_DST 0x0c
++#define PARM_SRC_DST_BIDX 0x10
++#define PARM_LINK_BCNTRLD 0x14
++#define PARM_SRC_DST_CIDX 0x18
++#define PARM_CCNT 0x1c
++
++#define PARM_SIZE 0x20
++
++/* Offsets for EDMA CC global channel registers and their shadows */
++#define SH_ER 0x00 /* 64 bits */
++#define SH_ECR 0x08 /* 64 bits */
++#define SH_ESR 0x10 /* 64 bits */
++#define SH_CER 0x18 /* 64 bits */
++#define SH_EER 0x20 /* 64 bits */
++#define SH_EECR 0x28 /* 64 bits */
++#define SH_EESR 0x30 /* 64 bits */
++#define SH_SER 0x38 /* 64 bits */
++#define SH_SECR 0x40 /* 64 bits */
++#define SH_IER 0x50 /* 64 bits */
++#define SH_IECR 0x58 /* 64 bits */
++#define SH_IESR 0x60 /* 64 bits */
++#define SH_IPR 0x68 /* 64 bits */
++#define SH_ICR 0x70 /* 64 bits */
++#define SH_IEVAL 0x78
++#define SH_QER 0x80
++#define SH_QEER 0x84
++#define SH_QEECR 0x88
++#define SH_QEESR 0x8c
++#define SH_QSER 0x90
++#define SH_QSECR 0x94
++#define SH_SIZE 0x200
++
++/* Offsets for EDMA CC global registers */
++#define EDMA_REV 0x0000
++#define EDMA_CCCFG 0x0004
++#define EDMA_QCHMAP 0x0200 /* 8 registers */
++#define EDMA_DMAQNUM 0x0240 /* 8 registers (4 on OMAP-L1xx) */
++#define EDMA_QDMAQNUM 0x0260
++#define EDMA_QUETCMAP 0x0280
++#define EDMA_QUEPRI 0x0284
++#define EDMA_EMR 0x0300 /* 64 bits */
++#define EDMA_EMCR 0x0308 /* 64 bits */
++#define EDMA_QEMR 0x0310
++#define EDMA_QEMCR 0x0314
++#define EDMA_CCERR 0x0318
++#define EDMA_CCERRCLR 0x031c
++#define EDMA_EEVAL 0x0320
++#define EDMA_DRAE 0x0340 /* 4 x 64 bits*/
++#define EDMA_QRAE 0x0380 /* 4 registers */
++#define EDMA_QUEEVTENTRY 0x0400 /* 2 x 16 registers */
++#define EDMA_QSTAT 0x0600 /* 2 registers */
++#define EDMA_QWMTHRA 0x0620
++#define EDMA_QWMTHRB 0x0624
++#define EDMA_CCSTAT 0x0640
++
++#define EDMA_M 0x1000 /* global channel registers */
++#define EDMA_ECR 0x1008
++#define EDMA_ECRH 0x100C
++#define EDMA_SHADOW0 0x2000 /* 4 regions shadowing global channels */
++#define EDMA_PARM 0x4000 /* 128 param entries */
++
++#define DAVINCI_DMA_3PCC_BASE 0x01C00000
++
++#define PARM_OFFSET(param_no) (EDMA_PARM + ((param_no) << 5))
++
++#define EDMA_MAX_DMACH 64
++#define EDMA_MAX_PARAMENTRY 512
++#define EDMA_MAX_EVQUE 2 /* FIXME too small */
++
++
++/*****************************************************************************/
++
++static void __iomem *edmacc_regs_base;
++
++static inline unsigned int edma_read(int offset)
++{
++ return (unsigned int)__raw_readl(edmacc_regs_base + offset);
++}
++
++static inline void edma_write(int offset, int val)
++{
++ __raw_writel(val, edmacc_regs_base + offset);
++}
++static inline void edma_modify(int offset, unsigned and, unsigned or)
++{
++ unsigned val = edma_read(offset);
++ val &= and;
++ val |= or;
++ edma_write(offset, val);
++}
++static inline void edma_and(int offset, unsigned and)
++{
++ unsigned val = edma_read(offset);
++ val &= and;
++ edma_write(offset, val);
++}
++static inline void edma_or(int offset, unsigned or)
++{
++ unsigned val = edma_read(offset);
++ val |= or;
++ edma_write(offset, val);
++}
++static inline unsigned int edma_read_array(int offset, int i)
++{
++ return edma_read(offset + (i << 2));
++}
++static inline void edma_write_array(int offset, int i, unsigned val)
++{
++ edma_write(offset + (i << 2), val);
++}
++static inline void edma_modify_array(int offset, int i,
++ unsigned and, unsigned or)
++{
++ edma_modify(offset + (i << 2), and, or);
++}
++static inline void edma_or_array(int offset, int i, unsigned or)
++{
++ edma_or(offset + (i << 2), or);
++}
++static inline void edma_or_array2(int offset, int i, int j, unsigned or)
++{
++ edma_or(offset + ((i*2 + j) << 2), or);
++}
++static inline void edma_write_array2(int offset, int i, int j, unsigned val)
++{
++ edma_write(offset + ((i*2 + j) << 2), val);
++}
++static inline unsigned int edma_shadow0_read(int offset)
++{
++ return edma_read(EDMA_SHADOW0 + offset);
++}
++static inline unsigned int edma_shadow0_read_array(int offset, int i)
++{
++ return edma_read(EDMA_SHADOW0 + offset + (i << 2));
++}
++static inline void edma_shadow0_write(int offset, unsigned val)
++{
++ edma_write(EDMA_SHADOW0 + offset, val);
++}
++static inline void edma_shadow0_write_array(int offset, int i, unsigned val)
++{
++ edma_write(EDMA_SHADOW0 + offset + (i << 2), val);
++}
++static inline unsigned int edma_parm_read(int offset, int param_no)
++{
++ return edma_read(EDMA_PARM + offset + (param_no << 5));
++}
++static inline void edma_parm_write(int offset, int param_no, unsigned val)
++{
++ edma_write(EDMA_PARM + offset + (param_no << 5), val);
++}
++static inline void edma_parm_modify(int offset, int param_no,
++ unsigned and, unsigned or)
++{
++ edma_modify(EDMA_PARM + offset + (param_no << 5), and, or);
++}
++static inline void edma_parm_and(int offset, int param_no, unsigned and)
++{
++ edma_and(EDMA_PARM + offset + (param_no << 5), and);
++}
++static inline void edma_parm_or(int offset, int param_no, unsigned or)
++{
++ edma_or(EDMA_PARM + offset + (param_no << 5), or);
++}
++
++/*****************************************************************************/
++
++/* actual number of DMA channels and slots on this silicon */
++static unsigned num_channels;
++static unsigned num_slots;
++
++static struct dma_interrupt_data {
++ void (*callback)(unsigned channel, unsigned short ch_status,
++ void *data);
++ void *data;
++} intr_data[EDMA_MAX_DMACH];
++
++/* The edma_inuse bit for each PaRAM slot is clear unless the
++ * channel is in use ... by ARM or DSP, for QDMA, or whatever.
++ */
++static DECLARE_BITMAP(edma_inuse, EDMA_MAX_PARAMENTRY);
++
++/* The edma_noevent bit for each channel is clear unless
++ * it doesn't trigger DMA events on this platform. It uses a
++ * bit of SOC-specific initialization code.
++ */
++static DECLARE_BITMAP(edma_noevent, EDMA_MAX_DMACH);
++
++/* dummy param set used to (re)initialize parameter RAM slots */
++static const struct edmacc_param dummy_paramset = {
++ .link_bcntrld = 0xffff,
++ .ccnt = 1,
++};
++
++static const int __initconst
++queue_tc_mapping[EDMA_MAX_EVQUE + 1][2] = {
++/* {event queue no, TC no} */
++ {0, 0},
++ {1, 1},
++ {-1, -1}
++};
++
++static const int __initconst
++queue_priority_mapping[EDMA_MAX_EVQUE + 1][2] = {
++ /* {event queue no, Priority} */
++ {0, 3},
++ {1, 7},
++ {-1, -1}
++};
++
++/*****************************************************************************/
++
++static void map_dmach_queue(unsigned ch_no, enum dma_event_q queue_no)
++{
++ int bit = (ch_no & 0x7) * 4;
++
++ /* default to low priority queue */
++ if (queue_no == EVENTQ_DEFAULT)
++ queue_no = EVENTQ_1;
++
++ queue_no &= 7;
++ edma_modify_array(EDMA_DMAQNUM, (ch_no >> 3),
++ ~(0x7 << bit), queue_no << bit);
++}
++
++static void __init map_queue_tc(int queue_no, int tc_no)
++{
++ int bit = queue_no * 4;
++ edma_modify(EDMA_QUETCMAP, ~(0x7 << bit), ((tc_no & 0x7) << bit));
++}
++
++static void __init assign_priority_to_queue(int queue_no, int priority)
++{
++ int bit = queue_no * 4;
++ edma_modify(EDMA_QUEPRI, ~(0x7 << bit), ((priority & 0x7) << bit));
++}
++
++static inline void
++setup_dma_interrupt(unsigned lch,
++ void (*callback)(unsigned channel, u16 ch_status, void *data),
++ void *data)
++{
++ if (!callback) {
++ edma_shadow0_write_array(SH_IECR, lch >> 5,
++ (1 << (lch & 0x1f)));
++ }
++
++ intr_data[lch].callback = callback;
++ intr_data[lch].data = data;
++
++ if (callback) {
++ edma_shadow0_write_array(SH_ICR, lch >> 5,
++ (1 << (lch & 0x1f)));
++ edma_shadow0_write_array(SH_IESR, lch >> 5,
++ (1 << (lch & 0x1f)));
++ }
++}
++
++/******************************************************************************
++ *
++ * DMA interrupt handler
++ *
++ *****************************************************************************/
++static irqreturn_t dma_irq_handler(int irq, void *data)
++{
++ int i;
++ unsigned int cnt = 0;
++
++ dev_dbg(data, "dma_irq_handler\n");
++
++ if ((edma_shadow0_read_array(SH_IPR, 0) == 0)
++ && (edma_shadow0_read_array(SH_IPR, 1) == 0))
++ return IRQ_NONE;
++
++ while (1) {
++ int j;
++ if (edma_shadow0_read_array(SH_IPR, 0))
++ j = 0;
++ else if (edma_shadow0_read_array(SH_IPR, 1))
++ j = 1;
++ else
++ break;
++ dev_dbg(data, "IPR%d %08x\n", j,
++ edma_shadow0_read_array(SH_IPR, j));
++ for (i = 0; i < 32; i++) {
++ int k = (j << 5) + i;
++ if (edma_shadow0_read_array(SH_IPR, j) & (1 << i)) {
++ /* Clear the corresponding IPR bits */
++ edma_shadow0_write_array(SH_ICR, j, (1 << i));
++ if (intr_data[k].callback) {
++ intr_data[k].callback(k, DMA_COMPLETE,
++ intr_data[k].data);
++ }
++ }
++ }
++ cnt++;
++ if (cnt > 10)
++ break;
++ }
++ edma_shadow0_write(SH_IEVAL, 1);
++ return IRQ_HANDLED;
++}
++
++/******************************************************************************
++ *
++ * DMA error interrupt handler
++ *
++ *****************************************************************************/
++static irqreturn_t dma_ccerr_handler(int irq, void *data)
++{
++ int i;
++ unsigned int cnt = 0;
++
++ dev_dbg(data, "dma_ccerr_handler\n");
++
++ if ((edma_read_array(EDMA_EMR, 0) == 0) &&
++ (edma_read_array(EDMA_EMR, 1) == 0) &&
++ (edma_read(EDMA_QEMR) == 0) && (edma_read(EDMA_CCERR) == 0))
++ return IRQ_NONE;
++
++ while (1) {
++ int j = -1;
++ if (edma_read_array(EDMA_EMR, 0))
++ j = 0;
++ else if (edma_read_array(EDMA_EMR, 1))
++ j = 1;
++ if (j >= 0) {
++ dev_dbg(data, "EMR%d %08x\n", j,
++ edma_read_array(EDMA_EMR, j));
++ for (i = 0; i < 32; i++) {
++ int k = (j << 5) + i;
++ if (edma_read_array(EDMA_EMR, j) & (1 << i)) {
++ /* Clear the corresponding EMR bits */
++ edma_write_array(EDMA_EMCR, j, 1 << i);
++ /* Clear any SER */
++ edma_shadow0_write_array(SH_SECR, j,
++ (1 << i));
++ if (intr_data[k].callback) {
++ intr_data[k].callback(k,
++ DMA_CC_ERROR,
++ intr_data
++ [k].data);
++ }
++ }
++ }
++ } else if (edma_read(EDMA_QEMR)) {
++ dev_dbg(data, "QEMR %02x\n",
++ edma_read(EDMA_QEMR));
++ for (i = 0; i < 8; i++) {
++ if (edma_read(EDMA_QEMR) & (1 << i)) {
++ /* Clear the corresponding IPR bits */
++ edma_write(EDMA_QEMCR, 1 << i);
++ edma_shadow0_write(SH_QSECR, (1 << i));
++
++ /* NOTE: not reported!! */
++ }
++ }
++ } else if (edma_read(EDMA_CCERR)) {
++ dev_dbg(data, "CCERR %08x\n",
++ edma_read(EDMA_CCERR));
++ /* FIXME: CCERR.BIT(16) ignored! much better
++ * to just write CCERRCLR with CCERR value...
++ */
++ for (i = 0; i < 8; i++) {
++ if (edma_read(EDMA_CCERR) & (1 << i)) {
++ /* Clear the corresponding IPR bits */
++ edma_write(EDMA_CCERRCLR, 1 << i);
++
++ /* NOTE: not reported!! */
++ }
++ }
++ }
++ if ((edma_read_array(EDMA_EMR, 0) == 0)
++ && (edma_read_array(EDMA_EMR, 1) == 0)
++ && (edma_read(EDMA_QEMR) == 0)
++ && (edma_read(EDMA_CCERR) == 0)) {
++ break;
++ }
++ cnt++;
++ if (cnt > 10)
++ break;
++ }
++ edma_write(EDMA_EEVAL, 1);
++ return IRQ_HANDLED;
++}
++
++/******************************************************************************
++ *
++ * Transfer controller error interrupt handlers
++ *
++ *****************************************************************************/
++
++#define tc_errs_handled false /* disabled as long as they're NOPs */
++
++static irqreturn_t dma_tc0err_handler(int irq, void *data)
++{
++ dev_dbg(data, "dma_tc0err_handler\n");
++ return IRQ_HANDLED;
++}
++
++static irqreturn_t dma_tc1err_handler(int irq, void *data)
++{
++ dev_dbg(data, "dma_tc1err_handler\n");
++ return IRQ_HANDLED;
++}
++
++/*-----------------------------------------------------------------------*/
++
++/* Resource alloc/free: dma channels, parameter RAM slots */
++
++/**
++ * edma_alloc_channel - allocate DMA channel and paired parameter RAM
++ * @channel: specific channel to allocate; negative for "any unmapped channel"
++ * @callback: optional; to be issued on DMA completion or errors
++ * @data: passed to callback
++ * @eventq_no: an EVENTQ_* constant, used to choose which Transfer
++ * Controller (TC) executes requests using this channel. Use
++ * EVENTQ_DEFAULT unless you really need a high priority queue.
++ *
++ * This allocates a DMA channel and its associated parameter RAM slot.
++ * The parameter RAM is initialized to hold a dummy transfer.
++ *
++ * Normal use is to pass a specific channel number as @channel, to make
++ * use of hardware events mapped to that channel. When the channel will
++ * be used only for software triggering or event chaining, channels not
++ * mapped to hardware events (or mapped to unused events) are preferable.
++ *
++ * DMA transfers start from a channel using edma_start(), or by
++ * chaining. When the transfer described in that channel's parameter RAM
++ * slot completes, that slot's data may be reloaded through a link.
++ *
++ * DMA errors are only reported to the @callback associated with the
++ * channel driving that transfer, but transfer completion callbacks can
++ * be sent to another channel under control of the TCC field in
++ * the option word of the transfer's parameter RAM set. Drivers must not
++ * use DMA transfer completion callbacks for channels they did not allocate.
++ * (The same applies to TCC codes used in transfer chaining.)
++ *
++ * Returns the number of the channel, else negative errno.
++ */
++int edma_alloc_channel(int channel,
++ void (*callback)(unsigned channel, u16 ch_status, void *data),
++ void *data,
++ enum dma_event_q eventq_no)
++{
++ if (channel < 0) {
++ channel = 0;
++ for (;;) {
++ channel = find_next_bit(edma_noevent,
++ num_channels, channel);
++ if (channel == num_channels)
++ return -ENOMEM;
++ if (!test_and_set_bit(channel, edma_inuse))
++ break;
++ channel++;
++ }
++ } else if (channel >= num_channels) {
++ return -EINVAL;
++ } else if (test_and_set_bit(channel, edma_inuse)) {
++ return -EBUSY;
++ }
++
++ /* ensure access through shadow region 0 */
++ edma_or_array2(EDMA_DRAE, 0, channel >> 5, 1 << (channel & 0x1f));
++
++ /* ensure no events are pending */
++ edma_stop(channel);
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(channel),
++ &dummy_paramset, PARM_SIZE);
++
++ if (callback)
++ setup_dma_interrupt(channel, callback, data);
++
++ map_dmach_queue(channel, eventq_no);
++
++ return channel;
++}
++EXPORT_SYMBOL(edma_alloc_channel);
++
++
++/**
++ * edma_free_channel - deallocate DMA channel
++ * @channel: dma channel returned from edma_alloc_channel()
++ *
++ * This deallocates the DMA channel and associated parameter RAM slot
++ * allocated by edma_alloc_channel().
++ *
++ * Callers are responsible for ensuring the channel is inactive, and
++ * will not be reactivated by linking, chaining, or software calls to
++ * edma_start().
++ */
++void edma_free_channel(unsigned channel)
++{
++ if (channel >= num_channels)
++ return;
++
++ setup_dma_interrupt(channel, NULL, NULL);
++ /* REVISIT should probably take out of shadow region 0 */
++
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(channel),
++ &dummy_paramset, PARM_SIZE);
++ clear_bit(channel, edma_inuse);
++}
++EXPORT_SYMBOL(edma_free_channel);
++
++/**
++ * edma_alloc_slot - allocate DMA parameter RAM
++ * @slot: specific slot to allocate; negative for "any unused slot"
++ *
++ * This allocates a parameter RAM slot, initializing it to hold a
++ * dummy transfer. Slots allocated using this routine have not been
++ * mapped to a hardware DMA channel, and will normally be used by
++ * linking to them from a slot associated with a DMA channel.
++ *
++ * Normal use is to pass EDMA_SLOT_ANY as the @slot, but specific
++ * slots may be allocated on behalf of DSP firmware.
++ *
++ * Returns the number of the slot, else negative errno.
++ */
++int edma_alloc_slot(int slot)
++{
++ if (slot < 0) {
++ slot = num_channels;
++ for (;;) {
++ slot = find_next_zero_bit(edma_inuse,
++ num_slots, slot);
++ if (slot == num_slots)
++ return -ENOMEM;
++ if (!test_and_set_bit(slot, edma_inuse))
++ break;
++ }
++ } else if (slot < num_channels || slot >= num_slots) {
++ return -EINVAL;
++ } else if (test_and_set_bit(slot, edma_inuse)) {
++ return -EBUSY;
++ }
++
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(slot),
++ &dummy_paramset, PARM_SIZE);
++
++ return slot;
++}
++EXPORT_SYMBOL(edma_alloc_slot);
++
++/**
++ * edma_free_slot - deallocate DMA parameter RAM
++ * @slot: parameter RAM slot returned from edma_alloc_slot()
++ *
++ * This deallocates the parameter RAM slot allocated by edma_alloc_slot().
++ * Callers are responsible for ensuring the slot is inactive, and will
++ * not be activated.
++ */
++void edma_free_slot(unsigned slot)
++{
++ if (slot < num_channels || slot >= num_slots)
++ return;
++
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(slot),
++ &dummy_paramset, PARM_SIZE);
++ clear_bit(slot, edma_inuse);
++}
++EXPORT_SYMBOL(edma_free_slot);
++
++/*-----------------------------------------------------------------------*/
++
++/* Parameter RAM operations (i) -- read/write partial slots */
++
++/**
++ * edma_set_src - set initial DMA source address in parameter RAM slot
++ * @slot: parameter RAM slot being configured
++ * @src_port: physical address of source (memory, controller FIFO, etc)
++ * @addressMode: INCR, except in very rare cases
++ * @fifoWidth: ignored unless @addressMode is FIFO, else specifies the
++ * width to use when addressing the fifo (e.g. W8BIT, W32BIT)
++ *
++ * Note that the source address is modified during the DMA transfer
++ * according to edma_set_src_index().
++ */
++void edma_set_src(unsigned slot, dma_addr_t src_port,
++ enum address_mode mode, enum fifo_width width)
++{
++ if (slot < num_slots) {
++ unsigned int i = edma_parm_read(PARM_OPT, slot);
++
++ if (mode) {
++ /* set SAM and program FWID */
++ i = (i & ~(EDMA_FWID)) | (SAM | ((width & 0x7) << 8));
++ } else {
++ /* clear SAM */
++ i &= ~SAM;
++ }
++ edma_parm_write(PARM_OPT, slot, i);
++
++ /* set the source port address
++ in source register of param structure */
++ edma_parm_write(PARM_SRC, slot, src_port);
++ }
++}
++EXPORT_SYMBOL(edma_set_src);
++
++/**
++ * edma_set_dest - set initial DMA destination address in parameter RAM slot
++ * @slot: parameter RAM slot being configured
++ * @dest_port: physical address of destination (memory, controller FIFO, etc)
++ * @addressMode: INCR, except in very rare cases
++ * @fifoWidth: ignored unless @addressMode is FIFO, else specifies the
++ * width to use when addressing the fifo (e.g. W8BIT, W32BIT)
++ *
++ * Note that the destination address is modified during the DMA transfer
++ * according to edma_set_dest_index().
++ */
++void edma_set_dest(unsigned slot, dma_addr_t dest_port,
++ enum address_mode mode, enum fifo_width width)
++{
++ if (slot < num_slots) {
++ unsigned int i = edma_parm_read(PARM_OPT, slot);
++
++ if (mode) {
++ /* set DAM and program FWID */
++ i = (i & ~(EDMA_FWID)) | (DAM | ((width & 0x7) << 8));
++ } else {
++ /* clear DAM */
++ i &= ~DAM;
++ }
++ edma_parm_write(PARM_OPT, slot, i);
++ /* set the destination port address
++ in dest register of param structure */
++ edma_parm_write(PARM_DST, slot, dest_port);
++ }
++}
++EXPORT_SYMBOL(edma_set_dest);
++
++/**
++ * edma_get_position - returns the current transfer points
++ * @slot: parameter RAM slot being examined
++ * @src: pointer to source port position
++ * @dst: pointer to destination port position
++ *
++ * Returns current source and destination addresses for a particular
++ * parameter RAM slot. Its channel should not be active when this is called.
++ */
++void edma_get_position(unsigned slot, dma_addr_t *src, dma_addr_t *dst)
++{
++ struct edmacc_param temp;
++
++ edma_read_slot(slot, &temp);
++ if (src != NULL)
++ *src = temp.src;
++ if (dst != NULL)
++ *dst = temp.dst;
++}
++EXPORT_SYMBOL(edma_get_position);
++
++/**
++ * edma_set_src_index - configure DMA source address indexing
++ * @slot: parameter RAM slot being configured
++ * @src_bidx: byte offset between source arrays in a frame
++ * @src_cidx: byte offset between source frames in a block
++ *
++ * Offsets are specified to support either contiguous or discontiguous
++ * memory transfers, or repeated access to a hardware register, as needed.
++ * When accessing hardware registers, both offsets are normally zero.
++ */
++void edma_set_src_index(unsigned slot, s16 src_bidx, s16 src_cidx)
++{
++ if (slot < num_slots) {
++ edma_parm_modify(PARM_SRC_DST_BIDX, slot,
++ 0xffff0000, src_bidx);
++ edma_parm_modify(PARM_SRC_DST_CIDX, slot,
++ 0xffff0000, src_cidx);
++ }
++}
++EXPORT_SYMBOL(edma_set_src_index);
++
++/**
++ * edma_set_dest_index - configure DMA destination address indexing
++ * @slot: parameter RAM slot being configured
++ * @dest_bidx: byte offset between destination arrays in a frame
++ * @dest_cidx: byte offset between destination frames in a block
++ *
++ * Offsets are specified to support either contiguous or discontiguous
++ * memory transfers, or repeated access to a hardware register, as needed.
++ * When accessing hardware registers, both offsets are normally zero.
++ */
++void edma_set_dest_index(unsigned slot, s16 dest_bidx, s16 dest_cidx)
++{
++ if (slot < num_slots) {
++ edma_parm_modify(PARM_SRC_DST_BIDX, slot,
++ 0x0000ffff, dest_bidx << 16);
++ edma_parm_modify(PARM_SRC_DST_CIDX, slot,
++ 0x0000ffff, dest_cidx << 16);
++ }
++}
++EXPORT_SYMBOL(edma_set_dest_index);
++
++/**
++ * edma_set_transfer_params - configure DMA transfer parameters
++ * @slot: parameter RAM slot being configured
++ * @acnt: how many bytes per array (at least one)
++ * @bcnt: how many arrays per frame (at least one)
++ * @ccnt: how many frames per block (at least one)
++ * @bcnt_rld: used only for A-Synchronized transfers; this specifies
++ * the value to reload into bcnt when it decrements to zero
++ * @sync_mode: ASYNC or ABSYNC
++ *
++ * See the EDMA3 documentation to understand how to configure and link
++ * transfers using the fields in PaRAM slots. If you are not doing it
++ * all at once with edma_write_slot(), you will use this routine
++ * plus two calls each for source and destination, setting the initial
++ * address and saying how to index that address.
++ *
++ * An example of an A-Synchronized transfer is a serial link using a
++ * single word shift register. In that case, @acnt would be equal to
++ * that word size; the serial controller issues a DMA synchronization
++ * event to transfer each word, and memory access by the DMA transfer
++ * controller will be word-at-a-time.
++ *
++ * An example of an AB-Synchronized transfer is a device using a FIFO.
++ * In that case, @acnt equals the FIFO width and @bcnt equals its depth.
++ * The controller with the FIFO issues DMA synchronization events when
++ * the FIFO threshold is reached, and the DMA transfer controller will
++ * transfer one frame to (or from) the FIFO. It will probably use
++ * efficient burst modes to access memory.
++ */
++void edma_set_transfer_params(unsigned slot,
++ u16 acnt, u16 bcnt, u16 ccnt,
++ u16 bcnt_rld, enum sync_dimension sync_mode)
++{
++ if (slot < num_slots) {
++ edma_parm_modify(PARM_LINK_BCNTRLD, slot,
++ 0x0000ffff, bcnt_rld << 16);
++ if (sync_mode == ASYNC)
++ edma_parm_and(PARM_OPT, slot, ~SYNCDIM);
++ else
++ edma_parm_or(PARM_OPT, slot, SYNCDIM);
++ /* Set the acount, bcount, ccount registers */
++ edma_parm_write(PARM_A_B_CNT, slot, (bcnt << 16) | acnt);
++ edma_parm_write(PARM_CCNT, slot, ccnt);
++ }
++}
++EXPORT_SYMBOL(edma_set_transfer_params);
++
++/**
++ * edma_link - link one parameter RAM slot to another
++ * @from: parameter RAM slot originating the link
++ * @to: parameter RAM slot which is the link target
++ *
++ * The originating slot should not be part of any active DMA transfer.
++ */
++void edma_link(unsigned from, unsigned to)
++{
++ if (from >= num_slots)
++ return;
++ if (to >= num_slots)
++ return;
++ edma_parm_modify(PARM_LINK_BCNTRLD, from, 0xffff0000, PARM_OFFSET(to));
++}
++EXPORT_SYMBOL(edma_link);
++
++/**
++ * edma_unlink - cut link from one parameter RAM slot
++ * @from: parameter RAM slot originating the link
++ *
++ * The originating slot should not be part of any active DMA transfer.
++ * Its link is set to 0xffff.
++ */
++void edma_unlink(unsigned from)
++{
++ if (from >= num_slots)
++ return;
++ edma_parm_or(PARM_LINK_BCNTRLD, from, 0xffff);
++}
++EXPORT_SYMBOL(edma_unlink);
++
++/*-----------------------------------------------------------------------*/
++
++/* Parameter RAM operations (ii) -- read/write whole parameter sets */
++
++/**
++ * edma_write_slot - write parameter RAM data for slot
++ * @slot: number of parameter RAM slot being modified
++ * @param: data to be written into parameter RAM slot
++ *
++ * Use this to assign all parameters of a transfer at once. This
++ * allows more efficient setup of transfers than issuing multiple
++ * calls to set up those parameters in small pieces, and provides
++ * complete control over all transfer options.
++ */
++void edma_write_slot(unsigned slot, const struct edmacc_param *param)
++{
++ if (slot >= num_slots)
++ return;
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(slot), param, PARM_SIZE);
++}
++EXPORT_SYMBOL(edma_write_slot);
++
++/**
++ * edma_read_slot - read parameter RAM data from slot
++ * @slot: number of parameter RAM slot being copied
++ * @param: where to store copy of parameter RAM data
++ *
++ * Use this to read data from a parameter RAM slot, perhaps to
++ * save them as a template for later reuse.
++ */
++void edma_read_slot(unsigned slot, struct edmacc_param *param)
++{
++ if (slot >= num_slots)
++ return;
++ memcpy_fromio(param, edmacc_regs_base + PARM_OFFSET(slot), PARM_SIZE);
++}
++EXPORT_SYMBOL(edma_read_slot);
++
++/*-----------------------------------------------------------------------*/
++
++/* Various EDMA channel control operations */
++
++/**
++ * edma_pause - pause dma on a channel
++ * @channel: on which edma_start() has been called
++ *
++ * This temporarily disables EDMA hardware events on the specified channel,
++ * preventing them from triggering new transfers on its behalf
++ */
++void edma_pause(unsigned channel)
++{
++ if (channel < num_channels) {
++ unsigned int mask = (1 << (channel & 0x1f));
++
++ edma_shadow0_write_array(SH_EECR, channel >> 5, mask);
++ }
++}
++EXPORT_SYMBOL(edma_pause);
++
++/**
++ * edma_resume - resumes dma on a paused channel
++ * @channel: on which edma_pause() has been called
++ *
++ * This re-enables EDMA hardware events on the specified channel.
++ */
++void edma_resume(unsigned channel)
++{
++ if (channel < num_channels) {
++ unsigned int mask = (1 << (channel & 0x1f));
++
++ edma_shadow0_write_array(SH_EESR, channel >> 5, mask);
++ }
++}
++EXPORT_SYMBOL(edma_resume);
++
++/**
++ * edma_start - start dma on a channel
++ * @channel: channel being activated
++ *
++ * Channels with event associations will be triggered by their hardware
++ * events, and channels without such associations will be triggered by
++ * software. (At this writing there is no interface for using software
++ * triggers except with channels that don't support hardware triggers.)
++ *
++ * Returns zero on success, else negative errno.
++ */
++int edma_start(unsigned channel)
++{
++ if (channel < num_channels) {
++ int j = channel >> 5;
++ unsigned int mask = (1 << (channel & 0x1f));
++
++ /* EDMA channels without event association */
++ if (test_bit(channel, edma_noevent)) {
++ pr_debug("EDMA: ESR%d %08x\n", j,
++ edma_shadow0_read_array(SH_ESR, j));
++ edma_shadow0_write_array(SH_ESR, j, mask);
++ return 0;
++ }
++
++ /* EDMA channel with event association */
++ pr_debug("EDMA: ER%d %08x\n", j,
++ edma_shadow0_read_array(SH_ER, j));
++ /* Clear any pending error */
++ edma_write_array(EDMA_EMCR, j, mask);
++ /* Clear any SER */
++ edma_shadow0_write_array(SH_SECR, j, mask);
++ edma_shadow0_write_array(SH_EESR, j, mask);
++ pr_debug("EDMA: EER%d %08x\n", j,
++ edma_shadow0_read_array(SH_EER, j));
++ return 0;
++ }
++
++ return -EINVAL;
++}
++EXPORT_SYMBOL(edma_start);
++
++/**
++ * edma_stop - stops dma on the channel passed
++ * @channel: channel being deactivated
++ *
++ * When @lch is a channel, any active transfer is paused and
++ * all pending hardware events are cleared. The current transfer
++ * may not be resumed, and the channel's Parameter RAM should be
++ * reinitialized before being reused.
++ */
++void edma_stop(unsigned channel)
++{
++ if (channel < num_channels) {
++ int j = channel >> 5;
++ unsigned int mask = (1 << (channel & 0x1f));
++
++ edma_shadow0_write_array(SH_EECR, j, mask);
++ edma_shadow0_write_array(SH_ECR, j, mask);
++ edma_shadow0_write_array(SH_SECR, j, mask);
++ edma_write_array(EDMA_EMCR, j, mask);
++
++ pr_debug("EDMA: EER%d %08x\n", j,
++ edma_shadow0_read_array(SH_EER, j));
++
++ /* REVISIT: consider guarding against inappropriate event
++ * chaining by overwriting with dummy_paramset.
++ */
++ }
++}
++EXPORT_SYMBOL(edma_stop);
++
++/******************************************************************************
++ *
++ * It cleans ParamEntry qand bring back EDMA to initial state if media has
++ * been removed before EDMA has finished.It is usedful for removable media.
++ * Arguments:
++ * ch_no - channel no
++ *
++ * Return: zero on success, or corresponding error no on failure
++ *
++ * FIXME this should not be needed ... edma_stop() should suffice.
++ *
++ *****************************************************************************/
++
++void edma_clean_channel(unsigned channel)
++{
++ if (channel < num_channels) {
++ int j = (channel >> 5);
++ unsigned int mask = 1 << (channel & 0x1f);
++
++ pr_debug("EDMA: EMR%d %08x\n", j,
++ edma_read_array(EDMA_EMR, j));
++ edma_shadow0_write_array(SH_ECR, j, mask);
++ /* Clear the corresponding EMR bits */
++ edma_write_array(EDMA_EMCR, j, mask);
++ /* Clear any SER */
++ edma_shadow0_write_array(SH_SECR, j, mask);
++ edma_write(EDMA_CCERRCLR, (1 << 16) | 0x3);
++ }
++}
++EXPORT_SYMBOL(edma_clean_channel);
++
++/*
++ * edma_clear_event - clear an outstanding event on the DMA channel
++ * Arguments:
++ * channel - channel number
++ */
++void edma_clear_event(unsigned channel)
++{
++ if (channel >= num_channels)
++ return;
++ if (channel < 32)
++ edma_write(EDMA_ECR, 1 << channel);
++ else
++ edma_write(EDMA_ECRH, 1 << (channel - 32));
++}
++EXPORT_SYMBOL(edma_clear_event);
++
++/*-----------------------------------------------------------------------*/
++
++static int __init edma_probe(struct platform_device *pdev)
++{
++ struct edma_soc_info *info = pdev->dev.platform_data;
++ int i;
++ int status;
++ const s8 *noevent;
++ int irq = 0, err_irq = 0;
++ struct resource *r;
++ resource_size_t len;
++
++ if (!info)
++ return -ENODEV;
++
++ r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "edma_cc");
++ if (!r)
++ return -ENODEV;
++
++ len = r->end - r->start + 1;
++
++ r = request_mem_region(r->start, len, r->name);
++ if (!r)
++ return -EBUSY;
++
++ edmacc_regs_base = ioremap(r->start, len);
++ if (!edmacc_regs_base) {
++ status = -EBUSY;
++ goto fail1;
++ }
++
++ num_channels = min_t(unsigned, info->n_channel, EDMA_MAX_DMACH);
++ num_slots = min_t(unsigned, info->n_slot, EDMA_MAX_PARAMENTRY);
++
++ dev_dbg(&pdev->dev, "DMA REG BASE ADDR=%p\n", edmacc_regs_base);
++
++ for (i = 0; i < num_slots; i++)
++ memcpy_toio(edmacc_regs_base + PARM_OFFSET(i),
++ &dummy_paramset, PARM_SIZE);
++
++ noevent = info->noevent;
++ if (noevent) {
++ while (*noevent != -1)
++ set_bit(*noevent++, edma_noevent);
++ }
++
++ irq = platform_get_irq(pdev, 0);
++ status = request_irq(irq, dma_irq_handler, 0, "edma", &pdev->dev);
++ if (status < 0) {
++ dev_dbg(&pdev->dev, "request_irq %d failed --> %d\n",
++ irq, status);
++ goto fail;
++ }
++
++ err_irq = platform_get_irq(pdev, 1);
++ status = request_irq(err_irq, dma_ccerr_handler, 0,
++ "edma_error", &pdev->dev);
++ if (status < 0) {
++ dev_dbg(&pdev->dev, "request_irq %d failed --> %d\n",
++ err_irq, status);
++ goto fail;
++ }
++
++ if (tc_errs_handled) {
++ status = request_irq(IRQ_TCERRINT0, dma_tc0err_handler, 0,
++ "edma_tc0", &pdev->dev);
++ if (status < 0) {
++ dev_dbg(&pdev->dev, "request_irq %d failed --> %d\n",
++ IRQ_TCERRINT0, status);
++ return status;
++ }
++ status = request_irq(IRQ_TCERRINT, dma_tc1err_handler, 0,
++ "edma_tc1", &pdev->dev);
++ if (status < 0) {
++ dev_dbg(&pdev->dev, "request_irq %d --> %d\n",
++ IRQ_TCERRINT, status);
++ return status;
++ }
++ }
++
++ /* Everything lives on transfer controller 1 until otherwise specified.
++ * This way, long transfers on the low priority queue
++ * started by the codec engine will not cause audio defects.
++ */
++ for (i = 0; i < num_channels; i++)
++ map_dmach_queue(i, EVENTQ_1);
++
++ /* Event queue to TC mapping */
++ for (i = 0; queue_tc_mapping[i][0] != -1; i++)
++ map_queue_tc(queue_tc_mapping[i][0], queue_tc_mapping[i][1]);
++
++ /* Event queue priority mapping */
++ for (i = 0; queue_priority_mapping[i][0] != -1; i++)
++ assign_priority_to_queue(queue_priority_mapping[i][0],
++ queue_priority_mapping[i][1]);
++
++ for (i = 0; i < info->n_region; i++) {
++ edma_write_array2(EDMA_DRAE, i, 0, 0x0);
++ edma_write_array2(EDMA_DRAE, i, 1, 0x0);
++ edma_write_array(EDMA_QRAE, i, 0x0);
++ }
++
++ return 0;
++
++fail:
++ if (err_irq)
++ free_irq(err_irq, NULL);
++ if (irq)
++ free_irq(irq, NULL);
++ iounmap(edmacc_regs_base);
++fail1:
++ release_mem_region(r->start, len);
++ return status;
++}
++
++
++static struct platform_driver edma_driver = {
++ .driver.name = "edma",
++};
++
++static int __init edma_init(void)
++{
++ return platform_driver_probe(&edma_driver, edma_probe);
++}
++arch_initcall(edma_init);
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/gpio.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/gpio.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/gpio.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/gpio.c 2009-05-13 09:46:19.000000000 +0200
+@@ -20,6 +20,7 @@
+ #include <linux/irq.h>
+ #include <linux/bitops.h>
+
++#include <mach/cputype.h>
+ #include <mach/irqs.h>
+ #include <mach/hardware.h>
+ #include <mach/gpio.h>
+@@ -36,9 +37,10 @@ struct davinci_gpio {
+
+ static struct davinci_gpio chips[DIV_ROUND_UP(DAVINCI_N_GPIO, 32)];
+
++static unsigned __initdata ngpio;
+
+ /* create a non-inlined version */
+-static struct gpio_controller *__iomem __init gpio2controller(unsigned gpio)
++static struct gpio_controller __iomem * __init gpio2controller(unsigned gpio)
+ {
+ return __gpio_to_controller(gpio);
+ }
+@@ -114,9 +116,30 @@ static int __init davinci_gpio_setup(voi
+ {
+ int i, base;
+
+- for (i = 0, base = 0;
+- i < ARRAY_SIZE(chips);
+- i++, base += 32) {
++ /* The gpio banks conceptually expose a segmented bitmap,
++ * and "ngpio" is one more than the largest zero-based
++ * bit index that's valid.
++ */
++ if (cpu_is_davinci_dm355()) { /* or dm335() */
++ ngpio = 104;
++ } else if (cpu_is_davinci_dm644x()) { /* or dm337() */
++ ngpio = 71;
++ } else if (cpu_is_davinci_dm646x()) {
++ /* NOTE: each bank has several "reserved" bits,
++ * unusable as GPIOs. Only 33 of the GPIO numbers
++ * are usable, and we're not rejecting the others.
++ */
++ ngpio = 43;
++ } else {
++ /* if cpu_is_davinci_dm643x() ngpio = 111 */
++ pr_err("GPIO setup: how many GPIOs?\n");
++ return -EINVAL;
++ }
++
++ if (WARN_ON(DAVINCI_N_GPIO < ngpio))
++ ngpio = DAVINCI_N_GPIO;
++
++ for (i = 0, base = 0; base < ngpio; i++, base += 32) {
+ chips[i].chip.label = "DaVinci";
+
+ chips[i].chip.direction_input = davinci_direction_in;
+@@ -125,7 +148,7 @@ static int __init davinci_gpio_setup(voi
+ chips[i].chip.set = davinci_gpio_set;
+
+ chips[i].chip.base = base;
+- chips[i].chip.ngpio = DAVINCI_N_GPIO - base;
++ chips[i].chip.ngpio = ngpio - base;
+ if (chips[i].chip.ngpio > 32)
+ chips[i].chip.ngpio = 32;
+
+@@ -143,11 +166,11 @@ pure_initcall(davinci_gpio_setup);
+ * We expect irqs will normally be set up as input pins, but they can also be
+ * used as output pins ... which is convenient for testing.
+ *
+- * NOTE: GPIO0..GPIO7 also have direct INTC hookups, which work in addition
+- * to their GPIOBNK0 irq (but with a bit less overhead). But we don't have
+- * a good way to hook those up ...
++ * NOTE: The first few GPIOs also have direct INTC hookups in addition
++ * to their GPIOBNK0 irq, with a bit less overhead but less flexibility
++ * on triggering (e.g. no edge options). We don't try to use those.
+ *
+- * All those INTC hookups (GPIO0..GPIO7 plus five IRQ banks) can also
++ * All those INTC hookups (direct, plus several IRQ banks) can also
+ * serve as EDMA event triggers.
+ */
+
+@@ -235,29 +258,42 @@ gpio_irq_handler(unsigned irq, struct ir
+ }
+
+ /*
+- * NOTE: for suspend/resume, probably best to make a sysdev (and class)
+- * with its suspend/resume calls hooking into the results of the set_wake()
++ * NOTE: for suspend/resume, probably best to make a platform_device with
++ * suspend_late/resume_resume calls hooking into results of the set_wake()
+ * calls ... so if no gpios are wakeup events the clock can be disabled,
+ * with outputs left at previously set levels, and so that VDD3P3V.IOPWDN0
+- * can be set appropriately for GPIOV33 pins.
++ * (dm6446) can be set appropriately for GPIOV33 pins.
+ */
+
+ static int __init davinci_gpio_irq_setup(void)
+ {
+ unsigned gpio, irq, bank;
++ unsigned bank_irq;
+ struct clk *clk;
++ u32 binten = 0;
++
++ if (cpu_is_davinci_dm355()) { /* or dm335() */
++ bank_irq = IRQ_DM355_GPIOBNK0;
++ } else if (cpu_is_davinci_dm644x()) {
++ bank_irq = IRQ_GPIOBNK0;
++ } else if (cpu_is_davinci_dm646x()) {
++ bank_irq = IRQ_DM646X_GPIOBNK0;
++ } else {
++ printk(KERN_ERR "Don't know first GPIO bank IRQ.\n");
++ return -EINVAL;
++ }
+
+ clk = clk_get(NULL, "gpio");
+ if (IS_ERR(clk)) {
+ printk(KERN_ERR "Error %ld getting gpio clock?\n",
+ PTR_ERR(clk));
+- return 0;
++ return PTR_ERR(clk);
+ }
+-
+ clk_enable(clk);
+
+- for (gpio = 0, irq = gpio_to_irq(0), bank = IRQ_GPIOBNK0;
+- gpio < DAVINCI_N_GPIO; bank++) {
++ for (gpio = 0, irq = gpio_to_irq(0), bank = 0;
++ gpio < ngpio;
++ bank++, bank_irq++) {
+ struct gpio_controller *__iomem g = gpio2controller(gpio);
+ unsigned i;
+
+@@ -265,28 +301,28 @@ static int __init davinci_gpio_irq_setup
+ __raw_writel(~0, &g->clr_rising);
+
+ /* set up all irqs in this bank */
+- set_irq_chained_handler(bank, gpio_irq_handler);
+- set_irq_chip_data(bank, g);
+- set_irq_data(bank, (void *)irq);
++ set_irq_chained_handler(bank_irq, gpio_irq_handler);
++ set_irq_chip_data(bank_irq, g);
++ set_irq_data(bank_irq, (void *)irq);
+
+- for (i = 0; i < 16 && gpio < DAVINCI_N_GPIO;
+- i++, irq++, gpio++) {
++ for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) {
+ set_irq_chip(irq, &gpio_irqchip);
+ set_irq_chip_data(irq, g);
+ set_irq_handler(irq, handle_simple_irq);
+ set_irq_flags(irq, IRQF_VALID);
+ }
++
++ binten |= BIT(bank);
+ }
+
+ /* BINTEN -- per-bank interrupt enable. genirq would also let these
+ * bits be set/cleared dynamically.
+ */
+- __raw_writel(0x1f, (void *__iomem)
++ __raw_writel(binten, (void *__iomem)
+ IO_ADDRESS(DAVINCI_GPIO_BASE + 0x08));
+
+ printk(KERN_INFO "DaVinci: %d gpio irqs\n", irq - gpio_to_irq(0));
+
+ return 0;
+ }
+-
+ arch_initcall(davinci_gpio_irq_setup);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/id.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/id.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/id.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/id.c 2009-05-13 09:46:19.000000000 +0200
+@@ -15,7 +15,9 @@
+ #include <linux/init.h>
+ #include <linux/io.h>
+
+-#define JTAG_ID_BASE 0x01c40028
++#define JTAG_ID_BASE IO_ADDRESS(0x01c40028)
++
++static unsigned int davinci_revision;
+
+ struct davinci_id {
+ u8 variant; /* JTAG ID bits 31:28 */
+@@ -33,6 +35,20 @@ static struct davinci_id davinci_ids[] _
+ .manufacturer = 0x017,
+ .type = 0x64460000,
+ },
++ {
++ /* DM646X */
++ .part_no = 0xb770,
++ .variant = 0x0,
++ .manufacturer = 0x017,
++ .type = 0x64670000,
++ },
++ {
++ /* DM355 */
++ .part_no = 0xb73b,
++ .variant = 0x0,
++ .manufacturer = 0x00f,
++ .type = 0x03550000,
++ },
+ };
+
+ /*
+@@ -42,7 +58,7 @@ static u16 __init davinci_get_part_no(vo
+ {
+ u32 dev_id, part_no;
+
+- dev_id = davinci_readl(JTAG_ID_BASE);
++ dev_id = __raw_readl(JTAG_ID_BASE);
+
+ part_no = ((dev_id >> 12) & 0xffff);
+
+@@ -56,13 +72,19 @@ static u8 __init davinci_get_variant(voi
+ {
+ u32 variant;
+
+- variant = davinci_readl(JTAG_ID_BASE);
++ variant = __raw_readl(JTAG_ID_BASE);
+
+ variant = (variant >> 28) & 0xf;
+
+ return variant;
+ }
+
++unsigned int davinci_rev(void)
++{
++ return davinci_revision >> 16;
++}
++EXPORT_SYMBOL(davinci_rev);
++
+ void __init davinci_check_revision(void)
+ {
+ int i;
+@@ -75,7 +97,7 @@ void __init davinci_check_revision(void)
+ /* First check only the major version in a safe way */
+ for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
+ if (part_no == (davinci_ids[i].part_no)) {
+- system_rev = davinci_ids[i].type;
++ davinci_revision = davinci_ids[i].type;
+ break;
+ }
+ }
+@@ -84,10 +106,11 @@ void __init davinci_check_revision(void)
+ for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
+ if (part_no == davinci_ids[i].part_no &&
+ variant == davinci_ids[i].variant) {
+- system_rev = davinci_ids[i].type;
++ davinci_revision = davinci_ids[i].type;
+ break;
+ }
+ }
+
+- printk("DaVinci DM%04x variant 0x%x\n", system_rev >> 16, variant);
++ printk(KERN_INFO "DaVinci DM%04x variant 0x%x\n",
++ davinci_rev(), variant);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/board-dm6446evm.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/board-dm6446evm.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/board-dm6446evm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/board-dm6446evm.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,20 @@
++/*
++ * DaVinci DM6446 EVM board specific headers
++ *
++ * Author: Kevin Hilman, Deep Root Systems, LLC
++ *
++ * 2007 (c) Deep Root Systems, LLC. This file is licensed under
++ * the terms of the GNU General Public License version 2. This program
++ * is licensed "as is" without any warranty of any kind, whether express
++ * or ifndef.
++ */
++
++#ifndef _MACH_DAVINCI_DM6446EVM_H
++#define _MACH_DAVINCI_DM6446EVM_H
++
++#include <linux/types.h>
++
++int dm6446evm_eeprom_read(char *buf, off_t off, size_t count);
++int dm6446evm_eeprom_write(char *buf, off_t off, size_t count);
++
++#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/clkdev.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/clkdev.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/clkdev.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,13 @@
++#ifndef __MACH_CLKDEV_H
++#define __MACH_CLKDEV_H
++
++static inline int __clk_get(struct clk *clk)
++{
++ return 1;
++}
++
++static inline void __clk_put(struct clk *clk)
++{
++}
++
++#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/clock.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/clock.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/clock.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/clock.h 2009-05-13 09:46:19.000000000 +0200
+@@ -17,6 +17,5 @@ struct clk;
+
+ extern int clk_register(struct clk *clk);
+ extern void clk_unregister(struct clk *clk);
+-extern int davinci_clk_init(void);
+
+ #endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/common.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/common.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/common.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/common.h 2009-05-13 09:46:19.000000000 +0200
+@@ -16,6 +16,12 @@ struct sys_timer;
+
+ extern struct sys_timer davinci_timer;
+
++extern void davinci_irq_init(void);
++extern void davinci_map_common_io(void);
++
++/* parameters describe VBUS sourcing for host mode */
++extern void setup_usb(unsigned mA, unsigned potpgt_msec);
++
+ /* parameters describe VBUS sourcing for host mode */
+ extern void setup_usb(unsigned mA, unsigned potpgt_msec);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/cputype.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/cputype.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/cputype.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/cputype.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,49 @@
++/*
++ * DaVinci CPU type detection
++ *
++ * Author: Kevin Hilman, Deep Root Systems, LLC
++ *
++ * Defines the cpu_is_*() macros for runtime detection of DaVinci
++ * device type. In addtion, if support for a given device is not
++ * compiled in to the kernel, the macros return 0 so that
++ * resulting code can be optimized out.
++ *
++ * 2009 (c) Deep Root Systems, LLC. This file is licensed under
++ * the terms of the GNU General Public License version 2. This program
++ * is licensed "as is" without any warranty of any kind, whether express
++ * or implied.
++ */
++#ifndef _ASM_ARCH_CPU_H
++#define _ASM_ARCH_CPU_H
++
++extern unsigned int davinci_rev(void);
++
++#define IS_DAVINCI_CPU(type, id) \
++static inline int is_davinci_dm ##type(void) \
++{ \
++ return (davinci_rev() == (id)) ? 1 : 0; \
++}
++
++IS_DAVINCI_CPU(644x, 0x6446)
++IS_DAVINCI_CPU(646x, 0x6467)
++IS_DAVINCI_CPU(355, 0x355)
++
++#ifdef CONFIG_ARCH_DAVINCI_DM644x
++#define cpu_is_davinci_dm644x() is_davinci_dm644x()
++#else
++#define cpu_is_davinci_dm644x() 0
++#endif
++
++#ifdef CONFIG_ARCH_DAVINCI_DM646x
++#define cpu_is_davinci_dm646x() is_davinci_dm646x()
++#else
++#define cpu_is_davinci_dm646x() 0
++#endif
++
++#ifdef CONFIG_ARCH_DAVINCI_DM355
++#define cpu_is_davinci_dm355() is_davinci_dm355()
++#else
++#define cpu_is_davinci_dm355() 0
++#endif
++
++#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/dm644x.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/dm644x.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/dm644x.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/dm644x.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,37 @@
++/*
++ * This file contains the processor specific definitions
++ * of the TI DM644x.
++ *
++ * Copyright (C) 2008 Texas Instruments.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ *
++ */
++#ifndef __ASM_ARCH_DM644X_H
++#define __ASM_ARCH_DM644X_H
++
++#include <linux/platform_device.h>
++#include <mach/hardware.h>
++
++#define DM644X_EMAC_BASE (0x01C80000)
++#define DM644X_EMAC_CNTRL_OFFSET (0x0000)
++#define DM644X_EMAC_CNTRL_MOD_OFFSET (0x1000)
++#define DM644X_EMAC_CNTRL_RAM_OFFSET (0x2000)
++#define DM644X_EMAC_MDIO_OFFSET (0x4000)
++#define DM644X_EMAC_CNTRL_RAM_SIZE (0x2000)
++
++void __init dm644x_init(void);
++
++#endif /* __ASM_ARCH_DM644X_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/edma.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/edma.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/edma.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/edma.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,228 @@
++/*
++ * TI DAVINCI dma definitions
++ *
++ * Copyright (C) 2006-2009 Texas Instruments.
++ *
++ * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
++ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
++ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
++ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * 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.,
++ * 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++/*
++ * This EDMA3 programming framework exposes two basic kinds of resource:
++ *
++ * Channel Triggers transfers, usually from a hardware event but
++ * also manually or by "chaining" from DMA completions.
++ * Each channel is coupled to a Parameter RAM (PaRAM) slot.
++ *
++ * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM
++ * "set"), source and destination addresses, a link to a
++ * next PaRAM slot (if any), options for the transfer, and
++ * instructions for updating those addresses. There are
++ * more than twice as many slots as event channels.
++ *
++ * Each PaRAM set describes a sequence of transfers, either for one large
++ * buffer or for several discontiguous smaller buffers. An EDMA transfer
++ * is driven only from a channel, which performs the transfers specified
++ * in its PaRAM slot until there are no more transfers. When that last
++ * transfer completes, the "link" field may be used to reload the channel's
++ * PaRAM slot with a new transfer descriptor.
++ *
++ * The EDMA Channel Controller (CC) maps requests from channels into physical
++ * Transfer Controller (TC) requests when the channel triggers (by hardware
++ * or software events, or by chaining). The two physical DMA channels provided
++ * by the TCs are thus shared by many logical channels.
++ *
++ * DaVinci hardware also has a "QDMA" mechanism which is not currently
++ * supported through this interface. (DSP firmware uses it though.)
++ */
++
++#ifndef EDMA_H_
++#define EDMA_H_
++
++/* PaRAM slots are laid out like this */
++struct edmacc_param {
++ unsigned int opt;
++ unsigned int src;
++ unsigned int a_b_cnt;
++ unsigned int dst;
++ unsigned int src_dst_bidx;
++ unsigned int link_bcntrld;
++ unsigned int src_dst_cidx;
++ unsigned int ccnt;
++};
++
++#define CCINT0_INTERRUPT 16
++#define CCERRINT_INTERRUPT 17
++#define TCERRINT0_INTERRUPT 18
++#define TCERRINT1_INTERRUPT 19
++
++/* fields in edmacc_param.opt */
++#define SAM BIT(0)
++#define DAM BIT(1)
++#define SYNCDIM BIT(2)
++#define STATIC BIT(3)
++#define EDMA_FWID (0x07 << 8)
++#define TCCMODE BIT(11)
++#define EDMA_TCC(t) ((t) << 12)
++#define TCINTEN BIT(20)
++#define ITCINTEN BIT(21)
++#define TCCHEN BIT(22)
++#define ITCCHEN BIT(23)
++
++#define TRWORD (0x7<<2)
++#define PAENTRY (0x1ff<<5)
++
++/* Drivers should avoid using these symbolic names for dm644x
++ * channels, and use platform_device IORESOURCE_DMA resources
++ * instead. (Other DaVinci chips have different peripherals
++ * and thus have different DMA channel mappings.)
++ */
++#define DAVINCI_DMA_MCBSP_TX 2
++#define DAVINCI_DMA_MCBSP_RX 3
++#define DAVINCI_DMA_VPSS_HIST 4
++#define DAVINCI_DMA_VPSS_H3A 5
++#define DAVINCI_DMA_VPSS_PRVU 6
++#define DAVINCI_DMA_VPSS_RSZ 7
++#define DAVINCI_DMA_IMCOP_IMXINT 8
++#define DAVINCI_DMA_IMCOP_VLCDINT 9
++#define DAVINCI_DMA_IMCO_PASQINT 10
++#define DAVINCI_DMA_IMCOP_DSQINT 11
++#define DAVINCI_DMA_SPI_SPIX 16
++#define DAVINCI_DMA_SPI_SPIR 17
++#define DAVINCI_DMA_UART0_URXEVT0 18
++#define DAVINCI_DMA_UART0_UTXEVT0 19
++#define DAVINCI_DMA_UART1_URXEVT1 20
++#define DAVINCI_DMA_UART1_UTXEVT1 21
++#define DAVINCI_DMA_UART2_URXEVT2 22
++#define DAVINCI_DMA_UART2_UTXEVT2 23
++#define DAVINCI_DMA_MEMSTK_MSEVT 24
++#define DAVINCI_DMA_MMCRXEVT 26
++#define DAVINCI_DMA_MMCTXEVT 27
++#define DAVINCI_DMA_I2C_ICREVT 28
++#define DAVINCI_DMA_I2C_ICXEVT 29
++#define DAVINCI_DMA_GPIO_GPINT0 32
++#define DAVINCI_DMA_GPIO_GPINT1 33
++#define DAVINCI_DMA_GPIO_GPINT2 34
++#define DAVINCI_DMA_GPIO_GPINT3 35
++#define DAVINCI_DMA_GPIO_GPINT4 36
++#define DAVINCI_DMA_GPIO_GPINT5 37
++#define DAVINCI_DMA_GPIO_GPINT6 38
++#define DAVINCI_DMA_GPIO_GPINT7 39
++#define DAVINCI_DMA_GPIO_GPBNKINT0 40
++#define DAVINCI_DMA_GPIO_GPBNKINT1 41
++#define DAVINCI_DMA_GPIO_GPBNKINT2 42
++#define DAVINCI_DMA_GPIO_GPBNKINT3 43
++#define DAVINCI_DMA_GPIO_GPBNKINT4 44
++#define DAVINCI_DMA_TIMER0_TINT0 48
++#define DAVINCI_DMA_TIMER1_TINT1 49
++#define DAVINCI_DMA_TIMER2_TINT2 50
++#define DAVINCI_DMA_TIMER3_TINT3 51
++#define DAVINCI_DMA_PWM0 52
++#define DAVINCI_DMA_PWM1 53
++#define DAVINCI_DMA_PWM2 54
++
++/*ch_status paramater of callback function possible values*/
++#define DMA_COMPLETE 1
++#define DMA_CC_ERROR 2
++#define DMA_TC1_ERROR 3
++#define DMA_TC2_ERROR 4
++
++enum address_mode {
++ INCR = 0,
++ FIFO = 1
++};
++
++enum fifo_width {
++ W8BIT = 0,
++ W16BIT = 1,
++ W32BIT = 2,
++ W64BIT = 3,
++ W128BIT = 4,
++ W256BIT = 5
++};
++
++enum dma_event_q {
++ EVENTQ_0 = 0,
++ EVENTQ_1 = 1,
++ EVENTQ_DEFAULT = -1
++};
++
++enum sync_dimension {
++ ASYNC = 0,
++ ABSYNC = 1
++};
++
++#define EDMA_CHANNEL_ANY -1 /* for edma_alloc_channel() */
++#define EDMA_SLOT_ANY -1 /* for edma_alloc_slot() */
++
++/* alloc/free DMA channels and their dedicated parameter RAM slots */
++int edma_alloc_channel(int channel,
++ void (*callback)(unsigned channel, u16 ch_status, void *data),
++ void *data, enum dma_event_q);
++void edma_free_channel(unsigned channel);
++
++/* alloc/free parameter RAM slots */
++int edma_alloc_slot(int slot);
++void edma_free_slot(unsigned slot);
++
++/* calls that operate on part of a parameter RAM slot */
++void edma_set_src(unsigned slot, dma_addr_t src_port,
++ enum address_mode mode, enum fifo_width);
++void edma_set_dest(unsigned slot, dma_addr_t dest_port,
++ enum address_mode mode, enum fifo_width);
++void edma_get_position(unsigned slot, dma_addr_t *src, dma_addr_t *dst);
++void edma_set_src_index(unsigned slot, s16 src_bidx, s16 src_cidx);
++void edma_set_dest_index(unsigned slot, s16 dest_bidx, s16 dest_cidx);
++void edma_set_transfer_params(unsigned slot, u16 acnt, u16 bcnt, u16 ccnt,
++ u16 bcnt_rld, enum sync_dimension sync_mode);
++void edma_link(unsigned from, unsigned to);
++void edma_unlink(unsigned from);
++
++/* calls that operate on an entire parameter RAM slot */
++void edma_write_slot(unsigned slot, const struct edmacc_param *params);
++void edma_read_slot(unsigned slot, struct edmacc_param *params);
++
++/* channel control operations */
++int edma_start(unsigned channel);
++void edma_stop(unsigned channel);
++void edma_clean_channel(unsigned channel);
++void edma_clear_event(unsigned channel);
++void edma_pause(unsigned channel);
++void edma_resume(unsigned channel);
++
++/* UNRELATED TO DMA */
++int davinci_alloc_iram(unsigned size);
++void davinci_free_iram(unsigned addr, unsigned size);
++
++/* platform_data for EDMA driver */
++struct edma_soc_info {
++
++ /* how many dma resources of each type */
++ unsigned n_channel;
++ unsigned n_region;
++ unsigned n_slot;
++ unsigned n_tc;
++
++ /* list of channels with no even trigger; terminated by "-1" */
++ const s8 *noevent;
++};
++
++#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/gpio.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/gpio.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/gpio.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/gpio.h 2009-05-13 09:46:19.000000000 +0200
+@@ -15,9 +15,11 @@
+
+ #include <linux/io.h>
+ #include <asm-generic/gpio.h>
+-#include <mach/hardware.h>
++
+ #include <mach/irqs.h>
+
++#define DAVINCI_GPIO_BASE 0x01C67000
++
+ /*
+ * basic gpio routines
+ *
+@@ -26,23 +28,18 @@
+ * go through boot loaders.
+ *
+ * the gpio clock will be turned on when gpios are used, and you may also
+- * need to pay attention to PINMUX0 and PINMUX1 to be sure those pins are
++ * need to pay attention to PINMUX registers to be sure those pins are
+ * used as gpios, not with other peripherals.
+ *
+ * On-chip GPIOs are numbered 0..(DAVINCI_N_GPIO-1). For documentation,
+- * and maybe for later updates, code should write GPIO(N) or:
+- * - GPIOV18(N) for 1.8V pins, N in 0..53; same as GPIO(0)..GPIO(53)
+- * - GPIOV33(N) for 3.3V pins, N in 0..17; same as GPIO(54)..GPIO(70)
+- *
+- * For GPIO IRQs use gpio_to_irq(GPIO(N)) or gpio_to_irq(GPIOV33(N)) etc
+- * for now, that's != GPIO(N)
++ * and maybe for later updates, code may write GPIO(N). These may be
++ * all 1.8V signals, all 3.3V ones, or a mix of the two. A given chip
++ * may not support all the GPIOs in that range.
+ *
+ * GPIOs can also be on external chips, numbered after the ones built-in
+ * to the DaVinci chip. For now, they won't be usable as IRQ sources.
+ */
+-#define GPIO(X) (X) /* 0 <= X <= 70 */
+-#define GPIOV18(X) (X) /* 1.8V i/o; 0 <= X <= 53 */
+-#define GPIOV33(X) ((X)+54) /* 3.3V i/o; 0 <= X <= 17 */
++#define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */
+
+ struct gpio_controller {
+ u32 dir;
+@@ -71,12 +68,14 @@ __gpio_to_controller(unsigned gpio)
+ {
+ void *__iomem ptr;
+
+- if (gpio < 32)
++ if (gpio < 32 * 1)
+ ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x10);
+- else if (gpio < 64)
++ else if (gpio < 32 * 2)
+ ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x38);
+- else if (gpio < DAVINCI_N_GPIO)
++ else if (gpio < 32 * 3)
+ ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x60);
++ else if (gpio < 32 * 4)
++ ptr = IO_ADDRESS(DAVINCI_GPIO_BASE + 0x88);
+ else
+ ptr = NULL;
+ return ptr;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/hardware.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/hardware.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/hardware.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/hardware.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,9 +1,9 @@
+ /*
+- * Common hardware definitions
++ * Hardware definitions common to all DaVinci family processors
+ *
+- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
++ * Author: Kevin Hilman, Deep Root Systems, LLC
+ *
+- * 2007 (c) MontaVista Software, Inc. This file is licensed under
++ * 2007 (c) Deep Root Systems, LLC. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+@@ -12,41 +12,16 @@
+ #define __ASM_ARCH_HARDWARE_H
+
+ /*
+- * Base register addresses
++ * Before you add anything to ths file:
++ *
++ * This header is for defines common to ALL DaVinci family chips.
++ * Anything that is chip specific should go in <chipname>.h,
++ * and the chip/board init code should then explicitly include
++ * <chipname>.h
+ */
+-#define DAVINCI_DMA_3PCC_BASE (0x01C00000)
+-#define DAVINCI_DMA_3PTC0_BASE (0x01C10000)
+-#define DAVINCI_DMA_3PTC1_BASE (0x01C10400)
+-#define DAVINCI_I2C_BASE (0x01C21000)
+-#define DAVINCI_PWM0_BASE (0x01C22000)
+-#define DAVINCI_PWM1_BASE (0x01C22400)
+-#define DAVINCI_PWM2_BASE (0x01C22800)
+-#define DAVINCI_SYSTEM_MODULE_BASE (0x01C40000)
+-#define DAVINCI_PLL_CNTRL0_BASE (0x01C40800)
+-#define DAVINCI_PLL_CNTRL1_BASE (0x01C40C00)
+-#define DAVINCI_PWR_SLEEP_CNTRL_BASE (0x01C41000)
+-#define DAVINCI_SYSTEM_DFT_BASE (0x01C42000)
+-#define DAVINCI_IEEE1394_BASE (0x01C60000)
+-#define DAVINCI_USB_OTG_BASE (0x01C64000)
+-#define DAVINCI_CFC_ATA_BASE (0x01C66000)
+-#define DAVINCI_SPI_BASE (0x01C66800)
+-#define DAVINCI_GPIO_BASE (0x01C67000)
+-#define DAVINCI_UHPI_BASE (0x01C67800)
+-#define DAVINCI_VPSS_REGS_BASE (0x01C70000)
+-#define DAVINCI_EMAC_CNTRL_REGS_BASE (0x01C80000)
+-#define DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE (0x01C81000)
+-#define DAVINCI_EMAC_WRAPPER_RAM_BASE (0x01C82000)
+-#define DAVINCI_MDIO_CNTRL_REGS_BASE (0x01C84000)
+-#define DAVINCI_IMCOP_BASE (0x01CC0000)
+-#define DAVINCI_ASYNC_EMIF_CNTRL_BASE (0x01E00000)
+-#define DAVINCI_VLYNQ_BASE (0x01E01000)
+-#define DAVINCI_MCBSP_BASE (0x01E02000)
+-#define DAVINCI_MMC_SD_BASE (0x01E10000)
+-#define DAVINCI_MS_BASE (0x01E20000)
+-#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE (0x02000000)
+-#define DAVINCI_ASYNC_EMIF_DATA_CE1_BASE (0x04000000)
+-#define DAVINCI_ASYNC_EMIF_DATA_CE2_BASE (0x06000000)
+-#define DAVINCI_ASYNC_EMIF_DATA_CE3_BASE (0x08000000)
+-#define DAVINCI_VLYNQ_REMOTE_BASE (0x0C000000)
++#define DAVINCI_SYSTEM_MODULE_BASE 0x01C40000
++
++/* System control register offsets */
++#define DM64XX_VDD3P3V_PWDN 0x48
+
+ #endif /* __ASM_ARCH_HARDWARE_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/io.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/io.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/io.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/io.h 2009-05-13 09:46:19.000000000 +0200
+@@ -40,22 +40,12 @@
+ #else
+ #define IOMEM(x) ((void __force __iomem *)(x))
+
+-/*
+- * Functions to access the DaVinci IO region
+- *
+- * NOTE: - Use davinci_read/write[bwl] for physical register addresses
+- * - Use __raw_read/write[bwl]() for virtual register addresses
+- * - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses
+- * - DO NOT use hardcoded virtual addresses to allow changing the
+- * IO address space again if needed
+- */
+-#define davinci_readb(a) __raw_readb(IO_ADDRESS(a))
+-#define davinci_readw(a) __raw_readw(IO_ADDRESS(a))
+-#define davinci_readl(a) __raw_readl(IO_ADDRESS(a))
++#define __arch_ioremap(p, s, t) davinci_ioremap(p, s, t)
++#define __arch_iounmap(v) davinci_iounmap(v)
+
+-#define davinci_writeb(v, a) __raw_writeb(v, IO_ADDRESS(a))
+-#define davinci_writew(v, a) __raw_writew(v, IO_ADDRESS(a))
+-#define davinci_writel(v, a) __raw_writel(v, IO_ADDRESS(a))
++void __iomem *davinci_ioremap(unsigned long phys, size_t size,
++ unsigned int type);
++void davinci_iounmap(volatile void __iomem *addr);
+
+ #endif /* __ASSEMBLER__ */
+ #endif /* __ASM_ARCH_IO_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/irqs.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/irqs.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/irqs.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/irqs.h 2009-05-13 09:46:19.000000000 +0200
+@@ -96,10 +96,111 @@
+ #define IRQ_EMUINT 63
+
+ #define DAVINCI_N_AINTC_IRQ 64
+-#define DAVINCI_N_GPIO 71
++#define DAVINCI_N_GPIO 104
+
+ #define NR_IRQS (DAVINCI_N_AINTC_IRQ + DAVINCI_N_GPIO)
+
+ #define ARCH_TIMER_IRQ IRQ_TINT1_TINT34
+
++/* DaVinci DM6467-specific Interrupts */
++#define IRQ_DM646X_VP_VERTINT0 0
++#define IRQ_DM646X_VP_VERTINT1 1
++#define IRQ_DM646X_VP_VERTINT2 2
++#define IRQ_DM646X_VP_VERTINT3 3
++#define IRQ_DM646X_VP_ERRINT 4
++#define IRQ_DM646X_RESERVED_1 5
++#define IRQ_DM646X_RESERVED_2 6
++#define IRQ_DM646X_WDINT 7
++#define IRQ_DM646X_CRGENINT0 8
++#define IRQ_DM646X_CRGENINT1 9
++#define IRQ_DM646X_TSIFINT0 10
++#define IRQ_DM646X_TSIFINT1 11
++#define IRQ_DM646X_VDCEINT 12
++#define IRQ_DM646X_USBINT 13
++#define IRQ_DM646X_USBDMAINT 14
++#define IRQ_DM646X_PCIINT 15
++#define IRQ_DM646X_TCERRINT2 20
++#define IRQ_DM646X_TCERRINT3 21
++#define IRQ_DM646X_IDE 22
++#define IRQ_DM646X_HPIINT 23
++#define IRQ_DM646X_EMACRXTHINT 24
++#define IRQ_DM646X_EMACRXINT 25
++#define IRQ_DM646X_EMACTXINT 26
++#define IRQ_DM646X_EMACMISCINT 27
++#define IRQ_DM646X_MCASP0TXINT 28
++#define IRQ_DM646X_MCASP0RXINT 29
++#define IRQ_DM646X_RESERVED_3 31
++#define IRQ_DM646X_MCASP1TXINT 32
++#define IRQ_DM646X_VLQINT 38
++#define IRQ_DM646X_UARTINT2 42
++#define IRQ_DM646X_SPINT0 43
++#define IRQ_DM646X_SPINT1 44
++#define IRQ_DM646X_DSP2ARMINT 45
++#define IRQ_DM646X_RESERVED_4 46
++#define IRQ_DM646X_PSCINT 47
++#define IRQ_DM646X_GPIO0 48
++#define IRQ_DM646X_GPIO1 49
++#define IRQ_DM646X_GPIO2 50
++#define IRQ_DM646X_GPIO3 51
++#define IRQ_DM646X_GPIO4 52
++#define IRQ_DM646X_GPIO5 53
++#define IRQ_DM646X_GPIO6 54
++#define IRQ_DM646X_GPIO7 55
++#define IRQ_DM646X_GPIOBNK0 56
++#define IRQ_DM646X_GPIOBNK1 57
++#define IRQ_DM646X_GPIOBNK2 58
++#define IRQ_DM646X_DDRINT 59
++#define IRQ_DM646X_AEMIFINT 60
++
++/* DaVinci DM355-specific Interrupts */
++#define IRQ_DM355_CCDC_VDINT0 0
++#define IRQ_DM355_CCDC_VDINT1 1
++#define IRQ_DM355_CCDC_VDINT2 2
++#define IRQ_DM355_IPIPE_HST 3
++#define IRQ_DM355_H3AINT 4
++#define IRQ_DM355_IPIPE_SDR 5
++#define IRQ_DM355_IPIPEIFINT 6
++#define IRQ_DM355_OSDINT 7
++#define IRQ_DM355_VENCINT 8
++#define IRQ_DM355_IMCOPINT 11
++#define IRQ_DM355_RTOINT 13
++#define IRQ_DM355_TINT4 13
++#define IRQ_DM355_TINT2_TINT12 13
++#define IRQ_DM355_UARTINT2 14
++#define IRQ_DM355_TINT5 14
++#define IRQ_DM355_TINT2_TINT34 14
++#define IRQ_DM355_TINT6 15
++#define IRQ_DM355_TINT3_TINT12 15
++#define IRQ_DM355_SPINT1_0 17
++#define IRQ_DM355_SPINT1_1 18
++#define IRQ_DM355_SPINT2_0 19
++#define IRQ_DM355_SPINT2_1 21
++#define IRQ_DM355_TINT7 22
++#define IRQ_DM355_TINT3_TINT34 22
++#define IRQ_DM355_SDIOINT0 23
++#define IRQ_DM355_MMCINT0 26
++#define IRQ_DM355_MSINT 26
++#define IRQ_DM355_MMCINT1 27
++#define IRQ_DM355_PWMINT3 28
++#define IRQ_DM355_SDIOINT1 31
++#define IRQ_DM355_SPINT0_0 42
++#define IRQ_DM355_SPINT0_1 43
++#define IRQ_DM355_GPIO0 44
++#define IRQ_DM355_GPIO1 45
++#define IRQ_DM355_GPIO2 46
++#define IRQ_DM355_GPIO3 47
++#define IRQ_DM355_GPIO4 48
++#define IRQ_DM355_GPIO5 49
++#define IRQ_DM355_GPIO6 50
++#define IRQ_DM355_GPIO7 51
++#define IRQ_DM355_GPIO8 52
++#define IRQ_DM355_GPIO9 53
++#define IRQ_DM355_GPIOBNK0 54
++#define IRQ_DM355_GPIOBNK1 55
++#define IRQ_DM355_GPIOBNK2 56
++#define IRQ_DM355_GPIOBNK3 57
++#define IRQ_DM355_GPIOBNK4 58
++#define IRQ_DM355_GPIOBNK5 59
++#define IRQ_DM355_GPIOBNK6 60
++
+ #endif /* __ASM_ARCH_IRQS_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/mux.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/mux.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/mux.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/mux.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,55 +1,183 @@
+ /*
+- * DaVinci pin multiplexing defines
++ * Table of the DAVINCI register configurations for the PINMUX combinations
+ *
+ * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
+ *
++ * Based on linux/include/asm-arm/arch-omap/mux.h:
++ * Copyright (C) 2003 - 2005 Nokia Corporation
++ *
++ * Written by Tony Lindgren
++ *
+ * 2007 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
++ *
++ * Copyright (C) 2008 Texas Instruments.
+ */
+-#ifndef __ASM_ARCH_MUX_H
+-#define __ASM_ARCH_MUX_H
+
+-#define DAVINCI_MUX_AEAW0 0
+-#define DAVINCI_MUX_AEAW1 1
+-#define DAVINCI_MUX_AEAW2 2
+-#define DAVINCI_MUX_AEAW3 3
+-#define DAVINCI_MUX_AEAW4 4
+-#define DAVINCI_MUX_AECS4 10
+-#define DAVINCI_MUX_AECS5 11
+-#define DAVINCI_MUX_VLYNQWD0 12
+-#define DAVINCI_MUX_VLYNQWD1 13
+-#define DAVINCI_MUX_VLSCREN 14
+-#define DAVINCI_MUX_VLYNQEN 15
+-#define DAVINCI_MUX_HDIREN 16
+-#define DAVINCI_MUX_ATAEN 17
+-#define DAVINCI_MUX_RGB666 22
+-#define DAVINCI_MUX_RGB888 23
+-#define DAVINCI_MUX_LOEEN 24
+-#define DAVINCI_MUX_LFLDEN 25
+-#define DAVINCI_MUX_CWEN 26
+-#define DAVINCI_MUX_CFLDEN 27
+-#define DAVINCI_MUX_HPIEN 29
+-#define DAVINCI_MUX_1394EN 30
+-#define DAVINCI_MUX_EMACEN 31
+-
+-#define DAVINCI_MUX_LEVEL2 32
+-#define DAVINCI_MUX_UART0 (DAVINCI_MUX_LEVEL2 + 0)
+-#define DAVINCI_MUX_UART1 (DAVINCI_MUX_LEVEL2 + 1)
+-#define DAVINCI_MUX_UART2 (DAVINCI_MUX_LEVEL2 + 2)
+-#define DAVINCI_MUX_U2FLO (DAVINCI_MUX_LEVEL2 + 3)
+-#define DAVINCI_MUX_PWM0 (DAVINCI_MUX_LEVEL2 + 4)
+-#define DAVINCI_MUX_PWM1 (DAVINCI_MUX_LEVEL2 + 5)
+-#define DAVINCI_MUX_PWM2 (DAVINCI_MUX_LEVEL2 + 6)
+-#define DAVINCI_MUX_I2C (DAVINCI_MUX_LEVEL2 + 7)
+-#define DAVINCI_MUX_SPI (DAVINCI_MUX_LEVEL2 + 8)
+-#define DAVINCI_MUX_MSTK (DAVINCI_MUX_LEVEL2 + 9)
+-#define DAVINCI_MUX_ASP (DAVINCI_MUX_LEVEL2 + 10)
+-#define DAVINCI_MUX_CLK0 (DAVINCI_MUX_LEVEL2 + 16)
+-#define DAVINCI_MUX_CLK1 (DAVINCI_MUX_LEVEL2 + 17)
+-#define DAVINCI_MUX_TIMIN (DAVINCI_MUX_LEVEL2 + 18)
++#ifndef __INC_MACH_MUX_H
++#define __INC_MACH_MUX_H
++
++/* System module registers */
++#define PINMUX0 0x00
++#define PINMUX1 0x04
++/* dm355 only */
++#define PINMUX2 0x08
++#define PINMUX3 0x0c
++#define PINMUX4 0x10
++#define INTMUX 0x18
++#define EVTMUX 0x1c
++
++struct mux_config {
++ const char *name;
++ const char *mux_reg_name;
++ const unsigned char mux_reg;
++ const unsigned char mask_offset;
++ const unsigned char mask;
++ const unsigned char mode;
++ bool debug;
++};
++
++enum davinci_dm644x_index {
++ /* ATA and HDDIR functions */
++ DM644X_HDIREN,
++ DM644X_ATAEN,
++ DM644X_ATAEN_DISABLE,
++
++ /* HPI functions */
++ DM644X_HPIEN_DISABLE,
++
++ /* AEAW functions */
++ DM644X_AEAW,
++
++ /* Memory Stick */
++ DM644X_MSTK,
++
++ /* I2C */
++ DM644X_I2C,
++
++ /* ASP function */
++ DM644X_MCBSP,
++
++ /* UART1 */
++ DM644X_UART1,
++
++ /* UART2 */
++ DM644X_UART2,
++
++ /* PWM0 */
++ DM644X_PWM0,
++
++ /* PWM1 */
++ DM644X_PWM1,
++
++ /* PWM2 */
++ DM644X_PWM2,
++
++ /* VLYNQ function */
++ DM644X_VLYNQEN,
++ DM644X_VLSCREN,
++ DM644X_VLYNQWD,
++
++ /* EMAC and MDIO function */
++ DM644X_EMACEN,
++
++ /* GPIO3V[0:16] pins */
++ DM644X_GPIO3V,
++
++ /* GPIO pins */
++ DM644X_GPIO0,
++ DM644X_GPIO3,
++ DM644X_GPIO43_44,
++ DM644X_GPIO46_47,
++
++ /* VPBE */
++ DM644X_RGB666,
++
++ /* LCD */
++ DM644X_LOEEN,
++ DM644X_LFLDEN,
++};
++
++enum davinci_dm646x_index {
++ /* ATA function */
++ DM646X_ATAEN,
++
++ /* AUDIO Clock */
++ DM646X_AUDCK1,
++ DM646X_AUDCK0,
++
++ /* CRGEN Control */
++ DM646X_CRGMUX,
++
++ /* VPIF Control */
++ DM646X_STSOMUX_DISABLE,
++ DM646X_STSIMUX_DISABLE,
++ DM646X_PTSOMUX_DISABLE,
++ DM646X_PTSIMUX_DISABLE,
++
++ /* TSIF Control */
++ DM646X_STSOMUX,
++ DM646X_STSIMUX,
++ DM646X_PTSOMUX_PARALLEL,
++ DM646X_PTSIMUX_PARALLEL,
++ DM646X_PTSOMUX_SERIAL,
++ DM646X_PTSIMUX_SERIAL,
++};
++
++enum davinci_dm355_index {
++ /* MMC/SD 0 */
++ DM355_MMCSD0,
++
++ /* MMC/SD 1 */
++ DM355_SD1_CLK,
++ DM355_SD1_CMD,
++ DM355_SD1_DATA3,
++ DM355_SD1_DATA2,
++ DM355_SD1_DATA1,
++ DM355_SD1_DATA0,
++
++ /* I2C */
++ DM355_I2C_SDA,
++ DM355_I2C_SCL,
++
++ /* ASP0 function */
++ DM355_MCBSP0_BDX,
++ DM355_MCBSP0_X,
++ DM355_MCBSP0_BFSX,
++ DM355_MCBSP0_BDR,
++ DM355_MCBSP0_R,
++ DM355_MCBSP0_BFSR,
++
++ /* SPI0 */
++ DM355_SPI0_SDI,
++ DM355_SPI0_SDENA0,
++ DM355_SPI0_SDENA1,
++
++ /* IRQ muxing */
++ DM355_INT_EDMA_CC,
++ DM355_INT_EDMA_TC0_ERR,
++ DM355_INT_EDMA_TC1_ERR,
++
++ /* EDMA event muxing */
++ DM355_EVT8_ASP1_TX,
++ DM355_EVT9_ASP1_RX,
++ DM355_EVT26_MMC0_RX,
++};
+
+-extern void davinci_mux_peripheral(unsigned int mux, unsigned int enable);
++#ifdef CONFIG_DAVINCI_MUX
++/* setup pin muxing */
++extern void davinci_mux_init(void);
++extern int davinci_mux_register(const struct mux_config *pins,
++ unsigned long size);
++extern int davinci_cfg_reg(unsigned long reg_cfg);
++#else
++/* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */
++static inline void davinci_mux_init(void) {}
++static inline int davinci_mux_register(const struct mux_config *pins,
++ unsigned long size) { return 0; }
++static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; }
++#endif
+
+-#endif /* __ASM_ARCH_MUX_H */
++#endif /* __INC_MACH_MUX_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/psc.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/psc.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/psc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/psc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -38,8 +38,6 @@
+ #define DAVINCI_LPSC_TPTC1 4
+ #define DAVINCI_LPSC_EMAC 5
+ #define DAVINCI_LPSC_EMAC_WRAPPER 6
+-#define DAVINCI_LPSC_MDIO 7
+-#define DAVINCI_LPSC_IEEE1394 8
+ #define DAVINCI_LPSC_USB 9
+ #define DAVINCI_LPSC_ATA 10
+ #define DAVINCI_LPSC_VLYNQ 11
+@@ -47,7 +45,6 @@
+ #define DAVINCI_LPSC_DDR_EMIF 13
+ #define DAVINCI_LPSC_AEMIF 14
+ #define DAVINCI_LPSC_MMC_SD 15
+-#define DAVINCI_LPSC_MEMSTICK 16
+ #define DAVINCI_LPSC_McBSP 17
+ #define DAVINCI_LPSC_I2C 18
+ #define DAVINCI_LPSC_UART0 19
+@@ -73,4 +70,54 @@
+ #define DAVINCI_LPSC_GEM 39
+ #define DAVINCI_LPSC_IMCOP 40
+
++#define DM355_LPSC_TIMER3 5
++#define DM355_LPSC_SPI1 6
++#define DM355_LPSC_MMC_SD1 7
++#define DM355_LPSC_McBSP1 8
++#define DM355_LPSC_PWM3 10
++#define DM355_LPSC_SPI2 11
++#define DM355_LPSC_RTO 12
++#define DM355_LPSC_VPSS_DAC 41
++
++/*
++ * LPSC Assignments
++ */
++#define DM646X_LPSC_ARM 0
++#define DM646X_LPSC_C64X_CPU 1
++#define DM646X_LPSC_HDVICP0 2
++#define DM646X_LPSC_HDVICP1 3
++#define DM646X_LPSC_TPCC 4
++#define DM646X_LPSC_TPTC0 5
++#define DM646X_LPSC_TPTC1 6
++#define DM646X_LPSC_TPTC2 7
++#define DM646X_LPSC_TPTC3 8
++#define DM646X_LPSC_PCI 13
++#define DM646X_LPSC_EMAC 14
++#define DM646X_LPSC_VDCE 15
++#define DM646X_LPSC_VPSSMSTR 16
++#define DM646X_LPSC_VPSSSLV 17
++#define DM646X_LPSC_TSIF0 18
++#define DM646X_LPSC_TSIF1 19
++#define DM646X_LPSC_DDR_EMIF 20
++#define DM646X_LPSC_AEMIF 21
++#define DM646X_LPSC_McASP0 22
++#define DM646X_LPSC_McASP1 23
++#define DM646X_LPSC_CRGEN0 24
++#define DM646X_LPSC_CRGEN1 25
++#define DM646X_LPSC_UART0 26
++#define DM646X_LPSC_UART1 27
++#define DM646X_LPSC_UART2 28
++#define DM646X_LPSC_PWM0 29
++#define DM646X_LPSC_PWM1 30
++#define DM646X_LPSC_I2C 31
++#define DM646X_LPSC_SPI 32
++#define DM646X_LPSC_GPIO 33
++#define DM646X_LPSC_TIMER0 34
++#define DM646X_LPSC_TIMER1 35
++#define DM646X_LPSC_ARM_INTC 45
++
++extern int davinci_psc_is_clk_active(unsigned int id);
++extern void davinci_psc_config(unsigned int domain, unsigned int id,
++ char enable);
++
+ #endif /* __ASM_ARCH_PSC_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/serial.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/serial.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/include/mach/serial.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/include/mach/serial.h 2009-05-13 09:46:19.000000000 +0200
+@@ -13,8 +13,23 @@
+
+ #include <mach/io.h>
+
+-#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
+-#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
+-#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
++#define DAVINCI_MAX_NR_UARTS 3
++#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
++#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
++#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
++
++#define DM355_UART2_BASE (IO_PHYS + 0x206000)
++
++/* DaVinci UART register offsets */
++#define UART_DAVINCI_PWREMU 0x0c
++#define UART_DM646X_SCR 0x10
++#define UART_DM646X_SCR_TX_WATERMARK 0x08
++
++struct davinci_uart_config {
++ /* Bit field of UARTs present; bit 0 --> UART1 */
++ unsigned int enabled_uarts;
++};
++
++extern void davinci_serial_init(struct davinci_uart_config *);
+
+ #endif /* __ASM_ARCH_SERIAL_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/io.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/io.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/io.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/io.c 2009-05-13 09:46:19.000000000 +0200
+@@ -51,7 +51,26 @@ void __init davinci_map_common_io(void)
+ davinci_check_revision();
+ }
+
+-void __init davinci_init_common_hw(void)
++#define BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
++#define XLATE(p, pst, vst) ((void __iomem *)((p) - (pst) + (vst)))
++
++/*
++ * Intercept ioremap() requests for addresses in our fixed mapping regions.
++ */
++void __iomem *davinci_ioremap(unsigned long p, size_t size, unsigned int type)
++{
++ if (BETWEEN(p, IO_PHYS, IO_SIZE))
++ return XLATE(p, IO_PHYS, IO_VIRT);
++
++ return __arm_ioremap(p, size, type);
++}
++EXPORT_SYMBOL(davinci_ioremap);
++
++void davinci_iounmap(volatile void __iomem *addr)
+ {
+- davinci_clk_init();
++ unsigned long virt = (unsigned long)addr;
++
++ if (virt >= VMALLOC_START && virt < VMALLOC_END)
++ __iounmap(addr);
+ }
++EXPORT_SYMBOL(davinci_iounmap);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/irq.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/irq.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/irq.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/irq.c 2009-05-13 09:46:19.000000000 +0200
+@@ -25,6 +25,7 @@
+ #include <linux/io.h>
+
+ #include <mach/hardware.h>
++#include <mach/cputype.h>
+ #include <asm/mach/irq.h>
+
+ #define IRQ_BIT(irq) ((irq) & 0x1f)
+@@ -40,14 +41,18 @@
+ #define IRQ_INTPRI0_REG_OFFSET 0x0030
+ #define IRQ_INTPRI7_REG_OFFSET 0x004C
+
++const u8 *davinci_def_priorities;
++
++#define INTC_BASE IO_ADDRESS(DAVINCI_ARM_INTC_BASE)
++
+ static inline unsigned int davinci_irq_readl(int offset)
+ {
+- return davinci_readl(DAVINCI_ARM_INTC_BASE + offset);
++ return __raw_readl(INTC_BASE + offset);
+ }
+
+ static inline void davinci_irq_writel(unsigned long value, int offset)
+ {
+- davinci_writel(value, DAVINCI_ARM_INTC_BASE + offset);
++ __raw_writel(value, INTC_BASE + offset);
+ }
+
+ /* Disable interrupt */
+@@ -108,9 +113,8 @@ static struct irq_chip davinci_irq_chip_
+ .unmask = davinci_unmask_irq,
+ };
+
+-
+ /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
+-static const u8 default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = {
++static const u8 dm644x_default_priorities[DAVINCI_N_AINTC_IRQ] __initdata = {
+ [IRQ_VDINT0] = 2,
+ [IRQ_VDINT1] = 6,
+ [IRQ_VDINT2] = 6,
+@@ -177,11 +181,149 @@ static const u8 default_priorities[DAVIN
+ [IRQ_EMUINT] = 7,
+ };
+
++static const u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
++ [IRQ_DM646X_VP_VERTINT0] = 7,
++ [IRQ_DM646X_VP_VERTINT1] = 7,
++ [IRQ_DM646X_VP_VERTINT2] = 7,
++ [IRQ_DM646X_VP_VERTINT3] = 7,
++ [IRQ_DM646X_VP_ERRINT] = 7,
++ [IRQ_DM646X_RESERVED_1] = 7,
++ [IRQ_DM646X_RESERVED_2] = 7,
++ [IRQ_DM646X_WDINT] = 7,
++ [IRQ_DM646X_CRGENINT0] = 7,
++ [IRQ_DM646X_CRGENINT1] = 7,
++ [IRQ_DM646X_TSIFINT0] = 7,
++ [IRQ_DM646X_TSIFINT1] = 7,
++ [IRQ_DM646X_VDCEINT] = 7,
++ [IRQ_DM646X_USBINT] = 7,
++ [IRQ_DM646X_USBDMAINT] = 7,
++ [IRQ_DM646X_PCIINT] = 7,
++ [IRQ_CCINT0] = 7, /* dma */
++ [IRQ_CCERRINT] = 7, /* dma */
++ [IRQ_TCERRINT0] = 7, /* dma */
++ [IRQ_TCERRINT] = 7, /* dma */
++ [IRQ_DM646X_TCERRINT2] = 7,
++ [IRQ_DM646X_TCERRINT3] = 7,
++ [IRQ_DM646X_IDE] = 7,
++ [IRQ_DM646X_HPIINT] = 7,
++ [IRQ_DM646X_EMACRXTHINT] = 7,
++ [IRQ_DM646X_EMACRXINT] = 7,
++ [IRQ_DM646X_EMACTXINT] = 7,
++ [IRQ_DM646X_EMACMISCINT] = 7,
++ [IRQ_DM646X_MCASP0TXINT] = 7,
++ [IRQ_DM646X_MCASP0RXINT] = 7,
++ [IRQ_AEMIFINT] = 7,
++ [IRQ_DM646X_RESERVED_3] = 7,
++ [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
++ [IRQ_TINT0_TINT34] = 7, /* clocksource */
++ [IRQ_TINT1_TINT12] = 7, /* DSP timer */
++ [IRQ_TINT1_TINT34] = 7, /* system tick */
++ [IRQ_PWMINT0] = 7,
++ [IRQ_PWMINT1] = 7,
++ [IRQ_DM646X_VLQINT] = 7,
++ [IRQ_I2C] = 7,
++ [IRQ_UARTINT0] = 7,
++ [IRQ_UARTINT1] = 7,
++ [IRQ_DM646X_UARTINT2] = 7,
++ [IRQ_DM646X_SPINT0] = 7,
++ [IRQ_DM646X_SPINT1] = 7,
++ [IRQ_DM646X_DSP2ARMINT] = 7,
++ [IRQ_DM646X_RESERVED_4] = 7,
++ [IRQ_DM646X_PSCINT] = 7,
++ [IRQ_DM646X_GPIO0] = 7,
++ [IRQ_DM646X_GPIO1] = 7,
++ [IRQ_DM646X_GPIO2] = 7,
++ [IRQ_DM646X_GPIO3] = 7,
++ [IRQ_DM646X_GPIO4] = 7,
++ [IRQ_DM646X_GPIO5] = 7,
++ [IRQ_DM646X_GPIO6] = 7,
++ [IRQ_DM646X_GPIO7] = 7,
++ [IRQ_DM646X_GPIOBNK0] = 7,
++ [IRQ_DM646X_GPIOBNK1] = 7,
++ [IRQ_DM646X_GPIOBNK2] = 7,
++ [IRQ_DM646X_DDRINT] = 7,
++ [IRQ_DM646X_AEMIFINT] = 7,
++ [IRQ_COMMTX] = 7,
++ [IRQ_COMMRX] = 7,
++ [IRQ_EMUINT] = 7,
++};
++
++static const u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
++ [IRQ_DM355_CCDC_VDINT0] = 2,
++ [IRQ_DM355_CCDC_VDINT1] = 6,
++ [IRQ_DM355_CCDC_VDINT2] = 6,
++ [IRQ_DM355_IPIPE_HST] = 6,
++ [IRQ_DM355_H3AINT] = 6,
++ [IRQ_DM355_IPIPE_SDR] = 6,
++ [IRQ_DM355_IPIPEIFINT] = 6,
++ [IRQ_DM355_OSDINT] = 7,
++ [IRQ_DM355_VENCINT] = 6,
++ [IRQ_ASQINT] = 6,
++ [IRQ_IMXINT] = 6,
++ [IRQ_USBINT] = 4,
++ [IRQ_DM355_RTOINT] = 4,
++ [IRQ_DM355_UARTINT2] = 7,
++ [IRQ_DM355_TINT6] = 7,
++ [IRQ_CCINT0] = 5, /* dma */
++ [IRQ_CCERRINT] = 5, /* dma */
++ [IRQ_TCERRINT0] = 5, /* dma */
++ [IRQ_TCERRINT] = 5, /* dma */
++ [IRQ_DM355_SPINT2_1] = 7,
++ [IRQ_DM355_TINT7] = 4,
++ [IRQ_DM355_SDIOINT0] = 7,
++ [IRQ_MBXINT] = 7,
++ [IRQ_MBRINT] = 7,
++ [IRQ_MMCINT] = 7,
++ [IRQ_DM355_MMCINT1] = 7,
++ [IRQ_DM355_PWMINT3] = 7,
++ [IRQ_DDRINT] = 7,
++ [IRQ_AEMIFINT] = 7,
++ [IRQ_DM355_SDIOINT1] = 4,
++ [IRQ_TINT0_TINT12] = 2, /* clockevent */
++ [IRQ_TINT0_TINT34] = 2, /* clocksource */
++ [IRQ_TINT1_TINT12] = 7, /* DSP timer */
++ [IRQ_TINT1_TINT34] = 7, /* system tick */
++ [IRQ_PWMINT0] = 7,
++ [IRQ_PWMINT1] = 7,
++ [IRQ_PWMINT2] = 7,
++ [IRQ_I2C] = 3,
++ [IRQ_UARTINT0] = 3,
++ [IRQ_UARTINT1] = 3,
++ [IRQ_DM355_SPINT0_0] = 3,
++ [IRQ_DM355_SPINT0_1] = 3,
++ [IRQ_DM355_GPIO0] = 3,
++ [IRQ_DM355_GPIO1] = 7,
++ [IRQ_DM355_GPIO2] = 4,
++ [IRQ_DM355_GPIO3] = 4,
++ [IRQ_DM355_GPIO4] = 7,
++ [IRQ_DM355_GPIO5] = 7,
++ [IRQ_DM355_GPIO6] = 7,
++ [IRQ_DM355_GPIO7] = 7,
++ [IRQ_DM355_GPIO8] = 7,
++ [IRQ_DM355_GPIO9] = 7,
++ [IRQ_DM355_GPIOBNK0] = 7,
++ [IRQ_DM355_GPIOBNK1] = 7,
++ [IRQ_DM355_GPIOBNK2] = 7,
++ [IRQ_DM355_GPIOBNK3] = 7,
++ [IRQ_DM355_GPIOBNK4] = 7,
++ [IRQ_DM355_GPIOBNK5] = 7,
++ [IRQ_DM355_GPIOBNK6] = 7,
++ [IRQ_COMMTX] = 7,
++ [IRQ_COMMRX] = 7,
++ [IRQ_EMUINT] = 7,
++};
++
+ /* ARM Interrupt Controller Initialization */
+ void __init davinci_irq_init(void)
+ {
+ unsigned i;
+- const u8 *priority = default_priorities;
++
++ if (cpu_is_davinci_dm644x())
++ davinci_def_priorities = dm644x_default_priorities;
++ else if (cpu_is_davinci_dm646x())
++ davinci_def_priorities = dm646x_default_priorities;
++ else if (cpu_is_davinci_dm355())
++ davinci_def_priorities = dm355_default_priorities;
+
+ /* Clear all interrupt requests */
+ davinci_irq_writel(~0x0, FIQ_REG0_OFFSET);
+@@ -209,8 +351,8 @@ void __init davinci_irq_init(void)
+ unsigned j;
+ u32 pri;
+
+- for (j = 0, pri = 0; j < 32; j += 4, priority++)
+- pri |= (*priority & 0x07) << j;
++ for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++)
++ pri |= (*davinci_def_priorities & 0x07) << j;
+ davinci_irq_writel(pri, i);
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/Kconfig linux-2.6.30-rc4-git/arch/arm/mach-davinci/Kconfig
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -4,19 +4,56 @@ menu "TI DaVinci Implementations"
+
+ comment "DaVinci Core Type"
+
+-config ARCH_DAVINCI644x
+- default y
++config ARCH_DAVINCI_DM644x
+ bool "DaVinci 644x based system"
+
+ comment "DaVinci Board Type"
+
+ config MACH_DAVINCI_EVM
+- bool "TI DaVinci EVM"
++ bool "TI DM644x EVM"
+ default y
+- depends on ARCH_DAVINCI644x
++ depends on ARCH_DAVINCI_DM644x
+ help
+ Configure this option to specify the whether the board used
+- for development is a DaVinci EVM
++ for development is a DM644x EVM
++
++
++config DAVINCI_MUX
++ bool "DAVINCI multiplexing support"
++ depends on ARCH_DAVINCI
++ default y
++ help
++ Pin multiplexing support for DAVINCI boards. If your bootloader
++ sets the multiplexing correctly, say N. Otherwise, or if unsure,
++ say Y.
++
++config DAVINCI_MUX_DEBUG
++ bool "Multiplexing debug output"
++ depends on DAVINCI_MUX
++ help
++ Makes the multiplexing functions print out a lot of debug info.
++ This is useful if you want to find out the correct values of the
++ multiplexing registers.
++
++config DAVINCI_MUX_WARNINGS
++ bool "Warn about pins the bootloader didn't set up"
++ depends on DAVINCI_MUX
++ help
++ Choose Y here to warn whenever driver initialization logic needs
++ to change the pin multiplexing setup. When there are no warnings
++ printed, it's safe to deselect DAVINCI_MUX for your product.
++
++config DAVINCI_RESET_CLOCKS
++ bool "Reset unused clocks during boot"
++ depends on ARCH_DAVINCI
++ help
++ Say Y if you want to reset unused clocks during boot.
++ This option saves power, but assumes all drivers are
++ using the clock framework. Broken drivers that do not
++ yet use clock framework may not work with this option.
++ If you are booting from another operating system, you
++ probably do not want this option enabled until your
++ device drivers work properly.
+
+ endmenu
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/Makefile linux-2.6.30-rc4-git/arch/arm/mach-davinci/Makefile
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -5,7 +5,12 @@
+
+ # Common objects
+ obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \
+- gpio.o mux.o devices.o usb.o
++ gpio.o devices.o dma.o usb.o
++
++obj-$(CONFIG_DAVINCI_MUX) += mux.o
++
++# Chip specific
++obj-$(CONFIG_ARCH_DAVINCI_DM644x) += dm644x.o
+
+ # Board specific
+-obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.o
++obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/mux.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/mux.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/mux.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/mux.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1,41 +1,103 @@
+ /*
+- * DaVinci pin multiplexing configurations
++ * Utility to set the DAVINCI MUX register from a table in mux.h
+ *
+ * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
+ *
++ * Based on linux/arch/arm/plat-omap/mux.c:
++ * Copyright (C) 2003 - 2005 Nokia Corporation
++ *
++ * Written by Tony Lindgren
++ *
+ * 2007 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
++ *
++ * Copyright (C) 2008 Texas Instruments.
+ */
+ #include <linux/io.h>
++#include <linux/module.h>
+ #include <linux/spinlock.h>
+
+ #include <mach/hardware.h>
+-
+ #include <mach/mux.h>
+
+-/* System control register offsets */
+-#define PINMUX0 0x00
+-#define PINMUX1 0x04
++static const struct mux_config *mux_table;
++static unsigned long pin_table_sz;
+
+-static DEFINE_SPINLOCK(mux_lock);
++int __init davinci_mux_register(const struct mux_config *pins,
++ unsigned long size)
++{
++ mux_table = pins;
++ pin_table_sz = size;
+
+-void davinci_mux_peripheral(unsigned int mux, unsigned int enable)
++ return 0;
++}
++
++/*
++ * Sets the DAVINCI MUX register based on the table
++ */
++int __init_or_module davinci_cfg_reg(const unsigned long index)
+ {
+- u32 pinmux, muxreg = PINMUX0;
++ static DEFINE_SPINLOCK(mux_spin_lock);
++ void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
++ unsigned long flags;
++ const struct mux_config *cfg;
++ unsigned int reg_orig = 0, reg = 0;
++ unsigned int mask, warn = 0;
++
++ if (!mux_table)
++ BUG();
++
++ if (index >= pin_table_sz) {
++ printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
++ index, pin_table_sz);
++ dump_stack();
++ return -ENODEV;
++ }
++
++ cfg = &mux_table[index];
++
++ if (cfg->name == NULL) {
++ printk(KERN_ERR "No entry for the specified index\n");
++ return -ENODEV;
++ }
++
++ /* Update the mux register in question */
++ if (cfg->mask) {
++ unsigned tmp1, tmp2;
++
++ spin_lock_irqsave(&mux_spin_lock, flags);
++ reg_orig = __raw_readl(base + cfg->mux_reg);
++
++ mask = (cfg->mask << cfg->mask_offset);
++ tmp1 = reg_orig & mask;
++ reg = reg_orig & ~mask;
++
++ tmp2 = (cfg->mode << cfg->mask_offset);
++ reg |= tmp2;
++
++ if (tmp1 != tmp2)
++ warn = 1;
++
++ __raw_writel(reg, base + cfg->mux_reg);
++ spin_unlock_irqrestore(&mux_spin_lock, flags);
++ }
++
++ if (warn) {
++#ifdef CONFIG_DAVINCI_MUX_WARNINGS
++ printk(KERN_WARNING "MUX: initialized %s\n", cfg->name);
++#endif
++ }
+
+- if (mux >= DAVINCI_MUX_LEVEL2) {
+- muxreg = PINMUX1;
+- mux -= DAVINCI_MUX_LEVEL2;
++#ifdef CONFIG_DAVINCI_MUX_DEBUG
++ if (cfg->debug || warn) {
++ printk(KERN_WARNING "MUX: Setting register %s\n", cfg->name);
++ printk(KERN_WARNING " %s (0x%08x) = 0x%08x -> 0x%08x\n",
++ cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg);
+ }
++#endif
+
+- spin_lock(&mux_lock);
+- pinmux = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + muxreg);
+- if (enable)
+- pinmux |= (1 << mux);
+- else
+- pinmux &= ~(1 << mux);
+- davinci_writel(pinmux, DAVINCI_SYSTEM_MODULE_BASE + muxreg);
+- spin_unlock(&mux_lock);
++ return 0;
+ }
++EXPORT_SYMBOL(davinci_cfg_reg);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/mux.h linux-2.6.30-rc4-git/arch/arm/mach-davinci/mux.h
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/mux.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/mux.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,51 @@
++/*
++ * Pin-multiplex helper macros for TI DaVinci family devices
++ *
++ * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
++ *
++ * 2007 (c) MontaVista Software, Inc. This file is licensed under
++ * the terms of the GNU General Public License version 2. This program
++ * is licensed "as is" without any warranty of any kind, whether express
++ * or implied.
++ *
++ * Copyright (C) 2008 Texas Instruments.
++ */
++#ifndef _MACH_DAVINCI_MUX_H_
++#define _MACH_DAVINCI_MUX_H_
++
++#include <mach/mux.h>
++
++#define MUX_CFG(soc, desc, muxreg, mode_offset, mode_mask, mux_mode, dbg)\
++[soc##_##desc] = { \
++ .name = #desc, \
++ .debug = dbg, \
++ .mux_reg_name = "PINMUX"#muxreg, \
++ .mux_reg = PINMUX##muxreg, \
++ .mask_offset = mode_offset, \
++ .mask = mode_mask, \
++ .mode = mux_mode, \
++ },
++
++#define INT_CFG(soc, desc, mode_offset, mode_mask, mux_mode, dbg) \
++[soc##_##desc] = { \
++ .name = #desc, \
++ .debug = dbg, \
++ .mux_reg_name = "INTMUX", \
++ .mux_reg = INTMUX, \
++ .mask_offset = mode_offset, \
++ .mask = mode_mask, \
++ .mode = mux_mode, \
++ },
++
++#define EVT_CFG(soc, desc, mode_offset, mode_mask, mux_mode, dbg) \
++[soc##_##desc] = { \
++ .name = #desc, \
++ .debug = dbg, \
++ .mux_reg_name = "EVTMUX", \
++ .mux_reg = EVTMUX, \
++ .mask_offset = mode_offset, \
++ .mask = mode_mask, \
++ .mode = mux_mode, \
++ },
++
++#endif /* _MACH_DAVINCI_MUX_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/psc.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/psc.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/psc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/psc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -23,10 +23,13 @@
+ #include <linux/init.h>
+ #include <linux/io.h>
+
++#include <mach/cputype.h>
+ #include <mach/hardware.h>
+ #include <mach/psc.h>
+ #include <mach/mux.h>
+
++#define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01C41000
++
+ /* PSC register offsets */
+ #define EPCPR 0x070
+ #define PTCMD 0x120
+@@ -36,102 +39,61 @@
+ #define MDSTAT 0x800
+ #define MDCTL 0xA00
+
+-/* System control register offsets */
+-#define VDD3P3V_PWDN 0x48
++#define MDSTAT_STATE_MASK 0x1f
+
+-static void davinci_psc_mux(unsigned int id)
++/* Return nonzero iff the domain's clock is active */
++int __init davinci_psc_is_clk_active(unsigned int id)
+ {
+- switch (id) {
+- case DAVINCI_LPSC_ATA:
+- davinci_mux_peripheral(DAVINCI_MUX_HDIREN, 1);
+- davinci_mux_peripheral(DAVINCI_MUX_ATAEN, 1);
+- break;
+- case DAVINCI_LPSC_MMC_SD:
+- /* VDD power manupulations are done in U-Boot for CPMAC
+- * so applies to MMC as well
+- */
+- /*Set up the pull regiter for MMC */
+- davinci_writel(0, DAVINCI_SYSTEM_MODULE_BASE + VDD3P3V_PWDN);
+- davinci_mux_peripheral(DAVINCI_MUX_MSTK, 0);
+- break;
+- case DAVINCI_LPSC_I2C:
+- davinci_mux_peripheral(DAVINCI_MUX_I2C, 1);
+- break;
+- case DAVINCI_LPSC_McBSP:
+- davinci_mux_peripheral(DAVINCI_MUX_ASP, 1);
+- break;
+- default:
+- break;
+- }
++ void __iomem *psc_base = IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE);
++ u32 mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
++
++ /* if clocked, state can be "Enable" or "SyncReset" */
++ return mdstat & BIT(12);
+ }
+
+ /* Enable or disable a PSC domain */
+ void davinci_psc_config(unsigned int domain, unsigned int id, char enable)
+ {
+- u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl, mdstat_mask;
++ u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl;
++ void __iomem *psc_base = IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE);
++ u32 next_state = enable ? 0x3 : 0x2; /* 0x3 enables, 0x2 disables */
++
++ mdctl = __raw_readl(psc_base + MDCTL + 4 * id);
++ mdctl &= ~MDSTAT_STATE_MASK;
++ mdctl |= next_state;
++ __raw_writel(mdctl, psc_base + MDCTL + 4 * id);
+
+- mdctl = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + MDCTL + 4 * id);
+- if (enable)
+- mdctl |= 0x00000003; /* Enable Module */
+- else
+- mdctl &= 0xFFFFFFF2; /* Disable Module */
+- davinci_writel(mdctl, DAVINCI_PWR_SLEEP_CNTRL_BASE + MDCTL + 4 * id);
+-
+- pdstat = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + PDSTAT);
++ pdstat = __raw_readl(psc_base + PDSTAT);
+ if ((pdstat & 0x00000001) == 0) {
+- pdctl1 = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + PDCTL1);
++ pdctl1 = __raw_readl(psc_base + PDCTL1);
+ pdctl1 |= 0x1;
+- davinci_writel(pdctl1, DAVINCI_PWR_SLEEP_CNTRL_BASE + PDCTL1);
++ __raw_writel(pdctl1, psc_base + PDCTL1);
+
+ ptcmd = 1 << domain;
+- davinci_writel(ptcmd, DAVINCI_PWR_SLEEP_CNTRL_BASE + PTCMD);
++ __raw_writel(ptcmd, psc_base + PTCMD);
+
+ do {
+- epcpr = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE +
+- EPCPR);
++ epcpr = __raw_readl(psc_base + EPCPR);
+ } while ((((epcpr >> domain) & 1) == 0));
+
+- pdctl1 = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + PDCTL1);
++ pdctl1 = __raw_readl(psc_base + PDCTL1);
+ pdctl1 |= 0x100;
+- davinci_writel(pdctl1, DAVINCI_PWR_SLEEP_CNTRL_BASE + PDCTL1);
++ __raw_writel(pdctl1, psc_base + PDCTL1);
+
+ do {
+- ptstat = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE +
++ ptstat = __raw_readl(psc_base +
+ PTSTAT);
+ } while (!(((ptstat >> domain) & 1) == 0));
+ } else {
+ ptcmd = 1 << domain;
+- davinci_writel(ptcmd, DAVINCI_PWR_SLEEP_CNTRL_BASE + PTCMD);
++ __raw_writel(ptcmd, psc_base + PTCMD);
+
+ do {
+- ptstat = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE +
+- PTSTAT);
++ ptstat = __raw_readl(psc_base + PTSTAT);
+ } while (!(((ptstat >> domain) & 1) == 0));
+ }
+
+- if (enable)
+- mdstat_mask = 0x3;
+- else
+- mdstat_mask = 0x2;
+-
+ do {
+- mdstat = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE +
+- MDSTAT + 4 * id);
+- } while (!((mdstat & 0x0000001F) == mdstat_mask));
+-
+- if (enable)
+- davinci_psc_mux(id);
+-}
+-
+-void __init davinci_psc_init(void)
+-{
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSMSTR, 1);
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSSLV, 1);
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPCC, 1);
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC0, 1);
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC1, 1);
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_GPIO, 1);
+-
+- /* Turn on WatchDog timer LPSC. Needed for RESET to work */
+- davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER2, 1);
++ mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
++ } while (!((mdstat & MDSTAT_STATE_MASK) == next_state));
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/serial.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/serial.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/serial.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/serial.c 2009-05-13 09:46:19.000000000 +0200
+@@ -32,32 +32,47 @@
+ #include <mach/hardware.h>
+ #include <mach/serial.h>
+ #include <mach/irqs.h>
++#include <mach/cputype.h>
++#include "clock.h"
+
+-#define UART_DAVINCI_PWREMU 0x0c
+-
+-static inline unsigned int davinci_serial_in(struct plat_serial8250_port *up,
+- int offset)
++static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
++ int offset)
+ {
+ offset <<= up->regshift;
+- return (unsigned int)__raw_readb(up->membase + offset);
++ return (unsigned int)__raw_readl(IO_ADDRESS(up->mapbase) + offset);
+ }
+
+-static inline void davinci_serial_outp(struct plat_serial8250_port *p,
+- int offset, int value)
++static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
++ int value)
+ {
+ offset <<= p->regshift;
+- __raw_writeb(value, p->membase + offset);
++ __raw_writel(value, IO_ADDRESS(p->mapbase) + offset);
+ }
+
+ static struct plat_serial8250_port serial_platform_data[] = {
+ {
+- .membase = (char *)IO_ADDRESS(DAVINCI_UART0_BASE),
+- .mapbase = (unsigned long)DAVINCI_UART0_BASE,
++ .mapbase = DAVINCI_UART0_BASE,
+ .irq = IRQ_UARTINT0,
+- .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
++ UPF_IOREMAP,
++ .iotype = UPIO_MEM,
++ .regshift = 2,
++ },
++ {
++ .mapbase = DAVINCI_UART1_BASE,
++ .irq = IRQ_UARTINT1,
++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
++ UPF_IOREMAP,
++ .iotype = UPIO_MEM,
++ .regshift = 2,
++ },
++ {
++ .mapbase = DAVINCI_UART2_BASE,
++ .irq = IRQ_UARTINT2,
++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
++ UPF_IOREMAP,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+- .uartclk = 27000000,
+ },
+ {
+ .flags = 0
+@@ -74,22 +89,68 @@ static struct platform_device serial_dev
+
+ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
+ {
+- /* reset both transmitter and receiver: bits 14,13 = UTRST, URRST */
+ unsigned int pwremu = 0;
+
+- davinci_serial_outp(p, UART_IER, 0); /* disable all interrupts */
++ serial_write_reg(p, UART_IER, 0); /* disable all interrupts */
+
+- davinci_serial_outp(p, UART_DAVINCI_PWREMU, pwremu);
++ /* reset both transmitter and receiver: bits 14,13 = UTRST, URRST */
++ serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
+ mdelay(10);
+
+ pwremu |= (0x3 << 13);
+ pwremu |= 0x1;
+- davinci_serial_outp(p, UART_DAVINCI_PWREMU, pwremu);
++ serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
++
++ if (cpu_is_davinci_dm646x())
++ serial_write_reg(p, UART_DM646X_SCR,
++ UART_DM646X_SCR_TX_WATERMARK);
++}
++
++void __init davinci_serial_init(struct davinci_uart_config *info)
++{
++ int i;
++ char name[16];
++ struct clk *uart_clk;
++ struct device *dev = &serial_device.dev;
++
++ /*
++ * Make sure the serial ports are muxed on at this point.
++ * You have to mux them off in device drivers later on
++ * if not needed.
++ */
++ for (i = 0; i < DAVINCI_MAX_NR_UARTS; i++) {
++ struct plat_serial8250_port *p = serial_platform_data + i;
++
++ if (!(info->enabled_uarts & (1 << i))) {
++ p->flags = 0;
++ continue;
++ }
++
++ if (cpu_is_davinci_dm646x())
++ p->iotype = UPIO_MEM32;
++
++ if (cpu_is_davinci_dm355()) {
++ if (i == 2) {
++ p->mapbase = (unsigned long)DM355_UART2_BASE;
++ p->irq = IRQ_DM355_UARTINT2;
++ }
++ }
++
++ sprintf(name, "uart%d", i);
++ uart_clk = clk_get(dev, name);
++ if (IS_ERR(uart_clk))
++ printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
++ __func__, __LINE__, i);
++ else {
++ clk_enable(uart_clk);
++ p->uartclk = clk_get_rate(uart_clk);
++ davinci_serial_reset(p);
++ }
++ }
+ }
+
+ static int __init davinci_init(void)
+ {
+- davinci_serial_reset(&serial_platform_data[0]);
+ return platform_device_register(&serial_device);
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/time.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/time.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/time.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/time.c 2009-05-13 09:46:19.000000000 +0200
+@@ -16,6 +16,9 @@
+ #include <linux/clockchips.h>
+ #include <linux/spinlock.h>
+ #include <linux/io.h>
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/device.h>
+
+ #include <mach/hardware.h>
+ #include <asm/system.h>
+@@ -24,8 +27,11 @@
+ #include <asm/mach/time.h>
+ #include <asm/errno.h>
+ #include <mach/io.h>
++#include <mach/cputype.h>
++#include "clock.h"
+
+ static struct clock_event_device clockevent_davinci;
++static unsigned int davinci_clock_tick_rate;
+
+ #define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
+ #define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
+@@ -99,9 +105,9 @@ struct timer_s {
+ unsigned int id;
+ unsigned long period;
+ unsigned long opts;
+- unsigned long reg_base;
+- unsigned long tim_reg;
+- unsigned long prd_reg;
++ void __iomem *base;
++ unsigned long tim_off;
++ unsigned long prd_off;
+ unsigned long enamode_shift;
+ struct irqaction irqaction;
+ };
+@@ -114,15 +120,15 @@ static struct timer_s timers[];
+
+ static int timer32_config(struct timer_s *t)
+ {
+- u32 tcr = davinci_readl(t->reg_base + TCR);
++ u32 tcr = __raw_readl(t->base + TCR);
+
+ /* disable timer */
+ tcr &= ~(TCR_ENAMODE_MASK << t->enamode_shift);
+- davinci_writel(tcr, t->reg_base + TCR);
++ __raw_writel(tcr, t->base + TCR);
+
+ /* reset counter to zero, set new period */
+- davinci_writel(0, t->tim_reg);
+- davinci_writel(t->period, t->prd_reg);
++ __raw_writel(0, t->base + t->tim_off);
++ __raw_writel(t->period, t->base + t->prd_off);
+
+ /* Set enable mode */
+ if (t->opts & TIMER_OPTS_ONESHOT) {
+@@ -131,13 +137,13 @@ static int timer32_config(struct timer_s
+ tcr |= TCR_ENAMODE_PERIODIC << t->enamode_shift;
+ }
+
+- davinci_writel(tcr, t->reg_base + TCR);
++ __raw_writel(tcr, t->base + TCR);
+ return 0;
+ }
+
+ static inline u32 timer32_read(struct timer_s *t)
+ {
+- return davinci_readl(t->tim_reg);
++ return __raw_readl(t->base + t->tim_off);
+ }
+
+ static irqreturn_t timer_interrupt(int irq, void *dev_id)
+@@ -176,51 +182,54 @@ static struct timer_s timers[] = {
+
+ static void __init timer_init(void)
+ {
+- u32 bases[] = {DAVINCI_TIMER0_BASE, DAVINCI_TIMER1_BASE};
++ u32 phys_bases[] = {DAVINCI_TIMER0_BASE, DAVINCI_TIMER1_BASE};
+ int i;
+
+ /* Global init of each 64-bit timer as a whole */
+ for(i=0; i<2; i++) {
+- u32 tgcr, base = bases[i];
++ u32 tgcr;
++ void __iomem *base = IO_ADDRESS(phys_bases[i]);
+
+ /* Disabled, Internal clock source */
+- davinci_writel(0, base + TCR);
++ __raw_writel(0, base + TCR);
+
+ /* reset both timers, no pre-scaler for timer34 */
+ tgcr = 0;
+- davinci_writel(tgcr, base + TGCR);
++ __raw_writel(tgcr, base + TGCR);
+
+ /* Set both timers to unchained 32-bit */
+ tgcr = TGCR_TIMMODE_32BIT_UNCHAINED << TGCR_TIMMODE_SHIFT;
+- davinci_writel(tgcr, base + TGCR);
++ __raw_writel(tgcr, base + TGCR);
+
+ /* Unreset timers */
+ tgcr |= (TGCR_UNRESET << TGCR_TIM12RS_SHIFT) |
+ (TGCR_UNRESET << TGCR_TIM34RS_SHIFT);
+- davinci_writel(tgcr, base + TGCR);
++ __raw_writel(tgcr, base + TGCR);
+
+ /* Init both counters to zero */
+- davinci_writel(0, base + TIM12);
+- davinci_writel(0, base + TIM34);
++ __raw_writel(0, base + TIM12);
++ __raw_writel(0, base + TIM34);
+ }
+
+ /* Init of each timer as a 32-bit timer */
+ for (i=0; i< ARRAY_SIZE(timers); i++) {
+ struct timer_s *t = &timers[i];
++ u32 phys_base;
+
+ if (t->name) {
+ t->id = i;
+- t->reg_base = (IS_TIMER1(t->id) ?
++ phys_base = (IS_TIMER1(t->id) ?
+ DAVINCI_TIMER1_BASE : DAVINCI_TIMER0_BASE);
++ t->base = IO_ADDRESS(phys_base);
+
+ if (IS_TIMER_BOT(t->id)) {
+ t->enamode_shift = 6;
+- t->tim_reg = t->reg_base + TIM12;
+- t->prd_reg = t->reg_base + PRD12;
++ t->tim_off = TIM12;
++ t->prd_off = PRD12;
+ } else {
+ t->enamode_shift = 22;
+- t->tim_reg = t->reg_base + TIM34;
+- t->prd_reg = t->reg_base + PRD34;
++ t->tim_off = TIM34;
++ t->prd_off = PRD34;
+ }
+
+ /* Register interrupt */
+@@ -274,7 +283,7 @@ static void davinci_set_mode(enum clock_
+
+ switch (mode) {
+ case CLOCK_EVT_MODE_PERIODIC:
+- t->period = CLOCK_TICK_RATE / (HZ);
++ t->period = davinci_clock_tick_rate / (HZ);
+ t->opts = TIMER_OPTS_PERIODIC;
+ timer32_config(t);
+ break;
+@@ -301,21 +310,29 @@ static struct clock_event_device clockev
+
+ static void __init davinci_timer_init(void)
+ {
++ struct clk *timer_clk;
++
+ static char err[] __initdata = KERN_ERR
+ "%s: can't register clocksource!\n";
+
+ /* init timer hw */
+ timer_init();
+
++ timer_clk = clk_get(NULL, "timer0");
++ BUG_ON(IS_ERR(timer_clk));
++ clk_enable(timer_clk);
++
++ davinci_clock_tick_rate = clk_get_rate(timer_clk);
++
+ /* setup clocksource */
+ clocksource_davinci.mult =
+- clocksource_khz2mult(CLOCK_TICK_RATE/1000,
++ clocksource_khz2mult(davinci_clock_tick_rate/1000,
+ clocksource_davinci.shift);
+ if (clocksource_register(&clocksource_davinci))
+ printk(err, clocksource_davinci.name);
+
+ /* setup clockevent */
+- clockevent_davinci.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
++ clockevent_davinci.mult = div_sc(davinci_clock_tick_rate, NSEC_PER_SEC,
+ clockevent_davinci.shift);
+ clockevent_davinci.max_delta_ns =
+ clockevent_delta2ns(0xfffffffe, &clockevent_davinci);
+@@ -333,42 +350,52 @@ struct sys_timer davinci_timer = {
+
+ /* reset board using watchdog timer */
+ void davinci_watchdog_reset(void) {
+- u32 tgcr, wdtcr, base = DAVINCI_WDOG_BASE;
++ u32 tgcr, wdtcr;
++ void __iomem *base = IO_ADDRESS(DAVINCI_WDOG_BASE);
++ struct device dev;
++ struct clk *wd_clk;
++ char *name = "watchdog";
++
++ dev_set_name(&dev, name);
++ wd_clk = clk_get(&dev, NULL);
++ if (WARN_ON(IS_ERR(wd_clk)))
++ return;
++ clk_enable(wd_clk);
+
+ /* disable, internal clock source */
+- davinci_writel(0, base + TCR);
++ __raw_writel(0, base + TCR);
+
+ /* reset timer, set mode to 64-bit watchdog, and unreset */
+ tgcr = 0;
+- davinci_writel(tgcr, base + TCR);
++ __raw_writel(tgcr, base + TCR);
+ tgcr = TGCR_TIMMODE_64BIT_WDOG << TGCR_TIMMODE_SHIFT;
+ tgcr |= (TGCR_UNRESET << TGCR_TIM12RS_SHIFT) |
+ (TGCR_UNRESET << TGCR_TIM34RS_SHIFT);
+- davinci_writel(tgcr, base + TCR);
++ __raw_writel(tgcr, base + TCR);
+
+ /* clear counter and period regs */
+- davinci_writel(0, base + TIM12);
+- davinci_writel(0, base + TIM34);
+- davinci_writel(0, base + PRD12);
+- davinci_writel(0, base + PRD34);
++ __raw_writel(0, base + TIM12);
++ __raw_writel(0, base + TIM34);
++ __raw_writel(0, base + PRD12);
++ __raw_writel(0, base + PRD34);
+
+ /* enable */
+- wdtcr = davinci_readl(base + WDTCR);
++ wdtcr = __raw_readl(base + WDTCR);
+ wdtcr |= WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT;
+- davinci_writel(wdtcr, base + WDTCR);
++ __raw_writel(wdtcr, base + WDTCR);
+
+ /* put watchdog in pre-active state */
+ wdtcr = (WDTCR_WDKEY_SEQ0 << WDTCR_WDKEY_SHIFT) |
+ (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT);
+- davinci_writel(wdtcr, base + WDTCR);
++ __raw_writel(wdtcr, base + WDTCR);
+
+ /* put watchdog in active state */
+ wdtcr = (WDTCR_WDKEY_SEQ1 << WDTCR_WDKEY_SHIFT) |
+ (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT);
+- davinci_writel(wdtcr, base + WDTCR);
++ __raw_writel(wdtcr, base + WDTCR);
+
+ /* write an invalid value to the WDKEY field to trigger
+ * a watchdog reset */
+ wdtcr = 0x00004000;
+- davinci_writel(wdtcr, base + WDTCR);
++ __raw_writel(wdtcr, base + WDTCR);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-davinci/usb.c linux-2.6.30-rc4-git/arch/arm/mach-davinci/usb.c
+--- linux-2.6.30-rc4/arch/arm/mach-davinci/usb.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-davinci/usb.c 2009-05-13 09:46:19.000000000 +0200
+@@ -14,6 +14,8 @@
+ #include <mach/hardware.h>
+ #include <mach/irqs.h>
+
++#define DAVINCI_USB_OTG_BASE 0x01C64000
++
+ #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
+ static struct musb_hdrc_eps_bits musb_eps[] = {
+ { "ep1_tx", 8, },
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/clock.c linux-2.6.30-rc4-git/arch/arm/mach-imx/clock.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/clock.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/clock.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,210 +0,0 @@
+-/*
+- * Copyright (C) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+- *
+- * 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 <linux/kernel.h>
+-#include <linux/device.h>
+-#include <linux/list.h>
+-#include <linux/math64.h>
+-#include <linux/err.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-
+-/*
+- * Very simple approach: We can't disable clocks, so we do
+- * not need refcounting
+- */
+-
+-struct clk {
+- struct list_head node;
+- const char *name;
+- unsigned long (*get_rate)(void);
+-};
+-
+-/*
+- * get the system pll clock in Hz
+- *
+- * mfi + mfn / (mfd +1)
+- * f = 2 * f_ref * --------------------
+- * pd + 1
+- */
+-static unsigned long imx_decode_pll(unsigned int pll, u32 f_ref)
+-{
+- unsigned long long ll;
+- unsigned long quot;
+-
+- u32 mfi = (pll >> 10) & 0xf;
+- u32 mfn = pll & 0x3ff;
+- u32 mfd = (pll >> 16) & 0x3ff;
+- u32 pd = (pll >> 26) & 0xf;
+-
+- mfi = mfi <= 5 ? 5 : mfi;
+-
+- ll = 2 * (unsigned long long)f_ref *
+- ((mfi << 16) + (mfn << 16) / (mfd + 1));
+- quot = (pd + 1) * (1 << 16);
+- ll += quot / 2;
+- do_div(ll, quot);
+- return (unsigned long)ll;
+-}
+-
+-static unsigned long imx_get_system_clk(void)
+-{
+- u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512);
+-
+- return imx_decode_pll(SPCTL0, f_ref);
+-}
+-
+-static unsigned long imx_get_mcu_clk(void)
+-{
+- return imx_decode_pll(MPCTL0, CLK32 * 512);
+-}
+-
+-/*
+- * get peripheral clock 1 ( UART[12], Timer[12], PWM )
+- */
+-static unsigned long imx_get_perclk1(void)
+-{
+- return imx_get_system_clk() / (((PCDR) & 0xf)+1);
+-}
+-
+-/*
+- * get peripheral clock 2 ( LCD, SD, SPI[12] )
+- */
+-static unsigned long imx_get_perclk2(void)
+-{
+- return imx_get_system_clk() / (((PCDR>>4) & 0xf)+1);
+-}
+-
+-/*
+- * get peripheral clock 3 ( SSI )
+- */
+-static unsigned long imx_get_perclk3(void)
+-{
+- return imx_get_system_clk() / (((PCDR>>16) & 0x7f)+1);
+-}
+-
+-/*
+- * get hclk ( SDRAM, CSI, Memory Stick, I2C, DMA )
+- */
+-static unsigned long imx_get_hclk(void)
+-{
+- return imx_get_system_clk() / (((CSCR>>10) & 0xf)+1);
+-}
+-
+-static struct clk clk_system_clk = {
+- .name = "system_clk",
+- .get_rate = imx_get_system_clk,
+-};
+-
+-static struct clk clk_hclk = {
+- .name = "hclk",
+- .get_rate = imx_get_hclk,
+-};
+-
+-static struct clk clk_mcu_clk = {
+- .name = "mcu_clk",
+- .get_rate = imx_get_mcu_clk,
+-};
+-
+-static struct clk clk_perclk1 = {
+- .name = "perclk1",
+- .get_rate = imx_get_perclk1,
+-};
+-
+-static struct clk clk_uart_clk = {
+- .name = "uart_clk",
+- .get_rate = imx_get_perclk1,
+-};
+-
+-static struct clk clk_perclk2 = {
+- .name = "perclk2",
+- .get_rate = imx_get_perclk2,
+-};
+-
+-static struct clk clk_perclk3 = {
+- .name = "perclk3",
+- .get_rate = imx_get_perclk3,
+-};
+-
+-static struct clk *clks[] = {
+- &clk_perclk1,
+- &clk_perclk2,
+- &clk_perclk3,
+- &clk_system_clk,
+- &clk_hclk,
+- &clk_mcu_clk,
+- &clk_uart_clk,
+-};
+-
+-static LIST_HEAD(clocks);
+-static DEFINE_MUTEX(clocks_mutex);
+-
+-struct clk *clk_get(struct device *dev, const char *id)
+-{
+- struct clk *p, *clk = ERR_PTR(-ENOENT);
+-
+- mutex_lock(&clocks_mutex);
+- list_for_each_entry(p, &clocks, node) {
+- if (!strcmp(p->name, id)) {
+- clk = p;
+- goto found;
+- }
+- }
+-
+-found:
+- mutex_unlock(&clocks_mutex);
+-
+- return clk;
+-}
+-EXPORT_SYMBOL(clk_get);
+-
+-void clk_put(struct clk *clk)
+-{
+-}
+-EXPORT_SYMBOL(clk_put);
+-
+-int clk_enable(struct clk *clk)
+-{
+- return 0;
+-}
+-EXPORT_SYMBOL(clk_enable);
+-
+-void clk_disable(struct clk *clk)
+-{
+-}
+-EXPORT_SYMBOL(clk_disable);
+-
+-unsigned long clk_get_rate(struct clk *clk)
+-{
+- return clk->get_rate();
+-}
+-EXPORT_SYMBOL(clk_get_rate);
+-
+-int imx_clocks_init(void)
+-{
+- int i;
+-
+- mutex_lock(&clocks_mutex);
+- for (i = 0; i < ARRAY_SIZE(clks); i++)
+- list_add(&clks[i]->node, &clocks);
+- mutex_unlock(&clocks_mutex);
+-
+- return 0;
+-}
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/cpufreq.c linux-2.6.30-rc4-git/arch/arm/mach-imx/cpufreq.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/cpufreq.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/cpufreq.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,315 +0,0 @@
+-/*
+- * cpu.c: clock scaling for the iMX
+- *
+- * Copyright (C) 2000 2001, The Delft University of Technology
+- * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
+- * Copyright (C) 2006 Inky Lung <ilung@cwlinux.com>
+- * Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
+- *
+- * Based on SA1100 version written by:
+- * - Johan Pouwelse (J.A.Pouwelse@its.tudelft.nl): initial version
+- * - Erik Mouw (J.A.K.Mouw@its.tudelft.nl):
+- *
+- * 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
+- *
+- */
+-
+-/*#define DEBUG*/
+-
+-#include <linux/kernel.h>
+-#include <linux/types.h>
+-#include <linux/init.h>
+-#include <linux/cpufreq.h>
+-#include <linux/clk.h>
+-#include <linux/err.h>
+-#include <asm/system.h>
+-
+-#include <mach/hardware.h>
+-
+-#include "generic.h"
+-
+-#ifndef __val2mfld
+-#define __val2mfld(mask,val) (((mask)&~((mask)<<1))*(val)&(mask))
+-#endif
+-#ifndef __mfld2val
+-#define __mfld2val(mask,val) (((val)&(mask))/((mask)&~((mask)<<1)))
+-#endif
+-
+-#define CR_920T_CLOCK_MODE 0xC0000000
+-#define CR_920T_FASTBUS_MODE 0x00000000
+-#define CR_920T_ASYNC_MODE 0xC0000000
+-
+-static u32 mpctl0_at_boot;
+-static u32 bclk_div_at_boot;
+-
+-static struct clk *system_clk, *mcu_clk;
+-
+-static void imx_set_async_mode(void)
+-{
+- adjust_cr(CR_920T_CLOCK_MODE, CR_920T_ASYNC_MODE);
+-}
+-
+-static void imx_set_fastbus_mode(void)
+-{
+- adjust_cr(CR_920T_CLOCK_MODE, CR_920T_FASTBUS_MODE);
+-}
+-
+-static void imx_set_mpctl0(u32 mpctl0)
+-{
+- unsigned long flags;
+-
+- if (mpctl0 == 0) {
+- local_irq_save(flags);
+- CSCR &= ~CSCR_MPEN;
+- local_irq_restore(flags);
+- return;
+- }
+-
+- local_irq_save(flags);
+- MPCTL0 = mpctl0;
+- CSCR |= CSCR_MPEN;
+- local_irq_restore(flags);
+-}
+-
+-/**
+- * imx_compute_mpctl - compute new PLL parameters
+- * @new_mpctl: pointer to location assigned by new PLL control register value
+- * @cur_mpctl: current PLL control register parameters
+- * @f_ref: reference source frequency Hz
+- * @freq: required frequency in Hz
+- * @relation: is one of %CPUFREQ_RELATION_L (supremum)
+- * and %CPUFREQ_RELATION_H (infimum)
+- */
+-long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, u32 f_ref, unsigned long freq, int relation)
+-{
+- u32 mfi;
+- u32 mfn;
+- u32 mfd;
+- u32 pd;
+- unsigned long long ll;
+- long l;
+- long quot;
+-
+- /* Fdppl=2*Fref*(MFI+MFN/(MFD+1))/(PD+1) */
+- /* PD=<0,15>, MFD=<1,1023>, MFI=<5,15> MFN=<0,1022> */
+-
+- if (cur_mpctl) {
+- mfd = ((cur_mpctl >> 16) & 0x3ff) + 1;
+- pd = ((cur_mpctl >> 26) & 0xf) + 1;
+- } else {
+- pd=2; mfd=313;
+- }
+-
+- /* pd=2; mfd=313; mfi=8; mfn=183; */
+- /* (MFI+MFN/(MFD)) = Fdppl / (2*Fref) * (PD); */
+-
+- quot = (f_ref + (1 << 9)) >> 10;
+- l = (freq * pd + quot) / (2 * quot);
+- mfi = l >> 10;
+- mfn = ((l & ((1 << 10) - 1)) * mfd + (1 << 9)) >> 10;
+-
+- mfd -= 1;
+- pd -= 1;
+-
+- *new_mpctl = ((mfi & 0xf) << 10) | (mfn & 0x3ff) | ((mfd & 0x3ff) << 16)
+- | ((pd & 0xf) << 26);
+-
+- ll = 2 * (unsigned long long)f_ref * ( (mfi<<16) + (mfn<<16) / (mfd+1) );
+- quot = (pd+1) * (1<<16);
+- ll += quot / 2;
+- do_div(ll, quot);
+- freq = ll;
+-
+- pr_debug(KERN_DEBUG "imx: new PLL parameters pd=%d mfd=%d mfi=%d mfn=%d, freq=%ld\n",
+- pd, mfd, mfi, mfn, freq);
+-
+- return freq;
+-}
+-
+-
+-static int imx_verify_speed(struct cpufreq_policy *policy)
+-{
+- if (policy->cpu != 0)
+- return -EINVAL;
+-
+- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
+-
+- return 0;
+-}
+-
+-static unsigned int imx_get_speed(unsigned int cpu)
+-{
+- unsigned int freq;
+- unsigned int cr;
+- unsigned int cscr;
+- unsigned int bclk_div;
+-
+- if (cpu)
+- return 0;
+-
+- cscr = CSCR;
+- bclk_div = __mfld2val(CSCR_BCLK_DIV, cscr) + 1;
+- cr = get_cr();
+-
+- if((cr & CR_920T_CLOCK_MODE) == CR_920T_FASTBUS_MODE) {
+- freq = clk_get_rate(system_clk);
+- freq = (freq + bclk_div/2) / bclk_div;
+- } else {
+- freq = clk_get_rate(mcu_clk);
+- if (cscr & CSCR_MPU_PRESC)
+- freq /= 2;
+- }
+-
+- freq = (freq + 500) / 1000;
+-
+- return freq;
+-}
+-
+-static int imx_set_target(struct cpufreq_policy *policy,
+- unsigned int target_freq,
+- unsigned int relation)
+-{
+- struct cpufreq_freqs freqs;
+- u32 mpctl0 = 0;
+- u32 cscr;
+- unsigned long flags;
+- long freq;
+- long sysclk;
+- unsigned int bclk_div = bclk_div_at_boot;
+-
+- /*
+- * Some governors do not respects CPU and policy lower limits
+- * which leads to bad things (division by zero etc), ensure
+- * that such things do not happen.
+- */
+- if(target_freq < policy->cpuinfo.min_freq)
+- target_freq = policy->cpuinfo.min_freq;
+-
+- if(target_freq < policy->min)
+- target_freq = policy->min;
+-
+- freq = target_freq * 1000;
+-
+- pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
+- freq, mpctl0_at_boot);
+-
+- sysclk = clk_get_rate(system_clk);
+-
+- if (freq > sysclk / bclk_div_at_boot + 1000000) {
+- freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, CLK32 * 512, freq, relation);
+- if (freq < 0) {
+- printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq);
+- return -EINVAL;
+- }
+- } else {
+- if(freq + 1000 < sysclk) {
+- if (relation == CPUFREQ_RELATION_L)
+- bclk_div = (sysclk - 1000) / freq;
+- else
+- bclk_div = (sysclk + freq + 1000) / freq;
+-
+- if(bclk_div > 16)
+- bclk_div = 16;
+- if(bclk_div < bclk_div_at_boot)
+- bclk_div = bclk_div_at_boot;
+- }
+- freq = (sysclk + bclk_div / 2) / bclk_div;
+- }
+-
+- freqs.old = imx_get_speed(0);
+- freqs.new = (freq + 500) / 1000;
+- freqs.cpu = 0;
+- freqs.flags = 0;
+-
+- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+-
+- local_irq_save(flags);
+-
+- imx_set_fastbus_mode();
+-
+- imx_set_mpctl0(mpctl0);
+-
+- cscr = CSCR;
+- cscr &= ~CSCR_BCLK_DIV;
+- cscr |= __val2mfld(CSCR_BCLK_DIV, bclk_div - 1);
+- CSCR = cscr;
+-
+- if(mpctl0) {
+- CSCR |= CSCR_MPLL_RESTART;
+-
+- /* Wait until MPLL is stabilized */
+- while( CSCR & CSCR_MPLL_RESTART );
+-
+- imx_set_async_mode();
+- }
+-
+- local_irq_restore(flags);
+-
+- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+-
+- pr_debug(KERN_INFO "imx: set frequency %ld Hz, running from %s\n",
+- freq, mpctl0? "MPLL": "SPLL");
+-
+- return 0;
+-}
+-
+-static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
+-{
+- printk(KERN_INFO "i.MX cpu freq change driver v1.0\n");
+-
+- if (policy->cpu != 0)
+- return -EINVAL;
+-
+- policy->cur = policy->min = policy->max = imx_get_speed(0);
+- policy->cpuinfo.min_freq = 8000;
+- policy->cpuinfo.max_freq = 200000;
+- /* Manual states, that PLL stabilizes in two CLK32 periods */
+- policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
+- return 0;
+-}
+-
+-static struct cpufreq_driver imx_driver = {
+- .flags = CPUFREQ_STICKY,
+- .verify = imx_verify_speed,
+- .target = imx_set_target,
+- .get = imx_get_speed,
+- .init = imx_cpufreq_driver_init,
+- .name = "imx",
+-};
+-
+-static int __init imx_cpufreq_init(void)
+-{
+- bclk_div_at_boot = __mfld2val(CSCR_BCLK_DIV, CSCR) + 1;
+- mpctl0_at_boot = 0;
+-
+- system_clk = clk_get(NULL, "system_clk");
+- if (IS_ERR(system_clk))
+- return PTR_ERR(system_clk);
+-
+- mcu_clk = clk_get(NULL, "mcu_clk");
+- if (IS_ERR(mcu_clk)) {
+- clk_put(system_clk);
+- return PTR_ERR(mcu_clk);
+- }
+-
+- if((CSCR & CSCR_MPEN) &&
+- ((get_cr() & CR_920T_CLOCK_MODE) != CR_920T_FASTBUS_MODE))
+- mpctl0_at_boot = MPCTL0;
+-
+- return cpufreq_register_driver(&imx_driver);
+-}
+-
+-arch_initcall(imx_cpufreq_init);
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/dma.c linux-2.6.30-rc4-git/arch/arm/mach-imx/dma.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/dma.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/dma.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,597 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/dma.c
+- *
+- * imx DMA registration and IRQ dispatching
+- *
+- * 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.
+- *
+- * 2004-03-03 Sascha Hauer <sascha@saschahauer.de>
+- * initial version heavily inspired by
+- * linux/arch/arm/mach-pxa/dma.c
+- *
+- * 2005-04-17 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+- * Changed to support scatter gather DMA
+- * by taking Russell's code from RiscPC
+- *
+- * 2006-05-31 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+- * Corrected error handling code.
+- *
+- */
+-
+-#undef DEBUG
+-
+-#include <linux/module.h>
+-#include <linux/init.h>
+-#include <linux/kernel.h>
+-#include <linux/interrupt.h>
+-#include <linux/errno.h>
+-
+-#include <asm/scatterlist.h>
+-#include <asm/system.h>
+-#include <asm/irq.h>
+-#include <mach/hardware.h>
+-#include <mach/dma.h>
+-#include <mach/imx-dma.h>
+-
+-struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
+-
+-/*
+- * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation
+- * @dma_ch: i.MX DMA channel number
+- * @lastcount: number of bytes transferred during last transfer
+- *
+- * Functions prepares DMA controller for next sg data chunk transfer.
+- * The @lastcount argument informs function about number of bytes transferred
+- * during last block. Zero value can be used for @lastcount to setup DMA
+- * for the first chunk.
+- */
+-static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+- unsigned int nextcount;
+- unsigned int nextaddr;
+-
+- if (!imxdma->name) {
+- printk(KERN_CRIT "%s: called for not allocated channel %d\n",
+- __func__, dma_ch);
+- return 0;
+- }
+-
+- imxdma->resbytes -= lastcount;
+-
+- if (!imxdma->sg) {
+- pr_debug("imxdma%d: no sg data\n", dma_ch);
+- return 0;
+- }
+-
+- imxdma->sgbc += lastcount;
+- if ((imxdma->sgbc >= imxdma->sg->length) || !imxdma->resbytes) {
+- if ((imxdma->sgcount <= 1) || !imxdma->resbytes) {
+- pr_debug("imxdma%d: sg transfer limit reached\n",
+- dma_ch);
+- imxdma->sgcount=0;
+- imxdma->sg = NULL;
+- return 0;
+- } else {
+- imxdma->sgcount--;
+- imxdma->sg++;
+- imxdma->sgbc = 0;
+- }
+- }
+- nextcount = imxdma->sg->length - imxdma->sgbc;
+- nextaddr = imxdma->sg->dma_address + imxdma->sgbc;
+-
+- if(imxdma->resbytes < nextcount)
+- nextcount = imxdma->resbytes;
+-
+- if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
+- DAR(dma_ch) = nextaddr;
+- else
+- SAR(dma_ch) = nextaddr;
+-
+- CNTR(dma_ch) = nextcount;
+- pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, size 0x%08x\n",
+- dma_ch, DAR(dma_ch), SAR(dma_ch), CNTR(dma_ch));
+-
+- return nextcount;
+-}
+-
+-/*
+- * imx_dma_setup_sg_base - scatter-gather DMA emulation
+- * @dma_ch: i.MX DMA channel number
+- * @sg: pointer to the scatter-gather list/vector
+- * @sgcount: scatter-gather list hungs count
+- *
+- * Functions sets up i.MX DMA state for emulated scatter-gather transfer
+- * and sets up channel registers to be ready for the first chunk
+- */
+-static int
+-imx_dma_setup_sg_base(imx_dmach_t dma_ch,
+- struct scatterlist *sg, unsigned int sgcount)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+-
+- imxdma->sg = sg;
+- imxdma->sgcount = sgcount;
+- imxdma->sgbc = 0;
+- return imx_dma_sg_next(dma_ch, 0);
+-}
+-
+-/**
+- * imx_dma_setup_single - setup i.MX DMA channel for linear memory to/from device transfer
+- * @dma_ch: i.MX DMA channel number
+- * @dma_address: the DMA/physical memory address of the linear data block
+- * to transfer
+- * @dma_length: length of the data block in bytes
+- * @dev_addr: physical device port address
+- * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
+- * or %DMA_MODE_WRITE from memory to the device
+- *
+- * The function setups DMA channel source and destination addresses for transfer
+- * specified by provided parameters. The scatter-gather emulation is disabled,
+- * because linear data block
+- * form the physical address range is transferred.
+- * Return value: if incorrect parameters are provided -%EINVAL.
+- * Zero indicates success.
+- */
+-int
+-imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
+- unsigned int dma_length, unsigned int dev_addr,
+- unsigned int dmamode)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+-
+- imxdma->sg = NULL;
+- imxdma->sgcount = 0;
+- imxdma->dma_mode = dmamode;
+- imxdma->resbytes = dma_length;
+-
+- if (!dma_address) {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_single null address\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- if (!dma_length) {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_single zero length\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
+- pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for read\n",
+- dma_ch, (unsigned int)dma_address, dma_length,
+- dev_addr);
+- SAR(dma_ch) = dev_addr;
+- DAR(dma_ch) = (unsigned int)dma_address;
+- } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
+- pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for write\n",
+- dma_ch, (unsigned int)dma_address, dma_length,
+- dev_addr);
+- SAR(dma_ch) = (unsigned int)dma_address;
+- DAR(dma_ch) = dev_addr;
+- } else {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- CNTR(dma_ch) = dma_length;
+-
+- return 0;
+-}
+-
+-/**
+- * imx_dma_setup_sg - setup i.MX DMA channel SG list to/from device transfer
+- * @dma_ch: i.MX DMA channel number
+- * @sg: pointer to the scatter-gather list/vector
+- * @sgcount: scatter-gather list hungs count
+- * @dma_length: total length of the transfer request in bytes
+- * @dev_addr: physical device port address
+- * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
+- * or %DMA_MODE_WRITE from memory to the device
+- *
+- * The function sets up DMA channel state and registers to be ready for transfer
+- * specified by provided parameters. The scatter-gather emulation is set up
+- * according to the parameters.
+- *
+- * The full preparation of the transfer requires setup of more register
+- * by the caller before imx_dma_enable() can be called.
+- *
+- * %BLR(dma_ch) holds transfer burst length in bytes, 0 means 64 bytes
+- *
+- * %RSSR(dma_ch) has to be set to the DMA request line source %DMA_REQ_xxx
+- *
+- * %CCR(dma_ch) has to specify transfer parameters, the next settings is typical
+- * for linear or simple scatter-gather transfers if %DMA_MODE_READ is specified
+- *
+- * %CCR_DMOD_LINEAR | %CCR_DSIZ_32 | %CCR_SMOD_FIFO | %CCR_SSIZ_x
+- *
+- * The typical setup for %DMA_MODE_WRITE is specified by next options combination
+- *
+- * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x
+- *
+- * Be careful here and do not mistakenly mix source and target device
+- * port sizes constants, they are really different:
+- * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32,
+- * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32
+- *
+- * Return value: if incorrect parameters are provided -%EINVAL.
+- * Zero indicates success.
+- */
+-int
+-imx_dma_setup_sg(imx_dmach_t dma_ch,
+- struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
+- unsigned int dev_addr, unsigned int dmamode)
+-{
+- int res;
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+-
+- imxdma->sg = NULL;
+- imxdma->sgcount = 0;
+- imxdma->dma_mode = dmamode;
+- imxdma->resbytes = dma_length;
+-
+- if (!sg || !sgcount) {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_sg epty sg list\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- if (!sg->length) {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_sg zero length\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
+- pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for read\n",
+- dma_ch, sg, sgcount, dma_length, dev_addr);
+- SAR(dma_ch) = dev_addr;
+- } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
+- pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for write\n",
+- dma_ch, sg, sgcount, dma_length, dev_addr);
+- DAR(dma_ch) = dev_addr;
+- } else {
+- printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n",
+- dma_ch);
+- return -EINVAL;
+- }
+-
+- res = imx_dma_setup_sg_base(dma_ch, sg, sgcount);
+- if (res <= 0) {
+- printk(KERN_ERR "imxdma%d: no sg chunk ready\n", dma_ch);
+- return -EINVAL;
+- }
+-
+- return 0;
+-}
+-
+-/**
+- * imx_dma_setup_handlers - setup i.MX DMA channel end and error notification handlers
+- * @dma_ch: i.MX DMA channel number
+- * @irq_handler: the pointer to the function called if the transfer
+- * ends successfully
+- * @err_handler: the pointer to the function called if the premature
+- * end caused by error occurs
+- * @data: user specified value to be passed to the handlers
+- */
+-int
+-imx_dma_setup_handlers(imx_dmach_t dma_ch,
+- void (*irq_handler) (int, void *),
+- void (*err_handler) (int, void *, int),
+- void *data)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+- unsigned long flags;
+-
+- if (!imxdma->name) {
+- printk(KERN_CRIT "%s: called for not allocated channel %d\n",
+- __func__, dma_ch);
+- return -ENODEV;
+- }
+-
+- local_irq_save(flags);
+- DISR = (1 << dma_ch);
+- imxdma->irq_handler = irq_handler;
+- imxdma->err_handler = err_handler;
+- imxdma->data = data;
+- local_irq_restore(flags);
+- return 0;
+-}
+-
+-/**
+- * imx_dma_enable - function to start i.MX DMA channel operation
+- * @dma_ch: i.MX DMA channel number
+- *
+- * The channel has to be allocated by driver through imx_dma_request()
+- * or imx_dma_request_by_prio() function.
+- * The transfer parameters has to be set to the channel registers through
+- * call of the imx_dma_setup_single() or imx_dma_setup_sg() function
+- * and registers %BLR(dma_ch), %RSSR(dma_ch) and %CCR(dma_ch) has to
+- * be set prior this function call by the channel user.
+- */
+-void imx_dma_enable(imx_dmach_t dma_ch)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+- unsigned long flags;
+-
+- pr_debug("imxdma%d: imx_dma_enable\n", dma_ch);
+-
+- if (!imxdma->name) {
+- printk(KERN_CRIT "%s: called for not allocated channel %d\n",
+- __func__, dma_ch);
+- return;
+- }
+-
+- local_irq_save(flags);
+- DISR = (1 << dma_ch);
+- DIMR &= ~(1 << dma_ch);
+- CCR(dma_ch) |= CCR_CEN;
+- local_irq_restore(flags);
+-}
+-
+-/**
+- * imx_dma_disable - stop, finish i.MX DMA channel operatin
+- * @dma_ch: i.MX DMA channel number
+- */
+-void imx_dma_disable(imx_dmach_t dma_ch)
+-{
+- unsigned long flags;
+-
+- pr_debug("imxdma%d: imx_dma_disable\n", dma_ch);
+-
+- local_irq_save(flags);
+- DIMR |= (1 << dma_ch);
+- CCR(dma_ch) &= ~CCR_CEN;
+- DISR = (1 << dma_ch);
+- local_irq_restore(flags);
+-}
+-
+-/**
+- * imx_dma_request - request/allocate specified channel number
+- * @dma_ch: i.MX DMA channel number
+- * @name: the driver/caller own non-%NULL identification
+- */
+-int imx_dma_request(imx_dmach_t dma_ch, const char *name)
+-{
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+- unsigned long flags;
+-
+- /* basic sanity checks */
+- if (!name)
+- return -EINVAL;
+-
+- if (dma_ch >= IMX_DMA_CHANNELS) {
+- printk(KERN_CRIT "%s: called for non-existed channel %d\n",
+- __func__, dma_ch);
+- return -EINVAL;
+- }
+-
+- local_irq_save(flags);
+- if (imxdma->name) {
+- local_irq_restore(flags);
+- return -ENODEV;
+- }
+-
+- imxdma->name = name;
+- imxdma->irq_handler = NULL;
+- imxdma->err_handler = NULL;
+- imxdma->data = NULL;
+- imxdma->sg = NULL;
+- local_irq_restore(flags);
+- return 0;
+-}
+-
+-/**
+- * imx_dma_free - release previously acquired channel
+- * @dma_ch: i.MX DMA channel number
+- */
+-void imx_dma_free(imx_dmach_t dma_ch)
+-{
+- unsigned long flags;
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+-
+- if (!imxdma->name) {
+- printk(KERN_CRIT
+- "%s: trying to free channel %d which is already freed\n",
+- __func__, dma_ch);
+- return;
+- }
+-
+- local_irq_save(flags);
+- /* Disable interrupts */
+- DIMR |= (1 << dma_ch);
+- CCR(dma_ch) &= ~CCR_CEN;
+- imxdma->name = NULL;
+- local_irq_restore(flags);
+-}
+-
+-/**
+- * imx_dma_request_by_prio - find and request some of free channels best suiting requested priority
+- * @name: the driver/caller own non-%NULL identification
+- * @prio: one of the hardware distinguished priority level:
+- * %DMA_PRIO_HIGH, %DMA_PRIO_MEDIUM, %DMA_PRIO_LOW
+- *
+- * This function tries to find free channel in the specified priority group
+- * if the priority cannot be achieved it tries to look for free channel
+- * in the higher and then even lower priority groups.
+- *
+- * Return value: If there is no free channel to allocate, -%ENODEV is returned.
+- * On successful allocation channel is returned.
+- */
+-imx_dmach_t imx_dma_request_by_prio(const char *name, imx_dma_prio prio)
+-{
+- int i;
+- int best;
+-
+- switch (prio) {
+- case (DMA_PRIO_HIGH):
+- best = 8;
+- break;
+- case (DMA_PRIO_MEDIUM):
+- best = 4;
+- break;
+- case (DMA_PRIO_LOW):
+- default:
+- best = 0;
+- break;
+- }
+-
+- for (i = best; i < IMX_DMA_CHANNELS; i++) {
+- if (!imx_dma_request(i, name)) {
+- return i;
+- }
+- }
+-
+- for (i = best - 1; i >= 0; i--) {
+- if (!imx_dma_request(i, name)) {
+- return i;
+- }
+- }
+-
+- printk(KERN_ERR "%s: no free DMA channel found\n", __func__);
+-
+- return -ENODEV;
+-}
+-
+-static irqreturn_t dma_err_handler(int irq, void *dev_id)
+-{
+- int i, disr = DISR;
+- struct imx_dma_channel *channel;
+- unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR;
+- int errcode;
+-
+- DISR = disr & err_mask;
+- for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+- if(!(err_mask & (1 << i)))
+- continue;
+- channel = &imx_dma_channels[i];
+- errcode = 0;
+-
+- if (DBTOSR & (1 << i)) {
+- DBTOSR = (1 << i);
+- errcode |= IMX_DMA_ERR_BURST;
+- }
+- if (DRTOSR & (1 << i)) {
+- DRTOSR = (1 << i);
+- errcode |= IMX_DMA_ERR_REQUEST;
+- }
+- if (DSESR & (1 << i)) {
+- DSESR = (1 << i);
+- errcode |= IMX_DMA_ERR_TRANSFER;
+- }
+- if (DBOSR & (1 << i)) {
+- DBOSR = (1 << i);
+- errcode |= IMX_DMA_ERR_BUFFER;
+- }
+-
+- /*
+- * The cleaning of @sg field would be questionable
+- * there, because its value can help to compute
+- * remaining/transferred bytes count in the handler
+- */
+- /*imx_dma_channels[i].sg = NULL;*/
+-
+- if (channel->name && channel->err_handler) {
+- channel->err_handler(i, channel->data, errcode);
+- continue;
+- }
+-
+- imx_dma_channels[i].sg = NULL;
+-
+- printk(KERN_WARNING
+- "DMA timeout on channel %d (%s) -%s%s%s%s\n",
+- i, channel->name,
+- errcode&IMX_DMA_ERR_BURST? " burst":"",
+- errcode&IMX_DMA_ERR_REQUEST? " request":"",
+- errcode&IMX_DMA_ERR_TRANSFER? " transfer":"",
+- errcode&IMX_DMA_ERR_BUFFER? " buffer":"");
+- }
+- return IRQ_HANDLED;
+-}
+-
+-static irqreturn_t dma_irq_handler(int irq, void *dev_id)
+-{
+- int i, disr = DISR;
+-
+- pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n",
+- disr);
+-
+- DISR = disr;
+- for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+- if (disr & (1 << i)) {
+- struct imx_dma_channel *channel = &imx_dma_channels[i];
+- if (channel->name) {
+- if (imx_dma_sg_next(i, CNTR(i))) {
+- CCR(i) &= ~CCR_CEN;
+- mb();
+- CCR(i) |= CCR_CEN;
+- } else {
+- if (channel->irq_handler)
+- channel->irq_handler(i,
+- channel->data);
+- }
+- } else {
+- /*
+- * IRQ for an unregistered DMA channel:
+- * let's clear the interrupts and disable it.
+- */
+- printk(KERN_WARNING
+- "spurious IRQ for DMA channel %d\n", i);
+- }
+- }
+- }
+- return IRQ_HANDLED;
+-}
+-
+-static int __init imx_dma_init(void)
+-{
+- int ret;
+- int i;
+-
+- /* reset DMA module */
+- DCR = DCR_DRST;
+-
+- ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL);
+- if (ret) {
+- printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n");
+- return ret;
+- }
+-
+- ret = request_irq(DMA_ERR, dma_err_handler, 0, "DMA", NULL);
+- if (ret) {
+- printk(KERN_CRIT "Wow! Can't register ERRIRQ for DMA\n");
+- free_irq(DMA_INT, NULL);
+- }
+-
+- /* enable DMA module */
+- DCR = DCR_DEN;
+-
+- /* clear all interrupts */
+- DISR = (1 << IMX_DMA_CHANNELS) - 1;
+-
+- /* enable interrupts */
+- DIMR = (1 << IMX_DMA_CHANNELS) - 1;
+-
+- for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+- imx_dma_channels[i].sg = NULL;
+- imx_dma_channels[i].dma_num = i;
+- }
+-
+- return ret;
+-}
+-
+-arch_initcall(imx_dma_init);
+-
+-EXPORT_SYMBOL(imx_dma_setup_single);
+-EXPORT_SYMBOL(imx_dma_setup_sg);
+-EXPORT_SYMBOL(imx_dma_setup_handlers);
+-EXPORT_SYMBOL(imx_dma_enable);
+-EXPORT_SYMBOL(imx_dma_disable);
+-EXPORT_SYMBOL(imx_dma_request);
+-EXPORT_SYMBOL(imx_dma_free);
+-EXPORT_SYMBOL(imx_dma_request_by_prio);
+-EXPORT_SYMBOL(imx_dma_channels);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/generic.c linux-2.6.30-rc4-git/arch/arm/mach-imx/generic.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/generic.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/generic.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,271 +0,0 @@
+-/*
+- * arch/arm/mach-imx/generic.c
+- *
+- * author: Sascha Hauer
+- * Created: april 20th, 2004
+- * Copyright: Synertronixx GmbH
+- *
+- * Common code for i.MX machines
+- *
+- * 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 <linux/platform_device.h>
+-#include <linux/init.h>
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-#include <linux/string.h>
+-
+-#include <asm/errno.h>
+-#include <mach/hardware.h>
+-#include <mach/imx-regs.h>
+-
+-#include <asm/mach/map.h>
+-#include <mach/mmc.h>
+-#include <mach/gpio.h>
+-
+-unsigned long imx_gpio_alloc_map[(GPIO_PORT_MAX + 1) * 32 / BITS_PER_LONG];
+-
+-void imx_gpio_mode(int gpio_mode)
+-{
+- unsigned int pin = gpio_mode & GPIO_PIN_MASK;
+- unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
+- unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT;
+- unsigned int tmp;
+-
+- /* Pullup enable */
+- if(gpio_mode & GPIO_PUEN)
+- PUEN(port) |= (1<<pin);
+- else
+- PUEN(port) &= ~(1<<pin);
+-
+- /* Data direction */
+- if(gpio_mode & GPIO_OUT)
+- DDIR(port) |= 1<<pin;
+- else
+- DDIR(port) &= ~(1<<pin);
+-
+- /* Primary / alternate function */
+- if(gpio_mode & GPIO_AF)
+- GPR(port) |= (1<<pin);
+- else
+- GPR(port) &= ~(1<<pin);
+-
+- /* use as gpio? */
+- if(gpio_mode & GPIO_GIUS)
+- GIUS(port) |= (1<<pin);
+- else
+- GIUS(port) &= ~(1<<pin);
+-
+- /* Output / input configuration */
+- /* FIXME: I'm not very sure about OCR and ICONF, someone
+- * should have a look over it
+- */
+- if(pin<16) {
+- tmp = OCR1(port);
+- tmp &= ~( 3<<(pin*2));
+- tmp |= (ocr << (pin*2));
+- OCR1(port) = tmp;
+-
+- ICONFA1(port) &= ~( 3<<(pin*2));
+- ICONFA1(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2);
+- ICONFB1(port) &= ~( 3<<(pin*2));
+- ICONFB1(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << (pin * 2);
+- } else {
+- tmp = OCR2(port);
+- tmp &= ~( 3<<((pin-16)*2));
+- tmp |= (ocr << ((pin-16)*2));
+- OCR2(port) = tmp;
+-
+- ICONFA2(port) &= ~( 3<<((pin-16)*2));
+- ICONFA2(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << ((pin-16) * 2);
+- ICONFB2(port) &= ~( 3<<((pin-16)*2));
+- ICONFB2(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << ((pin-16) * 2);
+- }
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_mode);
+-
+-int imx_gpio_request(unsigned gpio, const char *label)
+-{
+- if(gpio >= (GPIO_PORT_MAX + 1) * 32) {
+- printk(KERN_ERR "imx_gpio: Attempt to request nonexistent GPIO %d for \"%s\"\n",
+- gpio, label ? label : "?");
+- return -EINVAL;
+- }
+-
+- if(test_and_set_bit(gpio, imx_gpio_alloc_map)) {
+- printk(KERN_ERR "imx_gpio: GPIO %d already used. Allocation for \"%s\" failed\n",
+- gpio, label ? label : "?");
+- return -EBUSY;
+- }
+-
+- return 0;
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_request);
+-
+-void imx_gpio_free(unsigned gpio)
+-{
+- if(gpio >= (GPIO_PORT_MAX + 1) * 32)
+- return;
+-
+- clear_bit(gpio, imx_gpio_alloc_map);
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_free);
+-
+-int imx_gpio_direction_input(unsigned gpio)
+-{
+- imx_gpio_mode(gpio | GPIO_IN | GPIO_GIUS | GPIO_DR);
+- return 0;
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_direction_input);
+-
+-int imx_gpio_direction_output(unsigned gpio, int value)
+-{
+- imx_gpio_set_value(gpio, value);
+- imx_gpio_mode(gpio | GPIO_OUT | GPIO_GIUS | GPIO_DR);
+- return 0;
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_direction_output);
+-
+-int imx_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
+- int alloc_mode, const char *label)
+-{
+- const int *p = pin_list;
+- int i;
+- unsigned gpio;
+- unsigned mode;
+-
+- for (i = 0; i < count; i++) {
+- gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
+- mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK);
+-
+- if (gpio >= (GPIO_PORT_MAX + 1) * 32)
+- goto setup_error;
+-
+- if (alloc_mode & IMX_GPIO_ALLOC_MODE_RELEASE)
+- imx_gpio_free(gpio);
+- else if (!(alloc_mode & IMX_GPIO_ALLOC_MODE_NO_ALLOC))
+- if (imx_gpio_request(gpio, label))
+- if (!(alloc_mode & IMX_GPIO_ALLOC_MODE_TRY_ALLOC))
+- goto setup_error;
+-
+- if (!(alloc_mode & (IMX_GPIO_ALLOC_MODE_ALLOC_ONLY |
+- IMX_GPIO_ALLOC_MODE_RELEASE)))
+- imx_gpio_mode(gpio | mode);
+-
+- p++;
+- }
+- return 0;
+-
+-setup_error:
+- if(alloc_mode & (IMX_GPIO_ALLOC_MODE_NO_ALLOC |
+- IMX_GPIO_ALLOC_MODE_TRY_ALLOC))
+- return -EINVAL;
+-
+- while (p != pin_list) {
+- p--;
+- gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
+- imx_gpio_free(gpio);
+- }
+-
+- return -EINVAL;
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_setup_multiple_pins);
+-
+-void __imx_gpio_set_value(unsigned gpio, int value)
+-{
+- imx_gpio_set_value_inline(gpio, value);
+-}
+-
+-EXPORT_SYMBOL(__imx_gpio_set_value);
+-
+-int imx_gpio_to_irq(unsigned gpio)
+-{
+- return IRQ_GPIOA(0) + gpio;
+-}
+-
+-EXPORT_SYMBOL(imx_gpio_to_irq);
+-
+-int imx_irq_to_gpio(unsigned irq)
+-{
+- if (irq < IRQ_GPIOA(0))
+- return -EINVAL;
+- return irq - IRQ_GPIOA(0);
+-}
+-
+-EXPORT_SYMBOL(imx_irq_to_gpio);
+-
+-static struct resource imx_mmc_resources[] = {
+- [0] = {
+- .start = 0x00214000,
+- .end = 0x002140FF,
+- .flags = IORESOURCE_MEM,
+- },
+- [1] = {
+- .start = (SDHC_INT),
+- .end = (SDHC_INT),
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static u64 imxmmmc_dmamask = 0xffffffffUL;
+-
+-static struct platform_device imx_mmc_device = {
+- .name = "imx-mmc",
+- .id = 0,
+- .dev = {
+- .dma_mask = &imxmmmc_dmamask,
+- .coherent_dma_mask = 0xffffffff,
+- },
+- .num_resources = ARRAY_SIZE(imx_mmc_resources),
+- .resource = imx_mmc_resources,
+-};
+-
+-void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
+-{
+- imx_mmc_device.dev.platform_data = info;
+-}
+-
+-static struct platform_device *devices[] __initdata = {
+- &imx_mmc_device,
+-};
+-
+-static struct map_desc imx_io_desc[] __initdata = {
+- {
+- .virtual = IMX_IO_BASE,
+- .pfn = __phys_to_pfn(IMX_IO_PHYS),
+- .length = IMX_IO_SIZE,
+- .type = MT_DEVICE
+- }
+-};
+-
+-void __init
+-imx_map_io(void)
+-{
+- iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
+-}
+-
+-static int __init imx_init(void)
+-{
+- return platform_add_devices(devices, ARRAY_SIZE(devices));
+-}
+-
+-subsys_initcall(imx_init);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/generic.h linux-2.6.30-rc4-git/arch/arm/mach-imx/generic.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/generic.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/generic.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,16 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/generic.h
+- *
+- * Author: Sascha Hauer <sascha@saschahauer.de>
+- * Copyright: Synertronixx GmbH
+- *
+- * 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.
+- */
+-
+-extern void __init imx_map_io(void);
+-extern void __init imx_init_irq(void);
+-
+-struct sys_timer;
+-extern struct sys_timer imx_timer;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/debug-macro.S linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/debug-macro.S
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/debug-macro.S 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100
+@@ -1,34 +0,0 @@
+-/* arch/arm/mach-imx/include/mach/debug-macro.S
+- *
+- * Debugging macro include header
+- *
+- * Copyright (C) 1994-1999 Russell King
+- * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+- *
+- * 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.
+- *
+-*/
+-
+- .macro addruart,rx
+- mrc p15, 0, \rx, c1, c0
+- tst \rx, #1 @ MMU enabled?
+- moveq \rx, #0x00000000 @ physical
+- movne \rx, #0xe0000000 @ virtual
+- orreq \rx, \rx, #0x00200000 @ physical
+- orr \rx, \rx, #0x00006000 @ UART1 offset
+- .endm
+-
+- .macro senduart,rd,rx
+- str \rd, [\rx, #0x40] @ TXDATA
+- .endm
+-
+- .macro waituart,rd,rx
+- .endm
+-
+- .macro busyuart,rd,rx
+-1002: ldr \rd, [\rx, #0x98] @ SR2
+- tst \rd, #1 << 3 @ TXDC
+- beq 1002b @ wait until transmit done
+- .endm
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/dma.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/dma.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/dma.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,56 +0,0 @@
+-/*
+- * linux/include/asm-arm/imxads/dma.h
+- *
+- * Copyright (C) 1997,1998 Russell King
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#ifndef __ASM_ARCH_DMA_H
+-#define __ASM_ARCH_DMA_H
+-
+-typedef enum {
+- DMA_PRIO_HIGH = 0,
+- DMA_PRIO_MEDIUM = 1,
+- DMA_PRIO_LOW = 2
+-} imx_dma_prio;
+-
+-#define DMA_REQ_UART3_T 2
+-#define DMA_REQ_UART3_R 3
+-#define DMA_REQ_SSI2_T 4
+-#define DMA_REQ_SSI2_R 5
+-#define DMA_REQ_CSI_STAT 6
+-#define DMA_REQ_CSI_R 7
+-#define DMA_REQ_MSHC 8
+-#define DMA_REQ_DSPA_DCT_DOUT 9
+-#define DMA_REQ_DSPA_DCT_DIN 10
+-#define DMA_REQ_DSPA_MAC 11
+-#define DMA_REQ_EXT 12
+-#define DMA_REQ_SDHC 13
+-#define DMA_REQ_SPI1_R 14
+-#define DMA_REQ_SPI1_T 15
+-#define DMA_REQ_SSI_T 16
+-#define DMA_REQ_SSI_R 17
+-#define DMA_REQ_ASP_DAC 18
+-#define DMA_REQ_ASP_ADC 19
+-#define DMA_REQ_USP_EP(x) (20+(x))
+-#define DMA_REQ_SPI2_R 26
+-#define DMA_REQ_SPI2_T 27
+-#define DMA_REQ_UART2_T 28
+-#define DMA_REQ_UART2_R 29
+-#define DMA_REQ_UART1_T 30
+-#define DMA_REQ_UART1_R 31
+-
+-#endif /* _ASM_ARCH_DMA_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/entry-macro.S linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/entry-macro.S
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/entry-macro.S 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100
+@@ -1,32 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/entry-macro.S
+- *
+- * Low-level IRQ helper macros for iMX-based platforms
+- *
+- * This file is licensed under the terms of the GNU General Public
+- * License version 2. This program is licensed "as is" without any
+- * warranty of any kind, whether express or implied.
+- */
+-#include <mach/hardware.h>
+-
+- .macro disable_fiq
+- .endm
+-
+- .macro get_irqnr_preamble, base, tmp
+- .endm
+-
+- .macro arch_ret_to_user, tmp1, tmp2
+- .endm
+-
+-#define AITC_NIVECSR 0x40
+- .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+- ldr \base, =IO_ADDRESS(IMX_AITC_BASE)
+- @ Load offset & priority of the highest priority
+- @ interrupt pending.
+- ldr \irqstat, [\base, #AITC_NIVECSR]
+- @ Shift off the priority leaving the offset or
+- @ "interrupt number", use arithmetic shift to
+- @ transform illegal source (0xffff) as -1
+- mov \irqnr, \irqstat, asr #16
+- adds \tmp, \irqnr, #1
+- .endm
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/gpio.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/gpio.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/gpio.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,106 +0,0 @@
+-#ifndef _IMX_GPIO_H
+-
+-#include <linux/kernel.h>
+-#include <mach/hardware.h>
+-#include <mach/imx-regs.h>
+-
+-#define IMX_GPIO_ALLOC_MODE_NORMAL 0
+-#define IMX_GPIO_ALLOC_MODE_NO_ALLOC 1
+-#define IMX_GPIO_ALLOC_MODE_TRY_ALLOC 2
+-#define IMX_GPIO_ALLOC_MODE_ALLOC_ONLY 4
+-#define IMX_GPIO_ALLOC_MODE_RELEASE 8
+-
+-extern int imx_gpio_request(unsigned gpio, const char *label);
+-
+-extern void imx_gpio_free(unsigned gpio);
+-
+-extern int imx_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
+- int alloc_mode, const char *label);
+-
+-extern int imx_gpio_direction_input(unsigned gpio);
+-
+-extern int imx_gpio_direction_output(unsigned gpio, int value);
+-
+-extern void __imx_gpio_set_value(unsigned gpio, int value);
+-
+-static inline int imx_gpio_get_value(unsigned gpio)
+-{
+- return SSR(gpio >> GPIO_PORT_SHIFT) & (1 << (gpio & GPIO_PIN_MASK));
+-}
+-
+-static inline void imx_gpio_set_value_inline(unsigned gpio, int value)
+-{
+- unsigned long flags;
+-
+- raw_local_irq_save(flags);
+- if(value)
+- DR(gpio >> GPIO_PORT_SHIFT) |= (1 << (gpio & GPIO_PIN_MASK));
+- else
+- DR(gpio >> GPIO_PORT_SHIFT) &= ~(1 << (gpio & GPIO_PIN_MASK));
+- raw_local_irq_restore(flags);
+-}
+-
+-static inline void imx_gpio_set_value(unsigned gpio, int value)
+-{
+- if(__builtin_constant_p(gpio))
+- imx_gpio_set_value_inline(gpio, value);
+- else
+- __imx_gpio_set_value(gpio, value);
+-}
+-
+-extern int imx_gpio_to_irq(unsigned gpio);
+-
+-extern int imx_irq_to_gpio(unsigned irq);
+-
+-/*-------------------------------------------------------------------------*/
+-
+-/* Wrappers for "new style" GPIO calls. These calls i.MX specific versions
+- * to allow future extension of GPIO logic.
+- */
+-
+-static inline int gpio_request(unsigned gpio, const char *label)
+-{
+- return imx_gpio_request(gpio, label);
+-}
+-
+-static inline void gpio_free(unsigned gpio)
+-{
+- might_sleep();
+-
+- imx_gpio_free(gpio);
+-}
+-
+-static inline int gpio_direction_input(unsigned gpio)
+-{
+- return imx_gpio_direction_input(gpio);
+-}
+-
+-static inline int gpio_direction_output(unsigned gpio, int value)
+-{
+- return imx_gpio_direction_output(gpio, value);
+-}
+-
+-static inline int gpio_get_value(unsigned gpio)
+-{
+- return imx_gpio_get_value(gpio);
+-}
+-
+-static inline void gpio_set_value(unsigned gpio, int value)
+-{
+- imx_gpio_set_value(gpio, value);
+-}
+-
+-#include <asm-generic/gpio.h> /* cansleep wrappers */
+-
+-static inline int gpio_to_irq(unsigned gpio)
+-{
+- return imx_gpio_to_irq(gpio);
+-}
+-
+-static inline int irq_to_gpio(unsigned irq)
+-{
+- return imx_irq_to_gpio(irq);
+-}
+-
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/hardware.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/hardware.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/hardware.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,91 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/hardware.h
+- *
+- * Copyright (C) 1999 ARM Limited.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#ifndef __ASM_ARCH_HARDWARE_H
+-#define __ASM_ARCH_HARDWARE_H
+-
+-#include <asm/sizes.h>
+-#include "imx-regs.h"
+-
+-#ifndef __ASSEMBLY__
+-# define __REG(x) (*((volatile u32 *)IO_ADDRESS(x)))
+-
+-# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
+-#endif
+-
+-/*
+- * Memory map
+- */
+-
+-#define IMX_IO_PHYS 0x00200000
+-#define IMX_IO_SIZE 0x00100000
+-#define IMX_IO_BASE 0xe0000000
+-
+-#define IMX_CS0_PHYS 0x10000000
+-#define IMX_CS0_SIZE 0x02000000
+-#define IMX_CS0_VIRT 0xe8000000
+-
+-#define IMX_CS1_PHYS 0x12000000
+-#define IMX_CS1_SIZE 0x01000000
+-#define IMX_CS1_VIRT 0xea000000
+-
+-#define IMX_CS2_PHYS 0x13000000
+-#define IMX_CS2_SIZE 0x01000000
+-#define IMX_CS2_VIRT 0xeb000000
+-
+-#define IMX_CS3_PHYS 0x14000000
+-#define IMX_CS3_SIZE 0x01000000
+-#define IMX_CS3_VIRT 0xec000000
+-
+-#define IMX_CS4_PHYS 0x15000000
+-#define IMX_CS4_SIZE 0x01000000
+-#define IMX_CS4_VIRT 0xed000000
+-
+-#define IMX_CS5_PHYS 0x16000000
+-#define IMX_CS5_SIZE 0x01000000
+-#define IMX_CS5_VIRT 0xee000000
+-
+-#define IMX_FB_VIRT 0xF1000000
+-#define IMX_FB_SIZE (256*1024)
+-
+-/* macro to get at IO space when running virtually */
+-#define IO_ADDRESS(x) ((x) | IMX_IO_BASE)
+-
+-#ifndef __ASSEMBLY__
+-/*
+- * Handy routine to set GPIO functions
+- */
+-extern void imx_gpio_mode( int gpio_mode );
+-
+-#endif
+-
+-#define MAXIRQNUM 62
+-#define MAXFIQNUM 62
+-#define MAXSWINUM 62
+-
+-/*
+- * Use SDRAM for memory
+- */
+-#define MEM_SIZE 0x01000000
+-
+-#ifdef CONFIG_ARCH_MX1ADS
+-#include "mx1ads.h"
+-#endif
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-dma.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-dma.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-dma.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-dma.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,98 +0,0 @@
+-/*
+- * linux/include/asm-arm/imxads/dma.h
+- *
+- * Copyright (C) 1997,1998 Russell King
+- *
+- * 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 <mach/dma.h>
+-
+-#ifndef __ASM_ARCH_IMX_DMA_H
+-#define __ASM_ARCH_IMX_DMA_H
+-
+-#define IMX_DMA_CHANNELS 11
+-
+-/*
+- * struct imx_dma_channel - i.MX specific DMA extension
+- * @name: name specified by DMA client
+- * @irq_handler: client callback for end of transfer
+- * @err_handler: client callback for error condition
+- * @data: clients context data for callbacks
+- * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE
+- * @sg: pointer to the actual read/written chunk for scatter-gather emulation
+- * @sgbc: counter of processed bytes in the actual read/written chunk
+- * @resbytes: total residual number of bytes to transfer
+- * (it can be lower or same as sum of SG mapped chunk sizes)
+- * @sgcount: number of chunks to be read/written
+- *
+- * Structure is used for IMX DMA processing. It would be probably good
+- * @struct dma_struct in the future for external interfacing and use
+- * @struct imx_dma_channel only as extension to it.
+- */
+-
+-struct imx_dma_channel {
+- const char *name;
+- void (*irq_handler) (int, void *);
+- void (*err_handler) (int, void *, int errcode);
+- void *data;
+- unsigned int dma_mode;
+- struct scatterlist *sg;
+- unsigned int sgbc;
+- unsigned int sgcount;
+- unsigned int resbytes;
+- int dma_num;
+-};
+-
+-extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
+-
+-#define IMX_DMA_ERR_BURST 1
+-#define IMX_DMA_ERR_REQUEST 2
+-#define IMX_DMA_ERR_TRANSFER 4
+-#define IMX_DMA_ERR_BUFFER 8
+-
+-/* The type to distinguish channel numbers parameter from ordinal int type */
+-typedef int imx_dmach_t;
+-
+-#define DMA_MODE_READ 0
+-#define DMA_MODE_WRITE 1
+-#define DMA_MODE_MASK 1
+-
+-int
+-imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
+- unsigned int dma_length, unsigned int dev_addr, unsigned int dmamode);
+-
+-int
+-imx_dma_setup_sg(imx_dmach_t dma_ch,
+- struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
+- unsigned int dev_addr, unsigned int dmamode);
+-
+-int
+-imx_dma_setup_handlers(imx_dmach_t dma_ch,
+- void (*irq_handler) (int, void *),
+- void (*err_handler) (int, void *, int), void *data);
+-
+-void imx_dma_enable(imx_dmach_t dma_ch);
+-
+-void imx_dma_disable(imx_dmach_t dma_ch);
+-
+-int imx_dma_request(imx_dmach_t dma_ch, const char *name);
+-
+-void imx_dma_free(imx_dmach_t dma_ch);
+-
+-imx_dmach_t imx_dma_request_by_prio(const char *name, imx_dma_prio prio);
+-
+-
+-#endif /* _ASM_ARCH_IMX_DMA_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-regs.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-regs.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-regs.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-regs.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,376 +0,0 @@
+-#ifndef _IMX_REGS_H
+-#define _IMX_REGS_H
+-/* ------------------------------------------------------------------------
+- * Motorola IMX system registers
+- * ------------------------------------------------------------------------
+- *
+- */
+-
+-/*
+- * Register BASEs, based on OFFSETs
+- *
+- */
+-#define IMX_AIPI1_BASE (0x00000 + IMX_IO_BASE)
+-#define IMX_WDT_BASE (0x01000 + IMX_IO_BASE)
+-#define IMX_TIM1_BASE (0x02000 + IMX_IO_BASE)
+-#define IMX_TIM2_BASE (0x03000 + IMX_IO_BASE)
+-#define IMX_RTC_BASE (0x04000 + IMX_IO_BASE)
+-#define IMX_LCDC_BASE (0x05000 + IMX_IO_BASE)
+-#define IMX_UART1_BASE (0x06000 + IMX_IO_BASE)
+-#define IMX_UART2_BASE (0x07000 + IMX_IO_BASE)
+-#define IMX_PWM_BASE (0x08000 + IMX_IO_BASE)
+-#define IMX_DMAC_BASE (0x09000 + IMX_IO_BASE)
+-#define IMX_AIPI2_BASE (0x10000 + IMX_IO_BASE)
+-#define IMX_SIM_BASE (0x11000 + IMX_IO_BASE)
+-#define IMX_USBD_BASE (0x12000 + IMX_IO_BASE)
+-#define IMX_SPI1_BASE (0x13000 + IMX_IO_BASE)
+-#define IMX_MMC_BASE (0x14000 + IMX_IO_BASE)
+-#define IMX_ASP_BASE (0x15000 + IMX_IO_BASE)
+-#define IMX_BTA_BASE (0x16000 + IMX_IO_BASE)
+-#define IMX_I2C_BASE (0x17000 + IMX_IO_BASE)
+-#define IMX_SSI_BASE (0x18000 + IMX_IO_BASE)
+-#define IMX_SPI2_BASE (0x19000 + IMX_IO_BASE)
+-#define IMX_MSHC_BASE (0x1A000 + IMX_IO_BASE)
+-#define IMX_PLL_BASE (0x1B000 + IMX_IO_BASE)
+-#define IMX_GPIO_BASE (0x1C000 + IMX_IO_BASE)
+-#define IMX_EIM_BASE (0x20000 + IMX_IO_BASE)
+-#define IMX_SDRAMC_BASE (0x21000 + IMX_IO_BASE)
+-#define IMX_MMA_BASE (0x22000 + IMX_IO_BASE)
+-#define IMX_AITC_BASE (0x23000 + IMX_IO_BASE)
+-#define IMX_CSI_BASE (0x24000 + IMX_IO_BASE)
+-
+-/* PLL registers */
+-#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */
+-#define CSCR_SPLL_RESTART (1<<22)
+-#define CSCR_MPLL_RESTART (1<<21)
+-#define CSCR_SYSTEM_SEL (1<<16)
+-#define CSCR_BCLK_DIV (0xf<<10)
+-#define CSCR_MPU_PRESC (1<<15)
+-#define CSCR_SPEN (1<<1)
+-#define CSCR_MPEN (1<<0)
+-
+-#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */
+-#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */
+-#define SPCTL0 __REG(IMX_PLL_BASE + 0xc) /* System PLL Control Register 0 */
+-#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
+-#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */
+-
+-/*
+- * GPIO Module and I/O Multiplexer
+- * x = 0..3 for reg_A, reg_B, reg_C, reg_D
+- */
+-#define DDIR(x) __REG2(IMX_GPIO_BASE + 0x00, ((x) & 3) << 8)
+-#define OCR1(x) __REG2(IMX_GPIO_BASE + 0x04, ((x) & 3) << 8)
+-#define OCR2(x) __REG2(IMX_GPIO_BASE + 0x08, ((x) & 3) << 8)
+-#define ICONFA1(x) __REG2(IMX_GPIO_BASE + 0x0c, ((x) & 3) << 8)
+-#define ICONFA2(x) __REG2(IMX_GPIO_BASE + 0x10, ((x) & 3) << 8)
+-#define ICONFB1(x) __REG2(IMX_GPIO_BASE + 0x14, ((x) & 3) << 8)
+-#define ICONFB2(x) __REG2(IMX_GPIO_BASE + 0x18, ((x) & 3) << 8)
+-#define DR(x) __REG2(IMX_GPIO_BASE + 0x1c, ((x) & 3) << 8)
+-#define GIUS(x) __REG2(IMX_GPIO_BASE + 0x20, ((x) & 3) << 8)
+-#define SSR(x) __REG2(IMX_GPIO_BASE + 0x24, ((x) & 3) << 8)
+-#define ICR1(x) __REG2(IMX_GPIO_BASE + 0x28, ((x) & 3) << 8)
+-#define ICR2(x) __REG2(IMX_GPIO_BASE + 0x2c, ((x) & 3) << 8)
+-#define IMR(x) __REG2(IMX_GPIO_BASE + 0x30, ((x) & 3) << 8)
+-#define ISR(x) __REG2(IMX_GPIO_BASE + 0x34, ((x) & 3) << 8)
+-#define GPR(x) __REG2(IMX_GPIO_BASE + 0x38, ((x) & 3) << 8)
+-#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8)
+-#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8)
+-
+-#define GPIO_PORT_MAX 3
+-
+-#define GPIO_PIN_MASK 0x1f
+-#define GPIO_PORT_MASK (0x3 << 5)
+-
+-#define GPIO_PORT_SHIFT 5
+-#define GPIO_PORTA (0<<5)
+-#define GPIO_PORTB (1<<5)
+-#define GPIO_PORTC (2<<5)
+-#define GPIO_PORTD (3<<5)
+-
+-#define GPIO_OUT (1<<7)
+-#define GPIO_IN (0<<7)
+-#define GPIO_PUEN (1<<8)
+-
+-#define GPIO_PF (0<<9)
+-#define GPIO_AF (1<<9)
+-
+-#define GPIO_OCR_SHIFT 10
+-#define GPIO_OCR_MASK (3<<10)
+-#define GPIO_AIN (0<<10)
+-#define GPIO_BIN (1<<10)
+-#define GPIO_CIN (2<<10)
+-#define GPIO_DR (3<<10)
+-
+-#define GPIO_AOUT_SHIFT 12
+-#define GPIO_AOUT_MASK (3<<12)
+-#define GPIO_AOUT (0<<12)
+-#define GPIO_AOUT_ISR (1<<12)
+-#define GPIO_AOUT_0 (2<<12)
+-#define GPIO_AOUT_1 (3<<12)
+-
+-#define GPIO_BOUT_SHIFT 14
+-#define GPIO_BOUT_MASK (3<<14)
+-#define GPIO_BOUT (0<<14)
+-#define GPIO_BOUT_ISR (1<<14)
+-#define GPIO_BOUT_0 (2<<14)
+-#define GPIO_BOUT_1 (3<<14)
+-
+-#define GPIO_GIUS (1<<16)
+-
+-/* assignements for GPIO alternate/primary functions */
+-
+-/* FIXME: This list is not completed. The correct directions are
+- * missing on some (many) pins
+- */
+-#define PA0_AIN_SPI2_CLK ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 0 )
+-#define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 )
+-#define PA1_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTA | GPIO_IN | 1 )
+-#define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 )
+-#define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 )
+-#define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 )
+-#define PA4_PF_CSI_D0 ( GPIO_PORTA | GPIO_PF | 4 )
+-#define PA5_PF_CSI_D1 ( GPIO_PORTA | GPIO_PF | 5 )
+-#define PA6_PF_CSI_D2 ( GPIO_PORTA | GPIO_PF | 6 )
+-#define PA7_PF_CSI_D3 ( GPIO_PORTA | GPIO_PF | 7 )
+-#define PA8_PF_CSI_D4 ( GPIO_PORTA | GPIO_PF | 8 )
+-#define PA9_PF_CSI_D5 ( GPIO_PORTA | GPIO_PF | 9 )
+-#define PA10_PF_CSI_D6 ( GPIO_PORTA | GPIO_PF | 10 )
+-#define PA11_PF_CSI_D7 ( GPIO_PORTA | GPIO_PF | 11 )
+-#define PA12_PF_CSI_VSYNC ( GPIO_PORTA | GPIO_PF | 12 )
+-#define PA13_PF_CSI_HSYNC ( GPIO_PORTA | GPIO_PF | 13 )
+-#define PA14_PF_CSI_PIXCLK ( GPIO_PORTA | GPIO_PF | 14 )
+-#define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 )
+-#define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 )
+-#define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 )
+-#define PA17_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 17 )
+-#define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 )
+-#define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 )
+-#define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 )
+-#define PA21_PF_A0 ( GPIO_PORTA | GPIO_PF | 21 )
+-#define PA22_PF_CS4 ( GPIO_PORTA | GPIO_PF | 22 )
+-#define PA23_PF_CS5 ( GPIO_PORTA | GPIO_PF | 23 )
+-#define PA24_PF_A16 ( GPIO_PORTA | GPIO_PF | 24 )
+-#define PA24_AF_ETMTRACEPKT0 ( GPIO_PORTA | GPIO_AF | 24 )
+-#define PA25_PF_A17 ( GPIO_PORTA | GPIO_PF | 25 )
+-#define PA25_AF_ETMTRACEPKT1 ( GPIO_PORTA | GPIO_AF | 25 )
+-#define PA26_PF_A18 ( GPIO_PORTA | GPIO_PF | 26 )
+-#define PA26_AF_ETMTRACEPKT2 ( GPIO_PORTA | GPIO_AF | 26 )
+-#define PA27_PF_A19 ( GPIO_PORTA | GPIO_PF | 27 )
+-#define PA27_AF_ETMTRACEPKT3 ( GPIO_PORTA | GPIO_AF | 27 )
+-#define PA28_PF_A20 ( GPIO_PORTA | GPIO_PF | 28 )
+-#define PA28_AF_ETMPIPESTAT0 ( GPIO_PORTA | GPIO_AF | 28 )
+-#define PA29_PF_A21 ( GPIO_PORTA | GPIO_PF | 29 )
+-#define PA29_AF_ETMPIPESTAT1 ( GPIO_PORTA | GPIO_AF | 29 )
+-#define PA30_PF_A22 ( GPIO_PORTA | GPIO_PF | 30 )
+-#define PA30_AF_ETMPIPESTAT2 ( GPIO_PORTA | GPIO_AF | 30 )
+-#define PA31_PF_A23 ( GPIO_PORTA | GPIO_PF | 31 )
+-#define PA31_AF_ETMTRACECLK ( GPIO_PORTA | GPIO_AF | 31 )
+-#define PB8_PF_SD_DAT0 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8 )
+-#define PB8_AF_MS_PIO ( GPIO_PORTB | GPIO_AF | 8 )
+-#define PB9_PF_SD_DAT1 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9 )
+-#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
+-#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
+-#define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
+-#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
+-#define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
+-#define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
+-#define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
+-#define PB13_PF_SD_CMD ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13 )
+-#define PB13_AF_MS_BS ( GPIO_PORTB | GPIO_AF | 13 )
+-#define PB14_AF_SSI_RXFS ( GPIO_PORTB | GPIO_AF | 14 )
+-#define PB15_AF_SSI_RXCLK ( GPIO_PORTB | GPIO_AF | 15 )
+-#define PB16_AF_SSI_RXDAT ( GPIO_PORTB | GPIO_IN | GPIO_AF | 16 )
+-#define PB17_AF_SSI_TXDAT ( GPIO_PORTB | GPIO_OUT | GPIO_AF | 17 )
+-#define PB18_AF_SSI_TXFS ( GPIO_PORTB | GPIO_AF | 18 )
+-#define PB19_AF_SSI_TXCLK ( GPIO_PORTB | GPIO_AF | 19 )
+-#define PB20_PF_USBD_AFE ( GPIO_PORTB | GPIO_PF | 20 )
+-#define PB21_PF_USBD_OE ( GPIO_PORTB | GPIO_PF | 21 )
+-#define PB22_PFUSBD_RCV ( GPIO_PORTB | GPIO_PF | 22 )
+-#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
+-#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
+-#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
+-#define PB26_PF_USBD_VPO ( GPIO_PORTB | GPIO_PF | 26 )
+-#define PB27_PF_USBD_VMO ( GPIO_PORTB | GPIO_PF | 27 )
+-#define PB28_PF_UART2_CTS ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 28 )
+-#define PB29_PF_UART2_RTS ( GPIO_PORTB | GPIO_IN | GPIO_PF | 29 )
+-#define PB30_PF_UART2_TXD ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 30 )
+-#define PB31_PF_UART2_RXD ( GPIO_PORTB | GPIO_IN | GPIO_PF | 31 )
+-#define PC3_PF_SSI_RXFS ( GPIO_PORTC | GPIO_PF | 3 )
+-#define PC4_PF_SSI_RXCLK ( GPIO_PORTC | GPIO_PF | 4 )
+-#define PC5_PF_SSI_RXDAT ( GPIO_PORTC | GPIO_IN | GPIO_PF | 5 )
+-#define PC6_PF_SSI_TXDAT ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 6 )
+-#define PC7_PF_SSI_TXFS ( GPIO_PORTC | GPIO_PF | 7 )
+-#define PC8_PF_SSI_TXCLK ( GPIO_PORTC | GPIO_PF | 8 )
+-#define PC9_PF_UART1_CTS ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 9 )
+-#define PC10_PF_UART1_RTS ( GPIO_PORTC | GPIO_IN | GPIO_PF | 10 )
+-#define PC11_PF_UART1_TXD ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 11 )
+-#define PC12_PF_UART1_RXD ( GPIO_PORTC | GPIO_IN | GPIO_PF | 12 )
+-#define PC13_PF_SPI1_SPI_RDY ( GPIO_PORTC | GPIO_PF | 13 )
+-#define PC14_PF_SPI1_SCLK ( GPIO_PORTC | GPIO_PF | 14 )
+-#define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 )
+-#define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 )
+-#define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 )
+-#define PC24_BIN_UART3_RI ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24 )
+-#define PC25_BIN_UART3_DSR ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25 )
+-#define PC26_AOUT_UART3_DTR ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 26 )
+-#define PC27_BIN_UART3_DCD ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27 )
+-#define PC28_BIN_UART3_CTS ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28 )
+-#define PC29_AOUT_UART3_RTS ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 29 )
+-#define PC30_BIN_UART3_TX ( GPIO_GIUS | GPIO_PORTC | GPIO_BIN | 30 )
+-#define PC31_AOUT_UART3_RX ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 31)
+-#define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 )
+-#define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 )
+-#define PD7_AF_UART2_DTR ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | GPIO_AF | 7 )
+-#define PD7_AIN_SPI2_SCLK ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 7 )
+-#define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 )
+-#define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 )
+-#define PD8_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 8 )
+-#define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 )
+-#define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 )
+-#define PD9_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | 9 )
+-#define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 )
+-#define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 )
+-#define PD10_AIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_OUT | 10 )
+-#define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 )
+-#define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 )
+-#define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 )
+-#define PD14_PF_FLM_VSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 14 )
+-#define PD15_PF_LD0 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 15 )
+-#define PD16_PF_LD1 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 16 )
+-#define PD17_PF_LD2 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 17 )
+-#define PD18_PF_LD3 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 18 )
+-#define PD19_PF_LD4 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 19 )
+-#define PD20_PF_LD5 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 20 )
+-#define PD21_PF_LD6 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 21 )
+-#define PD22_PF_LD7 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 22 )
+-#define PD23_PF_LD8 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 23 )
+-#define PD24_PF_LD9 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 24 )
+-#define PD25_PF_LD10 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 25 )
+-#define PD26_PF_LD11 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 26 )
+-#define PD27_PF_LD12 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 27 )
+-#define PD28_PF_LD13 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 28 )
+-#define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 )
+-#define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 )
+-#define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 )
+-#define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 )
+-
+-/*
+- * PWM controller
+- */
+-#define PWMC __REG(IMX_PWM_BASE + 0x00) /* PWM Control Register */
+-#define PWMS __REG(IMX_PWM_BASE + 0x04) /* PWM Sample Register */
+-#define PWMP __REG(IMX_PWM_BASE + 0x08) /* PWM Period Register */
+-#define PWMCNT __REG(IMX_PWM_BASE + 0x0C) /* PWM Counter Register */
+-
+-#define PWMC_HCTR (0x01<<18) /* Halfword FIFO Data Swapping */
+-#define PWMC_BCTR (0x01<<17) /* Byte FIFO Data Swapping */
+-#define PWMC_SWR (0x01<<16) /* Software Reset */
+-#define PWMC_CLKSRC (0x01<<15) /* Clock Source */
+-#define PWMC_PRESCALER(x) (((x-1) & 0x7F) << 8) /* PRESCALER */
+-#define PWMC_IRQ (0x01<< 7) /* Interrupt Request */
+-#define PWMC_IRQEN (0x01<< 6) /* Interrupt Request Enable */
+-#define PWMC_FIFOAV (0x01<< 5) /* FIFO Available */
+-#define PWMC_EN (0x01<< 4) /* Enables/Disables the PWM */
+-#define PWMC_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
+-#define PWMC_CLKSEL(x) (((x) & 0x03) << 0) /* Clock Selection */
+-
+-#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
+-#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
+-#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
+-
+-/*
+- * DMA Controller
+- */
+-#define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */
+-#define DISR __REG(IMX_DMAC_BASE +0x04) /* DMA Interrupt status Register */
+-#define DIMR __REG(IMX_DMAC_BASE +0x08) /* DMA Interrupt mask Register */
+-#define DBTOSR __REG(IMX_DMAC_BASE +0x0c) /* DMA Burst timeout status Register */
+-#define DRTOSR __REG(IMX_DMAC_BASE +0x10) /* DMA Request timeout Register */
+-#define DSESR __REG(IMX_DMAC_BASE +0x14) /* DMA Transfer Error Status Register */
+-#define DBOSR __REG(IMX_DMAC_BASE +0x18) /* DMA Buffer overflow status Register */
+-#define DBTOCR __REG(IMX_DMAC_BASE +0x1c) /* DMA Burst timeout control Register */
+-#define WSRA __REG(IMX_DMAC_BASE +0x40) /* W-Size Register A */
+-#define XSRA __REG(IMX_DMAC_BASE +0x44) /* X-Size Register A */
+-#define YSRA __REG(IMX_DMAC_BASE +0x48) /* Y-Size Register A */
+-#define WSRB __REG(IMX_DMAC_BASE +0x4c) /* W-Size Register B */
+-#define XSRB __REG(IMX_DMAC_BASE +0x50) /* X-Size Register B */
+-#define YSRB __REG(IMX_DMAC_BASE +0x54) /* Y-Size Register B */
+-#define SAR(x) __REG2( IMX_DMAC_BASE + 0x80, (x) << 6) /* Source Address Registers */
+-#define DAR(x) __REG2( IMX_DMAC_BASE + 0x84, (x) << 6) /* Destination Address Registers */
+-#define CNTR(x) __REG2( IMX_DMAC_BASE + 0x88, (x) << 6) /* Count Registers */
+-#define CCR(x) __REG2( IMX_DMAC_BASE + 0x8c, (x) << 6) /* Control Registers */
+-#define RSSR(x) __REG2( IMX_DMAC_BASE + 0x90, (x) << 6) /* Request source select Registers */
+-#define BLR(x) __REG2( IMX_DMAC_BASE + 0x94, (x) << 6) /* Burst length Registers */
+-#define RTOR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Request timeout Registers */
+-#define BUCR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Bus Utilization Registers */
+-
+-#define DCR_DRST (1<<1)
+-#define DCR_DEN (1<<0)
+-#define DBTOCR_EN (1<<15)
+-#define DBTOCR_CNT(x) ((x) & 0x7fff )
+-#define CNTR_CNT(x) ((x) & 0xffffff )
+-#define CCR_DMOD_LINEAR ( 0x0 << 12 )
+-#define CCR_DMOD_2D ( 0x1 << 12 )
+-#define CCR_DMOD_FIFO ( 0x2 << 12 )
+-#define CCR_DMOD_EOBFIFO ( 0x3 << 12 )
+-#define CCR_SMOD_LINEAR ( 0x0 << 10 )
+-#define CCR_SMOD_2D ( 0x1 << 10 )
+-#define CCR_SMOD_FIFO ( 0x2 << 10 )
+-#define CCR_SMOD_EOBFIFO ( 0x3 << 10 )
+-#define CCR_MDIR_DEC (1<<9)
+-#define CCR_MSEL_B (1<<8)
+-#define CCR_DSIZ_32 ( 0x0 << 6 )
+-#define CCR_DSIZ_8 ( 0x1 << 6 )
+-#define CCR_DSIZ_16 ( 0x2 << 6 )
+-#define CCR_SSIZ_32 ( 0x0 << 4 )
+-#define CCR_SSIZ_8 ( 0x1 << 4 )
+-#define CCR_SSIZ_16 ( 0x2 << 4 )
+-#define CCR_REN (1<<3)
+-#define CCR_RPT (1<<2)
+-#define CCR_FRC (1<<1)
+-#define CCR_CEN (1<<0)
+-#define RTOR_EN (1<<15)
+-#define RTOR_CLK (1<<14)
+-#define RTOR_PSC (1<<13)
+-
+-/*
+- * Interrupt controller
+- */
+-
+-#define IMX_INTCNTL __REG(IMX_AITC_BASE+0x00)
+-#define INTCNTL_FIAD (1<<19)
+-#define INTCNTL_NIAD (1<<20)
+-
+-#define IMX_NIMASK __REG(IMX_AITC_BASE+0x04)
+-#define IMX_INTENNUM __REG(IMX_AITC_BASE+0x08)
+-#define IMX_INTDISNUM __REG(IMX_AITC_BASE+0x0c)
+-#define IMX_INTENABLEH __REG(IMX_AITC_BASE+0x10)
+-#define IMX_INTENABLEL __REG(IMX_AITC_BASE+0x14)
+-
+-/*
+- * General purpose timers
+- */
+-#define IMX_TCTL(x) __REG( 0x00 + (x))
+-#define TCTL_SWR (1<<15)
+-#define TCTL_FRR (1<<8)
+-#define TCTL_CAP_RIS (1<<6)
+-#define TCTL_CAP_FAL (2<<6)
+-#define TCTL_CAP_RIS_FAL (3<<6)
+-#define TCTL_OM (1<<5)
+-#define TCTL_IRQEN (1<<4)
+-#define TCTL_CLK_PCLK1 (1<<1)
+-#define TCTL_CLK_PCLK1_16 (2<<1)
+-#define TCTL_CLK_TIN (3<<1)
+-#define TCTL_CLK_32 (4<<1)
+-#define TCTL_TEN (1<<0)
+-
+-#define IMX_TPRER(x) __REG( 0x04 + (x))
+-#define IMX_TCMP(x) __REG( 0x08 + (x))
+-#define IMX_TCR(x) __REG( 0x0C + (x))
+-#define IMX_TCN(x) __REG( 0x10 + (x))
+-#define IMX_TSTAT(x) __REG( 0x14 + (x))
+-#define TSTAT_CAPT (1<<1)
+-#define TSTAT_COMP (1<<0)
+-
+-#endif // _IMX_REGS_H
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-uart.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-uart.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/imx-uart.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/imx-uart.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,12 +0,0 @@
+-#ifndef ASMARM_ARCH_UART_H
+-#define ASMARM_ARCH_UART_H
+-
+-#define IMXUART_HAVE_RTSCTS (1<<0)
+-
+-struct imxuart_platform_data {
+- int (*init)(struct platform_device *pdev);
+- void (*exit)(struct platform_device *pdev);
+- unsigned int flags;
+-};
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/io.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/io.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/io.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,28 +0,0 @@
+-/*
+- * arch/arm/mach-imxads/include/mach/io.h
+- *
+- * Copyright (C) 1999 ARM Limited
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#ifndef __ASM_ARM_ARCH_IO_H
+-#define __ASM_ARM_ARCH_IO_H
+-
+-#define IO_SPACE_LIMIT 0xffffffff
+-
+-#define __io(a) __typesafe_io(a)
+-#define __mem_pci(a) (a)
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/irqs.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/irqs.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/irqs.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,121 +0,0 @@
+-/*
+- * arch/arm/mach-imxads/include/mach/irqs.h
+- *
+- * Copyright (C) 1999 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#ifndef __ARM_IRQS_H__
+-#define __ARM_IRQS_H__
+-
+-/* Use the imx definitions */
+-#include <mach/hardware.h>
+-
+-/*
+- * IMX Interrupt numbers
+- *
+- */
+-#define INT_SOFTINT 0
+-#define CSI_INT 6
+-#define DSPA_MAC_INT 7
+-#define DSPA_INT 8
+-#define COMP_INT 9
+-#define MSHC_XINT 10
+-#define GPIO_INT_PORTA 11
+-#define GPIO_INT_PORTB 12
+-#define GPIO_INT_PORTC 13
+-#define LCDC_INT 14
+-#define SIM_INT 15
+-#define SIM_DATA_INT 16
+-#define RTC_INT 17
+-#define RTC_SAMINT 18
+-#define UART2_MINT_PFERR 19
+-#define UART2_MINT_RTS 20
+-#define UART2_MINT_DTR 21
+-#define UART2_MINT_UARTC 22
+-#define UART2_MINT_TX 23
+-#define UART2_MINT_RX 24
+-#define UART1_MINT_PFERR 25
+-#define UART1_MINT_RTS 26
+-#define UART1_MINT_DTR 27
+-#define UART1_MINT_UARTC 28
+-#define UART1_MINT_TX 29
+-#define UART1_MINT_RX 30
+-#define VOICE_DAC_INT 31
+-#define VOICE_ADC_INT 32
+-#define PEN_DATA_INT 33
+-#define PWM_INT 34
+-#define SDHC_INT 35
+-#define I2C_INT 39
+-#define CSPI_INT 41
+-#define SSI_TX_INT 42
+-#define SSI_TX_ERR_INT 43
+-#define SSI_RX_INT 44
+-#define SSI_RX_ERR_INT 45
+-#define TOUCH_INT 46
+-#define USBD_INT0 47
+-#define USBD_INT1 48
+-#define USBD_INT2 49
+-#define USBD_INT3 50
+-#define USBD_INT4 51
+-#define USBD_INT5 52
+-#define USBD_INT6 53
+-#define BTSYS_INT 55
+-#define BTTIM_INT 56
+-#define BTWUI_INT 57
+-#define TIM2_INT 58
+-#define TIM1_INT 59
+-#define DMA_ERR 60
+-#define DMA_INT 61
+-#define GPIO_INT_PORTD 62
+-
+-#define IMX_IRQS (64)
+-
+-/* note: the IMX has four gpio ports (A-D), but only
+- * the following pins are connected to the outside
+- * world:
+- *
+- * PORT A: bits 0-31
+- * PORT B: bits 8-31
+- * PORT C: bits 3-17
+- * PORT D: bits 6-31
+- *
+- * We map these interrupts straight on. As a result we have
+- * several holes in the interrupt mapping. We do this for two
+- * reasons:
+- * - mapping the interrupts without holes would get
+- * far more complicated
+- * - Motorola could well decide to bring some processor
+- * with more pins connected
+- */
+-
+-#define IRQ_GPIOA(x) (IMX_IRQS + x)
+-#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
+-#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
+-#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
+-
+-/* decode irq number to use with IMR(x), ISR(x) and friends */
+-#define IRQ_TO_REG(irq) ((irq - IMX_IRQS) >> 5)
+-
+-/* all normal IRQs can be FIQs */
+-#define FIQ_START 0
+-/* switch betwean IRQ and FIQ */
+-extern int imx_set_irq_fiq(unsigned int irq, unsigned int type);
+-
+-#define NR_IRQS (IRQ_GPIOD(32) + 1)
+-#define IRQ_GPIO(x)
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/memory.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/memory.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/memory.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,26 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/memory.h
+- *
+- * Copyright (C) 1999 ARM Limited
+- * Copyright (C) 2002 Shane Nay (shane@minirl.com)
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#ifndef __ASM_ARCH_MMU_H
+-#define __ASM_ARCH_MMU_H
+-
+-#define PHYS_OFFSET UL(0x08000000)
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/mmc.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/mmc.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/mmc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/mmc.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,15 +0,0 @@
+-#ifndef ASMARM_ARCH_MMC_H
+-#define ASMARM_ARCH_MMC_H
+-
+-#include <linux/mmc/host.h>
+-
+-struct device;
+-
+-struct imxmmc_platform_data {
+- int (*card_present)(struct device *);
+- int (*get_ro)(struct device *);
+-};
+-
+-extern void imx_set_mmc_info(struct imxmmc_platform_data *info);
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/mx1ads.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/mx1ads.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/mx1ads.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/mx1ads.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,36 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/mx1ads.h
+- *
+- * Copyright (C) 2004 Robert Schwebel, Pengutronix
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- *
+- */
+-
+-#ifndef __ASM_ARCH_MX1ADS_H
+-#define __ASM_ARCH_MX1ADS_H
+-
+-/* ------------------------------------------------------------------------ */
+-/* Memory Map for the M9328MX1ADS (MX1ADS) Board */
+-/* ------------------------------------------------------------------------ */
+-
+-#define MX1ADS_FLASH_PHYS 0x10000000
+-#define MX1ADS_FLASH_SIZE (16*1024*1024)
+-
+-#define IMX_FB_PHYS (0x0C000000 - 0x40000)
+-
+-#define CLK32 32000
+-
+-#endif /* __ASM_ARCH_MX1ADS_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/spi_imx.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/spi_imx.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/spi_imx.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/spi_imx.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,72 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/spi_imx.h
+- *
+- * Copyright (C) 2006 SWAPP
+- * Andrea Paterniani <a.paterniani@swapp-eng.it>
+- *
+- * Initial version inspired by:
+- * linux-2.6.17-rc3-mm1/arch/arm/mach-pxa/include/mach/pxa2xx_spi.h
+- *
+- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+- */
+-
+-#ifndef SPI_IMX_H_
+-#define SPI_IMX_H_
+-
+-
+-/*-------------------------------------------------------------------------*/
+-/**
+- * struct spi_imx_master - device.platform_data for SPI controller devices.
+- * @num_chipselect: chipselects are used to distinguish individual
+- * SPI slaves, and are numbered from zero to num_chipselects - 1.
+- * each slave has a chipselect signal, but it's common that not
+- * every chipselect is connected to a slave.
+- * @enable_dma: if true enables DMA driven transfers.
+-*/
+-struct spi_imx_master {
+- u8 num_chipselect;
+- u8 enable_dma:1;
+-};
+-/*-------------------------------------------------------------------------*/
+-
+-
+-/*-------------------------------------------------------------------------*/
+-/**
+- * struct spi_imx_chip - spi_board_info.controller_data for SPI
+- * slave devices, copied to spi_device.controller_data.
+- * @enable_loopback : used for test purpouse to internally connect RX and TX
+- * sections.
+- * @enable_dma : enables dma transfer (provided that controller driver has
+- * dma enabled too).
+- * @ins_ss_pulse : enable /SS pulse insertion between SPI burst.
+- * @bclk_wait : number of bclk waits between each bits_per_word SPI burst.
+- * @cs_control : function pointer to board-specific function to assert/deassert
+- * I/O port to control HW generation of devices chip-select.
+-*/
+-struct spi_imx_chip {
+- u8 enable_loopback:1;
+- u8 enable_dma:1;
+- u8 ins_ss_pulse:1;
+- u16 bclk_wait:15;
+- void (*cs_control)(u32 control);
+-};
+-
+-/* Chip-select state */
+-#define SPI_CS_ASSERT (1 << 0)
+-#define SPI_CS_DEASSERT (1 << 1)
+-/*-------------------------------------------------------------------------*/
+-
+-
+-#endif /* SPI_IMX_H_*/
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/system.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/system.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/system.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,40 +0,0 @@
+-/*
+- * arch/arm/mach-imxads/include/mach/system.h
+- *
+- * Copyright (C) 1999 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#ifndef __ASM_ARCH_SYSTEM_H
+-#define __ASM_ARCH_SYSTEM_H
+-
+-static void
+-arch_idle(void)
+-{
+- /*
+- * This should do all the clock switching
+- * and wait for interrupt tricks
+- */
+- cpu_do_idle();
+-}
+-
+-static inline void
+-arch_reset(char mode, const char *cmd)
+-{
+- cpu_reset(0);
+-}
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/timex.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/timex.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/timex.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,26 +0,0 @@
+-/*
+- * linux/include/asm-arm/imx/timex.h
+- *
+- * Copyright (C) 1999 ARM Limited
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#ifndef __ASM_ARCH_TIMEX_H
+-#define __ASM_ARCH_TIMEX_H
+-
+-#define CLOCK_TICK_RATE (16000000)
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/uncompress.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/uncompress.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/uncompress.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,71 +0,0 @@
+-/*
+- * arch/arm/mach-imxads/include/mach/uncompress.h
+- *
+- *
+- *
+- * Copyright (C) 1999 ARM Limited
+- * Copyright (C) Shane Nay (shane@minirl.com)
+- *
+- * 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
+- */
+-
+-#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
+-
+-#define UART1_BASE 0x206000
+-#define UART2_BASE 0x207000
+-#define USR2 0x98
+-#define USR2_TXFE (1<<14)
+-#define TXR 0x40
+-#define UCR1 0x80
+-#define UCR1_UARTEN 1
+-
+-/*
+- * The following code assumes the serial port has already been
+- * initialized by the bootloader. We search for the first enabled
+- * port in the most probable order. If you didn't setup a port in
+- * your bootloader then nothing will appear (which might be desired).
+- *
+- * This does not append a newline
+- */
+-static void putc(int c)
+-{
+- unsigned long serial_port;
+-
+- do {
+- serial_port = UART1_BASE;
+- if ( UART(UCR1) & UCR1_UARTEN )
+- break;
+- serial_port = UART2_BASE;
+- if ( UART(UCR1) & UCR1_UARTEN )
+- break;
+- return;
+- } while(0);
+-
+- while (!(UART(USR2) & USR2_TXFE))
+- barrier();
+-
+- UART(TXR) = c;
+-}
+-
+-static inline void flush(void)
+-{
+-}
+-
+-/*
+- * nothing to do
+- */
+-#define arch_decomp_setup()
+-
+-#define arch_decomp_wdog()
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/vmalloc.h linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/vmalloc.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/include/mach/vmalloc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,20 +0,0 @@
+-/*
+- * arch/arm/mach-imx/include/mach/vmalloc.h
+- *
+- * Copyright (C) 2000 Russell King.
+- *
+- * 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
+- */
+-#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/irq.c linux-2.6.30-rc4-git/arch/arm/mach-imx/irq.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/irq.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/irq.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,311 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/irq.c
+- *
+- * Copyright (C) 1999 ARM Limited
+- * Copyright (C) 2002 Shane Nay (shane@minirl.com)
+- *
+- * 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
+- *
+- * 03/03/2004 Sascha Hauer <sascha@saschahauer.de>
+- * Copied from the motorola bsp package and added gpio demux
+- * interrupt handler
+- */
+-
+-#include <linux/init.h>
+-#include <linux/list.h>
+-#include <linux/timer.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-#include <asm/irq.h>
+-
+-#include <asm/mach/irq.h>
+-
+-/*
+- *
+- * We simply use the ENABLE DISABLE registers inside of the IMX
+- * to turn on/off specific interrupts.
+- *
+- */
+-
+-#define INTCNTL_OFF 0x00
+-#define NIMASK_OFF 0x04
+-#define INTENNUM_OFF 0x08
+-#define INTDISNUM_OFF 0x0C
+-#define INTENABLEH_OFF 0x10
+-#define INTENABLEL_OFF 0x14
+-#define INTTYPEH_OFF 0x18
+-#define INTTYPEL_OFF 0x1C
+-#define NIPRIORITY_OFF(x) (0x20+4*(7-(x)))
+-#define NIVECSR_OFF 0x40
+-#define FIVECSR_OFF 0x44
+-#define INTSRCH_OFF 0x48
+-#define INTSRCL_OFF 0x4C
+-#define INTFRCH_OFF 0x50
+-#define INTFRCL_OFF 0x54
+-#define NIPNDH_OFF 0x58
+-#define NIPNDL_OFF 0x5C
+-#define FIPNDH_OFF 0x60
+-#define FIPNDL_OFF 0x64
+-
+-#define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE)
+-#define IMX_AITC_INTCNTL (VA_AITC_BASE + INTCNTL_OFF)
+-#define IMX_AITC_NIMASK (VA_AITC_BASE + NIMASK_OFF)
+-#define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF)
+-#define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF)
+-#define IMX_AITC_INTENABLEH (VA_AITC_BASE + INTENABLEH_OFF)
+-#define IMX_AITC_INTENABLEL (VA_AITC_BASE + INTENABLEL_OFF)
+-#define IMX_AITC_INTTYPEH (VA_AITC_BASE + INTTYPEH_OFF)
+-#define IMX_AITC_INTTYPEL (VA_AITC_BASE + INTTYPEL_OFF)
+-#define IMX_AITC_NIPRIORITY(x) (VA_AITC_BASE + NIPRIORITY_OFF(x))
+-#define IMX_AITC_NIVECSR (VA_AITC_BASE + NIVECSR_OFF)
+-#define IMX_AITC_FIVECSR (VA_AITC_BASE + FIVECSR_OFF)
+-#define IMX_AITC_INTSRCH (VA_AITC_BASE + INTSRCH_OFF)
+-#define IMX_AITC_INTSRCL (VA_AITC_BASE + INTSRCL_OFF)
+-#define IMX_AITC_INTFRCH (VA_AITC_BASE + INTFRCH_OFF)
+-#define IMX_AITC_INTFRCL (VA_AITC_BASE + INTFRCL_OFF)
+-#define IMX_AITC_NIPNDH (VA_AITC_BASE + NIPNDH_OFF)
+-#define IMX_AITC_NIPNDL (VA_AITC_BASE + NIPNDL_OFF)
+-#define IMX_AITC_FIPNDH (VA_AITC_BASE + FIPNDH_OFF)
+-#define IMX_AITC_FIPNDL (VA_AITC_BASE + FIPNDL_OFF)
+-
+-#if 0
+-#define DEBUG_IRQ(fmt...) printk(fmt)
+-#else
+-#define DEBUG_IRQ(fmt...) do { } while (0)
+-#endif
+-
+-static void
+-imx_mask_irq(unsigned int irq)
+-{
+- __raw_writel(irq, IMX_AITC_INTDISNUM);
+-}
+-
+-static void
+-imx_unmask_irq(unsigned int irq)
+-{
+- __raw_writel(irq, IMX_AITC_INTENNUM);
+-}
+-
+-#ifdef CONFIG_FIQ
+-int imx_set_irq_fiq(unsigned int irq, unsigned int type)
+-{
+- unsigned int irqt;
+-
+- if (irq >= IMX_IRQS)
+- return -EINVAL;
+-
+- if (irq < IMX_IRQS / 2) {
+- irqt = __raw_readl(IMX_AITC_INTTYPEL) & ~(1 << irq);
+- __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEL);
+- } else {
+- irq -= IMX_IRQS / 2;
+- irqt = __raw_readl(IMX_AITC_INTTYPEH) & ~(1 << irq);
+- __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEH);
+- }
+-
+- return 0;
+-}
+-EXPORT_SYMBOL(imx_set_irq_fiq);
+-#endif /* CONFIG_FIQ */
+-
+-static int
+-imx_gpio_irq_type(unsigned int _irq, unsigned int type)
+-{
+- unsigned int irq_type = 0, irq, reg, bit;
+-
+- irq = _irq - IRQ_GPIOA(0);
+- reg = irq >> 5;
+- bit = 1 << (irq % 32);
+-
+- if (type == IRQ_TYPE_PROBE) {
+- /* Don't mess with enabled GPIOs using preconfigured edges or
+- GPIOs set to alternate function during probe */
+- /* TODO: support probe */
+-// if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) &
+-// GPIO_bit(gpio))
+-// return 0;
+-// if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
+-// return 0;
+-// type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
+- }
+-
+- GIUS(reg) |= bit;
+- DDIR(reg) &= ~(bit);
+-
+- DEBUG_IRQ("setting type of irq %d to ", _irq);
+-
+- if (type & IRQ_TYPE_EDGE_RISING) {
+- DEBUG_IRQ("rising edges\n");
+- irq_type = 0x0;
+- }
+- if (type & IRQ_TYPE_EDGE_FALLING) {
+- DEBUG_IRQ("falling edges\n");
+- irq_type = 0x1;
+- }
+- if (type & IRQ_TYPE_LEVEL_LOW) {
+- DEBUG_IRQ("low level\n");
+- irq_type = 0x3;
+- }
+- if (type & IRQ_TYPE_LEVEL_HIGH) {
+- DEBUG_IRQ("high level\n");
+- irq_type = 0x2;
+- }
+-
+- if (irq % 32 < 16) {
+- ICR1(reg) = (ICR1(reg) & ~(0x3 << ((irq % 16) * 2))) |
+- (irq_type << ((irq % 16) * 2));
+- } else {
+- ICR2(reg) = (ICR2(reg) & ~(0x3 << ((irq % 16) * 2))) |
+- (irq_type << ((irq % 16) * 2));
+- }
+-
+- return 0;
+-
+-}
+-
+-static void
+-imx_gpio_ack_irq(unsigned int irq)
+-{
+- DEBUG_IRQ("%s: irq %d\n", __func__, irq);
+- ISR(IRQ_TO_REG(irq)) = 1 << ((irq - IRQ_GPIOA(0)) % 32);
+-}
+-
+-static void
+-imx_gpio_mask_irq(unsigned int irq)
+-{
+- DEBUG_IRQ("%s: irq %d\n", __func__, irq);
+- IMR(IRQ_TO_REG(irq)) &= ~( 1 << ((irq - IRQ_GPIOA(0)) % 32));
+-}
+-
+-static void
+-imx_gpio_unmask_irq(unsigned int irq)
+-{
+- DEBUG_IRQ("%s: irq %d\n", __func__, irq);
+- IMR(IRQ_TO_REG(irq)) |= 1 << ((irq - IRQ_GPIOA(0)) % 32);
+-}
+-
+-static void
+-imx_gpio_handler(unsigned int mask, unsigned int irq,
+- struct irq_desc *desc)
+-{
+- while (mask) {
+- if (mask & 1) {
+- DEBUG_IRQ("handling irq %d\n", irq);
+- generic_handle_irq(irq);
+- }
+- irq++;
+- mask >>= 1;
+- }
+-}
+-
+-static void
+-imx_gpioa_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
+-{
+- unsigned int mask, irq;
+-
+- mask = ISR(0);
+- irq = IRQ_GPIOA(0);
+- imx_gpio_handler(mask, irq, desc);
+-}
+-
+-static void
+-imx_gpiob_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
+-{
+- unsigned int mask, irq;
+-
+- mask = ISR(1);
+- irq = IRQ_GPIOB(0);
+- imx_gpio_handler(mask, irq, desc);
+-}
+-
+-static void
+-imx_gpioc_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
+-{
+- unsigned int mask, irq;
+-
+- mask = ISR(2);
+- irq = IRQ_GPIOC(0);
+- imx_gpio_handler(mask, irq, desc);
+-}
+-
+-static void
+-imx_gpiod_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
+-{
+- unsigned int mask, irq;
+-
+- mask = ISR(3);
+- irq = IRQ_GPIOD(0);
+- imx_gpio_handler(mask, irq, desc);
+-}
+-
+-static struct irq_chip imx_internal_chip = {
+- .name = "MPU",
+- .ack = imx_mask_irq,
+- .mask = imx_mask_irq,
+- .unmask = imx_unmask_irq,
+-};
+-
+-static struct irq_chip imx_gpio_chip = {
+- .name = "GPIO",
+- .ack = imx_gpio_ack_irq,
+- .mask = imx_gpio_mask_irq,
+- .unmask = imx_gpio_unmask_irq,
+- .set_type = imx_gpio_irq_type,
+-};
+-
+-void __init
+-imx_init_irq(void)
+-{
+- unsigned int irq;
+-
+- DEBUG_IRQ("Initializing imx interrupts\n");
+-
+- /* Disable all interrupts initially. */
+- /* Do not rely on the bootloader. */
+- __raw_writel(0, IMX_AITC_INTENABLEH);
+- __raw_writel(0, IMX_AITC_INTENABLEL);
+-
+- /* Mask all GPIO interrupts as well */
+- IMR(0) = 0;
+- IMR(1) = 0;
+- IMR(2) = 0;
+- IMR(3) = 0;
+-
+- for (irq = 0; irq < IMX_IRQS; irq++) {
+- set_irq_chip(irq, &imx_internal_chip);
+- set_irq_handler(irq, handle_level_irq);
+- set_irq_flags(irq, IRQF_VALID);
+- }
+-
+- for (irq = IRQ_GPIOA(0); irq < IRQ_GPIOD(32); irq++) {
+- set_irq_chip(irq, &imx_gpio_chip);
+- set_irq_handler(irq, handle_edge_irq);
+- set_irq_flags(irq, IRQF_VALID);
+- }
+-
+- set_irq_chained_handler(GPIO_INT_PORTA, imx_gpioa_demux_handler);
+- set_irq_chained_handler(GPIO_INT_PORTB, imx_gpiob_demux_handler);
+- set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler);
+- set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler);
+-
+- /* Release masking of interrupts according to priority */
+- __raw_writel(-1, IMX_AITC_NIMASK);
+-
+-#ifdef CONFIG_FIQ
+- /* Initialize FIQ */
+- init_FIQ();
+-#endif
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/Kconfig linux-2.6.30-rc4-git/arch/arm/mach-imx/Kconfig
+--- linux-2.6.30-rc4/arch/arm/mach-imx/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/Kconfig 1970-01-01 01:00:00.000000000 +0100
+@@ -1,11 +0,0 @@
+-menu "IMX Implementations"
+- depends on ARCH_IMX
+-
+-config ARCH_MX1ADS
+- bool "mx1ads"
+- depends on ARCH_IMX
+- select ISA
+- help
+- Say Y here if you are using the Motorola MX1ADS board
+-
+-endmenu
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/leds.c linux-2.6.30-rc4-git/arch/arm/mach-imx/leds.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/leds.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/leds.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,31 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/leds.c
+- *
+- * Copyright (C) 2004 Sascha Hauer <sascha@saschahauer.de>
+- *
+- *
+- * 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 <asm/leds.h>
+-#include <asm/mach-types.h>
+-
+-#include "leds.h"
+-
+-static int __init
+-leds_init(void)
+-{
+- if (machine_is_mx1ads()) {
+- leds_event = mx1ads_leds_event;
+- }
+-
+- return 0;
+-}
+-
+-__initcall(leds_init);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/leds.h linux-2.6.30-rc4-git/arch/arm/mach-imx/leds.h
+--- linux-2.6.30-rc4/arch/arm/mach-imx/leds.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/leds.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,9 +0,0 @@
+-/*
+- * arch/arm/mach-imx/leds.h
+- *
+- * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
+- *
+- * blinky lights for IMX-based systems
+- *
+- */
+-extern void mx1ads_leds_event(led_event_t evt);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/leds-mx1ads.c linux-2.6.30-rc4-git/arch/arm/mach-imx/leds-mx1ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/leds-mx1ads.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/leds-mx1ads.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,53 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/leds-mx1ads.c
+- *
+- * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
+- *
+- * Original (leds-footbridge.c) by Russell King
+- *
+- * 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/io.h>
+-#include <mach/hardware.h>
+-#include <asm/system.h>
+-#include <asm/leds.h>
+-#include "leds.h"
+-
+-/*
+- * The MX1ADS Board has only one usable LED,
+- * so select only the timer led or the
+- * cpu usage led
+- */
+-void
+-mx1ads_leds_event(led_event_t ledevt)
+-{
+- unsigned long flags;
+-
+- local_irq_save(flags);
+-
+- switch (ledevt) {
+-#ifdef CONFIG_LEDS_CPU
+- case led_idle_start:
+- DR(0) &= ~(1<<2);
+- break;
+-
+- case led_idle_end:
+- DR(0) |= 1<<2;
+- break;
+-#endif
+-
+-#ifdef CONFIG_LEDS_TIMER
+- case led_timer:
+- DR(0) ^= 1<<2;
+-#endif
+- default:
+- break;
+- }
+- local_irq_restore(flags);
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/Makefile linux-2.6.30-rc4-git/arch/arm/mach-imx/Makefile
+--- linux-2.6.30-rc4/arch/arm/mach-imx/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/Makefile 1970-01-01 01:00:00.000000000 +0100
+@@ -1,18 +0,0 @@
+-#
+-# Makefile for the linux kernel.
+-#
+-
+-# Object file lists.
+-
+-obj-y += irq.o time.o dma.o generic.o clock.o
+-
+-obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
+-
+-# Specific board support
+-obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o
+-
+-# Support for blinky lights
+-led-y := leds.o
+-
+-obj-$(CONFIG_LEDS) += $(led-y)
+-led-$(CONFIG_ARCH_MX1ADS) += leds-mx1ads.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/Makefile.boot linux-2.6.30-rc4-git/arch/arm/mach-imx/Makefile.boot
+--- linux-2.6.30-rc4/arch/arm/mach-imx/Makefile.boot 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/Makefile.boot 1970-01-01 01:00:00.000000000 +0100
+@@ -1,2 +0,0 @@
+- zreladdr-$(CONFIG_ARCH_MX1ADS) := 0x08008000
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/mx1ads.c linux-2.6.30-rc4-git/arch/arm/mach-imx/mx1ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/mx1ads.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/mx1ads.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,180 +0,0 @@
+-/*
+- * arch/arm/mach-imx/mx1ads.c
+- *
+- * Initially based on:
+- * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
+- * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
+- *
+- * 2004 (c) MontaVista Software, Inc.
+- *
+- * This file is licensed under the terms of the GNU General Public
+- * License version 2. This program is licensed "as is" without any
+- * warranty of any kind, whether express or implied.
+- */
+-
+-#include <linux/device.h>
+-#include <linux/init.h>
+-#include <linux/platform_device.h>
+-#include <asm/system.h>
+-#include <mach/hardware.h>
+-#include <asm/irq.h>
+-#include <asm/pgtable.h>
+-#include <asm/page.h>
+-
+-#include <asm/mach/map.h>
+-#include <asm/mach-types.h>
+-
+-#include <asm/mach/arch.h>
+-#include <mach/mmc.h>
+-#include <mach/imx-uart.h>
+-#include <linux/interrupt.h>
+-#include "generic.h"
+-
+-static struct resource cs89x0_resources[] = {
+- [0] = {
+- .start = IMX_CS4_PHYS + 0x300,
+- .end = IMX_CS4_PHYS + 0x300 + 16,
+- .flags = IORESOURCE_MEM,
+- },
+- [1] = {
+- .start = IRQ_GPIOC(17),
+- .end = IRQ_GPIOC(17),
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static struct platform_device cs89x0_device = {
+- .name = "cirrus-cs89x0",
+- .num_resources = ARRAY_SIZE(cs89x0_resources),
+- .resource = cs89x0_resources,
+-};
+-
+-static struct imxuart_platform_data uart_pdata = {
+- .flags = IMXUART_HAVE_RTSCTS,
+-};
+-
+-static struct resource imx_uart1_resources[] = {
+- [0] = {
+- .start = 0x00206000,
+- .end = 0x002060FF,
+- .flags = IORESOURCE_MEM,
+- },
+- [1] = {
+- .start = (UART1_MINT_RX),
+- .end = (UART1_MINT_RX),
+- .flags = IORESOURCE_IRQ,
+- },
+- [2] = {
+- .start = (UART1_MINT_TX),
+- .end = (UART1_MINT_TX),
+- .flags = IORESOURCE_IRQ,
+- },
+- [3] = {
+- .start = UART1_MINT_RTS,
+- .end = UART1_MINT_RTS,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static struct platform_device imx_uart1_device = {
+- .name = "imx-uart",
+- .id = 0,
+- .num_resources = ARRAY_SIZE(imx_uart1_resources),
+- .resource = imx_uart1_resources,
+- .dev = {
+- .platform_data = &uart_pdata,
+- }
+-};
+-
+-static struct resource imx_uart2_resources[] = {
+- [0] = {
+- .start = 0x00207000,
+- .end = 0x002070FF,
+- .flags = IORESOURCE_MEM,
+- },
+- [1] = {
+- .start = (UART2_MINT_RX),
+- .end = (UART2_MINT_RX),
+- .flags = IORESOURCE_IRQ,
+- },
+- [2] = {
+- .start = (UART2_MINT_TX),
+- .end = (UART2_MINT_TX),
+- .flags = IORESOURCE_IRQ,
+- },
+- [3] = {
+- .start = UART2_MINT_RTS,
+- .end = UART2_MINT_RTS,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static struct platform_device imx_uart2_device = {
+- .name = "imx-uart",
+- .id = 1,
+- .num_resources = ARRAY_SIZE(imx_uart2_resources),
+- .resource = imx_uart2_resources,
+- .dev = {
+- .platform_data = &uart_pdata,
+- }
+-};
+-
+-static struct platform_device *devices[] __initdata = {
+- &cs89x0_device,
+- &imx_uart1_device,
+- &imx_uart2_device,
+-};
+-
+-#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
+-static int mx1ads_mmc_card_present(struct device *dev)
+-{
+- /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
+- return (SSR(1) & (1 << 20) ? 0 : 1);
+-}
+-
+-static struct imxmmc_platform_data mx1ads_mmc_info = {
+- .card_present = mx1ads_mmc_card_present,
+-};
+-#endif
+-
+-static void __init
+-mx1ads_init(void)
+-{
+-#ifdef CONFIG_LEDS
+- imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
+-#endif
+-#if defined(CONFIG_MMC_IMX) || defined(CONFIG_MMC_IMX_MODULE)
+- /* SD/MMC card detect */
+- imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
+- imx_set_mmc_info(&mx1ads_mmc_info);
+-#endif
+-
+- imx_gpio_mode(PC9_PF_UART1_CTS);
+- imx_gpio_mode(PC10_PF_UART1_RTS);
+- imx_gpio_mode(PC11_PF_UART1_TXD);
+- imx_gpio_mode(PC12_PF_UART1_RXD);
+-
+- imx_gpio_mode(PB28_PF_UART2_CTS);
+- imx_gpio_mode(PB29_PF_UART2_RTS);
+- imx_gpio_mode(PB30_PF_UART2_TXD);
+- imx_gpio_mode(PB31_PF_UART2_RXD);
+-
+- platform_add_devices(devices, ARRAY_SIZE(devices));
+-}
+-
+-static void __init
+-mx1ads_map_io(void)
+-{
+- imx_map_io();
+-}
+-
+-MACHINE_START(MX1ADS, "Motorola MX1ADS")
+- /* Maintainer: Sascha Hauer, Pengutronix */
+- .phys_io = 0x00200000,
+- .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
+- .boot_params = 0x08000100,
+- .map_io = mx1ads_map_io,
+- .init_irq = imx_init_irq,
+- .timer = &imx_timer,
+- .init_machine = mx1ads_init,
+-MACHINE_END
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-imx/time.c linux-2.6.30-rc4-git/arch/arm/mach-imx/time.c
+--- linux-2.6.30-rc4/arch/arm/mach-imx/time.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-imx/time.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,220 +0,0 @@
+-/*
+- * linux/arch/arm/mach-imx/time.c
+- *
+- * Copyright (C) 2000-2001 Deep Blue Solutions
+- * Copyright (C) 2002 Shane Nay (shane@minirl.com)
+- * Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.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/sched.h>
+-#include <linux/init.h>
+-#include <linux/interrupt.h>
+-#include <linux/irq.h>
+-#include <linux/time.h>
+-#include <linux/clocksource.h>
+-#include <linux/clockchips.h>
+-#include <linux/clk.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-#include <asm/leds.h>
+-#include <asm/irq.h>
+-#include <asm/mach/time.h>
+-
+-/* Use timer 1 as system timer */
+-#define TIMER_BASE IMX_TIM1_BASE
+-
+-static struct clock_event_device clockevent_imx;
+-static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
+-
+-/*
+- * IRQ handler for the timer
+- */
+-static irqreturn_t
+-imx_timer_interrupt(int irq, void *dev_id)
+-{
+- struct clock_event_device *evt = &clockevent_imx;
+- uint32_t tstat;
+- irqreturn_t ret = IRQ_NONE;
+-
+- /* clear the interrupt */
+- tstat = IMX_TSTAT(TIMER_BASE);
+- IMX_TSTAT(TIMER_BASE) = 0;
+-
+- if (tstat & TSTAT_COMP) {
+- evt->event_handler(evt);
+- ret = IRQ_HANDLED;
+- }
+-
+- return ret;
+-}
+-
+-static struct irqaction imx_timer_irq = {
+- .name = "i.MX Timer Tick",
+- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+- .handler = imx_timer_interrupt,
+-};
+-
+-/*
+- * Set up timer hardware into expected mode and state.
+- */
+-static void __init imx_timer_hardware_init(void)
+-{
+- /*
+- * Initialise to a known state (all timers off, and timing reset)
+- */
+- IMX_TCTL(TIMER_BASE) = 0;
+- IMX_TPRER(TIMER_BASE) = 0;
+-
+- IMX_TCTL(TIMER_BASE) = TCTL_FRR | TCTL_CLK_PCLK1 | TCTL_TEN;
+-}
+-
+-cycle_t imx_get_cycles(struct clocksource *cs)
+-{
+- return IMX_TCN(TIMER_BASE);
+-}
+-
+-static struct clocksource clocksource_imx = {
+- .name = "imx_timer1",
+- .rating = 200,
+- .read = imx_get_cycles,
+- .mask = 0xFFFFFFFF,
+- .shift = 20,
+- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+-};
+-
+-static int __init imx_clocksource_init(unsigned long rate)
+-{
+- clocksource_imx.mult =
+- clocksource_hz2mult(rate, clocksource_imx.shift);
+- clocksource_register(&clocksource_imx);
+-
+- return 0;
+-}
+-
+-static int imx_set_next_event(unsigned long evt,
+- struct clock_event_device *unused)
+-{
+- unsigned long tcmp;
+-
+- tcmp = IMX_TCN(TIMER_BASE) + evt;
+- IMX_TCMP(TIMER_BASE) = tcmp;
+-
+- return (int32_t)(tcmp - IMX_TCN(TIMER_BASE)) < 0 ? -ETIME : 0;
+-}
+-
+-#ifdef DEBUG
+-static const char *clock_event_mode_label[]={
+- [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC",
+- [CLOCK_EVT_MODE_ONESHOT] = "CLOCK_EVT_MODE_ONESHOT",
+- [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN",
+- [CLOCK_EVT_MODE_UNUSED] = "CLOCK_EVT_MODE_UNUSED"
+-};
+-#endif /*DEBUG*/
+-
+-static void imx_set_mode(enum clock_event_mode mode, struct clock_event_device *evt)
+-{
+- unsigned long flags;
+-
+- /*
+- * The timer interrupt generation is disabled at least
+- * for enough time to call imx_set_next_event()
+- */
+- local_irq_save(flags);
+- /* Disable interrupt in GPT module */
+- IMX_TCTL(TIMER_BASE) &= ~TCTL_IRQEN;
+- if (mode != clockevent_mode) {
+- /* Set event time into far-far future */
+- IMX_TCMP(TIMER_BASE) = IMX_TCN(TIMER_BASE) - 3;
+- /* Clear pending interrupt */
+- IMX_TSTAT(TIMER_BASE) &= ~TSTAT_COMP;
+- }
+-
+-#ifdef DEBUG
+- printk(KERN_INFO "imx_set_mode: changing mode from %s to %s\n",
+- clock_event_mode_label[clockevent_mode], clock_event_mode_label[mode]);
+-#endif /*DEBUG*/
+-
+- /* Remember timer mode */
+- clockevent_mode = mode;
+- local_irq_restore(flags);
+-
+- switch (mode) {
+- case CLOCK_EVT_MODE_PERIODIC:
+- printk(KERN_ERR "imx_set_mode: Periodic mode is not supported for i.MX\n");
+- break;
+- case CLOCK_EVT_MODE_ONESHOT:
+- /*
+- * Do not put overhead of interrupt enable/disable into
+- * imx_set_next_event(), the core has about 4 minutes
+- * to call imx_set_next_event() or shutdown clock after
+- * mode switching
+- */
+- local_irq_save(flags);
+- IMX_TCTL(TIMER_BASE) |= TCTL_IRQEN;
+- local_irq_restore(flags);
+- break;
+- case CLOCK_EVT_MODE_SHUTDOWN:
+- case CLOCK_EVT_MODE_UNUSED:
+- case CLOCK_EVT_MODE_RESUME:
+- /* Left event sources disabled, no more interrupts appears */
+- break;
+- }
+-}
+-
+-static struct clock_event_device clockevent_imx = {
+- .name = "imx_timer1",
+- .features = CLOCK_EVT_FEAT_ONESHOT,
+- .shift = 32,
+- .set_mode = imx_set_mode,
+- .set_next_event = imx_set_next_event,
+- .rating = 200,
+-};
+-
+-static int __init imx_clockevent_init(unsigned long rate)
+-{
+- clockevent_imx.mult = div_sc(rate, NSEC_PER_SEC,
+- clockevent_imx.shift);
+- clockevent_imx.max_delta_ns =
+- clockevent_delta2ns(0xfffffffe, &clockevent_imx);
+- clockevent_imx.min_delta_ns =
+- clockevent_delta2ns(0xf, &clockevent_imx);
+-
+- clockevent_imx.cpumask = cpumask_of(0);
+-
+- clockevents_register_device(&clockevent_imx);
+-
+- return 0;
+-}
+-
+-extern int imx_clocks_init(void);
+-
+-static void __init imx_timer_init(void)
+-{
+- struct clk *clk;
+- unsigned long rate;
+-
+- imx_clocks_init();
+-
+- clk = clk_get(NULL, "perclk1");
+- clk_enable(clk);
+- rate = clk_get_rate(clk);
+-
+- imx_timer_hardware_init();
+- imx_clocksource_init(rate);
+-
+- imx_clockevent_init(rate);
+-
+- /*
+- * Make irqs happen for the system timer
+- */
+- setup_irq(TIM1_INT, &imx_timer_irq);
+-}
+-
+-struct sys_timer imx_timer = {
+- .init = imx_timer_init,
+-};
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx1/generic.c linux-2.6.30-rc4-git/arch/arm/mach-mx1/generic.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx1/generic.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx1/generic.c 2009-05-13 09:46:19.000000000 +0200
+@@ -26,6 +26,7 @@
+
+ #include <asm/mach/map.h>
+
++#include <mach/common.h>
+ #include <mach/hardware.h>
+
+ static struct map_desc imx_io_desc[] __initdata = {
+@@ -37,7 +38,9 @@ static struct map_desc imx_io_desc[] __i
+ }
+ };
+
+-void __init mxc_map_io(void)
++void __init mx1_map_io(void)
+ {
++ mxc_set_cpu_type(MXC_CPU_MX1);
++
+ iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx1/mx1ads.c linux-2.6.30-rc4-git/arch/arm/mach-mx1/mx1ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx1/mx1ads.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx1/mx1ads.c 2009-05-13 09:46:19.000000000 +0200
+@@ -12,77 +12,56 @@
+ * warranty of any kind, whether express or implied.
+ */
+
+-#include <linux/kernel.h>
++#include <linux/i2c.h>
++#include <linux/i2c/pcf857x.h>
+ #include <linux/init.h>
++#include <linux/kernel.h>
+ #include <linux/platform_device.h>
+ #include <linux/mtd/physmap.h>
+-#include <linux/i2c.h>
+-#include <linux/i2c/pcf857x.h>
+
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/time.h>
+
+-#include <mach/irqs.h>
+-#include <mach/hardware.h>
+ #include <mach/common.h>
+-#include <mach/imx-uart.h>
+-#include <mach/irqs.h>
++#include <mach/hardware.h>
+ #include <mach/i2c.h>
++#include <mach/imx-uart.h>
+ #include <mach/iomux.h>
++#include <mach/irqs.h>
++
+ #include "devices.h"
+
+-/*
+- * UARTs platform data
+- */
+-static int mxc_uart1_pins[] = {
++static int mx1ads_pins[] = {
++ /* UART1 */
+ PC9_PF_UART1_CTS,
+ PC10_PF_UART1_RTS,
+ PC11_PF_UART1_TXD,
+ PC12_PF_UART1_RXD,
+-};
+-
+-static int uart1_mxc_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins), "UART1");
+-}
+-
+-static int uart1_mxc_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins));
+- return 0;
+-}
+-
+-static int mxc_uart2_pins[] = {
++ /* UART2 */
+ PB28_PF_UART2_CTS,
+ PB29_PF_UART2_RTS,
+ PB30_PF_UART2_TXD,
+ PB31_PF_UART2_RXD,
++ /* I2C */
++ PA15_PF_I2C_SDA,
++ PA16_PF_I2C_SCL,
++ /* SPI */
++ PC13_PF_SPI1_SPI_RDY,
++ PC14_PF_SPI1_SCLK,
++ PC15_PF_SPI1_SS,
++ PC16_PF_SPI1_MISO,
++ PC17_PF_SPI1_MOSI,
+ };
+
+-static int uart2_mxc_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins), "UART2");
+-}
+-
+-static int uart2_mxc_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins));
+- return 0;
+-}
++/*
++ * UARTs platform data
++ */
+
+ static struct imxuart_platform_data uart_pdata[] = {
+ {
+- .init = uart1_mxc_init,
+- .exit = uart1_mxc_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart2_mxc_init,
+- .exit = uart2_mxc_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ },
+ };
+@@ -111,24 +90,6 @@ static struct platform_device flash_devi
+ /*
+ * I2C
+ */
+-
+-static int i2c_pins[] = {
+- PA15_PF_I2C_SDA,
+- PA16_PF_I2C_SCL,
+-};
+-
+-static int i2c_init(struct device *dev)
+-{
+- return mxc_gpio_setup_multiple_pins(i2c_pins,
+- ARRAY_SIZE(i2c_pins), "I2C");
+-}
+-
+-static void i2c_exit(struct device *dev)
+-{
+- mxc_gpio_release_multiple_pins(i2c_pins,
+- ARRAY_SIZE(i2c_pins));
+-}
+-
+ static struct pcf857x_platform_data pcf857x_data[] = {
+ {
+ .gpio_base = 4 * 32,
+@@ -139,8 +100,6 @@ static struct pcf857x_platform_data pcf8
+
+ static struct imxi2c_platform_data mx1ads_i2c_data = {
+ .bitrate = 100000,
+- .init = i2c_init,
+- .exit = i2c_exit,
+ };
+
+ static struct i2c_board_info mx1ads_i2c_devices[] = {
+@@ -160,6 +119,9 @@ static struct i2c_board_info mx1ads_i2c_
+ */
+ static void __init mx1ads_init(void)
+ {
++ mxc_gpio_setup_multiple_pins(mx1ads_pins,
++ ARRAY_SIZE(mx1ads_pins), "mx1ads");
++
+ /* UART */
+ mxc_register_device(&imx_uart1_device, &uart_pdata[0]);
+ mxc_register_device(&imx_uart2_device, &uart_pdata[1]);
+@@ -188,7 +150,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS"
+ .phys_io = IMX_IO_PHYS,
+ .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx1_map_io,
+ .init_irq = mxc_init_irq,
+ .timer = &mx1ads_timer,
+ .init_machine = mx1ads_init,
+@@ -198,7 +160,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS"
+ .phys_io = IMX_IO_PHYS,
+ .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx1_map_io,
+ .init_irq = mxc_init_irq,
+ .timer = &mx1ads_timer,
+ .init_machine = mx1ads_init,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx1/scb9328.c linux-2.6.30-rc4-git/arch/arm/mach-mx1/scb9328.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx1/scb9328.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx1/scb9328.c 2009-05-13 09:46:19.000000000 +0200
+@@ -153,7 +153,7 @@ MACHINE_START(SCB9328, "Synertronixx scb
+ .phys_io = 0x00200000,
+ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
+ .boot_params = 0x08000100,
+- .map_io = mxc_map_io,
++ .map_io = mx1_map_io,
+ .init_irq = mxc_init_irq,
+ .timer = &scb9328_timer,
+ .init_machine = scb9328_init,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/generic.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/generic.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/generic.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/generic.c 2009-05-13 09:46:19.000000000 +0200
+@@ -69,7 +69,17 @@ static struct map_desc mxc_io_desc[] __i
+ * system startup to create static physical to virtual
+ * memory map for the IO modules.
+ */
+-void __init mxc_map_io(void)
++void __init mx21_map_io(void)
+ {
++ mxc_set_cpu_type(MXC_CPU_MX21);
++
+ iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
+ }
++
++void __init mx27_map_io(void)
++{
++ mxc_set_cpu_type(MXC_CPU_MX27);
++
++ iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
++}
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-git/arch/arm/mach-mx2/Kconfig
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -18,6 +18,13 @@ endchoice
+
+ comment "MX2 platforms:"
+
++config MACH_MX21ADS
++ bool "MX21ADS platform"
++ depends on MACH_MX21
++ help
++ Include support for MX21ADS platform. This includes specific
++ configurations for the board and its peripherals.
++
+ config MACH_MX27ADS
+ bool "MX27ADS platform"
+ depends on MACH_MX27
+@@ -46,4 +53,10 @@ config MACH_PCM970_BASEBOARD
+
+ endchoice
+
++config MACH_MX27_3DS
++ bool "MX27PDK platform"
++ depends on MACH_MX27
++ help
++ Include support for MX27PDK platform. This includes specific
++ configurations for the board and its peripherals.
+ endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -11,6 +11,8 @@ obj-$(CONFIG_MACH_MX21) += clock_imx21.o
+ obj-$(CONFIG_MACH_MX27) += cpu_imx27.o
+ obj-$(CONFIG_MACH_MX27) += clock_imx27.o
+
++obj-$(CONFIG_MACH_MX21ADS) += mx21ads.o
+ obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
+ obj-$(CONFIG_MACH_PCM038) += pcm038.o
+ obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
++obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/mx21ads.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx21ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/mx21ads.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx21ads.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,286 @@
++/*
++ * Copyright (C) 2000 Deep Blue Solutions Ltd
++ * Copyright (C) 2002 Shane Nay (shane@minirl.com)
++ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * 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 <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/physmap.h>
++#include <linux/gpio.h>
++#include <mach/common.h>
++#include <mach/hardware.h>
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++#include <asm/mach/map.h>
++#include <mach/imx-uart.h>
++#include <mach/imxfb.h>
++#include <mach/iomux.h>
++#include <mach/mxc_nand.h>
++#include <mach/mmc.h>
++#include <mach/board-mx21ads.h>
++
++#include "devices.h"
++
++static unsigned int mx21ads_pins[] = {
++
++ /* CS8900A */
++ (GPIO_PORTE | GPIO_GPIO | GPIO_IN | 11),
++
++ /* UART1 */
++ PE12_PF_UART1_TXD,
++ PE13_PF_UART1_RXD,
++ PE14_PF_UART1_CTS,
++ PE15_PF_UART1_RTS,
++
++ /* UART3 (IrDA) - only TXD and RXD */
++ PE8_PF_UART3_TXD,
++ PE9_PF_UART3_RXD,
++
++ /* UART4 */
++ PB26_AF_UART4_RTS,
++ PB28_AF_UART4_TXD,
++ PB29_AF_UART4_CTS,
++ PB31_AF_UART4_RXD,
++
++ /* LCDC */
++ PA5_PF_LSCLK,
++ PA6_PF_LD0,
++ PA7_PF_LD1,
++ PA8_PF_LD2,
++ PA9_PF_LD3,
++ PA10_PF_LD4,
++ PA11_PF_LD5,
++ PA12_PF_LD6,
++ PA13_PF_LD7,
++ PA14_PF_LD8,
++ PA15_PF_LD9,
++ PA16_PF_LD10,
++ PA17_PF_LD11,
++ PA18_PF_LD12,
++ PA19_PF_LD13,
++ PA20_PF_LD14,
++ PA21_PF_LD15,
++ PA22_PF_LD16,
++ PA24_PF_REV, /* Sharp panel dedicated signal */
++ PA25_PF_CLS, /* Sharp panel dedicated signal */
++ PA26_PF_PS, /* Sharp panel dedicated signal */
++ PA27_PF_SPL_SPR, /* Sharp panel dedicated signal */
++ PA28_PF_HSYNC,
++ PA29_PF_VSYNC,
++ PA30_PF_CONTRAST,
++ PA31_PF_OE_ACD,
++
++ /* MMC/SDHC */
++ PE18_PF_SD1_D0,
++ PE19_PF_SD1_D1,
++ PE20_PF_SD1_D2,
++ PE21_PF_SD1_D3,
++ PE22_PF_SD1_CMD,
++ PE23_PF_SD1_CLK,
++
++ /* NFC */
++ PF0_PF_NRFB,
++ PF1_PF_NFCE,
++ PF2_PF_NFWP,
++ PF3_PF_NFCLE,
++ PF4_PF_NFALE,
++ PF5_PF_NFRE,
++ PF6_PF_NFWE,
++ PF7_PF_NFIO0,
++ PF8_PF_NFIO1,
++ PF9_PF_NFIO2,
++ PF10_PF_NFIO3,
++ PF11_PF_NFIO4,
++ PF12_PF_NFIO5,
++ PF13_PF_NFIO6,
++ PF14_PF_NFIO7,
++};
++
++/* ADS's NOR flash: 2x AM29BDS128HE9VKI on 32-bit bus */
++static struct physmap_flash_data mx21ads_flash_data = {
++ .width = 4,
++};
++
++static struct resource mx21ads_flash_resource = {
++ .start = CS0_BASE_ADDR,
++ .end = CS0_BASE_ADDR + 0x02000000 - 1,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct platform_device mx21ads_nor_mtd_device = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &mx21ads_flash_data,
++ },
++ .num_resources = 1,
++ .resource = &mx21ads_flash_resource,
++};
++
++static struct imxuart_platform_data uart_pdata = {
++ .flags = IMXUART_HAVE_RTSCTS,
++};
++
++static struct imxuart_platform_data uart_norts_pdata = {
++};
++
++
++static int mx21ads_fb_init(struct platform_device *pdev)
++{
++ u16 tmp;
++
++ tmp = __raw_readw(MX21ADS_IO_REG);
++ tmp |= MX21ADS_IO_LCDON;
++ __raw_writew(tmp, MX21ADS_IO_REG);
++ return 0;
++}
++
++static void mx21ads_fb_exit(struct platform_device *pdev)
++{
++ u16 tmp;
++
++ tmp = __raw_readw(MX21ADS_IO_REG);
++ tmp &= ~MX21ADS_IO_LCDON;
++ __raw_writew(tmp, MX21ADS_IO_REG);
++}
++
++/*
++ * Connected is a portrait Sharp-QVGA display
++ * of type: LQ035Q7DB02
++ */
++static struct imx_fb_platform_data mx21ads_fb_data = {
++ .pixclock = 188679, /* in ps */
++ .xres = 240,
++ .yres = 320,
++
++ .bpp = 16,
++ .hsync_len = 2,
++ .left_margin = 6,
++ .right_margin = 16,
++
++ .vsync_len = 1,
++ .upper_margin = 8,
++ .lower_margin = 10,
++ .fixed_screen_cpu = 0,
++
++ .pcr = 0xFB108BC7,
++ .pwmr = 0x00A901ff,
++ .lscr1 = 0x00120300,
++ .dmacr = 0x00020008,
++
++ .init = mx21ads_fb_init,
++ .exit = mx21ads_fb_exit,
++};
++
++static int mx21ads_sdhc_get_ro(struct device *dev)
++{
++ return (__raw_readw(MX21ADS_IO_REG) & MX21ADS_IO_SD_WP) ? 1 : 0;
++}
++
++static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
++{
++ int ret;
++
++ ret = request_irq(IRQ_GPIOD(25), detect_irq,
++ IRQF_TRIGGER_FALLING, "mmc-detect", data);
++ if (ret)
++ goto out;
++ return 0;
++out:
++ return ret;
++}
++
++static void mx21ads_sdhc_exit(struct device *dev, void *data)
++{
++ free_irq(IRQ_GPIOD(25), data);
++}
++
++static struct imxmmc_platform_data mx21ads_sdhc_pdata = {
++ .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */
++ .get_ro = mx21ads_sdhc_get_ro,
++ .init = mx21ads_sdhc_init,
++ .exit = mx21ads_sdhc_exit,
++};
++
++static struct mxc_nand_platform_data mx21ads_nand_board_info = {
++ .width = 1,
++ .hw_ecc = 1,
++};
++
++static struct map_desc mx21ads_io_desc[] __initdata = {
++ /*
++ * Memory-mapped I/O on MX21ADS Base board:
++ * - CS8900A Ethernet controller
++ * - ST16C2552CJ UART
++ * - CPU and Base board version
++ * - Base board I/O register
++ */
++ {
++ .virtual = MX21ADS_MMIO_BASE_ADDR,
++ .pfn = __phys_to_pfn(CS1_BASE_ADDR),
++ .length = MX21ADS_MMIO_SIZE,
++ .type = MT_DEVICE,
++ },
++};
++
++static void __init mx21ads_map_io(void)
++{
++ mx21_map_io();
++ iotable_init(mx21ads_io_desc, ARRAY_SIZE(mx21ads_io_desc));
++}
++
++static struct platform_device *platform_devices[] __initdata = {
++ &mx21ads_nor_mtd_device,
++};
++
++static void __init mx21ads_board_init(void)
++{
++ mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins),
++ "mx21ads");
++
++ mxc_register_device(&mxc_uart_device0, &uart_pdata);
++ mxc_register_device(&mxc_uart_device2, &uart_norts_pdata);
++ mxc_register_device(&mxc_uart_device3, &uart_pdata);
++ mxc_register_device(&mxc_fb_device, &mx21ads_fb_data);
++ mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata);
++ mxc_register_device(&mxc_nand_device, &mx21ads_nand_board_info);
++
++ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
++}
++
++static void __init mx21ads_timer_init(void)
++{
++ mx21_clocks_init(32768, 26000000);
++}
++
++static struct sys_timer mx21ads_timer = {
++ .init = mx21ads_timer_init,
++};
++
++MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
++ /* maintainer: Freescale Semiconductor, Inc. */
++ .phys_io = AIPI_BASE_ADDR,
++ .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
++ .boot_params = PHYS_OFFSET + 0x100,
++ .map_io = mx21ads_map_io,
++ .init_irq = mxc_init_irq,
++ .init_machine = mx21ads_board_init,
++ .timer = &mx21ads_timer,
++MACHINE_END
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/mx27ads.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx27ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/mx27ads.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx27ads.c 2009-05-13 09:46:19.000000000 +0200
+@@ -23,6 +23,8 @@
+ #include <linux/mtd/map.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/physmap.h>
++#include <linux/i2c.h>
++#include <linux/irq.h>
+ #include <mach/common.h>
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -33,9 +35,117 @@
+ #include <mach/imx-uart.h>
+ #include <mach/iomux.h>
+ #include <mach/board-mx27ads.h>
++#include <mach/mxc_nand.h>
++#include <mach/i2c.h>
++#include <mach/imxfb.h>
++#include <mach/mmc.h>
+
+ #include "devices.h"
+
++static unsigned int mx27ads_pins[] = {
++ /* UART0 */
++ PE12_PF_UART1_TXD,
++ PE13_PF_UART1_RXD,
++ PE14_PF_UART1_CTS,
++ PE15_PF_UART1_RTS,
++ /* UART1 */
++ PE3_PF_UART2_CTS,
++ PE4_PF_UART2_RTS,
++ PE6_PF_UART2_TXD,
++ PE7_PF_UART2_RXD,
++ /* UART2 */
++ PE8_PF_UART3_TXD,
++ PE9_PF_UART3_RXD,
++ PE10_PF_UART3_CTS,
++ PE11_PF_UART3_RTS,
++ /* UART3 */
++ PB26_AF_UART4_RTS,
++ PB28_AF_UART4_TXD,
++ PB29_AF_UART4_CTS,
++ PB31_AF_UART4_RXD,
++ /* UART4 */
++ PB18_AF_UART5_TXD,
++ PB19_AF_UART5_RXD,
++ PB20_AF_UART5_CTS,
++ PB21_AF_UART5_RTS,
++ /* UART5 */
++ PB10_AF_UART6_TXD,
++ PB12_AF_UART6_CTS,
++ PB11_AF_UART6_RXD,
++ PB13_AF_UART6_RTS,
++ /* FEC */
++ PD0_AIN_FEC_TXD0,
++ PD1_AIN_FEC_TXD1,
++ PD2_AIN_FEC_TXD2,
++ PD3_AIN_FEC_TXD3,
++ PD4_AOUT_FEC_RX_ER,
++ PD5_AOUT_FEC_RXD1,
++ PD6_AOUT_FEC_RXD2,
++ PD7_AOUT_FEC_RXD3,
++ PD8_AF_FEC_MDIO,
++ PD9_AIN_FEC_MDC,
++ PD10_AOUT_FEC_CRS,
++ PD11_AOUT_FEC_TX_CLK,
++ PD12_AOUT_FEC_RXD0,
++ PD13_AOUT_FEC_RX_DV,
++ PD14_AOUT_FEC_RX_CLK,
++ PD15_AOUT_FEC_COL,
++ PD16_AIN_FEC_TX_ER,
++ PF23_AIN_FEC_TX_EN,
++ /* I2C2 */
++ PC5_PF_I2C2_SDA,
++ PC6_PF_I2C2_SCL,
++ /* FB */
++ PA5_PF_LSCLK,
++ PA6_PF_LD0,
++ PA7_PF_LD1,
++ PA8_PF_LD2,
++ PA9_PF_LD3,
++ PA10_PF_LD4,
++ PA11_PF_LD5,
++ PA12_PF_LD6,
++ PA13_PF_LD7,
++ PA14_PF_LD8,
++ PA15_PF_LD9,
++ PA16_PF_LD10,
++ PA17_PF_LD11,
++ PA18_PF_LD12,
++ PA19_PF_LD13,
++ PA20_PF_LD14,
++ PA21_PF_LD15,
++ PA22_PF_LD16,
++ PA23_PF_LD17,
++ PA24_PF_REV,
++ PA25_PF_CLS,
++ PA26_PF_PS,
++ PA27_PF_SPL_SPR,
++ PA28_PF_HSYNC,
++ PA29_PF_VSYNC,
++ PA30_PF_CONTRAST,
++ PA31_PF_OE_ACD,
++ /* OWIRE */
++ PE16_AF_OWIRE,
++ /* SDHC1*/
++ PE18_PF_SD1_D0,
++ PE19_PF_SD1_D1,
++ PE20_PF_SD1_D2,
++ PE21_PF_SD1_D3,
++ PE22_PF_SD1_CMD,
++ PE23_PF_SD1_CLK,
++ /* SDHC2*/
++ PB4_PF_SD2_D0,
++ PB5_PF_SD2_D1,
++ PB6_PF_SD2_D2,
++ PB7_PF_SD2_D3,
++ PB8_PF_SD2_CMD,
++ PB9_PF_SD2_CLK,
++};
++
++static struct mxc_nand_platform_data mx27ads_nand_board_info = {
++ .width = 1,
++ .hw_ecc = 1,
++};
++
+ /* ADS's NOR flash */
+ static struct physmap_flash_data mx27ads_flash_data = {
+ .width = 2,
+@@ -58,189 +168,113 @@ static struct platform_device mx27ads_no
+ .resource = &mx27ads_flash_resource,
+ };
+
+-static int mxc_uart0_pins[] = {
+- PE12_PF_UART1_TXD,
+- PE13_PF_UART1_RXD,
+- PE14_PF_UART1_CTS,
+- PE15_PF_UART1_RTS
++static struct imxi2c_platform_data mx27ads_i2c_data = {
++ .bitrate = 100000,
+ };
+
+-static int uart_mxc_port0_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart0_pins,
+- ARRAY_SIZE(mxc_uart0_pins), "UART0");
+-}
+-
+-static int uart_mxc_port0_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart0_pins,
+- ARRAY_SIZE(mxc_uart0_pins));
+- return 0;
+-}
+-
+-static int mxc_uart1_pins[] = {
+- PE3_PF_UART2_CTS,
+- PE4_PF_UART2_RTS,
+- PE6_PF_UART2_TXD,
+- PE7_PF_UART2_RXD
++static struct i2c_board_info mx27ads_i2c_devices[] = {
+ };
+
+-static int uart_mxc_port1_init(struct platform_device *pdev)
++void lcd_power(int on)
+ {
+- return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins), "UART1");
++ if (on)
++ __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
++ else
++ __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
+ }
+
+-static int uart_mxc_port1_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins));
+- return 0;
+-}
++static struct imx_fb_platform_data mx27ads_fb_data = {
++ .pixclock = 188679,
++ .xres = 240,
++ .yres = 320,
+
+-static int mxc_uart2_pins[] = {
+- PE8_PF_UART3_TXD,
+- PE9_PF_UART3_RXD,
+- PE10_PF_UART3_CTS,
+- PE11_PF_UART3_RTS
+-};
++ .bpp = 16,
++ .hsync_len = 1,
++ .left_margin = 9,
++ .right_margin = 16,
+
+-static int uart_mxc_port2_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins), "UART2");
+-}
++ .vsync_len = 1,
++ .upper_margin = 7,
++ .lower_margin = 9,
++ .fixed_screen_cpu = 0,
+
+-static int uart_mxc_port2_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins));
+- return 0;
+-}
++ /*
++ * - HSYNC active high
++ * - VSYNC active high
++ * - clk notenabled while idle
++ * - clock inverted
++ * - data not inverted
++ * - data enable low active
++ * - enable sharp mode
++ */
++ .pcr = 0xFB008BC0,
++ .pwmr = 0x00A903FF,
++ .lscr1 = 0x00120300,
++ .dmacr = 0x00020010,
+
+-static int mxc_uart3_pins[] = {
+- PB26_AF_UART4_RTS,
+- PB28_AF_UART4_TXD,
+- PB29_AF_UART4_CTS,
+- PB31_AF_UART4_RXD
++ .lcd_power = lcd_power,
+ };
+
+-static int uart_mxc_port3_init(struct platform_device *pdev)
++static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
+ {
+- return mxc_gpio_setup_multiple_pins(mxc_uart3_pins,
+- ARRAY_SIZE(mxc_uart3_pins), "UART3");
++ return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING,
++ "sdhc1-card-detect", data);
+ }
+
+-static int uart_mxc_port3_exit(struct platform_device *pdev)
++static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
+ {
+- mxc_gpio_release_multiple_pins(mxc_uart3_pins,
+- ARRAY_SIZE(mxc_uart3_pins));
+- return 0;
++ return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING,
++ "sdhc2-card-detect", data);
+ }
+
+-static int mxc_uart4_pins[] = {
+- PB18_AF_UART5_TXD,
+- PB19_AF_UART5_RXD,
+- PB20_AF_UART5_CTS,
+- PB21_AF_UART5_RTS
+-};
+-
+-static int uart_mxc_port4_init(struct platform_device *pdev)
++static void mx27ads_sdhc1_exit(struct device *dev, void *data)
+ {
+- return mxc_gpio_setup_multiple_pins(mxc_uart4_pins,
+- ARRAY_SIZE(mxc_uart4_pins), "UART4");
++ free_irq(IRQ_GPIOE(21), data);
+ }
+
+-static int uart_mxc_port4_exit(struct platform_device *pdev)
++static void mx27ads_sdhc2_exit(struct device *dev, void *data)
+ {
+- mxc_gpio_release_multiple_pins(mxc_uart4_pins,
+- ARRAY_SIZE(mxc_uart4_pins));
+- return 0;
++ free_irq(IRQ_GPIOB(7), data);
+ }
+
+-static int mxc_uart5_pins[] = {
+- PB10_AF_UART6_TXD,
+- PB12_AF_UART6_CTS,
+- PB11_AF_UART6_RXD,
+- PB13_AF_UART6_RTS
++static struct imxmmc_platform_data sdhc1_pdata = {
++ .init = mx27ads_sdhc1_init,
++ .exit = mx27ads_sdhc1_exit,
+ };
+
+-static int uart_mxc_port5_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart5_pins,
+- ARRAY_SIZE(mxc_uart5_pins), "UART5");
+-}
+-
+-static int uart_mxc_port5_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart5_pins,
+- ARRAY_SIZE(mxc_uart5_pins));
+- return 0;
+-}
++static struct imxmmc_platform_data sdhc2_pdata = {
++ .init = mx27ads_sdhc2_init,
++ .exit = mx27ads_sdhc2_exit,
++};
+
+ static struct platform_device *platform_devices[] __initdata = {
+ &mx27ads_nor_mtd_device,
+ &mxc_fec_device,
++ &mxc_w1_master_device,
+ };
+
+-static int mxc_fec_pins[] = {
+- PD0_AIN_FEC_TXD0,
+- PD1_AIN_FEC_TXD1,
+- PD2_AIN_FEC_TXD2,
+- PD3_AIN_FEC_TXD3,
+- PD4_AOUT_FEC_RX_ER,
+- PD5_AOUT_FEC_RXD1,
+- PD6_AOUT_FEC_RXD2,
+- PD7_AOUT_FEC_RXD3,
+- PD8_AF_FEC_MDIO,
+- PD9_AIN_FEC_MDC,
+- PD10_AOUT_FEC_CRS,
+- PD11_AOUT_FEC_TX_CLK,
+- PD12_AOUT_FEC_RXD0,
+- PD13_AOUT_FEC_RX_DV,
+- PD14_AOUT_FEC_RX_CLK,
+- PD15_AOUT_FEC_COL,
+- PD16_AIN_FEC_TX_ER,
+- PF23_AIN_FEC_TX_EN
+-};
+-
+-static void gpio_fec_active(void)
+-{
+- mxc_gpio_setup_multiple_pins(mxc_fec_pins,
+- ARRAY_SIZE(mxc_fec_pins), "FEC");
+-}
+-
+ static struct imxuart_platform_data uart_pdata[] = {
+ {
+- .init = uart_mxc_port0_init,
+- .exit = uart_mxc_port0_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port1_init,
+- .exit = uart_mxc_port1_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port2_init,
+- .exit = uart_mxc_port2_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port3_init,
+- .exit = uart_mxc_port3_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port4_init,
+- .exit = uart_mxc_port4_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port5_init,
+- .exit = uart_mxc_port5_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ },
+ };
+
+ static void __init mx27ads_board_init(void)
+ {
+- gpio_fec_active();
++ mxc_gpio_setup_multiple_pins(mx27ads_pins, ARRAY_SIZE(mx27ads_pins),
++ "mx27ads");
+
+ mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
+ mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
+@@ -248,6 +282,15 @@ static void __init mx27ads_board_init(vo
+ mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
+ mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
+ mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
++ mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info);
++
++ /* only the i2c master 1 is used on this CPU card */
++ i2c_register_board_info(1, mx27ads_i2c_devices,
++ ARRAY_SIZE(mx27ads_i2c_devices));
++ mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data);
++ mxc_register_device(&mxc_fb_device, &mx27ads_fb_data);
++ mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
++ mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
+
+ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+ }
+@@ -277,7 +320,7 @@ static struct map_desc mx27ads_io_desc[]
+
+ static void __init mx27ads_map_io(void)
+ {
+- mxc_map_io();
++ mx27_map_io();
+ iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc));
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/mx27pdk.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx27pdk.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/mx27pdk.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/mx27pdk.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,95 @@
++/*
++ * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * Author: Fabio Estevam <fabio.estevam@freescale.com>
++ *
++ * 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 <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++#include <mach/hardware.h>
++#include <mach/common.h>
++#include <mach/imx-uart.h>
++#include <mach/iomux.h>
++#include <mach/board-mx27pdk.h>
++
++#include "devices.h"
++
++static unsigned int mx27pdk_pins[] = {
++ /* UART1 */
++ PE12_PF_UART1_TXD,
++ PE13_PF_UART1_RXD,
++ PE14_PF_UART1_CTS,
++ PE15_PF_UART1_RTS,
++ /* FEC */
++ PD0_AIN_FEC_TXD0,
++ PD1_AIN_FEC_TXD1,
++ PD2_AIN_FEC_TXD2,
++ PD3_AIN_FEC_TXD3,
++ PD4_AOUT_FEC_RX_ER,
++ PD5_AOUT_FEC_RXD1,
++ PD6_AOUT_FEC_RXD2,
++ PD7_AOUT_FEC_RXD3,
++ PD8_AF_FEC_MDIO,
++ PD9_AIN_FEC_MDC,
++ PD10_AOUT_FEC_CRS,
++ PD11_AOUT_FEC_TX_CLK,
++ PD12_AOUT_FEC_RXD0,
++ PD13_AOUT_FEC_RX_DV,
++ PD14_AOUT_FEC_RX_CLK,
++ PD15_AOUT_FEC_COL,
++ PD16_AIN_FEC_TX_ER,
++ PF23_AIN_FEC_TX_EN,
++};
++
++static struct imxuart_platform_data uart_pdata = {
++ .flags = IMXUART_HAVE_RTSCTS,
++};
++
++static struct platform_device *platform_devices[] __initdata = {
++ &mxc_fec_device,
++};
++
++static void __init mx27pdk_init(void)
++{
++ mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins),
++ "mx27pdk");
++ mxc_register_device(&mxc_uart_device0, &uart_pdata);
++ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
++}
++
++static void __init mx27pdk_timer_init(void)
++{
++ mx27_clocks_init(26000000);
++}
++
++static struct sys_timer mx27pdk_timer = {
++ .init = mx27pdk_timer_init,
++};
++
++MACHINE_START(MX27_3DS, "Freescale MX27PDK")
++ /* maintainer: Freescale Semiconductor, Inc. */
++ .phys_io = AIPI_BASE_ADDR,
++ .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
++ .boot_params = PHYS_OFFSET + 0x100,
++ .map_io = mxc_map_io,
++ .init_irq = mxc_init_irq,
++ .init_machine = mx27pdk_init,
++ .timer = &mx27pdk_timer,
++MACHINE_END
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/pcm038.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/pcm038.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/pcm038.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/pcm038.c 2009-05-13 09:46:19.000000000 +0200
+@@ -17,28 +17,84 @@
+ * MA 02110-1301, USA.
+ */
+
+-#include <linux/platform_device.h>
+-#include <linux/mtd/physmap.h>
+-#include <linux/mtd/plat-ram.h>
+-#include <linux/io.h>
+ #include <linux/i2c.h>
+ #include <linux/i2c/at24.h>
++#include <linux/io.h>
++#include <linux/mtd/plat-ram.h>
++#include <linux/mtd/physmap.h>
++#include <linux/platform_device.h>
+
+-#include <asm/mach/arch.h>
+ #include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++
++#include <mach/board-pcm038.h>
+ #include <mach/common.h>
+ #include <mach/hardware.h>
+-#include <mach/iomux.h>
+-#ifdef CONFIG_I2C_IMX
+ #include <mach/i2c.h>
+-#endif
+-#include <asm/mach/time.h>
++#include <mach/iomux.h>
+ #include <mach/imx-uart.h>
+-#include <mach/board-pcm038.h>
+ #include <mach/mxc_nand.h>
+
+ #include "devices.h"
+
++static int pcm038_pins[] = {
++ /* UART1 */
++ PE12_PF_UART1_TXD,
++ PE13_PF_UART1_RXD,
++ PE14_PF_UART1_CTS,
++ PE15_PF_UART1_RTS,
++ /* UART2 */
++ PE3_PF_UART2_CTS,
++ PE4_PF_UART2_RTS,
++ PE6_PF_UART2_TXD,
++ PE7_PF_UART2_RXD,
++ /* UART3 */
++ PE8_PF_UART3_TXD,
++ PE9_PF_UART3_RXD,
++ PE10_PF_UART3_CTS,
++ PE11_PF_UART3_RTS,
++ /* FEC */
++ PD0_AIN_FEC_TXD0,
++ PD1_AIN_FEC_TXD1,
++ PD2_AIN_FEC_TXD2,
++ PD3_AIN_FEC_TXD3,
++ PD4_AOUT_FEC_RX_ER,
++ PD5_AOUT_FEC_RXD1,
++ PD6_AOUT_FEC_RXD2,
++ PD7_AOUT_FEC_RXD3,
++ PD8_AF_FEC_MDIO,
++ PD9_AIN_FEC_MDC,
++ PD10_AOUT_FEC_CRS,
++ PD11_AOUT_FEC_TX_CLK,
++ PD12_AOUT_FEC_RXD0,
++ PD13_AOUT_FEC_RX_DV,
++ PD14_AOUT_FEC_RX_CLK,
++ PD15_AOUT_FEC_COL,
++ PD16_AIN_FEC_TX_ER,
++ PF23_AIN_FEC_TX_EN,
++ /* I2C2 */
++ PC5_PF_I2C2_SDA,
++ PC6_PF_I2C2_SCL,
++ /* SPI1 */
++ PD25_PF_CSPI1_RDY,
++ PD27_PF_CSPI1_SS1,
++ PD28_PF_CSPI1_SS0,
++ PD29_PF_CSPI1_SCLK,
++ PD30_PF_CSPI1_MISO,
++ PD31_PF_CSPI1_MOSI,
++ /* SSI1 */
++ PC20_PF_SSI1_FS,
++ PC21_PF_SSI1_RXD,
++ PC22_PF_SSI1_TXD,
++ PC23_PF_SSI1_CLK,
++ /* SSI4 */
++ PC16_PF_SSI4_FS,
++ PC17_PF_SSI4_RXD,
++ PC18_PF_SSI4_TXD,
++ PC19_PF_SSI4_CLK,
++};
++
+ /*
+ * Phytec's PCM038 comes with 2MiB battery buffered SRAM,
+ * 16 bit width
+@@ -88,107 +144,16 @@ static struct platform_device pcm038_nor
+ .resource = &pcm038_flash_resource,
+ };
+
+-static int mxc_uart0_pins[] = {
+- PE12_PF_UART1_TXD,
+- PE13_PF_UART1_RXD,
+- PE14_PF_UART1_CTS,
+- PE15_PF_UART1_RTS
+-};
+-
+-static int uart_mxc_port0_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart0_pins,
+- ARRAY_SIZE(mxc_uart0_pins), "UART0");
+-}
+-
+-static int uart_mxc_port0_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart0_pins,
+- ARRAY_SIZE(mxc_uart0_pins));
+- return 0;
+-}
+-
+-static int mxc_uart1_pins[] = {
+- PE3_PF_UART2_CTS,
+- PE4_PF_UART2_RTS,
+- PE6_PF_UART2_TXD,
+- PE7_PF_UART2_RXD
+-};
+-
+-static int uart_mxc_port1_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins), "UART1");
+-}
+-
+-static int uart_mxc_port1_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart1_pins,
+- ARRAY_SIZE(mxc_uart1_pins));
+- return 0;
+-}
+-
+-static int mxc_uart2_pins[] = { PE8_PF_UART3_TXD,
+- PE9_PF_UART3_RXD,
+- PE10_PF_UART3_CTS,
+- PE11_PF_UART3_RTS };
+-
+-static int uart_mxc_port2_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins), "UART2");
+-}
+-
+-static int uart_mxc_port2_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_uart2_pins,
+- ARRAY_SIZE(mxc_uart2_pins));
+- return 0;
+-}
+-
+ static struct imxuart_platform_data uart_pdata[] = {
+ {
+- .init = uart_mxc_port0_init,
+- .exit = uart_mxc_port0_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port1_init,
+- .exit = uart_mxc_port1_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ }, {
+- .init = uart_mxc_port2_init,
+- .exit = uart_mxc_port2_exit,
+ .flags = IMXUART_HAVE_RTSCTS,
+ },
+ };
+
+-static int mxc_fec_pins[] = {
+- PD0_AIN_FEC_TXD0,
+- PD1_AIN_FEC_TXD1,
+- PD2_AIN_FEC_TXD2,
+- PD3_AIN_FEC_TXD3,
+- PD4_AOUT_FEC_RX_ER,
+- PD5_AOUT_FEC_RXD1,
+- PD6_AOUT_FEC_RXD2,
+- PD7_AOUT_FEC_RXD3,
+- PD8_AF_FEC_MDIO,
+- PD9_AIN_FEC_MDC,
+- PD10_AOUT_FEC_CRS,
+- PD11_AOUT_FEC_TX_CLK,
+- PD12_AOUT_FEC_RXD0,
+- PD13_AOUT_FEC_RX_DV,
+- PD14_AOUT_FEC_RX_CLK,
+- PD15_AOUT_FEC_COL,
+- PD16_AIN_FEC_TX_ER,
+- PF23_AIN_FEC_TX_EN
+-};
+-
+-static void gpio_fec_active(void)
+-{
+- mxc_gpio_setup_multiple_pins(mxc_fec_pins,
+- ARRAY_SIZE(mxc_fec_pins), "FEC");
+-}
+-
+ static struct mxc_nand_platform_data pcm038_nand_board_info = {
+ .width = 1,
+ .hw_ecc = 1,
+@@ -210,27 +175,8 @@ static void __init pcm038_init_sram(void
+ __raw_writel(0x22220a00, CSCR_A(1));
+ }
+
+-#ifdef CONFIG_I2C_IMX
+-static int mxc_i2c1_pins[] = {
+- PC5_PF_I2C2_SDA,
+- PC6_PF_I2C2_SCL
+-};
+-
+-static int pcm038_i2c_1_init(struct device *dev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins),
+- "I2C1");
+-}
+-
+-static void pcm038_i2c_1_exit(struct device *dev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins));
+-}
+-
+ static struct imxi2c_platform_data pcm038_i2c_1_data = {
+ .bitrate = 100000,
+- .init = pcm038_i2c_1_init,
+- .exit = pcm038_i2c_1_exit,
+ };
+
+ static struct at24_platform_data board_eeprom = {
+@@ -253,11 +199,12 @@ static struct i2c_board_info pcm038_i2c_
+ .type = "lm75"
+ }
+ };
+-#endif
+
+ static void __init pcm038_init(void)
+ {
+- gpio_fec_active();
++ mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
++ "PCM038");
++
+ pcm038_init_sram();
+
+ mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
+@@ -267,13 +214,11 @@ static void __init pcm038_init(void)
+ mxc_gpio_mode(PE16_AF_OWIRE);
+ mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info);
+
+-#ifdef CONFIG_I2C_IMX
+ /* only the i2c master 1 is used on this CPU card */
+ i2c_register_board_info(1, pcm038_i2c_devices,
+ ARRAY_SIZE(pcm038_i2c_devices));
+
+ mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data);
+-#endif
+
+ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+
+@@ -295,7 +240,7 @@ MACHINE_START(PCM038, "phyCORE-i.MX27")
+ .phys_io = AIPI_BASE_ADDR,
+ .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx27_map_io,
+ .init_irq = mxc_init_irq,
+ .init_machine = pcm038_init,
+ .timer = &pcm038_timer,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx2/pcm970-baseboard.c linux-2.6.30-rc4-git/arch/arm/mach-mx2/pcm970-baseboard.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx2/pcm970-baseboard.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx2/pcm970-baseboard.c 2009-05-13 09:46:19.000000000 +0200
+@@ -16,71 +16,107 @@
+ * MA 02110-1301, USA.
+ */
+
+-#include <linux/platform_device.h>
+ #include <linux/gpio.h>
+ #include <linux/irq.h>
++#include <linux/platform_device.h>
+
+ #include <asm/mach/arch.h>
+
+-#include <mach/hardware.h>
+ #include <mach/common.h>
+-#include <mach/mmc.h>
+-#include <mach/imxfb.h>
+ #include <mach/iomux.h>
++#include <mach/imxfb.h>
++#include <mach/hardware.h>
++#include <mach/mmc.h>
+
+ #include "devices.h"
+
+-static int pcm970_sdhc2_get_ro(struct device *dev)
+-{
+- return gpio_get_value(GPIO_PORTC + 28);
+-}
+-
+-static int pcm970_sdhc2_pins[] = {
++static int pcm970_pins[] = {
++ /* SDHC */
+ PB4_PF_SD2_D0,
+ PB5_PF_SD2_D1,
+ PB6_PF_SD2_D2,
+ PB7_PF_SD2_D3,
+ PB8_PF_SD2_CMD,
+ PB9_PF_SD2_CLK,
++ GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN, /* card detect */
++ /* display */
++ PA5_PF_LSCLK,
++ PA6_PF_LD0,
++ PA7_PF_LD1,
++ PA8_PF_LD2,
++ PA9_PF_LD3,
++ PA10_PF_LD4,
++ PA11_PF_LD5,
++ PA12_PF_LD6,
++ PA13_PF_LD7,
++ PA14_PF_LD8,
++ PA15_PF_LD9,
++ PA16_PF_LD10,
++ PA17_PF_LD11,
++ PA18_PF_LD12,
++ PA19_PF_LD13,
++ PA20_PF_LD14,
++ PA21_PF_LD15,
++ PA22_PF_LD16,
++ PA23_PF_LD17,
++ PA24_PF_REV,
++ PA25_PF_CLS,
++ PA26_PF_PS,
++ PA27_PF_SPL_SPR,
++ PA28_PF_HSYNC,
++ PA29_PF_VSYNC,
++ PA30_PF_CONTRAST,
++ PA31_PF_OE_ACD,
++ /*
++ * it seems the data line misses a pullup, so we must enable
++ * the internal pullup as a local workaround
++ */
++ PD17_PF_I2C_DATA | GPIO_PUEN,
++ PD18_PF_I2C_CLK,
++ /* Camera */
++ PB10_PF_CSI_D0,
++ PB11_PF_CSI_D1,
++ PB12_PF_CSI_D2,
++ PB13_PF_CSI_D3,
++ PB14_PF_CSI_D4,
++ PB15_PF_CSI_MCLK,
++ PB16_PF_CSI_PIXCLK,
++ PB17_PF_CSI_D5,
++ PB18_PF_CSI_D6,
++ PB19_PF_CSI_D7,
++ PB20_PF_CSI_VSYNC,
++ PB21_PF_CSI_HSYNC,
+ };
+
++static int pcm970_sdhc2_get_ro(struct device *dev)
++{
++ return gpio_get_value(GPIO_PORTC + 28);
++}
++
+ static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data)
+ {
+ int ret;
+
+- ret = mxc_gpio_setup_multiple_pins(pcm970_sdhc2_pins,
+- ARRAY_SIZE(pcm970_sdhc2_pins), "sdhc2");
+- if(ret)
+- return ret;
+-
+- ret = request_irq(IRQ_GPIOC(29), detect_irq, 0,
++ ret = request_irq(IRQ_GPIOC(29), detect_irq, IRQF_TRIGGER_FALLING,
+ "imx-mmc-detect", data);
+ if (ret)
+- goto out_release_gpio;
+-
+- set_irq_type(IRQ_GPIOC(29), IRQF_TRIGGER_FALLING);
++ return ret;
+
+ ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro");
+- if (ret)
+- goto out_release_gpio;
++ if (ret) {
++ free_irq(IRQ_GPIOC(29), data);
++ return ret;
++ }
+
+- mxc_gpio_mode((GPIO_PORTC | 28) | GPIO_GPIO | GPIO_IN);
+ gpio_direction_input(GPIO_PORTC + 28);
+
+ return 0;
+-
+-out_release_gpio:
+- mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
+- ARRAY_SIZE(pcm970_sdhc2_pins));
+- return ret;
+ }
+
+ static void pcm970_sdhc2_exit(struct device *dev, void *data)
+ {
+ free_irq(IRQ_GPIOC(29), data);
+ gpio_free(GPIO_PORTC + 28);
+- mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
+- ARRAY_SIZE(pcm970_sdhc2_pins));
+ }
+
+ static struct imxmmc_platform_data sdhc_pdata = {
+@@ -89,29 +125,6 @@ static struct imxmmc_platform_data sdhc_
+ .exit = pcm970_sdhc2_exit,
+ };
+
+-static int mxc_fb_pins[] = {
+- PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2,
+- PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6,
+- PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10,
+- PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14,
+- PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV,
+- PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC,
+- PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD
+-};
+-
+-static int pcm038_fb_init(struct platform_device *pdev)
+-{
+- return mxc_gpio_setup_multiple_pins(mxc_fb_pins,
+- ARRAY_SIZE(mxc_fb_pins), "FB");
+-}
+-
+-static int pcm038_fb_exit(struct platform_device *pdev)
+-{
+- mxc_gpio_release_multiple_pins(mxc_fb_pins, ARRAY_SIZE(mxc_fb_pins));
+-
+- return 0;
+-}
+-
+ /*
+ * Connected is a portrait Sharp-QVGA display
+ * of type: LQ035Q7DH06
+@@ -144,9 +157,6 @@ static struct imx_fb_platform_data pcm03
+ .pwmr = 0x00A903FF,
+ .lscr1 = 0x00120300,
+ .dmacr = 0x00020010,
+-
+- .init = pcm038_fb_init,
+- .exit = pcm038_fb_exit,
+ };
+
+ /*
+@@ -157,6 +167,9 @@ static struct imx_fb_platform_data pcm03
+ */
+ void __init pcm970_baseboard_init(void)
+ {
++ mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins),
++ "PCM970");
++
+ mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
+ mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/clock.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/clock.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock.c 2009-05-13 09:46:19.000000000 +0200
+@@ -566,8 +566,6 @@ int __init mx31_clocks_init(unsigned lon
+ u32 reg;
+ int i;
+
+- mxc_set_cpu_type(MXC_CPU_MX31);
+-
+ ckih_rate = fref;
+
+ for (i = 0; i < ARRAY_SIZE(lookups); i++)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/clock-imx35.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock-imx35.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/clock-imx35.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock-imx35.c 2009-05-13 09:46:19.000000000 +0200
+@@ -147,34 +147,16 @@ static struct arm_ahb_div clk_consumer[]
+ { .arm = 0, .ahb = 0, .sel = 0},
+ };
+
+-static struct arm_ahb_div clk_automotive[] = {
+- { .arm = 1, .ahb = 3, .sel = 0},
+- { .arm = 1, .ahb = 2, .sel = 1},
+- { .arm = 2, .ahb = 1, .sel = 1},
+- { .arm = 0, .ahb = 0, .sel = 0},
+- { .arm = 1, .ahb = 6, .sel = 0},
+- { .arm = 1, .ahb = 4, .sel = 1},
+- { .arm = 2, .ahb = 2, .sel = 1},
+- { .arm = 0, .ahb = 0, .sel = 0},
+-};
+-
+ static unsigned long get_rate_arm(void)
+ {
+ unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
+ struct arm_ahb_div *aad;
+ unsigned long fref = get_rate_mpll();
+
+- if (pdr0 & 1) {
+- /* consumer path */
+- aad = &clk_consumer[(pdr0 >> 16) & 0xf];
+- if (aad->sel)
+- fref = fref * 2 / 3;
+- } else {
+- /* auto path */
+- aad = &clk_automotive[(pdr0 >> 9) & 0x7];
+- if (aad->sel)
+- fref = fref * 3 / 4;
+- }
++ aad = &clk_consumer[(pdr0 >> 16) & 0xf];
++ if (aad->sel)
++ fref = fref * 2 / 3;
++
+ return fref / aad->arm;
+ }
+
+@@ -184,12 +166,7 @@ static unsigned long get_rate_ahb(struct
+ struct arm_ahb_div *aad;
+ unsigned long fref = get_rate_mpll();
+
+- if (pdr0 & 1)
+- /* consumer path */
+- aad = &clk_consumer[(pdr0 >> 16) & 0xf];
+- else
+- /* auto path */
+- aad = &clk_automotive[(pdr0 >> 9) & 0x7];
++ aad = &clk_consumer[(pdr0 >> 16) & 0xf];
+
+ return fref / aad->ahb;
+ }
+@@ -430,7 +407,8 @@ static struct clk_lookup lookups[] __ini
+ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
+ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk)
+ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk)
+- _REGISTER_CLOCK(NULL, "ipu", ipu_clk)
++ _REGISTER_CLOCK("ipu-core", NULL, ipu_clk)
++ _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk)
+ _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
+ _REGISTER_CLOCK(NULL, "mlb", mlb_clk)
+ _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
+@@ -462,8 +440,6 @@ int __init mx35_clocks_init()
+ int i;
+ unsigned int ll = 0;
+
+- mxc_set_cpu_type(MXC_CPU_MX35);
+-
+ #ifdef CONFIG_DEBUG_LL_CONSOLE
+ ll = (3 << 16);
+ #endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/devices.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/devices.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/devices.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/devices.c 2009-05-13 09:46:19.000000000 +0200
+@@ -17,13 +17,17 @@
+ * Boston, MA 02110-1301, USA.
+ */
+
++#include <linux/dma-mapping.h>
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/serial.h>
+ #include <linux/gpio.h>
++#include <linux/dma-mapping.h>
+ #include <mach/hardware.h>
+ #include <mach/irqs.h>
++#include <mach/common.h>
+ #include <mach/imx-uart.h>
++#include <mach/mx3_camera.h>
+
+ #include "devices.h"
+
+@@ -283,6 +287,21 @@ struct platform_device mxcsdhc_device1 =
+ .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
+ .resource = mxcsdhc1_resources,
+ };
++
++static struct resource rnga_resources[] = {
++ {
++ .start = RNGA_BASE_ADDR,
++ .end = RNGA_BASE_ADDR + 0x28,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++struct platform_device mxc_rnga_device = {
++ .name = "mxc_rnga",
++ .id = -1,
++ .num_resources = 1,
++ .resource = rnga_resources,
++};
+ #endif /* CONFIG_ARCH_MX31 */
+
+ /* i.MX31 Image Processing Unit */
+@@ -329,10 +348,54 @@ struct platform_device mx3_fb = {
+ .num_resources = ARRAY_SIZE(fb_resources),
+ .resource = fb_resources,
+ .dev = {
+- .coherent_dma_mask = 0xffffffff,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
+ },
+ };
+
++static struct resource camera_resources[] = {
++ {
++ .start = IPU_CTRL_BASE_ADDR + 0x60,
++ .end = IPU_CTRL_BASE_ADDR + 0x87,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++struct platform_device mx3_camera = {
++ .name = "mx3-camera",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(camera_resources),
++ .resource = camera_resources,
++ .dev = {
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++};
++
++static struct resource otg_resources[] = {
++ {
++ .start = OTG_BASE_ADDR,
++ .end = OTG_BASE_ADDR + 0x1ff,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = MXC_INT_USB3,
++ .end = MXC_INT_USB3,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 otg_dmamask = DMA_BIT_MASK(32);
++
++/* OTG gadget device */
++struct platform_device mxc_otg_udc_device = {
++ .name = "fsl-usb2-udc",
++ .id = -1,
++ .dev = {
++ .dma_mask = &otg_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++ .resource = otg_resources,
++ .num_resources = ARRAY_SIZE(otg_resources),
++};
++
+ #ifdef CONFIG_ARCH_MX35
+ static struct resource mxc_fec_resources[] = {
+ {
+@@ -359,6 +422,7 @@ static int mx3_devices_init(void)
+ if (cpu_is_mx31()) {
+ mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR;
+ mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff;
++ mxc_register_device(&mxc_rnga_device, NULL);
+ }
+ if (cpu_is_mx35()) {
+ mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/devices.h linux-2.6.30-rc4-git/arch/arm/mach-mx3/devices.h
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/devices.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/devices.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,6 +11,8 @@ extern struct platform_device mxc_i2c_de
+ extern struct platform_device mxc_i2c_device2;
+ extern struct platform_device mx3_ipu;
+ extern struct platform_device mx3_fb;
++extern struct platform_device mx3_camera;
+ extern struct platform_device mxc_fec_device;
+ extern struct platform_device mxcsdhc_device0;
+ extern struct platform_device mxcsdhc_device1;
++extern struct platform_device mxc_otg_udc_device;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/iomux.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/iomux.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/iomux.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/iomux.c 2009-05-13 09:46:19.000000000 +0200
+@@ -21,7 +21,6 @@
+ #include <linux/module.h>
+ #include <linux/spinlock.h>
+ #include <linux/io.h>
+-#include <linux/gpio.h>
+ #include <linux/kernel.h>
+ #include <mach/hardware.h>
+ #include <mach/gpio.h>
+@@ -94,15 +93,13 @@ void mxc_iomux_set_pad(enum iomux_pins p
+ EXPORT_SYMBOL(mxc_iomux_set_pad);
+
+ /*
+- * setups a single pin:
++ * allocs a single pin:
+ * - reserves the pin so that it is not claimed by another driver
+ * - setups the iomux according to the configuration
+- * - if the pin is configured as a GPIO, we claim it through kernel gpiolib
+ */
+-int mxc_iomux_setup_pin(const unsigned int pin, const char *label)
++int mxc_iomux_alloc_pin(const unsigned int pin, const char *label)
+ {
+ unsigned pad = pin & IOMUX_PADNUM_MASK;
+- unsigned gpio;
+
+ if (pad >= (PIN_MAX + 1)) {
+ printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n",
+@@ -113,19 +110,13 @@ int mxc_iomux_setup_pin(const unsigned i
+ if (test_and_set_bit(pad, mxc_pin_alloc_map)) {
+ printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n",
+ pad, label ? label : "?");
+- return -EINVAL;
++ return -EBUSY;
+ }
+ mxc_iomux_mode(pin);
+
+- /* if we have a gpio, we can allocate it */
+- gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
+- if (gpio < (GPIO_PORT_MAX + 1) * 32)
+- if (gpio_request(gpio, label))
+- return -EINVAL;
+-
+ return 0;
+ }
+-EXPORT_SYMBOL(mxc_iomux_setup_pin);
++EXPORT_SYMBOL(mxc_iomux_alloc_pin);
+
+ int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
+ const char *label)
+@@ -135,7 +126,8 @@ int mxc_iomux_setup_multiple_pins(unsign
+ int ret = -EINVAL;
+
+ for (i = 0; i < count; i++) {
+- if (mxc_iomux_setup_pin(*p, label))
++ ret = mxc_iomux_alloc_pin(*p, label);
++ if (ret)
+ goto setup_error;
+ p++;
+ }
+@@ -150,14 +142,9 @@ EXPORT_SYMBOL(mxc_iomux_setup_multiple_p
+ void mxc_iomux_release_pin(const unsigned int pin)
+ {
+ unsigned pad = pin & IOMUX_PADNUM_MASK;
+- unsigned gpio;
+
+ if (pad < (PIN_MAX + 1))
+ clear_bit(pad, mxc_pin_alloc_map);
+-
+- gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
+- if (gpio < (GPIO_PORT_MAX + 1) * 32)
+- gpio_free(gpio);
+ }
+ EXPORT_SYMBOL(mxc_iomux_release_pin);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/Kconfig linux-2.6.30-rc4-git/arch/arm/mach-mx3/Kconfig
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -1,10 +1,12 @@
+ if ARCH_MX3
+
+ config ARCH_MX31
++ select ARCH_HAS_RNGA
+ bool
+
+ config ARCH_MX35
+ bool
++ select ARCH_MXC_IOMUX_V3
+
+ comment "MX3 platforms:"
+
+@@ -66,4 +68,11 @@ config MACH_QONG
+ Include support for Dave/DENX QongEVB-LITE platform. This includes
+ specific configurations for the board and its peripherals.
+
++config MACH_PCM043
++ bool "Support Phytec pcm043 (i.MX35) platforms"
++ select ARCH_MX35
++ help
++ Include support for Phytec pcm043 platform. This includes
++ specific configurations for the board and its peripherals.
++
+ endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/Makefile linux-2.6.30-rc4-git/arch/arm/mach-mx3/Makefile
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -14,3 +14,4 @@ obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
+ obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
+ mx31moboard-marxbot.o
+ obj-$(CONFIG_MACH_QONG) += qong.o
++obj-$(CONFIG_MACH_PCM043) += pcm043.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mm.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mm.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mm.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mm.c 2009-05-13 09:46:19.000000000 +0200
+@@ -72,8 +72,17 @@ static struct map_desc mxc_io_desc[] __i
+ * system startup to create static physical to virtual memory mappings
+ * for the IO modules.
+ */
+-void __init mxc_map_io(void)
++void __init mx31_map_io(void)
+ {
++ mxc_set_cpu_type(MXC_CPU_MX31);
++
++ iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
++}
++
++void __init mx35_map_io(void)
++{
++ mxc_set_cpu_type(MXC_CPU_MX35);
++
+ iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31ads.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31ads.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31ads.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31ads.c 2009-05-13 09:46:19.000000000 +0200
+@@ -187,7 +187,7 @@ static void __init mx31ads_init_expio(vo
+ /*
+ * Configure INT line as GPIO input
+ */
+- mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio");
++ mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio");
+
+ /* disable the interrupt and clear the status */
+ __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
+@@ -511,7 +511,7 @@ static struct map_desc mx31ads_io_desc[]
+ */
+ static void __init mx31ads_map_io(void)
+ {
+- mxc_map_io();
++ mx31_map_io();
+ iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31lite.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31lite.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31lite.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31lite.c 2009-05-13 09:46:19.000000000 +0200
+@@ -22,6 +22,9 @@
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/memory.h>
++#include <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <linux/smsc911x.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -32,11 +35,58 @@
+ #include <asm/page.h>
+ #include <asm/setup.h>
+ #include <mach/board-mx31lite.h>
++#include <mach/imx-uart.h>
++#include <mach/iomux-mx3.h>
++#include <mach/irqs.h>
++#include "devices.h"
+
+ /*
+ * This file contains the board-specific initialization routines.
+ */
+
++static unsigned int mx31lite_pins[] = {
++ /* UART1 */
++ MX31_PIN_CTS1__CTS1,
++ MX31_PIN_RTS1__RTS1,
++ MX31_PIN_TXD1__TXD1,
++ MX31_PIN_RXD1__RXD1,
++ /* LAN9117 IRQ pin */
++ IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
++};
++
++static struct imxuart_platform_data uart_pdata = {
++ .flags = IMXUART_HAVE_RTSCTS,
++};
++
++static struct smsc911x_platform_config smsc911x_config = {
++ .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
++ .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
++ .flags = SMSC911X_USE_16BIT,
++};
++
++static struct resource smsc911x_resources[] = {
++ [0] = {
++ .start = CS4_BASE_ADDR,
++ .end = CS4_BASE_ADDR + 0x100,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
++ .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device smsc911x_device = {
++ .name = "smsc911x",
++ .id = -1,
++ .num_resources = ARRAY_SIZE(smsc911x_resources),
++ .resource = smsc911x_resources,
++ .dev = {
++ .platform_data = &smsc911x_config,
++ },
++};
++
+ /*
+ * This structure defines the MX31 memory map.
+ */
+@@ -59,7 +109,7 @@ static struct map_desc mx31lite_io_desc[
+ */
+ void __init mx31lite_map_io(void)
+ {
+- mxc_map_io();
++ mx31_map_io();
+ iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
+ }
+
+@@ -68,6 +118,21 @@ void __init mx31lite_map_io(void)
+ */
+ static void __init mxc_board_init(void)
+ {
++ int ret;
++
++ mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
++ "mx31lite");
++
++ mxc_register_device(&mxc_uart_device0, &uart_pdata);
++
++ /* SMSC9117 IRQ pin */
++ ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
++ if (ret)
++ pr_warning("could not get LAN irq gpio\n");
++ else {
++ gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
++ platform_device_register(&smsc911x_device);
++ }
+ }
+
+ static void __init mx31lite_timer_init(void)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard.c 2009-05-13 09:46:19.000000000 +0200
+@@ -16,26 +16,47 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+-#include <linux/types.h>
++#include <linux/gpio.h>
+ #include <linux/init.h>
+-
+-#include <linux/platform_device.h>
++#include <linux/interrupt.h>
++#include <linux/memory.h>
+ #include <linux/mtd/physmap.h>
+ #include <linux/mtd/partitions.h>
+-#include <linux/memory.h>
++#include <linux/platform_device.h>
++#include <linux/types.h>
+
+-#include <mach/hardware.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/time.h>
+ #include <asm/mach/map.h>
++#include <mach/board-mx31moboard.h>
+ #include <mach/common.h>
++#include <mach/hardware.h>
+ #include <mach/imx-uart.h>
+ #include <mach/iomux-mx3.h>
+-#include <mach/board-mx31moboard.h>
++#include <mach/i2c.h>
++#include <mach/mmc.h>
+
+ #include "devices.h"
+
++static unsigned int moboard_pins[] = {
++ /* UART0 */
++ MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
++ MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
++ /* UART4 */
++ MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
++ MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
++ /* I2C0 */
++ MX31_PIN_I2C_DAT__I2C1_SDA, MX31_PIN_I2C_CLK__I2C1_SCL,
++ /* I2C1 */
++ MX31_PIN_DCD_DTE1__I2C2_SDA, MX31_PIN_RI_DTE1__I2C2_SCL,
++ /* SDHC1 */
++ MX31_PIN_SD1_DATA3__SD1_DATA3, MX31_PIN_SD1_DATA2__SD1_DATA2,
++ MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0,
++ MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD,
++ MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27,
++};
++
+ static struct physmap_flash_data mx31moboard_flash_data = {
+ .width = 2,
+ };
+@@ -60,17 +81,69 @@ static struct imxuart_platform_data uart
+ .flags = IMXUART_HAVE_RTSCTS,
+ };
+
+-static struct platform_device *devices[] __initdata = {
+- &mx31moboard_flash,
++static struct imxi2c_platform_data moboard_i2c0_pdata = {
++ .bitrate = 400000,
+ };
+
+-static int mxc_uart0_pins[] = {
+- MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
+- MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
++static struct imxi2c_platform_data moboard_i2c1_pdata = {
++ .bitrate = 100000,
+ };
+-static int mxc_uart4_pins[] = {
+- MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
+- MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
++
++#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0)
++#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1)
++
++static int moboard_sdhc1_get_ro(struct device *dev)
++{
++ return gpio_get_value(SDHC1_WP);
++}
++
++static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
++{
++ int ret;
++
++ ret = gpio_request(SDHC1_CD, "sdhc-detect");
++ if (ret)
++ return ret;
++
++ gpio_direction_input(SDHC1_CD);
++
++ ret = gpio_request(SDHC1_WP, "sdhc-wp");
++ if (ret)
++ goto err_gpio_free;
++ gpio_direction_input(SDHC1_WP);
++
++ ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
++ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
++ "sdhc1-card-detect", data);
++ if (ret)
++ goto err_gpio_free_2;
++
++ return 0;
++
++err_gpio_free_2:
++ gpio_free(SDHC1_WP);
++err_gpio_free:
++ gpio_free(SDHC1_CD);
++
++ return ret;
++}
++
++static void moboard_sdhc1_exit(struct device *dev, void *data)
++{
++ free_irq(gpio_to_irq(SDHC1_CD), data);
++ gpio_free(SDHC1_WP);
++ gpio_free(SDHC1_CD);
++}
++
++static struct imxmmc_platform_data sdhc1_pdata = {
++ .get_ro = moboard_sdhc1_get_ro,
++ .init = moboard_sdhc1_init,
++ .exit = moboard_sdhc1_exit,
++};
++
++static struct platform_device *devices[] __initdata = {
++ &mx31moboard_flash,
+ };
+
+ static int mx31moboard_baseboard;
+@@ -81,14 +154,19 @@ core_param(mx31moboard_baseboard, mx31mo
+ */
+ static void __init mxc_board_init(void)
+ {
++ mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
++ "moboard");
++
+ platform_add_devices(devices, ARRAY_SIZE(devices));
+
+- mxc_iomux_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "uart0");
+ mxc_register_device(&mxc_uart_device0, &uart_pdata);
+-
+- mxc_iomux_setup_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins), "uart4");
+ mxc_register_device(&mxc_uart_device4, &uart_pdata);
+
++ mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
++ mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
++
++ mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata);
++
+ switch (mx31moboard_baseboard) {
+ case MX31NOBOARD:
+ break;
+@@ -99,7 +177,8 @@ static void __init mxc_board_init(void)
+ mx31moboard_marxbot_init();
+ break;
+ default:
+- printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n", mx31moboard_baseboard);
++ printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n",
++ mx31moboard_baseboard);
+ }
+ }
+
+@@ -117,7 +196,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots
+ .phys_io = AIPS1_BASE_ADDR,
+ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx31_map_io,
+ .init_irq = mxc_init_irq,
+ .init_machine = mxc_board_init,
+ .timer = &mx31moboard_timer,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard-devboard.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard-devboard.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard-devboard.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard-devboard.c 2009-05-13 09:46:19.000000000 +0200
+@@ -16,33 +16,142 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+-#include <linux/types.h>
++#include <linux/fsl_devices.h>
++#include <linux/gpio.h>
+ #include <linux/init.h>
+-
++#include <linux/interrupt.h>
+ #include <linux/platform_device.h>
++#include <linux/types.h>
+
+-#include <mach/hardware.h>
+ #include <mach/common.h>
+ #include <mach/imx-uart.h>
+ #include <mach/iomux-mx3.h>
++#include <mach/hardware.h>
++#include <mach/mmc.h>
+
+ #include "devices.h"
+
++static unsigned int devboard_pins[] = {
++ /* UART1 */
++ MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
++ MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
++ /* SDHC2 */
++ MX31_PIN_PC_PWRON__SD2_DATA3, MX31_PIN_PC_VS1__SD2_DATA2,
++ MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
++ MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
++ MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
++ /* USB OTG */
++ MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
++ MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
++ MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
++ MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
++ MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
++ MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
++ MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
++ MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
++ MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
++ MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
++ MX31_PIN_USB_OC__GPIO1_30,
++};
++
+ static struct imxuart_platform_data uart_pdata = {
+ .flags = IMXUART_HAVE_RTSCTS,
+ };
+
+-static int mxc_uart1_pins[] = {
+- MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
+- MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
++#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
++#define SDHC2_WP IOMUX_TO_GPIO(MX31_PIN_ATA_DIOW)
++
++static int devboard_sdhc2_get_ro(struct device *dev)
++{
++ return gpio_get_value(SDHC2_WP);
++}
++
++static int devboard_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
++{
++ int ret;
++
++ ret = gpio_request(SDHC2_CD, "sdhc-detect");
++ if (ret)
++ return ret;
++
++ gpio_direction_input(SDHC2_CD);
++
++ ret = gpio_request(SDHC2_WP, "sdhc-wp");
++ if (ret)
++ goto err_gpio_free;
++ gpio_direction_input(SDHC2_WP);
++
++ ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
++ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
++ "sdhc2-card-detect", data);
++ if (ret)
++ goto err_gpio_free_2;
++
++ return 0;
++
++err_gpio_free_2:
++ gpio_free(SDHC2_WP);
++err_gpio_free:
++ gpio_free(SDHC2_CD);
++
++ return ret;
++}
++
++static void devboard_sdhc2_exit(struct device *dev, void *data)
++{
++ free_irq(gpio_to_irq(SDHC2_CD), data);
++ gpio_free(SDHC2_WP);
++ gpio_free(SDHC2_CD);
++}
++
++static struct imxmmc_platform_data sdhc2_pdata = {
++ .get_ro = devboard_sdhc2_get_ro,
++ .init = devboard_sdhc2_init,
++ .exit = devboard_sdhc2_exit,
++};
++
++static struct fsl_usb2_platform_data usb_pdata = {
++ .operating_mode = FSL_USB2_DR_DEVICE,
++ .phy_mode = FSL_USB2_PHY_ULPI,
+ };
+
++#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
++#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
++
++static void devboard_usbotg_init(void)
++{
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
++
++ gpio_request(OTG_EN_B, "usb-udc-en");
++ gpio_direction_output(OTG_EN_B, 0);
++}
++
+ /*
+ * system init for baseboard usage. Will be called by mx31moboard init.
+ */
+ void __init mx31moboard_devboard_init(void)
+ {
+ printk(KERN_INFO "Initializing mx31devboard peripherals\n");
+- mxc_iomux_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "uart1");
++
++ mxc_iomux_setup_multiple_pins(devboard_pins, ARRAY_SIZE(devboard_pins),
++ "devboard");
++
+ mxc_register_device(&mxc_uart_device1, &uart_pdata);
++
++ mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
++
++ devboard_usbotg_init();
++ mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard-marxbot.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard-marxbot.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31moboard-marxbot.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31moboard-marxbot.c 2009-05-13 09:46:19.000000000 +0200
+@@ -16,22 +16,144 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+-#include <linux/types.h>
++#include <linux/fsl_devices.h>
++#include <linux/gpio.h>
+ #include <linux/init.h>
+-
++#include <linux/interrupt.h>
+ #include <linux/platform_device.h>
++#include <linux/types.h>
+
+-#include <mach/hardware.h>
+ #include <mach/common.h>
++#include <mach/hardware.h>
+ #include <mach/imx-uart.h>
+ #include <mach/iomux-mx3.h>
++#include <mach/mmc.h>
+
+ #include "devices.h"
+
++static unsigned int marxbot_pins[] = {
++ /* SDHC2 */
++ MX31_PIN_PC_PWRON__SD2_DATA3, MX31_PIN_PC_VS1__SD2_DATA2,
++ MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
++ MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
++ MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
++ /* CSI */
++ MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
++ MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
++ MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
++ MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
++ MX31_PIN_CSI_D12__CSI_D12, MX31_PIN_CSI_D13__CSI_D13,
++ MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
++ MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
++ MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
++ MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
++ MX31_PIN_TXD2__GPIO1_28,
++ /* USB OTG */
++ MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
++ MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
++ MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
++ MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
++ MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
++ MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
++ MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
++ MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
++ MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
++ MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
++ MX31_PIN_USB_OC__GPIO1_30,
++};
++
++#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
++#define SDHC2_WP IOMUX_TO_GPIO(MX31_PIN_ATA_DIOW)
++
++static int marxbot_sdhc2_get_ro(struct device *dev)
++{
++ return gpio_get_value(SDHC2_WP);
++}
++
++static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
++{
++ int ret;
++
++ ret = gpio_request(SDHC2_CD, "sdhc-detect");
++ if (ret)
++ return ret;
++
++ gpio_direction_input(SDHC2_CD);
++
++ ret = gpio_request(SDHC2_WP, "sdhc-wp");
++ if (ret)
++ goto err_gpio_free;
++ gpio_direction_input(SDHC2_WP);
++
++ ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
++ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
++ "sdhc2-card-detect", data);
++ if (ret)
++ goto err_gpio_free_2;
++
++ return 0;
++
++err_gpio_free_2:
++ gpio_free(SDHC2_WP);
++err_gpio_free:
++ gpio_free(SDHC2_CD);
++
++ return ret;
++}
++
++static void marxbot_sdhc2_exit(struct device *dev, void *data)
++{
++ free_irq(gpio_to_irq(SDHC2_CD), data);
++ gpio_free(SDHC2_WP);
++ gpio_free(SDHC2_CD);
++}
++
++static struct imxmmc_platform_data sdhc2_pdata = {
++ .get_ro = marxbot_sdhc2_get_ro,
++ .init = marxbot_sdhc2_init,
++ .exit = marxbot_sdhc2_exit,
++};
++
++static struct fsl_usb2_platform_data usb_pdata = {
++ .operating_mode = FSL_USB2_DR_DEVICE,
++ .phy_mode = FSL_USB2_PHY_ULPI,
++};
++
++#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
++#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
++
++static void marxbot_usbotg_init(void)
++{
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
++
++ gpio_request(OTG_EN_B, "usb-udc-en");
++ gpio_direction_output(OTG_EN_B, 0);
++}
++
+ /*
+ * system init for baseboard usage. Will be called by mx31moboard init.
+ */
+ void __init mx31moboard_marxbot_init(void)
+ {
+ printk(KERN_INFO "Initializing mx31marxbot peripherals\n");
++
++ mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins),
++ "marxbot");
++
++ mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
++
++ marxbot_usbotg_init();
++ mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/mx31pdk.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31pdk.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/mx31pdk.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/mx31pdk.c 2009-05-13 09:46:19.000000000 +0200
+@@ -84,7 +84,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31P
+ .phys_io = AIPS1_BASE_ADDR,
+ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx31_map_io,
+ .init_irq = mxc_init_irq,
+ .init_machine = mxc_board_init,
+ .timer = &mx31pdk_timer,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/pcm037.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/pcm037.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/pcm037.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/pcm037.c 2009-05-13 09:46:19.000000000 +0200
+@@ -28,6 +28,10 @@
+ #include <linux/interrupt.h>
+ #include <linux/i2c.h>
+ #include <linux/i2c/at24.h>
++#include <linux/delay.h>
++#include <linux/spi/spi.h>
++#include <linux/irq.h>
++#include <linux/fsl_devices.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -37,7 +41,9 @@
+ #include <mach/common.h>
+ #include <mach/imx-uart.h>
+ #include <mach/iomux-mx3.h>
++#include <mach/ipu.h>
+ #include <mach/board-pcm037.h>
++#include <mach/mx3fb.h>
+ #include <mach/mxc_nand.h>
+ #include <mach/mmc.h>
+ #ifdef CONFIG_I2C_IMX
+@@ -46,6 +52,76 @@
+
+ #include "devices.h"
+
++static unsigned int pcm037_pins[] = {
++ /* I2C */
++ MX31_PIN_CSPI2_MOSI__SCL,
++ MX31_PIN_CSPI2_MISO__SDA,
++ /* SDHC1 */
++ MX31_PIN_SD1_DATA3__SD1_DATA3,
++ MX31_PIN_SD1_DATA2__SD1_DATA2,
++ MX31_PIN_SD1_DATA1__SD1_DATA1,
++ MX31_PIN_SD1_DATA0__SD1_DATA0,
++ MX31_PIN_SD1_CLK__SD1_CLK,
++ MX31_PIN_SD1_CMD__SD1_CMD,
++ IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO), /* card detect */
++ IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), /* write protect */
++ /* SPI1 */
++ MX31_PIN_CSPI1_MOSI__MOSI,
++ MX31_PIN_CSPI1_MISO__MISO,
++ MX31_PIN_CSPI1_SCLK__SCLK,
++ MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
++ MX31_PIN_CSPI1_SS0__SS0,
++ MX31_PIN_CSPI1_SS1__SS1,
++ MX31_PIN_CSPI1_SS2__SS2,
++ /* UART1 */
++ MX31_PIN_CTS1__CTS1,
++ MX31_PIN_RTS1__RTS1,
++ MX31_PIN_TXD1__TXD1,
++ MX31_PIN_RXD1__RXD1,
++ /* UART2 */
++ MX31_PIN_TXD2__TXD2,
++ MX31_PIN_RXD2__RXD2,
++ MX31_PIN_CTS2__CTS2,
++ MX31_PIN_RTS2__RTS2,
++ /* UART3 */
++ MX31_PIN_CSPI3_MOSI__RXD3,
++ MX31_PIN_CSPI3_MISO__TXD3,
++ MX31_PIN_CSPI3_SCLK__RTS3,
++ MX31_PIN_CSPI3_SPI_RDY__CTS3,
++ /* LAN9217 irq pin */
++ IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO),
++ /* Onewire */
++ MX31_PIN_BATT_LINE__OWIRE,
++ /* Framebuffer */
++ MX31_PIN_LD0__LD0,
++ MX31_PIN_LD1__LD1,
++ MX31_PIN_LD2__LD2,
++ MX31_PIN_LD3__LD3,
++ MX31_PIN_LD4__LD4,
++ MX31_PIN_LD5__LD5,
++ MX31_PIN_LD6__LD6,
++ MX31_PIN_LD7__LD7,
++ MX31_PIN_LD8__LD8,
++ MX31_PIN_LD9__LD9,
++ MX31_PIN_LD10__LD10,
++ MX31_PIN_LD11__LD11,
++ MX31_PIN_LD12__LD12,
++ MX31_PIN_LD13__LD13,
++ MX31_PIN_LD14__LD14,
++ MX31_PIN_LD15__LD15,
++ MX31_PIN_LD16__LD16,
++ MX31_PIN_LD17__LD17,
++ MX31_PIN_VSYNC3__VSYNC3,
++ MX31_PIN_HSYNC__HSYNC,
++ MX31_PIN_FPSHIFT__FPSHIFT,
++ MX31_PIN_DRDY0__DRDY0,
++ MX31_PIN_D3_REV__D3_REV,
++ MX31_PIN_CONTRAST__CONTRAST,
++ MX31_PIN_D3_SPL__D3_SPL,
++ MX31_PIN_D3_CLS__D3_CLS,
++ MX31_PIN_LCS0__GPI03_23,
++};
++
+ static struct physmap_flash_data pcm037_flash_data = {
+ .width = 2,
+ };
+@@ -56,6 +132,54 @@ static struct resource pcm037_flash_reso
+ .flags = IORESOURCE_MEM,
+ };
+
++static int usbotg_pins[] = {
++ MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
++ MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
++ MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
++ MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
++ MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
++ MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
++ MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
++ MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
++ MX31_PIN_USBOTG_CLK__USBOTG_CLK,
++ MX31_PIN_USBOTG_DIR__USBOTG_DIR,
++ MX31_PIN_USBOTG_NXT__USBOTG_NXT,
++ MX31_PIN_USBOTG_STP__USBOTG_STP,
++};
++
++/* USB OTG HS port */
++static int __init gpio_usbotg_hs_activate(void)
++{
++ int ret = mxc_iomux_setup_multiple_pins(usbotg_pins,
++ ARRAY_SIZE(usbotg_pins), "usbotg");
++
++ if (ret < 0) {
++ printk(KERN_ERR "Cannot set up OTG pins\n");
++ return ret;
++ }
++
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++ mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
++
++ return 0;
++}
++
++/* OTG config */
++static struct fsl_usb2_platform_data usb_pdata = {
++ .operating_mode = FSL_USB2_DR_DEVICE,
++ .phy_mode = FSL_USB2_PHY_ULPI,
++};
++
+ static struct platform_device pcm037_flash = {
+ .name = "physmap-flash",
+ .id = 0,
+@@ -127,26 +251,8 @@ static struct mxc_nand_platform_data pcm
+ };
+
+ #ifdef CONFIG_I2C_IMX
+-static int i2c_1_pins[] = {
+- MX31_PIN_CSPI2_MOSI__SCL,
+- MX31_PIN_CSPI2_MISO__SDA,
+-};
+-
+-static int pcm037_i2c_1_init(struct device *dev)
+-{
+- return mxc_iomux_setup_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins),
+- "i2c-1");
+-}
+-
+-static void pcm037_i2c_1_exit(struct device *dev)
+-{
+- mxc_iomux_release_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins));
+-}
+-
+ static struct imxi2c_platform_data pcm037_i2c_1_data = {
+ .bitrate = 100000,
+- .init = pcm037_i2c_1_init,
+- .exit = pcm037_i2c_1_exit,
+ };
+
+ static struct at24_platform_data board_eeprom = {
+@@ -166,48 +272,119 @@ static struct i2c_board_info pcm037_i2c_
+ };
+ #endif
+
+-static int sdhc1_pins[] = {
+- MX31_PIN_SD1_DATA3__SD1_DATA3,
+- MX31_PIN_SD1_DATA2__SD1_DATA2,
+- MX31_PIN_SD1_DATA1__SD1_DATA1,
+- MX31_PIN_SD1_DATA0__SD1_DATA0,
+- MX31_PIN_SD1_CLK__SD1_CLK,
+- MX31_PIN_SD1_CMD__SD1_CMD,
+-};
++/* Not connected by default */
++#ifdef PCM970_SDHC_RW_SWITCH
++static int pcm970_sdhc1_get_ro(struct device *dev)
++{
++ return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_SFS6));
++}
++#endif
+
+-static int pcm970_sdhc1_init(struct device *dev, irq_handler_t h, void *data)
++#define SDHC1_GPIO_WP IOMUX_TO_GPIO(MX31_PIN_SFS6)
++#define SDHC1_GPIO_DET IOMUX_TO_GPIO(MX31_PIN_SCK6)
++
++static int pcm970_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
++ void *data)
+ {
+- return mxc_iomux_setup_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins),
+- "sdhc-1");
++ int ret;
++
++ ret = gpio_request(SDHC1_GPIO_DET, "sdhc-detect");
++ if (ret)
++ return ret;
++
++ gpio_direction_input(SDHC1_GPIO_DET);
++
++#ifdef PCM970_SDHC_RW_SWITCH
++ ret = gpio_request(SDHC1_GPIO_WP, "sdhc-wp");
++ if (ret)
++ goto err_gpio_free;
++ gpio_direction_input(SDHC1_GPIO_WP);
++#endif
++
++ ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq,
++ IRQF_DISABLED | IRQF_TRIGGER_FALLING,
++ "sdhc-detect", data);
++ if (ret)
++ goto err_gpio_free_2;
++
++ return 0;
++
++err_gpio_free_2:
++#ifdef PCM970_SDHC_RW_SWITCH
++ gpio_free(SDHC1_GPIO_WP);
++err_gpio_free:
++#endif
++ gpio_free(SDHC1_GPIO_DET);
++
++ return ret;
+ }
+
+ static void pcm970_sdhc1_exit(struct device *dev, void *data)
+ {
+- mxc_iomux_release_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins));
++ free_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), data);
++ gpio_free(SDHC1_GPIO_DET);
++ gpio_free(SDHC1_GPIO_WP);
+ }
+
+-/* No card and rw detection at the moment */
+ static struct imxmmc_platform_data sdhc_pdata = {
++#ifdef PCM970_SDHC_RW_SWITCH
++ .get_ro = pcm970_sdhc1_get_ro,
++#endif
+ .init = pcm970_sdhc1_init,
+ .exit = pcm970_sdhc1_exit,
+ };
+
+ static struct platform_device *devices[] __initdata = {
+ &pcm037_flash,
+- &pcm037_eth,
+ &pcm037_sram_device,
+ };
+
+-static int uart0_pins[] = {
+- MX31_PIN_CTS1__CTS1,
+- MX31_PIN_RTS1__RTS1,
+- MX31_PIN_TXD1__TXD1,
+- MX31_PIN_RXD1__RXD1
++static struct ipu_platform_data mx3_ipu_data = {
++ .irq_base = MXC_IPU_IRQ_START,
+ };
+
+-static int uart2_pins[] = {
+- MX31_PIN_CSPI3_MOSI__RXD3,
+- MX31_PIN_CSPI3_MISO__TXD3
++static const struct fb_videomode fb_modedb[] = {
++ {
++ /* 240x320 @ 60 Hz Sharp */
++ .name = "Sharp-LQ035Q7DH06-QVGA",
++ .refresh = 60,
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 185925,
++ .left_margin = 9,
++ .right_margin = 16,
++ .upper_margin = 7,
++ .lower_margin = 9,
++ .hsync_len = 1,
++ .vsync_len = 1,
++ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE |
++ FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
++ .vmode = FB_VMODE_NONINTERLACED,
++ .flag = 0,
++ }, {
++ /* 240x320 @ 60 Hz */
++ .name = "TX090",
++ .refresh = 60,
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 38255,
++ .left_margin = 144,
++ .right_margin = 0,
++ .upper_margin = 7,
++ .lower_margin = 40,
++ .hsync_len = 96,
++ .vsync_len = 1,
++ .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
++ .vmode = FB_VMODE_NONINTERLACED,
++ .flag = 0,
++ },
++};
++
++static struct mx3fb_platform_data mx3fb_pdata = {
++ .dma_dev = &mx3_ipu.dev,
++ .name = "Sharp-LQ035Q7DH06-QVGA",
++ .mode = fb_modedb,
++ .num_modes = ARRAY_SIZE(fb_modedb),
+ };
+
+ /*
+@@ -215,21 +392,28 @@ static int uart2_pins[] = {
+ */
+ static void __init mxc_board_init(void)
+ {
++ int ret;
++
++ mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
++ "pcm037");
++
+ platform_add_devices(devices, ARRAY_SIZE(devices));
+
+- mxc_iomux_setup_multiple_pins(uart0_pins, ARRAY_SIZE(uart0_pins), "uart-0");
+ mxc_register_device(&mxc_uart_device0, &uart_pdata);
+-
+- mxc_iomux_setup_multiple_pins(uart2_pins, ARRAY_SIZE(uart2_pins), "uart-2");
++ mxc_register_device(&mxc_uart_device1, &uart_pdata);
+ mxc_register_device(&mxc_uart_device2, &uart_pdata);
+
+- mxc_iomux_setup_pin(MX31_PIN_BATT_LINE__OWIRE, "batt-0wire");
+ mxc_register_device(&mxc_w1_master_device, NULL);
+
+ /* LAN9217 IRQ pin */
+- if (!mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO),
+- "pcm037-eth"))
++ ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq");
++ if (ret)
++ pr_warning("could not get LAN irq gpio\n");
++ else {
+ gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
++ platform_device_register(&pcm037_eth);
++ }
++
+
+ #ifdef CONFIG_I2C_IMX
+ i2c_register_board_info(1, pcm037_i2c_devices,
+@@ -239,6 +423,10 @@ static void __init mxc_board_init(void)
+ #endif
+ mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
+ mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
++ mxc_register_device(&mx3_ipu, &mx3_ipu_data);
++ mxc_register_device(&mx3_fb, &mx3fb_pdata);
++ if (!gpio_usbotg_hs_activate())
++ mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+ }
+
+ static void __init pcm037_timer_init(void)
+@@ -255,7 +443,7 @@ MACHINE_START(PCM037, "Phytec Phycore pc
+ .phys_io = AIPS1_BASE_ADDR,
+ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx31_map_io,
+ .init_irq = mxc_init_irq,
+ .init_machine = mxc_board_init,
+ .timer = &pcm037_timer,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/pcm043.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/pcm043.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/pcm043.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/pcm043.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,252 @@
++/*
++ * Copyright (C) 2009 Sascha Hauer, Pengutronix
++ *
++ * 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 <linux/types.h>
++#include <linux/init.h>
++
++#include <linux/platform_device.h>
++#include <linux/mtd/physmap.h>
++#include <linux/mtd/plat-ram.h>
++#include <linux/memory.h>
++#include <linux/gpio.h>
++#include <linux/smc911x.h>
++#include <linux/interrupt.h>
++#include <linux/i2c.h>
++#include <linux/i2c/at24.h>
++
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++#include <asm/mach/map.h>
++
++#include <mach/hardware.h>
++#include <mach/common.h>
++#include <mach/imx-uart.h>
++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
++#include <mach/i2c.h>
++#endif
++#include <mach/iomux-mx35.h>
++#include <mach/ipu.h>
++#include <mach/mx3fb.h>
++
++#include "devices.h"
++
++static const struct fb_videomode fb_modedb[] = {
++ {
++ /* 240x320 @ 60 Hz */
++ .name = "Sharp-LQ035Q7",
++ .refresh = 60,
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 185925,
++ .left_margin = 9,
++ .right_margin = 16,
++ .upper_margin = 7,
++ .lower_margin = 9,
++ .hsync_len = 1,
++ .vsync_len = 1,
++ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE | FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN,
++ .vmode = FB_VMODE_NONINTERLACED,
++ .flag = 0,
++ }, {
++ /* 240x320 @ 60 Hz */
++ .name = "TX090",
++ .refresh = 60,
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 38255,
++ .left_margin = 144,
++ .right_margin = 0,
++ .upper_margin = 7,
++ .lower_margin = 40,
++ .hsync_len = 96,
++ .vsync_len = 1,
++ .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
++ .vmode = FB_VMODE_NONINTERLACED,
++ .flag = 0,
++ },
++};
++
++static struct ipu_platform_data mx3_ipu_data = {
++ .irq_base = MXC_IPU_IRQ_START,
++};
++
++static struct mx3fb_platform_data mx3fb_pdata = {
++ .dma_dev = &mx3_ipu.dev,
++ .name = "Sharp-LQ035Q7",
++ .mode = fb_modedb,
++ .num_modes = ARRAY_SIZE(fb_modedb),
++};
++
++static struct physmap_flash_data pcm043_flash_data = {
++ .width = 2,
++};
++
++static struct resource pcm043_flash_resource = {
++ .start = 0xa0000000,
++ .end = 0xa1ffffff,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct platform_device pcm043_flash = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &pcm043_flash_data,
++ },
++ .resource = &pcm043_flash_resource,
++ .num_resources = 1,
++};
++
++static struct imxuart_platform_data uart_pdata = {
++ .flags = IMXUART_HAVE_RTSCTS,
++};
++
++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
++static struct imxi2c_platform_data pcm043_i2c_1_data = {
++ .bitrate = 50000,
++};
++
++static struct at24_platform_data board_eeprom = {
++ .byte_len = 4096,
++ .page_size = 32,
++ .flags = AT24_FLAG_ADDR16,
++};
++
++static struct i2c_board_info pcm043_i2c_devices[] = {
++ {
++ I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
++ .platform_data = &board_eeprom,
++ }, {
++ I2C_BOARD_INFO("rtc-pcf8563", 0x51),
++ .type = "pcf8563",
++ }
++};
++#endif
++
++static struct platform_device *devices[] __initdata = {
++ &pcm043_flash,
++ &mxc_fec_device,
++};
++
++static struct pad_desc pcm043_pads[] = {
++ /* UART1 */
++ MX35_PAD_CTS1__UART1_CTS,
++ MX35_PAD_RTS1__UART1_RTS,
++ MX35_PAD_TXD1__UART1_TXD_MUX,
++ MX35_PAD_RXD1__UART1_RXD_MUX,
++ /* UART2 */
++ MX35_PAD_CTS2__UART2_CTS,
++ MX35_PAD_RTS2__UART2_RTS,
++ MX35_PAD_TXD2__UART2_TXD_MUX,
++ MX35_PAD_RXD2__UART2_RXD_MUX,
++ /* FEC */
++ MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
++ MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
++ MX35_PAD_FEC_RX_DV__FEC_RX_DV,
++ MX35_PAD_FEC_COL__FEC_COL,
++ MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
++ MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
++ MX35_PAD_FEC_TX_EN__FEC_TX_EN,
++ MX35_PAD_FEC_MDC__FEC_MDC,
++ MX35_PAD_FEC_MDIO__FEC_MDIO,
++ MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
++ MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
++ MX35_PAD_FEC_CRS__FEC_CRS,
++ MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
++ MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
++ MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
++ MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
++ MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
++ MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
++ /* I2C1 */
++ MX35_PAD_I2C1_CLK__I2C1_SCL,
++ MX35_PAD_I2C1_DAT__I2C1_SDA,
++ /* Display */
++ MX35_PAD_LD0__IPU_DISPB_DAT_0,
++ MX35_PAD_LD1__IPU_DISPB_DAT_1,
++ MX35_PAD_LD2__IPU_DISPB_DAT_2,
++ MX35_PAD_LD3__IPU_DISPB_DAT_3,
++ MX35_PAD_LD4__IPU_DISPB_DAT_4,
++ MX35_PAD_LD5__IPU_DISPB_DAT_5,
++ MX35_PAD_LD6__IPU_DISPB_DAT_6,
++ MX35_PAD_LD7__IPU_DISPB_DAT_7,
++ MX35_PAD_LD8__IPU_DISPB_DAT_8,
++ MX35_PAD_LD9__IPU_DISPB_DAT_9,
++ MX35_PAD_LD10__IPU_DISPB_DAT_10,
++ MX35_PAD_LD11__IPU_DISPB_DAT_11,
++ MX35_PAD_LD12__IPU_DISPB_DAT_12,
++ MX35_PAD_LD13__IPU_DISPB_DAT_13,
++ MX35_PAD_LD14__IPU_DISPB_DAT_14,
++ MX35_PAD_LD15__IPU_DISPB_DAT_15,
++ MX35_PAD_LD16__IPU_DISPB_DAT_16,
++ MX35_PAD_LD17__IPU_DISPB_DAT_17,
++ MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC,
++ MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
++ MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
++ MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
++ MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
++ MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
++ MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
++ MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL
++};
++
++/*
++ * Board specific initialization.
++ */
++static void __init mxc_board_init(void)
++{
++ mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
++
++ platform_add_devices(devices, ARRAY_SIZE(devices));
++
++ mxc_register_device(&mxc_uart_device0, &uart_pdata);
++
++ mxc_register_device(&mxc_uart_device1, &uart_pdata);
++
++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
++ i2c_register_board_info(0, pcm043_i2c_devices,
++ ARRAY_SIZE(pcm043_i2c_devices));
++
++ mxc_register_device(&mxc_i2c_device0, &pcm043_i2c_1_data);
++#endif
++
++ mxc_register_device(&mx3_ipu, &mx3_ipu_data);
++ mxc_register_device(&mx3_fb, &mx3fb_pdata);
++}
++
++static void __init pcm043_timer_init(void)
++{
++ mx35_clocks_init();
++}
++
++struct sys_timer pcm043_timer = {
++ .init = pcm043_timer_init,
++};
++
++MACHINE_START(PCM043, "Phytec Phycore pcm043")
++ /* Maintainer: Pengutronix */
++ .phys_io = AIPS1_BASE_ADDR,
++ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
++ .boot_params = PHYS_OFFSET + 0x100,
++ .map_io = mx35_map_io,
++ .init_irq = mxc_init_irq,
++ .init_machine = mxc_board_init,
++ .timer = &pcm043_timer,
++MACHINE_END
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-mx3/qong.c linux-2.6.30-rc4-git/arch/arm/mach-mx3/qong.c
+--- linux-2.6.30-rc4/arch/arm/mach-mx3/qong.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-mx3/qong.c 2009-05-13 09:46:19.000000000 +0200
+@@ -279,7 +279,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-L
+ .phys_io = AIPS1_BASE_ADDR,
+ .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
+ .boot_params = PHYS_OFFSET + 0x100,
+- .map_io = mxc_map_io,
++ .map_io = mx31_map_io,
+ .init_irq = mxc_init_irq,
+ .init_machine = mxc_board_init,
+ .timer = &qong_timer,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap1/board-h2-mmc.c linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h2-mmc.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap1/board-h2-mmc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h2-mmc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -26,19 +26,13 @@
+ static int mmc_set_power(struct device *dev, int slot, int power_on,
+ int vdd)
+ {
+- if (power_on)
+- gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 1);
+- else
+- gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);
+-
++ gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on);
+ return 0;
+ }
+
+ static int mmc_late_init(struct device *dev)
+ {
+- int ret;
+-
+- ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
++ int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");
+ if (ret < 0)
+ return ret;
+
+@@ -47,7 +41,7 @@ static int mmc_late_init(struct device *
+ return ret;
+ }
+
+-static void mmc_shutdown(struct device *dev)
++static void mmc_cleanup(struct device *dev)
+ {
+ gpio_free(H2_TPS_GPIO_MMC_PWR_EN);
+ }
+@@ -60,7 +54,7 @@ static void mmc_shutdown(struct device *
+ static struct omap_mmc_platform_data mmc1_data = {
+ .nr_slots = 1,
+ .init = mmc_late_init,
+- .shutdown = mmc_shutdown,
++ .cleanup = mmc_cleanup,
+ .dma_mask = 0xffffffff,
+ .slots[0] = {
+ .set_power = mmc_set_power,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap1/board-h3.c linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h3.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap1/board-h3.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h3.c 2009-05-13 09:46:19.000000000 +0200
+@@ -39,12 +39,10 @@
+ #include <asm/mach/flash.h>
+ #include <asm/mach/map.h>
+
+-#include <mach/gpioexpander.h>
+ #include <mach/irqs.h>
+ #include <mach/mux.h>
+ #include <mach/tc.h>
+ #include <mach/nand.h>
+-#include <mach/irda.h>
+ #include <mach/usb.h>
+ #include <mach/keypad.h>
+ #include <mach/dma.h>
+@@ -276,104 +274,6 @@ static struct platform_device h3_kp_devi
+ .resource = h3_kp_resources,
+ };
+
+-
+-/* Select between the IrDA and aGPS module
+- */
+-static int h3_select_irda(struct device *dev, int state)
+-{
+- unsigned char expa;
+- int err = 0;
+-
+- if ((err = read_gpio_expa(&expa, 0x26))) {
+- printk(KERN_ERR "Error reading from I/O EXPANDER \n");
+- return err;
+- }
+-
+- /* 'P6' enable/disable IRDA_TX and IRDA_RX */
+- if (state & IR_SEL) { /* IrDA */
+- if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
+- printk(KERN_ERR "Error writing to I/O EXPANDER \n");
+- return err;
+- }
+- } else {
+- if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
+- printk(KERN_ERR "Error writing to I/O EXPANDER \n");
+- return err;
+- }
+- }
+- return err;
+-}
+-
+-static void set_trans_mode(struct work_struct *work)
+-{
+- struct omap_irda_config *irda_config =
+- container_of(work, struct omap_irda_config, gpio_expa.work);
+- int mode = irda_config->mode;
+- unsigned char expa;
+- int err = 0;
+-
+- if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
+- printk(KERN_ERR "Error reading from I/O expander\n");
+- }
+-
+- expa &= ~0x03;
+-
+- if (mode & IR_SIRMODE) {
+- expa |= 0x01;
+- } else { /* MIR/FIR */
+- expa |= 0x03;
+- }
+-
+- if ((err = write_gpio_expa(expa, 0x27)) != 0) {
+- printk(KERN_ERR "Error writing to I/O expander\n");
+- }
+-}
+-
+-static int h3_transceiver_mode(struct device *dev, int mode)
+-{
+- struct omap_irda_config *irda_config = dev->platform_data;
+-
+- irda_config->mode = mode;
+- cancel_delayed_work(&irda_config->gpio_expa);
+- PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
+- schedule_delayed_work(&irda_config->gpio_expa, 0);
+-
+- return 0;
+-}
+-
+-static struct omap_irda_config h3_irda_data = {
+- .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+- .transceiver_mode = h3_transceiver_mode,
+- .select_irda = h3_select_irda,
+- .rx_channel = OMAP_DMA_UART3_RX,
+- .tx_channel = OMAP_DMA_UART3_TX,
+- .dest_start = UART3_THR,
+- .src_start = UART3_RHR,
+- .tx_trigger = 0,
+- .rx_trigger = 0,
+-};
+-
+-static struct resource h3_irda_resources[] = {
+- [0] = {
+- .start = INT_UART3,
+- .end = INT_UART3,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static u64 irda_dmamask = 0xffffffff;
+-
+-static struct platform_device h3_irda_device = {
+- .name = "omapirda",
+- .id = 0,
+- .dev = {
+- .platform_data = &h3_irda_data,
+- .dma_mask = &irda_dmamask,
+- },
+- .num_resources = ARRAY_SIZE(h3_irda_resources),
+- .resource = h3_irda_resources,
+-};
+-
+ static struct platform_device h3_lcd_device = {
+ .name = "lcd_h3",
+ .id = -1,
+@@ -395,7 +295,6 @@ static struct platform_device *devices[]
+ &nand_device,
+ &smc91x_device,
+ &intlat_device,
+- &h3_irda_device,
+ &h3_kp_device,
+ &h3_lcd_device,
+ };
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap1/board-h3-mmc.c linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h3-mmc.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap1/board-h3-mmc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-h3-mmc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -26,11 +26,7 @@
+ static int mmc_set_power(struct device *dev, int slot, int power_on,
+ int vdd)
+ {
+- if (power_on)
+- gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 1);
+- else
+- gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);
+-
++ gpio_set_value(H3_TPS_GPIO_MMC_PWR_EN, power_on);
+ return 0;
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap1/board-nokia770.c linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-nokia770.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap1/board-nokia770.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap1/board-nokia770.c 2009-05-13 09:46:19.000000000 +0200
+@@ -181,11 +181,7 @@ static struct omap_usb_config nokia770_u
+ static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on,
+ int vdd)
+ {
+- if (power_on)
+- gpio_set_value(NOKIA770_GPIO_MMC_POWER, 1);
+- else
+- gpio_set_value(NOKIA770_GPIO_MMC_POWER, 0);
+-
++ gpio_set_value(NOKIA770_GPIO_MMC_POWER, power_on);
+ return 0;
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap1/mcbsp.c linux-2.6.30-rc4-git/arch/arm/mach-omap1/mcbsp.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap1/mcbsp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap1/mcbsp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -40,8 +40,8 @@ static void omap1_mcbsp_request(unsigned
+ */
+ if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) {
+ if (dsp_use++ == 0) {
+- api_clk = clk_get(NULL, "api_clk");
+- dsp_clk = clk_get(NULL, "dsp_clk");
++ api_clk = clk_get(NULL, "api_ck");
++ dsp_clk = clk_get(NULL, "dsp_ck");
+ if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) {
+ clk_enable(api_clk);
+ clk_enable(dsp_clk);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/board-h4.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-h4.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/board-h4.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-h4.c 2009-05-13 09:46:19.000000000 +0200
+@@ -33,10 +33,8 @@
+
+ #include <mach/control.h>
+ #include <mach/gpio.h>
+-#include <mach/gpioexpander.h>
+ #include <mach/mux.h>
+ #include <mach/usb.h>
+-#include <mach/irda.h>
+ #include <mach/board.h>
+ #include <mach/common.h>
+ #include <mach/keypad.h>
+@@ -138,98 +136,6 @@ static struct platform_device h4_flash_d
+ .resource = &h4_flash_resource,
+ };
+
+-/* Select between the IrDA and aGPS module
+- */
+-static int h4_select_irda(struct device *dev, int state)
+-{
+- unsigned char expa;
+- int err = 0;
+-
+- if ((err = read_gpio_expa(&expa, 0x21))) {
+- printk(KERN_ERR "Error reading from I/O expander\n");
+- return err;
+- }
+-
+- /* 'P6' enable/disable IRDA_TX and IRDA_RX */
+- if (state & IR_SEL) { /* IrDa */
+- if ((err = write_gpio_expa(expa | 0x01, 0x21))) {
+- printk(KERN_ERR "Error writing to I/O expander\n");
+- return err;
+- }
+- } else {
+- if ((err = write_gpio_expa(expa & ~0x01, 0x21))) {
+- printk(KERN_ERR "Error writing to I/O expander\n");
+- return err;
+- }
+- }
+- return err;
+-}
+-
+-static void set_trans_mode(struct work_struct *work)
+-{
+- struct omap_irda_config *irda_config =
+- container_of(work, struct omap_irda_config, gpio_expa.work);
+- int mode = irda_config->mode;
+- unsigned char expa;
+- int err = 0;
+-
+- if ((err = read_gpio_expa(&expa, 0x20)) != 0) {
+- printk(KERN_ERR "Error reading from I/O expander\n");
+- }
+-
+- expa &= ~0x01;
+-
+- if (!(mode & IR_SIRMODE)) { /* MIR/FIR */
+- expa |= 0x01;
+- }
+-
+- if ((err = write_gpio_expa(expa, 0x20)) != 0) {
+- printk(KERN_ERR "Error writing to I/O expander\n");
+- }
+-}
+-
+-static int h4_transceiver_mode(struct device *dev, int mode)
+-{
+- struct omap_irda_config *irda_config = dev->platform_data;
+-
+- irda_config->mode = mode;
+- cancel_delayed_work(&irda_config->gpio_expa);
+- PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
+- schedule_delayed_work(&irda_config->gpio_expa, 0);
+-
+- return 0;
+-}
+-
+-static struct omap_irda_config h4_irda_data = {
+- .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+- .transceiver_mode = h4_transceiver_mode,
+- .select_irda = h4_select_irda,
+- .rx_channel = OMAP24XX_DMA_UART3_RX,
+- .tx_channel = OMAP24XX_DMA_UART3_TX,
+- .dest_start = OMAP_UART3_BASE,
+- .src_start = OMAP_UART3_BASE,
+- .tx_trigger = OMAP24XX_DMA_UART3_TX,
+- .rx_trigger = OMAP24XX_DMA_UART3_RX,
+-};
+-
+-static struct resource h4_irda_resources[] = {
+- [0] = {
+- .start = INT_24XX_UART3_IRQ,
+- .end = INT_24XX_UART3_IRQ,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static struct platform_device h4_irda_device = {
+- .name = "omapirda",
+- .id = -1,
+- .dev = {
+- .platform_data = &h4_irda_data,
+- },
+- .num_resources = 1,
+- .resource = h4_irda_resources,
+-};
+-
+ static struct omap_kp_platform_data h4_kp_data = {
+ .rows = 6,
+ .cols = 7,
+@@ -255,7 +161,6 @@ static struct platform_device h4_lcd_dev
+
+ static struct platform_device *h4_devices[] __initdata = {
+ &h4_flash_device,
+- &h4_irda_device,
+ &h4_kp_device,
+ &h4_lcd_device,
+ };
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/board-omap3beagle.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-omap3beagle.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/board-omap3beagle.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-omap3beagle.c 2009-05-13 09:46:19.000000000 +0200
+@@ -42,6 +42,7 @@
+ #include <mach/nand.h>
+ #include <mach/mux.h>
+ #include <mach/usb.h>
++#include <mach/timer-gp.h>
+
+ #include "mmc-twl4030.h"
+
+@@ -186,6 +187,9 @@ static void __init omap3_beagle_init_irq
+ {
+ omap2_init_common_hw(NULL);
+ omap_init_irq();
++#ifdef CONFIG_OMAP_32K_TIMER
++ omap2_gp_clockevent_set_gptimer(12);
++#endif
+ omap_gpio_init();
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/board-rx51.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-rx51.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/board-rx51.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/board-rx51.c 2009-05-13 09:46:19.000000000 +0200
+@@ -15,7 +15,6 @@
+ #include <linux/err.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
+-#include <linux/delay.h>
+ #include <linux/gpio.h>
+
+ #include <mach/hardware.h>
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/clock24xx.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock24xx.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/clock24xx.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock24xx.c 2009-05-13 09:46:19.000000000 +0200
+@@ -60,12 +60,13 @@ struct omap_clk {
+ }, \
+ }
+
+-#define CK_243X (1 << 0)
+-#define CK_242X (1 << 1)
++#define CK_243X RATE_IN_243X
++#define CK_242X RATE_IN_242X
+
+ static struct omap_clk omap24xx_clks[] = {
+ /* external root sources */
+ CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X),
++ CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X),
+ CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X),
+ CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X),
+ CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X),
+@@ -711,7 +712,7 @@ int __init omap2_clk_init(void)
+ {
+ struct prcm_config *prcm;
+ struct omap_clk *c;
+- u32 clkrate, cpu_mask;
++ u32 clkrate;
+
+ if (cpu_is_omap242x())
+ cpu_mask = RATE_IN_242X;
+@@ -720,21 +721,15 @@ int __init omap2_clk_init(void)
+
+ clk_init(&omap2_clk_functions);
+
++ for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
++ clk_init_one(c->lk.clk);
++
+ osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
+ propagate_rate(&osc_ck);
+ sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);
+ propagate_rate(&sys_ck);
+
+ for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
+- clk_init_one(c->lk.clk);
+-
+- cpu_mask = 0;
+- if (cpu_is_omap2420())
+- cpu_mask |= CK_242X;
+- if (cpu_is_omap2430())
+- cpu_mask |= CK_243X;
+-
+- for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
+ if (c->cpu & cpu_mask) {
+ clkdev_add(&c->lk);
+ clk_register(c->lk.clk);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/clock24xx.h linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock24xx.h
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/clock24xx.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock24xx.h 2009-05-13 09:46:19.000000000 +0200
+@@ -625,6 +625,14 @@ static struct clk func_32k_ck = {
+ .clkdm_name = "wkup_clkdm",
+ };
+
++static struct clk secure_32k_ck = {
++ .name = "secure_32k_ck",
++ .ops = &clkops_null,
++ .rate = 32768,
++ .flags = RATE_FIXED,
++ .clkdm_name = "wkup_clkdm",
++};
++
+ /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
+ static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
+ .name = "osc_ck",
+@@ -1790,7 +1798,7 @@ static struct clk gpt12_ick = {
+ static struct clk gpt12_fck = {
+ .name = "gpt12_fck",
+ .ops = &clkops_omap2_dflt_wait,
+- .parent = &func_32k_ck,
++ .parent = &secure_32k_ck,
+ .clkdm_name = "core_l4_clkdm",
+ .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+ .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/clock34xx.h linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock34xx.h
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/clock34xx.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/clock34xx.h 2009-05-13 09:46:19.000000000 +0200
+@@ -2052,7 +2052,7 @@ static struct clk dss_ick = {
+
+ static struct clk cam_mclk = {
+ .name = "cam_mclk",
+- .ops = &clkops_omap2_dflt_wait,
++ .ops = &clkops_omap2_dflt,
+ .parent = &dpll4_m5x2_ck,
+ .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
+ .enable_bit = OMAP3430_EN_CAM_SHIFT,
+@@ -2063,7 +2063,7 @@ static struct clk cam_mclk = {
+ static struct clk cam_ick = {
+ /* Handles both L3 and L4 clocks */
+ .name = "cam_ick",
+- .ops = &clkops_omap2_dflt_wait,
++ .ops = &clkops_omap2_dflt,
+ .parent = &l4_ick,
+ .init = &omap2_init_clk_clkdm,
+ .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
+@@ -2074,7 +2074,7 @@ static struct clk cam_ick = {
+
+ static struct clk csi2_96m_fck = {
+ .name = "csi2_96m_fck",
+- .ops = &clkops_omap2_dflt_wait,
++ .ops = &clkops_omap2_dflt,
+ .parent = &core_96m_fck,
+ .init = &omap2_init_clk_clkdm,
+ .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
+@@ -2901,7 +2901,6 @@ static struct clk sr_l4_ick = {
+
+ /* SECURE_32K_FCK clocks */
+
+-/* XXX This clock no longer exists in 3430 TRM rev F */
+ static struct clk gpt12_fck = {
+ .name = "gpt12_fck",
+ .ops = &clkops_null,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/devices.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/devices.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/devices.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/devices.c 2009-05-13 09:46:19.000000000 +0200
+@@ -25,7 +25,6 @@
+ #include <mach/board.h>
+ #include <mach/mux.h>
+ #include <mach/gpio.h>
+-#include <mach/eac.h>
+ #include <mach/mmc.h>
+
+ #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
+@@ -366,38 +365,6 @@ static void omap_init_mcspi(void)
+ static inline void omap_init_mcspi(void) {}
+ #endif
+
+-#ifdef CONFIG_SND_OMAP24XX_EAC
+-
+-#define OMAP2_EAC_BASE 0x48090000
+-
+-static struct resource omap2_eac_resources[] = {
+- {
+- .start = OMAP2_EAC_BASE,
+- .end = OMAP2_EAC_BASE + 0x109,
+- .flags = IORESOURCE_MEM,
+- },
+-};
+-
+-static struct platform_device omap2_eac_device = {
+- .name = "omap24xx-eac",
+- .id = -1,
+- .num_resources = ARRAY_SIZE(omap2_eac_resources),
+- .resource = omap2_eac_resources,
+- .dev = {
+- .platform_data = NULL,
+- },
+-};
+-
+-void omap_init_eac(struct eac_platform_data *pdata)
+-{
+- omap2_eac_device.dev.platform_data = pdata;
+- platform_device_register(&omap2_eac_device);
+-}
+-
+-#else
+-void omap_init_eac(struct eac_platform_data *pdata) {}
+-#endif
+-
+ #ifdef CONFIG_OMAP_SHA1_MD5
+ static struct resource sha1_md5_resources[] = {
+ {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/irq.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/irq.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/irq.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/irq.c 2009-05-13 09:46:19.000000000 +0200
+@@ -73,9 +73,9 @@ static int omap_check_spurious(unsigned
+ u32 sir, spurious;
+
+ sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR);
+- spurious = sir >> 6;
++ spurious = sir >> 7;
+
+- if (spurious > 1) {
++ if (spurious) {
+ printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush "
+ "posted write for irq %i\n",
+ irq, sir, previous_irq);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/timer-gp.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/timer-gp.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/timer-gp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/timer-gp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -3,6 +3,8 @@
+ *
+ * OMAP2 GP timer support.
+ *
++ * Copyright (C) 2009 Nokia Corporation
++ *
+ * Update to use new clocksource/clockevent layers
+ * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
+ * Copyright (C) 2007 MontaVista Software, Inc.
+@@ -36,8 +38,13 @@
+ #include <asm/mach/time.h>
+ #include <mach/dmtimer.h>
+
++/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
++#define MAX_GPTIMER_ID 12
++
+ static struct omap_dm_timer *gptimer;
+ static struct clock_event_device clockevent_gpt;
++static u8 __initdata gptimer_id = 1;
++static u8 __initdata inited;
+
+ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
+ {
+@@ -95,20 +102,53 @@ static struct clock_event_device clockev
+ .set_mode = omap2_gp_timer_set_mode,
+ };
+
++/**
++ * omap2_gp_clockevent_set_gptimer - set which GPTIMER is used for clockevents
++ * @id: GPTIMER to use (1..MAX_GPTIMER_ID)
++ *
++ * Define the GPTIMER that the system should use for the tick timer.
++ * Meant to be called from board-*.c files in the event that GPTIMER1, the
++ * default, is unsuitable. Returns -EINVAL on error or 0 on success.
++ */
++int __init omap2_gp_clockevent_set_gptimer(u8 id)
++{
++ if (id < 1 || id > MAX_GPTIMER_ID)
++ return -EINVAL;
++
++ BUG_ON(inited);
++
++ gptimer_id = id;
++
++ return 0;
++}
++
+ static void __init omap2_gp_clockevent_init(void)
+ {
+ u32 tick_rate;
++ int src;
+
+- gptimer = omap_dm_timer_request_specific(1);
++ inited = 1;
++
++ gptimer = omap_dm_timer_request_specific(gptimer_id);
+ BUG_ON(gptimer == NULL);
+
+ #if defined(CONFIG_OMAP_32K_TIMER)
+- omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
++ src = OMAP_TIMER_SRC_32_KHZ;
+ #else
+- omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_SYS_CLK);
++ src = OMAP_TIMER_SRC_SYS_CLK;
++ WARN(gptimer_id == 12, "WARNING: GPTIMER12 can only use the "
++ "secure 32KiHz clock source\n");
+ #endif
++
++ if (gptimer_id != 12)
++ WARN(IS_ERR_VALUE(omap_dm_timer_set_source(gptimer, src)),
++ "timer-gp: omap_dm_timer_set_source() failed\n");
++
+ tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
+
++ pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n",
++ gptimer_id, tick_rate);
++
+ omap2_gp_timer_irq.dev_id = (void *)gptimer;
+ setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq);
+ omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
+@@ -125,6 +165,8 @@ static void __init omap2_gp_clockevent_i
+ clockevents_register_device(&clockevent_gpt);
+ }
+
++/* Clocksource code */
++
+ #ifdef CONFIG_OMAP_32K_TIMER
+ /*
+ * When 32k-timer is enabled, don't use GPTimer for clocksource
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-omap2/usb-tusb6010.c linux-2.6.30-rc4-git/arch/arm/mach-omap2/usb-tusb6010.c
+--- linux-2.6.30-rc4/arch/arm/mach-omap2/usb-tusb6010.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-omap2/usb-tusb6010.c 2009-05-13 09:46:19.000000000 +0200
+@@ -187,7 +187,7 @@ int tusb6010_platform_retime(unsigned is
+ unsigned sysclk_ps;
+ int status;
+
+- if (!refclk_psec)
++ if (!refclk_psec || sysclk_ps == 0)
+ return -ENODEV;
+
+ sysclk_ps = is_refclk ? refclk_psec : TUSB6010_OSCCLK_60;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-pxa/corgi.c linux-2.6.30-rc4-git/arch/arm/mach-pxa/corgi.c
+--- linux-2.6.30-rc4/arch/arm/mach-pxa/corgi.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-pxa/corgi.c 2009-05-13 09:46:19.000000000 +0200
+@@ -427,12 +427,22 @@ static struct pxa2xx_spi_master corgi_sp
+ .num_chipselect = 3,
+ };
+
++static void corgi_wait_for_hsync(void)
++{
++ while (gpio_get_value(CORGI_GPIO_HSYNC))
++ cpu_relax();
++
++ while (!gpio_get_value(CORGI_GPIO_HSYNC))
++ cpu_relax();
++}
++
+ static struct ads7846_platform_data corgi_ads7846_info = {
+ .model = 7846,
+ .vref_delay_usecs = 100,
+ .x_plate_ohms = 419,
+ .y_plate_ohms = 486,
+ .gpio_pendown = CORGI_GPIO_TP_INT,
++ .wait_for_sync = corgi_wait_for_hsync,
+ };
+
+ static void corgi_ads7846_cs(u32 command)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-pxa/littleton.c linux-2.6.30-rc4-git/arch/arm/mach-pxa/littleton.c
+--- linux-2.6.30-rc4/arch/arm/mach-pxa/littleton.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-pxa/littleton.c 2009-05-13 09:46:19.000000000 +0200
+@@ -334,6 +334,11 @@ static struct led_info littleton_da9034_
+ },
+ };
+
++static struct da9034_touch_pdata littleton_da9034_touch = {
++ .x_inverted = 1,
++ .interval_ms = 20,
++};
++
+ static struct da903x_subdev_info littleton_da9034_subdevs[] = {
+ {
+ .name = "da903x-led",
+@@ -350,6 +355,10 @@ static struct da903x_subdev_info littlet
+ }, {
+ .name = "da903x-backlight",
+ .id = DA9034_ID_WLED,
++ }, {
++ .name = "da9034-touch",
++ .id = DA9034_ID_TOUCH,
++ .platform_data = &littleton_da9034_touch,
+ },
+ };
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-pxa/spitz.c linux-2.6.30-rc4-git/arch/arm/mach-pxa/spitz.c
+--- linux-2.6.30-rc4/arch/arm/mach-pxa/spitz.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-pxa/spitz.c 2009-05-13 09:46:19.000000000 +0200
+@@ -299,12 +299,22 @@ static struct pxa2xx_spi_master spitz_sp
+ .num_chipselect = 3,
+ };
+
++static void spitz_wait_for_hsync(void)
++{
++ while (gpio_get_value(SPITZ_GPIO_HSYNC))
++ cpu_relax();
++
++ while (!gpio_get_value(SPITZ_GPIO_HSYNC))
++ cpu_relax();
++}
++
+ static struct ads7846_platform_data spitz_ads7846_info = {
+ .model = 7846,
+ .vref_delay_usecs = 100,
+ .x_plate_ohms = 419,
+ .y_plate_ohms = 486,
+ .gpio_pendown = SPITZ_GPIO_TP_INT,
++ .wait_for_sync = spitz_wait_for_hsync,
+ };
+
+ static void spitz_ads7846_cs(u32 command)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-pxa/zylonite_pxa300.c linux-2.6.30-rc4-git/arch/arm/mach-pxa/zylonite_pxa300.c
+--- linux-2.6.30-rc4/arch/arm/mach-pxa/zylonite_pxa300.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-pxa/zylonite_pxa300.c 2009-05-13 09:46:19.000000000 +0200
+@@ -72,6 +72,7 @@ static mfp_cfg_t common_mfp_cfg[] __init
+ GPIO25_AC97_SDATA_IN_0,
+ GPIO27_AC97_SDATA_OUT,
+ GPIO28_AC97_SYNC,
++ GPIO17_GPIO, /* SDATA_IN_1 but unused - configure to GPIO */
+
+ /* SSP3 */
+ GPIO91_SSP3_SCLK,
+@@ -126,6 +127,10 @@ static mfp_cfg_t common_mfp_cfg[] __init
+ /* Standard I2C */
+ GPIO21_I2C_SCL,
+ GPIO22_I2C_SDA,
++
++ /* GPIO */
++ GPIO18_GPIO, /* GPIO Expander #0 INT_N */
++ GPIO19_GPIO, /* GPIO Expander #1 INT_N */
+ };
+
+ static mfp_cfg_t pxa300_mfp_cfg[] __initdata = {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-pxa/zylonite_pxa320.c linux-2.6.30-rc4-git/arch/arm/mach-pxa/zylonite_pxa320.c
+--- linux-2.6.30-rc4/arch/arm/mach-pxa/zylonite_pxa320.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-pxa/zylonite_pxa320.c 2009-05-13 09:46:19.000000000 +0200
+@@ -68,6 +68,7 @@ static mfp_cfg_t mfp_cfg[] __initdata =
+ GPIO38_AC97_SYNC,
+ GPIO39_AC97_BITCLK,
+ GPIO40_AC97_nACRESET,
++ GPIO36_GPIO, /* SDATA_IN_1 but unused - configure to GPIO */
+
+ /* SSP3 */
+ GPIO89_SSP3_SCLK,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mach-sa1100/lart.c linux-2.6.30-rc4-git/arch/arm/mach-sa1100/lart.c
+--- linux-2.6.30-rc4/arch/arm/mach-sa1100/lart.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mach-sa1100/lart.c 2009-05-13 09:46:19.000000000 +0200
+@@ -9,6 +9,7 @@
+ #include <mach/hardware.h>
+ #include <asm/setup.h>
+ #include <asm/mach-types.h>
++#include <asm/page.h>
+
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/Makefile linux-2.6.30-rc4-git/arch/arm/Makefile
+--- linux-2.6.30-rc4/arch/arm/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -135,7 +135,6 @@ endif
+ plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c
+ machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
+ machine-$(CONFIG_ARCH_VERSATILE) := versatile
+- machine-$(CONFIG_ARCH_IMX) := imx
+ machine-$(CONFIG_ARCH_H720X) := h720x
+ machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
+ machine-$(CONFIG_ARCH_REALVIEW) := realview
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mm/cache-v6.S linux-2.6.30-rc4-git/arch/arm/mm/cache-v6.S
+--- linux-2.6.30-rc4/arch/arm/mm/cache-v6.S 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mm/cache-v6.S 2009-05-13 09:46:19.000000000 +0200
+@@ -20,6 +20,31 @@
+ #define D_CACHE_LINE_SIZE 32
+ #define BTB_FLUSH_SIZE 8
+
++#ifdef CONFIG_ARM_ERRATA_411920
++/*
++ * Invalidate the entire I cache (this code is a workaround for the ARM1136
++ * erratum 411920 - Invalidate Instruction Cache operation can fail. This
++ * erratum is present in 1136, 1156 and 1176. It does not affect the MPCore.
++ *
++ * Registers:
++ * r0 - set to 0
++ * r1 - corrupted
++ */
++ENTRY(v6_icache_inval_all)
++ mov r0, #0
++ mrs r1, cpsr
++ cpsid ifa @ disable interrupts
++ mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache
++ mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache
++ mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache
++ mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache
++ msr cpsr_cx, r1 @ restore interrupts
++ .rept 11 @ ARM Ltd recommends at least
++ nop @ 11 NOPs
++ .endr
++ mov pc, lr
++#endif
++
+ /*
+ * v6_flush_cache_all()
+ *
+@@ -31,8 +56,12 @@ ENTRY(v6_flush_kern_cache_all)
+ mov r0, #0
+ #ifdef HARVARD_CACHE
+ mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate
++#ifndef CONFIG_ARM_ERRATA_411920
+ mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
+ #else
++ b v6_icache_inval_all
++#endif
++#else
+ mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate
+ #endif
+ mov pc, lr
+@@ -103,8 +132,12 @@ ENTRY(v6_coherent_user_range)
+ mov r0, #0
+ #ifdef HARVARD_CACHE
+ mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
++#ifndef CONFIG_ARM_ERRATA_411920
+ mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
+ #else
++ b v6_icache_inval_all
++#endif
++#else
+ mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB
+ #endif
+ mov pc, lr
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mm/flush.c linux-2.6.30-rc4-git/arch/arm/mm/flush.c
+--- linux-2.6.30-rc4/arch/arm/mm/flush.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mm/flush.c 2009-05-13 09:46:19.000000000 +0200
+@@ -18,6 +18,10 @@
+
+ #include "mm.h"
+
++#ifdef CONFIG_ARM_ERRATA_411920
++extern void v6_icache_inval_all(void);
++#endif
++
+ #ifdef CONFIG_CPU_CACHE_VIPT
+
+ #define ALIAS_FLUSH_START 0xffff4000
+@@ -32,10 +36,15 @@ static void flush_pfn_alias(unsigned lon
+
+ asm( "mcrr p15, 0, %1, %0, c14\n"
+ " mcr p15, 0, %2, c7, c10, 4\n"
++#ifndef CONFIG_ARM_ERRATA_411920
+ " mcr p15, 0, %2, c7, c5, 0\n"
++#endif
+ :
+ : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero)
+ : "cc");
++#ifdef CONFIG_ARM_ERRATA_411920
++ v6_icache_inval_all();
++#endif
+ }
+
+ void flush_cache_mm(struct mm_struct *mm)
+@@ -48,11 +57,16 @@ void flush_cache_mm(struct mm_struct *mm
+
+ if (cache_is_vipt_aliasing()) {
+ asm( "mcr p15, 0, %0, c7, c14, 0\n"
++ " mcr p15, 0, %0, c7, c10, 4\n"
++#ifndef CONFIG_ARM_ERRATA_411920
+ " mcr p15, 0, %0, c7, c5, 0\n"
+- " mcr p15, 0, %0, c7, c10, 4"
++#endif
+ :
+ : "r" (0)
+ : "cc");
++#ifdef CONFIG_ARM_ERRATA_411920
++ v6_icache_inval_all();
++#endif
+ }
+ }
+
+@@ -67,11 +81,16 @@ void flush_cache_range(struct vm_area_st
+
+ if (cache_is_vipt_aliasing()) {
+ asm( "mcr p15, 0, %0, c7, c14, 0\n"
++ " mcr p15, 0, %0, c7, c10, 4\n"
++#ifndef CONFIG_ARM_ERRATA_411920
+ " mcr p15, 0, %0, c7, c5, 0\n"
+- " mcr p15, 0, %0, c7, c10, 4"
++#endif
+ :
+ : "r" (0)
+ : "cc");
++#ifdef CONFIG_ARM_ERRATA_411920
++ v6_icache_inval_all();
++#endif
+ }
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/mm/proc-v7.S linux-2.6.30-rc4-git/arch/arm/mm/proc-v7.S
+--- linux-2.6.30-rc4/arch/arm/mm/proc-v7.S 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/mm/proc-v7.S 2009-05-13 09:46:19.000000000 +0200
+@@ -96,6 +96,9 @@ ENTRY(cpu_v7_switch_mm)
+ mov r2, #0
+ ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
+ orr r0, r0, #TTB_FLAGS
++#ifdef CONFIG_ARM_ERRATA_430973
++ mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
++#endif
+ mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
+ isb
+ 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
+@@ -181,6 +184,22 @@ __v7_setup:
+ stmia r12, {r0-r5, r7, r9, r11, lr}
+ bl v7_flush_dcache_all
+ ldmia r12, {r0-r5, r7, r9, r11, lr}
++#ifdef CONFIG_ARM_ERRATA_430973
++ mrc p15, 0, r10, c1, c0, 1 @ read aux control register
++ orr r10, r10, #(1 << 6) @ set IBE to 1
++ mcr p15, 0, r10, c1, c0, 1 @ write aux control register
++#endif
++#ifdef CONFIG_ARM_ERRATA_458693
++ mrc p15, 0, r10, c1, c0, 1 @ read aux control register
++ orr r10, r10, #(1 << 5) @ set L1NEON to 1
++ orr r10, r10, #(1 << 9) @ set PLDNOP to 1
++ mcr p15, 0, r10, c1, c0, 1 @ write aux control register
++#endif
++#ifdef CONFIG_ARM_ERRATA_460075
++ mrc p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register
++ orr r10, r10, #(1 << 22) @ set the Write Allocate disable bit
++ mcr p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register
++#endif
+ mov r10, #0
+ #ifdef HARVARD_CACHE
+ mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/dma-mx1-mx2.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/dma-mx1-mx2.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/dma-mx1-mx2.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/dma-mx1-mx2.c 2009-05-13 09:46:19.000000000 +0200
+@@ -693,12 +693,15 @@ int imx_dma_request(int channel, const c
+ local_irq_restore(flags);
+ return -EBUSY;
+ }
++ memset(imxdma, 0, sizeof(imxdma));
++ imxdma->name = name;
++ local_irq_restore(flags); /* request_irq() can block */
+
+ #ifdef CONFIG_ARCH_MX2
+ ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA",
+ NULL);
+ if (ret) {
+- local_irq_restore(flags);
++ imxdma->name = NULL;
+ printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n",
+ MXC_INT_DMACH0 + channel, channel);
+ return ret;
+@@ -708,13 +711,6 @@ int imx_dma_request(int channel, const c
+ imxdma->watchdog.data = channel;
+ #endif
+
+- imxdma->name = name;
+- imxdma->irq_handler = NULL;
+- imxdma->err_handler = NULL;
+- imxdma->data = NULL;
+- imxdma->sg = NULL;
+-
+- local_irq_restore(flags);
+ return ret;
+ }
+ EXPORT_SYMBOL(imx_dma_request);
+@@ -737,10 +733,7 @@ void imx_dma_free(int channel)
+
+ local_irq_save(flags);
+ /* Disable interrupts */
+- __raw_writel(__raw_readl(DMA_BASE + DMA_DIMR) | (1 << channel),
+- DMA_BASE + DMA_DIMR);
+- __raw_writel(__raw_readl(DMA_BASE + DMA_CCR(channel)) & ~CCR_CEN,
+- DMA_BASE + DMA_CCR(channel));
++ imx_dma_disable(channel);
+ imxdma->name = NULL;
+
+ #ifdef CONFIG_ARCH_MX2
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/gpio.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/gpio.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/gpio.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/gpio.c 2009-05-13 09:46:19.000000000 +0200
+@@ -64,6 +64,8 @@ static void gpio_unmask_irq(u32 irq)
+ _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1);
+ }
+
++static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset);
++
+ static int gpio_set_irq_type(u32 irq, u32 type)
+ {
+ u32 gpio = irq_to_gpio(irq);
+@@ -72,6 +74,7 @@ static int gpio_set_irq_type(u32 irq, u3
+ int edge;
+ void __iomem *reg = port->base;
+
++ port->both_edges &= ~(1 << (gpio & 31));
+ switch (type) {
+ case IRQ_TYPE_EDGE_RISING:
+ edge = GPIO_INT_RISE_EDGE;
+@@ -79,13 +82,24 @@ static int gpio_set_irq_type(u32 irq, u3
+ case IRQ_TYPE_EDGE_FALLING:
+ edge = GPIO_INT_FALL_EDGE;
+ break;
++ case IRQ_TYPE_EDGE_BOTH:
++ val = mxc_gpio_get(&port->chip, gpio & 31);
++ if (val) {
++ edge = GPIO_INT_LOW_LEV;
++ pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
++ } else {
++ edge = GPIO_INT_HIGH_LEV;
++ pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
++ }
++ port->both_edges |= 1 << (gpio & 31);
++ break;
+ case IRQ_TYPE_LEVEL_LOW:
+ edge = GPIO_INT_LOW_LEV;
+ break;
+ case IRQ_TYPE_LEVEL_HIGH:
+ edge = GPIO_INT_HIGH_LEV;
+ break;
+- default: /* this includes IRQ_TYPE_EDGE_BOTH */
++ default:
+ return -EINVAL;
+ }
+
+@@ -98,6 +112,34 @@ static int gpio_set_irq_type(u32 irq, u3
+ return 0;
+ }
+
++static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
++{
++ void __iomem *reg = port->base;
++ u32 bit, val;
++ int edge;
++
++ reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
++ bit = gpio & 0xf;
++ val = __raw_readl(reg);
++ edge = (val >> (bit << 1)) & 3;
++ val &= ~(0x3 << (bit << 1));
++ switch (edge) {
++ case GPIO_INT_HIGH_LEV:
++ edge = GPIO_INT_LOW_LEV;
++ pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
++ break;
++ case GPIO_INT_LOW_LEV:
++ edge = GPIO_INT_HIGH_LEV;
++ pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
++ break;
++ default:
++ pr_err("mxc: invalid configuration for GPIO %d: %x\n",
++ gpio, edge);
++ return;
++ }
++ __raw_writel(val | (edge << (bit << 1)), reg);
++}
++
+ /* handle n interrupts in one status register */
+ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
+ {
+@@ -105,11 +147,16 @@ static void mxc_gpio_irq_handler(struct
+
+ gpio_irq_no = port->virtual_irq_start;
+ for (; irq_stat != 0; irq_stat >>= 1, gpio_irq_no++) {
++ u32 gpio = irq_to_gpio(gpio_irq_no);
+
+ if ((irq_stat & 1) == 0)
+ continue;
+
+ BUG_ON(!(irq_desc[gpio_irq_no].handle_irq));
++
++ if (port->both_edges & (1 << (gpio & 31)))
++ mxc_flip_edge(port, gpio);
++
+ irq_desc[gpio_irq_no].handle_irq(gpio_irq_no,
+ &irq_desc[gpio_irq_no]);
+ }
+@@ -124,7 +171,7 @@ static void mx3_gpio_irq_handler(u32 irq
+
+ irq_stat = __raw_readl(port->base + GPIO_ISR) &
+ __raw_readl(port->base + GPIO_IMR);
+- BUG_ON(!irq_stat);
++
+ mxc_gpio_irq_handler(port, irq_stat);
+ }
+ #endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx21ads.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx21ads.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx21ads.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx21ads.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,58 @@
++/*
++ * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ */
++
++/*
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++#ifndef __ASM_ARCH_MXC_BOARD_MX21ADS_H__
++#define __ASM_ARCH_MXC_BOARD_MX21ADS_H__
++
++/*
++ * MXC UART EVB board level configurations
++ */
++#define MXC_LL_UART_PADDR UART1_BASE_ADDR
++#define MXC_LL_UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
++
++/*
++ * Memory-mapped I/O on MX21ADS base board
++ */
++#define MX21ADS_MMIO_BASE_ADDR 0xF5000000
++#define MX21ADS_MMIO_SIZE SZ_16M
++
++#define MX21ADS_REG_ADDR(offset) (void __force __iomem *) \
++ (MX21ADS_MMIO_BASE_ADDR + (offset))
++
++#define MX21ADS_CS8900A_IRQ IRQ_GPIOE(11)
++#define MX21ADS_CS8900A_IOBASE_REG MX21ADS_REG_ADDR(0x000000)
++#define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000)
++#define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000)
++#define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000)
++
++/* MX21ADS_IO_REG bit definitions */
++#define MX21ADS_IO_SD_WP 0x0001 /* read */
++#define MX21ADS_IO_TP6 0x0001 /* write */
++#define MX21ADS_IO_SW_SEL 0x0002 /* read */
++#define MX21ADS_IO_TP7 0x0002 /* write */
++#define MX21ADS_IO_RESET_E_UART 0x0004
++#define MX21ADS_IO_RESET_BASE 0x0008
++#define MX21ADS_IO_CSI_CTL2 0x0010
++#define MX21ADS_IO_CSI_CTL1 0x0020
++#define MX21ADS_IO_CSI_CTL0 0x0040
++#define MX21ADS_IO_UART1_EN 0x0080
++#define MX21ADS_IO_UART4_EN 0x0100
++#define MX21ADS_IO_LCDON 0x0200
++#define MX21ADS_IO_IRDA_EN 0x0400
++#define MX21ADS_IO_IRDA_FIR_SEL 0x0800
++#define MX21ADS_IO_IRDA_MD0_B 0x1000
++#define MX21ADS_IO_IRDA_MD1 0x2000
++#define MX21ADS_IO_LED4_ON 0x4000
++#define MX21ADS_IO_LED3_ON 0x8000
++
++#endif /* __ASM_ARCH_MXC_BOARD_MX21ADS_H__ */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx27ads.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx27ads.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx27ads.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx27ads.h 2009-05-13 09:46:19.000000000 +0200
+@@ -47,7 +47,7 @@
+ /*
+ * Base address of PBC controller, CS4
+ */
+-#define PBC_BASE_ADDRESS 0xEB000000
++#define PBC_BASE_ADDRESS 0xf4300000
+ #define PBC_REG_ADDR(offset) (void __force __iomem *) \
+ (PBC_BASE_ADDRESS + (offset))
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx27pdk.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx27pdk.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx27pdk.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,19 @@
++/*
++ * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ */
++
++/*
++ * 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.
++ */
++
++#ifndef __ASM_ARCH_MXC_BOARD_MX27PDK_H__
++#define __ASM_ARCH_MXC_BOARD_MX27PDK_H__
++
++/* mandatory for CONFIG_DEBUG_LL */
++
++#define MXC_LL_UART_PADDR UART1_BASE_ADDR
++#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
++
++#endif /* __ASM_ARCH_MXC_BOARD_MX27PDK_H__ */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31ads.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31ads.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31ads.h 2009-05-13 09:46:19.000000000 +0200
+@@ -114,7 +114,7 @@
+
+ #define MXC_MAX_EXP_IO_LINES 16
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31lite.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31lite.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31lite.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,28 +11,8 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__
+ #define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
+
+-#define MXC_MAX_EXP_IO_LINES 16
+-
+-
+-/*
+- * Memory Size parameters
+- */
+-
+-/*
+- * Size of SDRAM memory
+- */
+-#define SDRAM_MEM_SIZE SZ_128M
+-/*
+- * Size of MBX buffer memory
+- */
+-#define MXC_MBX_MEM_SIZE SZ_16M
+-/*
+- * Size of memory available to kernel
+- */
+-#define MEM_SIZE (SDRAM_MEM_SIZE - MXC_MBX_MEM_SIZE)
+-
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+
+-#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
++#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31moboard.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31moboard.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31moboard.h 2009-05-13 09:46:19.000000000 +0200
+@@ -19,7 +19,7 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
+ #define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31pdk.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-mx31pdk.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-mx31pdk.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,7 +11,7 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__
+ #define __ASM_ARCH_MXC_BOARD_MX31PDK_H__
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm037.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm037.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm037.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm037.h 2009-05-13 09:46:19.000000000 +0200
+@@ -19,7 +19,7 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_PCM037_H__
+ #define __ASM_ARCH_MXC_BOARD_PCM037_H__
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm038.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm038.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm038.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm038.h 2009-05-13 09:46:19.000000000 +0200
+@@ -19,7 +19,7 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_PCM038_H__
+ #define __ASM_ARCH_MXC_BOARD_PCM038_H__
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm043.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm043.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-pcm043.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-pcm043.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,27 @@
++/*
++ * Copyright (C) 2008 Sascha Hauer, Pengutronix
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef __ASM_ARCH_MXC_BOARD_PCM043_H__
++#define __ASM_ARCH_MXC_BOARD_PCM043_H__
++
++/* mandatory for CONFIG_LL_DEBUG */
++
++#define MXC_LL_UART_PADDR UART1_BASE_ADDR
++#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
++
++#endif /* __ASM_ARCH_MXC_BOARD_PCM043_H__ */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-qong.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-qong.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-qong.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-qong.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,7 +11,7 @@
+ #ifndef __ASM_ARCH_MXC_BOARD_QONG_H__
+ #define __ASM_ARCH_MXC_BOARD_QONG_H__
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/common.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/common.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/common.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/common.h 2009-05-13 09:46:19.000000000 +0200
+@@ -14,7 +14,11 @@
+ struct platform_device;
+ struct clk;
+
+-extern void mxc_map_io(void);
++extern void mx1_map_io(void);
++extern void mx21_map_io(void);
++extern void mx27_map_io(void);
++extern void mx31_map_io(void);
++extern void mx35_map_io(void);
+ extern void mxc_init_irq(void);
+ extern void mxc_timer_init(struct clk *timer_clk);
+ extern int mx1_clocks_init(unsigned long fref);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/debug-macro.S linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/debug-macro.S
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/debug-macro.S 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/debug-macro.S 2009-05-13 09:46:19.000000000 +0200
+@@ -25,6 +25,9 @@
+ #ifdef CONFIG_MACH_MX27ADS
+ #include <mach/board-mx27ads.h>
+ #endif
++#ifdef CONFIG_MACH_MX21ADS
++#include <mach/board-mx21ads.h>
++#endif
+ #ifdef CONFIG_MACH_PCM038
+ #include <mach/board-pcm038.h>
+ #endif
+@@ -34,6 +37,12 @@
+ #ifdef CONFIG_MACH_QONG
+ #include <mach/board-qong.h>
+ #endif
++#ifdef CONFIG_MACH_PCM043
++#include <mach/board-pcm043.h>
++#endif
++#ifdef CONFIG_MACH_MX27_3DS
++#include <mach/board-mx27pdk.h>
++#endif
+ .macro addruart,rx
+ mrc p15, 0, \rx, c1, c0
+ tst \rx, #1 @ MMU enabled?
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/gpio.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/gpio.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/gpio.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/gpio.h 2009-05-13 09:46:19.000000000 +0200
+@@ -35,6 +35,7 @@ struct mxc_gpio_port {
+ int irq;
+ int virtual_irq_start;
+ struct gpio_chip chip;
++ u32 both_edges;
+ };
+
+ int mxc_gpio_init(struct mxc_gpio_port*, int);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imxfb.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imxfb.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imxfb.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imxfb.h 2009-05-13 09:46:19.000000000 +0200
+@@ -76,8 +76,8 @@ struct imx_fb_platform_data {
+ u_char * fixed_screen_cpu;
+ dma_addr_t fixed_screen_dma;
+
+- int (*init)(struct platform_device*);
+- int (*exit)(struct platform_device*);
++ int (*init)(struct platform_device *);
++ void (*exit)(struct platform_device *);
+
+ void (*lcd_power)(int);
+ void (*backlight_power)(int);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imx-uart.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imx-uart.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imx-uart.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imx-uart.h 2009-05-13 09:46:19.000000000 +0200
+@@ -23,7 +23,7 @@
+
+ struct imxuart_platform_data {
+ int (*init)(struct platform_device *pdev);
+- int (*exit)(struct platform_device *pdev);
++ void (*exit)(struct platform_device *pdev);
+ unsigned int flags;
+ };
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx35.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx35.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx35.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx35.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,1267 @@
++/*
++ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
++ *
++ * 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, NO_PAD_CTRL) 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., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#ifndef __MACH_IOMUX_MX35_H__
++#define __MACH_IOMUX_MX35_H__
++
++#include <mach/iomux-v3.h>
++
++/*
++ * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
++ * If <padname> or <padmode> refers to a GPIO, it is named
++ * GPIO_<unit>_<num> see also iomux-v3.h
++ */
++
++/* PAD MUX ALT INPSE PATH */
++#define MX35_PAD_CAPTURE__GPT_CAPIN1 IOMUX_PAD(0x328, 0x004, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CAPTURE__GPT_CMPOUT2 IOMUX_PAD(0x328, 0x004, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CAPTURE__CSPI2_SS1 IOMUX_PAD(0x328, 0x004, 2, 0x7f4, 0, NO_PAD_CTRL)
++#define MX35_PAD_CAPTURE__EPIT1_EPITO IOMUX_PAD(0x328, 0x004, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CAPTURE__CCM_CLK32K IOMUX_PAD(0x328, 0x004, 4, 0x7d0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CAPTURE__GPIO1_4 IOMUX_PAD(0x328, 0x004, 5, 0x850, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_COMPARE__GPT_CMPOUT1 IOMUX_PAD(0x32c, 0x008, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_COMPARE__GPT_CAPIN2 IOMUX_PAD(0x32c, 0x008, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_COMPARE__GPT_CMPOUT3 IOMUX_PAD(0x32c, 0x008, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_COMPARE__EPIT2_EPITO IOMUX_PAD(0x32c, 0x008, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_COMPARE__GPIO1_5 IOMUX_PAD(0x32c, 0x008, 5, 0x854, 0, NO_PAD_CTRL)
++#define MX35_PAD_COMPARE__SDMA_EXTDMA_2 IOMUX_PAD(0x32c, 0x008, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_WDOG_RST__WDOG_WDOG_B IOMUX_PAD(0x330, 0x00c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_WDOG_RST__IPU_FLASH_STROBE IOMUX_PAD(0x330, 0x00c, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_WDOG_RST__GPIO1_6 IOMUX_PAD(0x330, 0x00c, 5, 0x858, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_GPIO1_0__GPIO1_0 IOMUX_PAD(0x334, 0x010, 0, 0x82c, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_0__CCM_PMIC_RDY IOMUX_PAD(0x334, 0x010, 1, 0x7d4, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_0__OWIRE_LINE IOMUX_PAD(0x334, 0x010, 2, 0x990, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_0__SDMA_EXTDMA_0 IOMUX_PAD(0x334, 0x010, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_GPIO1_1__GPIO1_1 IOMUX_PAD(0x338, 0x014, 0, 0x838, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_1__PWM_PWMO IOMUX_PAD(0x338, 0x014, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_1__CSPI1_SS2 IOMUX_PAD(0x338, 0x014, 3, 0x7d8, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_1__SCC_TAMPER_DETECT IOMUX_PAD(0x338, 0x014, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO1_1__SDMA_EXTDMA_1 IOMUX_PAD(0x338, 0x014, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_GPIO2_0__GPIO2_0 IOMUX_PAD(0x33c, 0x018, 0, 0x868, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO2_0__USB_TOP_USBOTG_CLK IOMUX_PAD(0x33c, 0x018, 1, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_GPIO3_0__GPIO3_0 IOMUX_PAD(0x340, 0x01c, 0, 0x8e8, 0, NO_PAD_CTRL)
++#define MX35_PAD_GPIO3_0__USB_TOP_USBH2_CLK IOMUX_PAD(0x340, 0x01c, 1, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RESET_IN_B__CCM_RESET_IN_B IOMUX_PAD(0x344, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_POR_B__CCM_POR_B IOMUX_PAD(0x348, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CLKO__CCM_CLKO IOMUX_PAD(0x34c, 0x020, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CLKO__GPIO1_8 IOMUX_PAD(0x34c, 0x020, 5, 0x860, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_BOOT_MODE0__CCM_BOOT_MODE_0 IOMUX_PAD(0x350, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_BOOT_MODE1__CCM_BOOT_MODE_1 IOMUX_PAD(0x354, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CLK_MODE0__CCM_CLK_MODE_0 IOMUX_PAD(0x358, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CLK_MODE1__CCM_CLK_MODE_1 IOMUX_PAD(0x35c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_POWER_FAIL__CCM_DSM_WAKEUP_INT_26 IOMUX_PAD(0x360, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_VSTBY__CCM_VSTBY IOMUX_PAD(0x364, 0x024, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_VSTBY__GPIO1_7 IOMUX_PAD(0x364, 0x024, 5, 0x85c, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A0__EMI_EIM_DA_L_0 IOMUX_PAD(0x368, 0x028, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A1__EMI_EIM_DA_L_1 IOMUX_PAD(0x36c, 0x02c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A2__EMI_EIM_DA_L_2 IOMUX_PAD(0x370, 0x030, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A3__EMI_EIM_DA_L_3 IOMUX_PAD(0x374, 0x034, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A4__EMI_EIM_DA_L_4 IOMUX_PAD(0x378, 0x038, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A5__EMI_EIM_DA_L_5 IOMUX_PAD(0x37c, 0x03c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A6__EMI_EIM_DA_L_6 IOMUX_PAD(0x380, 0x040, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A7__EMI_EIM_DA_L_7 IOMUX_PAD(0x384, 0x044, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A8__EMI_EIM_DA_H_8 IOMUX_PAD(0x388, 0x048, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A9__EMI_EIM_DA_H_9 IOMUX_PAD(0x38c, 0x04c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A10__EMI_EIM_DA_H_10 IOMUX_PAD(0x390, 0x050, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_MA10__EMI_MA10 IOMUX_PAD(0x394, 0x054, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A11__EMI_EIM_DA_H_11 IOMUX_PAD(0x398, 0x058, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A12__EMI_EIM_DA_H_12 IOMUX_PAD(0x39c, 0x05c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A13__EMI_EIM_DA_H_13 IOMUX_PAD(0x3a0, 0x060, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A14__EMI_EIM_DA_H2_14 IOMUX_PAD(0x3a4, 0x064, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A15__EMI_EIM_DA_H2_15 IOMUX_PAD(0x3a8, 0x068, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A16__EMI_EIM_A_16 IOMUX_PAD(0x3ac, 0x06c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A17__EMI_EIM_A_17 IOMUX_PAD(0x3b0, 0x070, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A18__EMI_EIM_A_18 IOMUX_PAD(0x3b4, 0x074, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A19__EMI_EIM_A_19 IOMUX_PAD(0x3b8, 0x078, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A20__EMI_EIM_A_20 IOMUX_PAD(0x3bc, 0x07c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A21__EMI_EIM_A_21 IOMUX_PAD(0x3c0, 0x080, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A22__EMI_EIM_A_22 IOMUX_PAD(0x3c4, 0x084, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A23__EMI_EIM_A_23 IOMUX_PAD(0x3c8, 0x088, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A24__EMI_EIM_A_24 IOMUX_PAD(0x3cc, 0x08c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_A25__EMI_EIM_A_25 IOMUX_PAD(0x3d0, 0x090, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDBA1__EMI_EIM_SDBA1 IOMUX_PAD(0x3d4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDBA0__EMI_EIM_SDBA0 IOMUX_PAD(0x3d8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD0__EMI_DRAM_D_0 IOMUX_PAD(0x3dc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1__EMI_DRAM_D_1 IOMUX_PAD(0x3e0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2__EMI_DRAM_D_2 IOMUX_PAD(0x3e4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD3__EMI_DRAM_D_3 IOMUX_PAD(0x3e8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD4__EMI_DRAM_D_4 IOMUX_PAD(0x3ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD5__EMI_DRAM_D_5 IOMUX_PAD(0x3f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD6__EMI_DRAM_D_6 IOMUX_PAD(0x3f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD7__EMI_DRAM_D_7 IOMUX_PAD(0x3f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD8__EMI_DRAM_D_8 IOMUX_PAD(0x3fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD9__EMI_DRAM_D_9 IOMUX_PAD(0x400, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD10__EMI_DRAM_D_10 IOMUX_PAD(0x404, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD11__EMI_DRAM_D_11 IOMUX_PAD(0x408, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD12__EMI_DRAM_D_12 IOMUX_PAD(0x40c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD13__EMI_DRAM_D_13 IOMUX_PAD(0x410, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD14__EMI_DRAM_D_14 IOMUX_PAD(0x414, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD15__EMI_DRAM_D_15 IOMUX_PAD(0x418, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD16__EMI_DRAM_D_16 IOMUX_PAD(0x41c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD17__EMI_DRAM_D_17 IOMUX_PAD(0x420, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD18__EMI_DRAM_D_18 IOMUX_PAD(0x424, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD19__EMI_DRAM_D_19 IOMUX_PAD(0x428, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD20__EMI_DRAM_D_20 IOMUX_PAD(0x42c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD21__EMI_DRAM_D_21 IOMUX_PAD(0x430, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD22__EMI_DRAM_D_22 IOMUX_PAD(0x434, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD23__EMI_DRAM_D_23 IOMUX_PAD(0x438, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD24__EMI_DRAM_D_24 IOMUX_PAD(0x43c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD25__EMI_DRAM_D_25 IOMUX_PAD(0x440, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD26__EMI_DRAM_D_26 IOMUX_PAD(0x444, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD27__EMI_DRAM_D_27 IOMUX_PAD(0x448, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD28__EMI_DRAM_D_28 IOMUX_PAD(0x44c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD29__EMI_DRAM_D_29 IOMUX_PAD(0x450, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD30__EMI_DRAM_D_30 IOMUX_PAD(0x454, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD31__EMI_DRAM_D_31 IOMUX_PAD(0x458, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_DQM0__EMI_DRAM_DQM_0 IOMUX_PAD(0x45c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_DQM1__EMI_DRAM_DQM_1 IOMUX_PAD(0x460, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_DQM2__EMI_DRAM_DQM_2 IOMUX_PAD(0x464, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_DQM3__EMI_DRAM_DQM_3 IOMUX_PAD(0x468, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_EB0__EMI_EIM_EB0_B IOMUX_PAD(0x46c, 0x094, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_EB1__EMI_EIM_EB1_B IOMUX_PAD(0x470, 0x098, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_OE__EMI_EIM_OE IOMUX_PAD(0x474, 0x09c, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS0__EMI_EIM_CS0 IOMUX_PAD(0x478, 0x0a0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS1__EMI_EIM_CS1 IOMUX_PAD(0x47c, 0x0a4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS1__EMI_NANDF_CE3 IOMUX_PAD(0x47c, 0x0a4, 3, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS2__EMI_EIM_CS2 IOMUX_PAD(0x480, 0x0a8, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS3__EMI_EIM_CS3 IOMUX_PAD(0x484, 0x0ac, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS4__EMI_EIM_CS4 IOMUX_PAD(0x488, 0x0b0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS4__EMI_DTACK_B IOMUX_PAD(0x488, 0x0b0, 1, 0x800, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS4__EMI_NANDF_CE1 IOMUX_PAD(0x488, 0x0b0, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS4__GPIO1_20 IOMUX_PAD(0x488, 0x0b0, 5, 0x83c, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CS5__EMI_EIM_CS5 IOMUX_PAD(0x48c, 0x0b4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS5__CSPI2_SS2 IOMUX_PAD(0x48c, 0x0b4, 1, 0x7f8, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS5__CSPI1_SS2 IOMUX_PAD(0x48c, 0x0b4, 2, 0x7d8, 1, NO_PAD_CTRL)
++#define MX35_PAD_CS5__EMI_NANDF_CE2 IOMUX_PAD(0x48c, 0x0b4, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CS5__GPIO1_21 IOMUX_PAD(0x48c, 0x0b4, 5, 0x840, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NF_CE0__EMI_NANDF_CE0 IOMUX_PAD(0x490, 0x0b8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NF_CE0__GPIO1_22 IOMUX_PAD(0x490, 0x0b8, 5, 0x844, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ECB__EMI_EIM_ECB IOMUX_PAD(0x494, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LBA__EMI_EIM_LBA IOMUX_PAD(0x498, 0x0bc, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_BCLK__EMI_EIM_BCLK IOMUX_PAD(0x49c, 0x0c0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RW__EMI_EIM_RW IOMUX_PAD(0x4a0, 0x0c4, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RAS__EMI_DRAM_RAS IOMUX_PAD(0x4a4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CAS__EMI_DRAM_CAS IOMUX_PAD(0x4a8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDWE__EMI_DRAM_SDWE IOMUX_PAD(0x4ac, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDCKE0__EMI_DRAM_SDCKE_0 IOMUX_PAD(0x4b0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDCKE1__EMI_DRAM_SDCKE_1 IOMUX_PAD(0x4b4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDCLK__EMI_DRAM_SDCLK IOMUX_PAD(0x4b8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDQS0__EMI_DRAM_SDQS_0 IOMUX_PAD(0x4bc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDQS1__EMI_DRAM_SDQS_1 IOMUX_PAD(0x4c0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDQS2__EMI_DRAM_SDQS_2 IOMUX_PAD(0x4c4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SDQS3__EMI_DRAM_SDQS_3 IOMUX_PAD(0x4c8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFWE_B__EMI_NANDF_WE_B IOMUX_PAD(0x4cc, 0x0c8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWE_B__USB_TOP_USBH2_DATA_3 IOMUX_PAD(0x4cc, 0x0c8, 1, 0x9d8, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWE_B__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x4cc, 0x0c8, 2, 0x924, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWE_B__GPIO2_18 IOMUX_PAD(0x4cc, 0x0c8, 5, 0x88c, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWE_B__ARM11P_TOP_TRACE_0 IOMUX_PAD(0x4cc, 0x0c8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFRE_B__EMI_NANDF_RE_B IOMUX_PAD(0x4d0, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRE_B__USB_TOP_USBH2_DIR IOMUX_PAD(0x4d0, 0x0cc, 1, 0x9ec, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRE_B__IPU_DISPB_BCLK IOMUX_PAD(0x4d0, 0x0cc, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRE_B__GPIO2_19 IOMUX_PAD(0x4d0, 0x0cc, 5, 0x890, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRE_B__ARM11P_TOP_TRACE_1 IOMUX_PAD(0x4d0, 0x0cc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFALE__EMI_NANDF_ALE IOMUX_PAD(0x4d4, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFALE__USB_TOP_USBH2_STP IOMUX_PAD(0x4d4, 0x0d0, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFALE__IPU_DISPB_CS0 IOMUX_PAD(0x4d4, 0x0d0, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFALE__GPIO2_20 IOMUX_PAD(0x4d4, 0x0d0, 5, 0x898, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFALE__ARM11P_TOP_TRACE_2 IOMUX_PAD(0x4d4, 0x0d0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFCLE__EMI_NANDF_CLE IOMUX_PAD(0x4d8, 0x0d4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFCLE__USB_TOP_USBH2_NXT IOMUX_PAD(0x4d8, 0x0d4, 1, 0x9f0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFCLE__IPU_DISPB_PAR_RS IOMUX_PAD(0x4d8, 0x0d4, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFCLE__GPIO2_21 IOMUX_PAD(0x4d8, 0x0d4, 5, 0x89c, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFCLE__ARM11P_TOP_TRACE_3 IOMUX_PAD(0x4d8, 0x0d4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFWP_B__EMI_NANDF_WP_B IOMUX_PAD(0x4dc, 0x0d8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWP_B__USB_TOP_USBH2_DATA_7 IOMUX_PAD(0x4dc, 0x0d8, 1, 0x9e8, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWP_B__IPU_DISPB_WR IOMUX_PAD(0x4dc, 0x0d8, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWP_B__GPIO2_22 IOMUX_PAD(0x4dc, 0x0d8, 5, 0x8a0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFWP_B__ARM11P_TOP_TRCTL IOMUX_PAD(0x4dc, 0x0d8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_NFRB__EMI_NANDF_RB IOMUX_PAD(0x4e0, 0x0dc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRB__IPU_DISPB_RD IOMUX_PAD(0x4e0, 0x0dc, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRB__GPIO2_23 IOMUX_PAD(0x4e0, 0x0dc, 5, 0x8a4, 0, NO_PAD_CTRL)
++#define MX35_PAD_NFRB__ARM11P_TOP_TRCLK IOMUX_PAD(0x4e0, 0x0dc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D15__EMI_EIM_D_15 IOMUX_PAD(0x4e4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D14__EMI_EIM_D_14 IOMUX_PAD(0x4e8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D13__EMI_EIM_D_13 IOMUX_PAD(0x4ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D12__EMI_EIM_D_12 IOMUX_PAD(0x4f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D11__EMI_EIM_D_11 IOMUX_PAD(0x4f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D10__EMI_EIM_D_10 IOMUX_PAD(0x4f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D9__EMI_EIM_D_9 IOMUX_PAD(0x4fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D8__EMI_EIM_D_8 IOMUX_PAD(0x500, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D7__EMI_EIM_D_7 IOMUX_PAD(0x504, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D6__EMI_EIM_D_6 IOMUX_PAD(0x508, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D5__EMI_EIM_D_5 IOMUX_PAD(0x50c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D4__EMI_EIM_D_4 IOMUX_PAD(0x510, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3__EMI_EIM_D_3 IOMUX_PAD(0x514, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D2__EMI_EIM_D_2 IOMUX_PAD(0x518, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D1__EMI_EIM_D_1 IOMUX_PAD(0x51c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D0__EMI_EIM_D_0 IOMUX_PAD(0x520, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D8__IPU_CSI_D_8 IOMUX_PAD(0x524, 0x0e0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D8__KPP_COL_0 IOMUX_PAD(0x524, 0x0e0, 1, 0x950, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D8__GPIO1_20 IOMUX_PAD(0x524, 0x0e0, 5, 0x83c, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D8__ARM11P_TOP_EVNTBUS_13 IOMUX_PAD(0x524, 0x0e0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D9__IPU_CSI_D_9 IOMUX_PAD(0x528, 0x0e4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D9__KPP_COL_1 IOMUX_PAD(0x528, 0x0e4, 1, 0x954, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D9__GPIO1_21 IOMUX_PAD(0x528, 0x0e4, 5, 0x840, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D9__ARM11P_TOP_EVNTBUS_14 IOMUX_PAD(0x528, 0x0e4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D10__IPU_CSI_D_10 IOMUX_PAD(0x52c, 0x0e8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D10__KPP_COL_2 IOMUX_PAD(0x52c, 0x0e8, 1, 0x958, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D10__GPIO1_22 IOMUX_PAD(0x52c, 0x0e8, 5, 0x844, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D10__ARM11P_TOP_EVNTBUS_15 IOMUX_PAD(0x52c, 0x0e8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D11__IPU_CSI_D_11 IOMUX_PAD(0x530, 0x0ec, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D11__KPP_COL_3 IOMUX_PAD(0x530, 0x0ec, 1, 0x95c, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D11__GPIO1_23 IOMUX_PAD(0x530, 0x0ec, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D12__IPU_CSI_D_12 IOMUX_PAD(0x534, 0x0f0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D12__KPP_ROW_0 IOMUX_PAD(0x534, 0x0f0, 1, 0x970, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D12__GPIO1_24 IOMUX_PAD(0x534, 0x0f0, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D13__IPU_CSI_D_13 IOMUX_PAD(0x538, 0x0f4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D13__KPP_ROW_1 IOMUX_PAD(0x538, 0x0f4, 1, 0x974, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D13__GPIO1_25 IOMUX_PAD(0x538, 0x0f4, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D14__IPU_CSI_D_14 IOMUX_PAD(0x53c, 0x0f8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D14__KPP_ROW_2 IOMUX_PAD(0x53c, 0x0f8, 1, 0x978, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D14__GPIO1_26 IOMUX_PAD(0x53c, 0x0f8, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_D15__IPU_CSI_D_15 IOMUX_PAD(0x540, 0x0fc, 0, 0x97c, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D15__KPP_ROW_3 IOMUX_PAD(0x540, 0x0fc, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_D15__GPIO1_27 IOMUX_PAD(0x540, 0x0fc, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_MCLK__IPU_CSI_MCLK IOMUX_PAD(0x544, 0x100, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_MCLK__GPIO1_28 IOMUX_PAD(0x544, 0x100, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC IOMUX_PAD(0x548, 0x104, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_VSYNC__GPIO1_29 IOMUX_PAD(0x548, 0x104, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_HSYNC__IPU_CSI_HSYNC IOMUX_PAD(0x54c, 0x108, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_HSYNC__GPIO1_30 IOMUX_PAD(0x54c, 0x108, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK IOMUX_PAD(0x550, 0x10c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSI_PIXCLK__GPIO1_31 IOMUX_PAD(0x550, 0x10c, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_I2C1_CLK__I2C1_SCL IOMUX_PAD(0x554, 0x110, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C1_CLK__GPIO2_24 IOMUX_PAD(0x554, 0x110, 5, 0x8a8, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C1_CLK__CCM_USB_BYP_CLK IOMUX_PAD(0x554, 0x110, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_I2C1_DAT__I2C1_SDA IOMUX_PAD(0x558, 0x114, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C1_DAT__GPIO2_25 IOMUX_PAD(0x558, 0x114, 5, 0x8ac, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_I2C2_CLK__I2C2_SCL IOMUX_PAD(0x55c, 0x118, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_CLK__CAN1_TXCAN IOMUX_PAD(0x55c, 0x118, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR IOMUX_PAD(0x55c, 0x118, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_CLK__GPIO2_26 IOMUX_PAD(0x55c, 0x118, 5, 0x8b0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_CLK__SDMA_DEBUG_BUS_DEVICE_2 IOMUX_PAD(0x55c, 0x118, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_I2C2_DAT__I2C2_SDA IOMUX_PAD(0x560, 0x11c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_DAT__CAN1_RXCAN IOMUX_PAD(0x560, 0x11c, 1, 0x7c8, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC IOMUX_PAD(0x560, 0x11c, 2, 0x9f4, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_DAT__GPIO2_27 IOMUX_PAD(0x560, 0x11c, 5, 0x8b4, 0, NO_PAD_CTRL)
++#define MX35_PAD_I2C2_DAT__SDMA_DEBUG_BUS_DEVICE_3 IOMUX_PAD(0x560, 0x11c, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_STXD4__AUDMUX_AUD4_TXD IOMUX_PAD(0x564, 0x120, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXD4__GPIO2_28 IOMUX_PAD(0x564, 0x120, 5, 0x8b8, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXD4__ARM11P_TOP_ARM_COREASID0 IOMUX_PAD(0x564, 0x120, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SRXD4__AUDMUX_AUD4_RXD IOMUX_PAD(0x568, 0x124, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SRXD4__GPIO2_29 IOMUX_PAD(0x568, 0x124, 5, 0x8bc, 0, NO_PAD_CTRL)
++#define MX35_PAD_SRXD4__ARM11P_TOP_ARM_COREASID1 IOMUX_PAD(0x568, 0x124, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SCK4__AUDMUX_AUD4_TXC IOMUX_PAD(0x56c, 0x128, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK4__GPIO2_30 IOMUX_PAD(0x56c, 0x128, 5, 0x8c4, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK4__ARM11P_TOP_ARM_COREASID2 IOMUX_PAD(0x56c, 0x128, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS IOMUX_PAD(0x570, 0x12c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXFS4__GPIO2_31 IOMUX_PAD(0x570, 0x12c, 5, 0x8c8, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXFS4__ARM11P_TOP_ARM_COREASID3 IOMUX_PAD(0x570, 0x12c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_STXD5__AUDMUX_AUD5_TXD IOMUX_PAD(0x574, 0x130, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXD5__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x574, 0x130, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXD5__CSPI2_MOSI IOMUX_PAD(0x574, 0x130, 2, 0x7ec, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXD5__GPIO1_0 IOMUX_PAD(0x574, 0x130, 5, 0x82c, 1, NO_PAD_CTRL)
++#define MX35_PAD_STXD5__ARM11P_TOP_ARM_COREASID4 IOMUX_PAD(0x574, 0x130, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SRXD5__AUDMUX_AUD5_RXD IOMUX_PAD(0x578, 0x134, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SRXD5__SPDIF_SPDIF_IN1 IOMUX_PAD(0x578, 0x134, 1, 0x998, 0, NO_PAD_CTRL)
++#define MX35_PAD_SRXD5__CSPI2_MISO IOMUX_PAD(0x578, 0x134, 2, 0x7e8, 0, NO_PAD_CTRL)
++#define MX35_PAD_SRXD5__GPIO1_1 IOMUX_PAD(0x578, 0x134, 5, 0x838, 1, NO_PAD_CTRL)
++#define MX35_PAD_SRXD5__ARM11P_TOP_ARM_COREASID5 IOMUX_PAD(0x578, 0x134, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SCK5__AUDMUX_AUD5_TXC IOMUX_PAD(0x57c, 0x138, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK5__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x57c, 0x138, 1, 0x994, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK5__CSPI2_SCLK IOMUX_PAD(0x57c, 0x138, 2, 0x7e0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK5__GPIO1_2 IOMUX_PAD(0x57c, 0x138, 5, 0x848, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCK5__ARM11P_TOP_ARM_COREASID6 IOMUX_PAD(0x57c, 0x138, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_STXFS5__AUDMUX_AUD5_TXFS IOMUX_PAD(0x580, 0x13c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXFS5__CSPI2_RDY IOMUX_PAD(0x580, 0x13c, 2, 0x7e4, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXFS5__GPIO1_3 IOMUX_PAD(0x580, 0x13c, 5, 0x84c, 0, NO_PAD_CTRL)
++#define MX35_PAD_STXFS5__ARM11P_TOP_ARM_COREASID7 IOMUX_PAD(0x580, 0x13c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SCKR__ESAI_SCKR IOMUX_PAD(0x584, 0x140, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCKR__GPIO1_4 IOMUX_PAD(0x584, 0x140, 5, 0x850, 1, NO_PAD_CTRL)
++#define MX35_PAD_SCKR__ARM11P_TOP_EVNTBUS_10 IOMUX_PAD(0x584, 0x140, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FSR__ESAI_FSR IOMUX_PAD(0x588, 0x144, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FSR__GPIO1_5 IOMUX_PAD(0x588, 0x144, 5, 0x854, 1, NO_PAD_CTRL)
++#define MX35_PAD_FSR__ARM11P_TOP_EVNTBUS_11 IOMUX_PAD(0x588, 0x144, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_HCKR__ESAI_HCKR IOMUX_PAD(0x58c, 0x148, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKR__AUDMUX_AUD5_RXFS IOMUX_PAD(0x58c, 0x148, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKR__CSPI2_SS0 IOMUX_PAD(0x58c, 0x148, 2, 0x7f0, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKR__IPU_FLASH_STROBE IOMUX_PAD(0x58c, 0x148, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKR__GPIO1_6 IOMUX_PAD(0x58c, 0x148, 5, 0x858, 1, NO_PAD_CTRL)
++#define MX35_PAD_HCKR__ARM11P_TOP_EVNTBUS_12 IOMUX_PAD(0x58c, 0x148, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SCKT__ESAI_SCKT IOMUX_PAD(0x590, 0x14c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCKT__GPIO1_7 IOMUX_PAD(0x590, 0x14c, 5, 0x85c, 1, NO_PAD_CTRL)
++#define MX35_PAD_SCKT__IPU_CSI_D_0 IOMUX_PAD(0x590, 0x14c, 6, 0x930, 0, NO_PAD_CTRL)
++#define MX35_PAD_SCKT__KPP_ROW_2 IOMUX_PAD(0x590, 0x14c, 7, 0x978, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_FST__ESAI_FST IOMUX_PAD(0x594, 0x150, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FST__GPIO1_8 IOMUX_PAD(0x594, 0x150, 5, 0x860, 1, NO_PAD_CTRL)
++#define MX35_PAD_FST__IPU_CSI_D_1 IOMUX_PAD(0x594, 0x150, 6, 0x934, 0, NO_PAD_CTRL)
++#define MX35_PAD_FST__KPP_ROW_3 IOMUX_PAD(0x594, 0x150, 7, 0x97c, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_HCKT__ESAI_HCKT IOMUX_PAD(0x598, 0x154, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKT__AUDMUX_AUD5_RXC IOMUX_PAD(0x598, 0x154, 1, 0x7a8, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKT__GPIO1_9 IOMUX_PAD(0x598, 0x154, 5, 0x864, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKT__IPU_CSI_D_2 IOMUX_PAD(0x598, 0x154, 6, 0x938, 0, NO_PAD_CTRL)
++#define MX35_PAD_HCKT__KPP_COL_3 IOMUX_PAD(0x598, 0x154, 7, 0x95c, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_TX5_RX0__ESAI_TX5_RX0 IOMUX_PAD(0x59c, 0x158, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__AUDMUX_AUD4_RXC IOMUX_PAD(0x59c, 0x158, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__CSPI2_SS2 IOMUX_PAD(0x59c, 0x158, 2, 0x7f8, 1, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__CAN2_TXCAN IOMUX_PAD(0x59c, 0x158, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__UART2_DTR IOMUX_PAD(0x59c, 0x158, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__GPIO1_10 IOMUX_PAD(0x59c, 0x158, 5, 0x830, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX5_RX0__EMI_M3IF_CHOSEN_MASTER_0 IOMUX_PAD(0x59c, 0x158, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TX4_RX1__ESAI_TX4_RX1 IOMUX_PAD(0x5a0, 0x15c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__AUDMUX_AUD4_RXFS IOMUX_PAD(0x5a0, 0x15c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__CSPI2_SS3 IOMUX_PAD(0x5a0, 0x15c, 2, 0x7fc, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__CAN2_RXCAN IOMUX_PAD(0x5a0, 0x15c, 3, 0x7cc, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__UART2_DSR IOMUX_PAD(0x5a0, 0x15c, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__GPIO1_11 IOMUX_PAD(0x5a0, 0x15c, 5, 0x834, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__IPU_CSI_D_3 IOMUX_PAD(0x5a0, 0x15c, 6, 0x93c, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX4_RX1__KPP_ROW_0 IOMUX_PAD(0x5a0, 0x15c, 7, 0x970, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_TX3_RX2__ESAI_TX3_RX2 IOMUX_PAD(0x5a4, 0x160, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX3_RX2__I2C3_SCL IOMUX_PAD(0x5a4, 0x160, 1, 0x91c, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX3_RX2__EMI_NANDF_CE1 IOMUX_PAD(0x5a4, 0x160, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX3_RX2__GPIO1_12 IOMUX_PAD(0x5a4, 0x160, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX3_RX2__IPU_CSI_D_4 IOMUX_PAD(0x5a4, 0x160, 6, 0x940, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX3_RX2__KPP_ROW_1 IOMUX_PAD(0x5a4, 0x160, 7, 0x974, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_TX2_RX3__ESAI_TX2_RX3 IOMUX_PAD(0x5a8, 0x164, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX2_RX3__I2C3_SDA IOMUX_PAD(0x5a8, 0x164, 1, 0x920, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX2_RX3__EMI_NANDF_CE2 IOMUX_PAD(0x5a8, 0x164, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX2_RX3__GPIO1_13 IOMUX_PAD(0x5a8, 0x164, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX2_RX3__IPU_CSI_D_5 IOMUX_PAD(0x5a8, 0x164, 6, 0x944, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX2_RX3__KPP_COL_0 IOMUX_PAD(0x5a8, 0x164, 7, 0x950, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_TX1__ESAI_TX1 IOMUX_PAD(0x5ac, 0x168, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX1__CCM_PMIC_RDY IOMUX_PAD(0x5ac, 0x168, 1, 0x7d4, 1, NO_PAD_CTRL)
++#define MX35_PAD_TX1__CSPI1_SS2 IOMUX_PAD(0x5ac, 0x168, 2, 0x7d8, 2, NO_PAD_CTRL)
++#define MX35_PAD_TX1__EMI_NANDF_CE3 IOMUX_PAD(0x5ac, 0x168, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX1__UART2_RI IOMUX_PAD(0x5ac, 0x168, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX1__GPIO1_14 IOMUX_PAD(0x5ac, 0x168, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX1__IPU_CSI_D_6 IOMUX_PAD(0x5ac, 0x168, 6, 0x948, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX1__KPP_COL_1 IOMUX_PAD(0x5ac, 0x168, 7, 0x954, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_TX0__ESAI_TX0 IOMUX_PAD(0x5b0, 0x16c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX0__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x5b0, 0x16c, 1, 0x994, 1, NO_PAD_CTRL)
++#define MX35_PAD_TX0__CSPI1_SS3 IOMUX_PAD(0x5b0, 0x16c, 2, 0x7dc, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX0__EMI_DTACK_B IOMUX_PAD(0x5b0, 0x16c, 3, 0x800, 1, NO_PAD_CTRL)
++#define MX35_PAD_TX0__UART2_DCD IOMUX_PAD(0x5b0, 0x16c, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX0__GPIO1_15 IOMUX_PAD(0x5b0, 0x16c, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX0__IPU_CSI_D_7 IOMUX_PAD(0x5b0, 0x16c, 6, 0x94c, 0, NO_PAD_CTRL)
++#define MX35_PAD_TX0__KPP_COL_2 IOMUX_PAD(0x5b0, 0x16c, 7, 0x958, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_MOSI__CSPI1_MOSI IOMUX_PAD(0x5b4, 0x170, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_MOSI__GPIO1_16 IOMUX_PAD(0x5b4, 0x170, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_MOSI__ECT_CTI_TRIG_OUT1_2 IOMUX_PAD(0x5b4, 0x170, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_MISO__CSPI1_MISO IOMUX_PAD(0x5b8, 0x174, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_MISO__GPIO1_17 IOMUX_PAD(0x5b8, 0x174, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_MISO__ECT_CTI_TRIG_OUT1_3 IOMUX_PAD(0x5b8, 0x174, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_SS0__CSPI1_SS0 IOMUX_PAD(0x5bc, 0x178, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS0__OWIRE_LINE IOMUX_PAD(0x5bc, 0x178, 1, 0x990, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS0__CSPI2_SS3 IOMUX_PAD(0x5bc, 0x178, 2, 0x7fc, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS0__GPIO1_18 IOMUX_PAD(0x5bc, 0x178, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS0__ECT_CTI_TRIG_OUT1_4 IOMUX_PAD(0x5bc, 0x178, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_SS1__CSPI1_SS1 IOMUX_PAD(0x5c0, 0x17c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS1__PWM_PWMO IOMUX_PAD(0x5c0, 0x17c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS1__CCM_CLK32K IOMUX_PAD(0x5c0, 0x17c, 2, 0x7d0, 1, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS1__GPIO1_19 IOMUX_PAD(0x5c0, 0x17c, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS1__IPU_DIAGB_29 IOMUX_PAD(0x5c0, 0x17c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SS1__ECT_CTI_TRIG_OUT1_5 IOMUX_PAD(0x5c0, 0x17c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_SCLK__CSPI1_SCLK IOMUX_PAD(0x5c4, 0x180, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SCLK__GPIO3_4 IOMUX_PAD(0x5c4, 0x180, 5, 0x904, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SCLK__IPU_DIAGB_30 IOMUX_PAD(0x5c4, 0x180, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SCLK__EMI_M3IF_CHOSEN_MASTER_1 IOMUX_PAD(0x5c4, 0x180, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CSPI1_SPI_RDY__CSPI1_RDY IOMUX_PAD(0x5c8, 0x184, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SPI_RDY__GPIO3_5 IOMUX_PAD(0x5c8, 0x184, 5, 0x908, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SPI_RDY__IPU_DIAGB_31 IOMUX_PAD(0x5c8, 0x184, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CSPI1_SPI_RDY__EMI_M3IF_CHOSEN_MASTER_2 IOMUX_PAD(0x5c8, 0x184, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RXD1__UART1_RXD_MUX IOMUX_PAD(0x5cc, 0x188, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RXD1__CSPI2_MOSI IOMUX_PAD(0x5cc, 0x188, 1, 0x7ec, 1, NO_PAD_CTRL)
++#define MX35_PAD_RXD1__KPP_COL_4 IOMUX_PAD(0x5cc, 0x188, 4, 0x960, 0, NO_PAD_CTRL)
++#define MX35_PAD_RXD1__GPIO3_6 IOMUX_PAD(0x5cc, 0x188, 5, 0x90c, 0, NO_PAD_CTRL)
++#define MX35_PAD_RXD1__ARM11P_TOP_EVNTBUS_16 IOMUX_PAD(0x5cc, 0x188, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TXD1__UART1_TXD_MUX IOMUX_PAD(0x5d0, 0x18c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TXD1__CSPI2_MISO IOMUX_PAD(0x5d0, 0x18c, 1, 0x7e8, 1, NO_PAD_CTRL)
++#define MX35_PAD_TXD1__KPP_COL_5 IOMUX_PAD(0x5d0, 0x18c, 4, 0x964, 0, NO_PAD_CTRL)
++#define MX35_PAD_TXD1__GPIO3_7 IOMUX_PAD(0x5d0, 0x18c, 5, 0x910, 0, NO_PAD_CTRL)
++#define MX35_PAD_TXD1__ARM11P_TOP_EVNTBUS_17 IOMUX_PAD(0x5d0, 0x18c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RTS1__UART1_RTS IOMUX_PAD(0x5d4, 0x190, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__CSPI2_SCLK IOMUX_PAD(0x5d4, 0x190, 1, 0x7e0, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__I2C3_SCL IOMUX_PAD(0x5d4, 0x190, 2, 0x91c, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__IPU_CSI_D_0 IOMUX_PAD(0x5d4, 0x190, 3, 0x930, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__KPP_COL_6 IOMUX_PAD(0x5d4, 0x190, 4, 0x968, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__GPIO3_8 IOMUX_PAD(0x5d4, 0x190, 5, 0x914, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__EMI_NANDF_CE1 IOMUX_PAD(0x5d4, 0x190, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS1__ARM11P_TOP_EVNTBUS_18 IOMUX_PAD(0x5d4, 0x190, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CTS1__UART1_CTS IOMUX_PAD(0x5d8, 0x194, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__CSPI2_RDY IOMUX_PAD(0x5d8, 0x194, 1, 0x7e4, 1, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__I2C3_SDA IOMUX_PAD(0x5d8, 0x194, 2, 0x920, 1, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__IPU_CSI_D_1 IOMUX_PAD(0x5d8, 0x194, 3, 0x934, 1, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__KPP_COL_7 IOMUX_PAD(0x5d8, 0x194, 4, 0x96c, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__GPIO3_9 IOMUX_PAD(0x5d8, 0x194, 5, 0x918, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__EMI_NANDF_CE2 IOMUX_PAD(0x5d8, 0x194, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS1__ARM11P_TOP_EVNTBUS_19 IOMUX_PAD(0x5d8, 0x194, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RXD2__UART2_RXD_MUX IOMUX_PAD(0x5dc, 0x198, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RXD2__KPP_ROW_4 IOMUX_PAD(0x5dc, 0x198, 4, 0x980, 0, NO_PAD_CTRL)
++#define MX35_PAD_RXD2__GPIO3_10 IOMUX_PAD(0x5dc, 0x198, 5, 0x8ec, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TXD2__UART2_TXD_MUX IOMUX_PAD(0x5e0, 0x19c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_TXD2__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x5e0, 0x19c, 1, 0x994, 2, NO_PAD_CTRL)
++#define MX35_PAD_TXD2__KPP_ROW_5 IOMUX_PAD(0x5e0, 0x19c, 4, 0x984, 0, NO_PAD_CTRL)
++#define MX35_PAD_TXD2__GPIO3_11 IOMUX_PAD(0x5e0, 0x19c, 5, 0x8f0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RTS2__UART2_RTS IOMUX_PAD(0x5e4, 0x1a0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__SPDIF_SPDIF_IN1 IOMUX_PAD(0x5e4, 0x1a0, 1, 0x998, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__CAN2_RXCAN IOMUX_PAD(0x5e4, 0x1a0, 2, 0x7cc, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__IPU_CSI_D_2 IOMUX_PAD(0x5e4, 0x1a0, 3, 0x938, 1, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__KPP_ROW_6 IOMUX_PAD(0x5e4, 0x1a0, 4, 0x988, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__GPIO3_12 IOMUX_PAD(0x5e4, 0x1a0, 5, 0x8f4, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__AUDMUX_AUD5_RXC IOMUX_PAD(0x5e4, 0x1a0, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_RTS2__UART3_RXD_MUX IOMUX_PAD(0x5e4, 0x1a0, 7, 0x9a0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CTS2__UART2_CTS IOMUX_PAD(0x5e8, 0x1a4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x5e8, 0x1a4, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__CAN2_TXCAN IOMUX_PAD(0x5e8, 0x1a4, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__IPU_CSI_D_3 IOMUX_PAD(0x5e8, 0x1a4, 3, 0x93c, 1, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__KPP_ROW_7 IOMUX_PAD(0x5e8, 0x1a4, 4, 0x98c, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__GPIO3_13 IOMUX_PAD(0x5e8, 0x1a4, 5, 0x8f8, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__AUDMUX_AUD5_RXFS IOMUX_PAD(0x5e8, 0x1a4, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CTS2__UART3_TXD_MUX IOMUX_PAD(0x5e8, 0x1a4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_RTCK__ARM11P_TOP_RTCK IOMUX_PAD(0x5ec, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TCK__SJC_TCK IOMUX_PAD(0x5f0, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TMS__SJC_TMS IOMUX_PAD(0x5f4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TDI__SJC_TDI IOMUX_PAD(0x5f8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TDO__SJC_TDO IOMUX_PAD(0x5fc, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TRSTB__SJC_TRSTB IOMUX_PAD(0x600, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_DE_B__SJC_DE_B IOMUX_PAD(0x604, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SJC_MOD__SJC_MOD IOMUX_PAD(0x608, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR IOMUX_PAD(0x60c, 0x1a8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_USBOTG_PWR__USB_TOP_USBH2_PWR IOMUX_PAD(0x60c, 0x1a8, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_USBOTG_PWR__GPIO3_14 IOMUX_PAD(0x60c, 0x1a8, 5, 0x8fc, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC IOMUX_PAD(0x610, 0x1ac, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_USBOTG_OC__USB_TOP_USBH2_OC IOMUX_PAD(0x610, 0x1ac, 1, 0x9f4, 1, NO_PAD_CTRL)
++#define MX35_PAD_USBOTG_OC__GPIO3_15 IOMUX_PAD(0x610, 0x1ac, 5, 0x900, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD0__IPU_DISPB_DAT_0 IOMUX_PAD(0x614, 0x1b0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD0__GPIO2_0 IOMUX_PAD(0x614, 0x1b0, 5, 0x868, 1, NO_PAD_CTRL)
++#define MX35_PAD_LD0__SDMA_SDMA_DEBUG_PC_0 IOMUX_PAD(0x614, 0x1b0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD1__IPU_DISPB_DAT_1 IOMUX_PAD(0x618, 0x1b4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD1__GPIO2_1 IOMUX_PAD(0x618, 0x1b4, 5, 0x894, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD1__SDMA_SDMA_DEBUG_PC_1 IOMUX_PAD(0x618, 0x1b4, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD2__IPU_DISPB_DAT_2 IOMUX_PAD(0x61c, 0x1b8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD2__GPIO2_2 IOMUX_PAD(0x61c, 0x1b8, 5, 0x8c0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD2__SDMA_SDMA_DEBUG_PC_2 IOMUX_PAD(0x61c, 0x1b8, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD3__IPU_DISPB_DAT_3 IOMUX_PAD(0x620, 0x1bc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD3__GPIO2_3 IOMUX_PAD(0x620, 0x1bc, 5, 0x8cc, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD3__SDMA_SDMA_DEBUG_PC_3 IOMUX_PAD(0x620, 0x1bc, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD4__IPU_DISPB_DAT_4 IOMUX_PAD(0x624, 0x1c0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD4__GPIO2_4 IOMUX_PAD(0x624, 0x1c0, 5, 0x8d0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD4__SDMA_SDMA_DEBUG_PC_4 IOMUX_PAD(0x624, 0x1c0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD5__IPU_DISPB_DAT_5 IOMUX_PAD(0x628, 0x1c4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD5__GPIO2_5 IOMUX_PAD(0x628, 0x1c4, 5, 0x8d4, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD5__SDMA_SDMA_DEBUG_PC_5 IOMUX_PAD(0x628, 0x1c4, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD6__IPU_DISPB_DAT_6 IOMUX_PAD(0x62c, 0x1c8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD6__GPIO2_6 IOMUX_PAD(0x62c, 0x1c8, 5, 0x8d8, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD6__SDMA_SDMA_DEBUG_PC_6 IOMUX_PAD(0x62c, 0x1c8, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD7__IPU_DISPB_DAT_7 IOMUX_PAD(0x630, 0x1cc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD7__GPIO2_7 IOMUX_PAD(0x630, 0x1cc, 5, 0x8dc, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD7__SDMA_SDMA_DEBUG_PC_7 IOMUX_PAD(0x630, 0x1cc, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD8__IPU_DISPB_DAT_8 IOMUX_PAD(0x634, 0x1d0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD8__GPIO2_8 IOMUX_PAD(0x634, 0x1d0, 5, 0x8e0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD8__SDMA_SDMA_DEBUG_PC_8 IOMUX_PAD(0x634, 0x1d0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD9__IPU_DISPB_DAT_9 IOMUX_PAD(0x638, 0x1d4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD9__GPIO2_9 IOMUX_PAD(0x638, 0x1d4, 5, 0x8e4 0, NO_PAD_CTRL)
++#define MX35_PAD_LD9__SDMA_SDMA_DEBUG_PC_9 IOMUX_PAD(0x638, 0x1d4, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD10__IPU_DISPB_DAT_10 IOMUX_PAD(0x63c, 0x1d8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD10__GPIO2_10 IOMUX_PAD(0x63c, 0x1d8, 5, 0x86c, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD10__SDMA_SDMA_DEBUG_PC_10 IOMUX_PAD(0x63c, 0x1d8, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD11__IPU_DISPB_DAT_11 IOMUX_PAD(0x640, 0x1dc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD11__GPIO2_11 IOMUX_PAD(0x640, 0x1dc, 5, 0x870, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD11__SDMA_SDMA_DEBUG_PC_11 IOMUX_PAD(0x640, 0x1dc, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD11__ARM11P_TOP_TRACE_4 IOMUX_PAD(0x640, 0x1dc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD12__IPU_DISPB_DAT_12 IOMUX_PAD(0x644, 0x1e0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD12__GPIO2_12 IOMUX_PAD(0x644, 0x1e0, 5, 0x874, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD12__SDMA_SDMA_DEBUG_PC_12 IOMUX_PAD(0x644, 0x1e0, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD12__ARM11P_TOP_TRACE_5 IOMUX_PAD(0x644, 0x1e0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD13__IPU_DISPB_DAT_13 IOMUX_PAD(0x648, 0x1e4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD13__GPIO2_13 IOMUX_PAD(0x648, 0x1e4, 5, 0x878, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD13__SDMA_SDMA_DEBUG_PC_13 IOMUX_PAD(0x648, 0x1e4, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD13__ARM11P_TOP_TRACE_6 IOMUX_PAD(0x648, 0x1e4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD14__IPU_DISPB_DAT_14 IOMUX_PAD(0x64c, 0x1e8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD14__GPIO2_14 IOMUX_PAD(0x64c, 0x1e8, 5, 0x87c, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD14__SDMA_SDMA_DEBUG_EVENT_CHANNEL_0 IOMUX_PAD(0x64c, 0x1e8, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD14__ARM11P_TOP_TRACE_7 IOMUX_PAD(0x64c, 0x1e8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD15__IPU_DISPB_DAT_15 IOMUX_PAD(0x650, 0x1ec, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD15__GPIO2_15 IOMUX_PAD(0x650, 0x1ec, 5, 0x880, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD15__SDMA_SDMA_DEBUG_EVENT_CHANNEL_1 IOMUX_PAD(0x650, 0x1ec, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD15__ARM11P_TOP_TRACE_8 IOMUX_PAD(0x650, 0x1ec, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD16__IPU_DISPB_DAT_16 IOMUX_PAD(0x654, 0x1f0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD16__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x654, 0x1f0, 2, 0x928, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD16__GPIO2_16 IOMUX_PAD(0x654, 0x1f0, 5, 0x884, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD16__SDMA_SDMA_DEBUG_EVENT_CHANNEL_2 IOMUX_PAD(0x654, 0x1f0, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD16__ARM11P_TOP_TRACE_9 IOMUX_PAD(0x654, 0x1f0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD17__IPU_DISPB_DAT_17 IOMUX_PAD(0x658, 0x1f4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD17__IPU_DISPB_CS2 IOMUX_PAD(0x658, 0x1f4, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD17__GPIO2_17 IOMUX_PAD(0x658, 0x1f4, 5, 0x888, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD17__SDMA_SDMA_DEBUG_EVENT_CHANNEL_3 IOMUX_PAD(0x658, 0x1f4, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD17__ARM11P_TOP_TRACE_10 IOMUX_PAD(0x658, 0x1f4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD18__IPU_DISPB_DAT_18 IOMUX_PAD(0x65c, 0x1f8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD18__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x65c, 0x1f8, 1, 0x924, 1, NO_PAD_CTRL)
++#define MX35_PAD_LD18__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x65c, 0x1f8, 2, 0x928, 1, NO_PAD_CTRL)
++#define MX35_PAD_LD18__ESDHC3_CMD IOMUX_PAD(0x65c, 0x1f8, 3, 0x818, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD18__USB_TOP_USBOTG_DATA_3 IOMUX_PAD(0x65c, 0x1f8, 4, 0x9b0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD18__GPIO3_24 IOMUX_PAD(0x65c, 0x1f8, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD18__SDMA_SDMA_DEBUG_EVENT_CHANNEL_4 IOMUX_PAD(0x65c, 0x1f8, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD18__ARM11P_TOP_TRACE_11 IOMUX_PAD(0x65c, 0x1f8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD19__IPU_DISPB_DAT_19 IOMUX_PAD(0x660, 0x1fc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__IPU_DISPB_BCLK IOMUX_PAD(0x660, 0x1fc, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__IPU_DISPB_CS1 IOMUX_PAD(0x660, 0x1fc, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__ESDHC3_CLK IOMUX_PAD(0x660, 0x1fc, 3, 0x814, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__USB_TOP_USBOTG_DIR IOMUX_PAD(0x660, 0x1fc, 4, 0x9c4, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__GPIO3_25 IOMUX_PAD(0x660, 0x1fc, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__SDMA_SDMA_DEBUG_EVENT_CHANNEL_5 IOMUX_PAD(0x660, 0x1fc, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD19__ARM11P_TOP_TRACE_12 IOMUX_PAD(0x660, 0x1fc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD20__IPU_DISPB_DAT_20 IOMUX_PAD(0x664, 0x200, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__IPU_DISPB_CS0 IOMUX_PAD(0x664, 0x200, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__IPU_DISPB_SD_CLK IOMUX_PAD(0x664, 0x200, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__ESDHC3_DAT0 IOMUX_PAD(0x664, 0x200, 3, 0x81c, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__GPIO3_26 IOMUX_PAD(0x664, 0x200, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__SDMA_SDMA_DEBUG_CORE_STATUS_3 IOMUX_PAD(0x664, 0x200, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD20__ARM11P_TOP_TRACE_13 IOMUX_PAD(0x664, 0x200, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD21__IPU_DISPB_DAT_21 IOMUX_PAD(0x668, 0x204, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__IPU_DISPB_PAR_RS IOMUX_PAD(0x668, 0x204, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__IPU_DISPB_SER_RS IOMUX_PAD(0x668, 0x204, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__ESDHC3_DAT1 IOMUX_PAD(0x668, 0x204, 3, 0x820, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__USB_TOP_USBOTG_STP IOMUX_PAD(0x668, 0x204, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__GPIO3_27 IOMUX_PAD(0x668, 0x204, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__SDMA_DEBUG_EVENT_CHANNEL_SEL IOMUX_PAD(0x668, 0x204, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD21__ARM11P_TOP_TRACE_14 IOMUX_PAD(0x668, 0x204, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD22__IPU_DISPB_DAT_22 IOMUX_PAD(0x66c, 0x208, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__IPU_DISPB_WR IOMUX_PAD(0x66c, 0x208, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__IPU_DISPB_SD_D_I IOMUX_PAD(0x66c, 0x208, 2, 0x92c, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__ESDHC3_DAT2 IOMUX_PAD(0x66c, 0x208, 3, 0x824, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__USB_TOP_USBOTG_NXT IOMUX_PAD(0x66c, 0x208, 4, 0x9c8, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__GPIO3_28 IOMUX_PAD(0x66c, 0x208, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__SDMA_DEBUG_BUS_ERROR IOMUX_PAD(0x66c, 0x208, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD22__ARM11P_TOP_TRCTL IOMUX_PAD(0x66c, 0x208, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_LD23__IPU_DISPB_DAT_23 IOMUX_PAD(0x670, 0x20c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__IPU_DISPB_RD IOMUX_PAD(0x670, 0x20c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__IPU_DISPB_SD_D_IO IOMUX_PAD(0x670, 0x20c, 2, 0x92c, 1, NO_PAD_CTRL)
++#define MX35_PAD_LD23__ESDHC3_DAT3 IOMUX_PAD(0x670, 0x20c, 3, 0x828, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__USB_TOP_USBOTG_DATA_7 IOMUX_PAD(0x670, 0x20c, 4, 0x9c0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__GPIO3_29 IOMUX_PAD(0x670, 0x20c, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__SDMA_DEBUG_MATCHED_DMBUS IOMUX_PAD(0x670, 0x20c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_LD23__ARM11P_TOP_TRCLK IOMUX_PAD(0x670, 0x20c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC IOMUX_PAD(0x674, 0x210, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_HSYNC__IPU_DISPB_SD_D_IO IOMUX_PAD(0x674, 0x210, 2, 0x92c, 2, NO_PAD_CTRL)
++#define MX35_PAD_D3_HSYNC__GPIO3_30 IOMUX_PAD(0x674, 0x210, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_HSYNC__SDMA_DEBUG_RTBUFFER_WRITE IOMUX_PAD(0x674, 0x210, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_HSYNC__ARM11P_TOP_TRACE_15 IOMUX_PAD(0x674, 0x210, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK IOMUX_PAD(0x678, 0x214, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_FPSHIFT__IPU_DISPB_SD_CLK IOMUX_PAD(0x678, 0x214, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_FPSHIFT__GPIO3_31 IOMUX_PAD(0x678, 0x214, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_FPSHIFT__SDMA_SDMA_DEBUG_CORE_STATUS_0 IOMUX_PAD(0x678, 0x214, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_FPSHIFT__ARM11P_TOP_TRACE_16 IOMUX_PAD(0x678, 0x214, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY IOMUX_PAD(0x67c, 0x218, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_DRDY__IPU_DISPB_SD_D_O IOMUX_PAD(0x67c, 0x218, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_DRDY__GPIO1_0 IOMUX_PAD(0x67c, 0x218, 5, 0x82c, 2, NO_PAD_CTRL)
++#define MX35_PAD_D3_DRDY__SDMA_SDMA_DEBUG_CORE_STATUS_1 IOMUX_PAD(0x67c, 0x218, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_DRDY__ARM11P_TOP_TRACE_17 IOMUX_PAD(0x67c, 0x218, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_CONTRAST__IPU_DISPB_CONTR IOMUX_PAD(0x680, 0x21c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CONTRAST__GPIO1_1 IOMUX_PAD(0x680, 0x21c, 5, 0x838, 2, NO_PAD_CTRL)
++#define MX35_PAD_CONTRAST__SDMA_SDMA_DEBUG_CORE_STATUS_2 IOMUX_PAD(0x680, 0x21c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_CONTRAST__ARM11P_TOP_TRACE_18 IOMUX_PAD(0x680, 0x21c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC IOMUX_PAD(0x684, 0x220, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_VSYNC__IPU_DISPB_CS1 IOMUX_PAD(0x684, 0x220, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_VSYNC__GPIO1_2 IOMUX_PAD(0x684, 0x220, 5, 0x848, 1, NO_PAD_CTRL)
++#define MX35_PAD_D3_VSYNC__SDMA_DEBUG_YIELD IOMUX_PAD(0x684, 0x220, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_VSYNC__ARM11P_TOP_TRACE_19 IOMUX_PAD(0x684, 0x220, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_REV__IPU_DISPB_D3_REV IOMUX_PAD(0x688, 0x224, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_REV__IPU_DISPB_SER_RS IOMUX_PAD(0x688, 0x224, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_REV__GPIO1_3 IOMUX_PAD(0x688, 0x224, 5, 0x84c, 1, NO_PAD_CTRL)
++#define MX35_PAD_D3_REV__SDMA_DEBUG_BUS_RWB IOMUX_PAD(0x688, 0x224, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_REV__ARM11P_TOP_TRACE_20 IOMUX_PAD(0x688, 0x224, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS IOMUX_PAD(0x68c, 0x228, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_CLS__IPU_DISPB_CS2 IOMUX_PAD(0x68c, 0x228, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_CLS__GPIO1_4 IOMUX_PAD(0x68c, 0x228, 5, 0x850, 2, NO_PAD_CTRL)
++#define MX35_PAD_D3_CLS__SDMA_DEBUG_BUS_DEVICE_0 IOMUX_PAD(0x68c, 0x228, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_CLS__ARM11P_TOP_TRACE_21 IOMUX_PAD(0x68c, 0x228, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL IOMUX_PAD(0x690, 0x22c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_SPL__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x690, 0x22c, 2, 0x928, 2, NO_PAD_CTRL)
++#define MX35_PAD_D3_SPL__GPIO1_5 IOMUX_PAD(0x690, 0x22c, 5, 0x854, 2, NO_PAD_CTRL)
++#define MX35_PAD_D3_SPL__SDMA_DEBUG_BUS_DEVICE_1 IOMUX_PAD(0x690, 0x22c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_D3_SPL__ARM11P_TOP_TRACE_22 IOMUX_PAD(0x690, 0x22c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_CMD__ESDHC1_CMD IOMUX_PAD(0x694, 0x230, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CMD__MSHC_SCLK IOMUX_PAD(0x694, 0x230, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CMD__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x694, 0x230, 3, 0x924, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CMD__USB_TOP_USBOTG_DATA_4 IOMUX_PAD(0x694, 0x230, 4, 0x9b4, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CMD__GPIO1_6 IOMUX_PAD(0x694, 0x230, 5, 0x858, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CMD__ARM11P_TOP_TRCTL IOMUX_PAD(0x694, 0x230, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_CLK__ESDHC1_CLK IOMUX_PAD(0x698, 0x234, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CLK__MSHC_BS IOMUX_PAD(0x698, 0x234, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CLK__IPU_DISPB_BCLK IOMUX_PAD(0x698, 0x234, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CLK__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x698, 0x234, 4, 0x9b8, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CLK__GPIO1_7 IOMUX_PAD(0x698, 0x234, 5, 0x85c, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD1_CLK__ARM11P_TOP_TRCLK IOMUX_PAD(0x698, 0x234, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_DATA0__ESDHC1_DAT0 IOMUX_PAD(0x69c, 0x238, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA0__MSHC_DATA_0 IOMUX_PAD(0x69c, 0x238, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA0__IPU_DISPB_CS0 IOMUX_PAD(0x69c, 0x238, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA0__USB_TOP_USBOTG_DATA_6 IOMUX_PAD(0x69c, 0x238, 4, 0x9bc, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA0__GPIO1_8 IOMUX_PAD(0x69c, 0x238, 5, 0x860, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA0__ARM11P_TOP_TRACE_23 IOMUX_PAD(0x69c, 0x238, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_DATA1__ESDHC1_DAT1 IOMUX_PAD(0x6a0, 0x23c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA1__MSHC_DATA_1 IOMUX_PAD(0x6a0, 0x23c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA1__IPU_DISPB_PAR_RS IOMUX_PAD(0x6a0, 0x23c, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA1__USB_TOP_USBOTG_DATA_0 IOMUX_PAD(0x6a0, 0x23c, 4, 0x9a4, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA1__GPIO1_9 IOMUX_PAD(0x6a0, 0x23c, 5, 0x864, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA1__ARM11P_TOP_TRACE_24 IOMUX_PAD(0x6a0, 0x23c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_DATA2__ESDHC1_DAT2 IOMUX_PAD(0x6a4, 0x240, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA2__MSHC_DATA_2 IOMUX_PAD(0x6a4, 0x240, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA2__IPU_DISPB_WR IOMUX_PAD(0x6a4, 0x240, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA2__USB_TOP_USBOTG_DATA_1 IOMUX_PAD(0x6a4, 0x240, 4, 0x9a8, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA2__GPIO1_10 IOMUX_PAD(0x6a4, 0x240, 5, 0x830, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA2__ARM11P_TOP_TRACE_25 IOMUX_PAD(0x6a4, 0x240, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD1_DATA3__ESDHC1_DAT3 IOMUX_PAD(0x6a8, 0x244, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA3__MSHC_DATA_3 IOMUX_PAD(0x6a8, 0x244, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA3__IPU_DISPB_RD IOMUX_PAD(0x6a8, 0x244, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA3__USB_TOP_USBOTG_DATA_2 IOMUX_PAD(0x6a8, 0x244, 4, 0x9ac, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA3__GPIO1_11 IOMUX_PAD(0x6a8, 0x244, 5, 0x834, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD1_DATA3__ARM11P_TOP_TRACE_26 IOMUX_PAD(0x6a8, 0x244, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_CMD__ESDHC2_CMD IOMUX_PAD(0x6ac, 0x248, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__I2C3_SCL IOMUX_PAD(0x6ac, 0x248, 1, 0x91c, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__ESDHC1_DAT4 IOMUX_PAD(0x6ac, 0x248, 2, 0x804, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__IPU_CSI_D_2 IOMUX_PAD(0x6ac, 0x248, 3, 0x938, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__USB_TOP_USBH2_DATA_4 IOMUX_PAD(0x6ac, 0x248, 4, 0x9dc, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__GPIO2_0 IOMUX_PAD(0x6ac, 0x248, 5, 0x868, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x6ac, 0x248, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CMD__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x6ac, 0x248, 7, 0x928, 3, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_CLK__ESDHC2_CLK IOMUX_PAD(0x6b0, 0x24c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__I2C3_SDA IOMUX_PAD(0x6b0, 0x24c, 1, 0x920, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__ESDHC1_DAT5 IOMUX_PAD(0x6b0, 0x24c, 2, 0x808, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__IPU_CSI_D_3 IOMUX_PAD(0x6b0, 0x24c, 3, 0x93c, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__USB_TOP_USBH2_DATA_5 IOMUX_PAD(0x6b0, 0x24c, 4, 0x9e0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__GPIO2_1 IOMUX_PAD(0x6b0, 0x24c, 5, 0x894, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__SPDIF_SPDIF_IN1 IOMUX_PAD(0x6b0, 0x24c, 6, 0x998, 2, NO_PAD_CTRL)
++#define MX35_PAD_SD2_CLK__IPU_DISPB_CS2 IOMUX_PAD(0x6b0, 0x24c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_DATA0__ESDHC2_DAT0 IOMUX_PAD(0x6b4, 0x250, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__UART3_RXD_MUX IOMUX_PAD(0x6b4, 0x250, 1, 0x9a0, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__ESDHC1_DAT6 IOMUX_PAD(0x6b4, 0x250, 2, 0x80c, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__IPU_CSI_D_4 IOMUX_PAD(0x6b4, 0x250, 3, 0x940, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__USB_TOP_USBH2_DATA_6 IOMUX_PAD(0x6b4, 0x250, 4, 0x9e4, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__GPIO2_2 IOMUX_PAD(0x6b4, 0x250, 5, 0x8c0, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA0__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x6b4, 0x250, 6, 0x994, 3, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_DATA1__ESDHC2_DAT1 IOMUX_PAD(0x6b8, 0x254, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA1__UART3_TXD_MUX IOMUX_PAD(0x6b8, 0x254, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA1__ESDHC1_DAT7 IOMUX_PAD(0x6b8, 0x254, 2, 0x810, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA1__IPU_CSI_D_5 IOMUX_PAD(0x6b8, 0x254, 3, 0x944, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA1__USB_TOP_USBH2_DATA_0 IOMUX_PAD(0x6b8, 0x254, 4, 0x9cc, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA1__GPIO2_3 IOMUX_PAD(0x6b8, 0x254, 5, 0x8cc, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_DATA2__ESDHC2_DAT2 IOMUX_PAD(0x6bc, 0x258, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA2__UART3_RTS IOMUX_PAD(0x6bc, 0x258, 1, 0x99c, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA2__CAN1_RXCAN IOMUX_PAD(0x6bc, 0x258, 2, 0x7c8, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA2__IPU_CSI_D_6 IOMUX_PAD(0x6bc, 0x258, 3, 0x948, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA2__USB_TOP_USBH2_DATA_1 IOMUX_PAD(0x6bc, 0x258, 4, 0x9d0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA2__GPIO2_4 IOMUX_PAD(0x6bc, 0x258, 5, 0x8d0, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_SD2_DATA3__ESDHC2_DAT3 IOMUX_PAD(0x6c0, 0x25c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA3__UART3_CTS IOMUX_PAD(0x6c0, 0x25c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA3__CAN1_TXCAN IOMUX_PAD(0x6c0, 0x25c, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA3__IPU_CSI_D_7 IOMUX_PAD(0x6c0, 0x25c, 3, 0x94c, 1, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA3__USB_TOP_USBH2_DATA_2 IOMUX_PAD(0x6c0, 0x25c, 4, 0x9d4, 0, NO_PAD_CTRL)
++#define MX35_PAD_SD2_DATA3__GPIO2_5 IOMUX_PAD(0x6c0, 0x25c, 5, 0x8d4, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_CS0__ATA_CS0 IOMUX_PAD(0x6c4, 0x260, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS0__CSPI1_SS3 IOMUX_PAD(0x6c4, 0x260, 1, 0x7dc, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS0__IPU_DISPB_CS1 IOMUX_PAD(0x6c4, 0x260, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS0__GPIO2_6 IOMUX_PAD(0x6c4, 0x260, 5, 0x8d8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS0__IPU_DIAGB_0 IOMUX_PAD(0x6c4, 0x260, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS0__ARM11P_TOP_MAX1_HMASTER_0 IOMUX_PAD(0x6c4, 0x260, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_CS1__ATA_CS1 IOMUX_PAD(0x6c8, 0x264, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS1__IPU_DISPB_CS2 IOMUX_PAD(0x6c8, 0x264, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS1__CSPI2_SS0 IOMUX_PAD(0x6c8, 0x264, 4, 0x7f0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS1__GPIO2_7 IOMUX_PAD(0x6c8, 0x264, 5, 0x8dc, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS1__IPU_DIAGB_1 IOMUX_PAD(0x6c8, 0x264, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_CS1__ARM11P_TOP_MAX1_HMASTER_1 IOMUX_PAD(0x6c8, 0x264, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DIOR__ATA_DIOR IOMUX_PAD(0x6cc, 0x268, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__ESDHC3_DAT0 IOMUX_PAD(0x6cc, 0x268, 1, 0x81c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__USB_TOP_USBOTG_DIR IOMUX_PAD(0x6cc, 0x268, 2, 0x9c4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__IPU_DISPB_BE0 IOMUX_PAD(0x6cc, 0x268, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__CSPI2_SS1 IOMUX_PAD(0x6cc, 0x268, 4, 0x7f4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__GPIO2_8 IOMUX_PAD(0x6cc, 0x268, 5, 0x8e0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__IPU_DIAGB_2 IOMUX_PAD(0x6cc, 0x268, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOR__ARM11P_TOP_MAX1_HMASTER_2 IOMUX_PAD(0x6cc, 0x268, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DIOW__ATA_DIOW IOMUX_PAD(0x6d0, 0x26c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__ESDHC3_DAT1 IOMUX_PAD(0x6d0, 0x26c, 1, 0x820, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__USB_TOP_USBOTG_STP IOMUX_PAD(0x6d0, 0x26c, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__IPU_DISPB_BE1 IOMUX_PAD(0x6d0, 0x26c, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__CSPI2_MOSI IOMUX_PAD(0x6d0, 0x26c, 4, 0x7ec, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__GPIO2_9 IOMUX_PAD(0x6d0, 0x26c, 5, 0x8e4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__IPU_DIAGB_3 IOMUX_PAD(0x6d0, 0x26c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DIOW__ARM11P_TOP_MAX1_HMASTER_3 IOMUX_PAD(0x6d0, 0x26c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DMACK__ATA_DMACK IOMUX_PAD(0x6d4, 0x270, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__ESDHC3_DAT2 IOMUX_PAD(0x6d4, 0x270, 1, 0x824, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__USB_TOP_USBOTG_NXT IOMUX_PAD(0x6d4, 0x270, 2, 0x9c8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__CSPI2_MISO IOMUX_PAD(0x6d4, 0x270, 4, 0x7e8, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__GPIO2_10 IOMUX_PAD(0x6d4, 0x270, 5, 0x86c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__IPU_DIAGB_4 IOMUX_PAD(0x6d4, 0x270, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMACK__ARM11P_TOP_MAX0_HMASTER_0 IOMUX_PAD(0x6d4, 0x270, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_RESET_B__ATA_RESET_B IOMUX_PAD(0x6d8, 0x274, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__ESDHC3_DAT3 IOMUX_PAD(0x6d8, 0x274, 1, 0x828, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__USB_TOP_USBOTG_DATA_0 IOMUX_PAD(0x6d8, 0x274, 2, 0x9a4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__IPU_DISPB_SD_D_O IOMUX_PAD(0x6d8, 0x274, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__CSPI2_RDY IOMUX_PAD(0x6d8, 0x274, 4, 0x7e4, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__GPIO2_11 IOMUX_PAD(0x6d8, 0x274, 5, 0x870, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__IPU_DIAGB_5 IOMUX_PAD(0x6d8, 0x274, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_RESET_B__ARM11P_TOP_MAX0_HMASTER_1 IOMUX_PAD(0x6d8, 0x274, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_IORDY__ATA_IORDY IOMUX_PAD(0x6dc, 0x278, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__ESDHC3_DAT4 IOMUX_PAD(0x6dc, 0x278, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__USB_TOP_USBOTG_DATA_1 IOMUX_PAD(0x6dc, 0x278, 2, 0x9a8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__IPU_DISPB_SD_D_IO IOMUX_PAD(0x6dc, 0x278, 3, 0x92c, 3, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__ESDHC2_DAT4 IOMUX_PAD(0x6dc, 0x278, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__GPIO2_12 IOMUX_PAD(0x6dc, 0x278, 5, 0x874, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__IPU_DIAGB_6 IOMUX_PAD(0x6dc, 0x278, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_IORDY__ARM11P_TOP_MAX0_HMASTER_2 IOMUX_PAD(0x6dc, 0x278, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA0__ATA_DATA_0 IOMUX_PAD(0x6e0, 0x27c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__ESDHC3_DAT5 IOMUX_PAD(0x6e0, 0x27c, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__USB_TOP_USBOTG_DATA_2 IOMUX_PAD(0x6e0, 0x27c, 2, 0x9ac, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x6e0, 0x27c, 3, 0x928, 4, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__ESDHC2_DAT5 IOMUX_PAD(0x6e0, 0x27c, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__GPIO2_13 IOMUX_PAD(0x6e0, 0x27c, 5, 0x878, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__IPU_DIAGB_7 IOMUX_PAD(0x6e0, 0x27c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA0__ARM11P_TOP_MAX0_HMASTER_3 IOMUX_PAD(0x6e0, 0x27c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA1__ATA_DATA_1 IOMUX_PAD(0x6e4, 0x280, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__ESDHC3_DAT6 IOMUX_PAD(0x6e4, 0x280, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__USB_TOP_USBOTG_DATA_3 IOMUX_PAD(0x6e4, 0x280, 2, 0x9b0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__IPU_DISPB_SD_CLK IOMUX_PAD(0x6e4, 0x280, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__ESDHC2_DAT6 IOMUX_PAD(0x6e4, 0x280, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__GPIO2_14 IOMUX_PAD(0x6e4, 0x280, 5, 0x87c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__IPU_DIAGB_8 IOMUX_PAD(0x6e4, 0x280, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA1__ARM11P_TOP_TRACE_27 IOMUX_PAD(0x6e4, 0x280, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA2__ATA_DATA_2 IOMUX_PAD(0x6e8, 0x284, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__ESDHC3_DAT7 IOMUX_PAD(0x6e8, 0x284, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__USB_TOP_USBOTG_DATA_4 IOMUX_PAD(0x6e8, 0x284, 2, 0x9b4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__IPU_DISPB_SER_RS IOMUX_PAD(0x6e8, 0x284, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__ESDHC2_DAT7 IOMUX_PAD(0x6e8, 0x284, 4, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__GPIO2_15 IOMUX_PAD(0x6e8, 0x284, 5, 0x880, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__IPU_DIAGB_9 IOMUX_PAD(0x6e8, 0x284, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA2__ARM11P_TOP_TRACE_28 IOMUX_PAD(0x6e8, 0x284, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA3__ATA_DATA_3 IOMUX_PAD(0x6e8, 0x288, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__ESDHC3_CLK IOMUX_PAD(0x6e8, 0x288, 1, 0x814, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x6e8, 0x288, 2, 0x9b8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__CSPI2_SCLK IOMUX_PAD(0x6e8, 0x288, 4, 0x7e0, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__GPIO2_16 IOMUX_PAD(0x6e8, 0x288, 5, 0x884, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__IPU_DIAGB_10 IOMUX_PAD(0x6e8, 0x288, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA3__ARM11P_TOP_TRACE_29 IOMUX_PAD(0x6e8, 0x288, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA4__ATA_DATA_4 IOMUX_PAD(0x6f0, 0x28c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA4__ESDHC3_CMD IOMUX_PAD(0x6f0, 0x28c, 1, 0x818, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA4__USB_TOP_USBOTG_DATA_6 IOMUX_PAD(0x6f0, 0x28c, 2, 0x9bc, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA4__GPIO2_17 IOMUX_PAD(0x6f0, 0x28c, 5, 0x888, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA4__IPU_DIAGB_11 IOMUX_PAD(0x6f0, 0x28c, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA4__ARM11P_TOP_TRACE_30 IOMUX_PAD(0x6f0, 0x28c, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA5__ATA_DATA_5 IOMUX_PAD(0x6f4, 0x290, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA5__USB_TOP_USBOTG_DATA_7 IOMUX_PAD(0x6f4, 0x290, 2, 0x9c0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA5__GPIO2_18 IOMUX_PAD(0x6f4, 0x290, 5, 0x88c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA5__IPU_DIAGB_12 IOMUX_PAD(0x6f4, 0x290, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA5__ARM11P_TOP_TRACE_31 IOMUX_PAD(0x6f4, 0x290, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA6__ATA_DATA_6 IOMUX_PAD(0x6f8, 0x294, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA6__CAN1_TXCAN IOMUX_PAD(0x6f8, 0x294, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA6__UART1_DTR IOMUX_PAD(0x6f8, 0x294, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA6__AUDMUX_AUD6_TXD IOMUX_PAD(0x6f8, 0x294, 3, 0x7b4, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA6__GPIO2_19 IOMUX_PAD(0x6f8, 0x294, 5, 0x890, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA6__IPU_DIAGB_13 IOMUX_PAD(0x6f8, 0x294, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA7__ATA_DATA_7 IOMUX_PAD(0x6fc, 0x298, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA7__CAN1_RXCAN IOMUX_PAD(0x6fc, 0x298, 1, 0x7c8, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA7__UART1_DSR IOMUX_PAD(0x6fc, 0x298, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA7__AUDMUX_AUD6_RXD IOMUX_PAD(0x6fc, 0x298, 3, 0x7b0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA7__GPIO2_20 IOMUX_PAD(0x6fc, 0x298, 5, 0x898, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA7__IPU_DIAGB_14 IOMUX_PAD(0x6fc, 0x298, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA8__ATA_DATA_8 IOMUX_PAD(0x700, 0x29c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA8__UART3_RTS IOMUX_PAD(0x700, 0x29c, 1, 0x99c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA8__UART1_RI IOMUX_PAD(0x700, 0x29c, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA8__AUDMUX_AUD6_TXC IOMUX_PAD(0x700, 0x29c, 3, 0x7c0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA8__GPIO2_21 IOMUX_PAD(0x700, 0x29c, 5, 0x89c, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA8__IPU_DIAGB_15 IOMUX_PAD(0x700, 0x29c, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA9__ATA_DATA_9 IOMUX_PAD(0x704, 0x2a0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA9__UART3_CTS IOMUX_PAD(0x704, 0x2a0, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA9__UART1_DCD IOMUX_PAD(0x704, 0x2a0, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA9__AUDMUX_AUD6_TXFS IOMUX_PAD(0x704, 0x2a0, 3, 0x7c4, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA9__GPIO2_22 IOMUX_PAD(0x704, 0x2a0, 5, 0x8a0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA9__IPU_DIAGB_16 IOMUX_PAD(0x704, 0x2a0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA10__ATA_DATA_10 IOMUX_PAD(0x708, 0x2a4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA10__UART3_RXD_MUX IOMUX_PAD(0x708, 0x2a4, 1, 0x9a0, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA10__AUDMUX_AUD6_RXC IOMUX_PAD(0x708, 0x2a4, 3, 0x7b8, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA10__GPIO2_23 IOMUX_PAD(0x708, 0x2a4, 5, 0x8a4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA10__IPU_DIAGB_17 IOMUX_PAD(0x708, 0x2a4, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA11__ATA_DATA_11 IOMUX_PAD(0x70c, 0x2a8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA11__UART3_TXD_MUX IOMUX_PAD(0x70c, 0x2a8, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA11__AUDMUX_AUD6_RXFS IOMUX_PAD(0x70c, 0x2a8, 3, 0x7bc, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA11__GPIO2_24 IOMUX_PAD(0x70c, 0x2a8, 5, 0x8a8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA11__IPU_DIAGB_18 IOMUX_PAD(0x70c, 0x2a8, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA12__ATA_DATA_12 IOMUX_PAD(0x710, 0x2ac, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA12__I2C3_SCL IOMUX_PAD(0x710, 0x2ac, 1, 0x91c, 3, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA12__GPIO2_25 IOMUX_PAD(0x710, 0x2ac, 5, 0x8ac, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA12__IPU_DIAGB_19 IOMUX_PAD(0x710, 0x2ac, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA13__ATA_DATA_13 IOMUX_PAD(0x714, 0x2b0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA13__I2C3_SDA IOMUX_PAD(0x714, 0x2b0, 1, 0x920, 3, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA13__GPIO2_26 IOMUX_PAD(0x714, 0x2b0, 5, 0x8b0, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA13__IPU_DIAGB_20 IOMUX_PAD(0x714, 0x2b0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA14__ATA_DATA_14 IOMUX_PAD(0x718, 0x2b4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA14__IPU_CSI_D_0 IOMUX_PAD(0x718, 0x2b4, 1, 0x930, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA14__KPP_ROW_0 IOMUX_PAD(0x718, 0x2b4, 3, 0x970, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA14__GPIO2_27 IOMUX_PAD(0x718, 0x2b4, 5, 0x8b4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA14__IPU_DIAGB_21 IOMUX_PAD(0x718, 0x2b4, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DATA15__ATA_DATA_15 IOMUX_PAD(0x71c, 0x2b8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA15__IPU_CSI_D_1 IOMUX_PAD(0x71c, 0x2b8, 1, 0x934, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA15__KPP_ROW_1 IOMUX_PAD(0x71c, 0x2b8, 3, 0x974, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA15__GPIO2_28 IOMUX_PAD(0x71c, 0x2b8, 5, 0x8b8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DATA15__IPU_DIAGB_22 IOMUX_PAD(0x71c, 0x2b8, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_INTRQ__ATA_INTRQ IOMUX_PAD(0x720, 0x2bc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_INTRQ__IPU_CSI_D_2 IOMUX_PAD(0x720, 0x2bc, 1, 0x938, 3, NO_PAD_CTRL)
++#define MX35_PAD_ATA_INTRQ__KPP_ROW_2 IOMUX_PAD(0x720, 0x2bc, 3, 0x978, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_INTRQ__GPIO2_29 IOMUX_PAD(0x720, 0x2bc, 5, 0x8bc, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_INTRQ__IPU_DIAGB_23 IOMUX_PAD(0x720, 0x2bc, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_BUFF_EN__ATA_BUFFER_EN IOMUX_PAD(0x724, 0x2c0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_BUFF_EN__IPU_CSI_D_3 IOMUX_PAD(0x724, 0x2c0, 1, 0x93c, 3, NO_PAD_CTRL)
++#define MX35_PAD_ATA_BUFF_EN__KPP_ROW_3 IOMUX_PAD(0x724, 0x2c0, 3, 0x97c, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_BUFF_EN__GPIO2_30 IOMUX_PAD(0x724, 0x2c0, 5, 0x8c4, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_BUFF_EN__IPU_DIAGB_24 IOMUX_PAD(0x724, 0x2c0, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DMARQ__ATA_DMARQ IOMUX_PAD(0x728, 0x2c4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMARQ__IPU_CSI_D_4 IOMUX_PAD(0x728, 0x2c4, 1, 0x940, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMARQ__KPP_COL_0 IOMUX_PAD(0x728, 0x2c4, 3, 0x950, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMARQ__GPIO2_31 IOMUX_PAD(0x728, 0x2c4, 5, 0x8c8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMARQ__IPU_DIAGB_25 IOMUX_PAD(0x728, 0x2c4, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DMARQ__ECT_CTI_TRIG_IN1_4 IOMUX_PAD(0x728, 0x2c4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DA0__ATA_DA_0 IOMUX_PAD(0x72c, 0x2c8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA0__IPU_CSI_D_5 IOMUX_PAD(0x72c, 0x2c8, 1, 0x944, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA0__KPP_COL_1 IOMUX_PAD(0x72c, 0x2c8, 3, 0x954, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA0__GPIO3_0 IOMUX_PAD(0x72c, 0x2c8, 5, 0x8e8, 1, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA0__IPU_DIAGB_26 IOMUX_PAD(0x72c, 0x2c8, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA0__ECT_CTI_TRIG_IN1_5 IOMUX_PAD(0x72c, 0x2c8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DA1__ATA_DA_1 IOMUX_PAD(0x730, 0x2cc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA1__IPU_CSI_D_6 IOMUX_PAD(0x730, 0x2cc, 1, 0x948, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA1__KPP_COL_2 IOMUX_PAD(0x730, 0x2cc, 3, 0x958, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA1__GPIO3_1 IOMUX_PAD(0x730, 0x2cc, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA1__IPU_DIAGB_27 IOMUX_PAD(0x730, 0x2cc, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA1__ECT_CTI_TRIG_IN1_6 IOMUX_PAD(0x730, 0x2cc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_ATA_DA2__ATA_DA_2 IOMUX_PAD(0x734, 0x2d0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA2__IPU_CSI_D_7 IOMUX_PAD(0x734, 0x2d0, 1, 0x94c, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA2__KPP_COL_3 IOMUX_PAD(0x734, 0x2d0, 3, 0x95c, 2, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA2__GPIO3_2 IOMUX_PAD(0x734, 0x2d0, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA2__IPU_DIAGB_28 IOMUX_PAD(0x734, 0x2d0, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_ATA_DA2__ECT_CTI_TRIG_IN1_7 IOMUX_PAD(0x734, 0x2d0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_MLB_CLK__MLB_MLBCLK IOMUX_PAD(0x738, 0x2d4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_MLB_CLK__GPIO3_3 IOMUX_PAD(0x738, 0x2d4, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_MLB_DAT__MLB_MLBDAT IOMUX_PAD(0x73c, 0x2d8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_MLB_DAT__GPIO3_4 IOMUX_PAD(0x73c, 0x2d8, 5, 0x904, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_MLB_SIG__MLB_MLBSIG IOMUX_PAD(0x740, 0x2dc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_MLB_SIG__GPIO3_5 IOMUX_PAD(0x740, 0x2dc, 5, 0x908, 1, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TX_CLK__FEC_TX_CLK IOMUX_PAD(0x744, 0x2e0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__ESDHC1_DAT4 IOMUX_PAD(0x744, 0x2e0, 1, 0x804, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__UART3_RXD_MUX IOMUX_PAD(0x744, 0x2e0, 2, 0x9a0, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__USB_TOP_USBH2_DIR IOMUX_PAD(0x744, 0x2e0, 3, 0x9ec, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__CSPI2_MOSI IOMUX_PAD(0x744, 0x2e0, 4, 0x7ec, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__GPIO3_6 IOMUX_PAD(0x744, 0x2e0, 5, 0x90c, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__IPU_DISPB_D12_VSYNC IOMUX_PAD(0x744, 0x2e0, 6, 0x928, 5, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_CLK__ARM11P_TOP_EVNTBUS_0 IOMUX_PAD(0x744, 0x2e0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RX_CLK__FEC_RX_CLK IOMUX_PAD(0x748, 0x2e4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__ESDHC1_DAT5 IOMUX_PAD(0x748, 0x2e4, 1, 0x808, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__UART3_TXD_MUX IOMUX_PAD(0x748, 0x2e4, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__USB_TOP_USBH2_STP IOMUX_PAD(0x748, 0x2e4, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__CSPI2_MISO IOMUX_PAD(0x748, 0x2e4, 4, 0x7e8, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__GPIO3_7 IOMUX_PAD(0x748, 0x2e4, 5, 0x910, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__IPU_DISPB_SD_D_I IOMUX_PAD(0x748, 0x2e4, 6, 0x92c, 4, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_CLK__ARM11P_TOP_EVNTBUS_1 IOMUX_PAD(0x748, 0x2e4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(0x74c, 0x2e8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__ESDHC1_DAT6 IOMUX_PAD(0x74c, 0x2e8, 1, 0x80c, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__UART3_RTS IOMUX_PAD(0x74c, 0x2e8, 2, 0x99c, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__USB_TOP_USBH2_NXT IOMUX_PAD(0x74c, 0x2e8, 3, 0x9f0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__CSPI2_SCLK IOMUX_PAD(0x74c, 0x2e8, 4, 0x7e0, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__GPIO3_8 IOMUX_PAD(0x74c, 0x2e8, 5, 0x914, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__IPU_DISPB_SD_CLK IOMUX_PAD(0x74c, 0x2e8, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_DV__ARM11P_TOP_EVNTBUS_2 IOMUX_PAD(0x74c, 0x2e8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_COL__FEC_COL IOMUX_PAD(0x750, 0x2ec, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__ESDHC1_DAT7 IOMUX_PAD(0x750, 0x2ec, 1, 0x810, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__UART3_CTS IOMUX_PAD(0x750, 0x2ec, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__USB_TOP_USBH2_DATA_0 IOMUX_PAD(0x750, 0x2ec, 3, 0x9cc, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__CSPI2_RDY IOMUX_PAD(0x750, 0x2ec, 4, 0x7e4, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__GPIO3_9 IOMUX_PAD(0x750, 0x2ec, 5, 0x918, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__IPU_DISPB_SER_RS IOMUX_PAD(0x750, 0x2ec, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_COL__ARM11P_TOP_EVNTBUS_3 IOMUX_PAD(0x750, 0x2ec, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RDATA0__FEC_RDATA_0 IOMUX_PAD(0x754, 0x2f0, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__PWM_PWMO IOMUX_PAD(0x754, 0x2f0, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__UART3_DTR IOMUX_PAD(0x754, 0x2f0, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__USB_TOP_USBH2_DATA_1 IOMUX_PAD(0x754, 0x2f0, 3, 0x9d0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__CSPI2_SS0 IOMUX_PAD(0x754, 0x2f0, 4, 0x7f0, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__GPIO3_10 IOMUX_PAD(0x754, 0x2f0, 5, 0x8ec, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__IPU_DISPB_CS1 IOMUX_PAD(0x754, 0x2f0, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA0__ARM11P_TOP_EVNTBUS_4 IOMUX_PAD(0x754, 0x2f0, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TDATA0__FEC_TDATA_0 IOMUX_PAD(0x758, 0x2f4, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__SPDIF_SPDIF_OUT1 IOMUX_PAD(0x758, 0x2f4, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__UART3_DSR IOMUX_PAD(0x758, 0x2f4, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__USB_TOP_USBH2_DATA_2 IOMUX_PAD(0x758, 0x2f4, 3, 0x9d4, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__CSPI2_SS1 IOMUX_PAD(0x758, 0x2f4, 4, 0x7f4, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__GPIO3_11 IOMUX_PAD(0x758, 0x2f4, 5, 0x8f0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__IPU_DISPB_CS0 IOMUX_PAD(0x758, 0x2f4, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA0__ARM11P_TOP_EVNTBUS_5 IOMUX_PAD(0x758, 0x2f4, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x75c, 0x2f8, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__SPDIF_SPDIF_IN1 IOMUX_PAD(0x75c, 0x2f8, 1, 0x998, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__UART3_RI IOMUX_PAD(0x75c, 0x2f8, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__USB_TOP_USBH2_DATA_3 IOMUX_PAD(0x75c, 0x2f8, 3, 0x9d8, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__GPIO3_12 IOMUX_PAD(0x75c, 0x2f8, 5, 0x8f4, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__IPU_DISPB_PAR_RS IOMUX_PAD(0x75c, 0x2f8, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_EN__ARM11P_TOP_EVNTBUS_6 IOMUX_PAD(0x75c, 0x2f8, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x760, 0x2fc, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__CAN2_TXCAN IOMUX_PAD(0x760, 0x2fc, 1, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__UART3_DCD IOMUX_PAD(0x760, 0x2fc, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__USB_TOP_USBH2_DATA_4 IOMUX_PAD(0x760, 0x2fc, 3, 0x9dc, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__GPIO3_13 IOMUX_PAD(0x760, 0x2fc, 5, 0x8f8, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__IPU_DISPB_WR IOMUX_PAD(0x760, 0x2fc, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDC__ARM11P_TOP_EVNTBUS_7 IOMUX_PAD(0x760, 0x2fc, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(0x764, 0x300, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDIO__CAN2_RXCAN IOMUX_PAD(0x764, 0x300, 1, 0x7cc, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDIO__USB_TOP_USBH2_DATA_5 IOMUX_PAD(0x764, 0x300, 3, 0x9e0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDIO__GPIO3_14 IOMUX_PAD(0x764, 0x300, 5, 0x8fc, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDIO__IPU_DISPB_RD IOMUX_PAD(0x764, 0x300, 6, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_MDIO__ARM11P_TOP_EVNTBUS_8 IOMUX_PAD(0x764, 0x300, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TX_ERR__FEC_TX_ERR IOMUX_PAD(0x768, 0x304, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__OWIRE_LINE IOMUX_PAD(0x768, 0x304, 1, 0x990, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__SPDIF_SPDIF_EXTCLK IOMUX_PAD(0x768, 0x304, 2, 0x994, 4, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__USB_TOP_USBH2_DATA_6 IOMUX_PAD(0x768, 0x304, 3, 0x9e4, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__GPIO3_15 IOMUX_PAD(0x768, 0x304, 5, 0x900, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__IPU_DISPB_D0_VSYNC IOMUX_PAD(0x768, 0x304, 6, 0x924, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TX_ERR__ARM11P_TOP_EVNTBUS_9 IOMUX_PAD(0x768, 0x304, 7, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RX_ERR__FEC_RX_ERR IOMUX_PAD(0x76c, 0x308, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_ERR__IPU_CSI_D_0 IOMUX_PAD(0x76c, 0x308, 1, 0x930, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_ERR__USB_TOP_USBH2_DATA_7 IOMUX_PAD(0x76c, 0x308, 3, 0x9e8, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_ERR__KPP_COL_4 IOMUX_PAD(0x76c, 0x308, 4, 0x960, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_ERR__GPIO3_16 IOMUX_PAD(0x76c, 0x308, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RX_ERR__IPU_DISPB_SD_D_IO IOMUX_PAD(0x76c, 0x308, 6, 0x92c, 5, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_CRS__FEC_CRS IOMUX_PAD(0x770, 0x30c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_CRS__IPU_CSI_D_1 IOMUX_PAD(0x770, 0x30c, 1, 0x934, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_CRS__USB_TOP_USBH2_PWR IOMUX_PAD(0x770, 0x30c, 3, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_CRS__KPP_COL_5 IOMUX_PAD(0x770, 0x30c, 4, 0x964, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_CRS__GPIO3_17 IOMUX_PAD(0x770, 0x30c, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_CRS__IPU_FLASH_STROBE IOMUX_PAD(0x770, 0x30c, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RDATA1__FEC_RDATA_1 IOMUX_PAD(0x774, 0x310, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__IPU_CSI_D_2 IOMUX_PAD(0x774, 0x310, 1, 0x938, 4, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__AUDMUX_AUD6_RXC IOMUX_PAD(0x774, 0x310, 2, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__USB_TOP_USBH2_OC IOMUX_PAD(0x774, 0x310, 3, 0x9f4, 2, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__KPP_COL_6 IOMUX_PAD(0x774, 0x310, 4, 0x968, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__GPIO3_18 IOMUX_PAD(0x774, 0x310, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA1__IPU_DISPB_BE0 IOMUX_PAD(0x774, 0x310, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TDATA1__FEC_TDATA_1 IOMUX_PAD(0x778, 0x314, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA1__IPU_CSI_D_3 IOMUX_PAD(0x778, 0x314, 1, 0x93c, 4, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA1__AUDMUX_AUD6_RXFS IOMUX_PAD(0x778, 0x314, 2, 0x7bc, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA1__KPP_COL_7 IOMUX_PAD(0x778, 0x314, 4, 0x96c, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA1__GPIO3_19 IOMUX_PAD(0x778, 0x314, 5, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA1__IPU_DISPB_BE1 IOMUX_PAD(0x778, 0x314, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RDATA2__FEC_RDATA_2 IOMUX_PAD(0x77c, 0x318, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA2__IPU_CSI_D_4 IOMUX_PAD(0x77c, 0x318, 1, 0x940, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA2__AUDMUX_AUD6_TXD IOMUX_PAD(0x77c, 0x318, 2, 0x7b4, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA2__KPP_ROW_4 IOMUX_PAD(0x77c, 0x318, 4, 0x980, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA2__GPIO3_20 IOMUX_PAD(0x77c, 0x318, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TDATA2__FEC_TDATA_2 IOMUX_PAD(0x780, 0x31c, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA2__IPU_CSI_D_5 IOMUX_PAD(0x780, 0x31c, 1, 0x944, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA2__AUDMUX_AUD6_RXD IOMUX_PAD(0x780, 0x31c, 2, 0x7b0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA2__KPP_ROW_5 IOMUX_PAD(0x780, 0x31c, 4, 0x984, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA2__GPIO3_21 IOMUX_PAD(0x780, 0x31c, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_RDATA3__FEC_RDATA_3 IOMUX_PAD(0x784, 0x320, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA3__IPU_CSI_D_6 IOMUX_PAD(0x784, 0x320, 1, 0x948, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA3__AUDMUX_AUD6_TXC IOMUX_PAD(0x784, 0x320, 2, 0x7c0, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA3__KPP_ROW_6 IOMUX_PAD(0x784, 0x320, 4, 0x988, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_RDATA3__GPIO3_22 IOMUX_PAD(0x784, 0x320, 6, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_FEC_TDATA3__FEC_TDATA_3 IOMUX_PAD(0x788, 0x324, 0, 0x0, 0, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA3__IPU_CSI_D_7 IOMUX_PAD(0x788, 0x324, 1, 0x94c, 3, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA3__AUDMUX_AUD6_TXFS IOMUX_PAD(0x788, 0x324, 2, 0x7c4, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA3__KPP_ROW_7 IOMUX_PAD(0x788, 0x324, 4, 0x98c, 1, NO_PAD_CTRL)
++#define MX35_PAD_FEC_TDATA3__GPIO3_23 IOMUX_PAD(0x788, 0x324, 5, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_EXT_ARMCLK__CCM_EXT_ARMCLK IOMUX_PAD(0x78c, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++#define MX35_PAD_TEST_MODE__TCU_TEST_MODE IOMUX_PAD(0x790, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
++
++
++#endif /* __MACH_IOMUX_MX35_H__ */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx3.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx3.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx3.h 2009-05-13 09:46:19.000000000 +0200
+@@ -114,7 +114,7 @@ enum iomux_gp_func {
+ * - setups the iomux according to the configuration
+ * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib
+ */
+-int mxc_iomux_setup_pin(const unsigned int pin, const char *label);
++int mxc_iomux_alloc_pin(const unsigned int pin, const char *label);
+ /*
+ * setups mutliple pins
+ * convenient way to call the above function with tables
+@@ -633,6 +633,40 @@ enum iomux_pins {
+ #define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC)
+ #define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC)
+ #define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2)
++#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2)
++#define MX31_PIN_ATA_CS0__GPIO3_26 IOMUX_MODE(MX31_PIN_ATA_CS0, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_ATA_CS1__GPIO3_27 IOMUX_MODE(MX31_PIN_ATA_CS1, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_PC_PWRON__SD2_DATA3 IOMUX_MODE(MX31_PIN_PC_PWRON, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_PC_VS1__SD2_DATA2 IOMUX_MODE(MX31_PIN_PC_VS1, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_PC_READY__SD2_DATA1 IOMUX_MODE(MX31_PIN_PC_READY, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_PC_WAIT_B__SD2_DATA0 IOMUX_MODE(MX31_PIN_PC_WAIT_B, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_PC_CD2_B__SD2_CLK IOMUX_MODE(MX31_PIN_PC_CD2_B, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_PC_CD1_B__SD2_CMD IOMUX_MODE(MX31_PIN_PC_CD1_B, IOMUX_CONFIG_ALT1)
++#define MX31_PIN_ATA_DIOR__GPIO3_28 IOMUX_MODE(MX31_PIN_ATA_DIOR, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_ATA_DIOW__GPIO3_29 IOMUX_MODE(MX31_PIN_ATA_DIOW, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D7__CSI_D7 IOMUX_MODE(MX31_PIN_CSI_D7, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D8__CSI_D8 IOMUX_MODE(MX31_PIN_CSI_D8, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D9__CSI_D9 IOMUX_MODE(MX31_PIN_CSI_D9, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D10__CSI_D10 IOMUX_MODE(MX31_PIN_CSI_D10, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D11__CSI_D11 IOMUX_MODE(MX31_PIN_CSI_D11, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D12__CSI_D12 IOMUX_MODE(MX31_PIN_CSI_D12, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D13__CSI_D13 IOMUX_MODE(MX31_PIN_CSI_D13, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D14__CSI_D14 IOMUX_MODE(MX31_PIN_CSI_D14, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_D15__CSI_D15 IOMUX_MODE(MX31_PIN_CSI_D15, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_HSYNC__CSI_HSYNC IOMUX_MODE(MX31_PIN_CSI_HSYNC, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_MCLK__CSI_MCLK IOMUX_MODE(MX31_PIN_CSI_MCLK, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_PIXCLK__CSI_PIXCLK IOMUX_MODE(MX31_PIN_CSI_PIXCLK, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_CSI_VSYNC__CSI_VSYNC IOMUX_MODE(MX31_PIN_CSI_VSYNC, IOMUX_CONFIG_FUNC)
++#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)
++#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
+
+ /*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
+ * cspi1_ss1*/
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-v3.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-v3.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-v3.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-v3.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,121 @@
++/*
++ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
++ * <armlinux@phytec.de>
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#ifndef __MACH_IOMUX_V3_H__
++#define __MACH_IOMUX_V3_H__
++
++/*
++ * build IOMUX_PAD structure
++ *
++ * This iomux scheme is based around pads, which are the physical balls
++ * on the processor.
++ *
++ * - Each pad has a pad control register (IOMUXC_SW_PAD_CTRL_x) which controls
++ * things like driving strength and pullup/pulldown.
++ * - Each pad can have but not necessarily does have an output routing register
++ * (IOMUXC_SW_MUX_CTL_PAD_x).
++ * - Each pad can have but not necessarily does have an input routing register
++ * (IOMUXC_x_SELECT_INPUT)
++ *
++ * The three register sets do not have a fixed offset to each other,
++ * hence we order this table by pad control registers (which all pads
++ * have) and put the optional i/o routing registers into additional
++ * fields.
++ *
++ * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
++ * If <padname> or <padmode> refers to a GPIO, it is named
++ * GPIO_<unit>_<num>
++ *
++ */
++
++struct pad_desc {
++ unsigned mux_ctrl_ofs:12; /* IOMUXC_SW_MUX_CTL_PAD offset */
++ unsigned mux_mode:8;
++ unsigned pad_ctrl_ofs:12; /* IOMUXC_SW_PAD_CTRL offset */
++#define NO_PAD_CTRL (1 << 16)
++ unsigned pad_ctrl:17;
++ unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */
++ unsigned select_input:3;
++};
++
++#define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
++ _select_input, _pad_ctrl) \
++ { \
++ .mux_ctrl_ofs = _mux_ctrl_ofs, \
++ .mux_mode = _mux_mode, \
++ .pad_ctrl_ofs = _pad_ctrl_ofs, \
++ .pad_ctrl = _pad_ctrl, \
++ .select_input_ofs = _select_input_ofs, \
++ .select_input = _select_input, \
++ }
++
++/*
++ * Use to set PAD control
++ */
++#define PAD_CTL_DRIVE_VOLTAGE_3_3_V 0
++#define PAD_CTL_DRIVE_VOLTAGE_1_8_V 1
++
++#define PAD_CTL_NO_HYSTERESIS 0
++#define PAD_CTL_HYSTERESIS 1
++
++#define PAD_CTL_PULL_DISABLED 0x0
++#define PAD_CTL_PULL_KEEPER 0xa
++#define PAD_CTL_PULL_DOWN_100K 0xc
++#define PAD_CTL_PULL_UP_47K 0xd
++#define PAD_CTL_PULL_UP_100K 0xe
++#define PAD_CTL_PULL_UP_22K 0xf
++
++#define PAD_CTL_OUTPUT_CMOS 0
++#define PAD_CTL_OUTPUT_OPEN_DRAIN 1
++
++#define PAD_CTL_DRIVE_STRENGTH_NORM 0
++#define PAD_CTL_DRIVE_STRENGTH_HIGH 1
++#define PAD_CTL_DRIVE_STRENGTH_MAX 2
++
++#define PAD_CTL_SLEW_RATE_SLOW 0
++#define PAD_CTL_SLEW_RATE_FAST 1
++
++/*
++ * setups a single pad:
++ * - reserves the pad so that it is not claimed by another driver
++ * - setups the iomux according to the configuration
++ */
++int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
++
++/*
++ * setups mutliple pads
++ * convenient way to call the above function with tables
++ */
++int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count);
++
++/*
++ * releases a single pad:
++ * - make it available for a future use by another driver
++ * - DOES NOT reconfigure the IOMUX in its reset state
++ */
++void mxc_iomux_v3_release_pad(struct pad_desc *pad);
++
++/*
++ * releases multiple pads
++ * convenvient way to call the above function with tables
++ */
++void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count);
++
++#endif /* __MACH_IOMUX_V3_H__*/
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/memory.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/memory.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/memory.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/memory.h 2009-05-13 09:46:19.000000000 +0200
+@@ -32,4 +32,12 @@
+ #define CONSISTENT_DMA_SIZE SZ_4M
+ #endif /* CONFIG_MX1_VIDEO */
+
++#if defined(CONFIG_MX3_VIDEO)
++/*
++ * Increase size of DMA-consistent memory region.
++ * This is required for mx3 camera driver to capture at least two QXGA frames.
++ */
++#define CONSISTENT_DMA_SIZE SZ_8M
++#endif /* CONFIG_MX3_VIDEO */
++
+ #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx1.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx1.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx1.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx1.h 2009-05-13 09:46:19.000000000 +0200
+@@ -179,7 +179,7 @@
+ #define DMA_REQ_UART1_T 30
+ #define DMA_REQ_UART1_R 31
+
+-/* mandatory for CONFIG_LL_DEBUG */
++/* mandatory for CONFIG_DEBUG_LL */
+ #define MXC_LL_UART_PADDR UART1_BASE_ADDR
+ #define MXC_LL_UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mxc_timer.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_timer.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mxc_timer.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_timer.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,158 +0,0 @@
+-/*
+- * mxc_timer.h
+- *
+- * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
+- *
+- * Platform independent (i.MX1, i.MX2, i.MX3) definition for timer handling.
+- *
+- * 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., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02110-1301, USA.
+- */
+-
+-#ifndef __PLAT_MXC_TIMER_H
+-#define __PLAT_MXC_TIMER_H
+-
+-#include <linux/clk.h>
+-#include <mach/hardware.h>
+-
+-#ifdef CONFIG_ARCH_MX1
+-#define TIMER_BASE IO_ADDRESS(TIM1_BASE_ADDR)
+-#define TIMER_INTERRUPT TIM1_INT
+-
+-#define TCTL_VAL TCTL_CLK_PCLK1
+-#define TCTL_IRQEN (1<<4)
+-#define TCTL_FRR (1<<8)
+-#define TCTL_CLK_PCLK1 (1<<1)
+-#define TCTL_CLK_PCLK1_4 (2<<1)
+-#define TCTL_CLK_TIN (3<<1)
+-#define TCTL_CLK_32 (4<<1)
+-
+-#define MXC_TCTL 0x00
+-#define MXC_TPRER 0x04
+-#define MXC_TCMP 0x08
+-#define MXC_TCR 0x0c
+-#define MXC_TCN 0x10
+-#define MXC_TSTAT 0x14
+-#define TSTAT_CAPT (1<<1)
+-#define TSTAT_COMP (1<<0)
+-
+-static inline void gpt_irq_disable(void)
+-{
+- unsigned int tmp;
+-
+- tmp = __raw_readl(TIMER_BASE + MXC_TCTL);
+- __raw_writel(tmp & ~TCTL_IRQEN, TIMER_BASE + MXC_TCTL);
+-}
+-
+-static inline void gpt_irq_enable(void)
+-{
+- __raw_writel(__raw_readl(TIMER_BASE + MXC_TCTL) | TCTL_IRQEN,
+- TIMER_BASE + MXC_TCTL);
+-}
+-
+-static void gpt_irq_acknowledge(void)
+-{
+- __raw_writel(0, TIMER_BASE + MXC_TSTAT);
+-}
+-#endif /* CONFIG_ARCH_MX1 */
+-
+-#ifdef CONFIG_ARCH_MX2
+-#define TIMER_BASE IO_ADDRESS(GPT1_BASE_ADDR)
+-#define TIMER_INTERRUPT MXC_INT_GPT1
+-
+-#define MXC_TCTL 0x00
+-#define TCTL_VAL TCTL_CLK_PCLK1
+-#define TCTL_CLK_PCLK1 (1<<1)
+-#define TCTL_CLK_PCLK1_4 (2<<1)
+-#define TCTL_IRQEN (1<<4)
+-#define TCTL_FRR (1<<8)
+-#define MXC_TPRER 0x04
+-#define MXC_TCMP 0x08
+-#define MXC_TCR 0x0c
+-#define MXC_TCN 0x10
+-#define MXC_TSTAT 0x14
+-#define TSTAT_CAPT (1<<1)
+-#define TSTAT_COMP (1<<0)
+-
+-static inline void gpt_irq_disable(void)
+-{
+- unsigned int tmp;
+-
+- tmp = __raw_readl(TIMER_BASE + MXC_TCTL);
+- __raw_writel(tmp & ~TCTL_IRQEN, TIMER_BASE + MXC_TCTL);
+-}
+-
+-static inline void gpt_irq_enable(void)
+-{
+- __raw_writel(__raw_readl(TIMER_BASE + MXC_TCTL) | TCTL_IRQEN,
+- TIMER_BASE + MXC_TCTL);
+-}
+-
+-static void gpt_irq_acknowledge(void)
+-{
+- __raw_writel(TSTAT_CAPT | TSTAT_COMP, TIMER_BASE + MXC_TSTAT);
+-}
+-#endif /* CONFIG_ARCH_MX2 */
+-
+-#ifdef CONFIG_ARCH_MX3
+-#define TIMER_BASE IO_ADDRESS(GPT1_BASE_ADDR)
+-#define TIMER_INTERRUPT MXC_INT_GPT
+-
+-#define MXC_TCTL 0x00
+-#define TCTL_VAL (TCTL_CLK_IPG | TCTL_WAITEN)
+-#define TCTL_CLK_IPG (1<<6)
+-#define TCTL_FRR (1<<9)
+-#define TCTL_WAITEN (1<<3)
+-
+-#define MXC_TPRER 0x04
+-#define MXC_TSTAT 0x08
+-#define TSTAT_OF1 (1<<0)
+-#define TSTAT_OF2 (1<<1)
+-#define TSTAT_OF3 (1<<2)
+-#define TSTAT_IF1 (1<<3)
+-#define TSTAT_IF2 (1<<4)
+-#define TSTAT_ROV (1<<5)
+-#define MXC_IR 0x0c
+-#define MXC_TCMP 0x10
+-#define MXC_TCMP2 0x14
+-#define MXC_TCMP3 0x18
+-#define MXC_TCR 0x1c
+-#define MXC_TCN 0x24
+-
+-static inline void gpt_irq_disable(void)
+-{
+- __raw_writel(0, TIMER_BASE + MXC_IR);
+-}
+-
+-static inline void gpt_irq_enable(void)
+-{
+- __raw_writel(1<<0, TIMER_BASE + MXC_IR);
+-}
+-
+-static inline void gpt_irq_acknowledge(void)
+-{
+- __raw_writel(TSTAT_OF1, TIMER_BASE + MXC_TSTAT);
+-}
+-#endif /* CONFIG_ARCH_MX3 */
+-
+-#define TCTL_SWR (1<<15)
+-#define TCTL_CC (1<<10)
+-#define TCTL_OM (1<<9)
+-#define TCTL_CAP_RIS (1<<6)
+-#define TCTL_CAP_FAL (2<<6)
+-#define TCTL_CAP_RIS_FAL (3<<6)
+-#define TCTL_CAP_ENA (1<<5)
+-#define TCTL_TEN (1<<0)
+-
+-#endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/usb.h linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/usb.h
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/usb.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/usb.h 2009-05-13 09:46:19.000000000 +0200
+@@ -17,7 +17,7 @@
+
+ struct imxusb_platform_data {
+ int (*init)(struct device *);
+- int (*exit)(struct device *);
++ void (*exit)(struct device *);
+ };
+
+ #endif /* __ASM_ARCH_MXC_USB */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-v3.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-v3.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-v3.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-v3.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,98 @@
++/*
++ * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
++ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
++ * <armlinux@phytec.de>
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++#include <linux/errno.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/string.h>
++#include <linux/gpio.h>
++
++#include <mach/hardware.h>
++#include <asm/mach/map.h>
++#include <mach/iomux-v3.h>
++
++#define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR)
++
++static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG];
++
++/*
++ * setups a single pin:
++ * - reserves the pin so that it is not claimed by another driver
++ * - setups the iomux according to the configuration
++ */
++int mxc_iomux_v3_setup_pad(struct pad_desc *pad)
++{
++ unsigned int pad_ofs = pad->pad_ctrl_ofs;
++
++ if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map))
++ return -EBUSY;
++ if (pad->mux_ctrl_ofs)
++ __raw_writel(pad->mux_mode, IOMUX_BASE + pad->mux_ctrl_ofs);
++
++ if (pad->select_input_ofs)
++ __raw_writel(pad->select_input,
++ IOMUX_BASE + pad->select_input_ofs);
++
++ if (!(pad->pad_ctrl & NO_PAD_CTRL))
++ __raw_writel(pad->pad_ctrl, IOMUX_BASE + pad->pad_ctrl_ofs);
++ return 0;
++}
++EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
++
++int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count)
++{
++ struct pad_desc *p = pad_list;
++ int i;
++ int ret;
++
++ for (i = 0; i < count; i++) {
++ ret = mxc_iomux_v3_setup_pad(p);
++ if (ret)
++ goto setup_error;
++ p++;
++ }
++ return 0;
++
++setup_error:
++ mxc_iomux_v3_release_multiple_pads(pad_list, i);
++ return ret;
++}
++EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads);
++
++void mxc_iomux_v3_release_pad(struct pad_desc *pad)
++{
++ unsigned int pad_ofs = pad->pad_ctrl_ofs;
++
++ clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map);
++}
++EXPORT_SYMBOL(mxc_iomux_v3_release_pad);
++
++void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count)
++{
++ struct pad_desc *p = pad_list;
++ int i;
++
++ for (i = 0; i < count; i++) {
++ mxc_iomux_v3_release_pad(p);
++ p++;
++ }
++}
++EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/irq.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/irq.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/irq.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/irq.c 2009-05-13 09:46:19.000000000 +0200
+@@ -24,31 +24,27 @@
+ #include <asm/mach/irq.h>
+ #include <mach/hardware.h>
+
+-#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
+-#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
+-#define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */
+-#define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */
+-#define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */
+-#define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */
+-#define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */
+-#define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */
+-#define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */
+-#define AVIC_NIPRIORITY(x) (AVIC_BASE + (0x20 + 4 * (7 - (x)))) /* int priority */
+-#define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */
+-#define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */
+-#define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */
+-#define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */
+-#define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */
+-#define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */
+-#define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */
+-#define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */
+-#define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */
+-#define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */
+-
+-#define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
+-#define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
+-#define IIM_PROD_REV_SH 3
+-#define IIM_PROD_REV_LEN 5
++#define AVIC_INTCNTL 0x00 /* int control reg */
++#define AVIC_NIMASK 0x04 /* int mask reg */
++#define AVIC_INTENNUM 0x08 /* int enable number reg */
++#define AVIC_INTDISNUM 0x0C /* int disable number reg */
++#define AVIC_INTENABLEH 0x10 /* int enable reg high */
++#define AVIC_INTENABLEL 0x14 /* int enable reg low */
++#define AVIC_INTTYPEH 0x18 /* int type reg high */
++#define AVIC_INTTYPEL 0x1C /* int type reg low */
++#define AVIC_NIPRIORITY(x) (0x20 + 4 * (7 - (x))) /* int priority */
++#define AVIC_NIVECSR 0x40 /* norm int vector/status */
++#define AVIC_FIVECSR 0x44 /* fast int vector/status */
++#define AVIC_INTSRCH 0x48 /* int source reg high */
++#define AVIC_INTSRCL 0x4C /* int source reg low */
++#define AVIC_INTFRCH 0x50 /* int force reg high */
++#define AVIC_INTFRCL 0x54 /* int force reg low */
++#define AVIC_NIPNDH 0x58 /* norm int pending high */
++#define AVIC_NIPNDL 0x5C /* norm int pending low */
++#define AVIC_FIPNDH 0x60 /* fast int pending high */
++#define AVIC_FIPNDL 0x64 /* fast int pending low */
++
++static void __iomem *avic_base;
+
+ int imx_irq_set_priority(unsigned char irq, unsigned char prio)
+ {
+@@ -59,11 +55,11 @@ int imx_irq_set_priority(unsigned char i
+ if (irq >= MXC_INTERNAL_IRQS)
+ return -EINVAL;;
+
+- temp = __raw_readl(AVIC_NIPRIORITY(irq / 8));
++ temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8));
+ temp &= ~mask;
+ temp |= prio & mask;
+
+- __raw_writel(temp, AVIC_NIPRIORITY(irq / 8));
++ __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8));
+
+ return 0;
+ #else
+@@ -81,12 +77,12 @@ int mxc_set_irq_fiq(unsigned int irq, un
+ return -EINVAL;
+
+ if (irq < MXC_INTERNAL_IRQS / 2) {
+- irqt = __raw_readl(AVIC_INTTYPEL) & ~(1 << irq);
+- __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEL);
++ irqt = __raw_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq);
++ __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL);
+ } else {
+ irq -= MXC_INTERNAL_IRQS / 2;
+- irqt = __raw_readl(AVIC_INTTYPEH) & ~(1 << irq);
+- __raw_writel(irqt | (!!type << irq), AVIC_INTTYPEH);
++ irqt = __raw_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq);
++ __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH);
+ }
+
+ return 0;
+@@ -97,13 +93,13 @@ EXPORT_SYMBOL(mxc_set_irq_fiq);
+ /* Disable interrupt number "irq" in the AVIC */
+ static void mxc_mask_irq(unsigned int irq)
+ {
+- __raw_writel(irq, AVIC_INTDISNUM);
++ __raw_writel(irq, avic_base + AVIC_INTDISNUM);
+ }
+
+ /* Enable interrupt number "irq" in the AVIC */
+ static void mxc_unmask_irq(unsigned int irq)
+ {
+- __raw_writel(irq, AVIC_INTENNUM);
++ __raw_writel(irq, avic_base + AVIC_INTENNUM);
+ }
+
+ static struct irq_chip mxc_avic_chip = {
+@@ -121,19 +117,21 @@ void __init mxc_init_irq(void)
+ {
+ int i;
+
++ avic_base = IO_ADDRESS(AVIC_BASE_ADDR);
++
+ /* put the AVIC into the reset value with
+ * all interrupts disabled
+ */
+- __raw_writel(0, AVIC_INTCNTL);
+- __raw_writel(0x1f, AVIC_NIMASK);
++ __raw_writel(0, avic_base + AVIC_INTCNTL);
++ __raw_writel(0x1f, avic_base + AVIC_NIMASK);
+
+ /* disable all interrupts */
+- __raw_writel(0, AVIC_INTENABLEH);
+- __raw_writel(0, AVIC_INTENABLEL);
++ __raw_writel(0, avic_base + AVIC_INTENABLEH);
++ __raw_writel(0, avic_base + AVIC_INTENABLEL);
+
+ /* all IRQ no FIQ */
+- __raw_writel(0, AVIC_INTTYPEH);
+- __raw_writel(0, AVIC_INTTYPEL);
++ __raw_writel(0, avic_base + AVIC_INTTYPEH);
++ __raw_writel(0, avic_base + AVIC_INTTYPEL);
+ for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
+ set_irq_chip(i, &mxc_avic_chip);
+ set_irq_handler(i, handle_level_irq);
+@@ -142,7 +140,7 @@ void __init mxc_init_irq(void)
+
+ /* Set default priority value (0) for all IRQ's */
+ for (i = 0; i < 8; i++)
+- __raw_writel(0, AVIC_NIPRIORITY(i));
++ __raw_writel(0, avic_base + AVIC_NIPRIORITY(i));
+
+ /* init architectures chained interrupt handler */
+ mxc_register_gpios();
+@@ -154,3 +152,4 @@ void __init mxc_init_irq(void)
+
+ printk(KERN_INFO "MXC IRQ initialized\n");
+ }
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/Kconfig linux-2.6.30-rc4-git/arch/arm/plat-mxc/Kconfig
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -48,7 +48,14 @@ config MXC_IRQ_PRIOR
+ config MXC_PWM
+ tristate "Enable PWM driver"
+ depends on ARCH_MXC
++ select HAVE_PWM
+ help
+ Enable support for the i.MX PWM controller(s).
+
++config ARCH_HAS_RNGA
++ bool
++ depends on ARCH_MXC
++
++config ARCH_MXC_IOMUX_V3
++ bool
+ endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/Makefile linux-2.6.30-rc4-git/arch/arm/plat-mxc/Makefile
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -7,4 +7,5 @@ obj-y := irq.o clock.o gpio.o time.o dev
+
+ obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o
+ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
++obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
+ obj-$(CONFIG_MXC_PWM) += pwm.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/pwm.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/pwm.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/pwm.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/pwm.c 2009-05-13 09:46:19.000000000 +0200
+@@ -15,65 +15,26 @@
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/pwm.h>
++#include <mach/hardware.h>
++
++
++/* i.MX1 and i.MX21 share the same PWM function block: */
++
++#define MX1_PWMC 0x00 /* PWM Control Register */
++#define MX1_PWMS 0x04 /* PWM Sample Register */
++#define MX1_PWMP 0x08 /* PWM Period Register */
++
++
++/* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
++
++#define MX3_PWMCR 0x00 /* PWM Control Register */
++#define MX3_PWMSAR 0x0C /* PWM Sample Register */
++#define MX3_PWMPR 0x10 /* PWM Period Register */
++#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)
++#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
++#define MX3_PWMCR_EN (1 << 0)
+
+-#if defined CONFIG_ARCH_MX1 || defined CONFIG_ARCH_MX21
+-#define PWM_VER_1
+
+-#define PWMCR 0x00 /* PWM Control Register */
+-#define PWMSR 0x04 /* PWM Sample Register */
+-#define PWMPR 0x08 /* PWM Period Register */
+-#define PWMCNR 0x0C /* PWM Counter Register */
+-
+-#define PWMCR_HCTR (1 << 18) /* Halfword FIFO Data Swapping */
+-#define PWMCR_BCTR (1 << 17) /* Byte FIFO Data Swapping */
+-#define PWMCR_SWR (1 << 16) /* Software Reset */
+-#define PWMCR_CLKSRC_PERCLK (0 << 15) /* PERCLK Clock Source */
+-#define PWMCR_CLKSRC_CLK32 (1 << 15) /* 32KHz Clock Source */
+-#define PWMCR_PRESCALER(x) (((x - 1) & 0x7F) << 8) /* PRESCALER */
+-#define PWMCR_IRQ (1 << 7) /* Interrupt Request */
+-#define PWMCR_IRQEN (1 << 6) /* Interrupt Request Enable */
+-#define PWMCR_FIFOAV (1 << 5) /* FIFO Available */
+-#define PWMCR_EN (1 << 4) /* Enables/Disables the PWM */
+-#define PWMCR_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
+-#define PWMCR_DIV(x) (((x) & 0x03) << 0) /* Clock divider 2/4/8/16 */
+-
+-#define MAX_DIV (128 * 16)
+-#endif
+-
+-#if defined CONFIG_MACH_MX27 || defined CONFIG_ARCH_MX31
+-#define PWM_VER_2
+-
+-#define PWMCR 0x00 /* PWM Control Register */
+-#define PWMSR 0x04 /* PWM Status Register */
+-#define PWMIR 0x08 /* PWM Interrupt Register */
+-#define PWMSAR 0x0C /* PWM Sample Register */
+-#define PWMPR 0x10 /* PWM Period Register */
+-#define PWMCNR 0x14 /* PWM Counter Register */
+-
+-#define PWMCR_EN (1 << 0) /* Enables/Disables the PWM */
+-#define PWMCR_REPEAT(x) (((x) & 0x03) << 1) /* Sample Repeats */
+-#define PWMCR_SWR (1 << 3) /* Software Reset */
+-#define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)/* PRESCALER */
+-#define PWMCR_CLKSRC(x) (((x) & 0x3) << 16)
+-#define PWMCR_CLKSRC_OFF (0 << 16)
+-#define PWMCR_CLKSRC_IPG (1 << 16)
+-#define PWMCR_CLKSRC_IPG_HIGH (2 << 16)
+-#define PWMCR_CLKSRC_CLK32 (3 << 16)
+-#define PWMCR_POUTC
+-#define PWMCR_HCTR (1 << 20) /* Halfword FIFO Data Swapping */
+-#define PWMCR_BCTR (1 << 21) /* Byte FIFO Data Swapping */
+-#define PWMCR_DBGEN (1 << 22) /* Debug Mode */
+-#define PWMCR_WAITEN (1 << 23) /* Wait Mode */
+-#define PWMCR_DOZEN (1 << 24) /* Doze Mode */
+-#define PWMCR_STOPEN (1 << 25) /* Stop Mode */
+-#define PWMCR_FWM(x) (((x) & 0x3) << 26) /* FIFO Water Mark */
+-
+-#define MAX_DIV 4096
+-#endif
+-
+-#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
+-#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
+-#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
+
+ struct pwm_device {
+ struct list_head node;
+@@ -91,32 +52,52 @@ struct pwm_device {
+
+ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
+ {
+- unsigned long long c;
+- unsigned long period_cycles, duty_cycles, prescale;
+-
+ if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
+ return -EINVAL;
+
+- c = clk_get_rate(pwm->clk);
+- c = c * period_ns;
+- do_div(c, 1000000000);
+- period_cycles = c;
+-
+- prescale = period_cycles / 0x10000 + 1;
+-
+- period_cycles /= prescale;
+- c = (unsigned long long)period_cycles * duty_ns;
+- do_div(c, period_ns);
+- duty_cycles = c;
+-
+-#ifdef PWM_VER_2
+- writel(duty_cycles, pwm->mmio_base + PWMSAR);
+- writel(period_cycles, pwm->mmio_base + PWMPR);
+- writel(PWMCR_PRESCALER(prescale - 1) | PWMCR_CLKSRC_IPG_HIGH | PWMCR_EN,
+- pwm->mmio_base + PWMCR);
+-#elif defined PWM_VER_1
+-#error PWM not yet working on MX1 / MX21
+-#endif
++ if (cpu_is_mx27() || cpu_is_mx3()) {
++ unsigned long long c;
++ unsigned long period_cycles, duty_cycles, prescale;
++ c = clk_get_rate(pwm->clk);
++ c = c * period_ns;
++ do_div(c, 1000000000);
++ period_cycles = c;
++
++ prescale = period_cycles / 0x10000 + 1;
++
++ period_cycles /= prescale;
++ c = (unsigned long long)period_cycles * duty_ns;
++ do_div(c, period_ns);
++ duty_cycles = c;
++
++ writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
++ writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
++ writel(MX3_PWMCR_PRESCALER(prescale - 1) |
++ MX3_PWMCR_CLKSRC_IPG_HIGH | MX3_PWMCR_EN,
++ pwm->mmio_base + MX3_PWMCR);
++ } else if (cpu_is_mx1() || cpu_is_mx21()) {
++ /* The PWM subsystem allows for exact frequencies. However,
++ * I cannot connect a scope on my device to the PWM line and
++ * thus cannot provide the program the PWM controller
++ * exactly. Instead, I'm relying on the fact that the
++ * Bootloader (u-boot or WinCE+haret) has programmed the PWM
++ * function group already. So I'll just modify the PWM sample
++ * register to follow the ratio of duty_ns vs. period_ns
++ * accordingly.
++ *
++ * This is good enought for programming the brightness of
++ * the LCD backlight.
++ *
++ * The real implementation would divide PERCLK[0] first by
++ * both the prescaler (/1 .. /128) and then by CLKSEL
++ * (/2 .. /16).
++ */
++ u32 max = readl(pwm->mmio_base + MX1_PWMP);
++ u32 p = max * duty_ns / period_ns;
++ writel(max - p, pwm->mmio_base + MX1_PWMS);
++ } else {
++ BUG();
++ }
+
+ return 0;
+ }
+@@ -297,4 +278,3 @@ module_exit(mxc_pwm_exit);
+
+ MODULE_LICENSE("GPL v2");
+ MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-mxc/time.c linux-2.6.30-rc4-git/arch/arm/plat-mxc/time.c
+--- linux-2.6.30-rc4/arch/arm/plat-mxc/time.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-mxc/time.c 2009-05-13 09:46:19.000000000 +0200
+@@ -29,22 +29,85 @@
+ #include <mach/hardware.h>
+ #include <asm/mach/time.h>
+ #include <mach/common.h>
+-#include <mach/mxc_timer.h>
++
++/* defines common for all i.MX */
++#define MXC_TCTL 0x00
++#define MXC_TCTL_TEN (1 << 0)
++#define MXC_TPRER 0x04
++
++/* MX1, MX21, MX27 */
++#define MX1_2_TCTL_CLK_PCLK1 (1 << 1)
++#define MX1_2_TCTL_IRQEN (1 << 4)
++#define MX1_2_TCTL_FRR (1 << 8)
++#define MX1_2_TCMP 0x08
++#define MX1_2_TCN 0x10
++#define MX1_2_TSTAT 0x14
++
++/* MX21, MX27 */
++#define MX2_TSTAT_CAPT (1 << 1)
++#define MX2_TSTAT_COMP (1 << 0)
++
++/* MX31, MX35 */
++#define MX3_TCTL_WAITEN (1 << 3)
++#define MX3_TCTL_CLK_IPG (1 << 6)
++#define MX3_TCTL_FRR (1 << 9)
++#define MX3_IR 0x0c
++#define MX3_TSTAT 0x08
++#define MX3_TSTAT_OF1 (1 << 0)
++#define MX3_TCN 0x24
++#define MX3_TCMP 0x10
+
+ static struct clock_event_device clockevent_mxc;
+ static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
+
+-/* clock source */
++static void __iomem *timer_base;
+
+-static cycle_t mxc_get_cycles(struct clocksource *cs)
++static inline void gpt_irq_disable(void)
+ {
+- return __raw_readl(TIMER_BASE + MXC_TCN);
++ unsigned int tmp;
++
++ if (cpu_is_mx3())
++ __raw_writel(0, timer_base + MX3_IR);
++ else {
++ tmp = __raw_readl(timer_base + MXC_TCTL);
++ __raw_writel(tmp & ~MX1_2_TCTL_IRQEN, timer_base + MXC_TCTL);
++ }
++}
++
++static inline void gpt_irq_enable(void)
++{
++ if (cpu_is_mx3())
++ __raw_writel(1<<0, timer_base + MX3_IR);
++ else {
++ __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN,
++ timer_base + MXC_TCTL);
++ }
++}
++
++static void gpt_irq_acknowledge(void)
++{
++ if (cpu_is_mx1())
++ __raw_writel(0, timer_base + MX1_2_TSTAT);
++ if (cpu_is_mx2())
++ __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT);
++ if (cpu_is_mx3())
++ __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT);
++}
++
++static cycle_t mx1_2_get_cycles(struct clocksource *cs)
++{
++ return __raw_readl(timer_base + MX1_2_TCN);
++}
++
++static cycle_t mx3_get_cycles(struct clocksource *cs)
++{
++ return __raw_readl(timer_base + MX3_TCN);
+ }
+
+ static struct clocksource clocksource_mxc = {
+ .name = "mxc_timer1",
+ .rating = 200,
+- .read = mxc_get_cycles,
++ .read = mx1_2_get_cycles,
+ .mask = CLOCKSOURCE_MASK(32),
+ .shift = 20,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+@@ -54,6 +117,9 @@ static int __init mxc_clocksource_init(s
+ {
+ unsigned int c = clk_get_rate(timer_clk);
+
++ if (cpu_is_mx3())
++ clocksource_mxc.read = mx3_get_cycles;
++
+ clocksource_mxc.mult = clocksource_hz2mult(c,
+ clocksource_mxc.shift);
+ clocksource_register(&clocksource_mxc);
+@@ -63,15 +129,29 @@ static int __init mxc_clocksource_init(s
+
+ /* clock event */
+
+-static int mxc_set_next_event(unsigned long evt,
++static int mx1_2_set_next_event(unsigned long evt,
+ struct clock_event_device *unused)
+ {
+ unsigned long tcmp;
+
+- tcmp = __raw_readl(TIMER_BASE + MXC_TCN) + evt;
+- __raw_writel(tcmp, TIMER_BASE + MXC_TCMP);
++ tcmp = __raw_readl(timer_base + MX1_2_TCN) + evt;
+
+- return (int)(tcmp - __raw_readl(TIMER_BASE + MXC_TCN)) < 0 ?
++ __raw_writel(tcmp, timer_base + MX1_2_TCMP);
++
++ return (int)(tcmp - __raw_readl(timer_base + MX1_2_TCN)) < 0 ?
++ -ETIME : 0;
++}
++
++static int mx3_set_next_event(unsigned long evt,
++ struct clock_event_device *unused)
++{
++ unsigned long tcmp;
++
++ tcmp = __raw_readl(timer_base + MX3_TCN) + evt;
++
++ __raw_writel(tcmp, timer_base + MX3_TCMP);
++
++ return (int)(tcmp - __raw_readl(timer_base + MX3_TCN)) < 0 ?
+ -ETIME : 0;
+ }
+
+@@ -100,8 +180,13 @@ static void mxc_set_mode(enum clock_even
+
+ if (mode != clockevent_mode) {
+ /* Set event time into far-far future */
+- __raw_writel(__raw_readl(TIMER_BASE + MXC_TCN) - 3,
+- TIMER_BASE + MXC_TCMP);
++ if (cpu_is_mx3())
++ __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3,
++ timer_base + MX3_TCMP);
++ else
++ __raw_writel(__raw_readl(timer_base + MX1_2_TCN) - 3,
++ timer_base + MX1_2_TCMP);
++
+ /* Clear pending interrupt */
+ gpt_irq_acknowledge();
+ }
+@@ -148,7 +233,10 @@ static irqreturn_t mxc_timer_interrupt(i
+ struct clock_event_device *evt = &clockevent_mxc;
+ uint32_t tstat;
+
+- tstat = __raw_readl(TIMER_BASE + MXC_TSTAT);
++ if (cpu_is_mx3())
++ tstat = __raw_readl(timer_base + MX3_TSTAT);
++ else
++ tstat = __raw_readl(timer_base + MX1_2_TSTAT);
+
+ gpt_irq_acknowledge();
+
+@@ -168,7 +256,7 @@ static struct clock_event_device clockev
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+ .shift = 32,
+ .set_mode = mxc_set_mode,
+- .set_next_event = mxc_set_next_event,
++ .set_next_event = mx1_2_set_next_event,
+ .rating = 200,
+ };
+
+@@ -176,6 +264,9 @@ static int __init mxc_clockevent_init(st
+ {
+ unsigned int c = clk_get_rate(timer_clk);
+
++ if (cpu_is_mx3())
++ clockevent_mxc.set_next_event = mx3_set_next_event;
++
+ clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
+ clockevent_mxc.shift);
+ clockevent_mxc.max_delta_ns =
+@@ -192,23 +283,47 @@ static int __init mxc_clockevent_init(st
+
+ void __init mxc_timer_init(struct clk *timer_clk)
+ {
++ uint32_t tctl_val;
++ int irq;
++
+ clk_enable(timer_clk);
+
++ if (cpu_is_mx1()) {
++#ifdef CONFIG_ARCH_MX1
++ timer_base = IO_ADDRESS(TIM1_BASE_ADDR);
++ irq = TIM1_INT;
++#endif
++ } else if (cpu_is_mx2()) {
++#ifdef CONFIG_ARCH_MX2
++ timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
++ irq = MXC_INT_GPT1;
++#endif
++ } else if (cpu_is_mx3()) {
++#ifdef CONFIG_ARCH_MX3
++ timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
++ irq = MXC_INT_GPT;
++#endif
++ } else
++ BUG();
++
+ /*
+ * Initialise to a known state (all timers off, and timing reset)
+ */
+- __raw_writel(0, TIMER_BASE + MXC_TCTL);
+- __raw_writel(0, TIMER_BASE + MXC_TPRER); /* see datasheet note */
+
+- __raw_writel(TCTL_FRR | /* free running */
+- TCTL_VAL | /* set clocksource and arch specific bits */
+- TCTL_TEN, /* start the timer */
+- TIMER_BASE + MXC_TCTL);
++ __raw_writel(0, timer_base + MXC_TCTL);
++ __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
++
++ if (cpu_is_mx3())
++ tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN;
++ else
++ tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
++
++ __raw_writel(tctl_val, timer_base + MXC_TCTL);
+
+ /* init and register the timer to the framework */
+ mxc_clocksource_init(timer_clk);
+ mxc_clockevent_init(timer_clk);
+
+ /* Make irqs happen */
+- setup_irq(TIMER_INTERRUPT, &mxc_timer_irq);
++ setup_irq(irq, &mxc_timer_irq);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/clock.c linux-2.6.30-rc4-git/arch/arm/plat-omap/clock.c
+--- linux-2.6.30-rc4/arch/arm/plat-omap/clock.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/clock.c 2009-05-13 09:46:19.000000000 +0200
+@@ -239,6 +239,13 @@ void recalculate_root_clocks(void)
+ }
+ }
+
++/**
++ * clk_init_one - initialize any fields in the struct clk before clk init
++ * @clk: struct clk * to initialize
++ *
++ * Initialize any struct clk fields needed before normal clk initialization
++ * can run. No return value.
++ */
+ void clk_init_one(struct clk *clk)
+ {
+ INIT_LIST_HEAD(&clk->children);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/dma.c linux-2.6.30-rc4-git/arch/arm/plat-omap/dma.c
+--- linux-2.6.30-rc4/arch/arm/plat-omap/dma.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/dma.c 2009-05-13 09:46:19.000000000 +0200
+@@ -760,19 +760,12 @@ void omap_free_dma(int lch)
+ {
+ unsigned long flags;
+
+- spin_lock_irqsave(&dma_chan_lock, flags);
+ if (dma_chan[lch].dev_id == -1) {
+ pr_err("omap_dma: trying to free unallocated DMA channel %d\n",
+ lch);
+- spin_unlock_irqrestore(&dma_chan_lock, flags);
+ return;
+ }
+
+- dma_chan[lch].dev_id = -1;
+- dma_chan[lch].next_lch = -1;
+- dma_chan[lch].callback = NULL;
+- spin_unlock_irqrestore(&dma_chan_lock, flags);
+-
+ if (cpu_class_is_omap1()) {
+ /* Disable all DMA interrupts for the channel. */
+ dma_write(0, CICR(lch));
+@@ -798,6 +791,12 @@ void omap_free_dma(int lch)
+ dma_write(0, CCR(lch));
+ omap_clear_dma(lch);
+ }
++
++ spin_lock_irqsave(&dma_chan_lock, flags);
++ dma_chan[lch].dev_id = -1;
++ dma_chan[lch].next_lch = -1;
++ dma_chan[lch].callback = NULL;
++ spin_unlock_irqrestore(&dma_chan_lock, flags);
+ }
+ EXPORT_SYMBOL(omap_free_dma);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/dmtimer.c linux-2.6.30-rc4-git/arch/arm/plat-omap/dmtimer.c
+--- linux-2.6.30-rc4/arch/arm/plat-omap/dmtimer.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/dmtimer.c 2009-05-13 09:46:19.000000000 +0200
+@@ -238,7 +238,7 @@ static struct omap_dm_timer omap3_dm_tim
+ { .phys_base = 0x49040000, .irq = INT_24XX_GPTIMER9 },
+ { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 },
+ { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 },
+- { .phys_base = 0x48304000, .irq = INT_24XX_GPTIMER12 },
++ { .phys_base = 0x48304000, .irq = INT_34XX_GPT12_IRQ },
+ };
+
+ static const char *omap3_dm_source_names[] __initdata = {
+@@ -321,11 +321,9 @@ static void omap_dm_timer_reset(struct o
+ l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
+
+ /*
+- * Enable wake-up only for GPT1 on OMAP2 CPUs.
+- * FIXME: All timers should have wake-up enabled and clear
+- * PRCM status.
++ * Enable wake-up on OMAP2 CPUs.
+ */
+- if (cpu_class_is_omap2() && (timer == &dm_timers[0]))
++ if (cpu_class_is_omap2())
+ l |= 1 << 2;
+ omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l);
+
+@@ -511,7 +509,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
+
+ #ifdef CONFIG_ARCH_OMAP1
+
+-void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
++int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
+ {
+ int n = (timer - dm_timers) << 1;
+ u32 l;
+@@ -519,23 +517,31 @@ void omap_dm_timer_set_source(struct oma
+ l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
+ l |= source << n;
+ omap_writel(l, MOD_CONF_CTRL_1);
++
++ return 0;
+ }
+ EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
+
+ #else
+
+-void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
++int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
+ {
++ int ret = -EINVAL;
++
+ if (source < 0 || source >= 3)
+- return;
++ return -EINVAL;
+
+ clk_disable(timer->fclk);
+- clk_set_parent(timer->fclk, dm_source_clocks[source]);
++ ret = clk_set_parent(timer->fclk, dm_source_clocks[source]);
+ clk_enable(timer->fclk);
+
+- /* When the functional clock disappears, too quick writes seem to
+- * cause an abort. */
++ /*
++ * When the functional clock disappears, too quick writes seem
++ * to cause an abort. XXX Is this still necessary?
++ */
+ __delay(150000);
++
++ return ret;
+ }
+ EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/gpio.c linux-2.6.30-rc4-git/arch/arm/plat-omap/gpio.c
+--- linux-2.6.30-rc4/arch/arm/plat-omap/gpio.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/gpio.c 2009-05-13 09:46:19.000000000 +0200
+@@ -758,8 +758,12 @@ static void _clear_gpio_irqbank(struct g
+
+ /* Workaround for clearing DSP GPIO interrupts to allow retention */
+ #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
++ reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2;
+ if (cpu_is_omap24xx() || cpu_is_omap34xx())
+- __raw_writel(gpio_mask, bank->base + OMAP24XX_GPIO_IRQSTATUS2);
++ __raw_writel(gpio_mask, reg);
++
++ /* Flush posted write for the irq status to avoid spurious interrupts */
++ __raw_readl(reg);
+ #endif
+ }
+
+@@ -921,13 +925,10 @@ static int _set_gpio_wakeup(struct gpio_
+ case METHOD_MPUIO:
+ case METHOD_GPIO_1610:
+ spin_lock_irqsave(&bank->lock, flags);
+- if (enable) {
++ if (enable)
+ bank->suspend_wakeup |= (1 << gpio);
+- enable_irq_wake(bank->irq);
+- } else {
+- disable_irq_wake(bank->irq);
++ else
+ bank->suspend_wakeup &= ~(1 << gpio);
+- }
+ spin_unlock_irqrestore(&bank->lock, flags);
+ return 0;
+ #endif
+@@ -940,13 +941,10 @@ static int _set_gpio_wakeup(struct gpio_
+ return -EINVAL;
+ }
+ spin_lock_irqsave(&bank->lock, flags);
+- if (enable) {
++ if (enable)
+ bank->suspend_wakeup |= (1 << gpio);
+- enable_irq_wake(bank->irq);
+- } else {
+- disable_irq_wake(bank->irq);
++ else
+ bank->suspend_wakeup &= ~(1 << gpio);
+- }
+ spin_unlock_irqrestore(&bank->lock, flags);
+ return 0;
+ #endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/dmtimer.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/dmtimer.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/dmtimer.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/dmtimer.h 2009-05-13 09:46:19.000000000 +0200
+@@ -64,7 +64,7 @@ void omap_dm_timer_trigger(struct omap_d
+ void omap_dm_timer_start(struct omap_dm_timer *timer);
+ void omap_dm_timer_stop(struct omap_dm_timer *timer);
+
+-void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
++int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
+ void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value);
+ void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value);
+ void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/eac.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/eac.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/eac.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/eac.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,100 +0,0 @@
+-/*
+- * arch/arm/plat-omap/include/mach2/eac.h
+- *
+- * Defines for Enhanced Audio Controller
+- *
+- * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
+- *
+- * Copyright (C) 2006 Nokia Corporation
+- * Copyright (C) 2004 Texas Instruments, Inc.
+- *
+- * 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.
+- *
+- * 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., 51 Franklin St, Fifth Floor, Boston, MA
+- * 02110-1301 USA
+- *
+- */
+-
+-#ifndef __ASM_ARM_ARCH_OMAP2_EAC_H
+-#define __ASM_ARM_ARCH_OMAP2_EAC_H
+-
+-#include <mach/io.h>
+-#include <mach/hardware.h>
+-#include <asm/irq.h>
+-
+-#include <sound/core.h>
+-
+-/* master codec clock source */
+-#define EAC_MCLK_EXT_MASK 0x100
+-enum eac_mclk_src {
+- EAC_MCLK_INT_11290000, /* internal 96 MHz / 8.5 = 11.29 Mhz */
+- EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK,
+- EAC_MCLK_EXT_12288000,
+- EAC_MCLK_EXT_2x11289600,
+- EAC_MCLK_EXT_2x12288000,
+-};
+-
+-/* codec port interface mode */
+-enum eac_codec_mode {
+- EAC_CODEC_PCM,
+- EAC_CODEC_AC97,
+- EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */
+- EAC_CODEC_I2S_SLAVE,
+-};
+-
+-/* configuration structure for I2S mode */
+-struct eac_i2s_conf {
+- /* if enabled, then first data slot (left channel) is signaled as
+- * positive level of frame sync EAC.AC_FS */
+- unsigned polarity_changed_mode:1;
+- /* if enabled, then serial data starts one clock cycle after the
+- * of EAC.AC_FS for first audio slot */
+- unsigned sync_delay_enable:1;
+-};
+-
+-/* configuration structure for EAC codec port */
+-struct eac_codec {
+- enum eac_mclk_src mclk_src;
+-
+- enum eac_codec_mode codec_mode;
+- union {
+- struct eac_i2s_conf i2s;
+- } codec_conf;
+-
+- int default_rate; /* audio sampling rate */
+-
+- int (* set_power)(void *private_data, int dac, int adc);
+- int (* register_controls)(void *private_data,
+- struct snd_card *card);
+- const char *short_name;
+-
+- void *private_data;
+-};
+-
+-/* structure for passing platform dependent data to the EAC driver */
+-struct eac_platform_data {
+- int (* init)(struct device *eac_dev);
+- void (* cleanup)(struct device *eac_dev);
+- /* these callbacks are used to configure & control external MCLK
+- * source. NULL if not used */
+- int (* enable_ext_clocks)(struct device *eac_dev);
+- void (* disable_ext_clocks)(struct device *eac_dev);
+-};
+-
+-extern void omap_init_eac(struct eac_platform_data *pdata);
+-
+-extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec);
+-extern void eac_unregister_codec(struct device *eac_dev);
+-
+-extern int eac_set_mode(struct device *eac_dev, int play, int rec);
+-
+-#endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/gpioexpander.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/gpioexpander.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/gpioexpander.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/gpioexpander.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,35 +0,0 @@
+-/*
+- * arch/arm/plat-omap/include/mach/gpioexpander.h
+- *
+- *
+- * Copyright (C) 2004 Texas Instruments, Inc.
+- *
+- * This package 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.
+- *
+- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+- */
+-
+-#ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H
+-#define __ASM_ARCH_OMAP_GPIOEXPANDER_H
+-
+-/* Function Prototypes for GPIO Expander functions */
+-
+-#ifdef CONFIG_GPIOEXPANDER_OMAP
+-int read_gpio_expa(u8 *, int);
+-int write_gpio_expa(u8 , int);
+-#else
+-static inline int read_gpio_expa(u8 *val, int addr)
+-{
+- return 0;
+-}
+-static inline int write_gpio_expa(u8 val, int addr)
+-{
+- return 0;
+-}
+-#endif
+-
+-#endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/irda.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/irda.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/irda.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/irda.h 2009-05-13 09:46:19.000000000 +0200
+@@ -21,10 +21,6 @@ struct omap_irda_config {
+ int transceiver_cap;
+ int (*transceiver_mode)(struct device *dev, int mode);
+ int (*select_irda)(struct device *dev, int state);
+- /* Very specific to the needs of some platforms (h3,h4)
+- * having calls which can sleep in irda_set_speed.
+- */
+- struct delayed_work gpio_expa;
+ int rx_channel;
+ int tx_channel;
+ unsigned long dest_start;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/mmc.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/mmc.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/mmc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/mmc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -79,7 +79,6 @@ struct omap_mmc_platform_data {
+
+ /* use the internal clock */
+ unsigned internal_clock:1;
+- s16 power_pin;
+
+ int switch_pin; /* gpio (card detect) */
+ int gpio_wp; /* gpio (write protect) */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/timer-gp.h linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/timer-gp.h
+--- linux-2.6.30-rc4/arch/arm/plat-omap/include/mach/timer-gp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/arch/arm/plat-omap/include/mach/timer-gp.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,17 @@
++/*
++ * OMAP2/3 GPTIMER support.headers
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file "COPYING" in the main directory of this archive
++ * for more details.
++ */
++
++#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H
++#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_TIMER_GP_H
++
++int __init omap2_gp_clockevent_set_gptimer(u8 id);
++
++#endif
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/arm/plat-pxa/gpio.c linux-2.6.30-rc4-git/arch/arm/plat-pxa/gpio.c
+--- linux-2.6.30-rc4/arch/arm/plat-pxa/gpio.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/arm/plat-pxa/gpio.c 2009-05-13 09:46:19.000000000 +0200
+@@ -121,6 +121,8 @@ static int __init pxa_init_gpio_chip(int
+ return -ENOMEM;
+ }
+
++ memset(chips, 0, nbanks * sizeof(struct pxa_gpio_chip));
++
+ for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) {
+ struct gpio_chip *c = &chips[i].chip;
+
+@@ -143,6 +145,21 @@ static int __init pxa_init_gpio_chip(int
+ return 0;
+ }
+
++/* Update only those GRERx and GFERx edge detection register bits if those
++ * bits are set in c->irq_mask
++ */
++static inline void update_edge_detect(struct pxa_gpio_chip *c)
++{
++ uint32_t grer, gfer;
++
++ grer = __raw_readl(c->regbase + GRER_OFFSET) & ~c->irq_mask;
++ gfer = __raw_readl(c->regbase + GFER_OFFSET) & ~c->irq_mask;
++ grer |= c->irq_edge_rise & c->irq_mask;
++ gfer |= c->irq_edge_fall & c->irq_mask;
++ __raw_writel(grer, c->regbase + GRER_OFFSET);
++ __raw_writel(gfer, c->regbase + GFER_OFFSET);
++}
++
+ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
+ {
+ struct pxa_gpio_chip *c;
+@@ -181,8 +198,7 @@ static int pxa_gpio_irq_type(unsigned in
+ else
+ c->irq_edge_fall &= ~mask;
+
+- __raw_writel(c->irq_edge_rise & c->irq_mask, c->regbase + GRER_OFFSET);
+- __raw_writel(c->irq_edge_fall & c->irq_mask, c->regbase + GFER_OFFSET);
++ update_edge_detect(c);
+
+ pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
+ ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
+@@ -244,8 +260,7 @@ static void pxa_unmask_muxed_gpio(unsign
+ struct pxa_gpio_chip *c = gpio_to_chip(gpio);
+
+ c->irq_mask |= GPIO_bit(gpio);
+- __raw_writel(c->irq_edge_rise & c->irq_mask, c->regbase + GRER_OFFSET);
+- __raw_writel(c->irq_edge_fall & c->irq_mask, c->regbase + GFER_OFFSET);
++ update_edge_detect(c);
+ }
+
+ static struct irq_chip pxa_muxed_gpio_chip = {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/avr32/Makefile linux-2.6.30-rc4-git/arch/avr32/Makefile
+--- linux-2.6.30-rc4/arch/avr32/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/avr32/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -43,8 +43,6 @@ core-y += arch/avr32/mm/
+ drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
+ libs-y += arch/avr32/lib/
+
+-CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
+-
+ BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
+
+ .PHONY: $(BOOT_TARGETS) install
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/m32r/boot/compressed/Makefile linux-2.6.30-rc4-git/arch/m32r/boot/compressed/Makefile
+--- linux-2.6.30-rc4/arch/m32r/boot/compressed/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/m32r/boot/compressed/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -6,7 +6,6 @@
+
+ targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \
+ piggy.o vmlinux.lds
+-EXTRA_AFLAGS := -traditional
+
+ OBJECTS = $(obj)/head.o $(obj)/misc.o
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/m32r/include/asm/assembler.h linux-2.6.30-rc4-git/arch/m32r/include/asm/assembler.h
+--- linux-2.6.30-rc4/arch/m32r/include/asm/assembler.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/m32r/include/asm/assembler.h 2009-05-13 09:46:19.000000000 +0200
+@@ -9,14 +9,15 @@
+ * This file contains M32R architecture specific macro definitions.
+ */
+
++#include <linux/stringify.h>
++
++#undef __STR
+
+-#ifndef __STR
+ #ifdef __ASSEMBLY__
+ #define __STR(x) x
+ #else
+-#define __STR(x) #x
++#define __STR(x) __stringify(x)
+ #endif
+-#endif /* __STR */
+
+ #ifdef CONFIG_SMP
+ #define M32R_LOCK __STR(lock)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/m32r/kernel/Makefile linux-2.6.30-rc4-git/arch/m32r/kernel/Makefile
+--- linux-2.6.30-rc4/arch/m32r/kernel/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/m32r/kernel/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -9,5 +9,3 @@ obj-y := process.o entry.o traps.o align
+
+ obj-$(CONFIG_SMP) += smp.o smpboot.o
+ obj-$(CONFIG_MODULES) += module.o
+-
+-EXTRA_AFLAGS := -traditional
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/microblaze/include/asm/of_platform.h linux-2.6.30-rc4-git/arch/microblaze/include/asm/of_platform.h
+--- linux-2.6.30-rc4/arch/microblaze/include/asm/of_platform.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/microblaze/include/asm/of_platform.h 2009-05-13 09:46:19.000000000 +0200
+@@ -36,16 +36,6 @@ static const struct of_device_id of_defa
+ {},
+ };
+
+-/* Platform drivers register/unregister */
+-static inline int of_register_platform_driver(struct of_platform_driver *drv)
+-{
+- return of_register_driver(drv, &of_platform_bus_type);
+-}
+-static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
+-{
+- of_unregister_driver(drv);
+-}
+-
+ /* Platform devices and busses creation */
+ extern struct of_device *of_platform_device_create(struct device_node *np,
+ const char *bus_id,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/checks.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/checks.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/checks.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/checks.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,587 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2007.
+- *
+- *
+- * 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 "dtc.h"
+-
+-#ifdef TRACE_CHECKS
+-#define TRACE(c, ...) \
+- do { \
+- fprintf(stderr, "=== %s: ", (c)->name); \
+- fprintf(stderr, __VA_ARGS__); \
+- fprintf(stderr, "\n"); \
+- } while (0)
+-#else
+-#define TRACE(c, fmt, ...) do { } while (0)
+-#endif
+-
+-enum checklevel {
+- IGNORE = 0,
+- WARN = 1,
+- ERROR = 2,
+-};
+-
+-enum checkstatus {
+- UNCHECKED = 0,
+- PREREQ,
+- PASSED,
+- FAILED,
+-};
+-
+-struct check;
+-
+-typedef void (*tree_check_fn)(struct check *c, struct node *dt);
+-typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
+-typedef void (*prop_check_fn)(struct check *c, struct node *dt,
+- struct node *node, struct property *prop);
+-
+-struct check {
+- const char *name;
+- tree_check_fn tree_fn;
+- node_check_fn node_fn;
+- prop_check_fn prop_fn;
+- void *data;
+- enum checklevel level;
+- enum checkstatus status;
+- int inprogress;
+- int num_prereqs;
+- struct check **prereq;
+-};
+-
+-#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
+- static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
+- static struct check nm = { \
+- .name = #nm, \
+- .tree_fn = (tfn), \
+- .node_fn = (nfn), \
+- .prop_fn = (pfn), \
+- .data = (d), \
+- .level = (lvl), \
+- .status = UNCHECKED, \
+- .num_prereqs = ARRAY_SIZE(nm##_prereqs), \
+- .prereq = nm##_prereqs, \
+- };
+-
+-#define TREE_CHECK(nm, d, lvl, ...) \
+- CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
+-#define NODE_CHECK(nm, d, lvl, ...) \
+- CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
+-#define PROP_CHECK(nm, d, lvl, ...) \
+- CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
+-#define BATCH_CHECK(nm, lvl, ...) \
+- CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
+-
+-#ifdef __GNUC__
+-static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
+-#endif
+-static inline void check_msg(struct check *c, const char *fmt, ...)
+-{
+- va_list ap;
+- va_start(ap, fmt);
+-
+- if ((c->level < WARN) || (c->level <= quiet))
+- return; /* Suppress message */
+-
+- fprintf(stderr, "%s (%s): ",
+- (c->level == ERROR) ? "ERROR" : "Warning", c->name);
+- vfprintf(stderr, fmt, ap);
+- fprintf(stderr, "\n");
+-}
+-
+-#define FAIL(c, ...) \
+- do { \
+- TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \
+- (c)->status = FAILED; \
+- check_msg((c), __VA_ARGS__); \
+- } while (0)
+-
+-static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
+-{
+- struct node *child;
+- struct property *prop;
+-
+- TRACE(c, "%s", node->fullpath);
+- if (c->node_fn)
+- c->node_fn(c, dt, node);
+-
+- if (c->prop_fn)
+- for_each_property(node, prop) {
+- TRACE(c, "%s\t'%s'", node->fullpath, prop->name);
+- c->prop_fn(c, dt, node, prop);
+- }
+-
+- for_each_child(node, child)
+- check_nodes_props(c, dt, child);
+-}
+-
+-static int run_check(struct check *c, struct node *dt)
+-{
+- int error = 0;
+- int i;
+-
+- assert(!c->inprogress);
+-
+- if (c->status != UNCHECKED)
+- goto out;
+-
+- c->inprogress = 1;
+-
+- for (i = 0; i < c->num_prereqs; i++) {
+- struct check *prq = c->prereq[i];
+- error |= run_check(prq, dt);
+- if (prq->status != PASSED) {
+- c->status = PREREQ;
+- check_msg(c, "Failed prerequisite '%s'",
+- c->prereq[i]->name);
+- }
+- }
+-
+- if (c->status != UNCHECKED)
+- goto out;
+-
+- if (c->node_fn || c->prop_fn)
+- check_nodes_props(c, dt, dt);
+-
+- if (c->tree_fn)
+- c->tree_fn(c, dt);
+- if (c->status == UNCHECKED)
+- c->status = PASSED;
+-
+- TRACE(c, "\tCompleted, status %d", c->status);
+-
+-out:
+- c->inprogress = 0;
+- if ((c->status != PASSED) && (c->level == ERROR))
+- error = 1;
+- return error;
+-}
+-
+-/*
+- * Utility check functions
+- */
+-
+-static void check_is_string(struct check *c, struct node *root,
+- struct node *node)
+-{
+- struct property *prop;
+- char *propname = c->data;
+-
+- prop = get_property(node, propname);
+- if (!prop)
+- return; /* Not present, assumed ok */
+-
+- if (!data_is_one_string(prop->val))
+- FAIL(c, "\"%s\" property in %s is not a string",
+- propname, node->fullpath);
+-}
+-#define CHECK_IS_STRING(nm, propname, lvl) \
+- CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl))
+-
+-static void check_is_cell(struct check *c, struct node *root,
+- struct node *node)
+-{
+- struct property *prop;
+- char *propname = c->data;
+-
+- prop = get_property(node, propname);
+- if (!prop)
+- return; /* Not present, assumed ok */
+-
+- if (prop->val.len != sizeof(cell_t))
+- FAIL(c, "\"%s\" property in %s is not a single cell",
+- propname, node->fullpath);
+-}
+-#define CHECK_IS_CELL(nm, propname, lvl) \
+- CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl))
+-
+-/*
+- * Structural check functions
+- */
+-
+-static void check_duplicate_node_names(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct node *child, *child2;
+-
+- for_each_child(node, child)
+- for (child2 = child->next_sibling;
+- child2;
+- child2 = child2->next_sibling)
+- if (streq(child->name, child2->name))
+- FAIL(c, "Duplicate node name %s",
+- child->fullpath);
+-}
+-NODE_CHECK(duplicate_node_names, NULL, ERROR);
+-
+-static void check_duplicate_property_names(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct property *prop, *prop2;
+-
+- for_each_property(node, prop)
+- for (prop2 = prop->next; prop2; prop2 = prop2->next)
+- if (streq(prop->name, prop2->name))
+- FAIL(c, "Duplicate property name %s in %s",
+- prop->name, node->fullpath);
+-}
+-NODE_CHECK(duplicate_property_names, NULL, ERROR);
+-
+-#define LOWERCASE "abcdefghijklmnopqrstuvwxyz"
+-#define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+-#define DIGITS "0123456789"
+-#define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-"
+-
+-static void check_node_name_chars(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- int n = strspn(node->name, c->data);
+-
+- if (n < strlen(node->name))
+- FAIL(c, "Bad character '%c' in node %s",
+- node->name[n], node->fullpath);
+-}
+-NODE_CHECK(node_name_chars, PROPNODECHARS "@", ERROR);
+-
+-static void check_node_name_format(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- if (strchr(get_unitname(node), '@'))
+- FAIL(c, "Node %s has multiple '@' characters in name",
+- node->fullpath);
+-}
+-NODE_CHECK(node_name_format, NULL, ERROR, &node_name_chars);
+-
+-static void check_property_name_chars(struct check *c, struct node *dt,
+- struct node *node, struct property *prop)
+-{
+- int n = strspn(prop->name, c->data);
+-
+- if (n < strlen(prop->name))
+- FAIL(c, "Bad character '%c' in property name \"%s\", node %s",
+- prop->name[n], prop->name, node->fullpath);
+-}
+-PROP_CHECK(property_name_chars, PROPNODECHARS, ERROR);
+-
+-static void check_explicit_phandles(struct check *c, struct node *root,
+- struct node *node)
+-{
+- struct property *prop;
+- struct node *other;
+- cell_t phandle;
+-
+- prop = get_property(node, "linux,phandle");
+- if (! prop)
+- return; /* No phandle, that's fine */
+-
+- if (prop->val.len != sizeof(cell_t)) {
+- FAIL(c, "%s has bad length (%d) linux,phandle property",
+- node->fullpath, prop->val.len);
+- return;
+- }
+-
+- phandle = propval_cell(prop);
+- if ((phandle == 0) || (phandle == -1)) {
+- FAIL(c, "%s has invalid linux,phandle value 0x%x",
+- node->fullpath, phandle);
+- return;
+- }
+-
+- other = get_node_by_phandle(root, phandle);
+- if (other) {
+- FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
+- node->fullpath, phandle, other->fullpath);
+- return;
+- }
+-
+- node->phandle = phandle;
+-}
+-NODE_CHECK(explicit_phandles, NULL, ERROR);
+-
+-static void check_name_properties(struct check *c, struct node *root,
+- struct node *node)
+-{
+- struct property **pp, *prop = NULL;
+-
+- for (pp = &node->proplist; *pp; pp = &((*pp)->next))
+- if (streq((*pp)->name, "name")) {
+- prop = *pp;
+- break;
+- }
+-
+- if (!prop)
+- return; /* No name property, that's fine */
+-
+- if ((prop->val.len != node->basenamelen+1)
+- || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) {
+- FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead"
+- " of base node name)", node->fullpath, prop->val.val);
+- } else {
+- /* The name property is correct, and therefore redundant.
+- * Delete it */
+- *pp = prop->next;
+- free(prop->name);
+- data_free(prop->val);
+- free(prop);
+- }
+-}
+-CHECK_IS_STRING(name_is_string, "name", ERROR);
+-NODE_CHECK(name_properties, NULL, ERROR, &name_is_string);
+-
+-/*
+- * Reference fixup functions
+- */
+-
+-static void fixup_phandle_references(struct check *c, struct node *dt,
+- struct node *node, struct property *prop)
+-{
+- struct marker *m = prop->val.markers;
+- struct node *refnode;
+- cell_t phandle;
+-
+- for_each_marker_of_type(m, REF_PHANDLE) {
+- assert(m->offset + sizeof(cell_t) <= prop->val.len);
+-
+- refnode = get_node_by_ref(dt, m->ref);
+- if (! refnode) {
+- FAIL(c, "Reference to non-existent node or label \"%s\"\n",
+- m->ref);
+- continue;
+- }
+-
+- phandle = get_node_phandle(dt, refnode);
+- *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
+- }
+-}
+-CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,
+- &duplicate_node_names, &explicit_phandles);
+-
+-static void fixup_path_references(struct check *c, struct node *dt,
+- struct node *node, struct property *prop)
+-{
+- struct marker *m = prop->val.markers;
+- struct node *refnode;
+- char *path;
+-
+- for_each_marker_of_type(m, REF_PATH) {
+- assert(m->offset <= prop->val.len);
+-
+- refnode = get_node_by_ref(dt, m->ref);
+- if (!refnode) {
+- FAIL(c, "Reference to non-existent node or label \"%s\"\n",
+- m->ref);
+- continue;
+- }
+-
+- path = refnode->fullpath;
+- prop->val = data_insert_at_marker(prop->val, m, path,
+- strlen(path) + 1);
+- }
+-}
+-CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR,
+- &duplicate_node_names);
+-
+-/*
+- * Semantic checks
+- */
+-CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN);
+-CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN);
+-CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN);
+-
+-CHECK_IS_STRING(device_type_is_string, "device_type", WARN);
+-CHECK_IS_STRING(model_is_string, "model", WARN);
+-CHECK_IS_STRING(status_is_string, "status", WARN);
+-
+-static void fixup_addr_size_cells(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct property *prop;
+-
+- node->addr_cells = -1;
+- node->size_cells = -1;
+-
+- prop = get_property(node, "#address-cells");
+- if (prop)
+- node->addr_cells = propval_cell(prop);
+-
+- prop = get_property(node, "#size-cells");
+- if (prop)
+- node->size_cells = propval_cell(prop);
+-}
+-CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN,
+- &address_cells_is_cell, &size_cells_is_cell);
+-
+-#define node_addr_cells(n) \
+- (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
+-#define node_size_cells(n) \
+- (((n)->size_cells == -1) ? 1 : (n)->size_cells)
+-
+-static void check_reg_format(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct property *prop;
+- int addr_cells, size_cells, entrylen;
+-
+- prop = get_property(node, "reg");
+- if (!prop)
+- return; /* No "reg", that's fine */
+-
+- if (!node->parent) {
+- FAIL(c, "Root node has a \"reg\" property");
+- return;
+- }
+-
+- if (prop->val.len == 0)
+- FAIL(c, "\"reg\" property in %s is empty", node->fullpath);
+-
+- addr_cells = node_addr_cells(node->parent);
+- size_cells = node_size_cells(node->parent);
+- entrylen = (addr_cells + size_cells) * sizeof(cell_t);
+-
+- if ((prop->val.len % entrylen) != 0)
+- FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) "
+- "(#address-cells == %d, #size-cells == %d)",
+- node->fullpath, prop->val.len, addr_cells, size_cells);
+-}
+-NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells);
+-
+-static void check_ranges_format(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct property *prop;
+- int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
+-
+- prop = get_property(node, "ranges");
+- if (!prop)
+- return;
+-
+- if (!node->parent) {
+- FAIL(c, "Root node has a \"ranges\" property");
+- return;
+- }
+-
+- p_addr_cells = node_addr_cells(node->parent);
+- p_size_cells = node_size_cells(node->parent);
+- c_addr_cells = node_addr_cells(node);
+- c_size_cells = node_size_cells(node);
+- entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
+-
+- if (prop->val.len == 0) {
+- if (p_addr_cells != c_addr_cells)
+- FAIL(c, "%s has empty \"ranges\" property but its "
+- "#address-cells (%d) differs from %s (%d)",
+- node->fullpath, c_addr_cells, node->parent->fullpath,
+- p_addr_cells);
+- if (p_size_cells != c_size_cells)
+- FAIL(c, "%s has empty \"ranges\" property but its "
+- "#size-cells (%d) differs from %s (%d)",
+- node->fullpath, c_size_cells, node->parent->fullpath,
+- p_size_cells);
+- } else if ((prop->val.len % entrylen) != 0) {
+- FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) "
+- "(parent #address-cells == %d, child #address-cells == %d, "
+- "#size-cells == %d)", node->fullpath, prop->val.len,
+- p_addr_cells, c_addr_cells, c_size_cells);
+- }
+-}
+-NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells);
+-
+-/*
+- * Style checks
+- */
+-static void check_avoid_default_addr_size(struct check *c, struct node *dt,
+- struct node *node)
+-{
+- struct property *reg, *ranges;
+-
+- if (!node->parent)
+- return; /* Ignore root node */
+-
+- reg = get_property(node, "reg");
+- ranges = get_property(node, "ranges");
+-
+- if (!reg && !ranges)
+- return;
+-
+- if ((node->parent->addr_cells == -1))
+- FAIL(c, "Relying on default #address-cells value for %s",
+- node->fullpath);
+-
+- if ((node->parent->size_cells == -1))
+- FAIL(c, "Relying on default #size-cells value for %s",
+- node->fullpath);
+-}
+-NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells);
+-
+-static void check_obsolete_chosen_interrupt_controller(struct check *c,
+- struct node *dt)
+-{
+- struct node *chosen;
+- struct property *prop;
+-
+- chosen = get_node_by_path(dt, "/chosen");
+- if (!chosen)
+- return;
+-
+- prop = get_property(chosen, "interrupt-controller");
+- if (prop)
+- FAIL(c, "/chosen has obsolete \"interrupt-controller\" "
+- "property");
+-}
+-TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN);
+-
+-static struct check *check_table[] = {
+- &duplicate_node_names, &duplicate_property_names,
+- &node_name_chars, &node_name_format, &property_name_chars,
+- &name_is_string, &name_properties,
+- &explicit_phandles,
+- &phandle_references, &path_references,
+-
+- &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
+- &device_type_is_string, &model_is_string, &status_is_string,
+-
+- &addr_size_cells, &reg_format, &ranges_format,
+-
+- &avoid_default_addr_size,
+- &obsolete_chosen_interrupt_controller,
+-};
+-
+-void process_checks(int force, struct boot_info *bi)
+-{
+- struct node *dt = bi->dt;
+- int i;
+- int error = 0;
+-
+- for (i = 0; i < ARRAY_SIZE(check_table); i++) {
+- struct check *c = check_table[i];
+-
+- if (c->level != IGNORE)
+- error = error || run_check(c, dt);
+- }
+-
+- if (error) {
+- if (!force) {
+- fprintf(stderr, "ERROR: Input tree has errors, aborting "
+- "(use -f to force output)\n");
+- exit(2);
+- } else if (quiet < 3) {
+- fprintf(stderr, "Warning: Input tree has errors, "
+- "output forced\n");
+- }
+- }
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/data.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/data.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/data.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/data.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,321 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-
+-void data_free(struct data d)
+-{
+- struct marker *m, *nm;
+-
+- m = d.markers;
+- while (m) {
+- nm = m->next;
+- free(m->ref);
+- free(m);
+- m = nm;
+- }
+-
+- if (d.val)
+- free(d.val);
+-}
+-
+-struct data data_grow_for(struct data d, int xlen)
+-{
+- struct data nd;
+- int newsize;
+-
+- if (xlen == 0)
+- return d;
+-
+- nd = d;
+-
+- newsize = xlen;
+-
+- while ((d.len + xlen) > newsize)
+- newsize *= 2;
+-
+- nd.val = xrealloc(d.val, newsize);
+-
+- return nd;
+-}
+-
+-struct data data_copy_mem(const char *mem, int len)
+-{
+- struct data d;
+-
+- d = data_grow_for(empty_data, len);
+-
+- d.len = len;
+- memcpy(d.val, mem, len);
+-
+- return d;
+-}
+-
+-static char get_oct_char(const char *s, int *i)
+-{
+- char x[4];
+- char *endx;
+- long val;
+-
+- x[3] = '\0';
+- strncpy(x, s + *i, 3);
+-
+- val = strtol(x, &endx, 8);
+-
+- assert(endx > x);
+-
+- (*i) += endx - x;
+- return val;
+-}
+-
+-static char get_hex_char(const char *s, int *i)
+-{
+- char x[3];
+- char *endx;
+- long val;
+-
+- x[2] = '\0';
+- strncpy(x, s + *i, 2);
+-
+- val = strtol(x, &endx, 16);
+- if (!(endx > x))
+- die("\\x used with no following hex digits\n");
+-
+- (*i) += endx - x;
+- return val;
+-}
+-
+-struct data data_copy_escape_string(const char *s, int len)
+-{
+- int i = 0;
+- struct data d;
+- char *q;
+-
+- d = data_grow_for(empty_data, strlen(s)+1);
+-
+- q = d.val;
+- while (i < len) {
+- char c = s[i++];
+-
+- if (c != '\\') {
+- q[d.len++] = c;
+- continue;
+- }
+-
+- c = s[i++];
+- assert(c);
+- switch (c) {
+- case 'a':
+- q[d.len++] = '\a';
+- break;
+- case 'b':
+- q[d.len++] = '\b';
+- break;
+- case 't':
+- q[d.len++] = '\t';
+- break;
+- case 'n':
+- q[d.len++] = '\n';
+- break;
+- case 'v':
+- q[d.len++] = '\v';
+- break;
+- case 'f':
+- q[d.len++] = '\f';
+- break;
+- case 'r':
+- q[d.len++] = '\r';
+- break;
+- case '0':
+- case '1':
+- case '2':
+- case '3':
+- case '4':
+- case '5':
+- case '6':
+- case '7':
+- i--; /* need to re-read the first digit as
+- * part of the octal value */
+- q[d.len++] = get_oct_char(s, &i);
+- break;
+- case 'x':
+- q[d.len++] = get_hex_char(s, &i);
+- break;
+- default:
+- q[d.len++] = c;
+- }
+- }
+-
+- q[d.len++] = '\0';
+- return d;
+-}
+-
+-struct data data_copy_file(FILE *f, size_t maxlen)
+-{
+- struct data d = empty_data;
+-
+- while (!feof(f) && (d.len < maxlen)) {
+- size_t chunksize, ret;
+-
+- if (maxlen == -1)
+- chunksize = 4096;
+- else
+- chunksize = maxlen - d.len;
+-
+- d = data_grow_for(d, chunksize);
+- ret = fread(d.val + d.len, 1, chunksize, f);
+-
+- if (ferror(f))
+- die("Error reading file into data: %s", strerror(errno));
+-
+- if (d.len + ret < d.len)
+- die("Overflow reading file into data\n");
+-
+- d.len += ret;
+- }
+-
+- return d;
+-}
+-
+-struct data data_append_data(struct data d, const void *p, int len)
+-{
+- d = data_grow_for(d, len);
+- memcpy(d.val + d.len, p, len);
+- d.len += len;
+- return d;
+-}
+-
+-struct data data_insert_at_marker(struct data d, struct marker *m,
+- const void *p, int len)
+-{
+- d = data_grow_for(d, len);
+- memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
+- memcpy(d.val + m->offset, p, len);
+- d.len += len;
+-
+- /* Adjust all markers after the one we're inserting at */
+- m = m->next;
+- for_each_marker(m)
+- m->offset += len;
+- return d;
+-}
+-
+-struct data data_append_markers(struct data d, struct marker *m)
+-{
+- struct marker **mp = &d.markers;
+-
+- /* Find the end of the markerlist */
+- while (*mp)
+- mp = &((*mp)->next);
+- *mp = m;
+- return d;
+-}
+-
+-struct data data_merge(struct data d1, struct data d2)
+-{
+- struct data d;
+- struct marker *m2 = d2.markers;
+-
+- d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
+-
+- /* Adjust for the length of d1 */
+- for_each_marker(m2)
+- m2->offset += d1.len;
+-
+- d2.markers = NULL; /* So data_free() doesn't clobber them */
+- data_free(d2);
+-
+- return d;
+-}
+-
+-struct data data_append_cell(struct data d, cell_t word)
+-{
+- cell_t beword = cpu_to_fdt32(word);
+-
+- return data_append_data(d, &beword, sizeof(beword));
+-}
+-
+-struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
+-{
+- struct fdt_reserve_entry bere;
+-
+- bere.address = cpu_to_fdt64(re->address);
+- bere.size = cpu_to_fdt64(re->size);
+-
+- return data_append_data(d, &bere, sizeof(bere));
+-}
+-
+-struct data data_append_addr(struct data d, uint64_t addr)
+-{
+- uint64_t beaddr = cpu_to_fdt64(addr);
+-
+- return data_append_data(d, &beaddr, sizeof(beaddr));
+-}
+-
+-struct data data_append_byte(struct data d, uint8_t byte)
+-{
+- return data_append_data(d, &byte, 1);
+-}
+-
+-struct data data_append_zeroes(struct data d, int len)
+-{
+- d = data_grow_for(d, len);
+-
+- memset(d.val + d.len, 0, len);
+- d.len += len;
+- return d;
+-}
+-
+-struct data data_append_align(struct data d, int align)
+-{
+- int newlen = ALIGN(d.len, align);
+- return data_append_zeroes(d, newlen - d.len);
+-}
+-
+-struct data data_add_marker(struct data d, enum markertype type, char *ref)
+-{
+- struct marker *m;
+-
+- m = xmalloc(sizeof(*m));
+- m->offset = d.len;
+- m->type = type;
+- m->ref = ref;
+- m->next = NULL;
+-
+- return data_append_markers(d, m);
+-}
+-
+-int data_is_one_string(struct data d)
+-{
+- int i;
+- int len = d.len;
+-
+- if (len == 0)
+- return 0;
+-
+- for (i = 0; i < len-1; i++)
+- if (d.val[i] == '\0')
+- return 0;
+-
+- if (d.val[len-1] != '\0')
+- return 0;
+-
+- return 1;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,226 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-#include "srcpos.h"
+-
+-#include "version_gen.h"
+-
+-/*
+- * Command line options
+- */
+-int quiet; /* Level of quietness */
+-int reservenum; /* Number of memory reservation slots */
+-int minsize; /* Minimum blob size */
+-int padsize; /* Additional padding to blob */
+-
+-char *join_path(const char *path, const char *name)
+-{
+- int lenp = strlen(path);
+- int lenn = strlen(name);
+- int len;
+- int needslash = 1;
+- char *str;
+-
+- len = lenp + lenn + 2;
+- if ((lenp > 0) && (path[lenp-1] == '/')) {
+- needslash = 0;
+- len--;
+- }
+-
+- str = xmalloc(len);
+- memcpy(str, path, lenp);
+- if (needslash) {
+- str[lenp] = '/';
+- lenp++;
+- }
+- memcpy(str+lenp, name, lenn+1);
+- return str;
+-}
+-
+-static void fill_fullpaths(struct node *tree, const char *prefix)
+-{
+- struct node *child;
+- const char *unit;
+-
+- tree->fullpath = join_path(prefix, tree->name);
+-
+- unit = strchr(tree->name, '@');
+- if (unit)
+- tree->basenamelen = unit - tree->name;
+- else
+- tree->basenamelen = strlen(tree->name);
+-
+- for_each_child(tree, child)
+- fill_fullpaths(child, tree->fullpath);
+-}
+-
+-static void __attribute__ ((noreturn)) usage(void)
+-{
+- fprintf(stderr, "Usage:\n");
+- fprintf(stderr, "\tdtc [options] <input file>\n");
+- fprintf(stderr, "\nOptions:\n");
+- fprintf(stderr, "\t-h\n");
+- fprintf(stderr, "\t\tThis help text\n");
+- fprintf(stderr, "\t-q\n");
+- fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n");
+- fprintf(stderr, "\t-I <input format>\n");
+- fprintf(stderr, "\t\tInput formats are:\n");
+- fprintf(stderr, "\t\t\tdts - device tree source text\n");
+- fprintf(stderr, "\t\t\tdtb - device tree blob\n");
+- fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n");
+- fprintf(stderr, "\t-o <output file>\n");
+- fprintf(stderr, "\t-O <output format>\n");
+- fprintf(stderr, "\t\tOutput formats are:\n");
+- fprintf(stderr, "\t\t\tdts - device tree source text\n");
+- fprintf(stderr, "\t\t\tdtb - device tree blob\n");
+- fprintf(stderr, "\t\t\tasm - assembler source\n");
+- fprintf(stderr, "\t-V <output version>\n");
+- fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION);
+- fprintf(stderr, "\t-R <number>\n");
+- fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
+- fprintf(stderr, "\t-S <bytes>\n");
+- fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
+- fprintf(stderr, "\t-p <bytes>\n");
+- fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
+- fprintf(stderr, "\t-b <number>\n");
+- fprintf(stderr, "\t\tSet the physical boot cpu\n");
+- fprintf(stderr, "\t-f\n");
+- fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n");
+- fprintf(stderr, "\t-v\n");
+- fprintf(stderr, "\t\tPrint DTC version and exit\n");
+- exit(3);
+-}
+-
+-int main(int argc, char *argv[])
+-{
+- struct boot_info *bi;
+- const char *inform = "dts";
+- const char *outform = "dts";
+- const char *outname = "-";
+- int force = 0, check = 0;
+- const char *arg;
+- int opt;
+- FILE *outf = NULL;
+- int outversion = DEFAULT_FDT_VERSION;
+- long long cmdline_boot_cpuid = -1;
+-
+- quiet = 0;
+- reservenum = 0;
+- minsize = 0;
+- padsize = 0;
+-
+- while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
+- switch (opt) {
+- case 'I':
+- inform = optarg;
+- break;
+- case 'O':
+- outform = optarg;
+- break;
+- case 'o':
+- outname = optarg;
+- break;
+- case 'V':
+- outversion = strtol(optarg, NULL, 0);
+- break;
+- case 'R':
+- reservenum = strtol(optarg, NULL, 0);
+- break;
+- case 'S':
+- minsize = strtol(optarg, NULL, 0);
+- break;
+- case 'p':
+- padsize = strtol(optarg, NULL, 0);
+- break;
+- case 'f':
+- force = 1;
+- break;
+- case 'c':
+- check = 1;
+- break;
+- case 'q':
+- quiet++;
+- break;
+- case 'b':
+- cmdline_boot_cpuid = strtoll(optarg, NULL, 0);
+- break;
+- case 'v':
+- printf("Version: %s\n", DTC_VERSION);
+- exit(0);
+- case 'h':
+- default:
+- usage();
+- }
+- }
+-
+- if (argc > (optind+1))
+- usage();
+- else if (argc < (optind+1))
+- arg = "-";
+- else
+- arg = argv[optind];
+-
+- /* minsize and padsize are mutually exclusive */
+- if (minsize && padsize)
+- die("Can't set both -p and -S\n");
+-
+- fprintf(stderr, "DTC: %s->%s on file \"%s\"\n",
+- inform, outform, arg);
+-
+- if (streq(inform, "dts"))
+- bi = dt_from_source(arg);
+- else if (streq(inform, "fs"))
+- bi = dt_from_fs(arg);
+- else if(streq(inform, "dtb"))
+- bi = dt_from_blob(arg);
+- else
+- die("Unknown input format \"%s\"\n", inform);
+-
+- if (cmdline_boot_cpuid != -1)
+- bi->boot_cpuid_phys = cmdline_boot_cpuid;
+-
+- fill_fullpaths(bi->dt, "");
+- process_checks(force, bi);
+-
+-
+- if (streq(outname, "-")) {
+- outf = stdout;
+- } else {
+- outf = fopen(outname, "w");
+- if (! outf)
+- die("Couldn't open output file %s: %s\n",
+- outname, strerror(errno));
+- }
+-
+- if (streq(outform, "dts")) {
+- dt_to_source(outf, bi);
+- } else if (streq(outform, "dtb")) {
+- dt_to_blob(outf, bi, outversion);
+- } else if (streq(outform, "asm")) {
+- dt_to_asm(outf, bi, outversion);
+- } else if (streq(outform, "null")) {
+- /* do nothing */
+- } else {
+- die("Unknown output format \"%s\"\n", outform);
+- }
+-
+- exit(0);
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc.h linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,246 +0,0 @@
+-#ifndef _DTC_H
+-#define _DTC_H
+-
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 <stdio.h>
+-#include <string.h>
+-#include <stdlib.h>
+-#include <stdint.h>
+-#include <stdarg.h>
+-#include <assert.h>
+-#include <ctype.h>
+-#include <errno.h>
+-#include <unistd.h>
+-
+-#include <libfdt_env.h>
+-#include <fdt.h>
+-
+-#define DEFAULT_FDT_VERSION 17
+-/*
+- * Command line options
+- */
+-extern int quiet; /* Level of quietness */
+-extern int reservenum; /* Number of memory reservation slots */
+-extern int minsize; /* Minimum blob size */
+-extern int padsize; /* Additional padding to blob */
+-
+-static inline void __attribute__((noreturn)) die(char * str, ...)
+-{
+- va_list ap;
+-
+- va_start(ap, str);
+- fprintf(stderr, "FATAL ERROR: ");
+- vfprintf(stderr, str, ap);
+- exit(1);
+-}
+-
+-static inline void *xmalloc(size_t len)
+-{
+- void *new = malloc(len);
+-
+- if (! new)
+- die("malloc() failed\n");
+-
+- return new;
+-}
+-
+-static inline void *xrealloc(void *p, size_t len)
+-{
+- void *new = realloc(p, len);
+-
+- if (! new)
+- die("realloc() failed (len=%d)\n", len);
+-
+- return new;
+-}
+-
+-typedef uint32_t cell_t;
+-
+-
+-#define streq(a, b) (strcmp((a), (b)) == 0)
+-#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
+-
+-#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
+-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+-
+-/* Data blobs */
+-enum markertype {
+- REF_PHANDLE,
+- REF_PATH,
+- LABEL,
+-};
+-
+-struct marker {
+- enum markertype type;
+- int offset;
+- char *ref;
+- struct marker *next;
+-};
+-
+-struct data {
+- int len;
+- char *val;
+- struct marker *markers;
+-};
+-
+-
+-#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
+-
+-#define for_each_marker(m) \
+- for (; (m); (m) = (m)->next)
+-#define for_each_marker_of_type(m, t) \
+- for_each_marker(m) \
+- if ((m)->type == (t))
+-
+-void data_free(struct data d);
+-
+-struct data data_grow_for(struct data d, int xlen);
+-
+-struct data data_copy_mem(const char *mem, int len);
+-struct data data_copy_escape_string(const char *s, int len);
+-struct data data_copy_file(FILE *f, size_t len);
+-
+-struct data data_append_data(struct data d, const void *p, int len);
+-struct data data_insert_at_marker(struct data d, struct marker *m,
+- const void *p, int len);
+-struct data data_merge(struct data d1, struct data d2);
+-struct data data_append_cell(struct data d, cell_t word);
+-struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
+-struct data data_append_addr(struct data d, uint64_t addr);
+-struct data data_append_byte(struct data d, uint8_t byte);
+-struct data data_append_zeroes(struct data d, int len);
+-struct data data_append_align(struct data d, int align);
+-
+-struct data data_add_marker(struct data d, enum markertype type, char *ref);
+-
+-int data_is_one_string(struct data d);
+-
+-/* DT constraints */
+-
+-#define MAX_PROPNAME_LEN 31
+-#define MAX_NODENAME_LEN 31
+-
+-/* Live trees */
+-struct property {
+- char *name;
+- struct data val;
+-
+- struct property *next;
+-
+- char *label;
+-};
+-
+-struct node {
+- char *name;
+- struct property *proplist;
+- struct node *children;
+-
+- struct node *parent;
+- struct node *next_sibling;
+-
+- char *fullpath;
+- int basenamelen;
+-
+- cell_t phandle;
+- int addr_cells, size_cells;
+-
+- char *label;
+-};
+-
+-#define for_each_property(n, p) \
+- for ((p) = (n)->proplist; (p); (p) = (p)->next)
+-
+-#define for_each_child(n, c) \
+- for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
+-
+-struct property *build_property(char *name, struct data val, char *label);
+-struct property *chain_property(struct property *first, struct property *list);
+-struct property *reverse_properties(struct property *first);
+-
+-struct node *build_node(struct property *proplist, struct node *children);
+-struct node *name_node(struct node *node, char *name, char *label);
+-struct node *chain_node(struct node *first, struct node *list);
+-
+-void add_property(struct node *node, struct property *prop);
+-void add_child(struct node *parent, struct node *child);
+-
+-const char *get_unitname(struct node *node);
+-struct property *get_property(struct node *node, const char *propname);
+-cell_t propval_cell(struct property *prop);
+-struct node *get_subnode(struct node *node, const char *nodename);
+-struct node *get_node_by_path(struct node *tree, const char *path);
+-struct node *get_node_by_label(struct node *tree, const char *label);
+-struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
+-struct node *get_node_by_ref(struct node *tree, const char *ref);
+-cell_t get_node_phandle(struct node *root, struct node *node);
+-
+-/* Boot info (tree plus memreserve information */
+-
+-struct reserve_info {
+- struct fdt_reserve_entry re;
+-
+- struct reserve_info *next;
+-
+- char *label;
+-};
+-
+-struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len, char *label);
+-struct reserve_info *chain_reserve_entry(struct reserve_info *first,
+- struct reserve_info *list);
+-struct reserve_info *add_reserve_entry(struct reserve_info *list,
+- struct reserve_info *new);
+-
+-
+-struct boot_info {
+- struct reserve_info *reservelist;
+- struct node *dt; /* the device tree */
+- uint32_t boot_cpuid_phys;
+-};
+-
+-struct boot_info *build_boot_info(struct reserve_info *reservelist,
+- struct node *tree, uint32_t boot_cpuid_phys);
+-
+-/* Checks */
+-
+-void process_checks(int force, struct boot_info *bi);
+-
+-/* Flattened trees */
+-
+-void dt_to_blob(FILE *f, struct boot_info *bi, int version);
+-void dt_to_asm(FILE *f, struct boot_info *bi, int version);
+-
+-struct boot_info *dt_from_blob(const char *fname);
+-
+-/* Tree source */
+-
+-void dt_to_source(FILE *f, struct boot_info *bi);
+-struct boot_info *dt_from_source(const char *f);
+-
+-/* FS trees */
+-
+-struct boot_info *dt_from_fs(const char *dirname);
+-
+-/* misc */
+-
+-char *join_path(const char *path, const char *name);
+-
+-#endif /* _DTC_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-lexer.l linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-lexer.l
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-lexer.l 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-lexer.l 1970-01-01 01:00:00.000000000 +0100
+@@ -1,320 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
+- */
+-
+-%option noyywrap nounput yylineno
+-
+-%x INCLUDE
+-%x BYTESTRING
+-%x PROPNODENAME
+-%s V1
+-
+-PROPNODECHAR [a-zA-Z0-9,._+*#?@-]
+-PATHCHAR ({PROPNODECHAR}|[/])
+-LABEL [a-zA-Z_][a-zA-Z0-9_]*
+-STRING \"([^\\"]|\\.)*\"
+-WS [[:space:]]
+-COMMENT "/*"([^*]|\*+[^*/])*\*+"/"
+-LINECOMMENT "//".*\n
+-
+-%{
+-#include "dtc.h"
+-#include "srcpos.h"
+-#include "dtc-parser.tab.h"
+-
+-
+-/*#define LEXDEBUG 1*/
+-
+-#ifdef LEXDEBUG
+-#define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
+-#else
+-#define DPRINT(fmt, ...) do { } while (0)
+-#endif
+-
+-static int dts_version; /* = 0 */
+-
+-#define BEGIN_DEFAULT() if (dts_version == 0) { \
+- DPRINT("<INITIAL>\n"); \
+- BEGIN(INITIAL); \
+- } else { \
+- DPRINT("<V1>\n"); \
+- BEGIN(V1); \
+- }
+-
+-static void push_input_file(const char *filename);
+-static int pop_input_file(void);
+-%}
+-
+-%%
+-<*>"/include/"{WS}*{STRING} {
+- char *name = strchr(yytext, '\"') + 1;
+- yytext[yyleng-1] = '\0';
+- push_input_file(name);
+- }
+-
+-<*><<EOF>> {
+- if (!pop_input_file()) {
+- yyterminate();
+- }
+- }
+-
+-<*>{STRING} {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("String: %s\n", yytext);
+- yylval.data = data_copy_escape_string(yytext+1,
+- yyleng-2);
+- yylloc.first_line = yylineno;
+- return DT_STRING;
+- }
+-
+-<*>"/dts-v1/" {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Keyword: /dts-v1/\n");
+- dts_version = 1;
+- BEGIN_DEFAULT();
+- return DT_V1;
+- }
+-
+-<*>"/memreserve/" {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Keyword: /memreserve/\n");
+- BEGIN_DEFAULT();
+- return DT_MEMRESERVE;
+- }
+-
+-<*>{LABEL}: {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Label: %s\n", yytext);
+- yylval.labelref = strdup(yytext);
+- yylval.labelref[yyleng-1] = '\0';
+- return DT_LABEL;
+- }
+-
+-<INITIAL>[bodh]# {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- if (*yytext == 'b')
+- yylval.cbase = 2;
+- else if (*yytext == 'o')
+- yylval.cbase = 8;
+- else if (*yytext == 'd')
+- yylval.cbase = 10;
+- else
+- yylval.cbase = 16;
+- DPRINT("Base: %d\n", yylval.cbase);
+- return DT_BASE;
+- }
+-
+-<INITIAL>[0-9a-fA-F]+ {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.literal = strdup(yytext);
+- DPRINT("Literal: '%s'\n", yylval.literal);
+- return DT_LEGACYLITERAL;
+- }
+-
+-<V1>[0-9]+|0[xX][0-9a-fA-F]+ {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.literal = strdup(yytext);
+- DPRINT("Literal: '%s'\n", yylval.literal);
+- return DT_LITERAL;
+- }
+-
+-\&{LABEL} { /* label reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Ref: %s\n", yytext+1);
+- yylval.labelref = strdup(yytext+1);
+- return DT_REF;
+- }
+-
+-"&{/"{PATHCHAR}+\} { /* new-style path reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yytext[yyleng-1] = '\0';
+- DPRINT("Ref: %s\n", yytext+2);
+- yylval.labelref = strdup(yytext+2);
+- return DT_REF;
+- }
+-
+-<INITIAL>"&/"{PATHCHAR}+ { /* old-style path reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Ref: %s\n", yytext+1);
+- yylval.labelref = strdup(yytext+1);
+- return DT_REF;
+- }
+-
+-<BYTESTRING>[0-9a-fA-F]{2} {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.byte = strtol(yytext, NULL, 16);
+- DPRINT("Byte: %02x\n", (int)yylval.byte);
+- return DT_BYTE;
+- }
+-
+-<BYTESTRING>"]" {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("/BYTESTRING\n");
+- BEGIN_DEFAULT();
+- return ']';
+- }
+-
+-<PROPNODENAME>{PROPNODECHAR}+ {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("PropNodeName: %s\n", yytext);
+- yylval.propnodename = strdup(yytext);
+- BEGIN_DEFAULT();
+- return DT_PROPNODENAME;
+- }
+-
+-"/incbin/" {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Binary Include\n");
+- return DT_INCBIN;
+- }
+-
+-<*>{WS}+ /* eat whitespace */
+-<*>{COMMENT}+ /* eat C-style comments */
+-<*>{LINECOMMENT}+ /* eat C++-style comments */
+-
+-<*>. {
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Char: %c (\\x%02x)\n", yytext[0],
+- (unsigned)yytext[0]);
+- if (yytext[0] == '[') {
+- DPRINT("<BYTESTRING>\n");
+- BEGIN(BYTESTRING);
+- }
+- if ((yytext[0] == '{')
+- || (yytext[0] == ';')) {
+- DPRINT("<PROPNODENAME>\n");
+- BEGIN(PROPNODENAME);
+- }
+- return yytext[0];
+- }
+-
+-%%
+-
+-
+-/*
+- * Stack of nested include file contexts.
+- */
+-
+-struct incl_file {
+- struct dtc_file *file;
+- YY_BUFFER_STATE yy_prev_buf;
+- int yy_prev_lineno;
+- struct incl_file *prev;
+-};
+-
+-static struct incl_file *incl_file_stack;
+-
+-
+-/*
+- * Detect infinite include recursion.
+- */
+-#define MAX_INCLUDE_DEPTH (100)
+-
+-static int incl_depth = 0;
+-
+-
+-static void push_input_file(const char *filename)
+-{
+- struct incl_file *incl_file;
+- struct dtc_file *newfile;
+- struct search_path search, *searchptr = NULL;
+-
+- assert(filename);
+-
+- if (incl_depth++ >= MAX_INCLUDE_DEPTH)
+- die("Includes nested too deeply");
+-
+- if (srcpos_file) {
+- search.dir = srcpos_file->dir;
+- search.next = NULL;
+- search.prev = NULL;
+- searchptr = &search;
+- }
+-
+- newfile = dtc_open_file(filename, searchptr);
+-
+- incl_file = xmalloc(sizeof(struct incl_file));
+-
+- /*
+- * Save current context.
+- */
+- incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
+- incl_file->yy_prev_lineno = yylineno;
+- incl_file->file = srcpos_file;
+- incl_file->prev = incl_file_stack;
+-
+- incl_file_stack = incl_file;
+-
+- /*
+- * Establish new context.
+- */
+- srcpos_file = newfile;
+- yylineno = 1;
+- yyin = newfile->file;
+- yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+-}
+-
+-
+-static int pop_input_file(void)
+-{
+- struct incl_file *incl_file;
+-
+- if (incl_file_stack == 0)
+- return 0;
+-
+- dtc_close_file(srcpos_file);
+-
+- /*
+- * Pop.
+- */
+- --incl_depth;
+- incl_file = incl_file_stack;
+- incl_file_stack = incl_file->prev;
+-
+- /*
+- * Recover old context.
+- */
+- yy_delete_buffer(YY_CURRENT_BUFFER);
+- yy_switch_to_buffer(incl_file->yy_prev_buf);
+- yylineno = incl_file->yy_prev_lineno;
+- srcpos_file = incl_file->file;
+- yyin = incl_file->file ? incl_file->file->file : NULL;
+-
+- /*
+- * Free old state.
+- */
+- free(incl_file);
+-
+- return 1;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped 1970-01-01 01:00:00.000000000 +0100
+@@ -1,2187 +0,0 @@
+-#line 2 "dtc-lexer.lex.c"
+-
+-#line 4 "dtc-lexer.lex.c"
+-
+-#define YY_INT_ALIGNED short int
+-
+-/* A lexical scanner generated by flex */
+-
+-#define FLEX_SCANNER
+-#define YY_FLEX_MAJOR_VERSION 2
+-#define YY_FLEX_MINOR_VERSION 5
+-#define YY_FLEX_SUBMINOR_VERSION 34
+-#if YY_FLEX_SUBMINOR_VERSION > 0
+-#define FLEX_BETA
+-#endif
+-
+-/* First, we deal with platform-specific or compiler-specific issues. */
+-
+-/* begin standard C headers. */
+-#include <stdio.h>
+-#include <string.h>
+-#include <errno.h>
+-#include <stdlib.h>
+-
+-/* end standard C headers. */
+-
+-/* flex integer type definitions */
+-
+-#ifndef FLEXINT_H
+-#define FLEXINT_H
+-
+-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+-
+-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+-
+-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+- * if you want the limit (max/min) macros for int types.
+- */
+-#ifndef __STDC_LIMIT_MACROS
+-#define __STDC_LIMIT_MACROS 1
+-#endif
+-
+-#include <inttypes.h>
+-typedef int8_t flex_int8_t;
+-typedef uint8_t flex_uint8_t;
+-typedef int16_t flex_int16_t;
+-typedef uint16_t flex_uint16_t;
+-typedef int32_t flex_int32_t;
+-typedef uint32_t flex_uint32_t;
+-#else
+-typedef signed char flex_int8_t;
+-typedef short int flex_int16_t;
+-typedef int flex_int32_t;
+-typedef unsigned char flex_uint8_t;
+-typedef unsigned short int flex_uint16_t;
+-typedef unsigned int flex_uint32_t;
+-#endif /* ! C99 */
+-
+-/* Limits of integral types. */
+-#ifndef INT8_MIN
+-#define INT8_MIN (-128)
+-#endif
+-#ifndef INT16_MIN
+-#define INT16_MIN (-32767-1)
+-#endif
+-#ifndef INT32_MIN
+-#define INT32_MIN (-2147483647-1)
+-#endif
+-#ifndef INT8_MAX
+-#define INT8_MAX (127)
+-#endif
+-#ifndef INT16_MAX
+-#define INT16_MAX (32767)
+-#endif
+-#ifndef INT32_MAX
+-#define INT32_MAX (2147483647)
+-#endif
+-#ifndef UINT8_MAX
+-#define UINT8_MAX (255U)
+-#endif
+-#ifndef UINT16_MAX
+-#define UINT16_MAX (65535U)
+-#endif
+-#ifndef UINT32_MAX
+-#define UINT32_MAX (4294967295U)
+-#endif
+-
+-#endif /* ! FLEXINT_H */
+-
+-#ifdef __cplusplus
+-
+-/* The "const" storage-class-modifier is valid. */
+-#define YY_USE_CONST
+-
+-#else /* ! __cplusplus */
+-
+-/* C99 requires __STDC__ to be defined as 1. */
+-#if defined (__STDC__)
+-
+-#define YY_USE_CONST
+-
+-#endif /* defined (__STDC__) */
+-#endif /* ! __cplusplus */
+-
+-#ifdef YY_USE_CONST
+-#define yyconst const
+-#else
+-#define yyconst
+-#endif
+-
+-/* Returned upon end-of-file. */
+-#define YY_NULL 0
+-
+-/* Promotes a possibly negative, possibly signed char to an unsigned
+- * integer for use as an array index. If the signed char is negative,
+- * we want to instead treat it as an 8-bit unsigned char, hence the
+- * double cast.
+- */
+-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+-
+-/* Enter a start condition. This macro really ought to take a parameter,
+- * but we do it the disgusting crufty way forced on us by the ()-less
+- * definition of BEGIN.
+- */
+-#define BEGIN (yy_start) = 1 + 2 *
+-
+-/* Translate the current start state into a value that can be later handed
+- * to BEGIN to return to the state. The YYSTATE alias is for lex
+- * compatibility.
+- */
+-#define YY_START (((yy_start) - 1) / 2)
+-#define YYSTATE YY_START
+-
+-/* Action number for EOF rule of a given start state. */
+-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+-
+-/* Special action meaning "start processing a new file". */
+-#define YY_NEW_FILE yyrestart(yyin )
+-
+-#define YY_END_OF_BUFFER_CHAR 0
+-
+-/* Size of default input buffer. */
+-#ifndef YY_BUF_SIZE
+-#define YY_BUF_SIZE 16384
+-#endif
+-
+-/* The state buf must be large enough to hold one state per character in the main buffer.
+- */
+-#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+-
+-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+-#define YY_TYPEDEF_YY_BUFFER_STATE
+-typedef struct yy_buffer_state *YY_BUFFER_STATE;
+-#endif
+-
+-extern int yyleng;
+-
+-extern FILE *yyin, *yyout;
+-
+-#define EOB_ACT_CONTINUE_SCAN 0
+-#define EOB_ACT_END_OF_FILE 1
+-#define EOB_ACT_LAST_MATCH 2
+-
+- /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+- * access to the local variable yy_act. Since yyless() is a macro, it would break
+- * existing scanners that call yyless() from OUTSIDE yylex.
+- * One obvious solution it to make yy_act a global. I tried that, and saw
+- * a 5% performance hit in a non-yylineno scanner, because yy_act is
+- * normally declared as a register variable-- so it is not worth it.
+- */
+- #define YY_LESS_LINENO(n) \
+- do { \
+- int yyl;\
+- for ( yyl = n; yyl < yyleng; ++yyl )\
+- if ( yytext[yyl] == '\n' )\
+- --yylineno;\
+- }while(0)
+-
+-/* Return all but the first "n" matched characters back to the input stream. */
+-#define yyless(n) \
+- do \
+- { \
+- /* Undo effects of setting up yytext. */ \
+- int yyless_macro_arg = (n); \
+- YY_LESS_LINENO(yyless_macro_arg);\
+- *yy_cp = (yy_hold_char); \
+- YY_RESTORE_YY_MORE_OFFSET \
+- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+- } \
+- while ( 0 )
+-
+-#define unput(c) yyunput( c, (yytext_ptr) )
+-
+-/* The following is because we cannot portably get our hands on size_t
+- * (without autoconf's help, which isn't available because we want
+- * flex-generated scanners to compile on their own).
+- * Given that the standard has decreed that size_t exists since 1989,
+- * I guess we can afford to depend on it. Manoj.
+- */
+-
+-#ifndef YY_TYPEDEF_YY_SIZE_T
+-#define YY_TYPEDEF_YY_SIZE_T
+-typedef size_t yy_size_t;
+-#endif
+-
+-#ifndef YY_STRUCT_YY_BUFFER_STATE
+-#define YY_STRUCT_YY_BUFFER_STATE
+-struct yy_buffer_state
+- {
+- FILE *yy_input_file;
+-
+- char *yy_ch_buf; /* input buffer */
+- char *yy_buf_pos; /* current position in input buffer */
+-
+- /* Size of input buffer in bytes, not including room for EOB
+- * characters.
+- */
+- yy_size_t yy_buf_size;
+-
+- /* Number of characters read into yy_ch_buf, not including EOB
+- * characters.
+- */
+- int yy_n_chars;
+-
+- /* Whether we "own" the buffer - i.e., we know we created it,
+- * and can realloc() it to grow it, and should free() it to
+- * delete it.
+- */
+- int yy_is_our_buffer;
+-
+- /* Whether this is an "interactive" input source; if so, and
+- * if we're using stdio for input, then we want to use getc()
+- * instead of fread(), to make sure we stop fetching input after
+- * each newline.
+- */
+- int yy_is_interactive;
+-
+- /* Whether we're considered to be at the beginning of a line.
+- * If so, '^' rules will be active on the next match, otherwise
+- * not.
+- */
+- int yy_at_bol;
+-
+- int yy_bs_lineno; /**< The line count. */
+- int yy_bs_column; /**< The column count. */
+-
+- /* Whether to try to fill the input buffer when we reach the
+- * end of it.
+- */
+- int yy_fill_buffer;
+-
+- int yy_buffer_status;
+-
+-#define YY_BUFFER_NEW 0
+-#define YY_BUFFER_NORMAL 1
+- /* When an EOF's been seen but there's still some text to process
+- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+- * shouldn't try reading from the input source any more. We might
+- * still have a bunch of tokens to match, though, because of
+- * possible backing-up.
+- *
+- * When we actually see the EOF, we change the status to "new"
+- * (via yyrestart()), so that the user can continue scanning by
+- * just pointing yyin at a new input file.
+- */
+-#define YY_BUFFER_EOF_PENDING 2
+-
+- };
+-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+-
+-/* Stack of input buffers. */
+-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+-
+-/* We provide macros for accessing buffer states in case in the
+- * future we want to put the buffer states in a more general
+- * "scanner state".
+- *
+- * Returns the top of the stack, or NULL.
+- */
+-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+- ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+- : NULL)
+-
+-/* Same as previous macro, but useful when we know that the buffer stack is not
+- * NULL or when we need an lvalue. For internal use only.
+- */
+-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+-
+-/* yy_hold_char holds the character lost when yytext is formed. */
+-static char yy_hold_char;
+-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+-int yyleng;
+-
+-/* Points to current character in buffer. */
+-static char *yy_c_buf_p = (char *) 0;
+-static int yy_init = 0; /* whether we need to initialize */
+-static int yy_start = 0; /* start state number */
+-
+-/* Flag which is used to allow yywrap()'s to do buffer switches
+- * instead of setting up a fresh yyin. A bit of a hack ...
+- */
+-static int yy_did_buffer_switch_on_eof;
+-
+-void yyrestart (FILE *input_file );
+-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
+-void yy_delete_buffer (YY_BUFFER_STATE b );
+-void yy_flush_buffer (YY_BUFFER_STATE b );
+-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
+-void yypop_buffer_state (void );
+-
+-static void yyensure_buffer_stack (void );
+-static void yy_load_buffer_state (void );
+-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+-
+-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+-
+-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
+-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
+-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+-
+-void *yyalloc (yy_size_t );
+-void *yyrealloc (void *,yy_size_t );
+-void yyfree (void * );
+-
+-#define yy_new_buffer yy_create_buffer
+-
+-#define yy_set_interactive(is_interactive) \
+- { \
+- if ( ! YY_CURRENT_BUFFER ){ \
+- yyensure_buffer_stack (); \
+- YY_CURRENT_BUFFER_LVALUE = \
+- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+- } \
+- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+- }
+-
+-#define yy_set_bol(at_bol) \
+- { \
+- if ( ! YY_CURRENT_BUFFER ){\
+- yyensure_buffer_stack (); \
+- YY_CURRENT_BUFFER_LVALUE = \
+- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+- } \
+- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+- }
+-
+-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+-
+-/* Begin user sect3 */
+-
+-#define yywrap(n) 1
+-#define YY_SKIP_YYWRAP
+-
+-typedef unsigned char YY_CHAR;
+-
+-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+-
+-typedef int yy_state_type;
+-
+-extern int yylineno;
+-
+-int yylineno = 1;
+-
+-extern char *yytext;
+-#define yytext_ptr yytext
+-
+-static yy_state_type yy_get_previous_state (void );
+-static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+-static int yy_get_next_buffer (void );
+-static void yy_fatal_error (yyconst char msg[] );
+-
+-/* Done after the current pattern has been matched and before the
+- * corresponding action - sets up yytext.
+- */
+-#define YY_DO_BEFORE_ACTION \
+- (yytext_ptr) = yy_bp; \
+- yyleng = (size_t) (yy_cp - yy_bp); \
+- (yy_hold_char) = *yy_cp; \
+- *yy_cp = '\0'; \
+- (yy_c_buf_p) = yy_cp;
+-
+-#define YY_NUM_RULES 20
+-#define YY_END_OF_BUFFER 21
+-/* This struct is not used in this scanner,
+- but its presence is necessary. */
+-struct yy_trans_info
+- {
+- flex_int32_t yy_verify;
+- flex_int32_t yy_nxt;
+- };
+-static yyconst flex_int16_t yy_accept[104] =
+- { 0,
+- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+- 21, 19, 16, 16, 19, 19, 19, 7, 7, 19,
+- 7, 19, 19, 19, 19, 13, 14, 14, 19, 8,
+- 8, 16, 0, 2, 0, 0, 9, 0, 0, 0,
+- 0, 0, 0, 7, 7, 5, 0, 6, 0, 12,
+- 12, 14, 14, 8, 0, 11, 9, 0, 0, 0,
+- 0, 18, 0, 0, 0, 0, 8, 0, 17, 0,
+- 0, 0, 0, 0, 10, 0, 0, 0, 0, 0,
+- 0, 0, 0, 0, 0, 0, 0, 0, 3, 15,
+- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+-
+- 0, 4, 0
+- } ;
+-
+-static yyconst flex_int32_t yy_ec[256] =
+- { 0,
+- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+- 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 2, 1, 4, 5, 1, 1, 6, 1, 1,
+- 1, 7, 8, 8, 9, 8, 10, 11, 12, 13,
+- 13, 13, 13, 13, 13, 13, 13, 14, 1, 1,
+- 1, 1, 8, 8, 15, 15, 15, 15, 15, 15,
+- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+- 16, 16, 16, 16, 16, 16, 16, 17, 16, 16,
+- 1, 18, 19, 1, 16, 1, 15, 20, 21, 22,
+-
+- 23, 15, 16, 24, 25, 16, 16, 26, 27, 28,
+- 24, 16, 16, 29, 30, 31, 32, 33, 16, 17,
+- 16, 16, 34, 1, 35, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+-
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1
+- } ;
+-
+-static yyconst flex_int32_t yy_meta[36] =
+- { 0,
+- 1, 1, 1, 1, 2, 1, 2, 2, 2, 3,
+- 4, 4, 4, 5, 6, 7, 7, 1, 1, 6,
+- 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
+- 7, 7, 7, 8, 1
+- } ;
+-
+-static yyconst flex_int16_t yy_base[117] =
+- { 0,
+- 0, 0, 30, 0, 44, 0, 67, 0, 97, 105,
+- 302, 303, 35, 44, 40, 94, 112, 0, 129, 152,
+- 296, 295, 159, 0, 176, 303, 0, 116, 95, 165,
+- 49, 46, 102, 303, 296, 0, 0, 288, 290, 293,
+- 264, 266, 270, 0, 0, 303, 0, 303, 264, 303,
+- 0, 0, 195, 101, 0, 0, 0, 0, 284, 125,
+- 277, 265, 225, 230, 216, 218, 0, 202, 224, 221,
+- 217, 107, 196, 188, 303, 206, 179, 186, 178, 185,
+- 183, 162, 161, 150, 169, 160, 145, 125, 303, 303,
+- 137, 109, 190, 103, 203, 167, 108, 197, 303, 123,
+-
+- 29, 303, 303, 215, 221, 226, 229, 234, 240, 246,
+- 250, 257, 265, 270, 275, 282
+- } ;
+-
+-static yyconst flex_int16_t yy_def[117] =
+- { 0,
+- 103, 1, 1, 3, 3, 5, 103, 7, 3, 3,
+- 103, 103, 103, 103, 104, 105, 103, 106, 103, 19,
+- 19, 20, 103, 107, 20, 103, 108, 109, 105, 103,
+- 103, 103, 104, 103, 104, 110, 111, 103, 112, 113,
+- 103, 103, 103, 106, 19, 103, 20, 103, 103, 103,
+- 20, 108, 109, 103, 114, 110, 111, 115, 112, 112,
+- 113, 103, 103, 103, 103, 103, 114, 115, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 116, 103, 116, 103, 116,
+-
+- 103, 103, 0, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103
+- } ;
+-
+-static yyconst flex_int16_t yy_nxt[339] =
+- { 0,
+- 12, 13, 14, 15, 12, 16, 12, 12, 12, 17,
+- 18, 18, 18, 12, 19, 20, 20, 12, 12, 21,
+- 19, 21, 19, 22, 20, 20, 20, 20, 20, 20,
+- 20, 20, 20, 12, 12, 12, 32, 32, 102, 23,
+- 12, 12, 12, 34, 20, 32, 32, 32, 32, 20,
+- 20, 20, 20, 20, 24, 24, 24, 35, 25, 54,
+- 54, 54, 26, 25, 25, 25, 25, 12, 13, 14,
+- 15, 27, 12, 27, 27, 27, 23, 27, 27, 27,
+- 12, 28, 28, 28, 12, 12, 28, 28, 28, 28,
+- 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+-
+- 12, 12, 29, 36, 103, 34, 17, 30, 31, 31,
+- 29, 54, 54, 54, 17, 30, 31, 31, 39, 35,
+- 52, 40, 52, 52, 52, 103, 78, 38, 38, 46,
+- 101, 60, 79, 41, 69, 97, 42, 94, 43, 45,
+- 45, 45, 46, 45, 47, 47, 93, 92, 45, 45,
+- 45, 45, 47, 47, 47, 47, 47, 47, 47, 47,
+- 47, 47, 47, 47, 47, 39, 47, 91, 40, 90,
+- 99, 47, 47, 47, 47, 54, 54, 54, 89, 88,
+- 41, 55, 87, 49, 100, 43, 51, 51, 51, 86,
+- 51, 95, 95, 96, 85, 51, 51, 51, 51, 52,
+-
+- 99, 52, 52, 52, 95, 95, 96, 84, 46, 83,
+- 82, 81, 39, 79, 100, 33, 33, 33, 33, 33,
+- 33, 33, 33, 37, 80, 77, 37, 37, 37, 44,
+- 40, 44, 50, 76, 50, 52, 75, 52, 74, 52,
+- 52, 53, 73, 53, 53, 53, 53, 56, 56, 56,
+- 72, 56, 56, 57, 71, 57, 57, 59, 59, 59,
+- 59, 59, 59, 59, 59, 61, 61, 61, 61, 61,
+- 61, 61, 61, 67, 70, 67, 68, 68, 68, 62,
+- 68, 68, 98, 98, 98, 98, 98, 98, 98, 98,
+- 60, 66, 65, 64, 63, 62, 60, 58, 103, 48,
+-
+- 48, 103, 11, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103
+- } ;
+-
+-static yyconst flex_int16_t yy_chk[339] =
+- { 0,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 1, 1, 1, 1, 3, 13, 13, 101, 3,
+- 3, 3, 3, 15, 3, 14, 14, 32, 32, 3,
+- 3, 3, 3, 3, 5, 5, 5, 15, 5, 31,
+- 31, 31, 5, 5, 5, 5, 5, 7, 7, 7,
+- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+-
+- 7, 7, 9, 16, 29, 33, 9, 9, 9, 9,
+- 10, 54, 54, 54, 10, 10, 10, 10, 17, 33,
+- 28, 17, 28, 28, 28, 100, 72, 16, 29, 28,
+- 97, 60, 72, 17, 60, 94, 17, 92, 17, 19,
+- 19, 19, 19, 19, 19, 19, 91, 88, 19, 19,
+- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+- 19, 19, 20, 20, 20, 23, 20, 87, 23, 86,
+- 96, 20, 20, 20, 20, 30, 30, 30, 85, 84,
+- 23, 30, 83, 23, 96, 23, 25, 25, 25, 82,
+- 25, 93, 93, 93, 81, 25, 25, 25, 25, 53,
+-
+- 98, 53, 53, 53, 95, 95, 95, 80, 53, 79,
+- 78, 77, 76, 74, 98, 104, 104, 104, 104, 104,
+- 104, 104, 104, 105, 73, 71, 105, 105, 105, 106,
+- 70, 106, 107, 69, 107, 108, 68, 108, 66, 108,
+- 108, 109, 65, 109, 109, 109, 109, 110, 110, 110,
+- 64, 110, 110, 111, 63, 111, 111, 112, 112, 112,
+- 112, 112, 112, 112, 112, 113, 113, 113, 113, 113,
+- 113, 113, 113, 114, 62, 114, 115, 115, 115, 61,
+- 115, 115, 116, 116, 116, 116, 116, 116, 116, 116,
+- 59, 49, 43, 42, 41, 40, 39, 38, 35, 22,
+-
+- 21, 11, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+- 103, 103, 103, 103, 103, 103, 103, 103
+- } ;
+-
+-/* Table of booleans, true if rule could match eol. */
+-static yyconst flex_int32_t yy_rule_can_match_eol[21] =
+- { 0,
+-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
+- 0, };
+-
+-static yy_state_type yy_last_accepting_state;
+-static char *yy_last_accepting_cpos;
+-
+-extern int yy_flex_debug;
+-int yy_flex_debug = 0;
+-
+-/* The intent behind this definition is that it'll catch
+- * any uses of REJECT which flex missed.
+- */
+-#define REJECT reject_used_but_not_detected
+-#define yymore() yymore_used_but_not_detected
+-#define YY_MORE_ADJ 0
+-#define YY_RESTORE_YY_MORE_OFFSET
+-char *yytext;
+-#line 1 "dtc-lexer.l"
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
+- */
+-
+-
+-
+-
+-#line 37 "dtc-lexer.l"
+-#include "dtc.h"
+-#include "srcpos.h"
+-#include "dtc-parser.tab.h"
+-
+-
+-/*#define LEXDEBUG 1*/
+-
+-#ifdef LEXDEBUG
+-#define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
+-#else
+-#define DPRINT(fmt, ...) do { } while (0)
+-#endif
+-
+-static int dts_version; /* = 0 */
+-
+-#define BEGIN_DEFAULT() if (dts_version == 0) { \
+- DPRINT("<INITIAL>\n"); \
+- BEGIN(INITIAL); \
+- } else { \
+- DPRINT("<V1>\n"); \
+- BEGIN(V1); \
+- }
+-
+-static void push_input_file(const char *filename);
+-static int pop_input_file(void);
+-#line 638 "dtc-lexer.lex.c"
+-
+-#define INITIAL 0
+-#define INCLUDE 1
+-#define BYTESTRING 2
+-#define PROPNODENAME 3
+-#define V1 4
+-
+-#ifndef YY_NO_UNISTD_H
+-/* Special case for "unistd.h", since it is non-ANSI. We include it way
+- * down here because we want the user's section 1 to have been scanned first.
+- * The user has a chance to override it with an option.
+- */
+-#include <unistd.h>
+-#endif
+-
+-#ifndef YY_EXTRA_TYPE
+-#define YY_EXTRA_TYPE void *
+-#endif
+-
+-static int yy_init_globals (void );
+-
+-/* Macros after this point can all be overridden by user definitions in
+- * section 1.
+- */
+-
+-#ifndef YY_SKIP_YYWRAP
+-#ifdef __cplusplus
+-extern "C" int yywrap (void );
+-#else
+-extern int yywrap (void );
+-#endif
+-#endif
+-
+-#ifndef yytext_ptr
+-static void yy_flex_strncpy (char *,yyconst char *,int );
+-#endif
+-
+-#ifdef YY_NEED_STRLEN
+-static int yy_flex_strlen (yyconst char * );
+-#endif
+-
+-#ifndef YY_NO_INPUT
+-
+-#ifdef __cplusplus
+-static int yyinput (void );
+-#else
+-static int input (void );
+-#endif
+-
+-#endif
+-
+-/* Amount of stuff to slurp up with each read. */
+-#ifndef YY_READ_BUF_SIZE
+-#define YY_READ_BUF_SIZE 8192
+-#endif
+-
+-/* Copy whatever the last rule matched to the standard output. */
+-#ifndef ECHO
+-/* This used to be an fputs(), but since the string might contain NUL's,
+- * we now use fwrite().
+- */
+-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+-#endif
+-
+-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+- * is returned in "result".
+- */
+-#ifndef YY_INPUT
+-#define YY_INPUT(buf,result,max_size) \
+- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+- { \
+- int c = '*'; \
+- int n; \
+- for ( n = 0; n < max_size && \
+- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+- buf[n] = (char) c; \
+- if ( c == '\n' ) \
+- buf[n++] = (char) c; \
+- if ( c == EOF && ferror( yyin ) ) \
+- YY_FATAL_ERROR( "input in flex scanner failed" ); \
+- result = n; \
+- } \
+- else \
+- { \
+- errno=0; \
+- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+- { \
+- if( errno != EINTR) \
+- { \
+- YY_FATAL_ERROR( "input in flex scanner failed" ); \
+- break; \
+- } \
+- errno=0; \
+- clearerr(yyin); \
+- } \
+- }\
+-\
+-
+-#endif
+-
+-/* No semi-colon after return; correct usage is to write "yyterminate();" -
+- * we don't want an extra ';' after the "return" because that will cause
+- * some compilers to complain about unreachable statements.
+- */
+-#ifndef yyterminate
+-#define yyterminate() return YY_NULL
+-#endif
+-
+-/* Number of entries by which start-condition stack grows. */
+-#ifndef YY_START_STACK_INCR
+-#define YY_START_STACK_INCR 25
+-#endif
+-
+-/* Report a fatal error. */
+-#ifndef YY_FATAL_ERROR
+-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+-#endif
+-
+-/* end tables serialization structures and prototypes */
+-
+-/* Default declaration of generated scanner - a define so the user can
+- * easily add parameters.
+- */
+-#ifndef YY_DECL
+-#define YY_DECL_IS_OURS 1
+-
+-extern int yylex (void);
+-
+-#define YY_DECL int yylex (void)
+-#endif /* !YY_DECL */
+-
+-/* Code executed at the beginning of each rule, after yytext and yyleng
+- * have been set up.
+- */
+-#ifndef YY_USER_ACTION
+-#define YY_USER_ACTION
+-#endif
+-
+-/* Code executed at the end of each rule. */
+-#ifndef YY_BREAK
+-#define YY_BREAK break;
+-#endif
+-
+-#define YY_RULE_SETUP \
+- YY_USER_ACTION
+-
+-/** The main scanner function which does all the work.
+- */
+-YY_DECL
+-{
+- register yy_state_type yy_current_state;
+- register char *yy_cp, *yy_bp;
+- register int yy_act;
+-
+-#line 64 "dtc-lexer.l"
+-
+-#line 795 "dtc-lexer.lex.c"
+-
+- if ( !(yy_init) )
+- {
+- (yy_init) = 1;
+-
+-#ifdef YY_USER_INIT
+- YY_USER_INIT;
+-#endif
+-
+- if ( ! (yy_start) )
+- (yy_start) = 1; /* first start state */
+-
+- if ( ! yyin )
+- yyin = stdin;
+-
+- if ( ! yyout )
+- yyout = stdout;
+-
+- if ( ! YY_CURRENT_BUFFER ) {
+- yyensure_buffer_stack ();
+- YY_CURRENT_BUFFER_LVALUE =
+- yy_create_buffer(yyin,YY_BUF_SIZE );
+- }
+-
+- yy_load_buffer_state( );
+- }
+-
+- while ( 1 ) /* loops until end-of-file is reached */
+- {
+- yy_cp = (yy_c_buf_p);
+-
+- /* Support of yytext. */
+- *yy_cp = (yy_hold_char);
+-
+- /* yy_bp points to the position in yy_ch_buf of the start of
+- * the current run.
+- */
+- yy_bp = yy_cp;
+-
+- yy_current_state = (yy_start);
+-yy_match:
+- do
+- {
+- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+- if ( yy_accept[yy_current_state] )
+- {
+- (yy_last_accepting_state) = yy_current_state;
+- (yy_last_accepting_cpos) = yy_cp;
+- }
+- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+- {
+- yy_current_state = (int) yy_def[yy_current_state];
+- if ( yy_current_state >= 104 )
+- yy_c = yy_meta[(unsigned int) yy_c];
+- }
+- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+- ++yy_cp;
+- }
+- while ( yy_base[yy_current_state] != 303 );
+-
+-yy_find_action:
+- yy_act = yy_accept[yy_current_state];
+- if ( yy_act == 0 )
+- { /* have to back up */
+- yy_cp = (yy_last_accepting_cpos);
+- yy_current_state = (yy_last_accepting_state);
+- yy_act = yy_accept[yy_current_state];
+- }
+-
+- YY_DO_BEFORE_ACTION;
+-
+- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+- {
+- int yyl;
+- for ( yyl = 0; yyl < yyleng; ++yyl )
+- if ( yytext[yyl] == '\n' )
+-
+- yylineno++;
+-;
+- }
+-
+-do_action: /* This label is used only to access EOF actions. */
+-
+- switch ( yy_act )
+- { /* beginning of action switch */
+- case 0: /* must back up */
+- /* undo the effects of YY_DO_BEFORE_ACTION */
+- *yy_cp = (yy_hold_char);
+- yy_cp = (yy_last_accepting_cpos);
+- yy_current_state = (yy_last_accepting_state);
+- goto yy_find_action;
+-
+-case 1:
+-/* rule 1 can match eol */
+-YY_RULE_SETUP
+-#line 65 "dtc-lexer.l"
+-{
+- char *name = strchr(yytext, '\"') + 1;
+- yytext[yyleng-1] = '\0';
+- push_input_file(name);
+- }
+- YY_BREAK
+-case YY_STATE_EOF(INITIAL):
+-case YY_STATE_EOF(INCLUDE):
+-case YY_STATE_EOF(BYTESTRING):
+-case YY_STATE_EOF(PROPNODENAME):
+-case YY_STATE_EOF(V1):
+-#line 71 "dtc-lexer.l"
+-{
+- if (!pop_input_file()) {
+- yyterminate();
+- }
+- }
+- YY_BREAK
+-case 2:
+-/* rule 2 can match eol */
+-YY_RULE_SETUP
+-#line 77 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("String: %s\n", yytext);
+- yylval.data = data_copy_escape_string(yytext+1,
+- yyleng-2);
+- yylloc.first_line = yylineno;
+- return DT_STRING;
+- }
+- YY_BREAK
+-case 3:
+-YY_RULE_SETUP
+-#line 87 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Keyword: /dts-v1/\n");
+- dts_version = 1;
+- BEGIN_DEFAULT();
+- return DT_V1;
+- }
+- YY_BREAK
+-case 4:
+-YY_RULE_SETUP
+-#line 96 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Keyword: /memreserve/\n");
+- BEGIN_DEFAULT();
+- return DT_MEMRESERVE;
+- }
+- YY_BREAK
+-case 5:
+-YY_RULE_SETUP
+-#line 104 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Label: %s\n", yytext);
+- yylval.labelref = strdup(yytext);
+- yylval.labelref[yyleng-1] = '\0';
+- return DT_LABEL;
+- }
+- YY_BREAK
+-case 6:
+-YY_RULE_SETUP
+-#line 113 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- if (*yytext == 'b')
+- yylval.cbase = 2;
+- else if (*yytext == 'o')
+- yylval.cbase = 8;
+- else if (*yytext == 'd')
+- yylval.cbase = 10;
+- else
+- yylval.cbase = 16;
+- DPRINT("Base: %d\n", yylval.cbase);
+- return DT_BASE;
+- }
+- YY_BREAK
+-case 7:
+-YY_RULE_SETUP
+-#line 128 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.literal = strdup(yytext);
+- DPRINT("Literal: '%s'\n", yylval.literal);
+- return DT_LEGACYLITERAL;
+- }
+- YY_BREAK
+-case 8:
+-YY_RULE_SETUP
+-#line 136 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.literal = strdup(yytext);
+- DPRINT("Literal: '%s'\n", yylval.literal);
+- return DT_LITERAL;
+- }
+- YY_BREAK
+-case 9:
+-YY_RULE_SETUP
+-#line 144 "dtc-lexer.l"
+-{ /* label reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Ref: %s\n", yytext+1);
+- yylval.labelref = strdup(yytext+1);
+- return DT_REF;
+- }
+- YY_BREAK
+-case 10:
+-YY_RULE_SETUP
+-#line 152 "dtc-lexer.l"
+-{ /* new-style path reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yytext[yyleng-1] = '\0';
+- DPRINT("Ref: %s\n", yytext+2);
+- yylval.labelref = strdup(yytext+2);
+- return DT_REF;
+- }
+- YY_BREAK
+-case 11:
+-YY_RULE_SETUP
+-#line 161 "dtc-lexer.l"
+-{ /* old-style path reference */
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Ref: %s\n", yytext+1);
+- yylval.labelref = strdup(yytext+1);
+- return DT_REF;
+- }
+- YY_BREAK
+-case 12:
+-YY_RULE_SETUP
+-#line 169 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- yylval.byte = strtol(yytext, NULL, 16);
+- DPRINT("Byte: %02x\n", (int)yylval.byte);
+- return DT_BYTE;
+- }
+- YY_BREAK
+-case 13:
+-YY_RULE_SETUP
+-#line 177 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("/BYTESTRING\n");
+- BEGIN_DEFAULT();
+- return ']';
+- }
+- YY_BREAK
+-case 14:
+-YY_RULE_SETUP
+-#line 185 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("PropNodeName: %s\n", yytext);
+- yylval.propnodename = strdup(yytext);
+- BEGIN_DEFAULT();
+- return DT_PROPNODENAME;
+- }
+- YY_BREAK
+-case 15:
+-YY_RULE_SETUP
+-#line 194 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Binary Include\n");
+- return DT_INCBIN;
+- }
+- YY_BREAK
+-case 16:
+-/* rule 16 can match eol */
+-YY_RULE_SETUP
+-#line 201 "dtc-lexer.l"
+-/* eat whitespace */
+- YY_BREAK
+-case 17:
+-/* rule 17 can match eol */
+-YY_RULE_SETUP
+-#line 202 "dtc-lexer.l"
+-/* eat C-style comments */
+- YY_BREAK
+-case 18:
+-/* rule 18 can match eol */
+-YY_RULE_SETUP
+-#line 203 "dtc-lexer.l"
+-/* eat C++-style comments */
+- YY_BREAK
+-case 19:
+-YY_RULE_SETUP
+-#line 205 "dtc-lexer.l"
+-{
+- yylloc.file = srcpos_file;
+- yylloc.first_line = yylineno;
+- DPRINT("Char: %c (\\x%02x)\n", yytext[0],
+- (unsigned)yytext[0]);
+- if (yytext[0] == '[') {
+- DPRINT("<BYTESTRING>\n");
+- BEGIN(BYTESTRING);
+- }
+- if ((yytext[0] == '{')
+- || (yytext[0] == ';')) {
+- DPRINT("<PROPNODENAME>\n");
+- BEGIN(PROPNODENAME);
+- }
+- return yytext[0];
+- }
+- YY_BREAK
+-case 20:
+-YY_RULE_SETUP
+-#line 222 "dtc-lexer.l"
+-ECHO;
+- YY_BREAK
+-#line 1120 "dtc-lexer.lex.c"
+-
+- case YY_END_OF_BUFFER:
+- {
+- /* Amount of text matched not including the EOB char. */
+- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+-
+- /* Undo the effects of YY_DO_BEFORE_ACTION. */
+- *yy_cp = (yy_hold_char);
+- YY_RESTORE_YY_MORE_OFFSET
+-
+- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+- {
+- /* We're scanning a new file or input source. It's
+- * possible that this happened because the user
+- * just pointed yyin at a new source and called
+- * yylex(). If so, then we have to assure
+- * consistency between YY_CURRENT_BUFFER and our
+- * globals. Here is the right place to do so, because
+- * this is the first action (other than possibly a
+- * back-up) that will match for the new input source.
+- */
+- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+- }
+-
+- /* Note that here we test for yy_c_buf_p "<=" to the position
+- * of the first EOB in the buffer, since yy_c_buf_p will
+- * already have been incremented past the NUL character
+- * (since all states make transitions on EOB to the
+- * end-of-buffer state). Contrast this with the test
+- * in input().
+- */
+- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+- { /* This was really a NUL. */
+- yy_state_type yy_next_state;
+-
+- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+-
+- yy_current_state = yy_get_previous_state( );
+-
+- /* Okay, we're now positioned to make the NUL
+- * transition. We couldn't have
+- * yy_get_previous_state() go ahead and do it
+- * for us because it doesn't know how to deal
+- * with the possibility of jamming (and we don't
+- * want to build jamming into it because then it
+- * will run more slowly).
+- */
+-
+- yy_next_state = yy_try_NUL_trans( yy_current_state );
+-
+- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+-
+- if ( yy_next_state )
+- {
+- /* Consume the NUL. */
+- yy_cp = ++(yy_c_buf_p);
+- yy_current_state = yy_next_state;
+- goto yy_match;
+- }
+-
+- else
+- {
+- yy_cp = (yy_c_buf_p);
+- goto yy_find_action;
+- }
+- }
+-
+- else switch ( yy_get_next_buffer( ) )
+- {
+- case EOB_ACT_END_OF_FILE:
+- {
+- (yy_did_buffer_switch_on_eof) = 0;
+-
+- if ( yywrap( ) )
+- {
+- /* Note: because we've taken care in
+- * yy_get_next_buffer() to have set up
+- * yytext, we can now set up
+- * yy_c_buf_p so that if some total
+- * hoser (like flex itself) wants to
+- * call the scanner after we return the
+- * YY_NULL, it'll still work - another
+- * YY_NULL will get returned.
+- */
+- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+-
+- yy_act = YY_STATE_EOF(YY_START);
+- goto do_action;
+- }
+-
+- else
+- {
+- if ( ! (yy_did_buffer_switch_on_eof) )
+- YY_NEW_FILE;
+- }
+- break;
+- }
+-
+- case EOB_ACT_CONTINUE_SCAN:
+- (yy_c_buf_p) =
+- (yytext_ptr) + yy_amount_of_matched_text;
+-
+- yy_current_state = yy_get_previous_state( );
+-
+- yy_cp = (yy_c_buf_p);
+- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+- goto yy_match;
+-
+- case EOB_ACT_LAST_MATCH:
+- (yy_c_buf_p) =
+- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+-
+- yy_current_state = yy_get_previous_state( );
+-
+- yy_cp = (yy_c_buf_p);
+- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+- goto yy_find_action;
+- }
+- break;
+- }
+-
+- default:
+- YY_FATAL_ERROR(
+- "fatal flex scanner internal error--no action found" );
+- } /* end of action switch */
+- } /* end of scanning one token */
+-} /* end of yylex */
+-
+-/* yy_get_next_buffer - try to read in a new buffer
+- *
+- * Returns a code representing an action:
+- * EOB_ACT_LAST_MATCH -
+- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+- * EOB_ACT_END_OF_FILE - end of file
+- */
+-static int yy_get_next_buffer (void)
+-{
+- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+- register char *source = (yytext_ptr);
+- register int number_to_move, i;
+- int ret_val;
+-
+- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+- YY_FATAL_ERROR(
+- "fatal flex scanner internal error--end of buffer missed" );
+-
+- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+- { /* Don't try to fill the buffer, so this is an EOF. */
+- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+- {
+- /* We matched a single character, the EOB, so
+- * treat this as a final EOF.
+- */
+- return EOB_ACT_END_OF_FILE;
+- }
+-
+- else
+- {
+- /* We matched some text prior to the EOB, first
+- * process it.
+- */
+- return EOB_ACT_LAST_MATCH;
+- }
+- }
+-
+- /* Try to read more data. */
+-
+- /* First move last chars to start of buffer. */
+- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+-
+- for ( i = 0; i < number_to_move; ++i )
+- *(dest++) = *(source++);
+-
+- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+- /* don't do the read, it's not guaranteed to return an EOF,
+- * just force an EOF
+- */
+- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+-
+- else
+- {
+- int num_to_read =
+- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+-
+- while ( num_to_read <= 0 )
+- { /* Not enough room in the buffer - grow it. */
+-
+- /* just a shorter name for the current buffer */
+- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+-
+- int yy_c_buf_p_offset =
+- (int) ((yy_c_buf_p) - b->yy_ch_buf);
+-
+- if ( b->yy_is_our_buffer )
+- {
+- int new_size = b->yy_buf_size * 2;
+-
+- if ( new_size <= 0 )
+- b->yy_buf_size += b->yy_buf_size / 8;
+- else
+- b->yy_buf_size *= 2;
+-
+- b->yy_ch_buf = (char *)
+- /* Include room in for 2 EOB chars. */
+- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+- }
+- else
+- /* Can't grow it, we don't own it. */
+- b->yy_ch_buf = 0;
+-
+- if ( ! b->yy_ch_buf )
+- YY_FATAL_ERROR(
+- "fatal error - scanner input buffer overflow" );
+-
+- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+-
+- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+- number_to_move - 1;
+-
+- }
+-
+- if ( num_to_read > YY_READ_BUF_SIZE )
+- num_to_read = YY_READ_BUF_SIZE;
+-
+- /* Read in more data. */
+- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+- (yy_n_chars), (size_t) num_to_read );
+-
+- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+- }
+-
+- if ( (yy_n_chars) == 0 )
+- {
+- if ( number_to_move == YY_MORE_ADJ )
+- {
+- ret_val = EOB_ACT_END_OF_FILE;
+- yyrestart(yyin );
+- }
+-
+- else
+- {
+- ret_val = EOB_ACT_LAST_MATCH;
+- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+- YY_BUFFER_EOF_PENDING;
+- }
+- }
+-
+- else
+- ret_val = EOB_ACT_CONTINUE_SCAN;
+-
+- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+- /* Extend the array by 50%, plus the number we really need. */
+- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+- }
+-
+- (yy_n_chars) += number_to_move;
+- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+-
+- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+-
+- return ret_val;
+-}
+-
+-/* yy_get_previous_state - get the state just before the EOB char was reached */
+-
+- static yy_state_type yy_get_previous_state (void)
+-{
+- register yy_state_type yy_current_state;
+- register char *yy_cp;
+-
+- yy_current_state = (yy_start);
+-
+- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+- {
+- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+- if ( yy_accept[yy_current_state] )
+- {
+- (yy_last_accepting_state) = yy_current_state;
+- (yy_last_accepting_cpos) = yy_cp;
+- }
+- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+- {
+- yy_current_state = (int) yy_def[yy_current_state];
+- if ( yy_current_state >= 104 )
+- yy_c = yy_meta[(unsigned int) yy_c];
+- }
+- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+- }
+-
+- return yy_current_state;
+-}
+-
+-/* yy_try_NUL_trans - try to make a transition on the NUL character
+- *
+- * synopsis
+- * next_state = yy_try_NUL_trans( current_state );
+- */
+- static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+-{
+- register int yy_is_jam;
+- register char *yy_cp = (yy_c_buf_p);
+-
+- register YY_CHAR yy_c = 1;
+- if ( yy_accept[yy_current_state] )
+- {
+- (yy_last_accepting_state) = yy_current_state;
+- (yy_last_accepting_cpos) = yy_cp;
+- }
+- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+- {
+- yy_current_state = (int) yy_def[yy_current_state];
+- if ( yy_current_state >= 104 )
+- yy_c = yy_meta[(unsigned int) yy_c];
+- }
+- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+- yy_is_jam = (yy_current_state == 103);
+-
+- return yy_is_jam ? 0 : yy_current_state;
+-}
+-
+-#ifndef YY_NO_INPUT
+-#ifdef __cplusplus
+- static int yyinput (void)
+-#else
+- static int input (void)
+-#endif
+-
+-{
+- int c;
+-
+- *(yy_c_buf_p) = (yy_hold_char);
+-
+- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+- {
+- /* yy_c_buf_p now points to the character we want to return.
+- * If this occurs *before* the EOB characters, then it's a
+- * valid NUL; if not, then we've hit the end of the buffer.
+- */
+- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+- /* This was really a NUL. */
+- *(yy_c_buf_p) = '\0';
+-
+- else
+- { /* need more input */
+- int offset = (yy_c_buf_p) - (yytext_ptr);
+- ++(yy_c_buf_p);
+-
+- switch ( yy_get_next_buffer( ) )
+- {
+- case EOB_ACT_LAST_MATCH:
+- /* This happens because yy_g_n_b()
+- * sees that we've accumulated a
+- * token and flags that we need to
+- * try matching the token before
+- * proceeding. But for input(),
+- * there's no matching to consider.
+- * So convert the EOB_ACT_LAST_MATCH
+- * to EOB_ACT_END_OF_FILE.
+- */
+-
+- /* Reset buffer status. */
+- yyrestart(yyin );
+-
+- /*FALLTHROUGH*/
+-
+- case EOB_ACT_END_OF_FILE:
+- {
+- if ( yywrap( ) )
+- return EOF;
+-
+- if ( ! (yy_did_buffer_switch_on_eof) )
+- YY_NEW_FILE;
+-#ifdef __cplusplus
+- return yyinput();
+-#else
+- return input();
+-#endif
+- }
+-
+- case EOB_ACT_CONTINUE_SCAN:
+- (yy_c_buf_p) = (yytext_ptr) + offset;
+- break;
+- }
+- }
+- }
+-
+- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+- *(yy_c_buf_p) = '\0'; /* preserve yytext */
+- (yy_hold_char) = *++(yy_c_buf_p);
+-
+- if ( c == '\n' )
+-
+- yylineno++;
+-;
+-
+- return c;
+-}
+-#endif /* ifndef YY_NO_INPUT */
+-
+-/** Immediately switch to a different input stream.
+- * @param input_file A readable stream.
+- *
+- * @note This function does not reset the start condition to @c INITIAL .
+- */
+- void yyrestart (FILE * input_file )
+-{
+-
+- if ( ! YY_CURRENT_BUFFER ){
+- yyensure_buffer_stack ();
+- YY_CURRENT_BUFFER_LVALUE =
+- yy_create_buffer(yyin,YY_BUF_SIZE );
+- }
+-
+- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+- yy_load_buffer_state( );
+-}
+-
+-/** Switch to a different input buffer.
+- * @param new_buffer The new input buffer.
+- *
+- */
+- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+-{
+-
+- /* TODO. We should be able to replace this entire function body
+- * with
+- * yypop_buffer_state();
+- * yypush_buffer_state(new_buffer);
+- */
+- yyensure_buffer_stack ();
+- if ( YY_CURRENT_BUFFER == new_buffer )
+- return;
+-
+- if ( YY_CURRENT_BUFFER )
+- {
+- /* Flush out information for old buffer. */
+- *(yy_c_buf_p) = (yy_hold_char);
+- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+- }
+-
+- YY_CURRENT_BUFFER_LVALUE = new_buffer;
+- yy_load_buffer_state( );
+-
+- /* We don't actually know whether we did this switch during
+- * EOF (yywrap()) processing, but the only time this flag
+- * is looked at is after yywrap() is called, so it's safe
+- * to go ahead and always set it.
+- */
+- (yy_did_buffer_switch_on_eof) = 1;
+-}
+-
+-static void yy_load_buffer_state (void)
+-{
+- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+- (yy_hold_char) = *(yy_c_buf_p);
+-}
+-
+-/** Allocate and initialize an input buffer state.
+- * @param file A readable stream.
+- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+- *
+- * @return the allocated buffer state.
+- */
+- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
+-{
+- YY_BUFFER_STATE b;
+-
+- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+- if ( ! b )
+- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+-
+- b->yy_buf_size = size;
+-
+- /* yy_ch_buf has to be 2 characters longer than the size given because
+- * we need to put in 2 end-of-buffer characters.
+- */
+- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+- if ( ! b->yy_ch_buf )
+- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+-
+- b->yy_is_our_buffer = 1;
+-
+- yy_init_buffer(b,file );
+-
+- return b;
+-}
+-
+-/** Destroy the buffer.
+- * @param b a buffer created with yy_create_buffer()
+- *
+- */
+- void yy_delete_buffer (YY_BUFFER_STATE b )
+-{
+-
+- if ( ! b )
+- return;
+-
+- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+-
+- if ( b->yy_is_our_buffer )
+- yyfree((void *) b->yy_ch_buf );
+-
+- yyfree((void *) b );
+-}
+-
+-#ifndef __cplusplus
+-extern int isatty (int );
+-#endif /* __cplusplus */
+-
+-/* Initializes or reinitializes a buffer.
+- * This function is sometimes called more than once on the same buffer,
+- * such as during a yyrestart() or at EOF.
+- */
+- static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+-
+-{
+- int oerrno = errno;
+-
+- yy_flush_buffer(b );
+-
+- b->yy_input_file = file;
+- b->yy_fill_buffer = 1;
+-
+- /* If b is the current buffer, then yy_init_buffer was _probably_
+- * called from yyrestart() or through yy_get_next_buffer.
+- * In that case, we don't want to reset the lineno or column.
+- */
+- if (b != YY_CURRENT_BUFFER){
+- b->yy_bs_lineno = 1;
+- b->yy_bs_column = 0;
+- }
+-
+- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+-
+- errno = oerrno;
+-}
+-
+-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+- *
+- */
+- void yy_flush_buffer (YY_BUFFER_STATE b )
+-{
+- if ( ! b )
+- return;
+-
+- b->yy_n_chars = 0;
+-
+- /* We always need two end-of-buffer characters. The first causes
+- * a transition to the end-of-buffer state. The second causes
+- * a jam in that state.
+- */
+- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+-
+- b->yy_buf_pos = &b->yy_ch_buf[0];
+-
+- b->yy_at_bol = 1;
+- b->yy_buffer_status = YY_BUFFER_NEW;
+-
+- if ( b == YY_CURRENT_BUFFER )
+- yy_load_buffer_state( );
+-}
+-
+-/** Pushes the new state onto the stack. The new state becomes
+- * the current state. This function will allocate the stack
+- * if necessary.
+- * @param new_buffer The new state.
+- *
+- */
+-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+-{
+- if (new_buffer == NULL)
+- return;
+-
+- yyensure_buffer_stack();
+-
+- /* This block is copied from yy_switch_to_buffer. */
+- if ( YY_CURRENT_BUFFER )
+- {
+- /* Flush out information for old buffer. */
+- *(yy_c_buf_p) = (yy_hold_char);
+- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+- }
+-
+- /* Only push if top exists. Otherwise, replace top. */
+- if (YY_CURRENT_BUFFER)
+- (yy_buffer_stack_top)++;
+- YY_CURRENT_BUFFER_LVALUE = new_buffer;
+-
+- /* copied from yy_switch_to_buffer. */
+- yy_load_buffer_state( );
+- (yy_did_buffer_switch_on_eof) = 1;
+-}
+-
+-/** Removes and deletes the top of the stack, if present.
+- * The next element becomes the new top.
+- *
+- */
+-void yypop_buffer_state (void)
+-{
+- if (!YY_CURRENT_BUFFER)
+- return;
+-
+- yy_delete_buffer(YY_CURRENT_BUFFER );
+- YY_CURRENT_BUFFER_LVALUE = NULL;
+- if ((yy_buffer_stack_top) > 0)
+- --(yy_buffer_stack_top);
+-
+- if (YY_CURRENT_BUFFER) {
+- yy_load_buffer_state( );
+- (yy_did_buffer_switch_on_eof) = 1;
+- }
+-}
+-
+-/* Allocates the stack if it does not exist.
+- * Guarantees space for at least one push.
+- */
+-static void yyensure_buffer_stack (void)
+-{
+- int num_to_alloc;
+-
+- if (!(yy_buffer_stack)) {
+-
+- /* First allocation is just for 2 elements, since we don't know if this
+- * scanner will even need a stack. We use 2 instead of 1 to avoid an
+- * immediate realloc on the next call.
+- */
+- num_to_alloc = 1;
+- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+- (num_to_alloc * sizeof(struct yy_buffer_state*)
+- );
+- if ( ! (yy_buffer_stack) )
+- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+-
+- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+-
+- (yy_buffer_stack_max) = num_to_alloc;
+- (yy_buffer_stack_top) = 0;
+- return;
+- }
+-
+- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+-
+- /* Increase the buffer to prepare for a possible push. */
+- int grow_size = 8 /* arbitrary grow size */;
+-
+- num_to_alloc = (yy_buffer_stack_max) + grow_size;
+- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+- ((yy_buffer_stack),
+- num_to_alloc * sizeof(struct yy_buffer_state*)
+- );
+- if ( ! (yy_buffer_stack) )
+- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+-
+- /* zero only the new slots.*/
+- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+- (yy_buffer_stack_max) = num_to_alloc;
+- }
+-}
+-
+-/** Setup the input buffer state to scan directly from a user-specified character buffer.
+- * @param base the character buffer
+- * @param size the size in bytes of the character buffer
+- *
+- * @return the newly allocated buffer state object.
+- */
+-YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
+-{
+- YY_BUFFER_STATE b;
+-
+- if ( size < 2 ||
+- base[size-2] != YY_END_OF_BUFFER_CHAR ||
+- base[size-1] != YY_END_OF_BUFFER_CHAR )
+- /* They forgot to leave room for the EOB's. */
+- return 0;
+-
+- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+- if ( ! b )
+- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+-
+- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+- b->yy_buf_pos = b->yy_ch_buf = base;
+- b->yy_is_our_buffer = 0;
+- b->yy_input_file = 0;
+- b->yy_n_chars = b->yy_buf_size;
+- b->yy_is_interactive = 0;
+- b->yy_at_bol = 1;
+- b->yy_fill_buffer = 0;
+- b->yy_buffer_status = YY_BUFFER_NEW;
+-
+- yy_switch_to_buffer(b );
+-
+- return b;
+-}
+-
+-/** Setup the input buffer state to scan a string. The next call to yylex() will
+- * scan from a @e copy of @a str.
+- * @param yystr a NUL-terminated string to scan
+- *
+- * @return the newly allocated buffer state object.
+- * @note If you want to scan bytes that may contain NUL values, then use
+- * yy_scan_bytes() instead.
+- */
+-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+-{
+-
+- return yy_scan_bytes(yystr,strlen(yystr) );
+-}
+-
+-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+- * scan from a @e copy of @a bytes.
+- * @param bytes the byte buffer to scan
+- * @param len the number of bytes in the buffer pointed to by @a bytes.
+- *
+- * @return the newly allocated buffer state object.
+- */
+-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+-{
+- YY_BUFFER_STATE b;
+- char *buf;
+- yy_size_t n;
+- int i;
+-
+- /* Get memory for full buffer, including space for trailing EOB's. */
+- n = _yybytes_len + 2;
+- buf = (char *) yyalloc(n );
+- if ( ! buf )
+- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+-
+- for ( i = 0; i < _yybytes_len; ++i )
+- buf[i] = yybytes[i];
+-
+- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+-
+- b = yy_scan_buffer(buf,n );
+- if ( ! b )
+- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+-
+- /* It's okay to grow etc. this buffer, and we should throw it
+- * away when we're done.
+- */
+- b->yy_is_our_buffer = 1;
+-
+- return b;
+-}
+-
+-#ifndef YY_EXIT_FAILURE
+-#define YY_EXIT_FAILURE 2
+-#endif
+-
+-static void yy_fatal_error (yyconst char* msg )
+-{
+- (void) fprintf( stderr, "%s\n", msg );
+- exit( YY_EXIT_FAILURE );
+-}
+-
+-/* Redefine yyless() so it works in section 3 code. */
+-
+-#undef yyless
+-#define yyless(n) \
+- do \
+- { \
+- /* Undo effects of setting up yytext. */ \
+- int yyless_macro_arg = (n); \
+- YY_LESS_LINENO(yyless_macro_arg);\
+- yytext[yyleng] = (yy_hold_char); \
+- (yy_c_buf_p) = yytext + yyless_macro_arg; \
+- (yy_hold_char) = *(yy_c_buf_p); \
+- *(yy_c_buf_p) = '\0'; \
+- yyleng = yyless_macro_arg; \
+- } \
+- while ( 0 )
+-
+-/* Accessor methods (get/set functions) to struct members. */
+-
+-/** Get the current line number.
+- *
+- */
+-int yyget_lineno (void)
+-{
+-
+- return yylineno;
+-}
+-
+-/** Get the input stream.
+- *
+- */
+-FILE *yyget_in (void)
+-{
+- return yyin;
+-}
+-
+-/** Get the output stream.
+- *
+- */
+-FILE *yyget_out (void)
+-{
+- return yyout;
+-}
+-
+-/** Get the length of the current token.
+- *
+- */
+-int yyget_leng (void)
+-{
+- return yyleng;
+-}
+-
+-/** Get the current token.
+- *
+- */
+-
+-char *yyget_text (void)
+-{
+- return yytext;
+-}
+-
+-/** Set the current line number.
+- * @param line_number
+- *
+- */
+-void yyset_lineno (int line_number )
+-{
+-
+- yylineno = line_number;
+-}
+-
+-/** Set the input stream. This does not discard the current
+- * input buffer.
+- * @param in_str A readable stream.
+- *
+- * @see yy_switch_to_buffer
+- */
+-void yyset_in (FILE * in_str )
+-{
+- yyin = in_str ;
+-}
+-
+-void yyset_out (FILE * out_str )
+-{
+- yyout = out_str ;
+-}
+-
+-int yyget_debug (void)
+-{
+- return yy_flex_debug;
+-}
+-
+-void yyset_debug (int bdebug )
+-{
+- yy_flex_debug = bdebug ;
+-}
+-
+-static int yy_init_globals (void)
+-{
+- /* Initialization is the same as for the non-reentrant scanner.
+- * This function is called from yylex_destroy(), so don't allocate here.
+- */
+-
+- /* We do not touch yylineno unless the option is enabled. */
+- yylineno = 1;
+-
+- (yy_buffer_stack) = 0;
+- (yy_buffer_stack_top) = 0;
+- (yy_buffer_stack_max) = 0;
+- (yy_c_buf_p) = (char *) 0;
+- (yy_init) = 0;
+- (yy_start) = 0;
+-
+-/* Defined in main.c */
+-#ifdef YY_STDINIT
+- yyin = stdin;
+- yyout = stdout;
+-#else
+- yyin = (FILE *) 0;
+- yyout = (FILE *) 0;
+-#endif
+-
+- /* For future reference: Set errno on error, since we are called by
+- * yylex_init()
+- */
+- return 0;
+-}
+-
+-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+-int yylex_destroy (void)
+-{
+-
+- /* Pop the buffer stack, destroying each element. */
+- while(YY_CURRENT_BUFFER){
+- yy_delete_buffer(YY_CURRENT_BUFFER );
+- YY_CURRENT_BUFFER_LVALUE = NULL;
+- yypop_buffer_state();
+- }
+-
+- /* Destroy the stack itself. */
+- yyfree((yy_buffer_stack) );
+- (yy_buffer_stack) = NULL;
+-
+- /* Reset the globals. This is important in a non-reentrant scanner so the next time
+- * yylex() is called, initialization will occur. */
+- yy_init_globals( );
+-
+- return 0;
+-}
+-
+-/*
+- * Internal utility routines.
+- */
+-
+-#ifndef yytext_ptr
+-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+-{
+- register int i;
+- for ( i = 0; i < n; ++i )
+- s1[i] = s2[i];
+-}
+-#endif
+-
+-#ifdef YY_NEED_STRLEN
+-static int yy_flex_strlen (yyconst char * s )
+-{
+- register int n;
+- for ( n = 0; s[n]; ++n )
+- ;
+-
+- return n;
+-}
+-#endif
+-
+-void *yyalloc (yy_size_t size )
+-{
+- return (void *) malloc( size );
+-}
+-
+-void *yyrealloc (void * ptr, yy_size_t size )
+-{
+- /* The cast to (char *) in the following accommodates both
+- * implementations that use char* generic pointers, and those
+- * that use void* generic pointers. It works with the latter
+- * because both ANSI C and C++ allow castless assignment from
+- * any pointer type to void*, and deal with argument conversions
+- * as though doing an assignment.
+- */
+- return (void *) realloc( (char *) ptr, size );
+-}
+-
+-void yyfree (void * ptr )
+-{
+- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+-}
+-
+-#define YYTABLES_NAME "yytables"
+-
+-#line 222 "dtc-lexer.l"
+-
+-
+-
+-
+-/*
+- * Stack of nested include file contexts.
+- */
+-
+-struct incl_file {
+- struct dtc_file *file;
+- YY_BUFFER_STATE yy_prev_buf;
+- int yy_prev_lineno;
+- struct incl_file *prev;
+-};
+-
+-static struct incl_file *incl_file_stack;
+-
+-
+-/*
+- * Detect infinite include recursion.
+- */
+-#define MAX_INCLUDE_DEPTH (100)
+-
+-static int incl_depth = 0;
+-
+-
+-static void push_input_file(const char *filename)
+-{
+- struct incl_file *incl_file;
+- struct dtc_file *newfile;
+- struct search_path search, *searchptr = NULL;
+-
+- assert(filename);
+-
+- if (incl_depth++ >= MAX_INCLUDE_DEPTH)
+- die("Includes nested too deeply");
+-
+- if (srcpos_file) {
+- search.dir = srcpos_file->dir;
+- search.next = NULL;
+- search.prev = NULL;
+- searchptr = &search;
+- }
+-
+- newfile = dtc_open_file(filename, searchptr);
+-
+- incl_file = xmalloc(sizeof(struct incl_file));
+-
+- /*
+- * Save current context.
+- */
+- incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
+- incl_file->yy_prev_lineno = yylineno;
+- incl_file->file = srcpos_file;
+- incl_file->prev = incl_file_stack;
+-
+- incl_file_stack = incl_file;
+-
+- /*
+- * Establish new context.
+- */
+- srcpos_file = newfile;
+- yylineno = 1;
+- yyin = newfile->file;
+- yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
+-}
+-
+-
+-static int pop_input_file(void)
+-{
+- struct incl_file *incl_file;
+-
+- if (incl_file_stack == 0)
+- return 0;
+-
+- dtc_close_file(srcpos_file);
+-
+- /*
+- * Pop.
+- */
+- --incl_depth;
+- incl_file = incl_file_stack;
+- incl_file_stack = incl_file->prev;
+-
+- /*
+- * Recover old context.
+- */
+- yy_delete_buffer(YY_CURRENT_BUFFER);
+- yy_switch_to_buffer(incl_file->yy_prev_buf);
+- yylineno = incl_file->yy_prev_lineno;
+- srcpos_file = incl_file->file;
+- yyin = incl_file->file ? incl_file->file->file : NULL;
+-
+- /*
+- * Free old state.
+- */
+- free(incl_file);
+-
+- return 1;
+-}
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped 1970-01-01 01:00:00.000000000 +0100
+@@ -1,2040 +0,0 @@
+-/* A Bison parser, made by GNU Bison 2.3. */
+-
+-/* Skeleton implementation for Bison's Yacc-like parsers in C
+-
+- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+- Free Software Foundation, Inc.
+-
+- 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, Inc., 51 Franklin Street, Fifth Floor,
+- Boston, MA 02110-1301, USA. */
+-
+-/* As a special exception, you may create a larger work that contains
+- part or all of the Bison parser skeleton and distribute that work
+- under terms of your choice, so long as that work isn't itself a
+- parser generator using the skeleton or a modified version thereof
+- as a parser skeleton. Alternatively, if you modify or redistribute
+- the parser skeleton itself, you may (at your option) remove this
+- special exception, which will cause the skeleton and the resulting
+- Bison output files to be licensed under the GNU General Public
+- License without this special exception.
+-
+- This special exception was added by the Free Software Foundation in
+- version 2.2 of Bison. */
+-
+-/* C LALR(1) parser skeleton written by Richard Stallman, by
+- simplifying the original so-called "semantic" parser. */
+-
+-/* All symbols defined below should begin with yy or YY, to avoid
+- infringing on user name space. This should be done even for local
+- variables, as they might otherwise be expanded by user macros.
+- There are some unavoidable exceptions within include files to
+- define necessary library symbols; they are noted "INFRINGES ON
+- USER NAME SPACE" below. */
+-
+-/* Identify Bison output. */
+-#define YYBISON 1
+-
+-/* Bison version. */
+-#define YYBISON_VERSION "2.3"
+-
+-/* Skeleton name. */
+-#define YYSKELETON_NAME "yacc.c"
+-
+-/* Pure parsers. */
+-#define YYPURE 0
+-
+-/* Using locations. */
+-#define YYLSP_NEEDED 1
+-
+-
+-
+-/* Tokens. */
+-#ifndef YYTOKENTYPE
+-# define YYTOKENTYPE
+- /* Put the tokens into the symbol table, so that GDB and other debuggers
+- know about them. */
+- enum yytokentype {
+- DT_V1 = 258,
+- DT_MEMRESERVE = 259,
+- DT_PROPNODENAME = 260,
+- DT_LITERAL = 261,
+- DT_LEGACYLITERAL = 262,
+- DT_BASE = 263,
+- DT_BYTE = 264,
+- DT_STRING = 265,
+- DT_LABEL = 266,
+- DT_REF = 267,
+- DT_INCBIN = 268
+- };
+-#endif
+-/* Tokens. */
+-#define DT_V1 258
+-#define DT_MEMRESERVE 259
+-#define DT_PROPNODENAME 260
+-#define DT_LITERAL 261
+-#define DT_LEGACYLITERAL 262
+-#define DT_BASE 263
+-#define DT_BYTE 264
+-#define DT_STRING 265
+-#define DT_LABEL 266
+-#define DT_REF 267
+-#define DT_INCBIN 268
+-
+-
+-
+-
+-/* Copy the first part of user declarations. */
+-#line 23 "dtc-parser.y"
+-
+-#include <stdio.h>
+-
+-#include "dtc.h"
+-#include "srcpos.h"
+-
+-extern int yylex(void);
+-
+-extern struct boot_info *the_boot_info;
+-extern int treesource_error;
+-
+-static unsigned long long eval_literal(const char *s, int base, int bits);
+-
+-
+-/* Enabling traces. */
+-#ifndef YYDEBUG
+-# define YYDEBUG 0
+-#endif
+-
+-/* Enabling verbose error messages. */
+-#ifdef YYERROR_VERBOSE
+-# undef YYERROR_VERBOSE
+-# define YYERROR_VERBOSE 1
+-#else
+-# define YYERROR_VERBOSE 0
+-#endif
+-
+-/* Enabling the token table. */
+-#ifndef YYTOKEN_TABLE
+-# define YYTOKEN_TABLE 0
+-#endif
+-
+-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+-typedef union YYSTYPE
+-#line 37 "dtc-parser.y"
+-{
+- char *propnodename;
+- char *literal;
+- char *labelref;
+- unsigned int cbase;
+- uint8_t byte;
+- struct data data;
+-
+- uint64_t addr;
+- cell_t cell;
+- struct property *prop;
+- struct property *proplist;
+- struct node *node;
+- struct node *nodelist;
+- struct reserve_info *re;
+-}
+-/* Line 187 of yacc.c. */
+-#line 153 "dtc-parser.tab.c"
+- YYSTYPE;
+-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+-# define YYSTYPE_IS_DECLARED 1
+-# define YYSTYPE_IS_TRIVIAL 1
+-#endif
+-
+-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+-typedef struct YYLTYPE
+-{
+- int first_line;
+- int first_column;
+- int last_line;
+- int last_column;
+-} YYLTYPE;
+-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+-# define YYLTYPE_IS_DECLARED 1
+-# define YYLTYPE_IS_TRIVIAL 1
+-#endif
+-
+-
+-/* Copy the second part of user declarations. */
+-
+-
+-/* Line 216 of yacc.c. */
+-#line 178 "dtc-parser.tab.c"
+-
+-#ifdef short
+-# undef short
+-#endif
+-
+-#ifdef YYTYPE_UINT8
+-typedef YYTYPE_UINT8 yytype_uint8;
+-#else
+-typedef unsigned char yytype_uint8;
+-#endif
+-
+-#ifdef YYTYPE_INT8
+-typedef YYTYPE_INT8 yytype_int8;
+-#elif (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-typedef signed char yytype_int8;
+-#else
+-typedef short int yytype_int8;
+-#endif
+-
+-#ifdef YYTYPE_UINT16
+-typedef YYTYPE_UINT16 yytype_uint16;
+-#else
+-typedef unsigned short int yytype_uint16;
+-#endif
+-
+-#ifdef YYTYPE_INT16
+-typedef YYTYPE_INT16 yytype_int16;
+-#else
+-typedef short int yytype_int16;
+-#endif
+-
+-#ifndef YYSIZE_T
+-# ifdef __SIZE_TYPE__
+-# define YYSIZE_T __SIZE_TYPE__
+-# elif defined size_t
+-# define YYSIZE_T size_t
+-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+-# define YYSIZE_T size_t
+-# else
+-# define YYSIZE_T unsigned int
+-# endif
+-#endif
+-
+-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+-
+-#ifndef YY_
+-# if YYENABLE_NLS
+-# if ENABLE_NLS
+-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+-# endif
+-# endif
+-# ifndef YY_
+-# define YY_(msgid) msgid
+-# endif
+-#endif
+-
+-/* Suppress unused-variable warnings by "using" E. */
+-#if ! defined lint || defined __GNUC__
+-# define YYUSE(e) ((void) (e))
+-#else
+-# define YYUSE(e) /* empty */
+-#endif
+-
+-/* Identity function, used to suppress warnings about constant conditions. */
+-#ifndef lint
+-# define YYID(n) (n)
+-#else
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static int
+-YYID (int i)
+-#else
+-static int
+-YYID (i)
+- int i;
+-#endif
+-{
+- return i;
+-}
+-#endif
+-
+-#if ! defined yyoverflow || YYERROR_VERBOSE
+-
+-/* The parser invokes alloca or malloc; define the necessary symbols. */
+-
+-# ifdef YYSTACK_USE_ALLOCA
+-# if YYSTACK_USE_ALLOCA
+-# ifdef __GNUC__
+-# define YYSTACK_ALLOC __builtin_alloca
+-# elif defined __BUILTIN_VA_ARG_INCR
+-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+-# elif defined _AIX
+-# define YYSTACK_ALLOC __alloca
+-# elif defined _MSC_VER
+-# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+-# define alloca _alloca
+-# else
+-# define YYSTACK_ALLOC alloca
+-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+-# ifndef _STDLIB_H
+-# define _STDLIB_H 1
+-# endif
+-# endif
+-# endif
+-# endif
+-# endif
+-
+-# ifdef YYSTACK_ALLOC
+- /* Pacify GCC's `empty if-body' warning. */
+-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+-# ifndef YYSTACK_ALLOC_MAXIMUM
+- /* The OS might guarantee only one guard page at the bottom of the stack,
+- and a page size can be as small as 4096 bytes. So we cannot safely
+- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+- to allow for a few compiler-allocated temporary stack slots. */
+-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+-# endif
+-# else
+-# define YYSTACK_ALLOC YYMALLOC
+-# define YYSTACK_FREE YYFREE
+-# ifndef YYSTACK_ALLOC_MAXIMUM
+-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+-# endif
+-# if (defined __cplusplus && ! defined _STDLIB_H \
+- && ! ((defined YYMALLOC || defined malloc) \
+- && (defined YYFREE || defined free)))
+-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+-# ifndef _STDLIB_H
+-# define _STDLIB_H 1
+-# endif
+-# endif
+-# ifndef YYMALLOC
+-# define YYMALLOC malloc
+-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+-# endif
+-# endif
+-# ifndef YYFREE
+-# define YYFREE free
+-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-void free (void *); /* INFRINGES ON USER NAME SPACE */
+-# endif
+-# endif
+-# endif
+-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+-
+-
+-#if (! defined yyoverflow \
+- && (! defined __cplusplus \
+- || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+- && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+-
+-/* A type that is properly aligned for any stack member. */
+-union yyalloc
+-{
+- yytype_int16 yyss;
+- YYSTYPE yyvs;
+- YYLTYPE yyls;
+-};
+-
+-/* The size of the maximum gap between one aligned stack and the next. */
+-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+-
+-/* The size of an array large to enough to hold all stacks, each with
+- N elements. */
+-# define YYSTACK_BYTES(N) \
+- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+- + 2 * YYSTACK_GAP_MAXIMUM)
+-
+-/* Copy COUNT objects from FROM to TO. The source and destination do
+- not overlap. */
+-# ifndef YYCOPY
+-# if defined __GNUC__ && 1 < __GNUC__
+-# define YYCOPY(To, From, Count) \
+- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+-# else
+-# define YYCOPY(To, From, Count) \
+- do \
+- { \
+- YYSIZE_T yyi; \
+- for (yyi = 0; yyi < (Count); yyi++) \
+- (To)[yyi] = (From)[yyi]; \
+- } \
+- while (YYID (0))
+-# endif
+-# endif
+-
+-/* Relocate STACK from its old location to the new one. The
+- local variables YYSIZE and YYSTACKSIZE give the old and new number of
+- elements in the stack, and YYPTR gives the new location of the
+- stack. Advance YYPTR to a properly aligned location for the next
+- stack. */
+-# define YYSTACK_RELOCATE(Stack) \
+- do \
+- { \
+- YYSIZE_T yynewbytes; \
+- YYCOPY (&yyptr->Stack, Stack, yysize); \
+- Stack = &yyptr->Stack; \
+- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+- yyptr += yynewbytes / sizeof (*yyptr); \
+- } \
+- while (YYID (0))
+-
+-#endif
+-
+-/* YYFINAL -- State number of the termination state. */
+-#define YYFINAL 9
+-/* YYLAST -- Last index in YYTABLE. */
+-#define YYLAST 73
+-
+-/* YYNTOKENS -- Number of terminals. */
+-#define YYNTOKENS 27
+-/* YYNNTS -- Number of nonterminals. */
+-#define YYNNTS 20
+-/* YYNRULES -- Number of rules. */
+-#define YYNRULES 45
+-/* YYNRULES -- Number of states. */
+-#define YYNSTATES 76
+-
+-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+-#define YYUNDEFTOK 2
+-#define YYMAXUTOK 268
+-
+-#define YYTRANSLATE(YYX) \
+- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+-
+-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+-static const yytype_uint8 yytranslate[] =
+-{
+- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 24, 26, 2, 2, 25, 15, 2, 16, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 14,
+- 20, 19, 21, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 22, 2, 23, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 17, 2, 18, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+- 5, 6, 7, 8, 9, 10, 11, 12, 13
+-};
+-
+-#if YYDEBUG
+-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+- YYRHS. */
+-static const yytype_uint8 yyprhs[] =
+-{
+- 0, 0, 3, 8, 11, 12, 15, 21, 22, 25,
+- 27, 34, 36, 38, 41, 47, 48, 51, 57, 61,
+- 64, 69, 74, 77, 87, 93, 96, 97, 100, 103,
+- 104, 107, 110, 113, 114, 116, 118, 121, 122, 125,
+- 128, 129, 132, 135, 139, 140
+-};
+-
+-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+-static const yytype_int8 yyrhs[] =
+-{
+- 28, 0, -1, 3, 14, 29, 34, -1, 31, 34,
+- -1, -1, 30, 29, -1, 46, 4, 33, 33, 14,
+- -1, -1, 32, 31, -1, 30, -1, 46, 4, 33,
+- 15, 33, 14, -1, 6, -1, 7, -1, 16, 35,
+- -1, 17, 36, 44, 18, 14, -1, -1, 36, 37,
+- -1, 46, 5, 19, 38, 14, -1, 46, 5, 14,
+- -1, 39, 10, -1, 39, 20, 40, 21, -1, 39,
+- 22, 43, 23, -1, 39, 12, -1, 39, 13, 24,
+- 10, 25, 33, 25, 33, 26, -1, 39, 13, 24,
+- 10, 26, -1, 38, 11, -1, -1, 38, 25, -1,
+- 39, 11, -1, -1, 40, 42, -1, 40, 12, -1,
+- 40, 11, -1, -1, 8, -1, 6, -1, 41, 7,
+- -1, -1, 43, 9, -1, 43, 11, -1, -1, 45,
+- 44, -1, 45, 37, -1, 46, 5, 35, -1, -1,
+- 11, -1
+-};
+-
+-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+-static const yytype_uint16 yyrline[] =
+-{
+- 0, 89, 89, 93, 101, 104, 111, 119, 122, 129,
+- 133, 140, 144, 151, 158, 166, 169, 176, 180, 187,
+- 191, 195, 199, 203, 220, 231, 239, 242, 246, 254,
+- 257, 261, 266, 274, 277, 281, 285, 293, 296, 300,
+- 308, 311, 315, 323, 331, 334
+-};
+-#endif
+-
+-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+-static const char *const yytname[] =
+-{
+- "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
+- "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
+- "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'-'",
+- "'/'", "'{'", "'}'", "'='", "'<'", "'>'", "'['", "']'", "'('", "','",
+- "')'", "$accept", "sourcefile", "memreserves", "memreserve",
+- "v0_memreserves", "v0_memreserve", "addr", "devicetree", "nodedef",
+- "proplist", "propdef", "propdata", "propdataprefix", "celllist",
+- "cellbase", "cellval", "bytestring", "subnodes", "subnode", "label", 0
+-};
+-#endif
+-
+-# ifdef YYPRINT
+-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+- token YYLEX-NUM. */
+-static const yytype_uint16 yytoknum[] =
+-{
+- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+- 265, 266, 267, 268, 59, 45, 47, 123, 125, 61,
+- 60, 62, 91, 93, 40, 44, 41
+-};
+-# endif
+-
+-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+-static const yytype_uint8 yyr1[] =
+-{
+- 0, 27, 28, 28, 29, 29, 30, 31, 31, 32,
+- 32, 33, 33, 34, 35, 36, 36, 37, 37, 38,
+- 38, 38, 38, 38, 38, 38, 39, 39, 39, 40,
+- 40, 40, 40, 41, 41, 42, 42, 43, 43, 43,
+- 44, 44, 44, 45, 46, 46
+-};
+-
+-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+-static const yytype_uint8 yyr2[] =
+-{
+- 0, 2, 4, 2, 0, 2, 5, 0, 2, 1,
+- 6, 1, 1, 2, 5, 0, 2, 5, 3, 2,
+- 4, 4, 2, 9, 5, 2, 0, 2, 2, 0,
+- 2, 2, 2, 0, 1, 1, 2, 0, 2, 2,
+- 0, 2, 2, 3, 0, 1
+-};
+-
+-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+- means the default is an error. */
+-static const yytype_uint8 yydefact[] =
+-{
+- 7, 0, 45, 0, 9, 0, 7, 0, 4, 1,
+- 0, 3, 8, 0, 0, 4, 0, 15, 13, 11,
+- 12, 0, 2, 5, 0, 40, 0, 0, 0, 16,
+- 0, 40, 0, 0, 6, 0, 42, 41, 0, 10,
+- 14, 18, 26, 43, 0, 0, 25, 17, 27, 19,
+- 28, 22, 0, 29, 37, 0, 33, 0, 0, 35,
+- 34, 32, 31, 20, 0, 30, 38, 39, 21, 0,
+- 24, 36, 0, 0, 0, 23
+-};
+-
+-/* YYDEFGOTO[NTERM-NUM]. */
+-static const yytype_int8 yydefgoto[] =
+-{
+- -1, 3, 14, 4, 5, 6, 27, 11, 18, 25,
+- 29, 44, 45, 56, 64, 65, 57, 30, 31, 7
+-};
+-
+-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+- STATE-NUM. */
+-#define YYPACT_NINF -14
+-static const yytype_int8 yypact[] =
+-{
+- 30, -11, -14, 7, -14, -1, 27, 13, 27, -14,
+- 8, -14, -14, 40, -1, 27, 35, -14, -14, -14,
+- -14, 21, -14, -14, 40, 24, 40, 28, 40, -14,
+- 32, 24, 46, 38, -14, 39, -14, -14, 26, -14,
+- -14, -14, -14, -14, -9, 10, -14, -14, -14, -14,
+- -14, -14, 31, -14, -14, 44, -2, 3, 23, -14,
+- -14, -14, -14, -14, 50, -14, -14, -14, -14, 40,
+- -14, -14, 33, 40, 36, -14
+-};
+-
+-/* YYPGOTO[NTERM-NUM]. */
+-static const yytype_int8 yypgoto[] =
+-{
+- -14, -14, 48, 29, 53, -14, -13, 47, 34, -14,
+- 37, -14, -14, -14, -14, -14, -14, 42, -14, -7
+-};
+-
+-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+- positive, shift that token. If negative, reduce the rule which
+- number is the opposite. If zero, do what YYDEFACT says.
+- If YYTABLE_NINF, syntax error. */
+-#define YYTABLE_NINF -45
+-static const yytype_int8 yytable[] =
+-{
+- 21, 16, 46, 8, 59, 47, 60, 9, 16, 61,
+- 62, 28, 66, 33, 67, 10, 48, 13, 32, 63,
+- 49, 50, 51, 52, 32, 17, 68, 19, 20, -44,
+- 53, -44, 54, 1, -44, 2, 26, 15, 2, 24,
+- 41, 2, 34, 17, 15, 42, 19, 20, 69, 70,
+- 35, 38, 39, 40, 58, 55, 72, 71, 73, 12,
+- 74, 22, 75, 23, 0, 0, 0, 0, 36, 0,
+- 0, 0, 43, 37
+-};
+-
+-static const yytype_int8 yycheck[] =
+-{
+- 13, 8, 11, 14, 6, 14, 8, 0, 15, 11,
+- 12, 24, 9, 26, 11, 16, 25, 4, 25, 21,
+- 10, 11, 12, 13, 31, 17, 23, 6, 7, 5,
+- 20, 4, 22, 3, 4, 11, 15, 8, 11, 4,
+- 14, 11, 14, 17, 15, 19, 6, 7, 25, 26,
+- 18, 5, 14, 14, 10, 24, 69, 7, 25, 6,
+- 73, 14, 26, 15, -1, -1, -1, -1, 31, -1,
+- -1, -1, 38, 31
+-};
+-
+-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+- symbol of state STATE-NUM. */
+-static const yytype_uint8 yystos[] =
+-{
+- 0, 3, 11, 28, 30, 31, 32, 46, 14, 0,
+- 16, 34, 31, 4, 29, 30, 46, 17, 35, 6,
+- 7, 33, 34, 29, 4, 36, 15, 33, 33, 37,
+- 44, 45, 46, 33, 14, 18, 37, 44, 5, 14,
+- 14, 14, 19, 35, 38, 39, 11, 14, 25, 10,
+- 11, 12, 13, 20, 22, 24, 40, 43, 10, 6,
+- 8, 11, 12, 21, 41, 42, 9, 11, 23, 25,
+- 26, 7, 33, 25, 33, 26
+-};
+-
+-#define yyerrok (yyerrstatus = 0)
+-#define yyclearin (yychar = YYEMPTY)
+-#define YYEMPTY (-2)
+-#define YYEOF 0
+-
+-#define YYACCEPT goto yyacceptlab
+-#define YYABORT goto yyabortlab
+-#define YYERROR goto yyerrorlab
+-
+-
+-/* Like YYERROR except do call yyerror. This remains here temporarily
+- to ease the transition to the new meaning of YYERROR, for GCC.
+- Once GCC version 2 has supplanted version 1, this can go. */
+-
+-#define YYFAIL goto yyerrlab
+-
+-#define YYRECOVERING() (!!yyerrstatus)
+-
+-#define YYBACKUP(Token, Value) \
+-do \
+- if (yychar == YYEMPTY && yylen == 1) \
+- { \
+- yychar = (Token); \
+- yylval = (Value); \
+- yytoken = YYTRANSLATE (yychar); \
+- YYPOPSTACK (1); \
+- goto yybackup; \
+- } \
+- else \
+- { \
+- yyerror (YY_("syntax error: cannot back up")); \
+- YYERROR; \
+- } \
+-while (YYID (0))
+-
+-
+-#define YYTERROR 1
+-#define YYERRCODE 256
+-
+-
+-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+- If N is 0, then set CURRENT to the empty location which ends
+- the previous symbol: RHS[0] (always defined). */
+-
+-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+-#ifndef YYLLOC_DEFAULT
+-# define YYLLOC_DEFAULT(Current, Rhs, N) \
+- do \
+- if (YYID (N)) \
+- { \
+- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+- } \
+- else \
+- { \
+- (Current).first_line = (Current).last_line = \
+- YYRHSLOC (Rhs, 0).last_line; \
+- (Current).first_column = (Current).last_column = \
+- YYRHSLOC (Rhs, 0).last_column; \
+- } \
+- while (YYID (0))
+-#endif
+-
+-
+-/* YY_LOCATION_PRINT -- Print the location on the stream.
+- This macro was not mandated originally: define only if we know
+- we won't break user code: when these are the locations we know. */
+-
+-#ifndef YY_LOCATION_PRINT
+-# if YYLTYPE_IS_TRIVIAL
+-# define YY_LOCATION_PRINT(File, Loc) \
+- fprintf (File, "%d.%d-%d.%d", \
+- (Loc).first_line, (Loc).first_column, \
+- (Loc).last_line, (Loc).last_column)
+-# else
+-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+-# endif
+-#endif
+-
+-
+-/* YYLEX -- calling `yylex' with the right arguments. */
+-
+-#ifdef YYLEX_PARAM
+-# define YYLEX yylex (YYLEX_PARAM)
+-#else
+-# define YYLEX yylex ()
+-#endif
+-
+-/* Enable debugging if requested. */
+-#if YYDEBUG
+-
+-# ifndef YYFPRINTF
+-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+-# define YYFPRINTF fprintf
+-# endif
+-
+-# define YYDPRINTF(Args) \
+-do { \
+- if (yydebug) \
+- YYFPRINTF Args; \
+-} while (YYID (0))
+-
+-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+-do { \
+- if (yydebug) \
+- { \
+- YYFPRINTF (stderr, "%s ", Title); \
+- yy_symbol_print (stderr, \
+- Type, Value, Location); \
+- YYFPRINTF (stderr, "\n"); \
+- } \
+-} while (YYID (0))
+-
+-
+-/*--------------------------------.
+-| Print this symbol on YYOUTPUT. |
+-`--------------------------------*/
+-
+-/*ARGSUSED*/
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static void
+-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
+-#else
+-static void
+-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
+- FILE *yyoutput;
+- int yytype;
+- YYSTYPE const * const yyvaluep;
+- YYLTYPE const * const yylocationp;
+-#endif
+-{
+- if (!yyvaluep)
+- return;
+- YYUSE (yylocationp);
+-# ifdef YYPRINT
+- if (yytype < YYNTOKENS)
+- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+-# else
+- YYUSE (yyoutput);
+-# endif
+- switch (yytype)
+- {
+- default:
+- break;
+- }
+-}
+-
+-
+-/*--------------------------------.
+-| Print this symbol on YYOUTPUT. |
+-`--------------------------------*/
+-
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static void
+-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
+-#else
+-static void
+-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
+- FILE *yyoutput;
+- int yytype;
+- YYSTYPE const * const yyvaluep;
+- YYLTYPE const * const yylocationp;
+-#endif
+-{
+- if (yytype < YYNTOKENS)
+- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+- else
+- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+-
+- YY_LOCATION_PRINT (yyoutput, *yylocationp);
+- YYFPRINTF (yyoutput, ": ");
+- yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
+- YYFPRINTF (yyoutput, ")");
+-}
+-
+-/*------------------------------------------------------------------.
+-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+-| TOP (included). |
+-`------------------------------------------------------------------*/
+-
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static void
+-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+-#else
+-static void
+-yy_stack_print (bottom, top)
+- yytype_int16 *bottom;
+- yytype_int16 *top;
+-#endif
+-{
+- YYFPRINTF (stderr, "Stack now");
+- for (; bottom <= top; ++bottom)
+- YYFPRINTF (stderr, " %d", *bottom);
+- YYFPRINTF (stderr, "\n");
+-}
+-
+-# define YY_STACK_PRINT(Bottom, Top) \
+-do { \
+- if (yydebug) \
+- yy_stack_print ((Bottom), (Top)); \
+-} while (YYID (0))
+-
+-
+-/*------------------------------------------------.
+-| Report that the YYRULE is going to be reduced. |
+-`------------------------------------------------*/
+-
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static void
+-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
+-#else
+-static void
+-yy_reduce_print (yyvsp, yylsp, yyrule)
+- YYSTYPE *yyvsp;
+- YYLTYPE *yylsp;
+- int yyrule;
+-#endif
+-{
+- int yynrhs = yyr2[yyrule];
+- int yyi;
+- unsigned long int yylno = yyrline[yyrule];
+- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+- yyrule - 1, yylno);
+- /* The symbols being reduced. */
+- for (yyi = 0; yyi < yynrhs; yyi++)
+- {
+- fprintf (stderr, " $%d = ", yyi + 1);
+- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+- &(yyvsp[(yyi + 1) - (yynrhs)])
+- , &(yylsp[(yyi + 1) - (yynrhs)]) );
+- fprintf (stderr, "\n");
+- }
+-}
+-
+-# define YY_REDUCE_PRINT(Rule) \
+-do { \
+- if (yydebug) \
+- yy_reduce_print (yyvsp, yylsp, Rule); \
+-} while (YYID (0))
+-
+-/* Nonzero means print parse trace. It is left uninitialized so that
+- multiple parsers can coexist. */
+-int yydebug;
+-#else /* !YYDEBUG */
+-# define YYDPRINTF(Args)
+-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+-# define YY_STACK_PRINT(Bottom, Top)
+-# define YY_REDUCE_PRINT(Rule)
+-#endif /* !YYDEBUG */
+-
+-
+-/* YYINITDEPTH -- initial size of the parser's stacks. */
+-#ifndef YYINITDEPTH
+-# define YYINITDEPTH 200
+-#endif
+-
+-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+- if the built-in stack extension method is used).
+-
+- Do not make this value too large; the results are undefined if
+- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+- evaluated with infinite-precision integer arithmetic. */
+-
+-#ifndef YYMAXDEPTH
+-# define YYMAXDEPTH 10000
+-#endif
+-
+-
+-
+-#if YYERROR_VERBOSE
+-
+-# ifndef yystrlen
+-# if defined __GLIBC__ && defined _STRING_H
+-# define yystrlen strlen
+-# else
+-/* Return the length of YYSTR. */
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static YYSIZE_T
+-yystrlen (const char *yystr)
+-#else
+-static YYSIZE_T
+-yystrlen (yystr)
+- const char *yystr;
+-#endif
+-{
+- YYSIZE_T yylen;
+- for (yylen = 0; yystr[yylen]; yylen++)
+- continue;
+- return yylen;
+-}
+-# endif
+-# endif
+-
+-# ifndef yystpcpy
+-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+-# define yystpcpy stpcpy
+-# else
+-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+- YYDEST. */
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static char *
+-yystpcpy (char *yydest, const char *yysrc)
+-#else
+-static char *
+-yystpcpy (yydest, yysrc)
+- char *yydest;
+- const char *yysrc;
+-#endif
+-{
+- char *yyd = yydest;
+- const char *yys = yysrc;
+-
+- while ((*yyd++ = *yys++) != '\0')
+- continue;
+-
+- return yyd - 1;
+-}
+-# endif
+-# endif
+-
+-# ifndef yytnamerr
+-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+- quotes and backslashes, so that it's suitable for yyerror. The
+- heuristic is that double-quoting is unnecessary unless the string
+- contains an apostrophe, a comma, or backslash (other than
+- backslash-backslash). YYSTR is taken from yytname. If YYRES is
+- null, do not copy; instead, return the length of what the result
+- would have been. */
+-static YYSIZE_T
+-yytnamerr (char *yyres, const char *yystr)
+-{
+- if (*yystr == '"')
+- {
+- YYSIZE_T yyn = 0;
+- char const *yyp = yystr;
+-
+- for (;;)
+- switch (*++yyp)
+- {
+- case '\'':
+- case ',':
+- goto do_not_strip_quotes;
+-
+- case '\\':
+- if (*++yyp != '\\')
+- goto do_not_strip_quotes;
+- /* Fall through. */
+- default:
+- if (yyres)
+- yyres[yyn] = *yyp;
+- yyn++;
+- break;
+-
+- case '"':
+- if (yyres)
+- yyres[yyn] = '\0';
+- return yyn;
+- }
+- do_not_strip_quotes: ;
+- }
+-
+- if (! yyres)
+- return yystrlen (yystr);
+-
+- return yystpcpy (yyres, yystr) - yyres;
+-}
+-# endif
+-
+-/* Copy into YYRESULT an error message about the unexpected token
+- YYCHAR while in state YYSTATE. Return the number of bytes copied,
+- including the terminating null byte. If YYRESULT is null, do not
+- copy anything; just return the number of bytes that would be
+- copied. As a special case, return 0 if an ordinary "syntax error"
+- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+- size calculation. */
+-static YYSIZE_T
+-yysyntax_error (char *yyresult, int yystate, int yychar)
+-{
+- int yyn = yypact[yystate];
+-
+- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+- return 0;
+- else
+- {
+- int yytype = YYTRANSLATE (yychar);
+- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+- YYSIZE_T yysize = yysize0;
+- YYSIZE_T yysize1;
+- int yysize_overflow = 0;
+- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+- int yyx;
+-
+-# if 0
+- /* This is so xgettext sees the translatable formats that are
+- constructed on the fly. */
+- YY_("syntax error, unexpected %s");
+- YY_("syntax error, unexpected %s, expecting %s");
+- YY_("syntax error, unexpected %s, expecting %s or %s");
+- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+-# endif
+- char *yyfmt;
+- char const *yyf;
+- static char const yyunexpected[] = "syntax error, unexpected %s";
+- static char const yyexpecting[] = ", expecting %s";
+- static char const yyor[] = " or %s";
+- char yyformat[sizeof yyunexpected
+- + sizeof yyexpecting - 1
+- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+- * (sizeof yyor - 1))];
+- char const *yyprefix = yyexpecting;
+-
+- /* Start YYX at -YYN if negative to avoid negative indexes in
+- YYCHECK. */
+- int yyxbegin = yyn < 0 ? -yyn : 0;
+-
+- /* Stay within bounds of both yycheck and yytname. */
+- int yychecklim = YYLAST - yyn + 1;
+- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+- int yycount = 1;
+-
+- yyarg[0] = yytname[yytype];
+- yyfmt = yystpcpy (yyformat, yyunexpected);
+-
+- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+- {
+- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+- {
+- yycount = 1;
+- yysize = yysize0;
+- yyformat[sizeof yyunexpected - 1] = '\0';
+- break;
+- }
+- yyarg[yycount++] = yytname[yyx];
+- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+- yysize_overflow |= (yysize1 < yysize);
+- yysize = yysize1;
+- yyfmt = yystpcpy (yyfmt, yyprefix);
+- yyprefix = yyor;
+- }
+-
+- yyf = YY_(yyformat);
+- yysize1 = yysize + yystrlen (yyf);
+- yysize_overflow |= (yysize1 < yysize);
+- yysize = yysize1;
+-
+- if (yysize_overflow)
+- return YYSIZE_MAXIMUM;
+-
+- if (yyresult)
+- {
+- /* Avoid sprintf, as that infringes on the user's name space.
+- Don't have undefined behavior even if the translation
+- produced a string with the wrong number of "%s"s. */
+- char *yyp = yyresult;
+- int yyi = 0;
+- while ((*yyp = *yyf) != '\0')
+- {
+- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+- {
+- yyp += yytnamerr (yyp, yyarg[yyi++]);
+- yyf += 2;
+- }
+- else
+- {
+- yyp++;
+- yyf++;
+- }
+- }
+- }
+- return yysize;
+- }
+-}
+-#endif /* YYERROR_VERBOSE */
+-
+-
+-/*-----------------------------------------------.
+-| Release the memory associated to this symbol. |
+-`-----------------------------------------------*/
+-
+-/*ARGSUSED*/
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-static void
+-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
+-#else
+-static void
+-yydestruct (yymsg, yytype, yyvaluep, yylocationp)
+- const char *yymsg;
+- int yytype;
+- YYSTYPE *yyvaluep;
+- YYLTYPE *yylocationp;
+-#endif
+-{
+- YYUSE (yyvaluep);
+- YYUSE (yylocationp);
+-
+- if (!yymsg)
+- yymsg = "Deleting";
+- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+-
+- switch (yytype)
+- {
+-
+- default:
+- break;
+- }
+-}
+-
+-
+-/* Prevent warnings from -Wmissing-prototypes. */
+-
+-#ifdef YYPARSE_PARAM
+-#if defined __STDC__ || defined __cplusplus
+-int yyparse (void *YYPARSE_PARAM);
+-#else
+-int yyparse ();
+-#endif
+-#else /* ! YYPARSE_PARAM */
+-#if defined __STDC__ || defined __cplusplus
+-int yyparse (void);
+-#else
+-int yyparse ();
+-#endif
+-#endif /* ! YYPARSE_PARAM */
+-
+-
+-
+-/* The look-ahead symbol. */
+-int yychar;
+-
+-/* The semantic value of the look-ahead symbol. */
+-YYSTYPE yylval;
+-
+-/* Number of syntax errors so far. */
+-int yynerrs;
+-/* Location data for the look-ahead symbol. */
+-YYLTYPE yylloc;
+-
+-
+-
+-/*----------.
+-| yyparse. |
+-`----------*/
+-
+-#ifdef YYPARSE_PARAM
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-int
+-yyparse (void *YYPARSE_PARAM)
+-#else
+-int
+-yyparse (YYPARSE_PARAM)
+- void *YYPARSE_PARAM;
+-#endif
+-#else /* ! YYPARSE_PARAM */
+-#if (defined __STDC__ || defined __C99__FUNC__ \
+- || defined __cplusplus || defined _MSC_VER)
+-int
+-yyparse (void)
+-#else
+-int
+-yyparse ()
+-
+-#endif
+-#endif
+-{
+-
+- int yystate;
+- int yyn;
+- int yyresult;
+- /* Number of tokens to shift before error messages enabled. */
+- int yyerrstatus;
+- /* Look-ahead token as an internal (translated) token number. */
+- int yytoken = 0;
+-#if YYERROR_VERBOSE
+- /* Buffer for error messages, and its allocated size. */
+- char yymsgbuf[128];
+- char *yymsg = yymsgbuf;
+- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+-#endif
+-
+- /* Three stacks and their tools:
+- `yyss': related to states,
+- `yyvs': related to semantic values,
+- `yyls': related to locations.
+-
+- Refer to the stacks thru separate pointers, to allow yyoverflow
+- to reallocate them elsewhere. */
+-
+- /* The state stack. */
+- yytype_int16 yyssa[YYINITDEPTH];
+- yytype_int16 *yyss = yyssa;
+- yytype_int16 *yyssp;
+-
+- /* The semantic value stack. */
+- YYSTYPE yyvsa[YYINITDEPTH];
+- YYSTYPE *yyvs = yyvsa;
+- YYSTYPE *yyvsp;
+-
+- /* The location stack. */
+- YYLTYPE yylsa[YYINITDEPTH];
+- YYLTYPE *yyls = yylsa;
+- YYLTYPE *yylsp;
+- /* The locations where the error started and ended. */
+- YYLTYPE yyerror_range[2];
+-
+-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
+-
+- YYSIZE_T yystacksize = YYINITDEPTH;
+-
+- /* The variables used to return semantic value and location from the
+- action routines. */
+- YYSTYPE yyval;
+- YYLTYPE yyloc;
+-
+- /* The number of symbols on the RHS of the reduced rule.
+- Keep to zero when no symbol should be popped. */
+- int yylen = 0;
+-
+- YYDPRINTF ((stderr, "Starting parse\n"));
+-
+- yystate = 0;
+- yyerrstatus = 0;
+- yynerrs = 0;
+- yychar = YYEMPTY; /* Cause a token to be read. */
+-
+- /* Initialize stack pointers.
+- Waste one element of value and location stack
+- so that they stay on the same level as the state stack.
+- The wasted elements are never initialized. */
+-
+- yyssp = yyss;
+- yyvsp = yyvs;
+- yylsp = yyls;
+-#if YYLTYPE_IS_TRIVIAL
+- /* Initialize the default location before parsing starts. */
+- yylloc.first_line = yylloc.last_line = 1;
+- yylloc.first_column = yylloc.last_column = 0;
+-#endif
+-
+- goto yysetstate;
+-
+-/*------------------------------------------------------------.
+-| yynewstate -- Push a new state, which is found in yystate. |
+-`------------------------------------------------------------*/
+- yynewstate:
+- /* In all cases, when you get here, the value and location stacks
+- have just been pushed. So pushing a state here evens the stacks. */
+- yyssp++;
+-
+- yysetstate:
+- *yyssp = yystate;
+-
+- if (yyss + yystacksize - 1 <= yyssp)
+- {
+- /* Get the current used size of the three stacks, in elements. */
+- YYSIZE_T yysize = yyssp - yyss + 1;
+-
+-#ifdef yyoverflow
+- {
+- /* Give user a chance to reallocate the stack. Use copies of
+- these so that the &'s don't force the real ones into
+- memory. */
+- YYSTYPE *yyvs1 = yyvs;
+- yytype_int16 *yyss1 = yyss;
+- YYLTYPE *yyls1 = yyls;
+-
+- /* Each stack pointer address is followed by the size of the
+- data in use in that stack, in bytes. This used to be a
+- conditional around just the two extra args, but that might
+- be undefined if yyoverflow is a macro. */
+- yyoverflow (YY_("memory exhausted"),
+- &yyss1, yysize * sizeof (*yyssp),
+- &yyvs1, yysize * sizeof (*yyvsp),
+- &yyls1, yysize * sizeof (*yylsp),
+- &yystacksize);
+- yyls = yyls1;
+- yyss = yyss1;
+- yyvs = yyvs1;
+- }
+-#else /* no yyoverflow */
+-# ifndef YYSTACK_RELOCATE
+- goto yyexhaustedlab;
+-# else
+- /* Extend the stack our own way. */
+- if (YYMAXDEPTH <= yystacksize)
+- goto yyexhaustedlab;
+- yystacksize *= 2;
+- if (YYMAXDEPTH < yystacksize)
+- yystacksize = YYMAXDEPTH;
+-
+- {
+- yytype_int16 *yyss1 = yyss;
+- union yyalloc *yyptr =
+- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+- if (! yyptr)
+- goto yyexhaustedlab;
+- YYSTACK_RELOCATE (yyss);
+- YYSTACK_RELOCATE (yyvs);
+- YYSTACK_RELOCATE (yyls);
+-# undef YYSTACK_RELOCATE
+- if (yyss1 != yyssa)
+- YYSTACK_FREE (yyss1);
+- }
+-# endif
+-#endif /* no yyoverflow */
+-
+- yyssp = yyss + yysize - 1;
+- yyvsp = yyvs + yysize - 1;
+- yylsp = yyls + yysize - 1;
+-
+- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+- (unsigned long int) yystacksize));
+-
+- if (yyss + yystacksize - 1 <= yyssp)
+- YYABORT;
+- }
+-
+- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+-
+- goto yybackup;
+-
+-/*-----------.
+-| yybackup. |
+-`-----------*/
+-yybackup:
+-
+- /* Do appropriate processing given the current state. Read a
+- look-ahead token if we need one and don't already have one. */
+-
+- /* First try to decide what to do without reference to look-ahead token. */
+- yyn = yypact[yystate];
+- if (yyn == YYPACT_NINF)
+- goto yydefault;
+-
+- /* Not known => get a look-ahead token if don't already have one. */
+-
+- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+- if (yychar == YYEMPTY)
+- {
+- YYDPRINTF ((stderr, "Reading a token: "));
+- yychar = YYLEX;
+- }
+-
+- if (yychar <= YYEOF)
+- {
+- yychar = yytoken = YYEOF;
+- YYDPRINTF ((stderr, "Now at end of input.\n"));
+- }
+- else
+- {
+- yytoken = YYTRANSLATE (yychar);
+- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+- }
+-
+- /* If the proper action on seeing token YYTOKEN is to reduce or to
+- detect an error, take that action. */
+- yyn += yytoken;
+- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+- goto yydefault;
+- yyn = yytable[yyn];
+- if (yyn <= 0)
+- {
+- if (yyn == 0 || yyn == YYTABLE_NINF)
+- goto yyerrlab;
+- yyn = -yyn;
+- goto yyreduce;
+- }
+-
+- if (yyn == YYFINAL)
+- YYACCEPT;
+-
+- /* Count tokens shifted since error; after three, turn off error
+- status. */
+- if (yyerrstatus)
+- yyerrstatus--;
+-
+- /* Shift the look-ahead token. */
+- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+-
+- /* Discard the shifted token unless it is eof. */
+- if (yychar != YYEOF)
+- yychar = YYEMPTY;
+-
+- yystate = yyn;
+- *++yyvsp = yylval;
+- *++yylsp = yylloc;
+- goto yynewstate;
+-
+-
+-/*-----------------------------------------------------------.
+-| yydefault -- do the default action for the current state. |
+-`-----------------------------------------------------------*/
+-yydefault:
+- yyn = yydefact[yystate];
+- if (yyn == 0)
+- goto yyerrlab;
+- goto yyreduce;
+-
+-
+-/*-----------------------------.
+-| yyreduce -- Do a reduction. |
+-`-----------------------------*/
+-yyreduce:
+- /* yyn is the number of a rule to reduce with. */
+- yylen = yyr2[yyn];
+-
+- /* If YYLEN is nonzero, implement the default value of the action:
+- `$$ = $1'.
+-
+- Otherwise, the following line sets YYVAL to garbage.
+- This behavior is undocumented and Bison
+- users should not rely upon it. Assigning to YYVAL
+- unconditionally makes the parser a bit smaller, and it avoids a
+- GCC warning that YYVAL may be used uninitialized. */
+- yyval = yyvsp[1-yylen];
+-
+- /* Default location. */
+- YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+- YY_REDUCE_PRINT (yyn);
+- switch (yyn)
+- {
+- case 2:
+-#line 90 "dtc-parser.y"
+- {
+- the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), 0);
+- ;}
+- break;
+-
+- case 3:
+-#line 94 "dtc-parser.y"
+- {
+- the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node), 0);
+- ;}
+- break;
+-
+- case 4:
+-#line 101 "dtc-parser.y"
+- {
+- (yyval.re) = NULL;
+- ;}
+- break;
+-
+- case 5:
+-#line 105 "dtc-parser.y"
+- {
+- (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
+- ;}
+- break;
+-
+- case 6:
+-#line 112 "dtc-parser.y"
+- {
+- (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
+- ;}
+- break;
+-
+- case 7:
+-#line 119 "dtc-parser.y"
+- {
+- (yyval.re) = NULL;
+- ;}
+- break;
+-
+- case 8:
+-#line 123 "dtc-parser.y"
+- {
+- (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
+- ;}
+- break;
+-
+- case 9:
+-#line 130 "dtc-parser.y"
+- {
+- (yyval.re) = (yyvsp[(1) - (1)].re);
+- ;}
+- break;
+-
+- case 10:
+-#line 134 "dtc-parser.y"
+- {
+- (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
+- ;}
+- break;
+-
+- case 11:
+-#line 141 "dtc-parser.y"
+- {
+- (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
+- ;}
+- break;
+-
+- case 12:
+-#line 145 "dtc-parser.y"
+- {
+- (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
+- ;}
+- break;
+-
+- case 13:
+-#line 152 "dtc-parser.y"
+- {
+- (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
+- ;}
+- break;
+-
+- case 14:
+-#line 159 "dtc-parser.y"
+- {
+- (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
+- ;}
+- break;
+-
+- case 15:
+-#line 166 "dtc-parser.y"
+- {
+- (yyval.proplist) = NULL;
+- ;}
+- break;
+-
+- case 16:
+-#line 170 "dtc-parser.y"
+- {
+- (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
+- ;}
+- break;
+-
+- case 17:
+-#line 177 "dtc-parser.y"
+- {
+- (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
+- ;}
+- break;
+-
+- case 18:
+-#line 181 "dtc-parser.y"
+- {
+- (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
+- ;}
+- break;
+-
+- case 19:
+-#line 188 "dtc-parser.y"
+- {
+- (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
+- ;}
+- break;
+-
+- case 20:
+-#line 192 "dtc-parser.y"
+- {
+- (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
+- ;}
+- break;
+-
+- case 21:
+-#line 196 "dtc-parser.y"
+- {
+- (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
+- ;}
+- break;
+-
+- case 22:
+-#line 200 "dtc-parser.y"
+- {
+- (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
+- ;}
+- break;
+-
+- case 23:
+-#line 204 "dtc-parser.y"
+- {
+- struct search_path path = { srcpos_file->dir, NULL, NULL };
+- struct dtc_file *file = dtc_open_file((yyvsp[(4) - (9)].data).val, &path);
+- struct data d = empty_data;
+-
+- if ((yyvsp[(6) - (9)].addr) != 0)
+- if (fseek(file->file, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
+- yyerrorf("Couldn't seek to offset %llu in \"%s\": %s",
+- (unsigned long long)(yyvsp[(6) - (9)].addr),
+- (yyvsp[(4) - (9)].data).val, strerror(errno));
+-
+- d = data_copy_file(file->file, (yyvsp[(8) - (9)].addr));
+-
+- (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
+- dtc_close_file(file);
+- ;}
+- break;
+-
+- case 24:
+-#line 221 "dtc-parser.y"
+- {
+- struct search_path path = { srcpos_file->dir, NULL, NULL };
+- struct dtc_file *file = dtc_open_file((yyvsp[(4) - (5)].data).val, &path);
+- struct data d = empty_data;
+-
+- d = data_copy_file(file->file, -1);
+-
+- (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
+- dtc_close_file(file);
+- ;}
+- break;
+-
+- case 25:
+-#line 232 "dtc-parser.y"
+- {
+- (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
+- ;}
+- break;
+-
+- case 26:
+-#line 239 "dtc-parser.y"
+- {
+- (yyval.data) = empty_data;
+- ;}
+- break;
+-
+- case 27:
+-#line 243 "dtc-parser.y"
+- {
+- (yyval.data) = (yyvsp[(1) - (2)].data);
+- ;}
+- break;
+-
+- case 28:
+-#line 247 "dtc-parser.y"
+- {
+- (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
+- ;}
+- break;
+-
+- case 29:
+-#line 254 "dtc-parser.y"
+- {
+- (yyval.data) = empty_data;
+- ;}
+- break;
+-
+- case 30:
+-#line 258 "dtc-parser.y"
+- {
+- (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
+- ;}
+- break;
+-
+- case 31:
+-#line 262 "dtc-parser.y"
+- {
+- (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
+- (yyvsp[(2) - (2)].labelref)), -1);
+- ;}
+- break;
+-
+- case 32:
+-#line 267 "dtc-parser.y"
+- {
+- (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
+- ;}
+- break;
+-
+- case 33:
+-#line 274 "dtc-parser.y"
+- {
+- (yyval.cbase) = 16;
+- ;}
+- break;
+-
+- case 35:
+-#line 282 "dtc-parser.y"
+- {
+- (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
+- ;}
+- break;
+-
+- case 36:
+-#line 286 "dtc-parser.y"
+- {
+- (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
+- ;}
+- break;
+-
+- case 37:
+-#line 293 "dtc-parser.y"
+- {
+- (yyval.data) = empty_data;
+- ;}
+- break;
+-
+- case 38:
+-#line 297 "dtc-parser.y"
+- {
+- (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
+- ;}
+- break;
+-
+- case 39:
+-#line 301 "dtc-parser.y"
+- {
+- (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
+- ;}
+- break;
+-
+- case 40:
+-#line 308 "dtc-parser.y"
+- {
+- (yyval.nodelist) = NULL;
+- ;}
+- break;
+-
+- case 41:
+-#line 312 "dtc-parser.y"
+- {
+- (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
+- ;}
+- break;
+-
+- case 42:
+-#line 316 "dtc-parser.y"
+- {
+- yyerror("syntax error: properties must precede subnodes");
+- YYERROR;
+- ;}
+- break;
+-
+- case 43:
+-#line 324 "dtc-parser.y"
+- {
+- (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
+- ;}
+- break;
+-
+- case 44:
+-#line 331 "dtc-parser.y"
+- {
+- (yyval.labelref) = NULL;
+- ;}
+- break;
+-
+- case 45:
+-#line 335 "dtc-parser.y"
+- {
+- (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
+- ;}
+- break;
+-
+-
+-/* Line 1267 of yacc.c. */
+-#line 1780 "dtc-parser.tab.c"
+- default: break;
+- }
+- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+-
+- YYPOPSTACK (yylen);
+- yylen = 0;
+- YY_STACK_PRINT (yyss, yyssp);
+-
+- *++yyvsp = yyval;
+- *++yylsp = yyloc;
+-
+- /* Now `shift' the result of the reduction. Determine what state
+- that goes to, based on the state we popped back to and the rule
+- number reduced by. */
+-
+- yyn = yyr1[yyn];
+-
+- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+- yystate = yytable[yystate];
+- else
+- yystate = yydefgoto[yyn - YYNTOKENS];
+-
+- goto yynewstate;
+-
+-
+-/*------------------------------------.
+-| yyerrlab -- here on detecting error |
+-`------------------------------------*/
+-yyerrlab:
+- /* If not already recovering from an error, report this error. */
+- if (!yyerrstatus)
+- {
+- ++yynerrs;
+-#if ! YYERROR_VERBOSE
+- yyerror (YY_("syntax error"));
+-#else
+- {
+- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+- {
+- YYSIZE_T yyalloc = 2 * yysize;
+- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+- yyalloc = YYSTACK_ALLOC_MAXIMUM;
+- if (yymsg != yymsgbuf)
+- YYSTACK_FREE (yymsg);
+- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+- if (yymsg)
+- yymsg_alloc = yyalloc;
+- else
+- {
+- yymsg = yymsgbuf;
+- yymsg_alloc = sizeof yymsgbuf;
+- }
+- }
+-
+- if (0 < yysize && yysize <= yymsg_alloc)
+- {
+- (void) yysyntax_error (yymsg, yystate, yychar);
+- yyerror (yymsg);
+- }
+- else
+- {
+- yyerror (YY_("syntax error"));
+- if (yysize != 0)
+- goto yyexhaustedlab;
+- }
+- }
+-#endif
+- }
+-
+- yyerror_range[0] = yylloc;
+-
+- if (yyerrstatus == 3)
+- {
+- /* If just tried and failed to reuse look-ahead token after an
+- error, discard it. */
+-
+- if (yychar <= YYEOF)
+- {
+- /* Return failure if at end of input. */
+- if (yychar == YYEOF)
+- YYABORT;
+- }
+- else
+- {
+- yydestruct ("Error: discarding",
+- yytoken, &yylval, &yylloc);
+- yychar = YYEMPTY;
+- }
+- }
+-
+- /* Else will try to reuse look-ahead token after shifting the error
+- token. */
+- goto yyerrlab1;
+-
+-
+-/*---------------------------------------------------.
+-| yyerrorlab -- error raised explicitly by YYERROR. |
+-`---------------------------------------------------*/
+-yyerrorlab:
+-
+- /* Pacify compilers like GCC when the user code never invokes
+- YYERROR and the label yyerrorlab therefore never appears in user
+- code. */
+- if (/*CONSTCOND*/ 0)
+- goto yyerrorlab;
+-
+- yyerror_range[0] = yylsp[1-yylen];
+- /* Do not reclaim the symbols of the rule which action triggered
+- this YYERROR. */
+- YYPOPSTACK (yylen);
+- yylen = 0;
+- YY_STACK_PRINT (yyss, yyssp);
+- yystate = *yyssp;
+- goto yyerrlab1;
+-
+-
+-/*-------------------------------------------------------------.
+-| yyerrlab1 -- common code for both syntax error and YYERROR. |
+-`-------------------------------------------------------------*/
+-yyerrlab1:
+- yyerrstatus = 3; /* Each real token shifted decrements this. */
+-
+- for (;;)
+- {
+- yyn = yypact[yystate];
+- if (yyn != YYPACT_NINF)
+- {
+- yyn += YYTERROR;
+- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+- {
+- yyn = yytable[yyn];
+- if (0 < yyn)
+- break;
+- }
+- }
+-
+- /* Pop the current state because it cannot handle the error token. */
+- if (yyssp == yyss)
+- YYABORT;
+-
+- yyerror_range[0] = *yylsp;
+- yydestruct ("Error: popping",
+- yystos[yystate], yyvsp, yylsp);
+- YYPOPSTACK (1);
+- yystate = *yyssp;
+- YY_STACK_PRINT (yyss, yyssp);
+- }
+-
+- if (yyn == YYFINAL)
+- YYACCEPT;
+-
+- *++yyvsp = yylval;
+-
+- yyerror_range[1] = yylloc;
+- /* Using YYLLOC is tempting, but would change the location of
+- the look-ahead. YYLOC is available though. */
+- YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+- *++yylsp = yyloc;
+-
+- /* Shift the error token. */
+- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+-
+- yystate = yyn;
+- goto yynewstate;
+-
+-
+-/*-------------------------------------.
+-| yyacceptlab -- YYACCEPT comes here. |
+-`-------------------------------------*/
+-yyacceptlab:
+- yyresult = 0;
+- goto yyreturn;
+-
+-/*-----------------------------------.
+-| yyabortlab -- YYABORT comes here. |
+-`-----------------------------------*/
+-yyabortlab:
+- yyresult = 1;
+- goto yyreturn;
+-
+-#ifndef yyoverflow
+-/*-------------------------------------------------.
+-| yyexhaustedlab -- memory exhaustion comes here. |
+-`-------------------------------------------------*/
+-yyexhaustedlab:
+- yyerror (YY_("memory exhausted"));
+- yyresult = 2;
+- /* Fall through. */
+-#endif
+-
+-yyreturn:
+- if (yychar != YYEOF && yychar != YYEMPTY)
+- yydestruct ("Cleanup: discarding lookahead",
+- yytoken, &yylval, &yylloc);
+- /* Do not reclaim the symbols of the rule which action triggered
+- this YYABORT or YYACCEPT. */
+- YYPOPSTACK (yylen);
+- YY_STACK_PRINT (yyss, yyssp);
+- while (yyssp != yyss)
+- {
+- yydestruct ("Cleanup: popping",
+- yystos[*yyssp], yyvsp, yylsp);
+- YYPOPSTACK (1);
+- }
+-#ifndef yyoverflow
+- if (yyss != yyssa)
+- YYSTACK_FREE (yyss);
+-#endif
+-#if YYERROR_VERBOSE
+- if (yymsg != yymsgbuf)
+- YYSTACK_FREE (yymsg);
+-#endif
+- /* Make sure YYID is used. */
+- return YYID (yyresult);
+-}
+-
+-
+-#line 340 "dtc-parser.y"
+-
+-
+-void yyerrorf(char const *s, ...)
+-{
+- const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
+- va_list va;
+- va_start(va, s);
+-
+- if (strcmp(fname, "-") == 0)
+- fname = "stdin";
+-
+- fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
+- vfprintf(stderr, s, va);
+- fprintf(stderr, "\n");
+-
+- treesource_error = 1;
+- va_end(va);
+-}
+-
+-void yyerror (char const *s)
+-{
+- yyerrorf("%s", s);
+-}
+-
+-static unsigned long long eval_literal(const char *s, int base, int bits)
+-{
+- unsigned long long val;
+- char *e;
+-
+- errno = 0;
+- val = strtoull(s, &e, base);
+- if (*e)
+- yyerror("bad characters in literal");
+- else if ((errno == ERANGE)
+- || ((bits < 64) && (val >= (1ULL << bits))))
+- yyerror("literal out of range");
+- else if (errno != 0)
+- yyerror("bad literal");
+- return val;
+-}
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped 1970-01-01 01:00:00.000000000 +0100
+@@ -1,113 +0,0 @@
+-/* A Bison parser, made by GNU Bison 2.3. */
+-
+-/* Skeleton interface for Bison's Yacc-like parsers in C
+-
+- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+- Free Software Foundation, Inc.
+-
+- 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, Inc., 51 Franklin Street, Fifth Floor,
+- Boston, MA 02110-1301, USA. */
+-
+-/* As a special exception, you may create a larger work that contains
+- part or all of the Bison parser skeleton and distribute that work
+- under terms of your choice, so long as that work isn't itself a
+- parser generator using the skeleton or a modified version thereof
+- as a parser skeleton. Alternatively, if you modify or redistribute
+- the parser skeleton itself, you may (at your option) remove this
+- special exception, which will cause the skeleton and the resulting
+- Bison output files to be licensed under the GNU General Public
+- License without this special exception.
+-
+- This special exception was added by the Free Software Foundation in
+- version 2.2 of Bison. */
+-
+-/* Tokens. */
+-#ifndef YYTOKENTYPE
+-# define YYTOKENTYPE
+- /* Put the tokens into the symbol table, so that GDB and other debuggers
+- know about them. */
+- enum yytokentype {
+- DT_V1 = 258,
+- DT_MEMRESERVE = 259,
+- DT_PROPNODENAME = 260,
+- DT_LITERAL = 261,
+- DT_LEGACYLITERAL = 262,
+- DT_BASE = 263,
+- DT_BYTE = 264,
+- DT_STRING = 265,
+- DT_LABEL = 266,
+- DT_REF = 267,
+- DT_INCBIN = 268
+- };
+-#endif
+-/* Tokens. */
+-#define DT_V1 258
+-#define DT_MEMRESERVE 259
+-#define DT_PROPNODENAME 260
+-#define DT_LITERAL 261
+-#define DT_LEGACYLITERAL 262
+-#define DT_BASE 263
+-#define DT_BYTE 264
+-#define DT_STRING 265
+-#define DT_LABEL 266
+-#define DT_REF 267
+-#define DT_INCBIN 268
+-
+-
+-
+-
+-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+-typedef union YYSTYPE
+-#line 37 "dtc-parser.y"
+-{
+- char *propnodename;
+- char *literal;
+- char *labelref;
+- unsigned int cbase;
+- uint8_t byte;
+- struct data data;
+-
+- uint64_t addr;
+- cell_t cell;
+- struct property *prop;
+- struct property *proplist;
+- struct node *node;
+- struct node *nodelist;
+- struct reserve_info *re;
+-}
+-/* Line 1489 of yacc.c. */
+-#line 92 "dtc-parser.tab.h"
+- YYSTYPE;
+-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+-# define YYSTYPE_IS_DECLARED 1
+-# define YYSTYPE_IS_TRIVIAL 1
+-#endif
+-
+-extern YYSTYPE yylval;
+-
+-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+-typedef struct YYLTYPE
+-{
+- int first_line;
+- int first_column;
+- int last_line;
+- int last_column;
+-} YYLTYPE;
+-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+-# define YYLTYPE_IS_DECLARED 1
+-# define YYLTYPE_IS_TRIVIAL 1
+-#endif
+-
+-extern YYLTYPE yylloc;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.y linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.y
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/dtc-parser.y 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/dtc-parser.y 1970-01-01 01:00:00.000000000 +0100
+@@ -1,379 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
+- */
+-
+-%locations
+-
+-%{
+-#include <stdio.h>
+-
+-#include "dtc.h"
+-#include "srcpos.h"
+-
+-extern int yylex(void);
+-
+-extern struct boot_info *the_boot_info;
+-extern int treesource_error;
+-
+-static unsigned long long eval_literal(const char *s, int base, int bits);
+-%}
+-
+-%union {
+- char *propnodename;
+- char *literal;
+- char *labelref;
+- unsigned int cbase;
+- uint8_t byte;
+- struct data data;
+-
+- uint64_t addr;
+- cell_t cell;
+- struct property *prop;
+- struct property *proplist;
+- struct node *node;
+- struct node *nodelist;
+- struct reserve_info *re;
+-}
+-
+-%token DT_V1
+-%token DT_MEMRESERVE
+-%token <propnodename> DT_PROPNODENAME
+-%token <literal> DT_LITERAL
+-%token <literal> DT_LEGACYLITERAL
+-%token <cbase> DT_BASE
+-%token <byte> DT_BYTE
+-%token <data> DT_STRING
+-%token <labelref> DT_LABEL
+-%token <labelref> DT_REF
+-%token DT_INCBIN
+-
+-%type <data> propdata
+-%type <data> propdataprefix
+-%type <re> memreserve
+-%type <re> memreserves
+-%type <re> v0_memreserve
+-%type <re> v0_memreserves
+-%type <addr> addr
+-%type <data> celllist
+-%type <cbase> cellbase
+-%type <cell> cellval
+-%type <data> bytestring
+-%type <prop> propdef
+-%type <proplist> proplist
+-
+-%type <node> devicetree
+-%type <node> nodedef
+-%type <node> subnode
+-%type <nodelist> subnodes
+-%type <labelref> label
+-
+-%%
+-
+-sourcefile:
+- DT_V1 ';' memreserves devicetree
+- {
+- the_boot_info = build_boot_info($3, $4, 0);
+- }
+- | v0_memreserves devicetree
+- {
+- the_boot_info = build_boot_info($1, $2, 0);
+- }
+- ;
+-
+-memreserves:
+- /* empty */
+- {
+- $$ = NULL;
+- }
+- | memreserve memreserves
+- {
+- $$ = chain_reserve_entry($1, $2);
+- }
+- ;
+-
+-memreserve:
+- label DT_MEMRESERVE addr addr ';'
+- {
+- $$ = build_reserve_entry($3, $4, $1);
+- }
+- ;
+-
+-v0_memreserves:
+- /* empty */
+- {
+- $$ = NULL;
+- }
+- | v0_memreserve v0_memreserves
+- {
+- $$ = chain_reserve_entry($1, $2);
+- };
+- ;
+-
+-v0_memreserve:
+- memreserve
+- {
+- $$ = $1;
+- }
+- | label DT_MEMRESERVE addr '-' addr ';'
+- {
+- $$ = build_reserve_entry($3, $5 - $3 + 1, $1);
+- }
+- ;
+-
+-addr:
+- DT_LITERAL
+- {
+- $$ = eval_literal($1, 0, 64);
+- }
+- | DT_LEGACYLITERAL
+- {
+- $$ = eval_literal($1, 16, 64);
+- }
+- ;
+-
+-devicetree:
+- '/' nodedef
+- {
+- $$ = name_node($2, "", NULL);
+- }
+- ;
+-
+-nodedef:
+- '{' proplist subnodes '}' ';'
+- {
+- $$ = build_node($2, $3);
+- }
+- ;
+-
+-proplist:
+- /* empty */
+- {
+- $$ = NULL;
+- }
+- | proplist propdef
+- {
+- $$ = chain_property($2, $1);
+- }
+- ;
+-
+-propdef:
+- label DT_PROPNODENAME '=' propdata ';'
+- {
+- $$ = build_property($2, $4, $1);
+- }
+- | label DT_PROPNODENAME ';'
+- {
+- $$ = build_property($2, empty_data, $1);
+- }
+- ;
+-
+-propdata:
+- propdataprefix DT_STRING
+- {
+- $$ = data_merge($1, $2);
+- }
+- | propdataprefix '<' celllist '>'
+- {
+- $$ = data_merge($1, $3);
+- }
+- | propdataprefix '[' bytestring ']'
+- {
+- $$ = data_merge($1, $3);
+- }
+- | propdataprefix DT_REF
+- {
+- $$ = data_add_marker($1, REF_PATH, $2);
+- }
+- | propdataprefix DT_INCBIN '(' DT_STRING ',' addr ',' addr ')'
+- {
+- struct search_path path = { srcpos_file->dir, NULL, NULL };
+- struct dtc_file *file = dtc_open_file($4.val, &path);
+- struct data d = empty_data;
+-
+- if ($6 != 0)
+- if (fseek(file->file, $6, SEEK_SET) != 0)
+- yyerrorf("Couldn't seek to offset %llu in \"%s\": %s",
+- (unsigned long long)$6,
+- $4.val, strerror(errno));
+-
+- d = data_copy_file(file->file, $8);
+-
+- $$ = data_merge($1, d);
+- dtc_close_file(file);
+- }
+- | propdataprefix DT_INCBIN '(' DT_STRING ')'
+- {
+- struct search_path path = { srcpos_file->dir, NULL, NULL };
+- struct dtc_file *file = dtc_open_file($4.val, &path);
+- struct data d = empty_data;
+-
+- d = data_copy_file(file->file, -1);
+-
+- $$ = data_merge($1, d);
+- dtc_close_file(file);
+- }
+- | propdata DT_LABEL
+- {
+- $$ = data_add_marker($1, LABEL, $2);
+- }
+- ;
+-
+-propdataprefix:
+- /* empty */
+- {
+- $$ = empty_data;
+- }
+- | propdata ','
+- {
+- $$ = $1;
+- }
+- | propdataprefix DT_LABEL
+- {
+- $$ = data_add_marker($1, LABEL, $2);
+- }
+- ;
+-
+-celllist:
+- /* empty */
+- {
+- $$ = empty_data;
+- }
+- | celllist cellval
+- {
+- $$ = data_append_cell($1, $2);
+- }
+- | celllist DT_REF
+- {
+- $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
+- $2), -1);
+- }
+- | celllist DT_LABEL
+- {
+- $$ = data_add_marker($1, LABEL, $2);
+- }
+- ;
+-
+-cellbase:
+- /* empty */
+- {
+- $$ = 16;
+- }
+- | DT_BASE
+- ;
+-
+-cellval:
+- DT_LITERAL
+- {
+- $$ = eval_literal($1, 0, 32);
+- }
+- | cellbase DT_LEGACYLITERAL
+- {
+- $$ = eval_literal($2, $1, 32);
+- }
+- ;
+-
+-bytestring:
+- /* empty */
+- {
+- $$ = empty_data;
+- }
+- | bytestring DT_BYTE
+- {
+- $$ = data_append_byte($1, $2);
+- }
+- | bytestring DT_LABEL
+- {
+- $$ = data_add_marker($1, LABEL, $2);
+- }
+- ;
+-
+-subnodes:
+- /* empty */
+- {
+- $$ = NULL;
+- }
+- | subnode subnodes
+- {
+- $$ = chain_node($1, $2);
+- }
+- | subnode propdef
+- {
+- yyerror("syntax error: properties must precede subnodes");
+- YYERROR;
+- }
+- ;
+-
+-subnode:
+- label DT_PROPNODENAME nodedef
+- {
+- $$ = name_node($3, $2, $1);
+- }
+- ;
+-
+-label:
+- /* empty */
+- {
+- $$ = NULL;
+- }
+- | DT_LABEL
+- {
+- $$ = $1;
+- }
+- ;
+-
+-%%
+-
+-void yyerrorf(char const *s, ...)
+-{
+- const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
+- va_list va;
+- va_start(va, s);
+-
+- if (strcmp(fname, "-") == 0)
+- fname = "stdin";
+-
+- fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
+- vfprintf(stderr, s, va);
+- fprintf(stderr, "\n");
+-
+- treesource_error = 1;
+- va_end(va);
+-}
+-
+-void yyerror (char const *s)
+-{
+- yyerrorf("%s", s);
+-}
+-
+-static unsigned long long eval_literal(const char *s, int base, int bits)
+-{
+- unsigned long long val;
+- char *e;
+-
+- errno = 0;
+- val = strtoull(s, &e, base);
+- if (*e)
+- yyerror("bad characters in literal");
+- else if ((errno == ERANGE)
+- || ((bits < 64) && (val >= (1ULL << bits))))
+- yyerror("literal out of range");
+- else if (errno != 0)
+- yyerror("bad literal");
+- return val;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/flattree.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/flattree.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/flattree.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/flattree.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,906 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-#include "srcpos.h"
+-
+-#define FTF_FULLPATH 0x1
+-#define FTF_VARALIGN 0x2
+-#define FTF_NAMEPROPS 0x4
+-#define FTF_BOOTCPUID 0x8
+-#define FTF_STRTABSIZE 0x10
+-#define FTF_STRUCTSIZE 0x20
+-#define FTF_NOPS 0x40
+-
+-static struct version_info {
+- int version;
+- int last_comp_version;
+- int hdr_size;
+- int flags;
+-} version_table[] = {
+- {1, 1, FDT_V1_SIZE,
+- FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
+- {2, 1, FDT_V2_SIZE,
+- FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
+- {3, 1, FDT_V3_SIZE,
+- FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
+- {16, 16, FDT_V3_SIZE,
+- FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
+- {17, 16, FDT_V17_SIZE,
+- FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
+-};
+-
+-struct emitter {
+- void (*cell)(void *, cell_t);
+- void (*string)(void *, char *, int);
+- void (*align)(void *, int);
+- void (*data)(void *, struct data);
+- void (*beginnode)(void *, const char *);
+- void (*endnode)(void *, const char *);
+- void (*property)(void *, const char *);
+-};
+-
+-static void bin_emit_cell(void *e, cell_t val)
+-{
+- struct data *dtbuf = e;
+-
+- *dtbuf = data_append_cell(*dtbuf, val);
+-}
+-
+-static void bin_emit_string(void *e, char *str, int len)
+-{
+- struct data *dtbuf = e;
+-
+- if (len == 0)
+- len = strlen(str);
+-
+- *dtbuf = data_append_data(*dtbuf, str, len);
+- *dtbuf = data_append_byte(*dtbuf, '\0');
+-}
+-
+-static void bin_emit_align(void *e, int a)
+-{
+- struct data *dtbuf = e;
+-
+- *dtbuf = data_append_align(*dtbuf, a);
+-}
+-
+-static void bin_emit_data(void *e, struct data d)
+-{
+- struct data *dtbuf = e;
+-
+- *dtbuf = data_append_data(*dtbuf, d.val, d.len);
+-}
+-
+-static void bin_emit_beginnode(void *e, const char *label)
+-{
+- bin_emit_cell(e, FDT_BEGIN_NODE);
+-}
+-
+-static void bin_emit_endnode(void *e, const char *label)
+-{
+- bin_emit_cell(e, FDT_END_NODE);
+-}
+-
+-static void bin_emit_property(void *e, const char *label)
+-{
+- bin_emit_cell(e, FDT_PROP);
+-}
+-
+-static struct emitter bin_emitter = {
+- .cell = bin_emit_cell,
+- .string = bin_emit_string,
+- .align = bin_emit_align,
+- .data = bin_emit_data,
+- .beginnode = bin_emit_beginnode,
+- .endnode = bin_emit_endnode,
+- .property = bin_emit_property,
+-};
+-
+-static void emit_label(FILE *f, const char *prefix, const char *label)
+-{
+- fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
+- fprintf(f, "%s_%s:\n", prefix, label);
+- fprintf(f, "_%s_%s:\n", prefix, label);
+-}
+-
+-static void emit_offset_label(FILE *f, const char *label, int offset)
+-{
+- fprintf(f, "\t.globl\t%s\n", label);
+- fprintf(f, "%s\t= . + %d\n", label, offset);
+-}
+-
+-static void asm_emit_cell(void *e, cell_t val)
+-{
+- FILE *f = e;
+-
+- fprintf(f, "\t.long\t0x%x\n", val);
+-}
+-
+-static void asm_emit_string(void *e, char *str, int len)
+-{
+- FILE *f = e;
+- char c = 0;
+-
+- if (len != 0) {
+- /* XXX: ewww */
+- c = str[len];
+- str[len] = '\0';
+- }
+-
+- fprintf(f, "\t.string\t\"%s\"\n", str);
+-
+- if (len != 0) {
+- str[len] = c;
+- }
+-}
+-
+-static void asm_emit_align(void *e, int a)
+-{
+- FILE *f = e;
+-
+- fprintf(f, "\t.balign\t%d\n", a);
+-}
+-
+-static void asm_emit_data(void *e, struct data d)
+-{
+- FILE *f = e;
+- int off = 0;
+- struct marker *m = d.markers;
+-
+- for_each_marker_of_type(m, LABEL)
+- emit_offset_label(f, m->ref, m->offset);
+-
+- while ((d.len - off) >= sizeof(uint32_t)) {
+- fprintf(f, "\t.long\t0x%x\n",
+- fdt32_to_cpu(*((uint32_t *)(d.val+off))));
+- off += sizeof(uint32_t);
+- }
+-
+- while ((d.len - off) >= 1) {
+- fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
+- off += 1;
+- }
+-
+- assert(off == d.len);
+-}
+-
+-static void asm_emit_beginnode(void *e, const char *label)
+-{
+- FILE *f = e;
+-
+- if (label) {
+- fprintf(f, "\t.globl\t%s\n", label);
+- fprintf(f, "%s:\n", label);
+- }
+- fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
+-}
+-
+-static void asm_emit_endnode(void *e, const char *label)
+-{
+- FILE *f = e;
+-
+- fprintf(f, "\t.long\tFDT_END_NODE\n");
+- if (label) {
+- fprintf(f, "\t.globl\t%s_end\n", label);
+- fprintf(f, "%s_end:\n", label);
+- }
+-}
+-
+-static void asm_emit_property(void *e, const char *label)
+-{
+- FILE *f = e;
+-
+- if (label) {
+- fprintf(f, "\t.globl\t%s\n", label);
+- fprintf(f, "%s:\n", label);
+- }
+- fprintf(f, "\t.long\tFDT_PROP\n");
+-}
+-
+-static struct emitter asm_emitter = {
+- .cell = asm_emit_cell,
+- .string = asm_emit_string,
+- .align = asm_emit_align,
+- .data = asm_emit_data,
+- .beginnode = asm_emit_beginnode,
+- .endnode = asm_emit_endnode,
+- .property = asm_emit_property,
+-};
+-
+-static int stringtable_insert(struct data *d, const char *str)
+-{
+- int i;
+-
+- /* FIXME: do this more efficiently? */
+-
+- for (i = 0; i < d->len; i++) {
+- if (streq(str, d->val + i))
+- return i;
+- }
+-
+- *d = data_append_data(*d, str, strlen(str)+1);
+- return i;
+-}
+-
+-static void flatten_tree(struct node *tree, struct emitter *emit,
+- void *etarget, struct data *strbuf,
+- struct version_info *vi)
+-{
+- struct property *prop;
+- struct node *child;
+- int seen_name_prop = 0;
+-
+- emit->beginnode(etarget, tree->label);
+-
+- if (vi->flags & FTF_FULLPATH)
+- emit->string(etarget, tree->fullpath, 0);
+- else
+- emit->string(etarget, tree->name, 0);
+-
+- emit->align(etarget, sizeof(cell_t));
+-
+- for_each_property(tree, prop) {
+- int nameoff;
+-
+- if (streq(prop->name, "name"))
+- seen_name_prop = 1;
+-
+- nameoff = stringtable_insert(strbuf, prop->name);
+-
+- emit->property(etarget, prop->label);
+- emit->cell(etarget, prop->val.len);
+- emit->cell(etarget, nameoff);
+-
+- if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
+- emit->align(etarget, 8);
+-
+- emit->data(etarget, prop->val);
+- emit->align(etarget, sizeof(cell_t));
+- }
+-
+- if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
+- emit->property(etarget, NULL);
+- emit->cell(etarget, tree->basenamelen+1);
+- emit->cell(etarget, stringtable_insert(strbuf, "name"));
+-
+- if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
+- emit->align(etarget, 8);
+-
+- emit->string(etarget, tree->name, tree->basenamelen);
+- emit->align(etarget, sizeof(cell_t));
+- }
+-
+- for_each_child(tree, child) {
+- flatten_tree(child, emit, etarget, strbuf, vi);
+- }
+-
+- emit->endnode(etarget, tree->label);
+-}
+-
+-static struct data flatten_reserve_list(struct reserve_info *reservelist,
+- struct version_info *vi)
+-{
+- struct reserve_info *re;
+- struct data d = empty_data;
+- static struct fdt_reserve_entry null_re = {0,0};
+- int j;
+-
+- for (re = reservelist; re; re = re->next) {
+- d = data_append_re(d, &re->re);
+- }
+- /*
+- * Add additional reserved slots if the user asked for them.
+- */
+- for (j = 0; j < reservenum; j++) {
+- d = data_append_re(d, &null_re);
+- }
+-
+- return d;
+-}
+-
+-static void make_fdt_header(struct fdt_header *fdt,
+- struct version_info *vi,
+- int reservesize, int dtsize, int strsize,
+- int boot_cpuid_phys)
+-{
+- int reserve_off;
+-
+- reservesize += sizeof(struct fdt_reserve_entry);
+-
+- memset(fdt, 0xff, sizeof(*fdt));
+-
+- fdt->magic = cpu_to_fdt32(FDT_MAGIC);
+- fdt->version = cpu_to_fdt32(vi->version);
+- fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version);
+-
+- /* Reserve map should be doubleword aligned */
+- reserve_off = ALIGN(vi->hdr_size, 8);
+-
+- fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off);
+- fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize);
+- fdt->off_dt_strings = cpu_to_fdt32(reserve_off + reservesize
+- + dtsize);
+- fdt->totalsize = cpu_to_fdt32(reserve_off + reservesize + dtsize + strsize);
+-
+- if (vi->flags & FTF_BOOTCPUID)
+- fdt->boot_cpuid_phys = cpu_to_fdt32(boot_cpuid_phys);
+- if (vi->flags & FTF_STRTABSIZE)
+- fdt->size_dt_strings = cpu_to_fdt32(strsize);
+- if (vi->flags & FTF_STRUCTSIZE)
+- fdt->size_dt_struct = cpu_to_fdt32(dtsize);
+-}
+-
+-void dt_to_blob(FILE *f, struct boot_info *bi, int version)
+-{
+- struct version_info *vi = NULL;
+- int i;
+- struct data blob = empty_data;
+- struct data reservebuf = empty_data;
+- struct data dtbuf = empty_data;
+- struct data strbuf = empty_data;
+- struct fdt_header fdt;
+- int padlen = 0;
+-
+- for (i = 0; i < ARRAY_SIZE(version_table); i++) {
+- if (version_table[i].version == version)
+- vi = &version_table[i];
+- }
+- if (!vi)
+- die("Unknown device tree blob version %d\n", version);
+-
+- flatten_tree(bi->dt, &bin_emitter, &dtbuf, &strbuf, vi);
+- bin_emit_cell(&dtbuf, FDT_END);
+-
+- reservebuf = flatten_reserve_list(bi->reservelist, vi);
+-
+- /* Make header */
+- make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
+- bi->boot_cpuid_phys);
+-
+- /*
+- * If the user asked for more space than is used, adjust the totalsize.
+- */
+- if (minsize > 0) {
+- padlen = minsize - fdt32_to_cpu(fdt.totalsize);
+- if ((padlen < 0) && (quiet < 1))
+- fprintf(stderr,
+- "Warning: blob size %d >= minimum size %d\n",
+- fdt32_to_cpu(fdt.totalsize), minsize);
+- }
+-
+- if (padsize > 0)
+- padlen = padsize;
+-
+- if (padlen > 0) {
+- int tsize = fdt32_to_cpu(fdt.totalsize);
+- tsize += padlen;
+- fdt.totalsize = cpu_to_fdt32(tsize);
+- }
+-
+- /*
+- * Assemble the blob: start with the header, add with alignment
+- * the reserve buffer, add the reserve map terminating zeroes,
+- * the device tree itself, and finally the strings.
+- */
+- blob = data_append_data(blob, &fdt, vi->hdr_size);
+- blob = data_append_align(blob, 8);
+- blob = data_merge(blob, reservebuf);
+- blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
+- blob = data_merge(blob, dtbuf);
+- blob = data_merge(blob, strbuf);
+-
+- /*
+- * If the user asked for more space than is used, pad out the blob.
+- */
+- if (padlen > 0)
+- blob = data_append_zeroes(blob, padlen);
+-
+- fwrite(blob.val, blob.len, 1, f);
+-
+- if (ferror(f))
+- die("Error writing device tree blob: %s\n", strerror(errno));
+-
+- /*
+- * data_merge() frees the right-hand element so only the blob
+- * remains to be freed.
+- */
+- data_free(blob);
+-}
+-
+-static void dump_stringtable_asm(FILE *f, struct data strbuf)
+-{
+- const char *p;
+- int len;
+-
+- p = strbuf.val;
+-
+- while (p < (strbuf.val + strbuf.len)) {
+- len = strlen(p);
+- fprintf(f, "\t.string \"%s\"\n", p);
+- p += len+1;
+- }
+-}
+-
+-void dt_to_asm(FILE *f, struct boot_info *bi, int version)
+-{
+- struct version_info *vi = NULL;
+- int i;
+- struct data strbuf = empty_data;
+- struct reserve_info *re;
+- const char *symprefix = "dt";
+-
+- for (i = 0; i < ARRAY_SIZE(version_table); i++) {
+- if (version_table[i].version == version)
+- vi = &version_table[i];
+- }
+- if (!vi)
+- die("Unknown device tree blob version %d\n", version);
+-
+- fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
+- fprintf(f, "#define FDT_MAGIC 0x%x\n", FDT_MAGIC);
+- fprintf(f, "#define FDT_BEGIN_NODE 0x%x\n", FDT_BEGIN_NODE);
+- fprintf(f, "#define FDT_END_NODE 0x%x\n", FDT_END_NODE);
+- fprintf(f, "#define FDT_PROP 0x%x\n", FDT_PROP);
+- fprintf(f, "#define FDT_END 0x%x\n", FDT_END);
+- fprintf(f, "\n");
+-
+- emit_label(f, symprefix, "blob_start");
+- emit_label(f, symprefix, "header");
+- fprintf(f, "\t.long\tFDT_MAGIC\t\t\t\t/* magic */\n");
+- fprintf(f, "\t.long\t_%s_blob_abs_end - _%s_blob_start\t/* totalsize */\n",
+- symprefix, symprefix);
+- fprintf(f, "\t.long\t_%s_struct_start - _%s_blob_start\t/* off_dt_struct */\n",
+- symprefix, symprefix);
+- fprintf(f, "\t.long\t_%s_strings_start - _%s_blob_start\t/* off_dt_strings */\n",
+- symprefix, symprefix);
+- fprintf(f, "\t.long\t_%s_reserve_map - _%s_blob_start\t/* off_dt_strings */\n",
+- symprefix, symprefix);
+- fprintf(f, "\t.long\t%d\t\t\t\t\t/* version */\n", vi->version);
+- fprintf(f, "\t.long\t%d\t\t\t\t\t/* last_comp_version */\n",
+- vi->last_comp_version);
+-
+- if (vi->flags & FTF_BOOTCPUID)
+- fprintf(f, "\t.long\t%i\t\t\t\t\t/* boot_cpuid_phys */\n",
+- bi->boot_cpuid_phys);
+-
+- if (vi->flags & FTF_STRTABSIZE)
+- fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
+- symprefix, symprefix);
+-
+- if (vi->flags & FTF_STRUCTSIZE)
+- fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
+- symprefix, symprefix);
+-
+- /*
+- * Reserve map entries.
+- * Align the reserve map to a doubleword boundary.
+- * Each entry is an (address, size) pair of u64 values.
+- * Always supply a zero-sized temination entry.
+- */
+- asm_emit_align(f, 8);
+- emit_label(f, symprefix, "reserve_map");
+-
+- fprintf(f, "/* Memory reserve map from source file */\n");
+-
+- /*
+- * Use .long on high and low halfs of u64s to avoid .quad
+- * as it appears .quad isn't available in some assemblers.
+- */
+- for (re = bi->reservelist; re; re = re->next) {
+- if (re->label) {
+- fprintf(f, "\t.globl\t%s\n", re->label);
+- fprintf(f, "%s:\n", re->label);
+- }
+- fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
+- (unsigned int)(re->re.address >> 32),
+- (unsigned int)(re->re.address & 0xffffffff));
+- fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
+- (unsigned int)(re->re.size >> 32),
+- (unsigned int)(re->re.size & 0xffffffff));
+- }
+- for (i = 0; i < reservenum; i++) {
+- fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
+- }
+-
+- fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
+-
+- emit_label(f, symprefix, "struct_start");
+- flatten_tree(bi->dt, &asm_emitter, f, &strbuf, vi);
+- fprintf(f, "\t.long\tFDT_END\n");
+- emit_label(f, symprefix, "struct_end");
+-
+- emit_label(f, symprefix, "strings_start");
+- dump_stringtable_asm(f, strbuf);
+- emit_label(f, symprefix, "strings_end");
+-
+- emit_label(f, symprefix, "blob_end");
+-
+- /*
+- * If the user asked for more space than is used, pad it out.
+- */
+- if (minsize > 0) {
+- fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
+- minsize, symprefix, symprefix);
+- }
+- if (padsize > 0) {
+- fprintf(f, "\t.space\t%d, 0\n", padsize);
+- }
+- emit_label(f, symprefix, "blob_abs_end");
+-
+- data_free(strbuf);
+-}
+-
+-struct inbuf {
+- char *base, *limit, *ptr;
+-};
+-
+-static void inbuf_init(struct inbuf *inb, void *base, void *limit)
+-{
+- inb->base = base;
+- inb->limit = limit;
+- inb->ptr = inb->base;
+-}
+-
+-static void flat_read_chunk(struct inbuf *inb, void *p, int len)
+-{
+- if ((inb->ptr + len) > inb->limit)
+- die("Premature end of data parsing flat device tree\n");
+-
+- memcpy(p, inb->ptr, len);
+-
+- inb->ptr += len;
+-}
+-
+-static uint32_t flat_read_word(struct inbuf *inb)
+-{
+- uint32_t val;
+-
+- assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
+-
+- flat_read_chunk(inb, &val, sizeof(val));
+-
+- return fdt32_to_cpu(val);
+-}
+-
+-static void flat_realign(struct inbuf *inb, int align)
+-{
+- int off = inb->ptr - inb->base;
+-
+- inb->ptr = inb->base + ALIGN(off, align);
+- if (inb->ptr > inb->limit)
+- die("Premature end of data parsing flat device tree\n");
+-}
+-
+-static char *flat_read_string(struct inbuf *inb)
+-{
+- int len = 0;
+- const char *p = inb->ptr;
+- char *str;
+-
+- do {
+- if (p >= inb->limit)
+- die("Premature end of data parsing flat device tree\n");
+- len++;
+- } while ((*p++) != '\0');
+-
+- str = strdup(inb->ptr);
+-
+- inb->ptr += len;
+-
+- flat_realign(inb, sizeof(uint32_t));
+-
+- return str;
+-}
+-
+-static struct data flat_read_data(struct inbuf *inb, int len)
+-{
+- struct data d = empty_data;
+-
+- if (len == 0)
+- return empty_data;
+-
+- d = data_grow_for(d, len);
+- d.len = len;
+-
+- flat_read_chunk(inb, d.val, len);
+-
+- flat_realign(inb, sizeof(uint32_t));
+-
+- return d;
+-}
+-
+-static char *flat_read_stringtable(struct inbuf *inb, int offset)
+-{
+- const char *p;
+-
+- p = inb->base + offset;
+- while (1) {
+- if (p >= inb->limit || p < inb->base)
+- die("String offset %d overruns string table\n",
+- offset);
+-
+- if (*p == '\0')
+- break;
+-
+- p++;
+- }
+-
+- return strdup(inb->base + offset);
+-}
+-
+-static struct property *flat_read_property(struct inbuf *dtbuf,
+- struct inbuf *strbuf, int flags)
+-{
+- uint32_t proplen, stroff;
+- char *name;
+- struct data val;
+-
+- proplen = flat_read_word(dtbuf);
+- stroff = flat_read_word(dtbuf);
+-
+- name = flat_read_stringtable(strbuf, stroff);
+-
+- if ((flags & FTF_VARALIGN) && (proplen >= 8))
+- flat_realign(dtbuf, 8);
+-
+- val = flat_read_data(dtbuf, proplen);
+-
+- return build_property(name, val, NULL);
+-}
+-
+-
+-static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
+-{
+- struct reserve_info *reservelist = NULL;
+- struct reserve_info *new;
+- const char *p;
+- struct fdt_reserve_entry re;
+-
+- /*
+- * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
+- * List terminates at an entry with size equal to zero.
+- *
+- * First pass, count entries.
+- */
+- p = inb->ptr;
+- while (1) {
+- flat_read_chunk(inb, &re, sizeof(re));
+- re.address = fdt64_to_cpu(re.address);
+- re.size = fdt64_to_cpu(re.size);
+- if (re.size == 0)
+- break;
+-
+- new = build_reserve_entry(re.address, re.size, NULL);
+- reservelist = add_reserve_entry(reservelist, new);
+- }
+-
+- return reservelist;
+-}
+-
+-
+-static char *nodename_from_path(const char *ppath, const char *cpath)
+-{
+- int plen;
+-
+- plen = strlen(ppath);
+-
+- if (!strneq(ppath, cpath, plen))
+- die("Path \"%s\" is not valid as a child of \"%s\"\n",
+- cpath, ppath);
+-
+- /* root node is a special case */
+- if (!streq(ppath, "/"))
+- plen++;
+-
+- return strdup(cpath + plen);
+-}
+-
+-static struct node *unflatten_tree(struct inbuf *dtbuf,
+- struct inbuf *strbuf,
+- const char *parent_flatname, int flags)
+-{
+- struct node *node;
+- char *flatname;
+- uint32_t val;
+-
+- node = build_node(NULL, NULL);
+-
+- flatname = flat_read_string(dtbuf);
+-
+- if (flags & FTF_FULLPATH)
+- node->name = nodename_from_path(parent_flatname, flatname);
+- else
+- node->name = flatname;
+-
+- do {
+- struct property *prop;
+- struct node *child;
+-
+- val = flat_read_word(dtbuf);
+- switch (val) {
+- case FDT_PROP:
+- if (node->children)
+- fprintf(stderr, "Warning: Flat tree input has "
+- "subnodes preceding a property.\n");
+- prop = flat_read_property(dtbuf, strbuf, flags);
+- add_property(node, prop);
+- break;
+-
+- case FDT_BEGIN_NODE:
+- child = unflatten_tree(dtbuf,strbuf, flatname, flags);
+- add_child(node, child);
+- break;
+-
+- case FDT_END_NODE:
+- break;
+-
+- case FDT_END:
+- die("Premature FDT_END in device tree blob\n");
+- break;
+-
+- case FDT_NOP:
+- if (!(flags & FTF_NOPS))
+- fprintf(stderr, "Warning: NOP tag found in flat tree"
+- " version <16\n");
+-
+- /* Ignore */
+- break;
+-
+- default:
+- die("Invalid opcode word %08x in device tree blob\n",
+- val);
+- }
+- } while (val != FDT_END_NODE);
+-
+- return node;
+-}
+-
+-
+-struct boot_info *dt_from_blob(const char *fname)
+-{
+- struct dtc_file *dtcf;
+- uint32_t magic, totalsize, version, size_dt, boot_cpuid_phys;
+- uint32_t off_dt, off_str, off_mem_rsvmap;
+- int rc;
+- char *blob;
+- struct fdt_header *fdt;
+- char *p;
+- struct inbuf dtbuf, strbuf;
+- struct inbuf memresvbuf;
+- int sizeleft;
+- struct reserve_info *reservelist;
+- struct node *tree;
+- uint32_t val;
+- int flags = 0;
+-
+- dtcf = dtc_open_file(fname, NULL);
+-
+- rc = fread(&magic, sizeof(magic), 1, dtcf->file);
+- if (ferror(dtcf->file))
+- die("Error reading DT blob magic number: %s\n",
+- strerror(errno));
+- if (rc < 1) {
+- if (feof(dtcf->file))
+- die("EOF reading DT blob magic number\n");
+- else
+- die("Mysterious short read reading magic number\n");
+- }
+-
+- magic = fdt32_to_cpu(magic);
+- if (magic != FDT_MAGIC)
+- die("Blob has incorrect magic number\n");
+-
+- rc = fread(&totalsize, sizeof(totalsize), 1, dtcf->file);
+- if (ferror(dtcf->file))
+- die("Error reading DT blob size: %s\n", strerror(errno));
+- if (rc < 1) {
+- if (feof(dtcf->file))
+- die("EOF reading DT blob size\n");
+- else
+- die("Mysterious short read reading blob size\n");
+- }
+-
+- totalsize = fdt32_to_cpu(totalsize);
+- if (totalsize < FDT_V1_SIZE)
+- die("DT blob size (%d) is too small\n", totalsize);
+-
+- blob = xmalloc(totalsize);
+-
+- fdt = (struct fdt_header *)blob;
+- fdt->magic = cpu_to_fdt32(magic);
+- fdt->totalsize = cpu_to_fdt32(totalsize);
+-
+- sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
+- p = blob + sizeof(magic) + sizeof(totalsize);
+-
+- while (sizeleft) {
+- if (feof(dtcf->file))
+- die("EOF before reading %d bytes of DT blob\n",
+- totalsize);
+-
+- rc = fread(p, 1, sizeleft, dtcf->file);
+- if (ferror(dtcf->file))
+- die("Error reading DT blob: %s\n",
+- strerror(errno));
+-
+- sizeleft -= rc;
+- p += rc;
+- }
+-
+- off_dt = fdt32_to_cpu(fdt->off_dt_struct);
+- off_str = fdt32_to_cpu(fdt->off_dt_strings);
+- off_mem_rsvmap = fdt32_to_cpu(fdt->off_mem_rsvmap);
+- version = fdt32_to_cpu(fdt->version);
+- boot_cpuid_phys = fdt32_to_cpu(fdt->boot_cpuid_phys);
+-
+- if (off_mem_rsvmap >= totalsize)
+- die("Mem Reserve structure offset exceeds total size\n");
+-
+- if (off_dt >= totalsize)
+- die("DT structure offset exceeds total size\n");
+-
+- if (off_str > totalsize)
+- die("String table offset exceeds total size\n");
+-
+- if (version >= 3) {
+- uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings);
+- if (off_str+size_str > totalsize)
+- die("String table extends past total size\n");
+- inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
+- } else {
+- inbuf_init(&strbuf, blob + off_str, blob + totalsize);
+- }
+-
+- if (version >= 17) {
+- size_dt = fdt32_to_cpu(fdt->size_dt_struct);
+- if (off_dt+size_dt > totalsize)
+- die("Structure block extends past total size\n");
+- }
+-
+- if (version < 16) {
+- flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
+- } else {
+- flags |= FTF_NOPS;
+- }
+-
+- inbuf_init(&memresvbuf,
+- blob + off_mem_rsvmap, blob + totalsize);
+- inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
+-
+- reservelist = flat_read_mem_reserve(&memresvbuf);
+-
+- val = flat_read_word(&dtbuf);
+-
+- if (val != FDT_BEGIN_NODE)
+- die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
+-
+- tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
+-
+- val = flat_read_word(&dtbuf);
+- if (val != FDT_END)
+- die("Device tree blob doesn't end with FDT_END\n");
+-
+- free(blob);
+-
+- dtc_close_file(dtcf);
+-
+- return build_boot_info(reservelist, tree, boot_cpuid_phys);
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/fstree.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/fstree.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/fstree.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/fstree.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,92 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-
+-#include <dirent.h>
+-#include <sys/stat.h>
+-
+-static struct node *read_fstree(const char *dirname)
+-{
+- DIR *d;
+- struct dirent *de;
+- struct stat st;
+- struct node *tree;
+-
+- d = opendir(dirname);
+- if (!d)
+- die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno));
+-
+- tree = build_node(NULL, NULL);
+-
+- while ((de = readdir(d)) != NULL) {
+- char *tmpnam;
+-
+- if (streq(de->d_name, ".")
+- || streq(de->d_name, ".."))
+- continue;
+-
+- tmpnam = join_path(dirname, de->d_name);
+-
+- if (lstat(tmpnam, &st) < 0)
+- die("stat(%s): %s\n", tmpnam, strerror(errno));
+-
+- if (S_ISREG(st.st_mode)) {
+- struct property *prop;
+- FILE *pfile;
+-
+- pfile = fopen(tmpnam, "r");
+- if (! pfile) {
+- fprintf(stderr,
+- "WARNING: Cannot open %s: %s\n",
+- tmpnam, strerror(errno));
+- } else {
+- prop = build_property(strdup(de->d_name),
+- data_copy_file(pfile,
+- st.st_size),
+- NULL);
+- add_property(tree, prop);
+- fclose(pfile);
+- }
+- } else if (S_ISDIR(st.st_mode)) {
+- struct node *newchild;
+-
+- newchild = read_fstree(tmpnam);
+- newchild = name_node(newchild, strdup(de->d_name),
+- NULL);
+- add_child(tree, newchild);
+- }
+-
+- free(tmpnam);
+- }
+-
+- return tree;
+-}
+-
+-struct boot_info *dt_from_fs(const char *dirname)
+-{
+- struct node *tree;
+-
+- tree = read_fstree(dirname);
+- tree = name_node(tree, "", NULL);
+-
+- return build_boot_info(NULL, tree, 0);
+-}
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/libfdt_env.h linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/libfdt_env.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/libfdt_env.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/libfdt_env.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,23 +0,0 @@
+-#ifndef _LIBFDT_ENV_H
+-#define _LIBFDT_ENV_H
+-
+-#include <stddef.h>
+-#include <stdint.h>
+-#include <string.h>
+-
+-#define _B(n) ((unsigned long long)((uint8_t *)&x)[n])
+-static inline uint32_t fdt32_to_cpu(uint32_t x)
+-{
+- return (_B(0) << 24) | (_B(1) << 16) | (_B(2) << 8) | _B(3);
+-}
+-#define cpu_to_fdt32(x) fdt32_to_cpu(x)
+-
+-static inline uint64_t fdt64_to_cpu(uint64_t x)
+-{
+- return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
+- | (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
+-}
+-#define cpu_to_fdt64(x) fdt64_to_cpu(x)
+-#undef _B
+-
+-#endif /* _LIBFDT_ENV_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/livetree.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/livetree.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/livetree.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/livetree.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,308 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-
+-/*
+- * Tree building functions
+- */
+-
+-struct property *build_property(char *name, struct data val, char *label)
+-{
+- struct property *new = xmalloc(sizeof(*new));
+-
+- new->name = name;
+- new->val = val;
+-
+- new->next = NULL;
+-
+- new->label = label;
+-
+- return new;
+-}
+-
+-struct property *chain_property(struct property *first, struct property *list)
+-{
+- assert(first->next == NULL);
+-
+- first->next = list;
+- return first;
+-}
+-
+-struct property *reverse_properties(struct property *first)
+-{
+- struct property *p = first;
+- struct property *head = NULL;
+- struct property *next;
+-
+- while (p) {
+- next = p->next;
+- p->next = head;
+- head = p;
+- p = next;
+- }
+- return head;
+-}
+-
+-struct node *build_node(struct property *proplist, struct node *children)
+-{
+- struct node *new = xmalloc(sizeof(*new));
+- struct node *child;
+-
+- memset(new, 0, sizeof(*new));
+-
+- new->proplist = reverse_properties(proplist);
+- new->children = children;
+-
+- for_each_child(new, child) {
+- child->parent = new;
+- }
+-
+- return new;
+-}
+-
+-struct node *name_node(struct node *node, char *name, char * label)
+-{
+- assert(node->name == NULL);
+-
+- node->name = name;
+-
+- node->label = label;
+-
+- return node;
+-}
+-
+-struct node *chain_node(struct node *first, struct node *list)
+-{
+- assert(first->next_sibling == NULL);
+-
+- first->next_sibling = list;
+- return first;
+-}
+-
+-void add_property(struct node *node, struct property *prop)
+-{
+- struct property **p;
+-
+- prop->next = NULL;
+-
+- p = &node->proplist;
+- while (*p)
+- p = &((*p)->next);
+-
+- *p = prop;
+-}
+-
+-void add_child(struct node *parent, struct node *child)
+-{
+- struct node **p;
+-
+- child->next_sibling = NULL;
+- child->parent = parent;
+-
+- p = &parent->children;
+- while (*p)
+- p = &((*p)->next_sibling);
+-
+- *p = child;
+-}
+-
+-struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size,
+- char *label)
+-{
+- struct reserve_info *new = xmalloc(sizeof(*new));
+-
+- new->re.address = address;
+- new->re.size = size;
+-
+- new->next = NULL;
+-
+- new->label = label;
+-
+- return new;
+-}
+-
+-struct reserve_info *chain_reserve_entry(struct reserve_info *first,
+- struct reserve_info *list)
+-{
+- assert(first->next == NULL);
+-
+- first->next = list;
+- return first;
+-}
+-
+-struct reserve_info *add_reserve_entry(struct reserve_info *list,
+- struct reserve_info *new)
+-{
+- struct reserve_info *last;
+-
+- new->next = NULL;
+-
+- if (! list)
+- return new;
+-
+- for (last = list; last->next; last = last->next)
+- ;
+-
+- last->next = new;
+-
+- return list;
+-}
+-
+-struct boot_info *build_boot_info(struct reserve_info *reservelist,
+- struct node *tree, uint32_t boot_cpuid_phys)
+-{
+- struct boot_info *bi;
+-
+- bi = xmalloc(sizeof(*bi));
+- bi->reservelist = reservelist;
+- bi->dt = tree;
+- bi->boot_cpuid_phys = boot_cpuid_phys;
+-
+- return bi;
+-}
+-
+-/*
+- * Tree accessor functions
+- */
+-
+-const char *get_unitname(struct node *node)
+-{
+- if (node->name[node->basenamelen] == '\0')
+- return "";
+- else
+- return node->name + node->basenamelen + 1;
+-}
+-
+-struct property *get_property(struct node *node, const char *propname)
+-{
+- struct property *prop;
+-
+- for_each_property(node, prop)
+- if (streq(prop->name, propname))
+- return prop;
+-
+- return NULL;
+-}
+-
+-cell_t propval_cell(struct property *prop)
+-{
+- assert(prop->val.len == sizeof(cell_t));
+- return fdt32_to_cpu(*((cell_t *)prop->val.val));
+-}
+-
+-struct node *get_subnode(struct node *node, const char *nodename)
+-{
+- struct node *child;
+-
+- for_each_child(node, child)
+- if (streq(child->name, nodename))
+- return child;
+-
+- return NULL;
+-}
+-
+-struct node *get_node_by_path(struct node *tree, const char *path)
+-{
+- const char *p;
+- struct node *child;
+-
+- if (!path || ! (*path))
+- return tree;
+-
+- while (path[0] == '/')
+- path++;
+-
+- p = strchr(path, '/');
+-
+- for_each_child(tree, child) {
+- if (p && strneq(path, child->name, p-path))
+- return get_node_by_path(child, p+1);
+- else if (!p && streq(path, child->name))
+- return child;
+- }
+-
+- return NULL;
+-}
+-
+-struct node *get_node_by_label(struct node *tree, const char *label)
+-{
+- struct node *child, *node;
+-
+- assert(label && (strlen(label) > 0));
+-
+- if (tree->label && streq(tree->label, label))
+- return tree;
+-
+- for_each_child(tree, child) {
+- node = get_node_by_label(child, label);
+- if (node)
+- return node;
+- }
+-
+- return NULL;
+-}
+-
+-struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
+-{
+- struct node *child, *node;
+-
+- assert((phandle != 0) && (phandle != -1));
+-
+- if (tree->phandle == phandle)
+- return tree;
+-
+- for_each_child(tree, child) {
+- node = get_node_by_phandle(child, phandle);
+- if (node)
+- return node;
+- }
+-
+- return NULL;
+-}
+-
+-struct node *get_node_by_ref(struct node *tree, const char *ref)
+-{
+- if (ref[0] == '/')
+- return get_node_by_path(tree, ref);
+- else
+- return get_node_by_label(tree, ref);
+-}
+-
+-cell_t get_node_phandle(struct node *root, struct node *node)
+-{
+- static cell_t phandle = 1; /* FIXME: ick, static local */
+-
+- if ((node->phandle != 0) && (node->phandle != -1))
+- return node->phandle;
+-
+- assert(! get_property(node, "linux,phandle"));
+-
+- while (get_node_by_phandle(root, phandle))
+- phandle++;
+-
+- node->phandle = phandle;
+- add_property(node,
+- build_property("linux,phandle",
+- data_append_cell(empty_data, phandle),
+- NULL));
+-
+- return node->phandle;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/Makefile.dtc linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/Makefile.dtc
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/Makefile.dtc 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/Makefile.dtc 1970-01-01 01:00:00.000000000 +0100
+@@ -1,9 +0,0 @@
+-# Makefile.dtc
+-#
+-# This is not a complete Makefile of itself. Instead, it is designed to
+-# be easily embeddable into other systems of Makefiles.
+-#
+-DTC_SRCS = dtc.c flattree.c fstree.c data.c livetree.c treesource.c srcpos.c \
+- checks.c
+-DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
+-DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/srcpos.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/srcpos.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/srcpos.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/srcpos.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,116 +0,0 @@
+-/*
+- * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+- *
+- * 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 "dtc.h"
+-#include "srcpos.h"
+-
+-/*
+- * Like yylineno, this is the current open file pos.
+- */
+-
+-struct dtc_file *srcpos_file;
+-
+-static int dtc_open_one(struct dtc_file *file,
+- const char *search,
+- const char *fname)
+-{
+- char *fullname;
+-
+- if (search) {
+- fullname = xmalloc(strlen(search) + strlen(fname) + 2);
+-
+- strcpy(fullname, search);
+- strcat(fullname, "/");
+- strcat(fullname, fname);
+- } else {
+- fullname = strdup(fname);
+- }
+-
+- file->file = fopen(fullname, "r");
+- if (!file->file) {
+- free(fullname);
+- return 0;
+- }
+-
+- file->name = fullname;
+- return 1;
+-}
+-
+-
+-struct dtc_file *dtc_open_file(const char *fname,
+- const struct search_path *search)
+-{
+- static const struct search_path default_search = { NULL, NULL, NULL };
+-
+- struct dtc_file *file;
+- const char *slash;
+-
+- file = xmalloc(sizeof(struct dtc_file));
+-
+- slash = strrchr(fname, '/');
+- if (slash) {
+- char *dir = xmalloc(slash - fname + 1);
+-
+- memcpy(dir, fname, slash - fname);
+- dir[slash - fname] = 0;
+- file->dir = dir;
+- } else {
+- file->dir = NULL;
+- }
+-
+- if (streq(fname, "-")) {
+- file->name = "stdin";
+- file->file = stdin;
+- return file;
+- }
+-
+- if (fname[0] == '/') {
+- file->file = fopen(fname, "r");
+- if (!file->file)
+- goto fail;
+-
+- file->name = strdup(fname);
+- return file;
+- }
+-
+- if (!search)
+- search = &default_search;
+-
+- while (search) {
+- if (dtc_open_one(file, search->dir, fname))
+- return file;
+-
+- if (errno != ENOENT)
+- goto fail;
+-
+- search = search->next;
+- }
+-
+-fail:
+- die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
+-}
+-
+-void dtc_close_file(struct dtc_file *file)
+-{
+- if (fclose(file->file))
+- die("Error closing \"%s\": %s\n", file->name, strerror(errno));
+-
+- free(file->dir);
+- free(file);
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/srcpos.h linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/srcpos.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/srcpos.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/srcpos.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,85 +0,0 @@
+-/*
+- * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+- *
+- * 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
+- */
+-
+-/*
+- * Augment the standard YYLTYPE with a filenum index into an
+- * array of all opened filenames.
+- */
+-
+-#include <stdio.h>
+-
+-struct dtc_file {
+- char *dir;
+- const char *name;
+- FILE *file;
+-};
+-
+-#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
+-typedef struct YYLTYPE {
+- int first_line;
+- int first_column;
+- int last_line;
+- int last_column;
+- struct dtc_file *file;
+-} YYLTYPE;
+-
+-#define YYLTYPE_IS_DECLARED 1
+-#define YYLTYPE_IS_TRIVIAL 1
+-#endif
+-
+-/* Cater to old parser templates. */
+-#ifndef YYID
+-#define YYID(n) (n)
+-#endif
+-
+-#define YYLLOC_DEFAULT(Current, Rhs, N) \
+- do \
+- if (YYID (N)) \
+- { \
+- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+- (Current).file = YYRHSLOC (Rhs, N).file; \
+- } \
+- else \
+- { \
+- (Current).first_line = (Current).last_line = \
+- YYRHSLOC (Rhs, 0).last_line; \
+- (Current).first_column = (Current).last_column = \
+- YYRHSLOC (Rhs, 0).last_column; \
+- (Current).file = YYRHSLOC (Rhs, 0).file; \
+- } \
+- while (YYID (0))
+-
+-
+-
+-extern void yyerror(char const *);
+-extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
+-
+-extern struct dtc_file *srcpos_file;
+-
+-struct search_path {
+- const char *dir; /* NULL for current directory */
+- struct search_path *prev, *next;
+-};
+-
+-extern struct dtc_file *dtc_open_file(const char *fname,
+- const struct search_path *search);
+-extern void dtc_close_file(struct dtc_file *file);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/treesource.c linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/treesource.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/treesource.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/treesource.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,278 +0,0 @@
+-/*
+- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
+-#include "srcpos.h"
+-
+-extern FILE *yyin;
+-extern int yyparse(void);
+-
+-struct boot_info *the_boot_info;
+-int treesource_error;
+-
+-struct boot_info *dt_from_source(const char *fname)
+-{
+- the_boot_info = NULL;
+- treesource_error = 0;
+-
+- srcpos_file = dtc_open_file(fname, NULL);
+- yyin = srcpos_file->file;
+-
+- if (yyparse() != 0)
+- die("Unable to parse input tree\n");
+-
+- if (treesource_error)
+- die("Syntax error parsing input tree\n");
+-
+- return the_boot_info;
+-}
+-
+-static void write_prefix(FILE *f, int level)
+-{
+- int i;
+-
+- for (i = 0; i < level; i++)
+- fputc('\t', f);
+-}
+-
+-int isstring(char c)
+-{
+- return (isprint(c)
+- || (c == '\0')
+- || strchr("\a\b\t\n\v\f\r", c));
+-}
+-
+-static void write_propval_string(FILE *f, struct data val)
+-{
+- const char *str = val.val;
+- int i;
+- int newchunk = 1;
+- struct marker *m = val.markers;
+-
+- assert(str[val.len-1] == '\0');
+-
+- for (i = 0; i < (val.len-1); i++) {
+- char c = str[i];
+-
+- if (newchunk) {
+- while (m && (m->offset <= i)) {
+- if (m->type == LABEL) {
+- assert(m->offset == i);
+- fprintf(f, "%s: ", m->ref);
+- }
+- m = m->next;
+- }
+- fprintf(f, "\"");
+- newchunk = 0;
+- }
+-
+- switch (c) {
+- case '\a':
+- fprintf(f, "\\a");
+- break;
+- case '\b':
+- fprintf(f, "\\b");
+- break;
+- case '\t':
+- fprintf(f, "\\t");
+- break;
+- case '\n':
+- fprintf(f, "\\n");
+- break;
+- case '\v':
+- fprintf(f, "\\v");
+- break;
+- case '\f':
+- fprintf(f, "\\f");
+- break;
+- case '\r':
+- fprintf(f, "\\r");
+- break;
+- case '\\':
+- fprintf(f, "\\\\");
+- break;
+- case '\"':
+- fprintf(f, "\\\"");
+- break;
+- case '\0':
+- fprintf(f, "\", ");
+- newchunk = 1;
+- break;
+- default:
+- if (isprint(c))
+- fprintf(f, "%c", c);
+- else
+- fprintf(f, "\\x%02hhx", c);
+- }
+- }
+- fprintf(f, "\"");
+-
+- /* Wrap up any labels at the end of the value */
+- for_each_marker_of_type(m, LABEL) {
+- assert (m->offset == val.len);
+- fprintf(f, " %s:", m->ref);
+- }
+-}
+-
+-static void write_propval_cells(FILE *f, struct data val)
+-{
+- void *propend = val.val + val.len;
+- cell_t *cp = (cell_t *)val.val;
+- struct marker *m = val.markers;
+-
+- fprintf(f, "<");
+- for (;;) {
+- while (m && (m->offset <= ((char *)cp - val.val))) {
+- if (m->type == LABEL) {
+- assert(m->offset == ((char *)cp - val.val));
+- fprintf(f, "%s: ", m->ref);
+- }
+- m = m->next;
+- }
+-
+- fprintf(f, "0x%x", fdt32_to_cpu(*cp++));
+- if ((void *)cp >= propend)
+- break;
+- fprintf(f, " ");
+- }
+-
+- /* Wrap up any labels at the end of the value */
+- for_each_marker_of_type(m, LABEL) {
+- assert (m->offset == val.len);
+- fprintf(f, " %s:", m->ref);
+- }
+- fprintf(f, ">");
+-}
+-
+-static void write_propval_bytes(FILE *f, struct data val)
+-{
+- void *propend = val.val + val.len;
+- const char *bp = val.val;
+- struct marker *m = val.markers;
+-
+- fprintf(f, "[");
+- for (;;) {
+- while (m && (m->offset == (bp-val.val))) {
+- if (m->type == LABEL)
+- fprintf(f, "%s: ", m->ref);
+- m = m->next;
+- }
+-
+- fprintf(f, "%02hhx", *bp++);
+- if ((const void *)bp >= propend)
+- break;
+- fprintf(f, " ");
+- }
+-
+- /* Wrap up any labels at the end of the value */
+- for_each_marker_of_type(m, LABEL) {
+- assert (m->offset == val.len);
+- fprintf(f, " %s:", m->ref);
+- }
+- fprintf(f, "]");
+-}
+-
+-static void write_propval(FILE *f, struct property *prop)
+-{
+- int len = prop->val.len;
+- const char *p = prop->val.val;
+- struct marker *m = prop->val.markers;
+- int nnotstring = 0, nnul = 0;
+- int nnotstringlbl = 0, nnotcelllbl = 0;
+- int i;
+-
+- if (len == 0) {
+- fprintf(f, ";\n");
+- return;
+- }
+-
+- for (i = 0; i < len; i++) {
+- if (! isstring(p[i]))
+- nnotstring++;
+- if (p[i] == '\0')
+- nnul++;
+- }
+-
+- for_each_marker_of_type(m, LABEL) {
+- if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
+- nnotstringlbl++;
+- if ((m->offset % sizeof(cell_t)) != 0)
+- nnotcelllbl++;
+- }
+-
+- fprintf(f, " = ");
+- if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
+- && (nnotstringlbl == 0)) {
+- write_propval_string(f, prop->val);
+- } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
+- write_propval_cells(f, prop->val);
+- } else {
+- write_propval_bytes(f, prop->val);
+- }
+-
+- fprintf(f, ";\n");
+-}
+-
+-static void write_tree_source_node(FILE *f, struct node *tree, int level)
+-{
+- struct property *prop;
+- struct node *child;
+-
+- write_prefix(f, level);
+- if (tree->label)
+- fprintf(f, "%s: ", tree->label);
+- if (tree->name && (*tree->name))
+- fprintf(f, "%s {\n", tree->name);
+- else
+- fprintf(f, "/ {\n");
+-
+- for_each_property(tree, prop) {
+- write_prefix(f, level+1);
+- if (prop->label)
+- fprintf(f, "%s: ", prop->label);
+- fprintf(f, "%s", prop->name);
+- write_propval(f, prop);
+- }
+- for_each_child(tree, child) {
+- fprintf(f, "\n");
+- write_tree_source_node(f, child, level+1);
+- }
+- write_prefix(f, level);
+- fprintf(f, "};\n");
+-}
+-
+-
+-void dt_to_source(FILE *f, struct boot_info *bi)
+-{
+- struct reserve_info *re;
+-
+- fprintf(f, "/dts-v1/;\n\n");
+-
+- for (re = bi->reservelist; re; re = re->next) {
+- if (re->label)
+- fprintf(f, "%s: ", re->label);
+- fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
+- (unsigned long long)re->re.address,
+- (unsigned long long)re->re.size);
+- }
+-
+- write_tree_source_node(f, bi->dt, 0);
+-}
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/version_gen.h linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/version_gen.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/dtc-src/version_gen.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/dtc-src/version_gen.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1 +0,0 @@
+-#define DTC_VERSION "DTC 1.2.0"
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,201 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-int fdt_check_header(const void *fdt)
+-{
+- if (fdt_magic(fdt) == FDT_MAGIC) {
+- /* Complete tree */
+- if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
+- return -FDT_ERR_BADVERSION;
+- if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
+- return -FDT_ERR_BADVERSION;
+- } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
+- /* Unfinished sequential-write blob */
+- if (fdt_size_dt_struct(fdt) == 0)
+- return -FDT_ERR_BADSTATE;
+- } else {
+- return -FDT_ERR_BADMAGIC;
+- }
+-
+- return 0;
+-}
+-
+-const void *fdt_offset_ptr(const void *fdt, int offset, int len)
+-{
+- const char *p;
+-
+- if (fdt_version(fdt) >= 0x11)
+- if (((offset + len) < offset)
+- || ((offset + len) > fdt_size_dt_struct(fdt)))
+- return NULL;
+-
+- p = _fdt_offset_ptr(fdt, offset);
+-
+- if (p + len < p)
+- return NULL;
+- return p;
+-}
+-
+-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
+-{
+- const uint32_t *tagp, *lenp;
+- uint32_t tag;
+- const char *p;
+-
+- if (offset % FDT_TAGSIZE)
+- return -1;
+-
+- tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
+- if (! tagp)
+- return FDT_END; /* premature end */
+- tag = fdt32_to_cpu(*tagp);
+- offset += FDT_TAGSIZE;
+-
+- switch (tag) {
+- case FDT_BEGIN_NODE:
+- /* skip name */
+- do {
+- p = fdt_offset_ptr(fdt, offset++, 1);
+- } while (p && (*p != '\0'));
+- if (! p)
+- return FDT_END;
+- break;
+- case FDT_PROP:
+- lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
+- if (! lenp)
+- return FDT_END;
+- /* skip name offset, length and value */
+- offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
+- break;
+- }
+-
+- if (nextoffset)
+- *nextoffset = FDT_TAGALIGN(offset);
+-
+- return tag;
+-}
+-
+-int _fdt_check_node_offset(const void *fdt, int offset)
+-{
+- if ((offset < 0) || (offset % FDT_TAGSIZE)
+- || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
+- return -FDT_ERR_BADOFFSET;
+-
+- return offset;
+-}
+-
+-int fdt_next_node(const void *fdt, int offset, int *depth)
+-{
+- int nextoffset = 0;
+- uint32_t tag;
+-
+- if (offset >= 0)
+- if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
+- return nextoffset;
+-
+- do {
+- offset = nextoffset;
+- tag = fdt_next_tag(fdt, offset, &nextoffset);
+-
+- switch (tag) {
+- case FDT_PROP:
+- case FDT_NOP:
+- break;
+-
+- case FDT_BEGIN_NODE:
+- if (depth)
+- (*depth)++;
+- break;
+-
+- case FDT_END_NODE:
+- if (depth)
+- (*depth)--;
+- break;
+-
+- case FDT_END:
+- return -FDT_ERR_NOTFOUND;
+-
+- default:
+- return -FDT_ERR_BADSTRUCTURE;
+- }
+- } while (tag != FDT_BEGIN_NODE);
+-
+- return offset;
+-}
+-
+-const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
+-{
+- int len = strlen(s) + 1;
+- const char *last = strtab + tabsize - len;
+- const char *p;
+-
+- for (p = strtab; p <= last; p++)
+- if (memcmp(p, s, len) == 0)
+- return p;
+- return NULL;
+-}
+-
+-int fdt_move(const void *fdt, void *buf, int bufsize)
+-{
+- FDT_CHECK_HEADER(fdt);
+-
+- if (fdt_totalsize(fdt) > bufsize)
+- return -FDT_ERR_NOSPACE;
+-
+- memmove(buf, fdt, fdt_totalsize(fdt));
+- return 0;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt.h linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,60 +0,0 @@
+-#ifndef _FDT_H
+-#define _FDT_H
+-
+-#ifndef __ASSEMBLY__
+-
+-struct fdt_header {
+- uint32_t magic; /* magic word FDT_MAGIC */
+- uint32_t totalsize; /* total size of DT block */
+- uint32_t off_dt_struct; /* offset to structure */
+- uint32_t off_dt_strings; /* offset to strings */
+- uint32_t off_mem_rsvmap; /* offset to memory reserve map */
+- uint32_t version; /* format version */
+- uint32_t last_comp_version; /* last compatible version */
+-
+- /* version 2 fields below */
+- uint32_t boot_cpuid_phys; /* Which physical CPU id we're
+- booting on */
+- /* version 3 fields below */
+- uint32_t size_dt_strings; /* size of the strings block */
+-
+- /* version 17 fields below */
+- uint32_t size_dt_struct; /* size of the structure block */
+-};
+-
+-struct fdt_reserve_entry {
+- uint64_t address;
+- uint64_t size;
+-};
+-
+-struct fdt_node_header {
+- uint32_t tag;
+- char name[0];
+-};
+-
+-struct fdt_property {
+- uint32_t tag;
+- uint32_t len;
+- uint32_t nameoff;
+- char data[0];
+-};
+-
+-#endif /* !__ASSEMBLY */
+-
+-#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
+-#define FDT_TAGSIZE sizeof(uint32_t)
+-
+-#define FDT_BEGIN_NODE 0x1 /* Start node: full name */
+-#define FDT_END_NODE 0x2 /* End node */
+-#define FDT_PROP 0x3 /* Property: name off,
+- size, content */
+-#define FDT_NOP 0x4 /* nop */
+-#define FDT_END 0x9
+-
+-#define FDT_V1_SIZE (7*sizeof(uint32_t))
+-#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
+-#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
+-#define FDT_V16_SIZE FDT_V3_SIZE
+-#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
+-
+-#endif /* _FDT_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_ro.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_ro.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_ro.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_ro.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,469 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-static int _fdt_nodename_eq(const void *fdt, int offset,
+- const char *s, int len)
+-{
+- const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
+-
+- if (! p)
+- /* short match */
+- return 0;
+-
+- if (memcmp(p, s, len) != 0)
+- return 0;
+-
+- if (p[len] == '\0')
+- return 1;
+- else if (!memchr(s, '@', len) && (p[len] == '@'))
+- return 1;
+- else
+- return 0;
+-}
+-
+-const char *fdt_string(const void *fdt, int stroffset)
+-{
+- return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
+-}
+-
+-int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
+-{
+- FDT_CHECK_HEADER(fdt);
+- *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
+- *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
+- return 0;
+-}
+-
+-int fdt_num_mem_rsv(const void *fdt)
+-{
+- int i = 0;
+-
+- while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
+- i++;
+- return i;
+-}
+-
+-int fdt_subnode_offset_namelen(const void *fdt, int offset,
+- const char *name, int namelen)
+-{
+- int depth;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- for (depth = 0, offset = fdt_next_node(fdt, offset, &depth);
+- (offset >= 0) && (depth > 0);
+- offset = fdt_next_node(fdt, offset, &depth)) {
+- if (depth < 0)
+- return -FDT_ERR_NOTFOUND;
+- else if ((depth == 1)
+- && _fdt_nodename_eq(fdt, offset, name, namelen))
+- return offset;
+- }
+-
+- if (offset < 0)
+- return offset; /* error */
+- else
+- return -FDT_ERR_NOTFOUND;
+-}
+-
+-int fdt_subnode_offset(const void *fdt, int parentoffset,
+- const char *name)
+-{
+- return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
+-}
+-
+-int fdt_path_offset(const void *fdt, const char *path)
+-{
+- const char *end = path + strlen(path);
+- const char *p = path;
+- int offset = 0;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- if (*path != '/')
+- return -FDT_ERR_BADPATH;
+-
+- while (*p) {
+- const char *q;
+-
+- while (*p == '/')
+- p++;
+- if (! *p)
+- return offset;
+- q = strchr(p, '/');
+- if (! q)
+- q = end;
+-
+- offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
+- if (offset < 0)
+- return offset;
+-
+- p = q;
+- }
+-
+- return offset;
+-}
+-
+-const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
+-{
+- const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
+- int err;
+-
+- if (((err = fdt_check_header(fdt)) != 0)
+- || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
+- goto fail;
+-
+- if (len)
+- *len = strlen(nh->name);
+-
+- return nh->name;
+-
+- fail:
+- if (len)
+- *len = err;
+- return NULL;
+-}
+-
+-const struct fdt_property *fdt_get_property(const void *fdt,
+- int nodeoffset,
+- const char *name, int *lenp)
+-{
+- uint32_t tag;
+- const struct fdt_property *prop;
+- int namestroff;
+- int offset, nextoffset;
+- int err;
+-
+- if (((err = fdt_check_header(fdt)) != 0)
+- || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
+- goto fail;
+-
+- nextoffset = err;
+- do {
+- offset = nextoffset;
+-
+- tag = fdt_next_tag(fdt, offset, &nextoffset);
+- switch (tag) {
+- case FDT_END:
+- err = -FDT_ERR_TRUNCATED;
+- goto fail;
+-
+- case FDT_BEGIN_NODE:
+- case FDT_END_NODE:
+- case FDT_NOP:
+- break;
+-
+- case FDT_PROP:
+- err = -FDT_ERR_BADSTRUCTURE;
+- prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
+- if (! prop)
+- goto fail;
+- namestroff = fdt32_to_cpu(prop->nameoff);
+- if (strcmp(fdt_string(fdt, namestroff), name) == 0) {
+- /* Found it! */
+- int len = fdt32_to_cpu(prop->len);
+- prop = fdt_offset_ptr(fdt, offset,
+- sizeof(*prop)+len);
+- if (! prop)
+- goto fail;
+-
+- if (lenp)
+- *lenp = len;
+-
+- return prop;
+- }
+- break;
+-
+- default:
+- err = -FDT_ERR_BADSTRUCTURE;
+- goto fail;
+- }
+- } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
+-
+- err = -FDT_ERR_NOTFOUND;
+- fail:
+- if (lenp)
+- *lenp = err;
+- return NULL;
+-}
+-
+-const void *fdt_getprop(const void *fdt, int nodeoffset,
+- const char *name, int *lenp)
+-{
+- const struct fdt_property *prop;
+-
+- prop = fdt_get_property(fdt, nodeoffset, name, lenp);
+- if (! prop)
+- return NULL;
+-
+- return prop->data;
+-}
+-
+-uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
+-{
+- const uint32_t *php;
+- int len;
+-
+- php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
+- if (!php || (len != sizeof(*php)))
+- return 0;
+-
+- return fdt32_to_cpu(*php);
+-}
+-
+-int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
+-{
+- int pdepth = 0, p = 0;
+- int offset, depth, namelen;
+- const char *name;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- if (buflen < 2)
+- return -FDT_ERR_NOSPACE;
+-
+- for (offset = 0, depth = 0;
+- (offset >= 0) && (offset <= nodeoffset);
+- offset = fdt_next_node(fdt, offset, &depth)) {
+- if (pdepth < depth)
+- continue; /* overflowed buffer */
+-
+- while (pdepth > depth) {
+- do {
+- p--;
+- } while (buf[p-1] != '/');
+- pdepth--;
+- }
+-
+- name = fdt_get_name(fdt, offset, &namelen);
+- if (!name)
+- return namelen;
+- if ((p + namelen + 1) <= buflen) {
+- memcpy(buf + p, name, namelen);
+- p += namelen;
+- buf[p++] = '/';
+- pdepth++;
+- }
+-
+- if (offset == nodeoffset) {
+- if (pdepth < (depth + 1))
+- return -FDT_ERR_NOSPACE;
+-
+- if (p > 1) /* special case so that root path is "/", not "" */
+- p--;
+- buf[p] = '\0';
+- return p;
+- }
+- }
+-
+- if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+- return -FDT_ERR_BADOFFSET;
+- else if (offset == -FDT_ERR_BADOFFSET)
+- return -FDT_ERR_BADSTRUCTURE;
+-
+- return offset; /* error from fdt_next_node() */
+-}
+-
+-int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+- int supernodedepth, int *nodedepth)
+-{
+- int offset, depth;
+- int supernodeoffset = -FDT_ERR_INTERNAL;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- if (supernodedepth < 0)
+- return -FDT_ERR_NOTFOUND;
+-
+- for (offset = 0, depth = 0;
+- (offset >= 0) && (offset <= nodeoffset);
+- offset = fdt_next_node(fdt, offset, &depth)) {
+- if (depth == supernodedepth)
+- supernodeoffset = offset;
+-
+- if (offset == nodeoffset) {
+- if (nodedepth)
+- *nodedepth = depth;
+-
+- if (supernodedepth > depth)
+- return -FDT_ERR_NOTFOUND;
+- else
+- return supernodeoffset;
+- }
+- }
+-
+- if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+- return -FDT_ERR_BADOFFSET;
+- else if (offset == -FDT_ERR_BADOFFSET)
+- return -FDT_ERR_BADSTRUCTURE;
+-
+- return offset; /* error from fdt_next_node() */
+-}
+-
+-int fdt_node_depth(const void *fdt, int nodeoffset)
+-{
+- int nodedepth;
+- int err;
+-
+- err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
+- if (err)
+- return (err < 0) ? err : -FDT_ERR_INTERNAL;
+- return nodedepth;
+-}
+-
+-int fdt_parent_offset(const void *fdt, int nodeoffset)
+-{
+- int nodedepth = fdt_node_depth(fdt, nodeoffset);
+-
+- if (nodedepth < 0)
+- return nodedepth;
+- return fdt_supernode_atdepth_offset(fdt, nodeoffset,
+- nodedepth - 1, NULL);
+-}
+-
+-int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+- const char *propname,
+- const void *propval, int proplen)
+-{
+- int offset;
+- const void *val;
+- int len;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- /* FIXME: The algorithm here is pretty horrible: we scan each
+- * property of a node in fdt_getprop(), then if that didn't
+- * find what we want, we scan over them again making our way
+- * to the next node. Still it's the easiest to implement
+- * approach; performance can come later. */
+- for (offset = fdt_next_node(fdt, startoffset, NULL);
+- offset >= 0;
+- offset = fdt_next_node(fdt, offset, NULL)) {
+- val = fdt_getprop(fdt, offset, propname, &len);
+- if (val && (len == proplen)
+- && (memcmp(val, propval, len) == 0))
+- return offset;
+- }
+-
+- return offset; /* error from fdt_next_node() */
+-}
+-
+-int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
+-{
+- if ((phandle == 0) || (phandle == -1))
+- return -FDT_ERR_BADPHANDLE;
+- phandle = cpu_to_fdt32(phandle);
+- return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
+- &phandle, sizeof(phandle));
+-}
+-
+-int _stringlist_contains(const char *strlist, int listlen, const char *str)
+-{
+- int len = strlen(str);
+- const char *p;
+-
+- while (listlen >= len) {
+- if (memcmp(str, strlist, len+1) == 0)
+- return 1;
+- p = memchr(strlist, '\0', listlen);
+- if (!p)
+- return 0; /* malformed strlist.. */
+- listlen -= (p-strlist) + 1;
+- strlist = p + 1;
+- }
+- return 0;
+-}
+-
+-int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+- const char *compatible)
+-{
+- const void *prop;
+- int len;
+-
+- prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
+- if (!prop)
+- return len;
+- if (_stringlist_contains(prop, len, compatible))
+- return 0;
+- else
+- return 1;
+-}
+-
+-int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+- const char *compatible)
+-{
+- int offset, err;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- /* FIXME: The algorithm here is pretty horrible: we scan each
+- * property of a node in fdt_node_check_compatible(), then if
+- * that didn't find what we want, we scan over them again
+- * making our way to the next node. Still it's the easiest to
+- * implement approach; performance can come later. */
+- for (offset = fdt_next_node(fdt, startoffset, NULL);
+- offset >= 0;
+- offset = fdt_next_node(fdt, offset, NULL)) {
+- err = fdt_node_check_compatible(fdt, offset, compatible);
+- if ((err < 0) && (err != -FDT_ERR_NOTFOUND))
+- return err;
+- else if (err == 0)
+- return offset;
+- }
+-
+- return offset; /* error from fdt_next_node() */
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_rw.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_rw.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_rw.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_rw.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,463 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-static int _fdt_blocks_misordered(const void *fdt,
+- int mem_rsv_size, int struct_size)
+-{
+- return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8))
+- || (fdt_off_dt_struct(fdt) <
+- (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
+- || (fdt_off_dt_strings(fdt) <
+- (fdt_off_dt_struct(fdt) + struct_size))
+- || (fdt_totalsize(fdt) <
+- (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
+-}
+-
+-static int _fdt_rw_check_header(void *fdt)
+-{
+- FDT_CHECK_HEADER(fdt);
+-
+- if (fdt_version(fdt) < 17)
+- return -FDT_ERR_BADVERSION;
+- if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
+- fdt_size_dt_struct(fdt)))
+- return -FDT_ERR_BADLAYOUT;
+- if (fdt_version(fdt) > 17)
+- fdt_set_version(fdt, 17);
+-
+- return 0;
+-}
+-
+-#define FDT_RW_CHECK_HEADER(fdt) \
+- { \
+- int err; \
+- if ((err = _fdt_rw_check_header(fdt)) != 0) \
+- return err; \
+- }
+-
+-static inline int _fdt_data_size(void *fdt)
+-{
+- return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
+-}
+-
+-static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
+-{
+- char *p = splicepoint;
+- char *end = (char *)fdt + _fdt_data_size(fdt);
+-
+- if (((p + oldlen) < p) || ((p + oldlen) > end))
+- return -FDT_ERR_BADOFFSET;
+- if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt)))
+- return -FDT_ERR_NOSPACE;
+- memmove(p + newlen, p + oldlen, end - p - oldlen);
+- return 0;
+-}
+-
+-static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
+- int oldn, int newn)
+-{
+- int delta = (newn - oldn) * sizeof(*p);
+- int err;
+- err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
+- if (err)
+- return err;
+- fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
+- fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
+- return 0;
+-}
+-
+-static int _fdt_splice_struct(void *fdt, void *p,
+- int oldlen, int newlen)
+-{
+- int delta = newlen - oldlen;
+- int err;
+-
+- if ((err = _fdt_splice(fdt, p, oldlen, newlen)))
+- return err;
+-
+- fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
+- fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
+- return 0;
+-}
+-
+-static int _fdt_splice_string(void *fdt, int newlen)
+-{
+- void *p = (char *)fdt
+- + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
+- int err;
+-
+- if ((err = _fdt_splice(fdt, p, 0, newlen)))
+- return err;
+-
+- fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
+- return 0;
+-}
+-
+-static int _fdt_find_add_string(void *fdt, const char *s)
+-{
+- char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
+- const char *p;
+- char *new;
+- int len = strlen(s) + 1;
+- int err;
+-
+- p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
+- if (p)
+- /* found it */
+- return (p - strtab);
+-
+- new = strtab + fdt_size_dt_strings(fdt);
+- err = _fdt_splice_string(fdt, len);
+- if (err)
+- return err;
+-
+- memcpy(new, s, len);
+- return (new - strtab);
+-}
+-
+-int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
+-{
+- struct fdt_reserve_entry *re;
+- int err;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
+- err = _fdt_splice_mem_rsv(fdt, re, 0, 1);
+- if (err)
+- return err;
+-
+- re->address = cpu_to_fdt64(address);
+- re->size = cpu_to_fdt64(size);
+- return 0;
+-}
+-
+-int fdt_del_mem_rsv(void *fdt, int n)
+-{
+- struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
+- int err;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- if (n >= fdt_num_mem_rsv(fdt))
+- return -FDT_ERR_NOTFOUND;
+-
+- err = _fdt_splice_mem_rsv(fdt, re, 1, 0);
+- if (err)
+- return err;
+- return 0;
+-}
+-
+-static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
+- int len, struct fdt_property **prop)
+-{
+- int oldlen;
+- int err;
+-
+- *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
+- if (! (*prop))
+- return oldlen;
+-
+- if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
+- FDT_TAGALIGN(len))))
+- return err;
+-
+- (*prop)->len = cpu_to_fdt32(len);
+- return 0;
+-}
+-
+-static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
+- int len, struct fdt_property **prop)
+-{
+- int proplen;
+- int nextoffset;
+- int namestroff;
+- int err;
+-
+- if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+- return nextoffset;
+-
+- namestroff = _fdt_find_add_string(fdt, name);
+- if (namestroff < 0)
+- return namestroff;
+-
+- *prop = _fdt_offset_ptr_w(fdt, nextoffset);
+- proplen = sizeof(**prop) + FDT_TAGALIGN(len);
+-
+- err = _fdt_splice_struct(fdt, *prop, 0, proplen);
+- if (err)
+- return err;
+-
+- (*prop)->tag = cpu_to_fdt32(FDT_PROP);
+- (*prop)->nameoff = cpu_to_fdt32(namestroff);
+- (*prop)->len = cpu_to_fdt32(len);
+- return 0;
+-}
+-
+-int fdt_set_name(void *fdt, int nodeoffset, const char *name)
+-{
+- char *namep;
+- int oldlen, newlen;
+- int err;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
+- if (!namep)
+- return oldlen;
+-
+- newlen = strlen(name);
+-
+- err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1),
+- FDT_TAGALIGN(newlen+1));
+- if (err)
+- return err;
+-
+- memcpy(namep, name, newlen+1);
+- return 0;
+-}
+-
+-int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+- const void *val, int len)
+-{
+- struct fdt_property *prop;
+- int err;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop);
+- if (err == -FDT_ERR_NOTFOUND)
+- err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+- if (err)
+- return err;
+-
+- memcpy(prop->data, val, len);
+- return 0;
+-}
+-
+-int fdt_delprop(void *fdt, int nodeoffset, const char *name)
+-{
+- struct fdt_property *prop;
+- int len, proplen;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
+- if (! prop)
+- return len;
+-
+- proplen = sizeof(*prop) + FDT_TAGALIGN(len);
+- return _fdt_splice_struct(fdt, prop, proplen, 0);
+-}
+-
+-int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+- const char *name, int namelen)
+-{
+- struct fdt_node_header *nh;
+- int offset, nextoffset;
+- int nodelen;
+- int err;
+- uint32_t tag;
+- uint32_t *endtag;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
+- if (offset >= 0)
+- return -FDT_ERR_EXISTS;
+- else if (offset != -FDT_ERR_NOTFOUND)
+- return offset;
+-
+- /* Try to place the new node after the parent's properties */
+- fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+- do {
+- offset = nextoffset;
+- tag = fdt_next_tag(fdt, offset, &nextoffset);
+- } while ((tag == FDT_PROP) || (tag == FDT_NOP));
+-
+- nh = _fdt_offset_ptr_w(fdt, offset);
+- nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
+-
+- err = _fdt_splice_struct(fdt, nh, 0, nodelen);
+- if (err)
+- return err;
+-
+- nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
+- memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
+- memcpy(nh->name, name, namelen);
+- endtag = (uint32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
+- *endtag = cpu_to_fdt32(FDT_END_NODE);
+-
+- return offset;
+-}
+-
+-int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
+-{
+- return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
+-}
+-
+-int fdt_del_node(void *fdt, int nodeoffset)
+-{
+- int endoffset;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+- if (endoffset < 0)
+- return endoffset;
+-
+- return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
+- endoffset - nodeoffset, 0);
+-}
+-
+-static void _fdt_packblocks(const char *old, char *new,
+- int mem_rsv_size, int struct_size)
+-{
+- int mem_rsv_off, struct_off, strings_off;
+-
+- mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8);
+- struct_off = mem_rsv_off + mem_rsv_size;
+- strings_off = struct_off + struct_size;
+-
+- memmove(new + mem_rsv_off, old + fdt_off_mem_rsvmap(old), mem_rsv_size);
+- fdt_set_off_mem_rsvmap(new, mem_rsv_off);
+-
+- memmove(new + struct_off, old + fdt_off_dt_struct(old), struct_size);
+- fdt_set_off_dt_struct(new, struct_off);
+- fdt_set_size_dt_struct(new, struct_size);
+-
+- memmove(new + strings_off, old + fdt_off_dt_strings(old),
+- fdt_size_dt_strings(old));
+- fdt_set_off_dt_strings(new, strings_off);
+- fdt_set_size_dt_strings(new, fdt_size_dt_strings(old));
+-}
+-
+-int fdt_open_into(const void *fdt, void *buf, int bufsize)
+-{
+- int err;
+- int mem_rsv_size, struct_size;
+- int newsize;
+- const char *fdtstart = fdt;
+- const char *fdtend = fdtstart + fdt_totalsize(fdt);
+- char *tmp;
+-
+- FDT_CHECK_HEADER(fdt);
+-
+- mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+- * sizeof(struct fdt_reserve_entry);
+-
+- if (fdt_version(fdt) >= 17) {
+- struct_size = fdt_size_dt_struct(fdt);
+- } else {
+- struct_size = 0;
+- while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
+- ;
+- }
+-
+- if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
+- /* no further work necessary */
+- err = fdt_move(fdt, buf, bufsize);
+- if (err)
+- return err;
+- fdt_set_version(buf, 17);
+- fdt_set_size_dt_struct(buf, struct_size);
+- fdt_set_totalsize(buf, bufsize);
+- return 0;
+- }
+-
+- /* Need to reorder */
+- newsize = FDT_ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
+- + struct_size + fdt_size_dt_strings(fdt);
+-
+- if (bufsize < newsize)
+- return -FDT_ERR_NOSPACE;
+-
+- /* First attempt to build converted tree at beginning of buffer */
+- tmp = buf;
+- /* But if that overlaps with the old tree... */
+- if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
+- /* Try right after the old tree instead */
+- tmp = (char *)(uintptr_t)fdtend;
+- if ((tmp + newsize) > ((char *)buf + bufsize))
+- return -FDT_ERR_NOSPACE;
+- }
+-
+- _fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size);
+- memmove(buf, tmp, newsize);
+-
+- fdt_set_magic(buf, FDT_MAGIC);
+- fdt_set_totalsize(buf, bufsize);
+- fdt_set_version(buf, 17);
+- fdt_set_last_comp_version(buf, 16);
+- fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
+-
+- return 0;
+-}
+-
+-int fdt_pack(void *fdt)
+-{
+- int mem_rsv_size;
+-
+- FDT_RW_CHECK_HEADER(fdt);
+-
+- mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+- * sizeof(struct fdt_reserve_entry);
+- _fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
+- fdt_set_totalsize(fdt, _fdt_data_size(fdt));
+-
+- return 0;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_strerror.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_strerror.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_strerror.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_strerror.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,96 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-struct fdt_errtabent {
+- const char *str;
+-};
+-
+-#define FDT_ERRTABENT(val) \
+- [(val)] = { .str = #val, }
+-
+-static struct fdt_errtabent fdt_errtable[] = {
+- FDT_ERRTABENT(FDT_ERR_NOTFOUND),
+- FDT_ERRTABENT(FDT_ERR_EXISTS),
+- FDT_ERRTABENT(FDT_ERR_NOSPACE),
+-
+- FDT_ERRTABENT(FDT_ERR_BADOFFSET),
+- FDT_ERRTABENT(FDT_ERR_BADPATH),
+- FDT_ERRTABENT(FDT_ERR_BADSTATE),
+-
+- FDT_ERRTABENT(FDT_ERR_TRUNCATED),
+- FDT_ERRTABENT(FDT_ERR_BADMAGIC),
+- FDT_ERRTABENT(FDT_ERR_BADVERSION),
+- FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE),
+- FDT_ERRTABENT(FDT_ERR_BADLAYOUT),
+-};
+-#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
+-
+-const char *fdt_strerror(int errval)
+-{
+- if (errval > 0)
+- return "<valid offset/length>";
+- else if (errval == 0)
+- return "<no error>";
+- else if (errval > -FDT_ERRTABSIZE) {
+- const char *s = fdt_errtable[-errval].str;
+-
+- if (s)
+- return s;
+- }
+-
+- return "<unknown error>";
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_sw.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_sw.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_sw.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_sw.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,257 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-static int _fdt_sw_check_header(void *fdt)
+-{
+- if (fdt_magic(fdt) != FDT_SW_MAGIC)
+- return -FDT_ERR_BADMAGIC;
+- /* FIXME: should check more details about the header state */
+- return 0;
+-}
+-
+-#define FDT_SW_CHECK_HEADER(fdt) \
+- { \
+- int err; \
+- if ((err = _fdt_sw_check_header(fdt)) != 0) \
+- return err; \
+- }
+-
+-static void *_fdt_grab_space(void *fdt, int len)
+-{
+- int offset = fdt_size_dt_struct(fdt);
+- int spaceleft;
+-
+- spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
+- - fdt_size_dt_strings(fdt);
+-
+- if ((offset + len < offset) || (offset + len > spaceleft))
+- return NULL;
+-
+- fdt_set_size_dt_struct(fdt, offset + len);
+- return fdt_offset_ptr_w(fdt, offset, len);
+-}
+-
+-int fdt_create(void *buf, int bufsize)
+-{
+- void *fdt = buf;
+-
+- if (bufsize < sizeof(struct fdt_header))
+- return -FDT_ERR_NOSPACE;
+-
+- memset(buf, 0, bufsize);
+-
+- fdt_set_magic(fdt, FDT_SW_MAGIC);
+- fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
+- fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
+- fdt_set_totalsize(fdt, bufsize);
+-
+- fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header),
+- sizeof(struct fdt_reserve_entry)));
+- fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
+- fdt_set_off_dt_strings(fdt, bufsize);
+-
+- return 0;
+-}
+-
+-int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
+-{
+- struct fdt_reserve_entry *re;
+- int offset;
+-
+- FDT_SW_CHECK_HEADER(fdt);
+-
+- if (fdt_size_dt_struct(fdt))
+- return -FDT_ERR_BADSTATE;
+-
+- offset = fdt_off_dt_struct(fdt);
+- if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
+- return -FDT_ERR_NOSPACE;
+-
+- re = (struct fdt_reserve_entry *)((char *)fdt + offset);
+- re->address = cpu_to_fdt64(addr);
+- re->size = cpu_to_fdt64(size);
+-
+- fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
+-
+- return 0;
+-}
+-
+-int fdt_finish_reservemap(void *fdt)
+-{
+- return fdt_add_reservemap_entry(fdt, 0, 0);
+-}
+-
+-int fdt_begin_node(void *fdt, const char *name)
+-{
+- struct fdt_node_header *nh;
+- int namelen = strlen(name) + 1;
+-
+- FDT_SW_CHECK_HEADER(fdt);
+-
+- nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
+- if (! nh)
+- return -FDT_ERR_NOSPACE;
+-
+- nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
+- memcpy(nh->name, name, namelen);
+- return 0;
+-}
+-
+-int fdt_end_node(void *fdt)
+-{
+- uint32_t *en;
+-
+- FDT_SW_CHECK_HEADER(fdt);
+-
+- en = _fdt_grab_space(fdt, FDT_TAGSIZE);
+- if (! en)
+- return -FDT_ERR_NOSPACE;
+-
+- *en = cpu_to_fdt32(FDT_END_NODE);
+- return 0;
+-}
+-
+-static int _fdt_find_add_string(void *fdt, const char *s)
+-{
+- char *strtab = (char *)fdt + fdt_totalsize(fdt);
+- const char *p;
+- int strtabsize = fdt_size_dt_strings(fdt);
+- int len = strlen(s) + 1;
+- int struct_top, offset;
+-
+- p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
+- if (p)
+- return p - strtab;
+-
+- /* Add it */
+- offset = -strtabsize - len;
+- struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
+- if (fdt_totalsize(fdt) + offset < struct_top)
+- return 0; /* no more room :( */
+-
+- memcpy(strtab + offset, s, len);
+- fdt_set_size_dt_strings(fdt, strtabsize + len);
+- return offset;
+-}
+-
+-int fdt_property(void *fdt, const char *name, const void *val, int len)
+-{
+- struct fdt_property *prop;
+- int nameoff;
+-
+- FDT_SW_CHECK_HEADER(fdt);
+-
+- nameoff = _fdt_find_add_string(fdt, name);
+- if (nameoff == 0)
+- return -FDT_ERR_NOSPACE;
+-
+- prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
+- if (! prop)
+- return -FDT_ERR_NOSPACE;
+-
+- prop->tag = cpu_to_fdt32(FDT_PROP);
+- prop->nameoff = cpu_to_fdt32(nameoff);
+- prop->len = cpu_to_fdt32(len);
+- memcpy(prop->data, val, len);
+- return 0;
+-}
+-
+-int fdt_finish(void *fdt)
+-{
+- char *p = (char *)fdt;
+- uint32_t *end;
+- int oldstroffset, newstroffset;
+- uint32_t tag;
+- int offset, nextoffset;
+-
+- FDT_SW_CHECK_HEADER(fdt);
+-
+- /* Add terminator */
+- end = _fdt_grab_space(fdt, sizeof(*end));
+- if (! end)
+- return -FDT_ERR_NOSPACE;
+- *end = cpu_to_fdt32(FDT_END);
+-
+- /* Relocate the string table */
+- oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
+- newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
+- memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
+- fdt_set_off_dt_strings(fdt, newstroffset);
+-
+- /* Walk the structure, correcting string offsets */
+- offset = 0;
+- while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
+- if (tag == FDT_PROP) {
+- struct fdt_property *prop =
+- fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
+- int nameoff;
+-
+- if (! prop)
+- return -FDT_ERR_BADSTRUCTURE;
+-
+- nameoff = fdt32_to_cpu(prop->nameoff);
+- nameoff += fdt_size_dt_strings(fdt);
+- prop->nameoff = cpu_to_fdt32(nameoff);
+- }
+- offset = nextoffset;
+- }
+-
+- /* Finally, adjust the header */
+- fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
+- fdt_set_magic(fdt, FDT_MAGIC);
+- return 0;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_wip.c linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_wip.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/fdt_wip.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/fdt_wip.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,145 +0,0 @@
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include "libfdt_env.h"
+-
+-#include <fdt.h>
+-#include <libfdt.h>
+-
+-#include "libfdt_internal.h"
+-
+-int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+- const void *val, int len)
+-{
+- void *propval;
+- int proplen;
+-
+- propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
+- if (! propval)
+- return proplen;
+-
+- if (proplen != len)
+- return -FDT_ERR_NOSPACE;
+-
+- memcpy(propval, val, len);
+- return 0;
+-}
+-
+-static void _fdt_nop_region(void *start, int len)
+-{
+- uint32_t *p;
+-
+- for (p = start; (char *)p < ((char *)start + len); p++)
+- *p = cpu_to_fdt32(FDT_NOP);
+-}
+-
+-int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
+-{
+- struct fdt_property *prop;
+- int len;
+-
+- prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
+- if (! prop)
+- return len;
+-
+- _fdt_nop_region(prop, len + sizeof(*prop));
+-
+- return 0;
+-}
+-
+-int _fdt_node_end_offset(void *fdt, int nodeoffset)
+-{
+- int level = 0;
+- uint32_t tag;
+- int offset, nextoffset;
+-
+- tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
+- if (tag != FDT_BEGIN_NODE)
+- return -FDT_ERR_BADOFFSET;
+- do {
+- offset = nextoffset;
+- tag = fdt_next_tag(fdt, offset, &nextoffset);
+-
+- switch (tag) {
+- case FDT_END:
+- return offset;
+-
+- case FDT_BEGIN_NODE:
+- level++;
+- break;
+-
+- case FDT_END_NODE:
+- level--;
+- break;
+-
+- case FDT_PROP:
+- case FDT_NOP:
+- break;
+-
+- default:
+- return -FDT_ERR_BADSTRUCTURE;
+- }
+- } while (level >= 0);
+-
+- return nextoffset;
+-}
+-
+-int fdt_nop_node(void *fdt, int nodeoffset)
+-{
+- int endoffset;
+-
+- endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+- if (endoffset < 0)
+- return endoffset;
+-
+- _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0),
+- endoffset - nodeoffset);
+- return 0;
+-}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/libfdt.h linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/libfdt.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/libfdt.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/libfdt.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,1076 +0,0 @@
+-#ifndef _LIBFDT_H
+-#define _LIBFDT_H
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-
+-#include <libfdt_env.h>
+-#include <fdt.h>
+-
+-#define FDT_FIRST_SUPPORTED_VERSION 0x10
+-#define FDT_LAST_SUPPORTED_VERSION 0x11
+-
+-/* Error codes: informative error codes */
+-#define FDT_ERR_NOTFOUND 1
+- /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
+-#define FDT_ERR_EXISTS 2
+- /* FDT_ERR_EXISTS: Attemped to create a node or property which
+- * already exists */
+-#define FDT_ERR_NOSPACE 3
+- /* FDT_ERR_NOSPACE: Operation needed to expand the device
+- * tree, but its buffer did not have sufficient space to
+- * contain the expanded tree. Use fdt_open_into() to move the
+- * device tree to a buffer with more space. */
+-
+-/* Error codes: codes for bad parameters */
+-#define FDT_ERR_BADOFFSET 4
+- /* FDT_ERR_BADOFFSET: Function was passed a structure block
+- * offset which is out-of-bounds, or which points to an
+- * unsuitable part of the structure for the operation. */
+-#define FDT_ERR_BADPATH 5
+- /* FDT_ERR_BADPATH: Function was passed a badly formatted path
+- * (e.g. missing a leading / for a function which requires an
+- * absolute path) */
+-#define FDT_ERR_BADPHANDLE 6
+- /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
+- * value. phandle values of 0 and -1 are not permitted. */
+-#define FDT_ERR_BADSTATE 7
+- /* FDT_ERR_BADSTATE: Function was passed an incomplete device
+- * tree created by the sequential-write functions, which is
+- * not sufficiently complete for the requested operation. */
+-
+-/* Error codes: codes for bad device tree blobs */
+-#define FDT_ERR_TRUNCATED 8
+- /* FDT_ERR_TRUNCATED: Structure block of the given device tree
+- * ends without an FDT_END tag. */
+-#define FDT_ERR_BADMAGIC 9
+- /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
+- * device tree at all - it is missing the flattened device
+- * tree magic number. */
+-#define FDT_ERR_BADVERSION 10
+- /* FDT_ERR_BADVERSION: Given device tree has a version which
+- * can't be handled by the requested operation. For
+- * read-write functions, this may mean that fdt_open_into() is
+- * required to convert the tree to the expected version. */
+-#define FDT_ERR_BADSTRUCTURE 11
+- /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
+- * structure block or other serious error (e.g. misnested
+- * nodes, or subnodes preceding properties). */
+-#define FDT_ERR_BADLAYOUT 12
+- /* FDT_ERR_BADLAYOUT: For read-write functions, the given
+- * device tree has it's sub-blocks in an order that the
+- * function can't handle (memory reserve map, then structure,
+- * then strings). Use fdt_open_into() to reorganize the tree
+- * into a form suitable for the read-write operations. */
+-
+-/* "Can't happen" error indicating a bug in libfdt */
+-#define FDT_ERR_INTERNAL 13
+- /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
+- * Should never be returned, if it is, it indicates a bug in
+- * libfdt itself. */
+-
+-#define FDT_ERR_MAX 13
+-
+-/**********************************************************************/
+-/* Low-level functions (you probably don't need these) */
+-/**********************************************************************/
+-
+-const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
+-static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
+-{
+- return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
+-}
+-
+-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+-
+-/**********************************************************************/
+-/* Traversal functions */
+-/**********************************************************************/
+-
+-int fdt_next_node(const void *fdt, int offset, int *depth);
+-
+-/**********************************************************************/
+-/* General functions */
+-/**********************************************************************/
+-
+-#define fdt_get_header(fdt, field) \
+- (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+-#define fdt_magic(fdt) (fdt_get_header(fdt, magic))
+-#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
+-#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
+-#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
+-#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
+-#define fdt_version(fdt) (fdt_get_header(fdt, version))
+-#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
+-#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
+-#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
+-#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
+-
+-#define __fdt_set_hdr(name) \
+- static inline void fdt_set_##name(void *fdt, uint32_t val) \
+- { \
+- struct fdt_header *fdth = fdt; \
+- fdth->name = cpu_to_fdt32(val); \
+- }
+-__fdt_set_hdr(magic);
+-__fdt_set_hdr(totalsize);
+-__fdt_set_hdr(off_dt_struct);
+-__fdt_set_hdr(off_dt_strings);
+-__fdt_set_hdr(off_mem_rsvmap);
+-__fdt_set_hdr(version);
+-__fdt_set_hdr(last_comp_version);
+-__fdt_set_hdr(boot_cpuid_phys);
+-__fdt_set_hdr(size_dt_strings);
+-__fdt_set_hdr(size_dt_struct);
+-#undef __fdt_set_hdr
+-
+-/**
+- * fdt_check_header - sanity check a device tree or possible device tree
+- * @fdt: pointer to data which might be a flattened device tree
+- *
+- * fdt_check_header() checks that the given buffer contains what
+- * appears to be a flattened device tree with sane information in its
+- * header.
+- *
+- * returns:
+- * 0, if the buffer appears to contain a valid device tree
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE, standard meanings, as above
+- */
+-int fdt_check_header(const void *fdt);
+-
+-/**
+- * fdt_move - move a device tree around in memory
+- * @fdt: pointer to the device tree to move
+- * @buf: pointer to memory where the device is to be moved
+- * @bufsize: size of the memory space at buf
+- *
+- * fdt_move() relocates, if possible, the device tree blob located at
+- * fdt to the buffer at buf of size bufsize. The buffer may overlap
+- * with the existing device tree blob at fdt. Therefore,
+- * fdt_move(fdt, fdt, fdt_totalsize(fdt))
+- * should always succeed.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE, standard meanings
+- */
+-int fdt_move(const void *fdt, void *buf, int bufsize);
+-
+-/**********************************************************************/
+-/* Read-only functions */
+-/**********************************************************************/
+-
+-/**
+- * fdt_string - retrieve a string from the strings block of a device tree
+- * @fdt: pointer to the device tree blob
+- * @stroffset: offset of the string within the strings block (native endian)
+- *
+- * fdt_string() retrieves a pointer to a single string from the
+- * strings block of the device tree blob at fdt.
+- *
+- * returns:
+- * a pointer to the string, on success
+- * NULL, if stroffset is out of bounds
+- */
+-const char *fdt_string(const void *fdt, int stroffset);
+-
+-/**
+- * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
+- * @fdt: pointer to the device tree blob
+- *
+- * Returns the number of entries in the device tree blob's memory
+- * reservation map. This does not include the terminating 0,0 entry
+- * or any other (0,0) entries reserved for expansion.
+- *
+- * returns:
+- * the number of entries
+- */
+-int fdt_num_mem_rsv(const void *fdt);
+-
+-/**
+- * fdt_get_mem_rsv - retrieve one memory reserve map entry
+- * @fdt: pointer to the device tree blob
+- * @address, @size: pointers to 64-bit variables
+- *
+- * On success, *address and *size will contain the address and size of
+- * the n-th reserve map entry from the device tree blob, in
+- * native-endian format.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE, standard meanings
+- */
+-int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+-
+-/**
+- * fdt_subnode_offset_namelen - find a subnode based on substring
+- * @fdt: pointer to the device tree blob
+- * @parentoffset: structure block offset of a node
+- * @name: name of the subnode to locate
+- * @namelen: number of characters of name to consider
+- *
+- * Identical to fdt_subnode_offset(), but only examine the first
+- * namelen characters of name for matching the subnode name. This is
+- * useful for finding subnodes based on a portion of a larger string,
+- * such as a full path.
+- */
+-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+- const char *name, int namelen);
+-/**
+- * fdt_subnode_offset - find a subnode of a given node
+- * @fdt: pointer to the device tree blob
+- * @parentoffset: structure block offset of a node
+- * @name: name of the subnode to locate
+- *
+- * fdt_subnode_offset() finds a subnode of the node at structure block
+- * offset parentoffset with the given name. name may include a unit
+- * address, in which case fdt_subnode_offset() will find the subnode
+- * with that unit address, or the unit address may be omitted, in
+- * which case fdt_subnode_offset() will find an arbitrary subnode
+- * whose name excluding unit address matches the given name.
+- *
+- * returns:
+- * structure block offset of the requested subnode (>=0), on success
+- * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
+- * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings.
+- */
+-int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
+-
+-/**
+- * fdt_path_offset - find a tree node by its full path
+- * @fdt: pointer to the device tree blob
+- * @path: full path of the node to locate
+- *
+- * fdt_path_offset() finds a node of a given path in the device tree.
+- * Each path component may omit the unit address portion, but the
+- * results of this are undefined if any such path component is
+- * ambiguous (that is if there are multiple nodes at the relevant
+- * level matching the given component, differentiated only by unit
+- * address).
+- *
+- * returns:
+- * structure block offset of the node with the requested path (>=0), on success
+- * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+- * -FDT_ERR_NOTFOUND, if the requested node does not exist
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings.
+- */
+-int fdt_path_offset(const void *fdt, const char *path);
+-
+-/**
+- * fdt_get_name - retrieve the name of a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: structure block offset of the starting node
+- * @lenp: pointer to an integer variable (will be overwritten) or NULL
+- *
+- * fdt_get_name() retrieves the name (including unit address) of the
+- * device tree node at structure block offset nodeoffset. If lenp is
+- * non-NULL, the length of this name is also returned, in the integer
+- * pointed to by lenp.
+- *
+- * returns:
+- * pointer to the node's name, on success
+- * If lenp is non-NULL, *lenp contains the length of that name (>=0)
+- * NULL, on error
+- * if lenp is non-NULL *lenp contains an error code (<0):
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE, standard meanings
+- */
+-const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
+-
+-/**
+- * fdt_get_property - find a given property in a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to find
+- * @name: name of the property to find
+- * @lenp: pointer to an integer variable (will be overwritten) or NULL
+- *
+- * fdt_get_property() retrieves a pointer to the fdt_property
+- * structure within the device tree blob corresponding to the property
+- * named 'name' of the node at offset nodeoffset. If lenp is
+- * non-NULL, the length of the property value is also returned, in the
+- * integer pointed to by lenp.
+- *
+- * returns:
+- * pointer to the structure representing the property
+- * if lenp is non-NULL, *lenp contains the length of the property
+- * value (>=0)
+- * NULL, on error
+- * if lenp is non-NULL, *lenp contains an error code (<0):
+- * -FDT_ERR_NOTFOUND, node does not have named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
+- const char *name, int *lenp);
+-static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
+- const char *name,
+- int *lenp)
+-{
+- return (struct fdt_property *)(uintptr_t)
+- fdt_get_property(fdt, nodeoffset, name, lenp);
+-}
+-
+-/**
+- * fdt_getprop - retrieve the value of a given property
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to find
+- * @name: name of the property to find
+- * @lenp: pointer to an integer variable (will be overwritten) or NULL
+- *
+- * fdt_getprop() retrieves a pointer to the value of the property
+- * named 'name' of the node at offset nodeoffset (this will be a
+- * pointer to within the device blob itself, not a copy of the value).
+- * If lenp is non-NULL, the length of the property value is also
+- * returned, in the integer pointed to by lenp.
+- *
+- * returns:
+- * pointer to the property's value
+- * if lenp is non-NULL, *lenp contains the length of the property
+- * value (>=0)
+- * NULL, on error
+- * if lenp is non-NULL, *lenp contains an error code (<0):
+- * -FDT_ERR_NOTFOUND, node does not have named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-const void *fdt_getprop(const void *fdt, int nodeoffset,
+- const char *name, int *lenp);
+-static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
+- const char *name, int *lenp)
+-{
+- return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
+-}
+-
+-/**
+- * fdt_get_phandle - retrieve the phandle of a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: structure block offset of the node
+- *
+- * fdt_get_phandle() retrieves the phandle of the device tree node at
+- * structure block offset nodeoffset.
+- *
+- * returns:
+- * the phandle of the node at nodeoffset, on success (!= 0, != -1)
+- * 0, if the node has no phandle, or another error occurs
+- */
+-uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
+-
+-/**
+- * fdt_get_path - determine the full path of a node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose path to find
+- * @buf: character buffer to contain the returned path (will be overwritten)
+- * @buflen: size of the character buffer at buf
+- *
+- * fdt_get_path() computes the full path of the node at offset
+- * nodeoffset, and records that path in the buffer at buf.
+- *
+- * NOTE: This function is expensive, as it must scan the device tree
+- * structure from the start to nodeoffset.
+- *
+- * returns:
+- * 0, on success
+- * buf contains the absolute path of the node at
+- * nodeoffset, as a NUL-terminated string.
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+- * characters and will not fit in the given buffer.
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
+-
+-/**
+- * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose parent to find
+- * @supernodedepth: depth of the ancestor to find
+- * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+- *
+- * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+- * at a specific depth from the root (where the root itself has depth
+- * 0, its immediate subnodes depth 1 and so forth). So
+- * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+- * will always return 0, the offset of the root node. If the node at
+- * nodeoffset has depth D, then:
+- * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+- * will return nodeoffset itself.
+- *
+- * NOTE: This function is expensive, as it must scan the device tree
+- * structure from the start to nodeoffset.
+- *
+- * returns:
+-
+- * structure block offset of the node at node offset's ancestor
+- * of depth supernodedepth (>=0), on success
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+-* -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+- int supernodedepth, int *nodedepth);
+-
+-/**
+- * fdt_node_depth - find the depth of a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose parent to find
+- *
+- * fdt_node_depth() finds the depth of a given node. The root node
+- * has depth 0, its immediate subnodes depth 1 and so forth.
+- *
+- * NOTE: This function is expensive, as it must scan the device tree
+- * structure from the start to nodeoffset.
+- *
+- * returns:
+- * depth of the node at nodeoffset (>=0), on success
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_node_depth(const void *fdt, int nodeoffset);
+-
+-/**
+- * fdt_parent_offset - find the parent of a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose parent to find
+- *
+- * fdt_parent_offset() locates the parent node of a given node (that
+- * is, it finds the offset of the node which contains the node at
+- * nodeoffset as a subnode).
+- *
+- * NOTE: This function is expensive, as it must scan the device tree
+- * structure from the start to nodeoffset, *twice*.
+- *
+- * returns:
+- * structure block offset of the parent of the node at nodeoffset
+- * (>=0), on success
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_parent_offset(const void *fdt, int nodeoffset);
+-
+-/**
+- * fdt_node_offset_by_prop_value - find nodes with a given property value
+- * @fdt: pointer to the device tree blob
+- * @startoffset: only find nodes after this offset
+- * @propname: property name to check
+- * @propval: property value to search for
+- * @proplen: length of the value in propval
+- *
+- * fdt_node_offset_by_prop_value() returns the offset of the first
+- * node after startoffset, which has a property named propname whose
+- * value is of length proplen and has value equal to propval; or if
+- * startoffset is -1, the very first such node in the tree.
+- *
+- * To iterate through all nodes matching the criterion, the following
+- * idiom can be used:
+- * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
+- * propval, proplen);
+- * while (offset != -FDT_ERR_NOTFOUND) {
+- * // other code here
+- * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
+- * propval, proplen);
+- * }
+- *
+- * Note the -1 in the first call to the function, if 0 is used here
+- * instead, the function will never locate the root node, even if it
+- * matches the criterion.
+- *
+- * returns:
+- * structure block offset of the located node (>= 0, >startoffset),
+- * on success
+- * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+- * tree after startoffset
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+- const char *propname,
+- const void *propval, int proplen);
+-
+-/**
+- * fdt_node_offset_by_phandle - find the node with a given phandle
+- * @fdt: pointer to the device tree blob
+- * @phandle: phandle value
+- *
+- * fdt_node_offset_by_phandle() returns the offset of the node
+- * which has the given phandle value. If there is more than one node
+- * in the tree with the given phandle (an invalid tree), results are
+- * undefined.
+- *
+- * returns:
+- * structure block offset of the located node (>= 0), on success
+- * -FDT_ERR_NOTFOUND, no node with that phandle exists
+- * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
+-
+-/**
+- * fdt_node_check_compatible: check a node's compatible property
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of a tree node
+- * @compatible: string to match against
+- *
+- *
+- * fdt_node_check_compatible() returns 0 if the given node contains a
+- * 'compatible' property with the given string as one of its elements,
+- * it returns non-zero otherwise, or on error.
+- *
+- * returns:
+- * 0, if the node has a 'compatible' property listing the given string
+- * 1, if the node has a 'compatible' property, but it does not list
+- * the given string
+- * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
+- * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+- const char *compatible);
+-
+-/**
+- * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
+- * @fdt: pointer to the device tree blob
+- * @startoffset: only find nodes after this offset
+- * @compatible: 'compatible' string to match against
+- *
+- * fdt_node_offset_by_compatible() returns the offset of the first
+- * node after startoffset, which has a 'compatible' property which
+- * lists the given compatible string; or if startoffset is -1, the
+- * very first such node in the tree.
+- *
+- * To iterate through all nodes matching the criterion, the following
+- * idiom can be used:
+- * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+- * while (offset != -FDT_ERR_NOTFOUND) {
+- * // other code here
+- * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
+- * }
+- *
+- * Note the -1 in the first call to the function, if 0 is used here
+- * instead, the function will never locate the root node, even if it
+- * matches the criterion.
+- *
+- * returns:
+- * structure block offset of the located node (>= 0, >startoffset),
+- * on success
+- * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+- * tree after startoffset
+- * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE, standard meanings
+- */
+-int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+- const char *compatible);
+-
+-/**********************************************************************/
+-/* Write-in-place functions */
+-/**********************************************************************/
+-
+-/**
+- * fdt_setprop_inplace - change a property's value, but not its size
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to change
+- * @name: name of the property to change
+- * @val: pointer to data to replace the property value with
+- * @len: length of the property value
+- *
+- * fdt_setprop_inplace() replaces the value of a given property with
+- * the data in val, of length len. This function cannot change the
+- * size of a property, and so will only work if len is equal to the
+- * current length of the property.
+- *
+- * This function will alter only the bytes in the blob which contain
+- * the given property value, and will not alter or move any other part
+- * of the tree.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, if len is not equal to the property's current length
+- * -FDT_ERR_NOTFOUND, node does not have the named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+- const void *val, int len);
+-
+-/**
+- * fdt_setprop_inplace_cell - change the value of a single-cell property
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to change
+- * @name: name of the property to change
+- * @val: cell (32-bit integer) value to replace the property with
+- *
+- * fdt_setprop_inplace_cell() replaces the value of a given property
+- * with the 32-bit integer cell value in val, converting val to
+- * big-endian if necessary. This function cannot change the size of a
+- * property, and so will only work if the property already exists and
+- * has length 4.
+- *
+- * This function will alter only the bytes in the blob which contain
+- * the given property value, and will not alter or move any other part
+- * of the tree.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, if the property's length is not equal to 4
+- * -FDT_ERR_NOTFOUND, node does not have the named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+- const char *name, uint32_t val)
+-{
+- val = cpu_to_fdt32(val);
+- return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+-}
+-
+-/**
+- * fdt_nop_property - replace a property with nop tags
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to nop
+- * @name: name of the property to nop
+- *
+- * fdt_nop_property() will replace a given property's representation
+- * in the blob with FDT_NOP tags, effectively removing it from the
+- * tree.
+- *
+- * This function will alter only the bytes in the blob which contain
+- * the property, and will not alter or move any other part of the
+- * tree.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOTFOUND, node does not have the named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
+-
+-/**
+- * fdt_nop_node - replace a node (subtree) with nop tags
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node to nop
+- *
+- * fdt_nop_node() will replace a given node's representation in the
+- * blob, including all its subnodes, if any, with FDT_NOP tags,
+- * effectively removing it from the tree.
+- *
+- * This function will alter only the bytes in the blob which contain
+- * the node and its properties and subnodes, and will not alter or
+- * move any other part of the tree.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_nop_node(void *fdt, int nodeoffset);
+-
+-/**********************************************************************/
+-/* Sequential write functions */
+-/**********************************************************************/
+-
+-int fdt_create(void *buf, int bufsize);
+-int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
+-int fdt_finish_reservemap(void *fdt);
+-int fdt_begin_node(void *fdt, const char *name);
+-int fdt_property(void *fdt, const char *name, const void *val, int len);
+-static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+-{
+- val = cpu_to_fdt32(val);
+- return fdt_property(fdt, name, &val, sizeof(val));
+-}
+-#define fdt_property_string(fdt, name, str) \
+- fdt_property(fdt, name, str, strlen(str)+1)
+-int fdt_end_node(void *fdt);
+-int fdt_finish(void *fdt);
+-
+-/**********************************************************************/
+-/* Read-write functions */
+-/**********************************************************************/
+-
+-int fdt_open_into(const void *fdt, void *buf, int bufsize);
+-int fdt_pack(void *fdt);
+-
+-/**
+- * fdt_add_mem_rsv - add one memory reserve map entry
+- * @fdt: pointer to the device tree blob
+- * @address, @size: 64-bit values (native endian)
+- *
+- * Adds a reserve map entry to the given blob reserving a region at
+- * address address of length size.
+- *
+- * This function will insert data into the reserve map and will
+- * therefore change the indexes of some entries in the table.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+- * contain the new reservation entry
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
+-
+-/**
+- * fdt_del_mem_rsv - remove a memory reserve map entry
+- * @fdt: pointer to the device tree blob
+- * @n: entry to remove
+- *
+- * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
+- * the blob.
+- *
+- * This function will delete data from the reservation table and will
+- * therefore change the indexes of some entries in the table.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
+- * are less than n+1 reserve map entries)
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_del_mem_rsv(void *fdt, int n);
+-
+-/**
+- * fdt_set_name - change the name of a given node
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: structure block offset of a node
+- * @name: name to give the node
+- *
+- * fdt_set_name() replaces the name (including unit address, if any)
+- * of the given node with the given string. NOTE: this function can't
+- * efficiently check if the new name is unique amongst the given
+- * node's siblings; results are undefined if this function is invoked
+- * with a name equal to one of the given node's siblings.
+- *
+- * This function may insert or delete data from the blob, and will
+- * therefore change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, there is insufficient free space in the blob
+- * to contain the new name
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE, standard meanings
+- */
+-int fdt_set_name(void *fdt, int nodeoffset, const char *name);
+-
+-/**
+- * fdt_setprop - create or change a property
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to change
+- * @name: name of the property to change
+- * @val: pointer to data to set the property value to
+- * @len: length of the property value
+- *
+- * fdt_setprop() sets the value of the named property in the given
+- * node to the given value and length, creating the property if it
+- * does not already exist.
+- *
+- * This function may insert or delete data from the blob, and will
+- * therefore change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+- * contain the new property value
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+- const void *val, int len);
+-
+-/**
+- * fdt_setprop_cell - set a property to a single cell value
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to change
+- * @name: name of the property to change
+- * @val: 32-bit integer value for the property (native endian)
+- *
+- * fdt_setprop_cell() sets the value of the named property in the
+- * given node to the given cell value (converting to big-endian if
+- * necessary), or creates a new property with that value if it does
+- * not already exist.
+- *
+- * This function may insert or delete data from the blob, and will
+- * therefore change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+- * contain the new property value
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+- uint32_t val)
+-{
+- val = cpu_to_fdt32(val);
+- return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+-}
+-
+-/**
+- * fdt_setprop_string - set a property to a string value
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to change
+- * @name: name of the property to change
+- * @str: string value for the property
+- *
+- * fdt_setprop_string() sets the value of the named property in the
+- * given node to the given string value (using the length of the
+- * string to determine the new length of the property), or creates a
+- * new property with that value if it does not already exist.
+- *
+- * This function may insert or delete data from the blob, and will
+- * therefore change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+- * contain the new property value
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-#define fdt_setprop_string(fdt, nodeoffset, name, str) \
+- fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+-
+-/**
+- * fdt_delprop - delete a property
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node whose property to nop
+- * @name: name of the property to nop
+- *
+- * fdt_del_property() will delete the given property.
+- *
+- * This function will delete data from the blob, and will therefore
+- * change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_NOTFOUND, node does not have the named property
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_delprop(void *fdt, int nodeoffset, const char *name);
+-
+-/**
+- * fdt_add_subnode_namelen - creates a new node based on substring
+- * @fdt: pointer to the device tree blob
+- * @parentoffset: structure block offset of a node
+- * @name: name of the subnode to locate
+- * @namelen: number of characters of name to consider
+- *
+- * Identical to fdt_add_subnode(), but use only the first namelen
+- * characters of name as the name of the new node. This is useful for
+- * creating subnodes based on a portion of a larger string, such as a
+- * full path.
+- */
+-int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+- const char *name, int namelen);
+-
+-/**
+- * fdt_add_subnode - creates a new node
+- * @fdt: pointer to the device tree blob
+- * @parentoffset: structure block offset of a node
+- * @name: name of the subnode to locate
+- *
+- * fdt_add_subnode() creates a new node as a subnode of the node at
+- * structure block offset parentoffset, with the given name (which
+- * should include the unit address, if any).
+- *
+- * This function will insert data into the blob, and will therefore
+- * change the offsets of some existing nodes.
+-
+- * returns:
+- * structure block offset of the created nodeequested subnode (>=0), on success
+- * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
+- * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+- * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
+- * the given name
+- * -FDT_ERR_NOSPACE, if there is insufficient free space in the
+- * blob to contain the new node
+- * -FDT_ERR_NOSPACE
+- * -FDT_ERR_BADLAYOUT
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings.
+- */
+-int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
+-
+-/**
+- * fdt_del_node - delete a node (subtree)
+- * @fdt: pointer to the device tree blob
+- * @nodeoffset: offset of the node to nop
+- *
+- * fdt_del_node() will remove the given node, including all its
+- * subnodes if any, from the blob.
+- *
+- * This function will delete data from the blob, and will therefore
+- * change the offsets of some existing nodes.
+- *
+- * returns:
+- * 0, on success
+- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+- * -FDT_ERR_BADLAYOUT,
+- * -FDT_ERR_BADMAGIC,
+- * -FDT_ERR_BADVERSION,
+- * -FDT_ERR_BADSTATE,
+- * -FDT_ERR_BADSTRUCTURE,
+- * -FDT_ERR_TRUNCATED, standard meanings
+- */
+-int fdt_del_node(void *fdt, int nodeoffset);
+-
+-/**********************************************************************/
+-/* Debugging / informational functions */
+-/**********************************************************************/
+-
+-const char *fdt_strerror(int errval);
+-
+-#endif /* _LIBFDT_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/libfdt_internal.h linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/libfdt_internal.h
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/libfdt_internal.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/libfdt_internal.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,95 +0,0 @@
+-#ifndef _LIBFDT_INTERNAL_H
+-#define _LIBFDT_INTERNAL_H
+-/*
+- * libfdt - Flat Device Tree manipulation
+- * Copyright (C) 2006 David Gibson, IBM Corporation.
+- *
+- * libfdt is dual licensed: you can use it either under the terms of
+- * the GPL, or the BSD license, at your option.
+- *
+- * a) 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 of the
+- * License, 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; if not, write to the Free
+- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+- * MA 02110-1301 USA
+- *
+- * Alternatively,
+- *
+- * b) Redistribution and use in source and binary forms, with or
+- * without modification, are permitted provided that the following
+- * conditions are met:
+- *
+- * 1. Redistributions of source code must retain the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer.
+- * 2. Redistributions in binary form must reproduce the above
+- * copyright notice, this list of conditions and the following
+- * disclaimer in the documentation and/or other materials
+- * provided with the distribution.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+- */
+-#include <fdt.h>
+-
+-#define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
+-#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))
+-
+-#define FDT_CHECK_HEADER(fdt) \
+- { \
+- int err; \
+- if ((err = fdt_check_header(fdt)) != 0) \
+- return err; \
+- }
+-
+-uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
+-int _fdt_check_node_offset(const void *fdt, int offset);
+-const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
+-int _fdt_node_end_offset(void *fdt, int nodeoffset);
+-
+-static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
+-{
+- return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
+-}
+-
+-static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
+-{
+- return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
+-}
+-
+-static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
+-{
+- const struct fdt_reserve_entry *rsv_table =
+- (const struct fdt_reserve_entry *)
+- ((const char *)fdt + fdt_off_mem_rsvmap(fdt));
+-
+- return rsv_table + n;
+-}
+-static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
+-{
+- return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
+-}
+-
+-#define FDT_SW_MAGIC (~FDT_MAGIC)
+-
+-#endif /* _LIBFDT_INTERNAL_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/libfdt/Makefile.libfdt linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/Makefile.libfdt
+--- linux-2.6.30-rc4/arch/powerpc/boot/libfdt/Makefile.libfdt 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/libfdt/Makefile.libfdt 1970-01-01 01:00:00.000000000 +0100
+@@ -1,8 +0,0 @@
+-# Makefile.libfdt
+-#
+-# This is not a complete Makefile of itself. Instead, it is designed to
+-# be easily embeddable into other systems of Makefiles.
+-#
+-LIBFDT_INCLUDES = fdt.h libfdt.h
+-LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
+-LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/Makefile linux-2.6.30-rc4-git/arch/powerpc/boot/Makefile
+--- linux-2.6.30-rc4/arch/powerpc/boot/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -33,7 +33,7 @@ ifeq ($(call cc-option-yn, -fstack-prote
+ BOOTCFLAGS += -fno-stack-protector
+ endif
+
+-BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt
++BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
+
+ DTS_FLAGS ?= -p 1024
+
+@@ -53,9 +53,14 @@ zliblinuxheader := zlib.h zconf.h zutil.
+ $(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \
+ $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
+
+-src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
++libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
++libfdtheader := fdt.h libfdt.h libfdt_internal.h
++
++$(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o): \
++ $(addprefix $(obj)/,$(libfdtheader))
++
+ src-wlib := string.S crt0.S crtsavres.S stdio.c main.c \
+- $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \
++ $(libfdt) libfdt-wrapper.c \
+ ns16550.c serial.c simple_alloc.c div64.S util.S \
+ gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
+ 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
+@@ -96,6 +101,12 @@ $(addprefix $(obj)/,$(zlibheader)): $(ob
+ $(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/%
+ $(call cmd,copy_zliblinuxheader)
+
++quiet_cmd_copy_libfdt = COPY $@
++ cmd_copy_libfdt = cp $< $@
++
++$(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/%
++ $(call cmd,copy_libfdt)
++
+ $(obj)/empty.c:
+ @touch $@
+
+@@ -103,6 +114,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds
+ @cp $< $@
+
+ clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
++ $(libfdt) $(libfdtheader) \
+ empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
+
+ quiet_cmd_bootcc = BOOTCC $@
+@@ -114,6 +126,8 @@ quiet_cmd_bootas = BOOTAS $@
+ quiet_cmd_bootar = BOOTAR $@
+ cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
+
++$(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
++ $(call if_changed_dep,bootcc)
+ $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
+ $(Q)mkdir -p $(dir $@)
+ $(call if_changed_dep,bootcc)
+@@ -124,7 +138,7 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-
+ $(obj)/wrapper.a: $(obj-wlib) FORCE
+ $(call if_changed,bootar)
+
+-hostprogs-y := addnote addRamDisk hack-coff mktree dtc
++hostprogs-y := addnote addRamDisk hack-coff mktree
+
+ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
+ extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
+@@ -133,47 +147,10 @@ extra-y := $(obj)/wrapper.a $(obj-plat)
+ dtstree := $(srctree)/$(src)/dts
+
+ wrapper :=$(srctree)/$(src)/wrapper
+-wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
++wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
+ $(wrapper) FORCE
+
+ #############
+-# Bits for building dtc
+-# DTC_GENPARSER := 1 # Uncomment to rebuild flex/bison output
+-
+-dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
+-dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
+-dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
+-
+-# prerequisites on generated files needs to be explicit
+-$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
+-$(obj)/dtc-src/dtc-lexer.lex.o: $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
+-
+-HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
+-
+-targets += dtc-src/dtc-parser.tab.c
+-targets += dtc-src/dtc-lexer.lex.c
+-
+-clean-files += dtc-src/dtc-parser.tab.h
+-
+-ifdef DTC_GENPARSER
+-BISON = bison
+-FLEX = flex
+-
+-quiet_cmd_bison = BISON $@
+- cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
+-quiet_cmd_flex = FLEX $@
+- cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
+-
+-$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
+- $(call if_changed,bison)
+-
+-$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
+-
+-$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
+- $(call if_changed,flex)
+-endif
+-
+-#############
+ # Bits for building various flavours of zImage
+
+ ifneq ($(CROSS32_COMPILE),)
+@@ -347,8 +324,10 @@ $(obj)/treeImage.%: vmlinux $(obj)/%.dtb
+ $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
+
+ # Rule to build device tree blobs
+-$(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc
+- $(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
++DTC = $(objtree)/scripts/dtc/dtc
++
++$(obj)/%.dtb: $(dtstree)/%.dts
++ $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
+
+ # If there isn't a platform selected then just strip the vmlinux.
+ ifeq (,$(image-y))
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/boot/simpleboot.c linux-2.6.30-rc4-git/arch/powerpc/boot/simpleboot.c
+--- linux-2.6.30-rc4/arch/powerpc/boot/simpleboot.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/boot/simpleboot.c 2009-05-13 09:46:19.000000000 +0200
+@@ -19,7 +19,7 @@
+ #include "types.h"
+ #include "io.h"
+ #include "stdio.h"
+-#include "libfdt/libfdt.h"
++#include <libfdt.h>
+
+ BSS_STACK(4*1024);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/include/asm/of_platform.h linux-2.6.30-rc4-git/arch/powerpc/include/asm/of_platform.h
+--- linux-2.6.30-rc4/arch/powerpc/include/asm/of_platform.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/include/asm/of_platform.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,16 +11,6 @@
+ *
+ */
+
+-/* Platform drivers register/unregister */
+-static inline int of_register_platform_driver(struct of_platform_driver *drv)
+-{
+- return of_register_driver(drv, &of_platform_bus_type);
+-}
+-static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
+-{
+- of_unregister_driver(drv);
+-}
+-
+ /* Platform devices and busses creation */
+ extern struct of_device *of_platform_device_create(struct device_node *np,
+ const char *bus_id,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/powerpc/Kconfig linux-2.6.30-rc4-git/arch/powerpc/Kconfig
+--- linux-2.6.30-rc4/arch/powerpc/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/powerpc/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -181,6 +181,10 @@ config SYS_SUPPORTS_APM_EMULATION
+ default y if PMAC_APM_EMU
+ bool
+
++config DTC
++ bool
++ default y
++
+ config DEFAULT_UIMAGE
+ bool
+ help
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/x86/include/asm/mce.h linux-2.6.30-rc4-git/arch/x86/include/asm/mce.h
+--- linux-2.6.30-rc4/arch/x86/include/asm/mce.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/x86/include/asm/mce.h 2009-05-13 09:46:19.000000000 +0200
+@@ -137,6 +137,7 @@ DECLARE_PER_CPU(mce_banks_t, mce_poll_ba
+ enum mcp_flags {
+ MCP_TIMESTAMP = (1 << 0), /* log time stamp */
+ MCP_UC = (1 << 1), /* log uncorrected errors */
++ MCP_DONTLOG = (1 << 2), /* only clear, don't log */
+ };
+ extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/arch/x86/kernel/cpu/mcheck/mce_64.c linux-2.6.30-rc4-git/arch/x86/kernel/cpu/mcheck/mce_64.c
+--- linux-2.6.30-rc4/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-05-13 09:46:19.000000000 +0200
+@@ -239,9 +239,10 @@ void machine_check_poll(enum mcp_flags f
+ * Don't get the IP here because it's unlikely to
+ * have anything to do with the actual error location.
+ */
+-
+- mce_log(&m);
+- add_taint(TAINT_MACHINE_CHECK);
++ if (!(flags & MCP_DONTLOG)) {
++ mce_log(&m);
++ add_taint(TAINT_MACHINE_CHECK);
++ }
+
+ /*
+ * Clear state for this bank.
+@@ -452,13 +453,14 @@ void mce_log_therm_throt_event(__u64 sta
+ */
+
+ static int check_interval = 5 * 60; /* 5 minutes */
+-static int next_interval; /* in jiffies */
++static DEFINE_PER_CPU(int, next_interval); /* in jiffies */
+ static void mcheck_timer(unsigned long);
+ static DEFINE_PER_CPU(struct timer_list, mce_timer);
+
+ static void mcheck_timer(unsigned long data)
+ {
+ struct timer_list *t = &per_cpu(mce_timer, data);
++ int *n;
+
+ WARN_ON(smp_processor_id() != data);
+
+@@ -470,14 +472,14 @@ static void mcheck_timer(unsigned long d
+ * Alert userspace if needed. If we logged an MCE, reduce the
+ * polling interval, otherwise increase the polling interval.
+ */
++ n = &__get_cpu_var(next_interval);
+ if (mce_notify_user()) {
+- next_interval = max(next_interval/2, HZ/100);
++ *n = max(*n/2, HZ/100);
+ } else {
+- next_interval = min(next_interval * 2,
+- (int)round_jiffies_relative(check_interval*HZ));
++ *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ));
+ }
+
+- t->expires = jiffies + next_interval;
++ t->expires = jiffies + *n;
+ add_timer(t);
+ }
+
+@@ -584,7 +586,7 @@ static void mce_init(void *dummy)
+ * Log the machine checks left over from the previous reset.
+ */
+ bitmap_fill(all_banks, MAX_NR_BANKS);
+- machine_check_poll(MCP_UC, &all_banks);
++ machine_check_poll(MCP_UC|(!mce_bootlog ? MCP_DONTLOG : 0), &all_banks);
+
+ set_in_cr4(X86_CR4_MCE);
+
+@@ -632,14 +634,13 @@ static void mce_cpu_features(struct cpui
+ static void mce_init_timer(void)
+ {
+ struct timer_list *t = &__get_cpu_var(mce_timer);
++ int *n = &__get_cpu_var(next_interval);
+
+- /* data race harmless because everyone sets to the same value */
+- if (!next_interval)
+- next_interval = check_interval * HZ;
+- if (!next_interval)
++ *n = check_interval * HZ;
++ if (!*n)
+ return;
+ setup_timer(t, mcheck_timer, smp_processor_id());
+- t->expires = round_jiffies(jiffies + next_interval);
++ t->expires = round_jiffies(jiffies + *n);
+ add_timer(t);
+ }
+
+@@ -907,7 +908,6 @@ static void mce_cpu_restart(void *data)
+ /* Reinit MCEs after user configuration changes */
+ static void mce_restart(void)
+ {
+- next_interval = check_interval * HZ;
+ on_each_cpu(mce_cpu_restart, NULL, 1);
+ }
+
+@@ -1110,7 +1110,8 @@ static int __cpuinit mce_cpu_callback(st
+ break;
+ case CPU_DOWN_FAILED:
+ case CPU_DOWN_FAILED_FROZEN:
+- t->expires = round_jiffies(jiffies + next_interval);
++ t->expires = round_jiffies(jiffies +
++ __get_cpu_var(next_interval));
+ add_timer_on(t, cpu);
+ smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
+ break;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/DocBook/Makefile linux-2.6.30-rc4-git/Documentation/DocBook/Makefile
+--- linux-2.6.30-rc4/Documentation/DocBook/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/Documentation/DocBook/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -143,7 +143,8 @@ quiet_cmd_db2pdf = PDF $@
+ $(call cmd,db2pdf)
+
+
+-main_idx = Documentation/DocBook/index.html
++index = index.html
++main_idx = Documentation/DocBook/$(index)
+ build_main_index = rm -rf $(main_idx) && \
+ echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
+ echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
+@@ -232,7 +233,7 @@ clean-files := $(DOCBOOKS) \
+ $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
+ $(patsubst %.xml, %.html, $(DOCBOOKS)) \
+ $(patsubst %.xml, %.9, $(DOCBOOKS)) \
+- $(C-procfs-example)
++ $(C-procfs-example) $(index)
+
+ clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/filesystems/Locking linux-2.6.30-rc4-git/Documentation/filesystems/Locking
+--- linux-2.6.30-rc4/Documentation/filesystems/Locking 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/Documentation/filesystems/Locking 2009-05-13 09:46:19.000000000 +0200
+@@ -512,16 +512,24 @@ locking rules:
+ BKL mmap_sem PageLocked(page)
+ open: no yes
+ close: no yes
+-fault: no yes
+-page_mkwrite: no yes no
++fault: no yes can return with page locked
++page_mkwrite: no yes can return with page locked
+ access: no yes
+
+- ->page_mkwrite() is called when a previously read-only page is
+-about to become writeable. The file system is responsible for
+-protecting against truncate races. Once appropriate action has been
+-taking to lock out truncate, the page range should be verified to be
+-within i_size. The page mapping should also be checked that it is not
+-NULL.
++ ->fault() is called when a previously not present pte is about
++to be faulted in. The filesystem must find and return the page associated
++with the passed in "pgoff" in the vm_fault structure. If it is possible that
++the page may be truncated and/or invalidated, then the filesystem must lock
++the page, then ensure it is not already truncated (the page lock will block
++subsequent truncate), and then return with VM_FAULT_LOCKED, and the page
++locked. The VM will unlock the page.
++
++ ->page_mkwrite() is called when a previously read-only pte is
++about to become writeable. The filesystem again must ensure that there are
++no truncate/invalidate races, and then return with the page locked. If
++the page has been truncated, the filesystem should not look up a new page
++like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
++will cause the VM to retry the fault.
+
+ ->access() is called when get_user_pages() fails in
+ acces_process_vm(), typically used to debug a process through
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/input/bcm5974.txt linux-2.6.30-rc4-git/Documentation/input/bcm5974.txt
+--- linux-2.6.30-rc4/Documentation/input/bcm5974.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/Documentation/input/bcm5974.txt 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,65 @@
++BCM5974 Driver (bcm5974)
++------------------------
++ Copyright (C) 2008-2009 Henrik Rydberg <rydberg@euromail.se>
++
++The USB initialization and package decoding was made by Scott Shawcroft as
++part of the touchd user-space driver project:
++ Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com)
++
++The BCM5974 driver is based on the appletouch driver:
++ Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com)
++ Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net)
++ Copyright (C) 2005 Stelian Pop (stelian@popies.net)
++ Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de)
++ Copyright (C) 2005 Peter Osterlund (petero2@telia.com)
++ Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch)
++ Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch)
++
++This driver adds support for the multi-touch trackpad on the new Apple
++Macbook Air and Macbook Pro laptops. It replaces the appletouch driver on
++those computers, and integrates well with the synaptics driver of the Xorg
++system.
++
++Known to work on Macbook Air, Macbook Pro Penryn and the new unibody
++Macbook 5 and Macbook Pro 5.
++
++Usage
++-----
++
++The driver loads automatically for the supported usb device ids, and
++becomes available both as an event device (/dev/input/event*) and as a
++mouse via the mousedev driver (/dev/input/mice).
++
++USB Race
++--------
++
++The Apple multi-touch trackpads report both mouse and keyboard events via
++different interfaces of the same usb device. This creates a race condition
++with the HID driver, which, if not told otherwise, will find the standard
++HID mouse and keyboard, and claim the whole device. To remedy, the usb
++product id must be listed in the mouse_ignore list of the hid driver.
++
++Debug output
++------------
++
++To ease the development for new hardware version, verbose packet output can
++be switched on with the debug kernel module parameter. The range [1-9]
++yields different levels of verbosity. Example (as root):
++
++echo -n 9 > /sys/module/bcm5974/parameters/debug
++
++tail -f /var/log/debug
++
++echo -n 0 > /sys/module/bcm5974/parameters/debug
++
++Trivia
++------
++
++The driver was developed at the ubuntu forums in June 2008 [1], and now has
++a more permanent home at bitmath.org [2].
++
++Links
++-----
++
++[1] http://ubuntuforums.org/showthread.php?t=840040
++[2] http://http://bitmath.org/code/
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/input/multi-touch-protocol.txt linux-2.6.30-rc4-git/Documentation/input/multi-touch-protocol.txt
+--- linux-2.6.30-rc4/Documentation/input/multi-touch-protocol.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/Documentation/input/multi-touch-protocol.txt 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,140 @@
++Multi-touch (MT) Protocol
++-------------------------
++ Copyright (C) 2009 Henrik Rydberg <rydberg@euromail.se>
++
++
++Introduction
++------------
++
++In order to utilize the full power of the new multi-touch devices, a way to
++report detailed finger data to user space is needed. This document
++describes the multi-touch (MT) protocol which allows kernel drivers to
++report details for an arbitrary number of fingers.
++
++
++Usage
++-----
++
++Anonymous finger details are sent sequentially as separate packets of ABS
++events. Only the ABS_MT events are recognized as part of a finger
++packet. The end of a packet is marked by calling the input_mt_sync()
++function, which generates a SYN_MT_REPORT event. The end of multi-touch
++transfer is marked by calling the usual input_sync() function.
++
++A set of ABS_MT events with the desired properties is defined. The events
++are divided into categories, to allow for partial implementation. The
++minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and
++ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the
++device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size
++of the approaching finger. Anisotropy and direction may be specified with
++ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. Devices with
++more granular information may specify general shapes as blobs, i.e., as a
++sequence of rectangular shapes grouped together by an
++ABS_MT_BLOB_ID. Finally, the ABS_MT_TOOL_TYPE may be used to specify
++whether the touching tool is a finger or a pen or something else.
++
++
++Event Semantics
++---------------
++
++The word "contact" is used to describe a tool which is in direct contact
++with the surface. A finger, a pen or a rubber all classify as contacts.
++
++ABS_MT_TOUCH_MAJOR
++
++The length of the major axis of the contact. The length should be given in
++surface units. If the surface has an X times Y resolution, the largest
++possible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal.
++
++ABS_MT_TOUCH_MINOR
++
++The length, in surface units, of the minor axis of the contact. If the
++contact is circular, this event can be omitted.
++
++ABS_MT_WIDTH_MAJOR
++
++The length, in surface units, of the major axis of the approaching
++tool. This should be understood as the size of the tool itself. The
++orientation of the contact and the approaching tool are assumed to be the
++same.
++
++ABS_MT_WIDTH_MINOR
++
++The length, in surface units, of the minor axis of the approaching
++tool. Omit if circular.
++
++The above four values can be used to derive additional information about
++the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
++the notion of pressure. The fingers of the hand and the palm all have
++different characteristic widths [1].
++
++ABS_MT_ORIENTATION
++
++The orientation of the ellipse. The value should describe half a revolution
++clockwise around the touch center. The scale of the value is arbitrary, but
++zero should be returned for an ellipse aligned along the Y axis of the
++surface. As an example, an index finger placed straight onto the axis could
++return zero orientation, something negative when twisted to the left, and
++something positive when twisted to the right. This value can be omitted if
++the touching object is circular, or if the information is not available in
++the kernel driver.
++
++ABS_MT_POSITION_X
++
++The surface X coordinate of the center of the touching ellipse.
++
++ABS_MT_POSITION_Y
++
++The surface Y coordinate of the center of the touching ellipse.
++
++ABS_MT_TOOL_TYPE
++
++The type of approaching tool. A lot of kernel drivers cannot distinguish
++between different tool types, such as a finger or a pen. In such cases, the
++event should be omitted. The protocol currently supports MT_TOOL_FINGER and
++MT_TOOL_PEN [2].
++
++ABS_MT_BLOB_ID
++
++The BLOB_ID groups several packets together into one arbitrarily shaped
++contact. This is a low-level anonymous grouping, and should not be confused
++with the high-level contactID, explained below. Most kernel drivers will
++not have this capability, and can safely omit the event.
++
++
++Finger Tracking
++---------------
++
++The kernel driver should generate an arbitrary enumeration of the set of
++anonymous contacts currently on the surface. The order in which the packets
++appear in the event stream is not important.
++
++The process of finger tracking, i.e., to assign a unique contactID to each
++initiated contact on the surface, is left to user space; preferably the
++multi-touch X driver [3]. In that driver, the contactID stays the same and
++unique until the contact vanishes (when the finger leaves the surface). The
++problem of assigning a set of anonymous fingers to a set of identified
++fingers is a euclidian bipartite matching problem at each event update, and
++relies on a sufficiently rapid update rate.
++
++Notes
++-----
++
++In order to stay compatible with existing applications, the data
++reported in a finger packet must not be recognized as single-touch
++events. In addition, all finger data must bypass input filtering,
++since subsequent events of the same type refer to different fingers.
++
++The first kernel driver to utilize the MT protocol is the bcm5974 driver,
++where examples can be found.
++
++[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
++difference between the contact position and the approaching tool position
++could be used to derive tilt.
++[2] The list can of course be extended.
++[3] The multi-touch X driver is currently in the prototyping stage. At the
++time of writing (April 2009), the MT protocol is not yet merged, and the
++prototype implements finger matching, basic mouse support and two-finger
++scrolling. The project aims at improving the quality of current multi-touch
++functionality available in the synaptics X driver, and in addition
++implement more advanced gestures.
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/kernel-doc-nano-HOWTO.txt linux-2.6.30-rc4-git/Documentation/kernel-doc-nano-HOWTO.txt
+--- linux-2.6.30-rc4/Documentation/kernel-doc-nano-HOWTO.txt 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/Documentation/kernel-doc-nano-HOWTO.txt 2009-05-13 09:46:19.000000000 +0200
+@@ -269,7 +269,10 @@ Use the argument mechanism to document m
+
+ Inside a struct description, you can use the "private:" and "public:"
+ comment tags. Structure fields that are inside a "private:" area
+-are not listed in the generated output documentation.
++are not listed in the generated output documentation. The "private:"
++and "public:" tags must begin immediately following a "/*" comment
++marker. They may optionally include comments between the ":" and the
++ending "*/" marker.
+
+ Example:
+
+@@ -283,7 +286,7 @@ Example:
+ struct my_struct {
+ int a;
+ int b;
+-/* private: */
++/* private: internal use only */
+ int c;
+ };
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Documentation/sysctl/vm.txt linux-2.6.30-rc4-git/Documentation/sysctl/vm.txt
+--- linux-2.6.30-rc4/Documentation/sysctl/vm.txt 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/Documentation/sysctl/vm.txt 2009-05-13 09:46:19.000000000 +0200
+@@ -90,6 +90,10 @@ will itself start writeback.
+ If dirty_bytes is written, dirty_ratio becomes a function of its value
+ (dirty_bytes / the amount of dirtyable system memory).
+
++Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
++value lower than this limit will be ignored and the old configuration will be
++retained.
++
+ ==============================================================
+
+ dirty_expire_centisecs
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/acpi/acpica/rscalc.c linux-2.6.30-rc4-git/drivers/acpi/acpica/rscalc.c
+--- linux-2.6.30-rc4/drivers/acpi/acpica/rscalc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/acpi/acpica/rscalc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -543,6 +543,13 @@ acpi_rs_get_pci_routing_table_length(uni
+
+ package_element = *top_object_list;
+
++ /* We must have a valid Package object */
++
++ if (!package_element ||
++ (package_element->common.type != ACPI_TYPE_PACKAGE)) {
++ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
++ }
++
+ /*
+ * The sub_object_list will now point to an array of the
+ * four IRQ elements: Address, Pin, Source and source_index
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/char/hw_random/Kconfig linux-2.6.30-rc4-git/drivers/char/hw_random/Kconfig
+--- linux-2.6.30-rc4/drivers/char/hw_random/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/char/hw_random/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -148,3 +148,15 @@ config HW_RANDOM_VIRTIO
+
+ To compile this driver as a module, choose M here: the
+ module will be called virtio-rng. If unsure, say N.
++
++config HW_RANDOM_MXC_RNGA
++ tristate "Freescale i.MX RNGA Random Number Generator"
++ depends on HW_RANDOM && ARCH_HAS_RNGA
++ ---help---
++ This driver provides kernel-side support for the Random Number
++ Generator hardware found on Freescale i.MX processors.
++
++ To compile this driver as a module, choose M here: the
++ module will be called mxc-rnga.
++
++ If unsure, say Y.
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/char/hw_random/Makefile linux-2.6.30-rc4-git/drivers/char/hw_random/Makefile
+--- linux-2.6.30-rc4/drivers/char/hw_random/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/char/hw_random/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -15,3 +15,4 @@ obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx
+ obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o
+ obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o
+ obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o
++obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/char/hw_random/mxc-rnga.c linux-2.6.30-rc4-git/drivers/char/hw_random/mxc-rnga.c
+--- linux-2.6.30-rc4/drivers/char/hw_random/mxc-rnga.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/drivers/char/hw_random/mxc-rnga.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,247 @@
++/*
++ * RNG driver for Freescale RNGA
++ *
++ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Author: Alan Carvalho de Assis <acassis@gmail.com>
++ */
++
++/*
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ *
++ * This driver is based on other RNG drivers.
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/ioport.h>
++#include <linux/platform_device.h>
++#include <linux/hw_random.h>
++#include <linux/io.h>
++
++/* RNGA Registers */
++#define RNGA_CONTROL 0x00
++#define RNGA_STATUS 0x04
++#define RNGA_ENTROPY 0x08
++#define RNGA_OUTPUT_FIFO 0x0c
++#define RNGA_MODE 0x10
++#define RNGA_VERIFICATION_CONTROL 0x14
++#define RNGA_OSC_CONTROL_COUNTER 0x18
++#define RNGA_OSC1_COUNTER 0x1c
++#define RNGA_OSC2_COUNTER 0x20
++#define RNGA_OSC_COUNTER_STATUS 0x24
++
++/* RNGA Registers Range */
++#define RNG_ADDR_RANGE 0x28
++
++/* RNGA Control Register */
++#define RNGA_CONTROL_SLEEP 0x00000010
++#define RNGA_CONTROL_CLEAR_INT 0x00000008
++#define RNGA_CONTROL_MASK_INTS 0x00000004
++#define RNGA_CONTROL_HIGH_ASSURANCE 0x00000002
++#define RNGA_CONTROL_GO 0x00000001
++
++#define RNGA_STATUS_LEVEL_MASK 0x0000ff00
++
++/* RNGA Status Register */
++#define RNGA_STATUS_OSC_DEAD 0x80000000
++#define RNGA_STATUS_SLEEP 0x00000010
++#define RNGA_STATUS_ERROR_INT 0x00000008
++#define RNGA_STATUS_FIFO_UNDERFLOW 0x00000004
++#define RNGA_STATUS_LAST_READ_STATUS 0x00000002
++#define RNGA_STATUS_SECURITY_VIOLATION 0x00000001
++
++static struct platform_device *rng_dev;
++
++static int mxc_rnga_data_present(struct hwrng *rng)
++{
++ int level;
++ void __iomem *rng_base = (void __iomem *)rng->priv;
++
++ /* how many random numbers is in FIFO? [0-16] */
++ level = ((__raw_readl(rng_base + RNGA_STATUS) &
++ RNGA_STATUS_LEVEL_MASK) >> 8);
++
++ return level > 0 ? 1 : 0;
++}
++
++static int mxc_rnga_data_read(struct hwrng *rng, u32 * data)
++{
++ int err;
++ u32 ctrl;
++ void __iomem *rng_base = (void __iomem *)rng->priv;
++
++ /* retrieve a random number from FIFO */
++ *data = __raw_readl(rng_base + RNGA_OUTPUT_FIFO);
++
++ /* some error while reading this random number? */
++ err = __raw_readl(rng_base + RNGA_STATUS) & RNGA_STATUS_ERROR_INT;
++
++ /* if error: clear error interrupt, but doesn't return random number */
++ if (err) {
++ dev_dbg(&rng_dev->dev, "Error while reading random number!\n");
++ ctrl = __raw_readl(rng_base + RNGA_CONTROL);
++ __raw_writel(ctrl | RNGA_CONTROL_CLEAR_INT,
++ rng_base + RNGA_CONTROL);
++ return 0;
++ } else
++ return 4;
++}
++
++static int mxc_rnga_init(struct hwrng *rng)
++{
++ u32 ctrl, osc;
++ void __iomem *rng_base = (void __iomem *)rng->priv;
++
++ /* wake up */
++ ctrl = __raw_readl(rng_base + RNGA_CONTROL);
++ __raw_writel(ctrl & ~RNGA_CONTROL_SLEEP, rng_base + RNGA_CONTROL);
++
++ /* verify if oscillator is working */
++ osc = __raw_readl(rng_base + RNGA_STATUS);
++ if (osc & RNGA_STATUS_OSC_DEAD) {
++ dev_err(&rng_dev->dev, "RNGA Oscillator is dead!\n");
++ return -ENODEV;
++ }
++
++ /* go running */
++ ctrl = __raw_readl(rng_base + RNGA_CONTROL);
++ __raw_writel(ctrl | RNGA_CONTROL_GO, rng_base + RNGA_CONTROL);
++
++ return 0;
++}
++
++static void mxc_rnga_cleanup(struct hwrng *rng)
++{
++ u32 ctrl;
++ void __iomem *rng_base = (void __iomem *)rng->priv;
++
++ ctrl = __raw_readl(rng_base + RNGA_CONTROL);
++
++ /* stop rnga */
++ __raw_writel(ctrl & ~RNGA_CONTROL_GO, rng_base + RNGA_CONTROL);
++}
++
++static struct hwrng mxc_rnga = {
++ .name = "mxc-rnga",
++ .init = mxc_rnga_init,
++ .cleanup = mxc_rnga_cleanup,
++ .data_present = mxc_rnga_data_present,
++ .data_read = mxc_rnga_data_read
++};
++
++static int __init mxc_rnga_probe(struct platform_device *pdev)
++{
++ int err = -ENODEV;
++ struct clk *clk;
++ struct resource *res, *mem;
++ void __iomem *rng_base = NULL;
++
++ if (rng_dev)
++ return -EBUSY;
++
++ clk = clk_get(&pdev->dev, "rng");
++ if (IS_ERR(clk)) {
++ dev_err(&pdev->dev, "Could not get rng_clk!\n");
++ err = PTR_ERR(clk);
++ goto out;
++ }
++
++ clk_enable(clk);
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ err = -ENOENT;
++ goto err_region;
++ }
++
++ mem = request_mem_region(res->start, resource_size(res), pdev->name);
++ if (mem == NULL) {
++ err = -EBUSY;
++ goto err_region;
++ }
++
++ rng_base = ioremap(res->start, resource_size(res));
++ if (!rng_base) {
++ err = -ENOMEM;
++ goto err_ioremap;
++ }
++
++ mxc_rnga.priv = (unsigned long)rng_base;
++
++ err = hwrng_register(&mxc_rnga);
++ if (err) {
++ dev_err(&pdev->dev, "MXC RNGA registering failed (%d)\n", err);
++ goto err_register;
++ }
++
++ rng_dev = pdev;
++
++ dev_info(&pdev->dev, "MXC RNGA Registered.\n");
++
++ return 0;
++
++err_register:
++ iounmap(rng_base);
++ rng_base = NULL;
++
++err_ioremap:
++ release_mem_region(res->start, resource_size(res));
++
++err_region:
++ clk_disable(clk);
++ clk_put(clk);
++
++out:
++ return err;
++}
++
++static int __exit mxc_rnga_remove(struct platform_device *pdev)
++{
++ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ void __iomem *rng_base = (void __iomem *)mxc_rnga.priv;
++ struct clk *clk = clk_get(&pdev->dev, "rng");
++
++ hwrng_unregister(&mxc_rnga);
++
++ iounmap(rng_base);
++
++ release_mem_region(res->start, resource_size(res));
++
++ clk_disable(clk);
++ clk_put(clk);
++
++ return 0;
++}
++
++static struct platform_driver mxc_rnga_driver = {
++ .driver = {
++ .name = "mxc_rnga",
++ .owner = THIS_MODULE,
++ },
++ .remove = __exit_p(mxc_rnga_remove),
++};
++
++static int __init mod_init(void)
++{
++ return platform_driver_probe(&mxc_rnga_driver, mxc_rnga_probe);
++}
++
++static void __exit mod_exit(void)
++{
++ platform_driver_unregister(&mxc_rnga_driver);
++}
++
++module_init(mod_init);
++module_exit(mod_exit);
++
++MODULE_AUTHOR("Freescale Semiconductor, Inc.");
++MODULE_DESCRIPTION("H/W RNGA driver for i.MX");
++MODULE_LICENSE("GPL");
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/firmware/iscsi_ibft.c linux-2.6.30-rc4-git/drivers/firmware/iscsi_ibft.c
+--- linux-2.6.30-rc4/drivers/firmware/iscsi_ibft.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/firmware/iscsi_ibft.c 2009-05-13 09:46:19.000000000 +0200
+@@ -754,11 +754,11 @@ static int __init ibft_check_nic_for(str
+ rc = 1;
+ break;
+ case ibft_eth_ip_addr:
+- if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
++ if (memcmp(nic->ip_addr, nulls, sizeof(nic->ip_addr)))
+ rc = 1;
+ break;
+ case ibft_eth_subnet_mask:
+- if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
++ if (nic->subnet_mask_prefix)
+ rc = 1;
+ break;
+ case ibft_eth_origin:
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/hid-apple.c linux-2.6.30-rc4-git/drivers/hid/hid-apple.c
+--- linux-2.6.30-rc4/drivers/hid/hid-apple.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/hid-apple.c 2009-05-13 09:46:19.000000000 +0200
+@@ -151,7 +151,7 @@ static int hidinput_apple_event(struct h
+ if (fnmode) {
+ int do_translate;
+
+- trans = apple_find_translation((hid->product < 0x220 ||
++ trans = apple_find_translation((hid->product < 0x21d ||
+ hid->product >= 0x300) ?
+ powerbook_fn_keys : apple_fn_keys,
+ usage->code);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/hid-core.c linux-2.6.30-rc4-git/drivers/hid/hid-core.c
+--- linux-2.6.30-rc4/drivers/hid/hid-core.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/hid-core.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1293,6 +1293,7 @@ static const struct hid_device_id hid_bl
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) },
+@@ -1824,6 +1825,9 @@ int hid_check_keys_pressed(struct hid_de
+ struct hid_input *hidinput;
+ int i;
+
++ if (!(hid->claimed & HID_CLAIMED_INPUT))
++ return 0;
++
+ list_for_each_entry(hidinput, &hid->inputs, list) {
+ for (i = 0; i < BITS_TO_LONGS(KEY_MAX); i++)
+ if (hidinput->input->key[i])
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/hid-ids.h linux-2.6.30-rc4-git/drivers/hid/hid-ids.h
+--- linux-2.6.30-rc4/drivers/hid/hid-ids.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/hid-ids.h 2009-05-13 09:46:19.000000000 +0200
+@@ -292,6 +292,7 @@
+ #define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
+ #define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294
+ #define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL 0xc295
++#define USB_DEVICE_ID_LOGITECH_G25_WHEEL 0xc299
+ #define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a
+ #define USB_DEVICE_ID_S510_RECEIVER 0xc50c
+ #define USB_DEVICE_ID_S510_RECEIVER_2 0xc517
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/hid-lg.c linux-2.6.30-rc4-git/drivers/hid/hid-lg.c
+--- linux-2.6.30-rc4/drivers/hid/hid-lg.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/hid-lg.c 2009-05-13 09:46:19.000000000 +0200
+@@ -297,6 +297,8 @@ static const struct hid_device_id lg_dev
+ .driver_data = LG_FF },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
+ .driver_data = LG_FF },
++ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
++ .driver_data = LG_FF },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
+ .driver_data = LG_FF2 },
+ { }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/hidraw.c linux-2.6.30-rc4-git/drivers/hid/hidraw.c
+--- linux-2.6.30-rc4/drivers/hid/hidraw.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/hidraw.c 2009-05-13 09:46:19.000000000 +0200
+@@ -285,8 +285,10 @@ static long hidraw_ioctl(struct file *fi
+
+ if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWNAME(0))) {
+ int len;
+- if (!hid->name)
+- return 0;
++ if (!hid->name) {
++ ret = 0;
++ break;
++ }
+ len = strlen(hid->name) + 1;
+ if (len > _IOC_SIZE(cmd))
+ len = _IOC_SIZE(cmd);
+@@ -297,8 +299,10 @@ static long hidraw_ioctl(struct file *fi
+
+ if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWPHYS(0))) {
+ int len;
+- if (!hid->phys)
+- return 0;
++ if (!hid->phys) {
++ ret = 0;
++ break;
++ }
+ len = strlen(hid->phys) + 1;
+ if (len > _IOC_SIZE(cmd))
+ len = _IOC_SIZE(cmd);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/hid/usbhid/hid-core.c linux-2.6.30-rc4-git/drivers/hid/usbhid/hid-core.c
+--- linux-2.6.30-rc4/drivers/hid/usbhid/hid-core.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/hid/usbhid/hid-core.c 2009-05-13 09:46:19.000000000 +0200
+@@ -662,8 +662,8 @@ void usbhid_close(struct hid_device *hid
+ spin_lock_irq(&usbhid->lock);
+ if (!--hid->open) {
+ spin_unlock_irq(&usbhid->lock);
++ hid_cancel_delayed_stuff(usbhid);
+ usb_kill_urb(usbhid->urbin);
+- flush_scheduled_work();
+ usbhid->intf->needs_remote_wakeup = 0;
+ } else {
+ spin_unlock_irq(&usbhid->lock);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/ide/ide-cd.c linux-2.6.30-rc4-git/drivers/ide/ide-cd.c
+--- linux-2.6.30-rc4/drivers/ide/ide-cd.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/ide/ide-cd.c 2009-05-13 09:46:19.000000000 +0200
+@@ -312,7 +312,6 @@ static int cdrom_decode_status(ide_drive
+ ide_hwif_t *hwif = drive->hwif;
+ struct request *rq = hwif->rq;
+ int err, sense_key, do_end_request = 0;
+- u8 quiet = rq->cmd_flags & REQ_QUIET;
+
+ /* get the IDE error register */
+ err = ide_read_error(drive);
+@@ -347,7 +346,7 @@ static int cdrom_decode_status(ide_drive
+ } else {
+ cdrom_saw_media_change(drive);
+
+- if (blk_fs_request(rq) && !quiet)
++ if (blk_fs_request(rq) && !blk_rq_quiet(rq))
+ printk(KERN_ERR PFX "%s: tray open\n",
+ drive->name);
+ }
+@@ -382,7 +381,7 @@ static int cdrom_decode_status(ide_drive
+ * No point in retrying after an illegal request or data
+ * protect error.
+ */
+- if (!quiet)
++ if (!blk_rq_quiet(rq))
+ ide_dump_status(drive, "command error", stat);
+ do_end_request = 1;
+ break;
+@@ -391,14 +390,14 @@ static int cdrom_decode_status(ide_drive
+ * No point in re-trying a zillion times on a bad sector.
+ * If we got here the error is not correctable.
+ */
+- if (!quiet)
++ if (!blk_rq_quiet(rq))
+ ide_dump_status(drive, "media error "
+ "(bad sector)", stat);
+ do_end_request = 1;
+ break;
+ case BLANK_CHECK:
+ /* disk appears blank? */
+- if (!quiet)
++ if (!blk_rq_quiet(rq))
+ ide_dump_status(drive, "media error (blank)",
+ stat);
+ do_end_request = 1;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/infiniband/ulp/iser/iscsi_iser.c linux-2.6.30-rc4-git/drivers/infiniband/ulp/iser/iscsi_iser.c
+--- linux-2.6.30-rc4/drivers/infiniband/ulp/iser/iscsi_iser.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/infiniband/ulp/iser/iscsi_iser.c 2009-05-13 09:46:19.000000000 +0200
+@@ -599,6 +599,7 @@ static struct scsi_host_template iscsi_i
+ .eh_abort_handler = iscsi_eh_abort,
+ .eh_device_reset_handler= iscsi_eh_device_reset,
+ .eh_target_reset_handler= iscsi_eh_target_reset,
++ .target_alloc = iscsi_target_alloc,
+ .use_clustering = DISABLE_CLUSTERING,
+ .proc_name = "iscsi_iser",
+ .this_id = -1,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/input.c linux-2.6.30-rc4-git/drivers/input/input.c
+--- linux-2.6.30-rc4/drivers/input/input.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/input.c 2009-05-13 09:46:19.000000000 +0200
+@@ -29,6 +29,23 @@ MODULE_LICENSE("GPL");
+
+ #define INPUT_DEVICES 256
+
++/*
++ * EV_ABS events which should not be cached are listed here.
++ */
++static unsigned int input_abs_bypass_init_data[] __initdata = {
++ ABS_MT_TOUCH_MAJOR,
++ ABS_MT_TOUCH_MINOR,
++ ABS_MT_WIDTH_MAJOR,
++ ABS_MT_WIDTH_MINOR,
++ ABS_MT_ORIENTATION,
++ ABS_MT_POSITION_X,
++ ABS_MT_POSITION_Y,
++ ABS_MT_TOOL_TYPE,
++ ABS_MT_BLOB_ID,
++ 0
++};
++static unsigned long input_abs_bypass[BITS_TO_LONGS(ABS_CNT)];
++
+ static LIST_HEAD(input_dev_list);
+ static LIST_HEAD(input_handler_list);
+
+@@ -161,6 +178,10 @@ static void input_handle_event(struct in
+ disposition = INPUT_PASS_TO_HANDLERS;
+ }
+ break;
++ case SYN_MT_REPORT:
++ dev->sync = 0;
++ disposition = INPUT_PASS_TO_HANDLERS;
++ break;
+ }
+ break;
+
+@@ -192,6 +213,11 @@ static void input_handle_event(struct in
+ case EV_ABS:
+ if (is_event_supported(code, dev->absbit, ABS_MAX)) {
+
++ if (test_bit(code, input_abs_bypass)) {
++ disposition = INPUT_PASS_TO_HANDLERS;
++ break;
++ }
++
+ value = input_defuzz_abs_event(value,
+ dev->abs[code], dev->absfuzz[code]);
+
+@@ -1634,10 +1660,20 @@ static const struct file_operations inpu
+ .open = input_open_file,
+ };
+
++static void __init input_init_abs_bypass(void)
++{
++ const unsigned int *p;
++
++ for (p = input_abs_bypass_init_data; *p; p++)
++ input_abs_bypass[BIT_WORD(*p)] |= BIT_MASK(*p);
++}
++
+ static int __init input_init(void)
+ {
+ int err;
+
++ input_init_abs_bypass();
++
+ err = class_register(&input_class);
+ if (err) {
+ printk(KERN_ERR "input: unable to register input_dev class\n");
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/keyboard/omap-keypad.c linux-2.6.30-rc4-git/drivers/input/keyboard/omap-keypad.c
+--- linux-2.6.30-rc4/drivers/input/keyboard/omap-keypad.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/keyboard/omap-keypad.c 2009-05-13 09:46:19.000000000 +0200
+@@ -100,8 +100,20 @@ static irqreturn_t omap_kp_interrupt(int
+ /* disable keyboard interrupt and schedule for handling */
+ if (cpu_is_omap24xx()) {
+ int i;
+- for (i = 0; i < omap_kp->rows; i++)
+- disable_irq(gpio_to_irq(row_gpios[i]));
++
++ for (i = 0; i < omap_kp->rows; i++) {
++ int gpio_irq = gpio_to_irq(row_gpios[i]);
++ /*
++ * The interrupt which we're currently handling should
++ * be disabled _nosync() to avoid deadlocks waiting
++ * for this handler to complete. All others should
++ * be disabled the regular way for SMP safety.
++ */
++ if (gpio_irq == irq)
++ disable_irq_nosync(gpio_irq);
++ else
++ disable_irq(gpio_irq);
++ }
+ } else
+ /* disable keyboard interrupt and schedule for handling */
+ omap_writew(1, OMAP_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/alps.c linux-2.6.30-rc4-git/drivers/input/mouse/alps.c
+--- linux-2.6.30-rc4/drivers/input/mouse/alps.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/alps.c 2009-05-13 09:46:19.000000000 +0200
+@@ -37,6 +37,7 @@
+ #define ALPS_FW_BK_2 0x40
+
+ static const struct alps_model_info alps_model_data[] = {
++ { { 0x32, 0x02, 0x14 }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Toshiba Salellite Pro M10 */
+ { { 0x33, 0x02, 0x0a }, 0x88, 0xf8, ALPS_OLDPROTO }, /* UMAX-530T */
+ { { 0x53, 0x02, 0x0a }, 0xf8, 0xf8, 0 },
+ { { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 },
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/appletouch.c linux-2.6.30-rc4-git/drivers/input/mouse/appletouch.c
+--- linux-2.6.30-rc4/drivers/input/mouse/appletouch.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/appletouch.c 2009-05-13 09:46:19.000000000 +0200
+@@ -255,15 +255,22 @@ MODULE_PARM_DESC(debug, "Activate debugg
+ */
+ static int atp_geyser_init(struct usb_device *udev)
+ {
+- char data[8];
++ char *data;
+ int size;
+ int i;
++ int ret;
++
++ data = kmalloc(8, GFP_KERNEL);
++ if (!data) {
++ err("Out of memory");
++ return -ENOMEM;
++ }
+
+ size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+ ATP_GEYSER_MODE_READ_REQUEST_ID,
+ USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ ATP_GEYSER_MODE_REQUEST_VALUE,
+- ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
++ ATP_GEYSER_MODE_REQUEST_INDEX, data, 8, 5000);
+
+ if (size != 8) {
+ dprintk("atp_geyser_init: read error\n");
+@@ -271,7 +278,8 @@ static int atp_geyser_init(struct usb_de
+ dprintk("appletouch[%d]: %d\n", i, data[i]);
+
+ err("Failed to read mode from device.");
+- return -EIO;
++ ret = -EIO;
++ goto out_free;
+ }
+
+ /* Apply the mode switch */
+@@ -281,7 +289,7 @@ static int atp_geyser_init(struct usb_de
+ ATP_GEYSER_MODE_WRITE_REQUEST_ID,
+ USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ ATP_GEYSER_MODE_REQUEST_VALUE,
+- ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
++ ATP_GEYSER_MODE_REQUEST_INDEX, data, 8, 5000);
+
+ if (size != 8) {
+ dprintk("atp_geyser_init: write error\n");
+@@ -289,9 +297,13 @@ static int atp_geyser_init(struct usb_de
+ dprintk("appletouch[%d]: %d\n", i, data[i]);
+
+ err("Failed to request geyser raw mode");
+- return -EIO;
++ ret = -EIO;
++ goto out_free;
+ }
+- return 0;
++ ret = 0;
++out_free:
++ kfree(data);
++ return ret;
+ }
+
+ /*
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/bcm5974.c linux-2.6.30-rc4-git/drivers/input/mouse/bcm5974.c
+--- linux-2.6.30-rc4/drivers/input/mouse/bcm5974.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/bcm5974.c 2009-05-13 09:46:19.000000000 +0200
+@@ -51,6 +51,10 @@
+ #define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230
+ #define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231
+ #define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232
++/* Macbook5,1 (unibody), aka wellspring3 */
++#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236
++#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237
++#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238
+
+ #define BCM5974_DEVICE(prod) { \
+ .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
+@@ -72,6 +76,10 @@ static const struct usb_device_id bcm597
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI),
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_ISO),
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_JIS),
++ /* Macbook5,1 */
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ISO),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_JIS),
+ /* Terminating entry */
+ {}
+ };
+@@ -96,14 +104,23 @@ struct bt_data {
+ u8 rel_y; /* relative y coordinate */
+ };
+
+-/* trackpad header structure */
+-struct tp_header {
+- u8 unknown1[16]; /* constants, timers, etc */
+- u8 fingers; /* number of fingers on trackpad */
+- u8 unknown2[9]; /* constants, timers, etc */
++/* trackpad header types */
++enum tp_type {
++ TYPE1, /* plain trackpad */
++ TYPE2 /* button integrated in trackpad */
+ };
+
+-/* trackpad finger structure */
++/* trackpad finger data offsets, le16-aligned */
++#define FINGER_TYPE1 (13 * sizeof(__le16))
++#define FINGER_TYPE2 (15 * sizeof(__le16))
++
++/* trackpad button data offsets */
++#define BUTTON_TYPE2 15
++
++/* list of device capability bits */
++#define HAS_INTEGRATED_BUTTON 1
++
++/* trackpad finger structure, le16-aligned */
+ struct tp_finger {
+ __le16 origin; /* zero when switching track finger */
+ __le16 abs_x; /* absolute x coodinate */
+@@ -117,13 +134,11 @@ struct tp_finger {
+ __le16 force_minor; /* trackpad force, minor axis? */
+ __le16 unused[3]; /* zeros */
+ __le16 multi; /* one finger: varies, more fingers: constant */
+-};
++} __attribute__((packed,aligned(2)));
+
+-/* trackpad data structure, empirically at least ten fingers */
+-struct tp_data {
+- struct tp_header header;
+- struct tp_finger finger[16];
+-};
++/* trackpad finger data size, empirically at least ten fingers */
++#define SIZEOF_FINGER sizeof(struct tp_finger)
++#define SIZEOF_ALL_FINGERS (16 * SIZEOF_FINGER)
+
+ /* device-specific parameters */
+ struct bcm5974_param {
+@@ -136,9 +151,12 @@ struct bcm5974_param {
+ /* device-specific configuration */
+ struct bcm5974_config {
+ int ansi, iso, jis; /* the product id of this device */
++ int caps; /* device capability bitmask */
+ int bt_ep; /* the endpoint of the button interface */
+ int bt_datalen; /* data length of the button interface */
+ int tp_ep; /* the endpoint of the trackpad interface */
++ enum tp_type tp_type; /* type of trackpad interface */
++ int tp_offset; /* offset to trackpad finger data */
+ int tp_datalen; /* data length of the trackpad interface */
+ struct bcm5974_param p; /* finger pressure limits */
+ struct bcm5974_param w; /* finger width limits */
+@@ -158,7 +176,7 @@ struct bcm5974 {
+ struct urb *bt_urb; /* button usb request block */
+ struct bt_data *bt_data; /* button transferred data */
+ struct urb *tp_urb; /* trackpad usb request block */
+- struct tp_data *tp_data; /* trackpad transferred data */
++ u8 *tp_data; /* trackpad transferred data */
+ int fingers; /* number of fingers on trackpad */
+ };
+
+@@ -183,8 +201,9 @@ static const struct bcm5974_config bcm59
+ USB_DEVICE_ID_APPLE_WELLSPRING_ANSI,
+ USB_DEVICE_ID_APPLE_WELLSPRING_ISO,
+ USB_DEVICE_ID_APPLE_WELLSPRING_JIS,
++ 0,
+ 0x84, sizeof(struct bt_data),
+- 0x81, sizeof(struct tp_data),
++ 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
+ { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 },
+ { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
+ { DIM_X, DIM_X / SN_COORD, -4824, 5342 },
+@@ -194,13 +213,26 @@ static const struct bcm5974_config bcm59
+ USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI,
+ USB_DEVICE_ID_APPLE_WELLSPRING2_ISO,
+ USB_DEVICE_ID_APPLE_WELLSPRING2_JIS,
++ 0,
+ 0x84, sizeof(struct bt_data),
+- 0x81, sizeof(struct tp_data),
++ 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
+ { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 },
+ { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
+ { DIM_X, DIM_X / SN_COORD, -4824, 4824 },
+ { DIM_Y, DIM_Y / SN_COORD, -172, 4290 }
+ },
++ {
++ USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI,
++ USB_DEVICE_ID_APPLE_WELLSPRING3_ISO,
++ USB_DEVICE_ID_APPLE_WELLSPRING3_JIS,
++ HAS_INTEGRATED_BUTTON,
++ 0x84, sizeof(struct bt_data),
++ 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
++ { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
++ { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
++ { DIM_X, DIM_X / SN_COORD, -4460, 5166 },
++ { DIM_Y, DIM_Y / SN_COORD, -75, 6700 }
++ },
+ {}
+ };
+
+@@ -257,6 +289,7 @@ static void setup_events_to_report(struc
+ __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+ __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+ __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
++ __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
+ __set_bit(BTN_LEFT, input_dev->keybit);
+ }
+
+@@ -266,6 +299,11 @@ static int report_bt_state(struct bcm597
+ if (size != sizeof(struct bt_data))
+ return -EIO;
+
++ dprintk(7,
++ "bcm5974: button data: %x %x %x %x\n",
++ dev->bt_data->unknown1, dev->bt_data->button,
++ dev->bt_data->rel_x, dev->bt_data->rel_y);
++
+ input_report_key(dev->input, BTN_LEFT, dev->bt_data->button);
+ input_sync(dev->input);
+
+@@ -276,29 +314,37 @@ static int report_bt_state(struct bcm597
+ static int report_tp_state(struct bcm5974 *dev, int size)
+ {
+ const struct bcm5974_config *c = &dev->cfg;
+- const struct tp_finger *f = dev->tp_data->finger;
++ const struct tp_finger *f;
+ struct input_dev *input = dev->input;
+- const int fingers = (size - 26) / 28;
+- int raw_p, raw_w, raw_x, raw_y;
+- int ptest = 0, origin = 0, nmin = 0, nmax = 0;
++ int raw_p, raw_w, raw_x, raw_y, raw_n;
++ int ptest = 0, origin = 0, ibt = 0, nmin = 0, nmax = 0;
+ int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0;
+
+- if (size < 26 || (size - 26) % 28 != 0)
++ if (size < c->tp_offset || (size - c->tp_offset) % SIZEOF_FINGER != 0)
+ return -EIO;
+
++ /* finger data, le16-aligned */
++ f = (const struct tp_finger *)(dev->tp_data + c->tp_offset);
++ raw_n = (size - c->tp_offset) / SIZEOF_FINGER;
++
+ /* always track the first finger; when detached, start over */
+- if (fingers) {
++ if (raw_n) {
+ raw_p = raw2int(f->force_major);
+ raw_w = raw2int(f->size_major);
+ raw_x = raw2int(f->abs_x);
+ raw_y = raw2int(f->abs_y);
+
+ dprintk(9,
+- "bcm5974: raw: p: %+05d w: %+05d x: %+05d y: %+05d\n",
+- raw_p, raw_w, raw_x, raw_y);
++ "bcm5974: "
++ "raw: p: %+05d w: %+05d x: %+05d y: %+05d n: %d\n",
++ raw_p, raw_w, raw_x, raw_y, raw_n);
+
+ ptest = int2bound(&c->p, raw_p);
+ origin = raw2int(f->origin);
++
++ /* set the integrated button if applicable */
++ if (c->tp_type == TYPE2)
++ ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
+ }
+
+ /* while tracking finger still valid, count all fingers */
+@@ -307,12 +353,13 @@ static int report_tp_state(struct bcm597
+ abs_w = int2bound(&c->w, raw_w);
+ abs_x = int2bound(&c->x, raw_x - c->x.devmin);
+ abs_y = int2bound(&c->y, c->y.devmax - raw_y);
+- for (; f != dev->tp_data->finger + fingers; f++) {
++ while (raw_n--) {
+ ptest = int2bound(&c->p, raw2int(f->force_major));
+ if (ptest > PRESSURE_LOW)
+ nmax++;
+ if (ptest > PRESSURE_HIGH)
+ nmin++;
++ f++;
+ }
+ }
+
+@@ -324,7 +371,8 @@ static int report_tp_state(struct bcm597
+ input_report_key(input, BTN_TOUCH, dev->fingers > 0);
+ input_report_key(input, BTN_TOOL_FINGER, dev->fingers == 1);
+ input_report_key(input, BTN_TOOL_DOUBLETAP, dev->fingers == 2);
+- input_report_key(input, BTN_TOOL_TRIPLETAP, dev->fingers > 2);
++ input_report_key(input, BTN_TOOL_TRIPLETAP, dev->fingers == 3);
++ input_report_key(input, BTN_TOOL_QUADTAP, dev->fingers > 3);
+
+ input_report_abs(input, ABS_PRESSURE, abs_p);
+ input_report_abs(input, ABS_TOOL_WIDTH, abs_w);
+@@ -335,11 +383,15 @@ static int report_tp_state(struct bcm597
+
+ dprintk(8,
+ "bcm5974: abs: p: %+05d w: %+05d x: %+05d y: %+05d "
+- "nmin: %d nmax: %d n: %d\n",
+- abs_p, abs_w, abs_x, abs_y, nmin, nmax, dev->fingers);
++ "nmin: %d nmax: %d n: %d ibt: %d\n", abs_p, abs_w,
++ abs_x, abs_y, nmin, nmax, dev->fingers, ibt);
+
+ }
+
++ /* type 2 reports button events via ibt only */
++ if (c->tp_type == TYPE2)
++ input_report_key(input, BTN_LEFT, ibt);
++
+ input_sync(input);
+
+ return 0;
+@@ -649,6 +701,8 @@ static int bcm5974_probe(struct usb_inte
+ input_dev->name = "bcm5974";
+ input_dev->phys = dev->phys;
+ usb_to_input_id(dev->udev, &input_dev->id);
++ /* report driver capabilities via the version field */
++ input_dev->id.version = cfg->caps;
+ input_dev->dev.parent = &iface->dev;
+
+ input_set_drvdata(input_dev, dev);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/elantech.c linux-2.6.30-rc4-git/drivers/input/mouse/elantech.c
+--- linux-2.6.30-rc4/drivers/input/mouse/elantech.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/elantech.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1,7 +1,7 @@
+ /*
+- * Elantech Touchpad driver (v5)
++ * Elantech Touchpad driver (v6)
+ *
+- * Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net>
++ * Copyright (C) 2007-2009 Arjan Opmeer <arjan@opmeer.net>
+ *
+ * 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
+@@ -178,6 +178,7 @@ static void elantech_report_absolute_v1(
+ struct elantech_data *etd = psmouse->private;
+ unsigned char *packet = psmouse->packet;
+ int fingers;
++ static int old_fingers;
+
+ if (etd->fw_version_maj == 0x01) {
+ /* byte 0: D U p1 p2 1 p3 R L
+@@ -190,6 +191,14 @@ static void elantech_report_absolute_v1(
+ fingers = (packet[0] & 0xc0) >> 6;
+ }
+
++ if (etd->jumpy_cursor) {
++ /* Discard packets that are likely to have bogus coordinates */
++ if (fingers > old_fingers) {
++ elantech_debug("elantech.c: discarding packet\n");
++ goto discard_packet_v1;
++ }
++ }
++
+ input_report_key(dev, BTN_TOUCH, fingers != 0);
+
+ /* byte 2: x7 x6 x5 x4 x3 x2 x1 x0
+@@ -216,6 +225,9 @@ static void elantech_report_absolute_v1(
+ }
+
+ input_sync(dev);
++
++ discard_packet_v1:
++ old_fingers = fingers;
+ }
+
+ /*
+@@ -363,9 +375,14 @@ static int elantech_set_absolute_mode(st
+ rc = -1;
+ break;
+ }
++ }
++
++ if (rc == 0) {
+ /*
+- * Read back reg 0x10. The touchpad is probably initalising
+- * and not ready until we read back the value we just wrote.
++ * Read back reg 0x10. For hardware version 1 we must make
++ * sure the absolute mode bit is set. For hardware version 2
++ * the touchpad is probably initalising and not ready until
++ * we read back the value we just wrote.
+ */
+ do {
+ rc = elantech_read_reg(psmouse, 0x10, &val);
+@@ -373,12 +390,18 @@ static int elantech_set_absolute_mode(st
+ break;
+ tries--;
+ elantech_debug("elantech.c: retrying read (%d).\n",
+- tries);
++ tries);
+ msleep(ETP_READ_BACK_DELAY);
+ } while (tries > 0);
+- if (rc)
++
++ if (rc) {
+ pr_err("elantech.c: failed to read back register 0x10.\n");
+- break;
++ } else if (etd->hw_version == 1 &&
++ !(val & ETP_R10_ABSOLUTE_MODE)) {
++ pr_err("elantech.c: touchpad refuses "
++ "to switch to absolute mode.\n");
++ rc = -1;
++ }
+ }
+
+ if (rc)
+@@ -662,6 +685,17 @@ int elantech_init(struct psmouse *psmous
+ param[0], param[1], param[2]);
+ etd->capabilities = param[0];
+
++ /*
++ * This firmware seems to suffer from misreporting coordinates when
++ * a touch action starts causing the mouse cursor or scrolled page
++ * to jump. Enable a workaround.
++ */
++ if (etd->fw_version_maj == 0x02 && etd->fw_version_min == 0x22) {
++ pr_info("elantech.c: firmware version 2.34 detected, "
++ "enabling jumpy cursor workaround\n");
++ etd->jumpy_cursor = 1;
++ }
++
+ if (elantech_set_absolute_mode(psmouse)) {
+ pr_err("elantech.c: failed to put touchpad into absolute mode.\n");
+ goto init_fail;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/elantech.h linux-2.6.30-rc4-git/drivers/input/mouse/elantech.h
+--- linux-2.6.30-rc4/drivers/input/mouse/elantech.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/elantech.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,7 +1,7 @@
+ /*
+- * Elantech Touchpad driver (v5)
++ * Elantech Touchpad driver (v6)
+ *
+- * Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net>
++ * Copyright (C) 2007-2009 Arjan Opmeer <arjan@opmeer.net>
+ *
+ * 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
+@@ -104,6 +104,7 @@ struct elantech_data {
+ unsigned char fw_version_min;
+ unsigned char hw_version;
+ unsigned char paritycheck;
++ unsigned char jumpy_cursor;
+ unsigned char parity[256];
+ };
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/mouse/lifebook.c linux-2.6.30-rc4-git/drivers/input/mouse/lifebook.c
+--- linux-2.6.30-rc4/drivers/input/mouse/lifebook.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/mouse/lifebook.c 2009-05-13 09:46:19.000000000 +0200
+@@ -61,6 +61,12 @@ static const struct dmi_system_id lifebo
+ },
+ },
+ {
++ .ident = "Lifebook B-2130",
++ .matches = {
++ DMI_MATCH(DMI_BOARD_NAME, "ZEPHYR"),
++ },
++ },
++ {
+ .ident = "Lifebook B213x/B2150",
+ .matches = {
+ DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"),
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/serio/sa1111ps2.c linux-2.6.30-rc4-git/drivers/input/serio/sa1111ps2.c
+--- linux-2.6.30-rc4/drivers/input/serio/sa1111ps2.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/serio/sa1111ps2.c 2009-05-13 09:46:19.000000000 +0200
+@@ -77,7 +77,7 @@ static irqreturn_t ps2_txint(int irq, vo
+ spin_lock(&ps2if->lock);
+ status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
+ if (ps2if->head == ps2if->tail) {
+- disable_irq(irq);
++ disable_irq_nosync(irq);
+ /* done */
+ } else if (status & PS2STAT_TXE) {
+ sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + SA1111_PS2DATA);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/tablet/wacom.h linux-2.6.30-rc4-git/drivers/input/tablet/wacom.h
+--- linux-2.6.30-rc4/drivers/input/tablet/wacom.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/tablet/wacom.h 2009-05-13 09:46:19.000000000 +0200
+@@ -11,7 +11,7 @@
+ * Copyright (c) 2000 Daniel Egger <egger@suse.de>
+ * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
+ * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
+- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
++ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
+ *
+ * ChangeLog:
+ * v0.1 (vp) - Initial release
+@@ -67,6 +67,7 @@
+ * v1.47 (pc) - Added support for Bamboo
+ * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX
+ * v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A)
++ * v1.50 (pc) - Fixed a TabletPC touch bug in 2.6.28
+ */
+
+ /*
+@@ -87,7 +88,7 @@
+ /*
+ * Version Information
+ */
+-#define DRIVER_VERSION "v1.49"
++#define DRIVER_VERSION "v1.50"
+ #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
+ #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
+ #define DRIVER_LICENSE "GPL"
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/tablet/wacom_sys.c linux-2.6.30-rc4-git/drivers/input/tablet/wacom_sys.c
+--- linux-2.6.30-rc4/drivers/input/tablet/wacom_sys.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/tablet/wacom_sys.c 2009-05-13 09:46:19.000000000 +0200
+@@ -289,6 +289,7 @@ static int wacom_parse_hid(struct usb_in
+ 5000); /* 5 secs */
+ } while (result < 0 && limit++ < 5);
+
++ /* No need to parse the Descriptor. It isn't an error though */
+ if (result < 0)
+ goto out;
+
+@@ -368,9 +369,8 @@ static int wacom_parse_hid(struct usb_in
+ }
+ }
+
+- result = 0;
+-
+ out:
++ result = 0;
+ kfree(report);
+ return result;
+ }
+@@ -425,6 +425,15 @@ static int wacom_probe(struct usb_interf
+
+ endpoint = &intf->cur_altsetting->endpoint[0].desc;
+
++ /* Initialize touch_x_max and touch_y_max in case it is not defined */
++ if (wacom_wac->features->type == TABLETPC) {
++ features->touch_x_max = 1023;
++ features->touch_y_max = 1023;
++ } else {
++ features->touch_x_max = 0;
++ features->touch_y_max = 0;
++ }
++
+ /* TabletPC need to retrieve the physical and logical maximum from report descriptor */
+ if (wacom_wac->features->type == TABLETPC) {
+ if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/touchscreen/tsc2007.c linux-2.6.30-rc4-git/drivers/input/touchscreen/tsc2007.c
+--- linux-2.6.30-rc4/drivers/input/touchscreen/tsc2007.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/touchscreen/tsc2007.c 2009-05-13 09:46:19.000000000 +0200
+@@ -235,7 +235,7 @@ static irqreturn_t tsc2007_irq(int irq,
+ spin_lock_irqsave(&ts->lock, flags);
+
+ if (likely(ts->get_pendown_state())) {
+- disable_irq(ts->irq);
++ disable_irq_nosync(ts->irq);
+ hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),
+ HRTIMER_MODE_REL);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/input/touchscreen/ucb1400_ts.c linux-2.6.30-rc4-git/drivers/input/touchscreen/ucb1400_ts.c
+--- linux-2.6.30-rc4/drivers/input/touchscreen/ucb1400_ts.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/input/touchscreen/ucb1400_ts.c 2009-05-13 09:46:19.000000000 +0200
+@@ -256,7 +256,7 @@ static irqreturn_t ucb1400_hard_irq(int
+ struct ucb1400_ts *ucb = devid;
+
+ if (irqnr == ucb->irq) {
+- disable_irq(ucb->irq);
++ disable_irq_nosync(ucb->irq);
+ ucb->irq_pending = 1;
+ wake_up(&ucb->ts_wait);
+ return IRQ_HANDLED;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/media/video/Kconfig linux-2.6.30-rc4-git/drivers/media/video/Kconfig
+--- linux-2.6.30-rc4/drivers/media/video/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/media/video/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -758,10 +758,14 @@ config VIDEO_MX1
+ ---help---
+ This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface
+
++config MX3_VIDEO
++ bool
++
+ config VIDEO_MX3
+ tristate "i.MX3x Camera Sensor Interface driver"
+ depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA
+ select VIDEOBUF_DMA_CONTIG
++ select MX3_VIDEO
+ ---help---
+ This is a v4l2 driver for the i.MX3x Camera Sensor Interface
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/mmc/host/Kconfig linux-2.6.30-rc4-git/drivers/mmc/host/Kconfig
+--- linux-2.6.30-rc4/drivers/mmc/host/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/mmc/host/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -155,7 +155,7 @@ config MMC_ATMELMCI_DMA
+
+ config MMC_IMX
+ tristate "Motorola i.MX Multimedia Card Interface support"
+- depends on ARCH_IMX
++ depends on ARCH_MX1
+ help
+ This selects the Motorola i.MX Multimedia card Interface.
+ If you have a i.MX platform with a Multimedia Card slot,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/mmc/host/omap.c linux-2.6.30-rc4-git/drivers/mmc/host/omap.c
+--- linux-2.6.30-rc4/drivers/mmc/host/omap.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/mmc/host/omap.c 2009-05-13 09:46:19.000000000 +0200
+@@ -157,8 +157,6 @@ struct mmc_omap_host {
+ struct timer_list dma_timer;
+ unsigned dma_len;
+
+- short power_pin;
+-
+ struct mmc_omap_slot *slots[OMAP_MMC_MAX_SLOTS];
+ struct mmc_omap_slot *current_slot;
+ spinlock_t slot_lock;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_aux.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_aux.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_aux.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_aux.c 2009-05-13 09:46:19.000000000 +0200
+@@ -97,9 +97,7 @@ static void __init zfcp_init_device_conf
+ ccw_device_set_online(adapter->ccw_device);
+
+ zfcp_erp_wait(adapter);
+- wait_event(adapter->erp_done_wqh,
+- !(atomic_read(&unit->status) &
+- ZFCP_STATUS_UNIT_SCSI_WORK_PENDING));
++ flush_work(&unit->scsi_work);
+
+ down(&zfcp_data.config_sema);
+ zfcp_unit_put(unit);
+@@ -279,6 +277,7 @@ struct zfcp_unit *zfcp_unit_enqueue(stru
+
+ atomic_set(&unit->refcount, 0);
+ init_waitqueue_head(&unit->remove_wq);
++ INIT_WORK(&unit->scsi_work, zfcp_scsi_scan);
+
+ unit->port = port;
+ unit->fcp_lun = fcp_lun;
+@@ -525,6 +524,8 @@ int zfcp_adapter_enqueue(struct ccw_devi
+
+ atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
+
++ zfcp_fc_nameserver_init(adapter);
++
+ if (!zfcp_adapter_scsi_register(adapter))
+ return 0;
+
+@@ -553,7 +554,6 @@ void zfcp_adapter_dequeue(struct zfcp_ad
+
+ cancel_work_sync(&adapter->scan_work);
+ cancel_work_sync(&adapter->stat_work);
+- cancel_delayed_work_sync(&adapter->nsp.work);
+ zfcp_adapter_scsi_unregister(adapter);
+ sysfs_remove_group(&adapter->ccw_device->dev.kobj,
+ &zfcp_sysfs_adapter_attrs);
+@@ -671,8 +671,7 @@ void zfcp_port_dequeue(struct zfcp_port
+ list_del(&port->list);
+ write_unlock_irq(&zfcp_data.config_lock);
+ if (port->rport)
+- fc_remote_port_delete(port->rport);
+- port->rport = NULL;
++ port->rport->dd_data = NULL;
+ zfcp_adapter_put(port->adapter);
+ sysfs_remove_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs);
+ device_unregister(&port->sysfs_device);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_ccw.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_ccw.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_ccw.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_ccw.c 2009-05-13 09:46:19.000000000 +0200
+@@ -108,7 +108,6 @@ static int zfcp_ccw_set_online(struct cc
+ /* initialize request counter */
+ BUG_ON(!zfcp_reqlist_isempty(adapter));
+ adapter->req_no = 0;
+- zfcp_fc_nameserver_init(adapter);
+
+ zfcp_erp_modify_adapter_status(adapter, "ccsonl1", NULL,
+ ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_cfdc.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_cfdc.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_cfdc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_cfdc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -4,7 +4,7 @@
+ * Userspace interface for accessing the
+ * Access Control Lists / Control File Data Channel
+ *
+- * Copyright IBM Corporation 2008
++ * Copyright IBM Corporation 2008, 2009
+ */
+
+ #define KMSG_COMPONENT "zfcp"
+@@ -197,6 +197,7 @@ static long zfcp_cfdc_dev_ioctl(struct f
+ retval = -ENXIO;
+ goto free_buffer;
+ }
++ zfcp_adapter_get(adapter);
+
+ retval = zfcp_cfdc_sg_setup(data->command, fsf_cfdc->sg,
+ data_user->control_file);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_def.h linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_def.h
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_def.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_def.h 2009-05-13 09:46:19.000000000 +0200
+@@ -255,7 +255,6 @@ enum zfcp_wka_status {
+ /* logical unit status */
+ #define ZFCP_STATUS_UNIT_SHARED 0x00000004
+ #define ZFCP_STATUS_UNIT_READONLY 0x00000008
+-#define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020
+
+ /* FSF request status (this does not have a common part) */
+ #define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002
+@@ -530,6 +529,7 @@ struct zfcp_unit {
+ struct zfcp_erp_action erp_action; /* pending error recovery */
+ atomic_t erp_counter;
+ struct zfcp_latencies latencies;
++ struct work_struct scsi_work;
+ };
+
+ /* FSF request */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_erp.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_erp.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_erp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_erp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -719,6 +719,7 @@ static void zfcp_erp_adapter_strategy_cl
+ zfcp_qdio_close(adapter);
+ zfcp_fsf_req_dismiss_all(adapter);
+ adapter->fsf_req_seq_no = 0;
++ zfcp_fc_wka_port_force_offline(&adapter->nsp);
+ /* all ports and units are closed */
+ zfcp_erp_modify_adapter_status(adapter, "erascl1", NULL,
+ ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR);
+@@ -1176,48 +1177,6 @@ static void zfcp_erp_action_dequeue(stru
+ }
+ }
+
+-struct zfcp_erp_add_work {
+- struct zfcp_unit *unit;
+- struct work_struct work;
+-};
+-
+-static void zfcp_erp_scsi_scan(struct work_struct *work)
+-{
+- struct zfcp_erp_add_work *p =
+- container_of(work, struct zfcp_erp_add_work, work);
+- struct zfcp_unit *unit = p->unit;
+- struct fc_rport *rport = unit->port->rport;
+-
+- if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
+- scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
+- scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
+- atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
+- zfcp_unit_put(unit);
+- wake_up(&unit->port->adapter->erp_done_wqh);
+- kfree(p);
+-}
+-
+-static void zfcp_erp_schedule_work(struct zfcp_unit *unit)
+-{
+- struct zfcp_erp_add_work *p;
+-
+- p = kzalloc(sizeof(*p), GFP_KERNEL);
+- if (!p) {
+- dev_err(&unit->port->adapter->ccw_device->dev,
+- "Registering unit 0x%016Lx on port 0x%016Lx failed\n",
+- (unsigned long long)unit->fcp_lun,
+- (unsigned long long)unit->port->wwpn);
+- return;
+- }
+-
+- zfcp_unit_get(unit);
+- atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
+- INIT_WORK(&p->work, zfcp_erp_scsi_scan);
+- p->unit = unit;
+- if (!queue_work(zfcp_data.work_queue, &p->work))
+- zfcp_unit_put(unit);
+-}
+-
+ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
+ {
+ struct zfcp_adapter *adapter = act->adapter;
+@@ -1226,11 +1185,11 @@ static void zfcp_erp_action_cleanup(stru
+
+ switch (act->action) {
+ case ZFCP_ERP_ACTION_REOPEN_UNIT:
+- flush_work(&port->rport_work);
+ if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) {
+- if (!(atomic_read(&unit->status) &
+- ZFCP_STATUS_UNIT_SCSI_WORK_PENDING))
+- zfcp_erp_schedule_work(unit);
++ zfcp_unit_get(unit);
++ if (scsi_queue_work(unit->port->adapter->scsi_host,
++ &unit->scsi_work) <= 0)
++ zfcp_unit_put(unit);
+ }
+ zfcp_unit_put(unit);
+ break;
+@@ -1352,6 +1311,11 @@ static int zfcp_erp_thread(void *data)
+
+ while (!(atomic_read(&adapter->status) &
+ ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL)) {
++
++ zfcp_rec_dbf_event_thread_lock("erthrd1", adapter);
++ ignore = down_interruptible(&adapter->erp_ready_sem);
++ zfcp_rec_dbf_event_thread_lock("erthrd2", adapter);
++
+ write_lock_irqsave(&adapter->erp_lock, flags);
+ next = adapter->erp_ready_head.next;
+ write_unlock_irqrestore(&adapter->erp_lock, flags);
+@@ -1363,10 +1327,6 @@ static int zfcp_erp_thread(void *data)
+ if (zfcp_erp_strategy(act) != ZFCP_ERP_DISMISSED)
+ zfcp_erp_wakeup(adapter);
+ }
+-
+- zfcp_rec_dbf_event_thread_lock("erthrd1", adapter);
+- ignore = down_interruptible(&adapter->erp_ready_sem);
+- zfcp_rec_dbf_event_thread_lock("erthrd2", adapter);
+ }
+
+ atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_ext.h linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_ext.h
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_ext.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_ext.h 2009-05-13 09:46:19.000000000 +0200
+@@ -106,6 +106,7 @@ extern void zfcp_fc_plogi_evaluate(struc
+ extern void zfcp_test_link(struct zfcp_port *);
+ extern void zfcp_fc_link_test_work(struct work_struct *);
+ extern void zfcp_fc_nameserver_init(struct zfcp_adapter *);
++extern void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *);
+
+ /* zfcp_fsf.c */
+ extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
+@@ -158,6 +159,7 @@ extern void zfcp_scsi_rport_work(struct
+ extern void zfcp_scsi_schedule_rport_register(struct zfcp_port *);
+ extern void zfcp_scsi_schedule_rport_block(struct zfcp_port *);
+ extern void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *);
++extern void zfcp_scsi_scan(struct work_struct *);
+
+ /* zfcp_sysfs.c */
+ extern struct attribute_group zfcp_sysfs_unit_attrs;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_fc.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_fc.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_fc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_fc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -98,13 +98,6 @@ static void zfcp_wka_port_offline(struct
+ struct zfcp_wka_port *wka_port =
+ container_of(dw, struct zfcp_wka_port, work);
+
+- /* Don't wait forvever. If the wka_port is too busy take it offline
+- through a new call later */
+- if (!wait_event_timeout(wka_port->completion_wq,
+- atomic_read(&wka_port->refcount) == 0,
+- HZ >> 1))
+- return;
+-
+ mutex_lock(&wka_port->mutex);
+ if ((atomic_read(&wka_port->refcount) != 0) ||
+ (wka_port->status != ZFCP_WKA_PORT_ONLINE))
+@@ -142,6 +135,14 @@ void zfcp_fc_nameserver_init(struct zfcp
+ INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline);
+ }
+
++void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka)
++{
++ cancel_delayed_work_sync(&wka->work);
++ mutex_lock(&wka->mutex);
++ wka->status = ZFCP_WKA_PORT_OFFLINE;
++ mutex_unlock(&wka->mutex);
++}
++
+ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
+ struct fcp_rscn_element *elem)
+ {
+@@ -372,7 +373,8 @@ static void zfcp_fc_adisc_handler(unsign
+
+ if (adisc->els.status) {
+ /* request rejected or timed out */
+- zfcp_erp_port_forced_reopen(port, 0, "fcadh_1", NULL);
++ zfcp_erp_port_forced_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED,
++ "fcadh_1", NULL);
+ goto out;
+ }
+
+@@ -431,11 +433,6 @@ void zfcp_fc_link_test_work(struct work_
+ container_of(work, struct zfcp_port, test_link_work);
+ int retval;
+
+- if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_UNBLOCKED)) {
+- zfcp_port_put(port);
+- return; /* port erp is running and will update rport status */
+- }
+-
+ zfcp_port_get(port);
+ port->rport_task = RPORT_DEL;
+ zfcp_scsi_rport_work(&port->rport_work);
+@@ -542,6 +539,9 @@ static void zfcp_validate_port(struct zf
+ {
+ struct zfcp_adapter *adapter = port->adapter;
+
++ if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_NOESC))
++ return;
++
+ atomic_clear_mask(ZFCP_STATUS_COMMON_NOESC, &port->status);
+
+ if ((port->supported_classes != 0) ||
+@@ -602,10 +602,8 @@ static int zfcp_scan_eval_gpn_ft(struct
+ if (acc->wwpn == fc_host_port_name(adapter->scsi_host))
+ continue;
+ port = zfcp_get_port_by_wwpn(adapter, acc->wwpn);
+- if (port) {
+- zfcp_port_get(port);
++ if (port)
+ continue;
+- }
+
+ port = zfcp_port_enqueue(adapter, acc->wwpn,
+ ZFCP_STATUS_COMMON_NOESC, d_id);
+@@ -637,7 +635,8 @@ int zfcp_scan_ports(struct zfcp_adapter
+ max_entries = chain ? ZFCP_GPN_FT_MAX_ENTRIES : ZFCP_GPN_FT_ENTRIES;
+ max_bytes = chain ? ZFCP_GPN_FT_MAX_SIZE : ZFCP_CT_SIZE_ONE_PAGE;
+
+- if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
++ if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT &&
++ fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV)
+ return 0;
+
+ ret = zfcp_wka_port_get(&adapter->nsp);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_fsf.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_fsf.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_fsf.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_fsf.c 2009-05-13 09:46:19.000000000 +0200
+@@ -172,12 +172,16 @@ static void zfcp_fsf_link_down_info_eval
+ struct fsf_link_down_info *link_down)
+ {
+ struct zfcp_adapter *adapter = req->adapter;
++ unsigned long flags;
+
+ if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED)
+ return;
+
+ atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status);
++
++ read_lock_irqsave(&zfcp_data.config_lock, flags);
+ zfcp_scsi_schedule_rports_block(adapter);
++ read_unlock_irqrestore(&zfcp_data.config_lock, flags);
+
+ if (!link_down)
+ goto out;
+@@ -645,30 +649,30 @@ static void zfcp_fsf_exchange_port_data_
+ }
+ }
+
+-static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
+- __releases(&adapter->req_q_lock)
+- __acquires(&adapter->req_q_lock)
++static int zfcp_fsf_sbal_check(struct zfcp_adapter *adapter)
+ {
+ struct zfcp_qdio_queue *req_q = &adapter->req_q;
+- long ret;
+
+- if (atomic_read(&req_q->count) <= -REQUEST_LIST_SIZE)
+- return -EIO;
+- if (atomic_read(&req_q->count) > 0)
+- return 0;
++ spin_lock_bh(&adapter->req_q_lock);
++ if (atomic_read(&req_q->count))
++ return 1;
++ spin_unlock_bh(&adapter->req_q_lock);
++ return 0;
++}
++
++static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
++{
++ long ret;
+
+- atomic_dec(&req_q->count);
+ spin_unlock_bh(&adapter->req_q_lock);
+ ret = wait_event_interruptible_timeout(adapter->request_wq,
+- atomic_read(&req_q->count) >= 0,
+- 5 * HZ);
+- spin_lock_bh(&adapter->req_q_lock);
+- atomic_inc(&req_q->count);
+-
++ zfcp_fsf_sbal_check(adapter), 5 * HZ);
+ if (ret > 0)
+ return 0;
+ if (!ret)
+ atomic_inc(&adapter->qdio_outb_full);
++
++ spin_lock_bh(&adapter->req_q_lock);
+ return -EIO;
+ }
+
+@@ -766,8 +770,9 @@ static struct zfcp_fsf_req *zfcp_fsf_req
+ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
+ {
+ struct zfcp_adapter *adapter = req->adapter;
+- unsigned long flags;
+- int idx;
++ unsigned long flags;
++ int idx;
++ int with_qtcb = (req->qtcb != NULL);
+
+ /* put allocated FSF request into hash table */
+ spin_lock_irqsave(&adapter->req_list_lock, flags);
+@@ -789,7 +794,7 @@ static int zfcp_fsf_req_send(struct zfcp
+ }
+
+ /* Don't increase for unsolicited status */
+- if (req->qtcb)
++ if (with_qtcb)
+ adapter->fsf_req_seq_no++;
+ adapter->req_no++;
+
+@@ -1253,13 +1258,13 @@ int zfcp_fsf_exchange_config_data_sync(s
+
+ spin_lock_bh(&adapter->req_q_lock);
+ if (zfcp_fsf_req_sbal_get(adapter))
+- goto out;
++ goto out_unlock;
+
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA,
+ 0, NULL);
+ if (IS_ERR(req)) {
+ retval = PTR_ERR(req);
+- goto out;
++ goto out_unlock;
+ }
+
+ sbale = zfcp_qdio_sbale_req(req);
+@@ -1278,14 +1283,16 @@ int zfcp_fsf_exchange_config_data_sync(s
+
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
+ retval = zfcp_fsf_req_send(req);
+-out:
+ spin_unlock_bh(&adapter->req_q_lock);
+ if (!retval)
+ wait_event(req->completion_wq,
+ req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
+
+ zfcp_fsf_req_free(req);
++ return retval;
+
++out_unlock:
++ spin_unlock_bh(&adapter->req_q_lock);
+ return retval;
+ }
+
+@@ -1352,13 +1359,13 @@ int zfcp_fsf_exchange_port_data_sync(str
+
+ spin_lock_bh(&adapter->req_q_lock);
+ if (zfcp_fsf_req_sbal_get(adapter))
+- goto out;
++ goto out_unlock;
+
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0,
+ NULL);
+ if (IS_ERR(req)) {
+ retval = PTR_ERR(req);
+- goto out;
++ goto out_unlock;
+ }
+
+ if (data)
+@@ -1371,14 +1378,18 @@ int zfcp_fsf_exchange_port_data_sync(str
+ req->handler = zfcp_fsf_exchange_port_data_handler;
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
+ retval = zfcp_fsf_req_send(req);
+-out:
+ spin_unlock_bh(&adapter->req_q_lock);
++
+ if (!retval)
+ wait_event(req->completion_wq,
+ req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
+ zfcp_fsf_req_free(req);
+
+ return retval;
++
++out_unlock:
++ spin_unlock_bh(&adapter->req_q_lock);
++ return retval;
+ }
+
+ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
+@@ -2472,8 +2483,6 @@ out:
+
+ static void zfcp_fsf_control_file_handler(struct zfcp_fsf_req *req)
+ {
+- if (req->qtcb->header.fsf_status != FSF_GOOD)
+- req->status |= ZFCP_STATUS_FSFREQ_ERROR;
+ }
+
+ /**
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_scsi.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_scsi.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_scsi.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_scsi.c 2009-05-13 09:46:19.000000000 +0200
+@@ -171,7 +171,7 @@ static int zfcp_scsi_eh_abort_handler(st
+ write_unlock_irqrestore(&adapter->abort_lock, flags);
+ zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL,
+ old_req_id);
+- return SUCCESS;
++ return FAILED; /* completion could be in progress */
+ }
+ old_req->data = NULL;
+
+@@ -486,10 +486,12 @@ static void zfcp_set_rport_dev_loss_tmo(
+ */
+ static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport)
+ {
+- struct zfcp_port *port = rport->dd_data;
++ struct zfcp_port *port;
+
+ write_lock_irq(&zfcp_data.config_lock);
+- port->rport = NULL;
++ port = rport->dd_data;
++ if (port)
++ port->rport = NULL;
+ write_unlock_irq(&zfcp_data.config_lock);
+ }
+
+@@ -503,9 +505,18 @@ static void zfcp_scsi_dev_loss_tmo_callb
+ */
+ static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport)
+ {
+- struct zfcp_port *port = rport->dd_data;
++ struct zfcp_port *port;
++
++ write_lock_irq(&zfcp_data.config_lock);
++ port = rport->dd_data;
++ if (port)
++ zfcp_port_get(port);
++ write_unlock_irq(&zfcp_data.config_lock);
+
+- zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL);
++ if (port) {
++ zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL);
++ zfcp_port_put(port);
++ }
+ }
+
+ static void zfcp_scsi_rport_register(struct zfcp_port *port)
+@@ -534,8 +545,10 @@ static void zfcp_scsi_rport_register(str
+
+ static void zfcp_scsi_rport_block(struct zfcp_port *port)
+ {
+- if (port->rport)
+- fc_remote_port_delete(port->rport);
++ struct fc_rport *rport = port->rport;
++
++ if (rport)
++ fc_remote_port_delete(rport);
+ }
+
+ void zfcp_scsi_schedule_rport_register(struct zfcp_port *port)
+@@ -583,6 +596,23 @@ void zfcp_scsi_rport_work(struct work_st
+ }
+
+
++void zfcp_scsi_scan(struct work_struct *work)
++{
++ struct zfcp_unit *unit = container_of(work, struct zfcp_unit,
++ scsi_work);
++ struct fc_rport *rport;
++
++ flush_work(&unit->port->rport_work);
++ rport = unit->port->rport;
++
++ if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
++ scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
++ scsilun_to_int((struct scsi_lun *)
++ &unit->fcp_lun), 0);
++
++ zfcp_unit_put(unit);
++}
++
+ struct fc_function_template zfcp_transport_functions = {
+ .show_starget_port_id = 1,
+ .show_starget_port_name = 1,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/s390/scsi/zfcp_sysfs.c linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_sysfs.c
+--- linux-2.6.30-rc4/drivers/s390/scsi/zfcp_sysfs.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/s390/scsi/zfcp_sysfs.c 2009-05-13 09:46:19.000000000 +0200
+@@ -254,12 +254,21 @@ static ssize_t zfcp_sysfs_unit_remove_st
+
+ write_lock_irq(&zfcp_data.config_lock);
+ unit = zfcp_get_unit_by_lun(port, fcp_lun);
+- if (unit && (atomic_read(&unit->refcount) == 0)) {
+- zfcp_unit_get(unit);
+- atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status);
+- list_move(&unit->list, &unit_remove_lh);
+- } else
+- unit = NULL;
++ if (unit) {
++ write_unlock_irq(&zfcp_data.config_lock);
++ /* wait for possible timeout during SCSI probe */
++ flush_work(&unit->scsi_work);
++ write_lock_irq(&zfcp_data.config_lock);
++
++ if (atomic_read(&unit->refcount) == 0) {
++ zfcp_unit_get(unit);
++ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE,
++ &unit->status);
++ list_move(&unit->list, &unit_remove_lh);
++ } else {
++ unit = NULL;
++ }
++ }
+
+ write_unlock_irq(&zfcp_data.config_lock);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_ddp.c linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_ddp.c
+--- linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_ddp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_ddp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -120,20 +120,26 @@ static void clear_ddp_map(struct cxgb3i_
+ }
+
+ static inline int ddp_find_unused_entries(struct cxgb3i_ddp_info *ddp,
+- int start, int max, int count,
++ unsigned int start, unsigned int max,
++ unsigned int count,
+ struct cxgb3i_gather_list *gl)
+ {
+- unsigned int i, j;
++ unsigned int i, j, k;
+
++ /* not enough entries */
++ if ((max - start) < count)
++ return -EBUSY;
++
++ max -= count;
+ spin_lock(&ddp->map_lock);
+- for (i = start; i <= max;) {
+- for (j = 0; j < count; j++) {
+- if (ddp->gl_map[i + j])
++ for (i = start; i < max;) {
++ for (j = 0, k = i; j < count; j++, k++) {
++ if (ddp->gl_map[k])
+ break;
+ }
+ if (j == count) {
+- for (j = 0; j < count; j++)
+- ddp->gl_map[i + j] = gl;
++ for (j = 0, k = i; j < count; j++, k++)
++ ddp->gl_map[k] = gl;
+ spin_unlock(&ddp->map_lock);
+ return i;
+ }
+@@ -354,7 +360,7 @@ int cxgb3i_ddp_tag_reserve(struct t3cdev
+ struct cxgb3i_ddp_info *ddp = tdev->ulp_iscsi;
+ struct pagepod_hdr hdr;
+ unsigned int npods;
+- int idx = -1, idx_max;
++ int idx = -1;
+ int err = -ENOMEM;
+ u32 sw_tag = *tagp;
+ u32 tag;
+@@ -367,17 +373,17 @@ int cxgb3i_ddp_tag_reserve(struct t3cdev
+ }
+
+ npods = (gl->nelem + PPOD_PAGES_MAX - 1) >> PPOD_PAGES_SHIFT;
+- idx_max = ddp->nppods - npods + 1;
+
+ if (ddp->idx_last == ddp->nppods)
+- idx = ddp_find_unused_entries(ddp, 0, idx_max, npods, gl);
++ idx = ddp_find_unused_entries(ddp, 0, ddp->nppods, npods, gl);
+ else {
+ idx = ddp_find_unused_entries(ddp, ddp->idx_last + 1,
+- idx_max, npods, gl);
+- if (idx < 0 && ddp->idx_last >= npods)
++ ddp->nppods, npods, gl);
++ if (idx < 0 && ddp->idx_last >= npods) {
+ idx = ddp_find_unused_entries(ddp, 0,
+- ddp->idx_last - npods + 1,
++ min(ddp->idx_last + npods, ddp->nppods),
+ npods, gl);
++ }
+ }
+ if (idx < 0) {
+ ddp_log_debug("xferlen %u, gl %u, npods %u NO DDP.\n",
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i.h linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i.h
+--- linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i.h 2009-05-13 09:46:19.000000000 +0200
+@@ -34,7 +34,7 @@
+ #include "cxgb3i_offload.h"
+ #include "cxgb3i_ddp.h"
+
+-#define CXGB3I_SCSI_QDEPTH_DFLT 128
++#define CXGB3I_SCSI_HOST_QDEPTH 1024
+ #define CXGB3I_MAX_TARGET CXGB3I_MAX_CONN
+ #define CXGB3I_MAX_LUN 512
+ #define ISCSI_PDU_NONPAYLOAD_MAX \
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_iscsi.c linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+--- linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_iscsi.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_iscsi.c 2009-05-13 09:46:19.000000000 +0200
+@@ -876,13 +876,14 @@ static struct scsi_host_template cxgb3i_
+ .proc_name = "cxgb3i",
+ .queuecommand = iscsi_queuecommand,
+ .change_queue_depth = iscsi_change_queue_depth,
+- .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1,
++ .can_queue = CXGB3I_SCSI_HOST_QDEPTH,
+ .sg_tablesize = SG_ALL,
+ .max_sectors = 0xFFFF,
+- .cmd_per_lun = CXGB3I_SCSI_QDEPTH_DFLT,
++ .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
+ .eh_abort_handler = iscsi_eh_abort,
+ .eh_device_reset_handler = iscsi_eh_device_reset,
+ .eh_target_reset_handler = iscsi_eh_target_reset,
++ .target_alloc = iscsi_target_alloc,
+ .use_clustering = DISABLE_CLUSTERING,
+ .this_id = -1,
+ };
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_offload.c linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_offload.c
+--- linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_offload.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_offload.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1737,7 +1737,7 @@ int cxgb3i_c3cn_send_pdus(struct s3_conn
+ c3cn_tx_debug("c3cn 0x%p, snd %u - %u > %u.\n",
+ c3cn, c3cn->write_seq, c3cn->snd_una,
+ cxgb3_snd_win);
+- err = -EAGAIN;
++ err = -ENOBUFS;
+ goto out_err;
+ }
+
+@@ -1775,6 +1775,8 @@ done:
+ out_err:
+ if (copied == 0 && err == -EPIPE)
+ copied = c3cn->err ? c3cn->err : -EPIPE;
++ else
++ copied = err;
+ goto done;
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_pdu.c linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_pdu.c
+--- linux-2.6.30-rc4/drivers/scsi/cxgb3i/cxgb3i_pdu.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/cxgb3i/cxgb3i_pdu.c 2009-05-13 09:46:19.000000000 +0200
+@@ -400,17 +400,18 @@ int cxgb3i_conn_xmit_pdu(struct iscsi_ta
+ return 0;
+ }
+
+- if (err < 0 && err != -EAGAIN) {
+- kfree_skb(skb);
+- cxgb3i_tx_debug("itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
+- task->itt, skb, skb->len, skb->data_len, err);
+- iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);
+- iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);
++ if (err == -EAGAIN || err == -ENOBUFS) {
++ /* reset skb to send when we are called again */
++ tdata->skb = skb;
+ return err;
+ }
+- /* reset skb to send when we are called again */
+- tdata->skb = skb;
+- return -EAGAIN;
++
++ kfree_skb(skb);
++ cxgb3i_tx_debug("itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
++ task->itt, skb, skb->len, skb->data_len, err);
++ iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);
++ iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);
++ return err;
+ }
+
+ int cxgb3i_pdu_init(void)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/fcoe/fcoe.c linux-2.6.30-rc4-git/drivers/scsi/fcoe/fcoe.c
+--- linux-2.6.30-rc4/drivers/scsi/fcoe/fcoe.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/fcoe/fcoe.c 2009-05-13 09:46:19.000000000 +0200
+@@ -57,7 +57,7 @@ DEFINE_RWLOCK(fcoe_hostlist_lock);
+ DEFINE_TIMER(fcoe_timer, NULL, 0, 0);
+ DEFINE_PER_CPU(struct fcoe_percpu_s, fcoe_percpu);
+
+-/* Function Prototyes */
++/* Function Prototypes */
+ static int fcoe_reset(struct Scsi_Host *shost);
+ static int fcoe_xmit(struct fc_lport *, struct fc_frame *);
+ static int fcoe_rcv(struct sk_buff *, struct net_device *,
+@@ -138,7 +138,6 @@ static struct scsi_host_template fcoe_sh
+ /**
+ * fcoe_lport_config() - sets up the fc_lport
+ * @lp: ptr to the fc_lport
+- * @shost: ptr to the parent scsi host
+ *
+ * Returns: 0 for success
+ */
+@@ -256,6 +255,7 @@ static int fcoe_netdev_config(struct fc_
+ rtnl_lock();
+ memcpy(flogi_maddr, (u8[6]) FC_FCOE_FLOGI_MAC, ETH_ALEN);
+ dev_unicast_add(fc->real_dev, flogi_maddr, ETH_ALEN);
++ dev_mc_add(fc->real_dev, FIP_ALL_ENODE_MACS, ETH_ALEN, 0);
+ rtnl_unlock();
+
+ /*
+@@ -380,7 +380,7 @@ static int fcoe_if_destroy(struct net_de
+ dev_mc_delete(fc->real_dev, FIP_ALL_ENODE_MACS, ETH_ALEN, 0);
+ rtnl_unlock();
+
+- /* Free the per-CPU revieve threads */
++ /* Free the per-CPU receive threads */
+ fcoe_percpu_clean(lp);
+
+ /* Free existing skbs */
+@@ -720,7 +720,7 @@ static void fcoe_percpu_thread_destroy(u
+ }
+ #else
+ /*
+- * This a non-SMP scenario where the singluar Rx thread is
++ * This a non-SMP scenario where the singular Rx thread is
+ * being removed. Free all skbs and stop the thread.
+ */
+ spin_lock_bh(&p->fcoe_rx_list.lock);
+@@ -777,7 +777,7 @@ static struct notifier_block fcoe_cpu_no
+ * @skb: the receive skb
+ * @dev: associated net device
+ * @ptype: context
+- * @odldev: last device
++ * @olddev: last device
+ *
+ * this function will receive the packet and build fc frame and pass it up
+ *
+@@ -884,7 +884,6 @@ err2:
+ kfree_skb(skb);
+ return -1;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_rcv);
+
+ /**
+ * fcoe_start_io() - pass to netdev to start xmit for fcoe
+@@ -905,7 +904,7 @@ static inline int fcoe_start_io(struct s
+ }
+
+ /**
+- * fcoe_get_paged_crc_eof() - in case we need alloc a page for crc_eof
++ * fcoe_get_paged_crc_eof() - in case we need to alloc a page for crc_eof
+ * @skb: the skb to be xmitted
+ * @tlen: total len
+ *
+@@ -947,7 +946,7 @@ static int fcoe_get_paged_crc_eof(struct
+
+ /**
+ * fcoe_fc_crc() - calculates FC CRC in this fcoe skb
+- * @fp: the fc_frame containg data to be checksummed
++ * @fp: the fc_frame containing data to be checksummed
+ *
+ * This uses crc32() to calculate the crc for fc frame
+ * Return : 32 bit crc
+@@ -1011,7 +1010,7 @@ int fcoe_xmit(struct fc_lport *lp, struc
+ wlen = skb->len / FCOE_WORD_TO_BYTE;
+
+ if (!lp->link_up) {
+- kfree(skb);
++ kfree_skb(skb);
+ return 0;
+ }
+
+@@ -1062,7 +1061,7 @@ int fcoe_xmit(struct fc_lport *lp, struc
+ cp = NULL;
+ }
+
+- /* adjust skb netowrk/transport offsets to match mac/fcoe/fc */
++ /* adjust skb network/transport offsets to match mac/fcoe/fc */
+ skb_push(skb, elen + hlen);
+ skb_reset_mac_header(skb);
+ skb_reset_network_header(skb);
+@@ -1123,7 +1122,6 @@ int fcoe_xmit(struct fc_lport *lp, struc
+
+ return 0;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_xmit);
+
+ /**
+ * fcoe_percpu_receive_thread() - recv thread per cpu
+@@ -1296,17 +1294,16 @@ void fcoe_watchdog(ulong vp)
+
+
+ /**
+- * fcoe_check_wait_queue() - put the skb into fcoe pending xmit queue
+- * @lp: the fc_port for this skb
+- * @skb: the associated skb to be xmitted
++ * fcoe_check_wait_queue() - attempt to clear the transmit backlog
++ * @lp: the fc_lport
+ *
+ * This empties the wait_queue, dequeue the head of the wait_queue queue
+ * and calls fcoe_start_io() for each packet, if all skb have been
+ * transmitted, return qlen or -1 if a error occurs, then restore
+- * wait_queue and try again later.
++ * wait_queue and try again later.
+ *
+ * The wait_queue is used when the skb transmit fails. skb will go
+- * in the wait_queue which will be emptied by the time function OR
++ * in the wait_queue which will be emptied by the timer function or
+ * by the next skb transmit.
+ *
+ * Returns: 0 for success
+@@ -1355,10 +1352,6 @@ out:
+ */
+ static void fcoe_dev_setup()
+ {
+- /*
+- * here setup a interface specific wd time to
+- * monitor the link state
+- */
+ register_netdevice_notifier(&fcoe_notifier);
+ }
+
+@@ -1437,10 +1430,9 @@ out:
+
+ /**
+ * fcoe_if_to_netdev() - parse a name buffer to get netdev
+- * @ifname: fixed array for output parsed ifname
+ * @buffer: incoming buffer to be copied
+ *
+- * Returns: NULL or ptr to netdeive
++ * Returns: NULL or ptr to net_device
+ */
+ static struct net_device *fcoe_if_to_netdev(const char *buffer)
+ {
+@@ -1458,7 +1450,7 @@ static struct net_device *fcoe_if_to_net
+ }
+
+ /**
+- * fcoe_netdev_to_module_owner() - finds out the nic drive moddule of the netdev
++ * fcoe_netdev_to_module_owner() - finds out the driver module of the netdev
+ * @netdev: the target netdev
+ *
+ * Returns: ptr to the struct module, NULL for failure
+@@ -1488,7 +1480,7 @@ fcoe_netdev_to_module_owner(const struct
+ * Holds the Ethernet driver module by try_module_get() for
+ * the corresponding netdev.
+ *
+- * Returns: 0 for succsss
++ * Returns: 0 for success
+ */
+ static int fcoe_ethdrv_get(const struct net_device *netdev)
+ {
+@@ -1510,7 +1502,7 @@ static int fcoe_ethdrv_get(const struct
+ * Releases the Ethernet driver module by module_put for
+ * the corresponding netdev.
+ *
+- * Returns: 0 for succsss
++ * Returns: 0 for success
+ */
+ static int fcoe_ethdrv_put(const struct net_device *netdev)
+ {
+@@ -1528,7 +1520,7 @@ static int fcoe_ethdrv_put(const struct
+
+ /**
+ * fcoe_destroy() - handles the destroy from sysfs
+- * @buffer: expcted to be a eth if name
++ * @buffer: expected to be an eth if name
+ * @kp: associated kernel param
+ *
+ * Returns: 0 for success
+@@ -1565,7 +1557,7 @@ out_nodev:
+
+ /**
+ * fcoe_create() - Handles the create call from sysfs
+- * @buffer: expcted to be a eth if name
++ * @buffer: expected to be an eth if name
+ * @kp: associated kernel param
+ *
+ * Returns: 0 for success
+@@ -1652,7 +1644,6 @@ int fcoe_link_ok(struct fc_lport *lp)
+
+ return rc;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_link_ok);
+
+ /**
+ * fcoe_percpu_clean() - Clear the pending skbs for an lport
+@@ -1684,7 +1675,6 @@ void fcoe_percpu_clean(struct fc_lport *
+ spin_unlock_bh(&pp->fcoe_rx_list.lock);
+ }
+ }
+-EXPORT_SYMBOL_GPL(fcoe_percpu_clean);
+
+ /**
+ * fcoe_clean_pending_queue() - Dequeue a skb and free it
+@@ -1705,7 +1695,6 @@ void fcoe_clean_pending_queue(struct fc_
+ }
+ spin_unlock_bh(&fc->fcoe_pending_queue.lock);
+ }
+-EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);
+
+ /**
+ * fcoe_reset() - Resets the fcoe
+@@ -1719,11 +1708,10 @@ int fcoe_reset(struct Scsi_Host *shost)
+ fc_lport_reset(lport);
+ return 0;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_reset);
+
+ /**
+ * fcoe_hostlist_lookup_softc() - find the corresponding lport by a given device
+- * @device: this is currently ptr to net_device
++ * @dev: this is currently ptr to net_device
+ *
+ * Returns: NULL or the located fcoe_softc
+ */
+@@ -1757,11 +1745,10 @@ struct fc_lport *fcoe_hostlist_lookup(co
+
+ return (fc) ? fc->ctlr.lp : NULL;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_hostlist_lookup);
+
+ /**
+ * fcoe_hostlist_add() - Add a lport to lports list
+- * @lp: ptr to the fc_lport to badded
++ * @lp: ptr to the fc_lport to be added
+ *
+ * Returns: 0 for success
+ */
+@@ -1778,11 +1765,10 @@ int fcoe_hostlist_add(const struct fc_lp
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_hostlist_add);
+
+ /**
+ * fcoe_hostlist_remove() - remove a lport from lports list
+- * @lp: ptr to the fc_lport to badded
++ * @lp: ptr to the fc_lport to be removed
+ *
+ * Returns: 0 for success
+ */
+@@ -1798,7 +1784,6 @@ int fcoe_hostlist_remove(const struct fc
+
+ return 0;
+ }
+-EXPORT_SYMBOL_GPL(fcoe_hostlist_remove);
+
+ /**
+ * fcoe_init() - fcoe module loading initialization
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/fcoe/libfcoe.c linux-2.6.30-rc4-git/drivers/scsi/fcoe/libfcoe.c
+--- linux-2.6.30-rc4/drivers/scsi/fcoe/libfcoe.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/fcoe/libfcoe.c 2009-05-13 09:46:19.000000000 +0200
+@@ -122,7 +122,7 @@ static void fcoe_ctlr_reset_fcfs(struct
+ }
+
+ /**
+- * fcoe_ctrl_destroy() - Disable and tear-down the FCoE controller.
++ * fcoe_ctlr_destroy() - Disable and tear-down the FCoE controller.
+ * @fip: FCoE controller.
+ *
+ * This is called by FCoE drivers before freeing the &fcoe_ctlr.
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/ipr.c linux-2.6.30-rc4-git/drivers/scsi/ipr.c
+--- linux-2.6.30-rc4/drivers/scsi/ipr.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/ipr.c 2009-05-13 09:46:19.000000000 +0200
+@@ -3654,6 +3654,7 @@ static int ipr_slave_configure(struct sc
+ {
+ struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
+ struct ipr_resource_entry *res;
++ struct ata_port *ap = NULL;
+ unsigned long lock_flags = 0;
+
+ spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
+@@ -3672,12 +3673,16 @@ static int ipr_slave_configure(struct sc
+ }
+ if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res))
+ sdev->allow_restart = 1;
+- if (ipr_is_gata(res) && res->sata_port) {
++ if (ipr_is_gata(res) && res->sata_port)
++ ap = res->sata_port->ap;
++ spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
++
++ if (ap) {
+ scsi_adjust_queue_depth(sdev, 0, IPR_MAX_CMD_PER_ATA_LUN);
+- ata_sas_slave_configure(sdev, res->sata_port->ap);
+- } else {
++ ata_sas_slave_configure(sdev, ap);
++ } else
+ scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
+- }
++ return 0;
+ }
+ spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
+ return 0;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/iscsi_tcp.c linux-2.6.30-rc4-git/drivers/scsi/iscsi_tcp.c
+--- linux-2.6.30-rc4/drivers/scsi/iscsi_tcp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/iscsi_tcp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -463,7 +463,7 @@ static int iscsi_sw_tcp_pdu_init(struct
+ }
+
+ if (err) {
+- iscsi_conn_failure(conn, err);
++ /* got invalid offset/len */
+ return -EIO;
+ }
+ return 0;
+@@ -851,6 +851,7 @@ static struct scsi_host_template iscsi_s
+ .use_clustering = DISABLE_CLUSTERING,
+ .slave_alloc = iscsi_sw_tcp_slave_alloc,
+ .slave_configure = iscsi_sw_tcp_slave_configure,
++ .target_alloc = iscsi_target_alloc,
+ .proc_name = "iscsi_tcp",
+ .this_id = -1,
+ };
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libfc/fc_disc.c linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_disc.c
+--- linux-2.6.30-rc4/drivers/scsi/libfc/fc_disc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_disc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -113,6 +113,11 @@ void fc_disc_stop_rports(struct fc_disc
+ lport->tt.rport_logoff(rport);
+ }
+
++ list_for_each_entry_safe(rdata, next, &disc->rogue_rports, peers) {
++ rport = PRIV_TO_RPORT(rdata);
++ lport->tt.rport_logoff(rport);
++ }
++
+ mutex_unlock(&disc->disc_mutex);
+ }
+
+@@ -131,23 +136,32 @@ static void fc_disc_rport_callback(struc
+ {
+ struct fc_rport_libfc_priv *rdata = rport->dd_data;
+ struct fc_disc *disc = &lport->disc;
+- int found = 0;
+
+ FC_DEBUG_DISC("Received a %d event for port (%6x)\n", event,
+ rport->port_id);
+
+- if (event == RPORT_EV_CREATED) {
++ switch (event) {
++ case RPORT_EV_CREATED:
+ if (disc) {
+- found = 1;
+ mutex_lock(&disc->disc_mutex);
+ list_add_tail(&rdata->peers, &disc->rports);
+ mutex_unlock(&disc->disc_mutex);
+ }
++ break;
++ case RPORT_EV_LOGO:
++ case RPORT_EV_FAILED:
++ case RPORT_EV_STOP:
++ mutex_lock(&disc->disc_mutex);
++ mutex_lock(&rdata->rp_mutex);
++ if (rdata->trans_state == FC_PORTSTATE_ROGUE)
++ list_del(&rdata->peers);
++ mutex_unlock(&rdata->rp_mutex);
++ mutex_unlock(&disc->disc_mutex);
++ break;
++ default:
++ break;
+ }
+
+- if (!found)
+- FC_DEBUG_DISC("The rport (%6x) is not maintained "
+- "by the discovery layer\n", rport->port_id);
+ }
+
+ /**
+@@ -439,6 +453,7 @@ static int fc_disc_new_target(struct fc_
+ rdata = rport->dd_data;
+ rdata->ops = &fc_disc_rport_ops;
+ rdata->rp_state = RPORT_ST_INIT;
++ list_add_tail(&rdata->peers, &disc->rogue_rports);
+ lport->tt.rport_login(rport);
+ }
+ }
+@@ -461,21 +476,29 @@ static void fc_disc_del_target(struct fc
+ /**
+ * fc_disc_done() - Discovery has been completed
+ * @disc: FC discovery context
++ * Locking Note: This function expects that the disc mutex is locked before
++ * it is called. The discovery callback is then made with the lock released,
++ * and the lock is re-taken before returning from this function
+ */
+ static void fc_disc_done(struct fc_disc *disc)
+ {
+ struct fc_lport *lport = disc->lport;
++ enum fc_disc_event event;
+
+ FC_DEBUG_DISC("Discovery complete for port (%6x)\n",
+ fc_host_port_id(lport->host));
+
+- disc->disc_callback(lport, disc->event);
++ event = disc->event;
+ disc->event = DISC_EV_NONE;
+
+ if (disc->requested)
+ fc_disc_gpn_ft_req(disc);
+ else
+ disc->pending = 0;
++
++ mutex_unlock(&disc->disc_mutex);
++ disc->disc_callback(lport, event);
++ mutex_lock(&disc->disc_mutex);
+ }
+
+ /**
+@@ -622,6 +645,8 @@ static int fc_disc_gpn_ft_parse(struct f
+ rdata = rport->dd_data;
+ rdata->ops = &fc_disc_rport_ops;
+ rdata->local_port = lport;
++ list_add_tail(&rdata->peers,
++ &disc->rogue_rports);
+ lport->tt.rport_login(rport);
+ } else
+ FC_DBG("Failed to allocate memory for "
+@@ -681,8 +706,8 @@ static void fc_disc_timeout(struct work_
+ * @fp: response frame
+ * @lp_arg: Fibre Channel host port instance
+ *
+- * Locking Note: This function expects that the disc_mutex is locked
+- * before it is called.
++ * Locking Note: This function is called without disc mutex held, and
++ * should do all its processing with the mutex held
+ */
+ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
+ void *disc_arg)
+@@ -695,11 +720,13 @@ static void fc_disc_gpn_ft_resp(struct f
+ unsigned int len;
+ int error;
+
++ mutex_lock(&disc->disc_mutex);
+ FC_DEBUG_DISC("Received a GPN_FT response on port (%6x)\n",
+ fc_host_port_id(disc->lport->host));
+
+ if (IS_ERR(fp)) {
+ fc_disc_error(disc, fp);
++ mutex_unlock(&disc->disc_mutex);
+ return;
+ }
+
+@@ -744,6 +771,8 @@ static void fc_disc_gpn_ft_resp(struct f
+ disc->seq_count++;
+ }
+ fc_frame_free(fp);
++
++ mutex_unlock(&disc->disc_mutex);
+ }
+
+ /**
+@@ -757,7 +786,6 @@ static void fc_disc_gpn_ft_resp(struct f
+ static void fc_disc_single(struct fc_disc *disc, struct fc_disc_port *dp)
+ {
+ struct fc_lport *lport;
+- struct fc_rport *rport;
+ struct fc_rport *new_rport;
+ struct fc_rport_libfc_priv *rdata;
+
+@@ -766,15 +794,12 @@ static void fc_disc_single(struct fc_dis
+ if (dp->ids.port_id == fc_host_port_id(lport->host))
+ goto out;
+
+- rport = lport->tt.rport_lookup(lport, dp->ids.port_id);
+- if (rport)
+- fc_disc_del_target(disc, rport);
+-
+ new_rport = lport->tt.rport_create(dp);
+ if (new_rport) {
+ rdata = new_rport->dd_data;
+ rdata->ops = &fc_disc_rport_ops;
+ kfree(dp);
++ list_add_tail(&rdata->peers, &disc->rogue_rports);
+ lport->tt.rport_login(new_rport);
+ }
+ return;
+@@ -836,6 +861,7 @@ int fc_disc_init(struct fc_lport *lport)
+ INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
+ mutex_init(&disc->disc_mutex);
+ INIT_LIST_HEAD(&disc->rports);
++ INIT_LIST_HEAD(&disc->rogue_rports);
+
+ disc->lport = lport;
+ disc->delay = FC_DISC_DELAY;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libfc/fc_elsct.c linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_elsct.c
+--- linux-2.6.30-rc4/drivers/scsi/libfc/fc_elsct.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_elsct.c 2009-05-13 09:46:19.000000000 +0200
+@@ -41,7 +41,7 @@ static struct fc_seq *fc_elsct_send(stru
+ void *arg, u32 timer_msec)
+ {
+ enum fc_rctl r_ctl;
+- u32 did;
++ u32 did = FC_FID_NONE;
+ enum fc_fh_type fh_type;
+ int rc;
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libfc/fc_fcp.c linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_fcp.c
+--- linux-2.6.30-rc4/drivers/scsi/libfc/fc_fcp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_fcp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -713,7 +713,7 @@ done:
+ static void fc_fcp_recv(struct fc_seq *seq, struct fc_frame *fp, void *arg)
+ {
+ struct fc_fcp_pkt *fsp = (struct fc_fcp_pkt *)arg;
+- struct fc_lport *lp;
++ struct fc_lport *lport = fsp->lp;
+ struct fc_frame_header *fh;
+ struct fcp_txrdy *dd;
+ u8 r_ctl;
+@@ -724,9 +724,8 @@ static void fc_fcp_recv(struct fc_seq *s
+
+ fh = fc_frame_header_get(fp);
+ r_ctl = fh->fh_r_ctl;
+- lp = fsp->lp;
+
+- if (!(lp->state & LPORT_ST_READY))
++ if (!(lport->state & LPORT_ST_READY))
+ goto out;
+ if (fc_fcp_lock_pkt(fsp))
+ goto out;
+@@ -779,7 +778,7 @@ errout:
+ if (IS_ERR(fp))
+ fc_fcp_error(fsp, fp);
+ else if (rc == -ENOMEM)
+- fc_fcp_reduce_can_queue(lp);
++ fc_fcp_reduce_can_queue(lport);
+ }
+
+ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libfc/fc_lport.c linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_lport.c
+--- linux-2.6.30-rc4/drivers/scsi/libfc/fc_lport.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_lport.c 2009-05-13 09:46:19.000000000 +0200
+@@ -618,6 +618,11 @@ int fc_fabric_logoff(struct fc_lport *lp
+ {
+ lport->tt.disc_stop_final(lport);
+ mutex_lock(&lport->lp_mutex);
++ if (lport->dns_rp)
++ lport->tt.rport_logoff(lport->dns_rp);
++ mutex_unlock(&lport->lp_mutex);
++ lport->tt.rport_flush_queue();
++ mutex_lock(&lport->lp_mutex);
+ fc_lport_enter_logo(lport);
+ mutex_unlock(&lport->lp_mutex);
+ cancel_delayed_work_sync(&lport->retry_work);
+@@ -639,7 +644,12 @@ EXPORT_SYMBOL(fc_fabric_logoff);
+ */
+ int fc_lport_destroy(struct fc_lport *lport)
+ {
++ mutex_lock(&lport->lp_mutex);
++ lport->state = LPORT_ST_NONE;
++ lport->link_up = 0;
+ lport->tt.frame_send = fc_frame_drop;
++ mutex_unlock(&lport->lp_mutex);
++
+ lport->tt.fcp_abort_io(lport);
+ lport->tt.exch_mgr_reset(lport, 0, 0);
+ return 0;
+@@ -1032,17 +1042,19 @@ static void fc_lport_rft_id_resp(struct
+
+ FC_DEBUG_LPORT("Received a RFT_ID response\n");
+
+- if (IS_ERR(fp)) {
+- fc_lport_error(lport, fp);
+- goto err;
+- }
+-
+ if (lport->state != LPORT_ST_RFT_ID) {
+ FC_DBG("Received a RFT_ID response, but in state %s\n",
+ fc_lport_state(lport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_lport_error(lport, fp);
++ goto err;
++ }
++
+ fh = fc_frame_header_get(fp);
+ ct = fc_frame_payload_get(fp, sizeof(*ct));
+
+@@ -1084,17 +1096,19 @@ static void fc_lport_rpn_id_resp(struct
+
+ FC_DEBUG_LPORT("Received a RPN_ID response\n");
+
+- if (IS_ERR(fp)) {
+- fc_lport_error(lport, fp);
+- goto err;
+- }
+-
+ if (lport->state != LPORT_ST_RPN_ID) {
+ FC_DBG("Received a RPN_ID response, but in state %s\n",
+ fc_lport_state(lport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_lport_error(lport, fp);
++ goto err;
++ }
++
+ fh = fc_frame_header_get(fp);
+ ct = fc_frame_payload_get(fp, sizeof(*ct));
+ if (fh && ct && fh->fh_type == FC_TYPE_CT &&
+@@ -1134,17 +1148,19 @@ static void fc_lport_scr_resp(struct fc_
+
+ FC_DEBUG_LPORT("Received a SCR response\n");
+
+- if (IS_ERR(fp)) {
+- fc_lport_error(lport, fp);
+- goto err;
+- }
+-
+ if (lport->state != LPORT_ST_SCR) {
+ FC_DBG("Received a SCR response, but in state %s\n",
+ fc_lport_state(lport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_lport_error(lport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC)
+ fc_lport_enter_ready(lport);
+@@ -1360,17 +1376,19 @@ static void fc_lport_logo_resp(struct fc
+
+ FC_DEBUG_LPORT("Received a LOGO response\n");
+
+- if (IS_ERR(fp)) {
+- fc_lport_error(lport, fp);
+- goto err;
+- }
+-
+ if (lport->state != LPORT_ST_LOGO) {
+ FC_DBG("Received a LOGO response, but in state %s\n",
+ fc_lport_state(lport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_lport_error(lport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC)
+ fc_lport_enter_reset(lport);
+@@ -1400,10 +1418,6 @@ static void fc_lport_enter_logo(struct f
+
+ fc_lport_state_enter(lport, LPORT_ST_LOGO);
+
+- /* DNS session should be closed so we can release it here */
+- if (lport->dns_rp)
+- lport->tt.rport_logoff(lport->dns_rp);
+-
+ fp = fc_frame_alloc(lport, sizeof(*logo));
+ if (!fp) {
+ fc_lport_error(lport, fp);
+@@ -1444,17 +1458,19 @@ static void fc_lport_flogi_resp(struct f
+
+ FC_DEBUG_LPORT("Received a FLOGI response\n");
+
+- if (IS_ERR(fp)) {
+- fc_lport_error(lport, fp);
+- goto err;
+- }
+-
+ if (lport->state != LPORT_ST_FLOGI) {
+ FC_DBG("Received a FLOGI response, but in state %s\n",
+ fc_lport_state(lport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_lport_error(lport, fp);
++ goto err;
++ }
++
+ fh = fc_frame_header_get(fp);
+ did = ntoh24(fh->fh_d_id);
+ if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libfc/fc_rport.c linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_rport.c
+--- linux-2.6.30-rc4/drivers/scsi/libfc/fc_rport.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libfc/fc_rport.c 2009-05-13 09:46:19.000000000 +0200
+@@ -267,6 +267,10 @@ static void fc_rport_work(struct work_st
+ "(%6x).\n", ids.port_id);
+ event = RPORT_EV_FAILED;
+ }
++ if (rport->port_id != FC_FID_DIR_SERV)
++ if (rport_ops->event_callback)
++ rport_ops->event_callback(lport, rport,
++ RPORT_EV_FAILED);
+ put_device(&rport->dev);
+ rport = new_rport;
+ rdata = new_rport->dd_data;
+@@ -325,11 +329,20 @@ int fc_rport_login(struct fc_rport *rpor
+ int fc_rport_logoff(struct fc_rport *rport)
+ {
+ struct fc_rport_libfc_priv *rdata = rport->dd_data;
++ struct fc_lport *lport = rdata->local_port;
+
+ mutex_lock(&rdata->rp_mutex);
+
+ FC_DEBUG_RPORT("Remove port (%6x)\n", rport->port_id);
+
++ if (rdata->rp_state == RPORT_ST_NONE) {
++ FC_DEBUG_RPORT("(%6x): Port (%6x) in NONE state,"
++ " not removing", fc_host_port_id(lport->host),
++ rport->port_id);
++ mutex_unlock(&rdata->rp_mutex);
++ goto out;
++ }
++
+ fc_rport_enter_logo(rport);
+
+ /*
+@@ -349,6 +362,7 @@ int fc_rport_logoff(struct fc_rport *rpo
+
+ mutex_unlock(&rdata->rp_mutex);
+
++out:
+ return 0;
+ }
+
+@@ -430,6 +444,7 @@ static void fc_rport_error(struct fc_rpo
+ case RPORT_ST_PRLI:
+ case RPORT_ST_LOGO:
+ rdata->event = RPORT_EV_FAILED;
++ fc_rport_state_enter(rport, RPORT_ST_NONE);
+ queue_work(rport_event_queue,
+ &rdata->event_work);
+ break;
+@@ -494,7 +509,7 @@ static void fc_rport_plogi_resp(struct f
+ struct fc_rport *rport = rp_arg;
+ struct fc_rport_libfc_priv *rdata = rport->dd_data;
+ struct fc_lport *lport = rdata->local_port;
+- struct fc_els_flogi *plp;
++ struct fc_els_flogi *plp = NULL;
+ unsigned int tov;
+ u16 csp_seq;
+ u16 cssp_seq;
+@@ -505,17 +520,19 @@ static void fc_rport_plogi_resp(struct f
+ FC_DEBUG_RPORT("Received a PLOGI response from port (%6x)\n",
+ rport->port_id);
+
+- if (IS_ERR(fp)) {
+- fc_rport_error_retry(rport, fp);
+- goto err;
+- }
+-
+ if (rdata->rp_state != RPORT_ST_PLOGI) {
+ FC_DBG("Received a PLOGI response, but in state %s\n",
+ fc_rport_state(rport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_rport_error_retry(rport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC &&
+ (plp = fc_frame_payload_get(fp, sizeof(*plp))) != NULL) {
+@@ -614,17 +631,19 @@ static void fc_rport_prli_resp(struct fc
+ FC_DEBUG_RPORT("Received a PRLI response from port (%6x)\n",
+ rport->port_id);
+
+- if (IS_ERR(fp)) {
+- fc_rport_error_retry(rport, fp);
+- goto err;
+- }
+-
+ if (rdata->rp_state != RPORT_ST_PRLI) {
+ FC_DBG("Received a PRLI response, but in state %s\n",
+ fc_rport_state(rport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_rport_error_retry(rport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC) {
+ pp = fc_frame_payload_get(fp, sizeof(*pp));
+@@ -646,6 +665,7 @@ static void fc_rport_prli_resp(struct fc
+ } else {
+ FC_DBG("Bad ELS response\n");
+ rdata->event = RPORT_EV_FAILED;
++ fc_rport_state_enter(rport, RPORT_ST_NONE);
+ queue_work(rport_event_queue, &rdata->event_work);
+ }
+
+@@ -678,23 +698,26 @@ static void fc_rport_logo_resp(struct fc
+ FC_DEBUG_RPORT("Received a LOGO response from port (%6x)\n",
+ rport->port_id);
+
+- if (IS_ERR(fp)) {
+- fc_rport_error_retry(rport, fp);
+- goto err;
+- }
+-
+ if (rdata->rp_state != RPORT_ST_LOGO) {
+ FC_DEBUG_RPORT("Received a LOGO response, but in state %s\n",
+ fc_rport_state(rport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_rport_error_retry(rport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC) {
+ fc_rport_enter_rtv(rport);
+ } else {
+ FC_DBG("Bad ELS response\n");
+ rdata->event = RPORT_EV_LOGO;
++ fc_rport_state_enter(rport, RPORT_ST_NONE);
+ queue_work(rport_event_queue, &rdata->event_work);
+ }
+
+@@ -764,17 +787,19 @@ static void fc_rport_rtv_resp(struct fc_
+ FC_DEBUG_RPORT("Received a RTV response from port (%6x)\n",
+ rport->port_id);
+
+- if (IS_ERR(fp)) {
+- fc_rport_error(rport, fp);
+- goto err;
+- }
+-
+ if (rdata->rp_state != RPORT_ST_RTV) {
+ FC_DBG("Received a RTV response, but in state %s\n",
+ fc_rport_state(rport));
++ if (IS_ERR(fp))
++ goto err;
+ goto out;
+ }
+
++ if (IS_ERR(fp)) {
++ fc_rport_error(rport, fp);
++ goto err;
++ }
++
+ op = fc_frame_payload_op(fp);
+ if (op == ELS_LS_ACC) {
+ struct fc_els_rtv_acc *rtv;
+@@ -1007,6 +1032,8 @@ static void fc_rport_recv_plogi_req(stru
+ default:
+ FC_DEBUG_RPORT("incoming PLOGI from %x in unexpected "
+ "state %d\n", sid, rdata->rp_state);
++ fc_frame_free(fp);
++ return;
+ break;
+ }
+
+@@ -1098,6 +1125,8 @@ static void fc_rport_recv_prli_req(struc
+ reason = ELS_RJT_NONE;
+ break;
+ default:
++ fc_frame_free(rx_fp);
++ return;
+ break;
+ }
+ len = fr_len(rx_fp) - sizeof(*fh);
+@@ -1227,6 +1256,11 @@ static void fc_rport_recv_prlo_req(struc
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
+
++ if (rdata->rp_state == RPORT_ST_NONE) {
++ fc_frame_free(fp);
++ return;
++ }
++
+ rjt_data.fp = NULL;
+ rjt_data.reason = ELS_RJT_UNAB;
+ rjt_data.explan = ELS_EXPL_NONE;
+@@ -1256,7 +1290,13 @@ static void fc_rport_recv_logo_req(struc
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
+
++ if (rdata->rp_state == RPORT_ST_NONE) {
++ fc_frame_free(fp);
++ return;
++ }
++
+ rdata->event = RPORT_EV_LOGO;
++ fc_rport_state_enter(rport, RPORT_ST_NONE);
+ queue_work(rport_event_queue, &rdata->event_work);
+
+ lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libiscsi.c linux-2.6.30-rc4-git/drivers/scsi/libiscsi.c
+--- linux-2.6.30-rc4/drivers/scsi/libiscsi.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libiscsi.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1463,6 +1463,16 @@ int iscsi_change_queue_depth(struct scsi
+ }
+ EXPORT_SYMBOL_GPL(iscsi_change_queue_depth);
+
++int iscsi_target_alloc(struct scsi_target *starget)
++{
++ struct iscsi_cls_session *cls_session = starget_to_session(starget);
++ struct iscsi_session *session = cls_session->dd_data;
++
++ starget->can_queue = session->scsi_cmds_max;
++ return 0;
++}
++EXPORT_SYMBOL_GPL(iscsi_target_alloc);
++
+ void iscsi_session_recovery_timedout(struct iscsi_cls_session *cls_session)
+ {
+ struct iscsi_session *session = cls_session->dd_data;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/libiscsi_tcp.c linux-2.6.30-rc4-git/drivers/scsi/libiscsi_tcp.c
+--- linux-2.6.30-rc4/drivers/scsi/libiscsi_tcp.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/libiscsi_tcp.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1036,8 +1036,11 @@ flush:
+
+ rc = conn->session->tt->init_pdu(task, r2t->data_offset + r2t->sent,
+ r2t->data_count);
+- if (rc)
++ if (rc) {
++ iscsi_conn_failure(conn, ISCSI_ERR_XMIT_FAILED);
+ return rc;
++ }
++
+ r2t->sent += r2t->data_count;
+ goto flush;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_attr.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_attr.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_attr.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_attr.c 2009-05-13 09:46:19.000000000 +0200
+@@ -51,7 +51,7 @@
+ #define LPFC_LINK_SPEED_STRING "0, 1, 2, 4, 8"
+
+ /**
+- * lpfc_jedec_to_ascii: Hex to ascii convertor according to JEDEC rules.
++ * lpfc_jedec_to_ascii - Hex to ascii convertor according to JEDEC rules
+ * @incr: integer to convert.
+ * @hdw: ascii string holding converted integer plus a string terminator.
+ *
+@@ -82,7 +82,7 @@ lpfc_jedec_to_ascii(int incr, char hdw[]
+ }
+
+ /**
+- * lpfc_drvr_version_show: Return the Emulex driver string with version number.
++ * lpfc_drvr_version_show - Return the Emulex driver string with version number
+ * @dev: class unused variable.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the module description text.
+@@ -152,7 +152,7 @@ lpfc_bg_reftag_err_show(struct device *d
+ }
+
+ /**
+- * lpfc_info_show: Return some pci info about the host in ascii.
++ * lpfc_info_show - Return some pci info about the host in ascii
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the formatted text from lpfc_info().
+@@ -169,7 +169,7 @@ lpfc_info_show(struct device *dev, struc
+ }
+
+ /**
+- * lpfc_serialnum_show: Return the hba serial number in ascii.
++ * lpfc_serialnum_show - Return the hba serial number in ascii
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the formatted text serial number.
+@@ -188,7 +188,7 @@ lpfc_serialnum_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_temp_sensor_show: Return the temperature sensor level.
++ * lpfc_temp_sensor_show - Return the temperature sensor level
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the formatted support level.
+@@ -210,7 +210,7 @@ lpfc_temp_sensor_show(struct device *dev
+ }
+
+ /**
+- * lpfc_modeldesc_show: Return the model description of the hba.
++ * lpfc_modeldesc_show - Return the model description of the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the scsi vpd model description.
+@@ -229,7 +229,7 @@ lpfc_modeldesc_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_modelname_show: Return the model name of the hba.
++ * lpfc_modelname_show - Return the model name of the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the scsi vpd model name.
+@@ -248,7 +248,7 @@ lpfc_modelname_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_programtype_show: Return the program type of the hba.
++ * lpfc_programtype_show - Return the program type of the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the scsi vpd program type.
+@@ -267,7 +267,7 @@ lpfc_programtype_show(struct device *dev
+ }
+
+ /**
+- * lpfc_mlomgmt_show: Return the Menlo Maintenance sli flag.
++ * lpfc_mlomgmt_show - Return the Menlo Maintenance sli flag
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the Menlo Maintenance sli flag.
+@@ -286,7 +286,7 @@ lpfc_mlomgmt_show(struct device *dev, st
+ }
+
+ /**
+- * lpfc_vportnum_show: Return the port number in ascii of the hba.
++ * lpfc_vportnum_show - Return the port number in ascii of the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains scsi vpd program type.
+@@ -305,7 +305,7 @@ lpfc_vportnum_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_fwrev_show: Return the firmware rev running in the hba.
++ * lpfc_fwrev_show - Return the firmware rev running in the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the scsi vpd program type.
+@@ -326,7 +326,7 @@ lpfc_fwrev_show(struct device *dev, stru
+ }
+
+ /**
+- * lpfc_hdw_show: Return the jedec information about the hba.
++ * lpfc_hdw_show - Return the jedec information about the hba
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the scsi vpd program type.
+@@ -347,7 +347,7 @@ lpfc_hdw_show(struct device *dev, struct
+ }
+
+ /**
+- * lpfc_option_rom_version_show: Return the adapter ROM FCode version.
++ * lpfc_option_rom_version_show - Return the adapter ROM FCode version
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the ROM and FCode ascii strings.
+@@ -366,7 +366,7 @@ lpfc_option_rom_version_show(struct devi
+ }
+
+ /**
+- * lpfc_state_show: Return the link state of the port.
++ * lpfc_state_show - Return the link state of the port
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains text describing the state of the link.
+@@ -451,7 +451,7 @@ lpfc_link_state_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_num_discovered_ports_show: Return sum of mapped and unmapped vports.
++ * lpfc_num_discovered_ports_show - Return sum of mapped and unmapped vports
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the sum of fc mapped and unmapped.
+@@ -474,7 +474,7 @@ lpfc_num_discovered_ports_show(struct de
+ }
+
+ /**
+- * lpfc_issue_lip: Misnomer, name carried over from long ago.
++ * lpfc_issue_lip - Misnomer, name carried over from long ago
+ * @shost: Scsi_Host pointer.
+ *
+ * Description:
+@@ -529,7 +529,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
+ }
+
+ /**
+- * lpfc_do_offline: Issues a mailbox command to bring the link down.
++ * lpfc_do_offline - Issues a mailbox command to bring the link down
+ * @phba: lpfc_hba pointer.
+ * @type: LPFC_EVT_OFFLINE, LPFC_EVT_WARM_START, LPFC_EVT_KILL.
+ *
+@@ -537,7 +537,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
+ * Assumes any error from lpfc_do_offline() will be negative.
+ * Can wait up to 5 seconds for the port ring buffers count
+ * to reach zero, prints a warning if it is not zero and continues.
+- * lpfc_workq_post_event() returns a non-zero return coce if call fails.
++ * lpfc_workq_post_event() returns a non-zero return code if call fails.
+ *
+ * Returns:
+ * -EIO error posting the event
+@@ -591,7 +591,7 @@ lpfc_do_offline(struct lpfc_hba *phba, u
+ }
+
+ /**
+- * lpfc_selective_reset: Offline then onlines the port.
++ * lpfc_selective_reset - Offline then onlines the port
+ * @phba: lpfc_hba pointer.
+ *
+ * Description:
+@@ -632,7 +632,7 @@ lpfc_selective_reset(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_issue_reset: Selectively resets an adapter.
++ * lpfc_issue_reset - Selectively resets an adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: containing the string "selective".
+@@ -672,7 +672,7 @@ lpfc_issue_reset(struct device *dev, str
+ }
+
+ /**
+- * lpfc_nport_evt_cnt_show: Return the number of nport events.
++ * lpfc_nport_evt_cnt_show - Return the number of nport events
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the ascii number of nport events.
+@@ -691,7 +691,7 @@ lpfc_nport_evt_cnt_show(struct device *d
+ }
+
+ /**
+- * lpfc_board_mode_show: Return the state of the board.
++ * lpfc_board_mode_show - Return the state of the board
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the state of the adapter.
+@@ -720,7 +720,7 @@ lpfc_board_mode_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_board_mode_store: Puts the hba in online, offline, warm or error state.
++ * lpfc_board_mode_store - Puts the hba in online, offline, warm or error state
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: containing one of the strings "online", "offline", "warm" or "error".
+@@ -766,14 +766,14 @@ lpfc_board_mode_store(struct device *dev
+ }
+
+ /**
+- * lpfc_get_hba_info: Return various bits of informaton about the adapter.
++ * lpfc_get_hba_info - Return various bits of informaton about the adapter
+ * @phba: pointer to the adapter structure.
+- * @mxri max xri count.
+- * @axri available xri count.
+- * @mrpi max rpi count.
+- * @arpi available rpi count.
+- * @mvpi max vpi count.
+- * @avpi available vpi count.
++ * @mxri: max xri count.
++ * @axri: available xri count.
++ * @mrpi: max rpi count.
++ * @arpi: available rpi count.
++ * @mvpi: max vpi count.
++ * @avpi: available vpi count.
+ *
+ * Description:
+ * If an integer pointer for an count is not null then the value for the
+@@ -846,7 +846,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_max_rpi_show: Return maximum rpi.
++ * lpfc_max_rpi_show - Return maximum rpi
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the maximum rpi count in decimal or "Unknown".
+@@ -874,7 +874,7 @@ lpfc_max_rpi_show(struct device *dev, st
+ }
+
+ /**
+- * lpfc_used_rpi_show: Return maximum rpi minus available rpi.
++ * lpfc_used_rpi_show - Return maximum rpi minus available rpi
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: containing the used rpi count in decimal or "Unknown".
+@@ -902,7 +902,7 @@ lpfc_used_rpi_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_max_xri_show: Return maximum xri.
++ * lpfc_max_xri_show - Return maximum xri
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the maximum xri count in decimal or "Unknown".
+@@ -930,7 +930,7 @@ lpfc_max_xri_show(struct device *dev, st
+ }
+
+ /**
+- * lpfc_used_xri_show: Return maximum xpi minus the available xpi.
++ * lpfc_used_xri_show - Return maximum xpi minus the available xpi
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the used xri count in decimal or "Unknown".
+@@ -958,7 +958,7 @@ lpfc_used_xri_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_max_vpi_show: Return maximum vpi.
++ * lpfc_max_vpi_show - Return maximum vpi
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the maximum vpi count in decimal or "Unknown".
+@@ -986,7 +986,7 @@ lpfc_max_vpi_show(struct device *dev, st
+ }
+
+ /**
+- * lpfc_used_vpi_show: Return maximum vpi minus the available vpi.
++ * lpfc_used_vpi_show - Return maximum vpi minus the available vpi
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the used vpi count in decimal or "Unknown".
+@@ -1014,7 +1014,7 @@ lpfc_used_vpi_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_npiv_info_show: Return text about NPIV support for the adapter.
++ * lpfc_npiv_info_show - Return text about NPIV support for the adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: text that must be interpreted to determine if npiv is supported.
+@@ -1042,7 +1042,7 @@ lpfc_npiv_info_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_poll_show: Return text about poll support for the adapter.
++ * lpfc_poll_show - Return text about poll support for the adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the cfg_poll in hex.
+@@ -1064,7 +1064,7 @@ lpfc_poll_show(struct device *dev, struc
+ }
+
+ /**
+- * lpfc_poll_store: Set the value of cfg_poll for the adapter.
++ * lpfc_poll_store - Set the value of cfg_poll for the adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: one or more lpfc_polling_flags values.
+@@ -1136,7 +1136,7 @@ lpfc_poll_store(struct device *dev, stru
+ }
+
+ /**
+- * lpfc_param_show: Return a cfg attribute value in decimal.
++ * lpfc_param_show - Return a cfg attribute value in decimal
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1164,7 +1164,7 @@ lpfc_##attr##_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_param_hex_show: Return a cfg attribute value in hex.
++ * lpfc_param_hex_show - Return a cfg attribute value in hex
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1173,7 +1173,7 @@ lpfc_##attr##_show(struct device *dev, s
+ * lpfc_##attr##_show: Return the hex value of an adapters cfg_xxx field.
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+- * @buf: on return contains the attribute value in hexidecimal.
++ * @buf: on return contains the attribute value in hexadecimal.
+ *
+ * Returns: size of formatted string.
+ **/
+@@ -1192,7 +1192,7 @@ lpfc_##attr##_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_param_init: Intializes a cfg attribute.
++ * lpfc_param_init - Intializes a cfg attribute
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1226,7 +1226,7 @@ lpfc_##attr##_init(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_param_set: Set a cfg attribute value.
++ * lpfc_param_set - Set a cfg attribute value
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1260,7 +1260,7 @@ lpfc_##attr##_set(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_param_store: Set a vport attribute value.
++ * lpfc_param_store - Set a vport attribute value
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1300,7 +1300,7 @@ lpfc_##attr##_store(struct device *dev,
+ }
+
+ /**
+- * lpfc_vport_param_show: Return decimal formatted cfg attribute value.
++ * lpfc_vport_param_show - Return decimal formatted cfg attribute value
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1326,17 +1326,17 @@ lpfc_##attr##_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_vport_param_hex_show: Return hex formatted attribute value.
++ * lpfc_vport_param_hex_show - Return hex formatted attribute value
+ *
+ * Description:
+ * Macro that given an attr e.g.
+ * hba_queue_depth expands into a function with the name
+ * lpfc_hba_queue_depth_show
+ *
+- * lpfc_##attr##_show: prints the attribute value in hexidecimal.
++ * lpfc_##attr##_show: prints the attribute value in hexadecimal.
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+- * @buf: on return contains the attribute value in hexidecimal.
++ * @buf: on return contains the attribute value in hexadecimal.
+ *
+ * Returns: length of formatted string.
+ **/
+@@ -1353,7 +1353,7 @@ lpfc_##attr##_show(struct device *dev, s
+ }
+
+ /**
+- * lpfc_vport_param_init: Initialize a vport cfg attribute.
++ * lpfc_vport_param_init - Initialize a vport cfg attribute
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1386,7 +1386,7 @@ lpfc_##attr##_init(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_vport_param_set: Set a vport cfg attribute.
++ * lpfc_vport_param_set - Set a vport cfg attribute
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth expands
+@@ -1417,7 +1417,7 @@ lpfc_##attr##_set(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_vport_param_store: Set a vport attribute.
++ * lpfc_vport_param_store - Set a vport attribute
+ *
+ * Description:
+ * Macro that given an attr e.g. hba_queue_depth
+@@ -1576,7 +1576,7 @@ static DEVICE_ATTR(lpfc_temp_sensor, S_I
+ static char *lpfc_soft_wwn_key = "C99G71SL8032A";
+
+ /**
+- * lpfc_soft_wwn_enable_store: Allows setting of the wwn if the key is valid.
++ * lpfc_soft_wwn_enable_store - Allows setting of the wwn if the key is valid
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+ * @buf: containing the string lpfc_soft_wwn_key.
+@@ -1623,10 +1623,10 @@ static DEVICE_ATTR(lpfc_soft_wwn_enable,
+ lpfc_soft_wwn_enable_store);
+
+ /**
+- * lpfc_soft_wwpn_show: Return the cfg soft ww port name of the adapter.
++ * lpfc_soft_wwpn_show - Return the cfg soft ww port name of the adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+- * @buf: on return contains the wwpn in hexidecimal.
++ * @buf: on return contains the wwpn in hexadecimal.
+ *
+ * Returns: size of formatted string.
+ **/
+@@ -1643,10 +1643,10 @@ lpfc_soft_wwpn_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_soft_wwpn_store: Set the ww port name of the adapter.
++ * lpfc_soft_wwpn_store - Set the ww port name of the adapter
+ * @dev class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+- * @buf: contains the wwpn in hexidecimal.
++ * @buf: contains the wwpn in hexadecimal.
+ * @count: number of wwpn bytes in buf
+ *
+ * Returns:
+@@ -1729,10 +1729,10 @@ static DEVICE_ATTR(lpfc_soft_wwpn, S_IRU
+ lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
+
+ /**
+- * lpfc_soft_wwnn_show: Return the cfg soft ww node name for the adapter.
++ * lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter
+ * @dev: class device that is converted into a Scsi_host.
+ * @attr: device attribute, not used.
+- * @buf: on return contains the wwnn in hexidecimal.
++ * @buf: on return contains the wwnn in hexadecimal.
+ *
+ * Returns: size of formatted string.
+ **/
+@@ -1747,9 +1747,9 @@ lpfc_soft_wwnn_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_soft_wwnn_store: sets the ww node name of the adapter.
++ * lpfc_soft_wwnn_store - sets the ww node name of the adapter
+ * @cdev: class device that is converted into a Scsi_host.
+- * @buf: contains the ww node name in hexidecimal.
++ * @buf: contains the ww node name in hexadecimal.
+ * @count: number of wwnn bytes in buf.
+ *
+ * Returns:
+@@ -1845,7 +1845,7 @@ MODULE_PARM_DESC(lpfc_nodev_tmo,
+ "for a device to come back");
+
+ /**
+- * lpfc_nodev_tmo_show: Return the hba dev loss timeout value.
++ * lpfc_nodev_tmo_show - Return the hba dev loss timeout value
+ * @dev: class converted to a Scsi_host structure.
+ * @attr: device attribute, not used.
+ * @buf: on return contains the dev loss timeout in decimal.
+@@ -1864,7 +1864,7 @@ lpfc_nodev_tmo_show(struct device *dev,
+ }
+
+ /**
+- * lpfc_nodev_tmo_init: Set the hba nodev timeout value.
++ * lpfc_nodev_tmo_init - Set the hba nodev timeout value
+ * @vport: lpfc vport structure pointer.
+ * @val: contains the nodev timeout value.
+ *
+@@ -1905,7 +1905,7 @@ lpfc_nodev_tmo_init(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_update_rport_devloss_tmo: Update dev loss tmo value.
++ * lpfc_update_rport_devloss_tmo - Update dev loss tmo value
+ * @vport: lpfc vport structure pointer.
+ *
+ * Description:
+@@ -1926,7 +1926,7 @@ lpfc_update_rport_devloss_tmo(struct lpf
+ }
+
+ /**
+- * lpfc_nodev_tmo_set: Set the vport nodev tmo and devloss tmo values.
++ * lpfc_nodev_tmo_set - Set the vport nodev tmo and devloss tmo values
+ * @vport: lpfc vport structure pointer.
+ * @val: contains the tmo value.
+ *
+@@ -1982,7 +1982,7 @@ lpfc_vport_param_init(devloss_tmo, LPFC_
+ lpfc_vport_param_show(devloss_tmo)
+
+ /**
+- * lpfc_devloss_tmo_set: Sets vport nodev tmo, devloss tmo values, changed bit.
++ * lpfc_devloss_tmo_set - Sets vport nodev tmo, devloss tmo values, changed bit
+ * @vport: lpfc vport structure pointer.
+ * @val: contains the tmo value.
+ *
+@@ -2094,7 +2094,7 @@ MODULE_PARM_DESC(lpfc_restrict_login,
+ lpfc_vport_param_show(restrict_login);
+
+ /**
+- * lpfc_restrict_login_init: Set the vport restrict login flag.
++ * lpfc_restrict_login_init - Set the vport restrict login flag
+ * @vport: lpfc vport structure pointer.
+ * @val: contains the restrict login value.
+ *
+@@ -2128,7 +2128,7 @@ lpfc_restrict_login_init(struct lpfc_vpo
+ }
+
+ /**
+- * lpfc_restrict_login_set: Set the vport restrict login flag.
++ * lpfc_restrict_login_set - Set the vport restrict login flag
+ * @vport: lpfc vport structure pointer.
+ * @val: contains the restrict login value.
+ *
+@@ -2201,7 +2201,7 @@ LPFC_VPORT_ATTR_R(scan_down, 1, 0, 1,
+ */
+
+ /**
+- * lpfc_topology_set: Set the adapters topology field.
++ * lpfc_topology_set - Set the adapters topology field
+ * @phba: lpfc_hba pointer.
+ * @val: topology value.
+ *
+@@ -2216,18 +2216,41 @@ LPFC_VPORT_ATTR_R(scan_down, 1, 0, 1,
+ * non-zero return value from lpfc_issue_lip()
+ * -EINVAL val out of range
+ **/
+-static int
+-lpfc_topology_set(struct lpfc_hba *phba, int val)
++static ssize_t
++lpfc_topology_store(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
+ {
++ struct Scsi_Host *shost = class_to_shost(dev);
++ struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
++ struct lpfc_hba *phba = vport->phba;
++ int val = 0;
++ int nolip = 0;
++ const char *val_buf = buf;
+ int err;
+ uint32_t prev_val;
++
++ if (!strncmp(buf, "nolip ", strlen("nolip "))) {
++ nolip = 1;
++ val_buf = &buf[strlen("nolip ")];
++ }
++
++ if (!isdigit(val_buf[0]))
++ return -EINVAL;
++ if (sscanf(val_buf, "%i", &val) != 1)
++ return -EINVAL;
++
+ if (val >= 0 && val <= 6) {
+ prev_val = phba->cfg_topology;
+ phba->cfg_topology = val;
++ if (nolip)
++ return strlen(buf);
++
+ err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport));
+- if (err)
++ if (err) {
+ phba->cfg_topology = prev_val;
+- return err;
++ return -EINVAL;
++ } else
++ return strlen(buf);
+ }
+ lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+ "%d:0467 lpfc_topology attribute cannot be set to %d, "
+@@ -2240,14 +2263,12 @@ module_param(lpfc_topology, int, 0);
+ MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology");
+ lpfc_param_show(topology)
+ lpfc_param_init(topology, 0, 0, 6)
+-lpfc_param_store(topology)
+ static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR,
+ lpfc_topology_show, lpfc_topology_store);
+
+
+ /**
+- * lpfc_stat_data_ctrl_store: write call back for lpfc_stat_data_ctrl
+- * sysfs file.
++ * lpfc_stat_data_ctrl_store - write call back for lpfc_stat_data_ctrl sysfs file
+ * @dev: Pointer to class device.
+ * @buf: Data buffer.
+ * @count: Size of the data buffer.
+@@ -2282,7 +2303,7 @@ lpfc_stat_data_ctrl_store(struct device
+ unsigned long base, step, bucket_type;
+
+ if (!strncmp(buf, "setbucket", strlen("setbucket"))) {
+- if (strlen(buf) > LPFC_MAX_DATA_CTRL_LEN)
++ if (strlen(buf) > (LPFC_MAX_DATA_CTRL_LEN - 1))
+ return -EINVAL;
+
+ strcpy(bucket_data, buf);
+@@ -2411,8 +2432,7 @@ lpfc_stat_data_ctrl_store(struct device
+
+
+ /**
+- * lpfc_stat_data_ctrl_show: Read callback function for
+- * lpfc_stat_data_ctrl sysfs file.
++ * lpfc_stat_data_ctrl_show - Read function for lpfc_stat_data_ctrl sysfs file
+ * @dev: Pointer to class device object.
+ * @buf: Data buffer.
+ *
+@@ -2489,8 +2509,7 @@ static DEVICE_ATTR(lpfc_stat_data_ctrl,
+
+
+ /**
+- * sysfs_drvr_stat_data_read: Read callback function for lpfc_drvr_stat_data
+- * sysfs attribute.
++ * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute
+ * @kobj: Pointer to the kernel object
+ * @bin_attr: Attribute object
+ * @buff: Buffer pointer
+@@ -2585,7 +2604,7 @@ static struct bin_attribute sysfs_drvr_s
+ */
+
+ /**
+- * lpfc_link_speed_set: Set the adapters link speed.
++ * lpfc_link_speed_set - Set the adapters link speed
+ * @phba: lpfc_hba pointer.
+ * @val: link speed value.
+ *
+@@ -2601,12 +2620,29 @@ static struct bin_attribute sysfs_drvr_s
+ * non-zero return value from lpfc_issue_lip()
+ * -EINVAL val out of range
+ **/
+-static int
+-lpfc_link_speed_set(struct lpfc_hba *phba, int val)
++static ssize_t
++lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
+ {
++ struct Scsi_Host *shost = class_to_shost(dev);
++ struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
++ struct lpfc_hba *phba = vport->phba;
++ int val = 0;
++ int nolip = 0;
++ const char *val_buf = buf;
+ int err;
+ uint32_t prev_val;
+
++ if (!strncmp(buf, "nolip ", strlen("nolip "))) {
++ nolip = 1;
++ val_buf = &buf[strlen("nolip ")];
++ }
++
++ if (!isdigit(val_buf[0]))
++ return -EINVAL;
++ if (sscanf(val_buf, "%i", &val) != 1)
++ return -EINVAL;
++
+ if (((val == LINK_SPEED_1G) && !(phba->lmt & LMT_1Gb)) ||
+ ((val == LINK_SPEED_2G) && !(phba->lmt & LMT_2Gb)) ||
+ ((val == LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) ||
+@@ -2614,14 +2650,19 @@ lpfc_link_speed_set(struct lpfc_hba *phb
+ ((val == LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)))
+ return -EINVAL;
+
+- if ((val >= 0 && val <= LPFC_MAX_LINK_SPEED)
++ if ((val >= 0 && val <= 8)
+ && (LPFC_LINK_SPEED_BITMAP & (1 << val))) {
+ prev_val = phba->cfg_link_speed;
+ phba->cfg_link_speed = val;
++ if (nolip)
++ return strlen(buf);
++
+ err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport));
+- if (err)
++ if (err) {
+ phba->cfg_link_speed = prev_val;
+- return err;
++ return -EINVAL;
++ } else
++ return strlen(buf);
+ }
+
+ lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+@@ -2637,7 +2678,7 @@ MODULE_PARM_DESC(lpfc_link_speed, "Selec
+ lpfc_param_show(link_speed)
+
+ /**
+- * lpfc_link_speed_init: Set the adapters link speed.
++ * lpfc_link_speed_init - Set the adapters link speed
+ * @phba: lpfc_hba pointer.
+ * @val: link speed value.
+ *
+@@ -2668,7 +2709,6 @@ lpfc_link_speed_init(struct lpfc_hba *ph
+ return -EINVAL;
+ }
+
+-lpfc_param_store(link_speed)
+ static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR,
+ lpfc_link_speed_show, lpfc_link_speed_store);
+
+@@ -2865,7 +2905,7 @@ MODULE_PARM_DESC(lpfc_prot_guard, "host
+
+
+ /*
+- * lpfc_sg_seg_cnt: Initial Maximum DMA Segment Count
++ * lpfc_sg_seg_cnt - Initial Maximum DMA Segment Count
+ * This value can be set to values between 64 and 256. The default value is
+ * 64, but may be increased to allow for larger Max I/O sizes. The scsi layer
+ * will be allowed to request I/Os of sizes up to (MAX_SEG_COUNT * SEG_SIZE).
+@@ -2967,7 +3007,7 @@ struct device_attribute *lpfc_vport_attr
+ };
+
+ /**
+- * sysfs_ctlreg_write: Write method for writing to ctlreg.
++ * sysfs_ctlreg_write - Write method for writing to ctlreg
+ * @kobj: kernel kobject that contains the kernel class device.
+ * @bin_attr: kernel attributes passed to us.
+ * @buf: contains the data to be written to the adapter IOREG space.
+@@ -3017,7 +3057,7 @@ sysfs_ctlreg_write(struct kobject *kobj,
+ }
+
+ /**
+- * sysfs_ctlreg_read: Read method for reading from ctlreg.
++ * sysfs_ctlreg_read - Read method for reading from ctlreg
+ * @kobj: kernel kobject that contains the kernel class device.
+ * @bin_attr: kernel attributes passed to us.
+ * @buf: if succesful contains the data from the adapter IOREG space.
+@@ -3078,7 +3118,7 @@ static struct bin_attribute sysfs_ctlreg
+ };
+
+ /**
+- * sysfs_mbox_idle: frees the sysfs mailbox.
++ * sysfs_mbox_idle - frees the sysfs mailbox
+ * @phba: lpfc_hba pointer
+ **/
+ static void
+@@ -3095,7 +3135,7 @@ sysfs_mbox_idle(struct lpfc_hba *phba)
+ }
+
+ /**
+- * sysfs_mbox_write: Write method for writing information via mbox.
++ * sysfs_mbox_write - Write method for writing information via mbox
+ * @kobj: kernel kobject that contains the kernel class device.
+ * @bin_attr: kernel attributes passed to us.
+ * @buf: contains the data to be written to sysfs mbox.
+@@ -3170,7 +3210,7 @@ sysfs_mbox_write(struct kobject *kobj, s
+ }
+
+ /**
+- * sysfs_mbox_read: Read method for reading information via mbox.
++ * sysfs_mbox_read - Read method for reading information via mbox
+ * @kobj: kernel kobject that contains the kernel class device.
+ * @bin_attr: kernel attributes passed to us.
+ * @buf: contains the data to be read from sysfs mbox.
+@@ -3374,7 +3414,7 @@ static struct bin_attribute sysfs_mbox_a
+ };
+
+ /**
+- * lpfc_alloc_sysfs_attr: Creates the ctlreg and mbox entries.
++ * lpfc_alloc_sysfs_attr - Creates the ctlreg and mbox entries
+ * @vport: address of lpfc vport structure.
+ *
+ * Return codes:
+@@ -3415,7 +3455,7 @@ out:
+ }
+
+ /**
+- * lpfc_free_sysfs_attr: Removes the ctlreg and mbox entries.
++ * lpfc_free_sysfs_attr - Removes the ctlreg and mbox entries
+ * @vport: address of lpfc vport structure.
+ **/
+ void
+@@ -3437,7 +3477,7 @@ lpfc_free_sysfs_attr(struct lpfc_vport *
+ */
+
+ /**
+- * lpfc_get_host_port_id: Copy the vport DID into the scsi host port id.
++ * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3450,7 +3490,7 @@ lpfc_get_host_port_id(struct Scsi_Host *
+ }
+
+ /**
+- * lpfc_get_host_port_type: Set the value of the scsi host port type.
++ * lpfc_get_host_port_type - Set the value of the scsi host port type
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3482,7 +3522,7 @@ lpfc_get_host_port_type(struct Scsi_Host
+ }
+
+ /**
+- * lpfc_get_host_port_state: Set the value of the scsi host port state.
++ * lpfc_get_host_port_state - Set the value of the scsi host port state
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3520,7 +3560,7 @@ lpfc_get_host_port_state(struct Scsi_Hos
+ }
+
+ /**
+- * lpfc_get_host_speed: Set the value of the scsi host speed.
++ * lpfc_get_host_speed - Set the value of the scsi host speed
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3556,7 +3596,7 @@ lpfc_get_host_speed(struct Scsi_Host *sh
+ }
+
+ /**
+- * lpfc_get_host_fabric_name: Set the value of the scsi host fabric name.
++ * lpfc_get_host_fabric_name - Set the value of the scsi host fabric name
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3582,7 +3622,7 @@ lpfc_get_host_fabric_name (struct Scsi_H
+ }
+
+ /**
+- * lpfc_get_stats: Return statistical information about the adapter.
++ * lpfc_get_stats - Return statistical information about the adapter
+ * @shost: kernel scsi host pointer.
+ *
+ * Notes:
+@@ -3707,7 +3747,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
+ }
+
+ /**
+- * lpfc_reset_stats: Copy the adapter link stats information.
++ * lpfc_reset_stats - Copy the adapter link stats information
+ * @shost: kernel scsi host pointer.
+ **/
+ static void
+@@ -3788,7 +3828,7 @@ lpfc_reset_stats(struct Scsi_Host *shost
+ */
+
+ /**
+- * lpfc_get_node_by_target: Return the nodelist for a target.
++ * lpfc_get_node_by_target - Return the nodelist for a target
+ * @starget: kernel scsi target pointer.
+ *
+ * Returns:
+@@ -3817,7 +3857,7 @@ lpfc_get_node_by_target(struct scsi_targ
+ }
+
+ /**
+- * lpfc_get_starget_port_id: Set the target port id to the ndlp DID or -1.
++ * lpfc_get_starget_port_id - Set the target port id to the ndlp DID or -1
+ * @starget: kernel scsi target pointer.
+ **/
+ static void
+@@ -3829,7 +3869,7 @@ lpfc_get_starget_port_id(struct scsi_tar
+ }
+
+ /**
+- * lpfc_get_starget_node_name: Set the target node name.
++ * lpfc_get_starget_node_name - Set the target node name
+ * @starget: kernel scsi target pointer.
+ *
+ * Description: Set the target node name to the ndlp node name wwn or zero.
+@@ -3844,7 +3884,7 @@ lpfc_get_starget_node_name(struct scsi_t
+ }
+
+ /**
+- * lpfc_get_starget_port_name: Set the target port name.
++ * lpfc_get_starget_port_name - Set the target port name
+ * @starget: kernel scsi target pointer.
+ *
+ * Description: set the target port name to the ndlp port name wwn or zero.
+@@ -3859,7 +3899,7 @@ lpfc_get_starget_port_name(struct scsi_t
+ }
+
+ /**
+- * lpfc_set_rport_loss_tmo: Set the rport dev loss tmo.
++ * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo
+ * @rport: fc rport address.
+ * @timeout: new value for dev loss tmo.
+ *
+@@ -3877,7 +3917,7 @@ lpfc_set_rport_loss_tmo(struct fc_rport
+ }
+
+ /**
+- * lpfc_rport_show_function: Return rport target information.
++ * lpfc_rport_show_function - Return rport target information
+ *
+ * Description:
+ * Macro that uses field to generate a function with the name lpfc_show_rport_
+@@ -3905,7 +3945,7 @@ lpfc_show_rport_##field (struct device *
+ static FC_RPORT_ATTR(field, S_IRUGO, lpfc_show_rport_##field, NULL)
+
+ /**
+- * lpfc_set_vport_symbolic_name: Set the vport's symbolic name.
++ * lpfc_set_vport_symbolic_name - Set the vport's symbolic name
+ * @fc_vport: The fc_vport who's symbolic name has been changed.
+ *
+ * Description:
+@@ -4048,7 +4088,7 @@ struct fc_function_template lpfc_vport_t
+ };
+
+ /**
+- * lpfc_get_cfgparam: Used during probe_one to init the adapter structure.
++ * lpfc_get_cfgparam - Used during probe_one to init the adapter structure
+ * @phba: lpfc_hba pointer.
+ **/
+ void
+@@ -4097,7 +4137,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_get_vport_cfgparam: Used during port create, init the vport structure.
++ * lpfc_get_vport_cfgparam - Used during port create, init the vport structure
+ * @vport: lpfc_vport pointer.
+ **/
+ void
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_crtn.h linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_crtn.h
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_crtn.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_crtn.h 2009-05-13 09:46:19.000000000 +0200
+@@ -184,6 +184,8 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_
+ struct lpfc_iocbq * lpfc_sli_get_iocbq(struct lpfc_hba *);
+ void lpfc_sli_release_iocbq(struct lpfc_hba *, struct lpfc_iocbq *);
+ uint16_t lpfc_sli_next_iotag(struct lpfc_hba *, struct lpfc_iocbq *);
++void lpfc_sli_cancel_iocbs(struct lpfc_hba *, struct list_head *, uint32_t,
++ uint32_t);
+
+ void lpfc_reset_barrier(struct lpfc_hba * phba);
+ int lpfc_sli_brdready(struct lpfc_hba *, uint32_t);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_debugfs.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_debugfs.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_debugfs.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_debugfs.c 2009-05-13 09:46:19.000000000 +0200
+@@ -47,7 +47,7 @@
+ #include "lpfc_debugfs.h"
+
+ #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
+-/**
++/*
+ * debugfs interface
+ *
+ * To access this interface the user should:
+@@ -95,7 +95,7 @@ module_param(lpfc_debugfs_max_slow_ring_
+ MODULE_PARM_DESC(lpfc_debugfs_max_slow_ring_trc,
+ "Set debugfs slow ring trace depth");
+
+-int lpfc_debugfs_mask_disc_trc;
++static int lpfc_debugfs_mask_disc_trc;
+ module_param(lpfc_debugfs_mask_disc_trc, int, 0);
+ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
+ "Set debugfs discovery trace mask");
+@@ -127,7 +127,7 @@ static atomic_t lpfc_debugfs_seq_trc_cnt
+ static unsigned long lpfc_debugfs_start_time = 0L;
+
+ /**
+- * lpfc_debugfs_disc_trc_data - Dump discovery logging to a buffer.
++ * lpfc_debugfs_disc_trc_data - Dump discovery logging to a buffer
+ * @vport: The vport to gather the log info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -187,7 +187,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_v
+ }
+
+ /**
+- * lpfc_debugfs_slow_ring_trc_data - Dump slow ring logging to a buffer.
++ * lpfc_debugfs_slow_ring_trc_data - Dump slow ring logging to a buffer
+ * @phba: The HBA to gather the log info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -250,7 +250,7 @@ lpfc_debugfs_slow_ring_trc_data(struct l
+ static int lpfc_debugfs_last_hbq = -1;
+
+ /**
+- * lpfc_debugfs_hbqinfo_data - Dump host buffer queue info to a buffer.
++ * lpfc_debugfs_hbqinfo_data - Dump host buffer queue info to a buffer
+ * @phba: The HBA to gather host buffer info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -369,7 +369,7 @@ skipit:
+ static int lpfc_debugfs_last_hba_slim_off;
+
+ /**
+- * lpfc_debugfs_dumpHBASlim_data - Dump HBA SLIM info to a buffer.
++ * lpfc_debugfs_dumpHBASlim_data - Dump HBA SLIM info to a buffer
+ * @phba: The HBA to gather SLIM info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -399,8 +399,7 @@ lpfc_debugfs_dumpHBASlim_data(struct lpf
+
+ len += snprintf(buf+len, size-len, "HBA SLIM\n");
+ lpfc_memcpy_from_slim(buffer,
+- ((uint8_t *)phba->MBslimaddr) + lpfc_debugfs_last_hba_slim_off,
+- 1024);
++ phba->MBslimaddr + lpfc_debugfs_last_hba_slim_off, 1024);
+
+ ptr = (uint32_t *)&buffer[0];
+ off = lpfc_debugfs_last_hba_slim_off;
+@@ -426,7 +425,7 @@ lpfc_debugfs_dumpHBASlim_data(struct lpf
+ }
+
+ /**
+- * lpfc_debugfs_dumpHostSlim_data - Dump host SLIM info to a buffer.
++ * lpfc_debugfs_dumpHostSlim_data - Dump host SLIM info to a buffer
+ * @phba: The HBA to gather Host SLIM info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -501,7 +500,7 @@ lpfc_debugfs_dumpHostSlim_data(struct lp
+ }
+
+ /**
+- * lpfc_debugfs_nodelist_data - Dump target node list to a buffer.
++ * lpfc_debugfs_nodelist_data - Dump target node list to a buffer
+ * @vport: The vport to gather target node info from.
+ * @buf: The buffer to dump log into.
+ * @size: The maximum amount of data to process.
+@@ -599,7 +598,7 @@ lpfc_debugfs_nodelist_data(struct lpfc_v
+ #endif
+
+ /**
+- * lpfc_debugfs_disc_trc - Store discovery trace log.
++ * lpfc_debugfs_disc_trc - Store discovery trace log
+ * @vport: The vport to associate this trace string with for retrieval.
+ * @mask: Log entry classification.
+ * @fmt: Format string to be displayed when dumping the log.
+@@ -643,7 +642,7 @@ lpfc_debugfs_disc_trc(struct lpfc_vport
+ }
+
+ /**
+- * lpfc_debugfs_slow_ring_trc - Store slow ring trace log.
++ * lpfc_debugfs_slow_ring_trc - Store slow ring trace log
+ * @phba: The phba to associate this trace string with for retrieval.
+ * @fmt: Format string to be displayed when dumping the log.
+ * @data1: 1st data parameter to be applied to @fmt.
+@@ -682,7 +681,7 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_h
+
+ #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
+ /**
+- * lpfc_debugfs_disc_trc_open - Open the discovery trace log.
++ * lpfc_debugfs_disc_trc_open - Open the discovery trace log
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -732,7 +731,7 @@ out:
+ }
+
+ /**
+- * lpfc_debugfs_slow_ring_trc_open - Open the Slow Ring trace log.
++ * lpfc_debugfs_slow_ring_trc_open - Open the Slow Ring trace log
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -782,7 +781,7 @@ out:
+ }
+
+ /**
+- * lpfc_debugfs_hbqinfo_open - Open the hbqinfo debugfs buffer.
++ * lpfc_debugfs_hbqinfo_open - Open the hbqinfo debugfs buffer
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -824,7 +823,7 @@ out:
+ }
+
+ /**
+- * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer.
++ * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -866,7 +865,7 @@ out:
+ }
+
+ /**
+- * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer.
++ * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -993,7 +992,7 @@ lpfc_debugfs_dumpDataDif_write(struct fi
+
+
+ /**
+- * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file.
++ * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file
+ * @inode: The inode pointer that contains a vport pointer.
+ * @file: The file pointer to attach the log output.
+ *
+@@ -1035,7 +1034,7 @@ out:
+ }
+
+ /**
+- * lpfc_debugfs_lseek - Seek through a debugfs file.
++ * lpfc_debugfs_lseek - Seek through a debugfs file
+ * @file: The file pointer to seek through.
+ * @off: The offset to seek to or the amount to seek by.
+ * @whence: Indicates how to seek.
+@@ -1073,7 +1072,7 @@ lpfc_debugfs_lseek(struct file *file, lo
+ }
+
+ /**
+- * lpfc_debugfs_read - Read a debugfs file.
++ * lpfc_debugfs_read - Read a debugfs file
+ * @file: The file pointer to read from.
+ * @buf: The buffer to copy the data to.
+ * @nbytes: The number of bytes to read.
+@@ -1098,7 +1097,7 @@ lpfc_debugfs_read(struct file *file, cha
+ }
+
+ /**
+- * lpfc_debugfs_release - Release the buffer used to store debugfs file data.
++ * lpfc_debugfs_release - Release the buffer used to store debugfs file data
+ * @inode: The inode pointer that contains a vport pointer. (unused)
+ * @file: The file pointer that contains the buffer to release.
+ *
+@@ -1210,7 +1209,7 @@ static atomic_t lpfc_debugfs_hba_count;
+ #endif
+
+ /**
+- * lpfc_debugfs_initialize - Initialize debugfs for a vport.
++ * lpfc_debugfs_initialize - Initialize debugfs for a vport
+ * @vport: The vport pointer to initialize.
+ *
+ * Description:
+@@ -1434,7 +1433,7 @@ debug_failed:
+ }
+
+ /**
+- * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport.
++ * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport
+ * @vport: The vport pointer to remove from debugfs.
+ *
+ * Description:
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_disc.h linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_disc.h
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_disc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_disc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -99,6 +99,7 @@ struct lpfc_nodelist {
+ #define NLP_USG_FREE_ACK_BIT 0x8 /* Indicate ndlp memory free invoked */
+
+ struct timer_list nlp_delayfunc; /* Used for delayed ELS cmds */
++ struct lpfc_hba *phba;
+ struct fc_rport *rport; /* Corresponding FC transport
+ port structure */
+ struct lpfc_vport *vport;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_els.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_els.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_els.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_els.c 2009-05-13 09:46:19.000000000 +0200
+@@ -55,7 +55,7 @@ static void lpfc_register_new_vport(stru
+ static int lpfc_max_els_tries = 3;
+
+ /**
+- * lpfc_els_chk_latt: Check host link attention event for a vport.
++ * lpfc_els_chk_latt - Check host link attention event for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine checks whether there is an outstanding host link
+@@ -116,7 +116,7 @@ lpfc_els_chk_latt(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_prep_els_iocb: Allocate and prepare a lpfc iocb data structure.
++ * lpfc_prep_els_iocb - Allocate and prepare a lpfc iocb data structure
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @expectRsp: flag indicating whether response is expected.
+ * @cmdSize: size of the ELS command.
+@@ -290,7 +290,7 @@ els_iocb_free_pcmb_exit:
+ }
+
+ /**
+- * lpfc_issue_fabric_reglogin: Issue fabric registration login for a vport.
++ * lpfc_issue_fabric_reglogin - Issue fabric registration login for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine issues a fabric registration login for a @vport. An
+@@ -386,7 +386,7 @@ fail:
+ }
+
+ /**
+- * lpfc_cmpl_els_flogi_fabric: Completion function for flogi to a fabric port.
++ * lpfc_cmpl_els_flogi_fabric - Completion function for flogi to a fabric port
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @sp: pointer to service parameter data structure.
+@@ -509,7 +509,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_v
+ }
+
+ /**
+- * lpfc_cmpl_els_flogi_nport: Completion function for flogi to an N_Port.
++ * lpfc_cmpl_els_flogi_nport - Completion function for flogi to an N_Port
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @sp: pointer to service parameter data structure.
+@@ -626,7 +626,7 @@ fail:
+ }
+
+ /**
+- * lpfc_cmpl_els_flogi: Completion callback function for flogi.
++ * lpfc_cmpl_els_flogi - Completion callback function for flogi
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -751,7 +751,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_flogi: Issue an flogi iocb command for a vport.
++ * lpfc_issue_els_flogi - Issue an flogi iocb command for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @retry: number of retries to the command IOCB.
+@@ -849,7 +849,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_els_abort_flogi: Abort all outstanding flogi iocbs.
++ * lpfc_els_abort_flogi - Abort all outstanding flogi iocbs
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine aborts all the outstanding Fabric Login (FLOGI) IOCBs
+@@ -898,7 +898,7 @@ lpfc_els_abort_flogi(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_initial_flogi: Issue an initial fabric login for a vport.
++ * lpfc_initial_flogi - Issue an initial fabric login for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine issues an initial Fabric Login (FLOGI) for the @vport
+@@ -949,7 +949,7 @@ lpfc_initial_flogi(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_initial_fdisc: Issue an initial fabric discovery for a vport.
++ * lpfc_initial_fdisc - Issue an initial fabric discovery for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine issues an initial Fabric Discover (FDISC) for the @vport
+@@ -998,7 +998,7 @@ lpfc_initial_fdisc(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_more_plogi: Check and issue remaining plogis for a vport.
++ * lpfc_more_plogi - Check and issue remaining plogis for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine checks whether there are more remaining Port Logins
+@@ -1031,7 +1031,7 @@ lpfc_more_plogi(struct lpfc_vport *vport
+ }
+
+ /**
+- * lpfc_plogi_confirm_nport: Confirm pologi wwpn matches stored ndlp.
++ * lpfc_plogi_confirm_nport - Confirm pologi wwpn matches stored ndlp
+ * @phba: pointer to lpfc hba data structure.
+ * @prsp: pointer to response IOCB payload.
+ * @ndlp: pointer to a node-list data structure.
+@@ -1165,7 +1165,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_end_rscn: Check and handle more rscn for a vport.
++ * lpfc_end_rscn - Check and handle more rscn for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine checks whether more Registration State Change
+@@ -1197,7 +1197,7 @@ lpfc_end_rscn(struct lpfc_vport *vport)
+ }
+
+ /**
+- * lpfc_cmpl_els_plogi: Completion callback function for plogi.
++ * lpfc_cmpl_els_plogi - Completion callback function for plogi
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -1322,7 +1322,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_plogi: Issue an plogi iocb command for a vport.
++ * lpfc_issue_els_plogi - Issue an plogi iocb command for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @did: destination port identifier.
+ * @retry: number of retries to the command IOCB.
+@@ -1401,7 +1401,7 @@ lpfc_issue_els_plogi(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_cmpl_els_prli: Completion callback function for prli.
++ * lpfc_cmpl_els_prli - Completion callback function for prli
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -1472,7 +1472,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_prli: Issue a prli iocb command for a vport.
++ * lpfc_issue_els_prli - Issue a prli iocb command for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @retry: number of retries to the command IOCB.
+@@ -1562,7 +1562,7 @@ lpfc_issue_els_prli(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_rscn_disc: Perform rscn discovery for a vport.
++ * lpfc_rscn_disc - Perform rscn discovery for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine performs Registration State Change Notification (RSCN)
+@@ -1588,7 +1588,7 @@ lpfc_rscn_disc(struct lpfc_vport *vport)
+ }
+
+ /**
+- * lpfc_adisc_done: Complete the adisc phase of discovery.
++ * lpfc_adisc_done - Complete the adisc phase of discovery
+ * @vport: pointer to lpfc_vport hba data structure that finished all ADISCs.
+ *
+ * This function is called when the final ADISC is completed during discovery.
+@@ -1639,7 +1639,7 @@ lpfc_adisc_done(struct lpfc_vport *vport
+ }
+
+ /**
+- * lpfc_more_adisc: Issue more adisc as needed.
++ * lpfc_more_adisc - Issue more adisc as needed
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine determines whether there are more ndlps on a @vport
+@@ -1672,7 +1672,7 @@ lpfc_more_adisc(struct lpfc_vport *vport
+ }
+
+ /**
+- * lpfc_cmpl_els_adisc: Completion callback function for adisc.
++ * lpfc_cmpl_els_adisc - Completion callback function for adisc
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -1760,7 +1760,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_adisc: Issue an address discover iocb to an node on a vport.
++ * lpfc_issue_els_adisc - Issue an address discover iocb to an node on a vport
+ * @vport: pointer to a virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @retry: number of retries to the command IOCB.
+@@ -1833,7 +1833,7 @@ lpfc_issue_els_adisc(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_cmpl_els_logo: Completion callback function for logo.
++ * lpfc_cmpl_els_logo - Completion callback function for logo
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -1910,7 +1910,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_logo: Issue a logo to an node on a vport.
++ * lpfc_issue_els_logo - Issue a logo to an node on a vport
+ * @vport: pointer to a virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @retry: number of retries to the command IOCB.
+@@ -1991,7 +1991,7 @@ lpfc_issue_els_logo(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_cmpl_els_cmd: Completion callback function for generic els command.
++ * lpfc_cmpl_els_cmd - Completion callback function for generic els command
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -2031,7 +2031,7 @@ lpfc_cmpl_els_cmd(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_issue_els_scr: Issue a scr to an node on a vport.
++ * lpfc_issue_els_scr - Issue a scr to an node on a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @nportid: N_Port identifier to the remote node.
+ * @retry: number of retries to the command IOCB.
+@@ -2125,7 +2125,7 @@ lpfc_issue_els_scr(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_issue_els_farpr: Issue a farp to an node on a vport.
++ * lpfc_issue_els_farpr - Issue a farp to an node on a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @nportid: N_Port identifier to the remote node.
+ * @retry: number of retries to the command IOCB.
+@@ -2236,7 +2236,7 @@ lpfc_issue_els_farpr(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_cancel_retry_delay_tmo: Cancel the timer with delayed iocb-cmd retry.
++ * lpfc_cancel_retry_delay_tmo - Cancel the timer with delayed iocb-cmd retry
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @nlp: pointer to a node-list data structure.
+ *
+@@ -2291,7 +2291,7 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_
+ }
+
+ /**
+- * lpfc_els_retry_delay: Timer function with a ndlp delayed function timer.
++ * lpfc_els_retry_delay - Timer function with a ndlp delayed function timer
+ * @ptr: holder for the pointer to the timer function associated data (ndlp).
+ *
+ * This routine is invoked by the ndlp delayed-function timer to check
+@@ -2333,7 +2333,7 @@ lpfc_els_retry_delay(unsigned long ptr)
+ }
+
+ /**
+- * lpfc_els_retry_delay_handler: Work thread handler for ndlp delayed function.
++ * lpfc_els_retry_delay_handler - Work thread handler for ndlp delayed function
+ * @ndlp: pointer to a node-list data structure.
+ *
+ * This routine is the worker-thread handler for processing the @ndlp delayed
+@@ -2404,7 +2404,7 @@ lpfc_els_retry_delay_handler(struct lpfc
+ }
+
+ /**
+- * lpfc_els_retry: Make retry decision on an els command iocb.
++ * lpfc_els_retry - Make retry decision on an els command iocb
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -2732,7 +2732,7 @@ lpfc_els_retry(struct lpfc_hba *phba, st
+ }
+
+ /**
+- * lpfc_els_free_data: Free lpfc dma buffer and data structure with an iocb.
++ * lpfc_els_free_data - Free lpfc dma buffer and data structure with an iocb
+ * @phba: pointer to lpfc hba data structure.
+ * @buf_ptr1: pointer to the lpfc DMA buffer data structure.
+ *
+@@ -2764,7 +2764,7 @@ lpfc_els_free_data(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_els_free_bpl: Free lpfc dma buffer and data structure with bpl.
++ * lpfc_els_free_bpl - Free lpfc dma buffer and data structure with bpl
+ * @phba: pointer to lpfc hba data structure.
+ * @buf_ptr: pointer to the lpfc dma buffer data structure.
+ *
+@@ -2784,7 +2784,7 @@ lpfc_els_free_bpl(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_els_free_iocb: Free a command iocb and its associated resources.
++ * lpfc_els_free_iocb - Free a command iocb and its associated resources
+ * @phba: pointer to lpfc hba data structure.
+ * @elsiocb: pointer to lpfc els command iocb data structure.
+ *
+@@ -2877,7 +2877,7 @@ lpfc_els_free_iocb(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_cmpl_els_logo_acc: Completion callback function to logo acc response.
++ * lpfc_cmpl_els_logo_acc - Completion callback function to logo acc response
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -2931,7 +2931,7 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_mbx_cmpl_dflt_rpi: Completion callbk func for unreg dflt rpi mbox cmd.
++ * lpfc_mbx_cmpl_dflt_rpi - Completion callbk func for unreg dflt rpi mbox cmd
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -2965,7 +2965,7 @@ lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_cmpl_els_rsp: Completion callback function for els response iocb cmd.
++ * lpfc_cmpl_els_rsp - Completion callback function for els response iocb cmd
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -3136,7 +3136,7 @@ out:
+ }
+
+ /**
+- * lpfc_els_rsp_acc: Prepare and issue an acc response iocb command.
++ * lpfc_els_rsp_acc - Prepare and issue an acc response iocb command
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @flag: the els command code to be accepted.
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+@@ -3275,7 +3275,7 @@ lpfc_els_rsp_acc(struct lpfc_vport *vpor
+ }
+
+ /**
+- * lpfc_els_rsp_reject: Propare and issue a rjt response iocb command.
++ * lpfc_els_rsp_reject - Propare and issue a rjt response iocb command
+ * @vport: pointer to a virtual N_Port data structure.
+ * @rejectError:
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+@@ -3356,7 +3356,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_els_rsp_adisc_acc: Prepare and issue acc response to adisc iocb cmd.
++ * lpfc_els_rsp_adisc_acc - Prepare and issue acc response to adisc iocb cmd
+ * @vport: pointer to a virtual N_Port data structure.
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -3431,7 +3431,7 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport
+ }
+
+ /**
+- * lpfc_els_rsp_prli_acc: Prepare and issue acc response to prli iocb cmd.
++ * lpfc_els_rsp_prli_acc - Prepare and issue acc response to prli iocb cmd
+ * @vport: pointer to a virtual N_Port data structure.
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -3529,7 +3529,7 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport
+ }
+
+ /**
+- * lpfc_els_rsp_rnid_acc: Issue rnid acc response iocb command.
++ * lpfc_els_rsp_rnid_acc - Issue rnid acc response iocb command
+ * @vport: pointer to a virtual N_Port data structure.
+ * @format: rnid command format.
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+@@ -3635,7 +3635,7 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport
+ }
+
+ /**
+- * lpfc_els_disc_adisc: Issue remaining adisc iocbs to npr nodes of a vport.
++ * lpfc_els_disc_adisc - Issue remaining adisc iocbs to npr nodes of a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine issues Address Discover (ADISC) ELS commands to those
+@@ -3693,7 +3693,7 @@ lpfc_els_disc_adisc(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_els_disc_plogi: Issue plogi for all npr nodes of a vport before adisc.
++ * lpfc_els_disc_plogi - Issue plogi for all npr nodes of a vport before adisc
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine issues Port Login (PLOGI) ELS commands to all the N_Ports
+@@ -3752,7 +3752,7 @@ lpfc_els_disc_plogi(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_els_flush_rscn: Clean up any rscn activities with a vport.
++ * lpfc_els_flush_rscn - Clean up any rscn activities with a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine cleans up any Registration State Change Notification
+@@ -3791,7 +3791,7 @@ lpfc_els_flush_rscn(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_rscn_payload_check: Check whether there is a pending rscn to a did.
++ * lpfc_rscn_payload_check - Check whether there is a pending rscn to a did
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @did: remote destination port identifier.
+ *
+@@ -3866,7 +3866,7 @@ return_did_out:
+ }
+
+ /**
+- * lpfc_rscn_recovery_check: Send recovery event to vport nodes matching rscn
++ * lpfc_rscn_recovery_check - Send recovery event to vport nodes matching rscn
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine sends recovery (NLP_EVT_DEVICE_RECOVERY) event to the
+@@ -3895,7 +3895,7 @@ lpfc_rscn_recovery_check(struct lpfc_vpo
+ }
+
+ /**
+- * lpfc_send_rscn_event: Send an RSCN event to management application.
++ * lpfc_send_rscn_event - Send an RSCN event to management application
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ *
+@@ -3938,7 +3938,7 @@ lpfc_send_rscn_event(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_els_rcv_rscn: Process an unsolicited rscn iocb.
++ * lpfc_els_rcv_rscn - Process an unsolicited rscn iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4134,7 +4134,7 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_els_handle_rscn: Handle rscn for a vport.
++ * lpfc_els_handle_rscn - Handle rscn for a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine handles the Registration State Configuration Notification
+@@ -4222,7 +4222,7 @@ lpfc_els_handle_rscn(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_els_rcv_flogi: Process an unsolicited flogi iocb.
++ * lpfc_els_rcv_flogi - Process an unsolicited flogi iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4336,7 +4336,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_els_rcv_rnid: Process an unsolicited rnid iocb.
++ * lpfc_els_rcv_rnid - Process an unsolicited rnid iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4391,7 +4391,7 @@ lpfc_els_rcv_rnid(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_els_rcv_lirr: Process an unsolicited lirr iocb.
++ * lpfc_els_rcv_lirr - Process an unsolicited lirr iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4419,7 +4419,7 @@ lpfc_els_rcv_lirr(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_els_rsp_rps_acc: Completion callbk func for MBX_READ_LNK_STAT mbox cmd.
++ * lpfc_els_rsp_rps_acc - Completion callbk func for MBX_READ_LNK_STAT mbox cmd
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -4513,7 +4513,7 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_els_rcv_rps: Process an unsolicited rps iocb.
++ * lpfc_els_rcv_rps - Process an unsolicited rps iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4590,7 +4590,7 @@ reject_out:
+ }
+
+ /**
+- * lpfc_els_rsp_rpl_acc: Issue an accept rpl els command.
++ * lpfc_els_rsp_rpl_acc - Issue an accept rpl els command
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdsize: size of the ELS command.
+ * @oldiocb: pointer to the original lpfc command iocb data structure.
+@@ -4662,7 +4662,7 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_els_rcv_rpl: Process an unsolicited rpl iocb.
++ * lpfc_els_rcv_rpl - Process an unsolicited rpl iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4721,7 +4721,7 @@ lpfc_els_rcv_rpl(struct lpfc_vport *vpor
+ }
+
+ /**
+- * lpfc_els_rcv_farp: Process an unsolicited farp request els command.
++ * lpfc_els_rcv_farp - Process an unsolicited farp request els command
+ * @vport: pointer to a virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4804,7 +4804,7 @@ lpfc_els_rcv_farp(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_els_rcv_farpr: Process an unsolicited farp response iocb.
++ * lpfc_els_rcv_farpr - Process an unsolicited farp response iocb
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -4842,7 +4842,7 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vp
+ }
+
+ /**
+- * lpfc_els_rcv_fan: Process an unsolicited fan iocb command.
++ * lpfc_els_rcv_fan - Process an unsolicited fan iocb command
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @fan_ndlp: pointer to a node-list data structure.
+@@ -4890,7 +4890,7 @@ lpfc_els_rcv_fan(struct lpfc_vport *vpor
+ }
+
+ /**
+- * lpfc_els_timeout: Handler funciton to the els timer.
++ * lpfc_els_timeout - Handler funciton to the els timer
+ * @ptr: holder for the timer function associated data.
+ *
+ * This routine is invoked by the ELS timer after timeout. It posts the ELS
+@@ -4919,7 +4919,7 @@ lpfc_els_timeout(unsigned long ptr)
+ }
+
+ /**
+- * lpfc_els_timeout_handler: Process an els timeout event.
++ * lpfc_els_timeout_handler - Process an els timeout event
+ * @vport: pointer to a virtual N_Port data structure.
+ *
+ * This routine is the actual handler function that processes an ELS timeout
+@@ -4994,7 +4994,7 @@ lpfc_els_timeout_handler(struct lpfc_vpo
+ }
+
+ /**
+- * lpfc_els_flush_cmd: Clean up the outstanding els commands to a vport.
++ * lpfc_els_flush_cmd - Clean up the outstanding els commands to a vport
+ * @vport: pointer to a host virtual N_Port data structure.
+ *
+ * This routine is used to clean up all the outstanding ELS commands on a
+@@ -5058,25 +5058,15 @@ lpfc_els_flush_cmd(struct lpfc_vport *vp
+ }
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- piocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- cmd = &piocb->iocb;
+- list_del_init(&piocb->list);
+-
+- if (!piocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, piocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (piocb->iocb_cmpl) (phba, piocb, piocb);
+- }
+- }
++ /* Cancell all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+
+ return;
+ }
+
+ /**
+- * lpfc_els_flush_all_cmd: Clean up all the outstanding els commands to a HBA.
++ * lpfc_els_flush_all_cmd - Clean up all the outstanding els commands to a HBA
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is used to clean up all the outstanding ELS commands on a
+@@ -5121,23 +5111,16 @@ lpfc_els_flush_all_cmd(struct lpfc_hba
+ lpfc_sli_issue_abort_iotag(phba, pring, piocb);
+ }
+ spin_unlock_irq(&phba->hbalock);
+- while (!list_empty(&completions)) {
+- piocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- cmd = &piocb->iocb;
+- list_del_init(&piocb->list);
+- if (!piocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, piocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (piocb->iocb_cmpl) (phba, piocb, piocb);
+- }
+- }
++
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
++
+ return;
+ }
+
+ /**
+- * lpfc_send_els_failure_event: Posts an ELS command failure event.
++ * lpfc_send_els_failure_event - Posts an ELS command failure event
+ * @phba: Pointer to hba context object.
+ * @cmdiocbp: Pointer to command iocb which reported error.
+ * @rspiocbp: Pointer to response iocb which reported error.
+@@ -5204,7 +5187,7 @@ lpfc_send_els_failure_event(struct lpfc_
+ }
+
+ /**
+- * lpfc_send_els_event: Posts unsolicited els event.
++ * lpfc_send_els_event - Posts unsolicited els event
+ * @vport: Pointer to vport object.
+ * @ndlp: Pointer FC node object.
+ * @cmd: ELS command code.
+@@ -5284,7 +5267,7 @@ lpfc_send_els_event(struct lpfc_vport *v
+
+
+ /**
+- * lpfc_els_unsol_buffer: Process an unsolicited event data buffer.
++ * lpfc_els_unsol_buffer - Process an unsolicited event data buffer
+ * @phba: pointer to lpfc hba data structure.
+ * @pring: pointer to a SLI ring.
+ * @vport: pointer to a host virtual N_Port data structure.
+@@ -5592,7 +5575,7 @@ dropit:
+ }
+
+ /**
+- * lpfc_find_vport_by_vpid: Find a vport on a HBA through vport identifier.
++ * lpfc_find_vport_by_vpid - Find a vport on a HBA through vport identifier
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: host virtual N_Port identifier.
+ *
+@@ -5622,7 +5605,7 @@ lpfc_find_vport_by_vpid(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_els_unsol_event: Process an unsolicited event from an els sli ring.
++ * lpfc_els_unsol_event - Process an unsolicited event from an els sli ring
+ * @phba: pointer to lpfc hba data structure.
+ * @pring: pointer to a SLI ring.
+ * @elsiocb: pointer to lpfc els iocb data structure.
+@@ -5710,7 +5693,7 @@ lpfc_els_unsol_event(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_do_scr_ns_plogi: Issue a plogi to the name server for scr.
++ * lpfc_do_scr_ns_plogi - Issue a plogi to the name server for scr
+ * @phba: pointer to lpfc hba data structure.
+ * @vport: pointer to a virtual N_Port data structure.
+ *
+@@ -5781,7 +5764,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_cmpl_reg_new_vport: Completion callback function to register new vport.
++ * lpfc_cmpl_reg_new_vport - Completion callback function to register new vport
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -5850,7 +5833,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_register_new_vport: Register a new vport with a HBA.
++ * lpfc_register_new_vport - Register a new vport with a HBA
+ * @phba: pointer to lpfc hba data structure.
+ * @vport: pointer to a host virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+@@ -5899,7 +5882,7 @@ mbox_err_exit:
+ }
+
+ /**
+- * lpfc_cmpl_els_fdisc: Completion function for fdisc iocb command.
++ * lpfc_cmpl_els_fdisc - Completion function for fdisc iocb command
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -6007,7 +5990,7 @@ out:
+ }
+
+ /**
+- * lpfc_issue_els_fdisc: Issue a fdisc iocb command.
++ * lpfc_issue_els_fdisc - Issue a fdisc iocb command
+ * @vport: pointer to a virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ * @retry: number of retries to the command IOCB.
+@@ -6101,7 +6084,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport *
+ }
+
+ /**
+- * lpfc_cmpl_els_npiv_logo: Completion function with vport logo.
++ * lpfc_cmpl_els_npiv_logo - Completion function with vport logo
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -6136,7 +6119,7 @@ lpfc_cmpl_els_npiv_logo(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_issue_els_npiv_logo: Issue a logo off a vport.
++ * lpfc_issue_els_npiv_logo - Issue a logo off a vport
+ * @vport: pointer to a virtual N_Port data structure.
+ * @ndlp: pointer to a node-list data structure.
+ *
+@@ -6197,7 +6180,7 @@ lpfc_issue_els_npiv_logo(struct lpfc_vpo
+ }
+
+ /**
+- * lpfc_fabric_block_timeout: Handler function to the fabric block timer.
++ * lpfc_fabric_block_timeout - Handler function to the fabric block timer
+ * @ptr: holder for the timer function associated data.
+ *
+ * This routine is invoked by the fabric iocb block timer after
+@@ -6226,7 +6209,7 @@ lpfc_fabric_block_timeout(unsigned long
+ }
+
+ /**
+- * lpfc_resume_fabric_iocbs: Issue a fabric iocb from driver internal list.
++ * lpfc_resume_fabric_iocbs - Issue a fabric iocb from driver internal list
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine issues one fabric iocb from the driver internal list to
+@@ -6285,7 +6268,7 @@ repeat:
+ }
+
+ /**
+- * lpfc_unblock_fabric_iocbs: Unblock issuing fabric iocb command.
++ * lpfc_unblock_fabric_iocbs - Unblock issuing fabric iocb command
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine unblocks the issuing fabric iocb command. The function
+@@ -6303,7 +6286,7 @@ lpfc_unblock_fabric_iocbs(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_block_fabric_iocbs: Block issuing fabric iocb command.
++ * lpfc_block_fabric_iocbs - Block issuing fabric iocb command
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine blocks the issuing fabric iocb for a specified amount of
+@@ -6325,7 +6308,7 @@ lpfc_block_fabric_iocbs(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_cmpl_fabric_iocb: Completion callback function for fabric iocb.
++ * lpfc_cmpl_fabric_iocb - Completion callback function for fabric iocb
+ * @phba: pointer to lpfc hba data structure.
+ * @cmdiocb: pointer to lpfc command iocb data structure.
+ * @rspiocb: pointer to lpfc response iocb data structure.
+@@ -6384,7 +6367,7 @@ lpfc_cmpl_fabric_iocb(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_issue_fabric_iocb: Issue a fabric iocb command.
++ * lpfc_issue_fabric_iocb - Issue a fabric iocb command
+ * @phba: pointer to lpfc hba data structure.
+ * @iocb: pointer to lpfc command iocb data structure.
+ *
+@@ -6453,7 +6436,7 @@ lpfc_issue_fabric_iocb(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_fabric_abort_vport: Abort a vport's iocbs from driver fabric iocb list.
++ * lpfc_fabric_abort_vport - Abort a vport's iocbs from driver fabric iocb list
+ * @vport: pointer to a virtual N_Port data structure.
+ *
+ * This routine aborts all the IOCBs associated with a @vport from the
+@@ -6468,7 +6451,6 @@ static void lpfc_fabric_abort_vport(stru
+ LIST_HEAD(completions);
+ struct lpfc_hba *phba = vport->phba;
+ struct lpfc_iocbq *tmp_iocb, *piocb;
+- IOCB_t *cmd;
+
+ spin_lock_irq(&phba->hbalock);
+ list_for_each_entry_safe(piocb, tmp_iocb, &phba->fabric_iocb_list,
+@@ -6481,19 +6463,13 @@ static void lpfc_fabric_abort_vport(stru
+ }
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- piocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- list_del_init(&piocb->list);
+-
+- cmd = &piocb->iocb;
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (piocb->iocb_cmpl) (phba, piocb, piocb);
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+ }
+
+ /**
+- * lpfc_fabric_abort_nport: Abort a ndlp's iocbs from driver fabric iocb list.
++ * lpfc_fabric_abort_nport - Abort a ndlp's iocbs from driver fabric iocb list
+ * @ndlp: pointer to a node-list data structure.
+ *
+ * This routine aborts all the IOCBs associated with an @ndlp from the
+@@ -6506,10 +6482,9 @@ static void lpfc_fabric_abort_vport(stru
+ void lpfc_fabric_abort_nport(struct lpfc_nodelist *ndlp)
+ {
+ LIST_HEAD(completions);
+- struct lpfc_hba *phba = ndlp->vport->phba;
++ struct lpfc_hba *phba = ndlp->phba;
+ struct lpfc_iocbq *tmp_iocb, *piocb;
+ struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
+- IOCB_t *cmd;
+
+ spin_lock_irq(&phba->hbalock);
+ list_for_each_entry_safe(piocb, tmp_iocb, &phba->fabric_iocb_list,
+@@ -6521,19 +6496,13 @@ void lpfc_fabric_abort_nport(struct lpfc
+ }
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- piocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- list_del_init(&piocb->list);
+-
+- cmd = &piocb->iocb;
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (piocb->iocb_cmpl) (phba, piocb, piocb);
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+ }
+
+ /**
+- * lpfc_fabric_abort_hba: Abort all iocbs on driver fabric iocb list.
++ * lpfc_fabric_abort_hba - Abort all iocbs on driver fabric iocb list
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine aborts all the IOCBs currently on the driver internal
+@@ -6546,20 +6515,12 @@ void lpfc_fabric_abort_nport(struct lpfc
+ void lpfc_fabric_abort_hba(struct lpfc_hba *phba)
+ {
+ LIST_HEAD(completions);
+- struct lpfc_iocbq *piocb;
+- IOCB_t *cmd;
+
+ spin_lock_irq(&phba->hbalock);
+ list_splice_init(&phba->fabric_iocb_list, &completions);
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- piocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- list_del_init(&piocb->list);
+-
+- cmd = &piocb->iocb;
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (piocb->iocb_cmpl) (phba, piocb, piocb);
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc.h linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc.h
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -443,6 +443,7 @@ struct lpfc_hba {
+ uint32_t hba_flag; /* hba generic flags */
+ #define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
+
++#define DEFER_ERATT 0x4 /* Deferred error attention in progress */
+ struct lpfc_dmabuf slim2p;
+
+ MAILBOX_t *mbox;
+@@ -723,4 +724,3 @@ lpfc_sli_read_hs(struct lpfc_hba *phba)
+
+ return;
+ }
+-
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_hbadisc.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_hbadisc.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -78,7 +78,7 @@ lpfc_terminate_rport_io(struct fc_rport
+ return;
+ }
+
+- phba = ndlp->vport->phba;
++ phba = ndlp->phba;
+
+ lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_RPORT,
+ "rport terminate: sid:x%x did:x%x flg:x%x",
+@@ -276,7 +276,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_no
+ }
+
+ /**
+- * lpfc_alloc_fast_evt: Allocates data structure for posting event.
++ * lpfc_alloc_fast_evt - Allocates data structure for posting event
+ * @phba: Pointer to hba context object.
+ *
+ * This function is called from the functions which need to post
+@@ -303,7 +303,7 @@ lpfc_alloc_fast_evt(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_free_fast_evt: Frees event data structure.
++ * lpfc_free_fast_evt - Frees event data structure
+ * @phba: Pointer to hba context object.
+ * @evt: Event object which need to be freed.
+ *
+@@ -319,7 +319,7 @@ lpfc_free_fast_evt(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_send_fastpath_evt: Posts events generated from fast path.
++ * lpfc_send_fastpath_evt - Posts events generated from fast path
+ * @phba: Pointer to hba context object.
+ * @evtp: Event data structure.
+ *
+@@ -1858,13 +1858,18 @@ lpfc_disable_node(struct lpfc_vport *vpo
+ NLP_STE_UNUSED_NODE);
+ }
+ /**
+- * lpfc_initialize_node: Initialize all fields of node object.
++ * lpfc_initialize_node - Initialize all fields of node object
+ * @vport: Pointer to Virtual Port object.
+ * @ndlp: Pointer to FC node object.
+ * @did: FC_ID of the node.
+- * This function is always called when node object need to
+- * be initialized. It initializes all the fields of the node
+- * object.
++ *
++ * This function is always called when node object need to be initialized.
++ * It initializes all the fields of the node object. Although the reference
++ * to phba from @ndlp can be obtained indirectly through it's reference to
++ * @vport, a direct reference to phba is taken here by @ndlp. This is due
++ * to the life-span of the @ndlp might go beyond the existence of @vport as
++ * the final release of ndlp is determined by its reference count. And, the
++ * operation on @ndlp needs the reference to phba.
+ **/
+ static inline void
+ lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
+@@ -1877,6 +1882,7 @@ lpfc_initialize_node(struct lpfc_vport *
+ ndlp->nlp_delayfunc.data = (unsigned long)ndlp;
+ ndlp->nlp_DID = did;
+ ndlp->vport = vport;
++ ndlp->phba = vport->phba;
+ ndlp->nlp_sid = NLP_NO_SID;
+ kref_init(&ndlp->kref);
+ NLP_INT_NODE_ACT(ndlp);
+@@ -2086,7 +2092,6 @@ lpfc_no_rpi(struct lpfc_hba *phba, struc
+ struct lpfc_sli *psli;
+ struct lpfc_sli_ring *pring;
+ struct lpfc_iocbq *iocb, *next_iocb;
+- IOCB_t *icmd;
+ uint32_t rpi, i;
+
+ lpfc_fabric_abort_nport(ndlp);
+@@ -2122,19 +2127,9 @@ lpfc_no_rpi(struct lpfc_hba *phba, struc
+ }
+ }
+
+- while (!list_empty(&completions)) {
+- iocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- icmd = &iocb->iocb;
+- icmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- icmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (iocb->iocb_cmpl)(phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+
+ return 0;
+ }
+@@ -2186,9 +2181,13 @@ lpfc_unreg_all_rpis(struct lpfc_vport *v
+ mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
+ mbox->context1 = NULL;
+ rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
+- if (rc == MBX_NOT_FINISHED) {
++ if (rc != MBX_TIMEOUT)
+ mempool_free(mbox, phba->mbox_mem_pool);
+- }
++
++ if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
++ lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
++ "1836 Could not issue "
++ "unreg_login(all_rpis) status %d\n", rc);
+ }
+ }
+
+@@ -2206,12 +2205,14 @@ lpfc_unreg_default_rpis(struct lpfc_vpor
+ mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
+ mbox->context1 = NULL;
+ rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
+- if (rc == MBX_NOT_FINISHED) {
++ if (rc != MBX_TIMEOUT)
++ mempool_free(mbox, phba->mbox_mem_pool);
++
++ if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
+ "1815 Could not issue "
+- "unreg_did (default rpis)\n");
+- mempool_free(mbox, phba->mbox_mem_pool);
+- }
++ "unreg_did (default rpis) status %d\n",
++ rc);
+ }
+ }
+
+@@ -2470,14 +2471,13 @@ lpfc_setup_disc_node(struct lpfc_vport *
+ if (ndlp->nlp_flag & NLP_RCV_PLOGI)
+ return NULL;
+
+- spin_lock_irq(shost->host_lock);
+- ndlp->nlp_flag |= NLP_NPR_2B_DISC;
+- spin_unlock_irq(shost->host_lock);
+-
+ /* Since this node is marked for discovery,
+ * delay timeout is not needed.
+ */
+ lpfc_cancel_retry_delay_tmo(vport, ndlp);
++ spin_lock_irq(shost->host_lock);
++ ndlp->nlp_flag |= NLP_NPR_2B_DISC;
++ spin_unlock_irq(shost->host_lock);
+ } else
+ ndlp = NULL;
+ } else {
+@@ -2740,19 +2740,9 @@ lpfc_free_tx(struct lpfc_hba *phba, stru
+ }
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- iocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- icmd = &iocb->iocb;
+- icmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- icmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+ }
+
+ static void
+@@ -3173,7 +3163,7 @@ lpfc_nlp_release(struct kref *kref)
+ lpfc_nlp_remove(ndlp->vport, ndlp);
+
+ /* clear the ndlp active flag for all release cases */
+- phba = ndlp->vport->phba;
++ phba = ndlp->phba;
+ spin_lock_irqsave(&phba->ndlp_lock, flags);
+ NLP_CLR_NODE_ACT(ndlp);
+ spin_unlock_irqrestore(&phba->ndlp_lock, flags);
+@@ -3181,7 +3171,7 @@ lpfc_nlp_release(struct kref *kref)
+ /* free ndlp memory for final ndlp release */
+ if (NLP_CHK_FREE_REQ(ndlp)) {
+ kfree(ndlp->lat_data);
+- mempool_free(ndlp, ndlp->vport->phba->nlp_mem_pool);
++ mempool_free(ndlp, ndlp->phba->nlp_mem_pool);
+ }
+ }
+
+@@ -3204,7 +3194,7 @@ lpfc_nlp_get(struct lpfc_nodelist *ndlp)
+ * ndlp reference count that is in the process of being
+ * released.
+ */
+- phba = ndlp->vport->phba;
++ phba = ndlp->phba;
+ spin_lock_irqsave(&phba->ndlp_lock, flags);
+ if (!NLP_CHK_NODE_ACT(ndlp) || NLP_CHK_FREE_ACK(ndlp)) {
+ spin_unlock_irqrestore(&phba->ndlp_lock, flags);
+@@ -3240,7 +3230,7 @@ lpfc_nlp_put(struct lpfc_nodelist *ndlp)
+ "node put: did:x%x flg:x%x refcnt:x%x",
+ ndlp->nlp_DID, ndlp->nlp_flag,
+ atomic_read(&ndlp->kref.refcount));
+- phba = ndlp->vport->phba;
++ phba = ndlp->phba;
+ spin_lock_irqsave(&phba->ndlp_lock, flags);
+ /* Check the ndlp memory free acknowledge flag to avoid the
+ * possible race condition that kref_put got invoked again
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_init.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_init.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_init.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_init.c 2009-05-13 09:46:19.000000000 +0200
+@@ -60,7 +60,7 @@ static struct scsi_transport_template *l
+ static DEFINE_IDR(lpfc_hba_index);
+
+ /**
+- * lpfc_config_port_prep: Perform lpfc initialization prior to config port.
++ * lpfc_config_port_prep - Perform lpfc initialization prior to config port
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine will do LPFC initialization prior to issuing the CONFIG_PORT
+@@ -221,7 +221,7 @@ out_free_mbox:
+ }
+
+ /**
+- * lpfc_config_async_cmpl: Completion handler for config async event mbox cmd.
++ * lpfc_config_async_cmpl - Completion handler for config async event mbox cmd
+ * @phba: pointer to lpfc hba data structure.
+ * @pmboxq: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -242,8 +242,7 @@ lpfc_config_async_cmpl(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_dump_wakeup_param_cmpl: Completion handler for dump memory mailbox
+- * command used for getting wake up parameters.
++ * lpfc_dump_wakeup_param_cmpl - dump memory mailbox command completion handler
+ * @phba: pointer to lpfc hba data structure.
+ * @pmboxq: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -287,7 +286,7 @@ lpfc_dump_wakeup_param_cmpl(struct lpfc_
+ }
+
+ /**
+- * lpfc_config_port_post: Perform lpfc initialization after config port.
++ * lpfc_config_port_post - Perform lpfc initialization after config port
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine will do LPFC initialization after the CONFIG_PORT mailbox
+@@ -303,6 +302,7 @@ int
+ lpfc_config_port_post(struct lpfc_hba *phba)
+ {
+ struct lpfc_vport *vport = phba->pport;
++ struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
+ LPFC_MBOXQ_t *pmb;
+ MAILBOX_t *mb;
+ struct lpfc_dmabuf *mp;
+@@ -360,6 +360,11 @@ lpfc_config_port_post(struct lpfc_hba *p
+ sizeof (struct lpfc_name));
+ memcpy(&vport->fc_portname, &vport->fc_sparam.portName,
+ sizeof (struct lpfc_name));
++
++ /* Update the fc_host data structures with new wwn. */
++ fc_host_node_name(shost) = wwn_to_u64(vport->fc_nodename.u.wwn);
++ fc_host_port_name(shost) = wwn_to_u64(vport->fc_portname.u.wwn);
++
+ /* If no serial number in VPD data, use low 6 bytes of WWNN */
+ /* This should be consolidated into parse_vpd ? - mr */
+ if (phba->SerialNumber[0] == 0) {
+@@ -551,7 +556,7 @@ lpfc_config_port_post(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_hba_down_prep: Perform lpfc uninitialization prior to HBA reset.
++ * lpfc_hba_down_prep - Perform lpfc uninitialization prior to HBA reset
+ * @phba: pointer to lpfc HBA data structure.
+ *
+ * This routine will do LPFC uninitialization before the HBA is reset when
+@@ -583,7 +588,7 @@ lpfc_hba_down_prep(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_hba_down_post: Perform lpfc uninitialization after HBA reset.
++ * lpfc_hba_down_post - Perform lpfc uninitialization after HBA reset
+ * @phba: pointer to lpfc HBA data structure.
+ *
+ * This routine will do uninitialization after the HBA is reset when bring
+@@ -599,8 +604,6 @@ lpfc_hba_down_post(struct lpfc_hba *phba
+ struct lpfc_sli *psli = &phba->sli;
+ struct lpfc_sli_ring *pring;
+ struct lpfc_dmabuf *mp, *next_mp;
+- struct lpfc_iocbq *iocb;
+- IOCB_t *cmd = NULL;
+ LIST_HEAD(completions);
+ int i;
+
+@@ -628,20 +631,9 @@ lpfc_hba_down_post(struct lpfc_hba *phba
+ pring->txcmplq_cnt = 0;
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- iocb = list_get_first(&completions, struct lpfc_iocbq,
+- list);
+- cmd = &iocb->iocb;
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+
+ lpfc_sli_abort_iocb_ring(phba, pring);
+ spin_lock_irq(&phba->hbalock);
+@@ -652,7 +644,7 @@ lpfc_hba_down_post(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_hb_timeout: The HBA-timer timeout handler.
++ * lpfc_hb_timeout - The HBA-timer timeout handler
+ * @ptr: unsigned long holds the pointer to lpfc hba data structure.
+ *
+ * This is the HBA-timer timeout handler registered to the lpfc driver. When
+@@ -686,7 +678,7 @@ lpfc_hb_timeout(unsigned long ptr)
+ }
+
+ /**
+- * lpfc_hb_mbox_cmpl: The lpfc heart-beat mailbox command callback function.
++ * lpfc_hb_mbox_cmpl - The lpfc heart-beat mailbox command callback function
+ * @phba: pointer to lpfc hba data structure.
+ * @pmboxq: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -721,7 +713,7 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba
+ }
+
+ /**
+- * lpfc_hb_timeout_handler: The HBA-timer timeout handler.
++ * lpfc_hb_timeout_handler - The HBA-timer timeout handler
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This is the actual HBA-timer timeout handler to be invoked by the worker
+@@ -830,7 +822,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_offline_eratt: Bring lpfc offline on hardware error attention.
++ * lpfc_offline_eratt - Bring lpfc offline on hardware error attention
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is called to bring the HBA offline when HBA hardware error
+@@ -857,7 +849,73 @@ lpfc_offline_eratt(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_handle_eratt: The HBA hardware error handler.
++ * lpfc_handle_deferred_eratt - The HBA hardware deferred error handler
++ * @phba: pointer to lpfc hba data structure.
++ *
++ * This routine is invoked to handle the deferred HBA hardware error
++ * conditions. This type of error is indicated by HBA by setting ER1
++ * and another ER bit in the host status register. The driver will
++ * wait until the ER1 bit clears before handling the error condition.
++ **/
++static void
++lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
++{
++ uint32_t old_host_status = phba->work_hs;
++ struct lpfc_sli_ring *pring;
++ struct lpfc_sli *psli = &phba->sli;
++
++ lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
++ "0479 Deferred Adapter Hardware Error "
++ "Data: x%x x%x x%x\n",
++ phba->work_hs,
++ phba->work_status[0], phba->work_status[1]);
++
++ spin_lock_irq(&phba->hbalock);
++ psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
++ spin_unlock_irq(&phba->hbalock);
++
++
++ /*
++ * Firmware stops when it triggred erratt. That could cause the I/Os
++ * dropped by the firmware. Error iocb (I/O) on txcmplq and let the
++ * SCSI layer retry it after re-establishing link.
++ */
++ pring = &psli->ring[psli->fcp_ring];
++ lpfc_sli_abort_iocb_ring(phba, pring);
++
++ /*
++ * There was a firmware error. Take the hba offline and then
++ * attempt to restart it.
++ */
++ lpfc_offline_prep(phba);
++ lpfc_offline(phba);
++
++ /* Wait for the ER1 bit to clear.*/
++ while (phba->work_hs & HS_FFER1) {
++ msleep(100);
++ phba->work_hs = readl(phba->HSregaddr);
++ /* If driver is unloading let the worker thread continue */
++ if (phba->pport->load_flag & FC_UNLOADING) {
++ phba->work_hs = 0;
++ break;
++ }
++ }
++
++ /*
++ * This is to ptrotect against a race condition in which
++ * first write to the host attention register clear the
++ * host status register.
++ */
++ if ((!phba->work_hs) && (!(phba->pport->load_flag & FC_UNLOADING)))
++ phba->work_hs = old_host_status & ~HS_FFER1;
++
++ phba->hba_flag &= ~DEFER_ERATT;
++ phba->work_status[0] = readl(phba->MBslimaddr + 0xa8);
++ phba->work_status[1] = readl(phba->MBslimaddr + 0xac);
++}
++
++/**
++ * lpfc_handle_eratt - The HBA hardware error handler
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to handle the following HBA hardware error
+@@ -895,6 +953,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
+ (char *) &board_event,
+ LPFC_NL_VENDOR_ID);
+
++ if (phba->hba_flag & DEFER_ERATT)
++ lpfc_handle_deferred_eratt(phba);
++
+ if (phba->work_hs & HS_FFER6) {
+ /* Re-establishing Link */
+ lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
+@@ -976,7 +1037,7 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_handle_latt: The HBA link event handler.
++ * lpfc_handle_latt - The HBA link event handler
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked from the worker thread to handle a HBA host
+@@ -1063,7 +1124,7 @@ lpfc_handle_latt_err_exit:
+ }
+
+ /**
+- * lpfc_parse_vpd: Parse VPD (Vital Product Data).
++ * lpfc_parse_vpd - Parse VPD (Vital Product Data)
+ * @phba: pointer to lpfc hba data structure.
+ * @vpd: pointer to the vital product data.
+ * @len: length of the vital product data in bytes.
+@@ -1213,7 +1274,7 @@ lpfc_parse_vpd(struct lpfc_hba *phba, ui
+ }
+
+ /**
+- * lpfc_get_hba_model_desc: Retrieve HBA device model name and description.
++ * lpfc_get_hba_model_desc - Retrieve HBA device model name and description
+ * @phba: pointer to lpfc hba data structure.
+ * @mdp: pointer to the data structure to hold the derived model name.
+ * @descp: pointer to the data structure to hold the derived description.
+@@ -1322,7 +1383,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba
+ m = (typeof(m)){"LPe11000", max_speed, "PCIe"};
+ break;
+ case PCI_DEVICE_ID_ZEPHYR_DCSP:
+- m = (typeof(m)){"LPe11002-SP", max_speed, "PCIe"};
++ m = (typeof(m)){"LP2105", max_speed, "PCIe"};
++ GE = 1;
+ break;
+ case PCI_DEVICE_ID_ZMID:
+ m = (typeof(m)){"LPe1150", max_speed, "PCIe"};
+@@ -1392,7 +1454,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_post_buffer: Post IOCB(s) with DMA buffer descriptor(s) to a IOCB ring.
++ * lpfc_post_buffer - Post IOCB(s) with DMA buffer descriptor(s) to a IOCB ring
+ * @phba: pointer to lpfc hba data structure.
+ * @pring: pointer to a IOCB ring.
+ * @cnt: the number of IOCBs to be posted to the IOCB ring.
+@@ -1493,7 +1555,7 @@ lpfc_post_buffer(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_post_rcv_buf: Post the initial receive IOCB buffers to ELS ring.
++ * lpfc_post_rcv_buf - Post the initial receive IOCB buffers to ELS ring
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine posts initial receive IOCB buffers to the ELS ring. The
+@@ -1518,7 +1580,7 @@ lpfc_post_rcv_buf(struct lpfc_hba *phba)
+ #define S(N,V) (((V)<<(N))|((V)>>(32-(N))))
+
+ /**
+- * lpfc_sha_init: Set up initial array of hash table entries.
++ * lpfc_sha_init - Set up initial array of hash table entries
+ * @HashResultPointer: pointer to an array as hash table.
+ *
+ * This routine sets up the initial values to the array of hash table entries
+@@ -1535,7 +1597,7 @@ lpfc_sha_init(uint32_t * HashResultPoint
+ }
+
+ /**
+- * lpfc_sha_iterate: Iterate initial hash table with the working hash table.
++ * lpfc_sha_iterate - Iterate initial hash table with the working hash table
+ * @HashResultPointer: pointer to an initial/result hash table.
+ * @HashWorkingPointer: pointer to an working hash table.
+ *
+@@ -1592,7 +1654,7 @@ lpfc_sha_iterate(uint32_t * HashResultPo
+ }
+
+ /**
+- * lpfc_challenge_key: Create challenge key based on WWPN of the HBA.
++ * lpfc_challenge_key - Create challenge key based on WWPN of the HBA
+ * @RandomChallenge: pointer to the entry of host challenge random number array.
+ * @HashWorking: pointer to the entry of the working hash array.
+ *
+@@ -1608,7 +1670,7 @@ lpfc_challenge_key(uint32_t * RandomChal
+ }
+
+ /**
+- * lpfc_hba_init: Perform special handling for LC HBA initialization.
++ * lpfc_hba_init - Perform special handling for LC HBA initialization
+ * @phba: pointer to lpfc hba data structure.
+ * @hbainit: pointer to an array of unsigned 32-bit integers.
+ *
+@@ -1637,7 +1699,7 @@ lpfc_hba_init(struct lpfc_hba *phba, uin
+ }
+
+ /**
+- * lpfc_cleanup: Performs vport cleanups before deleting a vport.
++ * lpfc_cleanup - Performs vport cleanups before deleting a vport
+ * @vport: pointer to a virtual N_Port data structure.
+ *
+ * This routine performs the necessary cleanups before deleting the @vport.
+@@ -1724,7 +1786,7 @@ lpfc_cleanup(struct lpfc_vport *vport)
+ }
+
+ /**
+- * lpfc_stop_vport_timers: Stop all the timers associated with a vport.
++ * lpfc_stop_vport_timers - Stop all the timers associated with a vport
+ * @vport: pointer to a virtual N_Port data structure.
+ *
+ * This routine stops all the timers associated with a @vport. This function
+@@ -1741,7 +1803,7 @@ lpfc_stop_vport_timers(struct lpfc_vport
+ }
+
+ /**
+- * lpfc_stop_phba_timers: Stop all the timers associated with an HBA.
++ * lpfc_stop_phba_timers - Stop all the timers associated with an HBA
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine stops all the timers associated with a HBA. This function is
+@@ -1761,7 +1823,7 @@ lpfc_stop_phba_timers(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_block_mgmt_io: Mark a HBA's management interface as blocked.
++ * lpfc_block_mgmt_io - Mark a HBA's management interface as blocked
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine marks a HBA's management interface as blocked. Once the HBA's
+@@ -1781,7 +1843,7 @@ lpfc_block_mgmt_io(struct lpfc_hba * phb
+ }
+
+ /**
+- * lpfc_online: Initialize and bring a HBA online.
++ * lpfc_online - Initialize and bring a HBA online
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine initializes the HBA and brings a HBA online. During this
+@@ -1839,7 +1901,7 @@ lpfc_online(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_unblock_mgmt_io: Mark a HBA's management interface to be not blocked.
++ * lpfc_unblock_mgmt_io - Mark a HBA's management interface to be not blocked
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine marks a HBA's management interface as not blocked. Once the
+@@ -1860,7 +1922,7 @@ lpfc_unblock_mgmt_io(struct lpfc_hba * p
+ }
+
+ /**
+- * lpfc_offline_prep: Prepare a HBA to be brought offline.
++ * lpfc_offline_prep - Prepare a HBA to be brought offline
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to prepare a HBA to be brought offline. It performs
+@@ -1917,7 +1979,7 @@ lpfc_offline_prep(struct lpfc_hba * phba
+ }
+
+ /**
+- * lpfc_offline: Bring a HBA offline.
++ * lpfc_offline - Bring a HBA offline
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine actually brings a HBA offline. It stops all the timers
+@@ -1962,7 +2024,7 @@ lpfc_offline(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_scsi_free: Free all the SCSI buffers and IOCBs from driver lists.
++ * lpfc_scsi_free - Free all the SCSI buffers and IOCBs from driver lists
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is to free all the SCSI buffers and IOCBs from the driver
+@@ -2001,7 +2063,7 @@ lpfc_scsi_free(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_create_port: Create an FC port.
++ * lpfc_create_port - Create an FC port
+ * @phba: pointer to lpfc hba data structure.
+ * @instance: a unique integer ID to this FC port.
+ * @dev: pointer to the device data structure.
+@@ -2091,7 +2153,7 @@ out:
+ }
+
+ /**
+- * destroy_port: Destroy an FC port.
++ * destroy_port - destroy an FC port
+ * @vport: pointer to an lpfc virtual N_Port data structure.
+ *
+ * This routine destroys a FC port from the upper layer protocol. All the
+@@ -2116,7 +2178,7 @@ destroy_port(struct lpfc_vport *vport)
+ }
+
+ /**
+- * lpfc_get_instance: Get a unique integer ID.
++ * lpfc_get_instance - Get a unique integer ID
+ *
+ * This routine allocates a unique integer ID from lpfc_hba_index pool. It
+ * uses the kernel idr facility to perform the task.
+@@ -2139,7 +2201,7 @@ lpfc_get_instance(void)
+ }
+
+ /**
+- * lpfc_scan_finished: method for SCSI layer to detect whether scan is done.
++ * lpfc_scan_finished - method for SCSI layer to detect whether scan is done
+ * @shost: pointer to SCSI host data structure.
+ * @time: elapsed time of the scan in jiffies.
+ *
+@@ -2197,7 +2259,7 @@ finished:
+ }
+
+ /**
+- * lpfc_host_attrib_init: Initialize SCSI host attributes on a FC port.
++ * lpfc_host_attrib_init - Initialize SCSI host attributes on a FC port
+ * @shost: pointer to SCSI host data structure.
+ *
+ * This routine initializes a given SCSI host attributes on a FC port. The
+@@ -2252,7 +2314,7 @@ void lpfc_host_attrib_init(struct Scsi_H
+ }
+
+ /**
+- * lpfc_enable_msix: Enable MSI-X interrupt mode.
++ * lpfc_enable_msix - Enable MSI-X interrupt mode
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to enable the MSI-X interrupt vectors. The kernel
+@@ -2366,7 +2428,7 @@ msi_fail_out:
+ }
+
+ /**
+- * lpfc_disable_msix: Disable MSI-X interrupt mode.
++ * lpfc_disable_msix - Disable MSI-X interrupt mode
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to release the MSI-X vectors and then disable the
+@@ -2385,7 +2447,7 @@ lpfc_disable_msix(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_enable_msi: Enable MSI interrupt mode.
++ * lpfc_enable_msi - Enable MSI interrupt mode
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to enable the MSI interrupt mode. The kernel
+@@ -2423,7 +2485,7 @@ lpfc_enable_msi(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_disable_msi: Disable MSI interrupt mode.
++ * lpfc_disable_msi - Disable MSI interrupt mode
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to disable the MSI interrupt mode. The driver
+@@ -2441,7 +2503,7 @@ lpfc_disable_msi(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_log_intr_mode: Log the active interrupt mode
++ * lpfc_log_intr_mode - Log the active interrupt mode
+ * @phba: pointer to lpfc hba data structure.
+ * @intr_mode: active interrupt mode adopted.
+ *
+@@ -2490,7 +2552,7 @@ lpfc_stop_port(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_enable_intr: Enable device interrupt.
++ * lpfc_enable_intr - Enable device interrupt
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to enable device interrupt and associate driver's
+@@ -2547,7 +2609,7 @@ lpfc_enable_intr(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_disable_intr: Disable device interrupt.
++ * lpfc_disable_intr - Disable device interrupt
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine is invoked to disable device interrupt and disassociate the
+@@ -2574,7 +2636,7 @@ lpfc_disable_intr(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_pci_probe_one: lpfc PCI probe func to register device to PCI subsystem.
++ * lpfc_pci_probe_one - lpfc PCI probe func to register device to PCI subsystem
+ * @pdev: pointer to PCI device
+ * @pid: pointer to PCI device identifier
+ *
+@@ -3010,7 +3072,7 @@ out:
+ }
+
+ /**
+- * lpfc_pci_remove_one: lpfc PCI func to unregister device from PCI subsystem.
++ * lpfc_pci_remove_one - lpfc PCI func to unregister device from PCI subsystem
+ * @pdev: pointer to PCI device
+ *
+ * This routine is to be registered to the kernel's PCI subsystem. When an
+@@ -3033,8 +3095,6 @@ lpfc_pci_remove_one(struct pci_dev *pdev
+
+ lpfc_free_sysfs_attr(vport);
+
+- kthread_stop(phba->worker_thread);
+-
+ /* Release all the vports against this physical port */
+ vports = lpfc_create_vport_work_array(phba);
+ if (vports != NULL)
+@@ -3052,7 +3112,12 @@ lpfc_pci_remove_one(struct pci_dev *pdev
+ * clears the rings, discards all mailbox commands, and resets
+ * the HBA.
+ */
++
++ /* HBA interrupt will be diabled after this call */
+ lpfc_sli_hba_down(phba);
++ /* Stop kthread signal shall trigger work_done one more time */
++ kthread_stop(phba->worker_thread);
++ /* Final cleanup of txcmplq and reset the HBA */
+ lpfc_sli_brdrestart(phba);
+
+ lpfc_stop_phba_timers(phba);
+@@ -3095,7 +3160,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev
+ }
+
+ /**
+- * lpfc_pci_suspend_one: lpfc PCI func to suspend device for power management.
++ * lpfc_pci_suspend_one - lpfc PCI func to suspend device for power management
+ * @pdev: pointer to PCI device
+ * @msg: power management message
+ *
+@@ -3139,7 +3204,7 @@ lpfc_pci_suspend_one(struct pci_dev *pde
+ }
+
+ /**
+- * lpfc_pci_resume_one: lpfc PCI func to resume device for power management.
++ * lpfc_pci_resume_one - lpfc PCI func to resume device for power management
+ * @pdev: pointer to PCI device
+ *
+ * This routine is to be registered to the kernel's PCI subsystem to support
+@@ -3204,7 +3269,7 @@ lpfc_pci_resume_one(struct pci_dev *pdev
+ }
+
+ /**
+- * lpfc_io_error_detected: Driver method for handling PCI I/O error detected.
++ * lpfc_io_error_detected - Driver method for handling PCI I/O error detected
+ * @pdev: pointer to PCI device.
+ * @state: the current PCI connection state.
+ *
+@@ -3254,7 +3319,7 @@ static pci_ers_result_t lpfc_io_error_de
+ }
+
+ /**
+- * lpfc_io_slot_reset: Restart a PCI device from scratch.
++ * lpfc_io_slot_reset - Restart a PCI device from scratch
+ * @pdev: pointer to PCI device.
+ *
+ * This routine is registered to the PCI subsystem for error handling. This is
+@@ -3313,7 +3378,7 @@ static pci_ers_result_t lpfc_io_slot_res
+ }
+
+ /**
+- * lpfc_io_resume: Resume PCI I/O operation.
++ * lpfc_io_resume - Resume PCI I/O operation
+ * @pdev: pointer to PCI device
+ *
+ * This routine is registered to the PCI subsystem for error handling. It is
+@@ -3426,7 +3491,7 @@ static struct pci_driver lpfc_driver = {
+ };
+
+ /**
+- * lpfc_init: lpfc module initialization routine.
++ * lpfc_init - lpfc module initialization routine
+ *
+ * This routine is to be invoked when the lpfc module is loaded into the
+ * kernel. The special kernel macro module_init() is used to indicate the
+@@ -3472,7 +3537,7 @@ lpfc_init(void)
+ }
+
+ /**
+- * lpfc_exit: lpfc module removal routine.
++ * lpfc_exit - lpfc module removal routine
+ *
+ * This routine is invoked when the lpfc module is removed from the kernel.
+ * The special kernel macro module_exit() is used to indicate the role of
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_logmsg.h linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_logmsg.h
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_logmsg.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_logmsg.h 2009-05-13 09:46:19.000000000 +0200
+@@ -27,7 +27,7 @@
+ #define LOG_FCP 0x40 /* FCP traffic history */
+ #define LOG_NODE 0x80 /* Node table events */
+ #define LOG_TEMP 0x100 /* Temperature sensor events */
+-#define LOG_BG 0x200 /* BlockBuard events */
++#define LOG_BG 0x200 /* BlockGuard events */
+ #define LOG_MISC 0x400 /* Miscellaneous events */
+ #define LOG_SLI 0x800 /* SLI events */
+ #define LOG_FCP_ERROR 0x1000 /* log errors, not underruns */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_mbox.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_mbox.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_mbox.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_mbox.c 2009-05-13 09:46:19.000000000 +0200
+@@ -39,7 +39,7 @@
+ #include "lpfc_compat.h"
+
+ /**
+- * lpfc_dump_mem: Prepare a mailbox command for retrieving HBA's VPD memory.
++ * lpfc_dump_mem - Prepare a mailbox command for retrieving HBA's VPD memory
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ * @offset: offset for dumping VPD memory mailbox command.
+@@ -77,9 +77,10 @@ lpfc_dump_mem(struct lpfc_hba * phba, LP
+ }
+
+ /**
+- * lpfc_dump_mem: Prepare a mailbox command for retrieving wakeup params.
++ * lpfc_dump_wakeup_param - Prepare mailbox command for retrieving wakeup params
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
++ *
+ * This function create a dump memory mailbox command to dump wake up
+ * parameters.
+ */
+@@ -109,7 +110,7 @@ lpfc_dump_wakeup_param(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_read_nv: Prepare a mailbox command for reading HBA's NVRAM param.
++ * lpfc_read_nv - Prepare a mailbox command for reading HBA's NVRAM param
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -132,7 +133,7 @@ lpfc_read_nv(struct lpfc_hba * phba, LPF
+ }
+
+ /**
+- * lpfc_config_async: Prepare a mailbox command for enabling HBA async event.
++ * lpfc_config_async - Prepare a mailbox command for enabling HBA async event
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ * @ring: ring number for the asynchronous event to be configured.
+@@ -159,7 +160,7 @@ lpfc_config_async(struct lpfc_hba * phba
+ }
+
+ /**
+- * lpfc_heart_beat: Prepare a mailbox command for heart beat.
++ * lpfc_heart_beat - Prepare a mailbox command for heart beat
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -184,7 +185,7 @@ lpfc_heart_beat(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_read_la: Prepare a mailbox command for reading HBA link attention.
++ * lpfc_read_la - Prepare a mailbox command for reading HBA link attention
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ * @mp: DMA buffer memory for reading the link attention information into.
+@@ -228,7 +229,7 @@ lpfc_read_la(struct lpfc_hba * phba, LPF
+ }
+
+ /**
+- * lpfc_clear_la: Prepare a mailbox command for clearing HBA link attention.
++ * lpfc_clear_la - Prepare a mailbox command for clearing HBA link attention
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -257,7 +258,7 @@ lpfc_clear_la(struct lpfc_hba * phba, LP
+ }
+
+ /**
+- * lpfc_config_link: Prepare a mailbox command for configuring link on a HBA.
++ * lpfc_config_link - Prepare a mailbox command for configuring link on a HBA
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -305,7 +306,7 @@ lpfc_config_link(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_config_msi: Prepare a mailbox command for configuring msi-x.
++ * lpfc_config_msi - Prepare a mailbox command for configuring msi-x
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -383,7 +384,7 @@ lpfc_config_msi(struct lpfc_hba *phba, L
+ }
+
+ /**
+- * lpfc_init_link: Prepare a mailbox command for initialize link on a HBA.
++ * lpfc_init_link - Prepare a mailbox command for initialize link on a HBA
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ * @topology: the link topology for the link to be initialized to.
+@@ -463,7 +464,7 @@ lpfc_init_link(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_read_sparam: Prepare a mailbox command for reading HBA parameters.
++ * lpfc_read_sparam - Prepare a mailbox command for reading HBA parameters
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ * @vpi: virtual N_Port identifier.
+@@ -523,7 +524,7 @@ lpfc_read_sparam(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_unreg_did: Prepare a mailbox command for unregistering DID.
++ * lpfc_unreg_did - Prepare a mailbox command for unregistering DID
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: virtual N_Port identifier.
+ * @did: remote port identifier.
+@@ -555,7 +556,7 @@ lpfc_unreg_did(struct lpfc_hba * phba, u
+ }
+
+ /**
+- * lpfc_read_config: Prepare a mailbox command for reading HBA configuration.
++ * lpfc_read_config - Prepare a mailbox command for reading HBA configuration
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -581,7 +582,7 @@ lpfc_read_config(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_read_lnk_stat: Prepare a mailbox command for reading HBA link stats.
++ * lpfc_read_lnk_stat - Prepare a mailbox command for reading HBA link stats
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -606,7 +607,7 @@ lpfc_read_lnk_stat(struct lpfc_hba * phb
+ }
+
+ /**
+- * lpfc_reg_login: Prepare a mailbox command for registering remote login.
++ * lpfc_reg_login - Prepare a mailbox command for registering remote login
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: virtual N_Port identifier.
+ * @did: remote port identifier.
+@@ -677,7 +678,7 @@ lpfc_reg_login(struct lpfc_hba *phba, ui
+ }
+
+ /**
+- * lpfc_unreg_login: Prepare a mailbox command for unregistering remote login.
++ * lpfc_unreg_login - Prepare a mailbox command for unregistering remote login
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: virtual N_Port identifier.
+ * @rpi: remote port identifier
+@@ -709,7 +710,7 @@ lpfc_unreg_login(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_reg_vpi: Prepare a mailbox command for registering vport identifier.
++ * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: virtual N_Port identifier.
+ * @sid: Fibre Channel S_ID (N_Port_ID assigned to a virtual N_Port).
+@@ -741,7 +742,7 @@ lpfc_reg_vpi(struct lpfc_hba *phba, uint
+ }
+
+ /**
+- * lpfc_unreg_vpi: Prepare a mailbox command for unregistering vport id.
++ * lpfc_unreg_vpi - Prepare a mailbox command for unregistering vport id
+ * @phba: pointer to lpfc hba data structure.
+ * @vpi: virtual N_Port identifier.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+@@ -771,7 +772,7 @@ lpfc_unreg_vpi(struct lpfc_hba *phba, ui
+ }
+
+ /**
+- * lpfc_config_pcb_setup: Set up IOCB rings in the Port Control Block (PCB)
++ * lpfc_config_pcb_setup - Set up IOCB rings in the Port Control Block (PCB)
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * This routine sets up and initializes the IOCB rings in the Port Control
+@@ -835,7 +836,7 @@ lpfc_config_pcb_setup(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_read_rev: Prepare a mailbox command for reading HBA revision.
++ * lpfc_read_rev - Prepare a mailbox command for reading HBA revision
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -861,7 +862,7 @@ lpfc_read_rev(struct lpfc_hba * phba, LP
+ }
+
+ /**
+- * lpfc_build_hbq_profile2: Set up the HBQ Selection Profile 2.
++ * lpfc_build_hbq_profile2 - Set up the HBQ Selection Profile 2
+ * @hbqmb: pointer to the HBQ configuration data structure in mailbox command.
+ * @hbq_desc: pointer to the HBQ selection profile descriptor.
+ *
+@@ -880,7 +881,7 @@ lpfc_build_hbq_profile2(struct config_hb
+ }
+
+ /**
+- * lpfc_build_hbq_profile3: Set up the HBQ Selection Profile 3.
++ * lpfc_build_hbq_profile3 - Set up the HBQ Selection Profile 3
+ * @hbqmb: pointer to the HBQ configuration data structure in mailbox command.
+ * @hbq_desc: pointer to the HBQ selection profile descriptor.
+ *
+@@ -902,7 +903,7 @@ lpfc_build_hbq_profile3(struct config_hb
+ }
+
+ /**
+- * lpfc_build_hbq_profile5: Set up the HBQ Selection Profile 5.
++ * lpfc_build_hbq_profile5 - Set up the HBQ Selection Profile 5
+ * @hbqmb: pointer to the HBQ configuration data structure in mailbox command.
+ * @hbq_desc: pointer to the HBQ selection profile descriptor.
+ *
+@@ -925,7 +926,7 @@ lpfc_build_hbq_profile5(struct config_hb
+ }
+
+ /**
+- * lpfc_config_hbq: Prepare a mailbox command for configuring an HBQ.
++ * lpfc_config_hbq - Prepare a mailbox command for configuring an HBQ
+ * @phba: pointer to lpfc hba data structure.
+ * @id: HBQ identifier.
+ * @hbq_desc: pointer to the HBA descriptor data structure.
+@@ -999,7 +1000,7 @@ lpfc_config_hbq(struct lpfc_hba *phba, u
+ }
+
+ /**
+- * lpfc_config_ring: Prepare a mailbox command for configuring an IOCB ring.
++ * lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring
+ * @phba: pointer to lpfc hba data structure.
+ * @ring:
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+@@ -1057,7 +1058,7 @@ lpfc_config_ring(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_config_port: Prepare a mailbox command for configuring port.
++ * lpfc_config_port - Prepare a mailbox command for configuring port
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -1227,7 +1228,7 @@ lpfc_config_port(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_kill_board: Prepare a mailbox command for killing board.
++ * lpfc_kill_board - Prepare a mailbox command for killing board
+ * @phba: pointer to lpfc hba data structure.
+ * @pmb: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -1253,7 +1254,7 @@ lpfc_kill_board(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_mbox_put: Put a mailbox cmd into the tail of driver's mailbox queue.
++ * lpfc_mbox_put - Put a mailbox cmd into the tail of driver's mailbox queue
+ * @phba: pointer to lpfc hba data structure.
+ * @mbq: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -1277,7 +1278,7 @@ lpfc_mbox_put(struct lpfc_hba * phba, LP
+ }
+
+ /**
+- * lpfc_mbox_get: Remove a mailbox cmd from the head of driver's mailbox queue.
++ * lpfc_mbox_get - Remove a mailbox cmd from the head of driver's mailbox queue
+ * @phba: pointer to lpfc hba data structure.
+ *
+ * Driver maintains a internal mailbox command queue implemented as a linked
+@@ -1304,7 +1305,7 @@ lpfc_mbox_get(struct lpfc_hba * phba)
+ }
+
+ /**
+- * lpfc_mbox_cmpl_put: Put mailbox command into mailbox command complete list.
++ * lpfc_mbox_cmpl_put - Put mailbox command into mailbox command complete list
+ * @phba: pointer to lpfc hba data structure.
+ * @mbq: pointer to the driver internal queue element for mailbox command.
+ *
+@@ -1327,7 +1328,7 @@ lpfc_mbox_cmpl_put(struct lpfc_hba * phb
+ }
+
+ /**
+- * lpfc_mbox_tmo_val: Retrieve mailbox command timeout value.
++ * lpfc_mbox_tmo_val - Retrieve mailbox command timeout value
+ * @phba: pointer to lpfc hba data structure.
+ * @cmd: mailbox command code.
+ *
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_mem.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_mem.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_mem.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_mem.c 2009-05-13 09:46:19.000000000 +0200
+@@ -41,7 +41,7 @@
+
+
+ /**
+- * lpfc_mem_alloc: create and allocate all PCI and memory pools
++ * lpfc_mem_alloc - create and allocate all PCI and memory pools
+ * @phba: HBA to allocate pools for
+ *
+ * Description: Creates and allocates PCI pools lpfc_scsi_dma_buf_pool,
+@@ -136,12 +136,12 @@ lpfc_mem_alloc(struct lpfc_hba * phba)
+ }
+
+ /**
+- * lpfc_mem_free: Frees all PCI and memory allocated by lpfc_mem_alloc
++ * lpfc_mem_free - Frees all PCI and memory allocated by lpfc_mem_alloc
+ * @phba: HBA to free memory for
+ *
+ * Description: Frees PCI pools lpfc_scsi_dma_buf_pool, lpfc_mbuf_pool,
+ * lpfc_hbq_pool. Frees kmalloc-backed mempools for LPFC_MBOXQ_t and
+- * lpfc_nodelist. Also frees the VPI bitmask.
++ * lpfc_nodelist. Also frees the VPI bitmask
+ *
+ * Returns: None
+ **/
+@@ -212,7 +212,7 @@ lpfc_mem_free(struct lpfc_hba * phba)
+ }
+
+ /**
+- * lpfc_mbuf_alloc: Allocate an mbuf from the lpfc_mbuf_pool PCI pool
++ * lpfc_mbuf_alloc - Allocate an mbuf from the lpfc_mbuf_pool PCI pool
+ * @phba: HBA which owns the pool to allocate from
+ * @mem_flags: indicates if this is a priority (MEM_PRI) allocation
+ * @handle: used to return the DMA-mapped address of the mbuf
+@@ -249,7 +249,7 @@ lpfc_mbuf_alloc(struct lpfc_hba *phba, i
+ }
+
+ /**
+- * __lpfc_mem_free: Free an mbuf from the lpfc_mbuf_pool PCI pool (locked)
++ * __lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (locked)
+ * @phba: HBA which owns the pool to return to
+ * @virt: mbuf to free
+ * @dma: the DMA-mapped address of the lpfc_mbuf_pool to be freed
+@@ -278,7 +278,7 @@ __lpfc_mbuf_free(struct lpfc_hba * phba,
+ }
+
+ /**
+- * lpfc_mem_free: Free an mbuf from the lpfc_mbuf_pool PCI pool (unlocked)
++ * lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (unlocked)
+ * @phba: HBA which owns the pool to return to
+ * @virt: mbuf to free
+ * @dma: the DMA-mapped address of the lpfc_mbuf_pool to be freed
+@@ -291,7 +291,6 @@ __lpfc_mbuf_free(struct lpfc_hba * phba,
+ * Returns: None
+ **/
+ void
+-
+ lpfc_mbuf_free(struct lpfc_hba * phba, void *virt, dma_addr_t dma)
+ {
+ unsigned long iflags;
+@@ -303,7 +302,7 @@ lpfc_mbuf_free(struct lpfc_hba * phba, v
+ }
+
+ /**
+- * lpfc_els_hbq_alloc: Allocate an HBQ buffer
++ * lpfc_els_hbq_alloc - Allocate an HBQ buffer
+ * @phba: HBA to allocate HBQ buffer for
+ *
+ * Description: Allocates a DMA-mapped HBQ buffer from the lpfc_hbq_pool PCI
+@@ -335,7 +334,7 @@ lpfc_els_hbq_alloc(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_mem_hbq_free: Frees an HBQ buffer allocated with lpfc_els_hbq_alloc
++ * lpfc_mem_hbq_free - Frees an HBQ buffer allocated with lpfc_els_hbq_alloc
+ * @phba: HBA buffer was allocated for
+ * @hbqbp: HBQ container returned by lpfc_els_hbq_alloc
+ *
+@@ -355,7 +354,7 @@ lpfc_els_hbq_free(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_in_buf_free: Free a DMA buffer
++ * lpfc_in_buf_free - Free a DMA buffer
+ * @phba: HBA buffer is associated with
+ * @mp: Buffer to free
+ *
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_nportdisc.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_nportdisc.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_nportdisc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_nportdisc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -192,7 +192,6 @@ lpfc_els_abort(struct lpfc_hba *phba, st
+ struct lpfc_sli *psli = &phba->sli;
+ struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING];
+ struct lpfc_iocbq *iocb, *next_iocb;
+- IOCB_t *cmd;
+
+ /* Abort outstanding I/O on NPort <nlp_DID> */
+ lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY,
+@@ -223,19 +222,10 @@ lpfc_els_abort(struct lpfc_hba *phba, st
+ }
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- iocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- cmd = &iocb->iocb;
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
++
+ lpfc_cancel_retry_delay_tmo(phba->pport, ndlp);
+ return 0;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_scsi.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_scsi.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_scsi.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_scsi.c 2009-05-13 09:46:19.000000000 +0200
+@@ -112,7 +112,7 @@ lpfc_debug_save_dif(struct scsi_cmnd *cm
+ }
+
+ /**
+- * lpfc_update_stats: Update statistical data for the command completion.
++ * lpfc_update_stats - Update statistical data for the command completion
+ * @phba: Pointer to HBA object.
+ * @lpfc_cmd: lpfc scsi command object pointer.
+ *
+@@ -165,8 +165,7 @@ lpfc_update_stats(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_send_sdev_queuedepth_change_event: Posts a queuedepth change
+- * event.
++ * lpfc_send_sdev_queuedepth_change_event - Posts a queuedepth change event
+ * @phba: Pointer to HBA context object.
+ * @vport: Pointer to vport object.
+ * @ndlp: Pointer to FC node associated with the target.
+@@ -220,7 +219,7 @@ lpfc_send_sdev_queuedepth_change_event(s
+ }
+
+ /**
+- * lpfc_rampdown_queue_depth: Post RAMP_DOWN_QUEUE event to worker thread.
++ * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine is called when there is resource error in driver or firmware.
+@@ -261,7 +260,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_rampup_queue_depth: Post RAMP_UP_QUEUE event for worker thread.
++ * lpfc_rampup_queue_depth - Post RAMP_UP_QUEUE event for worker thread
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine post WORKER_RAMP_UP_QUEUE event for @phba vport. This routine
+@@ -273,14 +272,14 @@ lpfc_rampdown_queue_depth(struct lpfc_hb
+ **/
+ static inline void
+ lpfc_rampup_queue_depth(struct lpfc_vport *vport,
+- struct scsi_device *sdev)
++ uint32_t queue_depth)
+ {
+ unsigned long flags;
+ struct lpfc_hba *phba = vport->phba;
+ uint32_t evt_posted;
+ atomic_inc(&phba->num_cmd_success);
+
+- if (vport->cfg_lun_queue_depth <= sdev->queue_depth)
++ if (vport->cfg_lun_queue_depth <= queue_depth)
+ return;
+ spin_lock_irqsave(&phba->hbalock, flags);
+ if (((phba->last_ramp_up_time + QUEUE_RAMP_UP_INTERVAL) > jiffies) ||
+@@ -303,7 +302,7 @@ lpfc_rampup_queue_depth(struct lpfc_vpor
+ }
+
+ /**
+- * lpfc_ramp_down_queue_handler: WORKER_RAMP_DOWN_QUEUE event handler.
++ * lpfc_ramp_down_queue_handler - WORKER_RAMP_DOWN_QUEUE event handler
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine is called to process WORKER_RAMP_DOWN_QUEUE event for worker
+@@ -361,7 +360,7 @@ lpfc_ramp_down_queue_handler(struct lpfc
+ }
+
+ /**
+- * lpfc_ramp_up_queue_handler: WORKER_RAMP_UP_QUEUE event handler.
++ * lpfc_ramp_up_queue_handler - WORKER_RAMP_UP_QUEUE event handler
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine is called to process WORKER_RAMP_UP_QUEUE event for worker
+@@ -410,7 +409,7 @@ lpfc_ramp_up_queue_handler(struct lpfc_h
+ }
+
+ /**
+- * lpfc_scsi_dev_block: set all scsi hosts to block state.
++ * lpfc_scsi_dev_block - set all scsi hosts to block state
+ * @phba: Pointer to HBA context object.
+ *
+ * This function walks vport list and set each SCSI host to block state
+@@ -439,7 +438,7 @@ lpfc_scsi_dev_block(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_new_scsi_buf: Scsi buffer allocator.
++ * lpfc_new_scsi_buf - Scsi buffer allocator
+ * @vport: The virtual port for which this call being executed.
+ *
+ * This routine allocates a scsi buffer, which contains all the necessary
+@@ -563,7 +562,7 @@ lpfc_new_scsi_buf(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_get_scsi_buf: Get a scsi buffer from lpfc_scsi_buf_list list of Hba.
++ * lpfc_get_scsi_buf - Get a scsi buffer from lpfc_scsi_buf_list list of Hba
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine removes a scsi buffer from head of @phba lpfc_scsi_buf_list list
+@@ -592,7 +591,7 @@ lpfc_get_scsi_buf(struct lpfc_hba * phba
+ }
+
+ /**
+- * lpfc_release_scsi_buf: Return a scsi buffer back to hba lpfc_scsi_buf_list list.
++ * lpfc_release_scsi_buf - Return a scsi buffer back to hba's lpfc_scsi_buf_list
+ * @phba: The Hba for which this call is being executed.
+ * @psb: The scsi buffer which is being released.
+ *
+@@ -611,7 +610,7 @@ lpfc_release_scsi_buf(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_scsi_prep_dma_buf: Routine to do DMA mapping for scsi buffer.
++ * lpfc_scsi_prep_dma_buf - Routine to do DMA mapping for scsi buffer
+ * @phba: The Hba for which this call is being executed.
+ * @lpfc_cmd: The scsi buffer which is going to be mapped.
+ *
+@@ -738,7 +737,7 @@ lpfc_scsi_prep_dma_buf(struct lpfc_hba *
+ * Due to difference in data length between DIF/non-DIF paths,
+ * we need to set word 4 of IOCB here
+ */
+- iocb_cmd->un.fcpi.fcpi_parm = le32_to_cpu(scsi_bufflen(scsi_cmnd));
++ iocb_cmd->un.fcpi.fcpi_parm = scsi_bufflen(scsi_cmnd);
+ return 0;
+ }
+
+@@ -823,9 +822,9 @@ lpfc_cmd_blksize(struct scsi_cmnd *sc)
+ /**
+ * lpfc_get_cmd_dif_parms - Extract DIF parameters from SCSI command
+ * @sc: in: SCSI command
+- * @apptagmask out: app tag mask
+- * @apptagval out: app tag value
+- * @reftag out: ref tag (reference tag)
++ * @apptagmask: out: app tag mask
++ * @apptagval: out: app tag value
++ * @reftag: out: ref tag (reference tag)
+ *
+ * Description:
+ * Extract DIF paramters from the command if possible. Otherwise,
+@@ -1413,7 +1412,7 @@ out:
+ }
+
+ /**
+- * lpfc_send_scsi_error_event: Posts an event when there is SCSI error.
++ * lpfc_send_scsi_error_event - Posts an event when there is SCSI error
+ * @phba: Pointer to hba context object.
+ * @vport: Pointer to vport object.
+ * @lpfc_cmd: Pointer to lpfc scsi command which reported the error.
+@@ -1505,7 +1504,7 @@ lpfc_send_scsi_error_event(struct lpfc_h
+ }
+
+ /**
+- * lpfc_scsi_unprep_dma_buf: Routine to un-map DMA mapping of scatter gather.
++ * lpfc_scsi_unprep_dma_buf - Routine to un-map DMA mapping of scatter gather
+ * @phba: The Hba for which this call is being executed.
+ * @psb: The scsi buffer which is going to be un-mapped.
+ *
+@@ -1530,7 +1529,7 @@ lpfc_scsi_unprep_dma_buf(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_handler_fcp_err: FCP response handler.
++ * lpfc_handler_fcp_err - FCP response handler
+ * @vport: The virtual port for which this call is being executed.
+ * @lpfc_cmd: Pointer to lpfc_scsi_buf data structure.
+ * @rsp_iocb: The response IOCB which contains FCP error.
+@@ -1674,7 +1673,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_scsi_cmd_iocb_cmpl: Scsi cmnd IOCB completion routine.
++ * lpfc_scsi_cmd_iocb_cmpl - Scsi cmnd IOCB completion routine
+ * @phba: The Hba for which this call is being executed.
+ * @pIocbIn: The command IOCBQ for the scsi cmnd.
+ * @pIocbOut: The response IOCBQ for the scsi cmnd .
+@@ -1694,10 +1693,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ struct lpfc_nodelist *pnode = rdata->pnode;
+ struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
+ int result;
+- struct scsi_device *sdev, *tmp_sdev;
++ struct scsi_device *tmp_sdev;
+ int depth = 0;
+ unsigned long flags;
+ struct lpfc_fast_path_event *fast_path_evt;
++ struct Scsi_Host *shost = cmd->device->host;
++ uint32_t queue_depth, scsi_id;
+
+ lpfc_cmd->result = pIocbOut->iocb.un.ulpWord[4];
+ lpfc_cmd->status = pIocbOut->iocb.ulpStatus;
+@@ -1808,11 +1809,10 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+
+ lpfc_update_stats(phba, lpfc_cmd);
+ result = cmd->result;
+- sdev = cmd->device;
+ if (vport->cfg_max_scsicmpl_time &&
+ time_after(jiffies, lpfc_cmd->start_time +
+ msecs_to_jiffies(vport->cfg_max_scsicmpl_time))) {
+- spin_lock_irqsave(sdev->host->host_lock, flags);
++ spin_lock_irqsave(shost->host_lock, flags);
+ if (pnode && NLP_CHK_NODE_ACT(pnode)) {
+ if (pnode->cmd_qdepth >
+ atomic_read(&pnode->cmd_pending) &&
+@@ -1825,22 +1825,26 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+
+ pnode->last_change_time = jiffies;
+ }
+- spin_unlock_irqrestore(sdev->host->host_lock, flags);
++ spin_unlock_irqrestore(shost->host_lock, flags);
+ } else if (pnode && NLP_CHK_NODE_ACT(pnode)) {
+ if ((pnode->cmd_qdepth < LPFC_MAX_TGT_QDEPTH) &&
+ time_after(jiffies, pnode->last_change_time +
+ msecs_to_jiffies(LPFC_TGTQ_INTERVAL))) {
+- spin_lock_irqsave(sdev->host->host_lock, flags);
++ spin_lock_irqsave(shost->host_lock, flags);
+ pnode->cmd_qdepth += pnode->cmd_qdepth *
+ LPFC_TGTQ_RAMPUP_PCENT / 100;
+ if (pnode->cmd_qdepth > LPFC_MAX_TGT_QDEPTH)
+ pnode->cmd_qdepth = LPFC_MAX_TGT_QDEPTH;
+ pnode->last_change_time = jiffies;
+- spin_unlock_irqrestore(sdev->host->host_lock, flags);
++ spin_unlock_irqrestore(shost->host_lock, flags);
+ }
+ }
+
+ lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
++
++ /* The sdev is not guaranteed to be valid post scsi_done upcall. */
++ queue_depth = cmd->device->queue_depth;
++ scsi_id = cmd->device->id;
+ cmd->scsi_done(cmd);
+
+ if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+@@ -1848,28 +1852,28 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ * If there is a thread waiting for command completion
+ * wake up the thread.
+ */
+- spin_lock_irqsave(sdev->host->host_lock, flags);
++ spin_lock_irqsave(shost->host_lock, flags);
+ lpfc_cmd->pCmd = NULL;
+ if (lpfc_cmd->waitq)
+ wake_up(lpfc_cmd->waitq);
+- spin_unlock_irqrestore(sdev->host->host_lock, flags);
++ spin_unlock_irqrestore(shost->host_lock, flags);
+ lpfc_release_scsi_buf(phba, lpfc_cmd);
+ return;
+ }
+
+
+ if (!result)
+- lpfc_rampup_queue_depth(vport, sdev);
++ lpfc_rampup_queue_depth(vport, queue_depth);
+
+ if (!result && pnode && NLP_CHK_NODE_ACT(pnode) &&
+ ((jiffies - pnode->last_ramp_up_time) >
+ LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
+ ((jiffies - pnode->last_q_full_time) >
+ LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
+- (vport->cfg_lun_queue_depth > sdev->queue_depth)) {
+- shost_for_each_device(tmp_sdev, sdev->host) {
++ (vport->cfg_lun_queue_depth > queue_depth)) {
++ shost_for_each_device(tmp_sdev, shost) {
+ if (vport->cfg_lun_queue_depth > tmp_sdev->queue_depth){
+- if (tmp_sdev->id != sdev->id)
++ if (tmp_sdev->id != scsi_id)
+ continue;
+ if (tmp_sdev->ordered_tags)
+ scsi_adjust_queue_depth(tmp_sdev,
+@@ -1885,7 +1889,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ }
+ lpfc_send_sdev_queuedepth_change_event(phba, vport, pnode,
+ 0xFFFFFFFF,
+- sdev->queue_depth - 1, sdev->queue_depth);
++ queue_depth , queue_depth + 1);
+ }
+
+ /*
+@@ -1896,8 +1900,8 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ NLP_CHK_NODE_ACT(pnode)) {
+ pnode->last_q_full_time = jiffies;
+
+- shost_for_each_device(tmp_sdev, sdev->host) {
+- if (tmp_sdev->id != sdev->id)
++ shost_for_each_device(tmp_sdev, shost) {
++ if (tmp_sdev->id != scsi_id)
+ continue;
+ depth = scsi_track_queue_full(tmp_sdev,
+ tmp_sdev->queue_depth - 1);
+@@ -1909,7 +1913,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ * scsi_track_queue_full.
+ */
+ if (depth == -1)
+- depth = sdev->host->cmd_per_lun;
++ depth = shost->cmd_per_lun;
+
+ if (depth) {
+ lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
+@@ -1925,17 +1929,17 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba
+ * If there is a thread waiting for command completion
+ * wake up the thread.
+ */
+- spin_lock_irqsave(sdev->host->host_lock, flags);
++ spin_lock_irqsave(shost->host_lock, flags);
+ lpfc_cmd->pCmd = NULL;
+ if (lpfc_cmd->waitq)
+ wake_up(lpfc_cmd->waitq);
+- spin_unlock_irqrestore(sdev->host->host_lock, flags);
++ spin_unlock_irqrestore(shost->host_lock, flags);
+
+ lpfc_release_scsi_buf(phba, lpfc_cmd);
+ }
+
+ /**
+- * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB.
++ * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB
+ * @data: A pointer to the immediate command data portion of the IOCB.
+ * @fcp_cmnd: The FCP Command that is provided by the SCSI layer.
+ *
+@@ -1953,7 +1957,7 @@ lpfc_fcpcmd_to_iocb(uint8_t *data, struc
+ }
+
+ /**
+- * lpfc_scsi_prep_cmnd: Routine to convert scsi cmnd to FCP information unit.
++ * lpfc_scsi_prep_cmnd - Routine to convert scsi cmnd to FCP information unit
+ * @vport: The virtual port for which this call is being executed.
+ * @lpfc_cmd: The scsi command which needs to send.
+ * @pnode: Pointer to lpfc_nodelist.
+@@ -2047,7 +2051,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_scsi_prep_task_mgmt_cmnd: Convert scsi TM cmnd to FCP information unit.
++ * lpfc_scsi_prep_task_mgmt_cmnd - Convert scsi TM cmnd to FCP information unit
+ * @vport: The virtual port for which this call is being executed.
+ * @lpfc_cmd: Pointer to lpfc_scsi_buf data structure.
+ * @lun: Logical unit number.
+@@ -2110,7 +2114,7 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc
+ }
+
+ /**
+- * lpc_taskmgmt_def_cmpl: IOCB completion routine for task management command.
++ * lpfc_taskmgmt_def_cmpl - IOCB completion routine for task management command
+ * @phba: The Hba for which this call is being executed.
+ * @cmdiocbq: Pointer to lpfc_iocbq data structure.
+ * @rspiocbq: Pointer to lpfc_iocbq data structure.
+@@ -2131,7 +2135,7 @@ lpfc_tskmgmt_def_cmpl(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_scsi_tgt_reset: Target reset handler.
++ * lpfc_scsi_tgt_reset - Target reset handler
+ * @lpfc_cmd: Pointer to lpfc_scsi_buf data structure
+ * @vport: The virtual port for which this call is being executed.
+ * @tgt_id: Target ID.
+@@ -2198,7 +2202,7 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf
+ }
+
+ /**
+- * lpfc_info: Info entry point of scsi_host_template data structure.
++ * lpfc_info - Info entry point of scsi_host_template data structure
+ * @host: The scsi host for which this call is being executed.
+ *
+ * This routine provides module information about hba.
+@@ -2236,7 +2240,7 @@ lpfc_info(struct Scsi_Host *host)
+ }
+
+ /**
+- * lpfc_poll_rearm_time: Routine to modify fcp_poll timer of hba.
++ * lpfc_poll_rearm_time - Routine to modify fcp_poll timer of hba
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine modifies fcp_poll_timer field of @phba by cfg_poll_tmo.
+@@ -2253,7 +2257,7 @@ static __inline__ void lpfc_poll_rearm_t
+ }
+
+ /**
+- * lpfc_poll_start_timer: Routine to start fcp_poll_timer of HBA.
++ * lpfc_poll_start_timer - Routine to start fcp_poll_timer of HBA
+ * @phba: The Hba for which this call is being executed.
+ *
+ * This routine starts the fcp_poll_timer of @phba.
+@@ -2264,7 +2268,7 @@ void lpfc_poll_start_timer(struct lpfc_h
+ }
+
+ /**
+- * lpfc_poll_timeout: Restart polling timer.
++ * lpfc_poll_timeout - Restart polling timer
+ * @ptr: Map to lpfc_hba data structure pointer.
+ *
+ * This routine restarts fcp_poll timer, when FCP ring polling is enable
+@@ -2283,8 +2287,7 @@ void lpfc_poll_timeout(unsigned long ptr
+ }
+
+ /**
+- * lpfc_queuecommand: Queuecommand entry point of Scsi Host Templater data
+- * structure.
++ * lpfc_queuecommand - scsi_host_template queuecommand entry point
+ * @cmnd: Pointer to scsi_cmnd data structure.
+ * @done: Pointer to done routine.
+ *
+@@ -2450,7 +2453,7 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd
+ }
+
+ /**
+- * lpfc_block_error_handler: Routine to block error handler.
++ * lpfc_block_error_handler - Routine to block error handler
+ * @cmnd: Pointer to scsi_cmnd data structure.
+ *
+ * This routine blocks execution till fc_rport state is not FC_PORSTAT_BLCOEKD.
+@@ -2472,8 +2475,7 @@ lpfc_block_error_handler(struct scsi_cmn
+ }
+
+ /**
+- * lpfc_abort_handler: Eh_abort_handler entry point of Scsi Host Template data
+- *structure.
++ * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
+ * @cmnd: Pointer to scsi_cmnd data structure.
+ *
+ * This routine aborts @cmnd pending in base driver.
+@@ -2578,8 +2580,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmn
+ }
+
+ /**
+- * lpfc_device_reset_handler: eh_device_reset entry point of Scsi Host Template
+- *data structure.
++ * lpfc_device_reset_handler - scsi_host_template eh_device_reset entry point
+ * @cmnd: Pointer to scsi_cmnd data structure.
+ *
+ * This routine does a device reset by sending a TARGET_RESET task management
+@@ -2587,7 +2588,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmn
+ *
+ * Return code :
+ * 0x2003 - Error
+- * 0ex2002 - Success
++ * 0x2002 - Success
+ **/
+ static int
+ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
+@@ -2707,8 +2708,7 @@ lpfc_device_reset_handler(struct scsi_cm
+ }
+
+ /**
+- * lpfc_bus_reset_handler: eh_bus_reset_handler entry point of Scsi Host
+- * Template data structure.
++ * lpfc_bus_reset_handler - scsi_host_template eh_bus_reset_handler entry point
+ * @cmnd: Pointer to scsi_cmnd data structure.
+ *
+ * This routine does target reset to all target on @cmnd->device->host.
+@@ -2808,8 +2808,7 @@ lpfc_bus_reset_handler(struct scsi_cmnd
+ }
+
+ /**
+- * lpfc_slave_alloc: slave_alloc entry point of Scsi Host Template data
+- * structure.
++ * lpfc_slave_alloc - scsi_host_template slave_alloc entry point
+ * @sdev: Pointer to scsi_device.
+ *
+ * This routine populates the cmds_per_lun count + 2 scsi_bufs into this host's
+@@ -2883,8 +2882,7 @@ lpfc_slave_alloc(struct scsi_device *sde
+ }
+
+ /**
+- * lpfc_slave_configure: slave_configure entry point of Scsi Host Templater data
+- * structure.
++ * lpfc_slave_configure - scsi_host_template slave_configure entry point
+ * @sdev: Pointer to scsi_device.
+ *
+ * This routine configures following items
+@@ -2925,7 +2923,7 @@ lpfc_slave_configure(struct scsi_device
+ }
+
+ /**
+- * lpfc_slave_destroy: slave_destroy entry point of SHT data structure.
++ * lpfc_slave_destroy - slave_destroy entry point of SHT data structure
+ * @sdev: Pointer to scsi_device.
+ *
+ * This routine sets @sdev hostatdata filed to null.
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_sli.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_sli.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_sli.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_sli.c 2009-05-13 09:46:19.000000000 +0200
+@@ -68,7 +68,7 @@ typedef enum _lpfc_iocb_type {
+ } lpfc_iocb_type;
+
+ /**
+- * lpfc_cmd_iocb: Get next command iocb entry in the ring.
++ * lpfc_cmd_iocb - Get next command iocb entry in the ring
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -85,7 +85,7 @@ lpfc_cmd_iocb(struct lpfc_hba *phba, str
+ }
+
+ /**
+- * lpfc_resp_iocb: Get next response iocb entry in the ring.
++ * lpfc_resp_iocb - Get next response iocb entry in the ring
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -102,7 +102,7 @@ lpfc_resp_iocb(struct lpfc_hba *phba, st
+ }
+
+ /**
+- * __lpfc_sli_get_iocbq: Allocates an iocb object from iocb pool.
++ * __lpfc_sli_get_iocbq - Allocates an iocb object from iocb pool
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called with hbalock held. This function
+@@ -121,7 +121,7 @@ __lpfc_sli_get_iocbq(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_get_iocbq: Allocates an iocb object from iocb pool.
++ * lpfc_sli_get_iocbq - Allocates an iocb object from iocb pool
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called with no lock held. This function
+@@ -142,7 +142,7 @@ lpfc_sli_get_iocbq(struct lpfc_hba *phba
+ }
+
+ /**
+- * __lpfc_sli_release_iocbq: Release iocb to the iocb pool.
++ * __lpfc_sli_release_iocbq - Release iocb to the iocb pool
+ * @phba: Pointer to HBA context object.
+ * @iocbq: Pointer to driver iocb object.
+ *
+@@ -164,7 +164,7 @@ __lpfc_sli_release_iocbq(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_release_iocbq: Release iocb to the iocb pool.
++ * lpfc_sli_release_iocbq - Release iocb to the iocb pool
+ * @phba: Pointer to HBA context object.
+ * @iocbq: Pointer to driver iocb object.
+ *
+@@ -185,8 +185,40 @@ lpfc_sli_release_iocbq(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_sli_iocb_cmd_type: Get the iocb type.
+- * @iocb_cmnd : iocb command code.
++ * lpfc_sli_cancel_iocbs - Cancel all iocbs from a list.
++ * @phba: Pointer to HBA context object.
++ * @iocblist: List of IOCBs.
++ * @ulpstatus: ULP status in IOCB command field.
++ * @ulpWord4: ULP word-4 in IOCB command field.
++ *
++ * This function is called with a list of IOCBs to cancel. It cancels the IOCB
++ * on the list by invoking the complete callback function associated with the
++ * IOCB with the provided @ulpstatus and @ulpword4 set to the IOCB commond
++ * fields.
++ **/
++void
++lpfc_sli_cancel_iocbs(struct lpfc_hba *phba, struct list_head *iocblist,
++ uint32_t ulpstatus, uint32_t ulpWord4)
++{
++ struct lpfc_iocbq *piocb;
++
++ while (!list_empty(iocblist)) {
++ list_remove_head(iocblist, piocb, struct lpfc_iocbq, list);
++
++ if (!piocb->iocb_cmpl)
++ lpfc_sli_release_iocbq(phba, piocb);
++ else {
++ piocb->iocb.ulpStatus = ulpstatus;
++ piocb->iocb.un.ulpWord[4] = ulpWord4;
++ (piocb->iocb_cmpl) (phba, piocb, piocb);
++ }
++ }
++ return;
++}
++
++/**
++ * lpfc_sli_iocb_cmd_type - Get the iocb type
++ * @iocb_cmnd: iocb command code.
+ *
+ * This function is called by ring event handler function to get the iocb type.
+ * This function translates the iocb command to an iocb command type used to
+@@ -295,7 +327,7 @@ lpfc_sli_iocb_cmd_type(uint8_t iocb_cmnd
+ }
+
+ /**
+- * lpfc_sli_ring_map: Issue config_ring mbox for all rings.
++ * lpfc_sli_ring_map - Issue config_ring mbox for all rings
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called from SLI initialization code
+@@ -338,7 +370,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_sli_ringtxcmpl_put: Adds new iocb to the txcmplq.
++ * lpfc_sli_ringtxcmpl_put - Adds new iocb to the txcmplq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @piocb: Pointer to the driver iocb object.
+@@ -370,7 +402,7 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_ringtx_get: Get first element of the txq.
++ * lpfc_sli_ringtx_get - Get first element of the txq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -391,7 +423,7 @@ lpfc_sli_ringtx_get(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_sli_next_iocb_slot: Get next iocb slot in the ring.
++ * lpfc_sli_next_iocb_slot - Get next iocb slot in the ring
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -445,7 +477,7 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_next_iotag: Get an iotag for the iocb.
++ * lpfc_sli_next_iotag - Get an iotag for the iocb
+ * @phba: Pointer to HBA context object.
+ * @iocbq: Pointer to driver iocb object.
+ *
+@@ -520,7 +552,7 @@ lpfc_sli_next_iotag(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_sli_submit_iocb: Submit an iocb to the firmware.
++ * lpfc_sli_submit_iocb - Submit an iocb to the firmware
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @iocb: Pointer to iocb slot in the ring.
+@@ -577,7 +609,7 @@ lpfc_sli_submit_iocb(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_update_full_ring: Update the chip attention register.
++ * lpfc_sli_update_full_ring - Update the chip attention register
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -608,7 +640,7 @@ lpfc_sli_update_full_ring(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_sli_update_ring: Update chip attention register.
++ * lpfc_sli_update_ring - Update chip attention register
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -632,7 +664,7 @@ lpfc_sli_update_ring(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_resume_iocb: Process iocbs in the txq.
++ * lpfc_sli_resume_iocb - Process iocbs in the txq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -672,7 +704,7 @@ lpfc_sli_resume_iocb(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_next_hbq_slot: Get next hbq entry for the HBQ.
++ * lpfc_sli_next_hbq_slot - Get next hbq entry for the HBQ
+ * @phba: Pointer to HBA context object.
+ * @hbqno: HBQ number.
+ *
+@@ -717,7 +749,7 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_sli_hbqbuf_free_all: Free all the hbq buffers.
++ * lpfc_sli_hbqbuf_free_all - Free all the hbq buffers
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called with no lock held to free all the
+@@ -771,7 +803,7 @@ lpfc_sli_hbqbuf_free_all(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_hbq_to_firmware: Post the hbq buffer to firmware.
++ * lpfc_sli_hbq_to_firmware - Post the hbq buffer to firmware
+ * @phba: Pointer to HBA context object.
+ * @hbqno: HBQ number.
+ * @hbq_buf: Pointer to HBQ buffer.
+@@ -818,8 +850,8 @@ static struct lpfc_hbq_init lpfc_els_hbq
+ .profile = 0,
+ .ring_mask = (1 << LPFC_ELS_RING),
+ .buffer_count = 0,
+- .init_count = 20,
+- .add_count = 5,
++ .init_count = 40,
++ .add_count = 40,
+ };
+
+ /* HBQ for the extra ring if needed */
+@@ -841,7 +873,7 @@ struct lpfc_hbq_init *lpfc_hbq_defs[] =
+ };
+
+ /**
+- * lpfc_sli_hbqbuf_fill_hbqs: Post more hbq buffers to HBQ.
++ * lpfc_sli_hbqbuf_fill_hbqs - Post more hbq buffers to HBQ
+ * @phba: Pointer to HBA context object.
+ * @hbqno: HBQ number.
+ * @count: Number of HBQ buffers to be posted.
+@@ -901,7 +933,7 @@ err:
+ }
+
+ /**
+- * lpfc_sli_hbqbuf_add_hbqs: Post more HBQ buffers to firmware.
++ * lpfc_sli_hbqbuf_add_hbqs - Post more HBQ buffers to firmware
+ * @phba: Pointer to HBA context object.
+ * @qno: HBQ number.
+ *
+@@ -917,7 +949,7 @@ lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_hbqbuf_init_hbqs: Post initial buffers to the HBQ.
++ * lpfc_sli_hbqbuf_init_hbqs - Post initial buffers to the HBQ
+ * @phba: Pointer to HBA context object.
+ * @qno: HBQ queue number.
+ *
+@@ -933,7 +965,7 @@ lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_sli_hbqbuf_find: Find the hbq buffer associated with a tag.
++ * lpfc_sli_hbqbuf_find - Find the hbq buffer associated with a tag
+ * @phba: Pointer to HBA context object.
+ * @tag: Tag of the hbq buffer.
+ *
+@@ -966,7 +998,7 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_free_hbq: Give back the hbq buffer to firmware.
++ * lpfc_sli_free_hbq - Give back the hbq buffer to firmware
+ * @phba: Pointer to HBA context object.
+ * @hbq_buffer: Pointer to HBQ buffer.
+ *
+@@ -988,7 +1020,7 @@ lpfc_sli_free_hbq(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_sli_chk_mbx_command: Check if the mailbox is a legitimate mailbox.
++ * lpfc_sli_chk_mbx_command - Check if the mailbox is a legitimate mailbox
+ * @mbxCommand: mailbox command code.
+ *
+ * This function is called by the mailbox event handler function to verify
+@@ -1064,8 +1096,7 @@ lpfc_sli_chk_mbx_command(uint8_t mbxComm
+ }
+
+ /**
+- * lpfc_sli_wake_mbox_wait: Completion handler for mbox issued from
+- * lpfc_sli_issue_mbox_wait.
++ * lpfc_sli_wake_mbox_wait - lpfc_sli_issue_mbox_wait mbox completion handler
+ * @phba: Pointer to HBA context object.
+ * @pmboxq: Pointer to mailbox command.
+ *
+@@ -1096,7 +1127,7 @@ lpfc_sli_wake_mbox_wait(struct lpfc_hba
+
+
+ /**
+- * lpfc_sli_def_mbox_cmpl: Default mailbox completion handler.
++ * lpfc_sli_def_mbox_cmpl - Default mailbox completion handler
+ * @phba: Pointer to HBA context object.
+ * @pmb: Pointer to mailbox object.
+ *
+@@ -1140,7 +1171,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_sli_handle_mb_event: Handle mailbox completions from firmware.
++ * lpfc_sli_handle_mb_event - Handle mailbox completions from firmware
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called with no lock held. This function processes all
+@@ -1260,7 +1291,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_get_buff: Get the buffer associated with the buffer tag.
++ * lpfc_sli_get_buff - Get the buffer associated with the buffer tag
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @tag: buffer tag.
+@@ -1288,7 +1319,7 @@ lpfc_sli_get_buff(struct lpfc_hba *phba,
+
+
+ /**
+- * lpfc_sli_process_unsol_iocb: Unsolicited iocb handler.
++ * lpfc_sli_process_unsol_iocb - Unsolicited iocb handler
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @saveq: Pointer to the unsolicited iocb.
+@@ -1484,7 +1515,7 @@ lpfc_sli_process_unsol_iocb(struct lpfc_
+ }
+
+ /**
+- * lpfc_sli_iocbq_lookup: Find command iocb for the given response iocb.
++ * lpfc_sli_iocbq_lookup - Find command iocb for the given response iocb
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @prspiocb: Pointer to response iocb object.
+@@ -1521,7 +1552,7 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_sli_process_sol_iocb: process solicited iocb completion.
++ * lpfc_sli_process_sol_iocb - process solicited iocb completion
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @saveq: Pointer to the response iocb to be processed.
+@@ -1597,7 +1628,7 @@ lpfc_sli_process_sol_iocb(struct lpfc_hb
+ * Ring <ringno> handler: unexpected completion IoTag
+ * <IoTag>
+ */
+- lpfc_printf_vlog(cmdiocbp->vport, KERN_WARNING, LOG_SLI,
++ lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
+ "0322 Ring %d handler: "
+ "unexpected completion IoTag x%x "
+ "Data: x%x x%x x%x x%x\n",
+@@ -1614,7 +1645,7 @@ lpfc_sli_process_sol_iocb(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_sli_rsp_pointers_error: Response ring pointer error handler.
++ * lpfc_sli_rsp_pointers_error - Response ring pointer error handler
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -1652,7 +1683,7 @@ lpfc_sli_rsp_pointers_error(struct lpfc_
+ }
+
+ /**
+- * lpfc_poll_eratt: Error attention polling timer timeout handler.
++ * lpfc_poll_eratt - Error attention polling timer timeout handler
+ * @ptr: Pointer to address of HBA context object.
+ *
+ * This function is invoked by the Error Attention polling timer when the
+@@ -1682,7 +1713,7 @@ void lpfc_poll_eratt(unsigned long ptr)
+ }
+
+ /**
+- * lpfc_sli_poll_fcp_ring: Handle FCP ring completion in polling mode.
++ * lpfc_sli_poll_fcp_ring - Handle FCP ring completion in polling mode
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called from lpfc_queuecommand, lpfc_poll_timeout,
+@@ -1845,7 +1876,7 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_
+ }
+
+ /**
+- * lpfc_sli_handle_fast_ring_event: Handle ring events on FCP ring.
++ * lpfc_sli_handle_fast_ring_event - Handle ring events on FCP ring
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @mask: Host attention register mask for this ring.
+@@ -2037,7 +2068,7 @@ lpfc_sli_handle_fast_ring_event(struct l
+ }
+
+ /**
+- * lpfc_sli_handle_slow_ring_event: Handle ring events for non-FCP rings.
++ * lpfc_sli_handle_slow_ring_event - Handle ring events for non-FCP rings
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @mask: Host attention register mask for this ring.
+@@ -2311,7 +2342,7 @@ lpfc_sli_handle_slow_ring_event(struct l
+ }
+
+ /**
+- * lpfc_sli_abort_iocb_ring: Abort all iocbs in the ring.
++ * lpfc_sli_abort_iocb_ring - Abort all iocbs in the ring
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ *
+@@ -2325,7 +2356,6 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba
+ {
+ LIST_HEAD(completions);
+ struct lpfc_iocbq *iocb, *next_iocb;
+- IOCB_t *cmd = NULL;
+
+ if (pring->ringno == LPFC_ELS_RING) {
+ lpfc_fabric_abort_hba(phba);
+@@ -2344,23 +2374,13 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba
+
+ spin_unlock_irq(&phba->hbalock);
+
+- while (!list_empty(&completions)) {
+- iocb = list_get_first(&completions, struct lpfc_iocbq, list);
+- cmd = &iocb->iocb;
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_ABORTED);
+ }
+
+ /**
+- * lpfc_sli_flush_fcp_rings: flush all iocbs in the fcp ring.
++ * lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring
+ * @phba: Pointer to HBA context object.
+ *
+ * This function flushes all iocbs in the fcp ring and frees all the iocb
+@@ -2374,8 +2394,6 @@ lpfc_sli_flush_fcp_rings(struct lpfc_hba
+ {
+ LIST_HEAD(txq);
+ LIST_HEAD(txcmplq);
+- struct lpfc_iocbq *iocb;
+- IOCB_t *cmd = NULL;
+ struct lpfc_sli *psli = &phba->sli;
+ struct lpfc_sli_ring *pring;
+
+@@ -2393,38 +2411,16 @@ lpfc_sli_flush_fcp_rings(struct lpfc_hba
+ spin_unlock_irq(&phba->hbalock);
+
+ /* Flush the txq */
+- while (!list_empty(&txq)) {
+- iocb = list_get_first(&txq, struct lpfc_iocbq, list);
+- cmd = &iocb->iocb;
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_DOWN;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ lpfc_sli_cancel_iocbs(phba, &txq, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_DOWN);
+
+ /* Flush the txcmpq */
+- while (!list_empty(&txcmplq)) {
+- iocb = list_get_first(&txcmplq, struct lpfc_iocbq, list);
+- cmd = &iocb->iocb;
+- list_del_init(&iocb->list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_DOWN;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ lpfc_sli_cancel_iocbs(phba, &txcmplq, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_DOWN);
+ }
+
+ /**
+- * lpfc_sli_brdready: Check for host status bits.
++ * lpfc_sli_brdready - Check for host status bits
+ * @phba: Pointer to HBA context object.
+ * @mask: Bit mask to be checked.
+ *
+@@ -2484,7 +2480,7 @@ lpfc_sli_brdready(struct lpfc_hba *phba,
+ #define BARRIER_TEST_PATTERN (0xdeadbeef)
+
+ /**
+- * lpfc_reset_barrier: Make HBA ready for HBA reset.
++ * lpfc_reset_barrier - Make HBA ready for HBA reset
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called before resetting an HBA. This
+@@ -2564,7 +2560,7 @@ restore_hc:
+ }
+
+ /**
+- * lpfc_sli_brdkill: Issue a kill_board mailbox command.
++ * lpfc_sli_brdkill - Issue a kill_board mailbox command
+ * @phba: Pointer to HBA context object.
+ *
+ * This function issues a kill_board mailbox command and waits for
+@@ -2651,7 +2647,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_sli_brdreset: Reset the HBA.
++ * lpfc_sli_brdreset - Reset the HBA
+ * @phba: Pointer to HBA context object.
+ *
+ * This function resets the HBA by writing HC_INITFF to the control
+@@ -2714,7 +2710,7 @@ lpfc_sli_brdreset(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_sli_brdrestart: Restart the HBA.
++ * lpfc_sli_brdrestart - Restart the HBA
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called in the SLI initialization code path to
+@@ -2781,7 +2777,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_sli_chipset_init: Wait for the restart of the HBA after a restart.
++ * lpfc_sli_chipset_init - Wait for the restart of the HBA after a restart
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called after a HBA restart to wait for successful
+@@ -2876,7 +2872,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_sli_hbq_count: Get the number of HBQs to be configured.
++ * lpfc_sli_hbq_count - Get the number of HBQs to be configured
+ *
+ * This function calculates and returns the number of HBQs required to be
+ * configured.
+@@ -2888,7 +2884,7 @@ lpfc_sli_hbq_count(void)
+ }
+
+ /**
+- * lpfc_sli_hbq_entry_count: Calculate total number of hbq entries.
++ * lpfc_sli_hbq_entry_count - Calculate total number of hbq entries
+ *
+ * This function adds the number of hbq entries in every HBQ to get
+ * the total number of hbq entries required for the HBA and returns
+@@ -2907,7 +2903,7 @@ lpfc_sli_hbq_entry_count(void)
+ }
+
+ /**
+- * lpfc_sli_hbq_size: Calculate memory required for all hbq entries.
++ * lpfc_sli_hbq_size - Calculate memory required for all hbq entries
+ *
+ * This function calculates amount of memory required for all hbq entries
+ * to be configured and returns the total memory required.
+@@ -2919,7 +2915,7 @@ lpfc_sli_hbq_size(void)
+ }
+
+ /**
+- * lpfc_sli_hbq_setup: configure and initialize HBQs.
++ * lpfc_sli_hbq_setup - configure and initialize HBQs
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called during the SLI initialization to configure
+@@ -2988,7 +2984,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba
+ }
+
+ /**
+- * lpfc_sli_config_port: Issue config port mailbox command.
++ * lpfc_sli_config_port - Issue config port mailbox command
+ * @phba: Pointer to HBA context object.
+ * @sli_mode: sli mode - 2/3
+ *
+@@ -3114,7 +3110,7 @@ do_prep_failed:
+
+
+ /**
+- * lpfc_sli_hba_setup: SLI intialization function.
++ * lpfc_sli_hba_setup - SLI intialization function
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is the main SLI intialization function. This function
+@@ -3206,7 +3202,7 @@ lpfc_sli_hba_setup_error:
+
+
+ /**
+- * lpfc_mbox_timeout: Timeout call back function for mbox timer.
++ * lpfc_mbox_timeout - Timeout call back function for mbox timer
+ * @ptr: context object - pointer to hba structure.
+ *
+ * This is the callback function for mailbox timer. The mailbox
+@@ -3237,7 +3233,7 @@ lpfc_mbox_timeout(unsigned long ptr)
+
+
+ /**
+- * lpfc_mbox_timeout_handler: Worker thread function to handle mailbox timeout.
++ * lpfc_mbox_timeout_handler - Worker thread function to handle mailbox timeout
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called from worker thread when a mailbox command times out.
+@@ -3252,6 +3248,21 @@ lpfc_mbox_timeout_handler(struct lpfc_hb
+ struct lpfc_sli *psli = &phba->sli;
+ struct lpfc_sli_ring *pring;
+
++ /* Check the pmbox pointer first. There is a race condition
++ * between the mbox timeout handler getting executed in the
++ * worklist and the mailbox actually completing. When this
++ * race condition occurs, the mbox_active will be NULL.
++ */
++ spin_lock_irq(&phba->hbalock);
++ if (pmbox == NULL) {
++ lpfc_printf_log(phba, KERN_WARNING,
++ LOG_MBOX | LOG_SLI,
++ "0353 Active Mailbox cleared - mailbox timeout "
++ "exiting\n");
++ spin_unlock_irq(&phba->hbalock);
++ return;
++ }
++
+ /* Mbox cmd <mbxCommand> timeout */
+ lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
+ "0310 Mailbox command x%x timeout Data: x%x x%x x%p\n",
+@@ -3259,6 +3270,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hb
+ phba->pport->port_state,
+ phba->sli.sli_flag,
+ phba->sli.mbox_active);
++ spin_unlock_irq(&phba->hbalock);
+
+ /* Setting state unknown so lpfc_sli_abort_iocb_ring
+ * would get IOCB_ERROR from lpfc_sli_issue_iocb, allowing
+@@ -3295,7 +3307,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_sli_issue_mbox: Issue a mailbox command to firmware.
++ * lpfc_sli_issue_mbox - Issue a mailbox command to firmware
+ * @phba: Pointer to HBA context object.
+ * @pmbox: Pointer to mailbox object.
+ * @flag: Flag indicating how the mailbox need to be processed.
+@@ -3365,6 +3377,12 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phb
+ goto out_not_finished;
+ }
+
++ /* If HBA has a deferred error attention, fail the iocb. */
++ if (unlikely(phba->hba_flag & DEFER_ERATT)) {
++ spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
++ goto out_not_finished;
++ }
++
+ psli = &phba->sli;
+
+ mb = &pmbox->mb;
+@@ -3632,7 +3650,7 @@ out_not_finished:
+ }
+
+ /**
+- * __lpfc_sli_ringtx_put: Add an iocb to the txq.
++ * __lpfc_sli_ringtx_put - Add an iocb to the txq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @piocb: Pointer to address of newly added command iocb.
+@@ -3651,7 +3669,7 @@ __lpfc_sli_ringtx_put(struct lpfc_hba *p
+ }
+
+ /**
+- * lpfc_sli_next_iocb: Get the next iocb in the txq.
++ * lpfc_sli_next_iocb - Get the next iocb in the txq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @piocb: Pointer to address of newly added command iocb.
+@@ -3683,7 +3701,7 @@ lpfc_sli_next_iocb(struct lpfc_hba *phba
+ }
+
+ /**
+- * __lpfc_sli_issue_iocb: Lockless version of lpfc_sli_issue_iocb.
++ * __lpfc_sli_issue_iocb - Lockless version of lpfc_sli_issue_iocb
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @piocb: Pointer to command iocb.
+@@ -3729,6 +3747,10 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *p
+ if (unlikely(pci_channel_offline(phba->pcidev)))
+ return IOCB_ERROR;
+
++ /* If HBA has a deferred error attention, fail the iocb. */
++ if (unlikely(phba->hba_flag & DEFER_ERATT))
++ return IOCB_ERROR;
++
+ /*
+ * We should never get an IOCB if we are in a < LINK_DOWN state
+ */
+@@ -3813,7 +3835,7 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *p
+
+
+ /**
+- * lpfc_sli_issue_iocb: Wrapper function for __lpfc_sli_issue_iocb.
++ * lpfc_sli_issue_iocb - Wrapper function for __lpfc_sli_issue_iocb
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @piocb: Pointer to command iocb.
+@@ -3840,7 +3862,7 @@ lpfc_sli_issue_iocb(struct lpfc_hba *phb
+ }
+
+ /**
+- * lpfc_extra_ring_setup: Extra ring setup function.
++ * lpfc_extra_ring_setup - Extra ring setup function
+ * @phba: Pointer to HBA context object.
+ *
+ * This function is called while driver attaches with the
+@@ -3886,7 +3908,7 @@ lpfc_extra_ring_setup( struct lpfc_hba *
+ }
+
+ /**
+- * lpfc_sli_async_event_handler: ASYNC iocb handler function.
++ * lpfc_sli_async_event_handler - ASYNC iocb handler function
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @iocbq: Pointer to iocb object.
+@@ -3907,6 +3929,7 @@ lpfc_sli_async_event_handler(struct lpfc
+ uint16_t temp;
+ struct temp_event temp_event_data;
+ struct Scsi_Host *shost;
++ uint32_t *iocb_w;
+
+ icmd = &iocbq->iocb;
+ evt_code = icmd->un.asyncstat.evt_code;
+@@ -3914,13 +3937,23 @@ lpfc_sli_async_event_handler(struct lpfc
+
+ if ((evt_code != ASYNC_TEMP_WARN) &&
+ (evt_code != ASYNC_TEMP_SAFE)) {
++ iocb_w = (uint32_t *) icmd;
+ lpfc_printf_log(phba,
+ KERN_ERR,
+ LOG_SLI,
+ "0346 Ring %d handler: unexpected ASYNC_STATUS"
+- " evt_code 0x%x\n",
++ " evt_code 0x%x \n"
++ "W0 0x%08x W1 0x%08x W2 0x%08x W3 0x%08x\n"
++ "W4 0x%08x W5 0x%08x W6 0x%08x W7 0x%08x\n"
++ "W8 0x%08x W9 0x%08x W10 0x%08x W11 0x%08x\n"
++ "W12 0x%08x W13 0x%08x W14 0x%08x W15 0x%08x\n",
+ pring->ringno,
+- icmd->un.asyncstat.evt_code);
++ icmd->un.asyncstat.evt_code,
++ iocb_w[0], iocb_w[1], iocb_w[2], iocb_w[3],
++ iocb_w[4], iocb_w[5], iocb_w[6], iocb_w[7],
++ iocb_w[8], iocb_w[9], iocb_w[10], iocb_w[11],
++ iocb_w[12], iocb_w[13], iocb_w[14], iocb_w[15]);
++
+ return;
+ }
+ temp_event_data.data = (uint32_t)temp;
+@@ -3954,7 +3987,7 @@ lpfc_sli_async_event_handler(struct lpfc
+
+
+ /**
+- * lpfc_sli_setup: SLI ring setup function.
++ * lpfc_sli_setup - SLI ring setup function
+ * @phba: Pointer to HBA context object.
+ *
+ * lpfc_sli_setup sets up rings of the SLI interface with
+@@ -4076,7 +4109,7 @@ lpfc_sli_setup(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_sli_queue_setup: Queue initialization function.
++ * lpfc_sli_queue_setup - Queue initialization function
+ * @phba: Pointer to HBA context object.
+ *
+ * lpfc_sli_queue_setup sets up mailbox queues and iocb queues for each
+@@ -4115,7 +4148,7 @@ lpfc_sli_queue_setup(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_host_down: Vport cleanup function.
++ * lpfc_sli_host_down - Vport cleanup function
+ * @vport: Pointer to virtual port object.
+ *
+ * lpfc_sli_host_down is called to clean up the resources
+@@ -4179,22 +4212,14 @@ lpfc_sli_host_down(struct lpfc_vport *vp
+
+ spin_unlock_irqrestore(&phba->hbalock, flags);
+
+- while (!list_empty(&completions)) {
+- list_remove_head(&completions, iocb, struct lpfc_iocbq, list);
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- iocb->iocb.ulpStatus = IOSTAT_LOCAL_REJECT;
+- iocb->iocb.un.ulpWord[4] = IOERR_SLI_DOWN;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_DOWN);
+ return 1;
+ }
+
+ /**
+- * lpfc_sli_hba_down: Resource cleanup function for the HBA.
++ * lpfc_sli_hba_down - Resource cleanup function for the HBA
+ * @phba: Pointer to HBA context object.
+ *
+ * This function cleans up all iocb, buffers, mailbox commands
+@@ -4216,8 +4241,6 @@ lpfc_sli_hba_down(struct lpfc_hba *phba)
+ struct lpfc_sli_ring *pring;
+ struct lpfc_dmabuf *buf_ptr;
+ LPFC_MBOXQ_t *pmb;
+- struct lpfc_iocbq *iocb;
+- IOCB_t *cmd = NULL;
+ int i;
+ unsigned long flags = 0;
+
+@@ -4245,18 +4268,9 @@ lpfc_sli_hba_down(struct lpfc_hba *phba)
+ }
+ spin_unlock_irqrestore(&phba->hbalock, flags);
+
+- while (!list_empty(&completions)) {
+- list_remove_head(&completions, iocb, struct lpfc_iocbq, list);
+- cmd = &iocb->iocb;
+-
+- if (!iocb->iocb_cmpl)
+- lpfc_sli_release_iocbq(phba, iocb);
+- else {
+- cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
+- cmd->un.ulpWord[4] = IOERR_SLI_DOWN;
+- (iocb->iocb_cmpl) (phba, iocb, iocb);
+- }
+- }
++ /* Cancel all the IOCBs from the completions list */
++ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
++ IOERR_SLI_DOWN);
+
+ spin_lock_irqsave(&phba->hbalock, flags);
+ list_splice_init(&phba->elsbuf, &completions);
+@@ -4299,7 +4313,7 @@ lpfc_sli_hba_down(struct lpfc_hba *phba)
+ }
+
+ /**
+- * lpfc_sli_pcimem_bcopy: SLI memory copy function.
++ * lpfc_sli_pcimem_bcopy - SLI memory copy function
+ * @srcp: Source memory pointer.
+ * @destp: Destination memory pointer.
+ * @cnt: Number of words required to be copied.
+@@ -4329,7 +4343,7 @@ lpfc_sli_pcimem_bcopy(void *srcp, void *
+
+
+ /**
+- * lpfc_sli_ringpostbuf_put: Function to add a buffer to postbufq.
++ * lpfc_sli_ringpostbuf_put - Function to add a buffer to postbufq
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @mp: Pointer to driver buffer object.
+@@ -4352,8 +4366,7 @@ lpfc_sli_ringpostbuf_put(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_get_buffer_tag: Tag allocation function for a buffer posted
+- * using CMD_QUE_XRI64_CX iocb.
++ * lpfc_sli_get_buffer_tag - allocates a tag for a CMD_QUE_XRI64_CX buffer
+ * @phba: Pointer to HBA context object.
+ *
+ * When HBQ is enabled, buffers are searched based on tags. This function
+@@ -4378,8 +4391,7 @@ lpfc_sli_get_buffer_tag(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_ring_taggedbuf_get: Search HBQ buffer associated with
+- * posted using CMD_QUE_XRI64_CX iocb.
++ * lpfc_sli_ring_taggedbuf_get - find HBQ buffer associated with given tag
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @tag: Buffer tag.
+@@ -4422,8 +4434,7 @@ lpfc_sli_ring_taggedbuf_get(struct lpfc_
+ }
+
+ /**
+- * lpfc_sli_ringpostbuf_get: SLI2 buffer search function for
+- * unsolicited ct and els events.
++ * lpfc_sli_ringpostbuf_get - search buffers for unsolicited CT and ELS events
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @phys: DMA address of the buffer.
+@@ -4466,7 +4477,7 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_abort_els_cmpl: Completion handler for the els abort iocbs.
++ * lpfc_sli_abort_els_cmpl - Completion handler for the els abort iocbs
+ * @phba: Pointer to HBA context object.
+ * @cmdiocb: Pointer to driver command iocb object.
+ * @rspiocb: Pointer to driver response iocb object.
+@@ -4542,7 +4553,7 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_ignore_els_cmpl: Completion handler for aborted ELS command.
++ * lpfc_ignore_els_cmpl - Completion handler for aborted ELS command
+ * @phba: Pointer to HBA context object.
+ * @cmdiocb: Pointer to driver command iocb object.
+ * @rspiocb: Pointer to driver response iocb object.
+@@ -4572,7 +4583,7 @@ lpfc_ignore_els_cmpl(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sli_issue_abort_iotag: Abort function for a command iocb.
++ * lpfc_sli_issue_abort_iotag - Abort function for a command iocb
+ * @phba: Pointer to HBA context object.
+ * @pring: Pointer to driver SLI ring object.
+ * @cmdiocb: Pointer to driver command iocb object.
+@@ -4658,15 +4669,14 @@ abort_iotag_exit:
+ }
+
+ /**
+- * lpfc_sli_validate_fcp_iocb: Filtering function, used to find commands
+- * associated with a vport/SCSI target/lun.
++ * lpfc_sli_validate_fcp_iocb - find commands associated with a vport or LUN
+ * @iocbq: Pointer to driver iocb object.
+ * @vport: Pointer to driver virtual port object.
+ * @tgt_id: SCSI ID of the target.
+ * @lun_id: LUN ID of the scsi device.
+ * @ctx_cmd: LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST
+ *
+- * This function acts as iocb filter for functions which abort or count
++ * This function acts as an iocb filter for functions which abort or count
+ * all FCP iocbs pending on a lun/SCSI target/SCSI host. It will return
+ * 0 if the filtering criteria is met for the given iocb and will return
+ * 1 if the filtering criteria is not met.
+@@ -4724,7 +4734,7 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_i
+ }
+
+ /**
+- * lpfc_sli_sum_iocb: Function to count the number of FCP iocbs pending.
++ * lpfc_sli_sum_iocb - Function to count the number of FCP iocbs pending
+ * @vport: Pointer to virtual port.
+ * @tgt_id: SCSI ID of the target.
+ * @lun_id: LUN ID of the scsi device.
+@@ -4762,8 +4772,7 @@ lpfc_sli_sum_iocb(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_sli_abort_fcp_cmpl: Completion handler function for an aborted
+- * FCP iocb.
++ * lpfc_sli_abort_fcp_cmpl - Completion handler function for aborted FCP IOCBs
+ * @phba: Pointer to HBA context object
+ * @cmdiocb: Pointer to command iocb object.
+ * @rspiocb: Pointer to response iocb object.
+@@ -4781,8 +4790,7 @@ lpfc_sli_abort_fcp_cmpl(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_abort_iocb: This function issue abort for all SCSI commands
+- * pending on a SCSI host(vport)/target/lun.
++ * lpfc_sli_abort_iocb - issue abort for all commands on a host/target/LUN
+ * @vport: Pointer to virtual port.
+ * @pring: Pointer to driver SLI ring object.
+ * @tgt_id: SCSI ID of the target.
+@@ -4854,8 +4862,7 @@ lpfc_sli_abort_iocb(struct lpfc_vport *v
+ }
+
+ /**
+- * lpfc_sli_wake_iocb_wait: iocb completion handler for iocb issued using
+- * lpfc_sli_issue_iocb_wait.
++ * lpfc_sli_wake_iocb_wait - lpfc_sli_issue_iocb_wait's completion handler
+ * @phba: Pointer to HBA context object.
+ * @cmdiocbq: Pointer to command iocb.
+ * @rspiocbq: Pointer to response iocb.
+@@ -4893,7 +4900,7 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_issue_iocb_wait: Synchronous function to issue iocb commands.
++ * lpfc_sli_issue_iocb_wait - Synchronous function to issue iocb commands
+ * @phba: Pointer to HBA context object..
+ * @pring: Pointer to sli ring.
+ * @piocb: Pointer to command iocb.
+@@ -5000,7 +5007,7 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_issue_mbox_wait: Synchronous function to issue mailbox.
++ * lpfc_sli_issue_mbox_wait - Synchronous function to issue mailbox
+ * @phba: Pointer to HBA context object.
+ * @pmboxq: Pointer to driver mailbox object.
+ * @timeout: Timeout in number of seconds.
+@@ -5070,7 +5077,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba
+ }
+
+ /**
+- * lpfc_sli_flush_mbox_queue: mailbox queue cleanup function.
++ * lpfc_sli_flush_mbox_queue - mailbox queue cleanup function
+ * @phba: Pointer to HBA context.
+ *
+ * This function is called to cleanup any pending mailbox
+@@ -5113,7 +5120,7 @@ lpfc_sli_flush_mbox_queue(struct lpfc_hb
+ }
+
+ /**
+- * lpfc_sli_check_eratt: check error attention events
++ * lpfc_sli_check_eratt - check error attention events
+ * @phba: Pointer to HBA context.
+ *
+ * This function is called form timer soft interrupt context to check HBA's
+@@ -5145,11 +5152,31 @@ lpfc_sli_check_eratt(struct lpfc_hba *ph
+ return 0;
+ }
+
++ /*
++ * If there is deferred error attention, do not check for error
++ * attention
++ */
++ if (unlikely(phba->hba_flag & DEFER_ERATT)) {
++ spin_unlock_irq(&phba->hbalock);
++ return 0;
++ }
++
+ /* Read chip Host Attention (HA) register */
+ ha_copy = readl(phba->HAregaddr);
+ if (ha_copy & HA_ERATT) {
+ /* Read host status register to retrieve error event */
+ lpfc_sli_read_hs(phba);
++
++ /* Check if there is a deferred error condition is active */
++ if ((HS_FFER1 & phba->work_hs) &&
++ ((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 |
++ HS_FFER6 | HS_FFER7) & phba->work_hs)) {
++ phba->hba_flag |= DEFER_ERATT;
++ /* Clear all interrupt enable conditions */
++ writel(0, phba->HCregaddr);
++ readl(phba->HCregaddr);
++ }
++
+ /* Set the driver HA work bitmap */
+ phba->work_ha |= HA_ERATT;
+ /* Indicate polling handles this ERATT */
+@@ -5162,7 +5189,7 @@ lpfc_sli_check_eratt(struct lpfc_hba *ph
+ }
+
+ /**
+- * lpfc_sp_intr_handler: The slow-path interrupt handler of lpfc driver.
++ * lpfc_sp_intr_handler - The slow-path interrupt handler of lpfc driver
+ * @irq: Interrupt number.
+ * @dev_id: The device context pointer.
+ *
+@@ -5238,6 +5265,16 @@ lpfc_sp_intr_handler(int irq, void *dev_
+ /* Indicate interrupt handler handles ERATT */
+ phba->hba_flag |= HBA_ERATT_HANDLED;
+ }
++
++ /*
++ * If there is deferred error attention, do not check for any
++ * interrupt.
++ */
++ if (unlikely(phba->hba_flag & DEFER_ERATT)) {
++ spin_unlock_irq(&phba->hbalock);
++ return IRQ_NONE;
++ }
++
+ /* Clear up only attention source related to slow-path */
+ writel((ha_copy & (HA_MBATT | HA_R2_CLR_MSK)),
+ phba->HAregaddr);
+@@ -5309,8 +5346,22 @@ lpfc_sp_intr_handler(int irq, void *dev_
+ }
+ }
+ spin_lock_irqsave(&phba->hbalock, iflag);
+- if (work_ha_copy & HA_ERATT)
++ if (work_ha_copy & HA_ERATT) {
+ lpfc_sli_read_hs(phba);
++ /*
++ * Check if there is a deferred error condition
++ * is active
++ */
++ if ((HS_FFER1 & phba->work_hs) &&
++ ((HS_FFER2 | HS_FFER3 | HS_FFER4 | HS_FFER5 |
++ HS_FFER6 | HS_FFER7) & phba->work_hs)) {
++ phba->hba_flag |= DEFER_ERATT;
++ /* Clear all interrupt enable conditions */
++ writel(0, phba->HCregaddr);
++ readl(phba->HCregaddr);
++ }
++ }
++
+ if ((work_ha_copy & HA_MBATT) && (phba->sli.mbox_active)) {
+ pmb = phba->sli.mbox_active;
+ pmbox = &pmb->mb;
+@@ -5423,7 +5474,7 @@ send_current_mbox:
+ } /* lpfc_sp_intr_handler */
+
+ /**
+- * lpfc_fp_intr_handler: The fast-path interrupt handler of lpfc driver.
++ * lpfc_fp_intr_handler - The fast-path interrupt handler of lpfc driver
+ * @irq: Interrupt number.
+ * @dev_id: The device context pointer.
+ *
+@@ -5474,6 +5525,14 @@ lpfc_fp_intr_handler(int irq, void *dev_
+ ha_copy = readl(phba->HAregaddr);
+ /* Clear up only attention source related to fast-path */
+ spin_lock_irqsave(&phba->hbalock, iflag);
++ /*
++ * If there is deferred error attention, do not check for
++ * any interrupt.
++ */
++ if (unlikely(phba->hba_flag & DEFER_ERATT)) {
++ spin_unlock_irq(&phba->hbalock);
++ return IRQ_NONE;
++ }
+ writel((ha_copy & (HA_R0_CLR_MSK | HA_R1_CLR_MSK)),
+ phba->HAregaddr);
+ readl(phba->HAregaddr); /* flush */
+@@ -5510,7 +5569,7 @@ lpfc_fp_intr_handler(int irq, void *dev_
+ } /* lpfc_fp_intr_handler */
+
+ /**
+- * lpfc_intr_handler: The device-level interrupt handler of lpfc driver.
++ * lpfc_intr_handler - The device-level interrupt handler of lpfc driver
+ * @irq: Interrupt number.
+ * @dev_id: The device context pointer.
+ *
+@@ -5566,6 +5625,14 @@ lpfc_intr_handler(int irq, void *dev_id)
+ phba->hba_flag |= HBA_ERATT_HANDLED;
+ }
+
++ /*
++ * If there is deferred error attention, do not check for any interrupt.
++ */
++ if (unlikely(phba->hba_flag & DEFER_ERATT)) {
++ spin_unlock_irq(&phba->hbalock);
++ return IRQ_NONE;
++ }
++
+ /* Clear attention sources except link and error attentions */
+ writel((phba->ha_copy & ~(HA_LATT | HA_ERATT)), phba->HAregaddr);
+ readl(phba->HAregaddr); /* flush */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_version.h linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_version.h
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_version.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_version.h 2009-05-13 09:46:19.000000000 +0200
+@@ -1,7 +1,7 @@
+ /*******************************************************************
+ * This file is part of the Emulex Linux Device Driver for *
+ * Fibre Channel Host Bus Adapters. *
+- * Copyright (C) 2004-2008 Emulex. All rights reserved. *
++ * Copyright (C) 2004-2009 Emulex. All rights reserved. *
+ * EMULEX and SLI are trademarks of Emulex. *
+ * www.emulex.com *
+ * *
+@@ -18,7 +18,7 @@
+ * included with this package. *
+ *******************************************************************/
+
+-#define LPFC_DRIVER_VERSION "8.3.0"
++#define LPFC_DRIVER_VERSION "8.3.1"
+
+ #define LPFC_DRIVER_NAME "lpfc"
+ #define LPFC_SP_DRIVER_HANDLER_NAME "lpfc:sp"
+@@ -26,4 +26,4 @@
+
+ #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \
+ LPFC_DRIVER_VERSION
+-#define LPFC_COPYRIGHT "Copyright(c) 2004-2008 Emulex. All rights reserved."
++#define LPFC_COPYRIGHT "Copyright(c) 2004-2009 Emulex. All rights reserved."
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_vport.c linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_vport.c
+--- linux-2.6.30-rc4/drivers/scsi/lpfc/lpfc_vport.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/lpfc/lpfc_vport.c 2009-05-13 09:46:19.000000000 +0200
+@@ -206,7 +206,7 @@ lpfc_unique_wwpn(struct lpfc_hba *phba,
+ }
+
+ /**
+- * lpfc_discovery_wait: Wait for driver discovery to quiesce.
++ * lpfc_discovery_wait - Wait for driver discovery to quiesce
+ * @vport: The virtual port for which this call is being executed.
+ *
+ * This driver calls this routine specifically from lpfc_vport_delete
+@@ -741,7 +741,7 @@ lpfc_destroy_vport_work_array(struct lpf
+
+
+ /**
+- * lpfc_vport_reset_stat_data: Reset the statistical data for the vport.
++ * lpfc_vport_reset_stat_data - Reset the statistical data for the vport
+ * @vport: Pointer to vport object.
+ *
+ * This function resets the statistical data for the vport. This function
+@@ -763,8 +763,7 @@ lpfc_vport_reset_stat_data(struct lpfc_v
+
+
+ /**
+- * lpfc_alloc_bucket: Allocate data buffer required for collecting
+- * statistical data.
++ * lpfc_alloc_bucket - Allocate data buffer required for statistical data
+ * @vport: Pointer to vport object.
+ *
+ * This function allocates data buffer required for all the FC
+@@ -797,8 +796,7 @@ lpfc_alloc_bucket(struct lpfc_vport *vpo
+ }
+
+ /**
+- * lpfc_free_bucket: Free data buffer required for collecting
+- * statistical data.
++ * lpfc_free_bucket - Free data buffer required for statistical data
+ * @vport: Pointer to vport object.
+ *
+ * Th function frees statistical data buffer of all the FC
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_base.c linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_base.c
+--- linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_base.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_base.c 2009-05-13 09:46:19.000000000 +0200
+@@ -636,6 +636,14 @@ _base_unmask_interrupts(struct MPT2SAS_A
+ static irqreturn_t
+ _base_interrupt(int irq, void *bus_id)
+ {
++ union reply_descriptor {
++ u64 word;
++ struct {
++ u32 low;
++ u32 high;
++ } u;
++ };
++ union reply_descriptor rd;
+ u32 post_index, post_index_next, completed_cmds;
+ u8 request_desript_type;
+ u16 smid;
+@@ -656,7 +664,8 @@ _base_interrupt(int irq, void *bus_id)
+
+ completed_cmds = 0;
+ do {
+- if (ioc->reply_post_free[post_index].Words == ~0ULL)
++ rd.word = ioc->reply_post_free[post_index].Words;
++ if (rd.u.low == UINT_MAX || rd.u.high == UINT_MAX)
+ goto out;
+ reply = 0;
+ cb_idx = 0xFF;
+@@ -721,7 +730,7 @@ _base_interrupt(int irq, void *bus_id)
+ for (i = 0 ; i < completed_cmds; i++) {
+ post_index = post_index_next;
+ /* poison the reply post descriptor */
+- ioc->reply_post_free[post_index_next].Words = ~0ULL;
++ ioc->reply_post_free[post_index_next].Words = ULLONG_MAX;
+ post_index_next = (post_index ==
+ (ioc->reply_post_queue_depth - 1))
+ ? 0 : post_index + 1;
+@@ -1387,6 +1396,64 @@ mpt2sas_base_put_smid_target_assist(stru
+ }
+
+ /**
++ * _base_display_dell_branding - Disply branding string
++ * @ioc: per adapter object
++ *
++ * Return nothing.
++ */
++static void
++_base_display_dell_branding(struct MPT2SAS_ADAPTER *ioc)
++{
++ char dell_branding[MPT2SAS_DELL_BRANDING_SIZE];
++
++ if (ioc->pdev->subsystem_vendor != PCI_VENDOR_ID_DELL)
++ return;
++
++ memset(dell_branding, 0, MPT2SAS_DELL_BRANDING_SIZE);
++ switch (ioc->pdev->subsystem_device) {
++ case MPT2SAS_DELL_6GBPS_SAS_HBA_SSDID:
++ strncpy(dell_branding, MPT2SAS_DELL_6GBPS_SAS_HBA_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_PERC_H200_ADAPTER_SSDID:
++ strncpy(dell_branding, MPT2SAS_DELL_PERC_H200_ADAPTER_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_PERC_H200_INTEGRATED_SSDID:
++ strncpy(dell_branding,
++ MPT2SAS_DELL_PERC_H200_INTEGRATED_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_PERC_H200_MODULAR_SSDID:
++ strncpy(dell_branding,
++ MPT2SAS_DELL_PERC_H200_MODULAR_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_PERC_H200_EMBEDDED_SSDID:
++ strncpy(dell_branding,
++ MPT2SAS_DELL_PERC_H200_EMBEDDED_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_PERC_H200_SSDID:
++ strncpy(dell_branding, MPT2SAS_DELL_PERC_H200_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ case MPT2SAS_DELL_6GBPS_SAS_SSDID:
++ strncpy(dell_branding, MPT2SAS_DELL_6GBPS_SAS_BRANDING,
++ MPT2SAS_DELL_BRANDING_SIZE - 1);
++ break;
++ default:
++ sprintf(dell_branding, "0x%4X", ioc->pdev->subsystem_device);
++ break;
++ }
++
++ printk(MPT2SAS_INFO_FMT "%s: Vendor(0x%04X), Device(0x%04X),"
++ " SSVID(0x%04X), SSDID(0x%04X)\n", ioc->name, dell_branding,
++ ioc->pdev->vendor, ioc->pdev->device, ioc->pdev->subsystem_vendor,
++ ioc->pdev->subsystem_device);
++}
++
++/**
+ * _base_display_ioc_capabilities - Disply IOC's capabilities.
+ * @ioc: per adapter object
+ *
+@@ -1427,6 +1494,8 @@ _base_display_ioc_capabilities(struct MP
+ i++;
+ }
+
++ _base_display_dell_branding(ioc);
++
+ i = 0;
+ printk("), ");
+ printk("Capabilities=(");
+@@ -3068,7 +3137,7 @@ _base_make_ioc_operational(struct MPT2SA
+
+ /* initialize Reply Post Free Queue */
+ for (i = 0; i < ioc->reply_post_queue_depth; i++)
+- ioc->reply_post_free[i].Words = ~0ULL;
++ ioc->reply_post_free[i].Words = ULLONG_MAX;
+
+ r = _base_send_ioc_init(ioc, VF_ID, sleep_flag);
+ if (r)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_base.h linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_base.h
+--- linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_base.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_base.h 2009-05-13 09:46:19.000000000 +0200
+@@ -68,11 +68,11 @@
+ #define MPT2SAS_DRIVER_NAME "mpt2sas"
+ #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>"
+ #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver"
+-#define MPT2SAS_DRIVER_VERSION "00.100.11.16"
++#define MPT2SAS_DRIVER_VERSION "01.100.02.00"
+ #define MPT2SAS_MAJOR_VERSION 00
+ #define MPT2SAS_MINOR_VERSION 100
+-#define MPT2SAS_BUILD_VERSION 11
+-#define MPT2SAS_RELEASE_VERSION 16
++#define MPT2SAS_BUILD_VERSION 02
++#define MPT2SAS_RELEASE_VERSION 00
+
+ /*
+ * Set MPT2SAS_SG_DEPTH value based on user input.
+@@ -130,6 +130,30 @@
+ #define MPT2SAS_ERR_FMT KERN_ERR MPT2SAS_FMT
+
+ /*
++ * Dell HBA branding
++ */
++#define MPT2SAS_DELL_BRANDING_SIZE 32
++
++#define MPT2SAS_DELL_6GBPS_SAS_HBA_BRANDING "Dell 6Gbps SAS HBA"
++#define MPT2SAS_DELL_PERC_H200_ADAPTER_BRANDING "Dell PERC H200 Adapter"
++#define MPT2SAS_DELL_PERC_H200_INTEGRATED_BRANDING "Dell PERC H200 Integrated"
++#define MPT2SAS_DELL_PERC_H200_MODULAR_BRANDING "Dell PERC H200 Modular"
++#define MPT2SAS_DELL_PERC_H200_EMBEDDED_BRANDING "Dell PERC H200 Embedded"
++#define MPT2SAS_DELL_PERC_H200_BRANDING "Dell PERC H200"
++#define MPT2SAS_DELL_6GBPS_SAS_BRANDING "Dell 6Gbps SAS"
++
++/*
++ * Dell HBA SSDIDs
++ */
++#define MPT2SAS_DELL_6GBPS_SAS_HBA_SSDID 0x1F1C
++#define MPT2SAS_DELL_PERC_H200_ADAPTER_SSDID 0x1F1D
++#define MPT2SAS_DELL_PERC_H200_INTEGRATED_SSDID 0x1F1E
++#define MPT2SAS_DELL_PERC_H200_MODULAR_SSDID 0x1F1F
++#define MPT2SAS_DELL_PERC_H200_EMBEDDED_SSDID 0x1F20
++#define MPT2SAS_DELL_PERC_H200_SSDID 0x1F21
++#define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22
++
++/*
+ * per target private data
+ */
+ #define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_ctl.c linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+--- linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_ctl.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_ctl.c 2009-05-13 09:46:19.000000000 +0200
+@@ -64,6 +64,9 @@
+ static struct fasync_struct *async_queue;
+ static DECLARE_WAIT_QUEUE_HEAD(ctl_poll_wait);
+
++static int _ctl_send_release(struct MPT2SAS_ADAPTER *ioc, u8 buffer_type,
++ u8 *issue_reset);
++
+ /**
+ * enum block_state - blocking state
+ * @NON_BLOCKING: non blocking
+@@ -378,10 +381,22 @@ _ctl_verify_adapter(int ioc_number, stru
+ void
+ mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
+ {
++ int i;
++ u8 issue_reset;
++
+ switch (reset_phase) {
+ case MPT2_IOC_PRE_RESET:
+ dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
+ "MPT2_IOC_PRE_RESET\n", ioc->name, __func__));
++ for (i = 0; i < MPI2_DIAG_BUF_TYPE_COUNT; i++) {
++ if (!(ioc->diag_buffer_status[i] &
++ MPT2_DIAG_BUFFER_IS_REGISTERED))
++ continue;
++ if ((ioc->diag_buffer_status[i] &
++ MPT2_DIAG_BUFFER_IS_RELEASED))
++ continue;
++ _ctl_send_release(ioc, i, &issue_reset);
++ }
+ break;
+ case MPT2_IOC_AFTER_RESET:
+ dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
+@@ -395,6 +410,17 @@ mpt2sas_ctl_reset_handler(struct MPT2SAS
+ case MPT2_IOC_DONE_RESET:
+ dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
+ "MPT2_IOC_DONE_RESET\n", ioc->name, __func__));
++
++ for (i = 0; i < MPI2_DIAG_BUF_TYPE_COUNT; i++) {
++ if (!(ioc->diag_buffer_status[i] &
++ MPT2_DIAG_BUFFER_IS_REGISTERED))
++ continue;
++ if ((ioc->diag_buffer_status[i] &
++ MPT2_DIAG_BUFFER_IS_RELEASED))
++ continue;
++ ioc->diag_buffer_status[i] |=
++ MPT2_DIAG_BUFFER_IS_DIAG_RESET;
++ }
+ break;
+ }
+ }
+@@ -714,8 +740,10 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPT
+
+ if (tm_request->TaskType ==
+ MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
+- if (_ctl_do_task_abort(ioc, &karg, tm_request))
++ if (_ctl_do_task_abort(ioc, &karg, tm_request)) {
++ mpt2sas_base_free_smid(ioc, smid);
+ goto out;
++ }
+ }
+
+ mutex_lock(&ioc->tm_cmds.mutex);
+@@ -915,9 +943,9 @@ _ctl_getiocinfo(void __user *arg)
+ karg.pci_information.u.bits.function = PCI_FUNC(ioc->pdev->devfn);
+ karg.pci_information.segment_id = pci_domain_nr(ioc->pdev->bus);
+ karg.firmware_version = ioc->facts.FWVersion.Word;
+- strncpy(karg.driver_version, MPT2SAS_DRIVER_VERSION,
+- MPT2_IOCTL_VERSION_LENGTH);
+- karg.driver_version[MPT2_IOCTL_VERSION_LENGTH - 1] = '\0';
++ strcpy(karg.driver_version, MPT2SAS_DRIVER_NAME);
++ strcat(karg.driver_version, "-");
++ strcat(karg.driver_version, MPT2SAS_DRIVER_VERSION);
+ karg.bios_version = le32_to_cpu(ioc->bios_pg3.BiosVersion);
+
+ if (copy_to_user(arg, &karg, sizeof(karg))) {
+@@ -1551,81 +1579,38 @@ _ctl_diag_query(void __user *arg)
+ }
+
+ /**
+- * _ctl_diag_release - request to send Diag Release Message to firmware
+- * @arg - user space buffer containing ioctl content
+- * @state - NON_BLOCKING or BLOCKING
++ * _ctl_send_release - Diag Release Message
++ * @ioc: per adapter object
++ * @buffer_type - specifies either TRACE or SNAPSHOT
++ * @issue_reset - specifies whether host reset is required.
+ *
+- * This allows ownership of the specified buffer to returned to the driver,
+- * allowing an application to read the buffer without fear that firmware is
+- * overwritting information in the buffer.
+ */
+-static long
+-_ctl_diag_release(void __user *arg, enum block_state state)
++static int
++_ctl_send_release(struct MPT2SAS_ADAPTER *ioc, u8 buffer_type, u8 *issue_reset)
+ {
+- struct mpt2_diag_release karg;
+- struct MPT2SAS_ADAPTER *ioc;
+- void *request_data;
+- int rc;
+ Mpi2DiagReleaseRequest_t *mpi_request;
+ Mpi2DiagReleaseReply_t *mpi_reply;
+- u8 buffer_type;
+- unsigned long timeleft;
+ u16 smid;
+ u16 ioc_status;
+- u8 issue_reset = 0;
+-
+- if (copy_from_user(&karg, arg, sizeof(karg))) {
+- printk(KERN_ERR "failure at %s:%d/%s()!\n",
+- __FILE__, __LINE__, __func__);
+- return -EFAULT;
+- }
+- if (_ctl_verify_adapter(karg.hdr.ioc_number, &ioc) == -1 || !ioc)
+- return -ENODEV;
++ u32 ioc_state;
++ int rc;
++ unsigned long timeleft;
+
+ dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name,
+ __func__));
+
+- buffer_type = karg.unique_id & 0x000000ff;
+- if (!_ctl_diag_capability(ioc, buffer_type)) {
+- printk(MPT2SAS_ERR_FMT "%s: doesn't have capability for "
+- "buffer_type(0x%02x)\n", ioc->name, __func__, buffer_type);
+- return -EPERM;
+- }
+-
+- if ((ioc->diag_buffer_status[buffer_type] &
+- MPT2_DIAG_BUFFER_IS_REGISTERED) == 0) {
+- printk(MPT2SAS_ERR_FMT "%s: buffer_type(0x%02x) is not "
+- "registered\n", ioc->name, __func__, buffer_type);
+- return -EINVAL;
+- }
+-
+- if (karg.unique_id != ioc->unique_id[buffer_type]) {
+- printk(MPT2SAS_ERR_FMT "%s: unique_id(0x%08x) is not "
+- "registered\n", ioc->name, __func__, karg.unique_id);
+- return -EINVAL;
+- }
+-
+- if (ioc->diag_buffer_status[buffer_type] &
+- MPT2_DIAG_BUFFER_IS_RELEASED) {
+- printk(MPT2SAS_ERR_FMT "%s: buffer_type(0x%02x) "
+- "is already released\n", ioc->name, __func__,
+- buffer_type);
+- return 0;
+- }
+-
+- request_data = ioc->diag_buffer[buffer_type];
++ rc = 0;
++ *issue_reset = 0;
+
+- if (!request_data) {
+- printk(MPT2SAS_ERR_FMT "%s: doesn't have memory allocated for "
+- "buffer_type(0x%02x)\n", ioc->name, __func__, buffer_type);
+- return -ENOMEM;
++ ioc_state = mpt2sas_base_get_iocstate(ioc, 1);
++ if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
++ dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
++ "skipping due to FAULT state\n", ioc->name,
++ __func__));
++ rc = -EAGAIN;
++ goto out;
+ }
+
+- if (state == NON_BLOCKING && !mutex_trylock(&ioc->ctl_cmds.mutex))
+- return -EAGAIN;
+- else if (mutex_lock_interruptible(&ioc->ctl_cmds.mutex))
+- return -ERESTARTSYS;
+-
+ if (ioc->ctl_cmds.status != MPT2_CMD_NOT_USED) {
+ printk(MPT2SAS_ERR_FMT "%s: ctl_cmd in use\n",
+ ioc->name, __func__);
+@@ -1641,7 +1626,6 @@ _ctl_diag_release(void __user *arg, enum
+ goto out;
+ }
+
+- rc = 0;
+ ioc->ctl_cmds.status = MPT2_CMD_PENDING;
+ memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
+ mpi_request = mpt2sas_base_get_msg_frame(ioc, smid);
+@@ -1660,8 +1644,9 @@ _ctl_diag_release(void __user *arg, enum
+ _debug_dump_mf(mpi_request,
+ sizeof(Mpi2DiagReleaseRequest_t)/4);
+ if (!(ioc->ctl_cmds.status & MPT2_CMD_RESET))
+- issue_reset = 1;
+- goto issue_host_reset;
++ *issue_reset = 1;
++ rc = -EFAULT;
++ goto out;
+ }
+
+ /* process the completed Reply Message Frame */
+@@ -1687,14 +1672,101 @@ _ctl_diag_release(void __user *arg, enum
+ rc = -EFAULT;
+ }
+
+- issue_host_reset:
++ out:
++ ioc->ctl_cmds.status = MPT2_CMD_NOT_USED;
++ return rc;
++}
++
++/**
++ * _ctl_diag_release - request to send Diag Release Message to firmware
++ * @arg - user space buffer containing ioctl content
++ * @state - NON_BLOCKING or BLOCKING
++ *
++ * This allows ownership of the specified buffer to returned to the driver,
++ * allowing an application to read the buffer without fear that firmware is
++ * overwritting information in the buffer.
++ */
++static long
++_ctl_diag_release(void __user *arg, enum block_state state)
++{
++ struct mpt2_diag_release karg;
++ struct MPT2SAS_ADAPTER *ioc;
++ void *request_data;
++ int rc;
++ u8 buffer_type;
++ u8 issue_reset = 0;
++
++ if (copy_from_user(&karg, arg, sizeof(karg))) {
++ printk(KERN_ERR "failure at %s:%d/%s()!\n",
++ __FILE__, __LINE__, __func__);
++ return -EFAULT;
++ }
++ if (_ctl_verify_adapter(karg.hdr.ioc_number, &ioc) == -1 || !ioc)
++ return -ENODEV;
++
++ dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name,
++ __func__));
++
++ buffer_type = karg.unique_id & 0x000000ff;
++ if (!_ctl_diag_capability(ioc, buffer_type)) {
++ printk(MPT2SAS_ERR_FMT "%s: doesn't have capability for "
++ "buffer_type(0x%02x)\n", ioc->name, __func__, buffer_type);
++ return -EPERM;
++ }
++
++ if ((ioc->diag_buffer_status[buffer_type] &
++ MPT2_DIAG_BUFFER_IS_REGISTERED) == 0) {
++ printk(MPT2SAS_ERR_FMT "%s: buffer_type(0x%02x) is not "
++ "registered\n", ioc->name, __func__, buffer_type);
++ return -EINVAL;
++ }
++
++ if (karg.unique_id != ioc->unique_id[buffer_type]) {
++ printk(MPT2SAS_ERR_FMT "%s: unique_id(0x%08x) is not "
++ "registered\n", ioc->name, __func__, karg.unique_id);
++ return -EINVAL;
++ }
++
++ if (ioc->diag_buffer_status[buffer_type] &
++ MPT2_DIAG_BUFFER_IS_RELEASED) {
++ printk(MPT2SAS_ERR_FMT "%s: buffer_type(0x%02x) "
++ "is already released\n", ioc->name, __func__,
++ buffer_type);
++ return 0;
++ }
++
++ request_data = ioc->diag_buffer[buffer_type];
++
++ if (!request_data) {
++ printk(MPT2SAS_ERR_FMT "%s: doesn't have memory allocated for "
++ "buffer_type(0x%02x)\n", ioc->name, __func__, buffer_type);
++ return -ENOMEM;
++ }
++
++ /* buffers were released by due to host reset */
++ if ((ioc->diag_buffer_status[buffer_type] &
++ MPT2_DIAG_BUFFER_IS_DIAG_RESET)) {
++ ioc->diag_buffer_status[buffer_type] |=
++ MPT2_DIAG_BUFFER_IS_RELEASED;
++ ioc->diag_buffer_status[buffer_type] &=
++ ~MPT2_DIAG_BUFFER_IS_DIAG_RESET;
++ printk(MPT2SAS_ERR_FMT "%s: buffer_type(0x%02x) "
++ "was released due to host reset\n", ioc->name, __func__,
++ buffer_type);
++ return 0;
++ }
++
++ if (state == NON_BLOCKING && !mutex_trylock(&ioc->ctl_cmds.mutex))
++ return -EAGAIN;
++ else if (mutex_lock_interruptible(&ioc->ctl_cmds.mutex))
++ return -ERESTARTSYS;
++
++ rc = _ctl_send_release(ioc, buffer_type, &issue_reset);
++
+ if (issue_reset)
+ mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
+ FORCE_BIG_HAMMER);
+
+- out:
+-
+- ioc->ctl_cmds.status = MPT2_CMD_NOT_USED;
+ mutex_unlock(&ioc->ctl_cmds.mutex);
+ return rc;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_ctl.h linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_ctl.h
+--- linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_ctl.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_ctl.h 2009-05-13 09:46:19.000000000 +0200
+@@ -50,7 +50,7 @@
+ #endif
+
+ #define MPT2SAS_DEV_NAME "mpt2ctl"
+-#define MPT2_MAGIC_NUMBER 'm'
++#define MPT2_MAGIC_NUMBER 'L'
+ #define MPT2_IOCTL_DEFAULT_TIMEOUT (10) /* in seconds */
+
+ /**
+@@ -295,8 +295,9 @@ struct mpt2_ioctl_btdh_mapping {
+
+
+ /* status bits for ioc->diag_buffer_status */
+-#define MPT2_DIAG_BUFFER_IS_REGISTERED (0x01)
+-#define MPT2_DIAG_BUFFER_IS_RELEASED (0x02)
++#define MPT2_DIAG_BUFFER_IS_REGISTERED (0x01)
++#define MPT2_DIAG_BUFFER_IS_RELEASED (0x02)
++#define MPT2_DIAG_BUFFER_IS_DIAG_RESET (0x04)
+
+ /* application flags for mpt2_diag_register, mpt2_diag_query */
+ #define MPT2_APP_FLAGS_APP_OWNED (0x0001)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_scsih.c linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+--- linux-2.6.30-rc4/drivers/scsi/mpt2sas/mpt2sas_scsih.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/mpt2sas/mpt2sas_scsih.c 2009-05-13 09:46:19.000000000 +0200
+@@ -119,7 +119,7 @@ struct sense_info {
+ */
+ struct fw_event_work {
+ struct list_head list;
+- struct delayed_work work;
++ struct work_struct work;
+ struct MPT2SAS_ADAPTER *ioc;
+ u8 VF_ID;
+ u8 host_reset_handling;
+@@ -516,12 +516,8 @@ _scsih_sas_device_add(struct MPT2SAS_ADA
+ handle = sas_device->handle;
+ parent_handle = sas_device->parent_handle;
+ sas_address = sas_device->sas_address;
+- if (!mpt2sas_transport_port_add(ioc, handle, parent_handle)) {
++ if (!mpt2sas_transport_port_add(ioc, handle, parent_handle))
+ _scsih_sas_device_remove(ioc, sas_device);
+- } else if (!sas_device->starget) {
+- mpt2sas_transport_port_remove(ioc, sas_address, parent_handle);
+- _scsih_sas_device_remove(ioc, sas_device);
+- }
+ }
+
+ /**
+@@ -1203,7 +1199,9 @@ scsih_target_destroy(struct scsi_target
+ rphy = dev_to_rphy(starget->dev.parent);
+ sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
+ rphy->identify.sas_address);
+- if (sas_device)
++ if (sas_device && (sas_device->starget == starget) &&
++ (sas_device->id == starget->id) &&
++ (sas_device->channel == starget->channel))
+ sas_device->starget = NULL;
+
+ spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
+@@ -2009,8 +2007,8 @@ _scsih_fw_event_add(struct MPT2SAS_ADAPT
+
+ spin_lock_irqsave(&ioc->fw_event_lock, flags);
+ list_add_tail(&fw_event->list, &ioc->fw_event_list);
+- INIT_DELAYED_WORK(&fw_event->work, _firmware_event_work);
+- queue_delayed_work(ioc->firmware_event_thread, &fw_event->work, 1);
++ INIT_WORK(&fw_event->work, _firmware_event_work);
++ queue_work(ioc->firmware_event_thread, &fw_event->work);
+ spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
+ }
+
+@@ -2054,7 +2052,7 @@ _scsih_fw_event_requeue(struct MPT2SAS_A
+ return;
+
+ spin_lock_irqsave(&ioc->fw_event_lock, flags);
+- queue_delayed_work(ioc->firmware_event_thread, &fw_event->work, delay);
++ queue_work(ioc->firmware_event_thread, &fw_event->work);
+ spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
+ }
+
+@@ -2863,8 +2861,9 @@ scsih_io_done(struct MPT2SAS_ADAPTER *io
+ struct sense_info data;
+ const void *sense_data = mpt2sas_base_get_sense_buffer(ioc,
+ smid);
+- memcpy(scmd->sense_buffer, sense_data,
++ u32 sz = min_t(u32, SCSI_SENSE_BUFFERSIZE,
+ le32_to_cpu(mpi_reply->SenseCount));
++ memcpy(scmd->sense_buffer, sense_data, sz);
+ _scsih_normalize_sense(scmd->sense_buffer, &data);
+ /* failure prediction threshold exceeded */
+ if (data.asc == 0x5D)
+@@ -3923,7 +3922,7 @@ _scsih_sas_broadcast_primative_event(str
+
+ mpt2sas_scsih_issue_tm(ioc, handle, lun,
+ MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30);
+- termination_count += le32_to_cpu(mpi_reply->TerminationCount);
++ ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
+
+ if ((mpi_reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) &&
+ (mpi_reply->ResponseCode ==
+@@ -3933,10 +3932,10 @@ _scsih_sas_broadcast_primative_event(str
+ continue;
+
+ mpt2sas_scsih_issue_tm(ioc, handle, lun,
+- MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, smid, 30);
++ MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, 0, 30);
++ ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
+ termination_count += le32_to_cpu(mpi_reply->TerminationCount);
+ }
+- ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
+ ioc->broadcast_aen_busy = 0;
+ mutex_unlock(&ioc->tm_cmds.mutex);
+
+@@ -4962,7 +4961,7 @@ static void
+ _firmware_event_work(struct work_struct *work)
+ {
+ struct fw_event_work *fw_event = container_of(work,
+- struct fw_event_work, work.work);
++ struct fw_event_work, work);
+ unsigned long flags;
+ struct MPT2SAS_ADAPTER *ioc = fw_event->ioc;
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/osd/osd_initiator.c linux-2.6.30-rc4-git/drivers/scsi/osd/osd_initiator.c
+--- linux-2.6.30-rc4/drivers/scsi/osd/osd_initiator.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/osd/osd_initiator.c 2009-05-13 09:46:19.000000000 +0200
+@@ -205,6 +205,74 @@ static unsigned _osd_req_alist_elem_size
+ osdv2_attr_list_elem_size(len);
+ }
+
++static void _osd_req_alist_elem_encode(struct osd_request *or,
++ void *attr_last, const struct osd_attr *oa)
++{
++ if (osd_req_is_ver1(or)) {
++ struct osdv1_attributes_list_element *attr = attr_last;
++
++ attr->attr_page = cpu_to_be32(oa->attr_page);
++ attr->attr_id = cpu_to_be32(oa->attr_id);
++ attr->attr_bytes = cpu_to_be16(oa->len);
++ memcpy(attr->attr_val, oa->val_ptr, oa->len);
++ } else {
++ struct osdv2_attributes_list_element *attr = attr_last;
++
++ attr->attr_page = cpu_to_be32(oa->attr_page);
++ attr->attr_id = cpu_to_be32(oa->attr_id);
++ attr->attr_bytes = cpu_to_be16(oa->len);
++ memcpy(attr->attr_val, oa->val_ptr, oa->len);
++ }
++}
++
++static int _osd_req_alist_elem_decode(struct osd_request *or,
++ void *cur_p, struct osd_attr *oa, unsigned max_bytes)
++{
++ unsigned inc;
++ if (osd_req_is_ver1(or)) {
++ struct osdv1_attributes_list_element *attr = cur_p;
++
++ if (max_bytes < sizeof(*attr))
++ return -1;
++
++ oa->len = be16_to_cpu(attr->attr_bytes);
++ inc = _osd_req_alist_elem_size(or, oa->len);
++ if (inc > max_bytes)
++ return -1;
++
++ oa->attr_page = be32_to_cpu(attr->attr_page);
++ oa->attr_id = be32_to_cpu(attr->attr_id);
++
++ /* OSD1: On empty attributes we return a pointer to 2 bytes
++ * of zeros. This keeps similar behaviour with OSD2.
++ * (See below)
++ */
++ oa->val_ptr = likely(oa->len) ? attr->attr_val :
++ (u8 *)&attr->attr_bytes;
++ } else {
++ struct osdv2_attributes_list_element *attr = cur_p;
++
++ if (max_bytes < sizeof(*attr))
++ return -1;
++
++ oa->len = be16_to_cpu(attr->attr_bytes);
++ inc = _osd_req_alist_elem_size(or, oa->len);
++ if (inc > max_bytes)
++ return -1;
++
++ oa->attr_page = be32_to_cpu(attr->attr_page);
++ oa->attr_id = be32_to_cpu(attr->attr_id);
++
++ /* OSD2: For convenience, on empty attributes, we return 8 bytes
++ * of zeros here. This keeps the same behaviour with OSD2r04,
++ * and is nice with null terminating ASCII fields.
++ * oa->val_ptr == NULL marks the end-of-list, or error.
++ */
++ oa->val_ptr = likely(oa->len) ? attr->attr_val : attr->reserved;
++ }
++ return inc;
++}
++
+ static unsigned _osd_req_alist_size(struct osd_request *or, void *list_head)
+ {
+ return osd_req_is_ver1(or) ?
+@@ -282,9 +350,9 @@ _osd_req_sec_params(struct osd_request *
+ struct osd_cdb *ocdb = &or->cdb;
+
+ if (osd_req_is_ver1(or))
+- return &ocdb->v1.sec_params;
++ return (struct osd_security_parameters *)&ocdb->v1.sec_params;
+ else
+- return &ocdb->v2.sec_params;
++ return (struct osd_security_parameters *)&ocdb->v2.sec_params;
+ }
+
+ void osd_dev_init(struct osd_dev *osdd, struct scsi_device *scsi_device)
+@@ -612,9 +680,9 @@ static int _osd_req_list_objects(struct
+
+ WARN_ON(or->in.bio);
+ bio = bio_map_kern(q, list, len, or->alloc_flags);
+- if (!bio) {
++ if (IS_ERR(bio)) {
+ OSD_ERR("!!! Failed to allocate list_objects BIO\n");
+- return -ENOMEM;
++ return PTR_ERR(bio);
+ }
+
+ bio->bi_rw &= ~(1 << BIO_RW);
+@@ -798,7 +866,6 @@ int osd_req_add_set_attr_list(struct osd
+ attr_last = or->set_attr.buff + total_bytes;
+
+ for (; nelem; --nelem) {
+- struct osd_attributes_list_element *attr;
+ unsigned elem_size = _osd_req_alist_elem_size(or, oa->len);
+
+ total_bytes += elem_size;
+@@ -811,11 +878,7 @@ int osd_req_add_set_attr_list(struct osd
+ or->set_attr.buff + or->set_attr.total_bytes;
+ }
+
+- attr = attr_last;
+- attr->attr_page = cpu_to_be32(oa->attr_page);
+- attr->attr_id = cpu_to_be32(oa->attr_id);
+- attr->attr_bytes = cpu_to_be16(oa->len);
+- memcpy(attr->attr_val, oa->val_ptr, oa->len);
++ _osd_req_alist_elem_encode(or, attr_last, oa);
+
+ attr_last += elem_size;
+ ++oa;
+@@ -1070,15 +1133,10 @@ int osd_req_decode_get_attr_list(struct
+ }
+
+ for (n = 0; (n < *nelem) && (cur_bytes < returned_bytes); ++n) {
+- struct osd_attributes_list_element *attr = cur_p;
+- unsigned inc;
++ int inc = _osd_req_alist_elem_decode(or, cur_p, oa,
++ returned_bytes - cur_bytes);
+
+- oa->len = be16_to_cpu(attr->attr_bytes);
+- inc = _osd_req_alist_elem_size(or, oa->len);
+- OSD_DEBUG("oa->len=%d inc=%d cur_bytes=%d\n",
+- oa->len, inc, cur_bytes);
+- cur_bytes += inc;
+- if (cur_bytes > returned_bytes) {
++ if (inc < 0) {
+ OSD_ERR("BAD FOOD from target. list not valid!"
+ "c=%d r=%d n=%d\n",
+ cur_bytes, returned_bytes, n);
+@@ -1086,10 +1144,7 @@ int osd_req_decode_get_attr_list(struct
+ break;
+ }
+
+- oa->attr_page = be32_to_cpu(attr->attr_page);
+- oa->attr_id = be32_to_cpu(attr->attr_id);
+- oa->val_ptr = attr->attr_val;
+-
++ cur_bytes += inc;
+ cur_p += inc;
+ ++oa;
+ }
+@@ -1159,6 +1214,24 @@ static int _osd_req_finalize_attr_page(s
+ return ret;
+ }
+
++static inline void osd_sec_parms_set_out_offset(bool is_v1,
++ struct osd_security_parameters *sec_parms, osd_cdb_offset offset)
++{
++ if (is_v1)
++ sec_parms->v1.data_out_integrity_check_offset = offset;
++ else
++ sec_parms->v2.data_out_integrity_check_offset = offset;
++}
++
++static inline void osd_sec_parms_set_in_offset(bool is_v1,
++ struct osd_security_parameters *sec_parms, osd_cdb_offset offset)
++{
++ if (is_v1)
++ sec_parms->v1.data_in_integrity_check_offset = offset;
++ else
++ sec_parms->v2.data_in_integrity_check_offset = offset;
++}
++
+ static int _osd_req_finalize_data_integrity(struct osd_request *or,
+ bool has_in, bool has_out, const u8 *cap_key)
+ {
+@@ -1182,8 +1255,8 @@ static int _osd_req_finalize_data_integr
+ or->out_data_integ.get_attributes_bytes = cpu_to_be64(
+ or->enc_get_attr.total_bytes);
+
+- sec_parms->data_out_integrity_check_offset =
+- osd_req_encode_offset(or, or->out.total_bytes, &pad);
++ osd_sec_parms_set_out_offset(osd_req_is_ver1(or), sec_parms,
++ osd_req_encode_offset(or, or->out.total_bytes, &pad));
+
+ ret = _req_append_segment(or, pad, &seg, or->out.last_seg,
+ &or->out);
+@@ -1203,8 +1276,8 @@ static int _osd_req_finalize_data_integr
+ };
+ unsigned pad;
+
+- sec_parms->data_in_integrity_check_offset =
+- osd_req_encode_offset(or, or->in.total_bytes, &pad);
++ osd_sec_parms_set_in_offset(osd_req_is_ver1(or), sec_parms,
++ osd_req_encode_offset(or, or->in.total_bytes, &pad));
+
+ ret = _req_append_segment(or, pad, &seg, or->in.last_seg,
+ &or->in);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/scsi_lib.c linux-2.6.30-rc4-git/drivers/scsi/scsi_lib.c
+--- linux-2.6.30-rc4/drivers/scsi/scsi_lib.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/scsi_lib.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1291,10 +1291,8 @@ static inline int scsi_target_queue_read
+ if (--starget->target_blocked == 0) {
+ SCSI_LOG_MLQUEUE(3, starget_printk(KERN_INFO, starget,
+ "unblocking target at zero depth\n"));
+- } else {
+- blk_plug_device(sdev->request_queue);
++ } else
+ return 0;
+- }
+ }
+
+ if (scsi_target_is_busy(starget)) {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/sd.c linux-2.6.30-rc4-git/drivers/scsi/sd.c
+--- linux-2.6.30-rc4/drivers/scsi/sd.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/sd.c 2009-05-13 09:46:19.000000000 +0200
+@@ -50,6 +50,7 @@
+ #include <linux/string_helpers.h>
+ #include <linux/async.h>
+ #include <asm/uaccess.h>
++#include <asm/unaligned.h>
+
+ #include <scsi/scsi.h>
+ #include <scsi/scsi_cmnd.h>
+@@ -1344,12 +1345,8 @@ static int read_capacity_16(struct scsi_
+ return -EINVAL;
+ }
+
+- sector_size = (buffer[8] << 24) | (buffer[9] << 16) |
+- (buffer[10] << 8) | buffer[11];
+- lba = (((u64)buffer[0] << 56) | ((u64)buffer[1] << 48) |
+- ((u64)buffer[2] << 40) | ((u64)buffer[3] << 32) |
+- ((u64)buffer[4] << 24) | ((u64)buffer[5] << 16) |
+- ((u64)buffer[6] << 8) | (u64)buffer[7]);
++ sector_size = get_unaligned_be32(&buffer[8]);
++ lba = get_unaligned_be64(&buffer[0]);
+
+ sd_read_protection_type(sdkp, buffer);
+
+@@ -1400,10 +1397,8 @@ static int read_capacity_10(struct scsi_
+ return -EINVAL;
+ }
+
+- sector_size = (buffer[4] << 24) | (buffer[5] << 16) |
+- (buffer[6] << 8) | buffer[7];
+- lba = (buffer[0] << 24) | (buffer[1] << 16) |
+- (buffer[2] << 8) | buffer[3];
++ sector_size = get_unaligned_be32(&buffer[4]);
++ lba = get_unaligned_be32(&buffer[0]);
+
+ if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) {
+ sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a "
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/sg.c linux-2.6.30-rc4-git/drivers/scsi/sg.c
+--- linux-2.6.30-rc4/drivers/scsi/sg.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/sg.c 2009-05-13 09:46:19.000000000 +0200
+@@ -179,7 +179,7 @@ typedef struct sg_device { /* holds the
+ /* tasklet or soft irq callback */
+ static void sg_rq_end_io(struct request *rq, int uptodate);
+ static int sg_start_req(Sg_request *srp, unsigned char *cmd);
+-static void sg_finish_rem_req(Sg_request * srp);
++static int sg_finish_rem_req(Sg_request * srp);
+ static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
+ static ssize_t sg_new_read(Sg_fd * sfp, char __user *buf, size_t count,
+ Sg_request * srp);
+@@ -518,7 +518,7 @@ sg_new_read(Sg_fd * sfp, char __user *bu
+ goto err_out;
+ }
+ err_out:
+- sg_finish_rem_req(srp);
++ err = sg_finish_rem_req(srp);
+ return (0 == err) ? count : err;
+ }
+
+@@ -1696,9 +1696,10 @@ static int sg_start_req(Sg_request *srp,
+ return res;
+ }
+
+-static void
+-sg_finish_rem_req(Sg_request * srp)
++static int sg_finish_rem_req(Sg_request * srp)
+ {
++ int ret = 0;
++
+ Sg_fd *sfp = srp->parentfp;
+ Sg_scatter_hold *req_schp = &srp->data;
+
+@@ -1710,12 +1711,14 @@ sg_finish_rem_req(Sg_request * srp)
+
+ if (srp->rq) {
+ if (srp->bio)
+- blk_rq_unmap_user(srp->bio);
++ ret = blk_rq_unmap_user(srp->bio);
+
+ blk_put_request(srp->rq);
+ }
+
+ sg_remove_request(sfp, srp);
++
++ return ret;
+ }
+
+ static int
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/scsi/sr_ioctl.c linux-2.6.30-rc4-git/drivers/scsi/sr_ioctl.c
+--- linux-2.6.30-rc4/drivers/scsi/sr_ioctl.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/scsi/sr_ioctl.c 2009-05-13 09:46:19.000000000 +0200
+@@ -309,6 +309,11 @@ int sr_drive_status(struct cdrom_device_
+ if (0 == sr_test_unit_ready(cd->device, &sshdr))
+ return CDS_DISC_OK;
+
++ /* SK/ASC/ASCQ of 2/4/1 means "unit is becoming ready" */
++ if (scsi_sense_valid(&sshdr) && sshdr.sense_key == NOT_READY
++ && sshdr.asc == 0x04 && sshdr.ascq == 0x01)
++ return CDS_DRIVE_NOT_READY;
++
+ if (!cdrom_get_media_event(cdi, &med)) {
+ if (med.media_present)
+ return CDS_DISC_OK;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/serial/crisv10.c linux-2.6.30-rc4-git/drivers/serial/crisv10.c
+--- linux-2.6.30-rc4/drivers/serial/crisv10.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/serial/crisv10.c 2009-05-13 09:46:19.000000000 +0200
+@@ -23,16 +23,18 @@ static char *serial_version = "$Revision
+ #include <linux/mm.h>
+ #include <linux/slab.h>
+ #include <linux/init.h>
+-#include <asm/uaccess.h>
+ #include <linux/kernel.h>
+ #include <linux/mutex.h>
+ #include <linux/bitops.h>
++#include <linux/seq_file.h>
++#include <linux/delay.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++#include <linux/io.h>
+
+-#include <asm/io.h>
+ #include <asm/irq.h>
+ #include <asm/dma.h>
+ #include <asm/system.h>
+-#include <linux/delay.h>
+
+ #include <arch/svinto.h>
+
+@@ -456,7 +458,6 @@ static struct e100_serial rs_table[] = {
+
+ #define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial))
+
+-static struct ktermios *serial_termios[NR_PORTS];
+ #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
+ static struct fast_timer fast_timers[NR_PORTS];
+ #endif
+@@ -4257,151 +4258,132 @@ rs_open(struct tty_struct *tty, struct f
+ return 0;
+ }
+
++#ifdef CONFIG_PROC_FS
+ /*
+ * /proc fs routines....
+ */
+
+-static int line_info(char *buf, struct e100_serial *info)
++static void seq_line_info(struct seq_file *m, struct e100_serial *info)
+ {
+- char stat_buf[30];
+- int ret;
+ unsigned long tmp;
+
+- ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d",
+- info->line, (unsigned long)info->ioport, info->irq);
++ seq_printf(m, "%d: uart:E100 port:%lX irq:%d",
++ info->line, (unsigned long)info->ioport, info->irq);
+
+ if (!info->ioport || (info->type == PORT_UNKNOWN)) {
+- ret += sprintf(buf+ret, "\n");
+- return ret;
++ seq_printf(m, "\n");
++ return;
+ }
+
+- stat_buf[0] = 0;
+- stat_buf[1] = 0;
+- if (!E100_RTS_GET(info))
+- strcat(stat_buf, "|RTS");
+- if (!E100_CTS_GET(info))
+- strcat(stat_buf, "|CTS");
+- if (!E100_DTR_GET(info))
+- strcat(stat_buf, "|DTR");
+- if (!E100_DSR_GET(info))
+- strcat(stat_buf, "|DSR");
+- if (!E100_CD_GET(info))
+- strcat(stat_buf, "|CD");
+- if (!E100_RI_GET(info))
+- strcat(stat_buf, "|RI");
+-
+- ret += sprintf(buf+ret, " baud:%d", info->baud);
+-
+- ret += sprintf(buf+ret, " tx:%lu rx:%lu",
++ seq_printf(m, " baud:%d", info->baud);
++ seq_printf(m, " tx:%lu rx:%lu",
+ (unsigned long)info->icount.tx,
+ (unsigned long)info->icount.rx);
+ tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
+- if (tmp) {
+- ret += sprintf(buf+ret, " tx_pend:%lu/%lu",
+- (unsigned long)tmp,
+- (unsigned long)SERIAL_XMIT_SIZE);
+- }
+-
+- ret += sprintf(buf+ret, " rx_pend:%lu/%lu",
+- (unsigned long)info->recv_cnt,
+- (unsigned long)info->max_recv_cnt);
++ if (tmp)
++ seq_printf(m, " tx_pend:%lu/%lu",
++ (unsigned long)tmp,
++ (unsigned long)SERIAL_XMIT_SIZE);
++
++ seq_printf(m, " rx_pend:%lu/%lu",
++ (unsigned long)info->recv_cnt,
++ (unsigned long)info->max_recv_cnt);
+
+ #if 1
+ if (info->port.tty) {
+-
+ if (info->port.tty->stopped)
+- ret += sprintf(buf+ret, " stopped:%i",
+- (int)info->port.tty->stopped);
++ seq_printf(m, " stopped:%i",
++ (int)info->port.tty->stopped);
+ if (info->port.tty->hw_stopped)
+- ret += sprintf(buf+ret, " hw_stopped:%i",
+- (int)info->port.tty->hw_stopped);
++ seq_printf(m, " hw_stopped:%i",
++ (int)info->port.tty->hw_stopped);
+ }
+
+ {
+ unsigned char rstat = info->ioport[REG_STATUS];
+- if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) )
+- ret += sprintf(buf+ret, " xoff_detect:1");
++ if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect))
++ seq_printf(m, " xoff_detect:1");
+ }
+
+ #endif
+
+-
+-
+-
+ if (info->icount.frame)
+- ret += sprintf(buf+ret, " fe:%lu",
+- (unsigned long)info->icount.frame);
++ seq_printf(m, " fe:%lu", (unsigned long)info->icount.frame);
+
+ if (info->icount.parity)
+- ret += sprintf(buf+ret, " pe:%lu",
+- (unsigned long)info->icount.parity);
++ seq_printf(m, " pe:%lu", (unsigned long)info->icount.parity);
+
+ if (info->icount.brk)
+- ret += sprintf(buf+ret, " brk:%lu",
+- (unsigned long)info->icount.brk);
++ seq_printf(m, " brk:%lu", (unsigned long)info->icount.brk);
+
+ if (info->icount.overrun)
+- ret += sprintf(buf+ret, " oe:%lu",
+- (unsigned long)info->icount.overrun);
++ seq_printf(m, " oe:%lu", (unsigned long)info->icount.overrun);
+
+ /*
+ * Last thing is the RS-232 status lines
+ */
+- ret += sprintf(buf+ret, " %s\n", stat_buf+1);
+- return ret;
++ if (!E100_RTS_GET(info))
++ seq_puts(m, "|RTS");
++ if (!E100_CTS_GET(info))
++ seq_puts(m, "|CTS");
++ if (!E100_DTR_GET(info))
++ seq_puts(m, "|DTR");
++ if (!E100_DSR_GET(info))
++ seq_puts(m, "|DSR");
++ if (!E100_CD_GET(info))
++ seq_puts(m, "|CD");
++ if (!E100_RI_GET(info))
++ seq_puts(m, "|RI");
++ seq_puts(m, "\n");
+ }
+
+-int rs_read_proc(char *page, char **start, off_t off, int count,
+- int *eof, void *data)
++
++static int crisv10_proc_show(struct seq_file *m, void *v)
+ {
+- int i, len = 0, l;
+- off_t begin = 0;
++ int i;
++
++ seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
+
+- len += sprintf(page, "serinfo:1.0 driver:%s\n",
+- serial_version);
+- for (i = 0; i < NR_PORTS && len < 4000; i++) {
++ for (i = 0; i < NR_PORTS; i++) {
+ if (!rs_table[i].enabled)
+ continue;
+- l = line_info(page + len, &rs_table[i]);
+- len += l;
+- if (len+begin > off+count)
+- goto done;
+- if (len+begin < off) {
+- begin += len;
+- len = 0;
+- }
++ seq_line_info(m, &rs_table[i]);
+ }
+ #ifdef DEBUG_LOG_INCLUDED
+ for (i = 0; i < debug_log_pos; i++) {
+- len += sprintf(page + len, "%-4i %lu.%lu ", i, debug_log[i].time, timer_data_to_ns(debug_log[i].timer_data));
+- len += sprintf(page + len, debug_log[i].string, debug_log[i].value);
+- if (len+begin > off+count)
+- goto done;
+- if (len+begin < off) {
+- begin += len;
+- len = 0;
+- }
++ seq_printf(m, "%-4i %lu.%lu ",
++ i, debug_log[i].time,
++ timer_data_to_ns(debug_log[i].timer_data));
++ seq_printf(m, debug_log[i].string, debug_log[i].value);
+ }
+- len += sprintf(page + len, "debug_log %i/%i %li bytes\n",
+- i, DEBUG_LOG_SIZE, begin+len);
++ seq_printf(m, "debug_log %i/%i\n", i, DEBUG_LOG_SIZE);
+ debug_log_pos = 0;
+ #endif
++ return 0;
++}
+
+- *eof = 1;
+-done:
+- if (off >= len+begin)
+- return 0;
+- *start = page + (off-begin);
+- return ((count < begin+len-off) ? count : begin+len-off);
++static int crisv10_proc_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, crisv10_proc_show, NULL);
+ }
+
++static const struct file_operations crisv10_proc_fops = {
++ .owner = THIS_MODULE,
++ .open = crisv10_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++#endif
++
++
+ /* Finally, routines used to initialize the serial driver. */
+
+-static void
+-show_serial_version(void)
++static void show_serial_version(void)
+ {
+ printk(KERN_INFO
+- "ETRAX 100LX serial-driver %s, (c) 2000-2004 Axis Communications AB\r\n",
++ "ETRAX 100LX serial-driver %s, "
++ "(c) 2000-2004 Axis Communications AB\r\n",
+ &serial_version[11]); /* "$Revision: x.yy" */
+ }
+
+@@ -4425,13 +4407,14 @@ static const struct tty_operations rs_op
+ .break_ctl = rs_break,
+ .send_xchar = rs_send_xchar,
+ .wait_until_sent = rs_wait_until_sent,
+- .read_proc = rs_read_proc,
+ .tiocmget = rs_tiocmget,
+- .tiocmset = rs_tiocmset
++ .tiocmset = rs_tiocmset,
++#ifdef CONFIG_PROC_FS
++ .proc_fops = &crisv10_proc_fops,
++#endif
+ };
+
+-static int __init
+-rs_init(void)
++static int __init rs_init(void)
+ {
+ int i;
+ struct e100_serial *info;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/serial/imx.c linux-2.6.30-rc4-git/drivers/serial/imx.c
+--- linux-2.6.30-rc4/drivers/serial/imx.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/serial/imx.c 2009-05-13 09:46:19.000000000 +0200
+@@ -66,7 +66,7 @@
+ #define ONEMS 0xb0 /* One Millisecond register */
+ #define UTS 0xb4 /* UART Test Register */
+ #endif
+-#if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1)
++#ifdef CONFIG_ARCH_MX1
+ #define BIPR1 0xb0 /* Incremental Preset Register 1 */
+ #define BIPR2 0xb4 /* Incremental Preset Register 2 */
+ #define BIPR3 0xb8 /* Incremental Preset Register 3 */
+@@ -96,7 +96,7 @@
+ #define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
+ #define UCR1_SNDBRK (1<<4) /* Send break */
+ #define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
+-#if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1)
++#ifdef CONFIG_ARCH_MX1
+ #define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */
+ #endif
+ #if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2
+@@ -127,7 +127,7 @@
+ #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
+ #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
+ #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
+-#ifdef CONFIG_ARCH_IMX
++#ifdef CONFIG_ARCH_MX1
+ #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */
+ #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */
+ #endif
+@@ -180,13 +180,6 @@
+ #define UTS_SOFTRST (1<<0) /* Software reset */
+
+ /* We've been assigned a range on the "Low-density serial ports" major */
+-#ifdef CONFIG_ARCH_IMX
+-#define SERIAL_IMX_MAJOR 204
+-#define MINOR_START 41
+-#define DEV_NAME "ttySMX"
+-#define MAX_INTERNAL_IRQ IMX_IRQS
+-#endif
+-
+ #ifdef CONFIG_ARCH_MXC
+ #define SERIAL_IMX_MAJOR 207
+ #define MINOR_START 16
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/spi/Kconfig linux-2.6.30-rc4-git/drivers/spi/Kconfig
+--- linux-2.6.30-rc4/drivers/spi/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/spi/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -118,7 +118,7 @@ config SPI_GPIO
+
+ config SPI_IMX
+ tristate "Freescale iMX SPI controller"
+- depends on ARCH_IMX && EXPERIMENTAL
++ depends on ARCH_MX1 && EXPERIMENTAL
+ help
+ This enables using the Freescale iMX SPI controller in master
+ mode.
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/video/console/vgacon.c linux-2.6.30-rc4-git/drivers/video/console/vgacon.c
+--- linux-2.6.30-rc4/drivers/video/console/vgacon.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/video/console/vgacon.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1282,7 +1282,7 @@ static int vgacon_font_get(struct vc_dat
+ font->charcount = vga_512_chars ? 512 : 256;
+ if (!font->data)
+ return 0;
+- return vgacon_do_font_op(&state, font->data, 0, 0);
++ return vgacon_do_font_op(&state, font->data, 0, vga_512_chars);
+ }
+
+ #else
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/video/Kconfig linux-2.6.30-rc4-git/drivers/video/Kconfig
+--- linux-2.6.30-rc4/drivers/video/Kconfig 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/video/Kconfig 2009-05-13 09:46:19.000000000 +0200
+@@ -397,7 +397,7 @@ config FB_SA1100
+
+ config FB_IMX
+ tristate "Motorola i.MX LCD support"
+- depends on FB && (ARCH_IMX || ARCH_MX2)
++ depends on FB && (ARCH_MX1 || ARCH_MX2)
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/drivers/video/mx3fb.c linux-2.6.30-rc4-git/drivers/video/mx3fb.c
+--- linux-2.6.30-rc4/drivers/video/mx3fb.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/drivers/video/mx3fb.c 2009-05-13 09:46:19.000000000 +0200
+@@ -706,7 +706,7 @@ static void mx3fb_dma_done(void *arg)
+ dev_dbg(mx3fb->dev, "irq %d callback\n", ichannel->eof_irq);
+
+ /* We only need one interrupt, it will be re-enabled as needed */
+- disable_irq(ichannel->eof_irq);
++ disable_irq_nosync(ichannel->eof_irq);
+
+ complete(&mx3_fbi->flip_cmpl);
+ }
+@@ -1152,11 +1152,11 @@ static struct fb_ops mx3fb_ops = {
+ */
+ static int mx3fb_suspend(struct platform_device *pdev, pm_message_t state)
+ {
+- struct mx3fb_data *drv_data = platform_get_drvdata(pdev);
+- struct mx3fb_info *mx3_fbi = drv_data->fbi->par;
++ struct mx3fb_data *mx3fb = platform_get_drvdata(pdev);
++ struct mx3fb_info *mx3_fbi = mx3fb->fbi->par;
+
+ acquire_console_sem();
+- fb_set_suspend(drv_data->fbi, 1);
++ fb_set_suspend(mx3fb->fbi, 1);
+ release_console_sem();
+
+ if (mx3_fbi->blank == FB_BLANK_UNBLANK) {
+@@ -1172,16 +1172,16 @@ static int mx3fb_suspend(struct platform
+ */
+ static int mx3fb_resume(struct platform_device *pdev)
+ {
+- struct mx3fb_data *drv_data = platform_get_drvdata(pdev);
+- struct mx3fb_info *mx3_fbi = drv_data->fbi->par;
++ struct mx3fb_data *mx3fb = platform_get_drvdata(pdev);
++ struct mx3fb_info *mx3_fbi = mx3fb->fbi->par;
+
+ if (mx3_fbi->blank == FB_BLANK_UNBLANK) {
+ sdc_enable_channel(mx3_fbi);
+- sdc_set_brightness(mx3fb, drv_data->backlight_level);
++ sdc_set_brightness(mx3fb, mx3fb->backlight_level);
+ }
+
+ acquire_console_sem();
+- fb_set_suspend(drv_data->fbi, 0);
++ fb_set_suspend(mx3fb->fbi, 0);
+ release_console_sem();
+
+ return 0;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/autofs4/expire.c linux-2.6.30-rc4-git/fs/autofs4/expire.c
+--- linux-2.6.30-rc4/fs/autofs4/expire.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/autofs4/expire.c 2009-05-13 09:46:19.000000000 +0200
+@@ -70,8 +70,10 @@ static int autofs4_mount_busy(struct vfs
+ * Otherwise it's an offset mount and we need to check
+ * if we can umount its mount, if there is one.
+ */
+- if (!d_mountpoint(dentry))
++ if (!d_mountpoint(dentry)) {
++ status = 0;
+ goto done;
++ }
+ }
+
+ /* Update the expiry counter if fs is busy */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/binfmt_elf_fdpic.c linux-2.6.30-rc4-git/fs/binfmt_elf_fdpic.c
+--- linux-2.6.30-rc4/fs/binfmt_elf_fdpic.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/binfmt_elf_fdpic.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1388,7 +1388,7 @@ static void fill_prstatus(struct elf_prs
+ prstatus->pr_sigpend = p->pending.signal.sig[0];
+ prstatus->pr_sighold = p->blocked.sig[0];
+ prstatus->pr_pid = task_pid_vnr(p);
+- prstatus->pr_ppid = task_pid_vnr(p->parent);
++ prstatus->pr_ppid = task_pid_vnr(p->real_parent);
+ prstatus->pr_pgrp = task_pgrp_vnr(p);
+ prstatus->pr_sid = task_session_vnr(p);
+ if (thread_group_leader(p)) {
+@@ -1433,7 +1433,7 @@ static int fill_psinfo(struct elf_prpsin
+ psinfo->pr_psargs[len] = 0;
+
+ psinfo->pr_pid = task_pid_vnr(p);
+- psinfo->pr_ppid = task_pid_vnr(p->parent);
++ psinfo->pr_ppid = task_pid_vnr(p->real_parent);
+ psinfo->pr_pgrp = task_pgrp_vnr(p);
+ psinfo->pr_sid = task_session_vnr(p);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/buffer.c linux-2.6.30-rc4-git/fs/buffer.c
+--- linux-2.6.30-rc4/fs/buffer.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/buffer.c 2009-05-13 09:46:19.000000000 +0200
+@@ -2397,7 +2397,8 @@ block_page_mkwrite(struct vm_area_struct
+ if ((page->mapping != inode->i_mapping) ||
+ (page_offset(page) > size)) {
+ /* page got truncated out from underneath us */
+- goto out_unlock;
++ unlock_page(page);
++ goto out;
+ }
+
+ /* page is wholly or partially inside EOF */
+@@ -2411,14 +2412,15 @@ block_page_mkwrite(struct vm_area_struct
+ ret = block_commit_write(page, 0, end);
+
+ if (unlikely(ret)) {
++ unlock_page(page);
+ if (ret == -ENOMEM)
+ ret = VM_FAULT_OOM;
+ else /* -ENOSPC, -EIO, etc */
+ ret = VM_FAULT_SIGBUS;
+- }
++ } else
++ ret = VM_FAULT_LOCKED;
+
+-out_unlock:
+- unlock_page(page);
++out:
+ return ret;
+ }
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/configfs/symlink.c linux-2.6.30-rc4-git/fs/configfs/symlink.c
+--- linux-2.6.30-rc4/fs/configfs/symlink.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/configfs/symlink.c 2009-05-13 09:46:19.000000000 +0200
+@@ -135,7 +135,7 @@ int configfs_symlink(struct inode *dir,
+ struct path path;
+ struct configfs_dirent *sd;
+ struct config_item *parent_item;
+- struct config_item *target_item;
++ struct config_item *target_item = NULL;
+ struct config_item_type *type;
+
+ ret = -EPERM; /* What lack-of-symlink returns */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/exec.c linux-2.6.30-rc4-git/fs/exec.c
+--- linux-2.6.30-rc4/fs/exec.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/exec.c 2009-05-13 09:46:19.000000000 +0200
+@@ -69,17 +69,18 @@ int suid_dumpable = 0;
+ static LIST_HEAD(formats);
+ static DEFINE_RWLOCK(binfmt_lock);
+
+-int register_binfmt(struct linux_binfmt * fmt)
++int __register_binfmt(struct linux_binfmt * fmt, int insert)
+ {
+ if (!fmt)
+ return -EINVAL;
+ write_lock(&binfmt_lock);
+- list_add(&fmt->lh, &formats);
++ insert ? list_add(&fmt->lh, &formats) :
++ list_add_tail(&fmt->lh, &formats);
+ write_unlock(&binfmt_lock);
+ return 0;
+ }
+
+-EXPORT_SYMBOL(register_binfmt);
++EXPORT_SYMBOL(__register_binfmt);
+
+ void unregister_binfmt(struct linux_binfmt * fmt)
+ {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/dcache.c linux-2.6.30-rc4-git/fs/ocfs2/dcache.c
+--- linux-2.6.30-rc4/fs/ocfs2/dcache.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/dcache.c 2009-05-13 09:46:19.000000000 +0200
+@@ -290,6 +290,21 @@ out_attach:
+ else
+ mlog_errno(ret);
+
++ /*
++ * In case of error, manually free the allocation and do the iput().
++ * We need to do this because error here means no d_instantiate(),
++ * which means iput() will not be called during dput(dentry).
++ */
++ if (ret < 0 && !alias) {
++ ocfs2_lock_res_free(&dl->dl_lockres);
++ BUG_ON(dl->dl_count != 1);
++ spin_lock(&dentry_attach_lock);
++ dentry->d_fsdata = NULL;
++ spin_unlock(&dentry_attach_lock);
++ kfree(dl);
++ iput(inode);
++ }
++
+ dput(alias);
+
+ return ret;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/dir.c linux-2.6.30-rc4-git/fs/ocfs2/dir.c
+--- linux-2.6.30-rc4/fs/ocfs2/dir.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/dir.c 2009-05-13 09:46:19.000000000 +0200
+@@ -2697,7 +2697,7 @@ static int ocfs2_dx_dir_index_block(stru
+ u32 *num_dx_entries,
+ struct buffer_head *dirent_bh)
+ {
+- int ret, namelen, i;
++ int ret = 0, namelen, i;
+ char *de_buf, *limit;
+ struct ocfs2_dir_entry *de;
+ struct buffer_head *dx_leaf_bh;
+@@ -2934,7 +2934,7 @@ static int ocfs2_expand_inline_dir(struc
+ */
+ BUG_ON(alloc > 2);
+
+- ret = ocfs2_reserve_clusters(osb, alloc, &data_ac);
++ ret = ocfs2_reserve_clusters(osb, alloc + dx_alloc, &data_ac);
+ if (ret) {
+ mlog_errno(ret);
+ goto out;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/export.c linux-2.6.30-rc4-git/fs/ocfs2/export.c
+--- linux-2.6.30-rc4/fs/ocfs2/export.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/export.c 2009-05-13 09:46:19.000000000 +0200
+@@ -100,7 +100,8 @@ static struct dentry *ocfs2_get_dentry(s
+
+ /* If the inode allocator bit is clear, this inode must be stale */
+ if (!set) {
+- mlog(0, "inode %llu suballoc bit is clear\n", blkno);
++ mlog(0, "inode %llu suballoc bit is clear\n",
++ (unsigned long long)blkno);
+ status = -ESTALE;
+ goto unlock_nfs_sync;
+ }
+@@ -114,7 +115,7 @@ check_err:
+ if (status < 0) {
+ if (status == -ESTALE) {
+ mlog(0, "stale inode ino: %llu generation: %u\n",
+- blkno, handle->ih_generation);
++ (unsigned long long)blkno, handle->ih_generation);
+ }
+ result = ERR_PTR(status);
+ goto bail;
+@@ -129,8 +130,8 @@ check_err:
+ check_gen:
+ if (handle->ih_generation != inode->i_generation) {
+ iput(inode);
+- mlog(0, "stale inode ino: %llu generation: %u\n", blkno,
+- handle->ih_generation);
++ mlog(0, "stale inode ino: %llu generation: %u\n",
++ (unsigned long long)blkno, handle->ih_generation);
+ result = ERR_PTR(-ESTALE);
+ goto bail;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/journal.h linux-2.6.30-rc4-git/fs/ocfs2/journal.h
+--- linux-2.6.30-rc4/fs/ocfs2/journal.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/journal.h 2009-05-13 09:46:19.000000000 +0200
+@@ -437,8 +437,9 @@ static inline int ocfs2_unlink_credits(s
+ }
+
+ /* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry +
+- * inode alloc group descriptor + orphan dir index leaf */
+-#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 3)
++ * inode alloc group descriptor + orphan dir index root +
++ * orphan dir index leaf */
++#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 4)
+
+ /* dinode update, old dir dinode update, new dir dinode update, old
+ * dir dir entry, new dir dir entry, dir entry update for renaming
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/namei.c linux-2.6.30-rc4-git/fs/ocfs2/namei.c
+--- linux-2.6.30-rc4/fs/ocfs2/namei.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/namei.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1025,10 +1025,8 @@ static int ocfs2_rename(struct inode *ol
+ struct inode *orphan_dir = NULL;
+ struct ocfs2_dinode *newfe = NULL;
+ char orphan_name[OCFS2_ORPHAN_NAMELEN + 1];
+- struct buffer_head *orphan_entry_bh = NULL;
+ struct buffer_head *newfe_bh = NULL;
+ struct buffer_head *old_inode_bh = NULL;
+- struct buffer_head *insert_entry_bh = NULL;
+ struct ocfs2_super *osb = NULL;
+ u64 newfe_blkno, old_de_ino;
+ handle_t *handle = NULL;
+@@ -1455,8 +1453,6 @@ bail:
+ brelse(old_inode_bh);
+ brelse(old_dir_bh);
+ brelse(new_dir_bh);
+- brelse(orphan_entry_bh);
+- brelse(insert_entry_bh);
+
+ mlog_exit(status);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/ocfs2/suballoc.c linux-2.6.30-rc4-git/fs/ocfs2/suballoc.c
+--- linux-2.6.30-rc4/fs/ocfs2/suballoc.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/ocfs2/suballoc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -2197,26 +2197,29 @@ static int ocfs2_get_suballoc_slot_bit(s
+ struct buffer_head *inode_bh = NULL;
+ struct ocfs2_dinode *inode_fe;
+
+- mlog_entry("blkno: %llu\n", blkno);
++ mlog_entry("blkno: %llu\n", (unsigned long long)blkno);
+
+ /* dirty read disk */
+ status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh);
+ if (status < 0) {
+- mlog(ML_ERROR, "read block %llu failed %d\n", blkno, status);
++ mlog(ML_ERROR, "read block %llu failed %d\n",
++ (unsigned long long)blkno, status);
+ goto bail;
+ }
+
+ inode_fe = (struct ocfs2_dinode *) inode_bh->b_data;
+ if (!OCFS2_IS_VALID_DINODE(inode_fe)) {
+- mlog(ML_ERROR, "invalid inode %llu requested\n", blkno);
++ mlog(ML_ERROR, "invalid inode %llu requested\n",
++ (unsigned long long)blkno);
+ status = -EINVAL;
+ goto bail;
+ }
+
+- if (le16_to_cpu(inode_fe->i_suballoc_slot) != OCFS2_INVALID_SLOT &&
++ if (le16_to_cpu(inode_fe->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT &&
+ (u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots - 1) {
+ mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u\n",
+- blkno, (u32)le16_to_cpu(inode_fe->i_suballoc_slot));
++ (unsigned long long)blkno,
++ (u32)le16_to_cpu(inode_fe->i_suballoc_slot));
+ status = -EINVAL;
+ goto bail;
+ }
+@@ -2251,7 +2254,8 @@ static int ocfs2_test_suballoc_bit(struc
+ u64 bg_blkno;
+ int status;
+
+- mlog_entry("blkno: %llu bit: %u\n", blkno, (unsigned int)bit);
++ mlog_entry("blkno: %llu bit: %u\n", (unsigned long long)blkno,
++ (unsigned int)bit);
+
+ alloc_fe = (struct ocfs2_dinode *)alloc_bh->b_data;
+ if ((bit + 1) > ocfs2_bits_per_group(&alloc_fe->id2.i_chain)) {
+@@ -2266,7 +2270,8 @@ static int ocfs2_test_suballoc_bit(struc
+ status = ocfs2_read_group_descriptor(suballoc, alloc_fe, bg_blkno,
+ &group_bh);
+ if (status < 0) {
+- mlog(ML_ERROR, "read group %llu failed %d\n", bg_blkno, status);
++ mlog(ML_ERROR, "read group %llu failed %d\n",
++ (unsigned long long)bg_blkno, status);
+ goto bail;
+ }
+
+@@ -2300,7 +2305,7 @@ int ocfs2_test_inode_bit(struct ocfs2_su
+ struct inode *inode_alloc_inode;
+ struct buffer_head *alloc_bh = NULL;
+
+- mlog_entry("blkno: %llu", blkno);
++ mlog_entry("blkno: %llu", (unsigned long long)blkno);
+
+ status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot,
+ &suballoc_bit);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/proc/meminfo.c linux-2.6.30-rc4-git/fs/proc/meminfo.c
+--- linux-2.6.30-rc4/fs/proc/meminfo.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/proc/meminfo.c 2009-05-13 09:46:19.000000000 +0200
+@@ -35,7 +35,7 @@ static int meminfo_proc_show(struct seq_
+ #define K(x) ((x) << (PAGE_SHIFT - 10))
+ si_meminfo(&i);
+ si_swapinfo(&i);
+- committed = atomic_long_read(&vm_committed_space);
++ committed = percpu_counter_read_positive(&vm_committed_as);
+ allowed = ((totalram_pages - hugetlb_total_pages())
+ * sysctl_overcommit_ratio / 100) + total_swap_pages;
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/proc/task_mmu.c linux-2.6.30-rc4-git/fs/proc/task_mmu.c
+--- linux-2.6.30-rc4/fs/proc/task_mmu.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/proc/task_mmu.c 2009-05-13 09:46:19.000000000 +0200
+@@ -665,6 +665,10 @@ static ssize_t pagemap_read(struct file
+ goto out_task;
+
+ ret = 0;
++
++ if (!count)
++ goto out_task;
++
+ mm = get_task_mm(task);
+ if (!mm)
+ goto out_task;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/xfs/xfs_bmap.c linux-2.6.30-rc4-git/fs/xfs/xfs_bmap.c
+--- linux-2.6.30-rc4/fs/xfs/xfs_bmap.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/xfs/xfs_bmap.c 2009-05-13 09:46:19.000000000 +0200
+@@ -5880,7 +5880,7 @@ xfs_getbmap(
+ void *arg) /* formatter arg */
+ {
+ __int64_t bmvend; /* last block requested */
+- int error; /* return value */
++ int error = 0; /* return value */
+ __int64_t fixlen; /* length for -1 case */
+ int i; /* extent number */
+ int lock; /* lock state */
+@@ -5890,39 +5890,18 @@ xfs_getbmap(
+ int nexleft; /* # of user extents left */
+ int subnex; /* # of bmapi's can do */
+ int nmap; /* number of map entries */
+- struct getbmapx out; /* output structure */
++ struct getbmapx *out; /* output structure */
+ int whichfork; /* data or attr fork */
+ int prealloced; /* this is a file with
+ * preallocated data space */
+ int iflags; /* interface flags */
+ int bmapi_flags; /* flags for xfs_bmapi */
++ int cur_ext = 0;
+
+ mp = ip->i_mount;
+ iflags = bmv->bmv_iflags;
+-
+ whichfork = iflags & BMV_IF_ATTRFORK ? XFS_ATTR_FORK : XFS_DATA_FORK;
+
+- /* If the BMV_IF_NO_DMAPI_READ interface bit specified, do not
+- * generate a DMAPI read event. Otherwise, if the DM_EVENT_READ
+- * bit is set for the file, generate a read event in order
+- * that the DMAPI application may do its thing before we return
+- * the extents. Usually this means restoring user file data to
+- * regions of the file that look like holes.
+- *
+- * The "old behavior" (from XFS_IOC_GETBMAP) is to not specify
+- * BMV_IF_NO_DMAPI_READ so that read events are generated.
+- * If this were not true, callers of ioctl( XFS_IOC_GETBMAP )
+- * could misinterpret holes in a DMAPI file as true holes,
+- * when in fact they may represent offline user data.
+- */
+- if ((iflags & BMV_IF_NO_DMAPI_READ) == 0 &&
+- DM_EVENT_ENABLED(ip, DM_EVENT_READ) &&
+- whichfork == XFS_DATA_FORK) {
+- error = XFS_SEND_DATA(mp, DM_EVENT_READ, ip, 0, 0, 0, NULL);
+- if (error)
+- return XFS_ERROR(error);
+- }
+-
+ if (whichfork == XFS_ATTR_FORK) {
+ if (XFS_IFORK_Q(ip)) {
+ if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS &&
+@@ -5936,11 +5915,37 @@ xfs_getbmap(
+ ip->i_mount);
+ return XFS_ERROR(EFSCORRUPTED);
+ }
+- } else if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
+- ip->i_d.di_format != XFS_DINODE_FMT_BTREE &&
+- ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
+- return XFS_ERROR(EINVAL);
+- if (whichfork == XFS_DATA_FORK) {
++
++ prealloced = 0;
++ fixlen = 1LL << 32;
++ } else {
++ /*
++ * If the BMV_IF_NO_DMAPI_READ interface bit specified, do
++ * not generate a DMAPI read event. Otherwise, if the
++ * DM_EVENT_READ bit is set for the file, generate a read
++ * event in order that the DMAPI application may do its thing
++ * before we return the extents. Usually this means restoring
++ * user file data to regions of the file that look like holes.
++ *
++ * The "old behavior" (from XFS_IOC_GETBMAP) is to not specify
++ * BMV_IF_NO_DMAPI_READ so that read events are generated.
++ * If this were not true, callers of ioctl(XFS_IOC_GETBMAP)
++ * could misinterpret holes in a DMAPI file as true holes,
++ * when in fact they may represent offline user data.
++ */
++ if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) &&
++ !(iflags & BMV_IF_NO_DMAPI_READ)) {
++ error = XFS_SEND_DATA(mp, DM_EVENT_READ, ip,
++ 0, 0, 0, NULL);
++ if (error)
++ return XFS_ERROR(error);
++ }
++
++ if (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS &&
++ ip->i_d.di_format != XFS_DINODE_FMT_BTREE &&
++ ip->i_d.di_format != XFS_DINODE_FMT_LOCAL)
++ return XFS_ERROR(EINVAL);
++
+ if (xfs_get_extsz_hint(ip) ||
+ ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){
+ prealloced = 1;
+@@ -5949,42 +5954,41 @@ xfs_getbmap(
+ prealloced = 0;
+ fixlen = ip->i_size;
+ }
+- } else {
+- prealloced = 0;
+- fixlen = 1LL << 32;
+ }
+
+ if (bmv->bmv_length == -1) {
+ fixlen = XFS_FSB_TO_BB(mp, XFS_B_TO_FSB(mp, fixlen));
+- bmv->bmv_length = MAX( (__int64_t)(fixlen - bmv->bmv_offset),
+- (__int64_t)0);
+- } else if (bmv->bmv_length < 0)
+- return XFS_ERROR(EINVAL);
+- if (bmv->bmv_length == 0) {
++ bmv->bmv_length =
++ max_t(__int64_t, fixlen - bmv->bmv_offset, 0);
++ } else if (bmv->bmv_length == 0) {
+ bmv->bmv_entries = 0;
+ return 0;
++ } else if (bmv->bmv_length < 0) {
++ return XFS_ERROR(EINVAL);
+ }
++
+ nex = bmv->bmv_count - 1;
+ if (nex <= 0)
+ return XFS_ERROR(EINVAL);
+ bmvend = bmv->bmv_offset + bmv->bmv_length;
+
+- xfs_ilock(ip, XFS_IOLOCK_SHARED);
+
+- if (((iflags & BMV_IF_DELALLOC) == 0) &&
+- (whichfork == XFS_DATA_FORK) &&
+- (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
+- /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
+- error = xfs_flush_pages(ip, (xfs_off_t)0,
+- -1, 0, FI_REMAPF);
+- if (error) {
+- xfs_iunlock(ip, XFS_IOLOCK_SHARED);
+- return error;
++ if (bmv->bmv_count > ULONG_MAX / sizeof(struct getbmapx))
++ return XFS_ERROR(ENOMEM);
++ out = kmem_zalloc(bmv->bmv_count * sizeof(struct getbmapx), KM_MAYFAIL);
++ if (!out)
++ return XFS_ERROR(ENOMEM);
++
++ xfs_ilock(ip, XFS_IOLOCK_SHARED);
++ if (whichfork == XFS_DATA_FORK && !(iflags & BMV_IF_DELALLOC)) {
++ if (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size) {
++ error = xfs_flush_pages(ip, 0, -1, 0, FI_REMAPF);
++ if (error)
++ goto out_unlock_iolock;
+ }
+- }
+
+- ASSERT(whichfork == XFS_ATTR_FORK || (iflags & BMV_IF_DELALLOC) ||
+- ip->i_delayed_blks == 0);
++ ASSERT(ip->i_delayed_blks == 0);
++ }
+
+ lock = xfs_ilock_map_shared(ip);
+
+@@ -5995,23 +5999,25 @@ xfs_getbmap(
+ if (nex > XFS_IFORK_NEXTENTS(ip, whichfork) * 2 + 1)
+ nex = XFS_IFORK_NEXTENTS(ip, whichfork) * 2 + 1;
+
+- bmapi_flags = xfs_bmapi_aflag(whichfork) |
+- ((iflags & BMV_IF_PREALLOC) ? 0 : XFS_BMAPI_IGSTATE);
++ bmapi_flags = xfs_bmapi_aflag(whichfork);
++ if (!(iflags & BMV_IF_PREALLOC))
++ bmapi_flags |= XFS_BMAPI_IGSTATE;
+
+ /*
+ * Allocate enough space to handle "subnex" maps at a time.
+ */
++ error = ENOMEM;
+ subnex = 16;
+- map = kmem_alloc(subnex * sizeof(*map), KM_SLEEP);
++ map = kmem_alloc(subnex * sizeof(*map), KM_MAYFAIL);
++ if (!map)
++ goto out_unlock_ilock;
+
+ bmv->bmv_entries = 0;
+
+- if ((XFS_IFORK_NEXTENTS(ip, whichfork) == 0)) {
+- if (((iflags & BMV_IF_DELALLOC) == 0) ||
+- whichfork == XFS_ATTR_FORK) {
+- error = 0;
+- goto unlock_and_return;
+- }
++ if (XFS_IFORK_NEXTENTS(ip, whichfork) == 0 &&
++ (whichfork == XFS_ATTR_FORK || !(iflags & BMV_IF_DELALLOC))) {
++ error = 0;
++ goto out_free_map;
+ }
+
+ nexleft = nex;
+@@ -6023,53 +6029,61 @@ xfs_getbmap(
+ bmapi_flags, NULL, 0, map, &nmap,
+ NULL, NULL);
+ if (error)
+- goto unlock_and_return;
++ goto out_free_map;
+ ASSERT(nmap <= subnex);
+
+ for (i = 0; i < nmap && nexleft && bmv->bmv_length; i++) {
+- out.bmv_oflags = 0;
++ out[cur_ext].bmv_oflags = 0;
+ if (map[i].br_state == XFS_EXT_UNWRITTEN)
+- out.bmv_oflags |= BMV_OF_PREALLOC;
++ out[cur_ext].bmv_oflags |= BMV_OF_PREALLOC;
+ else if (map[i].br_startblock == DELAYSTARTBLOCK)
+- out.bmv_oflags |= BMV_OF_DELALLOC;
+- out.bmv_offset = XFS_FSB_TO_BB(mp, map[i].br_startoff);
+- out.bmv_length = XFS_FSB_TO_BB(mp, map[i].br_blockcount);
+- out.bmv_unused1 = out.bmv_unused2 = 0;
++ out[cur_ext].bmv_oflags |= BMV_OF_DELALLOC;
++ out[cur_ext].bmv_offset =
++ XFS_FSB_TO_BB(mp, map[i].br_startoff);
++ out[cur_ext].bmv_length =
++ XFS_FSB_TO_BB(mp, map[i].br_blockcount);
++ out[cur_ext].bmv_unused1 = 0;
++ out[cur_ext].bmv_unused2 = 0;
+ ASSERT(((iflags & BMV_IF_DELALLOC) != 0) ||
+ (map[i].br_startblock != DELAYSTARTBLOCK));
+ if (map[i].br_startblock == HOLESTARTBLOCK &&
+ whichfork == XFS_ATTR_FORK) {
+ /* came to the end of attribute fork */
+- out.bmv_oflags |= BMV_OF_LAST;
+- goto unlock_and_return;
+- } else {
+- int full = 0; /* user array is full */
+-
+- if (!xfs_getbmapx_fix_eof_hole(ip, &out,
+- prealloced, bmvend,
+- map[i].br_startblock)) {
+- goto unlock_and_return;
+- }
+-
+- /* format results & advance arg */
+- error = formatter(&arg, &out, &full);
+- if (error || full)
+- goto unlock_and_return;
+- nexleft--;
+- bmv->bmv_offset =
+- out.bmv_offset + out.bmv_length;
+- bmv->bmv_length = MAX((__int64_t)0,
+- (__int64_t)(bmvend - bmv->bmv_offset));
+- bmv->bmv_entries++;
++ out[cur_ext].bmv_oflags |= BMV_OF_LAST;
++ goto out_free_map;
+ }
++
++ if (!xfs_getbmapx_fix_eof_hole(ip, &out[cur_ext],
++ prealloced, bmvend,
++ map[i].br_startblock))
++ goto out_free_map;
++
++ nexleft--;
++ bmv->bmv_offset =
++ out[cur_ext].bmv_offset +
++ out[cur_ext].bmv_length;
++ bmv->bmv_length =
++ max_t(__int64_t, 0, bmvend - bmv->bmv_offset);
++ bmv->bmv_entries++;
++ cur_ext++;
+ }
+ } while (nmap && nexleft && bmv->bmv_length);
+
+-unlock_and_return:
++ out_free_map:
++ kmem_free(map);
++ out_unlock_ilock:
+ xfs_iunlock_map_shared(ip, lock);
++ out_unlock_iolock:
+ xfs_iunlock(ip, XFS_IOLOCK_SHARED);
+
+- kmem_free(map);
++ for (i = 0; i < cur_ext; i++) {
++ int full = 0; /* user array is full */
++
++ /* format results & advance arg */
++ error = formatter(&arg, &out[i], &full);
++ if (error || full)
++ break;
++ }
+
+ return error;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/xfs/xfs_inode.c linux-2.6.30-rc4-git/fs/xfs/xfs_inode.c
+--- linux-2.6.30-rc4/fs/xfs/xfs_inode.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/xfs/xfs_inode.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1258,8 +1258,10 @@ xfs_file_last_byte(
+ * necessary.
+ */
+ if (ip->i_df.if_flags & XFS_IFEXTENTS) {
++ xfs_ilock(ip, XFS_ILOCK_SHARED);
+ error = xfs_bmap_last_offset(NULL, ip, &last_block,
+ XFS_DATA_FORK);
++ xfs_iunlock(ip, XFS_ILOCK_SHARED);
+ if (error) {
+ last_block = 0;
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/fs/xfs/xfs_mount.c linux-2.6.30-rc4-git/fs/xfs/xfs_mount.c
+--- linux-2.6.30-rc4/fs/xfs/xfs_mount.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/fs/xfs/xfs_mount.c 2009-05-13 09:46:19.000000000 +0200
+@@ -291,14 +291,17 @@ xfs_mount_validate_sb(
+ sbp->sb_sectsize > XFS_MAX_SECTORSIZE ||
+ sbp->sb_sectlog < XFS_MIN_SECTORSIZE_LOG ||
+ sbp->sb_sectlog > XFS_MAX_SECTORSIZE_LOG ||
++ sbp->sb_sectsize != (1 << sbp->sb_sectlog) ||
+ sbp->sb_blocksize < XFS_MIN_BLOCKSIZE ||
+ sbp->sb_blocksize > XFS_MAX_BLOCKSIZE ||
+ sbp->sb_blocklog < XFS_MIN_BLOCKSIZE_LOG ||
+ sbp->sb_blocklog > XFS_MAX_BLOCKSIZE_LOG ||
++ sbp->sb_blocksize != (1 << sbp->sb_blocklog) ||
+ sbp->sb_inodesize < XFS_DINODE_MIN_SIZE ||
+ sbp->sb_inodesize > XFS_DINODE_MAX_SIZE ||
+ sbp->sb_inodelog < XFS_DINODE_MIN_LOG ||
+ sbp->sb_inodelog > XFS_DINODE_MAX_LOG ||
++ sbp->sb_inodesize != (1 << sbp->sb_inodelog) ||
+ (sbp->sb_blocklog - sbp->sb_inodelog != sbp->sb_inopblog) ||
+ (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) ||
+ (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) ||
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/asm-generic/atomic.h linux-2.6.30-rc4-git/include/asm-generic/atomic.h
+--- linux-2.6.30-rc4/include/asm-generic/atomic.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/asm-generic/atomic.h 2009-05-13 09:46:19.000000000 +0200
+@@ -132,9 +132,9 @@ static inline long atomic_long_add_unles
+ #define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l))
+
+ #define atomic_long_cmpxchg(l, old, new) \
+- (atomic_cmpxchg((atomic64_t *)(l), (old), (new)))
++ (atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
+ #define atomic_long_xchg(v, new) \
+- (atomic_xchg((atomic64_t *)(l), (new)))
++ (atomic64_xchg((atomic64_t *)(l), (new)))
+
+ #else /* BITS_PER_LONG == 64 */
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/binfmts.h linux-2.6.30-rc4-git/include/linux/binfmts.h
+--- linux-2.6.30-rc4/include/linux/binfmts.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/binfmts.h 2009-05-13 09:46:19.000000000 +0200
+@@ -82,7 +82,19 @@ struct linux_binfmt {
+ int hasvdso;
+ };
+
+-extern int register_binfmt(struct linux_binfmt *);
++extern int __register_binfmt(struct linux_binfmt *fmt, int insert);
++
++/* Registration of default binfmt handlers */
++static inline int register_binfmt(struct linux_binfmt *fmt)
++{
++ return __register_binfmt(fmt, 0);
++}
++/* Same as above, but adds a new binfmt at the top of the list */
++static inline int insert_binfmt(struct linux_binfmt *fmt)
++{
++ return __register_binfmt(fmt, 1);
++}
++
+ extern void unregister_binfmt(struct linux_binfmt *);
+
+ extern int prepare_binprm(struct linux_binprm *);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/blkdev.h linux-2.6.30-rc4-git/include/linux/blkdev.h
+--- linux-2.6.30-rc4/include/linux/blkdev.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/blkdev.h 2009-05-13 09:46:19.000000000 +0200
+@@ -601,6 +601,7 @@ enum {
+ blk_failfast_driver(rq))
+ #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
+ #define blk_rq_io_stat(rq) ((rq)->cmd_flags & REQ_IO_STAT)
++#define blk_rq_quiet(rq) ((rq)->cmd_flags & REQ_QUIET)
+
+ #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq)))
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/input.h linux-2.6.30-rc4-git/include/linux/input.h
+--- linux-2.6.30-rc4/include/linux/input.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/input.h 2009-05-13 09:46:19.000000000 +0200
+@@ -106,6 +106,7 @@ struct input_absinfo {
+
+ #define SYN_REPORT 0
+ #define SYN_CONFIG 1
++#define SYN_MT_REPORT 2
+
+ /*
+ * Keys and buttons
+@@ -445,6 +446,7 @@ struct input_absinfo {
+ #define BTN_STYLUS2 0x14c
+ #define BTN_TOOL_DOUBLETAP 0x14d
+ #define BTN_TOOL_TRIPLETAP 0x14e
++#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
+
+ #define BTN_WHEEL 0x150
+ #define BTN_GEAR_DOWN 0x150
+@@ -644,6 +646,17 @@ struct input_absinfo {
+ #define ABS_TOOL_WIDTH 0x1c
+ #define ABS_VOLUME 0x20
+ #define ABS_MISC 0x28
++
++#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
++#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
++#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
++#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
++#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
++#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
++#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
++#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
++#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
++
+ #define ABS_MAX 0x3f
+ #define ABS_CNT (ABS_MAX+1)
+
+@@ -743,6 +756,12 @@ struct input_absinfo {
+ #define BUS_ATARI 0x1B
+
+ /*
++ * MT_TOOL types
++ */
++#define MT_TOOL_FINGER 0
++#define MT_TOOL_PEN 1
++
++/*
+ * Values describing the status of a force-feedback effect
+ */
+ #define FF_STATUS_STOPPED 0x00
+@@ -1311,6 +1330,11 @@ static inline void input_sync(struct inp
+ input_event(dev, EV_SYN, SYN_REPORT, 0);
+ }
+
++static inline void input_mt_sync(struct input_dev *dev)
++{
++ input_event(dev, EV_SYN, SYN_MT_REPORT, 0);
++}
++
+ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
+
+ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/memcontrol.h linux-2.6.30-rc4-git/include/linux/memcontrol.h
+--- linux-2.6.30-rc4/include/linux/memcontrol.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/memcontrol.h 2009-05-13 09:46:19.000000000 +0200
+@@ -56,7 +56,7 @@ extern void mem_cgroup_move_lists(struct
+ enum lru_list from, enum lru_list to);
+ extern void mem_cgroup_uncharge_page(struct page *page);
+ extern void mem_cgroup_uncharge_cache_page(struct page *page);
+-extern int mem_cgroup_shrink_usage(struct page *page,
++extern int mem_cgroup_shmem_charge_fallback(struct page *page,
+ struct mm_struct *mm, gfp_t gfp_mask);
+
+ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
+@@ -155,7 +155,7 @@ static inline void mem_cgroup_uncharge_c
+ {
+ }
+
+-static inline int mem_cgroup_shrink_usage(struct page *page,
++static inline int mem_cgroup_shmem_charge_fallback(struct page *page,
+ struct mm_struct *mm, gfp_t gfp_mask)
+ {
+ return 0;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/mman.h linux-2.6.30-rc4-git/include/linux/mman.h
+--- linux-2.6.30-rc4/include/linux/mman.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/mman.h 2009-05-13 09:46:19.000000000 +0200
+@@ -12,21 +12,18 @@
+
+ #ifdef __KERNEL__
+ #include <linux/mm.h>
++#include <linux/percpu_counter.h>
+
+ #include <asm/atomic.h>
+
+ extern int sysctl_overcommit_memory;
+ extern int sysctl_overcommit_ratio;
+-extern atomic_long_t vm_committed_space;
++extern struct percpu_counter vm_committed_as;
+
+-#ifdef CONFIG_SMP
+-extern void vm_acct_memory(long pages);
+-#else
+ static inline void vm_acct_memory(long pages)
+ {
+- atomic_long_add(pages, &vm_committed_space);
++ percpu_counter_add(&vm_committed_as, pages);
+ }
+-#endif
+
+ static inline void vm_unacct_memory(long pages)
+ {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/of_platform.h linux-2.6.30-rc4-git/include/linux/of_platform.h
+--- linux-2.6.30-rc4/include/linux/of_platform.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/of_platform.h 2009-05-13 09:46:19.000000000 +0200
+@@ -51,6 +51,16 @@ extern int of_register_driver(struct of_
+ struct bus_type *bus);
+ extern void of_unregister_driver(struct of_platform_driver *drv);
+
++/* Platform drivers register/unregister */
++static inline int of_register_platform_driver(struct of_platform_driver *drv)
++{
++ return of_register_driver(drv, &of_platform_bus_type);
++}
++static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
++{
++ of_unregister_driver(drv);
++}
++
+ #include <asm/of_platform.h>
+
+ extern struct of_device *of_find_device_by_node(struct device_node *np);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/linux/sunrpc/xprt.h linux-2.6.30-rc4-git/include/linux/sunrpc/xprt.h
+--- linux-2.6.30-rc4/include/linux/sunrpc/xprt.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/linux/sunrpc/xprt.h 2009-05-13 09:46:19.000000000 +0200
+@@ -261,6 +261,7 @@ void xprt_conditional_disconnect(struc
+ #define XPRT_BINDING (5)
+ #define XPRT_CLOSING (6)
+ #define XPRT_CONNECTION_ABORT (7)
++#define XPRT_CONNECTION_CLOSE (8)
+
+ static inline void xprt_set_connected(struct rpc_xprt *xprt)
+ {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/scsi/fc/fc_fs.h linux-2.6.30-rc4-git/include/scsi/fc/fc_fs.h
+--- linux-2.6.30-rc4/include/scsi/fc/fc_fs.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/scsi/fc/fc_fs.h 2009-05-13 09:46:19.000000000 +0200
+@@ -149,6 +149,7 @@ enum fc_rctl {
+ * Well-known fabric addresses.
+ */
+ enum fc_well_known_fid {
++ FC_FID_NONE = 0x000000, /* No destination */
+ FC_FID_BCAST = 0xffffff, /* broadcast */
+ FC_FID_FLOGI = 0xfffffe, /* fabric login */
+ FC_FID_FCTRL = 0xfffffd, /* fabric controller */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/scsi/libfc.h linux-2.6.30-rc4-git/include/scsi/libfc.h
+--- linux-2.6.30-rc4/include/scsi/libfc.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/scsi/libfc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -637,6 +637,7 @@ struct fc_disc {
+ enum fc_disc_event);
+
+ struct list_head rports;
++ struct list_head rogue_rports;
+ struct fc_lport *lport;
+ struct mutex disc_mutex;
+ struct fc_gpn_ft_resp partial_buf; /* partial name buffer */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/scsi/libiscsi.h linux-2.6.30-rc4-git/include/scsi/libiscsi.h
+--- linux-2.6.30-rc4/include/scsi/libiscsi.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/scsi/libiscsi.h 2009-05-13 09:46:19.000000000 +0200
+@@ -36,6 +36,7 @@ struct scsi_transport_template;
+ struct scsi_host_template;
+ struct scsi_device;
+ struct Scsi_Host;
++struct scsi_target;
+ struct scsi_cmnd;
+ struct socket;
+ struct iscsi_transport;
+@@ -350,6 +351,7 @@ extern struct Scsi_Host *iscsi_host_allo
+ bool xmit_can_sleep);
+ extern void iscsi_host_remove(struct Scsi_Host *shost);
+ extern void iscsi_host_free(struct Scsi_Host *shost);
++extern int iscsi_target_alloc(struct scsi_target *starget);
+
+ /*
+ * session management
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/include/scsi/osd_protocol.h linux-2.6.30-rc4-git/include/scsi/osd_protocol.h
+--- linux-2.6.30-rc4/include/scsi/osd_protocol.h 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/include/scsi/osd_protocol.h 2009-05-13 09:46:19.000000000 +0200
+@@ -24,17 +24,18 @@ enum {
+ OSDv1_ADDITIONAL_CDB_LENGTH = 192,
+ OSDv1_TOTAL_CDB_LEN = OSDv1_ADDITIONAL_CDB_LENGTH + 8,
+ OSDv1_CAP_LEN = 80,
++
+ /* Latest supported version */
+-/* OSD_ADDITIONAL_CDB_LENGTH = 216,*/
++ OSDv2_ADDITIONAL_CDB_LENGTH = 228,
+ OSD_ADDITIONAL_CDB_LENGTH =
+- OSDv1_ADDITIONAL_CDB_LENGTH, /* FIXME: Pete rev-001 sup */
++ OSDv2_ADDITIONAL_CDB_LENGTH,
+ OSD_TOTAL_CDB_LEN = OSD_ADDITIONAL_CDB_LENGTH + 8,
+-/* OSD_CAP_LEN = 104,*/
+- OSD_CAP_LEN = OSDv1_CAP_LEN,/* FIXME: Pete rev-001 sup */
++ OSD_CAP_LEN = 104,
+
+ OSD_SYSTEMID_LEN = 20,
+- OSD_CRYPTO_KEYID_SIZE = 20,
+- /*FIXME: OSDv2_CRYPTO_KEYID_SIZE = 32,*/
++ OSDv1_CRYPTO_KEYID_SIZE = 20,
++ OSDv2_CRYPTO_KEYID_SIZE = 32,
++ OSD_CRYPTO_KEYID_SIZE = OSDv2_CRYPTO_KEYID_SIZE,
+ OSD_CRYPTO_SEED_SIZE = 4,
+ OSD_CRYPTO_NONCE_SIZE = 12,
+ OSD_MAX_SENSE_LEN = 252, /* from SPC-3 */
+@@ -164,7 +165,11 @@ struct osd_cdb_head {
+ /* called allocation_length in some commands */
+ /*32*/ __be64 length;
+ /*40*/ __be64 start_address;
+-/*48*/ __be32 list_identifier;/* Rarely used */
++ union {
++/*48*/ __be32 list_identifier;/* Rarely used */
++ /* OSD2r05 5.2.5 CDB continuation length */
++/*48*/ __be32 cdb_continuation_length;
++ };
+ } __packed v2;
+ };
+ /*52*/ union { /* selected attributes mode Page/List/Single */
+@@ -204,29 +209,40 @@ struct osd_cdb_head {
+ /*80*/
+
+ /*160 v1*/
+-/*184 v2*/
+-struct osd_security_parameters {
+-/*160*/u8 integrity_check_value[OSD_CRYPTO_KEYID_SIZE];
++struct osdv1_security_parameters {
++/*160*/u8 integrity_check_value[OSDv1_CRYPTO_KEYID_SIZE];
+ /*180*/u8 request_nonce[OSD_CRYPTO_NONCE_SIZE];
+ /*192*/osd_cdb_offset data_in_integrity_check_offset;
+ /*196*/osd_cdb_offset data_out_integrity_check_offset;
+ } __packed;
+ /*200 v1*/
+-/*224 v2*/
+
+-/* FIXME: osdv2_security_parameters */
++/*184 v2*/
++struct osdv2_security_parameters {
++/*184*/u8 integrity_check_value[OSDv2_CRYPTO_KEYID_SIZE];
++/*216*/u8 request_nonce[OSD_CRYPTO_NONCE_SIZE];
++/*228*/osd_cdb_offset data_in_integrity_check_offset;
++/*232*/osd_cdb_offset data_out_integrity_check_offset;
++} __packed;
++/*236 v2*/
++
++struct osd_security_parameters {
++ union {
++ struct osdv1_security_parameters v1;
++ struct osdv2_security_parameters v2;
++ };
++};
+
+ struct osdv1_cdb {
+ struct osd_cdb_head h;
+ u8 caps[OSDv1_CAP_LEN];
+- struct osd_security_parameters sec_params;
++ struct osdv1_security_parameters sec_params;
+ } __packed;
+
+ struct osdv2_cdb {
+ struct osd_cdb_head h;
+ u8 caps[OSD_CAP_LEN];
+- struct osd_security_parameters sec_params;
+- /* FIXME: osdv2_security_parameters */
++ struct osdv2_security_parameters sec_params;
+ } __packed;
+
+ struct osd_cdb {
+@@ -301,14 +317,25 @@ struct osd_attributes_list_attrid {
+ } __packed;
+
+ /*
++ * NOTE: v1: is not aligned.
++ */
++struct osdv1_attributes_list_element {
++ __be32 attr_page;
++ __be32 attr_id;
++ __be16 attr_bytes; /* valid bytes at attr_val without padding */
++ u8 attr_val[0];
++} __packed;
++
++/*
+ * osd2r03: 7.1.3.3 List entry format for retrieved attributes and
+ * for setting attributes
+- * NOTE: v2 is 8-bytes aligned, v1 is not aligned.
++ * NOTE: v2 is 8-bytes aligned
+ */
+-struct osd_attributes_list_element {
++struct osdv2_attributes_list_element {
+ __be32 attr_page;
+ __be32 attr_id;
+- __be16 attr_bytes;
++ u8 reserved[6];
++ __be16 attr_bytes; /* valid bytes at attr_val without padding */
+ u8 attr_val[0];
+ } __packed;
+
+@@ -324,13 +351,13 @@ enum {
+
+ static inline unsigned osdv1_attr_list_elem_size(unsigned len)
+ {
+- return ALIGN(len + sizeof(struct osd_attributes_list_element),
++ return ALIGN(len + sizeof(struct osdv1_attributes_list_element),
+ OSDv1_ATTRIBUTES_ELEM_ALIGN);
+ }
+
+ static inline unsigned osdv2_attr_list_elem_size(unsigned len)
+ {
+- return ALIGN(len + sizeof(struct osd_attributes_list_element),
++ return ALIGN(len + sizeof(struct osdv2_attributes_list_element),
+ OSD_ATTRIBUTES_ELEM_ALIGN);
+ }
+
+@@ -419,15 +446,35 @@ struct osd_data_out_integrity_info {
+ __be64 data_bytes;
+ __be64 set_attributes_bytes;
+ __be64 get_attributes_bytes;
+- __be64 integrity_check_value;
++ __u8 integrity_check_value[OSD_CRYPTO_KEYID_SIZE];
+ } __packed;
+
++/* Same osd_data_out_integrity_info is used for OSD2/OSD1. The only difference
++ * Is the sizeof the structure since in OSD1 the last array is smaller. Use
++ * below for version independent handling of this structure
++ */
++static inline int osd_data_out_integrity_info_sizeof(bool is_ver1)
++{
++ return sizeof(struct osd_data_out_integrity_info) -
++ (is_ver1 * (OSDv2_CRYPTO_KEYID_SIZE - OSDv1_CRYPTO_KEYID_SIZE));
++}
++
+ struct osd_data_in_integrity_info {
+ __be64 data_bytes;
+ __be64 retrieved_attributes_bytes;
+- __be64 integrity_check_value;
++ __u8 integrity_check_value[OSD_CRYPTO_KEYID_SIZE];
+ } __packed;
+
++/* Same osd_data_in_integrity_info is used for OSD2/OSD1. The only difference
++ * Is the sizeof the structure since in OSD1 the last array is smaller. Use
++ * below for version independent handling of this structure
++ */
++static inline int osd_data_in_integrity_info_sizeof(bool is_ver1)
++{
++ return sizeof(struct osd_data_in_integrity_info) -
++ (is_ver1 * (OSDv2_CRYPTO_KEYID_SIZE - OSDv1_CRYPTO_KEYID_SIZE));
++}
++
+ struct osd_timestamp {
+ u8 time[6]; /* number of milliseconds since 1/1/1970 UT (big endian) */
+ } __packed;
+@@ -477,7 +524,7 @@ enum osd_capability_bit_masks {
+
+ OSD_SEC_CAP_NONE1 = BIT(8),
+ OSD_SEC_CAP_NONE2 = BIT(9),
+- OSD_SEC_CAP_NONE3 = BIT(10),
++ OSD_SEC_GBL_REM = BIT(10), /*v2 only*/
+ OSD_SEC_CAP_QUERY = BIT(11), /*v2 only*/
+ OSD_SEC_CAP_M_OBJECT = BIT(12), /*v2 only*/
+ OSD_SEC_CAP_POL_SEC = BIT(13),
+@@ -552,8 +599,7 @@ struct osdv1_capability {
+
+ struct osd_capability {
+ struct osd_capability_head h;
+-/* struct osd_cap_object_descriptor od;*/
+- struct osdv1_cap_object_descriptor od; /* FIXME: Pete rev-001 sup */
++ struct osd_cap_object_descriptor od;
+ } __packed;
+
+ /**
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/kernel/sysctl.c linux-2.6.30-rc4-git/kernel/sysctl.c
+--- linux-2.6.30-rc4/kernel/sysctl.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/kernel/sysctl.c 2009-05-13 09:46:19.000000000 +0200
+@@ -103,6 +103,9 @@ static unsigned long one_ul = 1;
+ static int one_hundred = 100;
+ static int one_thousand = 1000;
+
++/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
++static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
++
+ /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
+ static int maxolduid = 65535;
+ static int minolduid;
+@@ -1006,7 +1009,7 @@ static struct ctl_table vm_table[] = {
+ .mode = 0644,
+ .proc_handler = &dirty_bytes_handler,
+ .strategy = &sysctl_intvec,
+- .extra1 = &one_ul,
++ .extra1 = &dirty_bytes_min,
+ },
+ {
+ .procname = "dirty_writeback_centisecs",
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/MAINTAINERS linux-2.6.30-rc4-git/MAINTAINERS
+--- linux-2.6.30-rc4/MAINTAINERS 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/MAINTAINERS 2009-05-13 09:46:19.000000000 +0200
+@@ -4189,7 +4189,7 @@ P: Joel Becker
+ M: joel.becker@oracle.com
+ L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
+ W: http://oss.oracle.com/projects/ocfs2/
+-T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git
++T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
+ S: Supported
+ F: Documentation/filesystems/ocfs2.txt
+ F: Documentation/filesystems/dlmfs.txt
+@@ -4521,6 +4521,19 @@ M: jim@jtan.com
+ L: cbe-oss-dev@ozlabs.org
+ S: Maintained
+
++PTRACE SUPPORT
++P: Roland McGrath
++M: roland@redhat.com
++P: Oleg Nesterov
++M: oleg@redhat.com
++L: linux-kernel@vger.kernel.org
++S: Maintained
++F: include/asm-generic/syscall.h
++F: include/linux/ptrace.h
++F: include/linux/regset.h
++F: include/linux/tracehook.h
++F: kernel/ptrace.c
++
+ PVRUSB2 VIDEO4LINUX DRIVER
+ P: Mike Isely
+ M: isely@pobox.com
+@@ -4666,13 +4679,13 @@ F: kernel/rcutorture.c
+
+ RDC R-321X SoC
+ P: Florian Fainelli
+-M: florian.fainelli@telecomint.eu
++M: florian@openwrt.org
+ L: linux-kernel@vger.kernel.org
+ S: Maintained
+
+ RDC R6040 FAST ETHERNET DRIVER
+ P: Florian Fainelli
+-M: florian.fainelli@telecomint.eu
++M: florian@openwrt.org
+ L: netdev@vger.kernel.org
+ S: Maintained
+ F: drivers/net/r6040.c
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/Makefile linux-2.6.30-rc4-git/Makefile
+--- linux-2.6.30-rc4/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -1293,7 +1293,7 @@ help:
+ @echo ' dir/ - Build all files in dir and below'
+ @echo ' dir/file.[ois] - Build specified target only'
+ @echo ' dir/file.ko - Build module including final link'
+- @echo ' prepare - Set up for building external modules'
++ @echo ' modules_prepare - Set up for building external modules'
+ @echo ' tags/TAGS - Generate tags file for editors'
+ @echo ' cscope - Generate cscope index'
+ @echo ' kernelrelease - Output the release version string'
+@@ -1421,7 +1421,9 @@ $(clean-dirs):
+ $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
+
+ clean: rm-dirs := $(MODVERDIR)
+-clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers
++clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
++ $(KBUILD_EXTMOD)/Module.markers \
++ $(KBUILD_EXTMOD)/modules.order
+ clean: $(clean-dirs)
+ $(call cmd,rmdirs)
+ $(call cmd,rmfiles)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/memcontrol.c linux-2.6.30-rc4-git/mm/memcontrol.c
+--- linux-2.6.30-rc4/mm/memcontrol.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/memcontrol.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1024,9 +1024,7 @@ static struct mem_cgroup *try_get_mem_cg
+ return NULL;
+
+ pc = lookup_page_cgroup(page);
+- /*
+- * Used bit of swapcache is solid under page lock.
+- */
++ lock_page_cgroup(pc);
+ if (PageCgroupUsed(pc)) {
+ mem = pc->mem_cgroup;
+ if (mem && !css_tryget(&mem->css))
+@@ -1040,6 +1038,7 @@ static struct mem_cgroup *try_get_mem_cg
+ mem = NULL;
+ rcu_read_unlock();
+ }
++ unlock_page_cgroup(pc);
+ return mem;
+ }
+
+@@ -1618,37 +1617,28 @@ void mem_cgroup_end_migration(struct mem
+ }
+
+ /*
+- * A call to try to shrink memory usage under specified resource controller.
+- * This is typically used for page reclaiming for shmem for reducing side
+- * effect of page allocation from shmem, which is used by some mem_cgroup.
++ * A call to try to shrink memory usage on charge failure at shmem's swapin.
++ * Calling hierarchical_reclaim is not enough because we should update
++ * last_oom_jiffies to prevent pagefault_out_of_memory from invoking global OOM.
++ * Moreover considering hierarchy, we should reclaim from the mem_over_limit,
++ * not from the memcg which this page would be charged to.
++ * try_charge_swapin does all of these works properly.
+ */
+-int mem_cgroup_shrink_usage(struct page *page,
++int mem_cgroup_shmem_charge_fallback(struct page *page,
+ struct mm_struct *mm,
+ gfp_t gfp_mask)
+ {
+ struct mem_cgroup *mem = NULL;
+- int progress = 0;
+- int retry = MEM_CGROUP_RECLAIM_RETRIES;
++ int ret;
+
+ if (mem_cgroup_disabled())
+ return 0;
+- if (page)
+- mem = try_get_mem_cgroup_from_swapcache(page);
+- if (!mem && mm)
+- mem = try_get_mem_cgroup_from_mm(mm);
+- if (unlikely(!mem))
+- return 0;
+
+- do {
+- progress = mem_cgroup_hierarchical_reclaim(mem,
+- gfp_mask, true, false);
+- progress += mem_cgroup_check_under_limit(mem);
+- } while (!progress && --retry);
++ ret = mem_cgroup_try_charge_swapin(mm, page, gfp_mask, &mem);
++ if (!ret)
++ mem_cgroup_cancel_charge_swapin(mem); /* it does !mem check */
+
+- css_put(&mem->css);
+- if (!retry)
+- return -ENOMEM;
+- return 0;
++ return ret;
+ }
+
+ static DEFINE_MUTEX(set_limit_mutex);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/memory.c linux-2.6.30-rc4-git/mm/memory.c
+--- linux-2.6.30-rc4/mm/memory.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/memory.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1971,6 +1971,15 @@ static int do_wp_page(struct mm_struct *
+ ret = tmp;
+ goto unwritable_page;
+ }
++ if (unlikely(!(tmp & VM_FAULT_LOCKED))) {
++ lock_page(old_page);
++ if (!old_page->mapping) {
++ ret = 0; /* retry the fault */
++ unlock_page(old_page);
++ goto unwritable_page;
++ }
++ } else
++ VM_BUG_ON(!PageLocked(old_page));
+
+ /*
+ * Since we dropped the lock we need to revalidate
+@@ -1980,9 +1989,11 @@ static int do_wp_page(struct mm_struct *
+ */
+ page_table = pte_offset_map_lock(mm, pmd, address,
+ &ptl);
+- page_cache_release(old_page);
+- if (!pte_same(*page_table, orig_pte))
++ if (!pte_same(*page_table, orig_pte)) {
++ unlock_page(old_page);
++ page_cache_release(old_page);
+ goto unlock;
++ }
+
+ page_mkwrite = 1;
+ }
+@@ -2094,9 +2105,6 @@ gotten:
+ unlock:
+ pte_unmap_unlock(page_table, ptl);
+ if (dirty_page) {
+- if (vma->vm_file)
+- file_update_time(vma->vm_file);
+-
+ /*
+ * Yes, Virginia, this is actually required to prevent a race
+ * with clear_page_dirty_for_io() from clearing the page dirty
+@@ -2105,16 +2113,41 @@ unlock:
+ *
+ * do_no_page is protected similarly.
+ */
+- wait_on_page_locked(dirty_page);
+- set_page_dirty_balance(dirty_page, page_mkwrite);
++ if (!page_mkwrite) {
++ wait_on_page_locked(dirty_page);
++ set_page_dirty_balance(dirty_page, page_mkwrite);
++ }
+ put_page(dirty_page);
++ if (page_mkwrite) {
++ struct address_space *mapping = dirty_page->mapping;
++
++ set_page_dirty(dirty_page);
++ unlock_page(dirty_page);
++ page_cache_release(dirty_page);
++ if (mapping) {
++ /*
++ * Some device drivers do not set page.mapping
++ * but still dirty their pages
++ */
++ balance_dirty_pages_ratelimited(mapping);
++ }
++ }
++
++ /* file_update_time outside page_lock */
++ if (vma->vm_file)
++ file_update_time(vma->vm_file);
+ }
+ return ret;
+ oom_free_new:
+ page_cache_release(new_page);
+ oom:
+- if (old_page)
++ if (old_page) {
++ if (page_mkwrite) {
++ unlock_page(old_page);
++ page_cache_release(old_page);
++ }
+ page_cache_release(old_page);
++ }
+ return VM_FAULT_OOM;
+
+ unwritable_page:
+@@ -2458,8 +2491,7 @@ static int do_swap_page(struct mm_struct
+
+ if (mem_cgroup_try_charge_swapin(mm, page, GFP_KERNEL, &ptr)) {
+ ret = VM_FAULT_OOM;
+- unlock_page(page);
+- goto out;
++ goto out_page;
+ }
+
+ /*
+@@ -2521,6 +2553,7 @@ out:
+ out_nomap:
+ mem_cgroup_cancel_charge_swapin(ptr);
+ pte_unmap_unlock(page_table, ptl);
++out_page:
+ unlock_page(page);
+ page_cache_release(page);
+ return ret;
+@@ -2664,27 +2697,22 @@ static int __do_fault(struct mm_struct *
+ int tmp;
+
+ unlock_page(page);
+- vmf.flags |= FAULT_FLAG_MKWRITE;
++ vmf.flags = FAULT_FLAG_WRITE|FAULT_FLAG_MKWRITE;
+ tmp = vma->vm_ops->page_mkwrite(vma, &vmf);
+ if (unlikely(tmp &
+ (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) {
+ ret = tmp;
+- anon = 1; /* no anon but release vmf.page */
+- goto out_unlocked;
+- }
+- lock_page(page);
+- /*
+- * XXX: this is not quite right (racy vs
+- * invalidate) to unlock and relock the page
+- * like this, however a better fix requires
+- * reworking page_mkwrite locking API, which
+- * is better done later.
+- */
+- if (!page->mapping) {
+- ret = 0;
+- anon = 1; /* no anon but release vmf.page */
+- goto out;
++ goto unwritable_page;
+ }
++ if (unlikely(!(tmp & VM_FAULT_LOCKED))) {
++ lock_page(page);
++ if (!page->mapping) {
++ ret = 0; /* retry the fault */
++ unlock_page(page);
++ goto unwritable_page;
++ }
++ } else
++ VM_BUG_ON(!PageLocked(page));
+ page_mkwrite = 1;
+ }
+ }
+@@ -2736,19 +2764,35 @@ static int __do_fault(struct mm_struct *
+ pte_unmap_unlock(page_table, ptl);
+
+ out:
+- unlock_page(vmf.page);
+-out_unlocked:
+- if (anon)
+- page_cache_release(vmf.page);
+- else if (dirty_page) {
+- if (vma->vm_file)
+- file_update_time(vma->vm_file);
++ if (dirty_page) {
++ struct address_space *mapping = page->mapping;
+
+- set_page_dirty_balance(dirty_page, page_mkwrite);
++ if (set_page_dirty(dirty_page))
++ page_mkwrite = 1;
++ unlock_page(dirty_page);
+ put_page(dirty_page);
++ if (page_mkwrite && mapping) {
++ /*
++ * Some device drivers do not set page.mapping but still
++ * dirty their pages
++ */
++ balance_dirty_pages_ratelimited(mapping);
++ }
++
++ /* file_update_time outside page_lock */
++ if (vma->vm_file)
++ file_update_time(vma->vm_file);
++ } else {
++ unlock_page(vmf.page);
++ if (anon)
++ page_cache_release(vmf.page);
+ }
+
+ return ret;
++
++unwritable_page:
++ page_cache_release(page);
++ return ret;
+ }
+
+ static int do_linear_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/mmap.c linux-2.6.30-rc4-git/mm/mmap.c
+--- linux-2.6.30-rc4/mm/mmap.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/mmap.c 2009-05-13 09:46:19.000000000 +0200
+@@ -85,7 +85,7 @@ EXPORT_SYMBOL(vm_get_page_prot);
+ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
+ int sysctl_overcommit_ratio = 50; /* default is 50% */
+ int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
+-atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
++struct percpu_counter vm_committed_as;
+
+ /*
+ * Check that a process has enough memory to allocate a new virtual
+@@ -179,11 +179,7 @@ int __vm_enough_memory(struct mm_struct
+ if (mm)
+ allowed -= mm->total_vm / 32;
+
+- /*
+- * cast `allowed' as a signed long because vm_committed_space
+- * sometimes has a negative value
+- */
+- if (atomic_long_read(&vm_committed_space) < (long)allowed)
++ if (percpu_counter_read_positive(&vm_committed_as) < allowed)
+ return 0;
+ error:
+ vm_unacct_memory(pages);
+@@ -2481,4 +2477,8 @@ void mm_drop_all_locks(struct mm_struct
+ */
+ void __init mmap_init(void)
+ {
++ int ret;
++
++ ret = percpu_counter_init(&vm_committed_as, 0);
++ VM_BUG_ON(ret);
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/nommu.c linux-2.6.30-rc4-git/mm/nommu.c
+--- linux-2.6.30-rc4/mm/nommu.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/nommu.c 2009-05-13 09:46:19.000000000 +0200
+@@ -62,7 +62,7 @@ void *high_memory;
+ struct page *mem_map;
+ unsigned long max_mapnr;
+ unsigned long num_physpages;
+-atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
++struct percpu_counter vm_committed_as;
+ int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
+ int sysctl_overcommit_ratio = 50; /* default is 50% */
+ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
+@@ -463,6 +463,10 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
+ */
+ void __init mmap_init(void)
+ {
++ int ret;
++
++ ret = percpu_counter_init(&vm_committed_as, 0);
++ VM_BUG_ON(ret);
+ vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC);
+ }
+
+@@ -1847,12 +1851,9 @@ int __vm_enough_memory(struct mm_struct
+ if (mm)
+ allowed -= mm->total_vm / 32;
+
+- /*
+- * cast `allowed' as a signed long because vm_committed_space
+- * sometimes has a negative value
+- */
+- if (atomic_long_read(&vm_committed_space) < (long)allowed)
++ if (percpu_counter_read_positive(&vm_committed_as) < allowed)
+ return 0;
++
+ error:
+ vm_unacct_memory(pages);
+
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/shmem.c linux-2.6.30-rc4-git/mm/shmem.c
+--- linux-2.6.30-rc4/mm/shmem.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/shmem.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1340,8 +1340,12 @@ repeat:
+ shmem_swp_unmap(entry);
+ spin_unlock(&info->lock);
+ if (error == -ENOMEM) {
+- /* allow reclaim from this memory cgroup */
+- error = mem_cgroup_shrink_usage(swappage,
++ /*
++ * reclaim from proper memory cgroup and
++ * call memcg's OOM if needed.
++ */
++ error = mem_cgroup_shmem_charge_fallback(
++ swappage,
+ current->mm,
+ gfp);
+ if (error) {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/swap.c linux-2.6.30-rc4-git/mm/swap.c
+--- linux-2.6.30-rc4/mm/swap.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/swap.c 2009-05-13 09:46:19.000000000 +0200
+@@ -491,49 +491,6 @@ unsigned pagevec_lookup_tag(struct pagev
+
+ EXPORT_SYMBOL(pagevec_lookup_tag);
+
+-#ifdef CONFIG_SMP
+-/*
+- * We tolerate a little inaccuracy to avoid ping-ponging the counter between
+- * CPUs
+- */
+-#define ACCT_THRESHOLD max(16, NR_CPUS * 2)
+-
+-static DEFINE_PER_CPU(long, committed_space);
+-
+-void vm_acct_memory(long pages)
+-{
+- long *local;
+-
+- preempt_disable();
+- local = &__get_cpu_var(committed_space);
+- *local += pages;
+- if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
+- atomic_long_add(*local, &vm_committed_space);
+- *local = 0;
+- }
+- preempt_enable();
+-}
+-
+-#ifdef CONFIG_HOTPLUG_CPU
+-
+-/* Drop the CPU's cached committed space back into the central pool. */
+-static int cpu_swap_callback(struct notifier_block *nfb,
+- unsigned long action,
+- void *hcpu)
+-{
+- long *committed;
+-
+- committed = &per_cpu(committed_space, (long)hcpu);
+- if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
+- atomic_long_add(*committed, &vm_committed_space);
+- *committed = 0;
+- drain_cpu_pagevecs((long)hcpu);
+- }
+- return NOTIFY_OK;
+-}
+-#endif /* CONFIG_HOTPLUG_CPU */
+-#endif /* CONFIG_SMP */
+-
+ /*
+ * Perform any setup for the swap system
+ */
+@@ -554,7 +511,4 @@ void __init swap_setup(void)
+ * Right now other parts of the system means that we
+ * _really_ don't want to cluster much more
+ */
+-#ifdef CONFIG_HOTPLUG_CPU
+- hotcpu_notifier(cpu_swap_callback, 0);
+-#endif
+ }
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/mm/vmscan.c linux-2.6.30-rc4-git/mm/vmscan.c
+--- linux-2.6.30-rc4/mm/vmscan.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/mm/vmscan.c 2009-05-13 09:46:19.000000000 +0200
+@@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, st
+
+ for_each_evictable_lru(l) {
+ int file = is_file_lru(l);
+- int scan;
++ unsigned long scan;
+
+ scan = zone_nr_pages(zone, sc, l);
+ if (priority) {
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/net/sunrpc/xprt.c linux-2.6.30-rc4-git/net/sunrpc/xprt.c
+--- linux-2.6.30-rc4/net/sunrpc/xprt.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/net/sunrpc/xprt.c 2009-05-13 09:46:19.000000000 +0200
+@@ -672,10 +672,8 @@ xprt_init_autodisconnect(unsigned long d
+ if (test_and_set_bit(XPRT_LOCKED, &xprt->state))
+ goto out_abort;
+ spin_unlock(&xprt->transport_lock);
+- if (xprt_connecting(xprt))
+- xprt_release_write(xprt, NULL);
+- else
+- queue_work(rpciod_workqueue, &xprt->task_cleanup);
++ set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
++ queue_work(rpciod_workqueue, &xprt->task_cleanup);
+ return;
+ out_abort:
+ spin_unlock(&xprt->transport_lock);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/net/sunrpc/xprtsock.c linux-2.6.30-rc4-git/net/sunrpc/xprtsock.c
+--- linux-2.6.30-rc4/net/sunrpc/xprtsock.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/net/sunrpc/xprtsock.c 2009-05-13 09:46:19.000000000 +0200
+@@ -807,6 +807,9 @@ static void xs_reset_transport(struct so
+ *
+ * This is used when all requests are complete; ie, no DRC state remains
+ * on the server we want to save.
++ *
++ * The caller _must_ be holding XPRT_LOCKED in order to avoid issues with
++ * xs_reset_transport() zeroing the socket from underneath a writer.
+ */
+ static void xs_close(struct rpc_xprt *xprt)
+ {
+@@ -824,6 +827,14 @@ static void xs_close(struct rpc_xprt *xp
+ xprt_disconnect_done(xprt);
+ }
+
++static void xs_tcp_close(struct rpc_xprt *xprt)
++{
++ if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state))
++ xs_close(xprt);
++ else
++ xs_tcp_shutdown(xprt);
++}
++
+ /**
+ * xs_destroy - prepare to shutdown a transport
+ * @xprt: doomed transport
+@@ -1772,6 +1783,15 @@ static void xs_tcp_setup_socket(struct r
+ xprt, -status, xprt_connected(xprt),
+ sock->sk->sk_state);
+ switch (status) {
++ default:
++ printk("%s: connect returned unhandled error %d\n",
++ __func__, status);
++ case -EADDRNOTAVAIL:
++ /* We're probably in TIME_WAIT. Get rid of existing socket,
++ * and retry
++ */
++ set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
++ xprt_force_disconnect(xprt);
+ case -ECONNREFUSED:
+ case -ECONNRESET:
+ case -ENETUNREACH:
+@@ -1782,10 +1802,6 @@ static void xs_tcp_setup_socket(struct r
+ xprt_clear_connecting(xprt);
+ return;
+ }
+- /* get rid of existing socket, and retry */
+- xs_tcp_shutdown(xprt);
+- printk("%s: connect returned unhandled error %d\n",
+- __func__, status);
+ out_eagain:
+ status = -EAGAIN;
+ out:
+@@ -1994,7 +2010,7 @@ static struct rpc_xprt_ops xs_tcp_ops =
+ .buf_free = rpc_free,
+ .send_request = xs_tcp_send_request,
+ .set_retrans_timeout = xprt_set_retrans_timeout_def,
+- .close = xs_tcp_shutdown,
++ .close = xs_tcp_close,
+ .destroy = xs_destroy,
+ .print_stats = xs_tcp_print_stats,
+ };
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/checks.c linux-2.6.30-rc4-git/scripts/dtc/checks.c
+--- linux-2.6.30-rc4/scripts/dtc/checks.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/checks.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,587 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2007.
++ *
++ *
++ * 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 "dtc.h"
++
++#ifdef TRACE_CHECKS
++#define TRACE(c, ...) \
++ do { \
++ fprintf(stderr, "=== %s: ", (c)->name); \
++ fprintf(stderr, __VA_ARGS__); \
++ fprintf(stderr, "\n"); \
++ } while (0)
++#else
++#define TRACE(c, fmt, ...) do { } while (0)
++#endif
++
++enum checklevel {
++ IGNORE = 0,
++ WARN = 1,
++ ERROR = 2,
++};
++
++enum checkstatus {
++ UNCHECKED = 0,
++ PREREQ,
++ PASSED,
++ FAILED,
++};
++
++struct check;
++
++typedef void (*tree_check_fn)(struct check *c, struct node *dt);
++typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
++typedef void (*prop_check_fn)(struct check *c, struct node *dt,
++ struct node *node, struct property *prop);
++
++struct check {
++ const char *name;
++ tree_check_fn tree_fn;
++ node_check_fn node_fn;
++ prop_check_fn prop_fn;
++ void *data;
++ enum checklevel level;
++ enum checkstatus status;
++ int inprogress;
++ int num_prereqs;
++ struct check **prereq;
++};
++
++#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
++ static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
++ static struct check nm = { \
++ .name = #nm, \
++ .tree_fn = (tfn), \
++ .node_fn = (nfn), \
++ .prop_fn = (pfn), \
++ .data = (d), \
++ .level = (lvl), \
++ .status = UNCHECKED, \
++ .num_prereqs = ARRAY_SIZE(nm##_prereqs), \
++ .prereq = nm##_prereqs, \
++ };
++
++#define TREE_CHECK(nm, d, lvl, ...) \
++ CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
++#define NODE_CHECK(nm, d, lvl, ...) \
++ CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
++#define PROP_CHECK(nm, d, lvl, ...) \
++ CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
++#define BATCH_CHECK(nm, lvl, ...) \
++ CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
++
++#ifdef __GNUC__
++static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
++#endif
++static inline void check_msg(struct check *c, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap, fmt);
++
++ if ((c->level < WARN) || (c->level <= quiet))
++ return; /* Suppress message */
++
++ fprintf(stderr, "%s (%s): ",
++ (c->level == ERROR) ? "ERROR" : "Warning", c->name);
++ vfprintf(stderr, fmt, ap);
++ fprintf(stderr, "\n");
++}
++
++#define FAIL(c, ...) \
++ do { \
++ TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \
++ (c)->status = FAILED; \
++ check_msg((c), __VA_ARGS__); \
++ } while (0)
++
++static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
++{
++ struct node *child;
++ struct property *prop;
++
++ TRACE(c, "%s", node->fullpath);
++ if (c->node_fn)
++ c->node_fn(c, dt, node);
++
++ if (c->prop_fn)
++ for_each_property(node, prop) {
++ TRACE(c, "%s\t'%s'", node->fullpath, prop->name);
++ c->prop_fn(c, dt, node, prop);
++ }
++
++ for_each_child(node, child)
++ check_nodes_props(c, dt, child);
++}
++
++static int run_check(struct check *c, struct node *dt)
++{
++ int error = 0;
++ int i;
++
++ assert(!c->inprogress);
++
++ if (c->status != UNCHECKED)
++ goto out;
++
++ c->inprogress = 1;
++
++ for (i = 0; i < c->num_prereqs; i++) {
++ struct check *prq = c->prereq[i];
++ error |= run_check(prq, dt);
++ if (prq->status != PASSED) {
++ c->status = PREREQ;
++ check_msg(c, "Failed prerequisite '%s'",
++ c->prereq[i]->name);
++ }
++ }
++
++ if (c->status != UNCHECKED)
++ goto out;
++
++ if (c->node_fn || c->prop_fn)
++ check_nodes_props(c, dt, dt);
++
++ if (c->tree_fn)
++ c->tree_fn(c, dt);
++ if (c->status == UNCHECKED)
++ c->status = PASSED;
++
++ TRACE(c, "\tCompleted, status %d", c->status);
++
++out:
++ c->inprogress = 0;
++ if ((c->status != PASSED) && (c->level == ERROR))
++ error = 1;
++ return error;
++}
++
++/*
++ * Utility check functions
++ */
++
++static void check_is_string(struct check *c, struct node *root,
++ struct node *node)
++{
++ struct property *prop;
++ char *propname = c->data;
++
++ prop = get_property(node, propname);
++ if (!prop)
++ return; /* Not present, assumed ok */
++
++ if (!data_is_one_string(prop->val))
++ FAIL(c, "\"%s\" property in %s is not a string",
++ propname, node->fullpath);
++}
++#define CHECK_IS_STRING(nm, propname, lvl) \
++ CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl))
++
++static void check_is_cell(struct check *c, struct node *root,
++ struct node *node)
++{
++ struct property *prop;
++ char *propname = c->data;
++
++ prop = get_property(node, propname);
++ if (!prop)
++ return; /* Not present, assumed ok */
++
++ if (prop->val.len != sizeof(cell_t))
++ FAIL(c, "\"%s\" property in %s is not a single cell",
++ propname, node->fullpath);
++}
++#define CHECK_IS_CELL(nm, propname, lvl) \
++ CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl))
++
++/*
++ * Structural check functions
++ */
++
++static void check_duplicate_node_names(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct node *child, *child2;
++
++ for_each_child(node, child)
++ for (child2 = child->next_sibling;
++ child2;
++ child2 = child2->next_sibling)
++ if (streq(child->name, child2->name))
++ FAIL(c, "Duplicate node name %s",
++ child->fullpath);
++}
++NODE_CHECK(duplicate_node_names, NULL, ERROR);
++
++static void check_duplicate_property_names(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct property *prop, *prop2;
++
++ for_each_property(node, prop)
++ for (prop2 = prop->next; prop2; prop2 = prop2->next)
++ if (streq(prop->name, prop2->name))
++ FAIL(c, "Duplicate property name %s in %s",
++ prop->name, node->fullpath);
++}
++NODE_CHECK(duplicate_property_names, NULL, ERROR);
++
++#define LOWERCASE "abcdefghijklmnopqrstuvwxyz"
++#define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
++#define DIGITS "0123456789"
++#define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-"
++
++static void check_node_name_chars(struct check *c, struct node *dt,
++ struct node *node)
++{
++ int n = strspn(node->name, c->data);
++
++ if (n < strlen(node->name))
++ FAIL(c, "Bad character '%c' in node %s",
++ node->name[n], node->fullpath);
++}
++NODE_CHECK(node_name_chars, PROPNODECHARS "@", ERROR);
++
++static void check_node_name_format(struct check *c, struct node *dt,
++ struct node *node)
++{
++ if (strchr(get_unitname(node), '@'))
++ FAIL(c, "Node %s has multiple '@' characters in name",
++ node->fullpath);
++}
++NODE_CHECK(node_name_format, NULL, ERROR, &node_name_chars);
++
++static void check_property_name_chars(struct check *c, struct node *dt,
++ struct node *node, struct property *prop)
++{
++ int n = strspn(prop->name, c->data);
++
++ if (n < strlen(prop->name))
++ FAIL(c, "Bad character '%c' in property name \"%s\", node %s",
++ prop->name[n], prop->name, node->fullpath);
++}
++PROP_CHECK(property_name_chars, PROPNODECHARS, ERROR);
++
++static void check_explicit_phandles(struct check *c, struct node *root,
++ struct node *node)
++{
++ struct property *prop;
++ struct node *other;
++ cell_t phandle;
++
++ prop = get_property(node, "linux,phandle");
++ if (! prop)
++ return; /* No phandle, that's fine */
++
++ if (prop->val.len != sizeof(cell_t)) {
++ FAIL(c, "%s has bad length (%d) linux,phandle property",
++ node->fullpath, prop->val.len);
++ return;
++ }
++
++ phandle = propval_cell(prop);
++ if ((phandle == 0) || (phandle == -1)) {
++ FAIL(c, "%s has invalid linux,phandle value 0x%x",
++ node->fullpath, phandle);
++ return;
++ }
++
++ other = get_node_by_phandle(root, phandle);
++ if (other) {
++ FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
++ node->fullpath, phandle, other->fullpath);
++ return;
++ }
++
++ node->phandle = phandle;
++}
++NODE_CHECK(explicit_phandles, NULL, ERROR);
++
++static void check_name_properties(struct check *c, struct node *root,
++ struct node *node)
++{
++ struct property **pp, *prop = NULL;
++
++ for (pp = &node->proplist; *pp; pp = &((*pp)->next))
++ if (streq((*pp)->name, "name")) {
++ prop = *pp;
++ break;
++ }
++
++ if (!prop)
++ return; /* No name property, that's fine */
++
++ if ((prop->val.len != node->basenamelen+1)
++ || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) {
++ FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead"
++ " of base node name)", node->fullpath, prop->val.val);
++ } else {
++ /* The name property is correct, and therefore redundant.
++ * Delete it */
++ *pp = prop->next;
++ free(prop->name);
++ data_free(prop->val);
++ free(prop);
++ }
++}
++CHECK_IS_STRING(name_is_string, "name", ERROR);
++NODE_CHECK(name_properties, NULL, ERROR, &name_is_string);
++
++/*
++ * Reference fixup functions
++ */
++
++static void fixup_phandle_references(struct check *c, struct node *dt,
++ struct node *node, struct property *prop)
++{
++ struct marker *m = prop->val.markers;
++ struct node *refnode;
++ cell_t phandle;
++
++ for_each_marker_of_type(m, REF_PHANDLE) {
++ assert(m->offset + sizeof(cell_t) <= prop->val.len);
++
++ refnode = get_node_by_ref(dt, m->ref);
++ if (! refnode) {
++ FAIL(c, "Reference to non-existent node or label \"%s\"\n",
++ m->ref);
++ continue;
++ }
++
++ phandle = get_node_phandle(dt, refnode);
++ *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
++ }
++}
++CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,
++ &duplicate_node_names, &explicit_phandles);
++
++static void fixup_path_references(struct check *c, struct node *dt,
++ struct node *node, struct property *prop)
++{
++ struct marker *m = prop->val.markers;
++ struct node *refnode;
++ char *path;
++
++ for_each_marker_of_type(m, REF_PATH) {
++ assert(m->offset <= prop->val.len);
++
++ refnode = get_node_by_ref(dt, m->ref);
++ if (!refnode) {
++ FAIL(c, "Reference to non-existent node or label \"%s\"\n",
++ m->ref);
++ continue;
++ }
++
++ path = refnode->fullpath;
++ prop->val = data_insert_at_marker(prop->val, m, path,
++ strlen(path) + 1);
++ }
++}
++CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR,
++ &duplicate_node_names);
++
++/*
++ * Semantic checks
++ */
++CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN);
++CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN);
++CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN);
++
++CHECK_IS_STRING(device_type_is_string, "device_type", WARN);
++CHECK_IS_STRING(model_is_string, "model", WARN);
++CHECK_IS_STRING(status_is_string, "status", WARN);
++
++static void fixup_addr_size_cells(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct property *prop;
++
++ node->addr_cells = -1;
++ node->size_cells = -1;
++
++ prop = get_property(node, "#address-cells");
++ if (prop)
++ node->addr_cells = propval_cell(prop);
++
++ prop = get_property(node, "#size-cells");
++ if (prop)
++ node->size_cells = propval_cell(prop);
++}
++CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN,
++ &address_cells_is_cell, &size_cells_is_cell);
++
++#define node_addr_cells(n) \
++ (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
++#define node_size_cells(n) \
++ (((n)->size_cells == -1) ? 1 : (n)->size_cells)
++
++static void check_reg_format(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct property *prop;
++ int addr_cells, size_cells, entrylen;
++
++ prop = get_property(node, "reg");
++ if (!prop)
++ return; /* No "reg", that's fine */
++
++ if (!node->parent) {
++ FAIL(c, "Root node has a \"reg\" property");
++ return;
++ }
++
++ if (prop->val.len == 0)
++ FAIL(c, "\"reg\" property in %s is empty", node->fullpath);
++
++ addr_cells = node_addr_cells(node->parent);
++ size_cells = node_size_cells(node->parent);
++ entrylen = (addr_cells + size_cells) * sizeof(cell_t);
++
++ if ((prop->val.len % entrylen) != 0)
++ FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) "
++ "(#address-cells == %d, #size-cells == %d)",
++ node->fullpath, prop->val.len, addr_cells, size_cells);
++}
++NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells);
++
++static void check_ranges_format(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct property *prop;
++ int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
++
++ prop = get_property(node, "ranges");
++ if (!prop)
++ return;
++
++ if (!node->parent) {
++ FAIL(c, "Root node has a \"ranges\" property");
++ return;
++ }
++
++ p_addr_cells = node_addr_cells(node->parent);
++ p_size_cells = node_size_cells(node->parent);
++ c_addr_cells = node_addr_cells(node);
++ c_size_cells = node_size_cells(node);
++ entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
++
++ if (prop->val.len == 0) {
++ if (p_addr_cells != c_addr_cells)
++ FAIL(c, "%s has empty \"ranges\" property but its "
++ "#address-cells (%d) differs from %s (%d)",
++ node->fullpath, c_addr_cells, node->parent->fullpath,
++ p_addr_cells);
++ if (p_size_cells != c_size_cells)
++ FAIL(c, "%s has empty \"ranges\" property but its "
++ "#size-cells (%d) differs from %s (%d)",
++ node->fullpath, c_size_cells, node->parent->fullpath,
++ p_size_cells);
++ } else if ((prop->val.len % entrylen) != 0) {
++ FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) "
++ "(parent #address-cells == %d, child #address-cells == %d, "
++ "#size-cells == %d)", node->fullpath, prop->val.len,
++ p_addr_cells, c_addr_cells, c_size_cells);
++ }
++}
++NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells);
++
++/*
++ * Style checks
++ */
++static void check_avoid_default_addr_size(struct check *c, struct node *dt,
++ struct node *node)
++{
++ struct property *reg, *ranges;
++
++ if (!node->parent)
++ return; /* Ignore root node */
++
++ reg = get_property(node, "reg");
++ ranges = get_property(node, "ranges");
++
++ if (!reg && !ranges)
++ return;
++
++ if ((node->parent->addr_cells == -1))
++ FAIL(c, "Relying on default #address-cells value for %s",
++ node->fullpath);
++
++ if ((node->parent->size_cells == -1))
++ FAIL(c, "Relying on default #size-cells value for %s",
++ node->fullpath);
++}
++NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells);
++
++static void check_obsolete_chosen_interrupt_controller(struct check *c,
++ struct node *dt)
++{
++ struct node *chosen;
++ struct property *prop;
++
++ chosen = get_node_by_path(dt, "/chosen");
++ if (!chosen)
++ return;
++
++ prop = get_property(chosen, "interrupt-controller");
++ if (prop)
++ FAIL(c, "/chosen has obsolete \"interrupt-controller\" "
++ "property");
++}
++TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN);
++
++static struct check *check_table[] = {
++ &duplicate_node_names, &duplicate_property_names,
++ &node_name_chars, &node_name_format, &property_name_chars,
++ &name_is_string, &name_properties,
++ &explicit_phandles,
++ &phandle_references, &path_references,
++
++ &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
++ &device_type_is_string, &model_is_string, &status_is_string,
++
++ &addr_size_cells, &reg_format, &ranges_format,
++
++ &avoid_default_addr_size,
++ &obsolete_chosen_interrupt_controller,
++};
++
++void process_checks(int force, struct boot_info *bi)
++{
++ struct node *dt = bi->dt;
++ int i;
++ int error = 0;
++
++ for (i = 0; i < ARRAY_SIZE(check_table); i++) {
++ struct check *c = check_table[i];
++
++ if (c->level != IGNORE)
++ error = error || run_check(c, dt);
++ }
++
++ if (error) {
++ if (!force) {
++ fprintf(stderr, "ERROR: Input tree has errors, aborting "
++ "(use -f to force output)\n");
++ exit(2);
++ } else if (quiet < 3) {
++ fprintf(stderr, "Warning: Input tree has errors, "
++ "output forced\n");
++ }
++ }
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/data.c linux-2.6.30-rc4-git/scripts/dtc/data.c
+--- linux-2.6.30-rc4/scripts/dtc/data.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/data.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,321 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++
++void data_free(struct data d)
++{
++ struct marker *m, *nm;
++
++ m = d.markers;
++ while (m) {
++ nm = m->next;
++ free(m->ref);
++ free(m);
++ m = nm;
++ }
++
++ if (d.val)
++ free(d.val);
++}
++
++struct data data_grow_for(struct data d, int xlen)
++{
++ struct data nd;
++ int newsize;
++
++ if (xlen == 0)
++ return d;
++
++ nd = d;
++
++ newsize = xlen;
++
++ while ((d.len + xlen) > newsize)
++ newsize *= 2;
++
++ nd.val = xrealloc(d.val, newsize);
++
++ return nd;
++}
++
++struct data data_copy_mem(const char *mem, int len)
++{
++ struct data d;
++
++ d = data_grow_for(empty_data, len);
++
++ d.len = len;
++ memcpy(d.val, mem, len);
++
++ return d;
++}
++
++static char get_oct_char(const char *s, int *i)
++{
++ char x[4];
++ char *endx;
++ long val;
++
++ x[3] = '\0';
++ strncpy(x, s + *i, 3);
++
++ val = strtol(x, &endx, 8);
++
++ assert(endx > x);
++
++ (*i) += endx - x;
++ return val;
++}
++
++static char get_hex_char(const char *s, int *i)
++{
++ char x[3];
++ char *endx;
++ long val;
++
++ x[2] = '\0';
++ strncpy(x, s + *i, 2);
++
++ val = strtol(x, &endx, 16);
++ if (!(endx > x))
++ die("\\x used with no following hex digits\n");
++
++ (*i) += endx - x;
++ return val;
++}
++
++struct data data_copy_escape_string(const char *s, int len)
++{
++ int i = 0;
++ struct data d;
++ char *q;
++
++ d = data_grow_for(empty_data, strlen(s)+1);
++
++ q = d.val;
++ while (i < len) {
++ char c = s[i++];
++
++ if (c != '\\') {
++ q[d.len++] = c;
++ continue;
++ }
++
++ c = s[i++];
++ assert(c);
++ switch (c) {
++ case 'a':
++ q[d.len++] = '\a';
++ break;
++ case 'b':
++ q[d.len++] = '\b';
++ break;
++ case 't':
++ q[d.len++] = '\t';
++ break;
++ case 'n':
++ q[d.len++] = '\n';
++ break;
++ case 'v':
++ q[d.len++] = '\v';
++ break;
++ case 'f':
++ q[d.len++] = '\f';
++ break;
++ case 'r':
++ q[d.len++] = '\r';
++ break;
++ case '0':
++ case '1':
++ case '2':
++ case '3':
++ case '4':
++ case '5':
++ case '6':
++ case '7':
++ i--; /* need to re-read the first digit as
++ * part of the octal value */
++ q[d.len++] = get_oct_char(s, &i);
++ break;
++ case 'x':
++ q[d.len++] = get_hex_char(s, &i);
++ break;
++ default:
++ q[d.len++] = c;
++ }
++ }
++
++ q[d.len++] = '\0';
++ return d;
++}
++
++struct data data_copy_file(FILE *f, size_t maxlen)
++{
++ struct data d = empty_data;
++
++ while (!feof(f) && (d.len < maxlen)) {
++ size_t chunksize, ret;
++
++ if (maxlen == -1)
++ chunksize = 4096;
++ else
++ chunksize = maxlen - d.len;
++
++ d = data_grow_for(d, chunksize);
++ ret = fread(d.val + d.len, 1, chunksize, f);
++
++ if (ferror(f))
++ die("Error reading file into data: %s", strerror(errno));
++
++ if (d.len + ret < d.len)
++ die("Overflow reading file into data\n");
++
++ d.len += ret;
++ }
++
++ return d;
++}
++
++struct data data_append_data(struct data d, const void *p, int len)
++{
++ d = data_grow_for(d, len);
++ memcpy(d.val + d.len, p, len);
++ d.len += len;
++ return d;
++}
++
++struct data data_insert_at_marker(struct data d, struct marker *m,
++ const void *p, int len)
++{
++ d = data_grow_for(d, len);
++ memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
++ memcpy(d.val + m->offset, p, len);
++ d.len += len;
++
++ /* Adjust all markers after the one we're inserting at */
++ m = m->next;
++ for_each_marker(m)
++ m->offset += len;
++ return d;
++}
++
++struct data data_append_markers(struct data d, struct marker *m)
++{
++ struct marker **mp = &d.markers;
++
++ /* Find the end of the markerlist */
++ while (*mp)
++ mp = &((*mp)->next);
++ *mp = m;
++ return d;
++}
++
++struct data data_merge(struct data d1, struct data d2)
++{
++ struct data d;
++ struct marker *m2 = d2.markers;
++
++ d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
++
++ /* Adjust for the length of d1 */
++ for_each_marker(m2)
++ m2->offset += d1.len;
++
++ d2.markers = NULL; /* So data_free() doesn't clobber them */
++ data_free(d2);
++
++ return d;
++}
++
++struct data data_append_cell(struct data d, cell_t word)
++{
++ cell_t beword = cpu_to_fdt32(word);
++
++ return data_append_data(d, &beword, sizeof(beword));
++}
++
++struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
++{
++ struct fdt_reserve_entry bere;
++
++ bere.address = cpu_to_fdt64(re->address);
++ bere.size = cpu_to_fdt64(re->size);
++
++ return data_append_data(d, &bere, sizeof(bere));
++}
++
++struct data data_append_addr(struct data d, uint64_t addr)
++{
++ uint64_t beaddr = cpu_to_fdt64(addr);
++
++ return data_append_data(d, &beaddr, sizeof(beaddr));
++}
++
++struct data data_append_byte(struct data d, uint8_t byte)
++{
++ return data_append_data(d, &byte, 1);
++}
++
++struct data data_append_zeroes(struct data d, int len)
++{
++ d = data_grow_for(d, len);
++
++ memset(d.val + d.len, 0, len);
++ d.len += len;
++ return d;
++}
++
++struct data data_append_align(struct data d, int align)
++{
++ int newlen = ALIGN(d.len, align);
++ return data_append_zeroes(d, newlen - d.len);
++}
++
++struct data data_add_marker(struct data d, enum markertype type, char *ref)
++{
++ struct marker *m;
++
++ m = xmalloc(sizeof(*m));
++ m->offset = d.len;
++ m->type = type;
++ m->ref = ref;
++ m->next = NULL;
++
++ return data_append_markers(d, m);
++}
++
++int data_is_one_string(struct data d)
++{
++ int i;
++ int len = d.len;
++
++ if (len == 0)
++ return 0;
++
++ for (i = 0; i < len-1; i++)
++ if (d.val[i] == '\0')
++ return 0;
++
++ if (d.val[len-1] != '\0')
++ return 0;
++
++ return 1;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc.c linux-2.6.30-rc4-git/scripts/dtc/dtc.c
+--- linux-2.6.30-rc4/scripts/dtc/dtc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,226 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++#include "srcpos.h"
++
++#include "version_gen.h"
++
++/*
++ * Command line options
++ */
++int quiet; /* Level of quietness */
++int reservenum; /* Number of memory reservation slots */
++int minsize; /* Minimum blob size */
++int padsize; /* Additional padding to blob */
++
++char *join_path(const char *path, const char *name)
++{
++ int lenp = strlen(path);
++ int lenn = strlen(name);
++ int len;
++ int needslash = 1;
++ char *str;
++
++ len = lenp + lenn + 2;
++ if ((lenp > 0) && (path[lenp-1] == '/')) {
++ needslash = 0;
++ len--;
++ }
++
++ str = xmalloc(len);
++ memcpy(str, path, lenp);
++ if (needslash) {
++ str[lenp] = '/';
++ lenp++;
++ }
++ memcpy(str+lenp, name, lenn+1);
++ return str;
++}
++
++static void fill_fullpaths(struct node *tree, const char *prefix)
++{
++ struct node *child;
++ const char *unit;
++
++ tree->fullpath = join_path(prefix, tree->name);
++
++ unit = strchr(tree->name, '@');
++ if (unit)
++ tree->basenamelen = unit - tree->name;
++ else
++ tree->basenamelen = strlen(tree->name);
++
++ for_each_child(tree, child)
++ fill_fullpaths(child, tree->fullpath);
++}
++
++static void __attribute__ ((noreturn)) usage(void)
++{
++ fprintf(stderr, "Usage:\n");
++ fprintf(stderr, "\tdtc [options] <input file>\n");
++ fprintf(stderr, "\nOptions:\n");
++ fprintf(stderr, "\t-h\n");
++ fprintf(stderr, "\t\tThis help text\n");
++ fprintf(stderr, "\t-q\n");
++ fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n");
++ fprintf(stderr, "\t-I <input format>\n");
++ fprintf(stderr, "\t\tInput formats are:\n");
++ fprintf(stderr, "\t\t\tdts - device tree source text\n");
++ fprintf(stderr, "\t\t\tdtb - device tree blob\n");
++ fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n");
++ fprintf(stderr, "\t-o <output file>\n");
++ fprintf(stderr, "\t-O <output format>\n");
++ fprintf(stderr, "\t\tOutput formats are:\n");
++ fprintf(stderr, "\t\t\tdts - device tree source text\n");
++ fprintf(stderr, "\t\t\tdtb - device tree blob\n");
++ fprintf(stderr, "\t\t\tasm - assembler source\n");
++ fprintf(stderr, "\t-V <output version>\n");
++ fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION);
++ fprintf(stderr, "\t-R <number>\n");
++ fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
++ fprintf(stderr, "\t-S <bytes>\n");
++ fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
++ fprintf(stderr, "\t-p <bytes>\n");
++ fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
++ fprintf(stderr, "\t-b <number>\n");
++ fprintf(stderr, "\t\tSet the physical boot cpu\n");
++ fprintf(stderr, "\t-f\n");
++ fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n");
++ fprintf(stderr, "\t-v\n");
++ fprintf(stderr, "\t\tPrint DTC version and exit\n");
++ exit(3);
++}
++
++int main(int argc, char *argv[])
++{
++ struct boot_info *bi;
++ const char *inform = "dts";
++ const char *outform = "dts";
++ const char *outname = "-";
++ int force = 0, check = 0;
++ const char *arg;
++ int opt;
++ FILE *outf = NULL;
++ int outversion = DEFAULT_FDT_VERSION;
++ long long cmdline_boot_cpuid = -1;
++
++ quiet = 0;
++ reservenum = 0;
++ minsize = 0;
++ padsize = 0;
++
++ while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
++ switch (opt) {
++ case 'I':
++ inform = optarg;
++ break;
++ case 'O':
++ outform = optarg;
++ break;
++ case 'o':
++ outname = optarg;
++ break;
++ case 'V':
++ outversion = strtol(optarg, NULL, 0);
++ break;
++ case 'R':
++ reservenum = strtol(optarg, NULL, 0);
++ break;
++ case 'S':
++ minsize = strtol(optarg, NULL, 0);
++ break;
++ case 'p':
++ padsize = strtol(optarg, NULL, 0);
++ break;
++ case 'f':
++ force = 1;
++ break;
++ case 'c':
++ check = 1;
++ break;
++ case 'q':
++ quiet++;
++ break;
++ case 'b':
++ cmdline_boot_cpuid = strtoll(optarg, NULL, 0);
++ break;
++ case 'v':
++ printf("Version: %s\n", DTC_VERSION);
++ exit(0);
++ case 'h':
++ default:
++ usage();
++ }
++ }
++
++ if (argc > (optind+1))
++ usage();
++ else if (argc < (optind+1))
++ arg = "-";
++ else
++ arg = argv[optind];
++
++ /* minsize and padsize are mutually exclusive */
++ if (minsize && padsize)
++ die("Can't set both -p and -S\n");
++
++ fprintf(stderr, "DTC: %s->%s on file \"%s\"\n",
++ inform, outform, arg);
++
++ if (streq(inform, "dts"))
++ bi = dt_from_source(arg);
++ else if (streq(inform, "fs"))
++ bi = dt_from_fs(arg);
++ else if(streq(inform, "dtb"))
++ bi = dt_from_blob(arg);
++ else
++ die("Unknown input format \"%s\"\n", inform);
++
++ if (cmdline_boot_cpuid != -1)
++ bi->boot_cpuid_phys = cmdline_boot_cpuid;
++
++ fill_fullpaths(bi->dt, "");
++ process_checks(force, bi);
++
++
++ if (streq(outname, "-")) {
++ outf = stdout;
++ } else {
++ outf = fopen(outname, "w");
++ if (! outf)
++ die("Couldn't open output file %s: %s\n",
++ outname, strerror(errno));
++ }
++
++ if (streq(outform, "dts")) {
++ dt_to_source(outf, bi);
++ } else if (streq(outform, "dtb")) {
++ dt_to_blob(outf, bi, outversion);
++ } else if (streq(outform, "asm")) {
++ dt_to_asm(outf, bi, outversion);
++ } else if (streq(outform, "null")) {
++ /* do nothing */
++ } else {
++ die("Unknown output format \"%s\"\n", outform);
++ }
++
++ exit(0);
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc.h linux-2.6.30-rc4-git/scripts/dtc/dtc.h
+--- linux-2.6.30-rc4/scripts/dtc/dtc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,246 @@
++#ifndef _DTC_H
++#define _DTC_H
++
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <stdarg.h>
++#include <assert.h>
++#include <ctype.h>
++#include <errno.h>
++#include <unistd.h>
++
++#include <libfdt_env.h>
++#include <fdt.h>
++
++#define DEFAULT_FDT_VERSION 17
++/*
++ * Command line options
++ */
++extern int quiet; /* Level of quietness */
++extern int reservenum; /* Number of memory reservation slots */
++extern int minsize; /* Minimum blob size */
++extern int padsize; /* Additional padding to blob */
++
++static inline void __attribute__((noreturn)) die(char * str, ...)
++{
++ va_list ap;
++
++ va_start(ap, str);
++ fprintf(stderr, "FATAL ERROR: ");
++ vfprintf(stderr, str, ap);
++ exit(1);
++}
++
++static inline void *xmalloc(size_t len)
++{
++ void *new = malloc(len);
++
++ if (! new)
++ die("malloc() failed\n");
++
++ return new;
++}
++
++static inline void *xrealloc(void *p, size_t len)
++{
++ void *new = realloc(p, len);
++
++ if (! new)
++ die("realloc() failed (len=%d)\n", len);
++
++ return new;
++}
++
++typedef uint32_t cell_t;
++
++
++#define streq(a, b) (strcmp((a), (b)) == 0)
++#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
++
++#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
++#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
++
++/* Data blobs */
++enum markertype {
++ REF_PHANDLE,
++ REF_PATH,
++ LABEL,
++};
++
++struct marker {
++ enum markertype type;
++ int offset;
++ char *ref;
++ struct marker *next;
++};
++
++struct data {
++ int len;
++ char *val;
++ struct marker *markers;
++};
++
++
++#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
++
++#define for_each_marker(m) \
++ for (; (m); (m) = (m)->next)
++#define for_each_marker_of_type(m, t) \
++ for_each_marker(m) \
++ if ((m)->type == (t))
++
++void data_free(struct data d);
++
++struct data data_grow_for(struct data d, int xlen);
++
++struct data data_copy_mem(const char *mem, int len);
++struct data data_copy_escape_string(const char *s, int len);
++struct data data_copy_file(FILE *f, size_t len);
++
++struct data data_append_data(struct data d, const void *p, int len);
++struct data data_insert_at_marker(struct data d, struct marker *m,
++ const void *p, int len);
++struct data data_merge(struct data d1, struct data d2);
++struct data data_append_cell(struct data d, cell_t word);
++struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
++struct data data_append_addr(struct data d, uint64_t addr);
++struct data data_append_byte(struct data d, uint8_t byte);
++struct data data_append_zeroes(struct data d, int len);
++struct data data_append_align(struct data d, int align);
++
++struct data data_add_marker(struct data d, enum markertype type, char *ref);
++
++int data_is_one_string(struct data d);
++
++/* DT constraints */
++
++#define MAX_PROPNAME_LEN 31
++#define MAX_NODENAME_LEN 31
++
++/* Live trees */
++struct property {
++ char *name;
++ struct data val;
++
++ struct property *next;
++
++ char *label;
++};
++
++struct node {
++ char *name;
++ struct property *proplist;
++ struct node *children;
++
++ struct node *parent;
++ struct node *next_sibling;
++
++ char *fullpath;
++ int basenamelen;
++
++ cell_t phandle;
++ int addr_cells, size_cells;
++
++ char *label;
++};
++
++#define for_each_property(n, p) \
++ for ((p) = (n)->proplist; (p); (p) = (p)->next)
++
++#define for_each_child(n, c) \
++ for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
++
++struct property *build_property(char *name, struct data val, char *label);
++struct property *chain_property(struct property *first, struct property *list);
++struct property *reverse_properties(struct property *first);
++
++struct node *build_node(struct property *proplist, struct node *children);
++struct node *name_node(struct node *node, char *name, char *label);
++struct node *chain_node(struct node *first, struct node *list);
++
++void add_property(struct node *node, struct property *prop);
++void add_child(struct node *parent, struct node *child);
++
++const char *get_unitname(struct node *node);
++struct property *get_property(struct node *node, const char *propname);
++cell_t propval_cell(struct property *prop);
++struct node *get_subnode(struct node *node, const char *nodename);
++struct node *get_node_by_path(struct node *tree, const char *path);
++struct node *get_node_by_label(struct node *tree, const char *label);
++struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
++struct node *get_node_by_ref(struct node *tree, const char *ref);
++cell_t get_node_phandle(struct node *root, struct node *node);
++
++/* Boot info (tree plus memreserve information */
++
++struct reserve_info {
++ struct fdt_reserve_entry re;
++
++ struct reserve_info *next;
++
++ char *label;
++};
++
++struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len, char *label);
++struct reserve_info *chain_reserve_entry(struct reserve_info *first,
++ struct reserve_info *list);
++struct reserve_info *add_reserve_entry(struct reserve_info *list,
++ struct reserve_info *new);
++
++
++struct boot_info {
++ struct reserve_info *reservelist;
++ struct node *dt; /* the device tree */
++ uint32_t boot_cpuid_phys;
++};
++
++struct boot_info *build_boot_info(struct reserve_info *reservelist,
++ struct node *tree, uint32_t boot_cpuid_phys);
++
++/* Checks */
++
++void process_checks(int force, struct boot_info *bi);
++
++/* Flattened trees */
++
++void dt_to_blob(FILE *f, struct boot_info *bi, int version);
++void dt_to_asm(FILE *f, struct boot_info *bi, int version);
++
++struct boot_info *dt_from_blob(const char *fname);
++
++/* Tree source */
++
++void dt_to_source(FILE *f, struct boot_info *bi);
++struct boot_info *dt_from_source(const char *f);
++
++/* FS trees */
++
++struct boot_info *dt_from_fs(const char *dirname);
++
++/* misc */
++
++char *join_path(const char *path, const char *name);
++
++#endif /* _DTC_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc-lexer.l linux-2.6.30-rc4-git/scripts/dtc/dtc-lexer.l
+--- linux-2.6.30-rc4/scripts/dtc/dtc-lexer.l 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc-lexer.l 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,320 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
++ */
++
++%option noyywrap nounput yylineno
++
++%x INCLUDE
++%x BYTESTRING
++%x PROPNODENAME
++%s V1
++
++PROPNODECHAR [a-zA-Z0-9,._+*#?@-]
++PATHCHAR ({PROPNODECHAR}|[/])
++LABEL [a-zA-Z_][a-zA-Z0-9_]*
++STRING \"([^\\"]|\\.)*\"
++WS [[:space:]]
++COMMENT "/*"([^*]|\*+[^*/])*\*+"/"
++LINECOMMENT "//".*\n
++
++%{
++#include "dtc.h"
++#include "srcpos.h"
++#include "dtc-parser.tab.h"
++
++
++/*#define LEXDEBUG 1*/
++
++#ifdef LEXDEBUG
++#define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
++#else
++#define DPRINT(fmt, ...) do { } while (0)
++#endif
++
++static int dts_version; /* = 0 */
++
++#define BEGIN_DEFAULT() if (dts_version == 0) { \
++ DPRINT("<INITIAL>\n"); \
++ BEGIN(INITIAL); \
++ } else { \
++ DPRINT("<V1>\n"); \
++ BEGIN(V1); \
++ }
++
++static void push_input_file(const char *filename);
++static int pop_input_file(void);
++%}
++
++%%
++<*>"/include/"{WS}*{STRING} {
++ char *name = strchr(yytext, '\"') + 1;
++ yytext[yyleng-1] = '\0';
++ push_input_file(name);
++ }
++
++<*><<EOF>> {
++ if (!pop_input_file()) {
++ yyterminate();
++ }
++ }
++
++<*>{STRING} {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("String: %s\n", yytext);
++ yylval.data = data_copy_escape_string(yytext+1,
++ yyleng-2);
++ yylloc.first_line = yylineno;
++ return DT_STRING;
++ }
++
++<*>"/dts-v1/" {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Keyword: /dts-v1/\n");
++ dts_version = 1;
++ BEGIN_DEFAULT();
++ return DT_V1;
++ }
++
++<*>"/memreserve/" {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Keyword: /memreserve/\n");
++ BEGIN_DEFAULT();
++ return DT_MEMRESERVE;
++ }
++
++<*>{LABEL}: {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Label: %s\n", yytext);
++ yylval.labelref = strdup(yytext);
++ yylval.labelref[yyleng-1] = '\0';
++ return DT_LABEL;
++ }
++
++<INITIAL>[bodh]# {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ if (*yytext == 'b')
++ yylval.cbase = 2;
++ else if (*yytext == 'o')
++ yylval.cbase = 8;
++ else if (*yytext == 'd')
++ yylval.cbase = 10;
++ else
++ yylval.cbase = 16;
++ DPRINT("Base: %d\n", yylval.cbase);
++ return DT_BASE;
++ }
++
++<INITIAL>[0-9a-fA-F]+ {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.literal = strdup(yytext);
++ DPRINT("Literal: '%s'\n", yylval.literal);
++ return DT_LEGACYLITERAL;
++ }
++
++<V1>[0-9]+|0[xX][0-9a-fA-F]+ {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.literal = strdup(yytext);
++ DPRINT("Literal: '%s'\n", yylval.literal);
++ return DT_LITERAL;
++ }
++
++\&{LABEL} { /* label reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Ref: %s\n", yytext+1);
++ yylval.labelref = strdup(yytext+1);
++ return DT_REF;
++ }
++
++"&{/"{PATHCHAR}+\} { /* new-style path reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yytext[yyleng-1] = '\0';
++ DPRINT("Ref: %s\n", yytext+2);
++ yylval.labelref = strdup(yytext+2);
++ return DT_REF;
++ }
++
++<INITIAL>"&/"{PATHCHAR}+ { /* old-style path reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Ref: %s\n", yytext+1);
++ yylval.labelref = strdup(yytext+1);
++ return DT_REF;
++ }
++
++<BYTESTRING>[0-9a-fA-F]{2} {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.byte = strtol(yytext, NULL, 16);
++ DPRINT("Byte: %02x\n", (int)yylval.byte);
++ return DT_BYTE;
++ }
++
++<BYTESTRING>"]" {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("/BYTESTRING\n");
++ BEGIN_DEFAULT();
++ return ']';
++ }
++
++<PROPNODENAME>{PROPNODECHAR}+ {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("PropNodeName: %s\n", yytext);
++ yylval.propnodename = strdup(yytext);
++ BEGIN_DEFAULT();
++ return DT_PROPNODENAME;
++ }
++
++"/incbin/" {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Binary Include\n");
++ return DT_INCBIN;
++ }
++
++<*>{WS}+ /* eat whitespace */
++<*>{COMMENT}+ /* eat C-style comments */
++<*>{LINECOMMENT}+ /* eat C++-style comments */
++
++<*>. {
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Char: %c (\\x%02x)\n", yytext[0],
++ (unsigned)yytext[0]);
++ if (yytext[0] == '[') {
++ DPRINT("<BYTESTRING>\n");
++ BEGIN(BYTESTRING);
++ }
++ if ((yytext[0] == '{')
++ || (yytext[0] == ';')) {
++ DPRINT("<PROPNODENAME>\n");
++ BEGIN(PROPNODENAME);
++ }
++ return yytext[0];
++ }
++
++%%
++
++
++/*
++ * Stack of nested include file contexts.
++ */
++
++struct incl_file {
++ struct dtc_file *file;
++ YY_BUFFER_STATE yy_prev_buf;
++ int yy_prev_lineno;
++ struct incl_file *prev;
++};
++
++static struct incl_file *incl_file_stack;
++
++
++/*
++ * Detect infinite include recursion.
++ */
++#define MAX_INCLUDE_DEPTH (100)
++
++static int incl_depth = 0;
++
++
++static void push_input_file(const char *filename)
++{
++ struct incl_file *incl_file;
++ struct dtc_file *newfile;
++ struct search_path search, *searchptr = NULL;
++
++ assert(filename);
++
++ if (incl_depth++ >= MAX_INCLUDE_DEPTH)
++ die("Includes nested too deeply");
++
++ if (srcpos_file) {
++ search.dir = srcpos_file->dir;
++ search.next = NULL;
++ search.prev = NULL;
++ searchptr = &search;
++ }
++
++ newfile = dtc_open_file(filename, searchptr);
++
++ incl_file = xmalloc(sizeof(struct incl_file));
++
++ /*
++ * Save current context.
++ */
++ incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
++ incl_file->yy_prev_lineno = yylineno;
++ incl_file->file = srcpos_file;
++ incl_file->prev = incl_file_stack;
++
++ incl_file_stack = incl_file;
++
++ /*
++ * Establish new context.
++ */
++ srcpos_file = newfile;
++ yylineno = 1;
++ yyin = newfile->file;
++ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
++}
++
++
++static int pop_input_file(void)
++{
++ struct incl_file *incl_file;
++
++ if (incl_file_stack == 0)
++ return 0;
++
++ dtc_close_file(srcpos_file);
++
++ /*
++ * Pop.
++ */
++ --incl_depth;
++ incl_file = incl_file_stack;
++ incl_file_stack = incl_file->prev;
++
++ /*
++ * Recover old context.
++ */
++ yy_delete_buffer(YY_CURRENT_BUFFER);
++ yy_switch_to_buffer(incl_file->yy_prev_buf);
++ yylineno = incl_file->yy_prev_lineno;
++ srcpos_file = incl_file->file;
++ yyin = incl_file->file ? incl_file->file->file : NULL;
++
++ /*
++ * Free old state.
++ */
++ free(incl_file);
++
++ return 1;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc-lexer.lex.c_shipped linux-2.6.30-rc4-git/scripts/dtc/dtc-lexer.lex.c_shipped
+--- linux-2.6.30-rc4/scripts/dtc/dtc-lexer.lex.c_shipped 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc-lexer.lex.c_shipped 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,2187 @@
++#line 2 "dtc-lexer.lex.c"
++
++#line 4 "dtc-lexer.lex.c"
++
++#define YY_INT_ALIGNED short int
++
++/* A lexical scanner generated by flex */
++
++#define FLEX_SCANNER
++#define YY_FLEX_MAJOR_VERSION 2
++#define YY_FLEX_MINOR_VERSION 5
++#define YY_FLEX_SUBMINOR_VERSION 34
++#if YY_FLEX_SUBMINOR_VERSION > 0
++#define FLEX_BETA
++#endif
++
++/* First, we deal with platform-specific or compiler-specific issues. */
++
++/* begin standard C headers. */
++#include <stdio.h>
++#include <string.h>
++#include <errno.h>
++#include <stdlib.h>
++
++/* end standard C headers. */
++
++/* flex integer type definitions */
++
++#ifndef FLEXINT_H
++#define FLEXINT_H
++
++/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
++
++#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
++
++/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
++ * if you want the limit (max/min) macros for int types.
++ */
++#ifndef __STDC_LIMIT_MACROS
++#define __STDC_LIMIT_MACROS 1
++#endif
++
++#include <inttypes.h>
++typedef int8_t flex_int8_t;
++typedef uint8_t flex_uint8_t;
++typedef int16_t flex_int16_t;
++typedef uint16_t flex_uint16_t;
++typedef int32_t flex_int32_t;
++typedef uint32_t flex_uint32_t;
++#else
++typedef signed char flex_int8_t;
++typedef short int flex_int16_t;
++typedef int flex_int32_t;
++typedef unsigned char flex_uint8_t;
++typedef unsigned short int flex_uint16_t;
++typedef unsigned int flex_uint32_t;
++#endif /* ! C99 */
++
++/* Limits of integral types. */
++#ifndef INT8_MIN
++#define INT8_MIN (-128)
++#endif
++#ifndef INT16_MIN
++#define INT16_MIN (-32767-1)
++#endif
++#ifndef INT32_MIN
++#define INT32_MIN (-2147483647-1)
++#endif
++#ifndef INT8_MAX
++#define INT8_MAX (127)
++#endif
++#ifndef INT16_MAX
++#define INT16_MAX (32767)
++#endif
++#ifndef INT32_MAX
++#define INT32_MAX (2147483647)
++#endif
++#ifndef UINT8_MAX
++#define UINT8_MAX (255U)
++#endif
++#ifndef UINT16_MAX
++#define UINT16_MAX (65535U)
++#endif
++#ifndef UINT32_MAX
++#define UINT32_MAX (4294967295U)
++#endif
++
++#endif /* ! FLEXINT_H */
++
++#ifdef __cplusplus
++
++/* The "const" storage-class-modifier is valid. */
++#define YY_USE_CONST
++
++#else /* ! __cplusplus */
++
++/* C99 requires __STDC__ to be defined as 1. */
++#if defined (__STDC__)
++
++#define YY_USE_CONST
++
++#endif /* defined (__STDC__) */
++#endif /* ! __cplusplus */
++
++#ifdef YY_USE_CONST
++#define yyconst const
++#else
++#define yyconst
++#endif
++
++/* Returned upon end-of-file. */
++#define YY_NULL 0
++
++/* Promotes a possibly negative, possibly signed char to an unsigned
++ * integer for use as an array index. If the signed char is negative,
++ * we want to instead treat it as an 8-bit unsigned char, hence the
++ * double cast.
++ */
++#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
++
++/* Enter a start condition. This macro really ought to take a parameter,
++ * but we do it the disgusting crufty way forced on us by the ()-less
++ * definition of BEGIN.
++ */
++#define BEGIN (yy_start) = 1 + 2 *
++
++/* Translate the current start state into a value that can be later handed
++ * to BEGIN to return to the state. The YYSTATE alias is for lex
++ * compatibility.
++ */
++#define YY_START (((yy_start) - 1) / 2)
++#define YYSTATE YY_START
++
++/* Action number for EOF rule of a given start state. */
++#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
++
++/* Special action meaning "start processing a new file". */
++#define YY_NEW_FILE yyrestart(yyin )
++
++#define YY_END_OF_BUFFER_CHAR 0
++
++/* Size of default input buffer. */
++#ifndef YY_BUF_SIZE
++#define YY_BUF_SIZE 16384
++#endif
++
++/* The state buf must be large enough to hold one state per character in the main buffer.
++ */
++#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
++
++#ifndef YY_TYPEDEF_YY_BUFFER_STATE
++#define YY_TYPEDEF_YY_BUFFER_STATE
++typedef struct yy_buffer_state *YY_BUFFER_STATE;
++#endif
++
++extern int yyleng;
++
++extern FILE *yyin, *yyout;
++
++#define EOB_ACT_CONTINUE_SCAN 0
++#define EOB_ACT_END_OF_FILE 1
++#define EOB_ACT_LAST_MATCH 2
++
++ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
++ * access to the local variable yy_act. Since yyless() is a macro, it would break
++ * existing scanners that call yyless() from OUTSIDE yylex.
++ * One obvious solution it to make yy_act a global. I tried that, and saw
++ * a 5% performance hit in a non-yylineno scanner, because yy_act is
++ * normally declared as a register variable-- so it is not worth it.
++ */
++ #define YY_LESS_LINENO(n) \
++ do { \
++ int yyl;\
++ for ( yyl = n; yyl < yyleng; ++yyl )\
++ if ( yytext[yyl] == '\n' )\
++ --yylineno;\
++ }while(0)
++
++/* Return all but the first "n" matched characters back to the input stream. */
++#define yyless(n) \
++ do \
++ { \
++ /* Undo effects of setting up yytext. */ \
++ int yyless_macro_arg = (n); \
++ YY_LESS_LINENO(yyless_macro_arg);\
++ *yy_cp = (yy_hold_char); \
++ YY_RESTORE_YY_MORE_OFFSET \
++ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
++ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
++ } \
++ while ( 0 )
++
++#define unput(c) yyunput( c, (yytext_ptr) )
++
++/* The following is because we cannot portably get our hands on size_t
++ * (without autoconf's help, which isn't available because we want
++ * flex-generated scanners to compile on their own).
++ * Given that the standard has decreed that size_t exists since 1989,
++ * I guess we can afford to depend on it. Manoj.
++ */
++
++#ifndef YY_TYPEDEF_YY_SIZE_T
++#define YY_TYPEDEF_YY_SIZE_T
++typedef size_t yy_size_t;
++#endif
++
++#ifndef YY_STRUCT_YY_BUFFER_STATE
++#define YY_STRUCT_YY_BUFFER_STATE
++struct yy_buffer_state
++ {
++ FILE *yy_input_file;
++
++ char *yy_ch_buf; /* input buffer */
++ char *yy_buf_pos; /* current position in input buffer */
++
++ /* Size of input buffer in bytes, not including room for EOB
++ * characters.
++ */
++ yy_size_t yy_buf_size;
++
++ /* Number of characters read into yy_ch_buf, not including EOB
++ * characters.
++ */
++ int yy_n_chars;
++
++ /* Whether we "own" the buffer - i.e., we know we created it,
++ * and can realloc() it to grow it, and should free() it to
++ * delete it.
++ */
++ int yy_is_our_buffer;
++
++ /* Whether this is an "interactive" input source; if so, and
++ * if we're using stdio for input, then we want to use getc()
++ * instead of fread(), to make sure we stop fetching input after
++ * each newline.
++ */
++ int yy_is_interactive;
++
++ /* Whether we're considered to be at the beginning of a line.
++ * If so, '^' rules will be active on the next match, otherwise
++ * not.
++ */
++ int yy_at_bol;
++
++ int yy_bs_lineno; /**< The line count. */
++ int yy_bs_column; /**< The column count. */
++
++ /* Whether to try to fill the input buffer when we reach the
++ * end of it.
++ */
++ int yy_fill_buffer;
++
++ int yy_buffer_status;
++
++#define YY_BUFFER_NEW 0
++#define YY_BUFFER_NORMAL 1
++ /* When an EOF's been seen but there's still some text to process
++ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
++ * shouldn't try reading from the input source any more. We might
++ * still have a bunch of tokens to match, though, because of
++ * possible backing-up.
++ *
++ * When we actually see the EOF, we change the status to "new"
++ * (via yyrestart()), so that the user can continue scanning by
++ * just pointing yyin at a new input file.
++ */
++#define YY_BUFFER_EOF_PENDING 2
++
++ };
++#endif /* !YY_STRUCT_YY_BUFFER_STATE */
++
++/* Stack of input buffers. */
++static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
++static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
++static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
++
++/* We provide macros for accessing buffer states in case in the
++ * future we want to put the buffer states in a more general
++ * "scanner state".
++ *
++ * Returns the top of the stack, or NULL.
++ */
++#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
++ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
++ : NULL)
++
++/* Same as previous macro, but useful when we know that the buffer stack is not
++ * NULL or when we need an lvalue. For internal use only.
++ */
++#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
++
++/* yy_hold_char holds the character lost when yytext is formed. */
++static char yy_hold_char;
++static int yy_n_chars; /* number of characters read into yy_ch_buf */
++int yyleng;
++
++/* Points to current character in buffer. */
++static char *yy_c_buf_p = (char *) 0;
++static int yy_init = 0; /* whether we need to initialize */
++static int yy_start = 0; /* start state number */
++
++/* Flag which is used to allow yywrap()'s to do buffer switches
++ * instead of setting up a fresh yyin. A bit of a hack ...
++ */
++static int yy_did_buffer_switch_on_eof;
++
++void yyrestart (FILE *input_file );
++void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
++YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
++void yy_delete_buffer (YY_BUFFER_STATE b );
++void yy_flush_buffer (YY_BUFFER_STATE b );
++void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
++void yypop_buffer_state (void );
++
++static void yyensure_buffer_stack (void );
++static void yy_load_buffer_state (void );
++static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
++
++#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
++
++YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
++YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
++YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
++
++void *yyalloc (yy_size_t );
++void *yyrealloc (void *,yy_size_t );
++void yyfree (void * );
++
++#define yy_new_buffer yy_create_buffer
++
++#define yy_set_interactive(is_interactive) \
++ { \
++ if ( ! YY_CURRENT_BUFFER ){ \
++ yyensure_buffer_stack (); \
++ YY_CURRENT_BUFFER_LVALUE = \
++ yy_create_buffer(yyin,YY_BUF_SIZE ); \
++ } \
++ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
++ }
++
++#define yy_set_bol(at_bol) \
++ { \
++ if ( ! YY_CURRENT_BUFFER ){\
++ yyensure_buffer_stack (); \
++ YY_CURRENT_BUFFER_LVALUE = \
++ yy_create_buffer(yyin,YY_BUF_SIZE ); \
++ } \
++ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
++ }
++
++#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
++
++/* Begin user sect3 */
++
++#define yywrap(n) 1
++#define YY_SKIP_YYWRAP
++
++typedef unsigned char YY_CHAR;
++
++FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
++
++typedef int yy_state_type;
++
++extern int yylineno;
++
++int yylineno = 1;
++
++extern char *yytext;
++#define yytext_ptr yytext
++
++static yy_state_type yy_get_previous_state (void );
++static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
++static int yy_get_next_buffer (void );
++static void yy_fatal_error (yyconst char msg[] );
++
++/* Done after the current pattern has been matched and before the
++ * corresponding action - sets up yytext.
++ */
++#define YY_DO_BEFORE_ACTION \
++ (yytext_ptr) = yy_bp; \
++ yyleng = (size_t) (yy_cp - yy_bp); \
++ (yy_hold_char) = *yy_cp; \
++ *yy_cp = '\0'; \
++ (yy_c_buf_p) = yy_cp;
++
++#define YY_NUM_RULES 20
++#define YY_END_OF_BUFFER 21
++/* This struct is not used in this scanner,
++ but its presence is necessary. */
++struct yy_trans_info
++ {
++ flex_int32_t yy_verify;
++ flex_int32_t yy_nxt;
++ };
++static yyconst flex_int16_t yy_accept[104] =
++ { 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 21, 19, 16, 16, 19, 19, 19, 7, 7, 19,
++ 7, 19, 19, 19, 19, 13, 14, 14, 19, 8,
++ 8, 16, 0, 2, 0, 0, 9, 0, 0, 0,
++ 0, 0, 0, 7, 7, 5, 0, 6, 0, 12,
++ 12, 14, 14, 8, 0, 11, 9, 0, 0, 0,
++ 0, 18, 0, 0, 0, 0, 8, 0, 17, 0,
++ 0, 0, 0, 0, 10, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 3, 15,
++ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
++
++ 0, 4, 0
++ } ;
++
++static yyconst flex_int32_t yy_ec[256] =
++ { 0,
++ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
++ 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 2, 1, 4, 5, 1, 1, 6, 1, 1,
++ 1, 7, 8, 8, 9, 8, 10, 11, 12, 13,
++ 13, 13, 13, 13, 13, 13, 13, 14, 1, 1,
++ 1, 1, 8, 8, 15, 15, 15, 15, 15, 15,
++ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
++ 16, 16, 16, 16, 16, 16, 16, 17, 16, 16,
++ 1, 18, 19, 1, 16, 1, 15, 20, 21, 22,
++
++ 23, 15, 16, 24, 25, 16, 16, 26, 27, 28,
++ 24, 16, 16, 29, 30, 31, 32, 33, 16, 17,
++ 16, 16, 34, 1, 35, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1
++ } ;
++
++static yyconst flex_int32_t yy_meta[36] =
++ { 0,
++ 1, 1, 1, 1, 2, 1, 2, 2, 2, 3,
++ 4, 4, 4, 5, 6, 7, 7, 1, 1, 6,
++ 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
++ 7, 7, 7, 8, 1
++ } ;
++
++static yyconst flex_int16_t yy_base[117] =
++ { 0,
++ 0, 0, 30, 0, 44, 0, 67, 0, 97, 105,
++ 302, 303, 35, 44, 40, 94, 112, 0, 129, 152,
++ 296, 295, 159, 0, 176, 303, 0, 116, 95, 165,
++ 49, 46, 102, 303, 296, 0, 0, 288, 290, 293,
++ 264, 266, 270, 0, 0, 303, 0, 303, 264, 303,
++ 0, 0, 195, 101, 0, 0, 0, 0, 284, 125,
++ 277, 265, 225, 230, 216, 218, 0, 202, 224, 221,
++ 217, 107, 196, 188, 303, 206, 179, 186, 178, 185,
++ 183, 162, 161, 150, 169, 160, 145, 125, 303, 303,
++ 137, 109, 190, 103, 203, 167, 108, 197, 303, 123,
++
++ 29, 303, 303, 215, 221, 226, 229, 234, 240, 246,
++ 250, 257, 265, 270, 275, 282
++ } ;
++
++static yyconst flex_int16_t yy_def[117] =
++ { 0,
++ 103, 1, 1, 3, 3, 5, 103, 7, 3, 3,
++ 103, 103, 103, 103, 104, 105, 103, 106, 103, 19,
++ 19, 20, 103, 107, 20, 103, 108, 109, 105, 103,
++ 103, 103, 104, 103, 104, 110, 111, 103, 112, 113,
++ 103, 103, 103, 106, 19, 103, 20, 103, 103, 103,
++ 20, 108, 109, 103, 114, 110, 111, 115, 112, 112,
++ 113, 103, 103, 103, 103, 103, 114, 115, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 116, 103, 116, 103, 116,
++
++ 103, 103, 0, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103
++ } ;
++
++static yyconst flex_int16_t yy_nxt[339] =
++ { 0,
++ 12, 13, 14, 15, 12, 16, 12, 12, 12, 17,
++ 18, 18, 18, 12, 19, 20, 20, 12, 12, 21,
++ 19, 21, 19, 22, 20, 20, 20, 20, 20, 20,
++ 20, 20, 20, 12, 12, 12, 32, 32, 102, 23,
++ 12, 12, 12, 34, 20, 32, 32, 32, 32, 20,
++ 20, 20, 20, 20, 24, 24, 24, 35, 25, 54,
++ 54, 54, 26, 25, 25, 25, 25, 12, 13, 14,
++ 15, 27, 12, 27, 27, 27, 23, 27, 27, 27,
++ 12, 28, 28, 28, 12, 12, 28, 28, 28, 28,
++ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
++
++ 12, 12, 29, 36, 103, 34, 17, 30, 31, 31,
++ 29, 54, 54, 54, 17, 30, 31, 31, 39, 35,
++ 52, 40, 52, 52, 52, 103, 78, 38, 38, 46,
++ 101, 60, 79, 41, 69, 97, 42, 94, 43, 45,
++ 45, 45, 46, 45, 47, 47, 93, 92, 45, 45,
++ 45, 45, 47, 47, 47, 47, 47, 47, 47, 47,
++ 47, 47, 47, 47, 47, 39, 47, 91, 40, 90,
++ 99, 47, 47, 47, 47, 54, 54, 54, 89, 88,
++ 41, 55, 87, 49, 100, 43, 51, 51, 51, 86,
++ 51, 95, 95, 96, 85, 51, 51, 51, 51, 52,
++
++ 99, 52, 52, 52, 95, 95, 96, 84, 46, 83,
++ 82, 81, 39, 79, 100, 33, 33, 33, 33, 33,
++ 33, 33, 33, 37, 80, 77, 37, 37, 37, 44,
++ 40, 44, 50, 76, 50, 52, 75, 52, 74, 52,
++ 52, 53, 73, 53, 53, 53, 53, 56, 56, 56,
++ 72, 56, 56, 57, 71, 57, 57, 59, 59, 59,
++ 59, 59, 59, 59, 59, 61, 61, 61, 61, 61,
++ 61, 61, 61, 67, 70, 67, 68, 68, 68, 62,
++ 68, 68, 98, 98, 98, 98, 98, 98, 98, 98,
++ 60, 66, 65, 64, 63, 62, 60, 58, 103, 48,
++
++ 48, 103, 11, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103
++ } ;
++
++static yyconst flex_int16_t yy_chk[339] =
++ { 0,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 1, 1, 3, 13, 13, 101, 3,
++ 3, 3, 3, 15, 3, 14, 14, 32, 32, 3,
++ 3, 3, 3, 3, 5, 5, 5, 15, 5, 31,
++ 31, 31, 5, 5, 5, 5, 5, 7, 7, 7,
++ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
++ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
++ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
++
++ 7, 7, 9, 16, 29, 33, 9, 9, 9, 9,
++ 10, 54, 54, 54, 10, 10, 10, 10, 17, 33,
++ 28, 17, 28, 28, 28, 100, 72, 16, 29, 28,
++ 97, 60, 72, 17, 60, 94, 17, 92, 17, 19,
++ 19, 19, 19, 19, 19, 19, 91, 88, 19, 19,
++ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
++ 19, 19, 20, 20, 20, 23, 20, 87, 23, 86,
++ 96, 20, 20, 20, 20, 30, 30, 30, 85, 84,
++ 23, 30, 83, 23, 96, 23, 25, 25, 25, 82,
++ 25, 93, 93, 93, 81, 25, 25, 25, 25, 53,
++
++ 98, 53, 53, 53, 95, 95, 95, 80, 53, 79,
++ 78, 77, 76, 74, 98, 104, 104, 104, 104, 104,
++ 104, 104, 104, 105, 73, 71, 105, 105, 105, 106,
++ 70, 106, 107, 69, 107, 108, 68, 108, 66, 108,
++ 108, 109, 65, 109, 109, 109, 109, 110, 110, 110,
++ 64, 110, 110, 111, 63, 111, 111, 112, 112, 112,
++ 112, 112, 112, 112, 112, 113, 113, 113, 113, 113,
++ 113, 113, 113, 114, 62, 114, 115, 115, 115, 61,
++ 115, 115, 116, 116, 116, 116, 116, 116, 116, 116,
++ 59, 49, 43, 42, 41, 40, 39, 38, 35, 22,
++
++ 21, 11, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
++ 103, 103, 103, 103, 103, 103, 103, 103
++ } ;
++
++/* Table of booleans, true if rule could match eol. */
++static yyconst flex_int32_t yy_rule_can_match_eol[21] =
++ { 0,
++1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
++ 0, };
++
++static yy_state_type yy_last_accepting_state;
++static char *yy_last_accepting_cpos;
++
++extern int yy_flex_debug;
++int yy_flex_debug = 0;
++
++/* The intent behind this definition is that it'll catch
++ * any uses of REJECT which flex missed.
++ */
++#define REJECT reject_used_but_not_detected
++#define yymore() yymore_used_but_not_detected
++#define YY_MORE_ADJ 0
++#define YY_RESTORE_YY_MORE_OFFSET
++char *yytext;
++#line 1 "dtc-lexer.l"
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
++ */
++
++
++
++
++#line 37 "dtc-lexer.l"
++#include "dtc.h"
++#include "srcpos.h"
++#include "dtc-parser.tab.h"
++
++
++/*#define LEXDEBUG 1*/
++
++#ifdef LEXDEBUG
++#define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
++#else
++#define DPRINT(fmt, ...) do { } while (0)
++#endif
++
++static int dts_version; /* = 0 */
++
++#define BEGIN_DEFAULT() if (dts_version == 0) { \
++ DPRINT("<INITIAL>\n"); \
++ BEGIN(INITIAL); \
++ } else { \
++ DPRINT("<V1>\n"); \
++ BEGIN(V1); \
++ }
++
++static void push_input_file(const char *filename);
++static int pop_input_file(void);
++#line 638 "dtc-lexer.lex.c"
++
++#define INITIAL 0
++#define INCLUDE 1
++#define BYTESTRING 2
++#define PROPNODENAME 3
++#define V1 4
++
++#ifndef YY_NO_UNISTD_H
++/* Special case for "unistd.h", since it is non-ANSI. We include it way
++ * down here because we want the user's section 1 to have been scanned first.
++ * The user has a chance to override it with an option.
++ */
++#include <unistd.h>
++#endif
++
++#ifndef YY_EXTRA_TYPE
++#define YY_EXTRA_TYPE void *
++#endif
++
++static int yy_init_globals (void );
++
++/* Macros after this point can all be overridden by user definitions in
++ * section 1.
++ */
++
++#ifndef YY_SKIP_YYWRAP
++#ifdef __cplusplus
++extern "C" int yywrap (void );
++#else
++extern int yywrap (void );
++#endif
++#endif
++
++#ifndef yytext_ptr
++static void yy_flex_strncpy (char *,yyconst char *,int );
++#endif
++
++#ifdef YY_NEED_STRLEN
++static int yy_flex_strlen (yyconst char * );
++#endif
++
++#ifndef YY_NO_INPUT
++
++#ifdef __cplusplus
++static int yyinput (void );
++#else
++static int input (void );
++#endif
++
++#endif
++
++/* Amount of stuff to slurp up with each read. */
++#ifndef YY_READ_BUF_SIZE
++#define YY_READ_BUF_SIZE 8192
++#endif
++
++/* Copy whatever the last rule matched to the standard output. */
++#ifndef ECHO
++/* This used to be an fputs(), but since the string might contain NUL's,
++ * we now use fwrite().
++ */
++#define ECHO fwrite( yytext, yyleng, 1, yyout )
++#endif
++
++/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
++ * is returned in "result".
++ */
++#ifndef YY_INPUT
++#define YY_INPUT(buf,result,max_size) \
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
++ { \
++ int c = '*'; \
++ int n; \
++ for ( n = 0; n < max_size && \
++ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
++ buf[n] = (char) c; \
++ if ( c == '\n' ) \
++ buf[n++] = (char) c; \
++ if ( c == EOF && ferror( yyin ) ) \
++ YY_FATAL_ERROR( "input in flex scanner failed" ); \
++ result = n; \
++ } \
++ else \
++ { \
++ errno=0; \
++ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
++ { \
++ if( errno != EINTR) \
++ { \
++ YY_FATAL_ERROR( "input in flex scanner failed" ); \
++ break; \
++ } \
++ errno=0; \
++ clearerr(yyin); \
++ } \
++ }\
++\
++
++#endif
++
++/* No semi-colon after return; correct usage is to write "yyterminate();" -
++ * we don't want an extra ';' after the "return" because that will cause
++ * some compilers to complain about unreachable statements.
++ */
++#ifndef yyterminate
++#define yyterminate() return YY_NULL
++#endif
++
++/* Number of entries by which start-condition stack grows. */
++#ifndef YY_START_STACK_INCR
++#define YY_START_STACK_INCR 25
++#endif
++
++/* Report a fatal error. */
++#ifndef YY_FATAL_ERROR
++#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
++#endif
++
++/* end tables serialization structures and prototypes */
++
++/* Default declaration of generated scanner - a define so the user can
++ * easily add parameters.
++ */
++#ifndef YY_DECL
++#define YY_DECL_IS_OURS 1
++
++extern int yylex (void);
++
++#define YY_DECL int yylex (void)
++#endif /* !YY_DECL */
++
++/* Code executed at the beginning of each rule, after yytext and yyleng
++ * have been set up.
++ */
++#ifndef YY_USER_ACTION
++#define YY_USER_ACTION
++#endif
++
++/* Code executed at the end of each rule. */
++#ifndef YY_BREAK
++#define YY_BREAK break;
++#endif
++
++#define YY_RULE_SETUP \
++ YY_USER_ACTION
++
++/** The main scanner function which does all the work.
++ */
++YY_DECL
++{
++ register yy_state_type yy_current_state;
++ register char *yy_cp, *yy_bp;
++ register int yy_act;
++
++#line 64 "dtc-lexer.l"
++
++#line 795 "dtc-lexer.lex.c"
++
++ if ( !(yy_init) )
++ {
++ (yy_init) = 1;
++
++#ifdef YY_USER_INIT
++ YY_USER_INIT;
++#endif
++
++ if ( ! (yy_start) )
++ (yy_start) = 1; /* first start state */
++
++ if ( ! yyin )
++ yyin = stdin;
++
++ if ( ! yyout )
++ yyout = stdout;
++
++ if ( ! YY_CURRENT_BUFFER ) {
++ yyensure_buffer_stack ();
++ YY_CURRENT_BUFFER_LVALUE =
++ yy_create_buffer(yyin,YY_BUF_SIZE );
++ }
++
++ yy_load_buffer_state( );
++ }
++
++ while ( 1 ) /* loops until end-of-file is reached */
++ {
++ yy_cp = (yy_c_buf_p);
++
++ /* Support of yytext. */
++ *yy_cp = (yy_hold_char);
++
++ /* yy_bp points to the position in yy_ch_buf of the start of
++ * the current run.
++ */
++ yy_bp = yy_cp;
++
++ yy_current_state = (yy_start);
++yy_match:
++ do
++ {
++ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
++ if ( yy_accept[yy_current_state] )
++ {
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
++ }
++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
++ {
++ yy_current_state = (int) yy_def[yy_current_state];
++ if ( yy_current_state >= 104 )
++ yy_c = yy_meta[(unsigned int) yy_c];
++ }
++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++ ++yy_cp;
++ }
++ while ( yy_base[yy_current_state] != 303 );
++
++yy_find_action:
++ yy_act = yy_accept[yy_current_state];
++ if ( yy_act == 0 )
++ { /* have to back up */
++ yy_cp = (yy_last_accepting_cpos);
++ yy_current_state = (yy_last_accepting_state);
++ yy_act = yy_accept[yy_current_state];
++ }
++
++ YY_DO_BEFORE_ACTION;
++
++ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
++ {
++ int yyl;
++ for ( yyl = 0; yyl < yyleng; ++yyl )
++ if ( yytext[yyl] == '\n' )
++
++ yylineno++;
++;
++ }
++
++do_action: /* This label is used only to access EOF actions. */
++
++ switch ( yy_act )
++ { /* beginning of action switch */
++ case 0: /* must back up */
++ /* undo the effects of YY_DO_BEFORE_ACTION */
++ *yy_cp = (yy_hold_char);
++ yy_cp = (yy_last_accepting_cpos);
++ yy_current_state = (yy_last_accepting_state);
++ goto yy_find_action;
++
++case 1:
++/* rule 1 can match eol */
++YY_RULE_SETUP
++#line 65 "dtc-lexer.l"
++{
++ char *name = strchr(yytext, '\"') + 1;
++ yytext[yyleng-1] = '\0';
++ push_input_file(name);
++ }
++ YY_BREAK
++case YY_STATE_EOF(INITIAL):
++case YY_STATE_EOF(INCLUDE):
++case YY_STATE_EOF(BYTESTRING):
++case YY_STATE_EOF(PROPNODENAME):
++case YY_STATE_EOF(V1):
++#line 71 "dtc-lexer.l"
++{
++ if (!pop_input_file()) {
++ yyterminate();
++ }
++ }
++ YY_BREAK
++case 2:
++/* rule 2 can match eol */
++YY_RULE_SETUP
++#line 77 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("String: %s\n", yytext);
++ yylval.data = data_copy_escape_string(yytext+1,
++ yyleng-2);
++ yylloc.first_line = yylineno;
++ return DT_STRING;
++ }
++ YY_BREAK
++case 3:
++YY_RULE_SETUP
++#line 87 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Keyword: /dts-v1/\n");
++ dts_version = 1;
++ BEGIN_DEFAULT();
++ return DT_V1;
++ }
++ YY_BREAK
++case 4:
++YY_RULE_SETUP
++#line 96 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Keyword: /memreserve/\n");
++ BEGIN_DEFAULT();
++ return DT_MEMRESERVE;
++ }
++ YY_BREAK
++case 5:
++YY_RULE_SETUP
++#line 104 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Label: %s\n", yytext);
++ yylval.labelref = strdup(yytext);
++ yylval.labelref[yyleng-1] = '\0';
++ return DT_LABEL;
++ }
++ YY_BREAK
++case 6:
++YY_RULE_SETUP
++#line 113 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ if (*yytext == 'b')
++ yylval.cbase = 2;
++ else if (*yytext == 'o')
++ yylval.cbase = 8;
++ else if (*yytext == 'd')
++ yylval.cbase = 10;
++ else
++ yylval.cbase = 16;
++ DPRINT("Base: %d\n", yylval.cbase);
++ return DT_BASE;
++ }
++ YY_BREAK
++case 7:
++YY_RULE_SETUP
++#line 128 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.literal = strdup(yytext);
++ DPRINT("Literal: '%s'\n", yylval.literal);
++ return DT_LEGACYLITERAL;
++ }
++ YY_BREAK
++case 8:
++YY_RULE_SETUP
++#line 136 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.literal = strdup(yytext);
++ DPRINT("Literal: '%s'\n", yylval.literal);
++ return DT_LITERAL;
++ }
++ YY_BREAK
++case 9:
++YY_RULE_SETUP
++#line 144 "dtc-lexer.l"
++{ /* label reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Ref: %s\n", yytext+1);
++ yylval.labelref = strdup(yytext+1);
++ return DT_REF;
++ }
++ YY_BREAK
++case 10:
++YY_RULE_SETUP
++#line 152 "dtc-lexer.l"
++{ /* new-style path reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yytext[yyleng-1] = '\0';
++ DPRINT("Ref: %s\n", yytext+2);
++ yylval.labelref = strdup(yytext+2);
++ return DT_REF;
++ }
++ YY_BREAK
++case 11:
++YY_RULE_SETUP
++#line 161 "dtc-lexer.l"
++{ /* old-style path reference */
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Ref: %s\n", yytext+1);
++ yylval.labelref = strdup(yytext+1);
++ return DT_REF;
++ }
++ YY_BREAK
++case 12:
++YY_RULE_SETUP
++#line 169 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ yylval.byte = strtol(yytext, NULL, 16);
++ DPRINT("Byte: %02x\n", (int)yylval.byte);
++ return DT_BYTE;
++ }
++ YY_BREAK
++case 13:
++YY_RULE_SETUP
++#line 177 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("/BYTESTRING\n");
++ BEGIN_DEFAULT();
++ return ']';
++ }
++ YY_BREAK
++case 14:
++YY_RULE_SETUP
++#line 185 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("PropNodeName: %s\n", yytext);
++ yylval.propnodename = strdup(yytext);
++ BEGIN_DEFAULT();
++ return DT_PROPNODENAME;
++ }
++ YY_BREAK
++case 15:
++YY_RULE_SETUP
++#line 194 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Binary Include\n");
++ return DT_INCBIN;
++ }
++ YY_BREAK
++case 16:
++/* rule 16 can match eol */
++YY_RULE_SETUP
++#line 201 "dtc-lexer.l"
++/* eat whitespace */
++ YY_BREAK
++case 17:
++/* rule 17 can match eol */
++YY_RULE_SETUP
++#line 202 "dtc-lexer.l"
++/* eat C-style comments */
++ YY_BREAK
++case 18:
++/* rule 18 can match eol */
++YY_RULE_SETUP
++#line 203 "dtc-lexer.l"
++/* eat C++-style comments */
++ YY_BREAK
++case 19:
++YY_RULE_SETUP
++#line 205 "dtc-lexer.l"
++{
++ yylloc.file = srcpos_file;
++ yylloc.first_line = yylineno;
++ DPRINT("Char: %c (\\x%02x)\n", yytext[0],
++ (unsigned)yytext[0]);
++ if (yytext[0] == '[') {
++ DPRINT("<BYTESTRING>\n");
++ BEGIN(BYTESTRING);
++ }
++ if ((yytext[0] == '{')
++ || (yytext[0] == ';')) {
++ DPRINT("<PROPNODENAME>\n");
++ BEGIN(PROPNODENAME);
++ }
++ return yytext[0];
++ }
++ YY_BREAK
++case 20:
++YY_RULE_SETUP
++#line 222 "dtc-lexer.l"
++ECHO;
++ YY_BREAK
++#line 1120 "dtc-lexer.lex.c"
++
++ case YY_END_OF_BUFFER:
++ {
++ /* Amount of text matched not including the EOB char. */
++ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
++
++ /* Undo the effects of YY_DO_BEFORE_ACTION. */
++ *yy_cp = (yy_hold_char);
++ YY_RESTORE_YY_MORE_OFFSET
++
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
++ {
++ /* We're scanning a new file or input source. It's
++ * possible that this happened because the user
++ * just pointed yyin at a new source and called
++ * yylex(). If so, then we have to assure
++ * consistency between YY_CURRENT_BUFFER and our
++ * globals. Here is the right place to do so, because
++ * this is the first action (other than possibly a
++ * back-up) that will match for the new input source.
++ */
++ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
++ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
++ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
++ }
++
++ /* Note that here we test for yy_c_buf_p "<=" to the position
++ * of the first EOB in the buffer, since yy_c_buf_p will
++ * already have been incremented past the NUL character
++ * (since all states make transitions on EOB to the
++ * end-of-buffer state). Contrast this with the test
++ * in input().
++ */
++ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
++ { /* This was really a NUL. */
++ yy_state_type yy_next_state;
++
++ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
++
++ yy_current_state = yy_get_previous_state( );
++
++ /* Okay, we're now positioned to make the NUL
++ * transition. We couldn't have
++ * yy_get_previous_state() go ahead and do it
++ * for us because it doesn't know how to deal
++ * with the possibility of jamming (and we don't
++ * want to build jamming into it because then it
++ * will run more slowly).
++ */
++
++ yy_next_state = yy_try_NUL_trans( yy_current_state );
++
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
++
++ if ( yy_next_state )
++ {
++ /* Consume the NUL. */
++ yy_cp = ++(yy_c_buf_p);
++ yy_current_state = yy_next_state;
++ goto yy_match;
++ }
++
++ else
++ {
++ yy_cp = (yy_c_buf_p);
++ goto yy_find_action;
++ }
++ }
++
++ else switch ( yy_get_next_buffer( ) )
++ {
++ case EOB_ACT_END_OF_FILE:
++ {
++ (yy_did_buffer_switch_on_eof) = 0;
++
++ if ( yywrap( ) )
++ {
++ /* Note: because we've taken care in
++ * yy_get_next_buffer() to have set up
++ * yytext, we can now set up
++ * yy_c_buf_p so that if some total
++ * hoser (like flex itself) wants to
++ * call the scanner after we return the
++ * YY_NULL, it'll still work - another
++ * YY_NULL will get returned.
++ */
++ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
++
++ yy_act = YY_STATE_EOF(YY_START);
++ goto do_action;
++ }
++
++ else
++ {
++ if ( ! (yy_did_buffer_switch_on_eof) )
++ YY_NEW_FILE;
++ }
++ break;
++ }
++
++ case EOB_ACT_CONTINUE_SCAN:
++ (yy_c_buf_p) =
++ (yytext_ptr) + yy_amount_of_matched_text;
++
++ yy_current_state = yy_get_previous_state( );
++
++ yy_cp = (yy_c_buf_p);
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
++ goto yy_match;
++
++ case EOB_ACT_LAST_MATCH:
++ (yy_c_buf_p) =
++ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
++
++ yy_current_state = yy_get_previous_state( );
++
++ yy_cp = (yy_c_buf_p);
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
++ goto yy_find_action;
++ }
++ break;
++ }
++
++ default:
++ YY_FATAL_ERROR(
++ "fatal flex scanner internal error--no action found" );
++ } /* end of action switch */
++ } /* end of scanning one token */
++} /* end of yylex */
++
++/* yy_get_next_buffer - try to read in a new buffer
++ *
++ * Returns a code representing an action:
++ * EOB_ACT_LAST_MATCH -
++ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
++ * EOB_ACT_END_OF_FILE - end of file
++ */
++static int yy_get_next_buffer (void)
++{
++ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
++ register char *source = (yytext_ptr);
++ register int number_to_move, i;
++ int ret_val;
++
++ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
++ YY_FATAL_ERROR(
++ "fatal flex scanner internal error--end of buffer missed" );
++
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
++ { /* Don't try to fill the buffer, so this is an EOF. */
++ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
++ {
++ /* We matched a single character, the EOB, so
++ * treat this as a final EOF.
++ */
++ return EOB_ACT_END_OF_FILE;
++ }
++
++ else
++ {
++ /* We matched some text prior to the EOB, first
++ * process it.
++ */
++ return EOB_ACT_LAST_MATCH;
++ }
++ }
++
++ /* Try to read more data. */
++
++ /* First move last chars to start of buffer. */
++ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
++
++ for ( i = 0; i < number_to_move; ++i )
++ *(dest++) = *(source++);
++
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
++ /* don't do the read, it's not guaranteed to return an EOF,
++ * just force an EOF
++ */
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
++
++ else
++ {
++ int num_to_read =
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
++
++ while ( num_to_read <= 0 )
++ { /* Not enough room in the buffer - grow it. */
++
++ /* just a shorter name for the current buffer */
++ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
++
++ int yy_c_buf_p_offset =
++ (int) ((yy_c_buf_p) - b->yy_ch_buf);
++
++ if ( b->yy_is_our_buffer )
++ {
++ int new_size = b->yy_buf_size * 2;
++
++ if ( new_size <= 0 )
++ b->yy_buf_size += b->yy_buf_size / 8;
++ else
++ b->yy_buf_size *= 2;
++
++ b->yy_ch_buf = (char *)
++ /* Include room in for 2 EOB chars. */
++ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
++ }
++ else
++ /* Can't grow it, we don't own it. */
++ b->yy_ch_buf = 0;
++
++ if ( ! b->yy_ch_buf )
++ YY_FATAL_ERROR(
++ "fatal error - scanner input buffer overflow" );
++
++ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
++
++ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
++ number_to_move - 1;
++
++ }
++
++ if ( num_to_read > YY_READ_BUF_SIZE )
++ num_to_read = YY_READ_BUF_SIZE;
++
++ /* Read in more data. */
++ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
++ (yy_n_chars), (size_t) num_to_read );
++
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
++ }
++
++ if ( (yy_n_chars) == 0 )
++ {
++ if ( number_to_move == YY_MORE_ADJ )
++ {
++ ret_val = EOB_ACT_END_OF_FILE;
++ yyrestart(yyin );
++ }
++
++ else
++ {
++ ret_val = EOB_ACT_LAST_MATCH;
++ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
++ YY_BUFFER_EOF_PENDING;
++ }
++ }
++
++ else
++ ret_val = EOB_ACT_CONTINUE_SCAN;
++
++ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
++ /* Extend the array by 50%, plus the number we really need. */
++ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
++ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
++ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
++ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
++ }
++
++ (yy_n_chars) += number_to_move;
++ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
++ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
++
++ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
++
++ return ret_val;
++}
++
++/* yy_get_previous_state - get the state just before the EOB char was reached */
++
++ static yy_state_type yy_get_previous_state (void)
++{
++ register yy_state_type yy_current_state;
++ register char *yy_cp;
++
++ yy_current_state = (yy_start);
++
++ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
++ {
++ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
++ if ( yy_accept[yy_current_state] )
++ {
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
++ }
++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
++ {
++ yy_current_state = (int) yy_def[yy_current_state];
++ if ( yy_current_state >= 104 )
++ yy_c = yy_meta[(unsigned int) yy_c];
++ }
++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++ }
++
++ return yy_current_state;
++}
++
++/* yy_try_NUL_trans - try to make a transition on the NUL character
++ *
++ * synopsis
++ * next_state = yy_try_NUL_trans( current_state );
++ */
++ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
++{
++ register int yy_is_jam;
++ register char *yy_cp = (yy_c_buf_p);
++
++ register YY_CHAR yy_c = 1;
++ if ( yy_accept[yy_current_state] )
++ {
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
++ }
++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
++ {
++ yy_current_state = (int) yy_def[yy_current_state];
++ if ( yy_current_state >= 104 )
++ yy_c = yy_meta[(unsigned int) yy_c];
++ }
++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++ yy_is_jam = (yy_current_state == 103);
++
++ return yy_is_jam ? 0 : yy_current_state;
++}
++
++#ifndef YY_NO_INPUT
++#ifdef __cplusplus
++ static int yyinput (void)
++#else
++ static int input (void)
++#endif
++
++{
++ int c;
++
++ *(yy_c_buf_p) = (yy_hold_char);
++
++ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
++ {
++ /* yy_c_buf_p now points to the character we want to return.
++ * If this occurs *before* the EOB characters, then it's a
++ * valid NUL; if not, then we've hit the end of the buffer.
++ */
++ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
++ /* This was really a NUL. */
++ *(yy_c_buf_p) = '\0';
++
++ else
++ { /* need more input */
++ int offset = (yy_c_buf_p) - (yytext_ptr);
++ ++(yy_c_buf_p);
++
++ switch ( yy_get_next_buffer( ) )
++ {
++ case EOB_ACT_LAST_MATCH:
++ /* This happens because yy_g_n_b()
++ * sees that we've accumulated a
++ * token and flags that we need to
++ * try matching the token before
++ * proceeding. But for input(),
++ * there's no matching to consider.
++ * So convert the EOB_ACT_LAST_MATCH
++ * to EOB_ACT_END_OF_FILE.
++ */
++
++ /* Reset buffer status. */
++ yyrestart(yyin );
++
++ /*FALLTHROUGH*/
++
++ case EOB_ACT_END_OF_FILE:
++ {
++ if ( yywrap( ) )
++ return EOF;
++
++ if ( ! (yy_did_buffer_switch_on_eof) )
++ YY_NEW_FILE;
++#ifdef __cplusplus
++ return yyinput();
++#else
++ return input();
++#endif
++ }
++
++ case EOB_ACT_CONTINUE_SCAN:
++ (yy_c_buf_p) = (yytext_ptr) + offset;
++ break;
++ }
++ }
++ }
++
++ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
++ *(yy_c_buf_p) = '\0'; /* preserve yytext */
++ (yy_hold_char) = *++(yy_c_buf_p);
++
++ if ( c == '\n' )
++
++ yylineno++;
++;
++
++ return c;
++}
++#endif /* ifndef YY_NO_INPUT */
++
++/** Immediately switch to a different input stream.
++ * @param input_file A readable stream.
++ *
++ * @note This function does not reset the start condition to @c INITIAL .
++ */
++ void yyrestart (FILE * input_file )
++{
++
++ if ( ! YY_CURRENT_BUFFER ){
++ yyensure_buffer_stack ();
++ YY_CURRENT_BUFFER_LVALUE =
++ yy_create_buffer(yyin,YY_BUF_SIZE );
++ }
++
++ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
++ yy_load_buffer_state( );
++}
++
++/** Switch to a different input buffer.
++ * @param new_buffer The new input buffer.
++ *
++ */
++ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
++{
++
++ /* TODO. We should be able to replace this entire function body
++ * with
++ * yypop_buffer_state();
++ * yypush_buffer_state(new_buffer);
++ */
++ yyensure_buffer_stack ();
++ if ( YY_CURRENT_BUFFER == new_buffer )
++ return;
++
++ if ( YY_CURRENT_BUFFER )
++ {
++ /* Flush out information for old buffer. */
++ *(yy_c_buf_p) = (yy_hold_char);
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
++ }
++
++ YY_CURRENT_BUFFER_LVALUE = new_buffer;
++ yy_load_buffer_state( );
++
++ /* We don't actually know whether we did this switch during
++ * EOF (yywrap()) processing, but the only time this flag
++ * is looked at is after yywrap() is called, so it's safe
++ * to go ahead and always set it.
++ */
++ (yy_did_buffer_switch_on_eof) = 1;
++}
++
++static void yy_load_buffer_state (void)
++{
++ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
++ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
++ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
++ (yy_hold_char) = *(yy_c_buf_p);
++}
++
++/** Allocate and initialize an input buffer state.
++ * @param file A readable stream.
++ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
++ *
++ * @return the allocated buffer state.
++ */
++ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
++{
++ YY_BUFFER_STATE b;
++
++ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
++ if ( ! b )
++ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
++
++ b->yy_buf_size = size;
++
++ /* yy_ch_buf has to be 2 characters longer than the size given because
++ * we need to put in 2 end-of-buffer characters.
++ */
++ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
++ if ( ! b->yy_ch_buf )
++ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
++
++ b->yy_is_our_buffer = 1;
++
++ yy_init_buffer(b,file );
++
++ return b;
++}
++
++/** Destroy the buffer.
++ * @param b a buffer created with yy_create_buffer()
++ *
++ */
++ void yy_delete_buffer (YY_BUFFER_STATE b )
++{
++
++ if ( ! b )
++ return;
++
++ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
++ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
++
++ if ( b->yy_is_our_buffer )
++ yyfree((void *) b->yy_ch_buf );
++
++ yyfree((void *) b );
++}
++
++#ifndef __cplusplus
++extern int isatty (int );
++#endif /* __cplusplus */
++
++/* Initializes or reinitializes a buffer.
++ * This function is sometimes called more than once on the same buffer,
++ * such as during a yyrestart() or at EOF.
++ */
++ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
++
++{
++ int oerrno = errno;
++
++ yy_flush_buffer(b );
++
++ b->yy_input_file = file;
++ b->yy_fill_buffer = 1;
++
++ /* If b is the current buffer, then yy_init_buffer was _probably_
++ * called from yyrestart() or through yy_get_next_buffer.
++ * In that case, we don't want to reset the lineno or column.
++ */
++ if (b != YY_CURRENT_BUFFER){
++ b->yy_bs_lineno = 1;
++ b->yy_bs_column = 0;
++ }
++
++ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
++
++ errno = oerrno;
++}
++
++/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
++ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
++ *
++ */
++ void yy_flush_buffer (YY_BUFFER_STATE b )
++{
++ if ( ! b )
++ return;
++
++ b->yy_n_chars = 0;
++
++ /* We always need two end-of-buffer characters. The first causes
++ * a transition to the end-of-buffer state. The second causes
++ * a jam in that state.
++ */
++ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
++ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
++
++ b->yy_buf_pos = &b->yy_ch_buf[0];
++
++ b->yy_at_bol = 1;
++ b->yy_buffer_status = YY_BUFFER_NEW;
++
++ if ( b == YY_CURRENT_BUFFER )
++ yy_load_buffer_state( );
++}
++
++/** Pushes the new state onto the stack. The new state becomes
++ * the current state. This function will allocate the stack
++ * if necessary.
++ * @param new_buffer The new state.
++ *
++ */
++void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
++{
++ if (new_buffer == NULL)
++ return;
++
++ yyensure_buffer_stack();
++
++ /* This block is copied from yy_switch_to_buffer. */
++ if ( YY_CURRENT_BUFFER )
++ {
++ /* Flush out information for old buffer. */
++ *(yy_c_buf_p) = (yy_hold_char);
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
++ }
++
++ /* Only push if top exists. Otherwise, replace top. */
++ if (YY_CURRENT_BUFFER)
++ (yy_buffer_stack_top)++;
++ YY_CURRENT_BUFFER_LVALUE = new_buffer;
++
++ /* copied from yy_switch_to_buffer. */
++ yy_load_buffer_state( );
++ (yy_did_buffer_switch_on_eof) = 1;
++}
++
++/** Removes and deletes the top of the stack, if present.
++ * The next element becomes the new top.
++ *
++ */
++void yypop_buffer_state (void)
++{
++ if (!YY_CURRENT_BUFFER)
++ return;
++
++ yy_delete_buffer(YY_CURRENT_BUFFER );
++ YY_CURRENT_BUFFER_LVALUE = NULL;
++ if ((yy_buffer_stack_top) > 0)
++ --(yy_buffer_stack_top);
++
++ if (YY_CURRENT_BUFFER) {
++ yy_load_buffer_state( );
++ (yy_did_buffer_switch_on_eof) = 1;
++ }
++}
++
++/* Allocates the stack if it does not exist.
++ * Guarantees space for at least one push.
++ */
++static void yyensure_buffer_stack (void)
++{
++ int num_to_alloc;
++
++ if (!(yy_buffer_stack)) {
++
++ /* First allocation is just for 2 elements, since we don't know if this
++ * scanner will even need a stack. We use 2 instead of 1 to avoid an
++ * immediate realloc on the next call.
++ */
++ num_to_alloc = 1;
++ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
++ (num_to_alloc * sizeof(struct yy_buffer_state*)
++ );
++ if ( ! (yy_buffer_stack) )
++ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
++
++ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
++
++ (yy_buffer_stack_max) = num_to_alloc;
++ (yy_buffer_stack_top) = 0;
++ return;
++ }
++
++ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
++
++ /* Increase the buffer to prepare for a possible push. */
++ int grow_size = 8 /* arbitrary grow size */;
++
++ num_to_alloc = (yy_buffer_stack_max) + grow_size;
++ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
++ ((yy_buffer_stack),
++ num_to_alloc * sizeof(struct yy_buffer_state*)
++ );
++ if ( ! (yy_buffer_stack) )
++ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
++
++ /* zero only the new slots.*/
++ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
++ (yy_buffer_stack_max) = num_to_alloc;
++ }
++}
++
++/** Setup the input buffer state to scan directly from a user-specified character buffer.
++ * @param base the character buffer
++ * @param size the size in bytes of the character buffer
++ *
++ * @return the newly allocated buffer state object.
++ */
++YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
++{
++ YY_BUFFER_STATE b;
++
++ if ( size < 2 ||
++ base[size-2] != YY_END_OF_BUFFER_CHAR ||
++ base[size-1] != YY_END_OF_BUFFER_CHAR )
++ /* They forgot to leave room for the EOB's. */
++ return 0;
++
++ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
++ if ( ! b )
++ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
++
++ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
++ b->yy_buf_pos = b->yy_ch_buf = base;
++ b->yy_is_our_buffer = 0;
++ b->yy_input_file = 0;
++ b->yy_n_chars = b->yy_buf_size;
++ b->yy_is_interactive = 0;
++ b->yy_at_bol = 1;
++ b->yy_fill_buffer = 0;
++ b->yy_buffer_status = YY_BUFFER_NEW;
++
++ yy_switch_to_buffer(b );
++
++ return b;
++}
++
++/** Setup the input buffer state to scan a string. The next call to yylex() will
++ * scan from a @e copy of @a str.
++ * @param yystr a NUL-terminated string to scan
++ *
++ * @return the newly allocated buffer state object.
++ * @note If you want to scan bytes that may contain NUL values, then use
++ * yy_scan_bytes() instead.
++ */
++YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
++{
++
++ return yy_scan_bytes(yystr,strlen(yystr) );
++}
++
++/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
++ * scan from a @e copy of @a bytes.
++ * @param bytes the byte buffer to scan
++ * @param len the number of bytes in the buffer pointed to by @a bytes.
++ *
++ * @return the newly allocated buffer state object.
++ */
++YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
++{
++ YY_BUFFER_STATE b;
++ char *buf;
++ yy_size_t n;
++ int i;
++
++ /* Get memory for full buffer, including space for trailing EOB's. */
++ n = _yybytes_len + 2;
++ buf = (char *) yyalloc(n );
++ if ( ! buf )
++ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
++
++ for ( i = 0; i < _yybytes_len; ++i )
++ buf[i] = yybytes[i];
++
++ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
++
++ b = yy_scan_buffer(buf,n );
++ if ( ! b )
++ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
++
++ /* It's okay to grow etc. this buffer, and we should throw it
++ * away when we're done.
++ */
++ b->yy_is_our_buffer = 1;
++
++ return b;
++}
++
++#ifndef YY_EXIT_FAILURE
++#define YY_EXIT_FAILURE 2
++#endif
++
++static void yy_fatal_error (yyconst char* msg )
++{
++ (void) fprintf( stderr, "%s\n", msg );
++ exit( YY_EXIT_FAILURE );
++}
++
++/* Redefine yyless() so it works in section 3 code. */
++
++#undef yyless
++#define yyless(n) \
++ do \
++ { \
++ /* Undo effects of setting up yytext. */ \
++ int yyless_macro_arg = (n); \
++ YY_LESS_LINENO(yyless_macro_arg);\
++ yytext[yyleng] = (yy_hold_char); \
++ (yy_c_buf_p) = yytext + yyless_macro_arg; \
++ (yy_hold_char) = *(yy_c_buf_p); \
++ *(yy_c_buf_p) = '\0'; \
++ yyleng = yyless_macro_arg; \
++ } \
++ while ( 0 )
++
++/* Accessor methods (get/set functions) to struct members. */
++
++/** Get the current line number.
++ *
++ */
++int yyget_lineno (void)
++{
++
++ return yylineno;
++}
++
++/** Get the input stream.
++ *
++ */
++FILE *yyget_in (void)
++{
++ return yyin;
++}
++
++/** Get the output stream.
++ *
++ */
++FILE *yyget_out (void)
++{
++ return yyout;
++}
++
++/** Get the length of the current token.
++ *
++ */
++int yyget_leng (void)
++{
++ return yyleng;
++}
++
++/** Get the current token.
++ *
++ */
++
++char *yyget_text (void)
++{
++ return yytext;
++}
++
++/** Set the current line number.
++ * @param line_number
++ *
++ */
++void yyset_lineno (int line_number )
++{
++
++ yylineno = line_number;
++}
++
++/** Set the input stream. This does not discard the current
++ * input buffer.
++ * @param in_str A readable stream.
++ *
++ * @see yy_switch_to_buffer
++ */
++void yyset_in (FILE * in_str )
++{
++ yyin = in_str ;
++}
++
++void yyset_out (FILE * out_str )
++{
++ yyout = out_str ;
++}
++
++int yyget_debug (void)
++{
++ return yy_flex_debug;
++}
++
++void yyset_debug (int bdebug )
++{
++ yy_flex_debug = bdebug ;
++}
++
++static int yy_init_globals (void)
++{
++ /* Initialization is the same as for the non-reentrant scanner.
++ * This function is called from yylex_destroy(), so don't allocate here.
++ */
++
++ /* We do not touch yylineno unless the option is enabled. */
++ yylineno = 1;
++
++ (yy_buffer_stack) = 0;
++ (yy_buffer_stack_top) = 0;
++ (yy_buffer_stack_max) = 0;
++ (yy_c_buf_p) = (char *) 0;
++ (yy_init) = 0;
++ (yy_start) = 0;
++
++/* Defined in main.c */
++#ifdef YY_STDINIT
++ yyin = stdin;
++ yyout = stdout;
++#else
++ yyin = (FILE *) 0;
++ yyout = (FILE *) 0;
++#endif
++
++ /* For future reference: Set errno on error, since we are called by
++ * yylex_init()
++ */
++ return 0;
++}
++
++/* yylex_destroy is for both reentrant and non-reentrant scanners. */
++int yylex_destroy (void)
++{
++
++ /* Pop the buffer stack, destroying each element. */
++ while(YY_CURRENT_BUFFER){
++ yy_delete_buffer(YY_CURRENT_BUFFER );
++ YY_CURRENT_BUFFER_LVALUE = NULL;
++ yypop_buffer_state();
++ }
++
++ /* Destroy the stack itself. */
++ yyfree((yy_buffer_stack) );
++ (yy_buffer_stack) = NULL;
++
++ /* Reset the globals. This is important in a non-reentrant scanner so the next time
++ * yylex() is called, initialization will occur. */
++ yy_init_globals( );
++
++ return 0;
++}
++
++/*
++ * Internal utility routines.
++ */
++
++#ifndef yytext_ptr
++static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
++{
++ register int i;
++ for ( i = 0; i < n; ++i )
++ s1[i] = s2[i];
++}
++#endif
++
++#ifdef YY_NEED_STRLEN
++static int yy_flex_strlen (yyconst char * s )
++{
++ register int n;
++ for ( n = 0; s[n]; ++n )
++ ;
++
++ return n;
++}
++#endif
++
++void *yyalloc (yy_size_t size )
++{
++ return (void *) malloc( size );
++}
++
++void *yyrealloc (void * ptr, yy_size_t size )
++{
++ /* The cast to (char *) in the following accommodates both
++ * implementations that use char* generic pointers, and those
++ * that use void* generic pointers. It works with the latter
++ * because both ANSI C and C++ allow castless assignment from
++ * any pointer type to void*, and deal with argument conversions
++ * as though doing an assignment.
++ */
++ return (void *) realloc( (char *) ptr, size );
++}
++
++void yyfree (void * ptr )
++{
++ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
++}
++
++#define YYTABLES_NAME "yytables"
++
++#line 222 "dtc-lexer.l"
++
++
++
++
++/*
++ * Stack of nested include file contexts.
++ */
++
++struct incl_file {
++ struct dtc_file *file;
++ YY_BUFFER_STATE yy_prev_buf;
++ int yy_prev_lineno;
++ struct incl_file *prev;
++};
++
++static struct incl_file *incl_file_stack;
++
++
++/*
++ * Detect infinite include recursion.
++ */
++#define MAX_INCLUDE_DEPTH (100)
++
++static int incl_depth = 0;
++
++
++static void push_input_file(const char *filename)
++{
++ struct incl_file *incl_file;
++ struct dtc_file *newfile;
++ struct search_path search, *searchptr = NULL;
++
++ assert(filename);
++
++ if (incl_depth++ >= MAX_INCLUDE_DEPTH)
++ die("Includes nested too deeply");
++
++ if (srcpos_file) {
++ search.dir = srcpos_file->dir;
++ search.next = NULL;
++ search.prev = NULL;
++ searchptr = &search;
++ }
++
++ newfile = dtc_open_file(filename, searchptr);
++
++ incl_file = xmalloc(sizeof(struct incl_file));
++
++ /*
++ * Save current context.
++ */
++ incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
++ incl_file->yy_prev_lineno = yylineno;
++ incl_file->file = srcpos_file;
++ incl_file->prev = incl_file_stack;
++
++ incl_file_stack = incl_file;
++
++ /*
++ * Establish new context.
++ */
++ srcpos_file = newfile;
++ yylineno = 1;
++ yyin = newfile->file;
++ yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
++}
++
++
++static int pop_input_file(void)
++{
++ struct incl_file *incl_file;
++
++ if (incl_file_stack == 0)
++ return 0;
++
++ dtc_close_file(srcpos_file);
++
++ /*
++ * Pop.
++ */
++ --incl_depth;
++ incl_file = incl_file_stack;
++ incl_file_stack = incl_file->prev;
++
++ /*
++ * Recover old context.
++ */
++ yy_delete_buffer(YY_CURRENT_BUFFER);
++ yy_switch_to_buffer(incl_file->yy_prev_buf);
++ yylineno = incl_file->yy_prev_lineno;
++ srcpos_file = incl_file->file;
++ yyin = incl_file->file ? incl_file->file->file : NULL;
++
++ /*
++ * Free old state.
++ */
++ free(incl_file);
++
++ return 1;
++}
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc-parser.tab.c_shipped linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.tab.c_shipped
+--- linux-2.6.30-rc4/scripts/dtc/dtc-parser.tab.c_shipped 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.tab.c_shipped 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,2040 @@
++/* A Bison parser, made by GNU Bison 2.3. */
++
++/* Skeleton implementation for Bison's Yacc-like parsers in C
++
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
++ Free Software Foundation, Inc.
++
++ 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, Inc., 51 Franklin Street, Fifth Floor,
++ Boston, MA 02110-1301, USA. */
++
++/* As a special exception, you may create a larger work that contains
++ part or all of the Bison parser skeleton and distribute that work
++ under terms of your choice, so long as that work isn't itself a
++ parser generator using the skeleton or a modified version thereof
++ as a parser skeleton. Alternatively, if you modify or redistribute
++ the parser skeleton itself, you may (at your option) remove this
++ special exception, which will cause the skeleton and the resulting
++ Bison output files to be licensed under the GNU General Public
++ License without this special exception.
++
++ This special exception was added by the Free Software Foundation in
++ version 2.2 of Bison. */
++
++/* C LALR(1) parser skeleton written by Richard Stallman, by
++ simplifying the original so-called "semantic" parser. */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++ infringing on user name space. This should be done even for local
++ variables, as they might otherwise be expanded by user macros.
++ There are some unavoidable exceptions within include files to
++ define necessary library symbols; they are noted "INFRINGES ON
++ USER NAME SPACE" below. */
++
++/* Identify Bison output. */
++#define YYBISON 1
++
++/* Bison version. */
++#define YYBISON_VERSION "2.3"
++
++/* Skeleton name. */
++#define YYSKELETON_NAME "yacc.c"
++
++/* Pure parsers. */
++#define YYPURE 0
++
++/* Using locations. */
++#define YYLSP_NEEDED 1
++
++
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ DT_V1 = 258,
++ DT_MEMRESERVE = 259,
++ DT_PROPNODENAME = 260,
++ DT_LITERAL = 261,
++ DT_LEGACYLITERAL = 262,
++ DT_BASE = 263,
++ DT_BYTE = 264,
++ DT_STRING = 265,
++ DT_LABEL = 266,
++ DT_REF = 267,
++ DT_INCBIN = 268
++ };
++#endif
++/* Tokens. */
++#define DT_V1 258
++#define DT_MEMRESERVE 259
++#define DT_PROPNODENAME 260
++#define DT_LITERAL 261
++#define DT_LEGACYLITERAL 262
++#define DT_BASE 263
++#define DT_BYTE 264
++#define DT_STRING 265
++#define DT_LABEL 266
++#define DT_REF 267
++#define DT_INCBIN 268
++
++
++
++
++/* Copy the first part of user declarations. */
++#line 23 "dtc-parser.y"
++
++#include <stdio.h>
++
++#include "dtc.h"
++#include "srcpos.h"
++
++extern int yylex(void);
++
++extern struct boot_info *the_boot_info;
++extern int treesource_error;
++
++static unsigned long long eval_literal(const char *s, int base, int bits);
++
++
++/* Enabling traces. */
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++/* Enabling verbose error messages. */
++#ifdef YYERROR_VERBOSE
++# undef YYERROR_VERBOSE
++# define YYERROR_VERBOSE 1
++#else
++# define YYERROR_VERBOSE 0
++#endif
++
++/* Enabling the token table. */
++#ifndef YYTOKEN_TABLE
++# define YYTOKEN_TABLE 0
++#endif
++
++#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
++typedef union YYSTYPE
++#line 37 "dtc-parser.y"
++{
++ char *propnodename;
++ char *literal;
++ char *labelref;
++ unsigned int cbase;
++ uint8_t byte;
++ struct data data;
++
++ uint64_t addr;
++ cell_t cell;
++ struct property *prop;
++ struct property *proplist;
++ struct node *node;
++ struct node *nodelist;
++ struct reserve_info *re;
++}
++/* Line 187 of yacc.c. */
++#line 153 "dtc-parser.tab.c"
++ YYSTYPE;
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++
++#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
++typedef struct YYLTYPE
++{
++ int first_line;
++ int first_column;
++ int last_line;
++ int last_column;
++} YYLTYPE;
++# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
++# define YYLTYPE_IS_DECLARED 1
++# define YYLTYPE_IS_TRIVIAL 1
++#endif
++
++
++/* Copy the second part of user declarations. */
++
++
++/* Line 216 of yacc.c. */
++#line 178 "dtc-parser.tab.c"
++
++#ifdef short
++# undef short
++#endif
++
++#ifdef YYTYPE_UINT8
++typedef YYTYPE_UINT8 yytype_uint8;
++#else
++typedef unsigned char yytype_uint8;
++#endif
++
++#ifdef YYTYPE_INT8
++typedef YYTYPE_INT8 yytype_int8;
++#elif (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++typedef signed char yytype_int8;
++#else
++typedef short int yytype_int8;
++#endif
++
++#ifdef YYTYPE_UINT16
++typedef YYTYPE_UINT16 yytype_uint16;
++#else
++typedef unsigned short int yytype_uint16;
++#endif
++
++#ifdef YYTYPE_INT16
++typedef YYTYPE_INT16 yytype_int16;
++#else
++typedef short int yytype_int16;
++#endif
++
++#ifndef YYSIZE_T
++# ifdef __SIZE_TYPE__
++# define YYSIZE_T __SIZE_TYPE__
++# elif defined size_t
++# define YYSIZE_T size_t
++# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# else
++# define YYSIZE_T unsigned int
++# endif
++#endif
++
++#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
++
++#ifndef YY_
++# if YYENABLE_NLS
++# if ENABLE_NLS
++# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
++# define YY_(msgid) dgettext ("bison-runtime", msgid)
++# endif
++# endif
++# ifndef YY_
++# define YY_(msgid) msgid
++# endif
++#endif
++
++/* Suppress unused-variable warnings by "using" E. */
++#if ! defined lint || defined __GNUC__
++# define YYUSE(e) ((void) (e))
++#else
++# define YYUSE(e) /* empty */
++#endif
++
++/* Identity function, used to suppress warnings about constant conditions. */
++#ifndef lint
++# define YYID(n) (n)
++#else
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static int
++YYID (int i)
++#else
++static int
++YYID (i)
++ int i;
++#endif
++{
++ return i;
++}
++#endif
++
++#if ! defined yyoverflow || YYERROR_VERBOSE
++
++/* The parser invokes alloca or malloc; define the necessary symbols. */
++
++# ifdef YYSTACK_USE_ALLOCA
++# if YYSTACK_USE_ALLOCA
++# ifdef __GNUC__
++# define YYSTACK_ALLOC __builtin_alloca
++# elif defined __BUILTIN_VA_ARG_INCR
++# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
++# elif defined _AIX
++# define YYSTACK_ALLOC __alloca
++# elif defined _MSC_VER
++# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
++# define alloca _alloca
++# else
++# define YYSTACK_ALLOC alloca
++# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# ifndef _STDLIB_H
++# define _STDLIB_H 1
++# endif
++# endif
++# endif
++# endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++ /* Pacify GCC's `empty if-body' warning. */
++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
++# ifndef YYSTACK_ALLOC_MAXIMUM
++ /* The OS might guarantee only one guard page at the bottom of the stack,
++ and a page size can be as small as 4096 bytes. So we cannot safely
++ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
++ to allow for a few compiler-allocated temporary stack slots. */
++# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
++# endif
++# else
++# define YYSTACK_ALLOC YYMALLOC
++# define YYSTACK_FREE YYFREE
++# ifndef YYSTACK_ALLOC_MAXIMUM
++# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
++# endif
++# if (defined __cplusplus && ! defined _STDLIB_H \
++ && ! ((defined YYMALLOC || defined malloc) \
++ && (defined YYFREE || defined free)))
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# ifndef _STDLIB_H
++# define _STDLIB_H 1
++# endif
++# endif
++# ifndef YYMALLOC
++# define YYMALLOC malloc
++# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
++# endif
++# endif
++# ifndef YYFREE
++# define YYFREE free
++# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++void free (void *); /* INFRINGES ON USER NAME SPACE */
++# endif
++# endif
++# endif
++#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
++
++
++#if (! defined yyoverflow \
++ && (! defined __cplusplus \
++ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
++ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
++
++/* A type that is properly aligned for any stack member. */
++union yyalloc
++{
++ yytype_int16 yyss;
++ YYSTYPE yyvs;
++ YYLTYPE yyls;
++};
++
++/* The size of the maximum gap between one aligned stack and the next. */
++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++ N elements. */
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
++ + 2 * YYSTACK_GAP_MAXIMUM)
++
++/* Copy COUNT objects from FROM to TO. The source and destination do
++ not overlap. */
++# ifndef YYCOPY
++# if defined __GNUC__ && 1 < __GNUC__
++# define YYCOPY(To, From, Count) \
++ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++# else
++# define YYCOPY(To, From, Count) \
++ do \
++ { \
++ YYSIZE_T yyi; \
++ for (yyi = 0; yyi < (Count); yyi++) \
++ (To)[yyi] = (From)[yyi]; \
++ } \
++ while (YYID (0))
++# endif
++# endif
++
++/* Relocate STACK from its old location to the new one. The
++ local variables YYSIZE and YYSTACKSIZE give the old and new number of
++ elements in the stack, and YYPTR gives the new location of the
++ stack. Advance YYPTR to a properly aligned location for the next
++ stack. */
++# define YYSTACK_RELOCATE(Stack) \
++ do \
++ { \
++ YYSIZE_T yynewbytes; \
++ YYCOPY (&yyptr->Stack, Stack, yysize); \
++ Stack = &yyptr->Stack; \
++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
++ yyptr += yynewbytes / sizeof (*yyptr); \
++ } \
++ while (YYID (0))
++
++#endif
++
++/* YYFINAL -- State number of the termination state. */
++#define YYFINAL 9
++/* YYLAST -- Last index in YYTABLE. */
++#define YYLAST 73
++
++/* YYNTOKENS -- Number of terminals. */
++#define YYNTOKENS 27
++/* YYNNTS -- Number of nonterminals. */
++#define YYNNTS 20
++/* YYNRULES -- Number of rules. */
++#define YYNRULES 45
++/* YYNRULES -- Number of states. */
++#define YYNSTATES 76
++
++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
++#define YYUNDEFTOK 2
++#define YYMAXUTOK 268
++
++#define YYTRANSLATE(YYX) \
++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
++
++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
++static const yytype_uint8 yytranslate[] =
++{
++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 24, 26, 2, 2, 25, 15, 2, 16, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 14,
++ 20, 19, 21, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 22, 2, 23, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 17, 2, 18, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
++ 5, 6, 7, 8, 9, 10, 11, 12, 13
++};
++
++#if YYDEBUG
++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
++ YYRHS. */
++static const yytype_uint8 yyprhs[] =
++{
++ 0, 0, 3, 8, 11, 12, 15, 21, 22, 25,
++ 27, 34, 36, 38, 41, 47, 48, 51, 57, 61,
++ 64, 69, 74, 77, 87, 93, 96, 97, 100, 103,
++ 104, 107, 110, 113, 114, 116, 118, 121, 122, 125,
++ 128, 129, 132, 135, 139, 140
++};
++
++/* YYRHS -- A `-1'-separated list of the rules' RHS. */
++static const yytype_int8 yyrhs[] =
++{
++ 28, 0, -1, 3, 14, 29, 34, -1, 31, 34,
++ -1, -1, 30, 29, -1, 46, 4, 33, 33, 14,
++ -1, -1, 32, 31, -1, 30, -1, 46, 4, 33,
++ 15, 33, 14, -1, 6, -1, 7, -1, 16, 35,
++ -1, 17, 36, 44, 18, 14, -1, -1, 36, 37,
++ -1, 46, 5, 19, 38, 14, -1, 46, 5, 14,
++ -1, 39, 10, -1, 39, 20, 40, 21, -1, 39,
++ 22, 43, 23, -1, 39, 12, -1, 39, 13, 24,
++ 10, 25, 33, 25, 33, 26, -1, 39, 13, 24,
++ 10, 26, -1, 38, 11, -1, -1, 38, 25, -1,
++ 39, 11, -1, -1, 40, 42, -1, 40, 12, -1,
++ 40, 11, -1, -1, 8, -1, 6, -1, 41, 7,
++ -1, -1, 43, 9, -1, 43, 11, -1, -1, 45,
++ 44, -1, 45, 37, -1, 46, 5, 35, -1, -1,
++ 11, -1
++};
++
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const yytype_uint16 yyrline[] =
++{
++ 0, 89, 89, 93, 101, 104, 111, 119, 122, 129,
++ 133, 140, 144, 151, 158, 166, 169, 176, 180, 187,
++ 191, 195, 199, 203, 220, 231, 239, 242, 246, 254,
++ 257, 261, 266, 274, 277, 281, 285, 293, 296, 300,
++ 308, 311, 315, 323, 331, 334
++};
++#endif
++
++#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
++/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
++static const char *const yytname[] =
++{
++ "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
++ "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
++ "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'-'",
++ "'/'", "'{'", "'}'", "'='", "'<'", "'>'", "'['", "']'", "'('", "','",
++ "')'", "$accept", "sourcefile", "memreserves", "memreserve",
++ "v0_memreserves", "v0_memreserve", "addr", "devicetree", "nodedef",
++ "proplist", "propdef", "propdata", "propdataprefix", "celllist",
++ "cellbase", "cellval", "bytestring", "subnodes", "subnode", "label", 0
++};
++#endif
++
++# ifdef YYPRINT
++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
++ token YYLEX-NUM. */
++static const yytype_uint16 yytoknum[] =
++{
++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
++ 265, 266, 267, 268, 59, 45, 47, 123, 125, 61,
++ 60, 62, 91, 93, 40, 44, 41
++};
++# endif
++
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const yytype_uint8 yyr1[] =
++{
++ 0, 27, 28, 28, 29, 29, 30, 31, 31, 32,
++ 32, 33, 33, 34, 35, 36, 36, 37, 37, 38,
++ 38, 38, 38, 38, 38, 38, 39, 39, 39, 40,
++ 40, 40, 40, 41, 41, 42, 42, 43, 43, 43,
++ 44, 44, 44, 45, 46, 46
++};
++
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const yytype_uint8 yyr2[] =
++{
++ 0, 2, 4, 2, 0, 2, 5, 0, 2, 1,
++ 6, 1, 1, 2, 5, 0, 2, 5, 3, 2,
++ 4, 4, 2, 9, 5, 2, 0, 2, 2, 0,
++ 2, 2, 2, 0, 1, 1, 2, 0, 2, 2,
++ 0, 2, 2, 3, 0, 1
++};
++
++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
++ means the default is an error. */
++static const yytype_uint8 yydefact[] =
++{
++ 7, 0, 45, 0, 9, 0, 7, 0, 4, 1,
++ 0, 3, 8, 0, 0, 4, 0, 15, 13, 11,
++ 12, 0, 2, 5, 0, 40, 0, 0, 0, 16,
++ 0, 40, 0, 0, 6, 0, 42, 41, 0, 10,
++ 14, 18, 26, 43, 0, 0, 25, 17, 27, 19,
++ 28, 22, 0, 29, 37, 0, 33, 0, 0, 35,
++ 34, 32, 31, 20, 0, 30, 38, 39, 21, 0,
++ 24, 36, 0, 0, 0, 23
++};
++
++/* YYDEFGOTO[NTERM-NUM]. */
++static const yytype_int8 yydefgoto[] =
++{
++ -1, 3, 14, 4, 5, 6, 27, 11, 18, 25,
++ 29, 44, 45, 56, 64, 65, 57, 30, 31, 7
++};
++
++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
++ STATE-NUM. */
++#define YYPACT_NINF -14
++static const yytype_int8 yypact[] =
++{
++ 30, -11, -14, 7, -14, -1, 27, 13, 27, -14,
++ 8, -14, -14, 40, -1, 27, 35, -14, -14, -14,
++ -14, 21, -14, -14, 40, 24, 40, 28, 40, -14,
++ 32, 24, 46, 38, -14, 39, -14, -14, 26, -14,
++ -14, -14, -14, -14, -9, 10, -14, -14, -14, -14,
++ -14, -14, 31, -14, -14, 44, -2, 3, 23, -14,
++ -14, -14, -14, -14, 50, -14, -14, -14, -14, 40,
++ -14, -14, 33, 40, 36, -14
++};
++
++/* YYPGOTO[NTERM-NUM]. */
++static const yytype_int8 yypgoto[] =
++{
++ -14, -14, 48, 29, 53, -14, -13, 47, 34, -14,
++ 37, -14, -14, -14, -14, -14, -14, 42, -14, -7
++};
++
++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
++ positive, shift that token. If negative, reduce the rule which
++ number is the opposite. If zero, do what YYDEFACT says.
++ If YYTABLE_NINF, syntax error. */
++#define YYTABLE_NINF -45
++static const yytype_int8 yytable[] =
++{
++ 21, 16, 46, 8, 59, 47, 60, 9, 16, 61,
++ 62, 28, 66, 33, 67, 10, 48, 13, 32, 63,
++ 49, 50, 51, 52, 32, 17, 68, 19, 20, -44,
++ 53, -44, 54, 1, -44, 2, 26, 15, 2, 24,
++ 41, 2, 34, 17, 15, 42, 19, 20, 69, 70,
++ 35, 38, 39, 40, 58, 55, 72, 71, 73, 12,
++ 74, 22, 75, 23, 0, 0, 0, 0, 36, 0,
++ 0, 0, 43, 37
++};
++
++static const yytype_int8 yycheck[] =
++{
++ 13, 8, 11, 14, 6, 14, 8, 0, 15, 11,
++ 12, 24, 9, 26, 11, 16, 25, 4, 25, 21,
++ 10, 11, 12, 13, 31, 17, 23, 6, 7, 5,
++ 20, 4, 22, 3, 4, 11, 15, 8, 11, 4,
++ 14, 11, 14, 17, 15, 19, 6, 7, 25, 26,
++ 18, 5, 14, 14, 10, 24, 69, 7, 25, 6,
++ 73, 14, 26, 15, -1, -1, -1, -1, 31, -1,
++ -1, -1, 38, 31
++};
++
++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
++ symbol of state STATE-NUM. */
++static const yytype_uint8 yystos[] =
++{
++ 0, 3, 11, 28, 30, 31, 32, 46, 14, 0,
++ 16, 34, 31, 4, 29, 30, 46, 17, 35, 6,
++ 7, 33, 34, 29, 4, 36, 15, 33, 33, 37,
++ 44, 45, 46, 33, 14, 18, 37, 44, 5, 14,
++ 14, 14, 19, 35, 38, 39, 11, 14, 25, 10,
++ 11, 12, 13, 20, 22, 24, 40, 43, 10, 6,
++ 8, 11, 12, 21, 41, 42, 9, 11, 23, 25,
++ 26, 7, 33, 25, 33, 26
++};
++
++#define yyerrok (yyerrstatus = 0)
++#define yyclearin (yychar = YYEMPTY)
++#define YYEMPTY (-2)
++#define YYEOF 0
++
++#define YYACCEPT goto yyacceptlab
++#define YYABORT goto yyabortlab
++#define YYERROR goto yyerrorlab
++
++
++/* Like YYERROR except do call yyerror. This remains here temporarily
++ to ease the transition to the new meaning of YYERROR, for GCC.
++ Once GCC version 2 has supplanted version 1, this can go. */
++
++#define YYFAIL goto yyerrlab
++
++#define YYRECOVERING() (!!yyerrstatus)
++
++#define YYBACKUP(Token, Value) \
++do \
++ if (yychar == YYEMPTY && yylen == 1) \
++ { \
++ yychar = (Token); \
++ yylval = (Value); \
++ yytoken = YYTRANSLATE (yychar); \
++ YYPOPSTACK (1); \
++ goto yybackup; \
++ } \
++ else \
++ { \
++ yyerror (YY_("syntax error: cannot back up")); \
++ YYERROR; \
++ } \
++while (YYID (0))
++
++
++#define YYTERROR 1
++#define YYERRCODE 256
++
++
++/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
++ If N is 0, then set CURRENT to the empty location which ends
++ the previous symbol: RHS[0] (always defined). */
++
++#define YYRHSLOC(Rhs, K) ((Rhs)[K])
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N) \
++ do \
++ if (YYID (N)) \
++ { \
++ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
++ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
++ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
++ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
++ } \
++ else \
++ { \
++ (Current).first_line = (Current).last_line = \
++ YYRHSLOC (Rhs, 0).last_line; \
++ (Current).first_column = (Current).last_column = \
++ YYRHSLOC (Rhs, 0).last_column; \
++ } \
++ while (YYID (0))
++#endif
++
++
++/* YY_LOCATION_PRINT -- Print the location on the stream.
++ This macro was not mandated originally: define only if we know
++ we won't break user code: when these are the locations we know. */
++
++#ifndef YY_LOCATION_PRINT
++# if YYLTYPE_IS_TRIVIAL
++# define YY_LOCATION_PRINT(File, Loc) \
++ fprintf (File, "%d.%d-%d.%d", \
++ (Loc).first_line, (Loc).first_column, \
++ (Loc).last_line, (Loc).last_column)
++# else
++# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
++# endif
++#endif
++
++
++/* YYLEX -- calling `yylex' with the right arguments. */
++
++#ifdef YYLEX_PARAM
++# define YYLEX yylex (YYLEX_PARAM)
++#else
++# define YYLEX yylex ()
++#endif
++
++/* Enable debugging if requested. */
++#if YYDEBUG
++
++# ifndef YYFPRINTF
++# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++# define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args) \
++do { \
++ if (yydebug) \
++ YYFPRINTF Args; \
++} while (YYID (0))
++
++# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
++do { \
++ if (yydebug) \
++ { \
++ YYFPRINTF (stderr, "%s ", Title); \
++ yy_symbol_print (stderr, \
++ Type, Value, Location); \
++ YYFPRINTF (stderr, "\n"); \
++ } \
++} while (YYID (0))
++
++
++/*--------------------------------.
++| Print this symbol on YYOUTPUT. |
++`--------------------------------*/
++
++/*ARGSUSED*/
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static void
++yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
++#else
++static void
++yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
++ FILE *yyoutput;
++ int yytype;
++ YYSTYPE const * const yyvaluep;
++ YYLTYPE const * const yylocationp;
++#endif
++{
++ if (!yyvaluep)
++ return;
++ YYUSE (yylocationp);
++# ifdef YYPRINT
++ if (yytype < YYNTOKENS)
++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
++# else
++ YYUSE (yyoutput);
++# endif
++ switch (yytype)
++ {
++ default:
++ break;
++ }
++}
++
++
++/*--------------------------------.
++| Print this symbol on YYOUTPUT. |
++`--------------------------------*/
++
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static void
++yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
++#else
++static void
++yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
++ FILE *yyoutput;
++ int yytype;
++ YYSTYPE const * const yyvaluep;
++ YYLTYPE const * const yylocationp;
++#endif
++{
++ if (yytype < YYNTOKENS)
++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
++ else
++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
++
++ YY_LOCATION_PRINT (yyoutput, *yylocationp);
++ YYFPRINTF (yyoutput, ": ");
++ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
++ YYFPRINTF (yyoutput, ")");
++}
++
++/*------------------------------------------------------------------.
++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
++| TOP (included). |
++`------------------------------------------------------------------*/
++
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static void
++yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
++#else
++static void
++yy_stack_print (bottom, top)
++ yytype_int16 *bottom;
++ yytype_int16 *top;
++#endif
++{
++ YYFPRINTF (stderr, "Stack now");
++ for (; bottom <= top; ++bottom)
++ YYFPRINTF (stderr, " %d", *bottom);
++ YYFPRINTF (stderr, "\n");
++}
++
++# define YY_STACK_PRINT(Bottom, Top) \
++do { \
++ if (yydebug) \
++ yy_stack_print ((Bottom), (Top)); \
++} while (YYID (0))
++
++
++/*------------------------------------------------.
++| Report that the YYRULE is going to be reduced. |
++`------------------------------------------------*/
++
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static void
++yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
++#else
++static void
++yy_reduce_print (yyvsp, yylsp, yyrule)
++ YYSTYPE *yyvsp;
++ YYLTYPE *yylsp;
++ int yyrule;
++#endif
++{
++ int yynrhs = yyr2[yyrule];
++ int yyi;
++ unsigned long int yylno = yyrline[yyrule];
++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
++ yyrule - 1, yylno);
++ /* The symbols being reduced. */
++ for (yyi = 0; yyi < yynrhs; yyi++)
++ {
++ fprintf (stderr, " $%d = ", yyi + 1);
++ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
++ &(yyvsp[(yyi + 1) - (yynrhs)])
++ , &(yylsp[(yyi + 1) - (yynrhs)]) );
++ fprintf (stderr, "\n");
++ }
++}
++
++# define YY_REDUCE_PRINT(Rule) \
++do { \
++ if (yydebug) \
++ yy_reduce_print (yyvsp, yylsp, Rule); \
++} while (YYID (0))
++
++/* Nonzero means print parse trace. It is left uninitialized so that
++ multiple parsers can coexist. */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
++# define YY_STACK_PRINT(Bottom, Top)
++# define YY_REDUCE_PRINT(Rule)
++#endif /* !YYDEBUG */
++
++
++/* YYINITDEPTH -- initial size of the parser's stacks. */
++#ifndef YYINITDEPTH
++# define YYINITDEPTH 200
++#endif
++
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++ if the built-in stack extension method is used).
++
++ Do not make this value too large; the results are undefined if
++ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
++ evaluated with infinite-precision integer arithmetic. */
++
++#ifndef YYMAXDEPTH
++# define YYMAXDEPTH 10000
++#endif
++
++
++
++#if YYERROR_VERBOSE
++
++# ifndef yystrlen
++# if defined __GLIBC__ && defined _STRING_H
++# define yystrlen strlen
++# else
++/* Return the length of YYSTR. */
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static YYSIZE_T
++yystrlen (const char *yystr)
++#else
++static YYSIZE_T
++yystrlen (yystr)
++ const char *yystr;
++#endif
++{
++ YYSIZE_T yylen;
++ for (yylen = 0; yystr[yylen]; yylen++)
++ continue;
++ return yylen;
++}
++# endif
++# endif
++
++# ifndef yystpcpy
++# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
++# define yystpcpy stpcpy
++# else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++ YYDEST. */
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static char *
++yystpcpy (char *yydest, const char *yysrc)
++#else
++static char *
++yystpcpy (yydest, yysrc)
++ char *yydest;
++ const char *yysrc;
++#endif
++{
++ char *yyd = yydest;
++ const char *yys = yysrc;
++
++ while ((*yyd++ = *yys++) != '\0')
++ continue;
++
++ return yyd - 1;
++}
++# endif
++# endif
++
++# ifndef yytnamerr
++/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
++ quotes and backslashes, so that it's suitable for yyerror. The
++ heuristic is that double-quoting is unnecessary unless the string
++ contains an apostrophe, a comma, or backslash (other than
++ backslash-backslash). YYSTR is taken from yytname. If YYRES is
++ null, do not copy; instead, return the length of what the result
++ would have been. */
++static YYSIZE_T
++yytnamerr (char *yyres, const char *yystr)
++{
++ if (*yystr == '"')
++ {
++ YYSIZE_T yyn = 0;
++ char const *yyp = yystr;
++
++ for (;;)
++ switch (*++yyp)
++ {
++ case '\'':
++ case ',':
++ goto do_not_strip_quotes;
++
++ case '\\':
++ if (*++yyp != '\\')
++ goto do_not_strip_quotes;
++ /* Fall through. */
++ default:
++ if (yyres)
++ yyres[yyn] = *yyp;
++ yyn++;
++ break;
++
++ case '"':
++ if (yyres)
++ yyres[yyn] = '\0';
++ return yyn;
++ }
++ do_not_strip_quotes: ;
++ }
++
++ if (! yyres)
++ return yystrlen (yystr);
++
++ return yystpcpy (yyres, yystr) - yyres;
++}
++# endif
++
++/* Copy into YYRESULT an error message about the unexpected token
++ YYCHAR while in state YYSTATE. Return the number of bytes copied,
++ including the terminating null byte. If YYRESULT is null, do not
++ copy anything; just return the number of bytes that would be
++ copied. As a special case, return 0 if an ordinary "syntax error"
++ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
++ size calculation. */
++static YYSIZE_T
++yysyntax_error (char *yyresult, int yystate, int yychar)
++{
++ int yyn = yypact[yystate];
++
++ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
++ return 0;
++ else
++ {
++ int yytype = YYTRANSLATE (yychar);
++ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
++ YYSIZE_T yysize = yysize0;
++ YYSIZE_T yysize1;
++ int yysize_overflow = 0;
++ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
++ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
++ int yyx;
++
++# if 0
++ /* This is so xgettext sees the translatable formats that are
++ constructed on the fly. */
++ YY_("syntax error, unexpected %s");
++ YY_("syntax error, unexpected %s, expecting %s");
++ YY_("syntax error, unexpected %s, expecting %s or %s");
++ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
++ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
++# endif
++ char *yyfmt;
++ char const *yyf;
++ static char const yyunexpected[] = "syntax error, unexpected %s";
++ static char const yyexpecting[] = ", expecting %s";
++ static char const yyor[] = " or %s";
++ char yyformat[sizeof yyunexpected
++ + sizeof yyexpecting - 1
++ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
++ * (sizeof yyor - 1))];
++ char const *yyprefix = yyexpecting;
++
++ /* Start YYX at -YYN if negative to avoid negative indexes in
++ YYCHECK. */
++ int yyxbegin = yyn < 0 ? -yyn : 0;
++
++ /* Stay within bounds of both yycheck and yytname. */
++ int yychecklim = YYLAST - yyn + 1;
++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
++ int yycount = 1;
++
++ yyarg[0] = yytname[yytype];
++ yyfmt = yystpcpy (yyformat, yyunexpected);
++
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
++ {
++ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
++ {
++ yycount = 1;
++ yysize = yysize0;
++ yyformat[sizeof yyunexpected - 1] = '\0';
++ break;
++ }
++ yyarg[yycount++] = yytname[yyx];
++ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
++ yysize_overflow |= (yysize1 < yysize);
++ yysize = yysize1;
++ yyfmt = yystpcpy (yyfmt, yyprefix);
++ yyprefix = yyor;
++ }
++
++ yyf = YY_(yyformat);
++ yysize1 = yysize + yystrlen (yyf);
++ yysize_overflow |= (yysize1 < yysize);
++ yysize = yysize1;
++
++ if (yysize_overflow)
++ return YYSIZE_MAXIMUM;
++
++ if (yyresult)
++ {
++ /* Avoid sprintf, as that infringes on the user's name space.
++ Don't have undefined behavior even if the translation
++ produced a string with the wrong number of "%s"s. */
++ char *yyp = yyresult;
++ int yyi = 0;
++ while ((*yyp = *yyf) != '\0')
++ {
++ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
++ {
++ yyp += yytnamerr (yyp, yyarg[yyi++]);
++ yyf += 2;
++ }
++ else
++ {
++ yyp++;
++ yyf++;
++ }
++ }
++ }
++ return yysize;
++ }
++}
++#endif /* YYERROR_VERBOSE */
++
++
++/*-----------------------------------------------.
++| Release the memory associated to this symbol. |
++`-----------------------------------------------*/
++
++/*ARGSUSED*/
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++static void
++yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
++#else
++static void
++yydestruct (yymsg, yytype, yyvaluep, yylocationp)
++ const char *yymsg;
++ int yytype;
++ YYSTYPE *yyvaluep;
++ YYLTYPE *yylocationp;
++#endif
++{
++ YYUSE (yyvaluep);
++ YYUSE (yylocationp);
++
++ if (!yymsg)
++ yymsg = "Deleting";
++ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
++
++ switch (yytype)
++ {
++
++ default:
++ break;
++ }
++}
++
++
++/* Prevent warnings from -Wmissing-prototypes. */
++
++#ifdef YYPARSE_PARAM
++#if defined __STDC__ || defined __cplusplus
++int yyparse (void *YYPARSE_PARAM);
++#else
++int yyparse ();
++#endif
++#else /* ! YYPARSE_PARAM */
++#if defined __STDC__ || defined __cplusplus
++int yyparse (void);
++#else
++int yyparse ();
++#endif
++#endif /* ! YYPARSE_PARAM */
++
++
++
++/* The look-ahead symbol. */
++int yychar;
++
++/* The semantic value of the look-ahead symbol. */
++YYSTYPE yylval;
++
++/* Number of syntax errors so far. */
++int yynerrs;
++/* Location data for the look-ahead symbol. */
++YYLTYPE yylloc;
++
++
++
++/*----------.
++| yyparse. |
++`----------*/
++
++#ifdef YYPARSE_PARAM
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++int
++yyparse (void *YYPARSE_PARAM)
++#else
++int
++yyparse (YYPARSE_PARAM)
++ void *YYPARSE_PARAM;
++#endif
++#else /* ! YYPARSE_PARAM */
++#if (defined __STDC__ || defined __C99__FUNC__ \
++ || defined __cplusplus || defined _MSC_VER)
++int
++yyparse (void)
++#else
++int
++yyparse ()
++
++#endif
++#endif
++{
++
++ int yystate;
++ int yyn;
++ int yyresult;
++ /* Number of tokens to shift before error messages enabled. */
++ int yyerrstatus;
++ /* Look-ahead token as an internal (translated) token number. */
++ int yytoken = 0;
++#if YYERROR_VERBOSE
++ /* Buffer for error messages, and its allocated size. */
++ char yymsgbuf[128];
++ char *yymsg = yymsgbuf;
++ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
++#endif
++
++ /* Three stacks and their tools:
++ `yyss': related to states,
++ `yyvs': related to semantic values,
++ `yyls': related to locations.
++
++ Refer to the stacks thru separate pointers, to allow yyoverflow
++ to reallocate them elsewhere. */
++
++ /* The state stack. */
++ yytype_int16 yyssa[YYINITDEPTH];
++ yytype_int16 *yyss = yyssa;
++ yytype_int16 *yyssp;
++
++ /* The semantic value stack. */
++ YYSTYPE yyvsa[YYINITDEPTH];
++ YYSTYPE *yyvs = yyvsa;
++ YYSTYPE *yyvsp;
++
++ /* The location stack. */
++ YYLTYPE yylsa[YYINITDEPTH];
++ YYLTYPE *yyls = yylsa;
++ YYLTYPE *yylsp;
++ /* The locations where the error started and ended. */
++ YYLTYPE yyerror_range[2];
++
++#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
++
++ YYSIZE_T yystacksize = YYINITDEPTH;
++
++ /* The variables used to return semantic value and location from the
++ action routines. */
++ YYSTYPE yyval;
++ YYLTYPE yyloc;
++
++ /* The number of symbols on the RHS of the reduced rule.
++ Keep to zero when no symbol should be popped. */
++ int yylen = 0;
++
++ YYDPRINTF ((stderr, "Starting parse\n"));
++
++ yystate = 0;
++ yyerrstatus = 0;
++ yynerrs = 0;
++ yychar = YYEMPTY; /* Cause a token to be read. */
++
++ /* Initialize stack pointers.
++ Waste one element of value and location stack
++ so that they stay on the same level as the state stack.
++ The wasted elements are never initialized. */
++
++ yyssp = yyss;
++ yyvsp = yyvs;
++ yylsp = yyls;
++#if YYLTYPE_IS_TRIVIAL
++ /* Initialize the default location before parsing starts. */
++ yylloc.first_line = yylloc.last_line = 1;
++ yylloc.first_column = yylloc.last_column = 0;
++#endif
++
++ goto yysetstate;
++
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate. |
++`------------------------------------------------------------*/
++ yynewstate:
++ /* In all cases, when you get here, the value and location stacks
++ have just been pushed. So pushing a state here evens the stacks. */
++ yyssp++;
++
++ yysetstate:
++ *yyssp = yystate;
++
++ if (yyss + yystacksize - 1 <= yyssp)
++ {
++ /* Get the current used size of the three stacks, in elements. */
++ YYSIZE_T yysize = yyssp - yyss + 1;
++
++#ifdef yyoverflow
++ {
++ /* Give user a chance to reallocate the stack. Use copies of
++ these so that the &'s don't force the real ones into
++ memory. */
++ YYSTYPE *yyvs1 = yyvs;
++ yytype_int16 *yyss1 = yyss;
++ YYLTYPE *yyls1 = yyls;
++
++ /* Each stack pointer address is followed by the size of the
++ data in use in that stack, in bytes. This used to be a
++ conditional around just the two extra args, but that might
++ be undefined if yyoverflow is a macro. */
++ yyoverflow (YY_("memory exhausted"),
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++ &yyls1, yysize * sizeof (*yylsp),
++ &yystacksize);
++ yyls = yyls1;
++ yyss = yyss1;
++ yyvs = yyvs1;
++ }
++#else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++ goto yyexhaustedlab;
++# else
++ /* Extend the stack our own way. */
++ if (YYMAXDEPTH <= yystacksize)
++ goto yyexhaustedlab;
++ yystacksize *= 2;
++ if (YYMAXDEPTH < yystacksize)
++ yystacksize = YYMAXDEPTH;
++
++ {
++ yytype_int16 *yyss1 = yyss;
++ union yyalloc *yyptr =
++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++ if (! yyptr)
++ goto yyexhaustedlab;
++ YYSTACK_RELOCATE (yyss);
++ YYSTACK_RELOCATE (yyvs);
++ YYSTACK_RELOCATE (yyls);
++# undef YYSTACK_RELOCATE
++ if (yyss1 != yyssa)
++ YYSTACK_FREE (yyss1);
++ }
++# endif
++#endif /* no yyoverflow */
++
++ yyssp = yyss + yysize - 1;
++ yyvsp = yyvs + yysize - 1;
++ yylsp = yyls + yysize - 1;
++
++ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++ (unsigned long int) yystacksize));
++
++ if (yyss + yystacksize - 1 <= yyssp)
++ YYABORT;
++ }
++
++ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
++
++ goto yybackup;
++
++/*-----------.
++| yybackup. |
++`-----------*/
++yybackup:
++
++ /* Do appropriate processing given the current state. Read a
++ look-ahead token if we need one and don't already have one. */
++
++ /* First try to decide what to do without reference to look-ahead token. */
++ yyn = yypact[yystate];
++ if (yyn == YYPACT_NINF)
++ goto yydefault;
++
++ /* Not known => get a look-ahead token if don't already have one. */
++
++ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
++ if (yychar == YYEMPTY)
++ {
++ YYDPRINTF ((stderr, "Reading a token: "));
++ yychar = YYLEX;
++ }
++
++ if (yychar <= YYEOF)
++ {
++ yychar = yytoken = YYEOF;
++ YYDPRINTF ((stderr, "Now at end of input.\n"));
++ }
++ else
++ {
++ yytoken = YYTRANSLATE (yychar);
++ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
++ }
++
++ /* If the proper action on seeing token YYTOKEN is to reduce or to
++ detect an error, take that action. */
++ yyn += yytoken;
++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
++ goto yydefault;
++ yyn = yytable[yyn];
++ if (yyn <= 0)
++ {
++ if (yyn == 0 || yyn == YYTABLE_NINF)
++ goto yyerrlab;
++ yyn = -yyn;
++ goto yyreduce;
++ }
++
++ if (yyn == YYFINAL)
++ YYACCEPT;
++
++ /* Count tokens shifted since error; after three, turn off error
++ status. */
++ if (yyerrstatus)
++ yyerrstatus--;
++
++ /* Shift the look-ahead token. */
++ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
++
++ /* Discard the shifted token unless it is eof. */
++ if (yychar != YYEOF)
++ yychar = YYEMPTY;
++
++ yystate = yyn;
++ *++yyvsp = yylval;
++ *++yylsp = yylloc;
++ goto yynewstate;
++
++
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state. |
++`-----------------------------------------------------------*/
++yydefault:
++ yyn = yydefact[yystate];
++ if (yyn == 0)
++ goto yyerrlab;
++ goto yyreduce;
++
++
++/*-----------------------------.
++| yyreduce -- Do a reduction. |
++`-----------------------------*/
++yyreduce:
++ /* yyn is the number of a rule to reduce with. */
++ yylen = yyr2[yyn];
++
++ /* If YYLEN is nonzero, implement the default value of the action:
++ `$$ = $1'.
++
++ Otherwise, the following line sets YYVAL to garbage.
++ This behavior is undocumented and Bison
++ users should not rely upon it. Assigning to YYVAL
++ unconditionally makes the parser a bit smaller, and it avoids a
++ GCC warning that YYVAL may be used uninitialized. */
++ yyval = yyvsp[1-yylen];
++
++ /* Default location. */
++ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
++ YY_REDUCE_PRINT (yyn);
++ switch (yyn)
++ {
++ case 2:
++#line 90 "dtc-parser.y"
++ {
++ the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), 0);
++ ;}
++ break;
++
++ case 3:
++#line 94 "dtc-parser.y"
++ {
++ the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node), 0);
++ ;}
++ break;
++
++ case 4:
++#line 101 "dtc-parser.y"
++ {
++ (yyval.re) = NULL;
++ ;}
++ break;
++
++ case 5:
++#line 105 "dtc-parser.y"
++ {
++ (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
++ ;}
++ break;
++
++ case 6:
++#line 112 "dtc-parser.y"
++ {
++ (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
++ ;}
++ break;
++
++ case 7:
++#line 119 "dtc-parser.y"
++ {
++ (yyval.re) = NULL;
++ ;}
++ break;
++
++ case 8:
++#line 123 "dtc-parser.y"
++ {
++ (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
++ ;}
++ break;
++
++ case 9:
++#line 130 "dtc-parser.y"
++ {
++ (yyval.re) = (yyvsp[(1) - (1)].re);
++ ;}
++ break;
++
++ case 10:
++#line 134 "dtc-parser.y"
++ {
++ (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
++ ;}
++ break;
++
++ case 11:
++#line 141 "dtc-parser.y"
++ {
++ (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
++ ;}
++ break;
++
++ case 12:
++#line 145 "dtc-parser.y"
++ {
++ (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
++ ;}
++ break;
++
++ case 13:
++#line 152 "dtc-parser.y"
++ {
++ (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
++ ;}
++ break;
++
++ case 14:
++#line 159 "dtc-parser.y"
++ {
++ (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
++ ;}
++ break;
++
++ case 15:
++#line 166 "dtc-parser.y"
++ {
++ (yyval.proplist) = NULL;
++ ;}
++ break;
++
++ case 16:
++#line 170 "dtc-parser.y"
++ {
++ (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
++ ;}
++ break;
++
++ case 17:
++#line 177 "dtc-parser.y"
++ {
++ (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
++ ;}
++ break;
++
++ case 18:
++#line 181 "dtc-parser.y"
++ {
++ (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
++ ;}
++ break;
++
++ case 19:
++#line 188 "dtc-parser.y"
++ {
++ (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
++ ;}
++ break;
++
++ case 20:
++#line 192 "dtc-parser.y"
++ {
++ (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
++ ;}
++ break;
++
++ case 21:
++#line 196 "dtc-parser.y"
++ {
++ (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
++ ;}
++ break;
++
++ case 22:
++#line 200 "dtc-parser.y"
++ {
++ (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
++ ;}
++ break;
++
++ case 23:
++#line 204 "dtc-parser.y"
++ {
++ struct search_path path = { srcpos_file->dir, NULL, NULL };
++ struct dtc_file *file = dtc_open_file((yyvsp[(4) - (9)].data).val, &path);
++ struct data d = empty_data;
++
++ if ((yyvsp[(6) - (9)].addr) != 0)
++ if (fseek(file->file, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
++ yyerrorf("Couldn't seek to offset %llu in \"%s\": %s",
++ (unsigned long long)(yyvsp[(6) - (9)].addr),
++ (yyvsp[(4) - (9)].data).val, strerror(errno));
++
++ d = data_copy_file(file->file, (yyvsp[(8) - (9)].addr));
++
++ (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
++ dtc_close_file(file);
++ ;}
++ break;
++
++ case 24:
++#line 221 "dtc-parser.y"
++ {
++ struct search_path path = { srcpos_file->dir, NULL, NULL };
++ struct dtc_file *file = dtc_open_file((yyvsp[(4) - (5)].data).val, &path);
++ struct data d = empty_data;
++
++ d = data_copy_file(file->file, -1);
++
++ (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
++ dtc_close_file(file);
++ ;}
++ break;
++
++ case 25:
++#line 232 "dtc-parser.y"
++ {
++ (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
++ ;}
++ break;
++
++ case 26:
++#line 239 "dtc-parser.y"
++ {
++ (yyval.data) = empty_data;
++ ;}
++ break;
++
++ case 27:
++#line 243 "dtc-parser.y"
++ {
++ (yyval.data) = (yyvsp[(1) - (2)].data);
++ ;}
++ break;
++
++ case 28:
++#line 247 "dtc-parser.y"
++ {
++ (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
++ ;}
++ break;
++
++ case 29:
++#line 254 "dtc-parser.y"
++ {
++ (yyval.data) = empty_data;
++ ;}
++ break;
++
++ case 30:
++#line 258 "dtc-parser.y"
++ {
++ (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
++ ;}
++ break;
++
++ case 31:
++#line 262 "dtc-parser.y"
++ {
++ (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
++ (yyvsp[(2) - (2)].labelref)), -1);
++ ;}
++ break;
++
++ case 32:
++#line 267 "dtc-parser.y"
++ {
++ (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
++ ;}
++ break;
++
++ case 33:
++#line 274 "dtc-parser.y"
++ {
++ (yyval.cbase) = 16;
++ ;}
++ break;
++
++ case 35:
++#line 282 "dtc-parser.y"
++ {
++ (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
++ ;}
++ break;
++
++ case 36:
++#line 286 "dtc-parser.y"
++ {
++ (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
++ ;}
++ break;
++
++ case 37:
++#line 293 "dtc-parser.y"
++ {
++ (yyval.data) = empty_data;
++ ;}
++ break;
++
++ case 38:
++#line 297 "dtc-parser.y"
++ {
++ (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
++ ;}
++ break;
++
++ case 39:
++#line 301 "dtc-parser.y"
++ {
++ (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
++ ;}
++ break;
++
++ case 40:
++#line 308 "dtc-parser.y"
++ {
++ (yyval.nodelist) = NULL;
++ ;}
++ break;
++
++ case 41:
++#line 312 "dtc-parser.y"
++ {
++ (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
++ ;}
++ break;
++
++ case 42:
++#line 316 "dtc-parser.y"
++ {
++ yyerror("syntax error: properties must precede subnodes");
++ YYERROR;
++ ;}
++ break;
++
++ case 43:
++#line 324 "dtc-parser.y"
++ {
++ (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
++ ;}
++ break;
++
++ case 44:
++#line 331 "dtc-parser.y"
++ {
++ (yyval.labelref) = NULL;
++ ;}
++ break;
++
++ case 45:
++#line 335 "dtc-parser.y"
++ {
++ (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
++ ;}
++ break;
++
++
++/* Line 1267 of yacc.c. */
++#line 1780 "dtc-parser.tab.c"
++ default: break;
++ }
++ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
++
++ YYPOPSTACK (yylen);
++ yylen = 0;
++ YY_STACK_PRINT (yyss, yyssp);
++
++ *++yyvsp = yyval;
++ *++yylsp = yyloc;
++
++ /* Now `shift' the result of the reduction. Determine what state
++ that goes to, based on the state we popped back to and the rule
++ number reduced by. */
++
++ yyn = yyr1[yyn];
++
++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++ yystate = yytable[yystate];
++ else
++ yystate = yydefgoto[yyn - YYNTOKENS];
++
++ goto yynewstate;
++
++
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++ /* If not already recovering from an error, report this error. */
++ if (!yyerrstatus)
++ {
++ ++yynerrs;
++#if ! YYERROR_VERBOSE
++ yyerror (YY_("syntax error"));
++#else
++ {
++ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
++ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
++ {
++ YYSIZE_T yyalloc = 2 * yysize;
++ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
++ yyalloc = YYSTACK_ALLOC_MAXIMUM;
++ if (yymsg != yymsgbuf)
++ YYSTACK_FREE (yymsg);
++ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
++ if (yymsg)
++ yymsg_alloc = yyalloc;
++ else
++ {
++ yymsg = yymsgbuf;
++ yymsg_alloc = sizeof yymsgbuf;
++ }
++ }
++
++ if (0 < yysize && yysize <= yymsg_alloc)
++ {
++ (void) yysyntax_error (yymsg, yystate, yychar);
++ yyerror (yymsg);
++ }
++ else
++ {
++ yyerror (YY_("syntax error"));
++ if (yysize != 0)
++ goto yyexhaustedlab;
++ }
++ }
++#endif
++ }
++
++ yyerror_range[0] = yylloc;
++
++ if (yyerrstatus == 3)
++ {
++ /* If just tried and failed to reuse look-ahead token after an
++ error, discard it. */
++
++ if (yychar <= YYEOF)
++ {
++ /* Return failure if at end of input. */
++ if (yychar == YYEOF)
++ YYABORT;
++ }
++ else
++ {
++ yydestruct ("Error: discarding",
++ yytoken, &yylval, &yylloc);
++ yychar = YYEMPTY;
++ }
++ }
++
++ /* Else will try to reuse look-ahead token after shifting the error
++ token. */
++ goto yyerrlab1;
++
++
++/*---------------------------------------------------.
++| yyerrorlab -- error raised explicitly by YYERROR. |
++`---------------------------------------------------*/
++yyerrorlab:
++
++ /* Pacify compilers like GCC when the user code never invokes
++ YYERROR and the label yyerrorlab therefore never appears in user
++ code. */
++ if (/*CONSTCOND*/ 0)
++ goto yyerrorlab;
++
++ yyerror_range[0] = yylsp[1-yylen];
++ /* Do not reclaim the symbols of the rule which action triggered
++ this YYERROR. */
++ YYPOPSTACK (yylen);
++ yylen = 0;
++ YY_STACK_PRINT (yyss, yyssp);
++ yystate = *yyssp;
++ goto yyerrlab1;
++
++
++/*-------------------------------------------------------------.
++| yyerrlab1 -- common code for both syntax error and YYERROR. |
++`-------------------------------------------------------------*/
++yyerrlab1:
++ yyerrstatus = 3; /* Each real token shifted decrements this. */
++
++ for (;;)
++ {
++ yyn = yypact[yystate];
++ if (yyn != YYPACT_NINF)
++ {
++ yyn += YYTERROR;
++ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
++ {
++ yyn = yytable[yyn];
++ if (0 < yyn)
++ break;
++ }
++ }
++
++ /* Pop the current state because it cannot handle the error token. */
++ if (yyssp == yyss)
++ YYABORT;
++
++ yyerror_range[0] = *yylsp;
++ yydestruct ("Error: popping",
++ yystos[yystate], yyvsp, yylsp);
++ YYPOPSTACK (1);
++ yystate = *yyssp;
++ YY_STACK_PRINT (yyss, yyssp);
++ }
++
++ if (yyn == YYFINAL)
++ YYACCEPT;
++
++ *++yyvsp = yylval;
++
++ yyerror_range[1] = yylloc;
++ /* Using YYLLOC is tempting, but would change the location of
++ the look-ahead. YYLOC is available though. */
++ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
++ *++yylsp = yyloc;
++
++ /* Shift the error token. */
++ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
++
++ yystate = yyn;
++ goto yynewstate;
++
++
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here. |
++`-------------------------------------*/
++yyacceptlab:
++ yyresult = 0;
++ goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here. |
++`-----------------------------------*/
++yyabortlab:
++ yyresult = 1;
++ goto yyreturn;
++
++#ifndef yyoverflow
++/*-------------------------------------------------.
++| yyexhaustedlab -- memory exhaustion comes here. |
++`-------------------------------------------------*/
++yyexhaustedlab:
++ yyerror (YY_("memory exhausted"));
++ yyresult = 2;
++ /* Fall through. */
++#endif
++
++yyreturn:
++ if (yychar != YYEOF && yychar != YYEMPTY)
++ yydestruct ("Cleanup: discarding lookahead",
++ yytoken, &yylval, &yylloc);
++ /* Do not reclaim the symbols of the rule which action triggered
++ this YYABORT or YYACCEPT. */
++ YYPOPSTACK (yylen);
++ YY_STACK_PRINT (yyss, yyssp);
++ while (yyssp != yyss)
++ {
++ yydestruct ("Cleanup: popping",
++ yystos[*yyssp], yyvsp, yylsp);
++ YYPOPSTACK (1);
++ }
++#ifndef yyoverflow
++ if (yyss != yyssa)
++ YYSTACK_FREE (yyss);
++#endif
++#if YYERROR_VERBOSE
++ if (yymsg != yymsgbuf)
++ YYSTACK_FREE (yymsg);
++#endif
++ /* Make sure YYID is used. */
++ return YYID (yyresult);
++}
++
++
++#line 340 "dtc-parser.y"
++
++
++void yyerrorf(char const *s, ...)
++{
++ const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
++ va_list va;
++ va_start(va, s);
++
++ if (strcmp(fname, "-") == 0)
++ fname = "stdin";
++
++ fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
++ vfprintf(stderr, s, va);
++ fprintf(stderr, "\n");
++
++ treesource_error = 1;
++ va_end(va);
++}
++
++void yyerror (char const *s)
++{
++ yyerrorf("%s", s);
++}
++
++static unsigned long long eval_literal(const char *s, int base, int bits)
++{
++ unsigned long long val;
++ char *e;
++
++ errno = 0;
++ val = strtoull(s, &e, base);
++ if (*e)
++ yyerror("bad characters in literal");
++ else if ((errno == ERANGE)
++ || ((bits < 64) && (val >= (1ULL << bits))))
++ yyerror("literal out of range");
++ else if (errno != 0)
++ yyerror("bad literal");
++ return val;
++}
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc-parser.tab.h_shipped linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.tab.h_shipped
+--- linux-2.6.30-rc4/scripts/dtc/dtc-parser.tab.h_shipped 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.tab.h_shipped 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,113 @@
++/* A Bison parser, made by GNU Bison 2.3. */
++
++/* Skeleton interface for Bison's Yacc-like parsers in C
++
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
++ Free Software Foundation, Inc.
++
++ 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, Inc., 51 Franklin Street, Fifth Floor,
++ Boston, MA 02110-1301, USA. */
++
++/* As a special exception, you may create a larger work that contains
++ part or all of the Bison parser skeleton and distribute that work
++ under terms of your choice, so long as that work isn't itself a
++ parser generator using the skeleton or a modified version thereof
++ as a parser skeleton. Alternatively, if you modify or redistribute
++ the parser skeleton itself, you may (at your option) remove this
++ special exception, which will cause the skeleton and the resulting
++ Bison output files to be licensed under the GNU General Public
++ License without this special exception.
++
++ This special exception was added by the Free Software Foundation in
++ version 2.2 of Bison. */
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ DT_V1 = 258,
++ DT_MEMRESERVE = 259,
++ DT_PROPNODENAME = 260,
++ DT_LITERAL = 261,
++ DT_LEGACYLITERAL = 262,
++ DT_BASE = 263,
++ DT_BYTE = 264,
++ DT_STRING = 265,
++ DT_LABEL = 266,
++ DT_REF = 267,
++ DT_INCBIN = 268
++ };
++#endif
++/* Tokens. */
++#define DT_V1 258
++#define DT_MEMRESERVE 259
++#define DT_PROPNODENAME 260
++#define DT_LITERAL 261
++#define DT_LEGACYLITERAL 262
++#define DT_BASE 263
++#define DT_BYTE 264
++#define DT_STRING 265
++#define DT_LABEL 266
++#define DT_REF 267
++#define DT_INCBIN 268
++
++
++
++
++#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
++typedef union YYSTYPE
++#line 37 "dtc-parser.y"
++{
++ char *propnodename;
++ char *literal;
++ char *labelref;
++ unsigned int cbase;
++ uint8_t byte;
++ struct data data;
++
++ uint64_t addr;
++ cell_t cell;
++ struct property *prop;
++ struct property *proplist;
++ struct node *node;
++ struct node *nodelist;
++ struct reserve_info *re;
++}
++/* Line 1489 of yacc.c. */
++#line 92 "dtc-parser.tab.h"
++ YYSTYPE;
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++
++extern YYSTYPE yylval;
++
++#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
++typedef struct YYLTYPE
++{
++ int first_line;
++ int first_column;
++ int last_line;
++ int last_column;
++} YYLTYPE;
++# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
++# define YYLTYPE_IS_DECLARED 1
++# define YYLTYPE_IS_TRIVIAL 1
++#endif
++
++extern YYLTYPE yylloc;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/dtc-parser.y linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.y
+--- linux-2.6.30-rc4/scripts/dtc/dtc-parser.y 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/dtc-parser.y 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,379 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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
++ */
++
++%locations
++
++%{
++#include <stdio.h>
++
++#include "dtc.h"
++#include "srcpos.h"
++
++extern int yylex(void);
++
++extern struct boot_info *the_boot_info;
++extern int treesource_error;
++
++static unsigned long long eval_literal(const char *s, int base, int bits);
++%}
++
++%union {
++ char *propnodename;
++ char *literal;
++ char *labelref;
++ unsigned int cbase;
++ uint8_t byte;
++ struct data data;
++
++ uint64_t addr;
++ cell_t cell;
++ struct property *prop;
++ struct property *proplist;
++ struct node *node;
++ struct node *nodelist;
++ struct reserve_info *re;
++}
++
++%token DT_V1
++%token DT_MEMRESERVE
++%token <propnodename> DT_PROPNODENAME
++%token <literal> DT_LITERAL
++%token <literal> DT_LEGACYLITERAL
++%token <cbase> DT_BASE
++%token <byte> DT_BYTE
++%token <data> DT_STRING
++%token <labelref> DT_LABEL
++%token <labelref> DT_REF
++%token DT_INCBIN
++
++%type <data> propdata
++%type <data> propdataprefix
++%type <re> memreserve
++%type <re> memreserves
++%type <re> v0_memreserve
++%type <re> v0_memreserves
++%type <addr> addr
++%type <data> celllist
++%type <cbase> cellbase
++%type <cell> cellval
++%type <data> bytestring
++%type <prop> propdef
++%type <proplist> proplist
++
++%type <node> devicetree
++%type <node> nodedef
++%type <node> subnode
++%type <nodelist> subnodes
++%type <labelref> label
++
++%%
++
++sourcefile:
++ DT_V1 ';' memreserves devicetree
++ {
++ the_boot_info = build_boot_info($3, $4, 0);
++ }
++ | v0_memreserves devicetree
++ {
++ the_boot_info = build_boot_info($1, $2, 0);
++ }
++ ;
++
++memreserves:
++ /* empty */
++ {
++ $$ = NULL;
++ }
++ | memreserve memreserves
++ {
++ $$ = chain_reserve_entry($1, $2);
++ }
++ ;
++
++memreserve:
++ label DT_MEMRESERVE addr addr ';'
++ {
++ $$ = build_reserve_entry($3, $4, $1);
++ }
++ ;
++
++v0_memreserves:
++ /* empty */
++ {
++ $$ = NULL;
++ }
++ | v0_memreserve v0_memreserves
++ {
++ $$ = chain_reserve_entry($1, $2);
++ };
++ ;
++
++v0_memreserve:
++ memreserve
++ {
++ $$ = $1;
++ }
++ | label DT_MEMRESERVE addr '-' addr ';'
++ {
++ $$ = build_reserve_entry($3, $5 - $3 + 1, $1);
++ }
++ ;
++
++addr:
++ DT_LITERAL
++ {
++ $$ = eval_literal($1, 0, 64);
++ }
++ | DT_LEGACYLITERAL
++ {
++ $$ = eval_literal($1, 16, 64);
++ }
++ ;
++
++devicetree:
++ '/' nodedef
++ {
++ $$ = name_node($2, "", NULL);
++ }
++ ;
++
++nodedef:
++ '{' proplist subnodes '}' ';'
++ {
++ $$ = build_node($2, $3);
++ }
++ ;
++
++proplist:
++ /* empty */
++ {
++ $$ = NULL;
++ }
++ | proplist propdef
++ {
++ $$ = chain_property($2, $1);
++ }
++ ;
++
++propdef:
++ label DT_PROPNODENAME '=' propdata ';'
++ {
++ $$ = build_property($2, $4, $1);
++ }
++ | label DT_PROPNODENAME ';'
++ {
++ $$ = build_property($2, empty_data, $1);
++ }
++ ;
++
++propdata:
++ propdataprefix DT_STRING
++ {
++ $$ = data_merge($1, $2);
++ }
++ | propdataprefix '<' celllist '>'
++ {
++ $$ = data_merge($1, $3);
++ }
++ | propdataprefix '[' bytestring ']'
++ {
++ $$ = data_merge($1, $3);
++ }
++ | propdataprefix DT_REF
++ {
++ $$ = data_add_marker($1, REF_PATH, $2);
++ }
++ | propdataprefix DT_INCBIN '(' DT_STRING ',' addr ',' addr ')'
++ {
++ struct search_path path = { srcpos_file->dir, NULL, NULL };
++ struct dtc_file *file = dtc_open_file($4.val, &path);
++ struct data d = empty_data;
++
++ if ($6 != 0)
++ if (fseek(file->file, $6, SEEK_SET) != 0)
++ yyerrorf("Couldn't seek to offset %llu in \"%s\": %s",
++ (unsigned long long)$6,
++ $4.val, strerror(errno));
++
++ d = data_copy_file(file->file, $8);
++
++ $$ = data_merge($1, d);
++ dtc_close_file(file);
++ }
++ | propdataprefix DT_INCBIN '(' DT_STRING ')'
++ {
++ struct search_path path = { srcpos_file->dir, NULL, NULL };
++ struct dtc_file *file = dtc_open_file($4.val, &path);
++ struct data d = empty_data;
++
++ d = data_copy_file(file->file, -1);
++
++ $$ = data_merge($1, d);
++ dtc_close_file(file);
++ }
++ | propdata DT_LABEL
++ {
++ $$ = data_add_marker($1, LABEL, $2);
++ }
++ ;
++
++propdataprefix:
++ /* empty */
++ {
++ $$ = empty_data;
++ }
++ | propdata ','
++ {
++ $$ = $1;
++ }
++ | propdataprefix DT_LABEL
++ {
++ $$ = data_add_marker($1, LABEL, $2);
++ }
++ ;
++
++celllist:
++ /* empty */
++ {
++ $$ = empty_data;
++ }
++ | celllist cellval
++ {
++ $$ = data_append_cell($1, $2);
++ }
++ | celllist DT_REF
++ {
++ $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
++ $2), -1);
++ }
++ | celllist DT_LABEL
++ {
++ $$ = data_add_marker($1, LABEL, $2);
++ }
++ ;
++
++cellbase:
++ /* empty */
++ {
++ $$ = 16;
++ }
++ | DT_BASE
++ ;
++
++cellval:
++ DT_LITERAL
++ {
++ $$ = eval_literal($1, 0, 32);
++ }
++ | cellbase DT_LEGACYLITERAL
++ {
++ $$ = eval_literal($2, $1, 32);
++ }
++ ;
++
++bytestring:
++ /* empty */
++ {
++ $$ = empty_data;
++ }
++ | bytestring DT_BYTE
++ {
++ $$ = data_append_byte($1, $2);
++ }
++ | bytestring DT_LABEL
++ {
++ $$ = data_add_marker($1, LABEL, $2);
++ }
++ ;
++
++subnodes:
++ /* empty */
++ {
++ $$ = NULL;
++ }
++ | subnode subnodes
++ {
++ $$ = chain_node($1, $2);
++ }
++ | subnode propdef
++ {
++ yyerror("syntax error: properties must precede subnodes");
++ YYERROR;
++ }
++ ;
++
++subnode:
++ label DT_PROPNODENAME nodedef
++ {
++ $$ = name_node($3, $2, $1);
++ }
++ ;
++
++label:
++ /* empty */
++ {
++ $$ = NULL;
++ }
++ | DT_LABEL
++ {
++ $$ = $1;
++ }
++ ;
++
++%%
++
++void yyerrorf(char const *s, ...)
++{
++ const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
++ va_list va;
++ va_start(va, s);
++
++ if (strcmp(fname, "-") == 0)
++ fname = "stdin";
++
++ fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
++ vfprintf(stderr, s, va);
++ fprintf(stderr, "\n");
++
++ treesource_error = 1;
++ va_end(va);
++}
++
++void yyerror (char const *s)
++{
++ yyerrorf("%s", s);
++}
++
++static unsigned long long eval_literal(const char *s, int base, int bits)
++{
++ unsigned long long val;
++ char *e;
++
++ errno = 0;
++ val = strtoull(s, &e, base);
++ if (*e)
++ yyerror("bad characters in literal");
++ else if ((errno == ERANGE)
++ || ((bits < 64) && (val >= (1ULL << bits))))
++ yyerror("literal out of range");
++ else if (errno != 0)
++ yyerror("bad literal");
++ return val;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/flattree.c linux-2.6.30-rc4-git/scripts/dtc/flattree.c
+--- linux-2.6.30-rc4/scripts/dtc/flattree.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/flattree.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,906 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++#include "srcpos.h"
++
++#define FTF_FULLPATH 0x1
++#define FTF_VARALIGN 0x2
++#define FTF_NAMEPROPS 0x4
++#define FTF_BOOTCPUID 0x8
++#define FTF_STRTABSIZE 0x10
++#define FTF_STRUCTSIZE 0x20
++#define FTF_NOPS 0x40
++
++static struct version_info {
++ int version;
++ int last_comp_version;
++ int hdr_size;
++ int flags;
++} version_table[] = {
++ {1, 1, FDT_V1_SIZE,
++ FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
++ {2, 1, FDT_V2_SIZE,
++ FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
++ {3, 1, FDT_V3_SIZE,
++ FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
++ {16, 16, FDT_V3_SIZE,
++ FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
++ {17, 16, FDT_V17_SIZE,
++ FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
++};
++
++struct emitter {
++ void (*cell)(void *, cell_t);
++ void (*string)(void *, char *, int);
++ void (*align)(void *, int);
++ void (*data)(void *, struct data);
++ void (*beginnode)(void *, const char *);
++ void (*endnode)(void *, const char *);
++ void (*property)(void *, const char *);
++};
++
++static void bin_emit_cell(void *e, cell_t val)
++{
++ struct data *dtbuf = e;
++
++ *dtbuf = data_append_cell(*dtbuf, val);
++}
++
++static void bin_emit_string(void *e, char *str, int len)
++{
++ struct data *dtbuf = e;
++
++ if (len == 0)
++ len = strlen(str);
++
++ *dtbuf = data_append_data(*dtbuf, str, len);
++ *dtbuf = data_append_byte(*dtbuf, '\0');
++}
++
++static void bin_emit_align(void *e, int a)
++{
++ struct data *dtbuf = e;
++
++ *dtbuf = data_append_align(*dtbuf, a);
++}
++
++static void bin_emit_data(void *e, struct data d)
++{
++ struct data *dtbuf = e;
++
++ *dtbuf = data_append_data(*dtbuf, d.val, d.len);
++}
++
++static void bin_emit_beginnode(void *e, const char *label)
++{
++ bin_emit_cell(e, FDT_BEGIN_NODE);
++}
++
++static void bin_emit_endnode(void *e, const char *label)
++{
++ bin_emit_cell(e, FDT_END_NODE);
++}
++
++static void bin_emit_property(void *e, const char *label)
++{
++ bin_emit_cell(e, FDT_PROP);
++}
++
++static struct emitter bin_emitter = {
++ .cell = bin_emit_cell,
++ .string = bin_emit_string,
++ .align = bin_emit_align,
++ .data = bin_emit_data,
++ .beginnode = bin_emit_beginnode,
++ .endnode = bin_emit_endnode,
++ .property = bin_emit_property,
++};
++
++static void emit_label(FILE *f, const char *prefix, const char *label)
++{
++ fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
++ fprintf(f, "%s_%s:\n", prefix, label);
++ fprintf(f, "_%s_%s:\n", prefix, label);
++}
++
++static void emit_offset_label(FILE *f, const char *label, int offset)
++{
++ fprintf(f, "\t.globl\t%s\n", label);
++ fprintf(f, "%s\t= . + %d\n", label, offset);
++}
++
++static void asm_emit_cell(void *e, cell_t val)
++{
++ FILE *f = e;
++
++ fprintf(f, "\t.long\t0x%x\n", val);
++}
++
++static void asm_emit_string(void *e, char *str, int len)
++{
++ FILE *f = e;
++ char c = 0;
++
++ if (len != 0) {
++ /* XXX: ewww */
++ c = str[len];
++ str[len] = '\0';
++ }
++
++ fprintf(f, "\t.string\t\"%s\"\n", str);
++
++ if (len != 0) {
++ str[len] = c;
++ }
++}
++
++static void asm_emit_align(void *e, int a)
++{
++ FILE *f = e;
++
++ fprintf(f, "\t.balign\t%d\n", a);
++}
++
++static void asm_emit_data(void *e, struct data d)
++{
++ FILE *f = e;
++ int off = 0;
++ struct marker *m = d.markers;
++
++ for_each_marker_of_type(m, LABEL)
++ emit_offset_label(f, m->ref, m->offset);
++
++ while ((d.len - off) >= sizeof(uint32_t)) {
++ fprintf(f, "\t.long\t0x%x\n",
++ fdt32_to_cpu(*((uint32_t *)(d.val+off))));
++ off += sizeof(uint32_t);
++ }
++
++ while ((d.len - off) >= 1) {
++ fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
++ off += 1;
++ }
++
++ assert(off == d.len);
++}
++
++static void asm_emit_beginnode(void *e, const char *label)
++{
++ FILE *f = e;
++
++ if (label) {
++ fprintf(f, "\t.globl\t%s\n", label);
++ fprintf(f, "%s:\n", label);
++ }
++ fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
++}
++
++static void asm_emit_endnode(void *e, const char *label)
++{
++ FILE *f = e;
++
++ fprintf(f, "\t.long\tFDT_END_NODE\n");
++ if (label) {
++ fprintf(f, "\t.globl\t%s_end\n", label);
++ fprintf(f, "%s_end:\n", label);
++ }
++}
++
++static void asm_emit_property(void *e, const char *label)
++{
++ FILE *f = e;
++
++ if (label) {
++ fprintf(f, "\t.globl\t%s\n", label);
++ fprintf(f, "%s:\n", label);
++ }
++ fprintf(f, "\t.long\tFDT_PROP\n");
++}
++
++static struct emitter asm_emitter = {
++ .cell = asm_emit_cell,
++ .string = asm_emit_string,
++ .align = asm_emit_align,
++ .data = asm_emit_data,
++ .beginnode = asm_emit_beginnode,
++ .endnode = asm_emit_endnode,
++ .property = asm_emit_property,
++};
++
++static int stringtable_insert(struct data *d, const char *str)
++{
++ int i;
++
++ /* FIXME: do this more efficiently? */
++
++ for (i = 0; i < d->len; i++) {
++ if (streq(str, d->val + i))
++ return i;
++ }
++
++ *d = data_append_data(*d, str, strlen(str)+1);
++ return i;
++}
++
++static void flatten_tree(struct node *tree, struct emitter *emit,
++ void *etarget, struct data *strbuf,
++ struct version_info *vi)
++{
++ struct property *prop;
++ struct node *child;
++ int seen_name_prop = 0;
++
++ emit->beginnode(etarget, tree->label);
++
++ if (vi->flags & FTF_FULLPATH)
++ emit->string(etarget, tree->fullpath, 0);
++ else
++ emit->string(etarget, tree->name, 0);
++
++ emit->align(etarget, sizeof(cell_t));
++
++ for_each_property(tree, prop) {
++ int nameoff;
++
++ if (streq(prop->name, "name"))
++ seen_name_prop = 1;
++
++ nameoff = stringtable_insert(strbuf, prop->name);
++
++ emit->property(etarget, prop->label);
++ emit->cell(etarget, prop->val.len);
++ emit->cell(etarget, nameoff);
++
++ if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
++ emit->align(etarget, 8);
++
++ emit->data(etarget, prop->val);
++ emit->align(etarget, sizeof(cell_t));
++ }
++
++ if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
++ emit->property(etarget, NULL);
++ emit->cell(etarget, tree->basenamelen+1);
++ emit->cell(etarget, stringtable_insert(strbuf, "name"));
++
++ if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
++ emit->align(etarget, 8);
++
++ emit->string(etarget, tree->name, tree->basenamelen);
++ emit->align(etarget, sizeof(cell_t));
++ }
++
++ for_each_child(tree, child) {
++ flatten_tree(child, emit, etarget, strbuf, vi);
++ }
++
++ emit->endnode(etarget, tree->label);
++}
++
++static struct data flatten_reserve_list(struct reserve_info *reservelist,
++ struct version_info *vi)
++{
++ struct reserve_info *re;
++ struct data d = empty_data;
++ static struct fdt_reserve_entry null_re = {0,0};
++ int j;
++
++ for (re = reservelist; re; re = re->next) {
++ d = data_append_re(d, &re->re);
++ }
++ /*
++ * Add additional reserved slots if the user asked for them.
++ */
++ for (j = 0; j < reservenum; j++) {
++ d = data_append_re(d, &null_re);
++ }
++
++ return d;
++}
++
++static void make_fdt_header(struct fdt_header *fdt,
++ struct version_info *vi,
++ int reservesize, int dtsize, int strsize,
++ int boot_cpuid_phys)
++{
++ int reserve_off;
++
++ reservesize += sizeof(struct fdt_reserve_entry);
++
++ memset(fdt, 0xff, sizeof(*fdt));
++
++ fdt->magic = cpu_to_fdt32(FDT_MAGIC);
++ fdt->version = cpu_to_fdt32(vi->version);
++ fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version);
++
++ /* Reserve map should be doubleword aligned */
++ reserve_off = ALIGN(vi->hdr_size, 8);
++
++ fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off);
++ fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize);
++ fdt->off_dt_strings = cpu_to_fdt32(reserve_off + reservesize
++ + dtsize);
++ fdt->totalsize = cpu_to_fdt32(reserve_off + reservesize + dtsize + strsize);
++
++ if (vi->flags & FTF_BOOTCPUID)
++ fdt->boot_cpuid_phys = cpu_to_fdt32(boot_cpuid_phys);
++ if (vi->flags & FTF_STRTABSIZE)
++ fdt->size_dt_strings = cpu_to_fdt32(strsize);
++ if (vi->flags & FTF_STRUCTSIZE)
++ fdt->size_dt_struct = cpu_to_fdt32(dtsize);
++}
++
++void dt_to_blob(FILE *f, struct boot_info *bi, int version)
++{
++ struct version_info *vi = NULL;
++ int i;
++ struct data blob = empty_data;
++ struct data reservebuf = empty_data;
++ struct data dtbuf = empty_data;
++ struct data strbuf = empty_data;
++ struct fdt_header fdt;
++ int padlen = 0;
++
++ for (i = 0; i < ARRAY_SIZE(version_table); i++) {
++ if (version_table[i].version == version)
++ vi = &version_table[i];
++ }
++ if (!vi)
++ die("Unknown device tree blob version %d\n", version);
++
++ flatten_tree(bi->dt, &bin_emitter, &dtbuf, &strbuf, vi);
++ bin_emit_cell(&dtbuf, FDT_END);
++
++ reservebuf = flatten_reserve_list(bi->reservelist, vi);
++
++ /* Make header */
++ make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
++ bi->boot_cpuid_phys);
++
++ /*
++ * If the user asked for more space than is used, adjust the totalsize.
++ */
++ if (minsize > 0) {
++ padlen = minsize - fdt32_to_cpu(fdt.totalsize);
++ if ((padlen < 0) && (quiet < 1))
++ fprintf(stderr,
++ "Warning: blob size %d >= minimum size %d\n",
++ fdt32_to_cpu(fdt.totalsize), minsize);
++ }
++
++ if (padsize > 0)
++ padlen = padsize;
++
++ if (padlen > 0) {
++ int tsize = fdt32_to_cpu(fdt.totalsize);
++ tsize += padlen;
++ fdt.totalsize = cpu_to_fdt32(tsize);
++ }
++
++ /*
++ * Assemble the blob: start with the header, add with alignment
++ * the reserve buffer, add the reserve map terminating zeroes,
++ * the device tree itself, and finally the strings.
++ */
++ blob = data_append_data(blob, &fdt, vi->hdr_size);
++ blob = data_append_align(blob, 8);
++ blob = data_merge(blob, reservebuf);
++ blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
++ blob = data_merge(blob, dtbuf);
++ blob = data_merge(blob, strbuf);
++
++ /*
++ * If the user asked for more space than is used, pad out the blob.
++ */
++ if (padlen > 0)
++ blob = data_append_zeroes(blob, padlen);
++
++ fwrite(blob.val, blob.len, 1, f);
++
++ if (ferror(f))
++ die("Error writing device tree blob: %s\n", strerror(errno));
++
++ /*
++ * data_merge() frees the right-hand element so only the blob
++ * remains to be freed.
++ */
++ data_free(blob);
++}
++
++static void dump_stringtable_asm(FILE *f, struct data strbuf)
++{
++ const char *p;
++ int len;
++
++ p = strbuf.val;
++
++ while (p < (strbuf.val + strbuf.len)) {
++ len = strlen(p);
++ fprintf(f, "\t.string \"%s\"\n", p);
++ p += len+1;
++ }
++}
++
++void dt_to_asm(FILE *f, struct boot_info *bi, int version)
++{
++ struct version_info *vi = NULL;
++ int i;
++ struct data strbuf = empty_data;
++ struct reserve_info *re;
++ const char *symprefix = "dt";
++
++ for (i = 0; i < ARRAY_SIZE(version_table); i++) {
++ if (version_table[i].version == version)
++ vi = &version_table[i];
++ }
++ if (!vi)
++ die("Unknown device tree blob version %d\n", version);
++
++ fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
++ fprintf(f, "#define FDT_MAGIC 0x%x\n", FDT_MAGIC);
++ fprintf(f, "#define FDT_BEGIN_NODE 0x%x\n", FDT_BEGIN_NODE);
++ fprintf(f, "#define FDT_END_NODE 0x%x\n", FDT_END_NODE);
++ fprintf(f, "#define FDT_PROP 0x%x\n", FDT_PROP);
++ fprintf(f, "#define FDT_END 0x%x\n", FDT_END);
++ fprintf(f, "\n");
++
++ emit_label(f, symprefix, "blob_start");
++ emit_label(f, symprefix, "header");
++ fprintf(f, "\t.long\tFDT_MAGIC\t\t\t\t/* magic */\n");
++ fprintf(f, "\t.long\t_%s_blob_abs_end - _%s_blob_start\t/* totalsize */\n",
++ symprefix, symprefix);
++ fprintf(f, "\t.long\t_%s_struct_start - _%s_blob_start\t/* off_dt_struct */\n",
++ symprefix, symprefix);
++ fprintf(f, "\t.long\t_%s_strings_start - _%s_blob_start\t/* off_dt_strings */\n",
++ symprefix, symprefix);
++ fprintf(f, "\t.long\t_%s_reserve_map - _%s_blob_start\t/* off_dt_strings */\n",
++ symprefix, symprefix);
++ fprintf(f, "\t.long\t%d\t\t\t\t\t/* version */\n", vi->version);
++ fprintf(f, "\t.long\t%d\t\t\t\t\t/* last_comp_version */\n",
++ vi->last_comp_version);
++
++ if (vi->flags & FTF_BOOTCPUID)
++ fprintf(f, "\t.long\t%i\t\t\t\t\t/* boot_cpuid_phys */\n",
++ bi->boot_cpuid_phys);
++
++ if (vi->flags & FTF_STRTABSIZE)
++ fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
++ symprefix, symprefix);
++
++ if (vi->flags & FTF_STRUCTSIZE)
++ fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
++ symprefix, symprefix);
++
++ /*
++ * Reserve map entries.
++ * Align the reserve map to a doubleword boundary.
++ * Each entry is an (address, size) pair of u64 values.
++ * Always supply a zero-sized temination entry.
++ */
++ asm_emit_align(f, 8);
++ emit_label(f, symprefix, "reserve_map");
++
++ fprintf(f, "/* Memory reserve map from source file */\n");
++
++ /*
++ * Use .long on high and low halfs of u64s to avoid .quad
++ * as it appears .quad isn't available in some assemblers.
++ */
++ for (re = bi->reservelist; re; re = re->next) {
++ if (re->label) {
++ fprintf(f, "\t.globl\t%s\n", re->label);
++ fprintf(f, "%s:\n", re->label);
++ }
++ fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
++ (unsigned int)(re->re.address >> 32),
++ (unsigned int)(re->re.address & 0xffffffff));
++ fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
++ (unsigned int)(re->re.size >> 32),
++ (unsigned int)(re->re.size & 0xffffffff));
++ }
++ for (i = 0; i < reservenum; i++) {
++ fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
++ }
++
++ fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
++
++ emit_label(f, symprefix, "struct_start");
++ flatten_tree(bi->dt, &asm_emitter, f, &strbuf, vi);
++ fprintf(f, "\t.long\tFDT_END\n");
++ emit_label(f, symprefix, "struct_end");
++
++ emit_label(f, symprefix, "strings_start");
++ dump_stringtable_asm(f, strbuf);
++ emit_label(f, symprefix, "strings_end");
++
++ emit_label(f, symprefix, "blob_end");
++
++ /*
++ * If the user asked for more space than is used, pad it out.
++ */
++ if (minsize > 0) {
++ fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
++ minsize, symprefix, symprefix);
++ }
++ if (padsize > 0) {
++ fprintf(f, "\t.space\t%d, 0\n", padsize);
++ }
++ emit_label(f, symprefix, "blob_abs_end");
++
++ data_free(strbuf);
++}
++
++struct inbuf {
++ char *base, *limit, *ptr;
++};
++
++static void inbuf_init(struct inbuf *inb, void *base, void *limit)
++{
++ inb->base = base;
++ inb->limit = limit;
++ inb->ptr = inb->base;
++}
++
++static void flat_read_chunk(struct inbuf *inb, void *p, int len)
++{
++ if ((inb->ptr + len) > inb->limit)
++ die("Premature end of data parsing flat device tree\n");
++
++ memcpy(p, inb->ptr, len);
++
++ inb->ptr += len;
++}
++
++static uint32_t flat_read_word(struct inbuf *inb)
++{
++ uint32_t val;
++
++ assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
++
++ flat_read_chunk(inb, &val, sizeof(val));
++
++ return fdt32_to_cpu(val);
++}
++
++static void flat_realign(struct inbuf *inb, int align)
++{
++ int off = inb->ptr - inb->base;
++
++ inb->ptr = inb->base + ALIGN(off, align);
++ if (inb->ptr > inb->limit)
++ die("Premature end of data parsing flat device tree\n");
++}
++
++static char *flat_read_string(struct inbuf *inb)
++{
++ int len = 0;
++ const char *p = inb->ptr;
++ char *str;
++
++ do {
++ if (p >= inb->limit)
++ die("Premature end of data parsing flat device tree\n");
++ len++;
++ } while ((*p++) != '\0');
++
++ str = strdup(inb->ptr);
++
++ inb->ptr += len;
++
++ flat_realign(inb, sizeof(uint32_t));
++
++ return str;
++}
++
++static struct data flat_read_data(struct inbuf *inb, int len)
++{
++ struct data d = empty_data;
++
++ if (len == 0)
++ return empty_data;
++
++ d = data_grow_for(d, len);
++ d.len = len;
++
++ flat_read_chunk(inb, d.val, len);
++
++ flat_realign(inb, sizeof(uint32_t));
++
++ return d;
++}
++
++static char *flat_read_stringtable(struct inbuf *inb, int offset)
++{
++ const char *p;
++
++ p = inb->base + offset;
++ while (1) {
++ if (p >= inb->limit || p < inb->base)
++ die("String offset %d overruns string table\n",
++ offset);
++
++ if (*p == '\0')
++ break;
++
++ p++;
++ }
++
++ return strdup(inb->base + offset);
++}
++
++static struct property *flat_read_property(struct inbuf *dtbuf,
++ struct inbuf *strbuf, int flags)
++{
++ uint32_t proplen, stroff;
++ char *name;
++ struct data val;
++
++ proplen = flat_read_word(dtbuf);
++ stroff = flat_read_word(dtbuf);
++
++ name = flat_read_stringtable(strbuf, stroff);
++
++ if ((flags & FTF_VARALIGN) && (proplen >= 8))
++ flat_realign(dtbuf, 8);
++
++ val = flat_read_data(dtbuf, proplen);
++
++ return build_property(name, val, NULL);
++}
++
++
++static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
++{
++ struct reserve_info *reservelist = NULL;
++ struct reserve_info *new;
++ const char *p;
++ struct fdt_reserve_entry re;
++
++ /*
++ * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
++ * List terminates at an entry with size equal to zero.
++ *
++ * First pass, count entries.
++ */
++ p = inb->ptr;
++ while (1) {
++ flat_read_chunk(inb, &re, sizeof(re));
++ re.address = fdt64_to_cpu(re.address);
++ re.size = fdt64_to_cpu(re.size);
++ if (re.size == 0)
++ break;
++
++ new = build_reserve_entry(re.address, re.size, NULL);
++ reservelist = add_reserve_entry(reservelist, new);
++ }
++
++ return reservelist;
++}
++
++
++static char *nodename_from_path(const char *ppath, const char *cpath)
++{
++ int plen;
++
++ plen = strlen(ppath);
++
++ if (!strneq(ppath, cpath, plen))
++ die("Path \"%s\" is not valid as a child of \"%s\"\n",
++ cpath, ppath);
++
++ /* root node is a special case */
++ if (!streq(ppath, "/"))
++ plen++;
++
++ return strdup(cpath + plen);
++}
++
++static struct node *unflatten_tree(struct inbuf *dtbuf,
++ struct inbuf *strbuf,
++ const char *parent_flatname, int flags)
++{
++ struct node *node;
++ char *flatname;
++ uint32_t val;
++
++ node = build_node(NULL, NULL);
++
++ flatname = flat_read_string(dtbuf);
++
++ if (flags & FTF_FULLPATH)
++ node->name = nodename_from_path(parent_flatname, flatname);
++ else
++ node->name = flatname;
++
++ do {
++ struct property *prop;
++ struct node *child;
++
++ val = flat_read_word(dtbuf);
++ switch (val) {
++ case FDT_PROP:
++ if (node->children)
++ fprintf(stderr, "Warning: Flat tree input has "
++ "subnodes preceding a property.\n");
++ prop = flat_read_property(dtbuf, strbuf, flags);
++ add_property(node, prop);
++ break;
++
++ case FDT_BEGIN_NODE:
++ child = unflatten_tree(dtbuf,strbuf, flatname, flags);
++ add_child(node, child);
++ break;
++
++ case FDT_END_NODE:
++ break;
++
++ case FDT_END:
++ die("Premature FDT_END in device tree blob\n");
++ break;
++
++ case FDT_NOP:
++ if (!(flags & FTF_NOPS))
++ fprintf(stderr, "Warning: NOP tag found in flat tree"
++ " version <16\n");
++
++ /* Ignore */
++ break;
++
++ default:
++ die("Invalid opcode word %08x in device tree blob\n",
++ val);
++ }
++ } while (val != FDT_END_NODE);
++
++ return node;
++}
++
++
++struct boot_info *dt_from_blob(const char *fname)
++{
++ struct dtc_file *dtcf;
++ uint32_t magic, totalsize, version, size_dt, boot_cpuid_phys;
++ uint32_t off_dt, off_str, off_mem_rsvmap;
++ int rc;
++ char *blob;
++ struct fdt_header *fdt;
++ char *p;
++ struct inbuf dtbuf, strbuf;
++ struct inbuf memresvbuf;
++ int sizeleft;
++ struct reserve_info *reservelist;
++ struct node *tree;
++ uint32_t val;
++ int flags = 0;
++
++ dtcf = dtc_open_file(fname, NULL);
++
++ rc = fread(&magic, sizeof(magic), 1, dtcf->file);
++ if (ferror(dtcf->file))
++ die("Error reading DT blob magic number: %s\n",
++ strerror(errno));
++ if (rc < 1) {
++ if (feof(dtcf->file))
++ die("EOF reading DT blob magic number\n");
++ else
++ die("Mysterious short read reading magic number\n");
++ }
++
++ magic = fdt32_to_cpu(magic);
++ if (magic != FDT_MAGIC)
++ die("Blob has incorrect magic number\n");
++
++ rc = fread(&totalsize, sizeof(totalsize), 1, dtcf->file);
++ if (ferror(dtcf->file))
++ die("Error reading DT blob size: %s\n", strerror(errno));
++ if (rc < 1) {
++ if (feof(dtcf->file))
++ die("EOF reading DT blob size\n");
++ else
++ die("Mysterious short read reading blob size\n");
++ }
++
++ totalsize = fdt32_to_cpu(totalsize);
++ if (totalsize < FDT_V1_SIZE)
++ die("DT blob size (%d) is too small\n", totalsize);
++
++ blob = xmalloc(totalsize);
++
++ fdt = (struct fdt_header *)blob;
++ fdt->magic = cpu_to_fdt32(magic);
++ fdt->totalsize = cpu_to_fdt32(totalsize);
++
++ sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
++ p = blob + sizeof(magic) + sizeof(totalsize);
++
++ while (sizeleft) {
++ if (feof(dtcf->file))
++ die("EOF before reading %d bytes of DT blob\n",
++ totalsize);
++
++ rc = fread(p, 1, sizeleft, dtcf->file);
++ if (ferror(dtcf->file))
++ die("Error reading DT blob: %s\n",
++ strerror(errno));
++
++ sizeleft -= rc;
++ p += rc;
++ }
++
++ off_dt = fdt32_to_cpu(fdt->off_dt_struct);
++ off_str = fdt32_to_cpu(fdt->off_dt_strings);
++ off_mem_rsvmap = fdt32_to_cpu(fdt->off_mem_rsvmap);
++ version = fdt32_to_cpu(fdt->version);
++ boot_cpuid_phys = fdt32_to_cpu(fdt->boot_cpuid_phys);
++
++ if (off_mem_rsvmap >= totalsize)
++ die("Mem Reserve structure offset exceeds total size\n");
++
++ if (off_dt >= totalsize)
++ die("DT structure offset exceeds total size\n");
++
++ if (off_str > totalsize)
++ die("String table offset exceeds total size\n");
++
++ if (version >= 3) {
++ uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings);
++ if (off_str+size_str > totalsize)
++ die("String table extends past total size\n");
++ inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
++ } else {
++ inbuf_init(&strbuf, blob + off_str, blob + totalsize);
++ }
++
++ if (version >= 17) {
++ size_dt = fdt32_to_cpu(fdt->size_dt_struct);
++ if (off_dt+size_dt > totalsize)
++ die("Structure block extends past total size\n");
++ }
++
++ if (version < 16) {
++ flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
++ } else {
++ flags |= FTF_NOPS;
++ }
++
++ inbuf_init(&memresvbuf,
++ blob + off_mem_rsvmap, blob + totalsize);
++ inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
++
++ reservelist = flat_read_mem_reserve(&memresvbuf);
++
++ val = flat_read_word(&dtbuf);
++
++ if (val != FDT_BEGIN_NODE)
++ die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
++
++ tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
++
++ val = flat_read_word(&dtbuf);
++ if (val != FDT_END)
++ die("Device tree blob doesn't end with FDT_END\n");
++
++ free(blob);
++
++ dtc_close_file(dtcf);
++
++ return build_boot_info(reservelist, tree, boot_cpuid_phys);
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/fstree.c linux-2.6.30-rc4-git/scripts/dtc/fstree.c
+--- linux-2.6.30-rc4/scripts/dtc/fstree.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/fstree.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,92 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++
++#include <dirent.h>
++#include <sys/stat.h>
++
++static struct node *read_fstree(const char *dirname)
++{
++ DIR *d;
++ struct dirent *de;
++ struct stat st;
++ struct node *tree;
++
++ d = opendir(dirname);
++ if (!d)
++ die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno));
++
++ tree = build_node(NULL, NULL);
++
++ while ((de = readdir(d)) != NULL) {
++ char *tmpnam;
++
++ if (streq(de->d_name, ".")
++ || streq(de->d_name, ".."))
++ continue;
++
++ tmpnam = join_path(dirname, de->d_name);
++
++ if (lstat(tmpnam, &st) < 0)
++ die("stat(%s): %s\n", tmpnam, strerror(errno));
++
++ if (S_ISREG(st.st_mode)) {
++ struct property *prop;
++ FILE *pfile;
++
++ pfile = fopen(tmpnam, "r");
++ if (! pfile) {
++ fprintf(stderr,
++ "WARNING: Cannot open %s: %s\n",
++ tmpnam, strerror(errno));
++ } else {
++ prop = build_property(strdup(de->d_name),
++ data_copy_file(pfile,
++ st.st_size),
++ NULL);
++ add_property(tree, prop);
++ fclose(pfile);
++ }
++ } else if (S_ISDIR(st.st_mode)) {
++ struct node *newchild;
++
++ newchild = read_fstree(tmpnam);
++ newchild = name_node(newchild, strdup(de->d_name),
++ NULL);
++ add_child(tree, newchild);
++ }
++
++ free(tmpnam);
++ }
++
++ return tree;
++}
++
++struct boot_info *dt_from_fs(const char *dirname)
++{
++ struct node *tree;
++
++ tree = read_fstree(dirname);
++ tree = name_node(tree, "", NULL);
++
++ return build_boot_info(NULL, tree, 0);
++}
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,201 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++int fdt_check_header(const void *fdt)
++{
++ if (fdt_magic(fdt) == FDT_MAGIC) {
++ /* Complete tree */
++ if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
++ return -FDT_ERR_BADVERSION;
++ if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
++ return -FDT_ERR_BADVERSION;
++ } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
++ /* Unfinished sequential-write blob */
++ if (fdt_size_dt_struct(fdt) == 0)
++ return -FDT_ERR_BADSTATE;
++ } else {
++ return -FDT_ERR_BADMAGIC;
++ }
++
++ return 0;
++}
++
++const void *fdt_offset_ptr(const void *fdt, int offset, int len)
++{
++ const char *p;
++
++ if (fdt_version(fdt) >= 0x11)
++ if (((offset + len) < offset)
++ || ((offset + len) > fdt_size_dt_struct(fdt)))
++ return NULL;
++
++ p = _fdt_offset_ptr(fdt, offset);
++
++ if (p + len < p)
++ return NULL;
++ return p;
++}
++
++uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
++{
++ const uint32_t *tagp, *lenp;
++ uint32_t tag;
++ const char *p;
++
++ if (offset % FDT_TAGSIZE)
++ return -1;
++
++ tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
++ if (! tagp)
++ return FDT_END; /* premature end */
++ tag = fdt32_to_cpu(*tagp);
++ offset += FDT_TAGSIZE;
++
++ switch (tag) {
++ case FDT_BEGIN_NODE:
++ /* skip name */
++ do {
++ p = fdt_offset_ptr(fdt, offset++, 1);
++ } while (p && (*p != '\0'));
++ if (! p)
++ return FDT_END;
++ break;
++ case FDT_PROP:
++ lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
++ if (! lenp)
++ return FDT_END;
++ /* skip name offset, length and value */
++ offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
++ break;
++ }
++
++ if (nextoffset)
++ *nextoffset = FDT_TAGALIGN(offset);
++
++ return tag;
++}
++
++int _fdt_check_node_offset(const void *fdt, int offset)
++{
++ if ((offset < 0) || (offset % FDT_TAGSIZE)
++ || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
++ return -FDT_ERR_BADOFFSET;
++
++ return offset;
++}
++
++int fdt_next_node(const void *fdt, int offset, int *depth)
++{
++ int nextoffset = 0;
++ uint32_t tag;
++
++ if (offset >= 0)
++ if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
++ return nextoffset;
++
++ do {
++ offset = nextoffset;
++ tag = fdt_next_tag(fdt, offset, &nextoffset);
++
++ switch (tag) {
++ case FDT_PROP:
++ case FDT_NOP:
++ break;
++
++ case FDT_BEGIN_NODE:
++ if (depth)
++ (*depth)++;
++ break;
++
++ case FDT_END_NODE:
++ if (depth)
++ (*depth)--;
++ break;
++
++ case FDT_END:
++ return -FDT_ERR_NOTFOUND;
++
++ default:
++ return -FDT_ERR_BADSTRUCTURE;
++ }
++ } while (tag != FDT_BEGIN_NODE);
++
++ return offset;
++}
++
++const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
++{
++ int len = strlen(s) + 1;
++ const char *last = strtab + tabsize - len;
++ const char *p;
++
++ for (p = strtab; p <= last; p++)
++ if (memcmp(p, s, len) == 0)
++ return p;
++ return NULL;
++}
++
++int fdt_move(const void *fdt, void *buf, int bufsize)
++{
++ FDT_CHECK_HEADER(fdt);
++
++ if (fdt_totalsize(fdt) > bufsize)
++ return -FDT_ERR_NOSPACE;
++
++ memmove(buf, fdt, fdt_totalsize(fdt));
++ return 0;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt.h linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt.h
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,60 @@
++#ifndef _FDT_H
++#define _FDT_H
++
++#ifndef __ASSEMBLY__
++
++struct fdt_header {
++ uint32_t magic; /* magic word FDT_MAGIC */
++ uint32_t totalsize; /* total size of DT block */
++ uint32_t off_dt_struct; /* offset to structure */
++ uint32_t off_dt_strings; /* offset to strings */
++ uint32_t off_mem_rsvmap; /* offset to memory reserve map */
++ uint32_t version; /* format version */
++ uint32_t last_comp_version; /* last compatible version */
++
++ /* version 2 fields below */
++ uint32_t boot_cpuid_phys; /* Which physical CPU id we're
++ booting on */
++ /* version 3 fields below */
++ uint32_t size_dt_strings; /* size of the strings block */
++
++ /* version 17 fields below */
++ uint32_t size_dt_struct; /* size of the structure block */
++};
++
++struct fdt_reserve_entry {
++ uint64_t address;
++ uint64_t size;
++};
++
++struct fdt_node_header {
++ uint32_t tag;
++ char name[0];
++};
++
++struct fdt_property {
++ uint32_t tag;
++ uint32_t len;
++ uint32_t nameoff;
++ char data[0];
++};
++
++#endif /* !__ASSEMBLY */
++
++#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
++#define FDT_TAGSIZE sizeof(uint32_t)
++
++#define FDT_BEGIN_NODE 0x1 /* Start node: full name */
++#define FDT_END_NODE 0x2 /* End node */
++#define FDT_PROP 0x3 /* Property: name off,
++ size, content */
++#define FDT_NOP 0x4 /* nop */
++#define FDT_END 0x9
++
++#define FDT_V1_SIZE (7*sizeof(uint32_t))
++#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))
++#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))
++#define FDT_V16_SIZE FDT_V3_SIZE
++#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t))
++
++#endif /* _FDT_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_ro.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_ro.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_ro.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_ro.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,469 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++static int _fdt_nodename_eq(const void *fdt, int offset,
++ const char *s, int len)
++{
++ const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
++
++ if (! p)
++ /* short match */
++ return 0;
++
++ if (memcmp(p, s, len) != 0)
++ return 0;
++
++ if (p[len] == '\0')
++ return 1;
++ else if (!memchr(s, '@', len) && (p[len] == '@'))
++ return 1;
++ else
++ return 0;
++}
++
++const char *fdt_string(const void *fdt, int stroffset)
++{
++ return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
++}
++
++int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
++{
++ FDT_CHECK_HEADER(fdt);
++ *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
++ *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
++ return 0;
++}
++
++int fdt_num_mem_rsv(const void *fdt)
++{
++ int i = 0;
++
++ while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
++ i++;
++ return i;
++}
++
++int fdt_subnode_offset_namelen(const void *fdt, int offset,
++ const char *name, int namelen)
++{
++ int depth;
++
++ FDT_CHECK_HEADER(fdt);
++
++ for (depth = 0, offset = fdt_next_node(fdt, offset, &depth);
++ (offset >= 0) && (depth > 0);
++ offset = fdt_next_node(fdt, offset, &depth)) {
++ if (depth < 0)
++ return -FDT_ERR_NOTFOUND;
++ else if ((depth == 1)
++ && _fdt_nodename_eq(fdt, offset, name, namelen))
++ return offset;
++ }
++
++ if (offset < 0)
++ return offset; /* error */
++ else
++ return -FDT_ERR_NOTFOUND;
++}
++
++int fdt_subnode_offset(const void *fdt, int parentoffset,
++ const char *name)
++{
++ return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
++}
++
++int fdt_path_offset(const void *fdt, const char *path)
++{
++ const char *end = path + strlen(path);
++ const char *p = path;
++ int offset = 0;
++
++ FDT_CHECK_HEADER(fdt);
++
++ if (*path != '/')
++ return -FDT_ERR_BADPATH;
++
++ while (*p) {
++ const char *q;
++
++ while (*p == '/')
++ p++;
++ if (! *p)
++ return offset;
++ q = strchr(p, '/');
++ if (! q)
++ q = end;
++
++ offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
++ if (offset < 0)
++ return offset;
++
++ p = q;
++ }
++
++ return offset;
++}
++
++const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
++{
++ const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
++ int err;
++
++ if (((err = fdt_check_header(fdt)) != 0)
++ || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
++ goto fail;
++
++ if (len)
++ *len = strlen(nh->name);
++
++ return nh->name;
++
++ fail:
++ if (len)
++ *len = err;
++ return NULL;
++}
++
++const struct fdt_property *fdt_get_property(const void *fdt,
++ int nodeoffset,
++ const char *name, int *lenp)
++{
++ uint32_t tag;
++ const struct fdt_property *prop;
++ int namestroff;
++ int offset, nextoffset;
++ int err;
++
++ if (((err = fdt_check_header(fdt)) != 0)
++ || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
++ goto fail;
++
++ nextoffset = err;
++ do {
++ offset = nextoffset;
++
++ tag = fdt_next_tag(fdt, offset, &nextoffset);
++ switch (tag) {
++ case FDT_END:
++ err = -FDT_ERR_TRUNCATED;
++ goto fail;
++
++ case FDT_BEGIN_NODE:
++ case FDT_END_NODE:
++ case FDT_NOP:
++ break;
++
++ case FDT_PROP:
++ err = -FDT_ERR_BADSTRUCTURE;
++ prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
++ if (! prop)
++ goto fail;
++ namestroff = fdt32_to_cpu(prop->nameoff);
++ if (strcmp(fdt_string(fdt, namestroff), name) == 0) {
++ /* Found it! */
++ int len = fdt32_to_cpu(prop->len);
++ prop = fdt_offset_ptr(fdt, offset,
++ sizeof(*prop)+len);
++ if (! prop)
++ goto fail;
++
++ if (lenp)
++ *lenp = len;
++
++ return prop;
++ }
++ break;
++
++ default:
++ err = -FDT_ERR_BADSTRUCTURE;
++ goto fail;
++ }
++ } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
++
++ err = -FDT_ERR_NOTFOUND;
++ fail:
++ if (lenp)
++ *lenp = err;
++ return NULL;
++}
++
++const void *fdt_getprop(const void *fdt, int nodeoffset,
++ const char *name, int *lenp)
++{
++ const struct fdt_property *prop;
++
++ prop = fdt_get_property(fdt, nodeoffset, name, lenp);
++ if (! prop)
++ return NULL;
++
++ return prop->data;
++}
++
++uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
++{
++ const uint32_t *php;
++ int len;
++
++ php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
++ if (!php || (len != sizeof(*php)))
++ return 0;
++
++ return fdt32_to_cpu(*php);
++}
++
++int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
++{
++ int pdepth = 0, p = 0;
++ int offset, depth, namelen;
++ const char *name;
++
++ FDT_CHECK_HEADER(fdt);
++
++ if (buflen < 2)
++ return -FDT_ERR_NOSPACE;
++
++ for (offset = 0, depth = 0;
++ (offset >= 0) && (offset <= nodeoffset);
++ offset = fdt_next_node(fdt, offset, &depth)) {
++ if (pdepth < depth)
++ continue; /* overflowed buffer */
++
++ while (pdepth > depth) {
++ do {
++ p--;
++ } while (buf[p-1] != '/');
++ pdepth--;
++ }
++
++ name = fdt_get_name(fdt, offset, &namelen);
++ if (!name)
++ return namelen;
++ if ((p + namelen + 1) <= buflen) {
++ memcpy(buf + p, name, namelen);
++ p += namelen;
++ buf[p++] = '/';
++ pdepth++;
++ }
++
++ if (offset == nodeoffset) {
++ if (pdepth < (depth + 1))
++ return -FDT_ERR_NOSPACE;
++
++ if (p > 1) /* special case so that root path is "/", not "" */
++ p--;
++ buf[p] = '\0';
++ return p;
++ }
++ }
++
++ if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
++ return -FDT_ERR_BADOFFSET;
++ else if (offset == -FDT_ERR_BADOFFSET)
++ return -FDT_ERR_BADSTRUCTURE;
++
++ return offset; /* error from fdt_next_node() */
++}
++
++int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
++ int supernodedepth, int *nodedepth)
++{
++ int offset, depth;
++ int supernodeoffset = -FDT_ERR_INTERNAL;
++
++ FDT_CHECK_HEADER(fdt);
++
++ if (supernodedepth < 0)
++ return -FDT_ERR_NOTFOUND;
++
++ for (offset = 0, depth = 0;
++ (offset >= 0) && (offset <= nodeoffset);
++ offset = fdt_next_node(fdt, offset, &depth)) {
++ if (depth == supernodedepth)
++ supernodeoffset = offset;
++
++ if (offset == nodeoffset) {
++ if (nodedepth)
++ *nodedepth = depth;
++
++ if (supernodedepth > depth)
++ return -FDT_ERR_NOTFOUND;
++ else
++ return supernodeoffset;
++ }
++ }
++
++ if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
++ return -FDT_ERR_BADOFFSET;
++ else if (offset == -FDT_ERR_BADOFFSET)
++ return -FDT_ERR_BADSTRUCTURE;
++
++ return offset; /* error from fdt_next_node() */
++}
++
++int fdt_node_depth(const void *fdt, int nodeoffset)
++{
++ int nodedepth;
++ int err;
++
++ err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
++ if (err)
++ return (err < 0) ? err : -FDT_ERR_INTERNAL;
++ return nodedepth;
++}
++
++int fdt_parent_offset(const void *fdt, int nodeoffset)
++{
++ int nodedepth = fdt_node_depth(fdt, nodeoffset);
++
++ if (nodedepth < 0)
++ return nodedepth;
++ return fdt_supernode_atdepth_offset(fdt, nodeoffset,
++ nodedepth - 1, NULL);
++}
++
++int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
++ const char *propname,
++ const void *propval, int proplen)
++{
++ int offset;
++ const void *val;
++ int len;
++
++ FDT_CHECK_HEADER(fdt);
++
++ /* FIXME: The algorithm here is pretty horrible: we scan each
++ * property of a node in fdt_getprop(), then if that didn't
++ * find what we want, we scan over them again making our way
++ * to the next node. Still it's the easiest to implement
++ * approach; performance can come later. */
++ for (offset = fdt_next_node(fdt, startoffset, NULL);
++ offset >= 0;
++ offset = fdt_next_node(fdt, offset, NULL)) {
++ val = fdt_getprop(fdt, offset, propname, &len);
++ if (val && (len == proplen)
++ && (memcmp(val, propval, len) == 0))
++ return offset;
++ }
++
++ return offset; /* error from fdt_next_node() */
++}
++
++int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
++{
++ if ((phandle == 0) || (phandle == -1))
++ return -FDT_ERR_BADPHANDLE;
++ phandle = cpu_to_fdt32(phandle);
++ return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
++ &phandle, sizeof(phandle));
++}
++
++int _stringlist_contains(const char *strlist, int listlen, const char *str)
++{
++ int len = strlen(str);
++ const char *p;
++
++ while (listlen >= len) {
++ if (memcmp(str, strlist, len+1) == 0)
++ return 1;
++ p = memchr(strlist, '\0', listlen);
++ if (!p)
++ return 0; /* malformed strlist.. */
++ listlen -= (p-strlist) + 1;
++ strlist = p + 1;
++ }
++ return 0;
++}
++
++int fdt_node_check_compatible(const void *fdt, int nodeoffset,
++ const char *compatible)
++{
++ const void *prop;
++ int len;
++
++ prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
++ if (!prop)
++ return len;
++ if (_stringlist_contains(prop, len, compatible))
++ return 0;
++ else
++ return 1;
++}
++
++int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
++ const char *compatible)
++{
++ int offset, err;
++
++ FDT_CHECK_HEADER(fdt);
++
++ /* FIXME: The algorithm here is pretty horrible: we scan each
++ * property of a node in fdt_node_check_compatible(), then if
++ * that didn't find what we want, we scan over them again
++ * making our way to the next node. Still it's the easiest to
++ * implement approach; performance can come later. */
++ for (offset = fdt_next_node(fdt, startoffset, NULL);
++ offset >= 0;
++ offset = fdt_next_node(fdt, offset, NULL)) {
++ err = fdt_node_check_compatible(fdt, offset, compatible);
++ if ((err < 0) && (err != -FDT_ERR_NOTFOUND))
++ return err;
++ else if (err == 0)
++ return offset;
++ }
++
++ return offset; /* error from fdt_next_node() */
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_rw.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_rw.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_rw.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_rw.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,463 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++static int _fdt_blocks_misordered(const void *fdt,
++ int mem_rsv_size, int struct_size)
++{
++ return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8))
++ || (fdt_off_dt_struct(fdt) <
++ (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
++ || (fdt_off_dt_strings(fdt) <
++ (fdt_off_dt_struct(fdt) + struct_size))
++ || (fdt_totalsize(fdt) <
++ (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
++}
++
++static int _fdt_rw_check_header(void *fdt)
++{
++ FDT_CHECK_HEADER(fdt);
++
++ if (fdt_version(fdt) < 17)
++ return -FDT_ERR_BADVERSION;
++ if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
++ fdt_size_dt_struct(fdt)))
++ return -FDT_ERR_BADLAYOUT;
++ if (fdt_version(fdt) > 17)
++ fdt_set_version(fdt, 17);
++
++ return 0;
++}
++
++#define FDT_RW_CHECK_HEADER(fdt) \
++ { \
++ int err; \
++ if ((err = _fdt_rw_check_header(fdt)) != 0) \
++ return err; \
++ }
++
++static inline int _fdt_data_size(void *fdt)
++{
++ return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
++}
++
++static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
++{
++ char *p = splicepoint;
++ char *end = (char *)fdt + _fdt_data_size(fdt);
++
++ if (((p + oldlen) < p) || ((p + oldlen) > end))
++ return -FDT_ERR_BADOFFSET;
++ if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt)))
++ return -FDT_ERR_NOSPACE;
++ memmove(p + newlen, p + oldlen, end - p - oldlen);
++ return 0;
++}
++
++static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
++ int oldn, int newn)
++{
++ int delta = (newn - oldn) * sizeof(*p);
++ int err;
++ err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
++ if (err)
++ return err;
++ fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
++ fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
++ return 0;
++}
++
++static int _fdt_splice_struct(void *fdt, void *p,
++ int oldlen, int newlen)
++{
++ int delta = newlen - oldlen;
++ int err;
++
++ if ((err = _fdt_splice(fdt, p, oldlen, newlen)))
++ return err;
++
++ fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
++ fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
++ return 0;
++}
++
++static int _fdt_splice_string(void *fdt, int newlen)
++{
++ void *p = (char *)fdt
++ + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
++ int err;
++
++ if ((err = _fdt_splice(fdt, p, 0, newlen)))
++ return err;
++
++ fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
++ return 0;
++}
++
++static int _fdt_find_add_string(void *fdt, const char *s)
++{
++ char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
++ const char *p;
++ char *new;
++ int len = strlen(s) + 1;
++ int err;
++
++ p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
++ if (p)
++ /* found it */
++ return (p - strtab);
++
++ new = strtab + fdt_size_dt_strings(fdt);
++ err = _fdt_splice_string(fdt, len);
++ if (err)
++ return err;
++
++ memcpy(new, s, len);
++ return (new - strtab);
++}
++
++int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
++{
++ struct fdt_reserve_entry *re;
++ int err;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
++ err = _fdt_splice_mem_rsv(fdt, re, 0, 1);
++ if (err)
++ return err;
++
++ re->address = cpu_to_fdt64(address);
++ re->size = cpu_to_fdt64(size);
++ return 0;
++}
++
++int fdt_del_mem_rsv(void *fdt, int n)
++{
++ struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
++ int err;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ if (n >= fdt_num_mem_rsv(fdt))
++ return -FDT_ERR_NOTFOUND;
++
++ err = _fdt_splice_mem_rsv(fdt, re, 1, 0);
++ if (err)
++ return err;
++ return 0;
++}
++
++static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
++ int len, struct fdt_property **prop)
++{
++ int oldlen;
++ int err;
++
++ *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
++ if (! (*prop))
++ return oldlen;
++
++ if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
++ FDT_TAGALIGN(len))))
++ return err;
++
++ (*prop)->len = cpu_to_fdt32(len);
++ return 0;
++}
++
++static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
++ int len, struct fdt_property **prop)
++{
++ int proplen;
++ int nextoffset;
++ int namestroff;
++ int err;
++
++ if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
++ return nextoffset;
++
++ namestroff = _fdt_find_add_string(fdt, name);
++ if (namestroff < 0)
++ return namestroff;
++
++ *prop = _fdt_offset_ptr_w(fdt, nextoffset);
++ proplen = sizeof(**prop) + FDT_TAGALIGN(len);
++
++ err = _fdt_splice_struct(fdt, *prop, 0, proplen);
++ if (err)
++ return err;
++
++ (*prop)->tag = cpu_to_fdt32(FDT_PROP);
++ (*prop)->nameoff = cpu_to_fdt32(namestroff);
++ (*prop)->len = cpu_to_fdt32(len);
++ return 0;
++}
++
++int fdt_set_name(void *fdt, int nodeoffset, const char *name)
++{
++ char *namep;
++ int oldlen, newlen;
++ int err;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
++ if (!namep)
++ return oldlen;
++
++ newlen = strlen(name);
++
++ err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1),
++ FDT_TAGALIGN(newlen+1));
++ if (err)
++ return err;
++
++ memcpy(namep, name, newlen+1);
++ return 0;
++}
++
++int fdt_setprop(void *fdt, int nodeoffset, const char *name,
++ const void *val, int len)
++{
++ struct fdt_property *prop;
++ int err;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop);
++ if (err == -FDT_ERR_NOTFOUND)
++ err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
++ if (err)
++ return err;
++
++ memcpy(prop->data, val, len);
++ return 0;
++}
++
++int fdt_delprop(void *fdt, int nodeoffset, const char *name)
++{
++ struct fdt_property *prop;
++ int len, proplen;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
++ if (! prop)
++ return len;
++
++ proplen = sizeof(*prop) + FDT_TAGALIGN(len);
++ return _fdt_splice_struct(fdt, prop, proplen, 0);
++}
++
++int fdt_add_subnode_namelen(void *fdt, int parentoffset,
++ const char *name, int namelen)
++{
++ struct fdt_node_header *nh;
++ int offset, nextoffset;
++ int nodelen;
++ int err;
++ uint32_t tag;
++ uint32_t *endtag;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
++ if (offset >= 0)
++ return -FDT_ERR_EXISTS;
++ else if (offset != -FDT_ERR_NOTFOUND)
++ return offset;
++
++ /* Try to place the new node after the parent's properties */
++ fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
++ do {
++ offset = nextoffset;
++ tag = fdt_next_tag(fdt, offset, &nextoffset);
++ } while ((tag == FDT_PROP) || (tag == FDT_NOP));
++
++ nh = _fdt_offset_ptr_w(fdt, offset);
++ nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
++
++ err = _fdt_splice_struct(fdt, nh, 0, nodelen);
++ if (err)
++ return err;
++
++ nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
++ memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
++ memcpy(nh->name, name, namelen);
++ endtag = (uint32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
++ *endtag = cpu_to_fdt32(FDT_END_NODE);
++
++ return offset;
++}
++
++int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
++{
++ return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
++}
++
++int fdt_del_node(void *fdt, int nodeoffset)
++{
++ int endoffset;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ endoffset = _fdt_node_end_offset(fdt, nodeoffset);
++ if (endoffset < 0)
++ return endoffset;
++
++ return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
++ endoffset - nodeoffset, 0);
++}
++
++static void _fdt_packblocks(const char *old, char *new,
++ int mem_rsv_size, int struct_size)
++{
++ int mem_rsv_off, struct_off, strings_off;
++
++ mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8);
++ struct_off = mem_rsv_off + mem_rsv_size;
++ strings_off = struct_off + struct_size;
++
++ memmove(new + mem_rsv_off, old + fdt_off_mem_rsvmap(old), mem_rsv_size);
++ fdt_set_off_mem_rsvmap(new, mem_rsv_off);
++
++ memmove(new + struct_off, old + fdt_off_dt_struct(old), struct_size);
++ fdt_set_off_dt_struct(new, struct_off);
++ fdt_set_size_dt_struct(new, struct_size);
++
++ memmove(new + strings_off, old + fdt_off_dt_strings(old),
++ fdt_size_dt_strings(old));
++ fdt_set_off_dt_strings(new, strings_off);
++ fdt_set_size_dt_strings(new, fdt_size_dt_strings(old));
++}
++
++int fdt_open_into(const void *fdt, void *buf, int bufsize)
++{
++ int err;
++ int mem_rsv_size, struct_size;
++ int newsize;
++ const char *fdtstart = fdt;
++ const char *fdtend = fdtstart + fdt_totalsize(fdt);
++ char *tmp;
++
++ FDT_CHECK_HEADER(fdt);
++
++ mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
++ * sizeof(struct fdt_reserve_entry);
++
++ if (fdt_version(fdt) >= 17) {
++ struct_size = fdt_size_dt_struct(fdt);
++ } else {
++ struct_size = 0;
++ while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
++ ;
++ }
++
++ if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
++ /* no further work necessary */
++ err = fdt_move(fdt, buf, bufsize);
++ if (err)
++ return err;
++ fdt_set_version(buf, 17);
++ fdt_set_size_dt_struct(buf, struct_size);
++ fdt_set_totalsize(buf, bufsize);
++ return 0;
++ }
++
++ /* Need to reorder */
++ newsize = FDT_ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
++ + struct_size + fdt_size_dt_strings(fdt);
++
++ if (bufsize < newsize)
++ return -FDT_ERR_NOSPACE;
++
++ /* First attempt to build converted tree at beginning of buffer */
++ tmp = buf;
++ /* But if that overlaps with the old tree... */
++ if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
++ /* Try right after the old tree instead */
++ tmp = (char *)(uintptr_t)fdtend;
++ if ((tmp + newsize) > ((char *)buf + bufsize))
++ return -FDT_ERR_NOSPACE;
++ }
++
++ _fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size);
++ memmove(buf, tmp, newsize);
++
++ fdt_set_magic(buf, FDT_MAGIC);
++ fdt_set_totalsize(buf, bufsize);
++ fdt_set_version(buf, 17);
++ fdt_set_last_comp_version(buf, 16);
++ fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
++
++ return 0;
++}
++
++int fdt_pack(void *fdt)
++{
++ int mem_rsv_size;
++
++ FDT_RW_CHECK_HEADER(fdt);
++
++ mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
++ * sizeof(struct fdt_reserve_entry);
++ _fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
++ fdt_set_totalsize(fdt, _fdt_data_size(fdt));
++
++ return 0;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_strerror.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_strerror.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_strerror.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_strerror.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,96 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++struct fdt_errtabent {
++ const char *str;
++};
++
++#define FDT_ERRTABENT(val) \
++ [(val)] = { .str = #val, }
++
++static struct fdt_errtabent fdt_errtable[] = {
++ FDT_ERRTABENT(FDT_ERR_NOTFOUND),
++ FDT_ERRTABENT(FDT_ERR_EXISTS),
++ FDT_ERRTABENT(FDT_ERR_NOSPACE),
++
++ FDT_ERRTABENT(FDT_ERR_BADOFFSET),
++ FDT_ERRTABENT(FDT_ERR_BADPATH),
++ FDT_ERRTABENT(FDT_ERR_BADSTATE),
++
++ FDT_ERRTABENT(FDT_ERR_TRUNCATED),
++ FDT_ERRTABENT(FDT_ERR_BADMAGIC),
++ FDT_ERRTABENT(FDT_ERR_BADVERSION),
++ FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE),
++ FDT_ERRTABENT(FDT_ERR_BADLAYOUT),
++};
++#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
++
++const char *fdt_strerror(int errval)
++{
++ if (errval > 0)
++ return "<valid offset/length>";
++ else if (errval == 0)
++ return "<no error>";
++ else if (errval > -FDT_ERRTABSIZE) {
++ const char *s = fdt_errtable[-errval].str;
++
++ if (s)
++ return s;
++ }
++
++ return "<unknown error>";
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_sw.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_sw.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_sw.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_sw.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,257 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++static int _fdt_sw_check_header(void *fdt)
++{
++ if (fdt_magic(fdt) != FDT_SW_MAGIC)
++ return -FDT_ERR_BADMAGIC;
++ /* FIXME: should check more details about the header state */
++ return 0;
++}
++
++#define FDT_SW_CHECK_HEADER(fdt) \
++ { \
++ int err; \
++ if ((err = _fdt_sw_check_header(fdt)) != 0) \
++ return err; \
++ }
++
++static void *_fdt_grab_space(void *fdt, int len)
++{
++ int offset = fdt_size_dt_struct(fdt);
++ int spaceleft;
++
++ spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
++ - fdt_size_dt_strings(fdt);
++
++ if ((offset + len < offset) || (offset + len > spaceleft))
++ return NULL;
++
++ fdt_set_size_dt_struct(fdt, offset + len);
++ return fdt_offset_ptr_w(fdt, offset, len);
++}
++
++int fdt_create(void *buf, int bufsize)
++{
++ void *fdt = buf;
++
++ if (bufsize < sizeof(struct fdt_header))
++ return -FDT_ERR_NOSPACE;
++
++ memset(buf, 0, bufsize);
++
++ fdt_set_magic(fdt, FDT_SW_MAGIC);
++ fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
++ fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
++ fdt_set_totalsize(fdt, bufsize);
++
++ fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header),
++ sizeof(struct fdt_reserve_entry)));
++ fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
++ fdt_set_off_dt_strings(fdt, bufsize);
++
++ return 0;
++}
++
++int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
++{
++ struct fdt_reserve_entry *re;
++ int offset;
++
++ FDT_SW_CHECK_HEADER(fdt);
++
++ if (fdt_size_dt_struct(fdt))
++ return -FDT_ERR_BADSTATE;
++
++ offset = fdt_off_dt_struct(fdt);
++ if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
++ return -FDT_ERR_NOSPACE;
++
++ re = (struct fdt_reserve_entry *)((char *)fdt + offset);
++ re->address = cpu_to_fdt64(addr);
++ re->size = cpu_to_fdt64(size);
++
++ fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
++
++ return 0;
++}
++
++int fdt_finish_reservemap(void *fdt)
++{
++ return fdt_add_reservemap_entry(fdt, 0, 0);
++}
++
++int fdt_begin_node(void *fdt, const char *name)
++{
++ struct fdt_node_header *nh;
++ int namelen = strlen(name) + 1;
++
++ FDT_SW_CHECK_HEADER(fdt);
++
++ nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
++ if (! nh)
++ return -FDT_ERR_NOSPACE;
++
++ nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
++ memcpy(nh->name, name, namelen);
++ return 0;
++}
++
++int fdt_end_node(void *fdt)
++{
++ uint32_t *en;
++
++ FDT_SW_CHECK_HEADER(fdt);
++
++ en = _fdt_grab_space(fdt, FDT_TAGSIZE);
++ if (! en)
++ return -FDT_ERR_NOSPACE;
++
++ *en = cpu_to_fdt32(FDT_END_NODE);
++ return 0;
++}
++
++static int _fdt_find_add_string(void *fdt, const char *s)
++{
++ char *strtab = (char *)fdt + fdt_totalsize(fdt);
++ const char *p;
++ int strtabsize = fdt_size_dt_strings(fdt);
++ int len = strlen(s) + 1;
++ int struct_top, offset;
++
++ p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
++ if (p)
++ return p - strtab;
++
++ /* Add it */
++ offset = -strtabsize - len;
++ struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
++ if (fdt_totalsize(fdt) + offset < struct_top)
++ return 0; /* no more room :( */
++
++ memcpy(strtab + offset, s, len);
++ fdt_set_size_dt_strings(fdt, strtabsize + len);
++ return offset;
++}
++
++int fdt_property(void *fdt, const char *name, const void *val, int len)
++{
++ struct fdt_property *prop;
++ int nameoff;
++
++ FDT_SW_CHECK_HEADER(fdt);
++
++ nameoff = _fdt_find_add_string(fdt, name);
++ if (nameoff == 0)
++ return -FDT_ERR_NOSPACE;
++
++ prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
++ if (! prop)
++ return -FDT_ERR_NOSPACE;
++
++ prop->tag = cpu_to_fdt32(FDT_PROP);
++ prop->nameoff = cpu_to_fdt32(nameoff);
++ prop->len = cpu_to_fdt32(len);
++ memcpy(prop->data, val, len);
++ return 0;
++}
++
++int fdt_finish(void *fdt)
++{
++ char *p = (char *)fdt;
++ uint32_t *end;
++ int oldstroffset, newstroffset;
++ uint32_t tag;
++ int offset, nextoffset;
++
++ FDT_SW_CHECK_HEADER(fdt);
++
++ /* Add terminator */
++ end = _fdt_grab_space(fdt, sizeof(*end));
++ if (! end)
++ return -FDT_ERR_NOSPACE;
++ *end = cpu_to_fdt32(FDT_END);
++
++ /* Relocate the string table */
++ oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
++ newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
++ memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
++ fdt_set_off_dt_strings(fdt, newstroffset);
++
++ /* Walk the structure, correcting string offsets */
++ offset = 0;
++ while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
++ if (tag == FDT_PROP) {
++ struct fdt_property *prop =
++ fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
++ int nameoff;
++
++ if (! prop)
++ return -FDT_ERR_BADSTRUCTURE;
++
++ nameoff = fdt32_to_cpu(prop->nameoff);
++ nameoff += fdt_size_dt_strings(fdt);
++ prop->nameoff = cpu_to_fdt32(nameoff);
++ }
++ offset = nextoffset;
++ }
++
++ /* Finally, adjust the header */
++ fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
++ fdt_set_magic(fdt, FDT_MAGIC);
++ return 0;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_wip.c linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_wip.c
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/fdt_wip.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/fdt_wip.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,145 @@
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include "libfdt_env.h"
++
++#include <fdt.h>
++#include <libfdt.h>
++
++#include "libfdt_internal.h"
++
++int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
++ const void *val, int len)
++{
++ void *propval;
++ int proplen;
++
++ propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
++ if (! propval)
++ return proplen;
++
++ if (proplen != len)
++ return -FDT_ERR_NOSPACE;
++
++ memcpy(propval, val, len);
++ return 0;
++}
++
++static void _fdt_nop_region(void *start, int len)
++{
++ uint32_t *p;
++
++ for (p = start; (char *)p < ((char *)start + len); p++)
++ *p = cpu_to_fdt32(FDT_NOP);
++}
++
++int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
++{
++ struct fdt_property *prop;
++ int len;
++
++ prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
++ if (! prop)
++ return len;
++
++ _fdt_nop_region(prop, len + sizeof(*prop));
++
++ return 0;
++}
++
++int _fdt_node_end_offset(void *fdt, int nodeoffset)
++{
++ int level = 0;
++ uint32_t tag;
++ int offset, nextoffset;
++
++ tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
++ if (tag != FDT_BEGIN_NODE)
++ return -FDT_ERR_BADOFFSET;
++ do {
++ offset = nextoffset;
++ tag = fdt_next_tag(fdt, offset, &nextoffset);
++
++ switch (tag) {
++ case FDT_END:
++ return offset;
++
++ case FDT_BEGIN_NODE:
++ level++;
++ break;
++
++ case FDT_END_NODE:
++ level--;
++ break;
++
++ case FDT_PROP:
++ case FDT_NOP:
++ break;
++
++ default:
++ return -FDT_ERR_BADSTRUCTURE;
++ }
++ } while (level >= 0);
++
++ return nextoffset;
++}
++
++int fdt_nop_node(void *fdt, int nodeoffset)
++{
++ int endoffset;
++
++ endoffset = _fdt_node_end_offset(fdt, nodeoffset);
++ if (endoffset < 0)
++ return endoffset;
++
++ _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0),
++ endoffset - nodeoffset);
++ return 0;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt_env.h linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt_env.h
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt_env.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt_env.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,23 @@
++#ifndef _LIBFDT_ENV_H
++#define _LIBFDT_ENV_H
++
++#include <stddef.h>
++#include <stdint.h>
++#include <string.h>
++
++#define _B(n) ((unsigned long long)((uint8_t *)&x)[n])
++static inline uint32_t fdt32_to_cpu(uint32_t x)
++{
++ return (_B(0) << 24) | (_B(1) << 16) | (_B(2) << 8) | _B(3);
++}
++#define cpu_to_fdt32(x) fdt32_to_cpu(x)
++
++static inline uint64_t fdt64_to_cpu(uint64_t x)
++{
++ return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
++ | (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
++}
++#define cpu_to_fdt64(x) fdt64_to_cpu(x)
++#undef _B
++
++#endif /* _LIBFDT_ENV_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt.h linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt.h
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,1076 @@
++#ifndef _LIBFDT_H
++#define _LIBFDT_H
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include <libfdt_env.h>
++#include <fdt.h>
++
++#define FDT_FIRST_SUPPORTED_VERSION 0x10
++#define FDT_LAST_SUPPORTED_VERSION 0x11
++
++/* Error codes: informative error codes */
++#define FDT_ERR_NOTFOUND 1
++ /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
++#define FDT_ERR_EXISTS 2
++ /* FDT_ERR_EXISTS: Attemped to create a node or property which
++ * already exists */
++#define FDT_ERR_NOSPACE 3
++ /* FDT_ERR_NOSPACE: Operation needed to expand the device
++ * tree, but its buffer did not have sufficient space to
++ * contain the expanded tree. Use fdt_open_into() to move the
++ * device tree to a buffer with more space. */
++
++/* Error codes: codes for bad parameters */
++#define FDT_ERR_BADOFFSET 4
++ /* FDT_ERR_BADOFFSET: Function was passed a structure block
++ * offset which is out-of-bounds, or which points to an
++ * unsuitable part of the structure for the operation. */
++#define FDT_ERR_BADPATH 5
++ /* FDT_ERR_BADPATH: Function was passed a badly formatted path
++ * (e.g. missing a leading / for a function which requires an
++ * absolute path) */
++#define FDT_ERR_BADPHANDLE 6
++ /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
++ * value. phandle values of 0 and -1 are not permitted. */
++#define FDT_ERR_BADSTATE 7
++ /* FDT_ERR_BADSTATE: Function was passed an incomplete device
++ * tree created by the sequential-write functions, which is
++ * not sufficiently complete for the requested operation. */
++
++/* Error codes: codes for bad device tree blobs */
++#define FDT_ERR_TRUNCATED 8
++ /* FDT_ERR_TRUNCATED: Structure block of the given device tree
++ * ends without an FDT_END tag. */
++#define FDT_ERR_BADMAGIC 9
++ /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
++ * device tree at all - it is missing the flattened device
++ * tree magic number. */
++#define FDT_ERR_BADVERSION 10
++ /* FDT_ERR_BADVERSION: Given device tree has a version which
++ * can't be handled by the requested operation. For
++ * read-write functions, this may mean that fdt_open_into() is
++ * required to convert the tree to the expected version. */
++#define FDT_ERR_BADSTRUCTURE 11
++ /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
++ * structure block or other serious error (e.g. misnested
++ * nodes, or subnodes preceding properties). */
++#define FDT_ERR_BADLAYOUT 12
++ /* FDT_ERR_BADLAYOUT: For read-write functions, the given
++ * device tree has it's sub-blocks in an order that the
++ * function can't handle (memory reserve map, then structure,
++ * then strings). Use fdt_open_into() to reorganize the tree
++ * into a form suitable for the read-write operations. */
++
++/* "Can't happen" error indicating a bug in libfdt */
++#define FDT_ERR_INTERNAL 13
++ /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
++ * Should never be returned, if it is, it indicates a bug in
++ * libfdt itself. */
++
++#define FDT_ERR_MAX 13
++
++/**********************************************************************/
++/* Low-level functions (you probably don't need these) */
++/**********************************************************************/
++
++const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
++static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
++{
++ return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
++}
++
++uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
++
++/**********************************************************************/
++/* Traversal functions */
++/**********************************************************************/
++
++int fdt_next_node(const void *fdt, int offset, int *depth);
++
++/**********************************************************************/
++/* General functions */
++/**********************************************************************/
++
++#define fdt_get_header(fdt, field) \
++ (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
++#define fdt_magic(fdt) (fdt_get_header(fdt, magic))
++#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
++#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
++#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
++#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
++#define fdt_version(fdt) (fdt_get_header(fdt, version))
++#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
++#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
++#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
++#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
++
++#define __fdt_set_hdr(name) \
++ static inline void fdt_set_##name(void *fdt, uint32_t val) \
++ { \
++ struct fdt_header *fdth = fdt; \
++ fdth->name = cpu_to_fdt32(val); \
++ }
++__fdt_set_hdr(magic);
++__fdt_set_hdr(totalsize);
++__fdt_set_hdr(off_dt_struct);
++__fdt_set_hdr(off_dt_strings);
++__fdt_set_hdr(off_mem_rsvmap);
++__fdt_set_hdr(version);
++__fdt_set_hdr(last_comp_version);
++__fdt_set_hdr(boot_cpuid_phys);
++__fdt_set_hdr(size_dt_strings);
++__fdt_set_hdr(size_dt_struct);
++#undef __fdt_set_hdr
++
++/**
++ * fdt_check_header - sanity check a device tree or possible device tree
++ * @fdt: pointer to data which might be a flattened device tree
++ *
++ * fdt_check_header() checks that the given buffer contains what
++ * appears to be a flattened device tree with sane information in its
++ * header.
++ *
++ * returns:
++ * 0, if the buffer appears to contain a valid device tree
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE, standard meanings, as above
++ */
++int fdt_check_header(const void *fdt);
++
++/**
++ * fdt_move - move a device tree around in memory
++ * @fdt: pointer to the device tree to move
++ * @buf: pointer to memory where the device is to be moved
++ * @bufsize: size of the memory space at buf
++ *
++ * fdt_move() relocates, if possible, the device tree blob located at
++ * fdt to the buffer at buf of size bufsize. The buffer may overlap
++ * with the existing device tree blob at fdt. Therefore,
++ * fdt_move(fdt, fdt, fdt_totalsize(fdt))
++ * should always succeed.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE, standard meanings
++ */
++int fdt_move(const void *fdt, void *buf, int bufsize);
++
++/**********************************************************************/
++/* Read-only functions */
++/**********************************************************************/
++
++/**
++ * fdt_string - retrieve a string from the strings block of a device tree
++ * @fdt: pointer to the device tree blob
++ * @stroffset: offset of the string within the strings block (native endian)
++ *
++ * fdt_string() retrieves a pointer to a single string from the
++ * strings block of the device tree blob at fdt.
++ *
++ * returns:
++ * a pointer to the string, on success
++ * NULL, if stroffset is out of bounds
++ */
++const char *fdt_string(const void *fdt, int stroffset);
++
++/**
++ * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
++ * @fdt: pointer to the device tree blob
++ *
++ * Returns the number of entries in the device tree blob's memory
++ * reservation map. This does not include the terminating 0,0 entry
++ * or any other (0,0) entries reserved for expansion.
++ *
++ * returns:
++ * the number of entries
++ */
++int fdt_num_mem_rsv(const void *fdt);
++
++/**
++ * fdt_get_mem_rsv - retrieve one memory reserve map entry
++ * @fdt: pointer to the device tree blob
++ * @address, @size: pointers to 64-bit variables
++ *
++ * On success, *address and *size will contain the address and size of
++ * the n-th reserve map entry from the device tree blob, in
++ * native-endian format.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE, standard meanings
++ */
++int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
++
++/**
++ * fdt_subnode_offset_namelen - find a subnode based on substring
++ * @fdt: pointer to the device tree blob
++ * @parentoffset: structure block offset of a node
++ * @name: name of the subnode to locate
++ * @namelen: number of characters of name to consider
++ *
++ * Identical to fdt_subnode_offset(), but only examine the first
++ * namelen characters of name for matching the subnode name. This is
++ * useful for finding subnodes based on a portion of a larger string,
++ * such as a full path.
++ */
++int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
++ const char *name, int namelen);
++/**
++ * fdt_subnode_offset - find a subnode of a given node
++ * @fdt: pointer to the device tree blob
++ * @parentoffset: structure block offset of a node
++ * @name: name of the subnode to locate
++ *
++ * fdt_subnode_offset() finds a subnode of the node at structure block
++ * offset parentoffset with the given name. name may include a unit
++ * address, in which case fdt_subnode_offset() will find the subnode
++ * with that unit address, or the unit address may be omitted, in
++ * which case fdt_subnode_offset() will find an arbitrary subnode
++ * whose name excluding unit address matches the given name.
++ *
++ * returns:
++ * structure block offset of the requested subnode (>=0), on success
++ * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
++ * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings.
++ */
++int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
++
++/**
++ * fdt_path_offset - find a tree node by its full path
++ * @fdt: pointer to the device tree blob
++ * @path: full path of the node to locate
++ *
++ * fdt_path_offset() finds a node of a given path in the device tree.
++ * Each path component may omit the unit address portion, but the
++ * results of this are undefined if any such path component is
++ * ambiguous (that is if there are multiple nodes at the relevant
++ * level matching the given component, differentiated only by unit
++ * address).
++ *
++ * returns:
++ * structure block offset of the node with the requested path (>=0), on success
++ * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
++ * -FDT_ERR_NOTFOUND, if the requested node does not exist
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings.
++ */
++int fdt_path_offset(const void *fdt, const char *path);
++
++/**
++ * fdt_get_name - retrieve the name of a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: structure block offset of the starting node
++ * @lenp: pointer to an integer variable (will be overwritten) or NULL
++ *
++ * fdt_get_name() retrieves the name (including unit address) of the
++ * device tree node at structure block offset nodeoffset. If lenp is
++ * non-NULL, the length of this name is also returned, in the integer
++ * pointed to by lenp.
++ *
++ * returns:
++ * pointer to the node's name, on success
++ * If lenp is non-NULL, *lenp contains the length of that name (>=0)
++ * NULL, on error
++ * if lenp is non-NULL *lenp contains an error code (<0):
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE, standard meanings
++ */
++const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
++
++/**
++ * fdt_get_property - find a given property in a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to find
++ * @name: name of the property to find
++ * @lenp: pointer to an integer variable (will be overwritten) or NULL
++ *
++ * fdt_get_property() retrieves a pointer to the fdt_property
++ * structure within the device tree blob corresponding to the property
++ * named 'name' of the node at offset nodeoffset. If lenp is
++ * non-NULL, the length of the property value is also returned, in the
++ * integer pointed to by lenp.
++ *
++ * returns:
++ * pointer to the structure representing the property
++ * if lenp is non-NULL, *lenp contains the length of the property
++ * value (>=0)
++ * NULL, on error
++ * if lenp is non-NULL, *lenp contains an error code (<0):
++ * -FDT_ERR_NOTFOUND, node does not have named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
++ const char *name, int *lenp);
++static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
++ const char *name,
++ int *lenp)
++{
++ return (struct fdt_property *)(uintptr_t)
++ fdt_get_property(fdt, nodeoffset, name, lenp);
++}
++
++/**
++ * fdt_getprop - retrieve the value of a given property
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to find
++ * @name: name of the property to find
++ * @lenp: pointer to an integer variable (will be overwritten) or NULL
++ *
++ * fdt_getprop() retrieves a pointer to the value of the property
++ * named 'name' of the node at offset nodeoffset (this will be a
++ * pointer to within the device blob itself, not a copy of the value).
++ * If lenp is non-NULL, the length of the property value is also
++ * returned, in the integer pointed to by lenp.
++ *
++ * returns:
++ * pointer to the property's value
++ * if lenp is non-NULL, *lenp contains the length of the property
++ * value (>=0)
++ * NULL, on error
++ * if lenp is non-NULL, *lenp contains an error code (<0):
++ * -FDT_ERR_NOTFOUND, node does not have named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++const void *fdt_getprop(const void *fdt, int nodeoffset,
++ const char *name, int *lenp);
++static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
++ const char *name, int *lenp)
++{
++ return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
++}
++
++/**
++ * fdt_get_phandle - retrieve the phandle of a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: structure block offset of the node
++ *
++ * fdt_get_phandle() retrieves the phandle of the device tree node at
++ * structure block offset nodeoffset.
++ *
++ * returns:
++ * the phandle of the node at nodeoffset, on success (!= 0, != -1)
++ * 0, if the node has no phandle, or another error occurs
++ */
++uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
++
++/**
++ * fdt_get_path - determine the full path of a node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose path to find
++ * @buf: character buffer to contain the returned path (will be overwritten)
++ * @buflen: size of the character buffer at buf
++ *
++ * fdt_get_path() computes the full path of the node at offset
++ * nodeoffset, and records that path in the buffer at buf.
++ *
++ * NOTE: This function is expensive, as it must scan the device tree
++ * structure from the start to nodeoffset.
++ *
++ * returns:
++ * 0, on success
++ * buf contains the absolute path of the node at
++ * nodeoffset, as a NUL-terminated string.
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
++ * characters and will not fit in the given buffer.
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
++
++/**
++ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose parent to find
++ * @supernodedepth: depth of the ancestor to find
++ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
++ *
++ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
++ * at a specific depth from the root (where the root itself has depth
++ * 0, its immediate subnodes depth 1 and so forth). So
++ * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
++ * will always return 0, the offset of the root node. If the node at
++ * nodeoffset has depth D, then:
++ * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
++ * will return nodeoffset itself.
++ *
++ * NOTE: This function is expensive, as it must scan the device tree
++ * structure from the start to nodeoffset.
++ *
++ * returns:
++
++ * structure block offset of the node at node offset's ancestor
++ * of depth supernodedepth (>=0), on success
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++* -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
++ int supernodedepth, int *nodedepth);
++
++/**
++ * fdt_node_depth - find the depth of a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose parent to find
++ *
++ * fdt_node_depth() finds the depth of a given node. The root node
++ * has depth 0, its immediate subnodes depth 1 and so forth.
++ *
++ * NOTE: This function is expensive, as it must scan the device tree
++ * structure from the start to nodeoffset.
++ *
++ * returns:
++ * depth of the node at nodeoffset (>=0), on success
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_node_depth(const void *fdt, int nodeoffset);
++
++/**
++ * fdt_parent_offset - find the parent of a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose parent to find
++ *
++ * fdt_parent_offset() locates the parent node of a given node (that
++ * is, it finds the offset of the node which contains the node at
++ * nodeoffset as a subnode).
++ *
++ * NOTE: This function is expensive, as it must scan the device tree
++ * structure from the start to nodeoffset, *twice*.
++ *
++ * returns:
++ * structure block offset of the parent of the node at nodeoffset
++ * (>=0), on success
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_parent_offset(const void *fdt, int nodeoffset);
++
++/**
++ * fdt_node_offset_by_prop_value - find nodes with a given property value
++ * @fdt: pointer to the device tree blob
++ * @startoffset: only find nodes after this offset
++ * @propname: property name to check
++ * @propval: property value to search for
++ * @proplen: length of the value in propval
++ *
++ * fdt_node_offset_by_prop_value() returns the offset of the first
++ * node after startoffset, which has a property named propname whose
++ * value is of length proplen and has value equal to propval; or if
++ * startoffset is -1, the very first such node in the tree.
++ *
++ * To iterate through all nodes matching the criterion, the following
++ * idiom can be used:
++ * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
++ * propval, proplen);
++ * while (offset != -FDT_ERR_NOTFOUND) {
++ * // other code here
++ * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
++ * propval, proplen);
++ * }
++ *
++ * Note the -1 in the first call to the function, if 0 is used here
++ * instead, the function will never locate the root node, even if it
++ * matches the criterion.
++ *
++ * returns:
++ * structure block offset of the located node (>= 0, >startoffset),
++ * on success
++ * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
++ * tree after startoffset
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
++ const char *propname,
++ const void *propval, int proplen);
++
++/**
++ * fdt_node_offset_by_phandle - find the node with a given phandle
++ * @fdt: pointer to the device tree blob
++ * @phandle: phandle value
++ *
++ * fdt_node_offset_by_phandle() returns the offset of the node
++ * which has the given phandle value. If there is more than one node
++ * in the tree with the given phandle (an invalid tree), results are
++ * undefined.
++ *
++ * returns:
++ * structure block offset of the located node (>= 0), on success
++ * -FDT_ERR_NOTFOUND, no node with that phandle exists
++ * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
++
++/**
++ * fdt_node_check_compatible: check a node's compatible property
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of a tree node
++ * @compatible: string to match against
++ *
++ *
++ * fdt_node_check_compatible() returns 0 if the given node contains a
++ * 'compatible' property with the given string as one of its elements,
++ * it returns non-zero otherwise, or on error.
++ *
++ * returns:
++ * 0, if the node has a 'compatible' property listing the given string
++ * 1, if the node has a 'compatible' property, but it does not list
++ * the given string
++ * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
++ * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_node_check_compatible(const void *fdt, int nodeoffset,
++ const char *compatible);
++
++/**
++ * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
++ * @fdt: pointer to the device tree blob
++ * @startoffset: only find nodes after this offset
++ * @compatible: 'compatible' string to match against
++ *
++ * fdt_node_offset_by_compatible() returns the offset of the first
++ * node after startoffset, which has a 'compatible' property which
++ * lists the given compatible string; or if startoffset is -1, the
++ * very first such node in the tree.
++ *
++ * To iterate through all nodes matching the criterion, the following
++ * idiom can be used:
++ * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
++ * while (offset != -FDT_ERR_NOTFOUND) {
++ * // other code here
++ * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
++ * }
++ *
++ * Note the -1 in the first call to the function, if 0 is used here
++ * instead, the function will never locate the root node, even if it
++ * matches the criterion.
++ *
++ * returns:
++ * structure block offset of the located node (>= 0, >startoffset),
++ * on success
++ * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
++ * tree after startoffset
++ * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE, standard meanings
++ */
++int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
++ const char *compatible);
++
++/**********************************************************************/
++/* Write-in-place functions */
++/**********************************************************************/
++
++/**
++ * fdt_setprop_inplace - change a property's value, but not its size
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to change
++ * @name: name of the property to change
++ * @val: pointer to data to replace the property value with
++ * @len: length of the property value
++ *
++ * fdt_setprop_inplace() replaces the value of a given property with
++ * the data in val, of length len. This function cannot change the
++ * size of a property, and so will only work if len is equal to the
++ * current length of the property.
++ *
++ * This function will alter only the bytes in the blob which contain
++ * the given property value, and will not alter or move any other part
++ * of the tree.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, if len is not equal to the property's current length
++ * -FDT_ERR_NOTFOUND, node does not have the named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
++ const void *val, int len);
++
++/**
++ * fdt_setprop_inplace_cell - change the value of a single-cell property
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to change
++ * @name: name of the property to change
++ * @val: cell (32-bit integer) value to replace the property with
++ *
++ * fdt_setprop_inplace_cell() replaces the value of a given property
++ * with the 32-bit integer cell value in val, converting val to
++ * big-endian if necessary. This function cannot change the size of a
++ * property, and so will only work if the property already exists and
++ * has length 4.
++ *
++ * This function will alter only the bytes in the blob which contain
++ * the given property value, and will not alter or move any other part
++ * of the tree.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, if the property's length is not equal to 4
++ * -FDT_ERR_NOTFOUND, node does not have the named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
++ const char *name, uint32_t val)
++{
++ val = cpu_to_fdt32(val);
++ return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
++}
++
++/**
++ * fdt_nop_property - replace a property with nop tags
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to nop
++ * @name: name of the property to nop
++ *
++ * fdt_nop_property() will replace a given property's representation
++ * in the blob with FDT_NOP tags, effectively removing it from the
++ * tree.
++ *
++ * This function will alter only the bytes in the blob which contain
++ * the property, and will not alter or move any other part of the
++ * tree.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOTFOUND, node does not have the named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
++
++/**
++ * fdt_nop_node - replace a node (subtree) with nop tags
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node to nop
++ *
++ * fdt_nop_node() will replace a given node's representation in the
++ * blob, including all its subnodes, if any, with FDT_NOP tags,
++ * effectively removing it from the tree.
++ *
++ * This function will alter only the bytes in the blob which contain
++ * the node and its properties and subnodes, and will not alter or
++ * move any other part of the tree.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_nop_node(void *fdt, int nodeoffset);
++
++/**********************************************************************/
++/* Sequential write functions */
++/**********************************************************************/
++
++int fdt_create(void *buf, int bufsize);
++int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
++int fdt_finish_reservemap(void *fdt);
++int fdt_begin_node(void *fdt, const char *name);
++int fdt_property(void *fdt, const char *name, const void *val, int len);
++static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
++{
++ val = cpu_to_fdt32(val);
++ return fdt_property(fdt, name, &val, sizeof(val));
++}
++#define fdt_property_string(fdt, name, str) \
++ fdt_property(fdt, name, str, strlen(str)+1)
++int fdt_end_node(void *fdt);
++int fdt_finish(void *fdt);
++
++/**********************************************************************/
++/* Read-write functions */
++/**********************************************************************/
++
++int fdt_open_into(const void *fdt, void *buf, int bufsize);
++int fdt_pack(void *fdt);
++
++/**
++ * fdt_add_mem_rsv - add one memory reserve map entry
++ * @fdt: pointer to the device tree blob
++ * @address, @size: 64-bit values (native endian)
++ *
++ * Adds a reserve map entry to the given blob reserving a region at
++ * address address of length size.
++ *
++ * This function will insert data into the reserve map and will
++ * therefore change the indexes of some entries in the table.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
++ * contain the new reservation entry
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
++
++/**
++ * fdt_del_mem_rsv - remove a memory reserve map entry
++ * @fdt: pointer to the device tree blob
++ * @n: entry to remove
++ *
++ * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
++ * the blob.
++ *
++ * This function will delete data from the reservation table and will
++ * therefore change the indexes of some entries in the table.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
++ * are less than n+1 reserve map entries)
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_del_mem_rsv(void *fdt, int n);
++
++/**
++ * fdt_set_name - change the name of a given node
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: structure block offset of a node
++ * @name: name to give the node
++ *
++ * fdt_set_name() replaces the name (including unit address, if any)
++ * of the given node with the given string. NOTE: this function can't
++ * efficiently check if the new name is unique amongst the given
++ * node's siblings; results are undefined if this function is invoked
++ * with a name equal to one of the given node's siblings.
++ *
++ * This function may insert or delete data from the blob, and will
++ * therefore change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob
++ * to contain the new name
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE, standard meanings
++ */
++int fdt_set_name(void *fdt, int nodeoffset, const char *name);
++
++/**
++ * fdt_setprop - create or change a property
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to change
++ * @name: name of the property to change
++ * @val: pointer to data to set the property value to
++ * @len: length of the property value
++ *
++ * fdt_setprop() sets the value of the named property in the given
++ * node to the given value and length, creating the property if it
++ * does not already exist.
++ *
++ * This function may insert or delete data from the blob, and will
++ * therefore change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
++ * contain the new property value
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_setprop(void *fdt, int nodeoffset, const char *name,
++ const void *val, int len);
++
++/**
++ * fdt_setprop_cell - set a property to a single cell value
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to change
++ * @name: name of the property to change
++ * @val: 32-bit integer value for the property (native endian)
++ *
++ * fdt_setprop_cell() sets the value of the named property in the
++ * given node to the given cell value (converting to big-endian if
++ * necessary), or creates a new property with that value if it does
++ * not already exist.
++ *
++ * This function may insert or delete data from the blob, and will
++ * therefore change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
++ * contain the new property value
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
++ uint32_t val)
++{
++ val = cpu_to_fdt32(val);
++ return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
++}
++
++/**
++ * fdt_setprop_string - set a property to a string value
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to change
++ * @name: name of the property to change
++ * @str: string value for the property
++ *
++ * fdt_setprop_string() sets the value of the named property in the
++ * given node to the given string value (using the length of the
++ * string to determine the new length of the property), or creates a
++ * new property with that value if it does not already exist.
++ *
++ * This function may insert or delete data from the blob, and will
++ * therefore change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
++ * contain the new property value
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++#define fdt_setprop_string(fdt, nodeoffset, name, str) \
++ fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
++
++/**
++ * fdt_delprop - delete a property
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node whose property to nop
++ * @name: name of the property to nop
++ *
++ * fdt_del_property() will delete the given property.
++ *
++ * This function will delete data from the blob, and will therefore
++ * change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_NOTFOUND, node does not have the named property
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_delprop(void *fdt, int nodeoffset, const char *name);
++
++/**
++ * fdt_add_subnode_namelen - creates a new node based on substring
++ * @fdt: pointer to the device tree blob
++ * @parentoffset: structure block offset of a node
++ * @name: name of the subnode to locate
++ * @namelen: number of characters of name to consider
++ *
++ * Identical to fdt_add_subnode(), but use only the first namelen
++ * characters of name as the name of the new node. This is useful for
++ * creating subnodes based on a portion of a larger string, such as a
++ * full path.
++ */
++int fdt_add_subnode_namelen(void *fdt, int parentoffset,
++ const char *name, int namelen);
++
++/**
++ * fdt_add_subnode - creates a new node
++ * @fdt: pointer to the device tree blob
++ * @parentoffset: structure block offset of a node
++ * @name: name of the subnode to locate
++ *
++ * fdt_add_subnode() creates a new node as a subnode of the node at
++ * structure block offset parentoffset, with the given name (which
++ * should include the unit address, if any).
++ *
++ * This function will insert data into the blob, and will therefore
++ * change the offsets of some existing nodes.
++
++ * returns:
++ * structure block offset of the created nodeequested subnode (>=0), on success
++ * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
++ * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
++ * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
++ * the given name
++ * -FDT_ERR_NOSPACE, if there is insufficient free space in the
++ * blob to contain the new node
++ * -FDT_ERR_NOSPACE
++ * -FDT_ERR_BADLAYOUT
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings.
++ */
++int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
++
++/**
++ * fdt_del_node - delete a node (subtree)
++ * @fdt: pointer to the device tree blob
++ * @nodeoffset: offset of the node to nop
++ *
++ * fdt_del_node() will remove the given node, including all its
++ * subnodes if any, from the blob.
++ *
++ * This function will delete data from the blob, and will therefore
++ * change the offsets of some existing nodes.
++ *
++ * returns:
++ * 0, on success
++ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
++ * -FDT_ERR_BADLAYOUT,
++ * -FDT_ERR_BADMAGIC,
++ * -FDT_ERR_BADVERSION,
++ * -FDT_ERR_BADSTATE,
++ * -FDT_ERR_BADSTRUCTURE,
++ * -FDT_ERR_TRUNCATED, standard meanings
++ */
++int fdt_del_node(void *fdt, int nodeoffset);
++
++/**********************************************************************/
++/* Debugging / informational functions */
++/**********************************************************************/
++
++const char *fdt_strerror(int errval);
++
++#endif /* _LIBFDT_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt_internal.h linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt_internal.h
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/libfdt_internal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/libfdt_internal.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,95 @@
++#ifndef _LIBFDT_INTERNAL_H
++#define _LIBFDT_INTERNAL_H
++/*
++ * libfdt - Flat Device Tree manipulation
++ * Copyright (C) 2006 David Gibson, IBM Corporation.
++ *
++ * libfdt is dual licensed: you can use it either under the terms of
++ * the GPL, or the BSD license, at your option.
++ *
++ * a) 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 of the
++ * License, 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; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ *
++ * Alternatively,
++ *
++ * b) Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ * 2. Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
++ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
++ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++#include <fdt.h>
++
++#define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
++#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))
++
++#define FDT_CHECK_HEADER(fdt) \
++ { \
++ int err; \
++ if ((err = fdt_check_header(fdt)) != 0) \
++ return err; \
++ }
++
++uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
++int _fdt_check_node_offset(const void *fdt, int offset);
++const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
++int _fdt_node_end_offset(void *fdt, int nodeoffset);
++
++static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
++{
++ return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
++}
++
++static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
++{
++ return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
++}
++
++static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
++{
++ const struct fdt_reserve_entry *rsv_table =
++ (const struct fdt_reserve_entry *)
++ ((const char *)fdt + fdt_off_mem_rsvmap(fdt));
++
++ return rsv_table + n;
++}
++static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
++{
++ return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
++}
++
++#define FDT_SW_MAGIC (~FDT_MAGIC)
++
++#endif /* _LIBFDT_INTERNAL_H */
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/libfdt/Makefile.libfdt linux-2.6.30-rc4-git/scripts/dtc/libfdt/Makefile.libfdt
+--- linux-2.6.30-rc4/scripts/dtc/libfdt/Makefile.libfdt 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/libfdt/Makefile.libfdt 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,8 @@
++# Makefile.libfdt
++#
++# This is not a complete Makefile of itself. Instead, it is designed to
++# be easily embeddable into other systems of Makefiles.
++#
++LIBFDT_INCLUDES = fdt.h libfdt.h
++LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
++LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/livetree.c linux-2.6.30-rc4-git/scripts/dtc/livetree.c
+--- linux-2.6.30-rc4/scripts/dtc/livetree.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/livetree.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,308 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++
++/*
++ * Tree building functions
++ */
++
++struct property *build_property(char *name, struct data val, char *label)
++{
++ struct property *new = xmalloc(sizeof(*new));
++
++ new->name = name;
++ new->val = val;
++
++ new->next = NULL;
++
++ new->label = label;
++
++ return new;
++}
++
++struct property *chain_property(struct property *first, struct property *list)
++{
++ assert(first->next == NULL);
++
++ first->next = list;
++ return first;
++}
++
++struct property *reverse_properties(struct property *first)
++{
++ struct property *p = first;
++ struct property *head = NULL;
++ struct property *next;
++
++ while (p) {
++ next = p->next;
++ p->next = head;
++ head = p;
++ p = next;
++ }
++ return head;
++}
++
++struct node *build_node(struct property *proplist, struct node *children)
++{
++ struct node *new = xmalloc(sizeof(*new));
++ struct node *child;
++
++ memset(new, 0, sizeof(*new));
++
++ new->proplist = reverse_properties(proplist);
++ new->children = children;
++
++ for_each_child(new, child) {
++ child->parent = new;
++ }
++
++ return new;
++}
++
++struct node *name_node(struct node *node, char *name, char * label)
++{
++ assert(node->name == NULL);
++
++ node->name = name;
++
++ node->label = label;
++
++ return node;
++}
++
++struct node *chain_node(struct node *first, struct node *list)
++{
++ assert(first->next_sibling == NULL);
++
++ first->next_sibling = list;
++ return first;
++}
++
++void add_property(struct node *node, struct property *prop)
++{
++ struct property **p;
++
++ prop->next = NULL;
++
++ p = &node->proplist;
++ while (*p)
++ p = &((*p)->next);
++
++ *p = prop;
++}
++
++void add_child(struct node *parent, struct node *child)
++{
++ struct node **p;
++
++ child->next_sibling = NULL;
++ child->parent = parent;
++
++ p = &parent->children;
++ while (*p)
++ p = &((*p)->next_sibling);
++
++ *p = child;
++}
++
++struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size,
++ char *label)
++{
++ struct reserve_info *new = xmalloc(sizeof(*new));
++
++ new->re.address = address;
++ new->re.size = size;
++
++ new->next = NULL;
++
++ new->label = label;
++
++ return new;
++}
++
++struct reserve_info *chain_reserve_entry(struct reserve_info *first,
++ struct reserve_info *list)
++{
++ assert(first->next == NULL);
++
++ first->next = list;
++ return first;
++}
++
++struct reserve_info *add_reserve_entry(struct reserve_info *list,
++ struct reserve_info *new)
++{
++ struct reserve_info *last;
++
++ new->next = NULL;
++
++ if (! list)
++ return new;
++
++ for (last = list; last->next; last = last->next)
++ ;
++
++ last->next = new;
++
++ return list;
++}
++
++struct boot_info *build_boot_info(struct reserve_info *reservelist,
++ struct node *tree, uint32_t boot_cpuid_phys)
++{
++ struct boot_info *bi;
++
++ bi = xmalloc(sizeof(*bi));
++ bi->reservelist = reservelist;
++ bi->dt = tree;
++ bi->boot_cpuid_phys = boot_cpuid_phys;
++
++ return bi;
++}
++
++/*
++ * Tree accessor functions
++ */
++
++const char *get_unitname(struct node *node)
++{
++ if (node->name[node->basenamelen] == '\0')
++ return "";
++ else
++ return node->name + node->basenamelen + 1;
++}
++
++struct property *get_property(struct node *node, const char *propname)
++{
++ struct property *prop;
++
++ for_each_property(node, prop)
++ if (streq(prop->name, propname))
++ return prop;
++
++ return NULL;
++}
++
++cell_t propval_cell(struct property *prop)
++{
++ assert(prop->val.len == sizeof(cell_t));
++ return fdt32_to_cpu(*((cell_t *)prop->val.val));
++}
++
++struct node *get_subnode(struct node *node, const char *nodename)
++{
++ struct node *child;
++
++ for_each_child(node, child)
++ if (streq(child->name, nodename))
++ return child;
++
++ return NULL;
++}
++
++struct node *get_node_by_path(struct node *tree, const char *path)
++{
++ const char *p;
++ struct node *child;
++
++ if (!path || ! (*path))
++ return tree;
++
++ while (path[0] == '/')
++ path++;
++
++ p = strchr(path, '/');
++
++ for_each_child(tree, child) {
++ if (p && strneq(path, child->name, p-path))
++ return get_node_by_path(child, p+1);
++ else if (!p && streq(path, child->name))
++ return child;
++ }
++
++ return NULL;
++}
++
++struct node *get_node_by_label(struct node *tree, const char *label)
++{
++ struct node *child, *node;
++
++ assert(label && (strlen(label) > 0));
++
++ if (tree->label && streq(tree->label, label))
++ return tree;
++
++ for_each_child(tree, child) {
++ node = get_node_by_label(child, label);
++ if (node)
++ return node;
++ }
++
++ return NULL;
++}
++
++struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
++{
++ struct node *child, *node;
++
++ assert((phandle != 0) && (phandle != -1));
++
++ if (tree->phandle == phandle)
++ return tree;
++
++ for_each_child(tree, child) {
++ node = get_node_by_phandle(child, phandle);
++ if (node)
++ return node;
++ }
++
++ return NULL;
++}
++
++struct node *get_node_by_ref(struct node *tree, const char *ref)
++{
++ if (ref[0] == '/')
++ return get_node_by_path(tree, ref);
++ else
++ return get_node_by_label(tree, ref);
++}
++
++cell_t get_node_phandle(struct node *root, struct node *node)
++{
++ static cell_t phandle = 1; /* FIXME: ick, static local */
++
++ if ((node->phandle != 0) && (node->phandle != -1))
++ return node->phandle;
++
++ assert(! get_property(node, "linux,phandle"));
++
++ while (get_node_by_phandle(root, phandle))
++ phandle++;
++
++ node->phandle = phandle;
++ add_property(node,
++ build_property("linux,phandle",
++ data_append_cell(empty_data, phandle),
++ NULL));
++
++ return node->phandle;
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/Makefile linux-2.6.30-rc4-git/scripts/dtc/Makefile
+--- linux-2.6.30-rc4/scripts/dtc/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,54 @@
++# scripts/dtc makefile
++
++hostprogs-y := dtc
++always := $(hostprogs-y)
++
++dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
++ srcpos.o checks.o
++dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
++
++# Source files need to get at the userspace version of libfdt_env.h to compile
++
++HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
++
++HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
++
++HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
++HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
++
++# dependencies on generated files need to be listed explicitly
++$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
++$(obj)/dtc-lexer.lex.o: $(obj)/dtc-lexer.lex.c $(obj)/dtc-parser.tab.h
++
++targets += dtc-parser.tab.c dtc-lexer.lex.c
++
++clean-files += dtc-parser.tab.h
++
++# GENERATE_PARSER := 1 # Uncomment to rebuild flex/bison output
++
++ifdef GENERATE_PARSER
++
++BISON = bison
++FLEX = flex
++
++quiet_cmd_bison = BISON $@
++ cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
++quiet_cmd_flex = FLEX $@
++ cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
++
++$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
++ $(call if_changed,bison)
++
++$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c
++
++$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
++ $(call if_changed,flex)
++
++endif
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/Makefile.dtc linux-2.6.30-rc4-git/scripts/dtc/Makefile.dtc
+--- linux-2.6.30-rc4/scripts/dtc/Makefile.dtc 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/Makefile.dtc 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,9 @@
++# Makefile.dtc
++#
++# This is not a complete Makefile of itself. Instead, it is designed to
++# be easily embeddable into other systems of Makefiles.
++#
++DTC_SRCS = dtc.c flattree.c fstree.c data.c livetree.c treesource.c srcpos.c \
++ checks.c
++DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
++DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/srcpos.c linux-2.6.30-rc4-git/scripts/dtc/srcpos.c
+--- linux-2.6.30-rc4/scripts/dtc/srcpos.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/srcpos.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,116 @@
++/*
++ * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
++ *
++ * 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 "dtc.h"
++#include "srcpos.h"
++
++/*
++ * Like yylineno, this is the current open file pos.
++ */
++
++struct dtc_file *srcpos_file;
++
++static int dtc_open_one(struct dtc_file *file,
++ const char *search,
++ const char *fname)
++{
++ char *fullname;
++
++ if (search) {
++ fullname = xmalloc(strlen(search) + strlen(fname) + 2);
++
++ strcpy(fullname, search);
++ strcat(fullname, "/");
++ strcat(fullname, fname);
++ } else {
++ fullname = strdup(fname);
++ }
++
++ file->file = fopen(fullname, "r");
++ if (!file->file) {
++ free(fullname);
++ return 0;
++ }
++
++ file->name = fullname;
++ return 1;
++}
++
++
++struct dtc_file *dtc_open_file(const char *fname,
++ const struct search_path *search)
++{
++ static const struct search_path default_search = { NULL, NULL, NULL };
++
++ struct dtc_file *file;
++ const char *slash;
++
++ file = xmalloc(sizeof(struct dtc_file));
++
++ slash = strrchr(fname, '/');
++ if (slash) {
++ char *dir = xmalloc(slash - fname + 1);
++
++ memcpy(dir, fname, slash - fname);
++ dir[slash - fname] = 0;
++ file->dir = dir;
++ } else {
++ file->dir = NULL;
++ }
++
++ if (streq(fname, "-")) {
++ file->name = "stdin";
++ file->file = stdin;
++ return file;
++ }
++
++ if (fname[0] == '/') {
++ file->file = fopen(fname, "r");
++ if (!file->file)
++ goto fail;
++
++ file->name = strdup(fname);
++ return file;
++ }
++
++ if (!search)
++ search = &default_search;
++
++ while (search) {
++ if (dtc_open_one(file, search->dir, fname))
++ return file;
++
++ if (errno != ENOENT)
++ goto fail;
++
++ search = search->next;
++ }
++
++fail:
++ die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
++}
++
++void dtc_close_file(struct dtc_file *file)
++{
++ if (fclose(file->file))
++ die("Error closing \"%s\": %s\n", file->name, strerror(errno));
++
++ free(file->dir);
++ free(file);
++}
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/srcpos.h linux-2.6.30-rc4-git/scripts/dtc/srcpos.h
+--- linux-2.6.30-rc4/scripts/dtc/srcpos.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/srcpos.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,85 @@
++/*
++ * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
++ *
++ * 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
++ */
++
++/*
++ * Augment the standard YYLTYPE with a filenum index into an
++ * array of all opened filenames.
++ */
++
++#include <stdio.h>
++
++struct dtc_file {
++ char *dir;
++ const char *name;
++ FILE *file;
++};
++
++#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
++typedef struct YYLTYPE {
++ int first_line;
++ int first_column;
++ int last_line;
++ int last_column;
++ struct dtc_file *file;
++} YYLTYPE;
++
++#define YYLTYPE_IS_DECLARED 1
++#define YYLTYPE_IS_TRIVIAL 1
++#endif
++
++/* Cater to old parser templates. */
++#ifndef YYID
++#define YYID(n) (n)
++#endif
++
++#define YYLLOC_DEFAULT(Current, Rhs, N) \
++ do \
++ if (YYID (N)) \
++ { \
++ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
++ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
++ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
++ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
++ (Current).file = YYRHSLOC (Rhs, N).file; \
++ } \
++ else \
++ { \
++ (Current).first_line = (Current).last_line = \
++ YYRHSLOC (Rhs, 0).last_line; \
++ (Current).first_column = (Current).last_column = \
++ YYRHSLOC (Rhs, 0).last_column; \
++ (Current).file = YYRHSLOC (Rhs, 0).file; \
++ } \
++ while (YYID (0))
++
++
++
++extern void yyerror(char const *);
++extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
++
++extern struct dtc_file *srcpos_file;
++
++struct search_path {
++ const char *dir; /* NULL for current directory */
++ struct search_path *prev, *next;
++};
++
++extern struct dtc_file *dtc_open_file(const char *fname,
++ const struct search_path *search);
++extern void dtc_close_file(struct dtc_file *file);
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/treesource.c linux-2.6.30-rc4-git/scripts/dtc/treesource.c
+--- linux-2.6.30-rc4/scripts/dtc/treesource.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/treesource.c 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1,278 @@
++/*
++ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 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 "dtc.h"
++#include "srcpos.h"
++
++extern FILE *yyin;
++extern int yyparse(void);
++
++struct boot_info *the_boot_info;
++int treesource_error;
++
++struct boot_info *dt_from_source(const char *fname)
++{
++ the_boot_info = NULL;
++ treesource_error = 0;
++
++ srcpos_file = dtc_open_file(fname, NULL);
++ yyin = srcpos_file->file;
++
++ if (yyparse() != 0)
++ die("Unable to parse input tree\n");
++
++ if (treesource_error)
++ die("Syntax error parsing input tree\n");
++
++ return the_boot_info;
++}
++
++static void write_prefix(FILE *f, int level)
++{
++ int i;
++
++ for (i = 0; i < level; i++)
++ fputc('\t', f);
++}
++
++int isstring(char c)
++{
++ return (isprint(c)
++ || (c == '\0')
++ || strchr("\a\b\t\n\v\f\r", c));
++}
++
++static void write_propval_string(FILE *f, struct data val)
++{
++ const char *str = val.val;
++ int i;
++ int newchunk = 1;
++ struct marker *m = val.markers;
++
++ assert(str[val.len-1] == '\0');
++
++ for (i = 0; i < (val.len-1); i++) {
++ char c = str[i];
++
++ if (newchunk) {
++ while (m && (m->offset <= i)) {
++ if (m->type == LABEL) {
++ assert(m->offset == i);
++ fprintf(f, "%s: ", m->ref);
++ }
++ m = m->next;
++ }
++ fprintf(f, "\"");
++ newchunk = 0;
++ }
++
++ switch (c) {
++ case '\a':
++ fprintf(f, "\\a");
++ break;
++ case '\b':
++ fprintf(f, "\\b");
++ break;
++ case '\t':
++ fprintf(f, "\\t");
++ break;
++ case '\n':
++ fprintf(f, "\\n");
++ break;
++ case '\v':
++ fprintf(f, "\\v");
++ break;
++ case '\f':
++ fprintf(f, "\\f");
++ break;
++ case '\r':
++ fprintf(f, "\\r");
++ break;
++ case '\\':
++ fprintf(f, "\\\\");
++ break;
++ case '\"':
++ fprintf(f, "\\\"");
++ break;
++ case '\0':
++ fprintf(f, "\", ");
++ newchunk = 1;
++ break;
++ default:
++ if (isprint(c))
++ fprintf(f, "%c", c);
++ else
++ fprintf(f, "\\x%02hhx", c);
++ }
++ }
++ fprintf(f, "\"");
++
++ /* Wrap up any labels at the end of the value */
++ for_each_marker_of_type(m, LABEL) {
++ assert (m->offset == val.len);
++ fprintf(f, " %s:", m->ref);
++ }
++}
++
++static void write_propval_cells(FILE *f, struct data val)
++{
++ void *propend = val.val + val.len;
++ cell_t *cp = (cell_t *)val.val;
++ struct marker *m = val.markers;
++
++ fprintf(f, "<");
++ for (;;) {
++ while (m && (m->offset <= ((char *)cp - val.val))) {
++ if (m->type == LABEL) {
++ assert(m->offset == ((char *)cp - val.val));
++ fprintf(f, "%s: ", m->ref);
++ }
++ m = m->next;
++ }
++
++ fprintf(f, "0x%x", fdt32_to_cpu(*cp++));
++ if ((void *)cp >= propend)
++ break;
++ fprintf(f, " ");
++ }
++
++ /* Wrap up any labels at the end of the value */
++ for_each_marker_of_type(m, LABEL) {
++ assert (m->offset == val.len);
++ fprintf(f, " %s:", m->ref);
++ }
++ fprintf(f, ">");
++}
++
++static void write_propval_bytes(FILE *f, struct data val)
++{
++ void *propend = val.val + val.len;
++ const char *bp = val.val;
++ struct marker *m = val.markers;
++
++ fprintf(f, "[");
++ for (;;) {
++ while (m && (m->offset == (bp-val.val))) {
++ if (m->type == LABEL)
++ fprintf(f, "%s: ", m->ref);
++ m = m->next;
++ }
++
++ fprintf(f, "%02hhx", *bp++);
++ if ((const void *)bp >= propend)
++ break;
++ fprintf(f, " ");
++ }
++
++ /* Wrap up any labels at the end of the value */
++ for_each_marker_of_type(m, LABEL) {
++ assert (m->offset == val.len);
++ fprintf(f, " %s:", m->ref);
++ }
++ fprintf(f, "]");
++}
++
++static void write_propval(FILE *f, struct property *prop)
++{
++ int len = prop->val.len;
++ const char *p = prop->val.val;
++ struct marker *m = prop->val.markers;
++ int nnotstring = 0, nnul = 0;
++ int nnotstringlbl = 0, nnotcelllbl = 0;
++ int i;
++
++ if (len == 0) {
++ fprintf(f, ";\n");
++ return;
++ }
++
++ for (i = 0; i < len; i++) {
++ if (! isstring(p[i]))
++ nnotstring++;
++ if (p[i] == '\0')
++ nnul++;
++ }
++
++ for_each_marker_of_type(m, LABEL) {
++ if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
++ nnotstringlbl++;
++ if ((m->offset % sizeof(cell_t)) != 0)
++ nnotcelllbl++;
++ }
++
++ fprintf(f, " = ");
++ if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
++ && (nnotstringlbl == 0)) {
++ write_propval_string(f, prop->val);
++ } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
++ write_propval_cells(f, prop->val);
++ } else {
++ write_propval_bytes(f, prop->val);
++ }
++
++ fprintf(f, ";\n");
++}
++
++static void write_tree_source_node(FILE *f, struct node *tree, int level)
++{
++ struct property *prop;
++ struct node *child;
++
++ write_prefix(f, level);
++ if (tree->label)
++ fprintf(f, "%s: ", tree->label);
++ if (tree->name && (*tree->name))
++ fprintf(f, "%s {\n", tree->name);
++ else
++ fprintf(f, "/ {\n");
++
++ for_each_property(tree, prop) {
++ write_prefix(f, level+1);
++ if (prop->label)
++ fprintf(f, "%s: ", prop->label);
++ fprintf(f, "%s", prop->name);
++ write_propval(f, prop);
++ }
++ for_each_child(tree, child) {
++ fprintf(f, "\n");
++ write_tree_source_node(f, child, level+1);
++ }
++ write_prefix(f, level);
++ fprintf(f, "};\n");
++}
++
++
++void dt_to_source(FILE *f, struct boot_info *bi)
++{
++ struct reserve_info *re;
++
++ fprintf(f, "/dts-v1/;\n\n");
++
++ for (re = bi->reservelist; re; re = re->next) {
++ if (re->label)
++ fprintf(f, "%s: ", re->label);
++ fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
++ (unsigned long long)re->re.address,
++ (unsigned long long)re->re.size);
++ }
++
++ write_tree_source_node(f, bi->dt, 0);
++}
++
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/dtc/version_gen.h linux-2.6.30-rc4-git/scripts/dtc/version_gen.h
+--- linux-2.6.30-rc4/scripts/dtc/version_gen.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-git/scripts/dtc/version_gen.h 2009-05-13 09:46:19.000000000 +0200
+@@ -0,0 +1 @@
++#define DTC_VERSION "DTC 1.2.0"
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/kernel-doc linux-2.6.30-rc4-git/scripts/kernel-doc
+--- linux-2.6.30-rc4/scripts/kernel-doc 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/scripts/kernel-doc 2009-05-13 09:46:19.000000000 +0200
+@@ -1411,7 +1411,8 @@ sub dump_struct($$) {
+ my $file = shift;
+ my $nested;
+
+- if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) {
++ if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
++ #my $decl_type = $1;
+ $declaration_name = $2;
+ my $members = $3;
+
+@@ -1420,8 +1421,8 @@ sub dump_struct($$) {
+ $nested = $1;
+
+ # ignore members marked private:
+- $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos;
+- $members =~ s/\/\*.*?private:.*//gos;
++ $members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gos;
++ $members =~ s/\/\*\s*private:.*//gos;
+ # strip comments:
+ $members =~ s/\/\*.*?\*\///gos;
+ $nested =~ s/\/\*.*?\*\///gos;
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/Makefile linux-2.6.30-rc4-git/scripts/Makefile
+--- linux-2.6.30-rc4/scripts/Makefile 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/scripts/Makefile 2009-05-13 09:46:19.000000000 +0200
+@@ -21,6 +21,7 @@ hostprogs-y += unifdef
+ subdir-$(CONFIG_MODVERSIONS) += genksyms
+ subdir-y += mod
+ subdir-$(CONFIG_SECURITY_SELINUX) += selinux
++subdir-$(CONFIG_DTC) += dtc
+
+ # Let clean descend into subdirs
+ subdir- += basic kconfig package selinux
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/mod/modpost.c linux-2.6.30-rc4-git/scripts/mod/modpost.c
+--- linux-2.6.30-rc4/scripts/mod/modpost.c 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/scripts/mod/modpost.c 2009-05-13 09:46:19.000000000 +0200
+@@ -716,41 +716,27 @@ int match(const char *sym, const char *
+
+ /* sections that we do not want to do full section mismatch check on */
+ static const char *section_white_list[] =
+- { ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
++ { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
+
+ /*
+- * Is this section one we do not want to check?
+- * This is often debug sections.
+- * If we are going to check this section then
+- * test if section name ends with a dot and a number.
+- * This is used to find sections where the linker have
+- * appended a dot-number to make the name unique.
++ * This is used to find sections missing the SHF_ALLOC flag.
+ * The cause of this is often a section specified in assembler
+- * without "ax" / "aw" and the same section used in .c
+- * code where gcc add these.
++ * without "ax" / "aw".
+ */
+-static int check_section(const char *modname, const char *sec)
++static void check_section(const char *modname, struct elf_info *elf,
++ Elf_Shdr *sechdr)
+ {
+- const char *e = sec + strlen(sec) - 1;
+- if (match(sec, section_white_list))
+- return 1;
++ const char *sec = sech_name(elf, sechdr);
+
+- if (*e && isdigit(*e)) {
+- /* consume all digits */
+- while (*e && e != sec && isdigit(*e))
+- e--;
+- if (*e == '.' && !strstr(sec, ".linkonce")) {
+- warn("%s (%s): unexpected section name.\n"
+- "The (.[number]+) following section name are "
+- "ld generated and not expected.\n"
+- "Did you forget to use \"ax\"/\"aw\" "
+- "in a .S file?\n"
+- "Note that for example <linux/init.h> contains\n"
+- "section definitions for use in .S files.\n\n",
+- modname, sec);
+- }
++ if (sechdr->sh_type == SHT_PROGBITS &&
++ !(sechdr->sh_flags & SHF_ALLOC) &&
++ !match(sec, section_white_list)) {
++ warn("%s (%s): unexpected non-allocatable section.\n"
++ "Did you forget to use \"ax\"/\"aw\" in a .S file?\n"
++ "Note that for example <linux/init.h> contains\n"
++ "section definitions for use in .S files.\n\n",
++ modname, sec);
+ }
+- return 0;
+ }
+
+
+@@ -928,8 +914,7 @@ static int section_mismatch(const char *
+ * *probe_one, *_console, *_timer
+ *
+ * Pattern 3:
+- * Whitelist all refereces from .text.head to .init.data
+- * Whitelist all refereces from .text.head to .init.text
++ * Whitelist all references from .head.text to any init section
+ *
+ * Pattern 4:
+ * Some symbols belong to init section but still it is ok to reference
+@@ -1359,7 +1344,7 @@ static void section_rela(const char *mod
+ fromsec = sech_name(elf, sechdr);
+ fromsec += strlen(".rela");
+ /* if from section (name) is know good then skip it */
+- if (check_section(modname, fromsec))
++ if (match(fromsec, section_white_list))
+ return;
+
+ for (rela = start; rela < stop; rela++) {
+@@ -1403,7 +1388,7 @@ static void section_rel(const char *modn
+ fromsec = sech_name(elf, sechdr);
+ fromsec += strlen(".rel");
+ /* if from section (name) is know good then skip it */
+- if (check_section(modname, fromsec))
++ if (match(fromsec, section_white_list))
+ return;
+
+ for (rel = start; rel < stop; rel++) {
+@@ -1466,6 +1451,7 @@ static void check_sec_ref(struct module
+
+ /* Walk through all sections */
+ for (i = 0; i < elf->hdr->e_shnum; i++) {
++ check_section(modname, elf, &elf->sechdrs[i]);
+ /* We want to process only relocation sections and not .init */
+ if (sechdrs[i].sh_type == SHT_RELA)
+ section_rela(modname, elf, &elf->sechdrs[i]);
+@@ -1990,6 +1976,7 @@ static void read_markers(const char *fna
+ if (!mod->skip)
+ add_marker(mod, marker, fmt);
+ }
++ release_file(file, size);
+ return;
+ fail:
+ fatal("parse error in markers list file\n");
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/setlocalversion linux-2.6.30-rc4-git/scripts/setlocalversion
+--- linux-2.6.30-rc4/scripts/setlocalversion 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/scripts/setlocalversion 2009-05-13 09:46:19.000000000 +0200
+@@ -10,13 +10,12 @@ cd "${1:-.}" || usage
+
+ # Check for git and a git repo.
+ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+- # Do we have an untagged version?
+- if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
+- if tag=`git describe 2>/dev/null`; then
+- echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+- else
+- printf '%s%s' -g $head
+- fi
++ # Do we have an untagged tag?
++ if atag=`git describe 2>/dev/null`; then
++ echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
++ # add -g${head}, if there is no usable tag
++ else
++ printf '%s%s' -g $head
+ fi
+
+ # Is this git on svn?
+diff -urNp --exclude Documentation/dontdiff linux-2.6.30-rc4/scripts/tags.sh linux-2.6.30-rc4-git/scripts/tags.sh
+--- linux-2.6.30-rc4/scripts/tags.sh 2009-04-30 06:48:16.000000000 +0200
++++ linux-2.6.30-rc4-git/scripts/tags.sh 2009-05-13 09:46:19.000000000 +0200
+@@ -164,10 +164,12 @@ case "$1" in
+ ;;
+
+ "tags")
++ rm -f tags
+ xtags ctags
+ ;;
+
+ "TAGS")
++ rm -f TAGS
+ xtags etags
+ ;;
+ esac
diff --git a/recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-karo3.diff
index 6926571c2e..dad744a629 100644
--- a/recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff
+++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-karo3.diff
@@ -1,11 +1,11 @@
-diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
---- linux-2.6.30-rc4/.config 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/.config 2009-06-02 16:17:34.000000000 +0200
-@@ -0,0 +1,1203 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc4-karo3/arch/arm/configs/karo_tx25_defconfig
+--- linux-2.6.30-rc4-git/arch/arm/configs/karo_tx25_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/configs/karo_tx25_defconfig 2009-07-14 13:49:57.000000000 +0200
+@@ -0,0 +1,1442 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.30-rc4
-+# Tue Jun 2 15:46:43 2009
++# Tue Jul 14 13:40:27 2009
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -76,7 +76,7 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
-+# CONFIG_KALLSYMS_ALL is not set
++CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+# CONFIG_STRIP_ASM_SYMS is not set
+CONFIG_HOTPLUG=y
@@ -304,7 +304,7 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+#
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
-+CONFIG_PM_VERBOSE=y
++# CONFIG_PM_VERBOSE is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
@@ -400,8 +400,7 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
-+CONFIG_MTD_DEBUG=y
-+CONFIG_MTD_DEBUG_VERBOSE=0
++# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_TESTS=m
@@ -474,9 +473,11 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
-+# CONFIG_MTD_NAND_MXC is not set
-+CONFIG_ARCH_MXC_HAS_NFC_V2=y
-+CONFIG_ARCH_MXC_HAS_NFC_V2_1=y
++# CONFIG_MTD_ALAUDA is not set
++CONFIG_MTD_NAND_MXC=y
++CONFIG_MTD_NAND_MXC_FLASH_BBT=y
++CONFIG_ARCH_MXC_HAS_NFC_V1=y
++CONFIG_ARCH_MXC_HAS_NFC_V1_1=y
+# CONFIG_MTD_ONENAND is not set
+
+#
@@ -494,6 +495,7 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+CONFIG_BLK_DEV_LOOP=m
+# 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=8192
@@ -515,1216 +517,42 @@ diff -urNp linux-2.6.30-rc4/.config linux-2.6.30-rc4-karo/.config
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
-+# CONFIG_SCSI is not set
-+# CONFIG_SCSI_DMA is not set
++CONFIG_SCSI=m
++CONFIG_SCSI_DMA=y
++# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
-+# CONFIG_ATA is not set
-+# CONFIG_MD is not set
-+CONFIG_NETDEVICES=y
-+CONFIG_COMPAT_NET_DEV_OPS=y
-+# 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_VETH is not set
-+CONFIG_PHYLIB=y
-+
-+#
-+# MII PHY device drivers
-+#
-+# CONFIG_MARVELL_PHY is not set
-+# CONFIG_DAVICOM_PHY is not set
-+# CONFIG_QSEMI_PHY is not set
-+# CONFIG_LXT_PHY is not set
-+# CONFIG_CICADA_PHY is not set
-+# CONFIG_VITESSE_PHY is not set
-+CONFIG_SMSC_PHY=y
-+# CONFIG_BROADCOM_PHY is not set
-+# CONFIG_ICPLUS_PHY is not set
-+# CONFIG_REALTEK_PHY is not set
-+# CONFIG_NATIONAL_PHY is not set
-+# CONFIG_STE10XP is not set
-+# CONFIG_LSI_ET1011C_PHY is not set
-+# CONFIG_FIXED_PHY is not set
-+# CONFIG_MDIO_BITBANG is not set
-+CONFIG_NET_ETHERNET=y
-+CONFIG_MII=y
-+# CONFIG_AX88796 is not set
-+# CONFIG_SMC91X is not set
-+# CONFIG_DM9000 is not set
-+# CONFIG_ETHOC is not set
-+# CONFIG_SMC911X is not set
-+# CONFIG_SMSC911X is not set
-+# CONFIG_DNET is not set
-+# CONFIG_IBM_NEW_EMAC_ZMII is not set
-+# CONFIG_IBM_NEW_EMAC_RGMII is not set
-+# CONFIG_IBM_NEW_EMAC_TAH is not set
-+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-+# CONFIG_B44 is not set
-+CONFIG_FEC=y
-+# CONFIG_FEC2 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
++CONFIG_SCSI_PROC_FS=y
+
+#
-+# Enable WiMAX (Networking options) to see the WiMAX drivers
++# SCSI support type (disk, tape, CD-ROM)
+#
-+# CONFIG_WAN is not set
-+# CONFIG_PPP is not set
-+# CONFIG_SLIP is not set
-+CONFIG_NETCONSOLE=y
-+CONFIG_NETCONSOLE_DYNAMIC=y
-+CONFIG_NETPOLL=y
-+# CONFIG_NETPOLL_TRAP is not set
-+CONFIG_NET_POLL_CONTROLLER=y
-+# CONFIG_ISDN is not set
++CONFIG_BLK_DEV_SD=m
++# 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=m
++# CONFIG_CHR_DEV_SCH is not set
+
+#
-+# Input device support
++# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
-+CONFIG_INPUT=y
-+# CONFIG_INPUT_FF_MEMLESS is not set
-+# CONFIG_INPUT_POLLDEV is not set
++# 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
+
+#
-+# Userland interfaces
++# SCSI Transports
+#
-+CONFIG_INPUT_MOUSEDEV=m
-+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_EVDEV=m
-+CONFIG_INPUT_EVBUG=m
-+# CONFIG_INPUT_APMPOWER is not set
-+
-+#
-+# Input Device Drivers
-+#
-+CONFIG_INPUT_KEYBOARD=y
-+# CONFIG_KEYBOARD_ATKBD is not set
-+# 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_GPIO=m
-+CONFIG_INPUT_MOUSE=y
-+# CONFIG_MOUSE_PS2 is not set
-+# CONFIG_MOUSE_SERIAL 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 is not set
-+# 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_CONSOLE_TRANSLATIONS=y
-+CONFIG_VT_CONSOLE=y
-+CONFIG_HW_CONSOLE=y
-+CONFIG_VT_HW_CONSOLE_BINDING=y
-+CONFIG_DEVKMEM=y
-+# CONFIG_SERIAL_NONSTANDARD is not set
-+
-+#
-+# Serial drivers
-+#
-+# CONFIG_SERIAL_8250 is not set
-+
-+#
-+# Non-8250 serial port support
-+#
-+CONFIG_SERIAL_IMX=y
-+CONFIG_SERIAL_IMX_CONSOLE=y
-+CONFIG_SERIAL_CORE=y
-+CONFIG_SERIAL_CORE_CONSOLE=y
-+CONFIG_UNIX98_PTYS=y
-+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
-+CONFIG_LEGACY_PTYS=y
-+CONFIG_LEGACY_PTY_COUNT=16
-+# CONFIG_IPMI_HANDLER is not set
-+# CONFIG_HW_RANDOM is not set
-+# CONFIG_R3964 is not set
-+# CONFIG_RAW_DRIVER is not set
-+# CONFIG_TCG_TPM is not set
-+# CONFIG_I2C is not set
-+# CONFIG_SPI is not set
-+CONFIG_ARCH_REQUIRE_GPIOLIB=y
-+CONFIG_GPIOLIB=y
-+CONFIG_DEBUG_GPIO=y
-+CONFIG_GPIO_SYSFS=y
-+
-+#
-+# Memory mapped GPIO expanders:
-+#
-+
-+#
-+# I2C GPIO expanders:
-+#
-+
-+#
-+# PCI GPIO expanders:
-+#
-+
-+#
-+# SPI GPIO expanders:
-+#
-+# CONFIG_W1 is not set
-+# CONFIG_POWER_SUPPLY is not set
-+# CONFIG_HWMON is not set
-+# CONFIG_THERMAL is not set
-+# CONFIG_THERMAL_HWMON is not set
-+# CONFIG_WATCHDOG is not set
-+CONFIG_SSB_POSSIBLE=y
-+
-+#
-+# Sonics Silicon Backplane
-+#
-+# CONFIG_SSB is not set
-+
-+#
-+# Multifunction device drivers
-+#
-+# CONFIG_MFD_CORE is not set
-+# CONFIG_MFD_SM501 is not set
-+# CONFIG_MFD_ASIC3 is not set
-+# CONFIG_HTC_EGPIO is not set
-+# CONFIG_HTC_PASIC3 is not set
-+# CONFIG_MFD_TMIO is not set
-+# CONFIG_MFD_T7L66XB is not set
-+# CONFIG_MFD_TC6387XB is not set
-+# CONFIG_MFD_TC6393XB is not set
-+
-+#
-+# Multimedia devices
-+#
-+
-+#
-+# Multimedia core support
-+#
-+# CONFIG_VIDEO_DEV is not set
-+# CONFIG_DVB_CORE is not set
-+# CONFIG_VIDEO_MEDIA is not set
-+
-+#
-+# Multimedia drivers
-+#
-+# CONFIG_DAB is not set
-+
-+#
-+# Graphics support
-+#
-+# 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_BOOT_VESA_SUPPORT is not set
-+CONFIG_FB_CFB_FILLRECT=y
-+CONFIG_FB_CFB_COPYAREA=y
-+CONFIG_FB_CFB_IMAGEBLIT=y
-+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
-+# CONFIG_FB_SYS_FILLRECT is not set
-+# CONFIG_FB_SYS_COPYAREA is not set
-+# CONFIG_FB_SYS_IMAGEBLIT is not set
-+# CONFIG_FB_FOREIGN_ENDIAN is not set
-+# CONFIG_FB_SYS_FOPS is not set
-+# CONFIG_FB_SVGALIB is not set
-+# CONFIG_FB_MACMODES is not set
-+# CONFIG_FB_BACKLIGHT is not set
-+CONFIG_FB_MODE_HELPERS=y
-+CONFIG_FB_TILEBLITTING=y
-+
-+#
-+# Frame buffer hardware drivers
-+#
-+CONFIG_FB_IMX=y
-+# CONFIG_FB_S1D13XXX is not set
-+# CONFIG_FB_VIRTUAL is not set
-+# CONFIG_FB_METRONOME is not set
-+# CONFIG_FB_MB862XX is not set
-+# CONFIG_FB_BROADSHEET is not set
-+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-+
-+#
-+# Display device support
-+#
-+# CONFIG_DISPLAY_SUPPORT 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=y
-+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-+# CONFIG_FONTS is not set
-+CONFIG_FONT_8x8=y
-+CONFIG_FONT_8x16=y
-+CONFIG_LOGO=y
-+CONFIG_LOGO_LINUX_MONO=y
-+CONFIG_LOGO_LINUX_VGA16=y
-+CONFIG_LOGO_LINUX_CLUT224=y
-+# CONFIG_SOUND is not set
-+# CONFIG_HID_SUPPORT is not set
-+# CONFIG_USB_SUPPORT is not set
-+# CONFIG_MMC is not set
-+# CONFIG_MEMSTICK is not set
-+# CONFIG_ACCESSIBILITY is not set
-+CONFIG_NEW_LEDS=y
-+CONFIG_LEDS_CLASS=y
-+
-+#
-+# LED drivers
-+#
-+CONFIG_LEDS_GPIO=y
-+CONFIG_LEDS_GPIO_PLATFORM=y
-+
-+#
-+# LED Triggers
-+#
-+CONFIG_LEDS_TRIGGERS=y
-+# CONFIG_LEDS_TRIGGER_TIMER is not set
-+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
-+# CONFIG_LEDS_TRIGGER_GPIO is not set
-+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
-+
-+#
-+# iptables trigger is under Netfilter config (LED target)
-+#
-+CONFIG_RTC_LIB=y
-+# CONFIG_RTC_CLASS is not set
-+# CONFIG_DMADEVICES is not set
-+# CONFIG_AUXDISPLAY is not set
-+# CONFIG_REGULATOR is not set
-+# CONFIG_UIO is not set
-+# CONFIG_STAGING is not set
-+
-+#
-+# File systems
-+#
-+CONFIG_EXT2_FS=y
-+# CONFIG_EXT2_FS_XATTR is not set
-+# CONFIG_EXT2_FS_XIP is not set
-+CONFIG_EXT3_FS=m
-+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-+CONFIG_EXT3_FS_XATTR=y
-+CONFIG_EXT3_FS_POSIX_ACL=y
-+# CONFIG_EXT3_FS_SECURITY is not set
-+# CONFIG_EXT4_FS is not set
-+CONFIG_JBD=m
-+CONFIG_FS_MBCACHE=m
-+# CONFIG_REISERFS_FS is not set
-+# CONFIG_JFS_FS is not set
-+CONFIG_FS_POSIX_ACL=y
-+CONFIG_FILE_LOCKING=y
-+# CONFIG_XFS_FS is not set
-+# CONFIG_GFS2_FS is not set
-+# CONFIG_OCFS2_FS is not set
-+# CONFIG_BTRFS_FS is not set
-+CONFIG_DNOTIFY=y
-+CONFIG_INOTIFY=y
-+CONFIG_INOTIFY_USER=y
-+# CONFIG_QUOTA is not set
-+# CONFIG_AUTOFS_FS is not set
-+# CONFIG_AUTOFS4_FS is not set
-+# CONFIG_FUSE_FS is not set
-+
-+#
-+# Caches
-+#
-+# CONFIG_FSCACHE is not set
-+
-+#
-+# CD-ROM/DVD Filesystems
-+#
-+CONFIG_ISO9660_FS=y
-+CONFIG_JOLIET=y
-+CONFIG_ZISOFS=y
-+# CONFIG_UDF_FS is not set
-+
-+#
-+# DOS/FAT/NT Filesystems
-+#
-+CONFIG_FAT_FS=m
-+CONFIG_MSDOS_FS=m
-+CONFIG_VFAT_FS=m
-+CONFIG_FAT_DEFAULT_CODEPAGE=437
-+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-+CONFIG_NTFS_FS=m
-+# CONFIG_NTFS_DEBUG is not set
-+CONFIG_NTFS_RW=y
-+
-+#
-+# Pseudo filesystems
-+#
-+CONFIG_PROC_FS=y
-+CONFIG_PROC_SYSCTL=y
-+CONFIG_PROC_PAGE_MONITOR=y
-+CONFIG_SYSFS=y
-+CONFIG_TMPFS=y
-+# CONFIG_TMPFS_POSIX_ACL is not set
-+# CONFIG_HUGETLB_PAGE is not set
-+CONFIG_CONFIGFS_FS=y
-+CONFIG_MISC_FILESYSTEMS=y
-+# 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_FS_WBUF_VERIFY is not set
-+CONFIG_JFFS2_SUMMARY=y
-+# CONFIG_JFFS2_FS_XATTR is not set
-+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-+CONFIG_JFFS2_ZLIB=y
-+# CONFIG_JFFS2_LZO is not set
-+CONFIG_JFFS2_RTIME=y
-+# CONFIG_JFFS2_RUBIN is not set
-+CONFIG_CRAMFS=y
-+# CONFIG_SQUASHFS is not set
-+# CONFIG_VXFS_FS is not set
-+# CONFIG_MINIX_FS is not set
-+# CONFIG_OMFS_FS is not set
-+# CONFIG_HPFS_FS is not set
-+# CONFIG_QNX4FS_FS is not set
-+# CONFIG_ROMFS_FS is not set
-+# CONFIG_SYSV_FS is not set
-+# CONFIG_UFS_FS is not set
-+# CONFIG_NILFS2_FS is not set
-+CONFIG_NETWORK_FILESYSTEMS=y
-+CONFIG_NFS_FS=y
-+CONFIG_NFS_V3=y
-+# CONFIG_NFS_V3_ACL is not set
-+CONFIG_NFS_V4=y
-+CONFIG_ROOT_NFS=y
-+# CONFIG_NFSD is not set
-+CONFIG_LOCKD=y
-+CONFIG_LOCKD_V4=y
-+CONFIG_NFS_COMMON=y
-+CONFIG_SUNRPC=y
-+CONFIG_SUNRPC_GSS=y
-+CONFIG_RPCSEC_GSS_KRB5=y
-+# CONFIG_RPCSEC_GSS_SPKM3 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=y
-+# CONFIG_ACORN_PARTITION is not set
-+# CONFIG_OSF_PARTITION is not set
-+# CONFIG_AMIGA_PARTITION is not set
-+# CONFIG_ATARI_PARTITION is not set
-+# CONFIG_MAC_PARTITION is not set
-+CONFIG_MSDOS_PARTITION=y
-+# CONFIG_BSD_DISKLABEL is not set
-+# CONFIG_MINIX_SUBPARTITION is not set
-+# CONFIG_SOLARIS_X86_PARTITION is not set
-+# CONFIG_UNIXWARE_DISKLABEL is not set
-+# CONFIG_LDM_PARTITION is not set
-+# CONFIG_SGI_PARTITION is not set
-+# CONFIG_ULTRIX_PARTITION is not set
-+# CONFIG_SUN_PARTITION is not set
-+# CONFIG_KARMA_PARTITION is not set
-+# CONFIG_EFI_PARTITION is not set
-+# CONFIG_SYSV68_PARTITION is not set
-+CONFIG_NLS=y
-+CONFIG_NLS_DEFAULT="cp437"
-+CONFIG_NLS_CODEPAGE_437=y
-+# CONFIG_NLS_CODEPAGE_737 is not set
-+# CONFIG_NLS_CODEPAGE_775 is not set
-+CONFIG_NLS_CODEPAGE_850=y
-+# 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=m
-+# CONFIG_NLS_CODEPAGE_1251 is not set
-+CONFIG_NLS_ASCII=m
-+CONFIG_NLS_ISO8859_1=m
-+# 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=y
-+# CONFIG_NLS_KOI8_R is not set
-+# CONFIG_NLS_KOI8_U is not set
-+CONFIG_NLS_UTF8=y
-+# CONFIG_DLM is not set
-+
-+#
-+# Kernel hacking
-+#
-+# CONFIG_PRINTK_TIME is not set
-+CONFIG_ENABLE_WARN_DEPRECATED=y
-+CONFIG_ENABLE_MUST_CHECK=y
-+CONFIG_FRAME_WARN=1024
-+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_DETECT_SOFTLOCKUP=y
-+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
-+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
-+CONFIG_DETECT_HUNG_TASK=y
-+CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
-+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
-+# CONFIG_SCHED_DEBUG is not set
-+# CONFIG_SCHEDSTATS is not set
-+# CONFIG_TIMER_STATS is not set
-+# CONFIG_DEBUG_OBJECTS is not set
-+CONFIG_DEBUG_SLAB=y
-+CONFIG_DEBUG_SLAB_LEAK=y
-+# CONFIG_DEBUG_PREEMPT 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_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
-+CONFIG_DEBUG_BUGVERBOSE=y
-+# CONFIG_DEBUG_INFO is not set
-+# CONFIG_DEBUG_VM is not set
-+# CONFIG_DEBUG_WRITECOUNT is not set
-+# CONFIG_DEBUG_MEMORY_INIT is not set
-+# CONFIG_DEBUG_LIST is not set
-+# CONFIG_DEBUG_SG is not set
-+# CONFIG_DEBUG_NOTIFIERS is not set
-+# CONFIG_BOOT_PRINTK_DELAY is not set
-+# CONFIG_RCU_TORTURE_TEST is not set
-+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-+# CONFIG_BACKTRACE_SELF_TEST is not set
-+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
-+# CONFIG_FAULT_INJECTION is not set
-+# CONFIG_LATENCYTOP is not set
-+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
-+# CONFIG_PAGE_POISONING is not set
-+CONFIG_HAVE_FUNCTION_TRACER=y
-+CONFIG_TRACING_SUPPORT=y
-+
-+#
-+# Tracers
-+#
-+# CONFIG_FUNCTION_TRACER is not set
-+# CONFIG_IRQSOFF_TRACER is not set
-+# CONFIG_PREEMPT_TRACER is not set
-+# CONFIG_SCHED_TRACER is not set
-+# CONFIG_CONTEXT_SWITCH_TRACER is not set
-+# CONFIG_EVENT_TRACER is not set
-+# CONFIG_BOOT_TRACER is not set
-+# CONFIG_TRACE_BRANCH_PROFILING is not set
-+# CONFIG_STACK_TRACER is not set
-+# CONFIG_KMEMTRACE is not set
-+# CONFIG_WORKQUEUE_TRACER is not set
-+# CONFIG_BLK_DEV_IO_TRACE is not set
-+# CONFIG_SAMPLES is not set
-+CONFIG_HAVE_ARCH_KGDB=y
-+# CONFIG_KGDB is not set
-+CONFIG_ARM_UNWIND=y
-+CONFIG_DEBUG_USER=y
-+CONFIG_DEBUG_ERRORS=y
-+# CONFIG_DEBUG_STACK_USAGE is not set
-+# CONFIG_DEBUG_LL is not set
-+
-+#
-+# Security options
-+#
-+# CONFIG_KEYS is not set
-+# CONFIG_SECURITY is not set
-+# CONFIG_SECURITYFS is not set
-+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-+CONFIG_CRYPTO=y
-+
-+#
-+# Crypto core or helper
-+#
-+# CONFIG_CRYPTO_FIPS is not set
-+CONFIG_CRYPTO_ALGAPI=y
-+CONFIG_CRYPTO_ALGAPI2=y
-+CONFIG_CRYPTO_AEAD2=y
-+CONFIG_CRYPTO_BLKCIPHER=y
-+CONFIG_CRYPTO_BLKCIPHER2=y
-+CONFIG_CRYPTO_HASH=y
-+CONFIG_CRYPTO_HASH2=y
-+CONFIG_CRYPTO_RNG2=y
-+CONFIG_CRYPTO_PCOMP=y
-+CONFIG_CRYPTO_MANAGER=y
-+CONFIG_CRYPTO_MANAGER2=y
-+# CONFIG_CRYPTO_GF128MUL is not set
-+# CONFIG_CRYPTO_NULL is not set
-+CONFIG_CRYPTO_WORKQUEUE=y
-+# CONFIG_CRYPTO_CRYPTD is not set
-+# CONFIG_CRYPTO_AUTHENC is not set
-+# CONFIG_CRYPTO_TEST is not set
-+
-+#
-+# Authenticated Encryption with Associated Data
-+#
-+# CONFIG_CRYPTO_CCM is not set
-+# CONFIG_CRYPTO_GCM is not set
-+# CONFIG_CRYPTO_SEQIV is not set
-+
-+#
-+# Block modes
-+#
-+CONFIG_CRYPTO_CBC=y
-+# CONFIG_CRYPTO_CTR is not set
-+# CONFIG_CRYPTO_CTS is not set
-+CONFIG_CRYPTO_ECB=y
-+# CONFIG_CRYPTO_LRW is not set
-+# CONFIG_CRYPTO_PCBC is not set
-+# CONFIG_CRYPTO_XTS is not set
-+
-+#
-+# Hash modes
-+#
-+CONFIG_CRYPTO_HMAC=y
-+# CONFIG_CRYPTO_XCBC is not set
-+
-+#
-+# Digest
-+#
-+# CONFIG_CRYPTO_CRC32C is not set
-+# CONFIG_CRYPTO_MD4 is not set
-+CONFIG_CRYPTO_MD5=y
-+# CONFIG_CRYPTO_MICHAEL_MIC is not set
-+# CONFIG_CRYPTO_RMD128 is not set
-+# CONFIG_CRYPTO_RMD160 is not set
-+# CONFIG_CRYPTO_RMD256 is not set
-+# CONFIG_CRYPTO_RMD320 is not set
-+# CONFIG_CRYPTO_SHA1 is not set
-+# CONFIG_CRYPTO_SHA256 is not set
-+# CONFIG_CRYPTO_SHA512 is not set
-+# CONFIG_CRYPTO_TGR192 is not set
-+# CONFIG_CRYPTO_WP512 is not set
-+
-+#
-+# Ciphers
-+#
-+CONFIG_CRYPTO_AES=y
-+# CONFIG_CRYPTO_ANUBIS is not set
-+CONFIG_CRYPTO_ARC4=y
-+# CONFIG_CRYPTO_BLOWFISH is not set
-+# CONFIG_CRYPTO_CAMELLIA is not set
-+# CONFIG_CRYPTO_CAST5 is not set
-+# CONFIG_CRYPTO_CAST6 is not set
-+CONFIG_CRYPTO_DES=y
-+# CONFIG_CRYPTO_FCRYPT is not set
-+# CONFIG_CRYPTO_KHAZAD is not set
-+# CONFIG_CRYPTO_SALSA20 is not set
-+# CONFIG_CRYPTO_SEED is not set
-+# CONFIG_CRYPTO_SERPENT is not set
-+# CONFIG_CRYPTO_TEA is not set
-+# CONFIG_CRYPTO_TWOFISH is not set
-+
-+#
-+# Compression
-+#
-+# CONFIG_CRYPTO_DEFLATE is not set
-+# CONFIG_CRYPTO_ZLIB is not set
-+# CONFIG_CRYPTO_LZO is not set
-+
-+#
-+# Random Number Generation
-+#
-+# CONFIG_CRYPTO_ANSI_CPRNG is not set
-+CONFIG_CRYPTO_HW=y
-+# CONFIG_BINARY_PRINTF is not set
-+
-+#
-+# Library routines
-+#
-+CONFIG_BITREVERSE=y
-+CONFIG_GENERIC_FIND_LAST_BIT=y
-+# CONFIG_CRC_CCITT is not set
-+# CONFIG_CRC16 is not set
-+# CONFIG_CRC_T10DIF 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_DECOMPRESS_GZIP=y
-+CONFIG_HAS_IOMEM=y
-+CONFIG_HAS_IOPORT=y
-+CONFIG_HAS_DMA=y
-+CONFIG_NLATTR=y
-diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc4-karo/arch/arm/configs/karo_tx25_defconfig
---- linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/configs/karo_tx25_defconfig 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,1203 @@
-+#
-+# Automatically generated make config: don't edit
-+# Linux kernel version: 2.6.30-rc4
-+# Tue Jun 2 15:46:43 2009
-+#
-+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_HAVE_LATENCYTOP_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_ARCH_MTD_XIP=y
-+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
-+CONFIG_LOCALVERSION_AUTO=y
-+# CONFIG_SWAP is not set
-+CONFIG_SYSVIPC=y
-+CONFIG_SYSVIPC_SYSCTL=y
-+CONFIG_POSIX_MQUEUE=y
-+CONFIG_POSIX_MQUEUE_SYSCTL=y
-+# CONFIG_BSD_PROCESS_ACCT is not set
-+# CONFIG_TASKSTATS is not set
-+# CONFIG_AUDIT is not set
-+
-+#
-+# RCU Subsystem
-+#
-+CONFIG_CLASSIC_RCU=y
-+# CONFIG_TREE_RCU is not set
-+# CONFIG_PREEMPT_RCU is not set
-+# CONFIG_TREE_RCU_TRACE is not set
-+# CONFIG_PREEMPT_RCU_TRACE is not set
-+# CONFIG_IKCONFIG is not set
-+CONFIG_LOG_BUF_SHIFT=17
-+# CONFIG_GROUP_SCHED is not set
-+# CONFIG_CGROUPS is not set
-+# CONFIG_SYSFS_DEPRECATED_V2 is not set
-+# CONFIG_RELAY is not set
-+# CONFIG_NAMESPACES is not set
-+CONFIG_BLK_DEV_INITRD=y
-+CONFIG_INITRAMFS_SOURCE=""
-+CONFIG_RD_GZIP=y
-+# CONFIG_RD_BZIP2 is not set
-+# CONFIG_RD_LZMA is not set
-+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-+CONFIG_SYSCTL=y
-+CONFIG_ANON_INODES=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_STRIP_ASM_SYMS is not set
-+CONFIG_HOTPLUG=y
-+CONFIG_PRINTK=y
-+CONFIG_BUG=y
-+# CONFIG_ELF_CORE is not set
-+CONFIG_BASE_FULL=y
-+CONFIG_FUTEX=y
-+CONFIG_EPOLL=y
-+CONFIG_SIGNALFD=y
-+CONFIG_TIMERFD=y
-+CONFIG_EVENTFD=y
-+CONFIG_SHMEM=y
-+# CONFIG_AIO is not set
-+# CONFIG_VM_EVENT_COUNTERS is not set
-+# CONFIG_COMPAT_BRK is not set
-+CONFIG_SLAB=y
-+# CONFIG_SLUB is not set
-+# CONFIG_SLOB is not set
-+# CONFIG_PROFILING is not set
-+# CONFIG_MARKERS is not set
-+CONFIG_HAVE_OPROFILE=y
-+# CONFIG_KPROBES is not set
-+CONFIG_HAVE_KPROBES=y
-+CONFIG_HAVE_KRETPROBES=y
-+CONFIG_HAVE_CLK=y
-+# CONFIG_SLOW_WORK is not set
-+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-+CONFIG_SLABINFO=y
-+CONFIG_RT_MUTEXES=y
-+CONFIG_BASE_SMALL=0
-+CONFIG_MODULES=y
-+# CONFIG_MODULE_FORCE_LOAD is not set
-+CONFIG_MODULE_UNLOAD=y
-+CONFIG_MODULE_FORCE_UNLOAD=y
-+CONFIG_MODVERSIONS=y
-+# CONFIG_MODULE_SRCVERSION_ALL is not set
-+CONFIG_BLOCK=y
-+CONFIG_LBD=y
-+# CONFIG_BLK_DEV_BSG is not set
-+# CONFIG_BLK_DEV_INTEGRITY 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"
-+CONFIG_FREEZER=y
-+
-+#
-+# 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_CLPS711X is not set
-+# CONFIG_ARCH_EBSA110 is not set
-+# CONFIG_ARCH_EP93XX is not set
-+# CONFIG_ARCH_GEMINI is not set
-+# CONFIG_ARCH_FOOTBRIDGE is not set
-+# CONFIG_ARCH_NETX is not set
-+# CONFIG_ARCH_H720X 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_KIRKWOOD is not set
-+# CONFIG_ARCH_KS8695 is not set
-+# CONFIG_ARCH_NS9XXX is not set
-+# CONFIG_ARCH_LOKI is not set
-+# CONFIG_ARCH_MV78XX0 is not set
-+CONFIG_ARCH_MXC=y
-+# CONFIG_ARCH_ORION5X is not set
-+# CONFIG_ARCH_PNX4008 is not set
-+# CONFIG_ARCH_PXA is not set
-+# CONFIG_ARCH_MMP is not set
-+# CONFIG_ARCH_RPC is not set
-+# CONFIG_ARCH_SA1100 is not set
-+# CONFIG_ARCH_S3C2410 is not set
-+# CONFIG_ARCH_S3C64XX 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
-+# CONFIG_ARCH_MSM is not set
-+# CONFIG_ARCH_W90X900 is not set
-+
-+#
-+# Freescale MXC Implementations
-+#
-+# CONFIG_ARCH_MX1 is not set
-+CONFIG_ARCH_MX2=y
-+# CONFIG_ARCH_MX3 is not set
-+# CONFIG_MACH_MX21 is not set
-+# CONFIG_MACH_MX27 is not set
-+CONFIG_MACH_MX25=y
-+
-+#
-+# MX2 platforms:
-+#
-+CONFIG_MACH_TX25=y
-+# CONFIG_KARO_DEBUG is not set
-+CONFIG_MACH_STK5_BASEBOARD=y
-+# CONFIG_MXC_IRQ_PRIOR is not set
-+# CONFIG_MXC_PWM is not set
-+CONFIG_ARCH_MXC_IOMUX_V3=y
-+
-+#
-+# Processor Type
-+#
-+CONFIG_CPU_32=y
-+CONFIG_CPU_ARM926T=y
-+CONFIG_CPU_32v5=y
-+CONFIG_CPU_ABRT_EV5TJ=y
-+CONFIG_CPU_PABRT_NOIFAR=y
-+CONFIG_CPU_CACHE_VIVT=y
-+CONFIG_CPU_COPY_V4WB=y
-+CONFIG_CPU_TLB_V4WBI=y
-+CONFIG_CPU_CP15=y
-+CONFIG_CPU_CP15_MMU=y
-+
-+#
-+# Processor Features
-+#
-+CONFIG_ARM_THUMB=y
-+# CONFIG_CPU_ICACHE_DISABLE is not set
-+# CONFIG_CPU_DCACHE_DISABLE is not set
-+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-+# CONFIG_OUTER_CACHE is not set
-+CONFIG_COMMON_CLKDEV=y
-+
-+#
-+# Bus support
-+#
-+# CONFIG_PCI_SYSCALL is not set
-+# CONFIG_ARCH_SUPPORTS_MSI is not set
-+# CONFIG_PCCARD is not set
-+
-+#
-+# Kernel Features
-+#
-+CONFIG_TICK_ONESHOT=y
-+CONFIG_NO_HZ=y
-+# CONFIG_HIGH_RES_TIMERS is not set
-+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-+CONFIG_VMSPLIT_3G=y
-+# CONFIG_VMSPLIT_2G is not set
-+# CONFIG_VMSPLIT_1G is not set
-+CONFIG_PAGE_OFFSET=0xC0000000
-+CONFIG_PREEMPT=y
-+CONFIG_HZ=100
-+CONFIG_AEABI=y
-+CONFIG_OABI_COMPAT=y
-+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
-+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-+# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
-+CONFIG_SPLIT_PTLOCK_CPUS=4096
-+# CONFIG_PHYS_ADDR_T_64BIT is not set
-+CONFIG_ZONE_DMA_FLAG=0
-+CONFIG_VIRT_TO_BUS=y
-+CONFIG_UNEVICTABLE_LRU=y
-+CONFIG_HAVE_MLOCK=y
-+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
-+CONFIG_ALIGNMENT_TRAP=y
-+
-+#
-+# Boot options
-+#
-+CONFIG_ZBOOT_ROM_TEXT=0
-+CONFIG_ZBOOT_ROM_BSS=0
-+CONFIG_CMDLINE="init=/linuxrc root=1f01 rootfstype=jffs2 ro console=ttymxc0,115200 panic=1"
-+# CONFIG_XIP_KERNEL is not set
-+# CONFIG_KEXEC is not set
-+
-+#
-+# CPU Power Management
-+#
-+CONFIG_CPU_IDLE=y
-+CONFIG_CPU_IDLE_GOV_LADDER=y
-+CONFIG_CPU_IDLE_GOV_MENU=y
-+
-+#
-+# 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
-+CONFIG_VFP=y
-+
-+#
-+# Userspace binary formats
-+#
-+CONFIG_BINFMT_ELF=y
-+CONFIG_HAVE_AOUT=y
-+# CONFIG_BINFMT_AOUT is not set
-+# CONFIG_BINFMT_MISC is not set
-+
-+#
-+# Power management options
-+#
-+CONFIG_PM=y
-+CONFIG_PM_DEBUG=y
-+CONFIG_PM_VERBOSE=y
-+CONFIG_CAN_PM_TRACE=y
-+CONFIG_PM_SLEEP=y
-+CONFIG_SUSPEND=y
-+CONFIG_SUSPEND_FREEZER=y
-+CONFIG_APM_EMULATION=y
-+CONFIG_ARCH_SUSPEND_POSSIBLE=y
-+CONFIG_NET=y
-+
-+#
-+# Networking options
-+#
-+CONFIG_PACKET=y
-+CONFIG_PACKET_MMAP=y
-+CONFIG_UNIX=y
-+# 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=y
-+# 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 is not set
-+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-+# CONFIG_INET_XFRM_MODE_BEET is not set
-+# CONFIG_INET_LRO is not set
-+# CONFIG_INET_DIAG is not set
-+# 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_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_NET_DSA 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
-+# CONFIG_PHONET is not set
-+# CONFIG_NET_SCHED is not set
-+# CONFIG_DCB is not set
-+
-+#
-+# Network testing
-+#
-+# CONFIG_NET_PKTGEN is not set
-+# CONFIG_HAMRADIO is not set
-+# CONFIG_CAN is not set
-+# CONFIG_IRDA is not set
-+# CONFIG_BT is not set
-+# CONFIG_AF_RXRPC is not set
-+# CONFIG_WIRELESS is not set
-+# CONFIG_WIMAX is not set
-+# CONFIG_RFKILL is not set
-+# CONFIG_NET_9P is not set
-+
-+#
-+# Device Drivers
-+#
-+
-+#
-+# Generic Driver Options
-+#
-+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-+CONFIG_STANDALONE=y
-+CONFIG_PREVENT_FIRMWARE_BUILD=y
-+CONFIG_FW_LOADER=y
-+CONFIG_FIRMWARE_IN_KERNEL=y
-+CONFIG_EXTRA_FIRMWARE=""
-+# CONFIG_DEBUG_DRIVER is not set
-+# CONFIG_DEBUG_DEVRES is not set
-+# CONFIG_SYS_HYPERVISOR is not set
-+# CONFIG_CONNECTOR is not set
-+CONFIG_MTD=y
-+CONFIG_MTD_DEBUG=y
-+CONFIG_MTD_DEBUG_VERBOSE=0
-+CONFIG_MTD_CONCAT=y
-+CONFIG_MTD_PARTITIONS=y
-+CONFIG_MTD_TESTS=m
-+CONFIG_MTD_REDBOOT_PARTS=y
-+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-5
-+# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
-+CONFIG_MTD_REDBOOT_PARTS_READONLY=y
-+CONFIG_MTD_CMDLINE_PARTS=y
-+# CONFIG_MTD_AFS_PARTS is not set
-+# CONFIG_MTD_AR7_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
-+# CONFIG_MTD_OOPS 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
-+
-+#
-+# Mapping drivers for chip access
-+#
-+# CONFIG_MTD_COMPLEX_MAPPINGS 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=y
-+# CONFIG_MTD_NAND_ECC_SMC is not set
-+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
-+# CONFIG_MTD_NAND_GPIO is not set
-+CONFIG_MTD_NAND_IDS=y
-+# CONFIG_MTD_NAND_DISKONCHIP is not set
-+# CONFIG_MTD_NAND_NANDSIM is not set
-+# CONFIG_MTD_NAND_PLATFORM is not set
-+# CONFIG_MTD_NAND_MXC is not set
-+CONFIG_ARCH_MXC_HAS_NFC_V2=y
-+CONFIG_ARCH_MXC_HAS_NFC_V2_1=y
-+# CONFIG_MTD_ONENAND is not set
-+
-+#
-+# LPDDR flash memory drivers
-+#
-+# CONFIG_MTD_LPDDR 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=m
-+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-+# CONFIG_BLK_DEV_NBD is not set
-+CONFIG_BLK_DEV_RAM=y
-+CONFIG_BLK_DEV_RAM_COUNT=16
-+CONFIG_BLK_DEV_RAM_SIZE=8192
-+# CONFIG_BLK_DEV_XIP is not set
-+# CONFIG_CDROM_PKTCDVD is not set
-+# CONFIG_ATA_OVER_ETH is not set
-+CONFIG_MISC_DEVICES=y
-+# CONFIG_ENCLOSURE_SERVICES is not set
-+# CONFIG_C2PORT is not set
-+
-+#
-+# EEPROM support
-+#
-+# CONFIG_EEPROM_93CX6 is not set
-+CONFIG_HAVE_IDE=y
-+# CONFIG_IDE is not set
-+
-+#
-+# SCSI device support
-+#
-+# CONFIG_RAID_ATTRS is not set
-+# CONFIG_SCSI is not set
-+# CONFIG_SCSI_DMA is not set
-+# CONFIG_SCSI_NETLINK is not set
++# 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_SRP_ATTRS is not set
++# CONFIG_SCSI_LOWLEVEL is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
@@ -1786,6 +614,15 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
++
++#
++# 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 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
@@ -1829,11 +666,38 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+CONFIG_INPUT_MOUSE=y
+# CONFIG_MOUSE_PS2 is not set
+# CONFIG_MOUSE_SERIAL is not set
++# CONFIG_MOUSE_APPLETOUCH is not set
++# CONFIG_MOUSE_BCM5974 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 is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_AD7879 is not set
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO 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_MXC_TSADCC=m
++CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
++CONFIG_TOUCHSCREEN_USB_EGALAX=y
++# CONFIG_TOUCHSCREEN_USB_PANJIT is not set
++# CONFIG_TOUCHSCREEN_USB_3M is not set
++# CONFIG_TOUCHSCREEN_USB_ITM is not set
++# CONFIG_TOUCHSCREEN_USB_ETURBO is not set
++# CONFIG_TOUCHSCREEN_USB_GUNZE is not set
++# CONFIG_TOUCHSCREEN_USB_DMC_TSC10 is not set
++# CONFIG_TOUCHSCREEN_USB_IRTOUCH is not set
++# CONFIG_TOUCHSCREEN_USB_IDEALTEK is not set
++# CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH is not set
++# CONFIG_TOUCHSCREEN_USB_GOTOP is not set
++# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_INPUT_MISC is not set
+
+#
@@ -1995,7 +859,170 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
-+# CONFIG_USB_SUPPORT is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++# CONFIG_USB_ARCH_HAS_OHCI is not set
++CONFIG_USB_ARCH_HAS_EHCI=y
++CONFIG_USB=m
++CONFIG_USB_DEBUG=y
++CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
++
++#
++# Miscellaneous USB options
++#
++CONFIG_USB_DEVICEFS=y
++CONFIG_USB_DEVICE_CLASS=y
++CONFIG_USB_DYNAMIC_MINORS=y
++CONFIG_USB_SUSPEND=y
++# CONFIG_USB_OTG is not set
++# CONFIG_USB_OTG_WHITELIST is not set
++# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_MON=m
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++CONFIG_USB_EHCI_HCD=m
++CONFIG_USB_EHCI_ROOT_HUB_TT=y
++# CONFIG_USB_EHCI_TT_NEWSCHED is not set
++# CONFIG_USB_OXU210HP_HCD is not set
++CONFIG_USB_EHCI_MXC=y
++CONFIG_ARCH_MXC_EHCI_USBH2=y
++# CONFIG_ARCH_MXC_EHCI_USBOTG is not set
++CONFIG_ARCH_MXC_HAS_USBH2=y
++CONFIG_ARCH_MXC_HAS_USBOTG=y
++# CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_ISP1760_HCD is not set
++# CONFIG_USB_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++
++#
++# Enable Host or Gadget support to see Inventra options
++#
++# CONFIG_USB_MUSB_HDRC is not set
++
++#
++# USB Device Class drivers
++#
++CONFIG_USB_ACM=m
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
++#
++
++#
++# also be needed; see USB_STORAGE Help for more info
++#
++CONFIG_USB_STORAGE=m
++# CONFIG_USB_STORAGE_DEBUG is not set
++CONFIG_USB_STORAGE_DATAFAB=m
++# CONFIG_USB_STORAGE_FREECOM is not set
++# CONFIG_USB_STORAGE_ISD200 is not set
++# CONFIG_USB_STORAGE_USBAT is not set
++CONFIG_USB_STORAGE_SDDR09=m
++CONFIG_USB_STORAGE_SDDR55=m
++CONFIG_USB_STORAGE_JUMPSHOT=m
++# CONFIG_USB_STORAGE_ALAUDA is not set
++# CONFIG_USB_STORAGE_ONETOUCH is not set
++# CONFIG_USB_STORAGE_KARMA is not set
++# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++# CONFIG_USB_MICROTEK is not set
++
++#
++# USB port drivers
++#
++CONFIG_USB_SERIAL=m
++# CONFIG_USB_EZUSB is not set
++# CONFIG_USB_SERIAL_GENERIC is not set
++# CONFIG_USB_SERIAL_AIRCABLE is not set
++# CONFIG_USB_SERIAL_ARK3116 is not set
++CONFIG_USB_SERIAL_BELKIN=m
++# CONFIG_USB_SERIAL_CH341 is not set
++# CONFIG_USB_SERIAL_WHITEHEAT is not set
++# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
++# CONFIG_USB_SERIAL_CP210X is not set
++# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
++# CONFIG_USB_SERIAL_EMPEG is not set
++# CONFIG_USB_SERIAL_FTDI_SIO is not set
++# CONFIG_USB_SERIAL_FUNSOFT is not set
++# CONFIG_USB_SERIAL_VISOR is not set
++# CONFIG_USB_SERIAL_IPAQ is not set
++# CONFIG_USB_SERIAL_IR is not set
++# CONFIG_USB_SERIAL_EDGEPORT is not set
++# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
++# CONFIG_USB_SERIAL_GARMIN is not set
++# CONFIG_USB_SERIAL_IPW is not set
++# CONFIG_USB_SERIAL_IUU is not set
++# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
++# CONFIG_USB_SERIAL_KEYSPAN is not set
++# CONFIG_USB_SERIAL_KLSI is not set
++# CONFIG_USB_SERIAL_KOBIL_SCT is not set
++# CONFIG_USB_SERIAL_MCT_U232 is not set
++# CONFIG_USB_SERIAL_MOS7720 is not set
++# CONFIG_USB_SERIAL_MOS7840 is not set
++# CONFIG_USB_SERIAL_MOTOROLA is not set
++# CONFIG_USB_SERIAL_NAVMAN is not set
++# CONFIG_USB_SERIAL_PL2303 is not set
++# CONFIG_USB_SERIAL_OTI6858 is not set
++# CONFIG_USB_SERIAL_QUALCOMM is not set
++# CONFIG_USB_SERIAL_SPCP8X5 is not set
++# CONFIG_USB_SERIAL_HP4X is not set
++# CONFIG_USB_SERIAL_SAFE is not set
++# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
++# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
++# CONFIG_USB_SERIAL_SYMBOL is not set
++# CONFIG_USB_SERIAL_TI is not set
++# CONFIG_USB_SERIAL_CYBERJACK is not set
++# CONFIG_USB_SERIAL_XIRCOM is not set
++# CONFIG_USB_SERIAL_OPTION is not set
++# CONFIG_USB_SERIAL_OMNINET is not set
++# CONFIG_USB_SERIAL_OPTICON is not set
++# CONFIG_USB_SERIAL_DEBUG 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_SEVSEG 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_IDMOUSE is not set
++# CONFIG_USB_FTDI_ELAN is not set
++# CONFIG_USB_APPLEDISPLAY is not set
++# CONFIG_USB_SISUSBVGA 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
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_VST is not set
++# CONFIG_USB_GADGET is not set
++
++#
++# OTG and related infrastructure
++#
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
@@ -2042,6 +1069,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=m
++# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
@@ -2217,7 +1245,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
-+# CONFIG_DEBUG_FS is not set
++CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
@@ -2236,13 +1264,16 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+# CONFIG_DEBUG_PREEMPT 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_LOCK_ALLOC is not set
++CONFIG_DEBUG_SPINLOCK=y
++CONFIG_DEBUG_MUTEXES=y
++CONFIG_DEBUG_LOCK_ALLOC=y
+# CONFIG_PROVE_LOCKING is not set
++CONFIG_LOCKDEP=y
+# CONFIG_LOCK_STAT is not set
-+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
++# CONFIG_DEBUG_LOCKDEP is not set
++CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
++CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
@@ -2279,6 +1310,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+# CONFIG_KMEMTRACE is not set
+# CONFIG_WORKQUEUE_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
@@ -2412,10 +1444,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/configs/karo_tx25_defconfig linux-2.6.30-rc
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Kconfig
---- linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Kconfig 2009-06-02 17:05:27.000000000 +0200
-@@ -6,14 +6,26 @@ choice
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Kconfig
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Kconfig 2009-07-01 11:09:09.000000000 +0200
+@@ -6,14 +6,32 @@ choice
config MACH_MX21
bool "i.MX21 support"
@@ -2428,13 +1460,19 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo/arch
bool "i.MX27 support"
+ select ARCH_MXC_IOMUX_V2
+ select ARCH_MXC_HAS_NFC_V1
++ select USB_ARCH_HAS_EHCI
++ select ARCH_MXC_HAS_USBH2
++ select ARCH_MXC_HAS_USBOTG
help
This enables support for Freescale's MX2 based i.MX27 processor.
+config MACH_MX25
+ bool "i.MX25 support"
+ select ARCH_MXC_IOMUX_V3
-+ select ARCH_MXC_HAS_NFC_V2_1
++ select ARCH_MXC_HAS_NFC_V1_1
++ select USB_ARCH_HAS_EHCI
++ select ARCH_MXC_HAS_USBH2
++ select ARCH_MXC_HAS_USBOTG
+ select PHYLIB if FEC
+ help
+ This enables support for Freescale's MX2 based i.MX25 processor.
@@ -2442,7 +1480,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo/arch
endchoice
comment "MX2 platforms:"
-@@ -39,6 +51,26 @@ config MACH_PCM038
+@@ -39,6 +57,26 @@ config MACH_PCM038
Include support for phyCORE-i.MX27 (aka pcm038) platform. This
includes specific configurations for the module and its peripherals.
@@ -2469,14 +1507,14 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo/arch
choice
prompt "Baseboard"
depends on MACH_PCM038
-@@ -60,3 +92,4 @@ config MACH_MX27_3DS
+@@ -60,3 +98,4 @@ config MACH_MX27_3DS
Include support for MX27PDK platform. This includes specific
configurations for the board and its peripherals.
endif
+
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Makefile
---- linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Makefile 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Makefile
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Makefile 2009-06-02 17:59:14.000000000 +0200
@@ -2,17 +2,31 @@
# Makefile for the linux kernel.
#
@@ -2518,9 +1556,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile linux-2.6.30-rc4-karo/arc
+obj-$(CONFIG_MACH_TX27) += karo-tx27.o tx27_gpio.o
+obj-$(CONFIG_MACH_TX25) += karo-tx25.o
+obj-$(CONFIG_MACH_STK5_BASEBOARD) += stk5-baseboard.o
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile.boot linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Makefile.boot
---- linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile.boot 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Makefile.boot 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile.boot linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Makefile.boot
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/Makefile.boot 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/Makefile.boot 2009-06-02 17:59:15.000000000 +0200
@@ -5,3 +5,7 @@ initrd_phys-$(CONFIG_MACH_MX21) := 0xC08
zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000
params_phys-$(CONFIG_MACH_MX27) := 0xA0000100
@@ -2529,9 +1567,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/Makefile.boot linux-2.6.30-rc4-kar
+zreladdr-$(CONFIG_MACH_MX25) := 0x80008000
+params_phys-$(CONFIG_MACH_MX25) := 0x80000100
+initrd_phys-$(CONFIG_MACH_MX25) := 0x80800000
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx21.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx21.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx21.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx21.c 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx21.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx21.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx21.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx21.c 2009-06-02 17:59:15.000000000 +0200
@@ -890,7 +890,7 @@ static struct clk clko_clk = {
.con_id = n, \
.clk = &c, \
@@ -2541,10 +1579,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx21.c linux-2.6.30-rc4-kar
/* It's unlikely that any driver wants one of them directly:
_REGISTER_CLOCK(NULL, "ckih", ckih_clk)
_REGISTER_CLOCK(NULL, "ckil", ckil_clk)
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx25.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx25.c 2009-06-02 17:05:26.000000000 +0200
-@@ -0,0 +1,1967 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx25.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx25.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx25.c 2009-07-06 14:10:59.000000000 +0200
+@@ -0,0 +1,1861 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
@@ -2718,7 +1756,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+#define MXC_CCM_CGCR2_SPBA_OFFSET (42 - 32)
+#define MXC_CCM_CGCR2_SSI1_OFFSET (43 - 32)
+#define MXC_CCM_CGCR2_SSI2_OFFSET (44 - 32)
-+#define MXC_CCM_CGCR2_TCHSCRN_OFFSET (45 - 32)
++#define MXC_CCM_CGCR2_TSC_OFFSET (45 - 32)
+#define MXC_CCM_CGCR2_UART1_OFFSET (46 - 32)
+#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32)
+#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32)
@@ -2821,37 +1859,42 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+static int _clk_pll_set_rate(struct clk *clk, unsigned long rate)
+{
+ unsigned long reg;
-+ signed long pd = 1; /* Pre-divider */
-+ signed long mfi; /* Multiplication Factor (Integer part) */
++ unsigned int pd = 1; /* Pre-divider */
++ unsigned long mfi; /* Multiplication Factor (Integer part) */
+ signed long mfn; /* Multiplication Factor (Integer part) */
-+ signed long mfd; /* Multiplication Factor (Denominator Part) */
++ unsigned long mfd; /* Multiplication Factor (Denominator Part) */
+ signed long tmp;
+ unsigned long ref_freq = clk_get_rate(clk->parent);
++ unsigned long err = ~0;
++ int best_mfn = -1;
++ int best_mfd = -1;
+
+ while (((ref_freq / pd) * 10) > rate)
+ pd++;
+
-+ /* the ref_freq/2 in the following is to round up */
-+ mfi = (((rate / 2) * pd) + (ref_freq / 2)) / ref_freq;
++ mfi = ((rate / 2) * pd) / ref_freq;
+ if (mfi < 5 || mfi > 15)
+ return -EINVAL;
+
-+ /* pick a mfd value that will work
-+ * then solve for mfn */
-+ mfd = ref_freq / 50000;
-+
-+ /*
-+ * pll_freq * pd * mfd
-+ * mfn = -------------------- - (mfi * mfd)
-+ * 2 * ref_freq
-+ */
-+ /* the tmp/2 is for rounding */
+ tmp = ref_freq / 10000;
-+ mfn = ((((((rate / 2) + (tmp / 2)) / tmp) * pd) * mfd) / 10000) -
-+ (mfi * mfd);
-+
-+ printk(KERN_DEBUG "pll freq: %lu PD=%ld MFI=%ld MFD=%ld MFN=%ld (0x%03lx)\n",
-+ rate, pd, mfi, mfd, mfn, (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff);
++ for (mfd = 1; mfd <= 1024; mfd++) {
++ unsigned long act_freq;
++
++ mfn = ((((((rate / 2) + (tmp - 1)) / tmp) * pd) * mfd) / 10000) -
++ (mfi * mfd);
++
++ act_freq = (2 * ref_freq * mfi + (2 * ref_freq * mfn / mfd)) / pd;
++ act_freq -= rate;
++ if (abs(act_freq) < err) {
++ best_mfn = mfn;
++ best_mfd = mfd;
++ err = abs(act_freq);
++ if (err == 0)
++ break;
++ }
++ }
++ mfn = best_mfn;
++ mfd = best_mfd;
+
+ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff;
+ pd--;
@@ -2880,7 +1923,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+static unsigned long _clk_pll_getrate(struct clk *clk)
+{
+ unsigned long rate;
-+ signed long mfi, mfn, mfd, pdf;
++ unsigned int mfi, mfd, pdf;
++ int mfn;
+ unsigned long ref_clk;
+ unsigned long reg;
+
@@ -2902,6 +1946,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ BUG(); /* oops */
+ }
+
++ if (mfn >= 512)
++ mfn = 1024 - mfn;
++
+ mfi = (mfi < 5) ? 5 : mfi;
+ rate = 2LL * ref_clk * mfn;
+ do_div(rate, mfd + 1);
@@ -2983,8 +2030,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+
+ pcdr = __raw_readl(pcdr_a[clk->id >> 2]);
+
-+ perclk_pdf =
-+ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK;
++ perclk_pdf = (pcdr >> ((clk->id & 3) << 3)) &
++ MXC_CCM_PCDR1_PERDIV1_MASK;
+
+ return clk_get_rate(clk->parent) / (perclk_pdf + 1);
+}
@@ -3013,8 +2060,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ return -EINVAL;
+
+ div = clk_get_rate(clk->parent) / rate;
-+ printk(KERN_DEBUG "%s: perclk[%d] parent_rate=%lu rate=%lu div=%lu\n",
-+ __FUNCTION__, clk->id, clk_get_rate(clk->parent), rate, div);
+ if (div > 64 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate))
+ return -EINVAL;
+ div--;
@@ -3089,7 +2134,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+
+static unsigned long _clk_ipg_getrate(struct clk *clk)
+{
-+ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */
++ unsigned long rate = clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */
++ return rate;
+}
+
+/* Top-level clocks */
@@ -3162,7 +2208,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+
+/* Bottom-level clocks */
+
-+struct clk usbotg_clk = {
++static struct clk usbotg_clk = {
+ .id = 0,
+ .parent = &ahb_clk,
+ .enable = _clk_enable,
@@ -3171,16 +2217,27 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk rtic_clk = {
-+ .id = 0,
-+ .parent = &ahb_clk,
-+ .enable = _clk_enable,
-+ .enable_reg = MXC_CCM_CGCR0,
-+ .enable_shift = MXC_CCM_CGCR0_HCLK_RTIC_OFFSET,
-+ .disable = _clk_disable,
++static struct clk rtic_clk[] = {
++ {
++ .id = 0,
++ .parent = &ipg_clk,
++ .enable = _clk_enable,
++ .enable_reg = MXC_CCM_CGCR2,
++ .enable_shift = MXC_CCM_CGCR2_RTIC_OFFSET,
++ .disable = _clk_disable,
++ .secondary = &rtic_clk[1],
++ },
++ {
++ .id = 0,
++ .parent = &ahb_clk,
++ .enable = _clk_enable,
++ .enable_reg = MXC_CCM_CGCR0,
++ .enable_shift = MXC_CCM_CGCR0_HCLK_RTIC_OFFSET,
++ .disable = _clk_disable,
++ },
+};
+
-+struct clk emi_clk = {
++static struct clk emi_clk = {
+ .id = 0,
+ .parent = &ahb_clk,
+ .enable = _clk_enable,
@@ -3189,7 +2246,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk brom_clk = {
++static struct clk brom_clk = {
+ .id = 0,
+ .parent = &ahb_clk,
+ .enable = _clk_enable,
@@ -3250,7 +2307,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+ {
+ .id = 5,
-+ .parent = &upll_clk, /* can be AHB or UPLL */
++ .parent = &ahb_clk, /* can be AHB or UPLL */
+ .round_rate = _clk_perclkx_round_rate,
+ .set_rate = _clk_perclkx_set_rate,
+ .set_parent = _clk_perclkx_set_parent,
@@ -3360,12 +2417,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk nfc_clk = {
++static struct clk nfc_clk = {
+ .id = 0,
+ .parent = &per_clk[8],
+};
+
-+struct clk audmux_clk = {
++static struct clk audmux_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3374,7 +2431,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk ata_clk[] = {
++static struct clk ata_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3394,7 +2451,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk can_clk[] = {
++static struct clk can_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3413,7 +2470,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk csi_clk[] = {
++static struct clk csi_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[0],
@@ -3438,7 +2495,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk cspi_clk[] = {
++static struct clk cspi_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3465,7 +2522,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk dryice_clk = {
++static struct clk dryice_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3474,7 +2531,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk ect_clk = {
++static struct clk ect_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3483,7 +2540,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk epit1_clk[] = {
++static struct clk epit1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[1],
@@ -3499,7 +2556,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk epit2_clk[] = {
++static struct clk epit2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[1],
@@ -3515,7 +2572,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk esai_clk[] = {
++static struct clk esai_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[2],
@@ -3540,7 +2597,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk esdhc1_clk[] = {
++static struct clk esdhc1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[3],
@@ -3565,7 +2622,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk esdhc2_clk[] = {
++static struct clk esdhc2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[4],
@@ -3590,7 +2647,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk fec_clk[] = {
++static struct clk fec_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3610,7 +2667,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk gpio_clk[] = {
++static struct clk gpio_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3657,7 +2714,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ {
+ .id = 1,
+ .parent = &per_clk[5],
-+ .secondary = &gpt1_clk[1],
++ .secondary = &gpt2_clk[1],
+ },
+ {
+ .id = 1,
@@ -3673,7 +2730,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ {
+ .id = 2,
+ .parent = &per_clk[5],
-+ .secondary = &gpt1_clk[1],
++ .secondary = &gpt3_clk[1],
+ },
+ {
+ .id = 2,
@@ -3689,7 +2746,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ {
+ .id = 3,
+ .parent = &per_clk[5],
-+ .secondary = &gpt1_clk[1],
++ .secondary = &gpt4_clk[1],
+ },
+ {
+ .id = 3,
@@ -3701,7 +2758,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk i2c_clk[] = {
++static struct clk i2c_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[6],
@@ -3716,7 +2773,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk iim_clk = {
++static struct clk iim_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3725,7 +2782,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk iomuxc_clk = {
++static struct clk iomuxc_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3734,7 +2791,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk kpp_clk = {
++static struct clk kpp_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3743,7 +2800,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk lcdc_clk[] = {
++static struct clk lcdc_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[7],
@@ -3768,7 +2825,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk owire_clk[] = {
++static struct clk owire_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[9],
@@ -3784,7 +2841,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk pwm1_clk[] = {
++static struct clk pwm1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[10],
@@ -3800,7 +2857,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk pwm2_clk[] = {
++static struct clk pwm2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[10],
@@ -3816,7 +2873,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk pwm3_clk[] = {
++static struct clk pwm3_clk[] = {
+ {
+ .id = 2,
+ .parent = &per_clk[10],
@@ -3832,7 +2889,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk pwm4_clk[] = {
++static struct clk pwm4_clk[] = {
+ {
+ .id = 3,
+ .parent = &per_clk[10],
@@ -3848,7 +2905,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk rngb_clk = {
++static struct clk rngb_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3857,7 +2914,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk scc_clk = {
++static struct clk scc_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3866,7 +2923,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk sdma_clk[] = {
++static struct clk sdma_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3886,7 +2943,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk sim1_clk[] = {
++static struct clk sim1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[11],
@@ -3902,7 +2959,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk sim2_clk[] = {
++static struct clk sim2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[12],
@@ -3918,7 +2975,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk slcdc_clk[] = {
++static struct clk slcdc_clk[] = {
+ {
+ .id = 0,
+ .parent = &ipg_clk,
@@ -3938,7 +2995,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk spba_clk = {
++static struct clk spba_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -3947,7 +3004,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+struct clk ssi1_clk[] = {
++static struct clk ssi1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[13],
@@ -3963,7 +3020,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk ssi2_clk[] = {
++static struct clk ssi2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[14],
@@ -3979,16 +3036,16 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk tchscrn_clk = {
++static struct clk tsc_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
+ .enable_reg = MXC_CCM_CGCR2,
-+ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET,
++ .enable_shift = MXC_CCM_CGCR2_TSC_OFFSET,
+ .disable = _clk_disable,
+};
+
-+struct clk uart1_clk[] = {
++static struct clk uart1_clk[] = {
+ {
+ .id = 0,
+ .parent = &per_clk[15],
@@ -4004,7 +3061,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk uart2_clk[] = {
++static struct clk uart2_clk[] = {
+ {
+ .id = 1,
+ .parent = &per_clk[15],
@@ -4020,7 +3077,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk uart3_clk[] = {
++static struct clk uart3_clk[] = {
+ {
+ .id = 2,
+ .parent = &per_clk[15],
@@ -4036,7 +3093,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk uart4_clk[] = {
++static struct clk uart4_clk[] = {
+ {
+ .id = 3,
+ .parent = &per_clk[15],
@@ -4052,7 +3109,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk uart5_clk[] = {
++static struct clk uart5_clk[] = {
+ {
+ .id = 4,
+ .parent = &per_clk[15],
@@ -4068,7 +3125,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ },
+};
+
-+struct clk wdog_clk = {
++static struct clk wdog_clk = {
+ .id = 0,
+ .parent = &ipg_clk,
+ .enable = _clk_enable,
@@ -4112,9 +3169,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+
+static unsigned long _clk_usb_getrate(struct clk *clk)
+{
-+ unsigned long div =
-+ __raw_readl(MXC_CCM_MCR) & MXC_CCM_CCTL_USB_DIV_MASK;
++ unsigned long div;
+
++ div = __raw_readl(MXC_CCM_MCR) & MXC_CCM_CCTL_USB_DIV_MASK;
+ div >>= MXC_CCM_CCTL_USB_DIV_OFFSET;
+
+ return clk_get_rate(clk->parent) / (div + 1);
@@ -4147,6 +3204,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .set_rate = _clk_usb_set_rate,
+ .round_rate = _clk_usb_round_rate,
+ .set_parent = _clk_usb_set_parent,
++ .secondary = &usbotg_clk,
+};
+
+/* CLKO */
@@ -4250,7 +3308,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ .disable = _clk_disable,
+};
+
-+#ifdef CONFIG_COMMON_CLKDEV
+#define _REGISTER_CLOCK(d, n, c) \
+ { \
+ .dev_id = d, \
@@ -4262,7 +3319,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
+ _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
+ _REGISTER_CLOCK(NULL, "ata", ata_clk[0])
-+ _REGISTER_CLOCK(NULL, "can", can_clk[0])
++ _REGISTER_CLOCK("mxc-flexcan.0", NULL, can_clk[0])
++ _REGISTER_CLOCK("mxc-flexcan.1", NULL, can_clk[1])
+ _REGISTER_CLOCK(NULL, "csi", csi_clk[0])
+ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0])
+ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1])
@@ -4303,149 +3361,25 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ _REGISTER_CLOCK(NULL, "spba", spba_clk)
+ _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk[0])
+ _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk[0])
-+ _REGISTER_CLOCK(NULL, "tchscrn", tchscrn_clk)
++ _REGISTER_CLOCK("mxc-tsadcc.0", NULL, tsc_clk)
+ _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk[0])
+ _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk[0])
+ _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk[0])
+ _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk[0])
+ _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk[0])
-+ _REGISTER_CLOCK(NULL, "wdog", wdog_clk)
++ _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk)
+ _REGISTER_CLOCK(NULL, "usb", usb_clk)
+ _REGISTER_CLOCK(NULL, "clko", clko_clk)
+ _REGISTER_CLOCK(NULL, "brom", brom_clk)
+};
-+#else
-+static struct clk *mxc_clks[] = {
-+ &osc24m_clk,
-+ &osc32k_clk,
-+ &mpll_clk,
-+ &upll_clk,
-+ &cpu_clk,
-+ &ahb_clk,
-+ &ipg_clk,
-+ &per_clk[0],
-+ &per_clk[1],
-+ &per_clk[2],
-+ &per_clk[3],
-+ &per_clk[4],
-+ &per_clk[5],
-+ &per_clk[6],
-+ &per_clk[7],
-+ &per_clk[8],
-+ &per_clk[9],
-+ &per_clk[10],
-+ &per_clk[11],
-+ &per_clk[12],
-+ &per_clk[13],
-+ &per_clk[14],
-+ &per_clk[15],
-+ &nfc_clk,
-+ &audmux_clk,
-+ &ata_clk[0],
-+ &ata_clk[1],
-+ &can_clk[0],
-+ &can_clk[1],
-+ &csi_clk[0],
-+ &csi_clk[1],
-+ &csi_clk[2],
-+ &cspi_clk[0],
-+ &cspi_clk[1],
-+ &cspi_clk[2],
-+ &dryice_clk,
-+ &ect_clk,
-+ &epit1_clk[0],
-+ &epit1_clk[1],
-+ &epit2_clk[0],
-+ &epit2_clk[1],
-+ &esai_clk[0],
-+ &esai_clk[1],
-+ &esai_clk[2],
-+ &esdhc1_clk[0],
-+ &esdhc1_clk[1],
-+ &esdhc1_clk[2],
-+ &esdhc2_clk[0],
-+ &esdhc2_clk[1],
-+ &esdhc2_clk[2],
-+ &fec_clk[0],
-+ &fec_clk[1],
-+ &gpio_clk[0],
-+ &gpio_clk[1],
-+ &gpio_clk[2],
-+ &gpt1_clk[0],
-+ &gpt1_clk[1],
-+ &gpt2_clk[0],
-+ &gpt2_clk[1],
-+ &gpt3_clk[0],
-+ &gpt3_clk[1],
-+ &gpt4_clk[0],
-+ &gpt4_clk[1],
-+ &i2c_clk[0],
-+ &i2c_clk[1],
-+ &i2c_clk[2],
-+ &iim_clk,
-+ &iomuxc_clk,
-+ &kpp_clk,
-+ &lcdc_clk[0],
-+ &lcdc_clk[1],
-+ &lcdc_clk[2],
-+ &owire_clk[0],
-+ &owire_clk[1],
-+ &pwm1_clk[0],
-+ &pwm1_clk[1],
-+ &pwm2_clk[0],
-+ &pwm2_clk[1],
-+ &pwm3_clk[0],
-+ &pwm3_clk[1],
-+ &pwm4_clk[0],
-+ &pwm4_clk[1],
-+ &rngb_clk,
-+ &scc_clk,
-+ &sdma_clk[0],
-+ &sdma_clk[1],
-+ &sim1_clk[0],
-+ &sim1_clk[1],
-+ &sim2_clk[0],
-+ &sim2_clk[1],
-+ &slcdc_clk[0],
-+ &slcdc_clk[1],
-+ &spba_clk,
-+ &ssi1_clk[0],
-+ &ssi1_clk[1],
-+ &ssi2_clk[0],
-+ &ssi2_clk[1],
-+ &tchscrn_clk,
-+ &uart1_clk[0],
-+ &uart1_clk[1],
-+ &uart2_clk[0],
-+ &uart2_clk[1],
-+ &uart3_clk[0],
-+ &uart3_clk[1],
-+ &uart4_clk[0],
-+ &uart4_clk[1],
-+ &uart5_clk[0],
-+ &uart5_clk[1],
-+ &wdog_clk,
-+ &usb_clk,
-+ &clko_clk,
-+};
-+#endif
+
+int __init mx25_clocks_init(unsigned long fref)
+{
+ int i;
+
-+#ifdef CONFIG_COMMON_CLKDEV
-+ for (i = 0; i < ARRAY_SIZE(lookups); i++) {
-+ printk(KERN_DEBUG "Registering clock '%s' '%s'\n",
-+ lookups[i].dev_id ? lookups[i].dev_id : "",
-+ lookups[i].con_id ? lookups[i].con_id : "");
++ for (i = 0; i < ARRAY_SIZE(lookups); i++)
+ clkdev_add(&lookups[i]);
-+ }
-+#else
-+ struct clk **clkp;
-+ for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++)
-+ clk_register(*clkp);
-+#endif
++
+ ckih_rate = fref;
+#ifndef CONFIG_DEBUG_LL
+ /* Turn off all possible clocks */
@@ -4472,29 +3406,27 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+
+ per_clk[i].set_parent(&per_clk[i], &upll_clk);
+ new_rate = per_clk[i].round_rate(&per_clk[i], rate);
++ if (rate == new_rate)
++ break;
+ if ((ret = per_clk[i].set_rate(&per_clk[i], new_rate)) < 0) {
+ printk(KERN_ERR "Error %d setting clk[%d] rate to %lu\n",
+ ret, i, new_rate);
+ }
+ }
+ }
-+#endif
++
+ /* the NFC clock must be derived from AHB clock */
+ clk_set_parent(&per_clk[8], &ahb_clk);
++#endif
+ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6);
++ clk_set_rate(&per_clk[7], clk_get_rate(per_clk[7].parent));
+
+ /* This will propagate to all children and init all the clock rates */
-+#if 1
++#ifdef CONFIG_DEBUG_LL
+ clk_enable(&uart1_clk[0]);
+#endif
+ clk_enable(&emi_clk);
-+ clk_enable(&gpio_clk[0]);
-+ clk_enable(&gpio_clk[1]);
-+ clk_enable(&gpio_clk[2]);
+ clk_enable(&iim_clk);
-+ clk_enable(&gpt1_clk[0]);
-+ clk_enable(&iomuxc_clk);
-+ clk_enable(&scc_clk);
+
+ pr_info("Clock input source is %ld\n", clk_get_rate(&osc24m_clk));
+
@@ -4509,12 +3441,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-kar
+ clk_set_rate(&mpll_clk, clk_get_rate(&mpll_clk));
+ clk_set_rate(&upll_clk, clk_get_rate(&upll_clk));
+
-+ mxc_timer_init(&gpt1_clk[0]);
++ mxc_timer_init(&gpt1_clk[1]);
+ return 0;
+}
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx27.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx27.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx27.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx27.c 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx27.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx27.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/clock_imx27.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/clock_imx27.c 2009-06-02 17:59:15.000000000 +0200
@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0,
.clk = &c, \
},
@@ -4524,9 +3456,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/clock_imx27.c linux-2.6.30-rc4-kar
_REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
_REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/cpu_imx25.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/cpu_imx25.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/cpu_imx25.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/cpu_imx25.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/cpu_imx25.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/cpu_imx25.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/cpu_imx25.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/cpu_imx25.c 2009-06-02 17:59:17.000000000 +0200
@@ -0,0 +1,65 @@
+/*
+ * arch/arm/mach-mx2/cpu_mx25.c
@@ -4593,9 +3525,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/cpu_imx25.c linux-2.6.30-rc4-karo/
+ return cpu_silicon_rev;
+}
+EXPORT_SYMBOL(mx25_revision);
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/crm_regs_mx25.h linux-2.6.30-rc4-karo/arch/arm/mach-mx2/crm_regs_mx25.h
---- linux-2.6.30-rc4/arch/arm/mach-mx2/crm_regs_mx25.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/crm_regs_mx25.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/crm_regs_mx25.h linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/crm_regs_mx25.h
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/crm_regs_mx25.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/crm_regs_mx25.h 2009-06-02 17:59:17.000000000 +0200
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -4787,23 +3719,26 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/crm_regs_mx25.h linux-2.6.30-rc4-k
+#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0)
+
+#endif /* __ARCH_ARM_MACH_MX25_CRM_REGS_H__ */
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices.h linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices.h
---- linux-2.6.30-rc4/arch/arm/mach-mx2/devices.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices.h 2009-06-02 17:05:27.000000000 +0200
-@@ -20,3 +20,9 @@ extern struct platform_device mxc_i2c_de
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/devices.h linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/devices.h
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/devices.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/devices.h 2009-07-01 11:10:15.000000000 +0200
+@@ -20,3 +20,12 @@ extern struct platform_device mxc_i2c_de
extern struct platform_device mxc_i2c_device1;
extern struct platform_device mxc_sdhc_device0;
extern struct platform_device mxc_sdhc_device1;
++extern struct platform_device mxc_usbh1_device;
++extern struct platform_device mxc_usbh2_device;
++extern struct platform_device mxc_usbotg_device;
+#ifdef CONFIG_MACH_MX25
+extern struct platform_device mx25_i2c_device0;
+extern struct platform_device mx25_i2c_device1;
+extern struct platform_device mx25_i2c_device2;
+extern struct platform_device mxc_sdhc_device2;
+#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices_mx25.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices_mx25.c 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,402 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/devices_mx25.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/devices_mx25.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/devices_mx25.c 2009-06-29 10:48:40.000000000 +0200
+@@ -0,0 +1,452 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
@@ -4948,12 +3883,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the CSPI1
+ */
+static struct resource mx25_spi1_resources[] = {
-+ [0] = {
++ {
+ .start = CSPI1_BASE_ADDR,
+ .end = CSPI1_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_CSPI1,
+ .end = MXC_INT_CSPI1,
+ .flags = IORESOURCE_IRQ,
@@ -4984,12 +3919,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the CSPI2
+ */
+static struct resource mx25_spi2_resources[] = {
-+ [0] = {
++ {
+ .start = CSPI2_BASE_ADDR,
+ .end = CSPI2_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_CSPI2,
+ .end = MXC_INT_CSPI2,
+ .flags = IORESOURCE_IRQ,
@@ -5019,12 +3954,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the CSPI3
+ */
+static struct resource mx25_spi3_resources[] = {
-+ [0] = {
++ {
+ .start = CSPI3_BASE_ADDR,
+ .end = CSPI3_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_CSPI3,
+ .end = MXC_INT_CSPI3,
+ .flags = IORESOURCE_IRQ,
@@ -5073,6 +4008,56 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+}
+#endif
+
++#if defined(CONFIG_USB_EHCI_MXC) || defined(CONFIG_USB_EHCI_MXC_MODULE)
++static struct resource mxc_usbotg_resources[] = {
++ {
++ .start = OTG_BASE_ADDR,
++ .end = OTG_BASE_ADDR + 0x1ff,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = MXC_INT_USB_OTG,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 usbotg_dmamask = (u32)~0;
++
++struct platform_device mxc_usbotg_device = {
++ .name = "mxc-ehci",
++ .id = 0,
++ .dev = {
++ .coherent_dma_mask = 0xffffffff,
++ .dma_mask = &usbotg_dmamask,
++ },
++ .num_resources = ARRAY_SIZE(mxc_usbotg_resources),
++ .resource = mxc_usbotg_resources,
++};
++
++static struct resource mxc_usbh2_resources[] = {
++ {
++ .start = USBH2_BASE_ADDR,
++ .end = USBH2_BASE_ADDR + 0x1ff,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = MXC_INT_USB_H2,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 usbh2_dmamask = (u32)~0;
++
++struct platform_device mxc_usbh2_device = {
++ .name = "mxc-ehci",
++ .id = 1,
++ .dev = {
++ .coherent_dma_mask = 0xffffffff,
++ .dma_mask = &usbh2_dmamask,
++ },
++ .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
++ .resource = mxc_usbh2_resources,
++};
++#endif
++
+/* I2C controller and device data */
+#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE)
+
@@ -5080,12 +4065,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the I2C1
+ */
+static struct resource mx25_i2c1_resources[] = {
-+ [0] = {
++ {
+ .start = I2C_BASE_ADDR,
+ .end = I2C_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_I2C,
+ .end = MXC_INT_I2C,
+ .flags = IORESOURCE_IRQ,
@@ -5096,12 +4081,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the I2C2
+ */
+static struct resource mx25_i2c2_resources[] = {
-+ [0] = {
++ {
+ .start = I2C2_BASE_ADDR,
+ .end = I2C2_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_I2C2,
+ .end = MXC_INT_I2C2,
+ .flags = IORESOURCE_IRQ,
@@ -5112,12 +4097,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+ * Resource definition for the I2C3
+ */
+static struct resource mx25_i2c3_resources[] = {
-+ [0] = {
++ {
+ .start = I2C3_BASE_ADDR,
+ .end = I2C3_BASE_ADDR + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
-+ [1] = {
++ {
+ .start = MXC_INT_I2C3,
+ .end = MXC_INT_I2C3,
+ .flags = IORESOURCE_IRQ,
@@ -5206,9 +4191,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-ka
+{
+ return mxc_gpio_init(mx25_gpio_ports, ARRAY_SIZE(mx25_gpio_ports));
+}
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/generic.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/generic.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/generic.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/generic.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/generic.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/generic.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/generic.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/generic.c 2009-06-02 17:59:16.000000000 +0200
@@ -26,6 +26,7 @@
#include <asm/mach/map.h>
@@ -5273,10 +4258,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/generic.c linux-2.6.30-rc4-karo/ar
+ iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
+}
+#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo-tx25.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo-tx25.c 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,1115 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/karo-tx25.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/karo-tx25.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/karo-tx25.c 2009-07-14 13:50:45.000000000 +0200
+@@ -0,0 +1,981 @@
+/*
+ * arch/arm/mach-mx2/karo-tx25.c
+ *
@@ -5310,8 +4295,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/fb.h>
-+//#include <linux/i2c.h>
-+//#include <linux/i2c/at24.h>
+#include <linux/spi/spi.h>
+#include <linux/serial_8250.h>
+#include <linux/fec_enet.h>
@@ -5340,14 +4323,12 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+#include <mach/irqs.h>
+#include <mach/clock.h>
+#include <mach/imxfb.h>
-+//#include <mach/imx_spi.h>
-+//#include <mach/i2c.h>
+#include <mach/mmc.h>
+#include <mach/imx-uart.h>
+#include <mach/mxc_nand.h>
-+//#include <mach/ulpi.h>
-+//#include <mach/mxc_ehci.h>
-+//#include <mach/board-tx25.h>
++#include <mach/mxc_ehci.h>
++#include <mach/mxc_tsadcc.h>
++#include <mach/mxc_can.h>
+
+#include "crm_regs.h"
+#include "devices.h"
@@ -5361,178 +4342,30 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+module_param(tx25_debug, int, 0);
+#endif
+
-+//#include "karo.h"
-+
+int karo_board_type = 0;
+int karo_mod_type = -1;
+
+
-+#ifdef CONFIG_USB_EHCI_MXC
-+
-+#define SMSC_VENDOR_ID 0x0424
-+#define USB3317_PROD_ID 0x0006
-+#define ULPI_FCTL 7
-+
-+static inline const char *ulpi_name(void __iomem *view)
-+{
-+ if ((unsigned long)view & 0x400) {
-+ return "USBH2";
-+ } else {
-+ return "USBOTG";
-+ }
-+}
-+
-+static int usb3317_init(void __iomem *view)
-+{
-+ int vid, pid, ret;
-+#if 1
-+ /* This is a kludge until we know why we sometimes read a wrong
-+ * vendor or product ID!
-+ */
-+ int retries = 3;
-+
-+ retry:
-+#endif
-+ ret = ulpi_read(ISP1504_VID_HIGH, view);
-+ if (ret < 0) {
-+ goto err;
-+ }
-+ vid = ret << 8;
-+
-+ ret = ulpi_read(ISP1504_VID_LOW, view);
-+ if (ret < 0) {
-+ goto err;
-+ }
-+ vid |= ret;
-+
-+ ret = ulpi_read(ISP1504_PID_HIGH, view);
-+ if (ret < 0) {
-+ goto err;
-+ }
-+ pid = ret << 8;
-+
-+ ret = ulpi_read(ISP1504_PID_LOW, view);
-+ if (ret < 0) {
-+ goto err;
-+ }
-+ pid |= ret;
-+
-+ pr_info("ULPI on %s port Vendor ID 0x%x Product ID 0x%x\n",
-+ ulpi_name(view), vid, pid);
-+ if (vid != SMSC_VENDOR_ID || pid != USB3317_PROD_ID) {
-+ if (retries-- < 0) {
-+ pr_err("No USB3317 found\n");
-+ return -ENODEV;
-+ }
-+ goto retry;
-+ }
-+ err:
-+ if (ret < 0) {
-+ printk(KERN_ERR "ULPI read on %s port failed with error %d\n",
-+ ulpi_name(view), ret);
-+ return ret;
-+ }
-+ return 0;
-+}
-+
-+static int usb3317_set_vbus_power(void __iomem *view, int on)
++static int karo_tx25_gpio_config(struct pad_desc *pd, int num)
+{
+ int ret;
++ int i;
++ int count = 0;
+
-+ DBG(0, "%s: Switching %s port VBUS power %s\n", __FUNCTION__,
-+ ulpi_name(view), on ? "on" : "off");
-+
-+ if (on) {
-+ ret = ulpi_set(DRV_VBUS_EXT | /* enable external Vbus */
-+ DRV_VBUS | /* enable internal Vbus */
-+ CHRG_VBUS, /* charge Vbus */
-+ ISP1504_OTGCTL, view);
-+ } else {
-+ ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */
-+ DRV_VBUS, /* disable internal Vbus */
-+ ISP1504_OTGCTL, view);
++ for (i = 0; i < num; i++) {
++ ret = mxc_iomux_v3_setup_pad(&pd[i]);
+ if (ret == 0) {
-+ ret = ulpi_set(DISCHRG_VBUS, /* discharge Vbus */
-+ ISP1504_OTGCTL, view);
++ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i,
++ MXC_PAD_NAME(&pd[i]));
++ count++;
++ mxc_iomux_v3_release_pad(&pd[i]);
++ } else {
++ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i,
++ MXC_PAD_NAME(&pd[i]));
+ }
+ }
-+ if (ret < 0) {
-+ printk(KERN_ERR "ULPI read on %s port failed with error %d\n",
-+ ulpi_name(view), ret);
-+ return ret;
-+ }
-+ return 0;
-+}
-+
-+static int tx25_usbh2_init(struct platform_device *pdev)
-+{
-+ int ret;
-+ u32 temp;
-+ unsigned long flags;
-+ void __iomem *view = IO_ADDRESS(OTG_BASE_ADDR + 0x570);
-+
-+ local_irq_save(flags);
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ temp &= ~((3 << 21) | (1 << 0));
-+ temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 20);
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ local_irq_restore(flags);
-+
-+ /* select ULPI transceiver */
-+ /* this must be done _before_ setting up the GPIOs! */
-+ temp = readl(view + 0x14);
-+ DBG(0, "%s: Changing USBH2_PORTSC1 from %08x to %08x\n", __FUNCTION__,
-+ temp, (temp & ~(3 << 30)) | (2 << 30));
-+ temp &= ~(3 << 30);
-+ temp |= 2 << 30;
-+ writel(temp, view + 0x14);
-+
-+ /* Set to Host mode */
-+ temp = readl(view + 0x38);
-+ DBG(0, "%s: Changing USBH2_USBMODE from %08x to %08x\n", __FUNCTION__,
-+ temp, temp | 3);
-+ writel(temp | 0x3, view + 0x38);
-+
-+ ret = gpio_usbh2_active();
-+ if (ret != 0) {
-+ return ret;
-+ }
-+
-+ ret = usb3317_init(view);
-+ if (ret != 0) {
-+ goto err;
-+ }
-+ ret = usb3317_set_vbus_power(view, 1);
-+ if (ret != 0) {
-+ goto err;
-+ }
-+ return 0;
-+
-+ err:
-+ gpio_usbh2_inactive();
-+ return ret;
-+}
-+
-+static int tx25_usbh2_exit(struct platform_device *pdev)
-+{
-+ gpio_usbh2_inactive();
-+ return 0;
-+}
-+
-+static struct mxc_usbh_platform_data tx25_usbh2_data = {
-+ .init = tx25_usbh2_init,
-+ .exit = tx25_usbh2_exit,
-+};
-+
-+int tx25_usbh2_register(void)
-+{
-+ int ret;
-+
-+ ret = mxc_register_device(&mxc_ehci2, &tx25_usbh2_data);
-+ return ret;
++ return count;
+}
-+device_initcall(tx25_usbh2_register);
-+#endif // CONFIG_USB_EHCI_MXC
+
+//#define FEC_MII_IRQ IRQ_GPIOD(8)
+
@@ -5660,17 +4493,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ return ret;
+ }
+ DBG(0, "%s: Switching FEC PHY power on\n", __FUNCTION__);
-+ //gpio_set_value(TX25_FEC_PWR_GPIO, 1);
-+#if 0
-+ while (1) {
-+ gpio_set_value(TX25_FEC_PWR_GPIO, 1);
-+ mdelay(1000);
-+ gpio_set_value(TX25_FEC_PWR_GPIO, 0);
-+ mdelay(1000);
-+ }
-+#endif
+ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__);
-+// gpio_set_value(TX25_FEC_RST_GPIO, 0);
+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) {
+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i];
+
@@ -5740,13 +4563,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ rel_gpio:
+ while (--i >= 0) {
+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i];
-+#ifdef DEBUG
-+ int grp = pd->gpio / 32 + 1;
-+ int ofs = pd->gpio % 32;
-+
-+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__,
-+ grp, ofs);
-+#endif
+ gpio_free(pd->gpio);
+ }
+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios,
@@ -5777,13 +4593,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios));
+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) {
+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i];
-+#ifdef DEBUG
-+ int grp = pd->gpio / 32 + 1;
-+ int ofs = pd->gpio % 32;
-+
-+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__,
-+ grp, ofs);
-+#endif
+ gpio_free(pd->gpio);
+ }
+}
@@ -5808,45 +4617,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ return 0;
+}
+
-+#if 0
-+/*
-+ * i.MX25 allows RMII mode to be configured via a gasket
-+ */
-+#define FEC_MIIGSK_CFGR_FRCONT (1 << 6)
-+#define FEC_MIIGSK_CFGR_LBMODE (1 << 4)
-+#define FEC_MIIGSK_CFGR_EMODE (1 << 3)
-+#define FEC_MIIGSK_CFGR_IF_MODE_MASK (3 << 0)
-+#define FEC_MIIGSK_CFGR_IF_MODE_MII (0 << 0)
-+#define FEC_MIIGSK_CFGR_IF_MODE_RMII (1 << 0)
-+
-+#define FEC_MIIGSK_ENR_READY (1 << 2)
-+#define FEC_MIIGSK_ENR_EN (1 << 1)
-+
-+#include "../arch/arm/mach-mx25/crm_regs.h"
-+static void __inline__ fec_localhw_setup(struct net_device *dev)
-+{
-+ struct fec_enet_private *fep = netdev_priv(dev);
-+
-+ /*
-+ * Set up the MII gasket for RMII mode
-+ */
-+ printk("%s: enable RMII gasket\n", dev->name);
-+
-+ /* disable the gasket and wait */
-+ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0);
-+ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY)
-+ udelay(1);
-+
-+ /* configure the gasket for RMII, 50 MHz, no loopback, no echo */
-+ fec_reg_write16(fep, FEC_MIIGSK_CFGR, FEC_MIIGSK_CFGR_IF_MODE_RMII);
-+
-+ /* re-enable the gasket */
-+ fec_reg_write16(fep, FEC_MIIGSK_ENR, FEC_MIIGSK_ENR_EN);
-+ fec_reg_read16(fep, FEC_MIIGSK_CFGR);
-+ fec_reg_read16(fep, FEC_MIIGSK_ENR);
-+}
-+#endif
-+
+static int fec_arch_init(struct platform_device *pdev)
+{
+ int ret;
@@ -5908,33 +4678,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+
+/* MTD NAND flash */
+#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE)
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2
-+static struct mtd_partition tx25_nand_partitions[] = {
-+ {
-+ .name = "RedBoot",
-+ .offset = 0,
-+ .size = 0x00040000,
-+ }, {
-+ .name = "kernel",
-+ .offset = MTDPART_OFS_APPEND,
-+ .size = 0x001A0000,
-+ }, {
-+ .name = "rootfs",
-+ .offset = MTDPART_OFS_APPEND,
-+ .size = 0x07E000000,
-+ }, {
-+ .name = "FIS directory",
-+ .offset = MTDPART_OFS_APPEND,
-+ .size = 0x00003000,
-+ .mask_flags = MTD_WRITEABLE,
-+ }, {
-+ .name = "RedBoot config",
-+ .offset = MTDPART_OFS_APPEND,
-+ .size = 0x00001000,
-+ .mask_flags = MTD_WRITEABLE,
-+ },
-+};
-+
+static struct pad_desc karo_tx25_nand_pads[] = {
+ MX25_PAD_NF_CE0__NF_CE0,
+ MX25_PAD_NFWE_B__NFWE_B,
@@ -5953,6 +4696,11 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ MX25_PAD_D0__D0,
+};
+
++static struct mxc_nand_platform_data tx25_nand_data = {
++ .hw_ecc = 1,
++ .width = 1,
++};
++
+static int tx25_nand_init(void)
+{
+ int ret;
@@ -5965,31 +4713,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ }
+ return 0;
+}
-+
-+static void tx25_nand_exit(void)
-+{
-+ mxc_iomux_v3_release_multiple_pads(karo_tx25_nand_pads,
-+ ARRAY_SIZE(karo_tx25_nand_pads));
-+}
-+
-+static struct flash_platform_data tx25_nand_data = {
-+ .map_name = "nand_probe",
-+ .name = "tx25-nand",
-+ .parts = tx25_nand_partitions,
-+ .nr_parts = ARRAY_SIZE(tx25_nand_partitions),
-+ .width = 1,
-+ .init = tx25_nand_init,
-+ .exit = tx25_nand_exit,
-+};
-+#else
-+static struct mxc_nand_platform_data tx25_nand_data = {
-+ .hw_ecc = 1,
-+ .width = 1,
-+};
-+#endif
++arch_initcall(tx25_nand_init);
+
+static struct resource tx25_nand_resources[] = {
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1
+ {
+ .start = NFC_BASE_ADDR + 0x1e00,
+ .end = NFC_BASE_ADDR + 0x1e2f,
@@ -5998,12 +4724,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ .start = NFC_BASE_ADDR,
+ .end = NFC_BASE_ADDR + 0x11ff,
+ .flags = IORESOURCE_MEM,
-+#else
-+ {
-+ .start = NFC_BASE_ADDR,
-+ .end = NFC_BASE_ADDR + 0x1e2f,
-+ .flags = IORESOURCE_MEM,
-+#endif
+ }, {
+ .start = MXC_INT_NANDFC,
+ .end = MXC_INT_NANDFC,
@@ -6038,10 +4758,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+#if 0
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+static struct pad_desc mxc_i2c0_pins[] = {
-+ /*
-+ * it seems the data line misses a pullup, so we must enable
-+ * the internal pullup as a local workaround
-+ */
+ MX25_PAD_I2C1_CLK__I2C1_CLK,
+ MX25_PAD_I2C1_DAT__I2C1_DAT,
+};
@@ -6101,6 +4817,146 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+#endif
+#endif
+
++#if defined(CONFIG_TOUCHSCREEN_MXC_TSADCC) || defined(CONFIG_TOUCHSCREEN_MXC_TSADCC_MODULE)
++static struct resource mxc_tsadcc_resources[] = {
++ {
++ .start = TSC_BASE_ADDR,
++ .end = TSC_BASE_ADDR + 0x85f,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = MXC_INT_TSC,
++ .end = MXC_INT_TSC,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct mxc_tsadcc_pdata mxc_tsadcc_pdata = {
++ .pen_debounce_time = 32,
++ .intref = 1,
++ .adc_clk = 1750000,
++ .tsc_mode = MXC_TSC_4WIRE,
++ .hsyncen = 0,
++};
++
++static struct platform_device mxc_tsadcc_device = {
++ .id = 0,
++ .name = "mxc-tsadcc",
++ .num_resources = ARRAY_SIZE(mxc_tsadcc_resources),
++ .resource = mxc_tsadcc_resources,
++ .dev = {
++ .platform_data = &mxc_tsadcc_pdata,
++ },
++};
++#endif
++
++#if defined(CONFIG_CAN_FLEXCAN) || defined(CONFIG_CAN_FLEXCAN_MODULE)
++
++#ifdef CONFIG_CAN_FLEXCAN_CAN1
++static struct pad_desc tx25_flexcan1_pads[] = {
++ MX25_PAD_GPIO_A__CAN1_TX,
++ MX25_PAD_GPIO_B__CAN1_RX,
++};
++
++static struct resource tx25_flexcan1_resources[] = {
++ {
++ .start = CAN1_BASE_ADDR,
++ .end = CAN1_BASE_ADDR + 0x97f,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = MXC_INT_CAN1,
++ .end = MXC_INT_CAN1,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static int tx25_flexcan1_active(struct platform_device *pdev)
++{
++ return mxc_iomux_v3_setup_multiple_pads(tx25_flexcan1_pads,
++ ARRAY_SIZE(tx25_flexcan1_pads));
++}
++
++static void tx25_flexcan1_inactive(struct platform_device *pdev)
++{
++ mxc_iomux_v3_release_multiple_pads(tx25_flexcan1_pads,
++ ARRAY_SIZE(tx25_flexcan1_pads));
++ karo_tx25_gpio_config(tx25_flexcan1_pads,
++ ARRAY_SIZE(tx25_flexcan1_pads));
++}
++
++static struct flexcan_platform_data tx25_flexcan1_pdata = {
++ //.core_reg = NULL;
++ //.io_reg = NULL;
++ //.xcvr_enable = NULL,
++ .active = tx25_flexcan1_active,
++ .inactive = tx25_flexcan1_inactive,
++};
++
++static struct platform_device tx25_flexcan1_device = {
++ .id = 0,
++ .name = "mxc-flexcan",
++ .num_resources = ARRAY_SIZE(tx25_flexcan1_resources),
++ .resource = tx25_flexcan1_resources,
++ .dev = {
++ .platform_data = &tx25_flexcan1_pdata,
++ },
++};
++#endif // CONFIG_CAN_FLEXCAN_CAN1
++
++#ifdef CONFIG_CAN_FLEXCAN_CAN2
++static struct pad_desc tx25_flexcan2_pads[] = {
++ MX25_PAD_GPIO_C__CAN2_TX,
++ MX25_PAD_GPIO_D__CAN2_RX,
++};
++
++static struct resource tx25_flexcan2_resources[] = {
++ {
++ .start = CAN2_BASE_ADDR,
++ .end = CAN2_BASE_ADDR + 0x97f,
++ .flags = IORESOURCE_MEM,
++ },
++ {
++ .start = MXC_INT_CAN2,
++ .end = MXC_INT_CAN2,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static int tx25_flexcan2_active(struct platform_device *pdev)
++{
++ return mxc_iomux_v3_setup_multiple_pads(tx25_flexcan2_pads,
++ ARRAY_SIZE(tx25_flexcan2_pads));
++}
++
++static void tx25_flexcan2_inactive(struct platform_device *pdev)
++{
++ mxc_iomux_v3_release_multiple_pads(tx25_flexcan2_pads,
++ ARRAY_SIZE(tx25_flexcan2_pads));
++ karo_tx25_gpio_config(tx25_flexcan2_pads,
++ ARRAY_SIZE(tx25_flexcan2_pads));
++}
++
++static struct flexcan_platform_data tx25_flexcan2_pdata = {
++ //.core_reg = NULL;
++ //.io_reg = NULL;
++ //.xcvr_enable = NULL,
++ .active = tx25_flexcan2_active,
++ .inactive = tx25_flexcan2_inactive,
++};
++
++static struct platform_device tx25_flexcan2_device = {
++ .id = 1,
++ .name = "mxc-flexcan",
++ .num_resources = ARRAY_SIZE(tx25_flexcan2_resources),
++ .resource = tx25_flexcan2_resources,
++ .dev = {
++ .platform_data = &tx25_flexcan2_pdata,
++ },
++};
++#endif // CONFIG_CAN_FLEXCAN_CAN2
++#endif // CONFIG_CAN_FLEXCAN || CONFIG_CAN_FLEXCAN_MODULE
++
+struct platform_dev_list {
+ struct platform_device *pdev;
+ int flag;
@@ -6109,19 +4965,28 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ { .pdev = &mxc_rtc_device, .flag = -1, },
+#endif
+#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE)
-+ { .pdev = &tx25_nand_mtd_device, .flag = 1, },
++ { .pdev = &tx25_nand_mtd_device, .flag = -1, },
+#endif
+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
-+ { .pdev = &fec_device, .flag = 1, },
++ { .pdev = &fec_device, .flag = -1, },
+#endif
+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE)
-+ { .pdev = &mxcspi1_device, .flag = 1, },
++ { .pdev = &mxcspi1_device, .flag = -1, },
+#endif
+#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE)
-+ { .pdev = &tx25_v4l2out_device, .flag = 1, },
++ { .pdev = &tx25_v4l2out_device, .flag = -1, },
+#endif
+#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE)
-+ { .pdev = &mxc_vpu_device, .flag = 1, },
++ { .pdev = &mxc_vpu_device, .flag = -1, },
++#endif
++#if defined(CONFIG_TOUCHSCREEN_MXC_TSADCC) || defined(CONFIG_TOUCHSCREEN_MXC_TSADCC_MODULE)
++ { .pdev = &mxc_tsadcc_device, .flag = -1, },
++#endif
++#ifdef CONFIG_CAN_FLEXCAN_CAN1
++ { .pdev = &tx25_flexcan1_device, .flag = -1, },
++#endif
++#ifdef CONFIG_CAN_FLEXCAN_CAN2
++ { .pdev = &tx25_flexcan2_device, .flag = -1, },
+#endif
+};
+#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices)
@@ -6292,17 +5157,20 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+
+static int __init karo_tx25_setup_gpios(void)
+{
++#if 1
++ int count;
++
++ count = karo_tx25_gpio_config(karo_tx25_gpios, ARRAY_SIZE(karo_tx25_gpios));
++ DBG(0, "%s: %d out of %d pins set up as GPIO\n", __FUNCTION__,
++ count, ARRAY_SIZE(karo_tx25_gpios));
++#else
+ int i;
+ int ret;
+ int count = 0;
+
+ for (i = 0; i < ARRAY_SIZE(karo_tx25_gpios); i++) {
+ struct pad_desc *pd = &karo_tx25_gpios[i];
-+#if 0
-+ if (i - 64 >= 16 && i - 64 < 32) {
-+ continue;
-+ }
-+#endif
++
+ ret = mxc_iomux_v3_setup_pad(pd);
+ if (ret == 0) {
+#ifdef IOMUX_DEBUG
@@ -6321,23 +5189,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ }
+ }
+ DBG(0, "%s: %d out of %d pins set up as GPIO\n", __FUNCTION__, count, i);
-+#if 0
-+ if (gpio_request(42, "TEST") == 0) {
-+ gpio_direction_output(42, 1);
-+ while (1) {
-+ gpio_set_value(42, 0);
-+ if (gpio_get_value(42)) {
-+ DBG(0, "%s: GPIO 42 is HIGH instead of LOW\n", __FUNCTION__);
-+ }
-+ msleep(1000);
-+ gpio_set_value(42, 1);
-+ if (!gpio_get_value(42)) {
-+ DBG(0, "%s: GPIO 42 is LOW instead of HIGH\n", __FUNCTION__);
-+ }
-+ msleep(1000);
-+ }
-+ }
-+ gpio_free(42);
+#endif
+ return 0;
+}
@@ -6392,9 +5243,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo/
+ .init_machine = karo_tx25_board_init,
+ .timer = &karo_tx25_timer,
+MACHINE_END
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo.h linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo.h
---- linux-2.6.30-rc4/arch/arm/mach-mx2/karo.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/karo.h linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/karo.h
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/karo.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/karo.h 2009-06-02 17:59:18.000000000 +0200
@@ -0,0 +1,99 @@
+/*
+ * arch/arm/mach-mx2/karo.h
@@ -6495,9 +5346,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/karo.h linux-2.6.30-rc4-karo/arch/
+ SHOW_GPIO_REG(i, ISR);
+ }
+}
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/sdma_script_code.h linux-2.6.30-rc4-karo/arch/arm/mach-mx2/sdma_script_code.h
---- linux-2.6.30-rc4/arch/arm/mach-mx2/sdma_script_code.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/sdma_script_code.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/sdma_script_code.h linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/sdma_script_code.h
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/sdma_script_code.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/sdma_script_code.h 2009-06-02 17:59:18.000000000 +0200
@@ -0,0 +1,159 @@
+
+/*
@@ -6658,10 +5509,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/sdma_script_code.h linux-2.6.30-rc
+ 0xc2d1, 0x0458, 0x0454, 0x6add, 0x7ff6, 0xc261, 0x98c6
+};
+#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-karo/arch/arm/mach-mx2/stk5-baseboard.c
---- linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx2/stk5-baseboard.c 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,1003 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/stk5-baseboard.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx2/stk5-baseboard.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx2/stk5-baseboard.c 2009-07-14 13:51:43.000000000 +0200
+@@ -0,0 +1,1187 @@
+/*
+ * arch/arm/mach-mx2/stk5-baseboard.c
+ *
@@ -6698,7 +5549,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+#include <linux/i2c.h>
+#include <linux/i2c/at24.h>
+#include <linux/spi/spi.h>
-+//#include <linux/serial_8250.h>
+
+#include <linux/serial.h>
+#include <linux/fsl_devices.h>
@@ -6723,8 +5573,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+#include <mach/i2c.h>
+#include <mach/mmc.h>
+#include <mach/imx-uart.h>
-+//#include <mach/ulpi.h>
-+//#include <mach/mxc_ehci.h>
++#include <mach/mxc_ehci.h>
+#include <mach/board-stk5.h>
+
+#include "crm_regs.h"
@@ -6805,209 +5654,354 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ },
+};
+
-+static struct platform_device *stk5_uart_devices[] = {
-+#if UART1_ENABLED
-+ &mxc_uart_device0,
-+#endif
-+#if UART2_ENABLED
-+ &mxc_uart_device1,
-+#endif
-+#if UART3_ENABLED
-+ &mxc_uart_device2,
-+#endif
-+#if UART4_ENABLED
-+ &mxc_uart_device3,
-+#endif
-+#if UART5_ENABLED
-+ &mxc_uart_device4,
-+#endif
-+};
++#ifdef CONFIG_USB_EHCI_MXC
+
-+static void __init karo_stk5_serial_init(void)
++/* USB register offsets */
++#define REG_USBCTRL 0x600
++#define REG_PHY_CTRL 0x608
++
++#define PHY_CTRL_USBEN (1 << 24)
++
++/* USB Host/OTG register offsets */
++#define REG_USBCMD 0x140
++#define REG_USBSTS 0x144
++#define REG_PORTSC1 0x184
++#define REG_USBMODE 0x1a8
++
++#define USBCMD_RST (1 << 1)
++#define USBCMD_RUN (1 << 0)
++
++#define USBSTS_HCH (1 << 12)
++
++/* USB_CTRL register bits */
++#define USBCTRL_OCPOL_HST (1 << 2)
++#define USBCTRL_OCPOL_OTG (1 << 3)
++#define USBCTRL_USBTE (1 << 4)
++#define USBCTRL_HSDT (1 << 5)
++#define USBCTRL_PUE_DWN (1 << 6)
++#define USBCTRL_XCSH (1 << 9)
++#define USBCTRL_XCSO (1 << 10)
++#define USBCTRL_PP_OTG (1 << 11)
++#define USBCTRL_HLKEN (1 << 12)
++#define USBCTRL_OLKEN (1 << 13)
++#define USBCTRL_HPM (1 << 16)
++#define USBCTRL_PP_HST (1 << 18)
++#define USBCTRL_HWIE (1 << 19)
++#define USBCTRL_HUIE (1 << 20)
++#define USBCTRL_OPM (1 << 24)
++#define USBCTRL_OEXTEN (1 << 25)
++#define USBCTRL_HEXTEN (1 << 26)
++#define USBCTRL_OWIE (1 << 27)
++#define USBCTRL_OUIE (1 << 28)
++
++#ifdef DEBUG
++#define usb_reg_write(v,b,r) _usb_reg_write(v,b,r,#r)
++static inline void _usb_reg_write(unsigned long val, void __iomem *base, int reg,
++ const char *name)
+{
-+ int i;
++ DBG(0, "%s: Writing %08lx to %s[%03x]\n", __FUNCTION__, val, name, reg);
++ __raw_writel(val, base + reg);
++}
+
-+ for (i = 0; i < ARRAY_SIZE(stk5_uart_devices); i++) {
-+ int ret;
-+ int port = stk5_uart_devices[i]->id;
++#define usb_reg_read(b,r) _usb_reg_read(b,r,#r)
++static inline unsigned long _usb_reg_read(void __iomem *base, int reg, const char *name)
++{
++ unsigned long val;
+
-+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n",
-+ __FUNCTION__, i, stk5_uart_devices[i],
-+ &stk5_uart_devices[i]->dev, stk5_uart_devices[i]->name);
-+ ret = mxc_register_device(stk5_uart_devices[i],
-+ &stk5_uart_ports[port]);
-+ if (ret != 0) {
-+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n",
-+ __FUNCTION__, i, stk5_uart_devices[i]->name, ret);
-+ }
-+ }
++ val = __raw_readl(base + reg);
++ DBG(0, "%s: Read %08lx from %s[%03x]\n", __FUNCTION__, val, name, reg);
++ return val;
+}
+#else
-+static void __init karo_stk5_serial_init(void)
++static inline void usb_reg_write(unsigned long val, void __iomem *base, int reg)
+{
++ __raw_writel(val, base + reg);
+}
-+#endif
+
-+#ifdef CONFIG_USB_EHCI_MXC
-+
-+#define SMSC_VENDOR_ID 0x0424
-+#define USB3317_PROD_ID 0x0006
-+#define ULPI_FCTL 7
-+
-+static inline const char *ulpi_name(void __iomem *view)
++static inline unsigned long usb_reg_read(void __iomem *base, int reg)
+{
-+ if ((unsigned long)view & 0x400) {
-+ return "USBH2";
-+ } else {
-+ return "USBOTG";
-+ }
++ return __raw_readl(base + reg);
+}
++#endif
+
-+static int usb3317_init(void __iomem *view)
++static int tx25_usb_init(struct platform_device *pdev, void __iomem *base, int host_mode)
+{
-+ int vid, pid, ret;
-+
-+ ret = ulpi_read(ISP1504_VID_HIGH, view);
-+ if (ret < 0) {
-+ goto err;
++ unsigned long val;
++ unsigned long flags;
++ const char __maybe_unused *name = pdev->id ? "USBH2" : "USBOTG";
++ unsigned int loops = 0;
++ void __iomem *otg_base = IO_ADDRESS(OTG_BASE_ADDR);
++ int ll = console_loglevel;
++
++ console_loglevel = 8;
++
++ if (!(usb_reg_read(base, REG_USBSTS) & USBSTS_HCH)) {
++ unsigned int loops = 0;
++
++ DBG(0, "%s: %s[%p] is busy: %08lx\n", __FUNCTION__, name,
++ base + REG_USBSTS, usb_reg_read(base, REG_USBSTS));
++ usb_reg_write(usb_reg_read(base, REG_USBCTRL) & ~USBCMD_RUN,
++ base, REG_USBCTRL);
++ while (usb_reg_read(base, REG_USBCTRL) & USBCMD_RUN) {
++ usb_reg_write(usb_reg_read(base, REG_USBCTRL) & ~USBCMD_RUN,
++ base, REG_USBCTRL);
++ cpu_relax();
++ loops++;
++ if (loops > 100)
++ break;
++ }
++ if (usb_reg_read(base, REG_USBSTS) & USBSTS_HCH) {
++ DBG(0, "USB controller idle after %u loops\n", loops);
++ } else {
++ DBG(0, "USB controller NOT idle after %u loops\n", loops);
++ }
+ }
-+ vid = ret << 8;
-+
-+ ret = ulpi_read(ISP1504_VID_LOW, view);
-+ if (ret < 0) {
-+ goto err;
++ DBG(0, "%s: PHY_CTRL[%p]=%08lx\n", __FUNCTION__, otg_base + REG_PHY_CTRL,
++ usb_reg_read(otg_base, REG_PHY_CTRL));
++ DBG(0, "%s: USBCMD[%p]=%08lx\n", __FUNCTION__, base + REG_USBCMD,
++ usb_reg_read(base, REG_USBCMD));
++ DBG(0, "%s: USBSTS[%p]=%08lx\n", __FUNCTION__, base + REG_USBSTS,
++ usb_reg_read(base, REG_USBSTS));
++
++ /* reset USB Host controller */
++ usb_reg_write(USBCMD_RST, base, REG_USBCMD);
++ while (usb_reg_read(base, REG_USBCMD) & USBCMD_RST) {
++ cpu_relax();
++ loops++;
+ }
-+ vid |= ret;
++ DBG(0, "USB controller reset finished after %u loops\n", loops);
+
-+ ret = ulpi_read(ISP1504_PID_HIGH, view);
-+ if (ret < 0) {
-+ goto err;
-+ }
-+ pid = ret << 8;
++ /* Switch to Host mode */
++ val = usb_reg_read(base, REG_USBMODE);
++ DBG(0, "%s: Changing %s_USBMODE from %08lx to %08lx\n", __FUNCTION__, name,
++ val, val | (host_mode ? 0x3 : 0x02));
++ usb_reg_write(val | (host_mode ? 0x3 : 0x02), base, REG_USBMODE);
+
-+ ret = ulpi_read(ISP1504_PID_LOW, view);
-+ if (ret < 0) {
-+ goto err;
++ local_irq_save(flags);
++ val = usb_reg_read(otg_base, REG_USBCTRL);
++ if (pdev->id == 1) {
++ val &= ~(USBCTRL_OCPOL_HST | USBCTRL_HPM |
++ USBCTRL_HEXTEN | USBCTRL_HWIE);
++ val |= USBCTRL_PP_HST | USBCTRL_HSDT | USBCTRL_USBTE |
++ USBCTRL_XCSH | USBCTRL_PUE_DWN;
++ } else {
++ val &= ~(USBCTRL_OCPOL_OTG | USBCTRL_OPM |
++ USBCTRL_OEXTEN | USBCTRL_OWIE);
++ val |= USBCTRL_PP_OTG | USBCTRL_XCSO;
+ }
-+ pid |= ret;
++ DBG(0, "%s: Changing %s_USBCTRL from %08lx to %08lx\n", __FUNCTION__, name,
++ usb_reg_read(otg_base, REG_USBCTRL), val);
++ usb_reg_write(val, otg_base, REG_USBCTRL);
++ local_irq_restore(flags);
+
-+ pr_info("ULPI on %s port Vendor ID 0x%x Product ID 0x%x\n",
-+ ulpi_name(view), vid, pid);
-+ if (vid != SMSC_VENDOR_ID || pid != USB3317_PROD_ID) {
-+ pr_err("No USB3317 found\n");
-+ return -ENODEV;
-+ }
-+ err:
-+ if (ret < 0) {
-+ printk(KERN_ERR "ULPI read on %s port failed with error %d\n",
-+ ulpi_name(view), ret);
-+ return ret;
++ val = usb_reg_read(base, REG_PORTSC1);
++ if (pdev->id == 1) {
++ /* select serial transceiver */
++ val = (val & ~(3 << 30)) | (3 << 30);
++ } else {
++ /* select UTMI transceiver */
++ val = (val & ~((3 << 30) | (0 << 28))) | (0 << 30);
+ }
++ DBG(0, "%s: Changing %s_PORTSC1 from %08lx to %08lx\n", __FUNCTION__, name,
++ usb_reg_read(base, REG_PORTSC1), val);
++ usb_reg_write(val, base, REG_PORTSC1);
++
++ console_loglevel = ll;
+ return 0;
+}
+
-+static int usb3317_set_vbus_power(void __iomem *view, int on)
++#ifdef CONFIG_ARCH_MXC_EHCI_USBH2
++/*
++ * The USB power switch (MAX893L) used on the STK5 base board
++ * produces a pulse (~100us) on the OC output whenever
++ * the ON input is activated. This disturbs the USB controller.
++ * As a workaround don't use USB power switching.
++ * If you have a hardware that works cleanly you may
++ * #define USE_USB_PWR to enable port power control for
++ * the EHCI controller.
++ */
++static struct pad_desc karo_tx25_usbh2_pads[] = {
++#ifdef USE_USB_PWR
++ MX25_PAD_D9__USBH2_PWR,
++#endif
++ MX25_PAD_D8__USBH2_OC,
++};
++
++static int tx25_usbh2_init(struct platform_device *pdev)
+{
+ int ret;
-+
-+ DBG(0, "%s: Switching %s port VBUS power %s\n", __FUNCTION__,
-+ ulpi_name(view), on ? "on" : "off");
-+
-+ if (on) {
-+ ret = ulpi_set(DRV_VBUS_EXT | /* enable external Vbus */
-+ DRV_VBUS | /* enable internal Vbus */
-+ CHRG_VBUS, /* charge Vbus */
-+ ISP1504_OTGCTL, view);
-+ } else {
-+ ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */
-+ DRV_VBUS, /* disable internal Vbus */
-+ ISP1504_OTGCTL, view);
-+ if (ret == 0) {
-+ ret = ulpi_set(DISCHRG_VBUS, /* discharge Vbus */
-+ ISP1504_OTGCTL, view);
-+ }
++ void __iomem *base = IO_ADDRESS(OTG_BASE_ADDR + 0x400);
++#ifndef USE_USB_PWR
++ const int pwr_gpio = 3 * 32 + 11;
++#endif
++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_usbh2_pads,
++ ARRAY_SIZE(karo_tx25_usbh2_pads));
++#ifdef USE_USB_PWR
++ if (ret) {
++ return ret;
+ }
-+ if (ret < 0) {
-+ printk(KERN_ERR "ULPI read on %s port failed with error %d\n",
-+ ulpi_name(view), ret);
++#else
++ ret = gpio_request(pwr_gpio, "USBH2_PWR");
++ if (ret) {
++ DBG(0, "%s: Failed to request GPIO %d\n", __FUNCTION__,
++ pwr_gpio);
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbh2_pads,
++ ARRAY_SIZE(karo_tx25_usbh2_pads));
+ return ret;
+ }
++
++ gpio_direction_output(pwr_gpio, 1);
++#endif
++ if (ret != 0) {
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbh2_pads,
++ ARRAY_SIZE(karo_tx25_usbh2_pads));
++ goto exit;
++ }
++ ret = tx25_usb_init(pdev, base, 1);
++
++ exit:
++#ifndef USE_USB_PWR
++ gpio_free(pwr_gpio);
++#endif
++ return ret;
++}
++
++static int tx25_usbh2_exit(struct platform_device *pdev)
++{
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbh2_pads,
++ ARRAY_SIZE(karo_tx25_usbh2_pads));
+ return 0;
+}
+
-+static int stk5_usbh2_init(struct platform_device *pdev)
++static struct mxc_usbh_platform_data tx25_usbh2_data = {
++ .init = tx25_usbh2_init,
++ .exit = tx25_usbh2_exit,
++};
++
++int tx25_usbh2_register(void)
+{
+ int ret;
-+ u32 temp;
-+ unsigned long flags;
-+ void __iomem *view = IO_ADDRESS(OTG_BASE_ADDR + 0x570);
+
-+ local_irq_save(flags);
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ temp &= ~((3 << 21) | (1 << 0));
-+ temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 20);
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ local_irq_restore(flags);
++ ret = mxc_register_device(&mxc_usbh2_device, &tx25_usbh2_data);
++ return ret;
++}
++device_initcall(tx25_usbh2_register);
++#endif // CONFIG_ARCH_MXC_EHCI_USBH2
+
-+ /* select ULPI transceiver */
-+ /* this must be done _before_ setting up the GPIOs! */
-+ temp = readl(view + 0x14);
-+ DBG(0, "%s: Changing USBH2_PORTSC1 from %08x to %08x\n", __FUNCTION__,
-+ temp, (temp & ~(3 << 30)) | (2 << 30));
-+ temp &= ~(3 << 30);
-+ temp |= 2 << 30;
-+ writel(temp, view + 0x14);
++#ifdef CONFIG_ARCH_MXC_EHCI_USBOTG
++static struct pad_desc karo_tx25_usbotg_pads[] = {
++#ifdef USE_USB_PWR
++ MX25_PAD_GPIO_A__USBOTG_PWR,
++#endif
++ MX25_PAD_GPIO_B__USBOTG_OC,
++};
+
-+ /* Set to Host mode */
-+ temp = readl(view + 0x38);
-+ DBG(0, "%s: Changing USBH2_USBMODE from %08x to %08x\n", __FUNCTION__,
-+ temp, temp | 3);
-+ writel(temp | 0x3, view + 0x38);
++static int tx25_usbotg_init(struct platform_device *pdev)
++{
++ int ret;
++ void __iomem *base = IO_ADDRESS(OTG_BASE_ADDR + 0x000);
++#ifndef USE_USB_PWR
++ const int pwr_gpio = 0 * 32 + 0;
++#endif
++ DBG(0, "%s: \n", __FUNCTION__);
+
-+ ret = gpio_usbh2_active();
-+ if (ret != 0) {
++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_usbotg_pads,
++ ARRAY_SIZE(karo_tx25_usbotg_pads));
++#ifdef USE_USB_PWR
++ if (ret) {
+ return ret;
+ }
-+
-+ ret = usb3317_init(view);
-+ if (ret != 0) {
-+ goto err;
++#else
++ ret = gpio_request(pwr_gpio, "USBOTG_PWR");
++ if (ret) {
++ DBG(0, "%s: Failed to request GPIO %d\n", __FUNCTION__,
++ pwr_gpio);
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbh2_pads,
++ ARRAY_SIZE(karo_tx25_usbh2_pads));
++ return ret;
+ }
-+ ret = usb3317_set_vbus_power(view, 1);
++
++ gpio_direction_output(pwr_gpio, 1);
++#endif
+ if (ret != 0) {
-+ goto err;
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbotg_pads,
++ ARRAY_SIZE(karo_tx25_usbotg_pads));
++ goto exit;
+ }
-+ return 0;
++ ret = tx25_usb_init(pdev, base, 1);
+
-+ err:
-+ gpio_usbh2_inactive();
++ exit:
++#ifndef USE_USB_PWR
++ gpio_free(pwr_gpio);
++#endif
+ return ret;
+}
+
-+static int stk5_usbh2_exit(struct platform_device *pdev)
++static int tx25_usbotg_exit(struct platform_device *pdev)
+{
-+ gpio_usbh2_inactive();
++ mxc_iomux_v3_release_multiple_pads(karo_tx25_usbotg_pads,
++ ARRAY_SIZE(karo_tx25_usbotg_pads));
+ return 0;
+}
+
-+static struct mxc_usbh_platform_data stk5_usbh2_data = {
-+ .init = stk5_usbh2_init,
-+ .exit = stk5_usbh2_exit,
++static struct mxc_usbh_platform_data tx25_usbotg_data = {
++ .init = tx25_usbotg_init,
++ .exit = tx25_usbotg_exit,
+};
+
-+static int __init karo_stk5_usbh2_register(void)
++int tx25_usbotg_register(void)
+{
+ int ret;
+
-+ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data);
++ ret = mxc_register_device(&mxc_usbotg_device, &tx25_usbotg_data);
+ return ret;
+}
++device_initcall(tx25_usbotg_register);
++#endif // CONFIG_ARCH_MXC_EHCI_USBOTG
++#endif // CONFIG_USB_EHCI_MXC
++
++static struct platform_device *stk5_uart_devices[] = {
++#if UART1_ENABLED
++ &mxc_uart_device0,
++#endif
++#if UART2_ENABLED
++ &mxc_uart_device1,
++#endif
++#if UART3_ENABLED
++ &mxc_uart_device2,
++#endif
++#if UART4_ENABLED
++ &mxc_uart_device3,
++#endif
++#if UART5_ENABLED
++ &mxc_uart_device4,
++#endif
++};
++
++static void __init karo_stk5_serial_init(void)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(stk5_uart_devices); i++) {
++ int ret;
++ int port = stk5_uart_devices[i]->id;
++
++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n",
++ __FUNCTION__, i, stk5_uart_devices[i],
++ &stk5_uart_devices[i]->dev, stk5_uart_devices[i]->name);
++ ret = mxc_register_device(stk5_uart_devices[i],
++ &stk5_uart_ports[port]);
++ if (ret != 0) {
++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n",
++ __FUNCTION__, i, stk5_uart_devices[i]->name, ret);
++ }
++ }
++}
+#else
-+static inline int karo_stk5_usbh2_register(void)
++static void __init karo_stk5_serial_init(void)
+{
-+ return 0;
+}
-+#endif // CONFIG_USB_EHCI_MXC
++#endif
+
+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
+static struct gpio_led stk5_leds[] = {
@@ -7134,25 +6128,71 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+
+static struct imx_fb_platform_data stk5_fb_data[] __initdata = {
+ {
++#if 1
+ //.fb_mode = "Xenarc_700_Y-18",
+ .init = stk5_gpio_lcdc_active,
+ .exit = stk5_gpio_lcdc_inactive,
+ .lcd_power = NULL,
+ .backlight_power = NULL,
+
++ .pixclock = 45833,
++
++ .xres = 640,
++ .yres = 480,
++
++ .bpp = 8,
++
++ .hsync_len = 64,
++ .right_margin = 28 + 1,
++ .left_margin = 20 + 3,
++
++ .vsync_len = 1,
++ .lower_margin = 0,
++ .upper_margin = 16,
++
++ .pcr = PCR_TFT | PCR_COLOR | PCR_END_BYTE_SWAP |
++ PCR_BPIX_8 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL,
++ .dmacr = 0x80040060,
++
++ .cmap_greyscale = 0,
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++
++ .fixed_screen_cpu = NULL,
++ }, {
++#endif
++ //.fb_mode = "Xenarc_700_Y-18",
++ .init = stk5_gpio_lcdc_active,
++ .exit = stk5_gpio_lcdc_inactive,
++ .lcd_power = NULL,
++ .backlight_power = NULL,
++#if 1
+ .pixclock = 34576,
++#else
++ .pixclock = 38033,
++#endif
+ .xres = 640,
+ .yres = 480,
+
+ .bpp = 32,
-+
++#if 1
+ .hsync_len = 64,
+ .right_margin = 60 + 1,
+ .left_margin = 80 + 3,
-+
++#else
++ .hsync_len = 64,
++ .right_margin = 79 + 1,
++ .left_margin = 57 + 3,
++#endif
++#if 1
+ .vsync_len = 2,
++ .lower_margin = 54,
+ .upper_margin = 54,
++#else
++ .vsync_len = 4,
+ .lower_margin = 54,
++ .upper_margin = 54,
++#endif
+#if 0
+ /* currently not used by driver! */
+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) |
@@ -7161,7 +6201,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+#else
+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 |
+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL,
-+ .dmacr = 0x800a0078,
++ .dmacr = 0x80040060,
+#endif
+ .cmap_greyscale = 0,
+ .cmap_inverse = 0,
@@ -7186,8 +6226,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ .left_margin = 118 + 3,
+
+ .vsync_len = 7,
-+ .upper_margin = 44,
+ .lower_margin = 44,
++ .upper_margin = 44,
+#if 0
+ /* currently not used by driver! */
+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) |
@@ -7224,8 +6264,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ .left_margin = 118 + 3,
+
+ .vsync_len = 7,
-+ .upper_margin = 28,
+ .lower_margin = 60,
++ .upper_margin = 28,
+#if 0
+ /* currently not used by driver! */
+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) |
@@ -7266,8 +6306,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ .left_margin = 0 + 3,
+
+ .vsync_len = 35,
-+ .upper_margin = 0,
+ .lower_margin = 0,
++ .upper_margin = 0,
+#if 0
+ /* currently not used by driver! */
+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) |
@@ -7638,11 +6678,6 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ printk(KERN_WARNING "%s: karo_stk5_fb_register() failed: %d\n",
+ __FUNCTION__, ret);
+ }
-+ ret = karo_stk5_usbh2_register();
-+ if (ret) {
-+ printk(KERN_WARNING "%s: karo_stk5_usbh2_register() failed: %d\n",
-+ __FUNCTION__, ret);
-+ }
+
+ for (i = 0; i < STK5_NUM_DEVICES; i++) {
+ if (stk5_devices[i].pdev == NULL) continue;
@@ -7665,9 +6700,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx2/stk5-baseboard.c linux-2.6.30-rc4-
+ return 0;
+}
+subsys_initcall(karo_stk5_board_init);
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx3/clock-imx35.c linux-2.6.30-rc4-karo/arch/arm/mach-mx3/clock-imx35.c
---- linux-2.6.30-rc4/arch/arm/mach-mx3/clock-imx35.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx3/clock-imx35.c 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock-imx35.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx3/clock-imx35.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock-imx35.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx3/clock-imx35.c 2009-06-02 17:59:19.000000000 +0200
@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4
.clk = &c, \
},
@@ -7677,9 +6712,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx3/clock-imx35.c linux-2.6.30-rc4-kar
_REGISTER_CLOCK(NULL, "asrc", asrc_clk)
_REGISTER_CLOCK(NULL, "ata", ata_clk)
_REGISTER_CLOCK(NULL, "audmux", audmux_clk)
-diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx3/clock.c linux-2.6.30-rc4-karo/arch/arm/mach-mx3/clock.c
---- linux-2.6.30-rc4/arch/arm/mach-mx3/clock.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/mach-mx3/clock.c 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock.c linux-2.6.30-rc4-karo3/arch/arm/mach-mx3/clock.c
+--- linux-2.6.30-rc4-git/arch/arm/mach-mx3/clock.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/mach-mx3/clock.c 2009-06-02 17:59:19.000000000 +0200
@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL,
.clk = &c, \
},
@@ -7689,9 +6724,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/mach-mx3/clock.c linux-2.6.30-rc4-karo/arch
_REGISTER_CLOCK(NULL, "emi", emi_clk)
_REGISTER_CLOCK(NULL, "cspi", cspi1_clk)
_REGISTER_CLOCK(NULL, "cspi", cspi2_clk)
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/Kconfig linux-2.6.30-rc4-karo/arch/arm/plat-mxc/Kconfig
---- linux-2.6.30-rc4/arch/arm/plat-mxc/Kconfig 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/Kconfig 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/Kconfig linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/Kconfig
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/Kconfig 2009-06-02 18:01:59.000000000 +0200
@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA
bool
depends on ARCH_MXC
@@ -7702,9 +6737,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/Kconfig linux-2.6.30-rc4-karo/arch
config ARCH_MXC_IOMUX_V3
bool
endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/Makefile linux-2.6.30-rc4-karo/arch/arm/plat-mxc/Makefile
---- linux-2.6.30-rc4/arch/arm/plat-mxc/Makefile 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/Makefile 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/Makefile linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/Makefile
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/Makefile 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/Makefile 2009-06-02 18:02:00.000000000 +0200
@@ -5,7 +5,7 @@
# Common support
obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o
@@ -7717,9 +6752,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/Makefile linux-2.6.30-rc4-karo/arc
+obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
+obj-$(CONFIG_MXC_PWM) += pwm.o
+obj-$(CONFIG_MACH_MX25) += spba.o
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-stk5.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/board-stk5.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-stk5.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/board-stk5.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-stk5.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/board-stk5.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-stk5.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/board-stk5.h 2009-06-02 18:02:13.000000000 +0200
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2009 <LW@KARO-electronics.de>
@@ -7738,9 +6773,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-stk5.h linux-2.
+/* Not available on TX25 */
+#define UART4_ENABLED 0
+#define UART5_ENABLED 0
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-tx25.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/board-tx25.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-tx25.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/board-tx25.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-tx25.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/board-tx25.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/board-tx25.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/board-tx25.h 2009-06-02 18:02:13.000000000 +0200
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2009 <LW@KARO-electronics.de>
@@ -7755,9 +6790,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/board-tx25.h linux-2.
+
+#define MXC_LL_UART_PADDR UART1_BASE_ADDR
+#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/common.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/common.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/common.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/common.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/common.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/common.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/common.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/common.h 2009-06-02 18:02:05.000000000 +0200
@@ -17,6 +17,7 @@ struct clk;
extern void mx1_map_io(void);
extern void mx21_map_io(void);
@@ -7774,9 +6809,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/common.h linux-2.6.30
extern int mx31_clocks_init(unsigned long fref);
extern int mx35_clocks_init(void);
extern int mxc_register_gpios(void);
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/dma.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/dma.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/dma.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/dma.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/dma.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/dma.h 2009-06-02 18:02:13.000000000 +0200
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -8037,9 +7072,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/dma.h linux-2.6.30-rc
+extern int mxc_dma_enable(int channel_num);
+
+#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/hardware.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/hardware.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/hardware.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/hardware.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/hardware.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/hardware.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/hardware.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/hardware.h 2009-06-02 18:02:06.000000000 +0200
@@ -29,13 +29,18 @@
#endif
@@ -8059,9 +7094,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/hardware.h linux-2.6.
#endif
#ifdef CONFIG_ARCH_MX1
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imxfb.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/imxfb.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imxfb.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/imxfb.h 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imxfb.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/imxfb.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/imxfb.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/imxfb.h 2009-06-02 18:02:06.000000000 +0200
@@ -13,7 +13,8 @@
#define PCR_BPIX_4 (2 << 25)
#define PCR_BPIX_8 (3 << 25)
@@ -8072,10 +7107,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/imxfb.h linux-2.6.30-
#define PCR_PIXPOL (1 << 24)
#define PCR_FLMPOL (1 << 23)
#define PCR_LPPOL (1 << 22)
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx25.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux-mx25.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx25.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux-mx25.h 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,905 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx25.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux-mx25.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-mx25.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux-mx25.h 2009-07-01 11:50:13.000000000 +0200
+@@ -0,0 +1,774 @@
+/*
+ * arch/arm/plat-mxc/include/mach/iomux-mx25.h
+ *
@@ -8112,475 +7147,345 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx25.h linux-2.
+ * IOMUX/PAD Bit field definitions
+ */
+
-+#define MX25_PAD_A10__A10 IOMUX_PAD(A10, A10, 0x000, 0x008, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_A10__GPIO_4_0 IOMUX_PAD(A10, GPIO_4_0, 0x000, 0x008, 0x05, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_A13__A13 IOMUX_PAD(A13, A13, 0x22C, 0x00c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A13__GPIO_4_1 IOMUX_PAD(A13, GPIO_4_1, 0x22C, 0x00c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A14__A14 IOMUX_PAD(A14, A14, 0x230, 0x010, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A14__GPIO_2_0 IOMUX_PAD(A14, GPIO_2_0, 0x230, 0x010, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A15__A15 IOMUX_PAD(A15, A15, 0x234, 0x014, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A15__GPIO_2_1 IOMUX_PAD(A15, GPIO_2_1, 0x234, 0x014, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A16__A16 IOMUX_PAD(A16, A16, 0x000, 0x018, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_A16__GPIO_2_2 IOMUX_PAD(A16, GPIO_2_2, 0x000, 0x018, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_A17__A17 IOMUX_PAD(A17, A17, 0x238, 0x01c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A17__GPIO_2_3 IOMUX_PAD(A17, GPIO_2_3, 0x238, 0x01c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A18__A18 IOMUX_PAD(A18, A18, 0x23c, 0x020, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A18__GPIO_2_4 IOMUX_PAD(A18, GPIO_2_4, 0x23c, 0x020, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A18__FEC_COL IOMUX_PAD(A18, FEC_COL, 0x23c, 0x020, 0x17, 0x504, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_A19__A19 IOMUX_PAD(A19, A19, 0x240, 0x024, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A19__FEC_RX_ER IOMUX_PAD(A19, FEC_RX_ER, 0x240, 0x024, 0x17, 0x518, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_A19__GPIO_2_5 IOMUX_PAD(A19, GPIO_2_5, 0x240, 0x024, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A20__A20 IOMUX_PAD(A20, A20, 0x244, 0x028, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A20__GPIO_2_6 IOMUX_PAD(A20, GPIO_2_6, 0x244, 0x028, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A20__FEC_RDATA2 IOMUX_PAD(A20, FEC_RDATA2, 0x244, 0x028, 0x17, 0x50c, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_A21__A21 IOMUX_PAD(A21, A21, 0x248, 0x02c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A21__GPIO_2_7 IOMUX_PAD(A21, GPIO_2_7, 0x248, 0x02c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A21__FEC_RDATA3 IOMUX_PAD(A21, FEC_RDATA3, 0x248, 0x02c, 0x17, 0x510, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_A22__A22 IOMUX_PAD(A22, A22, 0x000, 0x030, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A22__GPIO_2_8 IOMUX_PAD(A22, GPIO_2_8, 0x000, 0x030, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A23__A23 IOMUX_PAD(A23, A23, 0x24c, 0x034, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A23__GPIO_2_9 IOMUX_PAD(A23, GPIO_2_9, 0x24c, 0x034, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A24__A24 IOMUX_PAD(A24, A24, 0x250, 0x038, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A24__GPIO_2_10 IOMUX_PAD(A24, GPIO_2_10, 0x250, 0x038, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A24__FEC_RX_CLK IOMUX_PAD(A24, FEC_RX_CLK, 0x250, 0x038, 0x17, 0x514, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_A25__A25 IOMUX_PAD(A25, A25, 0x254, 0x03c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A25__GPIO_2_11 IOMUX_PAD(A25, GPIO_2_11, 0x254, 0x03c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_A25__FEC_CRS IOMUX_PAD(A25, FEC_CRS, 0x254, 0x03c, 0x17, 0x508, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_EB0__EB0 IOMUX_PAD(EB0, EB0, 0x258, 0x040, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EB0__AUD4_TXD IOMUX_PAD(EB0, AUD4_TXD, 0x258, 0x040, 0x14, 0x464, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EB0__GPIO_2_12 IOMUX_PAD(EB0, GPIO_2_12, 0x258, 0x040, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EB1__EB1 IOMUX_PAD(EB1, EB1, 0x25c, 0x044, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EB1__AUD4_RXD IOMUX_PAD(EB1, AUD4_RXD, 0x25c, 0x044, 0x14, 0x460, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EB1__GPIO_2_13 IOMUX_PAD(EB1, GPIO_2_13, 0x25c, 0x044, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_OE__OE IOMUX_PAD(OE, OE, 0x260, 0x048, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_OE__AUD4_TXC IOMUX_PAD(OE, AUD4_TXC, 0x260, 0x048, 0x14, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_OE__GPIO_2_14 IOMUX_PAD(OE, GPIO_2_14, 0x260, 0x048, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS0__CS0 IOMUX_PAD(CS0, CS0, 0x000, 0x04c, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CS0__GPIO_4_2 IOMUX_PAD(CS0, GPIO_4_2, 0x000, 0x04c, 0x05, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CS1__CS1 IOMUX_PAD(CS1, CS1, 0x000, 0x050, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CS1__GPIO_4_3 IOMUX_PAD(CS1, GPIO_4_3, 0x000, 0x050, 0x05, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CS4__CS4 IOMUX_PAD(CS4, CS4, 0x264, 0x054, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS4__UART5_CTS IOMUX_PAD(CS4, UART5_CTS, 0x264, 0x054, 0x13, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS4__GPIO_3_20 IOMUX_PAD(CS4, GPIO_3_20, 0x264, 0x054, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS5__CS5 IOMUX_PAD(CS5, CS5, 0x268, 0x058, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS5__UART5_RTS IOMUX_PAD(CS5, UART5_RTS, 0x268, 0x058, 0x13, 0x574, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CS5__GPIO_3_21 IOMUX_PAD(CS5, GPIO_3_21, 0x268, 0x058, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_NF_CE0__NF_CE0 IOMUX_PAD(NF_CE0, NF_CE0, 0x26c, 0x05c, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_NF_CE0__GPIO_3_22 IOMUX_PAD(NF_CE0, GPIO_3_22, 0x26c, 0x05c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_ECB__ECB IOMUX_PAD(ECB, ECB, 0x270, 0x060, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_ECB__UART5_TXD_MUX IOMUX_PAD(ECB, UART5_TXD_MUX, 0x270, 0x060, 0x13, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_ECB__GPIO_3_23 IOMUX_PAD(ECB, GPIO_3_23, 0x270, 0x060, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LBA__LBA IOMUX_PAD(LBA, LBA, 0x274, 0x064, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LBA__UART5_RXD_MUX IOMUX_PAD(LBA, UART5_RXD_MUX, 0x274, 0x064, 0x13, 0x578, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LBA__GPIO_3_24 IOMUX_PAD(LBA, GPIO_3_24, 0x274, 0x064, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_BCLK__BCLK IOMUX_PAD(BCLK, BCLK, 0x000, 0x068, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_BCLK__GPIO_4_4 IOMUX_PAD(BCLK, GPIO_4_4, 0x000, 0x068, 0x05, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_RW__RW IOMUX_PAD(RW, RW, 0x278, 0x06c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_RW__AUD4_TXFS IOMUX_PAD(RW, AUD4_TXFS, 0x278, 0x06c, 0x14, 0x474, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_RW__GPIO_3_25 IOMUX_PAD(RW, GPIO_3_25, 0x278, 0x06c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_NFWE_B__NFWE_B IOMUX_PAD(NFWE_B, NFWE_B, 0x000, 0x070, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFWE_B__GPIO_3_26 IOMUX_PAD(NFWE_B, GPIO_3_26, 0x000, 0x070, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFRE_B__NFRE_B IOMUX_PAD(NFRE_B, NFRE_B, 0x000, 0x074, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFRE_B__GPIO_3_27 IOMUX_PAD(NFRE_B, GPIO_3_27, 0x000, 0x074, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFALE__NFALE IOMUX_PAD(NFALE, NFALE, 0x000, 0x078, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFALE__GPIO_3_28 IOMUX_PAD(NFALE, GPIO_3_28, 0x000, 0x078, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFCLE__NFCLE IOMUX_PAD(NFCLE, NFCLE, 0x000, 0x07c, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFCLE__GPIO_3_29 IOMUX_PAD(NFCLE, GPIO_3_29, 0x000, 0x07c, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFWP_B__NFWP_B IOMUX_PAD(NFWP_B, NFWP_B, 0x000, 0x080, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFWP_B__GPIO_3_30 IOMUX_PAD(NFWP_B, GPIO_3_30, 0x000, 0x080, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_NFRB__NFRB IOMUX_PAD(NFRB, NFRB, 0x27c, 0x084, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_NFRB__GPIO_3_31 IOMUX_PAD(NFRB, GPIO_3_31, 0x27c, 0x084, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D15__D15 IOMUX_PAD(D15, D15, 0x280, 0x088, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D15__LD16 IOMUX_PAD(D15, LD16, 0x280, 0x088, 0x01, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D15__GPIO_4_5 IOMUX_PAD(D15, GPIO_4_5, 0x280, 0x088, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D14__D14 IOMUX_PAD(D14, D14, 0x284, 0x08c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D14__LD17 IOMUX_PAD(D14, LD17, 0x284, 0x08c, 0x01, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D14__GPIO_4_6 IOMUX_PAD(D14, GPIO_4_6, 0x284, 0x08c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D13__D13 IOMUX_PAD(D13, D13, 0x288, 0x090, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D13__LD18 IOMUX_PAD(D13, LD18, 0x288, 0x090, 0x01, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D13__GPIO_4_7 IOMUX_PAD(D13, GPIO_4_7, 0x288, 0x090, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D12__D12 IOMUX_PAD(D12, D12, 0x28c, 0x094, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D12__GPIO_4_8 IOMUX_PAD(D12, GPIO_4_8, 0x28c, 0x094, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D11__D11 IOMUX_PAD(D11, D11, 0x290, 0x098, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D11__GPIO_4_9 IOMUX_PAD(D11, GPIO_4_9, 0x290, 0x098, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D10__D10 IOMUX_PAD(D10, D10, 0x294, 0x09c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D10__GPIO_4_10 IOMUX_PAD(D10, GPIO_4_10, 0x294, 0x09c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D10__USBOTG_OC IOMUX_PAD(D10, USBOTG_OC, 0x294, 0x09c, 0x06, 0x57c, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D9__D9 IOMUX_PAD(D9, D9, 0x298, 0x0a0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D9__GPIO_4_11 IOMUX_PAD(D9, GPIO_4_11, 0x298, 0x0a0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D9__USBH2_PWR IOMUX_PAD(D9, USBH2_PWR, 0x298, 0x0a0, 0x06, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D8__D8 IOMUX_PAD(D8, D8, 0x29c, 0x0a4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D8__GPIO_4_12 IOMUX_PAD(D8, GPIO_4_12, 0x29c, 0x0a4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D8__USBH2_OC IOMUX_PAD(D8, USBH2_OC, 0x29c, 0x0a4, 0x06, 0x580, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D7__D7 IOMUX_PAD(D7, D7, 0x2a0, 0x0a8, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D7__GPIO_4_13 IOMUX_PAD(D7, GPIO_4_13, 0x2a0, 0x0a8, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D6__D6 IOMUX_PAD(D6, D6, 0x2a4, 0x0ac, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D6__GPIO_4_14 IOMUX_PAD(D6, GPIO_4_14, 0x2a4, 0x0ac, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D5__D5 IOMUX_PAD(D5, D5, 0x2a8, 0x0b0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D5__GPIO_4_15 IOMUX_PAD(D5, GPIO_4_15, 0x2a8, 0x0b0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D4__D4 IOMUX_PAD(D4, D4, 0x2ac, 0x0b4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D4__GPIO_4_16 IOMUX_PAD(D4, GPIO_4_16, 0x2ac, 0x0b4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D3__D3 IOMUX_PAD(D3, D3, 0x2b0, 0x0b8, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D3__GPIO_4_17 IOMUX_PAD(D3, GPIO_4_17, 0x2b0, 0x0b8, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D2__D2 IOMUX_PAD(D2, D2, 0x2b4, 0x0bc, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D2__GPIO_4_18 IOMUX_PAD(D2, GPIO_4_18, 0x2b4, 0x0bc, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D1__D1 IOMUX_PAD(D1, D1, 0x2b8, 0x0c0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D1__GPIO_4_19 IOMUX_PAD(D1, GPIO_4_19, 0x2b8, 0x0c0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D0__D0 IOMUX_PAD(D0, D0, 0x2bc, 0x0c4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_D0__GPIO_4_20 IOMUX_PAD(D0, GPIO_4_20, 0x2bc, 0x0c4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD0__LD0 IOMUX_PAD(LD0, LD0, 0x2c0, 0x0c8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD0__CSI_D0 IOMUX_PAD(LD0, CSI_D0, 0x2c0, 0x0c8, 0x12, 0x488, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD0__GPIO_2_15 IOMUX_PAD(LD0, GPIO_2_15, 0x2c0, 0x0c8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD1__LD1 IOMUX_PAD(LD1, LD1, 0x2c4, 0x0cc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD1__CSI_D1 IOMUX_PAD(LD1, CSI_D1, 0x2c4, 0x0cc, 0x12, 0x48c, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD1__GPIO_2_16 IOMUX_PAD(LD1, GPIO_2_16, 0x2c4, 0x0cc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD2__LD2 IOMUX_PAD(LD2, LD2, 0x2c8, 0x0d0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD2__GPIO_2_17 IOMUX_PAD(LD2, GPIO_2_17, 0x2c8, 0x0d0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD3__LD3 IOMUX_PAD(LD3, LD3, 0x2cc, 0x0d4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD3__GPIO_2_18 IOMUX_PAD(LD3, GPIO_2_18, 0x2cc, 0x0d4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD4__LD4 IOMUX_PAD(LD4, LD4, 0x2d0, 0x0d8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD4__GPIO_2_19 IOMUX_PAD(LD4, GPIO_2_19, 0x2d0, 0x0d8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD5__LD5 IOMUX_PAD(LD5, LD5, 0x2d4, 0x0dc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD5__GPIO_1_19 IOMUX_PAD(LD5, GPIO_1_19, 0x2d4, 0x0dc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD6__LD6 IOMUX_PAD(LD6, LD6, 0x2d8, 0x0e0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD6__GPIO_1_20 IOMUX_PAD(LD6, GPIO_1_20, 0x2d8, 0x0e0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD7__LD7 IOMUX_PAD(LD7, LD7, 0x2dc, 0x0e4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD7__GPIO_1_21 IOMUX_PAD(LD7, GPIO_1_21, 0x2dc, 0x0e4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD8__LD8 IOMUX_PAD(LD8, LD8, 0x2e0, 0x0e8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD8__FEC_TX_ERR IOMUX_PAD(LD8, FEC_TX_ERR, 0x2e0, 0x0e8, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD9__LD9 IOMUX_PAD(LD9, LD9, 0x2e4, 0x0ec, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD9__FEC_COL IOMUX_PAD(LD9, FEC_COL, 0x2e4, 0x0ec, 0x15, 0x504, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD10__LD10 IOMUX_PAD(LD10, LD10, 0x2e8, 0x0f0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD10__FEC_RX_ER IOMUX_PAD(LD10, FEC_RX_ER, 0x2e8, 0x0f0, 0x15, 0x518, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD11__LD11 IOMUX_PAD(LD11, LD11, 0x2ec, 0x0f4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD11__FEC_RDATA2 IOMUX_PAD(LD11, FEC_RDATA2, 0x2ec, 0x0f4, 0x15, 0x50c, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD12__LD12 IOMUX_PAD(LD12, LD12, 0x2f0, 0x0f8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD12__FEC_RDATA3 IOMUX_PAD(LD12, FEC_RDATA3, 0x2f0, 0x0f8, 0x15, 0x510, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD13__LD13 IOMUX_PAD(LD13, LD13, 0x2f4, 0x0fc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD13__FEC_TDATA2 IOMUX_PAD(LD13, FEC_TDATA2, 0x2f4, 0x0fc, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD14__LD14 IOMUX_PAD(LD14, LD14, 0x2f8, 0x100, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD14__FEC_TDATA3 IOMUX_PAD(LD14, FEC_TDATA3, 0x2f8, 0x100, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_LD15__LD15 IOMUX_PAD(LD15, LD15, 0x2fc, 0x104, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LD15__FEC_RX_CLK IOMUX_PAD(LD15, FEC_RX_CLK, 0x2fc, 0x104, 0x15, 0x514, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_HSYNC__HSYNC IOMUX_PAD(HSYNC, HSYNC, 0x300, 0x108, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_HSYNC__GPIO_1_22 IOMUX_PAD(HSYNC, GPIO_1_22, 0x300, 0x108, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSYNC__VSYNC IOMUX_PAD(VSYNC, VSYNC, 0x304, 0x10c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSYNC__GPIO_1_23 IOMUX_PAD(VSYNC, GPIO_1_23, 0x304, 0x10c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LSCLK__LSCLK IOMUX_PAD(LSCLK, LSCLK, 0x308, 0x110, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_LSCLK__GPIO_1_24 IOMUX_PAD(LSCLK, GPIO_1_24, 0x308, 0x110, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_OE_ACD__OE_ACD IOMUX_PAD(OE_ACD, OE_ACD, 0x30c, 0x114, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_OE_ACD__GPIO_1_25 IOMUX_PAD(OE_ACD, GPIO_1_25, 0x30c, 0x114, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CONTRAST__CONTRAST IOMUX_PAD(CONTRAST, CONTRAST, 0x310, 0x118, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CONTRAST__FEC_CRS IOMUX_PAD(CONTRAST, FEC_CRS, 0x310, 0x118, 0x15, 0x508, 1, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_PWM__PWM IOMUX_PAD(PWM, PWM, 0x314, 0x11c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_PWM__GPIO_1_26 IOMUX_PAD(PWM, GPIO_1_26, 0x314, 0x11c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_PWM__USBH2_OC IOMUX_PAD(PWM, USBH2_OC, 0x314, 0x11c, 0x16, 0x580, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D2__CSI_D2 IOMUX_PAD(CSI_D2, CSI_D2, 0x318, 0x120, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D2__UART5_RXD_MUX IOMUX_PAD(CSI_D2, UART5_RXD_MUX, 0x318, 0x120, 0x11, 0x578, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D2__GPIO_1_27 IOMUX_PAD(CSI_D2, GPIO_1_27, 0x318, 0x120, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D3__CSI_D3 IOMUX_PAD(CSI_D3, CSI_D3, 0x31c, 0x124, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D3__GPIO_1_28 IOMUX_PAD(CSI_D3, GPIO_1_28, 0x31c, 0x124, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D4__CSI_D4 IOMUX_PAD(CSI_D4, CSI_D4, 0x320, 0x128, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D4__UART5_RTS IOMUX_PAD(CSI_D4, UART5_RTS, 0x320, 0x128, 0x11, 0x574, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D4__GPIO_1_29 IOMUX_PAD(CSI_D4, GPIO_1_29, 0x320, 0x128, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D5__CSI_D5 IOMUX_PAD(CSI_D5, CSI_D5, 0x324, 0x12c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D5__GPIO_1_30 IOMUX_PAD(CSI_D5, GPIO_1_30, 0x324, 0x12c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D6__CSI_D6 IOMUX_PAD(CSI_D6, CSI_D6, 0x328, 0x130, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D6__GPIO_1_31 IOMUX_PAD(CSI_D6, GPIO_1_31, 0x328, 0x130, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D7__CSI_D7 IOMUX_PAD(CSI_D7, CSI_D7, 0x32c, 0x134, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D7__GPIO_1_6 IOMUX_PAD(CSI_D7, GPIO_1_6, 0x32c, 0x134, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D8__CSI_D8 IOMUX_PAD(CSI_D8, CSI_D8, 0x330, 0x138, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D8__GPIO_1_7 IOMUX_PAD(CSI_D8, GPIO_1_7, 0x330, 0x138, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D9__CSI_D9 IOMUX_PAD(CSI_D9, CSI_D9, 0x334, 0x13c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_D9__GPIO_4_21 IOMUX_PAD(CSI_D9, GPIO_4_21, 0x334, 0x13c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_MCLK__CSI_MCLK IOMUX_PAD(CSI_MCLK, CSI_MCLK, 0x338, 0x140, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_MCLK__GPIO_1_8 IOMUX_PAD(CSI_MCLK, GPIO_1_8, 0x338, 0x140, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_VSYNC__CSI_VSYNC IOMUX_PAD(CSI_VSYNC, CSI_VSYNC, 0x33c, 0x144, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_VSYNC__GPIO_1_9 IOMUX_PAD(CSI_VSYNC, GPIO_1_9, 0x33c, 0x144, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_HSYNC__CSI_HSYNC IOMUX_PAD(CSI_HSYNC, CSI_HSYNC, 0x340, 0x148, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_HSYNC__GPIO_1_10 IOMUX_PAD(CSI_HSYNC, GPIO_1_10, 0x340, 0x148, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK IOMUX_PAD(CSI_PIXCLK, CSI_PIXCLK, 0x344, 0x14c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 IOMUX_PAD(CSI_PIXCLK, GPIO_1_11, 0x344, 0x14c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_I2C1_CLK__I2C1_CLK IOMUX_PAD(I2C1_CLK, I2C1_CLK, 0x348, 0x150, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_I2C1_CLK__GPIO_1_12 IOMUX_PAD(I2C1_CLK, GPIO_1_12, 0x348, 0x150, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_I2C1_DAT__I2C1_DAT IOMUX_PAD(I2C1_DAT, I2C1_DAT, 0x34c, 0x154, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_I2C1_DAT__GPIO_1_13 IOMUX_PAD(I2C1_DAT, GPIO_1_13, 0x34c, 0x154, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_MOSI__CSPI1_MOSI IOMUX_PAD(CSPI1_MOSI, CSPI1_MOSI, 0x350, 0x158, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_MOSI__GPIO_1_14 IOMUX_PAD(CSPI1_MOSI, GPIO_1_14, 0x350, 0x158, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_MISO__CSPI1_MISO IOMUX_PAD(CSPI1_MISO, CSPI1_MISO, 0x354, 0x15c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_MISO__GPIO_1_15 IOMUX_PAD(CSPI1_MISO, GPIO_1_15, 0x354, 0x15c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SS0__CSPI1_SS0 IOMUX_PAD(CSPI1_SS0, CSPI1_SS0, 0x358, 0x160, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SS0__GPIO_1_16 IOMUX_PAD(CSPI1_SS0, GPIO_1_16, 0x358, 0x160, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SS1__CSPI1_SS1 IOMUX_PAD(CSPI1_SS1, CSPI1_SS1, 0x35c, 0x164, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SS1__GPIO_1_17 IOMUX_PAD(CSPI1_SS1, GPIO_1_17, 0x35c, 0x164, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SCLK__CSPI1_SCLK IOMUX_PAD(CSPI1_SCLK, CSPI1_SCLK, 0x360, 0x168, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_SCLK__GPIO_1_18 IOMUX_PAD(CSPI1_SCLK, GPIO_1_18, 0x360, 0x168, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CSPI1_RDY__CSPI1_RDY IOMUX_PAD(CSPI1_RDY, CSPI1_RDY, 0x364, 0x16c, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_CSPI1_RDY__GPIO_2_22 IOMUX_PAD(CSPI1_RDY, GPIO_2_22, 0x364, 0x16c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(UART1_RXD, UART1_RXD, 0x368, 0x170, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K)
-+#define MX25_PAD_UART1_RXD__GPIO_4_22 IOMUX_PAD(UART1_RXD, GPIO_4_22, 0x368, 0x170, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(UART1_TXD, UART1_TXD, 0x36c, 0x174, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_TXD__GPIO_4_23 IOMUX_PAD(UART1_TXD, GPIO_4_23, 0x36c, 0x174, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(UART1_RTS, UART1_RTS, 0x370, 0x178, 0x10, 0, 0, PAD_CTL_PULL_UP_100K)
-+#define MX25_PAD_UART1_RTS__CSI_D0 IOMUX_PAD(UART1_RTS, CSI_D0, 0x370, 0x178, 0x11, 0x488, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_RTS__GPIO_4_24 IOMUX_PAD(UART1_RTS, GPIO_4_24, 0x370, 0x178, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(UART1_CTS, UART1_CTS, 0x374, 0x17c, 0x10, 0, 0, PAD_CTL_PULL_UP_100K)
-+#define MX25_PAD_UART1_CTS__CSI_D1 IOMUX_PAD(UART1_CTS, CSI_D1, 0x374, 0x17c, 0x11, 0x48c, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART1_CTS__GPIO_4_25 IOMUX_PAD(UART1_CTS, GPIO_4_25, 0x374, 0x17c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(UART2_RXD, UART2_RXD, 0x378, 0x180, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_RXD__GPIO_4_26 IOMUX_PAD(UART2_RXD, GPIO_4_26, 0x378, 0x180, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(UART2_TXD, UART2_TXD, 0x37c, 0x184, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_TXD__GPIO_4_27 IOMUX_PAD(UART2_TXD, GPIO_4_27, 0x37c, 0x184, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(UART2_RTS, UART2_RTS, 0x380, 0x188, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_RTS__FEC_COL IOMUX_PAD(UART2_RTS, FEC_COL, 0x380, 0x188, 0x12, 0x504, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_UART2_RTS__GPIO_4_28 IOMUX_PAD(UART2_RTS, GPIO_4_28, 0x380, 0x188, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_CTS__FEC_RX_ER IOMUX_PAD(UART2_CTS, FEC_RX_ER, 0x384, 0x18c, 0x12, 0x518, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(UART2_CTS, UART2_CTS, 0x384, 0x18c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_UART2_CTS__GPIO_4_29 IOMUX_PAD(UART2_CTS, GPIO_4_29, 0x384, 0x18c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(SD1_CMD, SD1_CMD, 0x388, 0x190, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_CMD__FEC_RDATA2 IOMUX_PAD(SD1_CMD, FEC_RDATA2, 0x388, 0x190, 0x12, 0x50c, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_CMD__GPIO_2_23 IOMUX_PAD(SD1_CMD, GPIO_2_23, 0x388, 0x190, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(SD1_CLK, SD1_CLK, 0x38c, 0x194, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_CLK__FEC_RDATA3 IOMUX_PAD(SD1_CLK, FEC_RDATA3, 0x38c, 0x194, 0x12, 0x510, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_CLK__GPIO_2_24 IOMUX_PAD(SD1_CLK, GPIO_2_24, 0x38c, 0x194, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(SD1_DATA0, SD1_DATA0, 0x390, 0x198, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA0__GPIO_2_25 IOMUX_PAD(SD1_DATA0, GPIO_2_25, 0x390, 0x198, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(SD1_DATA1, SD1_DATA1, 0x394, 0x19c, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA1__AUD7_RXD IOMUX_PAD(SD1_DATA1, AUD7_RXD, 0x394, 0x19c, 0x13, 0x478, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_DATA1__GPIO_2_26 IOMUX_PAD(SD1_DATA1, GPIO_2_26, 0x394, 0x19c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(SD1_DATA2, SD1_DATA2, 0x398, 0x1a0, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA2__FEC_RX_CLK IOMUX_PAD(SD1_DATA2, FEC_RX_CLK, 0x398, 0x1a0, 0x15, 0x514, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA2__GPIO_2_27 IOMUX_PAD(SD1_DATA2, GPIO_2_27, 0x398, 0x1a0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(SD1_DATA3, SD1_DATA3, 0x39c, 0x1a4, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA3__FEC_CRS IOMUX_PAD(SD1_DATA3, FEC_CRS, 0x39c, 0x1a4, 0x10, 0x508, 2, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_SD1_DATA3__GPIO_2_28 IOMUX_PAD(SD1_DATA3, GPIO_2_28, 0x39c, 0x1a4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW0__KPP_ROW0 IOMUX_PAD(KPP_ROW0, KPP_ROW0, 0x3a0, 0x1a8, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_KPP_ROW0__GPIO_2_29 IOMUX_PAD(KPP_ROW0, GPIO_2_29, 0x3a0, 0x1a8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW1__KPP_ROW1 IOMUX_PAD(KPP_ROW1, KPP_ROW1, 0x3a4, 0x1ac, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_KPP_ROW1__GPIO_2_30 IOMUX_PAD(KPP_ROW1, GPIO_2_30, 0x3a4, 0x1ac, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW2__KPP_ROW2 IOMUX_PAD(KPP_ROW2, KPP_ROW2, 0x3a8, 0x1b0, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_KPP_ROW2__CSI_D0 IOMUX_PAD(KPP_ROW2, CSI_D0, 0x3a8, 0x1b0, 0x13, 0x488, 2, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW2__GPIO_2_31 IOMUX_PAD(KPP_ROW2, GPIO_2_31, 0x3a8, 0x1b0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW3__KPP_ROW3 IOMUX_PAD(KPP_ROW3, KPP_ROW3, 0x3ac, 0x1b4, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
-+#define MX25_PAD_KPP_ROW3__CSI_LD1 IOMUX_PAD(KPP_ROW3, CSI_LD1, 0x3ac, 0x1b4, 0x13, 0x48c, 2, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_ROW3__GPIO_3_0 IOMUX_PAD(KPP_ROW3, GPIO_3_0, 0x3ac, 0x1b4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_COL0__KPP_COL0 IOMUX_PAD(KPP_COL0, KPP_COL0, 0x3b0, 0x1b8, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
-+#define MX25_PAD_KPP_COL0__GPIO_3_1 IOMUX_PAD(KPP_COL0, GPIO_3_1, 0x3b0, 0x1b8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_COL1__KPP_COL1 IOMUX_PAD(KPP_COL1, KPP_COL1, 0x3b4, 0x1bc, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
-+#define MX25_PAD_KPP_COL1__GPIO_3_2 IOMUX_PAD(KPP_COL1, GPIO_3_2, 0x3b4, 0x1bc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_COL2__KPP_COL2 IOMUX_PAD(KPP_COL2, KPP_COL2, 0x3b8, 0x1c0, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
-+#define MX25_PAD_KPP_COL2__GPIO_3_3 IOMUX_PAD(KPP_COL2, GPIO_3_3, 0x3b8, 0x1c0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(KPP_COL3, KPP_COL3, 0x3bc, 0x1c4, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
-+#define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(KPP_COL3, GPIO_3_4, 0x3bc, 0x1c4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(FEC_MDC, FEC_MDC, 0x3c0, 0x1c8, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_MDC__AUD4_TXD IOMUX_PAD(FEC_MDC, AUD4_TXD, 0x3c0, 0x1c8, 0x12, 0x464, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_MDC__GPIO_3_5 IOMUX_PAD(FEC_MDC, GPIO_3_5, 0x3c0, 0x1c8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(FEC_MDIO, FEC_MDIO, 0x3c4, 0x1cc, 0x10, 0, 0, PAD_CTL_HYSTERESIS | PAD_CTL_PULL_UP_22K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_MDIO__AUD4_RXD IOMUX_PAD(FEC_MDIO, AUD4_RXD, 0x3c4, 0x1cc, 0x12, 0x460, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_MDIO__GPIO_3_6 IOMUX_PAD(FEC_MDIO, GPIO_3_6, 0x3c4, 0x1cc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_TDATA0__FEC_TDATA0 IOMUX_PAD(FEC_TDATA0, FEC_TDATA0, 0x3c8, 0x1d0, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_TDATA0__GPIO_3_7 IOMUX_PAD(FEC_TDATA0, GPIO_3_7, 0x3c8, 0x1d0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_TDATA1__FEC_TDATA1 IOMUX_PAD(FEC_TDATA1, FEC_TDATA1, 0x3cc, 0x1d4, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_TDATA1__AUD4_TXFS IOMUX_PAD(FEC_TDATA1, AUD4_TXFS, 0x3cc, 0x1d4, 0x12, 0x474, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_TDATA1__GPIO_3_8 IOMUX_PAD(FEC_TDATA1, GPIO_3_8, 0x3cc, 0x1d4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(FEC_TX_EN, FEC_TX_EN, 0x3d0, 0x1d8, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_TX_EN__GPIO_3_9 IOMUX_PAD(FEC_TX_EN, GPIO_3_9 , 0x3d0, 0x1d8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_RDATA0__FEC_RDATA0 IOMUX_PAD(FEC_RDATA0, FEC_RDATA0, 0x3d4, 0x1dc, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_RDATA0__GPIO_3_10 IOMUX_PAD(FEC_RDATA0, GPIO_3_10, 0x3d4, 0x1dc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_RDATA1__FEC_RDATA1 IOMUX_PAD(FEC_RDATA1, FEC_RDATA1, 0x3d8, 0x1e0, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_RDATA1__GPIO_3_11 IOMUX_PAD(FEC_RDATA1, GPIO_3_11, 0x3d8, 0x1e0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(FEC_RX_DV, FEC_RX_DV, 0x3dc, 0x1e4, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_RX_DV__CAN2_RX IOMUX_PAD(FEC_RX_DV, CAN2_RX, 0x3dc, 0x1e4, 0x14, 0x484, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_RX_DV__GPIO_3_12 IOMUX_PAD(FEC_RX_DV, GPIO_3_12, 0x3dc, 0x1e4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_FEC_TX_CLK__FEC_TX_CLK IOMUX_PAD(FEC_TX_CLK, FEC_TX_CLK, 0x3e0, 0x1e8, 0x10, 0, 0, PAD_CTL_HYSTERESIS | PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
-+#define MX25_PAD_FEC_TX_CLK__GPIO_3_13 IOMUX_PAD(FEC_TX_CLK, GPIO_3_13, 0x3e0, 0x1e8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_RTCK__RTCK IOMUX_PAD(RTCK, RTCK, 0x3e4, 0x1ec, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_RTCK__OWIRE IOMUX_PAD(RTCK, OWIRE, 0x3e4, 0x1ec, 0x11, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_RTCK__GPIO_3_14 IOMUX_PAD(RTCK, GPIO_3_14, 0x3e4, 0x1ec, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_DE_B__DE_B IOMUX_PAD(DE_B, DE_B, 0x3ec, 0x1f0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_DE_B__GPIO_2_20 IOMUX_PAD(DE_B, GPIO_2_20, 0x3ec, 0x1f0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_TDO__TDO IOMUX_PAD(TDO, TDO, 0x3e8, 0x000, 0x00, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_A__GPIO_A IOMUX_PAD(GPIO_A, GPIO_A, 0x3f0, 0x1f4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_A__USBOTG_PWR IOMUX_PAD(GPIO_A, USBOTG_PWR, 0x3f0, 0x1f4, 0x12, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_B__GPIO_B IOMUX_PAD(GPIO_B, GPIO_B, 0x3f4, 0x1f8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_B__USBOTG_OC IOMUX_PAD(GPIO_B, USBOTG_OC, 0x3f4, 0x1f8, 0x12, 0x57c, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_C__GPIO_C IOMUX_PAD(GPIO_C, GPIO_C, 0x3f8, 0x1fc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_C__CAN2_TX IOMUX_PAD(GPIO_C, CAN2_TX, 0x3f8, 0x1fc, 0x16, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_D__GPIO_D IOMUX_PAD(GPIO_D, GPIO_D, 0x3fc, 0x200, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_D__CAN2_RX IOMUX_PAD(GPIO_D, CAN2_RX, 0x3fc, 0x200, 0x16, 0x484, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_E__GPIO_E IOMUX_PAD(GPIO_E, GPIO_E, 0x400, 0x204, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_E__AUD7_TXD IOMUX_PAD(GPIO_E, AUD7_TXD, 0x400, 0x204, 0x14, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_F__GPIO_F IOMUX_PAD(GPIO_F, GPIO_F, 0x404, 0x208, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_GPIO_F__AUD7_TXC IOMUX_PAD(GPIO_F, AUD7_TXC, 0x404, 0x208, 0x14, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_EXT_ARMCLK__EXT_ARMCLK IOMUX_PAD(EXT_ARMCLK, EXT_ARMCLK, 0x000, 0x20c, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_EXT_ARMCLK__GPIO_3_15 IOMUX_PAD(EXT_ARMCLK, GPIO_3_15, 0x000, 0x20c, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_UPLL_BYPCLK__UPLL_BYPCLK IOMUX_PAD(UPLL_BYPCLK, UPLL_BYPCLK, 0x000, 0x210, 0x10, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_UPLL_BYPCLK__GPIO_3_16 IOMUX_PAD(UPLL_BYPCLK, GPIO_3_16, 0x000, 0x210, 0x15, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_VSTBY_REQ__VSTBY_REQ IOMUX_PAD(VSTBY_REQ, VSTBY_REQ, 0x408, 0x214, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSTBY_REQ__AUD7_TXFS IOMUX_PAD(VSTBY_REQ, AUD7_TXFS, 0x408, 0x214, 0x14, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSTBY_REQ__GPIO_3_17 IOMUX_PAD(VSTBY_REQ, GPIO_3_17, 0x408, 0x214, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSTBY_ACK__VSTBY_ACK IOMUX_PAD(VSTBY_ACK, VSTBY_ACK, 0x40c, 0x218, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_VSTBY_ACK__GPIO_3_18 IOMUX_PAD(VSTBY_ACK, GPIO_3_18, 0x40c, 0x218, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_POWER_FAIL__POWER_FAIL IOMUX_PAD(POWER_FAIL, POWER_FAIL, 0x410, 0x21c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_POWER_FAIL__AUD7_RXD IOMUX_PAD(POWER_FAIL, AUD7_RXD, 0x410, 0x21c, 0x14, 0x478, 1, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_POWER_FAIL__GPIO_3_19 IOMUX_PAD(POWER_FAIL, GPIO_3_19, 0x410, 0x21c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CLKO__CLKO IOMUX_PAD(CLKO, CLKO, 0x414, 0x220, 0x10, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_CLKO__GPIO_2_21 IOMUX_PAD(CLKO, GPIO_2_21, 0x414, 0x220, 0x15, 0, 0, 0 | NO_PAD_CTRL)
-+#define MX25_PAD_BOOT_MODE0__BOOT_MODE0 IOMUX_PAD(BOOT_MODE0, BOOT_MODE0, 0x000, 0x224, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_BOOT_MODE0__GPIO_4_30 IOMUX_PAD(BOOT_MODE0, GPIO_4_30, 0x000, 0x224, 0x05, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 IOMUX_PAD(BOOT_MODE1, BOOT_MODE1, 0x000, 0x228, 0x00, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_BOOT_MODE1__GPIO_4_31 IOMUX_PAD(BOOT_MODE1, GPIO_4_31, 0x000, 0x228, 0x05, 0, 0, NO_PAD_CTRL)
-+
-+#define MX25_PAD_CTL_GRP_DVS_MISC IOMUX_PAD(0x418, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_FEC IOMUX_PAD(0x41c, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_JTAG IOMUX_PAD(0x420, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_NFC IOMUX_PAD(0x424, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_CSI IOMUX_PAD(0x428, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_WEIM IOMUX_PAD(0x42c, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_DDR IOMUX_PAD(0x430, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_CRM IOMUX_PAD(0x434, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_KPP IOMUX_PAD(0x438, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_SDHC1 IOMUX_PAD(0x43c, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_LCD IOMUX_PAD(0x440, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_UART IOMUX_PAD(0x444, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_NFC IOMUX_PAD(0x448, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_CSI IOMUX_PAD(0x44c, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DSE_CSPI1 IOMUX_PAD(0x450, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DDRTYPE IOMUX_PAD(0x454, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_SDHC1 IOMUX_PAD(0x458, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+#define MX25_PAD_CTL_GRP_DVS_LCD IOMUX_PAD(0x45c, 0x000, 0, 0, 0, NO_PAD_CTRL)
-+
-+#if 0
-+enum {
-+ GPIO_A,
-+ GPIO_B,
-+ GPIO_C,
-+ GPIO_D,
-+ GPIO_E,
-+ GPIO_F,
-+ GPIO_1_6,
-+ GPIO_1_7,
-+ GPIO_1_8,
-+ GPIO_1_9,
-+ GPIO_1_10,
-+ GPIO_1_11,
-+ GPIO_1_12,
-+ GPIO_1_13,
-+ GPIO_1_14,
-+ GPIO_1_15,
-+ GPIO_1_16,
-+ GPIO_1_17,
-+ GPIO_1_18,
-+ GPIO_1_19,
-+ GPIO_1_20,
-+ GPIO_1_21,
-+ GPIO_1_22,
-+ GPIO_1_23,
-+ GPIO_1_24,
-+ GPIO_1_25,
-+ GPIO_1_26,
-+ GPIO_1_27,
-+ GPIO_1_28,
-+ GPIO_1_29,
-+ GPIO_1_30,
-+ GPIO_1_31,
-+ GPIO_2_0,
-+ GPIO_2_1,
-+ GPIO_2_2,
-+ GPIO_2_3,
-+ GPIO_2_4,
-+ GPIO_2_5,
-+ GPIO_2_6,
-+ GPIO_2_7,
-+ GPIO_2_8,
-+ GPIO_2_9,
-+ GPIO_2_10,
-+ GPIO_2_11,
-+ GPIO_2_12,
-+ GPIO_2_13,
-+ GPIO_2_14,
-+ GPIO_2_15,
-+ GPIO_2_16,
-+ GPIO_2_17,
-+ GPIO_2_18,
-+ GPIO_2_19,
-+ GPIO_2_20,
-+ GPIO_2_21,
-+ GPIO_2_22,
-+ GPIO_2_23,
-+ GPIO_2_24,
-+ GPIO_2_25,
-+ GPIO_2_26,
-+ GPIO_2_27,
-+ GPIO_2_28,
-+ GPIO_2_29,
-+ GPIO_2_30,
-+ GPIO_2_31,
-+ GPIO_3_0,
-+ GPIO_3_1,
-+ GPIO_3_2,
-+ GPIO_3_3,
-+ GPIO_3_4,
-+ GPIO_3_5,
-+ GPIO_3_6,
-+ GPIO_3_7,
-+ GPIO_3_8,
-+ GPIO_3_9,
-+ GPIO_3_10,
-+ GPIO_3_11,
-+ GPIO_3_12,
-+ GPIO_3_13,
-+ GPIO_3_14,
-+ GPIO_3_15,
-+ GPIO_3_16,
-+ GPIO_3_17,
-+ GPIO_3_18,
-+ GPIO_3_19,
-+ GPIO_3_20,
-+ GPIO_3_21,
-+ GPIO_3_22,
-+ GPIO_3_23,
-+ GPIO_3_24,
-+ GPIO_3_25,
-+ GPIO_3_26,
-+ GPIO_3_27,
-+ GPIO_3_28,
-+ GPIO_3_29,
-+ GPIO_3_30,
-+ GPIO_3_31,
-+ GPIO_4_0,
-+ GPIO_4_1,
-+ GPIO_4_2,
-+ GPIO_4_3,
-+ GPIO_4_4,
-+ GPIO_4_5,
-+ GPIO_4_6,
-+ GPIO_4_7,
-+ GPIO_4_8,
-+ GPIO_4_9,
-+ GPIO_4_10,
-+ GPIO_4_11,
-+ GPIO_4_12,
-+ GPIO_4_13,
-+ GPIO_4_14,
-+ GPIO_4_15,
-+ GPIO_4_16,
-+ GPIO_4_17,
-+ GPIO_4_18,
-+ GPIO_4_19,
-+ GPIO_4_20,
-+ GPIO_4_21,
-+ GPIO_4_22,
-+ GPIO_4_23,
-+ GPIO_4_24,
-+ GPIO_4_25,
-+ GPIO_4_26,
-+ GPIO_4_27,
-+ GPIO_4_28,
-+ GPIO_4_29,
-+ GPIO_4_30,
-+ GPIO_4_31,
-+};
++#define MX25_PAD_A10__A10 IOMUX_PAD(A10, A10, 0x000, 0x008, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_A10__GPIO_4_0 IOMUX_PAD(A10, GPIO_4_0, 0x000, 0x008, 0x05, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_A13__A13 IOMUX_PAD(A13, A13, 0x22C, 0x00c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A13__GPIO_4_1 IOMUX_PAD(A13, GPIO_4_1, 0x22C, 0x00c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A14__A14 IOMUX_PAD(A14, A14, 0x230, 0x010, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A14__GPIO_2_0 IOMUX_PAD(A14, GPIO_2_0, 0x230, 0x010, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A15__A15 IOMUX_PAD(A15, A15, 0x234, 0x014, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A15__GPIO_2_1 IOMUX_PAD(A15, GPIO_2_1, 0x234, 0x014, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A16__A16 IOMUX_PAD(A16, A16, 0x000, 0x018, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_A16__GPIO_2_2 IOMUX_PAD(A16, GPIO_2_2, 0x000, 0x018, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_A17__A17 IOMUX_PAD(A17, A17, 0x238, 0x01c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A17__GPIO_2_3 IOMUX_PAD(A17, GPIO_2_3, 0x238, 0x01c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A18__A18 IOMUX_PAD(A18, A18, 0x23c, 0x020, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A18__GPIO_2_4 IOMUX_PAD(A18, GPIO_2_4, 0x23c, 0x020, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A18__FEC_COL IOMUX_PAD(A18, FEC_COL, 0x23c, 0x020, 0x17, 0x504, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_A19__A19 IOMUX_PAD(A19, A19, 0x240, 0x024, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A19__FEC_RX_ER IOMUX_PAD(A19, FEC_RX_ER, 0x240, 0x024, 0x17, 0x518, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_A19__GPIO_2_5 IOMUX_PAD(A19, GPIO_2_5, 0x240, 0x024, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A20__A20 IOMUX_PAD(A20, A20, 0x244, 0x028, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A20__GPIO_2_6 IOMUX_PAD(A20, GPIO_2_6, 0x244, 0x028, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A20__FEC_RDATA2 IOMUX_PAD(A20, FEC_RDATA2, 0x244, 0x028, 0x17, 0x50c, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_A21__A21 IOMUX_PAD(A21, A21, 0x248, 0x02c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A21__GPIO_2_7 IOMUX_PAD(A21, GPIO_2_7, 0x248, 0x02c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A21__FEC_RDATA3 IOMUX_PAD(A21, FEC_RDATA3, 0x248, 0x02c, 0x17, 0x510, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_A22__A22 IOMUX_PAD(A22, A22, 0x000, 0x030, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A22__GPIO_2_8 IOMUX_PAD(A22, GPIO_2_8, 0x000, 0x030, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A23__A23 IOMUX_PAD(A23, A23, 0x24c, 0x034, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A23__GPIO_2_9 IOMUX_PAD(A23, GPIO_2_9, 0x24c, 0x034, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A24__A24 IOMUX_PAD(A24, A24, 0x250, 0x038, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A24__GPIO_2_10 IOMUX_PAD(A24, GPIO_2_10, 0x250, 0x038, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A24__FEC_RX_CLK IOMUX_PAD(A24, FEC_RX_CLK, 0x250, 0x038, 0x17, 0x514, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_A25__A25 IOMUX_PAD(A25, A25, 0x254, 0x03c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A25__GPIO_2_11 IOMUX_PAD(A25, GPIO_2_11, 0x254, 0x03c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_A25__FEC_CRS IOMUX_PAD(A25, FEC_CRS, 0x254, 0x03c, 0x17, 0x508, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_EB0__EB0 IOMUX_PAD(EB0, EB0, 0x258, 0x040, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EB0__AUD4_TXD IOMUX_PAD(EB0, AUD4_TXD, 0x258, 0x040, 0x14, 0x464, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EB0__GPIO_2_12 IOMUX_PAD(EB0, GPIO_2_12, 0x258, 0x040, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EB1__EB1 IOMUX_PAD(EB1, EB1, 0x25c, 0x044, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EB1__AUD4_RXD IOMUX_PAD(EB1, AUD4_RXD, 0x25c, 0x044, 0x14, 0x460, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EB1__GPIO_2_13 IOMUX_PAD(EB1, GPIO_2_13, 0x25c, 0x044, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_OE__OE IOMUX_PAD(OE, OE, 0x260, 0x048, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_OE__AUD4_TXC IOMUX_PAD(OE, AUD4_TXC, 0x260, 0x048, 0x14, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_OE__GPIO_2_14 IOMUX_PAD(OE, GPIO_2_14, 0x260, 0x048, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS0__CS0 IOMUX_PAD(CS0, CS0, 0x000, 0x04c, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CS0__GPIO_4_2 IOMUX_PAD(CS0, GPIO_4_2, 0x000, 0x04c, 0x05, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CS1__CS1 IOMUX_PAD(CS1, CS1, 0x000, 0x050, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CS1__GPIO_4_3 IOMUX_PAD(CS1, GPIO_4_3, 0x000, 0x050, 0x05, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CS4__CS4 IOMUX_PAD(CS4, CS4, 0x264, 0x054, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS4__UART5_CTS IOMUX_PAD(CS4, UART5_CTS, 0x264, 0x054, 0x13, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS4__GPIO_3_20 IOMUX_PAD(CS4, GPIO_3_20, 0x264, 0x054, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS5__CS5 IOMUX_PAD(CS5, CS5, 0x268, 0x058, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS5__UART5_RTS IOMUX_PAD(CS5, UART5_RTS, 0x268, 0x058, 0x13, 0x574, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CS5__GPIO_3_21 IOMUX_PAD(CS5, GPIO_3_21, 0x268, 0x058, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_NF_CE0__NF_CE0 IOMUX_PAD(NF_CE0, NF_CE0, 0x26c, 0x05c, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_NF_CE0__GPIO_3_22 IOMUX_PAD(NF_CE0, GPIO_3_22, 0x26c, 0x05c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_ECB__ECB IOMUX_PAD(ECB, ECB, 0x270, 0x060, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_ECB__UART5_TXD_MUX IOMUX_PAD(ECB, UART5_TXD_MUX, 0x270, 0x060, 0x13, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_ECB__GPIO_3_23 IOMUX_PAD(ECB, GPIO_3_23, 0x270, 0x060, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LBA__LBA IOMUX_PAD(LBA, LBA, 0x274, 0x064, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LBA__UART5_RXD_MUX IOMUX_PAD(LBA, UART5_RXD_MUX, 0x274, 0x064, 0x13, 0x578, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LBA__GPIO_3_24 IOMUX_PAD(LBA, GPIO_3_24, 0x274, 0x064, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_BCLK__BCLK IOMUX_PAD(BCLK, BCLK, 0x000, 0x068, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_BCLK__GPIO_4_4 IOMUX_PAD(BCLK, GPIO_4_4, 0x000, 0x068, 0x05, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_RW__RW IOMUX_PAD(RW, RW, 0x278, 0x06c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_RW__AUD4_TXFS IOMUX_PAD(RW, AUD4_TXFS, 0x278, 0x06c, 0x14, 0x474, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_RW__GPIO_3_25 IOMUX_PAD(RW, GPIO_3_25, 0x278, 0x06c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_NFWE_B__NFWE_B IOMUX_PAD(NFWE_B, NFWE_B, 0x000, 0x070, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFWE_B__GPIO_3_26 IOMUX_PAD(NFWE_B, GPIO_3_26, 0x000, 0x070, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFRE_B__NFRE_B IOMUX_PAD(NFRE_B, NFRE_B, 0x000, 0x074, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFRE_B__GPIO_3_27 IOMUX_PAD(NFRE_B, GPIO_3_27, 0x000, 0x074, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFALE__NFALE IOMUX_PAD(NFALE, NFALE, 0x000, 0x078, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFALE__GPIO_3_28 IOMUX_PAD(NFALE, GPIO_3_28, 0x000, 0x078, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFCLE__NFCLE IOMUX_PAD(NFCLE, NFCLE, 0x000, 0x07c, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFCLE__GPIO_3_29 IOMUX_PAD(NFCLE, GPIO_3_29, 0x000, 0x07c, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFWP_B__NFWP_B IOMUX_PAD(NFWP_B, NFWP_B, 0x000, 0x080, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFWP_B__GPIO_3_30 IOMUX_PAD(NFWP_B, GPIO_3_30, 0x000, 0x080, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_NFRB__NFRB IOMUX_PAD(NFRB, NFRB, 0x27c, 0x084, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_NFRB__GPIO_3_31 IOMUX_PAD(NFRB, GPIO_3_31, 0x27c, 0x084, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D15__D15 IOMUX_PAD(D15, D15, 0x280, 0x088, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D15__LD16 IOMUX_PAD(D15, LD16, 0x280, 0x088, 0x01, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D15__GPIO_4_5 IOMUX_PAD(D15, GPIO_4_5, 0x280, 0x088, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D14__D14 IOMUX_PAD(D14, D14, 0x284, 0x08c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D14__LD17 IOMUX_PAD(D14, LD17, 0x284, 0x08c, 0x01, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D14__GPIO_4_6 IOMUX_PAD(D14, GPIO_4_6, 0x284, 0x08c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D13__D13 IOMUX_PAD(D13, D13, 0x288, 0x090, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D13__LD18 IOMUX_PAD(D13, LD18, 0x288, 0x090, 0x01, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D13__GPIO_4_7 IOMUX_PAD(D13, GPIO_4_7, 0x288, 0x090, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D12__D12 IOMUX_PAD(D12, D12, 0x28c, 0x094, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D12__GPIO_4_8 IOMUX_PAD(D12, GPIO_4_8, 0x28c, 0x094, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D11__D11 IOMUX_PAD(D11, D11, 0x290, 0x098, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D11__GPIO_4_9 IOMUX_PAD(D11, GPIO_4_9, 0x290, 0x098, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D10__D10 IOMUX_PAD(D10, D10, 0x294, 0x09c, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D10__GPIO_4_10 IOMUX_PAD(D10, GPIO_4_10, 0x294, 0x09c, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D10__USBOTG_OC IOMUX_PAD(D10, USBOTG_OC, 0x294, 0x09c, 0x06, 0x57c, 0, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_D9__D9 IOMUX_PAD(D9, D9, 0x298, 0x0a0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D9__GPIO_4_11 IOMUX_PAD(D9, GPIO_4_11, 0x298, 0x0a0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D9__USBH2_PWR IOMUX_PAD(D9, USBH2_PWR, 0x298, 0x0a0, 0x06, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_D8__D8 IOMUX_PAD(D8, D8, 0x29c, 0x0a4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D8__GPIO_4_12 IOMUX_PAD(D8, GPIO_4_12, 0x29c, 0x0a4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D8__USBH2_OC IOMUX_PAD(D8, USBH2_OC, 0x29c, 0x0a4, 0x06, 0x580, 0, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_D7__D7 IOMUX_PAD(D7, D7, 0x2a0, 0x0a8, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D7__GPIO_4_13 IOMUX_PAD(D7, GPIO_4_13, 0x2a0, 0x0a8, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D6__D6 IOMUX_PAD(D6, D6, 0x2a4, 0x0ac, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D6__GPIO_4_14 IOMUX_PAD(D6, GPIO_4_14, 0x2a4, 0x0ac, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D5__D5 IOMUX_PAD(D5, D5, 0x2a8, 0x0b0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D5__GPIO_4_15 IOMUX_PAD(D5, GPIO_4_15, 0x2a8, 0x0b0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D4__D4 IOMUX_PAD(D4, D4, 0x2ac, 0x0b4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D4__GPIO_4_16 IOMUX_PAD(D4, GPIO_4_16, 0x2ac, 0x0b4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D3__D3 IOMUX_PAD(D3, D3, 0x2b0, 0x0b8, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D3__GPIO_4_17 IOMUX_PAD(D3, GPIO_4_17, 0x2b0, 0x0b8, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D2__D2 IOMUX_PAD(D2, D2, 0x2b4, 0x0bc, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D2__GPIO_4_18 IOMUX_PAD(D2, GPIO_4_18, 0x2b4, 0x0bc, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D1__D1 IOMUX_PAD(D1, D1, 0x2b8, 0x0c0, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D1__GPIO_4_19 IOMUX_PAD(D1, GPIO_4_19, 0x2b8, 0x0c0, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D0__D0 IOMUX_PAD(D0, D0, 0x2bc, 0x0c4, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_D0__GPIO_4_20 IOMUX_PAD(D0, GPIO_4_20, 0x2bc, 0x0c4, 0x05, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD0__LD0 IOMUX_PAD(LD0, LD0, 0x2c0, 0x0c8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD0__CSI_D0 IOMUX_PAD(LD0, CSI_D0, 0x2c0, 0x0c8, 0x12, 0x488, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD0__GPIO_2_15 IOMUX_PAD(LD0, GPIO_2_15, 0x2c0, 0x0c8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD1__LD1 IOMUX_PAD(LD1, LD1, 0x2c4, 0x0cc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD1__CSI_D1 IOMUX_PAD(LD1, CSI_D1, 0x2c4, 0x0cc, 0x12, 0x48c, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD1__GPIO_2_16 IOMUX_PAD(LD1, GPIO_2_16, 0x2c4, 0x0cc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD2__LD2 IOMUX_PAD(LD2, LD2, 0x2c8, 0x0d0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD2__GPIO_2_17 IOMUX_PAD(LD2, GPIO_2_17, 0x2c8, 0x0d0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD3__LD3 IOMUX_PAD(LD3, LD3, 0x2cc, 0x0d4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD3__GPIO_2_18 IOMUX_PAD(LD3, GPIO_2_18, 0x2cc, 0x0d4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD4__LD4 IOMUX_PAD(LD4, LD4, 0x2d0, 0x0d8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD4__GPIO_2_19 IOMUX_PAD(LD4, GPIO_2_19, 0x2d0, 0x0d8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD5__LD5 IOMUX_PAD(LD5, LD5, 0x2d4, 0x0dc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD5__GPIO_1_19 IOMUX_PAD(LD5, GPIO_1_19, 0x2d4, 0x0dc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD6__LD6 IOMUX_PAD(LD6, LD6, 0x2d8, 0x0e0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD6__GPIO_1_20 IOMUX_PAD(LD6, GPIO_1_20, 0x2d8, 0x0e0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD7__LD7 IOMUX_PAD(LD7, LD7, 0x2dc, 0x0e4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD7__GPIO_1_21 IOMUX_PAD(LD7, GPIO_1_21, 0x2dc, 0x0e4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD8__LD8 IOMUX_PAD(LD8, LD8, 0x2e0, 0x0e8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD8__FEC_TX_ERR IOMUX_PAD(LD8, FEC_TX_ERR, 0x2e0, 0x0e8, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD9__LD9 IOMUX_PAD(LD9, LD9, 0x2e4, 0x0ec, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD9__FEC_COL IOMUX_PAD(LD9, FEC_COL, 0x2e4, 0x0ec, 0x15, 0x504, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD10__LD10 IOMUX_PAD(LD10, LD10, 0x2e8, 0x0f0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD10__FEC_RX_ER IOMUX_PAD(LD10, FEC_RX_ER, 0x2e8, 0x0f0, 0x15, 0x518, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD11__LD11 IOMUX_PAD(LD11, LD11, 0x2ec, 0x0f4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD11__FEC_RDATA2 IOMUX_PAD(LD11, FEC_RDATA2, 0x2ec, 0x0f4, 0x15, 0x50c, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD12__LD12 IOMUX_PAD(LD12, LD12, 0x2f0, 0x0f8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD12__FEC_RDATA3 IOMUX_PAD(LD12, FEC_RDATA3, 0x2f0, 0x0f8, 0x15, 0x510, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD13__LD13 IOMUX_PAD(LD13, LD13, 0x2f4, 0x0fc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD13__FEC_TDATA2 IOMUX_PAD(LD13, FEC_TDATA2, 0x2f4, 0x0fc, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD14__LD14 IOMUX_PAD(LD14, LD14, 0x2f8, 0x100, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD14__FEC_TDATA3 IOMUX_PAD(LD14, FEC_TDATA3, 0x2f8, 0x100, 0x15, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_LD15__LD15 IOMUX_PAD(LD15, LD15, 0x2fc, 0x104, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LD15__FEC_RX_CLK IOMUX_PAD(LD15, FEC_RX_CLK, 0x2fc, 0x104, 0x15, 0x514, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_HSYNC__HSYNC IOMUX_PAD(HSYNC, HSYNC, 0x300, 0x108, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_HSYNC__GPIO_1_22 IOMUX_PAD(HSYNC, GPIO_1_22, 0x300, 0x108, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSYNC__VSYNC IOMUX_PAD(VSYNC, VSYNC, 0x304, 0x10c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSYNC__GPIO_1_23 IOMUX_PAD(VSYNC, GPIO_1_23, 0x304, 0x10c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LSCLK__LSCLK IOMUX_PAD(LSCLK, LSCLK, 0x308, 0x110, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_LSCLK__GPIO_1_24 IOMUX_PAD(LSCLK, GPIO_1_24, 0x308, 0x110, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_OE_ACD__OE_ACD IOMUX_PAD(OE_ACD, OE_ACD, 0x30c, 0x114, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_OE_ACD__GPIO_1_25 IOMUX_PAD(OE_ACD, GPIO_1_25, 0x30c, 0x114, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CONTRAST__CONTRAST IOMUX_PAD(CONTRAST, CONTRAST, 0x310, 0x118, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CONTRAST__FEC_CRS IOMUX_PAD(CONTRAST, FEC_CRS, 0x310, 0x118, 0x15, 0x508, 1, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_PWM__PWM IOMUX_PAD(PWM, PWM, 0x314, 0x11c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_PWM__GPIO_1_26 IOMUX_PAD(PWM, GPIO_1_26, 0x314, 0x11c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_PWM__USBH2_OC IOMUX_PAD(PWM, USBH2_OC, 0x314, 0x11c, 0x16, 0x580, 1, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_CSI_D2__CSI_D2 IOMUX_PAD(CSI_D2, CSI_D2, 0x318, 0x120, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D2__UART5_RXD_MUX IOMUX_PAD(CSI_D2, UART5_RXD_MUX, 0x318, 0x120, 0x11, 0x578, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D2__GPIO_1_27 IOMUX_PAD(CSI_D2, GPIO_1_27, 0x318, 0x120, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D3__CSI_D3 IOMUX_PAD(CSI_D3, CSI_D3, 0x31c, 0x124, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D3__GPIO_1_28 IOMUX_PAD(CSI_D3, GPIO_1_28, 0x31c, 0x124, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D4__CSI_D4 IOMUX_PAD(CSI_D4, CSI_D4, 0x320, 0x128, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D4__UART5_RTS IOMUX_PAD(CSI_D4, UART5_RTS, 0x320, 0x128, 0x11, 0x574, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D4__GPIO_1_29 IOMUX_PAD(CSI_D4, GPIO_1_29, 0x320, 0x128, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D5__CSI_D5 IOMUX_PAD(CSI_D5, CSI_D5, 0x324, 0x12c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D5__GPIO_1_30 IOMUX_PAD(CSI_D5, GPIO_1_30, 0x324, 0x12c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D6__CSI_D6 IOMUX_PAD(CSI_D6, CSI_D6, 0x328, 0x130, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D6__GPIO_1_31 IOMUX_PAD(CSI_D6, GPIO_1_31, 0x328, 0x130, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D7__CSI_D7 IOMUX_PAD(CSI_D7, CSI_D7, 0x32c, 0x134, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D7__GPIO_1_6 IOMUX_PAD(CSI_D7, GPIO_1_6, 0x32c, 0x134, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D8__CSI_D8 IOMUX_PAD(CSI_D8, CSI_D8, 0x330, 0x138, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D8__GPIO_1_7 IOMUX_PAD(CSI_D8, GPIO_1_7, 0x330, 0x138, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D9__CSI_D9 IOMUX_PAD(CSI_D9, CSI_D9, 0x334, 0x13c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_D9__GPIO_4_21 IOMUX_PAD(CSI_D9, GPIO_4_21, 0x334, 0x13c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_MCLK__CSI_MCLK IOMUX_PAD(CSI_MCLK, CSI_MCLK, 0x338, 0x140, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_MCLK__GPIO_1_8 IOMUX_PAD(CSI_MCLK, GPIO_1_8, 0x338, 0x140, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_VSYNC__CSI_VSYNC IOMUX_PAD(CSI_VSYNC, CSI_VSYNC, 0x33c, 0x144, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_VSYNC__GPIO_1_9 IOMUX_PAD(CSI_VSYNC, GPIO_1_9, 0x33c, 0x144, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_HSYNC__CSI_HSYNC IOMUX_PAD(CSI_HSYNC, CSI_HSYNC, 0x340, 0x148, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_HSYNC__GPIO_1_10 IOMUX_PAD(CSI_HSYNC, GPIO_1_10, 0x340, 0x148, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK IOMUX_PAD(CSI_PIXCLK, CSI_PIXCLK, 0x344, 0x14c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 IOMUX_PAD(CSI_PIXCLK, GPIO_1_11, 0x344, 0x14c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_I2C1_CLK__I2C1_CLK IOMUX_PAD(I2C1_CLK, I2C1_CLK, 0x348, 0x150, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_I2C1_CLK__GPIO_1_12 IOMUX_PAD(I2C1_CLK, GPIO_1_12, 0x348, 0x150, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_I2C1_DAT__I2C1_DAT IOMUX_PAD(I2C1_DAT, I2C1_DAT, 0x34c, 0x154, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_I2C1_DAT__GPIO_1_13 IOMUX_PAD(I2C1_DAT, GPIO_1_13, 0x34c, 0x154, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_MOSI__CSPI1_MOSI IOMUX_PAD(CSPI1_MOSI, CSPI1_MOSI, 0x350, 0x158, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_MOSI__GPIO_1_14 IOMUX_PAD(CSPI1_MOSI, GPIO_1_14, 0x350, 0x158, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_MISO__CSPI1_MISO IOMUX_PAD(CSPI1_MISO, CSPI1_MISO, 0x354, 0x15c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_MISO__GPIO_1_15 IOMUX_PAD(CSPI1_MISO, GPIO_1_15, 0x354, 0x15c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SS0__CSPI1_SS0 IOMUX_PAD(CSPI1_SS0, CSPI1_SS0, 0x358, 0x160, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SS0__GPIO_1_16 IOMUX_PAD(CSPI1_SS0, GPIO_1_16, 0x358, 0x160, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SS1__CSPI1_SS1 IOMUX_PAD(CSPI1_SS1, CSPI1_SS1, 0x35c, 0x164, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SS1__GPIO_1_17 IOMUX_PAD(CSPI1_SS1, GPIO_1_17, 0x35c, 0x164, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SCLK__CSPI1_SCLK IOMUX_PAD(CSPI1_SCLK, CSPI1_SCLK, 0x360, 0x168, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_SCLK__GPIO_1_18 IOMUX_PAD(CSPI1_SCLK, GPIO_1_18, 0x360, 0x168, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CSPI1_RDY__CSPI1_RDY IOMUX_PAD(CSPI1_RDY, CSPI1_RDY, 0x364, 0x16c, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_CSPI1_RDY__GPIO_2_22 IOMUX_PAD(CSPI1_RDY, GPIO_2_22, 0x364, 0x16c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(UART1_RXD, UART1_RXD, 0x368, 0x170, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K)
++#define MX25_PAD_UART1_RXD__GPIO_4_22 IOMUX_PAD(UART1_RXD, GPIO_4_22, 0x368, 0x170, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(UART1_TXD, UART1_TXD, 0x36c, 0x174, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_TXD__GPIO_4_23 IOMUX_PAD(UART1_TXD, GPIO_4_23, 0x36c, 0x174, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(UART1_RTS, UART1_RTS, 0x370, 0x178, 0x10, 0, 0, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_UART1_RTS__CSI_D0 IOMUX_PAD(UART1_RTS, CSI_D0, 0x370, 0x178, 0x11, 0x488, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_RTS__GPIO_4_24 IOMUX_PAD(UART1_RTS, GPIO_4_24, 0x370, 0x178, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(UART1_CTS, UART1_CTS, 0x374, 0x17c, 0x10, 0, 0, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_UART1_CTS__CSI_D1 IOMUX_PAD(UART1_CTS, CSI_D1, 0x374, 0x17c, 0x11, 0x48c, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART1_CTS__GPIO_4_25 IOMUX_PAD(UART1_CTS, GPIO_4_25, 0x374, 0x17c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(UART2_RXD, UART2_RXD, 0x378, 0x180, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_RXD__GPIO_4_26 IOMUX_PAD(UART2_RXD, GPIO_4_26, 0x378, 0x180, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(UART2_TXD, UART2_TXD, 0x37c, 0x184, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_TXD__GPIO_4_27 IOMUX_PAD(UART2_TXD, GPIO_4_27, 0x37c, 0x184, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(UART2_RTS, UART2_RTS, 0x380, 0x188, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_RTS__FEC_COL IOMUX_PAD(UART2_RTS, FEC_COL, 0x380, 0x188, 0x12, 0x504, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_UART2_RTS__GPIO_4_28 IOMUX_PAD(UART2_RTS, GPIO_4_28, 0x380, 0x188, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_CTS__FEC_RX_ER IOMUX_PAD(UART2_CTS, FEC_RX_ER, 0x384, 0x18c, 0x12, 0x518, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(UART2_CTS, UART2_CTS, 0x384, 0x18c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_UART2_CTS__GPIO_4_29 IOMUX_PAD(UART2_CTS, GPIO_4_29, 0x384, 0x18c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(SD1_CMD, SD1_CMD, 0x388, 0x190, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_CMD__FEC_RDATA2 IOMUX_PAD(SD1_CMD, FEC_RDATA2, 0x388, 0x190, 0x12, 0x50c, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_CMD__GPIO_2_23 IOMUX_PAD(SD1_CMD, GPIO_2_23, 0x388, 0x190, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(SD1_CLK, SD1_CLK, 0x38c, 0x194, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_CLK__FEC_RDATA3 IOMUX_PAD(SD1_CLK, FEC_RDATA3, 0x38c, 0x194, 0x12, 0x510, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_CLK__GPIO_2_24 IOMUX_PAD(SD1_CLK, GPIO_2_24, 0x38c, 0x194, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(SD1_DATA0, SD1_DATA0, 0x390, 0x198, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA0__GPIO_2_25 IOMUX_PAD(SD1_DATA0, GPIO_2_25, 0x390, 0x198, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(SD1_DATA1, SD1_DATA1, 0x394, 0x19c, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA1__AUD7_RXD IOMUX_PAD(SD1_DATA1, AUD7_RXD, 0x394, 0x19c, 0x13, 0x478, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_DATA1__GPIO_2_26 IOMUX_PAD(SD1_DATA1, GPIO_2_26, 0x394, 0x19c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(SD1_DATA2, SD1_DATA2, 0x398, 0x1a0, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA2__FEC_RX_CLK IOMUX_PAD(SD1_DATA2, FEC_RX_CLK, 0x398, 0x1a0, 0x15, 0x514, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA2__GPIO_2_27 IOMUX_PAD(SD1_DATA2, GPIO_2_27, 0x398, 0x1a0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(SD1_DATA3, SD1_DATA3, 0x39c, 0x1a4, 0x10, 0, 0, PAD_CTL_PULL_UP_47K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA3__FEC_CRS IOMUX_PAD(SD1_DATA3, FEC_CRS, 0x39c, 0x1a4, 0x10, 0x508, 2, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_SD1_DATA3__GPIO_2_28 IOMUX_PAD(SD1_DATA3, GPIO_2_28, 0x39c, 0x1a4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW0__KPP_ROW0 IOMUX_PAD(KPP_ROW0, KPP_ROW0, 0x3a0, 0x1a8, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_KPP_ROW0__GPIO_2_29 IOMUX_PAD(KPP_ROW0, GPIO_2_29, 0x3a0, 0x1a8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW1__KPP_ROW1 IOMUX_PAD(KPP_ROW1, KPP_ROW1, 0x3a4, 0x1ac, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_KPP_ROW1__GPIO_2_30 IOMUX_PAD(KPP_ROW1, GPIO_2_30, 0x3a4, 0x1ac, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW2__KPP_ROW2 IOMUX_PAD(KPP_ROW2, KPP_ROW2, 0x3a8, 0x1b0, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_KPP_ROW2__CSI_D0 IOMUX_PAD(KPP_ROW2, CSI_D0, 0x3a8, 0x1b0, 0x13, 0x488, 2, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW2__GPIO_2_31 IOMUX_PAD(KPP_ROW2, GPIO_2_31, 0x3a8, 0x1b0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW3__KPP_ROW3 IOMUX_PAD(KPP_ROW3, KPP_ROW3, 0x3ac, 0x1b4, 0x10, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_KPP_ROW3__CSI_LD1 IOMUX_PAD(KPP_ROW3, CSI_LD1, 0x3ac, 0x1b4, 0x13, 0x48c, 2, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_ROW3__GPIO_3_0 IOMUX_PAD(KPP_ROW3, GPIO_3_0, 0x3ac, 0x1b4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_COL0__KPP_COL0 IOMUX_PAD(KPP_COL0, KPP_COL0, 0x3b0, 0x1b8, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
++#define MX25_PAD_KPP_COL0__GPIO_3_1 IOMUX_PAD(KPP_COL0, GPIO_3_1, 0x3b0, 0x1b8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_COL1__KPP_COL1 IOMUX_PAD(KPP_COL1, KPP_COL1, 0x3b4, 0x1bc, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
++#define MX25_PAD_KPP_COL1__GPIO_3_2 IOMUX_PAD(KPP_COL1, GPIO_3_2, 0x3b4, 0x1bc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_COL2__KPP_COL2 IOMUX_PAD(KPP_COL2, KPP_COL2, 0x3b8, 0x1c0, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
++#define MX25_PAD_KPP_COL2__GPIO_3_3 IOMUX_PAD(KPP_COL2, GPIO_3_3, 0x3b8, 0x1c0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(KPP_COL3, KPP_COL3, 0x3bc, 0x1c4, 0x10, 0, 0, PAD_CTL_PULL_KEEPER | PAD_CTL_OUTPUT_OPEN_DRAIN)
++#define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(KPP_COL3, GPIO_3_4, 0x3bc, 0x1c4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(FEC_MDC, FEC_MDC, 0x3c0, 0x1c8, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_MDC__AUD4_TXD IOMUX_PAD(FEC_MDC, AUD4_TXD, 0x3c0, 0x1c8, 0x12, 0x464, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_MDC__GPIO_3_5 IOMUX_PAD(FEC_MDC, GPIO_3_5, 0x3c0, 0x1c8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(FEC_MDIO, FEC_MDIO, 0x3c4, 0x1cc, 0x10, 0, 0, PAD_CTL_HYSTERESIS | PAD_CTL_PULL_UP_22K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_MDIO__AUD4_RXD IOMUX_PAD(FEC_MDIO, AUD4_RXD, 0x3c4, 0x1cc, 0x12, 0x460, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_MDIO__GPIO_3_6 IOMUX_PAD(FEC_MDIO, GPIO_3_6, 0x3c4, 0x1cc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_TDATA0__FEC_TDATA0 IOMUX_PAD(FEC_TDATA0, FEC_TDATA0, 0x3c8, 0x1d0, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_TDATA0__GPIO_3_7 IOMUX_PAD(FEC_TDATA0, GPIO_3_7, 0x3c8, 0x1d0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_TDATA1__FEC_TDATA1 IOMUX_PAD(FEC_TDATA1, FEC_TDATA1, 0x3cc, 0x1d4, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_TDATA1__AUD4_TXFS IOMUX_PAD(FEC_TDATA1, AUD4_TXFS, 0x3cc, 0x1d4, 0x12, 0x474, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_TDATA1__GPIO_3_8 IOMUX_PAD(FEC_TDATA1, GPIO_3_8, 0x3cc, 0x1d4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(FEC_TX_EN, FEC_TX_EN, 0x3d0, 0x1d8, 0x10, 0, 0, PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_TX_EN__GPIO_3_9 IOMUX_PAD(FEC_TX_EN, GPIO_3_9 , 0x3d0, 0x1d8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_RDATA0__FEC_RDATA0 IOMUX_PAD(FEC_RDATA0, FEC_RDATA0, 0x3d4, 0x1dc, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_RDATA0__GPIO_3_10 IOMUX_PAD(FEC_RDATA0, GPIO_3_10, 0x3d4, 0x1dc, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_RDATA1__FEC_RDATA1 IOMUX_PAD(FEC_RDATA1, FEC_RDATA1, 0x3d8, 0x1e0, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_RDATA1__GPIO_3_11 IOMUX_PAD(FEC_RDATA1, GPIO_3_11, 0x3d8, 0x1e0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(FEC_RX_DV, FEC_RX_DV, 0x3dc, 0x1e4, 0x10, 0, 0, PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_RX_DV__CAN2_RX IOMUX_PAD(FEC_RX_DV, CAN2_RX, 0x3dc, 0x1e4, 0x14, 0x484, 0, PAD_CTL_PULL_UP_22K)
++#define MX25_PAD_FEC_RX_DV__GPIO_3_12 IOMUX_PAD(FEC_RX_DV, GPIO_3_12, 0x3dc, 0x1e4, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_FEC_TX_CLK__FEC_TX_CLK IOMUX_PAD(FEC_TX_CLK, FEC_TX_CLK, 0x3e0, 0x1e8, 0x10, 0, 0, PAD_CTL_HYSTERESIS | PAD_CTL_PULL_DOWN_100K | PAD_CTL_SLEW_RATE_FAST)
++#define MX25_PAD_FEC_TX_CLK__GPIO_3_13 IOMUX_PAD(FEC_TX_CLK, GPIO_3_13, 0x3e0, 0x1e8, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_RTCK__RTCK IOMUX_PAD(RTCK, RTCK, 0x3e4, 0x1ec, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_RTCK__OWIRE IOMUX_PAD(RTCK, OWIRE, 0x3e4, 0x1ec, 0x11, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_RTCK__GPIO_3_14 IOMUX_PAD(RTCK, GPIO_3_14, 0x3e4, 0x1ec, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_DE_B__DE_B IOMUX_PAD(DE_B, DE_B, 0x3ec, 0x1f0, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_DE_B__GPIO_2_20 IOMUX_PAD(DE_B, GPIO_2_20, 0x3ec, 0x1f0, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_TDO__TDO IOMUX_PAD(TDO, TDO, 0x3e8, 0x000, 0x00, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_A__GPIO_A IOMUX_PAD(GPIO_A, GPIO_A, 0x3f0, 0x1f4, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_A__CAN1_TX IOMUX_PAD(GPIO_A, CAN1_TX, 0x3f0, 0x1f4, 0x16, 0, 0, PAD_CTL_PULL_UP_22K | PAD_CTL_OUTPUT_OPEN_DRAIN | PAD_CTL_DRIVE_STRENGTH_MAX)
++#define MX25_PAD_GPIO_A__USBOTG_PWR IOMUX_PAD(GPIO_A, USBOTG_PWR, 0x3f0, 0x1f4, 0x12, 0, 0, PAD_CTL_PULL_KEEPER)
++#define MX25_PAD_GPIO_B__GPIO_B IOMUX_PAD(GPIO_B, GPIO_B, 0x3f4, 0x1f8, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_B__CAN1_RX IOMUX_PAD(GPIO_B, CAN1_RX, 0x3f4, 0x1f8, 0x16, 0x480, 1, PAD_CTL_PULL_UP_22K | PAD_CTL_OUTPUT_OPEN_DRAIN)
++#define MX25_PAD_GPIO_B__USBOTG_OC IOMUX_PAD(GPIO_B, USBOTG_OC, 0x3f4, 0x1f8, 0x12, 0x57c, 1, PAD_CTL_PULL_UP_100K)
++#define MX25_PAD_GPIO_C__GPIO_C IOMUX_PAD(GPIO_C, GPIO_C, 0x3f8, 0x1fc, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_C__CAN2_TX IOMUX_PAD(GPIO_C, CAN2_TX, 0x3f8, 0x1fc, 0x16, 0, 0, PAD_CTL_PULL_UP_22K | PAD_CTL_OUTPUT_OPEN_DRAIN | PAD_CTL_DRIVE_STRENGTH_MAX)
++#define MX25_PAD_GPIO_D__GPIO_D IOMUX_PAD(GPIO_D, GPIO_D, 0x3fc, 0x200, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_D__CAN2_RX IOMUX_PAD(GPIO_D, CAN2_RX, 0x3fc, 0x200, 0x16, 0x484, 1, PAD_CTL_PULL_UP_22K)
++#define MX25_PAD_GPIO_E__GPIO_E IOMUX_PAD(GPIO_E, GPIO_E, 0x400, 0x204, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_E__AUD7_TXD IOMUX_PAD(GPIO_E, AUD7_TXD, 0x400, 0x204, 0x14, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_F__GPIO_F IOMUX_PAD(GPIO_F, GPIO_F, 0x404, 0x208, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_GPIO_F__AUD7_TXC IOMUX_PAD(GPIO_F, AUD7_TXC, 0x404, 0x208, 0x14, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_EXT_ARMCLK__EXT_ARMCLK IOMUX_PAD(EXT_ARMCLK, EXT_ARMCLK, 0x000, 0x20c, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_EXT_ARMCLK__GPIO_3_15 IOMUX_PAD(EXT_ARMCLK, GPIO_3_15, 0x000, 0x20c, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_UPLL_BYPCLK__UPLL_BYPCLK IOMUX_PAD(UPLL_BYPCLK, UPLL_BYPCLK, 0x000, 0x210, 0x10, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_UPLL_BYPCLK__GPIO_3_16 IOMUX_PAD(UPLL_BYPCLK, GPIO_3_16, 0x000, 0x210, 0x15, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_VSTBY_REQ__VSTBY_REQ IOMUX_PAD(VSTBY_REQ, VSTBY_REQ, 0x408, 0x214, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSTBY_REQ__AUD7_TXFS IOMUX_PAD(VSTBY_REQ, AUD7_TXFS, 0x408, 0x214, 0x14, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSTBY_REQ__GPIO_3_17 IOMUX_PAD(VSTBY_REQ, GPIO_3_17, 0x408, 0x214, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSTBY_ACK__VSTBY_ACK IOMUX_PAD(VSTBY_ACK, VSTBY_ACK, 0x40c, 0x218, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_VSTBY_ACK__GPIO_3_18 IOMUX_PAD(VSTBY_ACK, GPIO_3_18, 0x40c, 0x218, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_POWER_FAIL__POWER_FAIL IOMUX_PAD(POWER_FAIL, POWER_FAIL, 0x410, 0x21c, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_POWER_FAIL__AUD7_RXD IOMUX_PAD(POWER_FAIL, AUD7_RXD, 0x410, 0x21c, 0x14, 0x478, 1, 0 | NO_PAD_CTRL)
++#define MX25_PAD_POWER_FAIL__GPIO_3_19 IOMUX_PAD(POWER_FAIL, GPIO_3_19, 0x410, 0x21c, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CLKO__CLKO IOMUX_PAD(CLKO, CLKO, 0x414, 0x220, 0x10, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_CLKO__GPIO_2_21 IOMUX_PAD(CLKO, GPIO_2_21, 0x414, 0x220, 0x15, 0, 0, 0 | NO_PAD_CTRL)
++#define MX25_PAD_BOOT_MODE0__BOOT_MODE0 IOMUX_PAD(BOOT_MODE0, BOOT_MODE0, 0x000, 0x224, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_BOOT_MODE0__GPIO_4_30 IOMUX_PAD(BOOT_MODE0, GPIO_4_30, 0x000, 0x224, 0x05, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 IOMUX_PAD(BOOT_MODE1, BOOT_MODE1, 0x000, 0x228, 0x00, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_BOOT_MODE1__GPIO_4_31 IOMUX_PAD(BOOT_MODE1, GPIO_4_31, 0x000, 0x228, 0x05, 0, 0, NO_PAD_CTRL)
++
++#define MX25_PAD_CTL_GRP_DVS_MISC IOMUX_PAD(0x418, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_FEC IOMUX_PAD(0x41c, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_JTAG IOMUX_PAD(0x420, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_NFC IOMUX_PAD(0x424, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_CSI IOMUX_PAD(0x428, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_WEIM IOMUX_PAD(0x42c, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_DDR IOMUX_PAD(0x430, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_CRM IOMUX_PAD(0x434, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_KPP IOMUX_PAD(0x438, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_SDHC1 IOMUX_PAD(0x43c, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_LCD IOMUX_PAD(0x440, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_UART IOMUX_PAD(0x444, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_NFC IOMUX_PAD(0x448, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_CSI IOMUX_PAD(0x44c, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DSE_CSPI1 IOMUX_PAD(0x450, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DDRTYPE IOMUX_PAD(0x454, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_SDHC1 IOMUX_PAD(0x458, 0x000, 0, 0, 0, NO_PAD_CTRL)
++#define MX25_PAD_CTL_GRP_DVS_LCD IOMUX_PAD(0x45c, 0x000, 0, 0, 0, NO_PAD_CTRL)
+
+#define IOMUX_TO_GPIO(__pad_desc) ({ \
+ int __gpio = -1; \
@@ -8588,412 +7493,446 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-mx25.h linux-2.
+ \
+ switch (__pd->mux_ctrl_ofs) { \
+ case MX25_PAD_GPIO_A__GPIO_A: \
-+ __gpio = GPIO_A; \
-+ break; \
++ __gpio = GPIO_A; \
++ break; \
+ case MX25_PAD_GPIO_B__GPIO_B: \
-+ __gpio = GPIO_B; \
-+ break; \
++ __gpio = GPIO_B; \
++ break; \
+ case MX25_PAD_GPIO_C__GPIO_C: \
-+ __gpio = GPIO_C; \
-+ break; \
++ __gpio = GPIO_C; \
++ break; \
+ case MX25_PAD_GPIO_D__GPIO_D: \
-+ __gpio = GPIO_D; \
-+ break; \
++ __gpio = GPIO_D; \
++ break; \
+ case MX25_PAD_GPIO_E__GPIO_E: \
-+ __gpio = GPIO_E; \
-+ break; \
++ __gpio = GPIO_E; \
++ break; \
+ case MX25_PAD_GPIO_F__GPIO_F: \
-+ __gpio = GPIO_F; \
-+ break; \
++ __gpio = GPIO_F; \
++ break; \
+ case MX25_PAD_CSI_D7__GPIO_1_6: \
-+ __gpio = GPIO_1_6; \
-+ break; \
++ __gpio = GPIO_1_6; \
++ break; \
+ case MX25_PAD_CSI_D8__GPIO_1_7: \
-+ __gpio = GPIO_1_7; \
-+ break; \
++ __gpio = GPIO_1_7; \
++ break; \
+ case MX25_PAD_CSI_MCLK__GPIO_1_8: \
-+ __gpio = GPIO_1_8; \
-+ break; \
++ __gpio = GPIO_1_8; \
++ break; \
+ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \
-+ __gpio = GPIO_1_9; \
-+ break; \
++ __gpio = GPIO_1_9; \
++ break; \
+ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \
-+ __gpio = GPIO_1_10; \
-+ break; \
++ __gpio = GPIO_1_10; \
++ break; \
+ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \
-+ __gpio = GPIO_1_11; \
-+ break; \
++ __gpio = GPIO_1_11; \
++ break; \
+ case MX25_PAD_I2C1_CLK__GPIO_1_12: \
-+ __gpio = GPIO_1_12; \
-+ break; \
++ __gpio = GPIO_1_12; \
++ break; \
+ case MX25_PAD_I2C1_DAT__GPIO_1_13: \
-+ __gpio = GPIO_1_13; \
-+ break; \
++ __gpio = GPIO_1_13; \
++ break; \
+ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \
-+ __gpio = GPIO_1_14; \
-+ break; \
++ __gpio = GPIO_1_14; \
++ break; \
+ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \
-+ __gpio = GPIO_1_15; \
-+ break; \
++ __gpio = GPIO_1_15; \
++ break; \
+ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \
-+ __gpio = GPIO_1_16; \
-+ break; \
++ __gpio = GPIO_1_16; \
++ break; \
+ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \
-+ __gpio = GPIO_1_17; \
-+ break; \
++ __gpio = GPIO_1_17; \
++ break; \
+ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \
-+ __gpio = GPIO_1_18; \
-+ break; \
++ __gpio = GPIO_1_18; \
++ break; \
+ case MX25_PAD_LD5__GPIO_1_19: \
-+ __gpio = GPIO_1_19; \
-+ break; \
++ __gpio = GPIO_1_19; \
++ break; \
+ case MX25_PAD_LD6__GPIO_1_20: \
-+ __gpio = GPIO_1_20; \
-+ break; \
++ __gpio = GPIO_1_20; \
++ break; \
+ case MX25_PAD_LD7__GPIO_1_21: \
-+ __gpio = GPIO_1_21; \
-+ break; \
++ __gpio = GPIO_1_21; \
++ break; \
+ case MX25_PAD_HSYNC__GPIO_1_22: \
-+ __gpio = GPIO_1_22; \
-+ break; \
++ __gpio = GPIO_1_22; \
++ break; \
+ case MX25_PAD_VSYNC__GPIO_1_23: \
-+ __gpio = GPIO_1_23; \
-+ break; \
++ __gpio = GPIO_1_23; \
++ break; \
+ case MX25_PAD_LSCLK__GPIO_1_24: \
-+ __gpio = GPIO_1_24; \
-+ break; \
++ __gpio = GPIO_1_24; \
++ break; \
+ case MX25_PAD_OE_ACD__GPIO_1_25: \
-+ __gpio = GPIO_1_25; \
-+ break; \
++ __gpio = GPIO_1_25; \
++ break; \
+ case MX25_PAD_PWM__GPIO_1_26: \
-+ __gpio = GPIO_1_26; \
-+ break; \
++ __gpio = GPIO_1_26; \
++ break; \
+ case MX25_PAD_CSI_D2__GPIO_1_27: \
-+ __gpio = GPIO_1_27; \
-+ break; \
++ __gpio = GPIO_1_27; \
++ break; \
+ case MX25_PAD_CSI_D3__GPIO_1_28: \
-+ __gpio = GPIO_1_28; \
-+ break; \
++ __gpio = GPIO_1_28; \
++ break; \
+ case MX25_PAD_CSI_D4__GPIO_1_29: \
-+ __gpio = GPIO_1_29; \
-+ break; \
++ __gpio = GPIO_1_29; \
++ break; \
+ case MX25_PAD_CSI_D5__GPIO_1_30: \
-+ __gpio = GPIO_1_30; \
-+ break; \
++ __gpio = GPIO_1_30; \
++ break; \
+ case MX25_PAD_CSI_D6__GPIO_1_31: \
-+ __gpio = GPIO_1_31; \
-+ break; \
++ __gpio = GPIO_1_31; \
++ break; \
+ \
+ case MX25_PAD_A14__GPIO_2_0: \
-+ __gpio = GPIO_2_0; \
-+ break; \
++ __gpio = GPIO_2_0; \
++ break; \
+ case MX25_PAD_A15__GPIO_2_1: \
-+ __gpio = GPIO_2_1; \
-+ break; \
++ __gpio = GPIO_2_1; \
++ break; \
+ case MX25_PAD_A16__GPIO_2_2: \
-+ __gpio = GPIO_2_2; \
-+ break; \
++ __gpio = GPIO_2_2; \
++ break; \
+ case MX25_PAD_A17__GPIO_2_3: \
-+ __gpio = GPIO_2_3; \
-+ break; \
++ __gpio = GPIO_2_3; \
++ break; \
+ case MX25_PAD_A18__GPIO_2_4: \
-+ __gpio = GPIO_2_4; \
-+ break; \
++ __gpio = GPIO_2_4; \
++ break; \
+ case MX25_PAD_A19__GPIO_2_5: \
-+ __gpio = GPIO_2_5; \
-+ break; \
++ __gpio = GPIO_2_5; \
++ break; \
+ case MX25_PAD_A20__GPIO_2_6: \
-+ __gpio = GPIO_2_6; \
-+ break; \
++ __gpio = GPIO_2_6; \
++ break; \
+ case MX25_PAD_A21__GPIO_2_7: \
-+ __gpio = GPIO_2_7; \
-+ break; \
++ __gpio = GPIO_2_7; \
++ break; \
+ case MX25_PAD_A22__GPIO_2_8: \
-+ __gpio = GPIO_2_8; \
-+ break; \
++ __gpio = GPIO_2_8; \
++ break; \
+ case MX25_PAD_A23__GPIO_2_9: \
-+ __gpio = GPIO_2_9; \
-+ break; \
++ __gpio = GPIO_2_9; \
++ break; \
+ case MX25_PAD_A24__GPIO_2_10: \
-+ __gpio = GPIO_2_10; \
-+ break; \
++ __gpio = GPIO_2_10; \
++ break; \
+ case MX25_PAD_A25__GPIO_2_11: \
-+ __gpio = GPIO_2_11; \
-+ break; \
++ __gpio = GPIO_2_11; \
++ break; \
+ case MX25_PAD_EB0__GPIO_2_12: \
-+ __gpio = GPIO_2_12; \
-+ break; \
++ __gpio = GPIO_2_12; \
++ break; \
+ case MX25_PAD_EB1__GPIO_2_13: \
-+ __gpio = GPIO_2_13; \
-+ break; \
++ __gpio = GPIO_2_13; \
++ break; \
+ case MX25_PAD_OE__GPIO_2_14: \
-+ __gpio = GPIO_2_14; \
-+ break; \
++ __gpio = GPIO_2_14; \
++ break; \
+ case MX25_PAD_LD0__GPIO_2_15: \
-+ __gpio = GPIO_2_15; \
-+ break; \
++ __gpio = GPIO_2_15; \
++ break; \
+ case MX25_PAD_LD1__GPIO_2_16: \
-+ __gpio = GPIO_2_16; \
-+ break; \
++ __gpio = GPIO_2_16; \
++ break; \
+ case MX25_PAD_LD2__GPIO_2_17: \
-+ __gpio = GPIO_2_17; \
-+ break; \
++ __gpio = GPIO_2_17; \
++ break; \
+ case MX25_PAD_LD3__GPIO_2_18: \
-+ __gpio = GPIO_2_18; \
-+ break; \
++ __gpio = GPIO_2_18; \
++ break; \
+ case MX25_PAD_LD4__GPIO_2_19: \
-+ __gpio = GPIO_2_19; \
-+ break; \
++ __gpio = GPIO_2_19; \
++ break; \
+ case MX25_PAD_DE_B__GPIO_2_20: \
-+ __gpio = GPIO_2_20; \
-+ break; \
++ __gpio = GPIO_2_20; \
++ break; \
+ case MX25_PAD_CLKO__GPIO_2_21: \
-+ __gpio = GPIO_2_21; \
-+ break; \
++ __gpio = GPIO_2_21; \
++ break; \
+ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \
-+ __gpio = GPIO_2_22; \
-+ break; \
++ __gpio = GPIO_2_22; \
++ break; \
+ case MX25_PAD_SD1_CMD__GPIO_2_23: \
-+ __gpio = GPIO_2_23; \
-+ break; \
++ __gpio = GPIO_2_23; \
++ break; \
+ case MX25_PAD_SD1_CLK__GPIO_2_24: \
-+ __gpio = GPIO_2_24; \
-+ break; \
++ __gpio = GPIO_2_24; \
++ break; \
+ case MX25_PAD_SD1_DATA0__GPIO_2_25: \
-+ __gpio = GPIO_2_25; \
-+ break; \
++ __gpio = GPIO_2_25; \
++ break; \
+ case MX25_PAD_SD1_DATA1__GPIO_2_26: \
-+ __gpio = GPIO_2_26; \
-+ break; \
++ __gpio = GPIO_2_26; \
++ break; \
+ case MX25_PAD_SD1_DATA2__GPIO_2_27: \
-+ __gpio = GPIO_2_27; \
-+ break; \
++ __gpio = GPIO_2_27; \
++ break; \
+ case MX25_PAD_SD1_DATA3__GPIO_2_28: \
-+ __gpio = GPIO_2_28; \
-+ break; \
++ __gpio = GPIO_2_28; \
++ break; \
+ case MX25_PAD_KPP_ROW0__GPIO_2_29: \
-+ __gpio = GPIO_2_29; \
-+ break; \
++ __gpio = GPIO_2_29; \
++ break; \
+ case MX25_PAD_KPP_ROW1__GPIO_2_30: \
-+ __gpio = GPIO_2_30; \
-+ break; \
++ __gpio = GPIO_2_30; \
++ break; \
+ case MX25_PAD_KPP_ROW2__GPIO_2_31: \
-+ __gpio = GPIO_2_31; \
-+ break; \
++ __gpio = GPIO_2_31; \
++ break; \
+ \
+ case MX25_PAD_KPP_ROW3__GPIO_3_0: \
-+ __gpio = GPIO_3_0; \
-+ break; \
++ __gpio = GPIO_3_0; \
++ break; \
+ case MX25_PAD_KPP_COL0__GPIO_3_1: \
-+ __gpio = GPIO_3_1; \
-+ break; \
++ __gpio = GPIO_3_1; \
++ break; \
+ case MX25_PAD_KPP_COL1__GPIO_3_2: \
-+ __gpio = GPIO_3_2; \
-+ break; \
++ __gpio = GPIO_3_2; \
++ break; \
+ case MX25_PAD_KPP_COL2__GPIO_3_3: \
-+ __gpio = GPIO_3_3; \
-+ break; \
++ __gpio = GPIO_3_3; \
++ break; \
+ case MX25_PAD_KPP_COL3__GPIO_3_4: \
-+ __gpio = GPIO_3_4; \
-+ break; \
++ __gpio = GPIO_3_4; \
++ break; \
+ case MX25_PAD_FEC_MDC__GPIO_3_5: \
-+ __gpio = GPIO_3_5; \
-+ break; \
++ __gpio = GPIO_3_5; \
++ break; \
+ case MX25_PAD_FEC_MDIO__GPIO_3_6: \
-+ __gpio = GPIO_3_6; \
-+ break; \
++ __gpio = GPIO_3_6; \
++ break; \
+ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \
-+ __gpio = GPIO_3_7; \
-+ break; \
++ __gpio = GPIO_3_7; \
++ break; \
+ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \
-+ __gpio = GPIO_3_8; \
-+ break; \
++ __gpio = GPIO_3_8; \
++ break; \
+ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \
-+ __gpio = GPIO_3_9; \
-+ break; \
++ __gpio = GPIO_3_9; \
++ break; \
+ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \
-+ __gpio = GPIO_3_10; \
-+ break; \
++ __gpio = GPIO_3_10; \
++ break; \
+ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \
-+ __gpio = GPIO_3_11; \
-+ break; \
++ __gpio = GPIO_3_11; \
++ break; \
+ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \
-+ __gpio = GPIO_3_12; \
-+ break; \
++ __gpio = GPIO_3_12; \
++ break; \
+ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \
-+ __gpio = GPIO_3_13; \
-+ break; \
++ __gpio = GPIO_3_13; \
++ break; \
+ case MX25_PAD_RTCK__GPIO_3_14: \
-+ __gpio = GPIO_3_14; \
-+ break; \
++ __gpio = GPIO_3_14; \
++ break; \
+ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \
-+ __gpio = GPIO_3_15; \
-+ break; \
++ __gpio = GPIO_3_15; \
++ break; \
+ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \
-+ __gpio = GPIO_3_16; \
-+ break; \
++ __gpio = GPIO_3_16; \
++ break; \
+ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \
-+ __gpio = GPIO_3_17; \
-+ break; \
++ __gpio = GPIO_3_17; \
++ break; \
+ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \
-+ __gpio = GPIO_3_18; \
-+ break; \
++ __gpio = GPIO_3_18; \
++ break; \
+ case MX25_PAD_POWER_FAIL__GPIO_3_19: \
-+ __gpio = GPIO_3_19; \
-+ break; \
++ __gpio = GPIO_3_19; \
++ break; \
+ case MX25_PAD_CS4__GPIO_3_20: \
-+ __gpio = GPIO_3_20; \
-+ break; \
++ __gpio = GPIO_3_20; \
++ break; \
+ case MX25_PAD_CS5__GPIO_3_21: \
-+ __gpio = GPIO_3_21; \
-+ break; \
++ __gpio = GPIO_3_21; \
++ break; \
+ case MX25_PAD_NF_CE0__GPIO_3_22: \
-+ __gpio = GPIO_3_22; \
-+ break; \
++ __gpio = GPIO_3_22; \
++ break; \
+ case MX25_PAD_ECB__GPIO_3_23: \
-+ __gpio = GPIO_3_23; \
-+ break; \
++ __gpio = GPIO_3_23; \
++ break; \
+ case MX25_PAD_LBA__GPIO_3_24: \
-+ __gpio = GPIO_3_24; \
-+ break; \
++ __gpio = GPIO_3_24; \
++ break; \
+ case MX25_PAD_RW__GPIO_3_25: \
-+ __gpio = GPIO_3_25; \
-+ break; \
++ __gpio = GPIO_3_25; \
++ break; \
+ case MX25_PAD_NFWE_B__GPIO_3_26: \
-+ __gpio = GPIO_3_26; \
-+ break; \
++ __gpio = GPIO_3_26; \
++ break; \
+ case MX25_PAD_NFRE_B__GPIO_3_27: \
-+ __gpio = GPIO_3_27; \
-+ break; \
++ __gpio = GPIO_3_27; \
++ break; \
+ case MX25_PAD_NFALE__GPIO_3_28: \
-+ __gpio = GPIO_3_28; \
-+ break; \
++ __gpio = GPIO_3_28; \
++ break; \
+ case MX25_PAD_NFCLE__GPIO_3_29: \
-+ __gpio = GPIO_3_29; \
-+ break; \
++ __gpio = GPIO_3_29; \
++ break; \
+ case MX25_PAD_NFWP_B__GPIO_3_30: \
-+ __gpio = GPIO_3_30; \
-+ break; \
++ __gpio = GPIO_3_30; \
++ break; \
+ case MX25_PAD_NFRB__GPIO_3_31: \
-+ __gpio = GPIO_3_31; \
-+ break; \
++ __gpio = GPIO_3_31; \
++ break; \
+ \
+ case MX25_PAD_A10__GPIO_4_0: \
-+ __gpio = GPIO_4_0; \
-+ break; \
++ __gpio = GPIO_4_0; \
++ break; \
+ case MX25_PAD_A13__GPIO_4_1: \
-+ __gpio = GPIO_4_1; \
-+ break; \
++ __gpio = GPIO_4_1; \
++ break; \
+ case MX25_PAD_CS0__GPIO_4_2: \
-+ __gpio = GPIO_4_2; \
-+ break; \
++ __gpio = GPIO_4_2; \
++ break; \
+ case MX25_PAD_CS1__GPIO_4_3: \
-+ __gpio = GPIO_4_3; \
-+ break; \
++ __gpio = GPIO_4_3; \
++ break; \
+ case MX25_PAD_BCLK__GPIO_4_4: \
-+ __gpio = GPIO_4_4; \
-+ break; \
++ __gpio = GPIO_4_4; \
++ break; \
+ case MX25_PAD_D15__GPIO_4_5: \
-+ __gpio = GPIO_4_5; \
-+ break; \
++ __gpio = GPIO_4_5; \
++ break; \
+ case MX25_PAD_D14__GPIO_4_6: \
-+ __gpio = GPIO_4_6; \
-+ break; \
++ __gpio = GPIO_4_6; \
++ break; \
+ case MX25_PAD_D13__GPIO_4_7: \
-+ __gpio = GPIO_4_7; \
-+ break; \
++ __gpio = GPIO_4_7; \
++ break; \
+ case MX25_PAD_D12__GPIO_4_8: \
-+ __gpio = GPIO_4_8; \
-+ break; \
++ __gpio = GPIO_4_8; \
++ break; \
+ case MX25_PAD_D11__GPIO_4_9: \
-+ __gpio = GPIO_4_9; \
-+ break; \
++ __gpio = GPIO_4_9; \
++ break; \
+ case MX25_PAD_D10__GPIO_4_10: \
-+ __gpio = GPIO_4_10; \
-+ break; \
++ __gpio = GPIO_4_10; \
++ break; \
+ case MX25_PAD_D9__GPIO_4_11: \
-+ __gpio = GPIO_4_11; \
-+ break; \
++ __gpio = GPIO_4_11; \
++ break; \
+ case MX25_PAD_D8__GPIO_4_12: \
-+ __gpio = GPIO_4_12; \
-+ break; \
++ __gpio = GPIO_4_12; \
++ break; \
+ case MX25_PAD_D7__GPIO_4_13: \
-+ __gpio = GPIO_4_13; \
-+ break; \
++ __gpio = GPIO_4_13; \
++ break; \
+ case MX25_PAD_D6__GPIO_4_14: \
-+ __gpio = GPIO_4_14; \
-+ break; \
++ __gpio = GPIO_4_14; \
++ break; \
+ case MX25_PAD_D5__GPIO_4_15: \
-+ __gpio = GPIO_4_15; \
-+ break; \
++ __gpio = GPIO_4_15; \
++ break; \
+ case MX25_PAD_D4__GPIO_4_16: \
-+ __gpio = GPIO_4_16; \
-+ break; \
++ __gpio = GPIO_4_16; \
++ break; \
+ case MX25_PAD_D3__GPIO_4_17: \
-+ __gpio = GPIO_4_17; \
-+ break; \
++ __gpio = GPIO_4_17; \
++ break; \
+ case MX25_PAD_D2__GPIO_4_18: \
-+ __gpio = GPIO_4_18; \
-+ break; \
++ __gpio = GPIO_4_18; \
++ break; \
+ case MX25_PAD_D1__GPIO_4_19: \
-+ __gpio = GPIO_4_19; \
-+ break; \
++ __gpio = GPIO_4_19; \
++ break; \
+ case MX25_PAD_D0__GPIO_4_20: \
-+ __gpio = GPIO_4_20; \
-+ break; \
++ __gpio = GPIO_4_20; \
++ break; \
+ case MX25_PAD_CSI_D9__GPIO_4_21: \
-+ __gpio = GPIO_4_21; \
-+ break; \
++ __gpio = GPIO_4_21; \
++ break; \
+ case MX25_PAD_UART1_RXD__GPIO_4_22: \
-+ __gpio = GPIO_4_22; \
-+ break; \
++ __gpio = GPIO_4_22; \
++ break; \
+ case MX25_PAD_UART1_TXD__GPIO_4_23: \
-+ __gpio = GPIO_4_23; \
-+ break; \
++ __gpio = GPIO_4_23; \
++ break; \
+ case MX25_PAD_UART1_RTS__GPIO_4_24: \
-+ __gpio = GPIO_4_24; \
-+ break; \
++ __gpio = GPIO_4_24; \
++ break; \
+ case MX25_PAD_UART1_CTS__GPIO_4_25: \
-+ __gpio = GPIO_4_25; \
-+ break; \
++ __gpio = GPIO_4_25; \
++ break; \
+ case MX25_PAD_UART2_RXD__GPIO_4_26: \
-+ __gpio = GPIO_4_26; \
-+ break; \
++ __gpio = GPIO_4_26; \
++ break; \
+ case MX25_PAD_UART2_TXD__GPIO_4_27: \
-+ __gpio = GPIO_4_27; \
-+ break; \
++ __gpio = GPIO_4_27; \
++ break; \
+ case MX25_PAD_UART2_RTS__GPIO_4_28: \
-+ __gpio = GPIO_4_28; \
-+ break; \
++ __gpio = GPIO_4_28; \
++ break; \
+ case MX25_PAD_UART2_CTS__GPIO_4_29: \
-+ __gpio = GPIO_4_29; \
-+ break; \
++ __gpio = GPIO_4_29; \
++ break; \
+ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \
-+ __gpio = GPIO_4_30; \
-+ break; \
++ __gpio = GPIO_4_30; \
++ break; \
+ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \
-+ __gpio = GPIO_4_31; \
-+ break; \
++ __gpio = GPIO_4_31; \
++ break; \
+ } \
+ __gpio; \
+})
-+#endif
+
+#endif // __ASSEMBLY__
+#endif // __IOMUX_MX25_H__
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-v3.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux-v3.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-v3.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux-v3.h 2009-06-02 17:05:27.000000000 +0200
-@@ -54,7 +54,7 @@ struct pad_desc {
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-v3.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux-v3.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux-v3.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux-v3.h 2009-06-25 15:27:32.000000000 +0200
+@@ -52,44 +52,63 @@ struct pad_desc {
+ unsigned pad_ctrl:17;
+ unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */
unsigned select_input:3;
++#ifdef IOMUX_DEBUG
++ char *name;
++#endif
};
-#define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
-+#define IOMUX_PAD(_pad, _func, _pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
- _select_input, _pad_ctrl) \
- { \
- .mux_ctrl_ofs = _mux_ctrl_ofs, \
-@@ -68,28 +68,28 @@ struct pad_desc {
+- _select_input, _pad_ctrl) \
+- { \
+- .mux_ctrl_ofs = _mux_ctrl_ofs, \
+- .mux_mode = _mux_mode, \
+- .pad_ctrl_ofs = _pad_ctrl_ofs, \
+- .pad_ctrl = _pad_ctrl, \
+- .select_input_ofs = _select_input_ofs, \
+- .select_input = _select_input, \
++#ifdef IOMUX_DEBUG
++#define MXC_PAD_NAME(pd) (pd)->name
++#define IOMUX_PAD(_pad, _func, _pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
++ _select_input, _pad_ctrl) \
++ { \
++ .mux_ctrl_ofs = _mux_ctrl_ofs, \
++ .mux_mode = _mux_mode, \
++ .pad_ctrl_ofs = _pad_ctrl_ofs, \
++ .pad_ctrl = _pad_ctrl, \
++ .select_input_ofs = _select_input_ofs, \
++ .select_input = _select_input, \
++ .name = #_pad"__"#_func, \
+ }
++#else
++#define MXC_PAD_NAME(pd) ""
++#define IOMUX_PAD(_pad, _func, _pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \
++ _select_input, _pad_ctrl) \
++ { \
++ .mux_ctrl_ofs = _mux_ctrl_ofs, \
++ .mux_mode = _mux_mode, \
++ .pad_ctrl_ofs = _pad_ctrl_ofs, \
++ .pad_ctrl = _pad_ctrl, \
++ .select_input_ofs = _select_input_ofs, \
++ .select_input = _select_input, \
++ }
++#endif
+
/*
* Use to set PAD control
*/
@@ -9041,9 +7980,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux-v3.h linux-2.6.
/*
* setups a single pad:
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/iomux.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/iomux.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/iomux.h 2009-06-02 18:02:08.000000000 +0200
@@ -24,10 +24,14 @@
* GPIO Module and I/O Multiplexer
* x = 0..3 for reg_A, reg_B, reg_C, reg_D
@@ -9088,9 +8027,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/iomux.h linux-2.6.30-
#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/irqs.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/irqs.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/irqs.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/irqs.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/irqs.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/irqs.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/irqs.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/irqs.h 2009-06-02 18:02:09.000000000 +0200
@@ -21,7 +21,11 @@
#if defined CONFIG_ARCH_MX1
#define MXC_GPIO_IRQS (32 * 4)
@@ -9103,9 +8042,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/irqs.h linux-2.6.30-r
#elif defined CONFIG_ARCH_MX3
#define MXC_GPIO_IRQS (32 * 3)
#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/memory.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/memory.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/memory.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/memory.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/memory.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/memory.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/memory.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/memory.h 2009-06-02 18:02:09.000000000 +0200
@@ -14,12 +14,13 @@
#if defined CONFIG_ARCH_MX1
#define PHYS_OFFSET UL(0x08000000)
@@ -9124,10 +8063,10 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/memory.h linux-2.6.30
#elif defined CONFIG_ARCH_MX3
#define PHYS_OFFSET UL(0x80000000)
#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mx25.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mx25.h 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,482 @@
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mx25.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx25.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mx25.h 2009-07-01 11:21:51.000000000 +0200
+@@ -0,0 +1,483 @@
+/*
+ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
@@ -9209,7 +8148,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-r
+#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
+#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
+#define CAN1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
-+#define CAN3_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
++#define CAN2_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
+#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
+#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
+#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
@@ -9329,7 +8268,8 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-r
+#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
+#define IIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F0000)
+#define USBOTG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F4000)
-+#define OTG_BASE_ADDR USBOTG_BASE_ADDR
++#define OTG_BASE_ADDR (USBOTG_BASE_ADDR + 0x000)
++#define USBH2_BASE_ADDR (USBOTG_BASE_ADDR + 0x400)
+#define CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000)
+#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000)
+
@@ -9536,7 +8476,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-r
+#define MXC_INT_UART2 32
+#define MXC_INT_NANDFC 33
+#define MXC_INT_SDMA 34
-+#define MXC_INT_USB_HTG 35
++#define MXC_INT_USB_H2 35
+#define MXC_INT_PWM2 36
+#define MXC_INT_USB_OTG 37
+#define MXC_INT_SLCDC 38
@@ -9610,9 +8550,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx25.h linux-2.6.30-r
+#endif
+
+#endif /* __ASM_ARCH_MXC_MX25_H__ */
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx2x.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mx2x.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx2x.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mx2x.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx2x.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mx2x.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mx2x.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mx2x.h 2009-06-02 18:02:11.000000000 +0200
@@ -79,7 +79,7 @@
* This macro defines the physical to virtual address mapping for all the
* peripheral modules. It is used by passing in the physical address as x
@@ -9631,9 +8571,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mx2x.h linux-2.6.30-r
/* define the address mapping macros: in physical address order */
#define AIPI_IO_ADDRESS(x) \
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mxc.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mxc.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mxc.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/mxc.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc.h 2009-06-02 18:02:12.000000000 +0200
@@ -27,6 +27,7 @@
#define MXC_CPU_MX1 1
#define MXC_CPU_MX21 21
@@ -9669,9 +8609,84 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/mxc.h linux-2.6.30-rc
+#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx25() || cpu_is_mx27())
#endif /* __ASM_ARCH_MXC_H__ */
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/sdma.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/sdma.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/sdma.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/sdma.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_can.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_can.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_can.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_can.h 2009-07-01 11:31:19.000000000 +0200
+@@ -0,0 +1,26 @@
++/*
++ * Copyright (C) 2009 Lothar Wassmann <LW@KARO-electronics.de>
++ *
++ * 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
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
++ */
++
++#include <linux/platform_device.h>
++
++struct flexcan_platform_data {
++ char *core_reg;
++ char *io_reg;
++ int (*xcvr_enable)(struct platform_device *pdev, int en);
++ int (*active)(struct platform_device *pdev);
++ void (*inactive)(struct platform_device *pdev);
++};
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_ehci.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_ehci.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_ehci.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_ehci.h 2009-07-01 11:31:34.000000000 +0200
+@@ -0,0 +1,9 @@
++#ifndef __INCLUDE_ASM_ARCH_MXC_EHCI_H
++#define __INCLUDE_ASM_ARCH_MXC_EHCI_H
++
++struct mxc_usbh_platform_data {
++ int (*init)(struct platform_device *pdev);
++ int (*exit)(struct platform_device *pdev);
++};
++#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */
++
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_tsadcc.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_tsadcc.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/mxc_tsadcc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/mxc_tsadcc.h 2009-07-01 11:23:07.000000000 +0200
+@@ -0,0 +1,28 @@
++/*
++ * Freescale i.MX25 Touch Screen Driver
++ *
++ * Copyright (c) 2009 Lothar Wassmann <LW@KARO-electronics.de>
++ *
++ * Based on code from Freescale BSP
++ *
++ * 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.
++ */
++
++typedef enum {
++ MXC_TSC_4WIRE,
++ MXC_TSC_5WIRE,
++} mxc_tsc_mode;
++
++struct mxc_tsadcc_pdata {
++ int pen_debounce_time; /* 0: disable debounce;
++ * 1..128: # of ADC clock cycles / 8 */
++ unsigned int intref:1, /* 0|1: internal reference disabled|enabled */
++ hsyncen:1; /* synchronize measurements with LCD HSYNC */
++ unsigned int r_xplate; /* resistance (in Ohms) of X plate
++ * (required for pressure measurement */
++ int adc_clk; /* ADC clock frequency in Hz (max. 1750000);
++ * <= 0: use default (1666667) */
++ mxc_tsc_mode tsc_mode; /* select 4 wire or 5 wire mode */
++};
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/sdma.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/sdma.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/sdma.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/sdma.h 2009-06-02 18:02:13.000000000 +0200
@@ -0,0 +1,504 @@
+
+/*
@@ -10177,9 +9192,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/sdma.h linux-2.6.30-r
+#define DEFAULT_ERR 1
+
+#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/spba.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/spba.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/spba.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/spba.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/spba.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/spba.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/spba.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/spba.h 2009-06-02 18:02:13.000000000 +0200
@@ -0,0 +1,66 @@
+
+/*
@@ -10247,9 +9262,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/spba.h linux-2.6.30-r
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_ARCH_MXC_SPBA_H__ */
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/timex.h linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/timex.h
---- linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/timex.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/include/mach/timex.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/timex.h linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/timex.h
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/include/mach/timex.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/include/mach/timex.h 2009-07-02 16:20:37.000000000 +0200
@@ -23,7 +23,11 @@
#if defined CONFIG_ARCH_MX1
#define CLOCK_TICK_RATE 16000000
@@ -10257,14 +9272,14 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/include/mach/timex.h linux-2.6.30-
+#ifndef CONFIG_MACH_MX25
#define CLOCK_TICK_RATE 13300000
+#else
-+#define CLOCK_TICK_RATE 12000000
++#define CLOCK_TICK_RATE 66500000
+#endif
#elif defined CONFIG_ARCH_MX3
#define CLOCK_TICK_RATE 16625000
#endif
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-mx1-mx2.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/iomux-mx1-mx2.c
---- linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-mx1-mx2.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/iomux-mx1-mx2.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-mx1-mx2.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/iomux-mx1-mx2.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-mx1-mx2.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/iomux-mx1-mx2.c 2009-06-02 18:02:01.000000000 +0200
@@ -74,11 +74,12 @@ void mxc_gpio_mode(int gpio_mode)
__raw_writel(tmp, VA_GPIO_BASE + MXC_GIUS(port));
@@ -10294,9 +9309,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-mx1-mx2.c linux-2.6.30-rc4-k
tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA2(port));
tmp &= ~(3 << (pin * 2));
tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2);
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-v3.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/iomux-v3.c
---- linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-v3.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/iomux-v3.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-v3.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/iomux-v3.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/iomux-v3.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/iomux-v3.c 2009-06-02 18:02:02.000000000 +0200
@@ -31,7 +31,24 @@
#define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR)
@@ -10353,9 +9368,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/iomux-v3.c linux-2.6.30-rc4-karo/a
clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map);
}
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/pwm.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/pwm.c
---- linux-2.6.30-rc4/arch/arm/plat-mxc/pwm.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/pwm.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/pwm.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/pwm.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/pwm.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/pwm.c 2009-06-02 18:02:02.000000000 +0200
@@ -55,7 +55,7 @@ int pwm_config(struct pwm_device *pwm, i
if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
return -EINVAL;
@@ -10365,9 +9380,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/pwm.c linux-2.6.30-rc4-karo/arch/a
unsigned long long c;
unsigned long period_cycles, duty_cycles, prescale;
c = clk_get_rate(pwm->clk);
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/spba.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/spba.c
---- linux-2.6.30-rc4/arch/arm/plat-mxc/spba.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/spba.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/spba.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/spba.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/spba.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/spba.c 2009-06-02 18:02:03.000000000 +0200
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -10512,9 +9527,58 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/spba.c linux-2.6.30-rc4-karo/arch/
+MODULE_AUTHOR("Freescale Semiconductor, Inc.");
+MODULE_DESCRIPTION("SPBA");
+MODULE_LICENSE("GPL");
-diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/time.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/time.c
---- linux-2.6.30-rc4/arch/arm/plat-mxc/time.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/time.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/system.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/system.c 2009-06-29 10:49:32.000000000 +0200
+@@ -21,6 +21,7 @@
+ */
+
+ #include <linux/kernel.h>
++#include <linux/init.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/err.h>
+@@ -43,14 +44,6 @@
+ */
+ void arch_reset(char mode, const char *cmd)
+ {
+- if (!cpu_is_mx1()) {
+- struct clk *clk;
+-
+- clk = clk_get_sys("imx-wdt.0", NULL);
+- if (!IS_ERR(clk))
+- clk_enable(clk);
+- }
+-
+ /* Assert SRS signal */
+ __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG);
+
+@@ -65,3 +58,22 @@ void arch_reset(char mode, const char *c
+ /* we'll take a jump through zero as a poor second */
+ cpu_reset(0);
+ }
++
++static int mxc_wdt_init(void)
++{
++ struct clk *wdt_clk;
++
++ if (cpu_is_mx1())
++ return 0;
++
++ wdt_clk = clk_get_sys("imx-wdt.0", NULL);
++ if (IS_ERR(wdt_clk)) {
++ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %ld\n",
++ __FUNCTION__, PTR_ERR(wdt_clk));
++ return PTR_ERR(wdt_clk);
++ }
++ clk_enable(wdt_clk);
++ clk_put(wdt_clk);
++ return 0;
++}
++arch_initcall(mxc_wdt_init);
+diff -purN linux-2.6.30-rc4-git/arch/arm/plat-mxc/time.c linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/time.c
+--- linux-2.6.30-rc4-git/arch/arm/plat-mxc/time.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/plat-mxc/time.c 2009-07-06 14:12:36.000000000 +0200
@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void)
{
unsigned int tmp;
@@ -10581,23 +9645,7 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/time.c linux-2.6.30-rc4-karo/arch/
clockevent_mxc.set_next_event = mx3_set_next_event;
clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
-@@ -287,6 +287,7 @@ void __init mxc_timer_init(struct clk *t
- int irq;
-
- clk_enable(timer_clk);
-+printk(KERN_DEBUG "%s: \n", __FUNCTION__);
-
- if (cpu_is_mx1()) {
- #ifdef CONFIG_ARCH_MX1
-@@ -306,6 +307,7 @@ void __init mxc_timer_init(struct clk *t
- } else
- BUG();
-
-+printk(KERN_DEBUG "%s: timer_base=%p IRQ=%d\n", __FUNCTION__, timer_base, irq);
- /*
- * Initialise to a known state (all timers off, and timing reset)
- */
-@@ -313,7 +315,7 @@ void __init mxc_timer_init(struct clk *t
+@@ -313,7 +313,7 @@ void __init mxc_timer_init(struct clk *t
__raw_writel(0, timer_base + MXC_TCTL);
__raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
@@ -10606,9 +9654,9 @@ diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/time.c linux-2.6.30-rc4-karo/arch/
tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN;
else
tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
-diff -urNp linux-2.6.30-rc4/arch/arm/tools/mach-types linux-2.6.30-rc4-karo/arch/arm/tools/mach-types
---- linux-2.6.30-rc4/arch/arm/tools/mach-types 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/arch/arm/tools/mach-types 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/arch/arm/tools/mach-types linux-2.6.30-rc4-karo3/arch/arm/tools/mach-types
+--- linux-2.6.30-rc4-git/arch/arm/tools/mach-types 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/arch/arm/tools/mach-types 2009-06-02 18:02:54.000000000 +0200
@@ -12,7 +12,7 @@
#
# http://www.arm.linux.org.uk/developer/machines/?action=new
@@ -10669,9 +9717,1207 @@ diff -urNp linux-2.6.30-rc4/arch/arm/tools/mach-types linux-2.6.30-rc4-karo/arch
+pxa255 MACH_PXA255 PXA255 2180
+lal43 MACH_LAL43 LAL43 2181
+htcraphael_cdma500 MACH_HTCRAPHAEL_CDMA500 HTCRAPHAEL_CDMA500 2182
-diff -urNp linux-2.6.30-rc4/drivers/leds/leds-gpio.c linux-2.6.30-rc4-karo/drivers/leds/leds-gpio.c
---- linux-2.6.30-rc4/drivers/leds/leds-gpio.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/leds/leds-gpio.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/drivers/input/touchscreen/Kconfig linux-2.6.30-rc4-karo3/drivers/input/touchscreen/Kconfig
+--- linux-2.6.30-rc4-git/drivers/input/touchscreen/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/input/touchscreen/Kconfig 2009-06-23 13:33:58.000000000 +0200
+@@ -287,6 +287,18 @@ config TOUCHSCREEN_ATMEL_TSADCC
+ To compile this driver as a module, choose M here: the
+ module will be called atmel_tsadcc.
+
++config TOUCHSCREEN_MXC_TSADCC
++ tristate "i.MX25 Touchscreen Interface"
++ depends on MACH_MX25
++ help
++ Say Y here if you have a 4-wire touchscreen connected to the
++ ADC Controller on your Freescale i.MX25 SoC.
++
++ If unsure, say N.
++
++ To compile this driver as a module, choose M here: the
++ module will be called atmel_tsadcc.
++
+ config TOUCHSCREEN_UCB1400
+ tristate "Philips UCB1400 touchscreen"
+ depends on AC97_BUS
+diff -purN linux-2.6.30-rc4-git/drivers/input/touchscreen/Makefile linux-2.6.30-rc4-karo3/drivers/input/touchscreen/Makefile
+--- linux-2.6.30-rc4-git/drivers/input/touchscreen/Makefile 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/input/touchscreen/Makefile 2009-06-23 13:33:59.000000000 +0200
+@@ -16,19 +16,20 @@ obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunz
+ obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o
+ obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o
+-obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o
+-obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o
+-obj-$(CONFIG_TOUCHSCREEN_MK712) += mk712.o
+ obj-$(CONFIG_TOUCHSCREEN_HP600) += hp680_ts_input.o
+ obj-$(CONFIG_TOUCHSCREEN_HP7XX) += jornada720_ts.o
+ obj-$(CONFIG_TOUCHSCREEN_HTCPEN) += htcpen.o
+-obj-$(CONFIG_TOUCHSCREEN_USB_COMPOSITE) += usbtouchscreen.o
++obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o
++obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o
++obj-$(CONFIG_TOUCHSCREEN_MK712) += mk712.o
++obj-$(CONFIG_TOUCHSCREEN_MXC_TSADCC) += mxc_tsadcc.o
+ obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o
+ obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
+ obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
+ obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
+ obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
+ obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
++obj-$(CONFIG_TOUCHSCREEN_USB_COMPOSITE) += usbtouchscreen.o
+ obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001) += wacom_w8001.o
+ obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o
+ obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o
+diff -purN linux-2.6.30-rc4-git/drivers/input/touchscreen/mxc_tsadcc.c linux-2.6.30-rc4-karo3/drivers/input/touchscreen/mxc_tsadcc.c
+--- linux-2.6.30-rc4-git/drivers/input/touchscreen/mxc_tsadcc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/drivers/input/touchscreen/mxc_tsadcc.c 2009-07-01 11:27:20.000000000 +0200
+@@ -0,0 +1,897 @@
++/*
++ * Freescale i.MX25 Touch Screen Driver
++ *
++ * Copyright (c) 2009 Lothar Wassmann <LW@KARO-electronics.de>
++ *
++ * Based on atmel_tsadcc.c
++ * Copyright (c) 2008 ATMEL et. al.
++ * and code from Freescale BSP
++ *
++ * 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/err.h>
++#include <linux/input.h>
++#include <linux/timer.h>
++#include <linux/interrupt.h>
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <mach/mxc_tsadcc.h>
++
++#include "mxc_tsadcc.h"
++
++#define TSC_NUM_SAMPLES 1
++#define ADC_NUM_SAMPLES 1
++
++#ifdef DEBUG
++static int debug = 4;
++#define dbg_lvl(n) ((n) < debug)
++module_param(debug, int, S_IRUGO | S_IWUSR);
++
++#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0)
++#else
++static int debug;
++#define dbg_lvl(n) 0
++module_param(debug, int, 0);
++
++#define DBG(lvl, fmt...) do { } while (0)
++#endif
++
++#define DEFAULT_ADC_CLOCK 1666667
++#define DEFAULT_RX_VALUE 360
++
++//#define REPORT_PRESSURE
++
++struct mxc_tsadcc_fifo_data {
++ unsigned int id:4,
++ data:12;
++};
++
++/* The layout of this structure depends on the setup created by mxc_tsadcc_config() */
++struct mxc_tsadcc_tsc_data {
++ struct mxc_tsadcc_fifo_data pendown[TSC_NUM_SAMPLES];
++ struct mxc_tsadcc_fifo_data pos_x[TSC_NUM_SAMPLES];
++ struct mxc_tsadcc_fifo_data pos_y[TSC_NUM_SAMPLES];
++#ifdef REPORT_PRESSURE
++ struct mxc_tsadcc_fifo_data yn[TSC_NUM_SAMPLES];
++ struct mxc_tsadcc_fifo_data xp[TSC_NUM_SAMPLES];
++#endif
++ struct mxc_tsadcc_fifo_data pendown2[TSC_NUM_SAMPLES];
++};
++
++struct mxc_tsadcc_adc_data {
++ struct mxc_tsadcc_fifo_data data[ADC_NUM_SAMPLES];
++};
++
++struct mxc_tsadcc {
++ struct input_dev *input;
++ char phys[32];
++ void __iomem *reg_base;
++ struct clk *clk;
++ int irq;
++ struct work_struct work;
++ struct timer_list timer;
++ wait_queue_head_t wq;
++ unsigned int pendown:1,
++ clk_enabled:1,
++ attrs:1,
++ valid_measure:1;
++ mxc_tsc_mode tsc_mode;
++ struct mxc_tsadcc_tsc_data *tsc_data;
++ struct mxc_tsadcc_adc_data *adc_data;
++ unsigned int r_xplate;
++
++ struct mutex convert_mutex;
++ unsigned short pressure;
++ unsigned short prev_absx;
++ unsigned short prev_absy;
++};
++
++#ifdef DEBUG
++#define mxc_tsadcc_read(s,reg) _mxc_tsadcc_read(s,reg,#reg,__FUNCTION__)
++#define mxc_tsadcc_write(s,reg,val) _mxc_tsadcc_write(s,reg,val,#reg,__FUNCTION__)
++
++static inline unsigned long _mxc_tsadcc_read(struct mxc_tsadcc *ts_dev, int reg,
++ const char *name, const char *fn)
++{
++ unsigned long val = __raw_readl(ts_dev->reg_base + reg);
++ DBG(3, "%s: Read %08lx from %s\n", fn, val, name);
++ return val;
++}
++
++static inline void _mxc_tsadcc_write(struct mxc_tsadcc *ts_dev, int reg, unsigned long val,
++ const char *name, const char *fn)
++{
++ __raw_writel(val, ts_dev->reg_base + reg);
++ DBG(3, "%s: Wrote %08lx to %s\n", fn, val, name);
++}
++#else
++static inline unsigned long mxc_tsadcc_read(struct mxc_tsadcc *ts_dev, int reg)
++{
++ return __raw_readl(ts_dev->reg_base + reg);
++}
++static inline void mxc_tsadcc_write(struct mxc_tsadcc *ts_dev, int reg, unsigned long val)
++{
++ __raw_writel(val, ts_dev->reg_base + reg);
++}
++#endif
++
++static void tsc_clk_enable(struct mxc_tsadcc *ts_dev)
++{
++ if (!ts_dev->clk_enabled) {
++ unsigned long reg;
++ clk_enable(ts_dev->clk);
++
++ reg = mxc_tsadcc_read(ts_dev, TGCR);
++ reg |= TGCR_IPG_CLK_EN;
++ mxc_tsadcc_write(ts_dev, TGCR, reg);
++ ts_dev->clk_enabled = 1;
++ }
++}
++
++static void tsc_clk_disable(struct mxc_tsadcc *ts_dev)
++{
++ if (ts_dev->clk_enabled) {
++ unsigned long reg;
++
++ reg = mxc_tsadcc_read(ts_dev, TGCR);
++ reg &= ~TGCR_IPG_CLK_EN;
++ mxc_tsadcc_write(ts_dev, TGCR, reg);
++
++ clk_disable(ts_dev->clk);
++ ts_dev->clk_enabled = 0;
++ }
++}
++
++static inline int mxc_tsadcc_pendown(struct mxc_tsadcc *ts_dev)
++{
++ return ts_dev->pendown;
++}
++
++static int mxc_tsadcc_read_adc(struct mxc_tsadcc *ts_dev, int chan)
++{
++ int ret = 1;
++ unsigned long reg;
++ unsigned int data_num = 0;
++ int i;
++ union {
++ unsigned int fifo[sizeof(struct mxc_tsadcc_tsc_data) / sizeof(int)];
++ struct mxc_tsadcc_tsc_data data;
++ } *fifo_data = (void *)ts_dev->adc_data;
++ struct mxc_tsadcc_adc_data *adc_data = ts_dev->adc_data;
++ int lastitemid = 0;
++ struct input_dev *input_dev = ts_dev->input;
++ long timeout = msecs_to_jiffies(1 * ADC_NUM_SAMPLES);
++
++ mutex_lock(&ts_dev->convert_mutex);
++ reg = (0xf << CQCR_FIFOWATERMARK_SHIFT) |
++ (lastitemid << CQCR_LAST_ITEM_ID_SHIFT) | CQCR_QSM_FQS;
++ mxc_tsadcc_write(ts_dev, GCQCR, reg);
++
++ reg = ((ADC_NUM_SAMPLES - 1) << CC_NOS_SHIFT) |
++ (16 << CC_SETTLING_TIME_SHIFT) |
++ CC_YPLLSW_OFF | CC_XNURSW_OFF | CC_XPULSW |
++ CC_SELREFP_INT | chan | CC_SEL_REFN_AGND;
++ mxc_tsadcc_write(ts_dev, GCC0, reg);
++
++ memset(adc_data, 0, sizeof(*adc_data));
++
++ reg = mxc_tsadcc_read(ts_dev, GCQCR);
++ reg |= CQCR_FQS;
++ mxc_tsadcc_write(ts_dev, GCQCR, reg);
++
++ /* enable end of conversion interrupt */
++ reg = mxc_tsadcc_read(ts_dev, GCQMR);
++ reg &= ~CQMR_EOQ_IRQ_MSK;
++ mxc_tsadcc_write(ts_dev, GCQMR, reg);
++
++ timeout = wait_event_timeout(ts_dev->wq,
++ mxc_tsadcc_read(ts_dev, GCQSR) &
++ CQSR_EOQ, timeout);
++ if (timeout == 0 &&
++ !(mxc_tsadcc_read(ts_dev, GCQSR) & CQSR_EOQ)) {
++ dev_err(&input_dev->dev,
++ "Timeout waiting for data on channel %d\n",
++ chan);
++ ret = -ETIME;
++ goto exit;
++ }
++
++ reg = mxc_tsadcc_read(ts_dev, GCQCR);
++ reg &= ~CQCR_FQS;
++ mxc_tsadcc_write(ts_dev, GCQCR, reg);
++ reg = mxc_tsadcc_read(ts_dev, GCQSR);
++
++ /* clear interrupt status bit */
++ reg = CQSR_EOQ;
++ mxc_tsadcc_write(ts_dev, GCQSR, reg);
++
++ while (!(mxc_tsadcc_read(ts_dev, GCQSR) & CQSR_EMPT)) {
++ BUG_ON(data_num >= ARRAY_SIZE(fifo_data->fifo));
++ reg = mxc_tsadcc_read(ts_dev, GCQFIFO);
++ fifo_data->fifo[data_num] = reg;
++ data_num++;
++ }
++ DBG(0, "%s: Read %u words from fifo\n", __FUNCTION__, data_num);
++ for (i = 0; i < data_num; i++) {
++ DBG(0, "%s: data[%d]=%03x ID %d\n", __FUNCTION__, i,
++ adc_data->data[i].data, adc_data->data[i].id);
++ }
++ exit:
++ mutex_unlock(&ts_dev->convert_mutex);
++
++ return ret;
++}
++
++struct mxc_tsadcc_attr {
++ struct device_attribute attr;
++ unsigned int reg;
++};
++
++#define to_mxc_tsadcc_attr(a) container_of(a, struct mxc_tsadcc_attr, attr)
++
++#define MXC_TSADCC_DEV_ATTR(_name, _mode, _reg, _read, _write) \
++ struct mxc_tsadcc_attr mxc_tsadcc_attr_##_name = { \
++ .attr = __ATTR(_name,_mode,_read,_write), \
++ .reg = _reg, \
++ }
++
++static ssize_t mxc_tsadcc_attr_get(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ ssize_t ret = -EIO;
++ struct mxc_tsadcc *ts_dev = dev_get_drvdata(dev);
++ struct mxc_tsadcc_attr *mxc_tsadcc_attr = to_mxc_tsadcc_attr(attr);
++
++ if (mxc_tsadcc_read_adc(ts_dev, mxc_tsadcc_attr->reg)) {
++ ret = sprintf(buf, "0x%04x\n", ts_dev->adc_data->data[0].data);
++ }
++ return ret;
++}
++
++#if 0
++static ssize_t mxc_tsadcc_attr_set(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ ssize_t ret;
++ struct mxc_tsadcc *ts_dev = dev_get_drvdata(dev);
++ struct mxc_tsadcc_attr *mxc_tsadcc_attr = to_mxc_tsadcc_attr(attr);
++ unsigned long val = simple_strtoul(buf, NULL, 0);
++
++ mxc_tsadcc_write(ts_dev, mxc_tsadcc_attr->reg, val);
++ return count;
++}
++#endif
++
++MXC_TSADCC_DEV_ATTR(inaux0, S_IRUGO, CC_SELIN_INAUX0, mxc_tsadcc_attr_get, NULL);
++MXC_TSADCC_DEV_ATTR(inaux1, S_IRUGO, CC_SELIN_INAUX1, mxc_tsadcc_attr_get, NULL);
++MXC_TSADCC_DEV_ATTR(inaux2, S_IRUGO, CC_SELIN_INAUX2, mxc_tsadcc_attr_get, NULL);
++
++static struct attribute *mxc_tsadcc_attrs[] = {
++ &mxc_tsadcc_attr_inaux0.attr.attr,
++ &mxc_tsadcc_attr_inaux1.attr.attr,
++ &mxc_tsadcc_attr_inaux2.attr.attr,
++ NULL
++};
++
++static const struct attribute_group mxc_tsadcc_attr_group = {
++ .attrs = mxc_tsadcc_attrs,
++};
++
++static int mxc_tsadcc_read_ts(struct mxc_tsadcc *ts_dev, int force)
++{
++ int ret;
++ unsigned long reg;
++ unsigned int data_num = 0;
++ union {
++ unsigned int fifo[sizeof(struct mxc_tsadcc_tsc_data) / sizeof(int)];
++ struct mxc_tsadcc_tsc_data data;
++ } *fifo_data = (void *)ts_dev->tsc_data;
++ struct mxc_tsadcc_tsc_data *tsc_data = ts_dev->tsc_data;
++ struct input_dev *input_dev = ts_dev->input;
++ long timeout = msecs_to_jiffies(1 * TSC_NUM_SAMPLES);
++
++ mutex_lock(&ts_dev->convert_mutex);
++ memset(tsc_data, 0, sizeof(*tsc_data));
++ if (force) {
++ reg = (0x1 << CC_YPLLSW_SHIFT) | (0x1 << CC_XNURSW_SHIFT) |
++ CC_XPULSW;
++ mxc_tsadcc_write(ts_dev, TICR, reg);
++
++ /* FQS */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_QSM_MASK;
++ reg |= CQCR_QSM_FQS;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg |= CQCR_FQS;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ timeout = wait_event_timeout(ts_dev->wq,
++ mxc_tsadcc_read(ts_dev, TCQSR) &
++ CQSR_EOQ, timeout);
++ if (timeout == 0 &&
++ !(mxc_tsadcc_read(ts_dev, TCQSR) & CQSR_EOQ)) {
++ dev_err(&input_dev->dev,
++ "Timeout waiting for TSC data\n");
++ ret = -ETIME;
++ goto exit;
++ }
++
++ /* stop FQS */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_QSM_MASK;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_FQS;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ /* clear status bit */
++ reg = mxc_tsadcc_read(ts_dev, TCQSR);
++ reg = CQSR_EOQ;
++ mxc_tsadcc_write(ts_dev, TCQSR, reg);
++ } else {
++ /* Config idle for 4-wire */
++ reg = TSC_4WIRE_TOUCH_DETECT;
++ mxc_tsadcc_write(ts_dev, TICR, reg);
++
++ /* Pen interrupt starts new conversion queue */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_QSM_MASK;
++ reg |= CQCR_QSM_PEN;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ /* PDEN and PDBEN */
++ reg = mxc_tsadcc_read(ts_dev, TGCR);
++ reg |= (TGCR_PDB_EN | TGCR_PD_EN);
++ mxc_tsadcc_write(ts_dev, TGCR, reg);
++
++ wait_event_timeout(ts_dev->wq,
++ mxc_tsadcc_read(ts_dev, TCQSR) &
++ CQSR_EOQ, timeout);
++ if (timeout == 0 &&
++ !(mxc_tsadcc_read(ts_dev, TCQSR) & CQSR_EOQ)) {
++ dev_err(&input_dev->dev,
++ "Timeout waiting for TSC data\n");
++ ret = -ETIME;
++ goto exit;
++ }
++
++ /* stop the conversion */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_QSM_MASK;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ /* clear interrupt status flags */
++ reg = CQSR_PD | CQSR_EOQ;
++ mxc_tsadcc_write(ts_dev, TCQSR, reg);
++
++ /* change configuration for FQS mode */
++ reg = (0x1 << CC_YPLLSW_SHIFT) | (0x1 << CC_XNURSW_SHIFT) |
++ CC_XPULSW;
++ mxc_tsadcc_write(ts_dev, TICR, reg);
++ }
++
++ while (!(mxc_tsadcc_read(ts_dev, TCQSR) & CQSR_EMPT)) {
++ BUG_ON(data_num >= ARRAY_SIZE(fifo_data->fifo));
++ reg = mxc_tsadcc_read(ts_dev, TCQFIFO);
++ fifo_data->fifo[data_num] = reg;
++ data_num++;
++ }
++ DBG(0, "%s: Read %u words from fifo\n", __FUNCTION__, data_num);
++
++ ret = tsc_data->pendown[0].data <= 0x600 &&
++ tsc_data->pendown2[0].data <= 0x600;
++
++ if (ret) {
++ DBG(0, "%s: pos_x=%03x pos_y=%03x\n",
++ __FUNCTION__, tsc_data->pos_x[0].data,
++ tsc_data->pos_y[0].data);
++#ifdef REPORT_PRESSURE
++ DBG(0, "%s: pos_x=%03x pos_y=%03x xp=%03x yn=%03x\n",
++ __FUNCTION__, tsc_data->xp[0].data,
++ tsc_data->yn[0].data);
++#endif
++ if (/*(mxc_tsadcc_read(ts_dev, TCQSR) & CQSR_PD) && */
++ tsc_data->pos_x[0].data &&
++ tsc_data->pos_x[1].data &&
++ tsc_data->pos_x[2].data) {
++#ifdef REPORT_PRESSURE
++ ts_dev->pressure = ts_dev->r_xplate *
++ (tsc_data->pos_x[0].data / 4096) *
++ ((tsc_data->yn[0].data - tsc_data->xp[0].data) /
++ tsc_data->xp[0].data);
++#else
++ ts_dev->pressure = 4095;
++#endif
++ DBG(0, "%s: Detected PEN DOWN with pressure %03x\n",
++ __FUNCTION__, ts_dev->pressure);
++ ts_dev->pendown = 1;
++ } else {
++ DBG(0, "%s: Detected PEN UP\n", __FUNCTION__);
++ ts_dev->pendown = 0;
++ }
++ } else {
++ DBG(0, "%s: Discarding measurement\n", __FUNCTION__);
++ ts_dev->pendown = 0;
++ }
++ exit:
++ mutex_unlock(&ts_dev->convert_mutex);
++
++ return ret;
++}
++
++static inline void mxc_tsadcc_enable_pendown(struct mxc_tsadcc *ts_dev)
++{
++ unsigned long reg;
++
++ /* Config idle for 4-wire */
++ reg = TSC_4WIRE_TOUCH_DETECT;
++ mxc_tsadcc_write(ts_dev, TICR, reg);
++
++ DBG(0, "%s: Enable PD detect\n", __FUNCTION__);
++ reg = mxc_tsadcc_read(ts_dev, TGCR);
++ reg |= TGCR_PD_EN;
++ mxc_tsadcc_write(ts_dev, TGCR, reg);
++}
++
++static void mxc_tsadcc_work(struct work_struct *w)
++{
++ struct mxc_tsadcc *ts_dev = container_of(w, struct mxc_tsadcc, work);
++ struct input_dev *input_dev = ts_dev->input;
++
++ if (mxc_tsadcc_read_ts(ts_dev, 1)) {
++ DBG(0, "%s: Got sample %d\n", __FUNCTION__, ts_dev->pendown);
++ if (mxc_tsadcc_pendown(ts_dev)) {
++ if (!ts_dev->valid_measure) {
++ ts_dev->valid_measure = 1;
++ } else {
++ DBG(0, "%s: Reporting PD event %03x @ %03x,%03x\n",
++ __FUNCTION__, ts_dev->pressure,
++ ts_dev->tsc_data->pos_x[0].data,
++ ts_dev->tsc_data->pos_y[0].data);
++
++ input_report_abs(input_dev, ABS_X,
++ ts_dev->tsc_data->pos_x[0].data);
++ input_report_abs(input_dev, ABS_Y,
++ ts_dev->tsc_data->pos_y[0].data);
++#ifdef REPORT_PRESSURE
++ input_report_abs(input_dev, ABS_PRESSURE,
++ ts_dev->pressure);
++#endif
++ input_report_key(input_dev, BTN_TOUCH, 1);
++ input_sync(input_dev);
++ }
++ ts_dev->prev_absx = ts_dev->tsc_data->pos_x[0].data;
++ ts_dev->prev_absy = ts_dev->tsc_data->pos_y[0].data;
++ DBG(0, "%s: Enabling timer\n", __FUNCTION__);
++ mod_timer(&ts_dev->timer, jiffies +
++ msecs_to_jiffies(10));
++ return;
++ }
++ }
++ if (ts_dev->valid_measure) {
++ DBG(0, "%s: Reporting PU event: %03x,%03x\n", __FUNCTION__,
++ ts_dev->prev_absx, ts_dev->prev_absy);
++ input_report_abs(input_dev, ABS_X,
++ ts_dev->prev_absx);
++ input_report_abs(input_dev, ABS_Y,
++ ts_dev->prev_absy);
++#ifdef REPORT_PRESSURE
++ input_report_abs(input_dev, ABS_PRESSURE, 0);
++#endif
++ input_report_key(input_dev, BTN_TOUCH, 0);
++ input_sync(input_dev);
++ }
++ ts_dev->valid_measure = 0;
++ mxc_tsadcc_enable_pendown(ts_dev);
++}
++
++static void mxc_tsadcc_timer(unsigned long data)
++{
++ struct mxc_tsadcc *ts_dev = (void *)data;
++ schedule_work(&ts_dev->work);
++}
++
++static irqreturn_t mxc_tsadcc_interrupt(int irq, void *dev)
++{
++ struct mxc_tsadcc *ts_dev = dev;
++ //struct input_dev *input_dev = ts_dev->input;
++ unsigned long reg;
++ unsigned long status = mxc_tsadcc_read(ts_dev, TGSR);
++
++ DBG(0, "%s: TCSR= %08lx\n", __FUNCTION__, status);
++
++ if (status & TGSR_TCQ_INT) {
++ DBG(0, "%s: TCQSR=%08lx\n", __FUNCTION__,
++ mxc_tsadcc_read(ts_dev, TCQSR));
++ reg = mxc_tsadcc_read(ts_dev, TCQSR);
++ if (reg & CQSR_PD) {
++ /* disable pen down detect */
++ DBG(0, "%s: Disable PD detect\n", __FUNCTION__);
++ reg = mxc_tsadcc_read(ts_dev, TGCR);
++ reg &= ~TGCR_PD_EN;
++ mxc_tsadcc_write(ts_dev, TGCR, reg);
++
++ /* Now schedule new measurement */
++ schedule_work(&ts_dev->work);
++ }
++ }
++ if (status & TGSR_GCQ_INT) {
++ DBG(0, "%s: GCQSR=%08lx\n", __FUNCTION__,
++ mxc_tsadcc_read(ts_dev, GCQSR));
++ reg = mxc_tsadcc_read(ts_dev, GCQSR);
++ if (reg & CQSR_EOQ) {
++ reg = mxc_tsadcc_read(ts_dev, GCQMR);
++ reg |= CQMR_EOQ_IRQ_MSK;
++ mxc_tsadcc_write(ts_dev, GCQMR, reg);
++ }
++ }
++ return IRQ_HANDLED;
++}
++
++static void mxc_tsadcc_4wire_config(struct mxc_tsadcc *ts_dev)
++{
++ unsigned long reg;
++ int lastitemid;
++
++ /* Level sense */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg |= CQCR_PD_CFG;
++ reg |= (0xf << CQCR_FIFOWATERMARK_SHIFT); /* watermark */
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ /* Configure 4-wire */
++ reg = TSC_4WIRE_PRECHARGE;
++ reg |= CC_IGS;
++ mxc_tsadcc_write(ts_dev, TCC0, reg);
++
++ reg = TSC_4WIRE_TOUCH_DETECT;
++ reg |= (TSC_NUM_SAMPLES - 1) << CC_NOS_SHIFT; /* 4 samples */
++ reg |= 32 << CC_SETTLING_TIME_SHIFT; /* it's important! */
++ mxc_tsadcc_write(ts_dev, TCC1, reg);
++
++ reg = TSC_4WIRE_X_MEASURE;
++ reg |= (TSC_NUM_SAMPLES - 1) << CC_NOS_SHIFT; /* 4 samples */
++ reg |= 16 << CC_SETTLING_TIME_SHIFT; /* settling time */
++ mxc_tsadcc_write(ts_dev, TCC2, reg);
++
++ reg = TSC_4WIRE_Y_MEASURE;
++ reg |= (TSC_NUM_SAMPLES - 1) << CC_NOS_SHIFT; /* 4 samples */
++ reg |= 16 << CC_SETTLING_TIME_SHIFT; /* settling time */
++ mxc_tsadcc_write(ts_dev, TCC3, reg);
++
++ reg = TSC_4WIRE_YN_MEASURE;
++ reg |= (TSC_NUM_SAMPLES - 1) << CC_NOS_SHIFT; /* 4 samples */
++ reg |= 16 << CC_SETTLING_TIME_SHIFT; /* settling time */
++ mxc_tsadcc_write(ts_dev, TCC4, reg);
++
++ reg = TSC_4WIRE_XP_MEASURE;
++ reg |= (TSC_NUM_SAMPLES - 1) << CC_NOS_SHIFT; /* 4 samples */
++ reg |= 16 << CC_SETTLING_TIME_SHIFT; /* settling time */
++ mxc_tsadcc_write(ts_dev, TCC5, reg);
++
++ reg = (TCQ_ITEM_TCC0 << CQ_ITEM0_SHIFT) |
++ (TCQ_ITEM_TCC1 << CQ_ITEM1_SHIFT) |
++ (TCQ_ITEM_TCC2 << CQ_ITEM2_SHIFT) |
++ (TCQ_ITEM_TCC3 << CQ_ITEM3_SHIFT) |
++ (TCQ_ITEM_TCC0 << CQ_ITEM4_SHIFT) |
++ (TCQ_ITEM_TCC1 << CQ_ITEM5_SHIFT);
++ mxc_tsadcc_write(ts_dev, TCQ_ITEM_7_0, reg);
++
++ lastitemid = 5;
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg = (reg & ~CQCR_LAST_ITEM_ID_MASK) |
++ (lastitemid << CQCR_LAST_ITEM_ID_SHIFT);
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++
++ /* pen down enable */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_PD_MSK;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++ reg = mxc_tsadcc_read(ts_dev, TCQMR);
++ reg &= ~CQMR_PD_IRQ_MSK;
++ mxc_tsadcc_write(ts_dev, TCQMR, reg);
++
++ /* Config idle for 4-wire */
++ reg = TSC_4WIRE_TOUCH_DETECT;
++ mxc_tsadcc_write(ts_dev, TICR, reg);
++
++ /* Pen interrupt starts new conversion queue */
++ reg = mxc_tsadcc_read(ts_dev, TCQCR);
++ reg &= ~CQCR_QSM_MASK;
++ reg |= CQCR_QSM_PEN;
++ mxc_tsadcc_write(ts_dev, TCQCR, reg);
++}
++
++static void mxc_tsadcc_config(struct platform_device *pdev)
++{
++ struct mxc_tsadcc *ts_dev = platform_get_drvdata(pdev);
++ struct mxc_tsadcc_pdata *pdata = pdev->dev.platform_data;
++ unsigned int tgcr;
++ unsigned int pdbt;
++ unsigned int pdben;
++ unsigned int intref;
++ unsigned int adc_clk = DEFAULT_ADC_CLOCK;
++ unsigned long ipg_clk;
++ unsigned int clkdiv;
++
++ if (pdata) {
++ pdbt = pdata->pen_debounce_time - 1;
++ pdben = pdata->pen_debounce_time > 0;
++ intref = !!pdata->intref;
++ if (pdata->adc_clk > 0) {
++ adc_clk = pdata->adc_clk;
++ }
++ ts_dev->r_xplate = pdata->r_xplate;
++ } else {
++ dev_dbg(&pdev->dev, "No platform_data; using defaults\n");
++ pdbt = TGCR_PDBTIME128;
++ pdben = 1;
++ intref = 1;
++ }
++ if (ts_dev->r_xplate == 0) {
++ ts_dev->r_xplate = DEFAULT_RX_VALUE;
++ DBG(0, "%s: Assuming default Rx value of %u Ohms\n",
++ __FUNCTION__, ts_dev->r_xplate);
++ }
++ ipg_clk = clk_get_rate(ts_dev->clk);
++ dev_info(&pdev->dev, "Master clock is: %lu.%06luMHz requested ADC clock: %u.%06uMHz\n",
++ ipg_clk / 1000000, ipg_clk % 1000000,
++ adc_clk / 1000000, adc_clk % 1000000);
++ /*
++ * adc_clk = ipg_clk / (2 * clkdiv + 2)
++ * The exact formula for the clock divider would be:
++ * clkdiv = ipg_clk / (2 * adc_clk) - 1
++ * but we drop the '- 1' due to integer truncation
++ * and to make sure the actual clock is always less or equal
++ * to the designated clock.
++ */
++ clkdiv = ipg_clk / (2 * adc_clk + 1);
++ if (clkdiv > 31) {
++ clkdiv = 31;
++ dev_warn(&pdev->dev,
++ "cannot accomodate designated clock of %u.%06uMHz; using %lu.%06luMHz\n",
++ adc_clk / 1000000, adc_clk % 1000000,
++ ipg_clk / (2 * clkdiv + 2) / 1000000,
++ ipg_clk / (2 * clkdiv + 2) % 1000000);
++ } else {
++ dev_dbg(&pdev->dev,
++ "clkdiv=%u actual ADC clock: %lu.%06luMHz\n",
++ clkdiv, ipg_clk / (2 * (clkdiv + 1)) / 1000000,
++ ipg_clk / (2 * clkdiv + 2) % 1000000);
++ }
++
++ tgcr = ((pdbt << TGCR_PDBTIME_SHIFT) & TGCR_PDBTIME_MASK) | /* pen debounce time */
++ (pdben * TGCR_PDB_EN) | /* pen debounce enable */
++ (intref * TGCR_INTREFEN) | /* pen debounce enable */
++ TGCR_POWER_SAVE | /* Switch TSC on */
++ TGCR_PD_EN | /* Enable Pen Detect */
++ ((clkdiv << TGCR_ADCCLKCFG_SHIFT) & TGCR_ADCCLKCFG_MASK);
++
++ /* reset TSC */
++ mxc_tsadcc_write(ts_dev, TGCR, TGCR_TSC_RST);
++ while (mxc_tsadcc_read(ts_dev, TGCR) & TGCR_TSC_RST) {
++ cpu_relax();
++ }
++ mxc_tsadcc_write(ts_dev, TGCR, tgcr);
++
++ mxc_tsadcc_4wire_config(ts_dev);
++ tsc_clk_enable(ts_dev);
++}
++
++static int __devinit mxc_tsadcc_probe(struct platform_device *pdev)
++{
++ int err;
++ struct mxc_tsadcc *ts_dev;
++ struct input_dev *input_dev;
++ struct resource *res;
++ int irq;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "No mmio resource defined\n");
++ return -ENODEV;
++ }
++
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0) {
++ dev_err(&pdev->dev, "No IRQ assigned\n");
++ return -ENODEV;
++ }
++
++ if (!request_mem_region(res->start, resource_size(res),
++ "mxc tsadcc regs")) {
++ return -EBUSY;
++ }
++
++ /* Allocate memory for device */
++ ts_dev = kzalloc(sizeof(struct mxc_tsadcc), GFP_KERNEL);
++ if (!ts_dev) {
++ dev_err(&pdev->dev, "Failed to allocate memory\n");
++ err = -ENOMEM;
++ goto err_release_mem;
++ }
++
++ /* allocate conversion buffers separately to prevent
++ * cacheline alignment issues when using DMA */
++ ts_dev->tsc_data = kzalloc(sizeof(struct mxc_tsadcc_tsc_data), GFP_KERNEL);
++ ts_dev->adc_data = kzalloc(sizeof(struct mxc_tsadcc_adc_data), GFP_KERNEL);
++ if (ts_dev->tsc_data == NULL || ts_dev->adc_data == NULL) {
++ err = -ENOMEM;
++ goto err_free_mem;
++ }
++ ts_dev->irq = irq;
++ INIT_WORK(&ts_dev->work, mxc_tsadcc_work);
++ mutex_init(&ts_dev->convert_mutex);
++ setup_timer(&ts_dev->timer, mxc_tsadcc_timer, (unsigned long)ts_dev);
++ init_waitqueue_head(&ts_dev->wq);
++
++ platform_set_drvdata(pdev, ts_dev);
++
++ input_dev = input_allocate_device();
++ if (!input_dev) {
++ dev_err(&pdev->dev, "Failed to allocate input device\n");
++ err = -ENOMEM;
++ goto err_free_mem;
++ }
++
++ ts_dev->reg_base = ioremap(res->start, resource_size(res));
++ if (!ts_dev->reg_base) {
++ dev_err(&pdev->dev, "Failed to map registers\n");
++ err = -ENOMEM;
++ goto err_free_dev;
++ }
++
++ err = request_irq(ts_dev->irq, mxc_tsadcc_interrupt, 0,
++ pdev->dev.driver->name, ts_dev);
++ if (err) {
++ dev_err(&pdev->dev, "Failed to install irq handler: %d\n", err);
++ goto err_unmap_regs;
++ }
++
++ ts_dev->clk = clk_get(&pdev->dev, NULL);
++ if (IS_ERR(ts_dev->clk)) {
++ dev_err(&pdev->dev, "Failed to get ts_clk\n");
++ err = PTR_ERR(ts_dev->clk);
++ goto err_free_irq;
++ }
++
++ ts_dev->input = input_dev;
++
++ snprintf(ts_dev->phys, sizeof(ts_dev->phys),
++ "%s/input0", dev_name(&pdev->dev));
++
++ input_dev->name = "mxc touch screen controller";
++ input_dev->phys = ts_dev->phys;
++ input_dev->dev.parent = &pdev->dev;
++
++ input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
++ input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
++ input_dev->absbit[0] = BIT_MASK(ABS_X) |
++ BIT_MASK(ABS_Y) |
++ BIT_MASK(ABS_PRESSURE);
++
++ input_set_abs_params(input_dev, ABS_X, 0, 0xFFF, 0, 0);
++ input_set_abs_params(input_dev, ABS_Y, 0, 0xFFF, 0, 0);
++ input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xFFF, 0, 0);
++
++ mxc_tsadcc_config(pdev);
++
++ /* All went ok, so register to the input system */
++ err = input_register_device(input_dev);
++ if (err)
++ goto err_fail;
++
++ err = sysfs_create_group(&pdev->dev.kobj, &mxc_tsadcc_attr_group);
++ if (err) {
++ dev_warn(&pdev->dev, "Failed to create sysfs attributes: %d\n",
++ err);
++ }
++ ts_dev->attrs = !err;
++
++ return 0;
++
++err_fail:
++ clk_disable(ts_dev->clk);
++ clk_put(ts_dev->clk);
++err_free_irq:
++ free_irq(ts_dev->irq, ts_dev);
++err_unmap_regs:
++ iounmap(ts_dev->reg_base);
++err_free_dev:
++ input_free_device(ts_dev->input);
++err_free_mem:
++ kfree(ts_dev->tsc_data);
++ kfree(ts_dev->adc_data);
++ kfree(ts_dev);
++err_release_mem:
++ release_mem_region(res->start, resource_size(res));
++ return err;
++}
++
++static int __devexit mxc_tsadcc_remove(struct platform_device *pdev)
++{
++ struct mxc_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
++ struct resource *res;
++
++ if (ts_dev->attrs) {
++ DBG(0, "%s: Removing sysfs attributes\n", __FUNCTION__);
++ sysfs_remove_group(&pdev->dev.kobj, &mxc_tsadcc_attr_group);
++ }
++ del_timer_sync(&ts_dev->timer);
++ input_unregister_device(ts_dev->input);
++
++ clk_disable(ts_dev->clk);
++ clk_put(ts_dev->clk);
++
++ free_irq(ts_dev->irq, ts_dev);
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ iounmap(ts_dev->reg_base);
++ release_mem_region(res->start, resource_size(res));
++
++ kfree(ts_dev->tsc_data);
++ kfree(ts_dev->adc_data);
++ kfree(ts_dev);
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int mxc_tsadcc_suspend(struct platform_device *pdev, pm_message_t msg)
++{
++ struct mxc_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
++
++ if (ts_dev->clk_enabled) {
++ tsc_clk_disable(ts_dev);
++ ts_dev->clk_enabled = 1;
++ }
++ return 0;
++}
++
++static int mxc_tsadcc_resume(struct platform_device *pdev)
++{
++ struct mxc_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
++
++ if (ts_dev->clk_enabled) {
++ ts_dev->clk_enabled = 0;
++ tsc_clk_enable(ts_dev);
++ }
++ return 0;
++}
++#else
++#define mxc_tsadcc_suspend NULL
++#define mxc_tsadcc_resume NULL
++#endif
++
++static struct platform_driver mxc_tsadcc_driver = {
++ .probe = mxc_tsadcc_probe,
++ .remove = __devexit_p(mxc_tsadcc_remove),
++ .suspend = mxc_tsadcc_suspend,
++ .resume = mxc_tsadcc_resume,
++ .driver = {
++ .name = "mxc-tsadcc",
++ },
++};
++
++static int __init mxc_tsadcc_init(void)
++{
++ return platform_driver_register(&mxc_tsadcc_driver);
++}
++
++static void __exit mxc_tsadcc_exit(void)
++{
++ platform_driver_unregister(&mxc_tsadcc_driver);
++}
++
++module_init(mxc_tsadcc_init);
++module_exit(mxc_tsadcc_exit);
++
++
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION("i.MX25 TouchScreen Driver");
++MODULE_AUTHOR("Lothar Wassmann <LW@KARO-electronics.de>");
++
+diff -purN linux-2.6.30-rc4-git/drivers/input/touchscreen/mxc_tsadcc.h linux-2.6.30-rc4-karo3/drivers/input/touchscreen/mxc_tsadcc.h
+--- linux-2.6.30-rc4-git/drivers/input/touchscreen/mxc_tsadcc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/drivers/input/touchscreen/mxc_tsadcc.h 2009-07-01 11:27:51.000000000 +0200
+@@ -0,0 +1,243 @@
++/*
++ * Freescale i.MX25 Touch Screen Driver
++ *
++ * Copyright (c) 2009 Lothar Wassmann <LW@KARO-electronics.de>
++ *
++ * Based on code from Freescale BSP
++ *
++ * 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.
++ */
++
++/* TSC General Config Register */
++#define TGCR 0x000
++#define TGCR_IPG_CLK_EN (1 << 0)
++#define TGCR_TSC_RST (1 << 1)
++#define TGCR_FUNC_RST (1 << 2)
++#define TGCR_SLPC (1 << 4)
++#define TGCR_STLC (1 << 5)
++#define TGCR_HSYNC_EN (1 << 6)
++#define TGCR_HSYNC_POL (1 << 7)
++#define TGCR_POWERMODE_SHIFT 8
++#define TGCR_POWER_OFF (0x0 << TGCR_POWERMODE_SHIFT)
++#define TGCR_POWER_SAVE (0x1 << TGCR_POWERMODE_SHIFT)
++#define TGCR_POWER_ON (0x3 << TGCR_POWERMODE_SHIFT)
++#define TGCR_POWER_MASK (0x3 << TGCR_POWERMODE_SHIFT)
++#define TGCR_INTREFEN (1 << 10)
++#define TGCR_ADCCLKCFG_SHIFT 16
++#define TGCR_ADCCLKCFG_MASK (0x1f << TGCR_ADCCLKCFG_SHIFT)
++#define TGCR_PD_EN (1 << 23)
++#define TGCR_PDB_EN (1 << 24)
++#define TGCR_PDBTIME_SHIFT 25
++#define TGCR_PDBTIME128 (0x3f << TGCR_PDBTIME_SHIFT)
++#define TGCR_PDBTIME_MASK (0x7f << TGCR_PDBTIME_SHIFT)
++
++/* TSC General Status Register */
++#define TGSR 0x004
++#define TGSR_TCQ_INT (1 << 0)
++#define TGSR_GCQ_INT (1 << 1)
++#define TGSR_SLP_INT (1 << 2)
++#define TGSR_TCQ_DMA (1 << 16)
++#define TGSR_GCQ_DMA (1 << 17)
++
++/* TSC IDLE Config Register */
++#define TICR 0x008
++
++/* TouchScreen Convert Queue FIFO Register */
++#define TCQFIFO 0x400
++/* TouchScreen Convert Queue Control Register */
++#define TCQCR 0x404
++#define CQCR_QSM_SHIFT 0
++#define CQCR_QSM_STOP (0x0 << CQCR_QSM_SHIFT)
++#define CQCR_QSM_PEN (0x1 << CQCR_QSM_SHIFT)
++#define CQCR_QSM_FQS (0x2 << CQCR_QSM_SHIFT)
++#define CQCR_QSM_FQS_PEN (0x3 << CQCR_QSM_SHIFT)
++#define CQCR_QSM_MASK (0x3 << CQCR_QSM_SHIFT)
++#define CQCR_FQS (1 << 2)
++#define CQCR_RPT (1 << 3)
++#define CQCR_LAST_ITEM_ID_SHIFT 4
++#define CQCR_LAST_ITEM_ID_MASK (0xf << CQCR_LAST_ITEM_ID_SHIFT)
++#define CQCR_FIFOWATERMARK_SHIFT 8
++#define CQCR_FIFOWATERMARK_MASK (0xf << CQCR_FIFOWATERMARK_SHIFT)
++#define CQCR_REPEATWAIT_SHIFT 12
++#define CQCR_REPEATWAIT_MASK (0xf << CQCR_REPEATWAIT_SHIFT)
++#define CQCR_QRST (1 << 16)
++#define CQCR_FRST (1 << 17)
++#define CQCR_PD_MSK (1 << 18)
++#define CQCR_PD_CFG (1 << 19)
++
++/* TouchScreen Convert Queue Status Register */
++#define TCQSR 0x408
++#define CQSR_PD (1 << 0)
++#define CQSR_EOQ (1 << 1)
++#define CQSR_FOR (1 << 4)
++#define CQSR_FUR (1 << 5)
++#define CQSR_FER (1 << 6)
++#define CQSR_EMPT (1 << 13)
++#define CQSR_FULL (1 << 14)
++#define CQSR_FDRY (1 << 15)
++
++/* TouchScreen Convert Queue Mask Register */
++#define TCQMR 0x40c
++#define CQMR_PD_IRQ_MSK (1 << 0)
++#define CQMR_EOQ_IRQ_MSK (1 << 1)
++#define CQMR_FOR_IRQ_MSK (1 << 4)
++#define CQMR_FUR_IRQ_MSK (1 << 5)
++#define CQMR_FER_IRQ_MSK (1 << 6)
++#define CQMR_PD_DMA_MSK (1 << 16)
++#define CQMR_EOQ_DMA_MSK (1 << 17)
++#define CQMR_FOR_DMA_MSK (1 << 20)
++#define CQMR_FUR_DMA_MSK (1 << 21)
++#define CQMR_FER_DMA_MSK (1 << 22)
++#define CQMR_FDRY_DMA_MSK (1 << 31)
++
++/* TouchScreen Convert Queue ITEM 7~0 */
++#define TCQ_ITEM_7_0 0x420
++
++/* TouchScreen Convert Queue ITEM 15~8 */
++#define TCQ_ITEM_15_8 0x424
++
++#define TCQ_ITEM_TCC0 0x0
++#define TCQ_ITEM_TCC1 0x1
++#define TCQ_ITEM_TCC2 0x2
++#define TCQ_ITEM_TCC3 0x3
++#define TCQ_ITEM_TCC4 0x4
++#define TCQ_ITEM_TCC5 0x5
++#define TCQ_ITEM_TCC6 0x6
++#define TCQ_ITEM_TCC7 0x7
++#define TCQ_ITEM_GCC7 0x8
++#define TCQ_ITEM_GCC6 0x9
++#define TCQ_ITEM_GCC5 0xa
++#define TCQ_ITEM_GCC4 0xb
++#define TCQ_ITEM_GCC3 0xc
++#define TCQ_ITEM_GCC2 0xd
++#define TCQ_ITEM_GCC1 0xe
++#define TCQ_ITEM_GCC0 0xf
++
++/* TouchScreen Convert Config 0-7 */
++#define TCC0 0x440
++#define TCC1 0x444
++#define TCC2 0x448
++#define TCC3 0x44c
++#define TCC4 0x450
++#define TCC5 0x454
++#define TCC6 0x458
++#define TCC7 0x45c
++#define CC_PEN_IACK (1 << 1)
++#define CC_SEL_REFN_SHIFT 2
++#define CC_SEL_REFN_YNLR (0x1 << CC_SEL_REFN_SHIFT)
++#define CC_SEL_REFN_AGND (0x2 << CC_SEL_REFN_SHIFT)
++#define CC_SEL_REFN_MASK (0x3 << CC_SEL_REFN_SHIFT)
++#define CC_SELIN_SHIFT 4
++#define CC_SELIN_XPUL (0x0 << CC_SELIN_SHIFT)
++#define CC_SELIN_YPLL (0x1 << CC_SELIN_SHIFT)
++#define CC_SELIN_XNUR (0x2 << CC_SELIN_SHIFT)
++#define CC_SELIN_YNLR (0x3 << CC_SELIN_SHIFT)
++#define CC_SELIN_WIPER (0x4 << CC_SELIN_SHIFT)
++#define CC_SELIN_INAUX0 (0x5 << CC_SELIN_SHIFT)
++#define CC_SELIN_INAUX1 (0x6 << CC_SELIN_SHIFT)
++#define CC_SELIN_INAUX2 (0x7 << CC_SELIN_SHIFT)
++#define CC_SELIN_MASK (0x7 << CC_SELIN_SHIFT)
++#define CC_SELREFP_SHIFT 7
++#define CC_SELREFP_YPLL (0x0 << CC_SELREFP_SHIFT)
++#define CC_SELREFP_XPUL (0x1 << CC_SELREFP_SHIFT)
++#define CC_SELREFP_EXT (0x2 << CC_SELREFP_SHIFT)
++#define CC_SELREFP_INT (0x3 << CC_SELREFP_SHIFT)
++#define CC_SELREFP_MASK (0x3 << CC_SELREFP_SHIFT)
++#define CC_XPULSW (1 << 9)
++#define CC_XNURSW_SHIFT 10
++#define CC_XNURSW_HIGH (0x0 << CC_XNURSW_SHIFT)
++#define CC_XNURSW_OFF (0x1 << CC_XNURSW_SHIFT)
++#define CC_XNURSW_LOW (0x3 << CC_XNURSW_SHIFT)
++#define CC_XNURSW_MASK (0x3 << CC_XNURSW_SHIFT)
++#define CC_YPLLSW_SHIFT 12
++#define CC_YPLLSW_HIGH (0x0 << CC_YPLLSW_SHIFT)
++#define CC_YPLLSW_OFF (0x1 << CC_YPLLSW_SHIFT)
++#define CC_YPLLSW_LOW (0x3 << CC_YPLLSW_SHIFT)
++#define CC_YPLLSW_MASK (0x3 << CC_YPLLSW_SHIFT)
++#define CC_YNLRSW (1 << 14)
++#define CC_WIPERSW (1 << 15)
++#define CC_NOS_SHIFT 16
++#define CC_NOS_MASK (0xf << CC_NOS_SHIFT)
++#define CC_IGS (1 << 20)
++#define CC_SETTLING_TIME_SHIFT 24
++#define CC_SETTLING_TIME_MASK (0xff << CC_SETTLING_TIME_SHIFT)
++
++#define TSC_4WIRE_PRECHARGE 0x158c
++#define TSC_4WIRE_TOUCH_DETECT 0x578e
++
++#define TSC_4WIRE_X_MEASURE 0x1c90
++#define TSC_4WIRE_Y_MEASURE 0x4604
++#define TSC_4WIRE_XP_MEASURE 0x0f8c
++#define TSC_4WIRE_YN_MEASURE 0x0fbc
++
++#define TSC_GENERAL_ADC_GCC0 0x17dc
++#define TSC_GENERAL_ADC_GCC1 0x17ec
++#define TSC_GENERAL_ADC_GCC2 0x17fc
++
++/* GeneralADC Convert Queue FIFO Register */
++#define GCQFIFO 0x800
++#define GCQFIFO_ADCOUT_SHIFT 4
++#define GCQFIFO_ADCOUT_MASK (0xfff << GCQFIFO_ADCOUT_SHIFT)
++
++/* GeneralADC Convert Queue Control Register */
++#define GCQCR 0x804
++
++/* GeneralADC Convert Queue Status Register */
++#define GCQSR 0x808
++
++/* GeneralADC Convert Queue Mask Register */
++#define GCQMR 0x80c
++
++/* GeneralADC Convert Queue ITEM 7~0 */
++#define GCQ_ITEM_7_0 0x820
++
++/* GeneralADC Convert Queue ITEM 15~8 */
++#define GCQ_ITEM_15_8 0x824
++
++#define CQ_ITEM7_SHIFT 28
++#define CQ_ITEM6_SHIFT 24
++#define CQ_ITEM5_SHIFT 20
++#define CQ_ITEM4_SHIFT 16
++#define CQ_ITEM3_SHIFT 12
++#define CQ_ITEM2_SHIFT 8
++#define CQ_ITEM1_SHIFT 4
++#define CQ_ITEM0_SHIFT 0
++
++#define CQ_ITEM8_SHIFT 28
++#define CQ_ITEM9_SHIFT 24
++#define CQ_ITEM10_SHIFT 20
++#define CQ_ITEM11_SHIFT 16
++#define CQ_ITEM12_SHIFT 12
++#define CQ_ITEM13_SHIFT 8
++#define CQ_ITEM14_SHIFT 4
++#define CQ_ITEM15_SHIFT 0
++
++#define GCQ_ITEM_GCC0 0x0
++#define GCQ_ITEM_GCC1 0x1
++#define GCQ_ITEM_GCC2 0x2
++#define GCQ_ITEM_GCC3 0x3
++
++/* GeneralADC Convert Config 0-7 */
++#define GCC0 0x840
++#define GCC1 0x844
++#define GCC2 0x848
++#define GCC3 0x84c
++#define GCC4 0x850
++#define GCC5 0x854
++#define GCC6 0x858
++#define GCC7 0x85c
++
++/* TSC Test Register R/W */
++#define TTR 0xc00
++/* TSC Monitor Register 1, 2 */
++#define MNT1 0xc04
++#define MNT2 0xc04
++
++#define DETECT_ITEM_ID_1 1
++#define DETECT_ITEM_ID_2 5
++#define TS_X_ITEM_ID 2
++#define TS_Y_ITEM_ID 3
++#define TSI_DATA 1
++#define FQS_DATA 0
+diff -purN linux-2.6.30-rc4-git/drivers/leds/leds-gpio.c linux-2.6.30-rc4-karo3/drivers/leds/leds-gpio.c
+--- linux-2.6.30-rc4-git/drivers/leds/leds-gpio.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/leds/leds-gpio.c 2009-06-02 18:36:36.000000000 +0200
@@ -82,7 +82,7 @@ static int __devinit create_gpio_led(con
if (!gpio_is_valid(template->gpio)) {
printk(KERN_INFO "Skipping unavilable LED gpio %d (%s)\n",
@@ -10681,9 +10927,9 @@ diff -urNp linux-2.6.30-rc4/drivers/leds/leds-gpio.c linux-2.6.30-rc4-karo/drive
}
ret = gpio_request(template->gpio, template->name);
-diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/Kconfig linux-2.6.30-rc4-karo/drivers/mtd/nand/Kconfig
---- linux-2.6.30-rc4/drivers/mtd/nand/Kconfig 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/mtd/nand/Kconfig 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/drivers/mtd/nand/Kconfig linux-2.6.30-rc4-karo3/drivers/mtd/nand/Kconfig
+--- linux-2.6.30-rc4-git/drivers/mtd/nand/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/mtd/nand/Kconfig 2009-06-02 18:42:05.000000000 +0200
@@ -420,6 +420,27 @@ config MTD_NAND_MXC
This enables the driver for the NAND flash controller on the
MXC processors.
@@ -10712,32 +10958,18 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/Kconfig linux-2.6.30-rc4-karo/drive
config MTD_NAND_SH_FLCTL
tristate "Support for NAND on Renesas SuperH FLCTL"
depends on MTD_NAND && SUPERH && CPU_SUBTYPE_SH7723
-diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/Makefile linux-2.6.30-rc4-karo/drivers/mtd/nand/Makefile
---- linux-2.6.30-rc4/drivers/mtd/nand/Makefile 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/mtd/nand/Makefile 2009-06-02 17:05:27.000000000 +0200
-@@ -36,7 +36,13 @@ obj-$(CONFIG_MTD_NAND_ORION) += orion_n
- obj-$(CONFIG_MTD_NAND_FSL_ELBC) += fsl_elbc_nand.o
- obj-$(CONFIG_MTD_NAND_FSL_UPM) += fsl_upm.o
- obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o
-+ifneq ($(CONFIG_ARCH_MXC_HAS_NFC_V1),)
- obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
-+else
-+ifneq ($(CONFIG_ARCH_MXC_HAS_NFC_V2),)
-+obj-$(CONFIG_MTD_NAND_MXC) += mxc_nd2.o
-+endif
-+endif
- obj-$(CONFIG_MTD_NAND_SOCRATES) += socrates_nand.o
- obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o
+diff -purN linux-2.6.30-rc4-git/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo3/drivers/mtd/nand/mxc_nand.c
+--- linux-2.6.30-rc4-git/drivers/mtd/nand/mxc_nand.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/mtd/nand/mxc_nand.c 2009-07-14 14:10:27.000000000 +0200
+@@ -32,25 +32,58 @@
+ #include <linux/io.h>
-diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nand.c
---- linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nand.c 2009-06-02 17:05:27.000000000 +0200
-@@ -34,23 +34,52 @@
#include <asm/mach/flash.h>
++#include <mach/hardware.h>
#include <mach/mxc_nand.h>
+#ifdef CONFIG_MTD_DEBUG
-+static int debug = 3;
++static int debug;
+module_param(debug, int, S_IRUGO | S_IWUSR);
+
+#define dbg_lvl(n) ((n) < debug)
@@ -10776,12 +11008,15 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+#define NFC_FLASH_CMD 0x008
+#define NFC_CONFIG 0x00A
+#define NFC_ECC_STATUS_RESULT 0x00C
-+#define NFC_RSLTMAIN_AREA 0x00E
-+#define NFC_RSLTSPARE_AREA 0x010
+#define NFC_WRPROT 0x012
+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1
++#define NFC_RSLTMAIN_AREA 0x00E
++#define NFC_RSLTSPARE_AREA 0x010
+#define NFC_UNLOCKSTART_BLKADDR 0x014
+#define NFC_UNLOCKEND_BLKADDR 0x016
++#else
++#define NFC_ECC_STATUS_RESULT2 0x00E
++#define NFC_SPAS 0x010
+#endif
+#define NFC_NF_WRPRST 0x018
+#define NFC_CONFIG1 0x01A
@@ -10799,7 +11034,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
/* Addresses for NFC RAM BUFFER Main area 0 */
#define MAIN_AREA0 0x000
-@@ -59,10 +88,27 @@
+@@ -59,10 +92,27 @@
#define MAIN_AREA3 0x600
/* Addresses for NFC SPARE BUFFER Spare area 0 */
@@ -10827,7 +11062,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
/* Set INT to 0, FCMD to 1, rest to 0 in NFC_CONFIG2 Register
* for Command operation */
-@@ -107,6 +153,7 @@ struct mxc_nand_host {
+@@ -107,10 +157,12 @@ struct mxc_nand_host {
struct device *dev;
void __iomem *regs;
@@ -10835,38 +11070,43 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
int spare_only;
int status_request;
int pagesize_2k;
-@@ -128,32 +175,149 @@ struct mxc_nand_host {
- #define MAIN_SINGLEBIT_ERROR 0x4
- #define SPARE_SINGLEBIT_ERROR 0x1
+ uint16_t col_addr;
++ unsigned int page_addr;
+ struct clk *clk;
+ int clk_act;
+ int irq;
+@@ -120,40 +172,134 @@ struct mxc_nand_host {
+
+ /* Define delays in microsec for NAND device operations */
+ #define TROP_US_DELAY 2000
+-/* Macros to get byte and bit positions of ECC */
+-#define COLPOS(x) ((x) >> 3)
+-#define BITPOS(x) ((x) & 0xf)
+-
+-/* Define single bit Error positions in Main & Spare area */
+-#define MAIN_SINGLEBIT_ERROR 0x4
+-#define SPARE_SINGLEBIT_ERROR 0x1
+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1
/* OOB placement block for use with hardware ecc generation */
+static struct nand_ecclayout nand_hw_eccoob2k_8 = {
-+ .eccbytes = 5,
-+ .eccpos = {6, 7, 8, 9, 10},
-+ .oobfree = {{0, 5}, {11, 11}, {27, 11}, {43, 5}}
++ .eccbytes = 20,
++ .eccpos = {
++ 6, 7, 8, 9, 10,
++ 22, 23, 24, 25, 26,
++ 38, 39, 40, 41, 42,
++ 54, 55, 56, 57, 58,
++ },
++ .oobfree = {{2, 4}, {11, 11}, {27, 11}, {43, 11}, {59, 5}},
+};
+
static struct nand_ecclayout nand_hw_eccoob_8 = {
.eccbytes = 5,
- .eccpos = {6, 7, 8, 9, 10},
+- .eccpos = {6, 7, 8, 9, 10},
- .oobfree = {{0, 5}, {11, 5}, }
-+ .oobfree = {{0, 5}, {11, 5}}
-+};
-+
-+static struct nand_ecclayout nand_hw_eccoob2k_16 = {
-+ .eccbytes = 5,
-+ .eccpos = {6, 7, 8, 9, 10},
-+ .oobfree = {{0, 6}, {12, 10}, {28, 10}, {44, 4}}
- };
-
- static struct nand_ecclayout nand_hw_eccoob_16 = {
- .eccbytes = 5,
- .eccpos = {6, 7, 8, 9, 10},
-- .oobfree = {{0, 6}, {12, 4}, }
-+ .oobfree = {{0, 6}, {12, 4}}
++ .eccpos = { 6, 7, 8, 9, 10 },
++ .oobfree = {{0, 6}, {11, 5}}
+};
-+
+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT
+static u8 bbt_pattern[] = {'B', 'b', 't', '0' };
+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' };
@@ -10879,8 +11119,12 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ .veroffs = 11,
+ .maxblocks = 4,
+ .pattern = bbt_pattern,
-+};
-+
+ };
+
+-static struct nand_ecclayout nand_hw_eccoob_16 = {
+- .eccbytes = 5,
+- .eccpos = {6, 7, 8, 9, 10},
+- .oobfree = {{0, 6}, {12, 4}, }
+static struct nand_bbt_descr bbt_mirror_descr = {
+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE |
+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP),
@@ -10896,29 +11140,22 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ * OOB placement block for use with hardware ecc generation
+ */
+static struct nand_ecclayout nand_hw_eccoob2k_8 = {
-+ .eccbytes = 9,
-+ .eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
-+ .oobfree = {{0, 7}, {16, 7}, {32, 7}, {48, 7}},
++ .eccbytes = 36,
++ .eccpos = {
++ 7, 8, 9, 10, 11, 12, 13, 14, 15,
++ 23, 24, 25, 26, 27, 28, 29, 30, 31,
++ 39, 40, 41, 42, 43, 44, 45, 46, 47,
++ 55, 56, 57, 58, 59, 60, 61, 62, 63,
++ },
++ .oobfree = {{2, 5}, {16, 7}, {32, 7}, {48, 7}},
+};
+
+static struct nand_ecclayout nand_hw_eccoob_8 = {
+ .eccbytes = 9,
-+ .eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
++ .eccpos = { 7, 8, 9, 10, 11, 12, 13, 14, 15, },
+ .oobfree = {{0, 4}},
+};
+
-+static struct nand_ecclayout nand_hw_eccoob2k_16 = {
-+ .eccbytes = 9,
-+ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14},
-+ .oobfree = {{0, 6}, {17, 6}, {33, 6}, {47, 6}},
- };
-
-+static struct nand_ecclayout nand_hw_eccoob_16 = {
-+ .eccbytes = 9,
-+ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14},
-+ .oobfree = {{0, 3}}
-+};
-+
+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT
+/* Generic flash bbt decriptors
+*/
@@ -10933,8 +11170,8 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ .veroffs = 4,
+ .maxblocks = 4,
+ .pattern = bbt_pattern
-+};
-+
+ };
+
+static struct nand_bbt_descr bbt_mirror_descr = {
+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
@@ -10976,11 +11213,11 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
static irqreturn_t mxc_nfc_irq(int irq, void *dev_id)
{
struct mxc_nand_host *host = dev_id;
-
+-
uint16_t tmp;
- tmp = readw(host->regs + NFC_CONFIG1);
-+ DEBUG(MTD_DEBUG_LEVEL0, "%s(%d)\n", __FUNCTION__, irq);
++ DEBUG(MTD_DEBUG_LEVEL3, "%s(%d)\n", __FUNCTION__, irq);
+
+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
tmp |= NFC_INT_MSK; /* Disable interrupt */
@@ -10989,14 +11226,12 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
wake_up(&host->irq_waitq);
-@@ -166,36 +330,31 @@ static irqreturn_t mxc_nfc_irq(int irq,
+@@ -166,35 +312,29 @@ static irqreturn_t mxc_nfc_irq(int irq,
static void wait_op_done(struct mxc_nand_host *host, int max_retries,
uint16_t param, int useirq)
{
- uint32_t tmp;
-+ uint32_t nfc_stat;
-
-+ nfc_stat = nfc_read_reg(host->regs, NFC_CONFIG2);
+-
if (useirq) {
- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) {
-
@@ -11010,18 +11245,17 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- tmp = readw(host->regs + NFC_CONFIG2);
- tmp &= ~NFC_INT;
- writew(tmp, host->regs + NFC_CONFIG2);
-+ if (!(nfc_stat & NFC_INT)) {
++ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) {
+ uint32_t cfg1;
-+ const unsigned long timeout = 10;
++ const unsigned long timeout = max_retries;
+
+ cfg1 = nfc_read_reg(host->regs, NFC_CONFIG1);
+ cfg1 &= ~NFC_INT_MSK; /* Enable interrupt */
+ nfc_write_reg(cfg1, host->regs, NFC_CONFIG1);
+
+ max_retries = wait_event_timeout(host->irq_waitq,
-+ (nfc_stat = nfc_read_reg(host->regs,
-+ NFC_CONFIG2)) & NFC_INT,
-+ timeout);
++ nfc_read_reg(host->regs, NFC_CONFIG2) &
++ NFC_INT, timeout);
}
} else {
- while (max_retries-- > 0) {
@@ -11031,43 +11265,91 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- writew(tmp, host->regs + NFC_CONFIG2);
- break;
- }
-+ while (!(nfc_stat & NFC_INT) && max_retries-- > 0) {
-+ nfc_stat = nfc_read_reg(host->regs, NFC_CONFIG2);
++ while (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT) &&
++ max_retries-- > 0) {
udelay(1);
}
- if (max_retries <= 0)
- DEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n",
- __func__, param);
++ }
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2) & ~NFC_INT);
++ nfc_write_reg(0, host->regs, NFC_CONFIG2);
++ if (WARN_ON(max_retries <= 0)) {
++ printk(KERN_ERR "%s(%d): INT not set\n", __func__, param);
}
-+ nfc_write_reg(nfc_stat & ~NFC_INT, host->regs, NFC_CONFIG2);
-+ WARN_ONCE(max_retries <= 0, "%s(%d): INT not set\n", __func__, param);
}
- /* This function issues the specified command to the NAND device and
-@@ -204,8 +363,8 @@ static void send_cmd(struct mxc_nand_hos
+@@ -204,8 +344,9 @@ static void send_cmd(struct mxc_nand_hos
{
DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(host, 0x%x, %d)\n", cmd, useirq);
- writew(cmd, host->regs + NFC_FLASH_CMD);
- writew(NFC_CMD, host->regs + NFC_CONFIG2);
+ nfc_write_reg(cmd, host->regs, NFC_FLASH_CMD);
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
+ nfc_write_reg(NFC_CMD, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, cmd, useirq);
-@@ -218,8 +377,8 @@ static void send_addr(struct mxc_nand_ho
+@@ -218,34 +359,72 @@ static void send_addr(struct mxc_nand_ho
{
DEBUG(MTD_DEBUG_LEVEL3, "send_addr(host, 0x%x %d)\n", addr, islast);
- writew(addr, host->regs + NFC_FLASH_ADDR);
- writew(NFC_ADDR, host->regs + NFC_CONFIG2);
+ nfc_write_reg(addr, host->regs, NFC_FLASH_ADDR);
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
+ nfc_write_reg(NFC_ADDR, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, addr, islast);
-@@ -233,19 +392,19 @@ static void send_prog_page(struct mxc_na
- DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only);
+ }
+
++static inline void nfc_buf_read(const void __iomem *nfc, void *buf, int len)
++{
++ u32 *wp = buf;
++ int i;
++
++ BUG_ON((unsigned long)nfc & 3);
++ BUG_ON((unsigned long)buf & 3);
++
++ for (i = 0; i < len; i += sizeof(long)) {
++ wp[i >> 2] = readl(nfc + i);
++ }
++}
++
++static inline void nfc_buf_write(void __iomem *nfc, const void *buf, int len)
++{
++ const u32 *rp = buf;
++ int i;
++
++ BUG_ON((unsigned long)nfc & 3);
++ BUG_ON((unsigned long)buf & 3);
++
++ for (i = 0; i < len; i += sizeof(long)) {
++ writel(rp[i >> 2], nfc + i);
++ }
++}
++
+ /* This function requests the NANDFC to initate the transfer
+ * of data currently in the NANDFC RAM buffer to the NAND device. */
+ static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id,
+ int spare_only)
+ {
+- DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only);
++ int i;
++
++ if (spare_only)
++ DEBUG(MTD_DEBUG_LEVEL1, "send_prog_page (%d)\n", spare_only);
++ if (cpu_is_mx25()) {
++ for (i = 0; i < 4; i++) {
++ void __iomem *src = host->nfc_buf + SPARE_AREA0 + i * 16;
++ void __iomem *dst = host->nfc_buf + SPARE_AREA0 + i * 64;
++
++ memcpy(dst, src, 16);
++ }
++ }
/* NANDFC buffer 0 is used for page read/write */
- writew(buf_id, host->regs + NFC_BUF_ADDR);
@@ -11080,17 +11362,24 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
if (spare_only)
config1 |= NFC_SP_EN;
else
- config1 &= ~(NFC_SP_EN);
+- config1 &= ~(NFC_SP_EN);
- writew(config1, host->regs + NFC_CONFIG1);
++ config1 &= ~NFC_SP_EN;
+ nfc_write_reg(config1, host->regs, NFC_CONFIG1);
}
-
+-
- writew(NFC_INPUT, host->regs + NFC_CONFIG2);
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
+ nfc_write_reg(NFC_INPUT, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, spare_only, true);
-@@ -259,19 +418,19 @@ static void send_read_page(struct mxc_na
+@@ -256,25 +435,37 @@ static void send_prog_page(struct mxc_na
+ static void send_read_page(struct mxc_nand_host *host, uint8_t buf_id,
+ int spare_only)
+ {
++ int i;
++
DEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only);
/* NANDFC buffer 0 is used for page read/write */
@@ -11110,18 +11399,31 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
}
- writew(NFC_OUTPUT, host->regs + NFC_CONFIG2);
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
+ nfc_write_reg(NFC_OUTPUT, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, spare_only, true);
-@@ -284,20 +443,20 @@ static void send_read_id(struct mxc_nand
++ if (!cpu_is_mx25())
++ return;
++
++ for (i = 0; i < 4; i++) {
++ void __iomem *src = host->nfc_buf + SPARE_AREA0 + i * 64;
++ void __iomem *dst = host->nfc_buf + SPARE_AREA0 + i * 16;
++
++ memcpy(dst, src, 16);
++ }
+ }
+
+ /* Request the NANDFC to perform a read of the NAND device ID. */
+@@ -284,20 +475,23 @@ static void send_read_id(struct mxc_nand
uint16_t tmp;
/* NANDFC buffer 0 is used for device ID output */
- writew(0x0, host->regs + NFC_BUF_ADDR);
+ nfc_write_reg(0x0, host->regs, NFC_BUF_ADDR);
- /* Read ID into main buffer */
+- /* Read ID into main buffer */
- tmp = readw(host->regs + NFC_CONFIG1);
+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
tmp &= ~NFC_SP_EN;
@@ -11129,6 +11431,8 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
- writew(NFC_ID, host->regs + NFC_CONFIG2);
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
++ /* Read ID into main buffer */
+ nfc_write_reg(NFC_ID, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
@@ -11136,28 +11440,29 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
if (this->options & NAND_BUSWIDTH_16) {
- void __iomem *main_buf = host->regs + MAIN_AREA0;
++ /* FIXME: This cannot work, because the NFC buffer
++ * cannot be accessed with byte accesses! */
+ void __iomem *main_buf = host->nfc_buf + MAIN_AREA0;
/* compress the ID info */
writeb(readb(main_buf + 2), main_buf + 1);
writeb(readb(main_buf + 4), main_buf + 2);
-@@ -311,29 +470,29 @@ static void send_read_id(struct mxc_nand
+@@ -311,32 +505,35 @@ static void send_read_id(struct mxc_nand
* NAND device status and returns the current status. */
static uint16_t get_dev_status(struct mxc_nand_host *host)
{
- void __iomem *main_buf = host->regs + MAIN_AREA1;
-+ void __iomem *main_buf = host->nfc_buf + MAIN_AREA0;
++ void __iomem *main_buf = host->nfc_buf + MAIN_AREA1;
uint32_t store;
uint16_t ret, tmp;
- /* Issue status request to NAND device */
+- /* Issue status request to NAND device */
- /* store the main area1 first word, later do recovery */
+ /* store the main area first word, later do recovery */
store = readl(main_buf);
-- /* NANDFC buffer 1 is used for device status to prevent
-+ /* NANDFC buffer 0 is used for device status to prevent
+ /* NANDFC buffer 1 is used for device status to prevent
* corruption of read/write buffer on status requests. */
- writew(1, host->regs + NFC_BUF_ADDR);
-+ nfc_write_reg(0, host->regs, NFC_BUF_ADDR);
++ nfc_write_reg(1, host->regs, NFC_BUF_ADDR);
/* Read status into main buffer */
- tmp = readw(host->regs + NFC_CONFIG1);
@@ -11167,6 +11472,8 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
- writew(NFC_STATUS, host->regs + NFC_CONFIG2);
++ /* Issue status request to NAND device */
++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2));
+ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2);
/* Wait for operation to complete */
@@ -11174,20 +11481,367 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
/* Status is placed in first word of main buffer */
- /* get status, then recovery area 1 data */
-+ /* get status, then recover area 0 data */
++ /* get status, then recover area 1 data */
ret = readw(main_buf);
writel(store, main_buf);
-@@ -369,7 +528,7 @@ static int mxc_nand_correct_data(struct
++ DEBUG(MTD_DEBUG_LEVEL2, "%s: status=%02x\n", __FUNCTION__, ret);
++
+ return ret;
+ }
+
+@@ -352,10 +549,290 @@ static int mxc_nand_dev_ready(struct mtd
+
+ static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode)
+ {
+- /*
+- * If HW ECC is enabled, we turn it on during init. There is
+- * no need to enable again here.
+- */
++ switch (mode) {
++ case NAND_ECC_WRITE:
++ DBG(0, "ECC_MODE=NAND_ECC_WRITE\n");
++ break;
++ case NAND_ECC_READSYN:
++ DBG(0, "ECC_MODE=NAND_ECC_READSYN\n");
++ break;
++ case NAND_ECC_READ:
++ DBG(0, "ECC_MODE=NAND_ECC_READ\n");
++ break;
++ default:
++ DBG(-1, "%s: Unknown ECC_MODE: %d\n", __FUNCTION__, mode);
++ }
++}
++
++static void _mxc_nand_enable_hwecc(struct mtd_info *mtd, int on)
++{
++ struct nand_chip *nand_chip = mtd->priv;
++ struct mxc_nand_host *host = nand_chip->priv;
++ uint16_t ecc = nfc_read_reg(host->regs, NFC_CONFIG1);
++
++ if (on) {
++ ecc |= NFC_ECC_EN;
++ } else {
++ ecc &= ~NFC_ECC_EN;
++ }
++ nfc_write_reg(ecc, host->regs, NFC_CONFIG1);
++}
++
++static int mxc_nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
++ int page, int sndcmd)
++{
++ struct mxc_nand_host *host = chip->priv;
++ uint8_t *buf = chip->oob_poi;
++ int length = mtd->oobsize;
++ int eccpitch = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
++ uint8_t *bufpoi = buf;
++ int i, toread;
++
++ DEBUG(MTD_DEBUG_LEVEL0, "%s: Reading OOB area of page %u to oob %p\n",
++ __FUNCTION__, host->page_addr, buf);
++
++ chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page);
++ for (i = 0; i < chip->ecc.steps; i++) {
++ toread = min_t(int, length, chip->ecc.prepad);
++ if (toread) {
++ chip->read_buf(mtd, bufpoi, toread);
++ bufpoi += toread;
++ length -= toread;
++ }
++ bufpoi += chip->ecc.bytes;
++ host->col_addr += chip->ecc.bytes;
++ length -= chip->ecc.bytes;
++
++ toread = min_t(int, length, chip->ecc.postpad);
++ if (toread) {
++ chip->read_buf(mtd, bufpoi, toread);
++ bufpoi += toread;
++ length -= toread;
++ }
++ }
++ if (length > 0)
++ chip->read_buf(mtd, bufpoi, length);
++
++ _mxc_nand_enable_hwecc(mtd, 0);
++ chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize + chip->ecc.prepad, page);
++ bufpoi = buf + chip->ecc.prepad;
++ length = mtd->oobsize - chip->ecc.prepad;
++ for (i = 0; i < chip->ecc.steps; i++) {
++ toread = min_t(int, length, chip->ecc.bytes);
++ chip->read_buf(mtd, bufpoi, toread);
++ bufpoi += eccpitch;
++ length -= eccpitch;
++ host->col_addr += chip->ecc.postpad + chip->ecc.prepad;
++ }
++ _mxc_nand_enable_hwecc(mtd, 1);
++ return 1;
++}
++
++static int mxc_nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
++ uint8_t *buf)
++{
++ struct mxc_nand_host *host = chip->priv;
++ int eccsize = chip->ecc.size;
++ int eccbytes = chip->ecc.bytes;
++ int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
++ uint8_t *oob = chip->oob_poi;
++ int steps, size;
++ int n;
++
++ _mxc_nand_enable_hwecc(mtd, 0);
++ chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, host->page_addr);
++
++ for (n = 0, steps = chip->ecc.steps; steps > 0; n++, steps--) {
++ host->col_addr = n * eccsize;
++ chip->read_buf(mtd, buf, eccsize);
++ buf += eccsize;
++
++ host->col_addr = mtd->writesize + n * eccpitch;
++ if (chip->ecc.prepad) {
++ chip->read_buf(mtd, oob, chip->ecc.prepad);
++ oob += chip->ecc.prepad;
++ }
++
++ chip->read_buf(mtd, oob, eccbytes);
++ oob += eccbytes;
++
++ if (chip->ecc.postpad) {
++ chip->read_buf(mtd, oob, chip->ecc.postpad);
++ oob += chip->ecc.postpad;
++ }
++ }
++
++ size = mtd->oobsize - (oob - chip->oob_poi);
++ if (size)
++ chip->read_buf(mtd, oob, size);
++ _mxc_nand_enable_hwecc(mtd, 0);
++
++ return 0;
++}
++
++static int mxc_nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
++ uint8_t *buf)
++{
++ struct mxc_nand_host *host = chip->priv;
++ int n, eccsize = chip->ecc.size;
++ int eccbytes = chip->ecc.bytes;
++ int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
++ int eccsteps = chip->ecc.steps;
++ uint8_t *p = buf;
++ uint8_t *oob = chip->oob_poi;
++
++ DEBUG(MTD_DEBUG_LEVEL1, "%s: Reading page %u to buf %p oob %p\n", __FUNCTION__,
++ host->page_addr, buf, oob);
++
++ /* first read out the data area and the available portion of OOB */
++ for (n = 0; eccsteps; n++, eccsteps--, p += eccsize) {
++ int stat;
++
++ host->col_addr = n * eccsize;
++
++ chip->read_buf(mtd, p, eccsize);
++
++ host->col_addr = mtd->writesize + n * eccpitch;
++
++ if (chip->ecc.prepad) {
++ chip->read_buf(mtd, oob, chip->ecc.prepad);
++ oob += chip->ecc.prepad;
++ }
++
++ stat = chip->ecc.correct(mtd, p, oob, NULL);
++
++ if (stat < 0)
++ mtd->ecc_stats.failed++;
++ else
++ mtd->ecc_stats.corrected += stat;
++ oob += eccbytes;
++
++ if (chip->ecc.postpad) {
++ chip->read_buf(mtd, oob, chip->ecc.postpad);
++ oob += chip->ecc.postpad;
++ }
++ }
++
++ /* Calculate remaining oob bytes */
++ n = mtd->oobsize - (oob - chip->oob_poi);
++ if (n)
++ chip->read_buf(mtd, oob, n);
++
++ /* Then switch ECC off and read the OOB area to get the ECC code */
++ _mxc_nand_enable_hwecc(mtd, 0);
++ chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, host->page_addr);
++ eccsteps = chip->ecc.steps;
++ oob = chip->oob_poi + chip->ecc.prepad;
++ for (n = 0; eccsteps; n++, eccsteps--, p += eccsize) {
++ host->col_addr = mtd->writesize + n * eccpitch + chip->ecc.prepad;
++ chip->read_buf(mtd, oob, eccbytes);
++ oob += eccbytes + chip->ecc.postpad;
++ }
++ _mxc_nand_enable_hwecc(mtd, 1);
++ return 0;
++}
++
++static int mxc_nand_write_oob_syndrome(struct mtd_info *mtd,
++ struct nand_chip *chip, int page)
++{
++ struct mxc_nand_host *host = chip->priv;
++ int eccpitch = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
++ int length = mtd->oobsize;
++ int i, len, status, steps = chip->ecc.steps;
++ const uint8_t *bufpoi = chip->oob_poi;
++
++ chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page);
++ for (i = 0; i < steps; i++) {
++ len = min_t(int, length, eccpitch);
++
++ chip->write_buf(mtd, bufpoi, len);
++ bufpoi += len;
++ length -= len;
++ host->col_addr += chip->ecc.prepad + chip->ecc.postpad;
++ }
++ if (length > 0)
++ chip->write_buf(mtd, bufpoi, length);
++
++ chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
++ status = chip->waitfunc(mtd, chip);
++ return status & NAND_STATUS_FAIL ? -EIO : 0;
++}
++
++static void mxc_nand_write_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
++ const uint8_t *buf)
++{
++ struct mxc_nand_host *host = chip->priv;
++ int eccsize = chip->ecc.size;
++ int eccbytes = chip->ecc.bytes;
++ int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
++ uint8_t *oob = chip->oob_poi;
++ int steps, size;
++ int n;
++
++ for (n = 0, steps = chip->ecc.steps; steps > 0; n++, steps--) {
++ host->col_addr = n * eccsize;
++ chip->write_buf(mtd, buf, eccsize);
++ buf += eccsize;
++
++ host->col_addr = mtd->writesize + n * eccpitch;
++
++ if (chip->ecc.prepad) {
++ chip->write_buf(mtd, oob, chip->ecc.prepad);
++ oob += chip->ecc.prepad;
++ }
++
++ host->col_addr += eccbytes;
++ oob += eccbytes;
++
++ if (chip->ecc.postpad) {
++ chip->write_buf(mtd, oob, chip->ecc.postpad);
++ oob += chip->ecc.postpad;
++ }
++ }
++
++ size = mtd->oobsize - (oob - chip->oob_poi);
++ if (size)
++ chip->write_buf(mtd, oob, size);
++}
++
++static void mxc_nand_write_page_syndrome(struct mtd_info *mtd,
++ struct nand_chip *chip, const uint8_t *buf)
++{
++ struct mxc_nand_host *host = chip->priv;
++ int i, n, eccsize = chip->ecc.size;
++ int eccbytes = chip->ecc.bytes;
++ int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
++ int eccsteps = chip->ecc.steps;
++ const uint8_t *p = buf;
++ uint8_t *oob = chip->oob_poi;
++
++ chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
++
++ for (i = n = 0; eccsteps; n++, eccsteps--, i += eccbytes, p += eccsize) {
++ host->col_addr = n * eccsize;
++
++ chip->write_buf(mtd, p, eccsize);
++
++ host->col_addr = mtd->writesize + n * eccpitch;
++
++ if (chip->ecc.prepad) {
++ chip->write_buf(mtd, oob, chip->ecc.prepad);
++ oob += chip->ecc.prepad;
++ }
++
++ chip->write_buf(mtd, oob, eccbytes);
++ oob += eccbytes;
++
++ if (chip->ecc.postpad) {
++ chip->write_buf(mtd, oob, chip->ecc.postpad);
++ oob += chip->ecc.postpad;
++ }
++ }
++
++ /* Calculate remaining oob bytes */
++ i = mtd->oobsize - (oob - chip->oob_poi);
++ if (i)
++ chip->write_buf(mtd, oob, i);
+ }
+
+ static int mxc_nand_correct_data(struct mtd_info *mtd, u_char *dat,
+@@ -363,18 +840,41 @@ static int mxc_nand_correct_data(struct
+ {
+ struct nand_chip *nand_chip = mtd->priv;
+ struct mxc_nand_host *host = nand_chip->priv;
++ uint16_t ecc_status = nfc_read_reg(host->regs, NFC_ECC_STATUS_RESULT);
+
+ /*
+ * 1-Bit errors are automatically corrected in HW. No need for
* additional correction. 2-Bit errors cannot be corrected by
* HW ECC, so we need to return failure
*/
- uint16_t ecc_status = readw(host->regs + NFC_ECC_STATUS_RESULT);
-+ uint16_t ecc_status = nfc_read_reg(host->regs, NFC_ECC_STATUS_RESULT);
+-
+- if (((ecc_status & 0x3) == 2) || ((ecc_status >> 2) == 2)) {
+- DEBUG(MTD_DEBUG_LEVEL0,
+- "MXC_NAND: HWECC uncorrectable 2-bit ECC error\n");
+- return -1;
++ if (!(nfc_read_reg(host->regs, NFC_CONFIG1) & NFC_ECC_EN)) {
++ DEBUG(MTD_DEBUG_LEVEL1, "%s: ECC turned off\n", __FUNCTION__);
++ return 0;
++ }
++
++ if (ecc_status)
++ DBG(ecc_status ? -1 : 0, "%s: ECC_STATUS=%04x\n", __FUNCTION__, ecc_status);
++
++ if (cpu_is_mx25()) {
++ int subpages = mtd->writesize / nand_chip->subpagesize;
++
++ do {
++ if ((ecc_status & 0xf) > 4) {
++ printk(KERN_ERR
++ "MXC_NAND: HWECC uncorrectable ECC error in page %u subpage %d\n",
++ host->page_addr,
++ mtd->writesize / nand_chip->subpagesize - subpages);
++ return -1;
++ }
++ ecc_status >>= 4;
++ subpages--;
++ } while (subpages > 0);
++ } else {
++ if (((ecc_status & 0x3) == 2) || ((ecc_status >> 2) == 2)) {
++ DEBUG(MTD_DEBUG_LEVEL0,
++ "MXC_NAND: HWECC uncorrectable 2-bit ECC error\n");
++ return -1;
++ }
+ }
- if (((ecc_status & 0x3) == 2) || ((ecc_status >> 2) == 2)) {
- DEBUG(MTD_DEBUG_LEVEL0,
-@@ -392,8 +551,8 @@ static u_char mxc_nand_read_byte(struct
+ return 0;
+@@ -383,6 +883,7 @@ static int mxc_nand_correct_data(struct
+ static int mxc_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
+ u_char *ecc_code)
+ {
++ /* HW ECC calculation is done transparently by the controller */
+ return 0;
+ }
+
+@@ -392,8 +893,13 @@ static u_char mxc_nand_read_byte(struct
struct mxc_nand_host *host = nand_chip->priv;
uint8_t ret = 0;
uint16_t col, rd_word;
@@ -11195,11 +11849,33 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- uint16_t __iomem *spare_buf = host->regs + SPARE_AREA0;
+ uint16_t __iomem *main_buf = host->nfc_buf + MAIN_AREA0;
+ uint16_t __iomem *spare_buf = host->nfc_buf + SPARE_AREA0;
++
++ DEBUG(MTD_DEBUG_LEVEL3,
++ "%s(col = %d)\n", __FUNCTION__, host->col_addr);
++
++ BUG_ON(host->spare_only && host->col_addr >= 16);
/* Check for status request */
if (host->status_request)
-@@ -436,9 +595,9 @@ static uint16_t mxc_nand_read_word(struc
+@@ -424,28 +930,27 @@ static uint16_t mxc_nand_read_word(struc
+ {
+ struct nand_chip *nand_chip = mtd->priv;
+ struct mxc_nand_host *host = nand_chip->priv;
+- uint16_t col, rd_word, ret;
++ uint16_t col, ret;
+ uint16_t __iomem *p;
+
+- DEBUG(MTD_DEBUG_LEVEL3,
+- "mxc_nand_read_word(col = %d)\n", host->col_addr);
++ DEBUG(MTD_DEBUG_LEVEL1,
++ "%s(col = %d)\n", __FUNCTION__, host->col_addr);
+
+ col = host->col_addr;
++
+ /* Adjust saved column address */
+ if (col < mtd->writesize && host->spare_only)
col += mtd->writesize;
++ BUG_ON(col >= mtd->writesize + 16);
if (col < mtd->writesize)
- p = (host->regs + MAIN_AREA0) + (col >> 1);
@@ -11209,34 +11885,44 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1);
if (col & 1) {
- rd_word = readw(p);
-@@ -464,6 +623,7 @@ static void mxc_nand_write_buf(struct mt
- struct nand_chip *nand_chip = mtd->priv;
- struct mxc_nand_host *host = nand_chip->priv;
+- rd_word = readw(p);
+- ret = (rd_word >> 8) & 0xff;
+- rd_word = readw(&p[1]);
+- ret |= (rd_word << 8) & 0xff00;
+-
++ ret = readw(p++) >> 8;
++ ret |= readw(p) << 8;
+ } else
+ ret = readw(p);
+
+@@ -466,31 +971,32 @@ static void mxc_nand_write_buf(struct mt
int n, col, i = 0;
-+ int ss = mtd->oobsize / (mtd->writesize >> 9);
DEBUG(MTD_DEBUG_LEVEL3,
- "mxc_nand_write_buf(col = %d, len = %d)\n", host->col_addr,
-@@ -474,21 +634,27 @@ static void mxc_nand_write_buf(struct mt
+- "mxc_nand_write_buf(col = %d, len = %d)\n", host->col_addr,
+- len);
+-
++ "%s(buf=%p col=%03x, len=%03x)\n", __FUNCTION__,
++ buf, host->col_addr, len);
+ col = host->col_addr;
+
/* Adjust saved column address */
if (col < mtd->writesize && host->spare_only)
col += mtd->writesize;
--
-+#if 0
- n = mtd->writesize + mtd->oobsize - col;
- n = min(len, n);
-+#else
+
+- n = mtd->writesize + mtd->oobsize - col;
+- n = min(len, n);
++ /* If more data is requested to be written than free space in
++ * the flash buffer this is clearly a BUG! */
+ BUG_ON(len > mtd->writesize + mtd->oobsize - col);
+ n = len;
-+#endif
DEBUG(MTD_DEBUG_LEVEL3,
- "%s:%d: col = %d, n = %d\n", __func__, __LINE__, col, n);
+- "%s:%d: col = %d, n = %d\n", __func__, __LINE__, col, n);
++ "%s:%d: col=%03x, n=%03x\n", __func__, __LINE__, col, n);
while (n) {
void __iomem *p;
-+ int si = (col - mtd->writesize) / 16;
if (col < mtd->writesize)
- p = host->regs + MAIN_AREA0 + (col & ~3);
@@ -11245,55 +11931,51 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- p = host->regs + SPARE_AREA0 -
- mtd->writesize + (col & ~3);
+ p = host->nfc_buf + SPARE_AREA0 +
-+ si * SPARE_AREA_SIZE +
-+ (col - mtd->writesize) % ss;
++ (col & ~3) - mtd->writesize;
- DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__,
+- DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__,
++ DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p=%p\n", __func__,
__LINE__, p);
-@@ -542,6 +708,7 @@ static void mxc_nand_write_buf(struct mt
- DEBUG(MTD_DEBUG_LEVEL3,
- "%s:%d: n = %d, m = %d, i = %d, col = %d\n",
- __func__, __LINE__, n, m, i, col);
-+ BUG_ON(m == 0);
+ if (((col | (int)&buf[i]) & 3) || n < 16) {
+@@ -538,11 +1044,6 @@ static void mxc_nand_write_buf(struct mt
+ m += mtd->oobsize;
+
+ m = min(n, m) & ~3;
+-
+- DEBUG(MTD_DEBUG_LEVEL3,
+- "%s:%d: n = %d, m = %d, i = %d, col = %d\n",
+- __func__, __LINE__, n, m, i, col);
+-
memcpy(p, &buf[i], m);
col += m;
-@@ -562,27 +729,50 @@ static void mxc_nand_read_buf(struct mtd
- struct nand_chip *nand_chip = mtd->priv;
+ i += m;
+@@ -563,26 +1064,28 @@ static void mxc_nand_read_buf(struct mtd
struct mxc_nand_host *host = nand_chip->priv;
int n, col, i = 0;
-+ int ss = mtd->oobsize / (mtd->writesize >> 9);
-
- DEBUG(MTD_DEBUG_LEVEL3,
- "mxc_nand_read_buf(col = %d, len = %d)\n", host->col_addr, len);
+- DEBUG(MTD_DEBUG_LEVEL3,
+- "mxc_nand_read_buf(col = %d, len = %d)\n", host->col_addr, len);
+-
col = host->col_addr;
-+ if (dbg_lvl(2)) {
-+ int si = col / 512;
-+ print_hex_dump(KERN_DEBUG, "main: ", DUMP_PREFIX_ADDRESS,
-+ 16, 2, host->nfc_buf + MAIN_AREA0, 64, 0);
-+ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS,
-+ 16, 2, host->nfc_buf + SPARE_AREA0 +
-+ si * SPARE_AREA_SIZE, 16, 0);
-+ }
++ DEBUG(MTD_DEBUG_LEVEL1,
++ "%s(col=%03x len=%03x)\n", __FUNCTION__, col, len);
++
/* Adjust saved column address */
if (col < mtd->writesize && host->spare_only)
col += mtd->writesize;
--
-+#if 0
- n = mtd->writesize + mtd->oobsize - col;
- n = min(len, n);
--
-+#else
+
+- n = mtd->writesize + mtd->oobsize - col;
+- n = min(len, n);
+ /* If more data is requested to be read than is available in
+ * the flash buffer this is clearly a BUG! */
+ BUG_ON(len > mtd->writesize + mtd->oobsize - col);
+ n = len;
-+#endif
+
while (n) {
- void __iomem *p;
-+ int si = (col - mtd->writesize) / ss;
+- void __iomem *p;
++ const void __iomem *p;
if (col < mtd->writesize)
- p = host->regs + MAIN_AREA0 + (col & ~3);
@@ -11302,65 +11984,202 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- p = host->regs + SPARE_AREA0 -
- mtd->writesize + (col & ~3);
+ p = host->nfc_buf + SPARE_AREA0 +
-+ si * SPARE_AREA_SIZE +
-+ (col - mtd->writesize) % ss;
-+
-+ DBG(1, "p=%p col=%03x ss=%d si=%d\n", p, col, ss, si);
-+
-+ if (dbg_lvl(3)) {
-+ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS,
-+ 16, 2, p, 64, 0);
-+ }
++ (col & ~3) - mtd->writesize;
if (((col | (int)&buf[i]) & 3) || n < 16) {
uint32_t data;
-@@ -618,18 +808,23 @@ static void mxc_nand_read_buf(struct mtd
- int m = mtd->writesize - col;
-
- if (col >= mtd->writesize)
-- m += mtd->oobsize;
-+ m = ss;
-
- m = min(n, m) & ~3;
-+ DBG(1, "Copying %u byte from offset %03x[%p]\n",
-+ m + (col & 3), col, p);
-+ BUG_ON(m == 0);
- memcpy(&buf[i], p, m);
- col += m;
- i += m;
- n -= m;
- }
+@@ -629,7 +1132,6 @@ static void mxc_nand_read_buf(struct mtd
}
-+ if (dbg_lvl(1)) {
-+ print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);
-+ }
/* Update saved column address */
host->col_addr = col;
-
}
/* Used by the upper layer to verify the data in NAND Flash
-@@ -655,13 +850,15 @@ static void mxc_nand_select_chip(struct
+@@ -637,7 +1139,38 @@ static void mxc_nand_read_buf(struct mtd
+ static int mxc_nand_verify_buf(struct mtd_info *mtd,
+ const u_char *buf, int len)
+ {
+- return -EFAULT;
++ struct nand_chip *nand_chip = mtd->priv;
++ struct mxc_nand_host *host = nand_chip->priv;
++ int i;
++ u16 *wp = host->nfc_buf + MAIN_AREA0;
++ const u_char *b = buf;
++
++ for (i = 0; i < len >> 1; i++) {
++ u16 w = *wp++;
++ u16 data = *buf++;
++
++ if (len - i > 1)
++ data |= (*buf++) << 8;
++ else
++ data |= 0xff << 8;
++
++ /* This is crappy! The upper layer always sends us a
++ * whole page buffer to verify, even if only a partial page
++ * was written. So, ignore all 0xff bytes in the reference buffer.
++ */
++ if ((data & w) != w) {
++ printk(KERN_ERR
++ "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n",
++ __FUNCTION__, i, w & 0xff, w >> 8, data & 0xff, data >> 8);
++ print_hex_dump(KERN_DEBUG, "ver: ", DUMP_PREFIX_ADDRESS,
++ 16, 2, b + ((i << 1) & ~0xf), min(len - i, 64), 0);
++ print_hex_dump(KERN_DEBUG, "ref: ", DUMP_PREFIX_ADDRESS,
++ 16, 2, host->nfc_buf + MAIN_AREA0 + ((i << 1) & ~0xf),
++ min(len - i, 64), 0);
++ return -EFAULT;
++ }
++ }
++ return 0;
+ }
+
+ /* This function is used by upper layer for select and
+@@ -655,13 +1188,13 @@ static void mxc_nand_select_chip(struct
}
if (chip == -1) {
- writew(readw(host->regs + NFC_CONFIG1) & ~NFC_CE,
- host->regs + NFC_CONFIG1);
-+ nfc_write_reg(host->regs,
-+ nfc_read_reg(host->regs, NFC_CONFIG1) & ~NFC_CE,
-+ NFC_CONFIG1);
++ nfc_write_reg(nfc_read_reg(host->regs, NFC_CONFIG1) & ~NFC_CE,
++ host->regs, NFC_CONFIG1);
return;
}
- writew(readw(host->regs + NFC_CONFIG1) | NFC_CE,
- host->regs + NFC_CONFIG1);
-+ nfc_write_reg(host->regs,
-+ nfc_read_reg(host->regs, NFC_CONFIG1) | NFC_CE,
-+ NFC_CONFIG1);
++ nfc_write_reg(nfc_read_reg(host->regs, NFC_CONFIG1) | NFC_CE,
++ host->regs, NFC_CONFIG1);
#endif
switch (chip) {
-@@ -831,6 +1028,7 @@ static void mxc_nand_command(struct mtd_
+@@ -679,9 +1212,6 @@ static void mxc_nand_select_chip(struct
+ host->clk_act = 1;
+ }
+ break;
+-
+- default:
+- break;
+ }
+ }
+
+@@ -692,10 +1222,10 @@ static void mxc_nand_command(struct mtd_
+ {
+ struct nand_chip *nand_chip = mtd->priv;
+ struct mxc_nand_host *host = nand_chip->priv;
+- int useirq = true;
++ int useirq = false;
+
+ DEBUG(MTD_DEBUG_LEVEL3,
+- "mxc_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n",
++ "%s: cmd 0x%08x, col 0x%03x, page 0x%04x\n", __FUNCTION__,
+ command, column, page_addr);
+
+ /* Reset command state information */
+@@ -710,15 +1240,14 @@ static void mxc_nand_command(struct mtd_
+ break;
+
+ case NAND_CMD_READ0:
++ host->page_addr = page_addr;
+ host->col_addr = column;
+ host->spare_only = false;
+- useirq = false;
+ break;
+
+ case NAND_CMD_READOOB:
+ host->col_addr = column;
+ host->spare_only = true;
+- useirq = false;
+ if (host->pagesize_2k)
+ command = NAND_CMD_READ0; /* only READ0 is valid */
+ break;
+@@ -726,9 +1255,9 @@ static void mxc_nand_command(struct mtd_
+ case NAND_CMD_SEQIN:
+ if (column >= mtd->writesize) {
+ /*
+- * FIXME: before send SEQIN command for write OOB,
+- * We must read one page out.
+- * For K9F1GXX has no READ1 command to set current HW
++ * Before sending the SEQIN command for writing OOB
++ * we must read one page out.
++ * Because K9F1GXX has no READ1 command to set current HW
+ * pointer to spare area, we must write the whole page
+ * including OOB together.
+ */
+@@ -751,23 +1280,23 @@ static void mxc_nand_command(struct mtd_
+ if (!host->pagesize_2k)
+ send_cmd(host, NAND_CMD_READ0, false);
+ }
+- useirq = false;
+ break;
+
+ case NAND_CMD_PAGEPROG:
+ send_prog_page(host, 0, host->spare_only);
+-
+- if (host->pagesize_2k) {
++ if (host->pagesize_2k && !cpu_is_mx25()) {
+ /* data in 4 areas datas */
+ send_prog_page(host, 1, host->spare_only);
+ send_prog_page(host, 2, host->spare_only);
+ send_prog_page(host, 3, host->spare_only);
+ }
+-
++ useirq = true;
+ break;
+
+ case NAND_CMD_ERASE1:
+- useirq = false;
++ break;
++ case NAND_CMD_ERASE2:
++ useirq = true;
+ break;
+ }
+
+@@ -791,23 +1320,13 @@ static void mxc_nand_command(struct mtd_
+
+ /* Write out page address, if necessary */
+ if (page_addr != -1) {
+- /* paddr_0 - p_addr_7 */
+- send_addr(host, (page_addr & 0xff), false);
++ u32 page_mask = nand_chip->pagemask;
+
+- if (host->pagesize_2k) {
+- send_addr(host, (page_addr >> 8) & 0xFF, false);
+- if (mtd->size >= 0x40000000)
+- send_addr(host, (page_addr >> 16) & 0xff, true);
+- } else {
+- /* One more address cycle for higher density devices */
+- if (mtd->size >= 0x4000000) {
+- /* paddr_8 - paddr_15 */
+- send_addr(host, (page_addr >> 8) & 0xff, false);
+- send_addr(host, (page_addr >> 16) & 0xff, true);
+- } else
+- /* paddr_8 - paddr_15 */
+- send_addr(host, (page_addr >> 8) & 0xff, true);
+- }
++ do {
++ send_addr(host, (page_addr & 0xff), false);
++ page_mask >>= 8;
++ page_addr >>= 8;
++ } while (page_mask != 0);
+ }
+
+ /* Command post-processing step */
+@@ -823,14 +1342,17 @@ static void mxc_nand_command(struct mtd_
+ send_cmd(host, NAND_CMD_READSTART, true);
+ /* read for each AREA */
+ send_read_page(host, 0, host->spare_only);
+- send_read_page(host, 1, host->spare_only);
+- send_read_page(host, 2, host->spare_only);
+- send_read_page(host, 3, host->spare_only);
++ if (!cpu_is_mx25()) {
++ send_read_page(host, 1, host->spare_only);
++ send_read_page(host, 2, host->spare_only);
++ send_read_page(host, 3, host->spare_only);
++ }
+ } else
+ send_read_page(host, 0, host->spare_only);
break;
case NAND_CMD_READID:
@@ -11368,7 +12187,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
send_read_id(host);
break;
-@@ -851,9 +1049,12 @@ static int __init mxcnd_probe(struct pla
+@@ -851,9 +1373,9 @@ static int __init mxcnd_probe(struct pla
struct mtd_info *mtd;
struct mxc_nand_platform_data *pdata = pdev->dev.platform_data;
struct mxc_nand_host *host;
@@ -11377,13 +12196,10 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
uint16_t tmp;
- int err = 0, nr_parts = 0;
+ int err, nr_parts;
-+
-+ DBG(0, "%s: pdata=%p hw_ecc=%d width=%d\n", __FUNCTION__,
-+ pdata, pdata->hw_ecc, pdata->width);
/* Allocate memory for MTD device structure and private data */
host = kzalloc(sizeof(struct mxc_nand_host), GFP_KERNEL);
-@@ -868,9 +1069,6 @@ static int __init mxcnd_probe(struct pla
+@@ -868,9 +1390,6 @@ static int __init mxcnd_probe(struct pla
mtd->owner = THIS_MODULE;
mtd->dev.parent = &pdev->dev;
@@ -11393,7 +12209,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
this->priv = host;
this->dev_ready = mxc_nand_dev_ready;
this->cmdfunc = mxc_nand_command;
-@@ -880,29 +1078,61 @@ static int __init mxcnd_probe(struct pla
+@@ -880,29 +1399,54 @@ static int __init mxcnd_probe(struct pla
this->write_buf = mxc_nand_write_buf;
this->read_buf = mxc_nand_read_buf;
this->verify_buf = mxc_nand_verify_buf;
@@ -11410,9 +12226,6 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ err = PTR_ERR(host->clk);
goto eclk;
+ }
-+ printk(KERN_DEBUG "NFC clk rate: %lu\n", clk_get_rate(host->clk));
-+ clk_set_rate(host->clk, 11000000);
-+ printk(KERN_DEBUG "NFC clk rate: %lu\n", clk_get_rate(host->clk));
clk_enable(host->clk);
host->clk_act = 1;
@@ -11420,22 +12233,21 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
+ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ if (!res1) {
++ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++ if (!res1 || !res2) {
err = -ENODEV;
goto eres;
}
-+ if (!request_mem_region(res1->start, resource_size(res1), "mxc_nand")) {
+
+- host->regs = ioremap(res->start, res->end - res->start + 1);
++ if (!request_mem_region(res1->start, resource_size(res1), "mxc_nand regs")) {
+ err = -EBUSY;
+ goto ereq1;
+ }
-
-- host->regs = ioremap(res->start, res->end - res->start + 1);
-+ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+ if (res2) {
-+ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand")) {
-+ err = -EBUSY;
-+ goto ereq2;
-+ }
++
++ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) {
++ err = -EBUSY;
++ goto ereq2;
+ }
+
+ host->regs = ioremap(res1->start, resource_size(res1));
@@ -11447,56 +12259,45 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
}
- tmp = readw(host->regs + NFC_CONFIG1);
-+ if (!res2) {
-+ host->nfc_buf = host->regs;
-+ host->regs += 0xe00;
-+ } else {
-+ host->nfc_buf = ioremap(res2->start, resource_size(res2));
-+ if (!host->regs) {
++ host->nfc_buf = ioremap(res2->start, resource_size(res2));
++ if (!host->nfc_buf) {
+ err = -ENOMEM;
+ goto eunmap2;
-+ }
+ }
++
+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
tmp |= NFC_INT_MSK;
- writew(tmp, host->regs + NFC_CONFIG1);
+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
++ nfc_write_reg(0, host->regs, NFC_CONFIG2);
init_waitqueue_head(&host->irq_waitq);
-@@ -911,7 +1141,7 @@ static int __init mxcnd_probe(struct pla
- err = request_irq(host->irq, mxc_nfc_irq, 0, "mxc_nd", host);
+@@ -912,57 +1456,89 @@ static int __init mxcnd_probe(struct pla
if (err)
goto eirq;
--
-+#if 0
- if (pdata->hw_ecc) {
- this->ecc.calculate = mxc_nand_calculate_ecc;
- this->ecc.hwctl = mxc_nand_enable_hwecc;
-@@ -919,50 +1149,90 @@ static int __init mxcnd_probe(struct pla
- this->ecc.mode = NAND_ECC_HW;
- this->ecc.size = 512;
- this->ecc.bytes = 3;
-+ if (
- this->ecc.layout = &nand_hw_eccoob_8;
+
+- if (pdata->hw_ecc) {
+- this->ecc.calculate = mxc_nand_calculate_ecc;
+- this->ecc.hwctl = mxc_nand_enable_hwecc;
+- this->ecc.correct = mxc_nand_correct_data;
+- this->ecc.mode = NAND_ECC_HW;
+- this->ecc.size = 512;
+- this->ecc.bytes = 3;
+- this->ecc.layout = &nand_hw_eccoob_8;
- tmp = readw(host->regs + NFC_CONFIG1);
-+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
- tmp |= NFC_ECC_EN;
+- tmp |= NFC_ECC_EN;
- writew(tmp, host->regs + NFC_CONFIG1);
-+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
- } else {
- this->ecc.size = 512;
- this->ecc.bytes = 3;
- this->ecc.layout = &nand_hw_eccoob_8;
- this->ecc.mode = NAND_ECC_SOFT;
+- } else {
+- this->ecc.size = 512;
+- this->ecc.bytes = 3;
+- this->ecc.layout = &nand_hw_eccoob_8;
+- this->ecc.mode = NAND_ECC_SOFT;
- tmp = readw(host->regs + NFC_CONFIG1);
-+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
- tmp &= ~NFC_ECC_EN;
+- tmp &= ~NFC_ECC_EN;
- writew(tmp, host->regs + NFC_CONFIG1);
-+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
- }
+- }
-
-+#endif
/* Reset NAND */
this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
@@ -11530,37 +12331,47 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
DEBUG(MTD_DEBUG_LEVEL0,
"MXC_ND: Unable to find any NAND device.\n");
- err = -ENXIO;
-+ goto escan;
-+ }
+ goto escan;
+ }
+
+ /* this is required before completing the scan */
+ host->pagesize_2k = (mtd->writesize == 2048);
++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
++ if (cpu_is_mx25())
++ tmp |= NFC_ONE_CYCLE;
+
-+ if (pdata->width == 2) {
-+ if (host->pagesize_2k) {
-+ this->ecc.layout = &nand_hw_eccoob2k_16;
++ tmp &= ~(3 << 9); /* clear PPB mask */
++ /* set PPB (pages per block) */
++ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9;
++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
++
++ if (pdata->hw_ecc) {
++ this->ecc.calculate = mxc_nand_calculate_ecc;
++ this->ecc.hwctl = mxc_nand_enable_hwecc;
++ this->ecc.correct = mxc_nand_correct_data;
++ if (cpu_is_mx25()) {
++ this->ecc.mode = NAND_ECC_HW_SYNDROME;
++ this->ecc.read_page = mxc_nand_read_page_syndrome;
++ this->ecc.read_page_raw = mxc_nand_read_page_raw_syndrome;
++ this->ecc.read_oob = mxc_nand_read_oob_syndrome;
++ this->ecc.write_page = mxc_nand_write_page_syndrome;
++ this->ecc.write_page_raw = mxc_nand_write_page_raw_syndrome;
++ this->ecc.write_oob = mxc_nand_write_oob_syndrome;
++ this->ecc.bytes = 9;
++ this->ecc.prepad = 7;
+ } else {
-+ this->ecc.layout = &nand_hw_eccoob_16;
++ this->ecc.mode = NAND_ECC_HW;
+ }
-+ } else {
+ if (host->pagesize_2k) {
+ this->ecc.layout = &nand_hw_eccoob2k_8;
+ } else {
+ this->ecc.layout = &nand_hw_eccoob_8;
+ }
-+ }
-+ if (pdata->hw_ecc) {
-+ this->ecc.calculate = mxc_nand_calculate_ecc;
-+ this->ecc.hwctl = mxc_nand_enable_hwecc;
-+ this->ecc.correct = mxc_nand_correct_data;
-+ this->ecc.mode = NAND_ECC_HW;
+ this->ecc.size = 512;
-+ this->ecc.bytes = 3;
+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
+ tmp |= NFC_ECC_EN;
+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1);
+ } else {
-+ this->ecc.size = 512;
-+ this->ecc.bytes = 3;
+ this->ecc.mode = NAND_ECC_SOFT;
+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1);
+ tmp &= ~NFC_ECC_EN;
@@ -11569,23 +12380,27 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+
+ err = nand_scan_tail(mtd);
+ if (err) {
- goto escan;
- }
-
++ goto escan;
++ }
++ if (cpu_is_mx25()) {
++ mtd->flags &= ~MTD_OOB_WRITEABLE;
++ }
++
+ pr_info("MXC MTD nand Driver IRQ %d bus width: %u bit %s ECC IO: %08lx\n",
+ host->irq, pdata->width * 8, pdata->hw_ecc ? "HW" : "SW",
+ (unsigned long)res1->start);
++
/* Register the partitions */
#ifdef CONFIG_MTD_PARTITIONS
nr_parts =
-@@ -981,10 +1251,19 @@ static int __init mxcnd_probe(struct pla
+@@ -981,10 +1557,19 @@ static int __init mxcnd_probe(struct pla
return 0;
escan:
- free_irq(host->irq, NULL);
+ free_irq(host->irq, host);
eirq:
-+ if (host->regs != host->nfc_buf)
++ if (res2)
+ iounmap(host->nfc_buf);
+eunmap2:
iounmap(host->regs);
@@ -11599,7 +12414,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
clk_put(host->clk);
eclk:
kfree(host);
-@@ -995,46 +1274,63 @@ eclk:
+@@ -995,46 +1580,63 @@ eclk:
static int __devexit mxcnd_remove(struct platform_device *pdev)
{
struct mxc_nand_host *host = platform_get_drvdata(pdev);
@@ -11643,9 +12458,10 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
+ if (mtd)
+ ret = mtd->suspend(mtd);
-+ if (host->clk_act) {
- /* Disable the NFC clock */
+- /* Disable the NFC clock */
- clk_disable(nfc_clk); /* FIXME */
++ if (host->clk_act) {
++ /* Disable the NFC clock */
+ clk_disable(host->clk);
+ }
@@ -11675,7 +12491,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
return ret;
}
-@@ -1047,7 +1343,7 @@ static int mxcnd_resume(struct platform_
+@@ -1047,7 +1649,7 @@ static int mxcnd_resume(struct platform_
static struct platform_driver mxcnd_driver = {
.driver = {
.name = DRIVER_NAME,
@@ -11684,7 +12500,7 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
.remove = __exit_p(mxcnd_remove),
.suspend = mxcnd_suspend,
.resume = mxcnd_resume,
-@@ -1055,13 +1351,14 @@ static struct platform_driver mxcnd_driv
+@@ -1055,13 +1657,14 @@ static struct platform_driver mxcnd_driv
static int __init mxc_nd_init(void)
{
@@ -11703,1667 +12519,1850 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nand.c linux-2.6.30-rc4-karo/dr
}
static void __exit mxc_nd_cleanup(void)
-diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nd2.c linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nd2.c
---- linux-2.6.30-rc4/drivers/mtd/nand/mxc_nd2.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nd2.c 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,1651 @@
+diff -purN linux-2.6.30-rc4-git/drivers/net/Kconfig linux-2.6.30-rc4-karo3/drivers/net/Kconfig
+--- linux-2.6.30-rc4-git/drivers/net/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/net/Kconfig 2009-06-02 18:42:32.000000000 +0200
+@@ -1859,7 +1859,7 @@ config 68360_ENET
+
+ config FEC
+ bool "FEC ethernet controller (of ColdFire CPUs)"
+- depends on M523x || M527x || M5272 || M528x || M520x || M532x || MACH_MX27
++ depends on M523x || M527x || M5272 || M528x || M520x || M532x || MACH_MX27 || MACH_TX25
+ help
+ Say Y here if you want to use the built-in 10/100 Fast ethernet
+ controller on some Motorola ColdFire and Freescale i.MX processors.
+diff -purN linux-2.6.30-rc4-git/drivers/net/can/Kconfig linux-2.6.30-rc4-karo3/drivers/net/can/Kconfig
+--- linux-2.6.30-rc4-git/drivers/net/can/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/net/can/Kconfig 2009-07-01 11:28:55.000000000 +0200
+@@ -22,4 +22,21 @@ config CAN_DEBUG_DEVICES
+ a problem with CAN support and want to see more of what is going
+ on.
+
++config CAN_FLEXCAN
++ tristate "Freescale FlexCAN"
++ depends on CAN && (MACH_MX25 || ARCH_MX35)
++ default m
++ ---help---
++ This select the support of Freescale CAN(FlexCAN).
++ This driver can also be built as a module.
++ If unsure, say N.
++
++config CAN_FLEXCAN_CAN1
++ bool "Enable CAN1 interface on i.MX25/i.MX35"
++ depends on CAN_FLEXCAN && (MACH_MX25 && !ARCH_MXC_EHCI_USBOTG)
++
++config CAN_FLEXCAN_CAN2
++ bool "Enable CAN2 interface on i.MX25/i.MX35"
++ depends on CAN_FLEXCAN
++
+ endmenu
+diff -purN linux-2.6.30-rc4-git/drivers/net/can/Makefile linux-2.6.30-rc4-karo3/drivers/net/can/Makefile
+--- linux-2.6.30-rc4-git/drivers/net/can/Makefile 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/net/can/Makefile 2009-07-01 11:29:31.000000000 +0200
+@@ -1,5 +1,9 @@
+ #
+ # Makefile for the Linux Controller Area Network drivers.
+ #
++ifneq ($(CONFIG_CAN_DEBUG_DEVICES),)
++ EXTRA_CFLAGS += -DDEBUG
++endif
+
+ obj-$(CONFIG_CAN_VCAN) += vcan.o
++obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
+diff -purN linux-2.6.30-rc4-git/drivers/net/can/flexcan.c linux-2.6.30-rc4-karo3/drivers/net/can/flexcan.c
+--- linux-2.6.30-rc4-git/drivers/net/can/flexcan.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/drivers/net/can/flexcan.c 2009-07-06 15:17:41.000000000 +0200
+@@ -0,0 +1,1784 @@
+/*
-+ * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ * drivers/net/can/flexcan.c
++ *
++ * Copyright (C) 2009 Lothar Wassmann <LW@KARO-electronics.de>
++ *
++ * based on: drivers/net/can/flexcan/
++ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ *
++ * 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
++ *
++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ */
+
+/*
-+ * The code contained herein is licensed under the GNU General Public
-+ * License. You may obtain a copy of the GNU General Public License
-+ * Version 2 or later at the following locations:
-+ *
-+ * http://www.opensource.org/licenses/gpl-license.html
-+ * http://www.gnu.org/copyleft/gpl.html
++ * Driver for Freescale CAN Controller FlexCAN.
+ */
+
-+#include <linux/delay.h>
-+#include <linux/slab.h>
-+#include <linux/init.h>
+#include <linux/module.h>
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/nand.h>
-+#include <linux/interrupt.h>
-+#include <linux/device.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/netdevice.h>
++#include <linux/if_arp.h>
++#include <linux/if_ether.h>
+#include <linux/platform_device.h>
++#include <linux/regulator/consumer.h>
+#include <linux/clk.h>
-+#include <linux/err.h>
-+#include <linux/mtd/partitions.h>
-+#include <asm/mach/flash.h>
++
+#include <asm/io.h>
++#include <asm/irq.h>
++#include <mach/hardware.h>
++#include <mach/mxc_can.h>
+
-+#ifdef CONFIG_MTD_DEBUG
++#include "flexcan.h"
++
++#ifdef DEBUG
+static int debug = 0;
++#define dbg_lvl(n) ((n) < debug)
+module_param(debug, int, S_IRUGO | S_IWUSR);
+
-+#define dbg_lvl(n) ((n) < debug)
+#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0)
-+#undef DEBUG
-+#define DEBUG DBG
+#else
+static int debug;
++#define dbg_lvl(n) 0
+module_param(debug, int, 0);
+
-+#define dbg_lvl(n) 0
+#define DBG(lvl, fmt...) do { } while (0)
+#endif
+
-+#include "mxc_nd2.h"
-+
-+#define DRV_NAME "mxc_nand"
++#define ndev_dbg(d, l, fmt...) do { if (dbg_lvl(l)) dev_dbg(&(d)->dev, fmt); } while (0)
++#define pdev_dbg(p, l, fmt...) do { if (dbg_lvl(l)) dev_dbg(&(p)->dev, fmt); } while (0)
++#define flexcan_dbg(f, l, fmt...) do { if (dbg_lvl(l)) dev_dbg(&(f)->dev->dev, fmt); } while (0)
+
++#define ndev_err(d, fmt...) dev_err(&(d)->dev, fmt)
++#define pdev_err(p, fmt...) dev_err(&(p)->dev, fmt)
+
-+/* Global address Variables */
-+/*
-+static void __iomem *nfc_axi_base;
-+static void __iomem *nfc_ip_base;
-+*/
-+
-+struct mxc_mtd_s {
-+ struct mtd_info mtd;
-+ struct nand_chip nand;
-+ struct mtd_partition *parts;
-+ struct device *dev;
-+ wait_queue_head_t irq_waitq;
-+ int irq;
-+
-+ u8 *data_buf;
-+ u8 *oob_buf;
-+ struct clk *clk;
-+ int clk_act;
-+
-+ struct resource *res_ip;
-+ struct resource *res_axi;
-+ void __iomem *reg_base;
-+ void __iomem *axi_base;
-+ u16 __iomem *main_buf;
-+ u16 __iomem *spare_buf;
-+
-+ bool status_req;
-+ u16 col_addr;
++enum {
++ FLEXCAN_ATTR_STATE = 0,
++ FLEXCAN_ATTR_BITRATE,
++ FLEXCAN_ATTR_BR_PRESDIV,
++ FLEXCAN_ATTR_BR_RJW,
++ FLEXCAN_ATTR_BR_PROPSEG,
++ FLEXCAN_ATTR_BR_PSEG1,
++ FLEXCAN_ATTR_BR_PSEG2,
++ FLEXCAN_ATTR_BR_CLKSRC,
++ FLEXCAN_ATTR_MAXMB,
++ FLEXCAN_ATTR_XMIT_MAXMB,
++ FLEXCAN_ATTR_FIFO,
++ FLEXCAN_ATTR_WAKEUP,
++ FLEXCAN_ATTR_SRX_DIS,
++ FLEXCAN_ATTR_WAK_SRC,
++ FLEXCAN_ATTR_BCC,
++ FLEXCAN_ATTR_LOCAL_PRIORITY,
++ FLEXCAN_ATTR_ABORT,
++ FLEXCAN_ATTR_LOOPBACK,
++ FLEXCAN_ATTR_SMP,
++ FLEXCAN_ATTR_BOFF_REC,
++ FLEXCAN_ATTR_TSYN,
++ FLEXCAN_ATTR_LISTEN,
++ FLEXCAN_ATTR_EXTEND_MSG,
++ FLEXCAN_ATTR_STANDARD_MSG,
++#ifdef CONFIG_CAN_DEBUG_DEVICES
++ FLEXCAN_ATTR_DUMP_REG,
++ FLEXCAN_ATTR_DUMP_XMIT_MB,
++ FLEXCAN_ATTR_DUMP_RX_MB,
++#endif
++ FLEXCAN_ATTR_MAX
+};
+
-+/*
-+ * Define delays in microsec for NAND device operations
-+ */
-+#define TROP_US_DELAY 2000
++#ifdef DEBUG
++#define flexcan_reg_read(f,r) _flexcan_reg_read(f, r, #r, __FUNCTION__)
++static inline unsigned long _flexcan_reg_read(struct flexcan_device *flexcan, int reg,
++ const char *name, const char *fn)
++{
++ unsigned long val;
++ val = __raw_readl(flexcan->io_base + reg);
++ DBG(2, "%s: Read %08lx from %s[%p]\n", fn, val, name,
++ flexcan->io_base + reg);
++ return val;
++}
+
-+#ifdef CONFIG_MTD_NAND_MXC_SWECC
-+static int hardware_ecc = 0;
++#define flexcan_reg_write(f,r,v) _flexcan_reg_write(f, r, v, #r, __FUNCTION__)
++static inline void _flexcan_reg_write(struct flexcan_device *flexcan, int reg, unsigned long val,
++ const char *name, const char *fn)
++{
++ DBG(2, "%s: Writing %08lx to %s[%p]\n", fn, val, name, flexcan->io_base + reg);
++ __raw_writel(val, flexcan->io_base + reg);
++}
+#else
-+static int hardware_ecc = 1;
-+#endif
++static inline unsigned long flexcan_reg_read(struct flexcan_device *flexcan, int reg)
++{
++ return __raw_readl(flexcan->io_base + reg);
++}
+
-+static u8 num_of_interleave = 1;
++static inline void flexcan_reg_write(struct flexcan_device *flexcan, int reg, unsigned long val)
++{
++ __raw_writel(val, flexcan->io_base + reg);
++}
++#endif
+
-+/*
-+ * OOB placement block for use with hardware ecc generation
-+ */
-+static struct nand_ecclayout nand_hw_eccoob_512 = {
-+ .eccbytes = 9,
-+ .eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
-+ .oobfree = {{0, 4}},
++static ssize_t flexcan_show_attr(struct device *dev,
++ struct device_attribute *attr, char *buf);
++static ssize_t flexcan_set_attr(struct device *dev,
++ struct device_attribute *attr, const char *buf,
++ size_t count);
++
++static struct device_attribute flexcan_dev_attr[FLEXCAN_ATTR_MAX] = {
++ [FLEXCAN_ATTR_STATE] = __ATTR(state, 0444, flexcan_show_attr, NULL),
++ [FLEXCAN_ATTR_BITRATE] =
++ __ATTR(bitrate, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_PRESDIV] =
++ __ATTR(br_presdiv, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_RJW] =
++ __ATTR(br_rjw, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_PROPSEG] =
++ __ATTR(br_propseg, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_PSEG1] =
++ __ATTR(br_pseg1, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_PSEG2] =
++ __ATTR(br_pseg2, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BR_CLKSRC] =
++ __ATTR(br_clksrc, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_MAXMB] =
++ __ATTR(maxmb, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_XMIT_MAXMB] =
++ __ATTR(xmit_maxmb, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_FIFO] =
++ __ATTR(fifo, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_WAKEUP] =
++ __ATTR(wakeup, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_SRX_DIS] =
++ __ATTR(srx_dis, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_WAK_SRC] =
++ __ATTR(wak_src, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BCC] =
++ __ATTR(bcc, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_LOCAL_PRIORITY] =
++ __ATTR(local_priority, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_ABORT] =
++ __ATTR(abort, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_LOOPBACK] =
++ __ATTR(loopback, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_SMP] =
++ __ATTR(smp, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_BOFF_REC] =
++ __ATTR(boff_rec, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_TSYN] =
++ __ATTR(tsyn, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_LISTEN] =
++ __ATTR(listen, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_EXTEND_MSG] =
++ __ATTR(ext_msg, 0644, flexcan_show_attr, flexcan_set_attr),
++ [FLEXCAN_ATTR_STANDARD_MSG] =
++ __ATTR(std_msg, 0644, flexcan_show_attr, flexcan_set_attr),
++#ifdef CONFIG_CAN_DEBUG_DEVICES
++ [FLEXCAN_ATTR_DUMP_REG] =
++ __ATTR(dump_reg, 0444, flexcan_show_attr, NULL),
++ [FLEXCAN_ATTR_DUMP_XMIT_MB] =
++ __ATTR(dump_xmit_mb, 0444, flexcan_show_attr, NULL),
++ [FLEXCAN_ATTR_DUMP_RX_MB] =
++ __ATTR(dump_rx_mb, 0444, flexcan_show_attr, NULL),
++#endif
+};
+
-+static struct nand_ecclayout nand_hw_eccoob_2k = {
-+ .eccbytes = 9,
-+ .eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
-+ .oobfree = {{2, 5}, {16, 7}, {32, 7}, {48,7}},
-+};
++static void flexcan_set_bitrate(struct flexcan_device *flexcan, int bitrate)
++{
++ /* TODO:: implement in future
++ * based on the bitrate to get the timing of
++ * presdiv, pseg1, pseg2, propseg
++ */
++}
+
-+static struct nand_ecclayout nand_hw_eccoob_4k = {
-+ .eccbytes = 9,
-+ .eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
-+ .oobfree = {{2, 5}, {16, 218 - 16}},
-+};
++static void flexcan_update_bitrate(struct flexcan_device *flexcan)
++{
++ int rate, div;
++
++ if (flexcan->br_clksrc)
++ rate = clk_get_rate(flexcan->clk);
++ else {
++ struct clk *clk;
++ clk = clk_get_sys(NULL, "ckih");
++ if (IS_ERR(clk))
++ return;
++ rate = clk_get_rate(clk);
++ clk_put(clk);
++ }
++ if (!rate)
++ return;
+
-+/*!
-+ * @defgroup NAND_MTD NAND Flash MTD Driver for MXC processors
-+ */
++ flexcan_dbg(flexcan, 0, "%s: master clock rate %u from %s\n",
++ __FUNCTION__, rate, flexcan->br_clksrc ? "osc" : "pll");
+
-+/*!
-+ * @file mxc_nd2.c
-+ *
-+ * @brief This file contains the hardware specific layer for NAND Flash on
-+ * MXC processor
-+ *
-+ * @ingroup NAND_MTD
-+ */
++ div = flexcan->br_presdiv + 1;
++ div *= flexcan->br_propseg + flexcan->br_pseg1 + flexcan->br_pseg2 + 4;
++ flexcan->bitrate = (rate + div - 1) / div;
+
-+#ifdef CONFIG_MTD_PARTITIONS
-+static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL };
-+#endif
++ flexcan_dbg(flexcan, 0, "%s: flexcan bitrate %u time quantum %uns\n",
++ __FUNCTION__, flexcan->bitrate,
++ 1000000000 / (flexcan->bitrate *
++ (flexcan->br_propseg + flexcan->br_pseg1 +
++ flexcan->br_pseg2 + 4)));
++}
+
-+static irqreturn_t mxc_nfc_irq(int irq, void *dev_id)
++static inline void flexcan_read_hw_mb(struct flexcan_device *flexcan, struct can_hw_mb *mb,
++ int buf_no)
+{
-+ struct mxc_mtd_s *mxc_nand_data = dev_id;
-+
-+ /* Disable Interrupt */
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_INTERRUPT) |
-+ NFC_INT_MSK, REG_NFC_INTERRUPT);
-+ wake_up(&mxc_nand_data->irq_waitq);
-+
-+ return IRQ_HANDLED;
++ __raw_readsl(mb, flexcan->hwmb + buf_no * sizeof(*mb), sizeof(*mb));
+}
+
-+/*
-+ * Functions to transfer data to/from spare erea.
-+ */
-+static void
-+copy_spare(struct mtd_info *mtd, void *pbuf, void *pspare, int len, bool bfrom)
++static inline void flexcan_write_hw_mb(struct flexcan_device *flexcan, struct can_hw_mb *mb,
++ int buf_no)
+{
-+ u16 i, j;
-+ u16 m = mtd->oobsize;
-+ u16 n = mtd->writesize >> 9;
-+ u8 *d = (u8 *) pbuf;
-+ u8 *s = (u8 *) pspare;
-+ u16 t = SPARE_LEN;
-+
-+ m /= num_of_interleave;
-+ n /= num_of_interleave;
-+
-+ j = (m / n >> 1) << 1;
-+
-+ if (bfrom) {
-+ for (i = 0; i < n - 1; i++)
-+ memcpy(&d[i * j], &s[i * t], j);
-+
-+ /* the last section */
-+ memcpy(&d[i * j], &s[i * t], len - i * j);
-+ } else {
-+ for (i = 0; i < n - 1; i++)
-+ memcpy(&s[i * t], &d[i * j], j);
++ __raw_writesl(flexcan->hwmb + buf_no * sizeof(*mb), mb, sizeof(*mb));
++}
+
-+ /* the last section */
-+ memcpy(&s[i * t], &d[i * j], len - i * j);
-+ }
++#ifdef CONFIG_CAN_DEBUG_DEVICES
++static int flexcan_dump_reg(struct flexcan_device *flexcan, char *buf)
++{
++ int ret = 0;
++ unsigned int reg;
++
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ ret += sprintf(buf + ret, "MCR::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_CTRL);
++ ret += sprintf(buf + ret, "CTRL::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_RXGMASK);
++ ret += sprintf(buf + ret, "RXGMASK::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_RX14MASK);
++ ret += sprintf(buf + ret, "RX14MASK::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_RX15MASK);
++ ret += sprintf(buf + ret, "RX15MASK::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_ECR);
++ ret += sprintf(buf + ret, "ECR::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_ESR);
++ ret += sprintf(buf + ret, "ESR::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_IMASK2);
++ ret += sprintf(buf + ret, "IMASK2::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_IMASK1);
++ ret += sprintf(buf + ret, "IMASK1::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_IFLAG2);
++ ret += sprintf(buf + ret, "IFLAG2::0x%08x\n", reg);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_IFLAG1);
++ ret += sprintf(buf + ret, "IFLAG1::0x%08x\n", reg);
++ return ret;
+}
+
-+/*!
-+ * This function polls the NFC to wait for the basic operation to complete by
-+ * checking the INT bit of config2 register.
-+ *
-+ * @param retries number of retry attempts (separated by 1 us)
-+ * @param useirq True if IRQ should be used rather than polling
-+ */
-+static void wait_op_done(struct mxc_mtd_s *mxc_nand_data, int retries, bool useirq)
++static int flexcan_dump_xmit_mb(struct flexcan_device *flexcan, char *buf)
+{
-+ u32 nfc_stat;
-+ static unsigned long max_wait[2];
-+ unsigned long timeout = msecs_to_jiffies(retries);
-+ int op;
-+
-+ nfc_stat = nfc_read_reg(mxc_nand_data, REG_NFC_OPS_STAT);
-+ op = nfc_stat & 0xff;
-+ DBG(2, "%s: cmd: 0x%02x op: 0x%02x irq: %d\n", __FUNCTION__,
-+ __raw_readw(mxc_nand_data->reg_base + REG_NFC_FLASH_CMD),
-+ op, useirq);
-+ if (useirq) {
-+ if (!(nfc_stat & NFC_OPS_STAT)) {
-+ /* Enable Interrupt */
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data,
-+ REG_NFC_INTERRUPT) & ~NFC_INT_MSK,
-+ REG_NFC_INTERRUPT);
-+ retries = wait_event_timeout(mxc_nand_data->irq_waitq,
-+ (nfc_stat = nfc_read_reg(mxc_nand_data,
-+ REG_NFC_OPS_STAT)) & NFC_OPS_STAT,
-+ timeout);
-+ }
-+ } else {
-+ while (!(nfc_stat & NFC_OPS_STAT) && retries-- > 0) {
-+ udelay(1);
-+ nfc_stat = nfc_read_reg(mxc_nand_data, REG_NFC_OPS_STAT);
++ int ret = 0, i;
++
++ clk_enable(flexcan->clk);
++ for (i = flexcan->xmit_maxmb + 1; i <= flexcan->maxmb; i++) {
++ int j;
++
++ ret += sprintf(buf + ret,
++ "mb[%d]::CS:0x%08x ID:0x%08x DATA",
++ i, flexcan->hwmb[i].mb_cs.data,
++ flexcan->hwmb[i].mb_id);
++ for (j = 0; j < sizeof(flexcan->hwmb[i].mb_data); j++) {
++ ret += sprintf(buf + ret, ":%02x",
++ flexcan->hwmb[i].mb_data[j]);
+ }
++ ret += sprintf(buf + ret, "\n");
+ }
-+ if (!(nfc_stat & NFC_OPS_STAT) && retries <= 0) {
-+ printk(KERN_ERR "%s: timeout waiting for NFC INT for cmd: 0x%02x op 0x%02x: %d\n",
-+ __FUNCTION__, __raw_readw(mxc_nand_data->reg_base +
-+ REG_NFC_FLASH_CMD), op, useirq);
-+ BUG();
-+ } else {
-+ unsigned long wait = (useirq ? timeout : TROP_US_DELAY) - retries;
-+ if (wait > max_wait[useirq]) {
-+ max_wait[useirq] = wait;
-+ DBG(2, "%s: ready(%d) after %lu ticks\n", __FUNCTION__,
-+ useirq, max_wait[useirq]);
++ clk_disable(flexcan->clk);
++ return ret;
++}
++
++static int flexcan_dump_rx_mb(struct flexcan_device *flexcan, char *buf)
++{
++ int ret = 0, i;
++
++ clk_enable(flexcan->clk);
++ for (i = 0; i <= flexcan->xmit_maxmb; i++) {
++ int j;
++
++ ret += sprintf(buf + ret,
++ "mb[%d]::CS:0x%08x ID:0x%08x DATA",
++ i, flexcan->hwmb[i].mb_cs.data,
++ flexcan->hwmb[i].mb_id);
++ for (j = 0; j < sizeof(flexcan->hwmb[i].mb_data); j++) {
++ ret += sprintf(buf + ret, ":%02x",
++ flexcan->hwmb[i].mb_data[j]);
+ }
++ ret += sprintf(buf + ret, "\n");
+ }
-+ WRITE_NFC_IP_REG(nfc_stat & ~NFC_OPS_STAT, REG_NFC_OPS_STAT);
-+ if (nfc_stat & NFC_OPS_STAT) {
-+ DBG(2, "%s: Done: irq: %d ticks: %d\n", __FUNCTION__, useirq, retries);
-+ } else {
-+ DBG(0, "%s: Failed: irq: %d\n", __FUNCTION__, useirq);
-+ }
++ clk_disable(flexcan->clk);
++ return ret;
+}
++#endif
+
-+static inline void send_atomic_cmd(struct mxc_mtd_s *mxc_nand_data, u16 cmd, bool useirq)
++static ssize_t flexcan_show_state(struct net_device *net, char *buf)
+{
-+ /* fill command */
-+ nfc_write_reg(mxc_nand_data, cmd, REG_NFC_FLASH_CMD);
-+
-+ /* clear status */
-+ ACK_OPS;
-+
-+ /* send out command */
-+ nfc_write_reg(mxc_nand_data, NFC_CMD, REG_NFC_OPS);
-+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, useirq);
++ int ret, esr;
++ struct flexcan_device *flexcan = netdev_priv(net);
++
++ ret = sprintf(buf, "%s::", netif_running(net) ? "Start" : "Stop");
++ if (netif_carrier_ok(net)) {
++ esr = flexcan_reg_read(flexcan, CAN_HW_REG_ESR);
++ switch ((esr & __ESR_FLT_CONF_MASK) >> __ESR_FLT_CONF_OFF) {
++ case 0:
++ ret += sprintf(buf + ret, "normal\n");
++ break;
++ case 1:
++ ret += sprintf(buf + ret, "error passive\n");
++ break;
++ default:
++ ret += sprintf(buf + ret, "bus off\n");
++ }
++ } else
++ ret += sprintf(buf + ret, "bus off\n");
++ return ret;
+}
+
-+static void mxc_do_addr_cycle(struct mtd_info *mtd, int column, int page_addr);
-+static int mxc_check_ecc_status(struct mtd_info *mtd);
++static ssize_t flexcan_show_attr(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ int attr_id;
++ struct net_device *net = dev_get_drvdata(dev);
++ struct flexcan_device *flexcan = netdev_priv(net);
++
++ attr_id = attr - flexcan_dev_attr;
++ switch (attr_id) {
++ case FLEXCAN_ATTR_STATE:
++ return flexcan_show_state(net, buf);
++ case FLEXCAN_ATTR_BITRATE:
++ return sprintf(buf, "%d\n", flexcan->bitrate);
++ case FLEXCAN_ATTR_BR_PRESDIV:
++ return sprintf(buf, "%d\n", flexcan->br_presdiv + 1);
++ case FLEXCAN_ATTR_BR_RJW:
++ return sprintf(buf, "%d\n", flexcan->br_rjw);
++ case FLEXCAN_ATTR_BR_PROPSEG:
++ return sprintf(buf, "%d\n", flexcan->br_propseg + 1);
++ case FLEXCAN_ATTR_BR_PSEG1:
++ return sprintf(buf, "%d\n", flexcan->br_pseg1 + 1);
++ case FLEXCAN_ATTR_BR_PSEG2:
++ return sprintf(buf, "%d\n", flexcan->br_pseg2 + 1);
++ case FLEXCAN_ATTR_BR_CLKSRC:
++ return sprintf(buf, "%s\n", flexcan->br_clksrc ? "bus" : "osc");
++ case FLEXCAN_ATTR_MAXMB:
++ return sprintf(buf, "%d\n", flexcan->maxmb + 1);
++ case FLEXCAN_ATTR_XMIT_MAXMB:
++ return sprintf(buf, "%d\n", flexcan->xmit_maxmb + 1);
++ case FLEXCAN_ATTR_FIFO:
++ return sprintf(buf, "%d\n", flexcan->fifo);
++ case FLEXCAN_ATTR_WAKEUP:
++ return sprintf(buf, "%d\n", flexcan->wakeup);
++ case FLEXCAN_ATTR_SRX_DIS:
++ return sprintf(buf, "%d\n", flexcan->srx_dis);
++ case FLEXCAN_ATTR_WAK_SRC:
++ return sprintf(buf, "%d\n", flexcan->wak_src);
++ case FLEXCAN_ATTR_BCC:
++ return sprintf(buf, "%d\n", flexcan->bcc);
++ case FLEXCAN_ATTR_LOCAL_PRIORITY:
++ return sprintf(buf, "%d\n", flexcan->lprio);
++ case FLEXCAN_ATTR_ABORT:
++ return sprintf(buf, "%d\n", flexcan->abort);
++ case FLEXCAN_ATTR_LOOPBACK:
++ return sprintf(buf, "%d\n", flexcan->loopback);
++ case FLEXCAN_ATTR_SMP:
++ return sprintf(buf, "%d\n", flexcan->smp);
++ case FLEXCAN_ATTR_BOFF_REC:
++ return sprintf(buf, "%d\n", flexcan->boff_rec);
++ case FLEXCAN_ATTR_TSYN:
++ return sprintf(buf, "%d\n", flexcan->tsyn);
++ case FLEXCAN_ATTR_LISTEN:
++ return sprintf(buf, "%d\n", flexcan->listen);
++ case FLEXCAN_ATTR_EXTEND_MSG:
++ return sprintf(buf, "%d\n", flexcan->ext_msg);
++ case FLEXCAN_ATTR_STANDARD_MSG:
++ return sprintf(buf, "%d\n", flexcan->std_msg);
++#ifdef CONFIG_CAN_DEBUG_DEVICES
++ case FLEXCAN_ATTR_DUMP_REG:
++ return flexcan_dump_reg(flexcan, buf);
++ case FLEXCAN_ATTR_DUMP_XMIT_MB:
++ return flexcan_dump_xmit_mb(flexcan, buf);
++ case FLEXCAN_ATTR_DUMP_RX_MB:
++ return flexcan_dump_rx_mb(flexcan, buf);
++#endif
++ default:
++ return sprintf(buf, "%s:%p->%p\n", __func__, flexcan_dev_attr,
++ attr);
++ }
++}
+
-+#ifdef NFC_AUTO_MODE_ENABLE
-+/*!
-+ * This function handle the interleave related work
-+ * @param mtd mtd info
-+ * @param cmd command
-+ */
-+static void auto_cmd_interleave(struct mtd_info *mtd, u16 cmd)
++static ssize_t flexcan_set_attr(struct device *dev,
++ struct device_attribute *attr, const char *buf,
++ size_t count)
+{
-+ u32 i;
-+ u32 j = num_of_interleave;
-+ struct nand_chip *this = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ u32 addr_low = nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR0);
-+ u32 addr_high = nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR8);
-+ u32 page_addr = addr_low >> 16 | addr_high << 16;
-+ u8 *dbuf = mxc_nand_data->data_buf;
-+ u8 *obuf = mxc_nand_data->oob_buf;
-+ u32 dlen = mtd->writesize / j;
-+ u32 olen = mtd->oobsize / j;
-+
-+ /* adjust the addr value
-+ * since ADD_OP mode is 01
-+ */
-+ if (j > 1)
-+ page_addr *= j;
-+ else
-+ page_addr *= this->numchips;
++ int attr_id, tmp;
++ struct net_device *net = dev_get_drvdata(dev);
++ struct flexcan_device *flexcan = netdev_priv(net);
+
-+ switch (cmd) {
-+ case NAND_CMD_PAGEPROG:
-+ for (i = 0; i < j; i++) {
-+ /* reset addr cycle */
-+ if (j > 1)
-+ mxc_do_addr_cycle(mtd, 0, page_addr++);
++ attr_id = attr - flexcan_dev_attr;
+
-+ /* data transfer */
-+ memcpy(mxc_nand_data->main_buf, dbuf, dlen);
-+ copy_spare(mtd, obuf, mxc_nand_data->spare_buf, olen, false);
++ mutex_lock(&flexcan->mutex);
+
-+ /* update the value */
-+ dbuf += dlen;
-+ obuf += olen;
++ if (netif_running(net))
++ goto set_finish;
+
-+ NFC_SET_RBA(0);
-+ ACK_OPS;
-+ nfc_write_reg(mxc_nand_data, NFC_AUTO_PROG, REG_NFC_OPS);
++ if (attr_id == FLEXCAN_ATTR_BR_CLKSRC) {
++ if (!strcasecmp(buf, "bus"))
++ flexcan->br_clksrc = 1;
++ else if (!strcasecmp(buf, "osc"))
++ flexcan->br_clksrc = 0;
++ goto set_finish;
++ }
+
-+ /* wait auto_prog_done bit set */
-+ while (!(raw_read(REG_NFC_OPS_STAT) & NFC_OP_DONE)) ;
++ tmp = simple_strtoul(buf, NULL, 0);
++ switch (attr_id) {
++ case FLEXCAN_ATTR_BITRATE:
++ flexcan_set_bitrate(flexcan, tmp);
++ break;
++ case FLEXCAN_ATTR_BR_PRESDIV:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_PRESDIV)) {
++ flexcan->br_presdiv = tmp - 1;
++ flexcan_update_bitrate(flexcan);
+ }
-+
-+ wait_op_done(TROP_US_DELAY, false);
-+ while (!(raw_read(REG_NFC_OPS_STAT) & NFC_RB)) ;
-+
+ break;
-+ case NAND_CMD_READSTART:
-+ for (i = 0; i < j; i++) {
-+ /* reset addr cycle */
-+ if (j > 1)
-+ mxc_do_addr_cycle(mtd, 0, page_addr++);
-+
-+ NFC_SET_RBA(0);
-+ ACK_OPS;
-+ nfc_write_reg(mxc_nand_data, NFC_AUTO_READ, REG_NFC_OPS);
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true);
-+
-+ /* check ecc error */
-+ mxc_check_ecc_status(mtd);
-+
-+ /* data transfer */
-+ memcpy(dbuf, mxc_nand_data->main_buf, dlen);
-+ copy_spare(mtd, obuf, mxc_nand_data->spare_buf, olen, true);
-+
-+ /* update the value */
-+ dbuf += dlen;
-+ obuf += olen;
++ case FLEXCAN_ATTR_BR_RJW:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_RJW))
++ flexcan->br_rjw = tmp - 1;
++ break;
++ case FLEXCAN_ATTR_BR_PROPSEG:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_PROPSEG)) {
++ flexcan->br_propseg = tmp - 1;
++ flexcan_update_bitrate(flexcan);
+ }
+ break;
-+ case NAND_CMD_ERASE2:
-+ for (i = 0; i < j; i++) {
-+ if (!i) {
-+ page_addr = addr_low;
-+ page_addr *= (j > 1 ? j : this->numchips);
++ case FLEXCAN_ATTR_BR_PSEG1:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_PSEG1)) {
++ flexcan->br_pseg1 = tmp - 1;
++ flexcan_update_bitrate(flexcan);
++ }
++ break;
++ case FLEXCAN_ATTR_BR_PSEG2:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_PSEG2)) {
++ flexcan->br_pseg2 = tmp - 1;
++ flexcan_update_bitrate(flexcan);
++ }
++ break;
++ case FLEXCAN_ATTR_MAXMB:
++ if ((tmp > 0) && (tmp <= FLEXCAN_MAX_MB)) {
++ if (flexcan->maxmb != (tmp - 1)) {
++ flexcan->maxmb = tmp - 1;
++ if (flexcan->xmit_maxmb < flexcan->maxmb)
++ flexcan->xmit_maxmb = flexcan->maxmb;
+ }
-+ mxc_do_addr_cycle(mtd, -1, page_addr++);
-+ ACK_OPS;
-+ nfc_write_reg(NFC_AUTO_ERASE, REG_NFC_OPS);
-+ wait_op_done(TROP_US_DELAY, true);
+ }
+ break;
-+ case NAND_CMD_RESET:
-+ for (i = 0; i < j; i++) {
-+ if (j > 1)
-+ NFC_SET_NFC_ACTIVE_CS(i);
-+ send_atomic_cmd(cmd, false);
++ case FLEXCAN_ATTR_XMIT_MAXMB:
++ if ((tmp > 0) && (tmp <= (flexcan->maxmb + 1))) {
++ if (flexcan->xmit_maxmb != (tmp - 1))
++ flexcan->xmit_maxmb = tmp - 1;
+ }
+ break;
-+ }
-+}
-+#endif
-+
-+static void send_addr(struct mxc_mtd_s *mxc_nand_data, u16 addr, bool useirq);
-+
-+/*!
-+ * This function issues the specified command to the NAND device and
-+ * waits for completion.
-+ *
-+ * @param cmd command for NAND Flash
-+ * @param useirq True if IRQ should be used rather than polling
-+ */
-+static void send_cmd(struct mtd_info *mtd, u16 cmd, bool useirq)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+
-+ DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(0x%x, %d)\n", cmd, useirq);
-+
-+#ifdef NFC_AUTO_MODE_ENABLE
-+ switch (cmd) {
-+ case NAND_CMD_READ0:
-+ case NAND_CMD_READOOB:
-+ nfc_write_reg(mxc_nand_data, NAND_CMD_READ0, REG_NFC_FLASH_CMD);
++ case FLEXCAN_ATTR_FIFO:
++ flexcan->fifo = !!tmp;
+ break;
-+ case NAND_CMD_SEQIN:
-+ case NAND_CMD_ERASE1:
-+ nfc_write_reg(mxc_nand_data, cmd, REG_NFC_FLASH_CMD);
++ case FLEXCAN_ATTR_WAKEUP:
++ flexcan->wakeup = !!tmp;
+ break;
-+ case NAND_CMD_PAGEPROG:
-+ case NAND_CMD_ERASE2:
-+ case NAND_CMD_READSTART:
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_FLASH_CMD) |
-+ cmd << NFC_CMD_1_SHIFT,
-+ REG_NFC_FLASH_CMD);
-+ auto_cmd_interleave(mtd, cmd);
++ case FLEXCAN_ATTR_SRX_DIS:
++ flexcan->srx_dis = !!tmp;
++ break;
++ case FLEXCAN_ATTR_WAK_SRC:
++ flexcan->wak_src = !!tmp;
++ break;
++ case FLEXCAN_ATTR_BCC:
++ flexcan->bcc = !!tmp;
++ break;
++ case FLEXCAN_ATTR_LOCAL_PRIORITY:
++ flexcan->lprio = !!tmp;
++ break;
++ case FLEXCAN_ATTR_ABORT:
++ flexcan->abort = !!tmp;
++ break;
++ case FLEXCAN_ATTR_LOOPBACK:
++ flexcan->loopback = !!tmp;
++ break;
++ case FLEXCAN_ATTR_SMP:
++ flexcan->smp = !!tmp;
+ break;
-+ case NAND_CMD_READID:
-+ send_atomic_cmd(mxc_nand_data, cmd, useirq);
-+ send_addr(mxc_nand_data, 0, false);
++ case FLEXCAN_ATTR_BOFF_REC:
++ flexcan->boff_rec = !!tmp;
+ break;
-+ case NAND_CMD_RESET:
-+ auto_cmd_interleave(mtd, cmd);
-+ case NAND_CMD_STATUS:
++ case FLEXCAN_ATTR_TSYN:
++ flexcan->tsyn = !!tmp;
++ break;
++ case FLEXCAN_ATTR_LISTEN:
++ flexcan->listen = !!tmp;
++ break;
++ case FLEXCAN_ATTR_EXTEND_MSG:
++ flexcan->ext_msg = !!tmp;
++ break;
++ case FLEXCAN_ATTR_STANDARD_MSG:
++ flexcan->std_msg = !!tmp;
+ break;
+ }
-+#else
-+ send_atomic_cmd(mxc_nand_data, cmd, useirq);
-+#endif
++ set_finish:
++ mutex_unlock(&flexcan->mutex);
++ return count;
+}
+
-+/*!
-+ * This function sends an address (or partial address) to the
-+ * NAND device. The address is used to select the source/destination for
-+ * a NAND command.
-+ *
-+ * @param addr address to be written to NFC.
-+ * @param useirq True if IRQ should be used rather than polling
-+ */
-+static void send_addr(struct mxc_mtd_s *mxc_nand_data, u16 addr, bool useirq)
++static void flexcan_device_default(struct flexcan_device *dev)
+{
-+ DEBUG(MTD_DEBUG_LEVEL3, "send_addr(0x%x %d)\n", addr, useirq);
++ dev->br_clksrc = 1;
++ dev->br_rjw = 2;
++ dev->br_presdiv = 6;
++ dev->br_propseg = 4;
++ dev->br_pseg1 = 4;
++ dev->br_pseg2 = 7;
++
++ dev->bcc = 1;
++ dev->srx_dis = 1;
++ dev->smp = 1;
++ dev->abort = 1;
++
++ dev->maxmb = FLEXCAN_MAX_MB - 1;
++ dev->xmit_maxmb = (FLEXCAN_MAX_MB >> 1) - 1;
++ dev->xmit_mb = dev->maxmb - dev->xmit_maxmb;
++
++ dev->ext_msg = 1;
++ dev->std_msg = 1;
++}
+
-+ /* fill address */
-+ nfc_write_reg(mxc_nand_data, (addr << NFC_FLASH_ADDR_SHIFT),
-+ REG_NFC_FLASH_ADDR);
++static int flexcan_device_attach(struct flexcan_device *flexcan)
++{
++ int ret;
++ struct resource *res;
++ struct platform_device *pdev = flexcan->dev;
++ struct flexcan_platform_data *plat_data = pdev->dev.platform_data;
++ int irq;
+
-+ /* clear status */
-+ ACK_OPS;
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res)
++ return -ENODEV;
+
-+ /* send out address */
-+ nfc_write_reg(mxc_nand_data, NFC_ADDR, REG_NFC_OPS);
++ irq = platform_get_irq(pdev, 0);
++ if (irq < 0)
++ return -ENODEV;
+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, useirq);
-+}
++ if (!request_mem_region(res->start, resource_size(res), "flexcan")) {
++ return -EBUSY;
++ }
+
-+/*!
-+ * This function requests the NFC to initate the transfer
-+ * of data currently in the NFC RAM buffer to the NAND device.
-+ *
-+ * @param buf_id Specify Internal RAM Buffer number
-+ */
-+static void send_prog_page(struct mxc_mtd_s *mxc_nand_data, u8 buf_id)
-+{
-+#ifndef NFC_AUTO_MODE_ENABLE
-+ DEBUG(MTD_DEBUG_LEVEL0, "%s\n", __FUNCTION__);
++ flexcan->irq = irq;
++ flexcan->io_base = ioremap_nocache(res->start, resource_size(res));
++ if (!flexcan->io_base) {
++ ret = -ENOMEM;
++ goto release;
++ }
++ pdev_dbg(pdev, 0, "controller registers %08lx remapped to %p\n",
++ (unsigned long)res->start, flexcan->io_base);
+
-+ /* set ram buffer id */
-+ NFC_SET_RBA(buf_id);
++ flexcan->hwmb = flexcan->io_base + CAN_MB_BASE;
++ flexcan->rx_mask = flexcan->io_base + CAN_RXMASK_BASE;
+
-+ /* clear status */
-+ ACK_OPS;
++ flexcan->clk = clk_get(&pdev->dev, "can_clk");
++ if (IS_ERR(flexcan->clk)) {
++ ret = PTR_ERR(flexcan->clk);
++ dev_err(&pdev->dev, "Failed to get clock: %d\n", ret);
++ goto unmap;
++ }
++
++ if (plat_data) {
++ if (plat_data->active) {
++ ret = plat_data->active(pdev);
++ if (ret)
++ goto put_clk;
++ }
++ if (plat_data->core_reg) {
++ flexcan->core_reg = regulator_get(&pdev->dev,
++ plat_data->core_reg);
++ if (IS_ERR(flexcan->core_reg)) {
++ ret = PTR_ERR(flexcan->core_reg);
++ goto deactivate;
++ }
++ }
+
-+ /* transfer data from NFC ram to nand */
-+ nfc_write_reg(mxc_nand_data, NFC_INPUT, REG_NFC_OPS);
++ if (plat_data->io_reg) {
++ flexcan->io_reg = regulator_get(&pdev->dev,
++ plat_data->io_reg);
++ if (IS_ERR(flexcan->core_reg)) {
++ ret = PTR_ERR(flexcan->io_reg);
++ goto put_reg;
++ }
++ }
++ }
++ return 0;
+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true);
-+#endif
++ put_reg:
++ regulator_put(flexcan->core_reg);
++ deactivate:
++ if (plat_data->inactive)
++ plat_data->inactive(pdev);
++ put_clk:
++ clk_put(flexcan->clk);
++ unmap:
++ iounmap(flexcan->io_base);
++ release:
++ release_mem_region(res->start, resource_size(res));
++ return ret;
+}
+
-+/*!
-+ * This function requests the NFC to initated the transfer
-+ * of data from the NAND device into in the NFC ram buffer.
-+ *
-+ * @param buf_id Specify Internal RAM Buffer number
-+ */
-+static void send_read_page(struct mxc_mtd_s *mxc_nand_data, u8 buf_id)
++static void flexcan_device_detach(struct flexcan_device *flexcan)
+{
-+#ifndef NFC_AUTO_MODE_ENABLE
-+ DEBUG(MTD_DEBUG_LEVEL2, "%s(%d)\n", __FUNCTION__, buf_id);
++ struct platform_device *pdev = flexcan->dev;
++ struct flexcan_platform_data *plat_data = pdev->dev.platform_data;
++ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
-+ /* set ram buffer id */
-+ NFC_SET_RBA(buf_id);
++ BUG_ON(!res);
+
-+ /* clear status */
-+ ACK_OPS;
++ clk_put(flexcan->clk);
+
-+ /* transfer data from nand to NFC ram */
-+ nfc_write_reg(mxc_nand_data, NFC_OUTPUT, REG_NFC_OPS);
++ if (flexcan->io_reg) {
++ regulator_put(flexcan->io_reg);
++ }
+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true);
-+#endif
++ if (flexcan->core_reg) {
++ regulator_put(flexcan->core_reg);
++ }
++
++ if (plat_data && plat_data->inactive)
++ plat_data->inactive(pdev);
++
++ iounmap(flexcan->io_base);
++ release_mem_region(res->start, resource_size(res));
+}
+
-+/*!
-+ * This function requests the NFC to perform a read of the
-+ * NAND device ID.
-+ */
-+static void send_read_id(struct mxc_mtd_s *mxc_nand_data)
++static void flexcan_mbm_isr(struct work_struct *work);
++static void flexcan_err_handler(struct work_struct *work);
++
++static struct net_device *flexcan_device_alloc(struct platform_device *pdev,
++ void (*setup)(struct net_device *dev))
+{
-+ DBG(2, "%s: \n", __FUNCTION__);
++ struct flexcan_device *flexcan;
++ struct net_device *net;
++ int i, num;
++ int ret;
+
-+ /* Set RBA bits for BUFFER0 */
-+ NFC_SET_RBA(0);
++ net = alloc_netdev(sizeof(*flexcan), "can%d", setup);
++ if (net == NULL) {
++ pdev_err(pdev, "Failed to allocate netdevice\n");
++ return ERR_PTR(-ENOMEM);
++ }
++ flexcan = netdev_priv(net);
+
-+ /* clear status */
-+ ACK_OPS;
++ init_timer(&flexcan->timer);
++ mutex_init(&flexcan->mutex);
++ INIT_WORK(&flexcan->mb_work, flexcan_mbm_isr);
++ INIT_WORK(&flexcan->err_work, flexcan_err_handler);
+
-+ /* Read ID into main buffer */
-+ nfc_write_reg(mxc_nand_data, NFC_ID, REG_NFC_OPS);
++ flexcan->dev = pdev;
++ ret = flexcan_device_attach(flexcan);
++ if (ret) {
++ free_netdev(net);
++ return ERR_PTR(ret);
++ }
++ flexcan_device_default(flexcan);
++ flexcan_update_bitrate(flexcan);
+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true);
++ num = ARRAY_SIZE(flexcan_dev_attr);
++
++ for (i = 0; i < num; i++) {
++ ret = device_create_file(&pdev->dev, flexcan_dev_attr + i);
++ if (ret) {
++ pdev_err(pdev, "Failed to create attribute file %s: %d\n",
++ (flexcan_dev_attr + i)->attr.name, ret);
++ for (i--; i >= 0; i--)
++ device_remove_file(&pdev->dev, flexcan_dev_attr + i);
++ flexcan_device_detach(flexcan);
++ free_netdev(net);
++ return ERR_PTR(ret);
++ }
++ }
++ platform_set_drvdata(pdev, net);
++ return net;
+}
+
-+#ifdef NFC_AUTO_MODE_ENABLE
-+static inline void read_dev_status(u16 *status)
++static void flexcan_device_free(struct net_device *dev)
+{
-+ u32 mask = 0xFF << 16;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct platform_device *pdev = flexcan->dev;
++ int i;
+
-+ /* clear status */
-+ ACK_OPS;
++ ndev_dbg(dev, 0, "%s: Deleting timer\n", __FUNCTION__);
++ del_timer_sync(&flexcan->timer);
+
-+ do {
-+ /* send auto read status command */
-+ nfc_write_reg(NFC_AUTO_STATE, REG_NFC_OPS);
-+ if (cpu_is_mx51_rev(CHIP_REV_2_0) == 1)
-+ wait_op_done(TROP_US_DELAY, false);
-+ *status = (raw_read(NFC_CONFIG1) & mask) >> 16;
-+ } while ((*status & NAND_STATUS_READY) == 0);
++ ndev_dbg(dev, 0, "%s: Removing sysfs files\n", __FUNCTION__);
++ for (i = 0; i < ARRAY_SIZE(flexcan_dev_attr); i++)
++ device_remove_file(&pdev->dev, flexcan_dev_attr + i);
++
++ ndev_dbg(dev, 0, "%s: Detaching can device\n", __FUNCTION__);
++ flexcan_device_detach(flexcan);
++ ndev_dbg(dev, 0, "%s: Freeing net_device\n", __FUNCTION__);
++ free_netdev(dev);
+}
-+#endif
+
-+/*!
-+ * This function requests the NFC to perform a read of the
-+ * NAND device status and returns the current status.
-+ *
-+ * @return device status
-+ */
-+static u16 get_dev_status(struct mxc_mtd_s *mxc_nand_data)
++#define flexcan_swab32(x) \
++ (((x) << 24) | ((x) >> 24) | \
++ (((x) & (__u32)0x0000ff00UL) << 8) | \
++ (((x) & (__u32)0x00ff0000UL) >> 8))
++
++static inline void flexcan_mb_write(struct can_frame *frame, struct can_hw_mb __iomem *hwmb,
++ int code)
+{
-+#ifdef NFC_AUTO_MODE_ENABLE
+ int i;
-+ u16 status = 0;
-+ for (i = 0; i < num_of_interleave; i++) {
-+
-+ /* set ative cs */
-+ NFC_SET_NFC_ACTIVE_CS(i);
-+
-+ /* FIXME, NFC Auto erase may have
-+ * problem, have to poll it until
-+ * the nand get idle, otherwise
-+ * it may get error
-+ */
-+ read_dev_status(&status);
-+ if (status & NAND_STATUS_FAIL)
-+ break;
++ unsigned long __iomem *s = (unsigned long *)&frame->data[0];
++ unsigned long __iomem *d = (unsigned long *)&hwmb->mb_data[0];
++ struct can_hw_mb mb;
++ unsigned int can_id;
++ int n_words = (frame->can_dlc + 3) / sizeof(unsigned int);
++
++ mb.mb_cs.data = 0;
++ mb.mb_cs.cs.code = code;
++ mb.mb_cs.cs.length = frame->can_dlc;
++
++ mb.mb_cs.cs.rtr = !!(frame->can_id & CAN_RTR_FLAG);
++
++ if (frame->can_id & CAN_EFF_FLAG) {
++ mb.mb_cs.cs.ide = 1;
++ mb.mb_cs.cs.srr = 1;
++ can_id = frame->can_id & CAN_EFF_MASK;
++ } else {
++ mb.mb_cs.cs.ide = 0;
++ can_id = (frame->can_id & CAN_SFF_MASK) << 18;
+ }
+
-+ return status;
-+#else
-+ u8 val = 1;
-+ u16 *main_buf = mxc_nand_data->main_buf + val * (0x200 >> 1);
-+ u16 ret;
-+ u16 save = *main_buf;
-+
-+ /* Set ram buffer id */
-+ NFC_SET_RBA(val);
-+
-+ /* clear status */
-+ ACK_OPS;
-+
-+ if (dbg_lvl(3)) {
-+ for (val = 0; val < 8; val++) {
-+ u16 *main_buf = mxc_nand_data->main_buf + val * (0x200 >> 1);
-+ print_hex_dump(KERN_DEBUG, "mainbuf0: ",
-+ DUMP_PREFIX_ADDRESS,
-+ 16, 2, main_buf, 16, 0);
-+ }
++ DBG(0, "%s: writing can_id %08x to mb_id %p\n", __FUNCTION__, can_id, &hwmb->mb_id);
++ __raw_writel(can_id, &hwmb->mb_id);
++ for (i = 0; i < n_words; i++, s++, d++) {
++ DBG(0, "%s: writing data %08lx to mb_data %p\n", __FUNCTION__,
++ flexcan_swab32(*s), d);
++ __raw_writel(flexcan_swab32(*s), d);
+ }
++ DBG(0, "%s: Writing CS %08x to mb_cs %p\n", __FUNCTION__, mb.mb_cs.data, &hwmb->mb_cs);
++ __raw_writel(mb.mb_cs.data, &hwmb->mb_cs.data);
++}
+
-+ /* Read status into main buffer */
-+ nfc_write_reg(mxc_nand_data, NFC_STATUS, REG_NFC_OPS);
++static inline void flexcan_mb_read(struct can_frame *frame, struct can_hw_mb __iomem *hwmb)
++{
++ int i;
++ unsigned long __iomem *s = (unsigned long *)&hwmb->mb_data[0];
++ unsigned long __iomem *d = (unsigned long *)&frame->data[0];
++ struct can_hw_mb mb;
++ unsigned int can_id;
++ int n_words;
+
-+ /* Wait for operation to complete */
-+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true);
++ mb.mb_cs.data = __raw_readl(&hwmb->mb_cs);
++ BUG_ON(mb.mb_cs.cs.code & CAN_MB_RX_BUSY);
+
-+ if (dbg_lvl(3)) {
-+ for (val = 0; val < 8; val++) {
-+ u16 *main_buf = mxc_nand_data->main_buf + val * (0x200 >> 1);
-+ print_hex_dump(KERN_DEBUG, "mainbuf1: ",
-+ DUMP_PREFIX_ADDRESS,
-+ 16, 2, main_buf, 16, 0);
-+ }
-+ }
++ can_id = __raw_readl(&hwmb->mb_id);
+
-+ /* Status is placed in first word of main buffer */
-+ /* get status, then recover area 1 data */
-+ ret = *main_buf;
-+ *main_buf = save;
++ if (mb.mb_cs.cs.ide)
++ frame->can_id = (can_id & CAN_EFF_MASK) | CAN_EFF_FLAG;
++ else
++ frame->can_id = (can_id >> 18) & CAN_SFF_MASK;
++ if (mb.mb_cs.cs.rtr)
++ frame->can_id |= CAN_RTR_FLAG;
+
-+ return ret;
-+#endif
++ frame->can_dlc = mb.mb_cs.cs.length;
++ if (frame->can_dlc == 0 || frame->can_dlc > 8)
++ return;
++
++ n_words = (frame->can_dlc + 3) / sizeof(unsigned int);
++ for (i = 0; i < n_words; i++, s++, d++)
++ *d = flexcan_swab32(__raw_readl(s));
+}
+
-+static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode)
++static inline void flexcan_memcpy(void *dst, void *src, int len)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ int i;
++ unsigned int __iomem *d = dst, *s = src;
+
-+ nfc_write_reg(mxc_nand_data,
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_EN) | NFC_ECC_EN),
-+ REG_NFC_ECC_EN);
-+ return;
++ DBG(2, "%s: Copying %u byte from %p to %p\n", __FUNCTION__, len, s, d);
++ WARN_ON(len & 3);
++ len = (len + 3) >> 2;
++ for (i = 0; i < len; i++, s++, d++)
++ __raw_writel(flexcan_swab32(*s), d);
++ if (dbg_lvl(1)) {
++ print_hex_dump(KERN_DEBUG, "swdat: ", DUMP_PREFIX_OFFSET, 16, 4,
++ src, len << 2, 0);
++ print_hex_dump(KERN_DEBUG, "hwdat: ", DUMP_PREFIX_OFFSET, 16, 4,
++ dst, len << 2, 0);
++ }
+}
+
-+/*
-+ * Function to record the ECC corrected/uncorrected errors resulted
-+ * after a page read. This NFC detects and corrects upto to 4 symbols
-+ * of 9-bits each.
-+ */
-+static int mxc_check_ecc_status(struct mtd_info *mtd)
++static inline struct can_frame *flexcan_skb_put(struct sk_buff *skb, unsigned int len)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ int no_subpages = (mtd->writesize >> 9) / num_of_interleave;
-+ int ret = 0;
-+ u8 ecc_bit_mask = (IS_4BIT_ECC ? 0x7 : 0xf);
-+ u8 err_limit = (IS_4BIT_ECC ? 0x4 : 0x8);
-+ u32 ecc_stat;
-+
-+ ecc_stat = GET_NFC_ECC_STATUS();
-+ do {
-+ u32 err = ecc_stat & ecc_bit_mask;
-+ if (err > err_limit) {
-+ mtd->ecc_stats.failed++;
-+ printk(KERN_WARNING "UnCorrectable RS-ECC Error\n");
-+ return -EILSEQ;
-+ } else {
-+ ret += err;
-+ }
-+ ecc_stat >>= 4;
-+ } while (--no_subpages);
-+
-+ mtd->ecc_stats.corrected += ret;
-+ pr_debug("%d Symbol Correctable RS-ECC Error\n", ret);
-+
-+ return ret;
++ return (struct can_frame *)skb_put(skb, len);
+}
+
-+/*
-+ * Function to correct the detected errors. This NFC corrects all the errors
-+ * detected. So this function just return 0.
-+ */
-+static int mxc_nand_correct_data(struct mtd_info *mtd, u_char *dat,
-+ u_char *read_ecc, u_char *calc_ecc)
++static inline struct can_frame *flexcan_skb_data(struct sk_buff *skb)
+{
-+ return 0;
++ BUG_ON(skb == NULL);
++ return (struct can_frame *)skb->data;
+}
+
-+/*
-+ * Function to calculate the ECC for the data to be stored in the Nand device.
-+ * This NFC has a hardware RS(511,503) ECC engine together with the RS ECC
-+ * CONTROL blocks are responsible for detection and correction of up to
-+ * 8 symbols of 9 bits each in 528 byte page.
-+ * So this function is just return 0.
-+ */
-+
-+static int mxc_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
-+ u_char *ecc_code)
++static struct net_device_stats *flexcan_get_stats(struct net_device *dev)
+{
-+ return 0;
++ ndev_dbg(dev, 3, "%s@%d: \n", __FUNCTION__, __LINE__);
++ if (!netif_running(dev))
++ return &dev->stats;
++ ndev_dbg(dev, 3, "%s@%d: \n", __FUNCTION__, __LINE__);
++ return &dev->stats;
+}
+
-+/*!
-+ * This function id is used to read the data buffer from the NAND Flash. To
-+ * read the data from NAND Flash first the data output cycle is initiated by
-+ * the NFC, which copies the data to RAMbuffer. This data of length \b len is
-+ * then copied to buffer \b buf.
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ * @param buf data to be read from NAND Flash
-+ * @param len number of bytes to be read
-+ */
-+static void mxc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
++static void flexcan_mb_bottom(struct net_device *dev, int index)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ u16 col = mxc_nand_data->col_addr;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct net_device_stats *stats = flexcan_get_stats(dev);
++ struct can_hw_mb __iomem *hwmb;
++ struct can_frame *frame;
++ struct sk_buff *skb;
++ struct can_hw_mb mb;
+
-+ if (mtd->writesize) {
-+ int j = mtd->writesize - col;
-+ int n = min((int)mtd->oobsize + j, len);
++ ndev_dbg(dev, 1, "%s: index: %d\n", __FUNCTION__, index);
+
-+ if (j > 0) {
-+ if (WARN_ON(n > j)) {
-+ memcpy(buf, &mxc_nand_data->data_buf[col], j);
-+ memcpy(buf + j, &mxc_nand_data->oob_buf[0], n - j);
-+ } else {
-+ memcpy(buf, &mxc_nand_data->data_buf[col], n);
++ hwmb = flexcan->hwmb + index;
++ mb.mb_cs.data = __raw_readl(&hwmb->mb_cs.data);
++ if (flexcan->fifo ||
++ index >= flexcan->maxmb - flexcan->xmit_maxmb) {
++ /* handle transmit MBs */
++
++ if (mb.mb_cs.cs.code == CAN_MB_TX_ABORT) {
++ mb.mb_cs.cs.code = CAN_MB_TX_INACTIVE;
++ __raw_writel(mb.mb_cs.data, &hwmb->mb_cs.data);
++ }
++ if (mb.mb_cs.cs.code & CAN_MB_TX_INACTIVE) {
++ if (flexcan->xmit_buffers++ == 0) {
++ ndev_dbg(dev, 1, "%s: Starting netif queue\n", __FUNCTION__);
++ netif_start_queue(dev);
+ }
-+ } else {
-+ col -= mtd->writesize;
-+ memcpy(buf, &mxc_nand_data->oob_buf[col], len);
++ BUG_ON(flexcan->xmit_buffers > flexcan->maxmb - flexcan->xmit_maxmb);
++ return;
+ }
++ /* if fifo is enabled all RX MBs should be handled in the fifo_isr */
++ BUG();
++ }
++ if (dbg_lvl(1))
++ print_hex_dump(KERN_DEBUG, "rx_mb: ", DUMP_PREFIX_OFFSET, 16, 4,
++ hwmb, sizeof(*hwmb), 0);
++ /* handle RX MB in case fifo is not used */
++ BUG_ON(flexcan->fifo);
++ if (mb.mb_cs.cs.code & CAN_MB_RX_BUSY) {
++ ndev_dbg(dev, -1, "%s: MB[%02x] is busy: %x\n", __FUNCTION__,
++ index, mb.mb_cs.cs.code);
++ /* unlock buffer */
++ (void)flexcan_reg_read(flexcan, CAN_HW_REG_TIMER);
++ return;
++ }
+
-+ /* update */
-+ mxc_nand_data->col_addr += n;
++ skb = dev_alloc_skb(sizeof(struct can_frame));
++ if (skb) {
++ frame = flexcan_skb_put(skb, sizeof(*frame));
++ flexcan_mb_read(frame, hwmb);
++ /* unlock buffer */
++ (void)flexcan_reg_read(flexcan, CAN_HW_REG_TIMER);
++
++ dev->last_rx = jiffies;
++ stats->rx_packets++;
++ stats->rx_bytes += frame->can_dlc;
++
++ skb->dev = dev;
++ skb->protocol = __constant_htons(ETH_P_CAN);
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++ netif_receive_skb(skb);
+ } else {
-+ /* At flash identify phase,
-+ * mtd->writesize has not been
-+ * set correctly, it should
-+ * be zero. And len will less 2
-+ */
-+ memcpy(buf, &mxc_nand_data->data_buf[col], len);
++ flexcan_dbg(flexcan, 0, "%s: Could not allocate SKB; dropping packet\n",
++ __FUNCTION__);
+
-+ /* update */
-+ mxc_nand_data->col_addr += len;
++ stats->rx_dropped++;
+ }
+}
+
-+/*!
-+ * This function reads byte from the NAND Flash
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ *
-+ * @return data read from the NAND Flash
-+ */
-+static u8 mxc_nand_read_byte(struct mtd_info *mtd)
++static void flexcan_fifo_isr(struct net_device *dev, unsigned int iflag1)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ u8 ret;
-+
-+ /* Check for status request */
-+ if (mxc_nand_data->status_req) {
-+ ret = get_dev_status(mxc_nand_data) & 0xFF;
-+ DBG(1, "%s: NAND status=%02x\n", __FUNCTION__, ret);
-+ return ret;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct net_device_stats *stats = flexcan_get_stats(dev);
++ struct sk_buff *skb;
++ struct can_hw_mb __iomem *hwmb = flexcan->hwmb;
++ struct can_frame *frame;
++
++ ndev_dbg(dev, 2, "%s: \n", __FUNCTION__);
++ if (dbg_lvl(1))
++ print_hex_dump(KERN_DEBUG, "rx_mb: ", DUMP_PREFIX_OFFSET, 16, 4,
++ hwmb, sizeof(*hwmb), 0);
++ if (iflag1 & __FIFO_RDY_INT) {
++ skb = dev_alloc_skb(sizeof(struct can_frame));
++ if (skb) {
++ frame = flexcan_skb_put(skb, sizeof(*frame));
++ flexcan_mb_read(frame, hwmb);
++ /* unlock mb */
++ (void) flexcan_reg_read(flexcan, CAN_HW_REG_TIMER);
++
++ dev->last_rx = jiffies;
++
++ stats->rx_packets++;
++ stats->rx_bytes += frame->can_dlc;
++
++ skb->dev = dev;
++ skb->protocol = __constant_htons(ETH_P_CAN);
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++ netif_receive_skb(skb);
++ } else {
++ (void)__raw_readl(&hwmb->mb_cs.data);
++ /* unlock mb */
++ (void) flexcan_reg_read(flexcan, CAN_HW_REG_TIMER);
++ }
+ }
+
-+ mxc_nand_read_buf(mtd, &ret, 1);
-+ return ret;
++ if (iflag1 & (__FIFO_OV_INT | __FIFO_WARN_INT)) {
++ skb = dev_alloc_skb(sizeof(struct can_frame));
++ if (skb) {
++ frame = flexcan_skb_put(skb, sizeof(*frame));
++ frame->can_id = CAN_ERR_FLAG | CAN_ERR_CRTL;
++ frame->can_dlc = CAN_ERR_DLC;
++ if (iflag1 & __FIFO_WARN_INT)
++ frame->data[1] |=
++ CAN_ERR_CRTL_TX_WARNING |
++ CAN_ERR_CRTL_RX_WARNING;
++ if (iflag1 & __FIFO_OV_INT)
++ frame->data[1] |= CAN_ERR_CRTL_RX_OVERFLOW;
++ if (dbg_lvl(1))
++ print_hex_dump(KERN_DEBUG, "err_mb: ", DUMP_PREFIX_OFFSET, 16, 4,
++ frame, sizeof(*frame), 0);
++
++ skb->dev = dev;
++ skb->protocol = __constant_htons(ETH_P_CAN);
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++ netif_receive_skb(skb);
++ }
++ }
+}
+
-+/*!
-+ * This function reads word from the NAND Flash
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ *
-+ * @return data read from the NAND Flash
-+ */
-+static u16 mxc_nand_read_word(struct mtd_info *mtd)
++/*
++ * called by CAN ISR to handle mb events.
++ */
++static void flexcan_mbm_isr(struct work_struct *work)
+{
-+ u16 ret;
++ struct flexcan_device *flexcan = container_of(work, struct flexcan_device, mb_work);
++ struct net_device *dev = platform_get_drvdata(flexcan->dev);
++ int i, iflag1, iflag2, maxmb;
++
++ i = 0;
++
++ ndev_dbg(dev, 2, "%s: \n", __FUNCTION__);
++
++ iflag1 = flexcan_reg_read(flexcan, CAN_HW_REG_IFLAG1) &
++ flexcan_reg_read(flexcan, CAN_HW_REG_IMASK1);
++ if (flexcan->maxmb > 31) {
++ maxmb = flexcan->maxmb + 1 - 32;
++ iflag2 = flexcan_reg_read(flexcan, CAN_HW_REG_IFLAG2) &
++ flexcan_reg_read(flexcan, CAN_HW_REG_IMASK2);
++ iflag2 &= (1 << maxmb) - 1;
++ maxmb = 32;
++ } else {
++ maxmb = flexcan->maxmb + 1;
++ iflag1 &= (1 << maxmb) - 1;
++ iflag2 = 0;
++ }
+
-+ mxc_nand_read_buf(mtd, (u8 *)&ret, sizeof(u16));
-+ return ret;
-+}
++ ndev_dbg(dev, 2, "%s: loop=%d iflag1=%08x\n", __FUNCTION__, i, iflag1);
+
-+/*!
-+ * This function reads byte from the NAND Flash
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ *
-+ * @return data read from the NAND Flash
-+ */
-+static u_char mxc_nand_read_byte16(struct mtd_info *mtd)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG1, iflag1);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG2, iflag2);
+
-+ /* Check for status request */
-+ if (mxc_nand_data->status_req) {
-+ return get_dev_status(mxc_nand_data) & 0xFF;
++ if (flexcan->fifo) {
++ flexcan_fifo_isr(dev, iflag1);
++ iflag1 &= ~0xFF;
++ }
++ for (i = 0; iflag1 && (i < maxmb); i++) {
++ if (iflag1 & (1 << i)) {
++ iflag1 &= ~(1 << i);
++ flexcan_mb_bottom(dev, i);
++ }
+ }
+
-+ return mxc_nand_read_word(mtd) & 0xFF;
++ for (i = maxmb; iflag2 && (i <= flexcan->maxmb); i++) {
++ if (iflag2 & (1 << (i - 32))) {
++ iflag2 &= ~(1 << (i - 32));
++ flexcan_mb_bottom(dev, i);
++ }
++ }
++ enable_irq(flexcan->irq);
+}
+
-+/*!
-+ * This function writes data of length \b len from buffer \b buf to the NAND
-+ * internal RAM buffer's MAIN area 0.
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ * @param buf data to be written to NAND Flash
-+ * @param len number of bytes to be written
-+ */
-+static void mxc_nand_write_buf(struct mtd_info *mtd,
-+ const u_char *buf, int len)
++static int flexcan_mbm_xmit(struct flexcan_device *flexcan, struct can_frame *frame)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ u16 col = mxc_nand_data->col_addr;
-+ int j = mtd->writesize - col;
-+ int n = mtd->oobsize + j;
++ int i = flexcan->xmit_mb;
++ struct can_hw_mb __iomem *hwmb = flexcan->hwmb;
++ static int last;
++
++ if (flexcan->xmit_buffers != last) {
++ flexcan_dbg(flexcan, 1, "%s: %d free buffers\n", __FUNCTION__,
++ flexcan->xmit_buffers);
++ last = flexcan->xmit_buffers;
++ }
++ do {
++ struct can_hw_mb mb;
+
-+ n = min(n, len);
++ mb.mb_cs.data = __raw_readl(&hwmb[i].mb_cs);
+
-+ if (j > 0) {
-+ if (n > j) {
-+ memcpy(&mxc_nand_data->data_buf[col], buf, j);
-+ memcpy(&mxc_nand_data->oob_buf[0], buf + j, n - j);
-+ } else {
-+ memcpy(&mxc_nand_data->data_buf[col], buf, n);
++ if (mb.mb_cs.cs.code == CAN_MB_TX_INACTIVE)
++ break;
++ if (++i > flexcan->maxmb) {
++ if (flexcan->fifo)
++ i = FLEXCAN_MAX_FIFO_MB;
++ else
++ i = flexcan->xmit_maxmb + 1;
+ }
-+ } else {
-+ col -= mtd->writesize;
-+ memcpy(&mxc_nand_data->oob_buf[col], buf, len);
++ if (i == flexcan->xmit_mb) {
++ flexcan_dbg(flexcan, 0, "%s: no free xmit buffer\n", __FUNCTION__);
++ return 0;
++ }
++ } while (1);
++
++ flexcan->xmit_mb = i + 1;
++ if (flexcan->xmit_mb > flexcan->maxmb) {
++ if (flexcan->fifo)
++ flexcan->xmit_mb = FLEXCAN_MAX_FIFO_MB;
++ else
++ flexcan->xmit_mb = flexcan->xmit_maxmb + 1;
+ }
+
-+ /* update */
-+ mxc_nand_data->col_addr += n;
++ flexcan_dbg(flexcan, 1, "%s: Enabling transmission of buffer %d\n", __FUNCTION__, i);
++ flexcan_mb_write(frame, &hwmb[i], CAN_MB_TX_ONCE);
++
++ if (dbg_lvl(1))
++ print_hex_dump(KERN_DEBUG, "tx_mb: ", DUMP_PREFIX_OFFSET, 16, 4,
++ &hwmb[i], sizeof(*hwmb), 0);
++ return 1;
+}
+
-+/*!
-+ * This function is used by the upper layer to verify the data in NAND Flash
-+ * with the data in the \b buf.
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ * @param buf data to be verified
-+ * @param len length of the data to be verified
-+ *
-+ * @return -EFAULT if error else 0
-+ *
-+ */
-+static int mxc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf,
-+ int len)
++static void flexcan_mbm_init(struct flexcan_device *flexcan)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ u_char *s = mxc_nand_data->data_buf;
-+ const u_char *p = buf;
++ struct can_hw_mb __iomem *hwmb;
++ int rx_mb, i;
+
-+ for (; len > 0; len--) {
-+ if (*p++ != *s++)
-+ return -EFAULT;
-+ }
++ flexcan_dbg(flexcan, 0, "%s@%d: \n", __FUNCTION__, __LINE__);
+
-+ return 0;
-+}
++ /* Set global mask to receive all messages */
++ flexcan_reg_write(flexcan, CAN_HW_REG_RXGMASK, 0);
++ flexcan_reg_write(flexcan, CAN_HW_REG_RX14MASK, 0);
++ flexcan_reg_write(flexcan, CAN_HW_REG_RX15MASK, 0);
+
-+/*!
-+ * This function is used by upper layer for select and deselect of the NAND
-+ * chip
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ * @param chip val indicating select or deselect
-+ */
-+static void mxc_nand_select_chip(struct mtd_info *mtd, int chip)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+
-+ switch (chip) {
-+ case -1:
-+ if (mxc_nand_data->clk_act) {
-+ /* Disable the NFC clock */
-+ clk_disable(mxc_nand_data->clk);
-+ mxc_nand_data->clk_act = 0;
-+ }
-+ break;
-+ case 0 ... 7:
-+ /* Enable the NFC clock */
-+ if (!mxc_nand_data->clk_act) {
-+ clk_enable(mxc_nand_data->clk);
-+ mxc_nand_data->clk_act = 1;
++ for (i = 0; i < FLEXCAN_MAX_MB; i++) {
++ int j;
++ void __iomem *mb = &flexcan->hwmb[i];
++ void __iomem *rxm = &flexcan->rx_mask[i];
++
++ __raw_writel(0, rxm);
++ for (j = 0; j < sizeof(*flexcan->hwmb); j += 4) {
++ __raw_writel(0, mb + j);
+ }
-+ NFC_SET_NFC_ACTIVE_CS(chip);
-+ break;
-+ default:
-+ BUG();
+ }
-+}
+
-+/*
-+ * Function to perform the address cycles.
-+ */
-+static void mxc_do_addr_cycle(struct mtd_info *mtd, int column, int page_addr)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+#ifdef NFC_AUTO_MODE_ENABLE
-+ if (page_addr != -1 && column != -1) {
-+ u32 mask = 0xFFFF;
-+ /* the column address */
-+ nfc_write_reg(mxc_nand_data, column & mask, NFC_FLASH_ADDR0);
-+ nfc_write_reg(mxc_nand_data,
-+ (nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR0) |
-+ ((page_addr & mask) << 16)), NFC_FLASH_ADDR0);
-+ /* the row address */
-+ nfc_write_reg(mxc_nand_data,
-+ ((nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR8) &
-+ (mask << 16)) |
-+ ((page_addr & (mask << 16)) >> 16)),
-+ NFC_FLASH_ADDR8);
-+ } else if (page_addr != -1) {
-+ nfc_write_reg(mxc_nand_data, page_addr, NFC_FLASH_ADDR0);
-+ }
++ if (flexcan->fifo)
++ rx_mb = FLEXCAN_MAX_FIFO_MB;
++ else
++ rx_mb = flexcan->maxmb - flexcan->xmit_maxmb;
+
-+ DEBUG(MTD_DEBUG_LEVEL3,
-+ "AutoMode:the ADDR REGS value is (0x%x, 0x%x)\n",
-+ nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR0),
-+ nfc_read_reg(mxc_nand_data, NFC_FLASH_ADDR8));
-+#else
++ hwmb = flexcan->hwmb;
++ if (flexcan->fifo) {
++ unsigned long *id_table = flexcan->io_base + CAN_FIFO_BASE;
++ for (i = 0; i < rx_mb; i++)
++ __raw_writel(0, &id_table[i]);
++ } else {
++ for (i = 0; i < rx_mb; i++) {
++ struct can_hw_mb mb;
+
-+ u32 page_mask = nand_chip->pagemask;
++ mb.mb_cs.data = 0;
++ mb.mb_cs.cs.code = CAN_MB_RX_EMPTY;
++ if (flexcan->ext_msg && flexcan->std_msg)
++ mb.mb_cs.cs.ide = i & 1;
++ else if (flexcan->ext_msg)
++ mb.mb_cs.cs.ide = 1;
+
-+ if (column != -1) {
-+ send_addr(mxc_nand_data, column & 0xFF, false);
-+ if (IS_2K_PAGE_NAND) {
-+ /* another col addr cycle for 2k page */
-+ send_addr(mxc_nand_data, (column >> 8) & 0xF, false);
-+ } else if (IS_4K_PAGE_NAND) {
-+ /* another col addr cycle for 4k page */
-+ send_addr(mxc_nand_data, (column >> 8) & 0x1F, false);
++ __raw_writel(mb.mb_cs.data, &hwmb[i]);
+ }
+ }
-+ if (page_addr != -1) {
-+ do {
-+ send_addr(mxc_nand_data, (page_addr & 0xff), false);
-+ page_mask >>= 8;
-+ page_addr >>= 8;
-+ } while (page_mask != 0);
++
++ for (; i <= flexcan->maxmb; i++) {
++ struct can_hw_mb mb;
++
++ mb.mb_cs.data = 0;
++ mb.mb_cs.cs.code = CAN_MB_TX_INACTIVE;
++ __raw_writel(mb.mb_cs.data, &hwmb[i]);
+ }
-+#endif
++
++ flexcan->xmit_mb = rx_mb;
++ flexcan->xmit_buffers = flexcan->maxmb - flexcan->xmit_maxmb;
+}
+
-+/*!
-+ * This function is used by the upper layer to write command to NAND Flash for
-+ * different operations to be carried out on NAND Flash
-+ *
-+ * @param mtd MTD structure for the NAND Flash
-+ * @param command command for NAND Flash
-+ * @param column column offset for the page read
-+ * @param page_addr page to be read from NAND Flash
-+ */
-+static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
-+ int column, int page_addr)
++static void flexcan_hw_start(struct flexcan_device *flexcan)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ bool useirq = false;
++ unsigned int reg;
+
-+ DEBUG(MTD_DEBUG_LEVEL2,
-+ "mxc_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n",
-+ command, column, page_addr);
-+ /*
-+ * Reset command state information
-+ */
-+ mxc_nand_data->status_req = false;
++ flexcan_dbg(flexcan, 0, "%s: \n", __FUNCTION__);
+
-+ /*
-+ * Command pre-processing step
-+ */
-+ switch (command) {
-+ case NAND_CMD_STATUS:
-+ mxc_nand_data->col_addr = 0;
-+ mxc_nand_data->status_req = true;
-+ break;
++ if ((flexcan->maxmb + 1) > 32) {
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK1, ~0);
++ reg = (1 << (flexcan->maxmb - 31)) - 1;
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK2, reg);
++ } else {
++ reg = (1 << (flexcan->maxmb + 1)) - 1;
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK1, reg);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK2, 0);
++ }
+
-+ case NAND_CMD_READ0:
-+ mxc_nand_data->col_addr = column;
-+ break;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg & ~__MCR_HALT);
++}
+
-+ case NAND_CMD_READOOB:
-+ mxc_nand_data->col_addr = column;
-+ command = NAND_CMD_READ0;
-+ break;
++static void flexcan_hw_stop(struct flexcan_device *flexcan)
++{
++ unsigned int reg;
+
-+ case NAND_CMD_SEQIN:
-+ if (column != 0) {
-+ /* Before sending SEQIN command for partial
-+ * write, we need to read one page out.
-+ * FSL NFC does not support partial write
-+ * for large page devices. It alway sends out
-+ * 512+ecc+512+ecc....
-+ * For small page nand flash, it would support
-+ * SPARE ONLY operation. But to simplify the driver,
-+ * we take the same approach for small page and
-+ * large page devices:
-+ * read out the whole page and update.
-+ * As for MLC nand NOP(num of operation) = 1.
-+ * Partial writing to one programmed page is
-+ * not allowed! We can't limit it in the driver,
-+ * the upper layer application needs to take care of it.
-+ */
-+ mxc_nand_command(mtd, NAND_CMD_READ0, 0, page_addr);
-+ }
++ flexcan_dbg(flexcan, 0, "%s: \n", __FUNCTION__);
+
-+ mxc_nand_data->col_addr = column;
-+ break;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg | __MCR_HALT);
++}
+
-+ case NAND_CMD_PAGEPROG:
-+#ifndef NFC_AUTO_MODE_ENABLE
-+ /* The NFC internal buffer access
-+ * has some limitation, it does not
-+ * allow byte access. To make the code
-+ * simple and easy to use, do not check
-+ * the address alignment each time.
-+ * Use the temp buffer to accomodate
-+ * the data alignment.
-+ * We know data_buf will be at least 4
-+ * byte aligned, so we can use
-+ * memcpy safely.
-+ */
-+ memcpy(mxc_nand_data->main_buf, mxc_nand_data->data_buf, mtd->writesize);
-+ copy_spare(mtd, mxc_nand_data->oob_buf, mxc_nand_data->spare_buf,
-+ mtd->oobsize, false);
-+#endif
++static int flexcan_hw_reset(struct flexcan_device *flexcan)
++{
++ struct platform_device *pdev __attribute__((unused)) = flexcan->dev;
++ unsigned int reg;
++ int timeout = 100000;
+
-+ if (IS_LARGE_PAGE_NAND)
-+ PROG_PAGE(mxc_nand_data);
-+ else
-+ send_prog_page(mxc_nand_data, 0);
-+ useirq = true;
-+ break;
++ flexcan_dbg(flexcan, 0, "%s: \n", __FUNCTION__);
+
-+ case NAND_CMD_ERASE1:
-+ break;
-+ case NAND_CMD_ERASE2:
-+ useirq = true;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg | __MCR_MDIS);
+
-+ break;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_CTRL);
++ if (flexcan->br_clksrc)
++ reg |= __CTRL_CLK_SRC;
++ else
++ reg &= ~__CTRL_CLK_SRC;
++ flexcan_reg_write(flexcan, CAN_HW_REG_CTRL, reg);
++
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR) & ~__MCR_MDIS;
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg);
++ reg |= __MCR_SOFT_RST;
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg);
++
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ while (reg & __MCR_SOFT_RST) {
++ if (--timeout <= 0) {
++ dev_err(&pdev->dev, "Flexcan software Reset Timeout\n");
++ return -ETIME;
++ }
++ udelay(10);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
+ }
++ return 0;
++}
+
-+ /*
-+ * Write out the command to the device.
-+ */
-+ send_cmd(mtd, command, useirq);
++static void flexcan_mcr_setup(struct flexcan_device *flexcan)
++{
++ unsigned int reg;
+
-+ mxc_do_addr_cycle(mtd, column, page_addr);
++ flexcan_dbg(flexcan, 0, "%s: \n", __FUNCTION__);
+
-+ /*
-+ * Command post-processing step
-+ */
-+ switch (command) {
-+
-+ case NAND_CMD_READOOB:
-+ case NAND_CMD_READ0:
-+ if (IS_LARGE_PAGE_NAND) {
-+ /* send read confirm command */
-+ send_cmd(mtd, NAND_CMD_READSTART, true);
-+ /* read for each AREA */
-+ READ_PAGE(mxc_nand_data);
-+ } else {
-+ send_read_page(mxc_nand_data, 0);
-+ }
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ reg &= ~(__MCR_MAX_MB_MASK | __MCR_WAK_MSK | __MCR_MAX_IDAM_MASK);
+
-+#ifndef NFC_AUTO_MODE_ENABLE
-+ /* FIXME, the NFC interal buffer
-+ * access has some limitation, it
-+ * does not allow byte access. To
-+ * make the code simple and ease use
-+ * do not check the address alignment
-+ * on each access. Use the temp buffer
-+ * to accomodate the data. Since we
-+ * know data_buf will be at least 4
-+ * byte alignment, so we can use
-+ * memcpy safely
-+ */
-+ memcpy(mxc_nand_data->data_buf, mxc_nand_data->main_buf, mtd->writesize);
-+ copy_spare(mtd, mxc_nand_data->oob_buf,
-+ mxc_nand_data->spare_buf, mtd->oobsize, true);
-+#endif
++ if (flexcan->fifo)
++ reg |= __MCR_FEN;
++ else
++ reg &= ~__MCR_FEN;
+
-+ break;
++ if (flexcan->wakeup)
++ reg |= __MCR_SLF_WAK | __MCR_WAK_MSK;
++ else
++ reg &= ~(__MCR_SLF_WAK | __MCR_WAK_MSK);
+
-+ case NAND_CMD_READID:
-+ send_read_id(mxc_nand_data);
-+ mxc_nand_data->col_addr = column;
-+ memcpy(mxc_nand_data->data_buf, mxc_nand_data->main_buf, 2048);
-+ break;
-+ }
-+}
++ if (flexcan->wak_src)
++ reg |= __MCR_WAK_SRC;
++ else
++ reg &= ~__MCR_WAK_SRC;
+
-+static int mxc_nand_read_oob(struct mtd_info *mtd,
-+ struct nand_chip *chip, int page, int sndcmd)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ if (flexcan->srx_dis)
++ reg |= __MCR_SRX_DIS;
++ else
++ reg &= ~__MCR_SRX_DIS;
+
-+ if (sndcmd) {
-+ chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
-+ sndcmd = 0;
-+ }
++ if (flexcan->bcc)
++ reg |= __MCR_BCC;
++ else
++ reg &= ~__MCR_BCC;
++
++ if (flexcan->lprio)
++ reg |= __MCR_LPRIO_EN;
++ else
++ reg &= ~__MCR_LPRIO_EN;
+
-+ memcpy(chip->oob_poi, mxc_nand_data->oob_buf, mtd->oobsize);
++ if (flexcan->abort)
++ reg |= __MCR_AEN;
++ else
++ reg &= ~__MCR_AEN;
+
-+ return sndcmd;
++ reg |= (flexcan->maxmb << __MCR_MAX_MB_OFFSET);
++ reg |= __MCR_DOZE | __MCR_MAX_IDAM_C;
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg);
+}
+
-+static int mxc_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip,
-+ u8 *buf)
++static void flexcan_ctrl_setup(struct flexcan_device *flexcan)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ unsigned int reg;
+
-+#ifndef NFC_AUTO_MODE_ENABLE
-+ if (mxc_check_ecc_status(mtd) < 0) {
-+ //printk(KERN_ERR "ECC error in block %u page %u\n",);
-+ }
-+#endif
++ flexcan_dbg(flexcan, 0, "%s: \n", __FUNCTION__);
+
-+ memcpy(buf, mxc_nand_data->data_buf, mtd->writesize);
-+ memcpy(chip->oob_poi, mxc_nand_data->oob_buf, mtd->oobsize);
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_CTRL);
++ reg &= ~(__CTRL_PRESDIV_MASK | __CTRL_RJW_MASK | __CTRL_PSEG1_MASK |
++ __CTRL_PSEG2_MASK | __CTRL_PROPSEG_MASK);
+
-+ return 0;
-+}
++ if (flexcan->loopback)
++ reg |= __CTRL_LPB;
++ else
++ reg &= ~__CTRL_LPB;
+
-+static void mxc_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
-+ const u8 *buf)
-+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ if (flexcan->smp)
++ reg |= __CTRL_SMP;
++ else
++ reg &= ~__CTRL_SMP;
+
-+ memcpy(mxc_nand_data->data_buf, buf, mtd->writesize);
-+ memcpy(mxc_nand_data->oob_buf, chip->oob_poi, mtd->oobsize);
-+}
++ if (flexcan->boff_rec)
++ reg |= __CTRL_BOFF_REC;
++ else
++ reg &= ~__CTRL_BOFF_REC;
+
-+/* Define some generic bad / good block scan pattern which are used
-+ * while scanning a device for factory marked good / bad blocks. */
-+static u8 scan_ff_pattern[] = { 0xff, 0xff };
++ if (flexcan->tsyn)
++ reg |= __CTRL_TSYN;
++ else
++ reg &= ~__CTRL_TSYN;
+
-+static struct nand_bbt_descr smallpage_memorybased = {
-+ .options = NAND_BBT_SCAN2NDPAGE,
-+ .offs = 5,
-+ .len = 1,
-+ .pattern = scan_ff_pattern
-+};
++ if (flexcan->listen)
++ reg |= __CTRL_LOM;
++ else
++ reg &= ~__CTRL_LOM;
+
-+static struct nand_bbt_descr largepage_memorybased = {
-+ .options = 0,
-+ .offs = 0,
-+ .len = 2,
-+ .pattern = scan_ff_pattern
-+};
++ reg |= (flexcan->br_presdiv << __CTRL_PRESDIV_OFFSET) |
++ (flexcan->br_rjw << __CTRL_RJW_OFFSET) |
++ (flexcan->br_pseg1 << __CTRL_PSEG1_OFFSET) |
++ (flexcan->br_pseg2 << __CTRL_PSEG2_OFFSET) |
++ (flexcan->br_propseg << __CTRL_PROPSEG_OFFSET);
+
-+/* Generic flash bbt decriptors
-+*/
-+static u8 bbt_pattern[] = { 'B', 'b', 't', '0' };
-+static u8 mirror_pattern[] = { '1', 't', 'b', 'B' };
++ reg &= ~__CTRL_LBUF;
+
-+static struct nand_bbt_descr bbt_main_descr = {
-+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
-+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
-+ .offs = 0,
-+ .len = 4,
-+ .veroffs = 4,
-+ .maxblocks = 4,
-+ .pattern = bbt_pattern
-+};
++ reg |= __CTRL_TWRN_MSK | __CTRL_RWRN_MSK | __CTRL_BOFF_MSK |
++ __CTRL_ERR_MSK;
+
-+static struct nand_bbt_descr bbt_mirror_descr = {
-+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
-+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
-+ .offs = 0,
-+ .len = 4,
-+ .veroffs = 4,
-+ .maxblocks = 4,
-+ .pattern = mirror_pattern
-+};
++ flexcan_reg_write(flexcan, CAN_HW_REG_CTRL, reg);
++}
+
-+static int mxc_nand_scan_bbt(struct mtd_info *mtd)
++static int flexcan_hw_restart(struct net_device *dev)
+{
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ unsigned int reg;
++ struct flexcan_device *flexcan = netdev_priv(dev);
+
-+ if (IS_2K_PAGE_NAND) {
-+ NFC_SET_NFMS(1 << NFMS_NF_PG_SZ);
-+ } else if (IS_4K_PAGE_NAND) {
-+ NFC_SET_NFMS(1 << NFMS_NF_PG_SZ);
-+ } else {
-+ }
++ ndev_dbg(dev, 0, "%s: \n", __FUNCTION__);
+
-+ /* reconfig for interleave mode */
-+#ifdef NFC_AUTO_MODE_ENABLE
-+ if (nand_chip->numchips > 1) {
-+ num_of_interleave = nand_chip->numchips;
-+ nand_chip->numchips = 1;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ if (reg & __MCR_SOFT_RST)
++ return 1;
+
-+ /* FIXEME:need remove it
-+ * when kernel support
-+ * 4G larger space
-+ */
-+ mtd->size = nand_chip->chipsize;
-+ mtd->erasesize *= num_of_interleave;
-+ mtd->writesize *= num_of_interleave;
-+ mtd->oobsize *= num_of_interleave;
-+ nand_chip->page_shift = ffs(mtd->writesize) - 1;
-+ nand_chip->bbt_erase_shift =
-+ nand_chip->phys_erase_shift = ffs(mtd->erasesize) - 1;
-+ nand_chip->chip_shift = ffs(nand_chip->chipsize) - 1;
-+ nand_chip->oob_poi = nand_chip->buffers->databuf + mtd->writesize;
-+ }
-+#endif
-+ /* jffs2 not write oob */
-+ //mtd->flags |= MTD_OOB_READONLY;
++ flexcan_mcr_setup(flexcan);
+
-+ /* use flash based bbt */
-+ nand_chip->bbt_td = &bbt_main_descr;
-+ nand_chip->bbt_md = &bbt_mirror_descr;
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK2, 0);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK1, 0);
+
-+ /* update flash based bbt */
-+ nand_chip->options |= NAND_USE_FLASH_BBT;
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG2, 0xFFFFFFFF);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG1, 0xFFFFFFFF);
+
-+ if (!nand_chip->badblock_pattern) {
-+ nand_chip->badblock_pattern = (mtd->writesize > 512) ?
-+ &largepage_memorybased : &smallpage_memorybased;
-+ }
++ flexcan_reg_write(flexcan, CAN_HW_REG_ECR, 0);
++
++ flexcan_mbm_init(flexcan);
++ netif_carrier_on(dev);
++ flexcan_hw_start(flexcan);
+
-+ /* Build bad block table */
-+ return nand_scan_bbt(mtd, nand_chip->badblock_pattern);
++ if (netif_queue_stopped(dev)) {
++ ndev_dbg(dev, 1, "%s@%d: Starting netif queue\n",
++ __FUNCTION__, __LINE__);
++ netif_start_queue(dev);
++ }
++ return 0;
+}
+
-+static void mxc_nfc_init(struct mxc_mtd_s *mxc_nand_data)
++static void flexcan_hw_watch(unsigned long data)
+{
-+ /* Disable interrupt */
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_INTERRUPT) |
-+ NFC_INT_MSK, REG_NFC_INTERRUPT);
-+
-+ /* disable spare enable */
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_SP_EN) &
-+ ~NFC_SP_EN, REG_NFC_SP_EN);
-+
-+ /* Unlock the internal RAM Buffer */
-+ nfc_write_reg(mxc_nand_data, NFC_SET_BLS(NFC_BLS_UNLOCKED),
-+ REG_NFC_BLS);
-+
-+ /* Blocks to be unlocked */
-+ UNLOCK_ADDR(0x0, 0xFFFF);
-+
-+ /* Unlock Block Command for given address range */
-+ nfc_write_reg(mxc_nand_data, NFC_SET_WPC(NFC_WPC_UNLOCK), REG_NFC_WPC);
-+
-+ /* Enable symmetric mode by default except mx37TO1.0 */
-+ if (!cpu_is_mx25()) {
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_ONE_CYCLE) |
-+ NFC_ONE_CYCLE, REG_NFC_ONE_CYCLE);
-+ } else {
-+ nfc_write_reg(mxc_nand_data,
-+ nfc_read_reg(mxc_nand_data, REG_NFC_ONE_CYCLE) &
-+ ~NFC_ONE_CYCLE, REG_NFC_ONE_CYCLE);
++ unsigned int reg, ecr;
++ struct net_device *dev = (struct net_device *)data;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++
++ ndev_dbg(dev, 1, "%s: \n", __FUNCTION__);
++
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ if (reg & __MCR_MDIS) {
++ if (flexcan_hw_restart(dev))
++ mod_timer(&flexcan->timer, HZ / 20);
++ return;
++ }
++ ecr = flexcan_reg_read(flexcan, CAN_HW_REG_ECR);
++ if (flexcan->boff_rec) {
++ if (((reg & __ESR_FLT_CONF_MASK) >> __ESR_FLT_CONF_OFF) > 1) {
++ reg |= __MCR_SOFT_RST;
++ ndev_dbg(dev, 1, "%s: Initiating soft reset\n", __FUNCTION__);
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg);
++ mod_timer(&flexcan->timer, HZ / 20);
++ return;
++ }
++ netif_carrier_on(dev);
+ }
++ ndev_dbg(dev, 1, "%s: Done\n", __FUNCTION__);
+}
+
-+static int mxc_alloc_buf(struct mxc_mtd_s *mxc_nand_data)
++static void flexcan_hw_busoff(struct net_device *dev)
+{
-+ u8 *buf;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ unsigned int reg;
+
-+ buf = kzalloc(NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE, GFP_KERNEL);
-+ if (!buf) {
-+ printk(KERN_ERR "%s: failed to allocate data_buf\n", __func__);
-+ return -ENOMEM;
++ netif_carrier_off(dev);
++
++ flexcan->timer.function = flexcan_hw_watch;
++ flexcan->timer.data = (unsigned long)dev;
++
++ if (flexcan->boff_rec) {
++ mod_timer(&flexcan->timer, HZ / 10);
++ return;
+ }
-+ mxc_nand_data->data_buf = buf;
-+ mxc_nand_data->oob_buf = &buf[NAND_MAX_PAGESIZE];
-+ return 0;
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_MCR);
++ flexcan_reg_write(flexcan, CAN_HW_REG_MCR, reg | __MCR_SOFT_RST);
++ mod_timer(&flexcan->timer, HZ / 20);
+}
+
-+static void mxc_free_buf(struct mxc_mtd_s *mxc_nand_data)
++static int flexcan_hw_open(struct flexcan_device *flexcan)
+{
-+ kfree(mxc_nand_data->data_buf);
-+}
++ int ret;
+
-+/*!
-+ * This function is called during the driver binding process.
-+ *
-+ * @param pdev the device structure used to store device specific
-+ * information that is used by the suspend, resume and
-+ * remove functions
-+ *
-+ * @return The function always returns 0.
-+ */
-+#define SPLIT_SCAN
++ if ((ret = flexcan_hw_reset(flexcan)) != 0)
++ return ret;
++
++ flexcan_mcr_setup(flexcan);
++ flexcan_ctrl_setup(flexcan);
++
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK2, 0);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IMASK1, 0);
++
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG2, 0xFFFFFFFF);
++ flexcan_reg_write(flexcan, CAN_HW_REG_IFLAG1, 0xFFFFFFFF);
++
++ flexcan_reg_write(flexcan, CAN_HW_REG_ECR, 0);
++ return 0;
++}
+
-+static int __init mxcnd_probe(struct platform_device *pdev)
++static void flexcan_err_handler(struct work_struct *work)
+{
-+ int err;
-+ struct nand_chip *this;
-+ struct mtd_info *mtd;
-+ struct flash_platform_data *pdata = pdev->dev.platform_data;
-+ int nr_parts;
-+ struct resource *res;
-+ struct mxc_mtd_s *mxc_nand_data;
-+ struct clk *clk;
-+ void __iomem *nfc_axi_base;
-+ void __iomem *nfc_ip_base;
++ struct flexcan_device *flexcan = container_of(work, struct flexcan_device, err_work);
++ struct net_device *dev = platform_get_drvdata(flexcan->dev);
++ struct sk_buff *skb;
++ struct can_frame *frame;
++ unsigned int esr, ecr;
+
-+ if (!pdata) {
-+ dev_err(&pdev->dev, "No platform_data\n");
-+ return -ENODEV;
-+ }
++ ndev_dbg(dev, 1, "%s@%d: \n", __FUNCTION__, __LINE__);
+
-+ /* Allocate memory for MTD device structure and private data */
-+ mxc_nand_data = kzalloc(sizeof(struct mxc_mtd_s), GFP_KERNEL);
-+ if (!mxc_nand_data) {
-+ printk(KERN_ERR "%s: failed to allocate mtd_info\n",
-+ __FUNCTION__);
-+ return -ENOMEM;
++ esr = flexcan_reg_read(flexcan, CAN_HW_REG_ESR);
++ flexcan_reg_write(flexcan, CAN_HW_REG_ESR, esr & __ESR_INTERRUPTS);
++ enable_irq(flexcan->irq);
++
++ if (esr & __ESR_WAK_INT) {
++ ndev_dbg(dev, 0, "%s@%d: \n", __FUNCTION__, __LINE__);
++ return;
+ }
+
-+ /* allocate data buffer */
-+ if (mxc_alloc_buf(mxc_nand_data)) {
-+ err = -ENOMEM;
-+ goto out;
++ skb = dev_alloc_skb(sizeof(struct can_frame));
++ if (!skb) {
++ ndev_err(dev, "%s: Failed to allocate skb\n", __func__);
++ return;
+ }
++ frame = flexcan_skb_put(skb, sizeof(*frame));
++ frame->can_id = CAN_ERR_FLAG | CAN_ERR_CRTL;
++ frame->can_dlc = CAN_ERR_DLC;
+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ if (!res) {
-+ dev_err(&pdev->dev, "no memory resource\n");
-+ err = -ENODEV;
-+ goto out1;
++ if (esr & __ESR_TWRN_INT) {
++ ndev_err(dev, "%s: TX_WARNING\n", __FUNCTION__);
++ frame->data[1] |= CAN_ERR_CRTL_TX_WARNING;
+ }
-+ if (!request_mem_region(res->start, resource_size(res), DRV_NAME)) {
-+ err = -EBUSY;
-+ goto out1;
++ if (esr & __ESR_RWRN_INT) {
++ ndev_err(dev, "%s: RX_WARNING\n", __FUNCTION__);
++ frame->data[1] |= CAN_ERR_CRTL_RX_WARNING;
+ }
-+ mxc_nand_data->res_ip = res;
-+
-+ nfc_ip_base = ioremap(res->start, resource_size(res));
-+ if (nfc_ip_base == NULL) {
-+ dev_err(&pdev->dev, "Failed to ioremap %08lx..%08lx\n",
-+ (unsigned long)res->start, (unsigned long)res->end);
-+ err = -ENOMEM;
-+ goto out2;
++ if (esr & __ESR_BOFF_INT) {
++ ndev_err(dev, "%s: BUS_OFF\n", __FUNCTION__);
++ frame->can_id |= CAN_ERR_BUSOFF;
+ }
-+ DBG(0, "%s: %08lx..%08lx remapped to %p\n", __FUNCTION__,
-+ (unsigned long)res->start, (unsigned long)res->end,
-+ nfc_ip_base);
++ if (esr & __ESR_ERR_INT) {
++ ndev_dbg(dev, 1, "%s@%d: \n", __FUNCTION__, __LINE__);
++ if (esr & __ESR_BIT1_ERR) {
++ ndev_err(dev, "%s: BIT1_ERR\n", __FUNCTION__);
++ frame->data[2] |= CAN_ERR_PROT_BIT1;
++ }
+
-+ mxc_nand_data->reg_base = nfc_ip_base;
-+ mxc_nand_data->main_buf = mxc_nand_data->reg_base + MAIN_AREA0;
-+ mxc_nand_data->spare_buf = mxc_nand_data->reg_base + SPARE_AREA0;
++ if (esr & __ESR_BIT0_ERR) {
++ ndev_err(dev, "%s: BIT0_ERR\n", __FUNCTION__);
++ frame->data[2] |= CAN_ERR_PROT_BIT0;
++ }
+
-+ DBG(1, "%s: reg_base=%p\n", __FUNCTION__, mxc_nand_data->reg_base);
-+ DBG(1, "%s: main_buf=%p\n", __FUNCTION__, mxc_nand_data->main_buf);
-+ DBG(1, "%s: spare_buf=%p\n", __FUNCTION__, mxc_nand_data->spare_buf);
++ if (esr & __ESR_ACK_ERR) {
++ ndev_err(dev, "%s: ACK_ERR\n", __FUNCTION__);
++ frame->can_id |= CAN_ERR_ACK;
++ }
+
-+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+ if (res) {
-+ if (!request_mem_region(res->start, resource_size(res), DRV_NAME)) {
-+ err = -EBUSY;
-+ goto out3;
++ /*TODO:// if (esr & __ESR_CRC_ERR) */
++
++ if (esr & __ESR_FRM_ERR) {
++ ndev_err(dev, "%s: FRM_ERR\n", __FUNCTION__);
++ frame->data[2] |= CAN_ERR_PROT_FORM;
+ }
-+ nfc_axi_base = ioremap(res->start, resource_size(res));
-+ if (nfc_axi_base == NULL) {
-+ dev_err(&pdev->dev, "Failed to ioremap %08lx..%08lx\n",
-+ (unsigned long)res->start, (unsigned long)res->end);
-+ err = -ENOMEM;
-+ goto out4;
++
++ if (esr & __ESR_STF_ERR) {
++ ndev_err(dev, "%s: STF_ERR\n", __FUNCTION__);
++ frame->data[2] |= CAN_ERR_PROT_STUFF;
+ }
-+ mxc_nand_data->res_axi = res;
-+ DBG(0, "%s: %08lx..%08lx remapped to %p\n", __FUNCTION__,
-+ (unsigned long)res->start, (unsigned long)res->end,
-+ nfc_axi_base);
-+ mxc_nand_data->axi_base = nfc_axi_base;
-+ }
+
-+ err = platform_get_irq(pdev, 0);
-+ if (err < 0) {
-+ dev_err(&pdev->dev, "Failed to get IRQ\n");
-+ goto out5;
-+ }
-+ mxc_nand_data->irq = err;
-+ DBG(0, "%s: IRQ=%d\n", __FUNCTION__, mxc_nand_data->irq);
-+
-+ /* init the nfc */
-+ mxc_nfc_init(mxc_nand_data);
-+
-+ mxc_nand_data->dev = &pdev->dev;
-+ /* structures must be linked */
-+ this = &mxc_nand_data->nand;
-+ mtd = &mxc_nand_data->mtd;
-+ mtd->priv = this;
-+ mtd->owner = THIS_MODULE;
-+
-+ this->priv = mxc_nand_data;
-+ this->cmdfunc = mxc_nand_command;
-+ this->select_chip = mxc_nand_select_chip;
-+ this->read_byte = mxc_nand_read_byte;
-+ this->read_word = mxc_nand_read_word;
-+ this->write_buf = mxc_nand_write_buf;
-+ this->read_buf = mxc_nand_read_buf;
-+ this->verify_buf = mxc_nand_verify_buf;
-+ this->scan_bbt = mxc_nand_scan_bbt;
-+
-+ /* NAND bus width determines access funtions used by upper layer */
-+ if (pdata->width == 2) {
-+ this->read_byte = mxc_nand_read_byte16;
-+ this->options |= NAND_BUSWIDTH_16;
-+ NFC_SET_NFMS(1 << NFMS_NF_DWIDTH);
-+ } else {
-+ NFC_SET_NFMS(0);
++ ecr = flexcan_reg_read(flexcan, CAN_HW_REG_ECR);
++ switch ((esr & __ESR_FLT_CONF_MASK) >> __ESR_FLT_CONF_OFF) {
++ case 0:
++ ndev_dbg(dev, 0, "%s@%d: \n", __FUNCTION__, __LINE__);
++ if (__ECR_TX_ERR_COUNTER(ecr) >= __ECR_ACTIVE_THRESHOLD)
++ frame->data[1] |= CAN_ERR_CRTL_TX_WARNING;
++ if (__ECR_RX_ERR_COUNTER(ecr) >= __ECR_ACTIVE_THRESHOLD)
++ frame->data[1] |= CAN_ERR_CRTL_RX_WARNING;
++ break;
++ case 1:
++ ndev_dbg(dev, 0, "%s@%d: \n", __FUNCTION__, __LINE__);
++ if (__ECR_TX_ERR_COUNTER(ecr) >=
++ __ECR_PASSIVE_THRESHOLD)
++ frame->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
++
++ if (__ECR_RX_ERR_COUNTER(ecr) >=
++ __ECR_PASSIVE_THRESHOLD)
++ frame->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
++ break;
++ default:
++ ndev_dbg(dev, 0, "%s@%d: \n", __FUNCTION__, __LINE__);
++ frame->can_id |= CAN_ERR_BUSOFF;
++ }
+ }
+
-+ clk = clk_get(&pdev->dev, "nfc_clk");
-+ if (IS_ERR(clk)) {
-+ dev_err(&pdev->dev, "Failed to get nfc_clk: %ld\n",
-+ PTR_ERR(clk));
-+ err = PTR_ERR(clk);
-+ goto out6;
++ if (frame->can_id & CAN_ERR_BUSOFF) {
++ ndev_dbg(dev, 0, "%s: switchung bus off\n", __FUNCTION__);
++ flexcan_hw_busoff(dev);
+ }
-+ mxc_nand_data->clk = clk;
-+ clk_enable(clk);
-+ mxc_nand_data->clk_act = 1;
++ skb->dev = dev;
++ skb->ip_summed = CHECKSUM_UNNECESSARY;
++ netif_receive_skb(skb);
++}
+
-+ init_waitqueue_head(&mxc_nand_data->irq_waitq);
-+ err = request_irq(mxc_nand_data->irq, mxc_nfc_irq, 0, "mxc_nd",
-+ mxc_nand_data);
-+ if (err) {
-+ goto out7;
++static irqreturn_t flexcan_irq_handler(int irq, void *data)
++{
++ struct net_device *dev = data;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ unsigned int reg;
++
++ ndev_dbg(dev, 1, "%s: \n", __FUNCTION__);
++ disable_irq_nosync(irq);
++
++ reg = flexcan_reg_read(flexcan, CAN_HW_REG_ESR);
++ if (reg & __ESR_INTERRUPTS) {
++ ndev_dbg(dev, 1, "%s: Scheduling err handler\n", __FUNCTION__);
++ schedule_work(&flexcan->err_work);
++ return IRQ_HANDLED;
+ }
+
-+ DBG(0, "%s: Init GPIOs\n", __FUNCTION__);
-+ /* config the gpio */
-+ if (pdata->init) {
-+ err = pdata->init();
-+ if (err) {
-+ printk(KERN_ERR "%s: Failed to init GPIOs: %d\n",
-+ __FUNCTION__, err);
-+ goto out8;
++ ndev_dbg(dev, 1, "%s: Scheduling mbm handler\n", __FUNCTION__);
++ schedule_work(&flexcan->mb_work);
++ return IRQ_HANDLED;
++}
++
++static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct can_frame *frame = flexcan_skb_data(skb);
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct net_device_stats *stats = flexcan_get_stats(dev);
++
++ ndev_dbg(dev, 1, "%s: \n", __FUNCTION__);
++
++ if (frame->can_dlc > 8)
++ return -EINVAL;
++
++ if (flexcan_mbm_xmit(flexcan, frame)) {
++ dev_kfree_skb(skb);
++ stats->tx_bytes += frame->can_dlc;
++ stats->tx_packets++;
++ dev->trans_start = jiffies;
++ if (--flexcan->xmit_buffers == 0) {
++ ndev_dbg(dev, 1, "%s: Stopping netif queue\n", __FUNCTION__);
++ netif_stop_queue(dev);
+ }
++ BUG_ON(flexcan->xmit_buffers < 0);
++ return NETDEV_TX_OK;
+ }
++ ndev_dbg(dev, 1, "%s: could not transmit message\n", __FUNCTION__);
++ return NETDEV_TX_BUSY;
++}
+
-+ DBG(0, "%s: Resetting NAND chip\n", __FUNCTION__);
-+ /* Reset NAND */
-+ this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
++static int flexcan_open(struct net_device *dev)
++{
++ int ret;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct platform_device *pdev = flexcan->dev;
++ struct flexcan_platform_data *plat_data = pdev->dev.platform_data;
+
-+ /* Scan to find existence of the device */
-+ err = nand_scan_ident(mtd, 1);
-+ if (err) {
-+ DEBUG(MTD_DEBUG_LEVEL0,
-+ "MXC_ND: Unable to find any NAND device.\n");
-+ goto out9;
-+ }
++ ndev_dbg(dev, 0, "%s: \n", __FUNCTION__);
+
-+ if (IS_2K_PAGE_NAND) {
-+ DBG(0, "%s: Using 2k ecc layout\n", __FUNCTION__);
-+ this->ecc.layout = &nand_hw_eccoob_2k;
-+ } else if (IS_4K_PAGE_NAND) {
-+ DBG(0, "%s: Using 4k ecc layout\n", __FUNCTION__);
-+ this->ecc.layout = &nand_hw_eccoob_4k;
-+ } else {
-+ DBG(0, "%s: Using 512b ecc layout\n", __FUNCTION__);
-+ this->ecc.layout = &nand_hw_eccoob_512;
-+ }
-+ if (hardware_ecc) {
-+ this->ecc.read_page = mxc_nand_read_page;
-+ this->ecc.write_page = mxc_nand_write_page;
-+ this->ecc.read_oob = mxc_nand_read_oob;
-+ this->ecc.calculate = mxc_nand_calculate_ecc;
-+ this->ecc.hwctl = mxc_nand_enable_hwecc;
-+ this->ecc.correct = mxc_nand_correct_data;
-+ this->ecc.mode = NAND_ECC_HW;
-+ this->ecc.size = 512;
-+ this->ecc.bytes = 9;
-+ nfc_write_reg(mxc_nand_data,
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_EN) | NFC_ECC_EN),
-+ REG_NFC_ECC_EN);
-+ } else {
-+ this->ecc.mode = NAND_ECC_SOFT;
-+ nfc_write_reg(mxc_nand_data,
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_EN) & ~NFC_ECC_EN),
-+ REG_NFC_ECC_EN);
++ ret = clk_enable(flexcan->clk);
++ if (ret)
++ goto clk_err;
++
++ if (flexcan->core_reg) {
++ ret = regulator_enable(flexcan->core_reg);
++ if (ret)
++ goto core_reg_err;
+ }
+
-+ DBG(0, "%s: Scanning for NAND devices\n", __FUNCTION__);
-+ err = nand_scan_tail(mtd);
-+ if (err) {
-+ goto out9;
++ if (flexcan->io_reg) {
++ ret = regulator_enable(flexcan->io_reg);
++ if (ret)
++ goto io_reg_err;
+ }
+
-+ printk(KERN_INFO "MXC NAND V2 driver %d bit bus width %s ECC with %u/%u byte\n",
-+ pdata->width * 8, hardware_ecc ? "HW" : "SW",
-+ this->ecc.bytes, this->ecc.size);
-+
-+ /* Register the partitions */
-+#ifdef CONFIG_MTD_PARTITIONS
-+ nr_parts =
-+ parse_mtd_partitions(mtd, part_probes, &mxc_nand_data->parts, 0);
-+ if (nr_parts > 0)
-+ add_mtd_partitions(mtd, mxc_nand_data->parts, nr_parts);
-+ else if (pdata->parts)
-+ add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
-+ else
-+#endif
-+ {
-+ pr_info("Registering %s as whole device\n", mtd->name);
-+ add_mtd_device(mtd);
++ if (plat_data && plat_data->xcvr_enable) {
++ ret = plat_data->xcvr_enable(pdev, 1);
++ if (ret)
++ goto enable_err;
+ }
+
-+ platform_set_drvdata(pdev, mtd);
++ ret = request_irq(flexcan->irq, flexcan_irq_handler, IRQF_SAMPLE_RANDOM,
++ dev->name, dev);
++ if (ret)
++ goto irq_err;
++
++ ret = flexcan_hw_open(flexcan);
++ if (ret)
++ goto open_err;
++
++ flexcan_mbm_init(flexcan);
++ netif_carrier_on(dev);
++ flexcan_hw_start(flexcan);
+ return 0;
+
-+ out9:
-+ if (pdata->exit)
-+ pdata->exit();
-+ out8:
-+ free_irq(mxc_nand_data->irq, mxc_nand_data);
-+ out7:
-+ clk_disable(clk);
-+ clk_put(clk);
-+ out6:
-+ mxc_free_buf(mxc_nand_data);
-+ out5:
-+ if (mxc_nand_data->axi_base)
-+ iounmap(mxc_nand_data->axi_base);
-+ out4:
-+ if (mxc_nand_data->res_axi)
-+ release_mem_region(mxc_nand_data->res_axi->start,
-+ resource_size(mxc_nand_data->res_axi));
-+ out3:
-+ iounmap(mxc_nand_data->reg_base);
-+ out2:
-+ release_mem_region(mxc_nand_data->res_ip->start,
-+ resource_size(mxc_nand_data->res_ip));
-+ out1:
-+ mxc_free_buf(mxc_nand_data);
-+ out:
-+ kfree(mxc_nand_data);
-+ return err;
++ open_err:
++ free_irq(flexcan->irq, dev);
++ irq_err:
++ if (plat_data && plat_data->xcvr_enable)
++ plat_data->xcvr_enable(pdev, 0);
++ enable_err:
++ if (flexcan->io_reg)
++ regulator_disable(flexcan->io_reg);
++ io_reg_err:
++ if (flexcan->core_reg)
++ regulator_disable(flexcan->core_reg);
++ core_reg_err:
++ if (flexcan->clk)
++ clk_disable(flexcan->clk);
++ clk_err:
++ return ret;
+}
+
-+ /*!
-+ * Dissociates the driver from the device.
-+ *
-+ * @param pdev the device structure used to give information on which
-+ *
-+ * @return The function always returns 0.
-+ */
-+
-+static int __exit mxcnd_remove(struct platform_device *pdev)
++static int flexcan_stop(struct net_device *dev)
+{
-+ struct mtd_info *mtd = platform_get_drvdata(pdev);
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ struct flash_platform_data *pdata = pdev->dev.platform_data;
++ struct flexcan_device *flexcan = netdev_priv(dev);
++ struct platform_device *pdev = flexcan->dev;
++ struct flexcan_platform_data *plat_data = pdev->dev.platform_data;
+
-+ if (pdata->exit)
-+ pdata->exit();
++ flexcan_hw_stop(flexcan);
+
-+ nand_release(mtd);
++ free_irq(flexcan->irq, dev);
+
-+ free_irq(mxc_nand_data->irq, mxc_nand_data);
-+ clk_disable(mxc_nand_data->clk);
-+ clk_put(mxc_nand_data->clk);
++ if (plat_data && plat_data->xcvr_enable)
++ plat_data->xcvr_enable(pdev, 0);
+
-+ iounmap(mxc_nand_data->reg_base);
-+ release_mem_region(mxc_nand_data->res_ip->start,
-+ resource_size(mxc_nand_data->res_ip));
-+ if (mxc_nand_data->res_axi) {
-+ iounmap(mxc_nand_data->axi_base);
-+ release_mem_region(mxc_nand_data->res_axi->start,
-+ resource_size(mxc_nand_data->res_axi));
-+ }
-+ mxc_free_buf(mxc_nand_data);
-+ kfree(mxc_nand_data);
++ if (flexcan->io_reg)
++ regulator_disable(flexcan->io_reg);
++ if (flexcan->core_reg)
++ regulator_disable(flexcan->core_reg);
++ clk_disable(flexcan->clk);
+ return 0;
+}
+
-+#ifdef CONFIG_PM
-+/*!
-+ * This function is called to put the NAND in a low power state. Refer to the
-+ * document driver-model/driver.txt in the kernel source tree for more
-+ * information.
-+ *
-+ * @param pdev the device information structure
-+ *
-+ * @param state the power state the device is entering
-+ *
-+ * @return The function returns 0 on success and a negative errno value on failure
-+ */
++static const struct net_device_ops flexcan_netdev_ops = {
++ .ndo_open = flexcan_open,
++ .ndo_stop = flexcan_stop,
++ .ndo_start_xmit = flexcan_start_xmit,
++ .ndo_get_stats = flexcan_get_stats,
++};
++
++static void flexcan_setup(struct net_device *dev)
++{
++ dev->type = ARPHRD_CAN;
++ dev->mtu = sizeof(struct can_frame);
++ dev->hard_header_len = 0;
++ dev->addr_len = 0;
++ dev->tx_queue_len = FLEXCAN_MAX_MB;
++ dev->flags = IFF_NOARP;
++ dev->features = NETIF_F_NO_CSUM;
++
++ dev->netdev_ops = &flexcan_netdev_ops;
++ dev->destructor = flexcan_device_free;
++}
+
-+static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
++static int flexcan_probe(struct platform_device *pdev)
+{
+ int ret;
-+ struct mtd_info *mtd = platform_get_drvdata(pdev);
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
++ struct net_device *net;
+
-+ DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND2 : NAND suspend\n");
-+ ret = mtd->suspend(mtd);
-+ if (ret == 0) {
-+ /* Disable the NFC clock */
-+ clk_disable(mxc_nand_data->clk);
++ net = flexcan_device_alloc(pdev, flexcan_setup);
++ if (IS_ERR(net))
++ return PTR_ERR(net);
++
++ ret = register_netdev(net);
++ if (ret) {
++ flexcan_device_free(net);
+ }
+ return ret;
+}
+
-+/*!
-+ * This function is called to bring the NAND back from a low power state. Refer
-+ * to the document driver-model/driver.txt in the kernel source tree for more
-+ * information.
-+ *
-+ * @param pdev the device information structure
-+ *
-+ * @return The function returns 0 on success and a negative errno value on failure
-+ */
-+static int mxcnd_resume(struct platform_device *pdev)
++static int flexcan_remove(struct platform_device *pdev)
+{
-+ struct mtd_info *mtd = platform_get_drvdata(pdev);
-+ struct nand_chip *nand_chip = mtd->priv;
-+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv;
-+ int ret = 0;
++ struct net_device *net = platform_get_drvdata(pdev);
+
-+ DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND2 : NAND resume\n");
-+ /* Enable the NFC clock */
-+ clk_enable(mxc_nand_data->clk);
++ unregister_netdev(net);
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int flexcan_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ struct net_device *net = platform_get_drvdata(pdev);
++ struct flexcan_device *flexcan = netdev_priv(net);
++ struct flexcan_platform_data *plat_data;
+
-+ mtd->resume(mtd);
++ if (!(net->flags & IFF_UP))
++ return 0;
+
-+ return ret;
++ if (flexcan->wakeup)
++ set_irq_wake(flexcan->irq, 1);
++ else {
++ int ret;
++
++ plat_data = pdev->dev.platform_data;
++
++ if (plat_data && plat_data->xcvr_enable) {
++ ret = plat_data->xcvr_enable(pdev, 0);
++ if (ret)
++ return ret;
++ }
++ if (flexcan->io_reg) {
++ ret = regulator_disable(flexcan->io_reg);
++ if (ret)
++ return ret;
++ }
++ if (flexcan->core_reg) {
++ ret = regulator_disable(flexcan->core_reg);
++ if (ret)
++ return ret;
++ }
++ clk_disable(flexcan->clk);
++ if (plat_data && plat_data->inactive) {
++ plat_data->inactive(pdev);
++ }
++ }
++ return 0;
+}
+
++static int flexcan_resume(struct platform_device *pdev)
++{
++ int ret;
++ struct net_device *net = platform_get_drvdata(pdev);
++ struct flexcan_device *flexcan = netdev_priv(net);
++ struct flexcan_platform_data *plat_data;
++
++ if (!(net->flags & IFF_UP))
++ return 0;
++
++ if (flexcan->wakeup)
++ set_irq_wake(flexcan->irq, 0);
++ else {
++ plat_data = pdev->dev.platform_data;
++ if (plat_data && plat_data->active) {
++ ret = plat_data->active(pdev);
++ if (ret)
++ printk(KERN_ERR "%s: Failed activate hardware: %d\n",
++ __func__, ret);
++ }
++ ret = clk_enable(flexcan->clk);
++ if (ret)
++ printk(KERN_ERR "%s: Failed to enable clock: %d\n",
++ __func__, ret);
++
++ if (flexcan->core_reg) {
++ ret = regulator_enable(flexcan->core_reg);
++ if (ret)
++ printk(KERN_ERR "%s: Failed to enable core voltage: %d\n",
++ __func__, ret);
++ }
++ if (flexcan->io_reg) {
++ ret = regulator_enable(flexcan->io_reg);
++ if (ret)
++ printk(KERN_ERR "%s: Failed to enable io voltage: %d\n",
++ __func__, ret);
++ }
++
++ if (plat_data && plat_data->xcvr_enable) {
++ ret = plat_data->xcvr_enable(pdev, 1);
++ if (ret)
++ printk(KERN_ERR "%s: Failed to enable transceiver: %d\n",
++ __func__, ret);
++ }
++ }
++ return 0;
++}
+#else
-+#define mxcnd_suspend NULL
-+#define mxcnd_resume NULL
-+#endif /* CONFIG_PM */
++#define flexcan_suspend NULL
++#define flexcan_resume NULL
++#endif
+
-+/*!
-+ * This structure contains pointers to the power management callback functions.
-+ */
-+static struct platform_driver mxcnd_driver = {
++static struct platform_driver flexcan_driver = {
+ .driver = {
-+ .name = DRV_NAME,
++ .name = "mxc-flexcan",
+ },
-+ .probe = mxcnd_probe,
-+ .remove = __exit_p(mxcnd_remove),
-+ .suspend = mxcnd_suspend,
-+ .resume = mxcnd_resume,
++ .probe = flexcan_probe,
++ .remove = flexcan_remove,
++ .suspend = flexcan_suspend,
++ .resume = flexcan_resume,
+};
+
-+/*!
-+ * Main initialization routine
-+ * @return 0 if successful; non-zero otherwise
-+ */
-+static int __init mxc_nd_init(void)
++static __init int flexcan_init(void)
+{
-+ int ret;
-+
-+ /* Register the device driver structure. */
-+ ret = platform_driver_register(&mxcnd_driver);
-+ if (ret != 0) {
-+ printk(KERN_ERR "Driver register failed for mxcnd_driver\n");
-+ }
-+ return ret;
++ pr_info("Freescale FlexCAN Driver \n");
++ return platform_driver_register(&flexcan_driver);
+}
+
-+/*!
-+ * Clean up routine
-+ */
-+static void __exit mxc_nd_cleanup(void)
++static __exit void flexcan_exit(void)
+{
-+ /* Unregister the device structure */
-+ platform_driver_unregister(&mxcnd_driver);
++ return platform_driver_unregister(&flexcan_driver);
+}
+
-+module_init(mxc_nd_init);
-+module_exit(mxc_nd_cleanup);
++module_init(flexcan_init);
++module_exit(flexcan_exit);
+
-+MODULE_AUTHOR("Freescale Semiconductor, Inc.");
-+MODULE_DESCRIPTION("MXC NAND MTD driver Version 2-5");
+MODULE_LICENSE("GPL");
-diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nd2.h linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nd2.h
---- linux-2.6.30-rc4/drivers/mtd/nand/mxc_nd2.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/drivers/mtd/nand/mxc_nd2.h 2009-06-02 17:05:27.000000000 +0200
-@@ -0,0 +1,699 @@
+diff -purN linux-2.6.30-rc4-git/drivers/net/can/flexcan.h linux-2.6.30-rc4-karo3/drivers/net/can/flexcan.h
+--- linux-2.6.30-rc4-git/drivers/net/can/flexcan.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/drivers/net/can/flexcan.h 2009-07-06 15:17:55.000000000 +0200
+@@ -0,0 +1,214 @@
+/*
-+ * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
@@ -13376,706 +14375,209 @@ diff -urNp linux-2.6.30-rc4/drivers/mtd/nand/mxc_nd2.h linux-2.6.30-rc4-karo/dri
+ */
+
+/*!
-+ * @file mxc_nd2.h
-+ *
-+ * @brief This file contains the NAND Flash Controller register information.
++ * @file flexcan.h
+ *
++ * @brief FlexCan definitions.
+ *
-+ * @ingroup NAND_MTD
-+ */
-+
-+#ifndef __MXC_ND2_H__
-+#define __MXC_ND2_H__
-+
-+#include <mach/hardware.h>
-+
-+#define IS_2K_PAGE_NAND ((mtd->writesize / num_of_interleave) \
-+ == NAND_PAGESIZE_2KB)
-+#define IS_4K_PAGE_NAND ((mtd->writesize / num_of_interleave) \
-+ == NAND_PAGESIZE_4KB)
-+#define IS_LARGE_PAGE_NAND ((mtd->writesize / num_of_interleave) > 512)
-+
-+#define GET_NAND_OOB_SIZE (mtd->oobsize / num_of_interleave)
-+
-+#define NAND_PAGESIZE_2KB 2048
-+#define NAND_PAGESIZE_4KB 4096
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3
-+/*
-+ * For V3 NFC registers Definition
++ * @ingroup can
+ */
-+/* AXI Bus Mapped */
-+#define NFC_AXI_BASE_ADDR NFC_BASE_ADDR_AXI
-+
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_1) /* mx37 */
-+#define MXC_INT_NANDFC MXC_INT_EMI
-+#define NFC_FLASH_ADDR_CMD (nfc_axi_base + 0x1E00)
-+#define NFC_CONFIG1 (nfc_axi_base + 0x1E04)
-+#define NFC_ECC_STATUS_RESULT (nfc_axi_base + 0x1E08)
-+#define LAUNCH_NFC (nfc_axi_base + 0x1E0c)
-+#define NFC_WRPROT 0x00
-+#define NFC_WRPROT_UNLOCK_BLK_ADD0 0x04
-+#define NFC_CONFIG2 0x14
-+#define NFC_IPC 0x18
-+#elif defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2) /* mx51 */
-+#define MXC_INT_NANDFC MXC_INT_NFC
-+#define NFC_AUTO_MODE_ENABLE
-+#define NFC_FLASH_CMD (nfc_axi_base + 0x1E00)
-+#define NFC_FLASH_ADDR0 (nfc_axi_base + 0x1E04)
-+#define NFC_FLASH_ADDR8 (nfc_axi_base + 0x1E24)
-+#define NFC_CONFIG1 (nfc_axi_base + 0x1E34)
-+#define NFC_ECC_STATUS_RESULT (nfc_axi_base + 0x1E38)
-+#define NFC_ECC_STATUS_SUM (nfc_axi_base + 0x1E3C)
-+#define LAUNCH_NFC (nfc_axi_base + 0x1E40)
-+#define NFC_WRPROT 0x00
-+#define NFC_WRPROT_UNLOCK_BLK_ADD0 0x04
-+#define NFC_CONFIG2 0x24
-+#define NFC_CONFIG3 0x28
-+#define NFC_IPC 0x2C
-+#else /* skye */
-+#define NFC_FLASH_ADDR_CMD (nfc_axi_base + 0xE00)
-+#define NFC_CONFIG1 (nfc_axi_base + 0xE04)
-+#define NFC_ECC_STATUS_RESULT (nfc_axi_base + 0xE08)
-+#define LAUNCH_NFC (nfc_axi_base + 0xE0C)
-+#define NFC_WRPROT 0x00
-+#define NFC_WRPROT_UNLOCK_BLK_ADD0 0x04
-+#define NFC_CONFIG2 0x14
-+#define NFC_IPC 0x18
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+/*!
-+ * Addresses for NFC RAM BUFFER Main area 0
-+ */
-+#define MAIN_AREA0 ((u16 *)(nfc_axi_base + 0x000))
-+#define MAIN_AREA1 ((u16 *)(nfc_axi_base + 0x200))
-+
-+/*!
-+ * Addresses for NFC SPARE BUFFER Spare area 0
-+ */
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_1) || \
-+ defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2)
-+#define SPARE_AREA0 ((u16 *)(nfc_axi_base + 0x1000))
-+#define SPARE_LEN 64
-+#define SPARE_COUNT 8
-+#define SPARE_SIZE (SPARE_LEN * SPARE_COUNT)
-+#else
-+#define SPARE_AREA0 ((u16 *)(nfc_axi_base + 0x800))
-+#define SPARE_LEN 16
-+#define SPARE_COUNT 4
-+#define SPARE_SIZE (SPARE_LEN * SPARE_COUNT)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_1) || \
-+ defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2)
-+#define NFC_SPAS_WIDTH 8
-+#define NFC_SPAS_SHIFT 16
-+
-+#define IS_4BIT_ECC \
-+( \
-+ cpu_is_mx51_rev(CHIP_REV_2_0) == 1 ? \
-+ !((raw_read(NFC_CONFIG2) & NFC_ECC_MODE_4) >> 6) : \
-+ ((raw_read(NFC_CONFIG2) & NFC_ECC_MODE_4) >> 6) \
-+)
-+
-+#define NFC_SET_SPAS(v) \
-+ raw_write((((raw_read(NFC_CONFIG2) & \
-+ NFC_FIELD_RESET(NFC_SPAS_WIDTH, NFC_SPAS_SHIFT)) | ((v) << 16))), \
-+ NFC_CONFIG2)
-+
-+#define NFC_SET_ECC_MODE(v) \
-+do { \
-+ if (cpu_is_mx51_rev(CHIP_REV_2_0) == 1) { \
-+ if ((v) == NFC_SPAS_218 || (v) == NFC_SPAS_112) \
-+ raw_write(((raw_read(NFC_CONFIG2) & \
-+ NFC_ECC_MODE_MASK) | \
-+ NFC_ECC_MODE_4), NFC_CONFIG2); \
-+ else \
-+ raw_write(((raw_read(NFC_CONFIG2) & \
-+ NFC_ECC_MODE_MASK) & \
-+ ~NFC_ECC_MODE_4), NFC_CONFIG2); \
-+ } else { \
-+ if ((v) == NFC_SPAS_218 || (v) == NFC_SPAS_112) \
-+ raw_write(((raw_read(NFC_CONFIG2) & \
-+ NFC_ECC_MODE_MASK) & \
-+ ~NFC_ECC_MODE_4), NFC_CONFIG2); \
-+ else \
-+ raw_write(((raw_read(NFC_CONFIG2) & \
-+ NFC_ECC_MODE_MASK) | \
-+ NFC_ECC_MODE_4), NFC_CONFIG2); \
-+ } \
-+} while (0)
-+
-+#define WRITE_NFC_IP_REG(val,reg) \
-+ do { \
-+ nfc_write_reg(mxc_nand_data, NFC_IPC_CREQ, NFC_IPC); \
-+ while (!(nfc_read_reg(mxc_nand_data, NFC_IPC) & NFC_IPC_ACK)); \
-+ nfc_write_reg(mxc_nand_data, val, reg); \
-+ nfc_write_reg(mxc_nand_data, 0, NFC_IPC); \
-+ } while(0)
-+#else
-+#define IS_4BIT_ECC 1
-+#define NFC_SET_SPAS(v)
-+#define NFC_SET_ECC_MODE(v)
-+#define NFC_SET_NFMS(v) (NFMS |= (v))
-+
-+#define WRITE_NFC_IP_REG(val,reg) \
-+ nfc_write_reg(mxc_nand_data, val, REG_NFC_OPS_STAT)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+
-+#define GET_NFC_ECC_STATUS() nfc_read_reg(mxc_nand_data, REG_NFC_ECC_STATUS_RESULT);
-+
-+/*!
-+ * Set 1 to specific operation bit, rest to 0 in LAUNCH_NFC Register for
-+ * Specific operation
-+ */
-+#define NFC_CMD 0x1
-+#define NFC_ADDR 0x2
-+#define NFC_INPUT 0x4
-+#define NFC_OUTPUT 0x8
-+#define NFC_ID 0x10
-+#define NFC_STATUS 0x20
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_2 /* mx51 */
-+#define NFC_AUTO_PROG 0x40
-+#define NFC_AUTO_READ 0x80
-+#define NFC_AUTO_ERASE 0x200
-+#define NFC_COPY_BACK_0 0x400
-+#define NFC_COPY_BACK_1 0x800
-+#define NFC_AUTO_STATE 0x1000
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+/* Bit Definitions for NFC_IPC*/
-+#define NFC_OPS_STAT (1 << 31)
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_2 /* mx51 */
-+#define NFC_OP_DONE (1 << 30)
-+#define NFC_RB (1 << 28)
-+#define NFC_PS_WIDTH 2
-+#define NFC_PS_SHIFT 0
-+#define NFC_PS_512 0
-+#define NFC_PS_2K 1
-+#define NFC_PS_4K 2
-+#else
-+#define NFC_RB (1 << 29)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+#define NFC_ONE_CYCLE (1 << 2)
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_2 /* mx51 */
-+#define NFC_INT_MSK (1 << 15)
-+#define NFC_AUTO_PROG_DONE_MSK (1 << 14)
-+#define NFC_NUM_ADDR_PHASE1_WIDTH 2
-+#define NFC_NUM_ADDR_PHASE1_SHIFT 12
-+
-+#define NFC_NUM_ADDR_PHASE0_WIDTH 1
-+#define NFC_NUM_ADDR_PHASE0_SHIFT 5
-+
-+#define NFC_ONE_LESS_PHASE1 0
-+#define NFC_TWO_LESS_PHASE1 1
-+
-+#define NFC_FLASH_ADDR_SHIFT 0
-+#else
-+#define NFC_INT_MSK (1 << 4)
-+#define NFC_BIG (1 << 5)
-+#define NFC_FLASH_ADDR_SHIFT 16
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+#define NFC_UNLOCK_END_ADDR_SHIFT 16
-+
-+/* Bit definition for NFC_CONFIGRATION_1 */
-+#define NFC_SP_EN (1 << 0)
-+#define NFC_CE (1 << 1)
-+#define NFC_RST (1 << 2)
-+#define NFC_ECC_EN (1 << 3)
-+
-+#define NFC_FIELD_RESET(width, shift) ~(((1 << (width)) - 1) << (shift))
-+
-+#define NFC_RBA_SHIFT 4
-+
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_1) || \
-+ defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2) /* mx51 */
-+#define NFC_RBA_WIDTH 3
-+#else
-+#define NFC_RBA_WIDTH 2
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2) /* mx51 */
-+#define NFC_ITERATION_SHIFT 8
-+#define NFC_ITERATION_WIDTH 4
-+#define NFC_ACTIVE_CS_SHIFT 12
-+#define NFC_ACTIVE_CS_WIDTH 3
-+/* bit definition for CONFIGRATION3 */
-+#define NFC_NO_SDMA (1 << 20)
-+#define NFC_FMP_SHIFT 16
-+#define NFC_FMP_WIDTH 4
-+#define NFC_RBB_MODE (1 << 15)
-+#define NFC_NUM_OF_DEVICES_SHIFT 12
-+#define NFC_NUM_OF_DEVICES_WIDTH 4
-+#define NFC_DMA_MODE_SHIFT 11
-+#define NFC_DMA_MODE_WIDTH 1
-+#define NFC_SBB_SHIFT 8
-+#define NFC_SBB_WIDTH 3
-+#define NFC_BIG (1 << 7)
-+#define NFC_SB2R_SHIFT 4
-+#define NFC_SB2R_WIDTH 3
-+#define NFC_FW_SHIFT 3
-+#define NFC_FW_WIDTH 1
-+#define NFC_TOO (1 << 2)
-+#define NFC_ADD_OP_SHIFT 0
-+#define NFC_ADD_OP_WIDTH 2
-+#define NFC_FW_8 1
-+#define NFC_FW_16 0
-+#define NFC_ST_CMD_SHITF 24
-+#define NFC_ST_CMD_WIDTH 8
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+#define NFC_PPB_32 (0 << 7)
-+#define NFC_PPB_64 (1 << 7)
-+#define NFC_PPB_128 (2 << 7)
-+#define NFC_PPB_256 (3 << 7)
-+#define NFC_PPB_RESET ~(3 << 7)
-+
-+#define NFC_BLS_LOCKED (0 << 16)
-+#define NFC_BLS_LOCKED_DEFAULT (1 << 16)
-+#define NFC_BLS_UNLOCKED (2 << 16)
-+#define NFC_BLS_RESET ~(3 << 16)
-+#define NFC_WPC_LOCK_TIGHT 1
-+#define NFC_WPC_LOCK (1 << 1)
-+#define NFC_WPC_UNLOCK (1 << 2)
-+#define NFC_WPC_RESET ~7
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_1) || \
-+ defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2)
-+#define NFC_ECC_MODE_4 (1 << 6)
-+#define NFC_ECC_MODE_MASK ~(1 << 6)
-+#define NFC_SPAS_16 8
-+#define NFC_SPAS_64 32
-+#define NFC_SPAS_128 64
-+#define NFC_SPAS_112 56
-+#define NFC_SPAS_218 109
-+#define NFC_IPC_CREQ (1 << 0)
-+#define NFC_IPC_ACK (1 << 1)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+
-+#define REG_NFC_OPS_STAT NFC_IPC
-+#define REG_NFC_INTERRUPT NFC_CONFIG2
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_2
-+#define REG_NFC_FLASH_ADDR NFC_FLASH_ADDR0
-+#define REG_NFC_FLASH_CMD NFC_FLASH_CMD
-+#else
-+#define REG_NFC_FLASH_ADDR NFC_FLASH_ADDR_CMD
-+#define REG_NFC_FLASH_CMD NFC_FLASH_ADDR_CMD
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+#define REG_NFC_OPS LAUNCH_NFC
-+#define REG_NFC_SET_RBA NFC_CONFIG1
-+#define REG_NFC_RB NFC_IPC
-+#define REG_NFC_ECC_EN NFC_CONFIG2
-+#define REG_NFC_ECC_STATUS_RESULT NFC_ECC_STATUS_RESULT
-+#define REG_NFC_CE NFC_CONFIG1
-+#define REG_NFC_RST NFC_CONFIG1
-+#define REG_NFC_PPB NFC_CONFIG2
-+#define REG_NFC_SP_EN NFC_CONFIG1
-+#define REG_NFC_BLS NFC_WRPROT
-+#define REG_UNLOCK_BLK_ADD0 NFC_WRPROT_UNLOCK_BLK_ADD0
-+#define REG_UNLOCK_BLK_ADD1 NFC_WRPROT_UNLOCK_BLK_ADD1
-+#define REG_UNLOCK_BLK_ADD2 NFC_WRPROT_UNLOCK_BLK_ADD2
-+#define REG_UNLOCK_BLK_ADD3 NFC_WRPROT_UNLOCK_BLK_ADD3
-+#define REG_NFC_WPC NFC_WRPROT
-+#define REG_NFC_ONE_CYCLE NFC_CONFIG2
-+
-+/* NFC V3 Specific MACRO function definitions */
-+#define raw_write(v,a) __raw_writel(v,a)
-+#define raw_read(a) __raw_readl(a)
-+
-+/* Explicitly ack ops status (if any), before issuing any command */
-+#define ACK_OPS \
-+ nfc_write_reg(mxc_nand_data, \
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_OPS_STAT) & ~NFC_OPS_STAT), \
-+ REG_NFC_OPS_STAT)
-+
-+/* Set RBA buffer id*/
-+#define NFC_SET_RBA(val) \
-+ nfc_write_reg(mxc_nand_data, \
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_SET_RBA) & \
-+ (NFC_FIELD_RESET(NFC_RBA_WIDTH, NFC_RBA_SHIFT))) | \
-+ ((val) << NFC_RBA_SHIFT), REG_NFC_SET_RBA)
-+
-+#define NFC_SET_PS(val) \
-+ nfc_write_reg(mxc_nand_data, \
-+ (nfc_read_reg(mxc_nand_data, NFC_CONFIG2) & \
-+ (NFC_FIELD_RESET(NFC_PS_WIDTH, NFC_PS_SHIFT))) | \
-+ ((val) << NFC_PS_SHIFT), NFC_CONFIG2)
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_2
-+#define UNLOCK_ADDR(start_addr,end_addr) \
-+{ \
-+ int i = 0; \
-+ for (; i < NAND_MAX_CHIPS; i++) \
-+ nfc_write_reg(mxc_nand_data, start_addr | \
-+ (end_addr << NFC_UNLOCK_END_ADDR_SHIFT), \
-+ REG_UNLOCK_BLK_ADD0 + (i << 2)); \
-+}
-+
-+#define NFC_SET_NFC_ACTIVE_CS(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG1) & \
-+ (NFC_FIELD_RESET(NFC_ACTIVE_CS_WIDTH, NFC_ACTIVE_CS_SHIFT))) | \
-+ ((val) << NFC_ACTIVE_CS_SHIFT), NFC_CONFIG1)
-+
-+#define NFC_GET_MAXCHIP_SP() 8
-+
-+#else
-+#define UNLOCK_ADDR(start_addr,end_addr) \
-+ nfc_write_reg(mxc_nand_data, start_addr | \
-+ (end_addr << NFC_UNLOCK_END_ADDR_SHIFT), REG_UNLOCK_BLK_ADD0)
-+
-+#define NFC_SET_NFC_ACTIVE_CS(val)
-+#define NFC_GET_MAXCHIP_SP() 1
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+#define NFC_SET_BLS(val) ((nfc_read_reg(mxc_nand_data, REG_NFC_BLS) & NFC_BLS_RESET) | val)
-+#define NFC_SET_WPC(val) ((nfc_read_reg(mxc_nand_data, REG_NFC_WPC) & NFC_WPC_RESET) | val)
-+#define CHECK_NFC_RB nfc_read_reg(mxc_nand_data, REG_NFC_RB) & NFC_RB
-+
-+#if defined(CONFIG_ARCH_MXC_HAS_NFC_V3_2)
-+#define NFC_SET_NFC_NUM_ADDR_PHASE1(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG2) & \
-+ (NFC_FIELD_RESET(NFC_NUM_ADDR_PHASE1_WIDTH, \
-+ NFC_NUM_ADDR_PHASE1_SHIFT))) | \
-+ ((val) << NFC_NUM_ADDR_PHASE1_SHIFT), NFC_CONFIG2);
-+
-+#define NFC_SET_NFC_NUM_ADDR_PHASE0(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG2) & \
-+ (NFC_FIELD_RESET(NFC_NUM_ADDR_PHASE0_WIDTH, \
-+ NFC_NUM_ADDR_PHASE0_SHIFT))) | \
-+ ((val) << NFC_NUM_ADDR_PHASE0_SHIFT), NFC_CONFIG2);
-+
-+#define NFC_SET_NFC_ITERATION(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG1) & \
-+ (NFC_FIELD_RESET(NFC_ITERATION_WIDTH, NFC_ITERATION_SHIFT))) | \
-+ ((val) << NFC_ITERATION_SHIFT), NFC_CONFIG1);
-+
-+#define NFC_SET_FW(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG3) & \
-+ (NFC_FIELD_RESET(NFC_FW_WIDTH, NFC_FW_SHIFT))) | \
-+ ((val) << NFC_FW_SHIFT), NFC_CONFIG3);
-+
-+#define NFC_SET_NUM_OF_DEVICE(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG3) & \
-+ (NFC_FIELD_RESET(NFC_NUM_OF_DEVICES_WIDTH, \
-+ NFC_NUM_OF_DEVICES_SHIFT))) | \
-+ ((val) << NFC_NUM_OF_DEVICES_SHIFT), NFC_CONFIG3);
-+
-+#define NFC_SET_ADD_OP_MODE(val) \
-+ nfc_write_reg(mxc_nand_data, (nfc_read_reg(mxc_nand_data, NFC_CONFIG3) & \
-+ (NFC_FIELD_RESET(NFC_ADD_OP_WIDTH, NFC_ADD_OP_SHIFT))) | \
-+ ((val) << NFC_ADD_OP_SHIFT), NFC_CONFIG3);
-+
-+#define NFC_SET_ADD_CS_MODE(val) \
-+{ \
-+ NFC_SET_ADD_OP_MODE(val); \
-+ NFC_SET_NUM_OF_DEVICE(this->numchips - 1); \
-+}
-+
-+#define NFC_SET_ST_CMD(val) \
-+ nfc_write_reg((raw_read(NFC_CONFIG2) & \
-+ (NFC_FIELD_RESET(NFC_ST_CMD_WIDTH, \
-+ NFC_ST_CMD_SHITF))) | \
-+ ((val) << NFC_ST_CMD_SHITF), NFC_CONFIG2);
-+
-+#define NFMS_NF_DWIDTH 0
-+#define NFMS_NF_PG_SZ 1
-+#define NFC_CMD_1_SHIFT 8
-+
-+#define NUM_OF_ADDR_CYCLE (fls(g_page_mask) >> 3)
-+
-+/*should set the fw,ps,spas,ppb*/
-+#define NFC_SET_NFMS(v) \
-+do { \
-+ NFC_SET_FW(NFC_FW_8); \
-+ if (((v) & (1 << NFMS_NF_DWIDTH))) \
-+ NFC_SET_FW(NFC_FW_16); \
-+ if (((v) & (1 << NFMS_NF_PG_SZ))) { \
-+ if (IS_2K_PAGE_NAND) { \
-+ NFC_SET_PS(NFC_PS_2K); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE1(NUM_OF_ADDR_CYCLE); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE0(NFC_TWO_LESS_PHASE1); \
-+ } else if (IS_4K_PAGE_NAND) { \
-+ NFC_SET_PS(NFC_PS_4K); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE1(NUM_OF_ADDR_CYCLE); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE0(NFC_TWO_LESS_PHASE1); \
-+ } else { \
-+ NFC_SET_PS(NFC_PS_512); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE1(NUM_OF_ADDR_CYCLE - 1); \
-+ NFC_SET_NFC_NUM_ADDR_PHASE0(NFC_ONE_LESS_PHASE1); \
-+ } \
-+ NFC_SET_ADD_CS_MODE(1); \
-+ NFC_SET_SPAS(GET_NAND_OOB_SIZE >> 1); \
-+ NFC_SET_ECC_MODE(GET_NAND_OOB_SIZE >> 1); \
-+ NFC_SET_ST_CMD(0x70); \
-+ nfc_write_reg(raw_read(NFC_CONFIG3) | 1 << 20, NFC_CONFIG3); \
-+ } \
-+} while (0)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_2 */
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V3_1
-+#define NFC_SET_NFMS(v)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3_1 */
-+
-+#define READ_PAGE(c) send_read_page(c,0)
-+#define PROG_PAGE(c) send_prog_page(c,0)
-+
-+#elif CONFIG_ARCH_MXC_HAS_NFC_V2
-+
-+/*
-+ * For V1/V2 NFC registers Definition
-+ */
-+
-+#define NFC_AXI_BASE_ADDR 0x00
-+/*
-+ * Addresses for NFC registers
-+ */
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define NFC_REG_BASE 0x1000
-+#else
-+#define NFC_REG_BASE 0x0000
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+#define NFC_BUF_SIZE (NFC_REG_BASE + 0xE00)
-+#define NFC_BUF_ADDR (NFC_REG_BASE + 0xE04)
-+#define NFC_FLASH_ADDR (NFC_REG_BASE + 0xE06)
-+#define NFC_FLASH_CMD (NFC_REG_BASE + 0xE08)
-+#define NFC_CONFIG (NFC_REG_BASE + 0xE0A)
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define NFC_ECC_STATUS_RESULT (NFC_REG_BASE + 0xE0C)
-+#define NFC_ECC_STATUS_RESULT_1 (NFC_REG_BASE + 0xE0C)
-+#define NFC_ECC_STATUS_RESULT_2 (NFC_REG_BASE + 0xE0E)
-+#define NFC_SPAS (NFC_REG_BASE + 0xE10)
-+#else
-+#define NFC_ECC_STATUS_RESULT (NFC_REG_BASE + 0xE0C)
-+#define NFC_RSLTMAIN_AREA (NFC_REG_BASE + 0xE0E)
-+#define NFC_RSLTSPARE_AREA (NFC_REG_BASE + 0xE10)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+#define NFC_WRPROT (NFC_REG_BASE + 0xE12)
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define NFC_UNLOCKSTART_BLKADDR (NFC_REG_BASE + 0xE20)
-+#define NFC_UNLOCKEND_BLKADDR (NFC_REG_BASE + 0xE22)
-+#define NFC_UNLOCKSTART_BLKADDR1 (NFC_REG_BASE + 0xE24)
-+#define NFC_UNLOCKEND_BLKADDR1 (NFC_REG_BASE + 0xE26)
-+#define NFC_UNLOCKSTART_BLKADDR2 (NFC_REG_BASE + 0xE28)
-+#define NFC_UNLOCKEND_BLKADDR2 (NFC_REG_BASE + 0xE2A)
-+#define NFC_UNLOCKSTART_BLKADDR3 (NFC_REG_BASE + 0xE2C)
-+#define NFC_UNLOCKEND_BLKADDR3 (NFC_REG_BASE + 0xE2E)
-+#else
-+#define NFC_UNLOCKSTART_BLKADDR (NFC_REG_BASE + 0xE14)
-+#define NFC_UNLOCKEND_BLKADDR (NFC_REG_BASE + 0xE16)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+#define NFC_NF_WRPRST (NFC_REG_BASE + 0xE18)
-+#define NFC_CONFIG1 (NFC_REG_BASE + 0xE1A)
-+#define NFC_CONFIG2 (NFC_REG_BASE + 0xE1C)
-+
-+/*!
-+ * Addresses for NFC RAM BUFFER Main area 0
-+ */
-+#define MAIN_AREA0 0x000
-+#define MAIN_AREA1 0x200
-+
-+/*!
-+ * Addresses for NFC SPARE BUFFER Spare area 0
-+ */
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define SPARE_AREA0 0x1000
-+#define SPARE_LEN 64
-+#define SPARE_COUNT 8
-+#else
-+#define SPARE_AREA0 0x800
-+#define SPARE_LEN 16
-+#define SPARE_COUNT 4
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+#define SPARE_SIZE (SPARE_LEN * SPARE_COUNT)
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define REG_NFC_ECC_MODE NFC_CONFIG1
-+#define SPAS_SHIFT 0
-+#define REG_NFC_SPAS NFC_SPAS
-+#define SPAS_MASK 0xFF00
-+#define IS_4BIT_ECC \
-+ (!!(nfc_read_reg(mxc_nand_data, REG_NFC_ECC_MODE) & NFC_ECC_MODE_4))
-+
-+#define NFC_SET_SPAS(v) \
-+ nfc_write_reg(mxc_nand_data, \
-+ ((nfc_read_reg(mxc_nand_data, REG_NFC_SPAS) & SPAS_MASK) | \
-+ (((v) << SPAS_SHIFT))), \
-+ REG_NFC_SPAS)
-+
-+#define NFC_SET_ECC_MODE(v) \
-+do { \
-+ if ((v) == NFC_SPAS_218) { \
-+ nfc_write_reg(mxc_nand_data, \
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_MODE) & ~NFC_ECC_MODE_4),\
-+ REG_NFC_ECC_MODE); \
-+ } else { \
-+ nfc_write_reg(mxc_nand_data, \
-+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_MODE) | NFC_ECC_MODE_4), \
-+ REG_NFC_ECC_MODE); \
-+ } \
-+} while (0)
-+
-+#define NFC_SET_NFMS(v) \
-+do { \
-+ DBG(0, "Setting NFMS[%p:%08lx] to %08x | %08x\n", NFMS_REG, \
-+ MXC_PHYS_ADDRESS(NFMS_REG), __raw_readl(NFMS_REG), v); \
-+ __raw_writel(__raw_readl(NFMS_REG) | (v), NFMS_REG); \
-+ if (((v) & (1 << NFMS_NF_PG_SZ))) { \
-+ NFC_SET_SPAS(GET_NAND_OOB_SIZE >> 1); \
-+ NFC_SET_ECC_MODE(GET_NAND_OOB_SIZE >> 1); \
-+ } \
-+} while (0)
-+#else
-+#define IS_4BIT_ECC 1
-+#define NFC_SET_SPAS(v)
-+#define NFC_SET_ECC_MODE(v)
-+#define NFC_SET_NFMS(v) (NFMS |= (v))
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+
-+#define WRITE_NFC_IP_REG(val,reg) \
-+ nfc_write_reg(mxc_nand_data, val, REG_NFC_OPS_STAT)
-+
-+#define GET_NFC_ECC_STATUS() nfc_read_reg(mxc_nand_data, REG_NFC_ECC_STATUS_RESULT)
-+
-+/*!
-+ * Set INT to 0, Set 1 to specific operation bit, rest to 0 in NFC_CONFIG2 Register for
-+ * Specific operation
-+ */
-+#define NFC_CMD 0x1
-+#define NFC_ADDR 0x2
-+#define NFC_INPUT 0x4
-+#define NFC_OUTPUT 0x8
-+#define NFC_ID 0x10
-+#define NFC_STATUS 0x20
-+
-+/* Bit Definitions */
-+#define NFC_OPS_STAT (1 << 15)
-+#define NFC_SP_EN (1 << 2)
-+#define NFC_ECC_EN (1 << 3)
-+#define NFC_INT_MSK (1 << 4)
-+#define NFC_BIG (1 << 5)
-+#define NFC_RST (1 << 6)
-+#define NFC_CE (1 << 7)
-+#define NFC_ONE_CYCLE (1 << 8)
-+#define NFC_BLS_LOCKED 0
-+#define NFC_BLS_LOCKED_DEFAULT 1
-+#define NFC_BLS_UNLOCKED 2
-+#define NFC_WPC_LOCK_TIGHT (1 << 0)
-+#define NFC_WPC_LOCK (1 << 1)
-+#define NFC_WPC_UNLOCK (1 << 2)
-+#define NFC_FLASH_ADDR_SHIFT 0
-+#define NFC_UNLOCK_END_ADDR_SHIFT 0
-+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define NFC_ECC_MODE_4 (1 << 0)
-+#define NFC_SPAS_16 8
-+#define NFC_SPAS_64 32
-+#define NFC_SPAS_112 56
-+#define NFC_SPAS_128 64
-+#define NFC_SPAS_218 109
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+/* NFC Register Mapping */
-+#define REG_NFC_OPS_STAT NFC_CONFIG2
-+#define REG_NFC_INTERRUPT NFC_CONFIG1
-+#define REG_NFC_FLASH_ADDR NFC_FLASH_ADDR
-+#define REG_NFC_FLASH_CMD NFC_FLASH_CMD
-+#define REG_NFC_OPS NFC_CONFIG2
-+#define REG_NFC_SET_RBA NFC_BUF_ADDR
-+#define REG_NFC_ECC_EN NFC_CONFIG1
-+#define REG_NFC_ECC_STATUS_RESULT NFC_ECC_STATUS_RESULT
-+#define REG_NFC_CE NFC_CONFIG1
-+#define REG_NFC_SP_EN NFC_CONFIG1
-+#define REG_NFC_BLS NFC_CONFIG
-+#define REG_NFC_WPC NFC_WRPROT
-+#define REG_START_BLKADDR NFC_UNLOCKSTART_BLKADDR
-+#define REG_END_BLKADDR NFC_UNLOCKEND_BLKADDR
-+#define REG_NFC_RST NFC_CONFIG1
-+#define REG_NFC_ONE_CYCLE NFC_CONFIG1
-+
-+/* NFC V1/V2 Specific MACRO functions definitions */
-+
-+#if defined(CONFIG_MTD_DEBUG)
-+#define nfc_write_reg(c, v, r) __nfc_reg_write(v, (c)->reg_base + r, #r, __FUNCTION__)
-+static inline void __nfc_reg_write(u16 val, void __iomem *addr,
-+ const char *reg, const char *fn)
-+{
-+ DBG(3, "%s: Writing %04x to %s[%04lx]\n", fn, val, reg,
-+ (unsigned long)addr & 0x1fff);
-+ __raw_writew(val, addr);
-+}
-+
-+#define nfc_read_reg(c, r) __nfc_reg_read((c)->reg_base + r, #r, __FUNCTION__)
-+static inline u16 __nfc_reg_read(void __iomem *addr,
-+ const char *reg, const char *fn)
-+{
-+ u16 val;
-+ val = __raw_readw(addr);
-+ DBG(3, "%s: Read %04x from %s[%04lx]\n", fn, val, reg,
-+ (unsigned long)addr & 0x1fff);
-+ return val;
-+}
-+#else
-+#define nfc_read_reg(c, r) __raw_readw((c)->reg_base + r)
-+#define nfc_write_reg(c, v, r) __raw_writew(v, (c)->reg_base + r)
-+#endif /* CONFIG_MTD_DEBUG */
-+
-+#define NFC_SET_BLS(val) (val)
+
-+#define UNLOCK_ADDR(start_addr,end_addr) \
-+{ \
-+ nfc_write_reg(mxc_nand_data, start_addr,REG_START_BLKADDR); \
-+ nfc_write_reg(mxc_nand_data, end_addr,REG_END_BLKADDR); \
-+}
++#ifndef __CAN_FLEXCAN_H__
++#define __CAN_FLEXCAN_H__
+
-+#define NFC_SET_NFC_ACTIVE_CS(val)
-+#define NFC_GET_MAXCHIP_SP() 1
-+#define NFC_SET_WPC(val) (val)
++#include <linux/list.h>
++#include <linux/platform_device.h>
++#include <linux/regulator/consumer.h>
++#include <linux/clk.h>
++#include <linux/can.h>
++#include <linux/can/core.h>
++#include <linux/can/error.h>
++
++struct can_mb_cs {
++ unsigned int time_stamp:16;
++ unsigned int length:4;
++ unsigned int rtr:1;
++ unsigned int ide:1;
++ unsigned int srr:1;
++ unsigned int nouse1:1;
++ unsigned int code:4;
++ unsigned int nouse2:4;
++};
+
-+#define ACK_OPS
-+#define NFC_SET_RBA(val) nfc_write_reg(mxc_nand_data, val, REG_NFC_SET_RBA);
++#define CAN_MB_RX_INACTIVE 0x0
++#define CAN_MB_RX_EMPTY 0x4
++#define CAN_MB_RX_FULL 0x2
++#define CAN_MB_RX_OVERRUN 0x6
++#define CAN_MB_RX_BUSY 0x1
++
++#define CAN_MB_TX_INACTIVE 0x8
++#define CAN_MB_TX_ABORT 0x9
++#define CAN_MB_TX_ONCE 0xC
++#define CAN_MB_TX_REMOTE 0xA
++
++struct can_hw_mb {
++ union {
++ struct can_mb_cs cs;
++ unsigned int data;
++ } mb_cs;
++ unsigned int mb_id;
++ unsigned char mb_data[8];
++};
+
-+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V2_1
-+#define READ_PAGE(c) send_read_page(c,0)
-+#define PROG_PAGE(c) send_prog_page(c,0)
-+#else
-+#define READ_PAGE(c) \
-+do { \
-+ send_read_page(c,0); \
-+ send_read_page(c,1); \
-+ send_read_page(c,2); \
-+ send_read_page(c,3); \
-+} while (0)
-+
-+#define PROG_PAGE(c) \
-+do { \
-+ send_prog_page(c,0); \
-+ send_prog_page(c,1); \
-+ send_prog_page(c,2); \
-+ send_prog_page(c,3); \
-+} while (0)
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V2_1 */
-+#define CHECK_NFC_RB 1
-+
-+#endif /* CONFIG_ARCH_MXC_HAS_NFC_V3 */
-+
-+#endif /* __MXC_ND2_H__ */
-diff -urNp linux-2.6.30-rc4/drivers/net/Kconfig linux-2.6.30-rc4-karo/drivers/net/Kconfig
---- linux-2.6.30-rc4/drivers/net/Kconfig 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/net/Kconfig 2009-06-02 17:05:27.000000000 +0200
-@@ -1859,7 +1859,7 @@ config 68360_ENET
-
- config FEC
- bool "FEC ethernet controller (of ColdFire CPUs)"
-- depends on M523x || M527x || M5272 || M528x || M520x || M532x || MACH_MX27
-+ depends on M523x || M527x || M5272 || M528x || M520x || M532x || MACH_MX27 || MACH_TX25
- help
- Say Y here if you want to use the built-in 10/100 Fast ethernet
- controller on some Motorola ColdFire and Freescale i.MX processors.
-diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/fec.c
---- linux-2.6.30-rc4/drivers/net/fec.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/net/fec.c 2009-06-02 17:05:27.000000000 +0200
++#define CAN_HW_REG_MCR 0x00
++#define CAN_HW_REG_CTRL 0x04
++#define CAN_HW_REG_TIMER 0x08
++#define CAN_HW_REG_RXGMASK 0x10
++#define CAN_HW_REG_RX14MASK 0x14
++#define CAN_HW_REG_RX15MASK 0x18
++#define CAN_HW_REG_ECR 0x1C
++#define CAN_HW_REG_ESR 0x20
++#define CAN_HW_REG_IMASK2 0x24
++#define CAN_HW_REG_IMASK1 0x28
++#define CAN_HW_REG_IFLAG2 0x2C
++#define CAN_HW_REG_IFLAG1 0x30
++
++#define CAN_MB_BASE 0x0080
++#define CAN_RXMASK_BASE 0x0880
++#define CAN_FIFO_BASE 0xE0
++
++#define __MCR_MDIS (1 << 31)
++#define __MCR_FRZ (1 << 30)
++#define __MCR_FEN (1 << 29)
++#define __MCR_HALT (1 << 28)
++#define __MCR_NOTRDY (1 << 27)
++#define __MCR_WAK_MSK (1 << 26)
++#define __MCR_SOFT_RST (1 << 25)
++#define __MCR_FRZ_ACK (1 << 24)
++#define __MCR_SLF_WAK (1 << 22)
++#define __MCR_WRN_EN (1 << 21)
++#define __MCR_LPM_ACK (1 << 20)
++#define __MCR_WAK_SRC (1 << 19)
++#define __MCR_DOZE (1 << 18)
++#define __MCR_SRX_DIS (1 << 17)
++#define __MCR_BCC (1 << 16)
++#define __MCR_LPRIO_EN (1 << 13)
++#define __MCR_AEN (1 << 12)
++#define __MCR_MAX_IDAM_OFFSET 8
++#define __MCR_MAX_IDAM_MASK (0x3 << __MCR_MAX_IDAM_OFFSET)
++#define __MCR_MAX_IDAM_A (0x0 << __MCR_MAX_IDAM_OFFSET)
++#define __MCR_MAX_IDAM_B (0x1 << __MCR_MAX_IDAM_OFFSET)
++#define __MCR_MAX_IDAM_C (0x2 << __MCR_MAX_IDAM_OFFSET)
++#define __MCR_MAX_IDAM_D (0x3 << __MCR_MAX_IDAM_OFFSET)
++#define __MCR_MAX_MB_OFFSET 0
++#define __MCR_MAX_MB_MASK (0x3F)
++
++#define __CTRL_PRESDIV_OFFSET 24
++#define __CTRL_PRESDIV_MASK (0xFF << __CTRL_PRESDIV_OFFSET)
++#define __CTRL_RJW_OFFSET 22
++#define __CTRL_RJW_MASK (0x3 << __CTRL_RJW_OFFSET)
++#define __CTRL_PSEG1_OFFSET 19
++#define __CTRL_PSEG1_MASK (0x7 << __CTRL_PSEG1_OFFSET)
++#define __CTRL_PSEG2_OFFSET 16
++#define __CTRL_PSEG2_MASK (0x7 << __CTRL_PSEG2_OFFSET)
++#define __CTRL_BOFF_MSK (0x1 << 15)
++#define __CTRL_ERR_MSK (0x1 << 14)
++#define __CTRL_CLK_SRC (0x1 << 13)
++#define __CTRL_LPB (0x1 << 12)
++#define __CTRL_TWRN_MSK (0x1 << 11)
++#define __CTRL_RWRN_MSK (0x1 << 10)
++#define __CTRL_SMP (0x1 << 7)
++#define __CTRL_BOFF_REC (0x1 << 6)
++#define __CTRL_TSYN (0x1 << 5)
++#define __CTRL_LBUF (0x1 << 4)
++#define __CTRL_LOM (0x1 << 3)
++#define __CTRL_PROPSEG_OFFSET 0
++#define __CTRL_PROPSEG_MASK (0x7)
++
++#define __ECR_TX_ERR_COUNTER(x) ((x) & 0xFF)
++#define __ECR_RX_ERR_COUNTER(x) (((x) >> 8) & 0xFF)
++#define __ECR_PASSIVE_THRESHOLD 128
++#define __ECR_ACTIVE_THRESHOLD 96
++
++#define __ESR_TWRN_INT (0x1 << 17)
++#define __ESR_RWRN_INT (0x1 << 16)
++#define __ESR_BIT1_ERR (0x1 << 15)
++#define __ESR_BIT0_ERR (0x1 << 14)
++#define __ESR_ACK_ERR (0x1 << 13)
++#define __ESR_CRC_ERR (0x1 << 12)
++#define __ESR_FRM_ERR (0x1 << 11)
++#define __ESR_STF_ERR (0x1 << 10)
++#define __ESR_TX_WRN (0x1 << 9)
++#define __ESR_RX_WRN (0x1 << 8)
++#define __ESR_IDLE (0x1 << 7)
++#define __ESR_TXRX (0x1 << 6)
++#define __ESR_FLT_CONF_OFF 4
++#define __ESR_FLT_CONF_MASK (0x3 << __ESR_FLT_CONF_OFF)
++#define __ESR_BOFF_INT (0x1 << 2)
++#define __ESR_ERR_INT (0x1 << 1)
++#define __ESR_WAK_INT (0x1)
++
++#define __ESR_INTERRUPTS (__ESR_WAK_INT | __ESR_ERR_INT | \
++ __ESR_BOFF_INT | __ESR_TWRN_INT | \
++ __ESR_RWRN_INT)
++
++#define __FIFO_OV_INT (1 << 7)
++#define __FIFO_WARN_INT (1 << 6)
++#define __FIFO_RDY_INT (1 << 5)
++
++#define FLEXCAN_MAX_FIFO_MB 8
++#define FLEXCAN_MAX_MB 64
++#define FLEXCAN_MAX_PRESDIV 256
++#define FLEXCAN_MAX_RJW 4
++#define FLEXCAN_MAX_PSEG1 8
++#define FLEXCAN_MAX_PSEG2 8
++#define FLEXCAN_MAX_PROPSEG 8
++#define FLEXCAN_MAX_BITRATE 1000000
++
++struct flexcan_device {
++ struct mutex mutex;
++ struct work_struct err_work;
++ struct work_struct mb_work;
++ void __iomem *io_base;
++ struct can_hw_mb __iomem *hwmb;
++ unsigned int __iomem *rx_mask;
++ int xmit_buffers;
++ unsigned int xmit_mb;
++ unsigned int bitrate;
++ /* word 1 */
++ unsigned int br_presdiv:8;
++ unsigned int br_rjw:2;
++ unsigned int br_propseg:3;
++ unsigned int br_pseg1:3;
++ unsigned int br_pseg2:3;
++ unsigned int maxmb:6;
++ unsigned int xmit_maxmb:6;
++ unsigned int rsrvd:1;
++
++ /* word 2 */
++ unsigned int fifo:1;
++ unsigned int wakeup:1;
++ unsigned int srx_dis:1;
++ unsigned int wak_src:1;
++ unsigned int bcc:1;
++ unsigned int lprio:1;
++ unsigned int abort:1;
++ unsigned int br_clksrc:1;
++ unsigned int loopback:1;
++ unsigned int smp:1;
++ unsigned int boff_rec:1;
++ unsigned int tsyn:1;
++ unsigned int listen:1;
++
++ unsigned int ext_msg:1;
++ unsigned int std_msg:1;
++
++ struct timer_list timer;
++ struct platform_device *dev;
++ struct regulator *core_reg;
++ struct regulator *io_reg;
++ struct clk *clk;
++ int irq;
++};
++#endif /* __CAN_FLEXCAN_H__ */
+diff -purN linux-2.6.30-rc4-git/drivers/net/fec.c linux-2.6.30-rc4-karo3/drivers/net/fec.c
+--- linux-2.6.30-rc4-git/drivers/net/fec.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/net/fec.c 2009-07-01 12:59:40.000000000 +0200
@@ -2,6 +2,12 @@
* Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
* Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
@@ -14422,7 +14924,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* Make MII read/write commands for the FEC.
*/
-@@ -284,87 +378,233 @@ static int mii_queue(struct net_device *
+@@ -284,47 +378,160 @@ static int mii_queue(struct net_device *
#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */
#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
@@ -14540,45 +15042,6 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr,
+ len, DMA_TO_DEVICE);
+}
-+
-+static void dump_packet(const char *prefix, const unsigned char *data, int len)
-+{
-+ if (dbg_lvl(3)) {
-+ print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, data, len);
-+ }
-+}
-+
-+static void dump_tx_buffers(struct fec_enet_private *fep)
-+{
-+ cbd_t *bdp = fep->tx_bd_base;
-+ int i;
-+
-+ printk(KERN_DEBUG "tx buffers: %u buffers\n", TX_RING_SIZE);
-+ for (i = 0; i < TX_RING_SIZE; i++, bdp++) {
-+ printk(KERN_DEBUG " %p: %04x %04x %08x\n",
-+ bdp,
-+ bdp->cbd_sc,
-+ bdp->cbd_datlen,
-+ bdp->cbd_bufaddr);
-+ print_hex_dump_bytes("tx buffers:", DUMP_PREFIX_ADDRESS, bdp, sizeof(cbd_t));
-+ }
-+}
-+
-+static void dump_rx_buffers(struct fec_enet_private *fep)
-+{
-+ cbd_t *bdp = fep->rx_bd_base;
-+ int i;
-+
-+ printk(KERN_DEBUG "rx buffers: %lu buffers\n", RX_RING_SIZE);
-+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) {
-+ printk(KERN_DEBUG " %p: %04x %04x %08x\n",
-+ bdp,
-+ bdp->cbd_sc,
-+ bdp->cbd_datlen,
-+ bdp->cbd_bufaddr);
-+ print_hex_dump_bytes("rx buffers:", DUMP_PREFIX_ADDRESS, bdp, sizeof(cbd_t));
-+ }
-+}
static int
fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -14599,13 +15062,13 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ if (!fep->linkstatus) {
+ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__);
/* Link is down or autonegotiation is in progress. */
- return 1;
+- return 1;
++ return NETDEV_TX_BUSY;
}
- spin_lock_irqsave(&fep->hw_lock, flags);
+ spin_lock_irqsave(&fep->lock, flags);
+
-+ //WARN_ON(fec_reg_read(fep, FEC_TDAR) & TDAR_BUSY);
+ fec_enet_cbd_get(fep);
+
/* Fill in a Tx ring entry */
@@ -14620,9 +15083,10 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
*/
printk("%s: tx queue full!.\n", dev->name);
- spin_unlock_irqrestore(&fep->hw_lock, flags);
+- return 1;
+ fec_enet_cbd_put(fep);
+ spin_unlock_irqrestore(&fep->lock, flags);
- return 1;
++ return NETDEV_TX_BUSY;
}
#endif
-
@@ -14635,9 +15099,8 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
- bdp->cbd_bufaddr = __pa(skb->data);
bdp->cbd_datlen = skb->len;
-+ dump_packet("sending packet:", skb->data, skb->len);
/*
- * On some FEC implementations data must be aligned on
+@@ -332,39 +539,31 @@ fec_enet_start_xmit(struct sk_buff *skb,
* 4-byte boundaries. Use bounce buffers to copy data
* and get it aligned. Ugh.
*/
@@ -14684,7 +15147,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* If this was the last BD in the ring, start at the beginning again.
*/
if (status & BD_ENET_TX_WRAP) {
-@@ -375,12 +615,22 @@ fec_enet_start_xmit(struct sk_buff *skb,
+@@ -375,14 +574,19 @@ fec_enet_start_xmit(struct sk_buff *skb,
if (bdp == fep->dirty_tx) {
fep->tx_full = 1;
@@ -14695,21 +15158,19 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
- fep->cur_tx = (cbd_t *)bdp;
+ fep->cur_tx = bdp;
+ fec_enet_cbd_put(fep);
-+#if 0
-+ if (dbg_lvl(3)) {
-+ dump_tx_buffers(fep);
-+ dump_rx_buffers(fep);
-+ }
-+#endif
++
+ /* Trigger transmission start */
+ fec_reg_write(fep, FEC_TDAR, DONT_CARE);
- spin_unlock_irqrestore(&fep->hw_lock, flags);
+ spin_unlock_irqrestore(&fep->lock, flags);
- return 0;
+- return 0;
++ return NETDEV_TX_OK;
}
-@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev)
+
+ static void
+@@ -390,101 +594,125 @@ fec_timeout(struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -14886,12 +15347,11 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
- spin_lock_irq(&fep->hw_lock);
+ spin_lock(&fep->lock);
+
-+ //WARN_ON(fec_reg_read(fep, FEC_TDAR) & TDAR_BUSY);
+ fec_enet_cbd_get(fep);
bdp = fep->dirty_tx;
while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
-@@ -495,22 +770,22 @@ fec_enet_tx(struct net_device *dev)
+@@ -495,22 +723,22 @@ fec_enet_tx(struct net_device *dev)
if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
BD_ENET_TX_RL | BD_ENET_TX_UN |
BD_ENET_TX_CSL)) {
@@ -14922,15 +15382,13 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (status & BD_ENET_TX_READY)
printk("HEY! Enet xmit interrupt and TX_READY.\n");
#endif
-@@ -518,12 +793,13 @@ fec_enet_tx(struct net_device *dev)
+@@ -518,12 +746,11 @@ fec_enet_tx(struct net_device *dev)
* but we eventually sent the packet OK.
*/
if (status & BD_ENET_TX_DEF)
- dev->stats.collisions++;
+ fep->stats.collisions++;
-+ dump_packet("sent packet:", fep->tx_skbuff[fep->skb_dirty]->data,
-+ fep->tx_skbuff[fep->skb_dirty]->len);
/* Free the sk buffer associated with this last transmit.
*/
- dev_kfree_skb_any(skb);
@@ -14939,7 +15397,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
fep->skb_dirty = (fep->skb_dirty + 1) & TX_RING_MOD_MASK;
/* Update pointer to next buffer descriptor to be transmitted.
-@@ -538,12 +814,15 @@ fec_enet_tx(struct net_device *dev)
+@@ -538,12 +765,15 @@ fec_enet_tx(struct net_device *dev)
*/
if (fep->tx_full) {
fep->tx_full = 0;
@@ -14958,7 +15416,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
-@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev)
+@@ -555,22 +785,22 @@ fec_enet_tx(struct net_device *dev)
static void
fec_enet_rx(struct net_device *dev)
{
@@ -14992,7 +15450,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* First, grab all of the stats for the incoming packet.
* These get messed up if we get called due to a busy condition.
-@@ -578,32 +857,34 @@ fec_enet_rx(struct net_device *dev)
+@@ -578,32 +808,34 @@ fec_enet_rx(struct net_device *dev)
bdp = fep->cur_rx;
while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
@@ -15038,7 +15496,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
/* Report late collisions as a frame error.
-@@ -611,39 +892,91 @@ while (!((status = bdp->cbd_sc) & BD_ENE
+@@ -611,39 +843,67 @@ while (!((status = bdp->cbd_sc) & BD_ENE
* have in the buffer. So, just drop this frame on the floor.
*/
if (status & BD_ENET_RX_CL) {
@@ -15047,33 +15505,14 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ fep->stats.rx_errors++;
+ fep->stats.rx_frame_errors++;
+ DBG(0, "%s: Collision detected; dropping packet\n", __FUNCTION__);
-+ if (bdp->cbd_datlen > PKT_MAXBUF_SIZE) {
-+ printk(KERN_ERR "invalid packet size %u; max %u\n", bdp->cbd_datlen,
-+ PKT_MAXBUF_SIZE);
-+ } else {
-+ fec_enet_rxbuf_get(fep, bdp, bdp->cbd_datlen);
-+ dump_packet("received packet:",
-+ fep->rx_skbuff[rx_index]->data, bdp->cbd_datlen);
-+ fec_enet_rxbuf_put(fep, bdp, bdp->cbd_datlen);
-+ }
- goto rx_processing_done;
- }
--
-+#if 1
-+ if (!fep->opened) {
-+ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__);
-+ if (bdp->cbd_datlen > PKT_MAXBUF_SIZE) {
-+ printk(KERN_ERR "invalid packet size %u; max %u\n", bdp->cbd_datlen,
-+ PKT_MAXBUF_SIZE);
-+ } else {
-+ fec_enet_rxbuf_get(fep, bdp, bdp->cbd_datlen);
-+ dump_packet("received packet:",
-+ fep->rx_skbuff[rx_index]->data, bdp->cbd_datlen);
-+ fec_enet_rxbuf_put(fep, bdp, bdp->cbd_datlen);
-+ }
+ goto rx_processing_done;
+ }
-+#endif
++
++ if (!fep->opened) {
++ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__);
+ goto rx_processing_done;
+ }
+
/* Process the incoming frame.
*/
- dev->stats.rx_packets++;
@@ -15136,16 +15575,10 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
rx_processing_done:
-
-+#if 0
-+ if (dbg_lvl(3)) {
-+ dump_rx_buffers(fep);
-+ dump_tx_buffers(fep);
-+ }
-+#endif
/* Clear the status flags for this buffer.
*/
status &= ~BD_ENET_RX_STATS;
-@@ -653,6 +986,9 @@ while (!((status = bdp->cbd_sc) & BD_ENE
+@@ -653,6 +913,9 @@ while (!((status = bdp->cbd_sc) & BD_ENE
status |= BD_ENET_RX_EMPTY;
bdp->cbd_sc = status;
@@ -15155,7 +15588,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* Update BD pointer to next entry.
*/
if (status & BD_ENET_RX_WRAP)
-@@ -665,10 +1001,10 @@ while (!((status = bdp->cbd_sc) & BD_ENE
+@@ -665,10 +928,10 @@ while (!((status = bdp->cbd_sc) & BD_ENE
* incoming frames. On a heavily loaded network, we should be
* able to keep up at the expense of system resources.
*/
@@ -15168,7 +15601,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
#if 0
/* Doing this here will allow us to process all frames in the
-@@ -678,27 +1014,28 @@ while (!((status = bdp->cbd_sc) & BD_ENE
+@@ -678,27 +941,28 @@ while (!((status = bdp->cbd_sc) & BD_ENE
* our way back to the interrupt return only to come right back
* here.
*/
@@ -15207,7 +15640,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if ((mip = mii_head) == NULL) {
printk("MII and no head!\n");
-@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev)
+@@ -713,27 +977,27 @@ fec_enet_mii(struct net_device *dev)
mii_free = mip;
if ((mip = mii_head) != NULL)
@@ -15242,7 +15675,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if ((mip = mii_free) != NULL) {
mii_free = mip->mii_next;
-@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re
+@@ -745,32 +1009,32 @@ mii_queue(struct net_device *dev, int re
mii_tail = mip;
} else {
mii_head = mii_tail = mip;
@@ -15284,7 +15717,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (mii_reg & 0x0004)
status |= PHY_STAT_LINK;
-@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s
+@@ -778,31 +1042,30 @@ static void mii_parse_sr(uint mii_reg, s
status |= PHY_STAT_FAULT;
if (mii_reg & 0x0020)
status |= PHY_STAT_ANC;
@@ -15321,7 +15754,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (mii_reg & 0x0020)
status |= PHY_CONF_10HDX;
-@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg,
+@@ -812,7 +1075,7 @@ static void mii_parse_anar(uint mii_reg,
status |= PHY_CONF_100HDX;
if (mii_reg & 0x00100)
status |= PHY_CONF_100FDX;
@@ -15330,7 +15763,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
/* ------------------------------------------------------------------------- */
-@@ -827,10 +1163,9 @@ static void mii_parse_anar(uint mii_reg,
+@@ -827,10 +1090,9 @@ static void mii_parse_anar(uint mii_reg,
static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -15342,7 +15775,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (mii_reg & 0x0800) {
if (mii_reg & 0x1000)
status |= PHY_STAT_100FDX;
-@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi
+@@ -842,7 +1104,7 @@ static void mii_parse_lxt970_csr(uint mi
else
status |= PHY_STAT_10HDX;
}
@@ -15351,7 +15784,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static phy_cmd_t const phy_cmd_lxt970_config[] = {
-@@ -898,16 +1233,15 @@ static phy_info_t const phy_info_lxt970
+@@ -898,16 +1160,15 @@ static phy_info_t const phy_info_lxt970
static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -15371,7 +15804,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
if (mii_reg & 0x0080)
status |= PHY_STAT_ANC;
-@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi
+@@ -925,7 +1186,7 @@ static void mii_parse_lxt971_sr2(uint mi
if (mii_reg & 0x0008)
status |= PHY_STAT_FAULT;
@@ -15380,7 +15813,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static phy_cmd_t const phy_cmd_lxt971_config[] = {
-@@ -982,10 +1316,9 @@ static phy_info_t const phy_info_lxt971
+@@ -982,10 +1243,9 @@ static phy_info_t const phy_info_lxt971
static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -15392,7 +15825,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
switch((mii_reg >> 2) & 7) {
case 1: status |= PHY_STAT_10HDX; break;
-@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi
+@@ -994,7 +1254,7 @@ static void mii_parse_qs6612_pcr(uint mi
case 6: status |= PHY_STAT_100FDX; break;
}
@@ -15401,7 +15834,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static phy_cmd_t const phy_cmd_qs6612_config[] = {
-@@ -1052,10 +1385,9 @@ static phy_info_t const phy_info_qs6612
+@@ -1052,10 +1312,9 @@ static phy_info_t const phy_info_qs6612
static void mii_parse_am79c874_dr(uint mii_reg, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -15413,7 +15846,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (mii_reg & 0x0080)
status |= PHY_STAT_ANC;
-@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m
+@@ -1064,7 +1323,7 @@ static void mii_parse_am79c874_dr(uint m
else
status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX);
@@ -15422,7 +15855,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static phy_cmd_t const phy_cmd_am79c874_config[] = {
-@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87
+@@ -1107,7 +1366,7 @@ static phy_info_t const phy_info_am79c87
/* register definitions for the 8721 */
#define MII_KS8721BL_RXERCR 21
@@ -15431,7 +15864,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
#define MII_KS8721BL_PHYCR 31
static phy_cmd_t const phy_cmd_ks8721bl_config[] = {
-@@ -1149,32 +1481,31 @@ static phy_info_t const phy_info_ks8721b
+@@ -1149,32 +1408,31 @@ static phy_info_t const phy_info_ks8721b
static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -15474,7 +15907,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static phy_info_t phy_info_dp83848= {
-@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info
+@@ -1211,122 +1469,391 @@ static phy_info_t const * const phy_info
&phy_info_dp83848,
NULL
};
@@ -15491,37 +15924,22 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+MOVED to platform_data hooks!
*/
-static void __inline__ fec_request_mii_intr(struct net_device *dev)
--{
-- if (request_irq(66, mii_link_interrupt, IRQF_DISABLED, "fec(MII)", dev) != 0)
-- printk("FEC: Could not allocate fec(MII) IRQ(66)!\n");
--}
-
--static void __inline__ fec_disable_phy_intr(void)
--{
-- volatile unsigned long *icrp;
-- icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
-- *icrp = 0x08000000;
--}
++
+#define PHY_POLL_LINK_ON (1 * HZ)
+#define PHY_POLL_LINK_OFF (HZ / 5)
-
--static void __inline__ fec_phy_ack_intr(void)
++
+static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum);
+
+#ifdef CONFIG_PHYLIB
+static void fec_link_change(struct net_device *dev)
{
-- volatile unsigned long *icrp;
-- /* Acknowledge the interrupt */
-- icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
-- *icrp = 0x0d000000;
+- if (request_irq(66, mii_link_interrupt, IRQF_DISABLED, "fec(MII)", dev) != 0)
+- printk("FEC: Could not allocate fec(MII) IRQ(66)!\n");
-}
--#endif
+ struct fec_enet_private *fep = netdev_priv(dev);
+ struct phy_device *phydev = fep->phy;
--#ifdef CONFIG_M5272
--static void __inline__ fec_get_mac(struct net_device *dev)
+-static void __inline__ fec_disable_phy_intr(void)
+ if (phydev->link != fep->linkstatus ||
+ phydev->duplex != fep->full_duplex) {
+ DBG(0, "%s: link status changed from %d to %d %s -> %s duplex\n", __FUNCTION__,
@@ -15548,28 +15966,16 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+#else
+static void fec_link_change(struct net_device *dev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
-- volatile fec_t *fecp;
-- unsigned char *iap, tmpaddr[ETH_ALEN];
-
-- fecp = fep->hwp;
+- volatile unsigned long *icrp;
+- icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
+- *icrp = 0x08000000;
++ struct fec_enet_private *fep = netdev_priv(dev);
++
+ DBG(0, "%s: link status changed from %d to %d\n", __FUNCTION__,
+ fep->old_linkstatus, fep->linkstatus);
+ if (fep->linkstatus) {
+ int duplex;
-
-- if (FEC_FLASHMAC) {
-- /*
-- * Get MAC address from FLASH.
-- * If it is all 1's or 0's, use the default.
-- */
-- iap = (unsigned char *)FEC_FLASHMAC;
-- if ((iap[0] == 0) && (iap[1] == 0) && (iap[2] == 0) &&
-- (iap[3] == 0) && (iap[4] == 0) && (iap[5] == 0))
-- iap = fec_mac_default;
-- if ((iap[0] == 0xff) && (iap[1] == 0xff) && (iap[2] == 0xff) &&
-- (iap[3] == 0xff) && (iap[4] == 0xff) && (iap[5] == 0xff))
-- iap = fec_mac_default;
++
+ duplex = 0;
+ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) {
+ duplex = 1;
@@ -15578,55 +15984,51 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ if (fep->phy_timer) {
+ mod_timer(fep->phy_timer, jiffies + PHY_POLL_LINK_ON);
+ }
- } else {
-- *((unsigned long *) &tmpaddr[0]) = fecp->fec_addr_low;
-- *((unsigned short *) &tmpaddr[4]) = (fecp->fec_addr_high >> 16);
-- iap = &tmpaddr[0];
++ } else {
+ fec_stop(dev);
+ if (fep->phy_timer) {
+ mod_timer(fep->phy_timer, jiffies + PHY_POLL_LINK_OFF);
+ }
- }
-
-- memcpy(dev->dev_addr, iap, ETH_ALEN);
--
-- /* Adjust MAC if using default MAC address */
-- if (iap == fec_mac_default)
-- dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] + fep->index;
++ }
++
+ fep->old_linkstatus = fep->linkstatus;
}
--#endif
--/* ------------------------------------------------------------------------- */
--
--static void mii_display_status(struct net_device *dev)
+-static void __inline__ fec_phy_ack_intr(void)
+static void fec_phy_timer(unsigned long data)
{
+- volatile unsigned long *icrp;
+- /* Acknowledge the interrupt */
+- icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
+- *icrp = 0x0d000000;
+ struct net_device *dev = (struct net_device *)data;
- struct fec_enet_private *fep = netdev_priv(dev);
-- volatile uint *s = &(fep->phy_status);
++ struct fec_enet_private *fep = netdev_priv(dev);
+ int link_poll_interval = fep->linkstatus ? PHY_POLL_LINK_ON : PHY_POLL_LINK_OFF;
-
-- if (!fep->link && !fep->old_link) {
-- /* Link is still down - don't print anything */
++
+ if (fep->old_linkstatus != fep->linkstatus) {
+ fec_link_change(dev);
+ }
+ mod_timer(fep->phy_timer, link_poll_interval);
-+}
-+#endif
-+
+ }
+ #endif
+
+-#ifdef CONFIG_M5272
+-static void __inline__ fec_get_mac(struct net_device *dev)
+/*
+ * Code specific to Freescale i.MXC
+ */
+static int fec_request_intrs(struct platform_device *pdev, struct net_device *dev)
-+{
+ {
+ int ret;
-+ struct fec_enet_private *fep = netdev_priv(dev);
-+
+ struct fec_enet_private *fep = netdev_priv(dev);
+- volatile fec_t *fecp;
+- unsigned char *iap, tmpaddr[ETH_ALEN];
+
+- fecp = fep->hwp;
+ fep->etn_irq = platform_get_irq(pdev, 0);
+ fep->mii_irq = platform_get_irq(pdev, 1);
-+
+
+- if (FEC_FLASHMAC) {
+ /* Setup interrupt handlers. */
+ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev);
+ if (ret != 0) {
@@ -15643,13 +16045,25 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ free_irq(fep->etn_irq, dev);
+ return ret;
+ }
-+ /*
+ /*
+- * Get MAC address from FLASH.
+- * If it is all 1's or 0's, use the default.
+ * board specific workaround should be done in board specific code
+ * This is unsafe anyway. An interrupt might have been asserted
+ * already. Use IRQ_NOAUTOEN with request_irq() to have irq initially disabled.
-+ */
+ */
+- iap = (unsigned char *)FEC_FLASHMAC;
+- if ((iap[0] == 0) && (iap[1] == 0) && (iap[2] == 0) &&
+- (iap[3] == 0) && (iap[4] == 0) && (iap[5] == 0))
+- iap = fec_mac_default;
+- if ((iap[0] == 0xff) && (iap[1] == 0xff) && (iap[2] == 0xff) &&
+- (iap[3] == 0xff) && (iap[4] == 0xff) && (iap[5] == 0xff))
+- iap = fec_mac_default;
+ fep->phy_int_enabled = 1;
-+ } else {
+ } else {
+- *((unsigned long *) &tmpaddr[0]) = fecp->fec_addr_low;
+- *((unsigned short *) &tmpaddr[4]) = (fecp->fec_addr_high >> 16);
+- iap = &tmpaddr[0];
+ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL);
+ if (fep->phy_timer == NULL) {
+ free_irq(fep->etn_irq, dev);
@@ -15659,49 +16073,87 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ fep->phy_timer->function = fec_phy_timer;
+ fep->phy_timer->data = (unsigned long)dev;
+ fec_link_change(dev);
-+ }
-+#endif
-+
+ }
+-
+- memcpy(dev->dev_addr, iap, ETH_ALEN);
+-
+- /* Adjust MAC if using default MAC address */
+- if (iap == fec_mac_default)
+- dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] + fep->index;
+-}
+ #endif
+
+-/* ------------------------------------------------------------------------- */
+ return 0;
+}
-+
+
+-static void mii_display_status(struct net_device *dev)
+static void fec_release_intrs(struct net_device *dev)
-+{
-+ struct fec_enet_private *fep = netdev_priv(dev);
-+
+ {
+ struct fec_enet_private *fep = netdev_priv(dev);
+- volatile uint *s = &(fep->phy_status);
+
+- if (!fep->link && !fep->old_link) {
+- /* Link is still down - don't print anything */
+- return;
+ free_irq(fep->etn_irq, dev);
+#ifndef CONFIG_PHYLIB
+ if (fep->mii_irq >= 0) {
+ free_irq(fep->mii_irq, dev);
-+ }
+ }
+#endif
+}
-+
+
+- printk("%s: status: ", dev->name);
+-
+- if (!fep->link) {
+- printk("link down");
+- } else {
+- printk("link up");
+-
+- switch(*s & PHY_STAT_SPMASK) {
+- case PHY_STAT_100FDX: printk(", 100MBit Full Duplex"); break;
+- case PHY_STAT_100HDX: printk(", 100MBit Half Duplex"); break;
+- case PHY_STAT_10FDX: printk(", 10MBit Full Duplex"); break;
+- case PHY_STAT_10HDX: printk(", 10MBit Half Duplex"); break;
+- default:
+- printk(", Unknown speed/duplex");
+- }
+#ifdef CONFIG_MACH_MX25
+/*
+ * i.MX25 allows RMII mode to be configured via a gasket
+ */
+#define FEC_MIIGSK_CFGR 0x300
+#define FEC_MIIGSK_ENR 0x308
-+
+
+- if (*s & PHY_STAT_ANC)
+- printk(", auto-negotiation complete");
+- }
+#define FEC_MIIGSK_CFGR_FRCONT (1 << 6)
+#define FEC_MIIGSK_CFGR_LBMODE (1 << 4)
+#define FEC_MIIGSK_CFGR_EMODE (1 << 3)
+#define FEC_MIIGSK_CFGR_IF_MODE_MASK (3 << 0)
+#define FEC_MIIGSK_CFGR_IF_MODE_MII (0 << 0)
+#define FEC_MIIGSK_CFGR_IF_MODE_RMII (1 << 0)
-+
+
+- if (*s & PHY_STAT_FAULT)
+- printk(", remote fault");
+#define FEC_MIIGSK_ENR_READY (1 << 2)
+#define FEC_MIIGSK_ENR_EN (1 << 1)
-+
+
+- printk(".\n");
+#ifndef DEBUG
+static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg)
+{
+ return readw(fep->reg_base + reg);
-+}
-+
+ }
+
+-static void mii_display_config(struct work_struct *work)
+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val)
-+{
+ {
+- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task);
+- struct net_device *dev = fep->netdev;
+- uint status = fep->phy_status;
+ writew(val, fep->reg_base + reg);
+}
+#else
@@ -15879,48 +16331,42 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+
+ if (!fep->linkstatus && !fep->old_linkstatus) {
+ /* Link is still down - don't print anything */
- return;
- }
-
- printk("%s: status: ", dev->name);
-
-- if (!fep->link) {
++ return;
++ }
++
++ printk("%s: status: ", dev->name);
++
+ if (!fep->linkstatus) {
- printk("link down");
- } else {
- printk("link up");
-
-- switch(*s & PHY_STAT_SPMASK) {
++ printk("link down");
++ } else {
++ printk("link up");
++
+ switch(fep->phy_status & PHY_STAT_SPMASK) {
- case PHY_STAT_100FDX: printk(", 100MBit Full Duplex"); break;
- case PHY_STAT_100HDX: printk(", 100MBit Half Duplex"); break;
- case PHY_STAT_10FDX: printk(", 10MBit Full Duplex"); break;
-@@ -1305,20 +1906,19 @@ static void mii_display_status(struct ne
- printk(", Unknown speed/duplex");
- }
-
-- if (*s & PHY_STAT_ANC)
++ case PHY_STAT_100FDX: printk(", 100MBit Full Duplex"); break;
++ case PHY_STAT_100HDX: printk(", 100MBit Half Duplex"); break;
++ case PHY_STAT_10FDX: printk(", 10MBit Full Duplex"); break;
++ case PHY_STAT_10HDX: printk(", 10MBit Half Duplex"); break;
++ default:
++ printk(", Unknown speed/duplex");
++ }
++
+ if (fep->phy_status & PHY_STAT_ANC)
- printk(", auto-negotiation complete");
- }
-
-- if (*s & PHY_STAT_FAULT)
++ printk(", auto-negotiation complete");
++ }
++
+ if (fep->phy_status & PHY_STAT_FAULT)
- printk(", remote fault");
-
- printk(".\n");
- }
-
--static void mii_display_config(struct work_struct *work)
++ printk(", remote fault");
++
++ printk(".\n");
++}
++
+static void mii_display_config(struct work_struct *w)
- {
-- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task);
-- struct net_device *dev = fep->netdev;
++{
+ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task);
- uint status = fep->phy_status;
++ uint status = fep->phy_status;
/*
-@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo
+ ** When we get here, phy_task is already removed from
** the workqueue. It is thus safe to allow to reuse it.
*/
fep->mii_phy_task_queued = 0;
@@ -15929,7 +16375,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (status & PHY_CONF_ANE)
printk("on");
-@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo
+@@ -1351,11 +1878,21 @@ static void mii_display_config(struct wo
fep->sequence_done = 1;
}
@@ -15954,7 +16400,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
int duplex;
/*
-@@ -1363,23 +1973,19 @@ static void mii_relink(struct work_struc
+@@ -1363,23 +1900,19 @@ static void mii_relink(struct work_struc
** the workqueue. It is thus safe to allow to reuse it.
*/
fep->mii_phy_task_queued = 0;
@@ -15985,7 +16431,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
/* mii_queue_relink is called in interrupt context from mii_link_interrupt */
-@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = {
+@@ -1429,15 +1962,14 @@ phy_cmd_t const phy_cmd_config[] = {
static void
mii_discover_phy3(uint mii_reg, struct net_device *dev)
{
@@ -16004,7 +16450,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
break;
}
-@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n
+@@ -1456,13 +1988,9 @@ mii_discover_phy3(uint mii_reg, struct n
static void
mii_discover_phy(uint mii_reg, struct net_device *dev)
{
@@ -16019,7 +16465,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (fep->phy_addr < 32) {
if ((phytype = (mii_reg & 0xffff)) != 0xffff && phytype != 0) {
-@@ -1470,39 +2071,40 @@ mii_discover_phy(uint mii_reg, struct ne
+@@ -1470,39 +1998,40 @@ mii_discover_phy(uint mii_reg, struct ne
*/
fep->phy_id = phytype << 16;
mii_queue(dev, mk_mii_read(MII_REG_PHYIR2),
@@ -16077,7 +16523,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
return IRQ_HANDLED;
}
-@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i
+@@ -1511,16 +2040,31 @@ mii_link_interrupt(int irq, void * dev_i
static int
fec_enet_open(struct net_device *dev)
{
@@ -16112,7 +16558,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
if (fep->phy) {
mii_do_cmd(dev, fep->phy->ack_int);
mii_do_cmd(dev, fep->phy->config);
-@@ -1542,16 +2159,20 @@ fec_enet_open(struct net_device *dev)
+@@ -1542,16 +2086,20 @@ fec_enet_open(struct net_device *dev)
* based on this device does not implement a PHY interrupt,
* so we are never notified of link change.
*/
@@ -16138,7 +16584,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
static int
-@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev)
+@@ -1559,15 +2107,46 @@ fec_enet_close(struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
@@ -16189,7 +16635,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* Set or clear the multicast filter for this adaptor.
* Skeleton taken from sunlance driver.
* The CPM Ethernet implementation allows Multicast as well as individual
-@@ -1583,37 +2235,32 @@ fec_enet_close(struct net_device *dev)
+@@ -1583,37 +2162,32 @@ fec_enet_close(struct net_device *dev)
static void set_multicast_list(struct net_device *dev)
{
@@ -16236,7 +16682,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* Only support group multicast for now.
*/
if (!(dmi->dmi_addr[0] & 1))
-@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne
+@@ -1621,13 +2195,11 @@ static void set_multicast_list(struct ne
/* calculate crc32 value of mac address
*/
@@ -16253,7 +16699,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
crc = (crc >> 1) ^
(((crc ^ data) & 1) ? CRC32_POLY : 0);
}
-@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne
+@@ -1639,9 +2211,13 @@ static void set_multicast_list(struct ne
hash = (crc >> (32 - HASH_BITS)) & 0x3f;
if (hash > 31)
@@ -16269,7 +16715,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
}
}
-@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne
+@@ -1650,106 +2226,272 @@ static void set_multicast_list(struct ne
/* Set a MAC change in hardware.
*/
static void
@@ -16291,7 +16737,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ fec_reg_write(fep, FEC_PAUR, (dev->dev_addr[5] << 16) |
+ (dev->dev_addr[4] << 24));
+}
-+
+
+static int
+fec_set_mac_address(struct net_device *dev, void *_addr)
+{
@@ -16308,7 +16754,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ addr->sa_data[4], addr->sa_data[5]);
+
+ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN);
-
++
+ _fec_set_mac_address(dev);
+
+ return 0;
@@ -16538,8 +16984,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ /*
+ * XXX: We need to clean up on failure exits here.
+ */
-
-- /* Set receive and transmit descriptor base.
++
+int __devinit fec_enet_init(struct platform_device *pdev, struct net_device *dev)
+{
+ int ret;
@@ -16548,7 +16993,8 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ struct sk_buff *pskb;
+ int i;
+ void *mem;
-+
+
+- /* Set receive and transmit descriptor base.
+ spin_lock_init(&fep->lock);
+
+ /* Whack a reset. We should wait for this.
@@ -16610,7 +17056,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
/* Set the last buffer to wrap.
-@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi
+@@ -1757,87 +2499,88 @@ int __init fec_enet_init(struct net_devi
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;
@@ -16757,7 +17203,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
}
/* This function is called to start or restart the FEC during a link
-@@ -1847,60 +2663,67 @@ int __init fec_enet_init(struct net_devi
+@@ -1847,60 +2590,67 @@ int __init fec_enet_init(struct net_devi
static void
fec_restart(struct net_device *dev, int duplex)
{
@@ -16853,7 +17299,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
/* Initialize the BD for every fragment in the page.
*/
bdp->cbd_sc = BD_ENET_RX_EMPTY;
-@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int
+@@ -1908,246 +2658,365 @@ fec_restart(struct net_device *dev, int
}
/* Set the last buffer to wrap.
@@ -17184,8 +17630,6 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ struct fec_enet_private *fep = netdev_priv(dev);
+
+ unregister_netdev(dev);
-+ free_netdev(dev);
-+
+#ifdef CONFIG_PHYLIB
+ if (fep->mii != NULL) {
+ kfree(fep->mii->irq);
@@ -17217,6 +17661,7 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+ if (fep->res_mem2 != NULL) {
+ release_resource(fep->res_mem2);
+ }
++ free_netdev(dev);
return 0;
}
@@ -17372,9 +17817,9 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.c linux-2.6.30-rc4-karo/drivers/net/
+module_exit(fec_enet_module_cleanup);
MODULE_LICENSE("GPL");
-diff -urNp linux-2.6.30-rc4/drivers/net/fec.h linux-2.6.30-rc4-karo/drivers/net/fec.h
---- linux-2.6.30-rc4/drivers/net/fec.h 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/net/fec.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/drivers/net/fec.h linux-2.6.30-rc4-karo3/drivers/net/fec.h
+--- linux-2.6.30-rc4-git/drivers/net/fec.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/net/fec.h 2009-06-02 18:43:03.000000000 +0200
@@ -13,6 +13,15 @@
#define FEC_H
/****************************************************************************/
@@ -17505,9 +17950,414 @@ diff -urNp linux-2.6.30-rc4/drivers/net/fec.h linux-2.6.30-rc4-karo/drivers/net/
+
/****************************************************************************/
#endif /* FEC_H */
-diff -urNp linux-2.6.30-rc4/drivers/video/imxfb.c linux-2.6.30-rc4-karo/drivers/video/imxfb.c
---- linux-2.6.30-rc4/drivers/video/imxfb.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/drivers/video/imxfb.c 2009-06-02 17:05:26.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/drivers/usb/Kconfig linux-2.6.30-rc4-karo3/drivers/usb/Kconfig
+--- linux-2.6.30-rc4-git/drivers/usb/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/usb/Kconfig 2009-06-29 10:49:52.000000000 +0200
+@@ -57,6 +57,7 @@ config USB_ARCH_HAS_EHCI
+ default y if PPC_83xx
+ default y if SOC_AU1200
+ default y if ARCH_IXP4XX
++ default y if ARCH_MXC
+ default PCI
+
+ # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
+diff -purN linux-2.6.30-rc4-git/drivers/usb/host/Kconfig linux-2.6.30-rc4-karo3/drivers/usb/host/Kconfig
+--- linux-2.6.30-rc4-git/drivers/usb/host/Kconfig 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/usb/host/Kconfig 2009-07-06 15:37:48.000000000 +0200
+@@ -106,6 +106,37 @@ config USB_OXU210HP_HCD
+ To compile this driver as a module, choose M here: the
+ module will be called oxu210hp-hcd.
+
++config USB_EHCI_MXC
++ bool "Support for Freescale on-chip EHCI USB controller"
++ depends on USB_EHCI_HCD && ARCH_MXC
++ select USB_EHCI_ROOT_HUB_TT
++ ---help---
++ Variation of ARC USB block used in some Freescale chips.
++
++config ARCH_MXC_EHCI_USBH1
++ bool "Enable USB on USBH1 port"
++ depends on USB_EHCI_MXC && ARCH_MXC_HAS_USBH1
++
++config ARCH_MXC_EHCI_USBH2
++ bool "Enable USB on USBH2 port"
++ depends on USB_EHCI_MXC && ARCH_MXC_HAS_USBH2
++
++config ARCH_MXC_EHCI_USBOTG
++ bool "Enable USB on USBOTG port"
++ depends on USB_EHCI_MXC && ARCH_MXC_HAS_USBOTG
++
++config ARCH_MXC_HAS_USBH1
++ bool
++ depends on USB_EHCI_MXC
++
++config ARCH_MXC_HAS_USBH2
++ bool
++ depends on USB_EHCI_MXC
++
++config ARCH_MXC_HAS_USBOTG
++ bool
++ depends on USB_EHCI_MXC
++
+ config USB_ISP116X_HCD
+ tristate "ISP116X HCD support"
+ depends on USB
+diff -purN linux-2.6.30-rc4-git/drivers/usb/host/ehci-hcd.c linux-2.6.30-rc4-karo3/drivers/usb/host/ehci-hcd.c
+--- linux-2.6.30-rc4-git/drivers/usb/host/ehci-hcd.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/usb/host/ehci-hcd.c 2009-07-01 11:30:25.000000000 +0200
+@@ -1047,6 +1047,11 @@ MODULE_LICENSE ("GPL");
+ #define PLATFORM_DRIVER ehci_fsl_driver
+ #endif
+
++#ifdef CONFIG_USB_EHCI_MXC
++#include "ehci-mxc.c"
++#define PLATFORM_DRIVER ehci_mxc_driver
++#endif
++
+ #ifdef CONFIG_SOC_AU1200
+ #include "ehci-au1xxx.c"
+ #define PLATFORM_DRIVER ehci_hcd_au1xxx_driver
+diff -purN linux-2.6.30-rc4-git/drivers/usb/host/ehci-mxc.c linux-2.6.30-rc4-karo3/drivers/usb/host/ehci-mxc.c
+--- linux-2.6.30-rc4-git/drivers/usb/host/ehci-mxc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/drivers/usb/host/ehci-mxc.c 2009-07-01 11:31:58.000000000 +0200
+@@ -0,0 +1,247 @@
++/*
++ * Copyright (c) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
++ *
++ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++#include <linux/platform_device.h>
++#include <linux/clk.h>
++#include <mach/mxc_ehci.h>
++
++/* called during probe() after chip reset completes */
++static int ehci_mxc_setup(struct usb_hcd *hcd)
++{
++ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
++ int retval;
++
++ /* EHCI registers start at offset 0x100 */
++ ehci->caps = hcd->regs + 0x100;
++ ehci->regs = hcd->regs + 0x100 +
++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
++ dbg_hcs_params(ehci, "reset");
++ dbg_hcc_params(ehci, "reset");
++
++ /* cache this readonly data; minimize chip reads */
++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++
++ retval = ehci_halt(ehci);
++ if (retval)
++ return retval;
++
++ /* data structure init */
++ retval = ehci_init(hcd);
++ if (retval)
++ return retval;
++
++ hcd->has_tt = 1;
++
++ ehci->sbrn = 0x20;
++
++ ehci_reset(ehci);
++
++ ehci_port_power(ehci, 0);
++ return 0;
++}
++
++static const struct hc_driver ehci_mxc_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Freescale On-Chip EHCI Host Controller",
++ .hcd_priv_size = sizeof(struct ehci_hcd),
++
++ /*
++ * generic hardware linkage
++ */
++ .irq = ehci_irq,
++ .flags = HCD_USB2 | HCD_MEMORY,
++
++ /*
++ * basic lifecycle operations
++ */
++ .reset = ehci_mxc_setup,
++ .start = ehci_run,
++ .stop = ehci_stop,
++ .shutdown = ehci_shutdown,
++
++ /*
++ * managing i/o requests and associated device resources
++ */
++ .urb_enqueue = ehci_urb_enqueue,
++ .urb_dequeue = ehci_urb_dequeue,
++ .endpoint_disable = ehci_endpoint_disable,
++
++ /*
++ * scheduling support
++ */
++ .get_frame_number = ehci_get_frame,
++
++ /*
++ * root hub support
++ */
++ .hub_status_data = ehci_hub_status_data,
++ .hub_control = ehci_hub_control,
++ .bus_suspend = ehci_bus_suspend,
++ .bus_resume = ehci_bus_resume,
++ .relinquish_port = ehci_relinquish_port,
++ .port_handed_over = ehci_port_handed_over,
++};
++
++static int ehci_mxc_drv_probe(struct platform_device *pdev)
++{
++ struct mxc_usbh_platform_data *pdata = pdev->dev.platform_data;
++ struct usb_hcd *hcd;
++ struct resource *res;
++ int irq, ret, temp;
++ struct clk *usbclk, *ahbclk;
++
++ dev_info(&pdev->dev, "initializing i.MX USB Controller\n");
++
++ /* Need platform data for setup */
++ if (!pdata) {
++ dev_err(&pdev->dev,
++ "No platform data for %s.\n", dev_name(&pdev->dev));
++ return -ENODEV;
++ }
++
++ irq = platform_get_irq(pdev, 0);
++
++ hcd = usb_create_hcd(&ehci_mxc_hc_driver, &pdev->dev, dev_name(&pdev->dev));
++ if (!hcd) {
++ ret = -ENOMEM;
++ goto err1;
++ }
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev,
++ "Found HC with no register addr. Check %s setup!\n",
++ dev_name(&pdev->dev));
++ ret = -ENODEV;
++ goto err1;
++ }
++
++ hcd->rsrc_start = res->start;
++ hcd->rsrc_len = resource_size(res);
++
++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
++ dev_dbg(&pdev->dev, "controller already in use\n");
++ ret = -EBUSY;
++ goto err1;
++ }
++
++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
++ if (!hcd->regs) {
++ dev_err(&pdev->dev, "error mapping memory\n");
++ ret = -EFAULT;
++ goto err2;
++ }
++
++#if 0
++ ahbclk = clk_get(NULL, "usb_ahb_clk");
++ if (IS_ERR(ahbclk)) {
++ ret = PTR_ERR(ahbclk);
++ printk(KERN_ERR "Failed to get usb_ahb_clk: %d\n", ret);
++ goto err3;
++ }
++ clk_enable(ahbclk);
++#endif
++ usbclk = clk_get(&pdev->dev, "usb");
++ if (IS_ERR(usbclk)) {
++ ret = PTR_ERR(usbclk);
++ printk(KERN_ERR "Failed to get usb_clk: %d\n", ret);
++ goto err4;
++ }
++ clk_enable(usbclk);
++
++ if (pdata->init) {
++ ret = pdata->init(pdev);
++ if (ret) {
++ dev_err(&pdev->dev, "platform init failed\n");
++ goto err5;
++ }
++ }
++
++ /* Set to Host mode */
++ temp = readl(hcd->regs + 0x1a8);
++ writel(temp | 0x3, hcd->regs + 0x1a8);
++
++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
++ if (ret)
++ goto err6;
++
++ platform_set_drvdata(pdev, hcd);
++ clk_put(usbclk);
++
++ return 0;
++err6:
++ if (pdata->exit)
++ pdata->exit(pdev);
++err5:
++ clk_disable(usbclk);
++ clk_put(usbclk);
++err4:
++#if 0
++ clk_disable(ahbclk);
++ clk_put(ahbclk);
++#endif
++err3:
++ iounmap(hcd->regs);
++err2:
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++err1:
++ usb_put_hcd(hcd);
++ return ret;
++}
++
++static int ehci_mxc_drv_remove(struct platform_device *pdev)
++{
++ struct usb_hcd *hcd = platform_get_drvdata(pdev);
++ struct mxc_usbh_platform_data *pdata = pdev->dev.platform_data;
++ struct clk *usbclk;
++
++ usb_remove_hcd(hcd);
++ iounmap(hcd->regs);
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ usb_put_hcd(hcd);
++ platform_set_drvdata(pdev, NULL);
++
++ if (pdata->exit)
++ pdata->exit(pdev);
++
++ usbclk = clk_get(&pdev->dev, "usb");
++ if (!IS_ERR(usbclk)) {
++ clk_disable(usbclk);
++ clk_put(usbclk);
++ }
++#if 0
++ ahbclk = clk_get(NULL, "usb_ahb_clk");
++ if (!IS_ERR(ahbclk)) {
++ clk_disable(ahbclk);
++ clk_put(ahbclk);
++ }
++#endif
++ return 0;
++}
++
++MODULE_ALIAS("platform:mxc-ehci");
++
++static struct platform_driver ehci_mxc_driver = {
++ .probe = ehci_mxc_drv_probe,
++ .remove = ehci_mxc_drv_remove,
++ .shutdown = usb_hcd_platform_shutdown,
++ .driver = {
++ .name = "mxc-ehci",
++ },
++};
+diff -purN linux-2.6.30-rc4-git/drivers/video/imxfb.c linux-2.6.30-rc4-karo3/drivers/video/imxfb.c
+--- linux-2.6.30-rc4-git/drivers/video/imxfb.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/drivers/video/imxfb.c 2009-07-02 16:21:35.000000000 +0200
+@@ -56,9 +56,9 @@
+ #define VPW_VPW(x) ((x) & 0x3ff)
+
+ #define LCDC_CPOS 0x0C
+-#define CPOS_CC1 (1<<31)
+-#define CPOS_CC0 (1<<30)
+-#define CPOS_OP (1<<28)
++#define CPOS_CC1 (1 << 31)
++#define CPOS_CC0 (1 << 30)
++#define CPOS_OP (1 << 28)
+ #define CPOS_CXP(x) (((x) & 3ff) << 16)
+
+ #ifdef CONFIG_ARCH_MX1
+@@ -68,7 +68,7 @@
+ #endif
+
+ #define LCDC_LCWHB 0x10
+-#define LCWHB_BK_EN (1<<31)
++#define LCWHB_BK_EN (1 << 31)
+ #define LCWHB_CW(w) (((w) & 0x1f) << 24)
+ #define LCWHB_CH(h) (((h) & 0x1f) << 16)
+ #define LCWHB_BD(x) ((x) & 0xff)
+@@ -112,22 +112,22 @@
+ #define LCDC_RMCR 0x34
+
+ #ifdef CONFIG_ARCH_MX1
+-#define RMCR_LCDC_EN (1<<1)
++#define RMCR_LCDC_EN (1 << 1)
+ #else
+ #define RMCR_LCDC_EN 0
+ #endif
+
+-#define RMCR_SELF_REF (1<<0)
++#define RMCR_SELF_REF (1 << 0)
+
+ #define LCDC_LCDICR 0x38
+-#define LCDICR_INT_SYN (1<<2)
+-#define LCDICR_INT_CON (1)
++#define LCDICR_INT_SYN (1 << 2)
++#define LCDICR_INT_CON 1
+
+ #define LCDC_LCDISR 0x40
+-#define LCDISR_UDR_ERR (1<<3)
+-#define LCDISR_ERR_RES (1<<2)
+-#define LCDISR_EOF (1<<1)
+-#define LCDISR_BOF (1<<0)
++#define LCDISR_UDR_ERR (1 << 3)
++#define LCDISR_ERR_RES (1 << 2)
++#define LCDISR_EOF (1 << 1)
++#define LCDISR_BOF (1 << 0)
+
+ /*
+ * These are the bitfields for each
+@@ -232,11 +232,11 @@ static int imxfb_setpalettereg(u_int reg
+ struct imxfb_info *fbi = info->par;
+ u_int val, ret = 1;
+
+-#define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16)
++#define CNVT_TOHW(val,width) ((((val) << (width)) + 0x7FFF - (val)) >> 16)
+ if (regno < fbi->palette_size) {
+- val = (CNVT_TOHW(red, 4) << 8) |
+- (CNVT_TOHW(green,4) << 4) |
+- CNVT_TOHW(blue, 4);
++ val = (CNVT_TOHW(red, 6) << 12) |
++ (CNVT_TOHW(green, 6) << 6) |
++ CNVT_TOHW(blue, 6);
+
+ writel(val, fbi->regs + 0x800 + (regno << 2));
+ ret = 0;
+@@ -265,7 +265,7 @@ static int imxfb_setcolreg(u_int regno,
+
+ /*
+ * If greyscale is true, then we convert the RGB value
+- * to greyscale no mater what visual we are using.
++ * to greyscale no matter what visual we are using.
+ */
+ if (info->var.grayscale)
+ red = green = blue = (19595 * red + 38470 * green +
+@@ -527,7 +527,7 @@ static int imxfb_activate_var(struct fb_
+ if (--pcr > 0x3F) {
+ pcr = 0x3F;
+ printk(KERN_WARNING "Must limit pixel clock to %uHz\n",
+- lcd_clk / pcr);
++ lcd_clk / pcr + 1);
+ }
+
+ /* add sync polarities */
@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_
#define imxfb_resume NULL
#endif
@@ -17572,9 +18422,55 @@ diff -urNp linux-2.6.30-rc4/drivers/video/imxfb.c linux-2.6.30-rc4-karo/drivers/
.shutdown = imxfb_shutdown,
.driver = {
.name = DRIVER_NAME,
-diff -urNp linux-2.6.30-rc4/include/linux/fec_enet.h linux-2.6.30-rc4-karo/include/linux/fec_enet.h
---- linux-2.6.30-rc4/include/linux/fec_enet.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.30-rc4-karo/include/linux/fec_enet.h 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/fs/jffs2/erase.c linux-2.6.30-rc4-karo3/fs/jffs2/erase.c
+--- linux-2.6.30-rc4-git/fs/jffs2/erase.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/fs/jffs2/erase.c 2009-07-14 14:12:12.000000000 +0200
+@@ -422,6 +422,7 @@ static void jffs2_mark_erased_block(stru
+ /* Cleanmarker in oob area or no cleanmarker at all ? */
+ if (jffs2_cleanmarker_oob(c) || c->cleanmarker_size == 0) {
+
++ /* We only write cleanmarker in case of SLC NAND */
+ if (jffs2_cleanmarker_oob(c)) {
+ if (jffs2_write_nand_cleanmarker(c, jeb))
+ goto filebad;
+diff -purN linux-2.6.30-rc4-git/fs/jffs2/fs.c linux-2.6.30-rc4-karo3/fs/jffs2/fs.c
+--- linux-2.6.30-rc4-git/fs/jffs2/fs.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/fs/jffs2/fs.c 2009-07-14 14:12:28.000000000 +0200
+@@ -680,7 +680,9 @@ void jffs2_gc_release_page(struct jffs2_
+ static int jffs2_flash_setup(struct jffs2_sb_info *c) {
+ int ret = 0;
+
+- if (jffs2_cleanmarker_oob(c)) {
++ if (c->mtd->type == MTD_NANDFLASH) {
++ if (!(c->mtd->flags & MTD_OOB_WRITEABLE))
++ printk(KERN_DEBUG "JFFS2 doesn't use OOB.\n");
+ /* NAND flash... do setup accordingly */
+ ret = jffs2_nand_flash_setup(c);
+ if (ret)
+@@ -713,7 +715,7 @@ static int jffs2_flash_setup(struct jffs
+
+ void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
+
+- if (jffs2_cleanmarker_oob(c)) {
++ if (c->mtd->type == MTD_NANDFLASH) {
+ jffs2_nand_flash_cleanup(c);
+ }
+
+diff -purN linux-2.6.30-rc4-git/fs/jffs2/os-linux.h linux-2.6.30-rc4-karo3/fs/jffs2/os-linux.h
+--- linux-2.6.30-rc4-git/fs/jffs2/os-linux.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/fs/jffs2/os-linux.h 2009-07-14 14:12:32.000000000 +0200
+@@ -110,7 +110,7 @@ static inline void jffs2_init_inode_info
+ #define jffs2_can_mark_obsolete(c) (c->mtd->flags & (MTD_BIT_WRITEABLE))
+ #endif
+
+-#define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH)
++#define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH && (c->mtd->flags & MTD_OOB_WRITEABLE))
+
+ #define jffs2_flash_write_oob(c, ofs, len, retlen, buf) ((c)->mtd->write_oob((c)->mtd, ofs, len, retlen, buf))
+ #define jffs2_flash_read_oob(c, ofs, len, retlen, buf) ((c)->mtd->read_oob((c)->mtd, ofs, len, retlen, buf))
+diff -purN linux-2.6.30-rc4-git/include/linux/fec_enet.h linux-2.6.30-rc4-karo3/include/linux/fec_enet.h
+--- linux-2.6.30-rc4-git/include/linux/fec_enet.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/include/linux/fec_enet.h 2009-03-16 12:49:03.000000000 +0100
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2007 Lothar Wassmann <LW@KARO-electronics.de>
@@ -17602,9 +18498,103 @@ diff -urNp linux-2.6.30-rc4/include/linux/fec_enet.h linux-2.6.30-rc4-karo/inclu
+ int (*suspend)(struct platform_device *dev);
+ int (*resume)(struct platform_device *dev);
+};
-diff -urNp linux-2.6.30-rc4/kernel/printk.c linux-2.6.30-rc4-karo/kernel/printk.c
---- linux-2.6.30-rc4/kernel/printk.c 2009-05-13 09:46:19.000000000 +0200
-+++ linux-2.6.30-rc4-karo/kernel/printk.c 2009-06-02 17:05:27.000000000 +0200
+diff -purN linux-2.6.30-rc4-git/include/linux/usb/xcvr.h linux-2.6.30-rc4-karo3/include/linux/usb/xcvr.h
+--- linux-2.6.30-rc4-git/include/linux/usb/xcvr.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.30-rc4-karo3/include/linux/usb/xcvr.h 2009-07-01 11:32:10.000000000 +0200
+@@ -0,0 +1,71 @@
++#ifndef __LINUX_USB_XCVR_H
++#define __LINUX_USB_XCVR_H
++
++struct usb_xcvr;
++
++struct usb_xcvr_access_ops {
++ int (*read)(struct usb_xcvr *xcvr, u32 reg);
++ int (*write)(struct usb_xcvr *xcvr, u32 val, u32 reg);
++};
++
++struct usb_xcvr_driver {
++ int (*init)(struct usb_xcvr *xcvr);
++ void (*shutdown)(struct usb_xcvr *xcvr);
++ int (*set_vbus)(struct usb_xcvr *xcvr, bool en);
++};
++
++struct usb_xcvr {
++ struct usb_xcvr_access_ops *access;
++ struct usb_xcvr_driver *driver;
++ void __iomem *access_priv;
++
++ /* only set this if you don't want the lowlevel driver to
++ * handle this */
++ int (*set_vbus)(struct usb_xcvr *xcvr, bool en);
++};
++
++static inline int usb_xcvr_init(struct usb_xcvr *xcvr)
++{
++ if (xcvr->driver && xcvr->driver->init)
++ return xcvr->driver->init(xcvr);
++
++ return -EINVAL;
++}
++
++static inline void usb_xcvr_shutdown(struct usb_xcvr *xcvr)
++{
++ if (xcvr->driver && xcvr->driver->shutdown)
++ xcvr->driver->shutdown(xcvr);
++}
++
++static inline int usb_xcvr_set_vbus(struct usb_xcvr *xcvr, bool en)
++{
++ if (xcvr->set_vbus)
++ return xcvr->set_vbus(xcvr, en);
++
++ if (xcvr->driver && xcvr->driver->set_vbus)
++ return xcvr->driver->set_vbus(xcvr, en);
++
++ return -EINVAL;
++}
++
++/* lowlowel access helpers */
++
++static inline int usb_xcvr_read(struct usb_xcvr *xcvr, u32 reg)
++{
++ if (xcvr->access->read)
++ return xcvr->access->read(xcvr, reg);
++
++ return -EINVAL;
++}
++
++static inline int usb_xcvr_write(struct usb_xcvr *xcvr, u32 val, u32 reg)
++{
++ if (xcvr->access->write)
++ return xcvr->access->write(xcvr, val, reg);
++
++ return -EINVAL;
++}
++
++#endif /* __LINUX_USB_XCVR_H */
++
+diff -purN linux-2.6.30-rc4-git/include/mtd/mtd-abi.h linux-2.6.30-rc4-karo3/include/mtd/mtd-abi.h
+--- linux-2.6.30-rc4-git/include/mtd/mtd-abi.h 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/include/mtd/mtd-abi.h 2009-07-14 14:12:38.000000000 +0200
+@@ -30,12 +30,14 @@ struct mtd_oob_buf {
+ #define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
+ #define MTD_NO_ERASE 0x1000 /* No erase necessary */
+ #define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
++#define MTD_OOB_WRITEABLE 0x4000 /* Use Out-Of-Band area */
+
+ // Some common devices / combinations of capabilities
+ #define MTD_CAP_ROM 0
+ #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
+ #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
+-#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
++#define MTD_CAP_NANDFLASH (MTD_WRITEABLE | MTD_OOB_WRITEABLE)
++#define MTD_CAP_MLC_NANDFLASH (MTD_WRITEABLE)
+
+ /* ECC byte placement */
+ #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
+diff -purN linux-2.6.30-rc4-git/kernel/printk.c linux-2.6.30-rc4-karo3/kernel/printk.c
+--- linux-2.6.30-rc4-git/kernel/printk.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/kernel/printk.c 2009-06-02 19:21:25.000000000 +0200
@@ -637,9 +637,12 @@ static int acquire_console_semaphore_for
static const char recursion_bug_msg [] =
KERN_CRIT "BUG: recent printk recursion!\n";
@@ -17629,3 +18619,45 @@ diff -urNp linux-2.6.30-rc4/kernel/printk.c linux-2.6.30-rc4-karo/kernel/printk.
/*
* Copy the output into log_buf. If the caller didn't provide
* appropriate log level tags, we insert them here
+diff -purN linux-2.6.30-rc4-git/net/can/bcm.c linux-2.6.30-rc4-karo3/net/can/bcm.c
+--- linux-2.6.30-rc4-git/net/can/bcm.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/net/can/bcm.c 2009-07-14 14:13:01.000000000 +0200
+@@ -75,6 +75,7 @@ static __initdata const char banner[] =
+ MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
+ MODULE_LICENSE("Dual BSD/GPL");
+ MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
++MODULE_ALIAS("can-proto-2");
+
+ /* easy access to can_frame payload */
+ static inline u64 GET_U64(const struct can_frame *cp)
+@@ -1469,6 +1470,9 @@ static int bcm_release(struct socket *so
+ bo->ifindex = 0;
+ }
+
++ sock_orphan(sk);
++ sock->sk = NULL;
++
+ release_sock(sk);
+ sock_put(sk);
+
+diff -purN linux-2.6.30-rc4-git/net/can/raw.c linux-2.6.30-rc4-karo3/net/can/raw.c
+--- linux-2.6.30-rc4-git/net/can/raw.c 2009-05-13 09:46:19.000000000 +0200
++++ linux-2.6.30-rc4-karo3/net/can/raw.c 2009-07-14 14:13:07.000000000 +0200
+@@ -62,6 +62,7 @@ static __initdata const char banner[] =
+ MODULE_DESCRIPTION("PF_CAN raw protocol");
+ MODULE_LICENSE("Dual BSD/GPL");
+ MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
++MODULE_ALIAS("can-proto-1");
+
+ #define MASK_ALL 0
+
+@@ -306,6 +307,9 @@ static int raw_release(struct socket *so
+ ro->bound = 0;
+ ro->count = 0;
+
++ sock_orphan(sk);
++ sock->sk = NULL;
++
+ release_sock(sk);
+ sock_put(sk);
+
diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/stk5-baseboard_c_vesa640.patch b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/stk5-baseboard_c_vesa640.patch
new file mode 100644
index 0000000000..c3eb357dda
--- /dev/null
+++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/stk5-baseboard_c_vesa640.patch
@@ -0,0 +1,40 @@
+--- a/arch/arm/mach-mx2/stk5-baseboard.c.orig 2009-07-17 00:57:10.000000000 +0200
++++ b/arch/arm/mach-mx2/stk5-baseboard.c 2009-07-16 13:02:20.000000000 +0200
+@@ -613,6 +613,37 @@
+
+ static struct imx_fb_platform_data stk5_fb_data[] __initdata = {
+ {
++ /* VESA 640x480@60 */
++ .init = stk5_gpio_lcdc_active,
++ .exit = stk5_gpio_lcdc_inactive,
++ .lcd_power = NULL,
++ .backlight_power = NULL,
++
++ .pixclock = 39721,
++
++ .xres = 640,
++ .yres = 480,
++
++ .bpp = 16,
++
++ .hsync_len = 64,
++ .right_margin = 24,
++ .left_margin = 40,
++
++ .vsync_len = 2,
++ .lower_margin = 11,
++ .upper_margin = 32,
++
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 |
++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL,
++ .dmacr = 0x80040060,
++
++ .cmap_greyscale = 0,
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++
++ .fixed_screen_cpu = NULL,
++ }, {
+ #if 1
+ //.fb_mode = "Xenarc_700_Y-18",
+ .init = stk5_gpio_lcdc_active,
diff --git a/recipes/linux/linux-2.6.29/stamp9g20evb/defconfig b/recipes/linux/linux-2.6.29/stamp9g20evb/defconfig
new file mode 100644
index 0000000000..f8203a3b94
--- /dev/null
+++ b/recipes/linux/linux-2.6.29/stamp9g20evb/defconfig
@@ -0,0 +1,1277 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29
+# Thu Jun 11 09:47:54 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+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_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EMBEDDED is not set
+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_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+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"
+CONFIG_FREEZER=y
+
+#
+# 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=y
+# CONFIG_ARCH_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX 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
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# Atmel AT91 System-on-Chip
+#
+# CONFIG_ARCH_AT91RM9200 is not set
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+CONFIG_ARCH_AT91SAM9G20=y
+# CONFIG_ARCH_AT91CAP9 is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+
+#
+# AT91SAM9G20 Board Type
+#
+# CONFIG_MACH_AT91SAM9G20EK is not set
+CONFIG_MACH_STAMP9G20=y
+CONFIG_MACH_STAMP9G20_EVB=y
+
+#
+# AT91 Board Options
+#
+
+#
+# AT91 Feature Selections
+#
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+CONFIG_AT91_SLOW_CLOCK=y
+CONFIG_AT91_TIMER_HZ=100
+CONFIG_AT91_EARLY_DBGU=y
+# CONFIG_AT91_EARLY_USART0 is not set
+# CONFIG_AT91_EARLY_USART1 is not set
+# CONFIG_AT91_EARLY_USART2 is not set
+# CONFIG_AT91_EARLY_USART3 is not set
+# CONFIG_AT91_EARLY_USART4 is not set
+# CONFIG_AT91_EARLY_USART5 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# 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 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 is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+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_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_NET_DSA 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS 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_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_ATMEL=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR 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_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ATMEL_TCLIB is not set
+# CONFIG_ATMEL_SSC is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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=y
+# 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_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# 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_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+CONFIG_MACB=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP 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 is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# 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_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+CONFIG_SERIAL_ATMEL_PDC=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_W1=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2490 is not set
+# CONFIG_W1_MASTER_DS1WM is not set
+CONFIG_W1_MASTER_GPIO=y
+
+#
+# 1-wire Slaves
+#
+# CONFIG_W1_SLAVE_THERM is not set
+# CONFIG_W1_SLAVE_SMEM is not set
+CONFIG_W1_SLAVE_DS2431=y
+# CONFIG_W1_SLAVE_DS2433 is not set
+# CONFIG_W1_SLAVE_DS2760 is not set
+# CONFIG_W1_SLAVE_BQ27000 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT 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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES 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_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_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_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_AT91=y
+CONFIG_USB_AT91=y
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_GPIO_VBUS is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+# CONFIG_MMC_BLOCK_BOUNCE is not set
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_AT91=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_GPIO=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
+CONFIG_RTC_DRV_AT91SAM9_RTT=0
+CONFIG_RTC_DRV_AT91SAM9_GPBR=0
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# 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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 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
+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=y
+# 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=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+# 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=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF 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/recipes/linux/linux-2.6.29/stamp9g20evb/stamp9g20.patch b/recipes/linux/linux-2.6.29/stamp9g20evb/stamp9g20.patch
new file mode 100644
index 0000000000..3d44c695f6
--- /dev/null
+++ b/recipes/linux/linux-2.6.29/stamp9g20evb/stamp9g20.patch
@@ -0,0 +1,1594 @@
+diff --git a/arch/arm/configs/stamp9g20evb_defconfig b/arch/arm/configs/stamp9g20evb_defconfig
+new file mode 100644
+index 0000000..f8203a3
+--- /dev/null
++++ b/arch/arm/configs/stamp9g20evb_defconfig
+@@ -0,0 +1,1277 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.29
++# Thu Jun 11 09:47:54 2009
++#
++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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
++# CONFIG_LOCALVERSION_AUTO is not set
++# CONFIG_SWAP is not set
++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_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=14
++# CONFIG_GROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++CONFIG_NAMESPACES=y
++# CONFIG_UTS_NS is not set
++# CONFIG_IPC_NS is not set
++# CONFIG_USER_NS is not set
++# CONFIG_PID_NS is not set
++# CONFIG_NET_NS is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++# CONFIG_EMBEDDED is not set
++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_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_SLOB is not set
++# CONFIG_PROFILING is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_CLK=y
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++# CONFIG_MODULE_FORCE_UNLOAD is not set
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++CONFIG_IOSCHED_AS=y
++# CONFIG_IOSCHED_DEADLINE is not set
++# CONFIG_IOSCHED_CFQ is not set
++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"
++CONFIG_FREEZER=y
++
++#
++# 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=y
++# CONFIG_ARCH_CLPS711X 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX 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
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# Atmel AT91 System-on-Chip
++#
++# CONFIG_ARCH_AT91RM9200 is not set
++# CONFIG_ARCH_AT91SAM9260 is not set
++# CONFIG_ARCH_AT91SAM9261 is not set
++# CONFIG_ARCH_AT91SAM9263 is not set
++# CONFIG_ARCH_AT91SAM9RL is not set
++CONFIG_ARCH_AT91SAM9G20=y
++# CONFIG_ARCH_AT91CAP9 is not set
++# CONFIG_ARCH_AT91X40 is not set
++CONFIG_AT91_PMC_UNIT=y
++
++#
++# AT91SAM9G20 Board Type
++#
++# CONFIG_MACH_AT91SAM9G20EK is not set
++CONFIG_MACH_STAMP9G20=y
++CONFIG_MACH_STAMP9G20_EVB=y
++
++#
++# AT91 Board Options
++#
++
++#
++# AT91 Feature Selections
++#
++CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
++CONFIG_AT91_SLOW_CLOCK=y
++CONFIG_AT91_TIMER_HZ=100
++CONFIG_AT91_EARLY_DBGU=y
++# CONFIG_AT91_EARLY_USART0 is not set
++# CONFIG_AT91_EARLY_USART1 is not set
++# CONFIG_AT91_EARLY_USART2 is not set
++# CONFIG_AT91_EARLY_USART3 is not set
++# CONFIG_AT91_EARLY_USART4 is not set
++# CONFIG_AT91_EARLY_USART5 is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_ARM926T=y
++CONFIG_CPU_32v5=y
++CONFIG_CPU_ABRT_EV5TJ=y
++CONFIG_CPU_PABRT_NOIFAR=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_COPY_V4WB=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
++# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
++# CONFIG_OUTER_CACHE is not set
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++CONFIG_PREEMPT=y
++CONFIG_HZ=100
++CONFIG_AEABI=y
++# CONFIG_OABI_COMPAT is not set
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4096
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++# CONFIG_LEDS is not set
++CONFIG_ALIGNMENT_TRAP=y
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_IDLE is not set
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++# CONFIG_VFP is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++CONFIG_PM_SLEEP=y
++CONFIG_SUSPEND=y
++CONFIG_SUSPEND_FREEZER=y
++# CONFIG_APM_EMULATION is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_COMPAT_NET_DEV_OPS=y
++CONFIG_PACKET=y
++# CONFIG_PACKET_MMAP is not set
++CONFIG_UNIX=y
++# 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 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 is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_INET_LRO is not set
++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_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_NET_DSA 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
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++# CONFIG_AF_RXRPC is not set
++# CONFIG_PHONET is not set
++# CONFIG_WIRELESS is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++CONFIG_FW_LOADER=y
++CONFIG_FIRMWARE_IN_KERNEL=y
++CONFIG_EXTRA_FIRMWARE=""
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++# CONFIG_MTD_DEBUG is not set
++CONFIG_MTD_CONCAT=y
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_TESTS is not set
++# CONFIG_MTD_REDBOOT_PARTS is not set
++CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS 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
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS 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_GPIO is not set
++CONFIG_MTD_NAND_IDS=y
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++CONFIG_MTD_NAND_ATMEL=y
++# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
++CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
++# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ALAUDA is not set
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++CONFIG_MISC_DEVICES=y
++# CONFIG_ATMEL_TCLIB is not set
++# CONFIG_ATMEL_SSC is not set
++# CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_C2PORT is not set
++
++#
++# EEPROM support
++#
++# CONFIG_EEPROM_93CX6 is not set
++CONFIG_HAVE_IDE=y
++# 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=y
++# 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_SRP_ATTRS is not set
++# CONFIG_SCSI_LOWLEVEL is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++# 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_VETH is not set
++CONFIG_PHYLIB=y
++
++#
++# MII PHY device drivers
++#
++# CONFIG_MARVELL_PHY is not set
++# CONFIG_DAVICOM_PHY is not set
++# CONFIG_QSEMI_PHY is not set
++# CONFIG_LXT_PHY is not set
++# CONFIG_CICADA_PHY is not set
++# CONFIG_VITESSE_PHY is not set
++# CONFIG_SMSC_PHY is not set
++# CONFIG_BROADCOM_PHY is not set
++# CONFIG_ICPLUS_PHY is not set
++# CONFIG_REALTEK_PHY is not set
++# CONFIG_NATIONAL_PHY is not set
++# CONFIG_STE10XP is not set
++# CONFIG_LSI_ET1011C_PHY is not set
++# CONFIG_FIXED_PHY is not set
++# CONFIG_MDIO_BITBANG is not set
++CONFIG_NET_ETHERNET=y
++# CONFIG_MII is not set
++CONFIG_MACB=y
++# CONFIG_AX88796 is not set
++# CONFIG_SMC91X is not set
++# CONFIG_DM9000 is not set
++# CONFIG_SMC911X is not set
++# CONFIG_SMSC911X is not set
++# CONFIG_DNET is not set
++# CONFIG_IBM_NEW_EMAC_ZMII is not set
++# CONFIG_IBM_NEW_EMAC_RGMII is not set
++# CONFIG_IBM_NEW_EMAC_TAH is not set
++# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
++# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
++# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
++# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
++# CONFIG_B44 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
++# CONFIG_IWLWIFI_LEDS is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++
++#
++# 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 is not set
++# CONFIG_WAN is not set
++# CONFIG_PPP is not set
++# CONFIG_SLIP 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 is not set
++CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
++CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
++# CONFIG_INPUT_JOYDEV is not set
++# CONFIG_INPUT_EVDEV is not set
++# 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_TABLET is not set
++# CONFIG_INPUT_TOUCHSCREEN is not set
++# 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_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++# CONFIG_DEVKMEM is not set
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++# CONFIG_SERIAL_8250 is not set
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_ATMEL=y
++CONFIG_SERIAL_ATMEL_CONSOLE=y
++CONFIG_SERIAL_ATMEL_PDC=y
++# CONFIG_SERIAL_ATMEL_TTYAT is not set
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++# CONFIG_HW_RANDOM is not set
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++# CONFIG_I2C is not set
++# CONFIG_SPI is not set
++CONFIG_W1=y
++
++#
++# 1-wire Bus Masters
++#
++# CONFIG_W1_MASTER_DS2490 is not set
++# CONFIG_W1_MASTER_DS1WM is not set
++CONFIG_W1_MASTER_GPIO=y
++
++#
++# 1-wire Slaves
++#
++# CONFIG_W1_SLAVE_THERM is not set
++# CONFIG_W1_SLAVE_SMEM is not set
++CONFIG_W1_SLAVE_DS2431=y
++# CONFIG_W1_SLAVE_DS2433 is not set
++# CONFIG_W1_SLAVE_DS2760 is not set
++# CONFIG_W1_SLAVE_BQ27000 is not set
++# CONFIG_POWER_SUPPLY is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++# CONFIG_WATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++# CONFIG_VIDEO_DEV is not set
++# CONFIG_DVB_CORE is not set
++# CONFIG_VIDEO_MEDIA is not set
++
++#
++# Multimedia drivers
++#
++# CONFIG_DAB is not set
++
++#
++# Graphics support
++#
++# CONFIG_VGASTATE is not set
++# CONFIG_VIDEO_OUTPUT_CONTROL is not set
++# CONFIG_FB is not set
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT is not set
++
++#
++# Console display driver support
++#
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_DUMMY_CONSOLE=y
++# CONFIG_SOUND is not set
++# CONFIG_HID_SUPPORT 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
++# CONFIG_USB_ANNOUNCE_NEW_DEVICES 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_SUSPEND is not set
++# CONFIG_USB_OTG is not set
++# CONFIG_USB_MON is not set
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++# CONFIG_USB_OXU210HP_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_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++# CONFIG_USB_MUSB_HDRC is not set
++# CONFIG_USB_GADGET_MUSB_HDRC is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++# CONFIG_USB_MICROTEK is not set
++
++#
++# USB port drivers
++#
++# 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_SEVSEG 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
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_VST is not set
++CONFIG_USB_GADGET=y
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
++CONFIG_USB_GADGET_VBUS_DRAW=2
++CONFIG_USB_GADGET_SELECTED=y
++CONFIG_USB_GADGET_AT91=y
++CONFIG_USB_AT91=y
++# CONFIG_USB_GADGET_ATMEL_USBA is not set
++# CONFIG_USB_GADGET_FSL_USB2 is not set
++# CONFIG_USB_GADGET_LH7A40X is not set
++# CONFIG_USB_GADGET_OMAP is not set
++# CONFIG_USB_GADGET_PXA25X is not set
++# CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C2410 is not set
++# CONFIG_USB_GADGET_IMX is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_AMD5536UDC is not set
++# CONFIG_USB_GADGET_FSL_QE is not set
++# CONFIG_USB_GADGET_CI13XXX is not set
++# CONFIG_USB_GADGET_NET2280 is not set
++# CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++# CONFIG_USB_GADGET_DUALSPEED is not set
++CONFIG_USB_ZERO=m
++CONFIG_USB_ETH=m
++CONFIG_USB_ETH_RNDIS=y
++CONFIG_USB_GADGETFS=m
++CONFIG_USB_FILE_STORAGE=m
++# CONFIG_USB_FILE_STORAGE_TEST is not set
++CONFIG_USB_G_SERIAL=m
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++
++#
++# OTG and related infrastructure
++#
++# CONFIG_USB_GPIO_VBUS is not set
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++# CONFIG_MMC_UNSAFE_RESUME is not set
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++# CONFIG_MMC_BLOCK_BOUNCE is not set
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++CONFIG_MMC_AT91=y
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++CONFIG_LEDS_GPIO=y
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGERS=y
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
++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
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# SPI RTC drivers
++#
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++
++#
++# on-CPU RTC drivers
++#
++CONFIG_RTC_DRV_AT91SAM9=y
++CONFIG_RTC_DRV_AT91SAM9_RTT=0
++CONFIG_RTC_DRV_AT91SAM9_GPBR=0
++# CONFIG_DMADEVICES is not set
++# CONFIG_REGULATOR is not set
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# 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 is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++CONFIG_FILE_LOCKING=y
++# CONFIG_XFS_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++CONFIG_DNOTIFY=y
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++# CONFIG_QUOTA is not set
++# 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_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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_FS_WBUF_VERIFY is not set
++CONFIG_JFFS2_SUMMARY=y
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++# CONFIG_NFS_V4 is not set
++# CONFIG_NFSD is not set
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++# CONFIG_SUNRPC_REGISTER_V4 is not set
++# CONFIG_RPCSEC_GSS_KRB5 is not set
++# CONFIG_RPCSEC_GSS_SPKM3 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
++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=y
++# 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=y
++# CONFIG_NLS_KOI8_R is not set
++# CONFIG_NLS_KOI8_U is not set
++CONFIG_NLS_UTF8=y
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++# CONFIG_ENABLE_WARN_DEPRECATED is not set
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++# 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=y
++CONFIG_DEBUG_MEMORY_INIT=y
++CONFIG_FRAME_POINTER=y
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_LATENCYTOP is not set
++# CONFIG_SYSCTL_SYSCALL_CHECK is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++
++#
++# Tracers
++#
++# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_DEBUG_USER is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++# CONFIG_CRYPTO_MANAGER is not set
++# CONFIG_CRYPTO_MANAGER2 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++# CONFIG_CRYPTO_CBC is not set
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++
++#
++# Digest
++#
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_MD4 is not set
++# CONFIG_CRYPTO_MD5 is not set
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++# CONFIG_CRYPTO_HW is not set
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++# CONFIG_CRC_CCITT is not set
++# CONFIG_CRC16 is not set
++# CONFIG_CRC_T10DIF 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/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
+index 323b47f..ed0017b 100644
+--- a/arch/arm/mach-at91/Kconfig
++++ b/arch/arm/mach-at91/Kconfig
+@@ -276,6 +276,17 @@ config MACH_AT91SAM9G20EK
+ help
+ Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit.
+
++config MACH_STAMP9G20
++ bool "taskit Stamp9G20 CPU module"
++ depends on ARCH_AT91SAM9G20
++ help
++ Select this if you are using taskit's Stamp9G20 CPU module.
++
++config MACH_STAMP9G20_EVB
++ bool "Stamp9G20 EVB"
++ depends on MACH_STAMP9G20
++ help
++ Select this if you are using taskit's Stamp9G20 Evaluation Board.
+ endif
+
+ # ----------------------------------------------------------
+diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
+index c69ff23..36060dc 100644
+--- a/arch/arm/mach-at91/Makefile
++++ b/arch/arm/mach-at91/Makefile
+@@ -54,6 +54,8 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o
+
+ # AT91SAM9G20 board-specific support
+ obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o
++obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o
++obj-$(CONFIG_MACH_STAMP9G20_EVB) += stamp9g20-evb.o
+
+ # AT91CAP9 board-specific support
+ obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o
+diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
+new file mode 100644
+index 0000000..c39b926
+--- /dev/null
++++ b/arch/arm/mach-at91/board-stamp9g20.c
+@@ -0,0 +1,153 @@
++/*
++ * Copyright (C) 2009 taskit GmbH
++ *
++ * 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 <linux/mm.h>
++#include <linux/platform_device.h>
++#include <linux/w1-gpio.h>
++
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++
++#include <mach/board.h>
++#include <mach/gpio.h>
++#include <mach/at91sam9_smc.h>
++
++#include "sam9_smc.h"
++#include "generic.h"
++
++
++static void __init stamp9g20_map_io(void)
++{
++ /* Initialize processor: 18.432 MHz crystal */
++ at91sam9260_initialize(18432000);
++
++ /* DGBU on ttyS0. (Rx & Tx only) */
++ at91_register_uart(0, 0, 0);
++
++ /* set serial console to ttyS0 (ie, DBGU) */
++ at91_set_serial_console(0);
++}
++
++static void __init stamp9g20_init_irq(void)
++{
++ at91sam9260_init_interrupts(NULL);
++}
++
++
++/*
++ * NAND flash
++ */
++
++/* det_pin is not connected */
++static struct atmel_nand_data __initdata stamp9g20_nand_data = {
++ .ale = 21,
++ .cle = 22,
++ .rdy_pin = AT91_PIN_PC13,
++ .enable_pin = AT91_PIN_PC14,
++ .bus_width_16 = 0,
++};
++
++static struct sam9_smc_config __initdata stamp9g20_nand_smc_config = {
++ .ncs_read_setup = 0,
++ .nrd_setup = 2,
++ .ncs_write_setup = 0,
++ .nwe_setup = 2,
++
++ .ncs_read_pulse = 4,
++ .nrd_pulse = 4,
++ .ncs_write_pulse = 4,
++ .nwe_pulse = 4,
++
++ .read_cycle = 7,
++ .write_cycle = 7,
++
++ .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
++ .tdf_cycles = 3,
++};
++
++static void __init stamp9g20_add_device_nand(void)
++{
++ /* configure chip-select 3 (NAND) */
++ sam9_smc_configure(3, &stamp9g20_nand_smc_config);
++
++ at91_add_device_nand(&stamp9g20_nand_data);
++}
++
++
++/*
++ * MCI (SD/MMC)
++ * det_pin, wp_pin and vcc_pin are not connected
++ */
++static struct at91_mmc_data __initdata stamp9g20_mmc_data = {
++ .slot_b = 0,
++ .wire4 = 1,
++};
++
++
++/*
++ * Dallas 1-Wire
++ */
++static struct w1_gpio_platform_data stamp9g20_w1_gpio_pdata = {
++ .pin = AT91_PIN_PA29,
++ .is_open_drain = 1,
++};
++
++static struct platform_device stamp9g20_w1_device = {
++ .name = "w1-gpio",
++ .id = -1,
++ .dev.platform_data = &stamp9g20_w1_gpio_pdata,
++};
++
++void stamp9g20_add_w1(void)
++{
++ at91_set_GPIO_periph(stamp9g20_w1_gpio_pdata.pin, 1);
++ at91_set_multi_drive(stamp9g20_w1_gpio_pdata.pin, 1);
++ platform_device_register(&stamp9g20_w1_device);
++}
++
++
++void stamp9g20_evb_init(void);
++
++static void __init stamp9g20_board_init(void)
++{
++ /* NAND */
++ stamp9g20_add_device_nand();
++ /* MMC */
++ at91_add_device_mmc(0, &stamp9g20_mmc_data);
++ /* W1 */
++ stamp9g20_add_w1();
++
++#ifdef CONFIG_MACH_STAMP9G20_EVB
++ stamp9g20_evb_init();
++#endif
++
++ /* Serial */
++ at91_add_device_serial();
++}
++
++
++MACHINE_START(STAMP9G20, "tastit Stamp9G20")
++ /* Maintainer: taskit GmbH */
++ .phys_io = AT91_BASE_SYS,
++ .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
++ .boot_params = AT91_SDRAM_BASE + 0x100,
++ .timer = &at91sam926x_timer,
++ .map_io = stamp9g20_map_io,
++ .init_irq = stamp9g20_init_irq,
++ .init_machine = stamp9g20_board_init,
++MACHINE_END
+diff --git a/arch/arm/mach-at91/stamp9g20-evb.c b/arch/arm/mach-at91/stamp9g20-evb.c
+new file mode 100644
+index 0000000..dc1e8ab
+--- /dev/null
++++ b/arch/arm/mach-at91/stamp9g20-evb.c
+@@ -0,0 +1,111 @@
++/*
++ * Copyright (C) 2009 taskit GmbH
++ *
++ * 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 <linux/types.h>
++#include <linux/init.h>
++#include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/at73c213.h>
++#include <linux/clk.h>
++
++#include <mach/hardware.h>
++#include <asm/setup.h>
++#include <asm/mach-types.h>
++#include <asm/irq.h>
++
++#include <asm/mach/arch.h>
++#include <asm/mach/map.h>
++#include <asm/mach/irq.h>
++
++#include <mach/board.h>
++#include <mach/gpio.h>
++#include <mach/at91sam9_smc.h>
++
++#include "sam9_smc.h"
++#include "generic.h"
++
++#include <mach/board.h>
++#include <mach/gpio.h>
++
++/*
++ * USB Host port
++ */
++static struct at91_usbh_data __initdata stamp9g20_usbh_data = {
++ .ports = 2,
++};
++
++
++/*
++ * USB Device port
++ */
++static struct at91_udc_data __initdata stamp9g20_udc_data = {
++ .vbus_pin = AT91_PIN_PA22,
++ .pullup_pin = 0, /* pull-up driven by UDC */
++};
++
++
++/*
++ * MACB Ethernet device
++ */
++static struct at91_eth_data __initdata stamp9g20_macb_data = {
++ .phy_irq_pin = AT91_PIN_PA28,
++ .is_rmii = 1,
++};
++
++
++/*
++ * LEDs
++ */
++static struct gpio_led ek_leds[] = {
++ {
++ .name = "D8:red",
++ .gpio = AT91_PIN_PB18,
++ .active_low = 1,
++ .default_trigger = "none",
++ },{
++ .name = "D9:yellow",
++ .gpio = AT91_PIN_PB19,
++ .active_low = 1,
++ .default_trigger = "none",
++ },{
++ .name = "D10:green",
++ .gpio = AT91_PIN_PB20,
++ .active_low = 1,
++ .default_trigger = "heartbeat",
++ }
++};
++
++void __init stamp9g20_evb_init(void)
++{
++ /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
++ at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
++ | ATMEL_UART_DTR | ATMEL_UART_DSR
++ | ATMEL_UART_DCD | ATMEL_UART_RI);
++ /* USB Host */
++ at91_add_device_usbh(&stamp9g20_usbh_data);
++ /* USB Device */
++ at91_add_device_udc(&stamp9g20_udc_data);
++ /* Ethernet */
++ at91_add_device_eth(&stamp9g20_macb_data);
++ /* LEDs */
++ at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
++ /* I2C */
++ at91_add_device_i2c(NULL, 0);
++}
++
diff --git a/recipes/linux/linux-2.6.29/tqm8540/defconfig b/recipes/linux/linux-2.6.29/tqm8540/defconfig
index 3021ddcfe0..80a805ce77 100644
--- a/recipes/linux/linux-2.6.29/tqm8540/defconfig
+++ b/recipes/linux/linux-2.6.29/tqm8540/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.29-rc2
-# Mon Jan 26 15:36:19 2009
+# Linux kernel version: 2.6.29
+# Sun Jul 5 15:45:43 2009
#
# CONFIG_PPC64 is not set
@@ -75,6 +75,15 @@ CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
CONFIG_GROUP_SCHED=y
@@ -91,6 +100,7 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
CONFIG_SYSCTL_SYSCALL=y
# CONFIG_KALLSYMS is not set
@@ -98,10 +108,8 @@ CONFIG_SYSCTL_SYSCALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
-CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
-CONFIG_ANON_INODES=y
# CONFIG_EPOLL is not set
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
@@ -111,6 +119,7 @@ CONFIG_AIO=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
@@ -125,7 +134,12 @@ CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
@@ -144,11 +158,6 @@ CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
# CONFIG_FREEZER is not set
#
@@ -350,13 +359,31 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_AF_RXRPC is not set
# CONFIG_PHONET is not set
CONFIG_WIRELESS=y
-# CONFIG_CFG80211 is not set
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_WIRELESS_EXT=y
-# CONFIG_LIB80211 is not set
-# CONFIG_MAC80211 is not set
+# CONFIG_WIRELESS_EXT_SYSFS is not set
+CONFIG_LIB80211=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=m
+
+#
+# Rate control algorithm selection
+#
+# CONFIG_MAC80211_RC_PID is not set
+CONFIG_MAC80211_RC_MINSTREL=y
+# CONFIG_MAC80211_RC_DEFAULT_PID is not set
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel"
+CONFIG_MAC80211_MESH=y
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
-# CONFIG_RFKILL is not set
+CONFIG_RFKILL=m
+CONFIG_RFKILL_INPUT=m
+CONFIG_RFKILL_LEDS=y
# CONFIG_NET_9P is not set
#
@@ -374,6 +401,7 @@ CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_OF_PARTS is not set
@@ -448,7 +476,6 @@ CONFIG_MTD_CFI_UTIL=y
# LPDDR flash memory drivers
#
# CONFIG_MTD_LPDDR is not set
-# CONFIG_MTD_QINFO_PROBE is not set
#
# UBI - Unsorted block images
@@ -477,13 +504,19 @@ CONFIG_BLK_DEV_RAM_SIZE=32768
# CONFIG_BLK_DEV_HD is not set
CONFIG_MISC_DEVICES=y
# CONFIG_PHANTOM is not set
-# CONFIG_EEPROM_93CX6 is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
CONFIG_HAVE_IDE=y
CONFIG_IDE=y
@@ -576,10 +609,10 @@ CONFIG_PHYLIB=y
#
# MII PHY device drivers
#
-# CONFIG_MARVELL_PHY is not set
+CONFIG_MARVELL_PHY=y
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
-# CONFIG_LXT_PHY is not set
+CONFIG_LXT_PHY=y
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
@@ -597,6 +630,7 @@ CONFIG_MII=y
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_DNET is not set
# CONFIG_NET_TULIP is not set
# CONFIG_HP100 is not set
# CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -648,6 +682,7 @@ CONFIG_GIANFAR=y
# CONFIG_QLA3XXX is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
# CONFIG_JME is not set
CONFIG_NETDEV_10000=y
# CONFIG_CHELSIO_T1 is not set
@@ -666,6 +701,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
# CONFIG_BNX2X is not set
# CONFIG_QLGE is not set
# CONFIG_SFC is not set
+# CONFIG_BE2NET is not set
# CONFIG_TR is not set
#
@@ -746,7 +782,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
-# CONFIG_SERIAL_OF_PLATFORM is not set
+CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
CONFIG_LEGACY_PTYS=y
@@ -755,8 +791,6 @@ CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_RAW_DRIVER is not set
@@ -811,13 +845,12 @@ CONFIG_I2C_MPC=y
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
#
# Miscellaneous I2C Chip support
#
# CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_PCF8575 is not set
# CONFIG_SENSORS_PCA9539 is not set
@@ -979,12 +1012,95 @@ CONFIG_USB_ARCH_HAS_EHCI=y
# CONFIG_UWB is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
# CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
-# CONFIG_DMADEVICES is not set
+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=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_PPC=y
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_FSL_DMA=m
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+# CONFIG_DMATEST is not set
# CONFIG_UIO is not set
# CONFIG_STAGING is not set
@@ -1174,12 +1290,20 @@ CONFIG_CRYPTO=y
# Crypto core or helper
#
# CONFIG_CRYPTO_FIPS is not set
-# CONFIG_CRYPTO_MANAGER is not set
-# CONFIG_CRYPTO_MANAGER2 is not set
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
+CONFIG_CRYPTO_AEAD2=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=m
+CONFIG_CRYPTO_HASH2=m
+CONFIG_CRYPTO_RNG2=m
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
#
# Authenticated Encryption with Associated Data
@@ -1194,7 +1318,7 @@ CONFIG_CRYPTO=y
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
-# CONFIG_CRYPTO_ECB is not set
+CONFIG_CRYPTO_ECB=m
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set
@@ -1227,7 +1351,7 @@ CONFIG_CRYPTO=y
#
CONFIG_CRYPTO_AES=m
# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_ARC4 is not set
+CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
diff --git a/recipes/linux/linux-2.6.30/at91sam9263ek/defconfig b/recipes/linux/linux-2.6.30/at91sam9263ek/defconfig
new file mode 100644
index 0000000000..a42673b7af
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91sam9263ek/defconfig
@@ -0,0 +1,1855 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.30
+# Tue Jul 14 22:02:26 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
+# 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_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+# CONFIG_STRIP_ASM_SYMS 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_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+# CONFIG_SLOW_WORK is not set
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+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"
+CONFIG_FREEZER=y
+
+#
+# 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=y
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_GEMINI 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX 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
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# Atmel AT91 System-on-Chip
+#
+# CONFIG_ARCH_AT91RM9200 is not set
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+CONFIG_ARCH_AT91SAM9263=y
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91SAM9G20 is not set
+# CONFIG_ARCH_AT91CAP9 is not set
+# CONFIG_ARCH_AT572D940HF is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+# CONFIG_MACH_NEOCORE926 is not set
+
+#
+# AT91SAM9263 Board Type
+#
+CONFIG_MACH_AT91SAM9263EK=y
+# CONFIG_MACH_USB_A9263 is not set
+# CONFIG_MACH_CSB737 is not set
+# CONFIG_MACH_TOTEMNOVA is not set
+
+#
+# AT91 Board Options
+#
+CONFIG_MTD_AT91_DATAFLASH_CARD=y
+# CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16 is not set
+
+#
+# AT91 Feature Selections
+#
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_AT91_SLOW_CLOCK is not set
+CONFIG_AT91_TIMER_HZ=100
+CONFIG_AT91_EARLY_DBGU=y
+# CONFIG_AT91_EARLY_USART0 is not set
+# CONFIG_AT91_EARLY_USART1 is not set
+# CONFIG_AT91_EARLY_USART2 is not set
+# CONFIG_AT91_EARLY_USART3 is not set
+# CONFIG_AT91_EARLY_USART4 is not set
+# CONFIG_AT91_EARLY_USART5 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_LEDS=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfstype=ext2 rootdelay=5"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_APM_EMULATION=m
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+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_XFRM_STATISTICS 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=m
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETLABEL 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_NET_DSA 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
+# CONFIG_PHONET is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# 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_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=y
+# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
+# CONFIG_MTD_DATAFLASH_OTP is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+CONFIG_MTD_BLOCK2MTD=y
+
+#
+# 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_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
+# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+CONFIG_MTD_UBI_GLUEBI=y
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG 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=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+CONFIG_ATA_OVER_ETH=m
+CONFIG_MISC_DEVICES=y
+CONFIG_ATMEL_PWM=y
+CONFIG_ATMEL_TCLIB=y
+CONFIG_ATMEL_TCB_CLKSRC=y
+CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
+# CONFIG_ICS932S401 is not set
+CONFIG_ATMEL_SSC=y
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+CONFIG_EEPROM_AT24=y
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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 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=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+CONFIG_SCSI_SCAN_ASYNC=y
+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_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+CONFIG_COMPAT_NET_DEV_OPS=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+CONFIG_DAVICOM_PHY=y
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_MACB=y
+CONFIG_MACB_TX_SRAM=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_CDC_EEM is not set
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_MCS7830 is not set
+# CONFIG_USB_NET_RNDIS_HOST is not set
+CONFIG_USB_NET_CDC_SUBSET=m
+# CONFIG_USB_ALI_M5632 is not set
+# CONFIG_USB_AN2720 is not set
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_EPSON2888 is not set
+# CONFIG_USB_KC2190 is not set
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_GPIO=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_AD7877 is not set
+# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
+# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_WM97XX is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=m
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+CONFIG_SERIAL_ATMEL_PDC=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+# CONFIG_SERIAL_MAX3100 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_ATMEL=y
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91SAM9X_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_UCB1400_CORE is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# 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_S1D15605 is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_ATMEL=y
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_ATMEL_LCDC=y
+CONFIG_BACKLIGHT_ATMEL_PWM=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_JACK=y
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_HRTIMER is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+CONFIG_SND_VERBOSE_PROCFS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_VMASTER=y
+CONFIG_SND_AC97_CODEC=y
+# CONFIG_SND_DRIVERS is not set
+CONFIG_SND_ARM=y
+CONFIG_SND_AT91_AC97=y
+
+#
+# Atmel devices (AVR32 and AT91)
+#
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
+CONFIG_SND_SOC=y
+CONFIG_SND_ATMEL_SOC=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=y
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+CONFIG_HIDRAW=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+# CONFIG_DRAGONRISE_FF is not set
+CONFIG_HID_EZKEY=y
+CONFIG_HID_KYE=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_KENSINGTON=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_GREENASIA_FF is not set
+CONFIG_HID_TOPSEED=y
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF 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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES 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_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_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
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+# CONFIG_USB_EZUSB is not set
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_CP210X is not set
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+CONFIG_USB_SERIAL_FTDI_SIO=m
+# CONFIG_USB_SERIAL_FUNSOFT is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+# CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_IUU is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
+CONFIG_USB_SERIAL_PL2303=m
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_QUALCOMM is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+# CONFIG_USB_SERIAL_SYMBOL is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OPTION is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_DEBUG 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_SEVSEG 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_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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+CONFIG_USB_GADGET_AT91=y
+CONFIG_USB_AT91=m
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_AT91=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_ATMEL_PWM=y
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_GPIO_PLATFORM=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_BD2802 is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
+CONFIG_RTC_DRV_AT91SAM9_RTT=0
+CONFIG_RTC_DRV_AT91SAM9_GPBR=0
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_REGULATOR is not set
+CONFIG_UIO=m
+CONFIG_UIO_PDRV=m
+CONFIG_UIO_PDRV_GENIRQ=m
+# CONFIG_UIO_SMX is not set
+# CONFIG_UIO_SERCOS3 is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=m
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=m
+# CONFIG_EXT4DEV_COMPAT is not set
+# CONFIG_EXT4_FS_XATTR is not set
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=m
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+CONFIG_CIFS_EXPERIMENTAL=y
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf-8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_CODEPAGE_852=y
+# 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=y
+# 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=y
+# 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=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_PAGE_POISONING is not set
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+CONFIG_TRACING_SUPPORT=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_EVENT_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_KMEMTRACE is not set
+# CONFIG_WORKQUEUE_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_ARM_UNWIND=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_PATH is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
+# CONFIG_SECURITY_TOMOYO is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_ZLIB is not set
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+CONFIG_BINARY_PRINTF=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
diff --git a/recipes/linux/linux-2.6.30/at91sam9263ek/hrw-linux-2.6.30-exp.patch b/recipes/linux/linux-2.6.30/at91sam9263ek/hrw-linux-2.6.30-exp.patch
new file mode 100644
index 0000000000..6634ba72a1
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91sam9263ek/hrw-linux-2.6.30-exp.patch
@@ -0,0 +1,1816 @@
+This is hacked version of linux-2.6.28-exp.patch from Atmel. I removed most of
+things not related to at91sam9263ek so it is not safe to use it on other
+boards (probably not so save also on this one).
+
+This adds sound support, touchscreen pressure and ability to use SRAM for
+Ethernet buffers.
+
+OE-Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+
+---
+ arch/arm/mach-at91/include/mach/at91_pmc.h | 27
+ drivers/input/touchscreen/atmel_tsadcc.c | 16
+ drivers/mmc/host/at91_mci.c | 39 -
+ drivers/net/Kconfig | 6
+ drivers/net/macb.c | 72 ++
+ drivers/net/macb.h | 9
+ sound/arm/Kconfig | 9
+ sound/arm/Makefile | 4
+ sound/arm/at91-ac97.c | 911 +++++++++++++++++++++++++++++
+ sound/arm/at91-ac97.h | 295 +++++++++
+ 10 files changed, 1367 insertions(+), 21 deletions(-)
+
+--- linux-2.6.30.orig/arch/arm/mach-at91/include/mach/at91_pmc.h
++++ linux-2.6.30/arch/arm/mach-at91/include/mach/at91_pmc.h
+@@ -21,11 +21,11 @@
+
+ #define AT91_PMC_SCSR (AT91_PMC + 0x08) /* System Clock Status Register */
+ #define AT91_PMC_PCK (1 << 0) /* Processor Clock */
+ #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */
+ #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
+-#define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [AT91CAP9 revC only] */
++#define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock Enable [some SAM9 only] */
+ #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */
+ #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */
+ #define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */
+ #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */
+ #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */
+@@ -38,15 +38,15 @@
+
+ #define AT91_PMC_PCER (AT91_PMC + 0x10) /* Peripheral Clock Enable Register */
+ #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */
+ #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */
+
+-#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [SAM9RL, CAP9] */
++#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9, CAP9] */
+ #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */
+ #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */
+ #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */
+-#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI PLL Start-up Time */
++#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */
+
+ #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */
+ #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */
+ #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [SAM9x, CAP9] */
+ #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */
+@@ -71,10 +71,11 @@
+ #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
+ #define AT91_PMC_CSS_SLOW (0 << 0)
+ #define AT91_PMC_CSS_MAIN (1 << 0)
+ #define AT91_PMC_CSS_PLLA (2 << 0)
+ #define AT91_PMC_CSS_PLLB (3 << 0)
++#define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */
+ #define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */
+ #define AT91_PMC_PRES_1 (0 << 2)
+ #define AT91_PMC_PRES_2 (1 << 2)
+ #define AT91_PMC_PRES_4 (2 << 2)
+ #define AT91_PMC_PRES_8 (3 << 2)
+@@ -87,25 +88,39 @@
+ #define AT91RM9200_PMC_MDIV_3 (2 << 8)
+ #define AT91RM9200_PMC_MDIV_4 (3 << 8)
+ #define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */
+ #define AT91SAM9_PMC_MDIV_2 (1 << 8)
+ #define AT91SAM9_PMC_MDIV_4 (2 << 8)
+-#define AT91SAM9_PMC_MDIV_6 (3 << 8)
++#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */
++#define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */
+ #define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
+ #define AT91_PMC_PDIV_1 (0 << 12)
+ #define AT91_PMC_PDIV_2 (1 << 12)
+
+-#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-4 Registers */
++#define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */
++#define AT91_PMC_PLLADIV2_OFF (0 << 12)
++#define AT91_PMC_PLLADIV2_ON (1 << 12)
++
++#define AT91_PMC_USB (AT91_PMC + 0x38) /* USB Clock Register [some SAM9 only] */
++#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */
++#define AT91_PMC_USBS_PLLA (0 << 0)
++#define AT91_PMC_USBS_UPLL (1 << 0)
++#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */
++
++#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */
++#define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */
++#define AT91_PMC_CSSMCK_CSS (0 << 8)
++#define AT91_PMC_CSSMCK_MCK (1 << 8)
+
+ #define AT91_PMC_IER (AT91_PMC + 0x60) /* Interrupt Enable Register */
+ #define AT91_PMC_IDR (AT91_PMC + 0x64) /* Interrupt Disable Register */
+ #define AT91_PMC_SR (AT91_PMC + 0x68) /* Status Register */
+ #define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */
+ #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */
+ #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
+ #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
+-#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [AT91CAP9 only] */
++#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9, AT91CAP9 only] */
+ #define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */
+ #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
+ #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
+ #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */
+ #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */
+--- linux-2.6.30.orig/drivers/input/touchscreen/atmel_tsadcc.c
++++ linux-2.6.30/drivers/input/touchscreen/atmel_tsadcc.c
+@@ -34,10 +34,11 @@
+ #define ATMEL_TSADCC_TSAMOD_ADC_ONLY_MODE (0x0) /* ADC Mode */
+ #define ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE (0x1) /* Touch Screen Only Mode */
+ #define ATMEL_TSADCC_LOWRES (1 << 4) /* Resolution selection */
+ #define ATMEL_TSADCC_SLEEP (1 << 5) /* Sleep mode */
+ #define ATMEL_TSADCC_PENDET (1 << 6) /* Pen Detect selection */
++#define ATMEL_TSADCC_PRES (1 << 7) /* Pressure Measurement Selection */
+ #define ATMEL_TSADCC_PRESCAL (0x3f << 8) /* Prescalar Rate Selection */
+ #define ATMEL_TSADCC_STARTUP (0x7f << 16) /* Start Up time */
+ #define ATMEL_TSADCC_SHTIM (0xf << 24) /* Sample & Hold time */
+ #define ATMEL_TSADCC_PENDBC (0xf << 28) /* Pen Detect debouncing time */
+
+@@ -82,20 +83,25 @@
+ #define ATMEL_TSADCC_CDR2 0x38 /* Channel Data 2 */
+ #define ATMEL_TSADCC_CDR3 0x3C /* Channel Data 3 */
+ #define ATMEL_TSADCC_CDR4 0x40 /* Channel Data 4 */
+ #define ATMEL_TSADCC_CDR5 0x44 /* Channel Data 5 */
+
++#define ATMEL_TSADCC_XPOS 0x50
++#define ATMEL_TSADCC_Z1DAT 0x54
++#define ATMEL_TSADCC_Z2DAT 0x58
++
++
+ #define ADC_CLOCK 1000000
+
+ struct atmel_tsadcc {
+ struct input_dev *input;
+ char phys[32];
+ struct clk *clk;
+ int irq;
+ unsigned int prev_absx;
+ unsigned int prev_absy;
+- unsigned char bufferedmeasure;
++ unsigned char bufferedmeasure;
+ };
+
+ static void __iomem *tsc_base;
+
+ #define atmel_tsadcc_read(reg) __raw_readl(tsc_base + (reg))
+@@ -122,10 +128,13 @@ static irqreturn_t atmel_tsadcc_interrup
+ ATMEL_TSADCC_EOC(3) | ATMEL_TSADCC_NOCNT);
+ atmel_tsadcc_write(ATMEL_TSADCC_IER, ATMEL_TSADCC_PENCNT);
+
+ input_report_key(input_dev, BTN_TOUCH, 0);
+ ts_dev->bufferedmeasure = 0;
++#ifdef CONFIG_TS_ABS_PRESSURE
++ input_report_abs(input_dev, ABS_PRESSURE, 0);
++#endif
+ input_sync(input_dev);
+
+ } else if (status & ATMEL_TSADCC_PENCNT) {
+ /* Pen detected */
+ reg = atmel_tsadcc_read(ATMEL_TSADCC_MR);
+@@ -146,10 +155,13 @@ static irqreturn_t atmel_tsadcc_interrup
+ * be erroneous.
+ * Always report previous measurement */
+ input_report_abs(input_dev, ABS_X, ts_dev->prev_absx);
+ input_report_abs(input_dev, ABS_Y, ts_dev->prev_absy);
+ input_report_key(input_dev, BTN_TOUCH, 1);
++#ifdef CONFIG_TS_ABS_PRESSURE
++ input_report_abs(input_dev, ABS_PRESSURE, 7500);
++#endif
+ input_sync(input_dev);
+ } else
+ ts_dev->bufferedmeasure = 1;
+
+ /* Now make new measurement */
+@@ -245,10 +257,11 @@ static int __devinit atmel_tsadcc_probe(
+ input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+ input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+
+ input_set_abs_params(input_dev, ABS_X, 0, 0x3FF, 0, 0);
+ input_set_abs_params(input_dev, ABS_Y, 0, 0x3FF, 0, 0);
++ input_set_abs_params(input_dev, ABS_PRESSURE, 0, 15000, 0, 0);
+
+ /* clk_enable() always returns 0, no need to check it */
+ clk_enable(ts_dev->clk);
+
+ prsc = clk_get_rate(ts_dev->clk);
+@@ -297,10 +310,11 @@ err_free_mem:
+ static int __devexit atmel_tsadcc_remove(struct platform_device *pdev)
+ {
+ struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
+ struct resource *res;
+
++ disable_irq(ts_dev->irq);
+ free_irq(ts_dev->irq, ts_dev);
+
+ input_unregister_device(ts_dev->input);
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+--- linux-2.6.30.orig/drivers/mmc/host/at91_mci.c
++++ linux-2.6.30/drivers/mmc/host/at91_mci.c
+@@ -77,10 +77,20 @@
+ #include <mach/cpu.h>
+ #include <mach/at91_mci.h>
+
+ #define DRIVER_NAME "at91_mci"
+
++static inline int at91mci_is_rev2(void)
++{
++ return ( cpu_is_at91sam9260()
++ || cpu_is_at91sam9263()
++ || cpu_is_at91cap9()
++ || cpu_is_at91sam9rl()
++ || cpu_is_at91sam9g20()
++ );
++}
++
+ #define FL_SENT_COMMAND (1 << 0)
+ #define FL_SENT_STOP (1 << 1)
+
+ #define AT91_MCI_ERRORS (AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE \
+ | AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE \
+@@ -199,12 +209,12 @@ static inline void at91_mci_sg_to_dma(st
+ unsigned *dmabuf = host->buffer;
+
+ size = data->blksz * data->blocks;
+ len = data->sg_len;
+
+- /* AT91SAM926[0/3] Data Write Operation and number of bytes erratum */
+- if (cpu_is_at91sam9260() || cpu_is_at91sam9263() || cpu_is_at91sam9g20())
++ /* at91mci rev2 Data Write Operation and number of bytes erratum */
++ if (at91mci_is_rev2())
+ if (host->total_length == 12)
+ memset(dmabuf, 0, 12);
+
+ /*
+ * Just loop through all entries. Size might not
+@@ -460,11 +470,11 @@ static void at91_mci_enable(struct at91m
+ at91_mci_write(host, AT91_MCI_CR, AT91_MCI_MCIEN);
+ at91_mci_write(host, AT91_MCI_IDR, 0xffffffff);
+ at91_mci_write(host, AT91_MCI_DTOR, AT91_MCI_DTOMUL_1M | AT91_MCI_DTOCYC);
+ mr = AT91_MCI_PDCMODE | 0x34a;
+
+- if (cpu_is_at91sam9260() || cpu_is_at91sam9263() || cpu_is_at91sam9g20())
++ if (at91mci_is_rev2())
+ mr |= AT91_MCI_RDPROOF | AT91_MCI_WRPROOF;
+
+ at91_mci_write(host, AT91_MCI_MR, mr);
+
+ /* use Slot A or B (only one at same time) */
+@@ -613,14 +623,14 @@ static void at91_mci_send_command(struct
+ /*
+ * Handle a write
+ */
+ host->total_length = block_length * blocks;
+ /*
+- * AT91SAM926[0/3] Data Write Operation and
++ * at91mci rev2 Data Write Operation and
+ * number of bytes erratum
+ */
+- if (cpu_is_at91sam9260 () || cpu_is_at91sam9263() || cpu_is_at91sam9g20())
++ if (at91mci_is_rev2())
+ if (host->total_length < 12)
+ host->total_length = 12;
+
+ host->buffer = kmalloc(host->total_length, GFP_KERNEL);
+ if (!host->buffer) {
+@@ -676,15 +686,14 @@ static void at91_mci_process_next(struct
+ else if ((!(host->flags & FL_SENT_STOP)) && host->request->stop) {
+ host->flags |= FL_SENT_STOP;
+ at91_mci_send_command(host, host->request->stop);
+ } else {
+ del_timer(&host->timer);
+- /* the at91rm9200 mci controller hangs after some transfers,
++ /* the mci controller hangs after some transfers,
+ * and the workaround is to reset it after each transfer.
+ */
+- if (cpu_is_at91rm9200())
+- at91_reset_host(host);
++ at91_reset_host(host);
+ mmc_request_done(host->mmc, host->request);
+ }
+ }
+
+ /*
+@@ -1005,28 +1014,35 @@ static int __init at91_mci_probe(struct
+
+ mmc->ops = &at91_mci_ops;
+ mmc->f_min = 375000;
+ mmc->f_max = 25000000;
+ mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+- mmc->caps = MMC_CAP_SDIO_IRQ;
++ mmc->caps = 0;
+
+ mmc->max_blk_size = 4095;
+ mmc->max_blk_count = mmc->max_req_size;
+
+ host = mmc_priv(mmc);
+ host->mmc = mmc;
+ host->buffer = NULL;
+ host->bus_mode = 0;
+ host->board = pdev->dev.platform_data;
+ if (host->board->wire4) {
+- if (cpu_is_at91sam9260() || cpu_is_at91sam9263() || cpu_is_at91sam9g20())
++ if (at91mci_is_rev2())
+ mmc->caps |= MMC_CAP_4_BIT_DATA;
+ else
+ dev_warn(&pdev->dev, "4 wire bus mode not supported"
+ " - using 1 wire\n");
+ }
+
++ /* Add SDIO capability when available */
++ if (at91mci_is_rev2()) {
++ /* at91mci rev2 sdio interrupt erratum */
++ if (host->board->wire4 || !host->board->slot_b)
++ mmc->caps |= MMC_CAP_SDIO_IRQ;
++ }
++
+ /*
+ * Reserve GPIOs ... board init code makes sure these pins are set
+ * up as GPIOs with the right direction (input, except for vcc)
+ */
+ if (host->board->det_pin) {
+@@ -1079,12 +1095,11 @@ static int __init at91_mci_probe(struct
+
+ /*
+ * Allocate the MCI interrupt
+ */
+ host->irq = platform_get_irq(pdev, 0);
+- ret = request_irq(host->irq, at91_mci_irq, IRQF_SHARED,
+- mmc_hostname(mmc), host);
++ ret = request_irq(host->irq, at91_mci_irq, 0, mmc_hostname(mmc), host);
+ if (ret) {
+ dev_dbg(&pdev->dev, "request MCI interrupt failed\n");
+ goto fail0;
+ }
+
+--- linux-2.6.30.orig/drivers/net/Kconfig
++++ linux-2.6.30/drivers/net/Kconfig
+@@ -226,10 +226,16 @@ config MACB
+ parts. Say Y to include support for the MACB chip.
+
+ To compile this driver as a module, choose M here: the module
+ will be called macb.
+
++config MACB_TX_SRAM
++ bool "Atmel MACB TX buffers in internal SRAM"
++ depends on NET_ETHERNET && MACB && (ARCH_AT91SAM9260 || ARCH_AT91SAM9263)
++ help
++ Use internal SRAM for TX buffers.
++
+ source "drivers/net/arm/Kconfig"
+
+ config AX88796
+ tristate "ASIX AX88796 NE2000 clone support"
+ depends on ARM || MIPS || SUPERH
+--- linux-2.6.30.orig/drivers/net/macb.c
++++ linux-2.6.30/drivers/net/macb.c
+@@ -31,13 +31,25 @@
+ #define RX_RING_BYTES (sizeof(struct dma_desc) * RX_RING_SIZE)
+
+ /* Make the IP header word-aligned (the ethernet header is 14 bytes) */
+ #define RX_OFFSET 2
+
+-#define TX_RING_SIZE 128
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++ #if defined(CONFIG_ARCH_AT91SAM9260)
++ #define TX_RING_SIZE 2
++ #elif defined(CONFIG_ARCH_AT91SAM9263)
++ #define TX_RING_SIZE 32
++ #endif
++ #define TX_BUFFER_SIZE 1536
++ #define TX_RING_BYTES (sizeof(struct dma_desc) * TX_RING_SIZE)
++ #define TX_DMA_SIZE ((TX_RING_BYTES) + (TX_RING_SIZE) * (TX_BUFFER_SIZE))
++#else
++ #define TX_RING_SIZE 128
++ #define TX_RING_BYTES (sizeof(struct dma_desc) * TX_RING_SIZE)
++#endif
++
+ #define DEF_TX_RING_PENDING (TX_RING_SIZE - 1)
+-#define TX_RING_BYTES (sizeof(struct dma_desc) * TX_RING_SIZE)
+
+ #define TX_RING_GAP(bp) \
+ (TX_RING_SIZE - (bp)->tx_pending)
+ #define TX_BUFFS_AVAIL(bp) \
+ (((bp)->tx_tail <= (bp)->tx_head) ? \
+@@ -376,12 +388,14 @@ static void macb_tx(struct macb *bp)
+ if (!(bufstat & MACB_BIT(TX_USED)))
+ break;
+
+ dev_dbg(&bp->pdev->dev, "skb %u (data %p) TX complete\n",
+ tail, skb->data);
++#if !defined(CONFIG_MACB_TX_SRAM)
+ dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
+ DMA_TO_DEVICE);
++#endif
+ bp->stats.tx_packets++;
+ bp->stats.tx_bytes += skb->len;
+ rp->skb = NULL;
+ dev_kfree_skb_irq(skb);
+ }
+@@ -633,23 +647,30 @@ static int macb_start_xmit(struct sk_buf
+ return 1;
+ }
+
+ entry = bp->tx_head;
+ dev_dbg(&bp->pdev->dev, "Allocated ring entry %u\n", entry);
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++ mapping = bp->tx_ring[entry].addr;
++ memcpy(bp->tx_buffers + entry * TX_BUFFER_SIZE, skb->data, len);
++#else
+ mapping = dma_map_single(&bp->pdev->dev, skb->data,
+ len, DMA_TO_DEVICE);
++#endif
+ bp->tx_skb[entry].skb = skb;
+ bp->tx_skb[entry].mapping = mapping;
+ dev_dbg(&bp->pdev->dev, "Mapped skb data %p to DMA addr %08lx\n",
+ skb->data, (unsigned long)mapping);
+
+ ctrl = MACB_BF(TX_FRMLEN, len);
+ ctrl |= MACB_BIT(TX_LAST);
+ if (entry == (TX_RING_SIZE - 1))
+ ctrl |= MACB_BIT(TX_WRAP);
+
++#if !defined(CONFIG_MACB_TX_SRAM)
+ bp->tx_ring[entry].addr = mapping;
++#endif
+ bp->tx_ring[entry].ctrl = ctrl;
+ wmb();
+
+ entry = NEXT_TX(entry);
+ bp->tx_head = entry;
+@@ -676,20 +697,29 @@ static void macb_free_consistent(struct
+ dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES,
+ bp->rx_ring, bp->rx_ring_dma);
+ bp->rx_ring = NULL;
+ }
+ if (bp->tx_ring) {
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++ iounmap((void *)bp->tx_ring);
++#else
+ dma_free_coherent(&bp->pdev->dev, TX_RING_BYTES,
+ bp->tx_ring, bp->tx_ring_dma);
++#endif
+ bp->tx_ring = NULL;
+ }
+ if (bp->rx_buffers) {
+ dma_free_coherent(&bp->pdev->dev,
+ RX_RING_SIZE * RX_BUFFER_SIZE,
+ bp->rx_buffers, bp->rx_buffers_dma);
+ bp->rx_buffers = NULL;
+ }
++
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++ if (bp->tx_ring_dma)
++ release_mem_region(bp->tx_ring_dma, TX_DMA_SIZE);
++#endif
+ }
+
+ static int macb_alloc_consistent(struct macb *bp)
+ {
+ int size;
+@@ -706,18 +736,48 @@ static int macb_alloc_consistent(struct
+ goto out_err;
+ dev_dbg(&bp->pdev->dev,
+ "Allocated RX ring of %d bytes at %08lx (mapped %p)\n",
+ size, (unsigned long)bp->rx_ring_dma, bp->rx_ring);
+
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++#if defined(CONFIG_ARCH_AT91SAM9260)
++ if (request_mem_region(AT91SAM9260_SRAM0_BASE, TX_DMA_SIZE, "macb")) {
++ bp->tx_ring_dma = AT91SAM9260_SRAM0_BASE;
++ } else {
++ if (request_mem_region(AT91SAM9260_SRAM1_BASE, TX_DMA_SIZE, "macb")) {
++ bp->tx_ring_dma = AT91SAM9260_SRAM1_BASE;
++ } else {
++ printk(KERN_WARNING "Cannot request SRAM memory for TX ring, already used\n");
++ return -EBUSY;
++ }
++ }
++#elif defined(CONFIG_ARCH_AT91SAM9263)
++ if (request_mem_region(AT91SAM9263_SRAM0_BASE, TX_DMA_SIZE, "macb")) {
++ bp->tx_ring_dma = AT91SAM9263_SRAM0_BASE;
++ } else {
++ printk(KERN_WARNING "Cannot request SRAM memory for TX ring, already used\n");
++ return -EBUSY;
++ }
++#endif
++
++ bp->tx_ring = ioremap(bp->tx_ring_dma, TX_DMA_SIZE);
++ if (!bp->tx_ring)
++ return -ENOMEM;
++
++ bp->tx_buffers_dma = bp->tx_ring_dma + TX_RING_BYTES;
++ bp->tx_buffers = (char *) bp->tx_ring + TX_RING_BYTES;
++#else
+ size = TX_RING_BYTES;
+ bp->tx_ring = dma_alloc_coherent(&bp->pdev->dev, size,
+ &bp->tx_ring_dma, GFP_KERNEL);
+ if (!bp->tx_ring)
+ goto out_err;
++
+ dev_dbg(&bp->pdev->dev,
+ "Allocated TX ring of %d bytes at %08lx (mapped %p)\n",
+ size, (unsigned long)bp->tx_ring_dma, bp->tx_ring);
++#endif
+
+ size = RX_RING_SIZE * RX_BUFFER_SIZE;
+ bp->rx_buffers = dma_alloc_coherent(&bp->pdev->dev, size,
+ &bp->rx_buffers_dma, GFP_KERNEL);
+ if (!bp->rx_buffers)
+@@ -744,14 +804,22 @@ static void macb_init_rings(struct macb
+ bp->rx_ring[i].ctrl = 0;
+ addr += RX_BUFFER_SIZE;
+ }
+ bp->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);
+
++#if defined(CONFIG_ARCH_AT91) && defined(CONFIG_MACB_TX_SRAM)
++ for (i = 0; i < TX_RING_SIZE; i++) {
++ bp->tx_ring[i].addr = bp->tx_buffers_dma + i * TX_BUFFER_SIZE;
++ bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
++ }
++#else
+ for (i = 0; i < TX_RING_SIZE; i++) {
+ bp->tx_ring[i].addr = 0;
+ bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
+ }
++#endif
++
+ bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
+
+ bp->rx_tail = bp->tx_head = bp->tx_tail = 0;
+ }
+
+--- linux-2.6.30.orig/drivers/net/macb.h
++++ linux-2.6.30/drivers/net/macb.h
+@@ -367,12 +367,17 @@ struct macb {
+
+ unsigned int tx_head, tx_tail;
+ struct dma_desc *tx_ring;
+ struct ring_info *tx_skb;
+
++#if defined(CONFIG_ARCH_AT91)
++ void *tx_buffers;
++#endif
++
+ spinlock_t lock;
+ struct platform_device *pdev;
++ struct clk *macb_clk;
+ struct clk *pclk;
+ struct clk *hclk;
+ struct net_device *dev;
+ struct napi_struct napi;
+ struct net_device_stats stats;
+@@ -380,10 +385,14 @@ struct macb {
+
+ dma_addr_t rx_ring_dma;
+ dma_addr_t tx_ring_dma;
+ dma_addr_t rx_buffers_dma;
+
++#if defined(CONFIG_ARCH_AT91)
++ dma_addr_t tx_buffers_dma;
++#endif
++
+ unsigned int rx_pending, tx_pending;
+
+ struct mii_bus *mii_bus;
+ struct phy_device *phy_dev;
+ unsigned int link;
+--- linux-2.6.30.orig/sound/arm/Kconfig
++++ linux-2.6.30/sound/arm/Kconfig
+@@ -37,7 +37,16 @@ config SND_PXA2XX_AC97
+ select SND_PXA2XX_LIB_AC97
+ help
+ Say Y or M if you want to support any AC97 codec attached to
+ the PXA2xx AC97 interface.
+
++config SND_AT91_AC97
++ tristate "AC97 Controller driver for SAM926X familly from ATMEL"
++ depends on SND && ARCH_AT91
++ select SND_PCM
++ select SND_AC97_CODEC
++ help
++ Say Y or M if you want to support any AC97 codec attached to
++ the SAM926X AC97 Controller.
++
+ endif # SND_ARM
+
+--- linux-2.6.30.orig/sound/arm/Makefile
++++ linux-2.6.30/sound/arm/Makefile
+@@ -12,5 +12,9 @@ obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2
+ snd-pxa2xx-lib-y := pxa2xx-pcm-lib.o
+ snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o
+
+ obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
+ snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
++
++obj-$(CONFIG_SND_AT91_AC97) += snd-at91-ac97.o
++snd-at91-ac97-objs := at91-ac97.o
++
+--- /dev/null
++++ linux-2.6.30/sound/arm/at91-ac97.c
+@@ -0,0 +1,911 @@
++/*
++ * at91-ac97.c -- AC'97 driver for atmel boards.
++ *
++ * Copyright (C) 2005 SAN People
++ * Copyright (C) 2006 Atmel
++ *
++ * Author: Patrice Vilchez <patrice.vilchez@atmel.com>
++ * Sedji Gaouaou <sedji.gaouaou@atmel.com>
++ * ATMEL CORP.
++ *
++ *
++ * 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 <linux/platform_device.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/delay.h>
++#include <linux/clk.h>
++#include <linux/atmel_pdc.h>
++#include <linux/io.h>
++
++#include <sound/core.h>
++#include <sound/initval.h>
++#include <sound/pcm.h>
++#include <sound/pcm_params.h>
++#include <sound/ac97_codec.h>
++#include <sound/soc.h>
++
++#include <asm/cacheflush.h>
++
++#include <mach/hardware.h>
++#include <mach/gpio.h>
++#include <mach/board.h>
++
++#include "at91-ac97.h"
++
++
++/*
++ * module parameters
++ */
++static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
++static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
++static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
++
++module_param_array(index, int, NULL, 0444);
++MODULE_PARM_DESC(index, "Index value for AC97 controller");
++module_param_array(id, charp, NULL, 0444);
++MODULE_PARM_DESC(id, "ID string for AC97 controller");
++module_param_array(enable, bool, NULL, 0444);
++MODULE_PARM_DESC(enable, "Enable AC97 controller");
++
++typedef struct at91_ac97 {
++ spinlock_t lock;
++ void *regs;
++ int period;
++ struct clk *ac97_clk;
++ struct snd_pcm_substream *playback_substream;
++ struct snd_pcm_substream *capture_substream;
++ struct snd_card *card;
++ struct snd_pcm *pcm;
++ struct snd_ac97 *ac97;
++ struct snd_ac97_bus *ac97_bus;
++ int irq;
++ struct platform_device *pdev;
++ u8 reset_pin;
++} at91_ac97_t;
++
++
++/*
++ * PIO management functions
++ */
++void at91_ac97c_drive_reset(at91_ac97_t *chip, unsigned int value)
++{
++ at91_set_gpio_value(chip->reset_pin, value);
++}
++
++static const char driver_name[] = "at91-ac97";
++
++
++/*
++ * PCM part
++ */
++static struct snd_pcm_hardware snd_at91_ac97_playback_hw = {
++ .info = (SNDRV_PCM_INFO_INTERLEAVED
++ | SNDRV_PCM_INFO_MMAP
++ | SNDRV_PCM_INFO_MMAP_VALID
++ | SNDRV_PCM_INFO_BLOCK_TRANSFER),
++ .formats = (SNDRV_PCM_FMTBIT_S16_LE
++ | SNDRV_PCM_FMTBIT_S16_BE),
++ .rates = SNDRV_PCM_RATE_CONTINUOUS,
++ .rate_min = 8000,
++ .rate_max = 48000,
++ .channels_min = 2,
++ .channels_max = 2,
++ .buffer_bytes_max = 256*1024,
++ .period_bytes_min = 1024,
++ .period_bytes_max = 4*1024,
++ .periods_min = 1,
++ .periods_max = 64,
++};
++
++static struct snd_pcm_hardware snd_at91_ac97_capture_hw = {
++ .info = (SNDRV_PCM_INFO_INTERLEAVED
++ | SNDRV_PCM_INFO_MMAP
++ | SNDRV_PCM_INFO_MMAP_VALID
++ | SNDRV_PCM_INFO_BLOCK_TRANSFER),
++ .formats = (SNDRV_PCM_FMTBIT_S16_LE
++ | SNDRV_PCM_FMTBIT_S16_BE),
++ .rates = SNDRV_PCM_RATE_CONTINUOUS,
++ .rate_min = 8000,
++ .rate_max = 48000,
++ .channels_min = 1,
++ .channels_max = 2,
++ .buffer_bytes_max = 256*1024,
++ .period_bytes_min = 1024,
++ .period_bytes_max = 4*1024,
++ .periods_min = 1,
++ .periods_max = 64,
++};
++
++static int snd_at91_ac97_playback_open(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++
++ runtime->hw = snd_at91_ac97_playback_hw;
++ chip->playback_substream = substream;
++ chip->period = 0;
++
++ pr_debug("%s : snd_at91_ac97_playback_open\n\r", driver_name);
++
++ return 0;
++}
++
++static int snd_at91_ac97_capture_open(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++
++ runtime->hw = snd_at91_ac97_capture_hw;
++ chip->capture_substream = substream;
++ chip->period = 0;
++
++ pr_debug("%s : snd_at91_ac97_capture_open\n\r", driver_name);
++
++ return 0;
++}
++
++static int snd_at91_ac97_playback_close(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++
++ chip->playback_substream = NULL;
++
++ return 0;
++}
++
++static int snd_at91_ac97_capture_close(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++
++ chip->capture_substream = NULL;
++
++ return 0;
++}
++
++static int snd_at91_ac97_playback_hw_params(struct snd_pcm_substream *substream,
++ struct snd_pcm_hw_params *hw_params)
++{
++ int err;
++
++ err = snd_pcm_lib_malloc_pages(substream,
++ params_buffer_bytes(hw_params));
++
++ return err;
++}
++
++static int snd_at91_ac97_capture_hw_params(struct snd_pcm_substream *substream,
++ struct snd_pcm_hw_params *hw_params)
++{
++ int err;
++
++ err = snd_pcm_lib_malloc_pages(substream,
++ params_buffer_bytes(hw_params));
++
++ return err;
++}
++
++static int snd_at91_ac97_playback_hw_free(struct snd_pcm_substream *substream)
++{
++
++ snd_pcm_lib_free_pages(substream);
++
++ return 0;
++}
++
++static int snd_at91_ac97_capture_hw_free(struct snd_pcm_substream *substream)
++{
++
++ snd_pcm_lib_free_pages(substream);
++
++ return 0;
++}
++
++static int snd_at91_ac97_playback_prepare(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++ int block_size = frames_to_bytes(runtime, runtime->period_size);
++ unsigned long word = 0;
++
++ pr_debug("%s : block_size = %d\n\r", driver_name, block_size);
++
++ /* Assign slots to channels */
++ switch (substream->runtime->channels) {
++ /* TODO: Support more than two channels */
++ case 1:
++ word |= AT91C_AC97C_CHID3_CA;
++ break;
++ case 2:
++ default:
++ /* Assign Left and Right slots (3,4) to Channel A */
++ word |= AT91C_AC97C_CHID3_CA | AT91C_AC97C_CHID4_CA;
++ break;
++ }
++
++ ac97c_writel(chip, OCA, word);
++
++ /*
++ * Configure sample format and size..
++ */
++ word = AT91C_AC97C_PDCEN | AT91C_AC97C_SIZE_16_BITS;
++
++ switch (runtime->format) {
++ case SNDRV_PCM_FORMAT_S16_BE:
++ word |= AT91C_AC97C_CEM;
++ break;
++ case SNDRV_PCM_FORMAT_S16_LE:
++ default:
++ break;
++ }
++
++ ac97c_writel(chip, CAMR, word);
++
++ /* Set variable rate if needed */
++ if (runtime->rate != 48000) {
++ word = ac97c_readl(chip, MR);
++ word |= AT91C_AC97C_VRA;
++ ac97c_writel(chip, MR, word);
++ } else {
++ /* Clear Variable Rate Bit */
++ word = ac97c_readl(chip, MR);
++ word &= ~AT91C_AC97C_VRA;
++ ac97c_writel(chip, MR, word);
++ }
++
++ /* Set rate */
++ snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate);
++
++ pr_debug("%s : dma_addr = %x\n\r : dma_area = %x\n\r"
++ " : dma_bytes = %d\n\r",
++ driver_name, runtime->dma_addr,
++ runtime->dma_area, runtime->dma_bytes);
++
++ /* Initialize and start the PDC */
++ writel(runtime->dma_addr, chip->regs + ATMEL_PDC_TPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_TCR);
++ writel(runtime->dma_addr + block_size, chip->regs + ATMEL_PDC_TNPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_TNCR);
++
++ /* Enable Channel A interrupts */
++ ac97c_writel(chip, IER, AT91C_AC97C_CAEVT);
++
++ pr_debug("%s : snd_at91_ac97_playback_prepare\n\r", driver_name);
++
++ return 0;
++}
++
++static int snd_at91_ac97_capture_prepare(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++ int block_size = frames_to_bytes(runtime, runtime->period_size);
++ unsigned long word = 0;
++
++ pr_debug("%s : block_size = %d\n\r", driver_name, block_size);
++
++
++ /* Assign slots to channels */
++ switch (substream->runtime->channels) {
++ /* TODO: Support more than two channels */
++ case 1:
++ word |= AT91C_AC97C_CHID3_CA;
++ break;
++ case 2:
++ default:
++ /* Assign Left and Right slots (3,4) to Channel A */
++ word |= AT91C_AC97C_CHID3_CA | AT91C_AC97C_CHID4_CA;
++ break;
++ }
++
++ ac97c_writel(chip, ICA, word);
++
++ /*
++ * Configure sample format and size.
++ */
++ word = AT91C_AC97C_PDCEN | AT91C_AC97C_SIZE_16_BITS;
++
++ switch (runtime->format) {
++ case SNDRV_PCM_FORMAT_S16_BE:
++ word |= AT91C_AC97C_CEM;
++ break;
++ case SNDRV_PCM_FORMAT_S16_LE:
++ break;
++ }
++
++ ac97c_writel(chip, CAMR, word);
++
++ /* Set variable rate if needed */
++ if (runtime->rate != 48000) {
++ word = ac97c_readl(chip, MR);
++ word |= AT91C_AC97C_VRA;
++ ac97c_writel(chip, MR, word);
++ } else {
++ /* Clear Variable Rate Bit */
++ word = ac97c_readl(chip, MR);
++ word &= ~AT91C_AC97C_VRA;
++ ac97c_writel(chip, MR, word);
++ }
++
++ /* Set rate */
++ snd_ac97_set_rate(chip->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate);
++
++ pr_debug("%s : dma_addr = %x\n\r : dma_area = %x\n\r"
++ " : dma_bytes = %d\n\r",
++ driver_name, runtime->dma_addr,
++ runtime->dma_area, runtime->dma_bytes);
++
++ /* Initialize and start the PDC */
++ writel(runtime->dma_addr, chip->regs + ATMEL_PDC_RPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_RCR);
++ writel(runtime->dma_addr + block_size, chip->regs + ATMEL_PDC_RNPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_RNCR);
++
++ /* Enable Channel A interrupts */
++ ac97c_writel(chip, IER, AT91C_AC97C_CAEVT);
++
++ pr_debug("%s : snd_at91_ac97_capture_prepare\n\r", driver_name);
++
++ return 0;
++}
++
++static int snd_at91_ac97_playback_trigger(struct snd_pcm_substream *substream,
++ int cmd)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ unsigned long camr, ptcr = 0, flags;
++ int err = 0;
++
++ spin_lock_irqsave(&chip->lock, flags);
++ camr = ac97c_readl(chip, CAMR);
++
++ switch (cmd) {
++ case SNDRV_PCM_TRIGGER_START:
++ camr |= (AT91C_AC97C_CEN | AT91C_AC97C_ENDTX);
++ ptcr = ATMEL_PDC_TXTEN;
++ break;
++ case SNDRV_PCM_TRIGGER_STOP:
++ camr &= ~(AT91C_AC97C_CEN | AT91C_AC97C_ENDTX);
++ ptcr = ATMEL_PDC_TXTDIS;
++ break;
++ default:
++ err = -EINVAL;
++ break;
++ }
++
++ ac97c_writel(chip, CAMR, camr);
++
++ writel(ptcr, chip->regs + ATMEL_PDC_PTCR);
++
++ spin_unlock_irqrestore(&chip->lock, flags);
++
++ pr_debug("%s : snd_at91_ac97_playback_trigger\n\r", driver_name);
++
++ return err;
++}
++
++static int snd_at91_ac97_capture_trigger(struct snd_pcm_substream *substream,
++ int cmd)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ unsigned long camr, ptcr = 0, flags;
++ int err = 0;
++
++ spin_lock_irqsave(&chip->lock, flags);
++ camr = ac97c_readl(chip, CAMR);
++
++ switch (cmd) {
++ case SNDRV_PCM_TRIGGER_START:
++ camr |= (AT91C_AC97C_CEN |
++ AT91C_AC97C_ENDRX |
++ AT91C_AC97C_OVRUN);
++ ptcr = ATMEL_PDC_RXTEN;
++ break;
++ case SNDRV_PCM_TRIGGER_STOP:
++ camr &= ~(AT91C_AC97C_CEN |
++ AT91C_AC97C_ENDRX |
++ AT91C_AC97C_OVRUN);
++ ptcr = ATMEL_PDC_RXTDIS;
++ break;
++ default:
++ err = -EINVAL;
++ break;
++ }
++
++ ac97c_writel(chip, CAMR, camr);
++
++ writel(ptcr, chip->regs + ATMEL_PDC_PTCR);
++
++ spin_unlock_irqrestore(&chip->lock, flags);
++
++ pr_debug("%s : snd_at91_ac97_capture_trigger\n\r", driver_name);
++
++ return err;
++}
++
++static snd_pcm_uframes_t
++snd_at91_ac97_playback_pointer(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++ snd_pcm_uframes_t pos;
++ unsigned long bytes;
++
++ bytes = readl(chip->regs + ATMEL_PDC_TPR) - runtime->dma_addr;
++
++ pos = bytes_to_frames(runtime, bytes);
++
++ if (pos >= runtime->buffer_size)
++ pos -= runtime->buffer_size;
++
++ pr_debug("%s : snd_at91_ac97_playback_pointer\n\r", driver_name);
++
++ return pos;
++}
++
++static snd_pcm_uframes_t
++snd_at91_ac97_capture_pointer(struct snd_pcm_substream *substream)
++{
++ at91_ac97_t *chip = snd_pcm_substream_chip(substream);
++ struct snd_pcm_runtime *runtime = substream->runtime;
++ snd_pcm_uframes_t pos;
++ unsigned long bytes;
++
++ bytes = readl(chip->regs + ATMEL_PDC_RPR) - runtime->dma_addr;
++ pos = bytes_to_frames(runtime, bytes);
++ if (pos >= runtime->buffer_size)
++ pos -= runtime->buffer_size;
++
++ pr_debug("%s : snd_at91_ac97_capture_pointer\n\r", driver_name);
++
++ return pos;
++}
++
++static struct snd_pcm_ops at91_ac97_playback_ops = {
++ .open = snd_at91_ac97_playback_open,
++ .close = snd_at91_ac97_playback_close,
++ .ioctl = snd_pcm_lib_ioctl,
++ .hw_params = snd_at91_ac97_playback_hw_params,
++ .hw_free = snd_at91_ac97_playback_hw_free,
++ .prepare = snd_at91_ac97_playback_prepare,
++ .trigger = snd_at91_ac97_playback_trigger,
++ .pointer = snd_at91_ac97_playback_pointer,
++};
++
++static struct snd_pcm_ops at91_ac97_capture_ops = {
++ .open = snd_at91_ac97_capture_open,
++ .close = snd_at91_ac97_capture_close,
++ .ioctl = snd_pcm_lib_ioctl,
++ .hw_params = snd_at91_ac97_capture_hw_params,
++ .hw_free = snd_at91_ac97_capture_hw_free,
++ .prepare = snd_at91_ac97_capture_prepare,
++ .trigger = snd_at91_ac97_capture_trigger,
++ .pointer = snd_at91_ac97_capture_pointer,
++};
++
++static struct ac97_pcm at91_ac97_pcm_defs[] __devinitdata = {
++ /* Playback */
++ {
++ .exclusive = 1,
++ .r = { {
++ .slots = ((1 << AC97_SLOT_PCM_LEFT)
++ | (1 << AC97_SLOT_PCM_RIGHT)),
++ } },
++ },
++ /* PCM in */
++ {
++ .stream = 1,
++ .exclusive = 1,
++ .r = { {
++ .slots = ((1 << AC97_SLOT_PCM_LEFT)
++ | (1 << AC97_SLOT_PCM_RIGHT)),
++ } }
++ },
++ /* Mic in */
++ {
++ .stream = 1,
++ .exclusive = 1,
++ .r = { {
++ .slots = (1<<AC97_SLOT_MIC),
++ } }
++ },
++};
++
++static int __devinit snd_at91_ac97_pcm_new(at91_ac97_t *chip)
++{
++ struct snd_pcm *pcm;
++ int err;
++
++ err = snd_ac97_pcm_assign(chip->ac97_bus,
++ ARRAY_SIZE(at91_ac97_pcm_defs),
++ at91_ac97_pcm_defs);
++ if (err)
++ return err;
++
++ err = snd_pcm_new(chip->card, "Atmel AC97", 0, 1, 1, &pcm);
++ if (err)
++ return err;
++
++ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
++ &chip->pdev->dev,
++ 128 * 1024, 256 * 1024);
++
++ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
++ &at91_ac97_playback_ops);
++ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &at91_ac97_capture_ops);
++
++ pcm->private_data = chip;
++ pcm->info_flags = 0;
++ strcpy(pcm->name, "Atmel AC97");
++ chip->pcm = pcm;
++
++ return 0;
++}
++
++
++/*
++ * Mixer part
++ */
++static int snd_at91_ac97_mixer_new(at91_ac97_t *chip)
++{
++ int err;
++ struct snd_ac97_template template;
++
++ memset(&template, 0, sizeof(template));
++ template.private_data = chip;
++ template.num = 0;
++ template.addr = 0;
++ err = snd_ac97_mixer(chip->ac97_bus, &template, &chip->ac97);
++
++ return err;
++}
++
++static irqreturn_t snd_at91_ac97_interrupt(int irq, void *dev_id)
++{
++ at91_ac97_t *chip = dev_id;
++ unsigned long status;
++ unsigned long dummy;
++
++ status = ac97c_readl(chip, SR);
++
++ if (status & AT91C_AC97C_CAEVT) {
++ struct snd_pcm_runtime *runtime;
++ int offset, next_period, block_size;
++ unsigned long casr, camr, test;
++
++ casr = ac97c_readl(chip, CASR);
++ camr = ac97c_readl(chip, CAMR);
++ test = casr & camr;
++
++ if ((casr & camr) & AT91C_AC97C_ENDTX) {
++ runtime = chip->playback_substream->runtime;
++ block_size = frames_to_bytes(runtime,
++ runtime->period_size);
++ chip->period++;
++
++ if (chip->period == runtime->periods)
++ chip->period = 0;
++ next_period = chip->period + 1;
++ if (next_period == runtime->periods)
++ next_period = 0;
++
++ offset = block_size * next_period;
++
++ writel(runtime->dma_addr + offset,
++ chip->regs + ATMEL_PDC_TNPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_TNCR);
++
++ snd_pcm_period_elapsed(chip->playback_substream);
++ }
++ if ((casr & camr) & AT91C_AC97C_ENDRX) {
++ runtime = chip->capture_substream->runtime;
++ block_size = frames_to_bytes(runtime,
++ runtime->period_size);
++ chip->period++;
++
++ if (chip->period == runtime->periods)
++ chip->period = 0;
++ next_period = chip->period + 1;
++ if (next_period == runtime->periods)
++ next_period = 0;
++
++ offset = block_size * next_period;
++
++ writel(runtime->dma_addr + offset,
++ chip->regs + ATMEL_PDC_RNPR);
++ writel(block_size / 2, chip->regs + ATMEL_PDC_RNCR);
++ snd_pcm_period_elapsed(chip->capture_substream);
++ }
++ if ((casr & camr) & AT91C_AC97C_OVRUN)
++ printk(KERN_INFO " AC97_irq - overrun!\n");
++ } else {
++ printk(KERN_WARNING
++ "Spurious AC97 interrupt, status = 0x%08lx\n",
++ status);
++ }
++
++ dummy = ac97c_readl(chip, SR);
++
++ return IRQ_HANDLED;
++}
++
++
++/*
++ * CODEC part
++ */
++static void snd_at91_ac97_hard_reset(at91_ac97_t *chip)
++{
++ /* Enable AC97 Controller.*/
++ /* Perform a cold (hard) reset of the AC97 codec.*/
++ ac97c_writel(chip, MR, 0);
++ ac97c_writel(chip, MR, AT91C_AC97C_ENA);
++
++ at91_ac97c_drive_reset(chip, 0);
++ udelay(1);
++ at91_ac97c_drive_reset(chip, 1);
++ udelay(1);
++}
++
++static void snd_at91_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
++ unsigned short val)
++{
++ at91_ac97_t *chip = ac97->private_data;
++ unsigned long word;
++ int timeout = 0x100;
++
++ pr_debug("%s : Writing codec register 0x%x = 0x%x\n\r",
++ driver_name, reg, val);
++
++ word = (reg & 0x7f) << 16 | val;
++
++ do {
++ if (ac97c_readl(chip, COSR) & AT91C_AC97C_TXRDY) {
++ ac97c_writel(chip, COTHR, word);
++ return;
++ }
++ udelay(1);
++ } while (--timeout);
++
++ snd_printk(KERN_WARNING "at91-ac97: codec write timeout\n\r");
++}
++
++static unsigned short snd_at91_ac97_read(struct snd_ac97 *ac97,
++ unsigned short reg)
++{
++ at91_ac97_t *chip = ac97->private_data;
++ unsigned long word;
++ int timeout = 40;
++
++ word = (0x80 | (reg & 0x7f)) << 16;
++
++ do {
++ if (ac97c_readl(chip, COSR) & AT91C_AC97C_TXRDY) {
++ ac97c_writel(chip, COTHR, word);
++ break;
++ }
++ udelay(1);
++ } while (--timeout);
++
++ if (!timeout)
++ goto timed_out;
++
++ timeout = 0x100;
++
++ do {
++ if (ac97c_readl(chip, COSR) & AT91C_AC97C_RXRDY) {
++ unsigned short val =
++ (unsigned short) ac97c_readl(chip, CORHR);
++ return val;
++ }
++ udelay(1);
++ } while (--timeout);
++
++ if (!timeout)
++ goto timed_out;
++
++timed_out:
++ snd_printk(KERN_WARNING "at91-ac97: codec write timeout\n\r");
++ return 0xffff;
++}
++
++static void snd_at91_ac97_warm_reset(struct snd_ac97 *ac97)
++{
++ at91_ac97_t *chip = ac97->private_data;
++ unsigned int mr = ac97c_readl(chip, MR);
++
++ mr |= AT91C_AC97C_WRST;
++
++ ac97c_writel(chip, MR, mr);
++ udelay(1);
++
++ mr &= ~AT91C_AC97C_WRST;
++ ac97c_writel(chip, MR, mr);
++}
++
++static void snd_at91_ac97_destroy(struct snd_card *card)
++{
++ at91_ac97_t *chip = get_chip(card);
++
++ if (chip->irq != -1)
++ free_irq(chip->irq, chip);
++
++ if (chip->regs)
++ iounmap(chip->regs);
++}
++
++static int __devinit snd_at91_ac97_create(struct snd_card *card,
++ struct platform_device *pdev)
++{
++ static struct snd_ac97_bus_ops ops = {
++ .write = snd_at91_ac97_write,
++ .read = snd_at91_ac97_read,
++ .reset = snd_at91_ac97_warm_reset,
++ };
++
++ at91_ac97_t *chip = get_chip(card);
++ int irq, err = 0;
++
++
++
++ card->private_free = snd_at91_ac97_destroy;
++
++ spin_lock_init(&chip->lock);
++ chip->card = card;
++ chip->pdev = pdev;
++ chip->irq = -1;
++
++ if (!(platform_resource_flags(pdev, 0) & IORESOURCE_MEM)
++ || !(platform_resource_flags(pdev, 1) & IORESOURCE_IRQ))
++ return -ENODEV;
++
++ irq = platform_resource_start(pdev, 1);
++
++ err = request_irq(irq, snd_at91_ac97_interrupt, 0, "ac97", chip);
++ if (err) {
++ snd_printk(KERN_WARNING "unable to request IRQ%d\n", irq);
++ return err;
++ }
++
++ chip->irq = irq;
++ snd_printk(KERN_INFO "AC97C regs = %08X \n",
++ platform_resource_start(pdev, 0));
++ snd_printk(KERN_INFO "AC97C irq = %d \n", irq);
++
++ chip->regs = ioremap(platform_resource_start(pdev, 0),
++ platform_resource_len(pdev, 0));
++ if (!chip->regs) {
++ snd_printk(KERN_WARNING "unable to remap AC97C io memory\n");
++ return -ENOMEM;
++ }
++
++ snd_card_set_dev(card, &pdev->dev);
++
++ err = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus);
++
++ return err;
++}
++
++static int __devinit snd_at91_ac97_probe(struct platform_device *pdev)
++{
++ static int dev;
++ struct atmel_ac97_data *pdata = pdev->dev.platform_data;
++ struct snd_card *card;
++ at91_ac97_t *chip;
++ int err;
++
++ if (dev >= SNDRV_CARDS)
++ return -ENODEV;
++ if (!enable[dev]) {
++ dev++;
++ return -ENOENT;
++ }
++
++ card = snd_card_new(index[dev], id[dev], THIS_MODULE,
++ sizeof(at91_ac97_t));
++ if (!card)
++ return -ENOMEM;
++ chip = get_chip(card);
++
++ err = snd_at91_ac97_create(card, pdev);
++ if (err)
++ goto out_free_card;
++
++ /* Enable AC97 Controller clock*/
++ chip->reset_pin = pdata->reset_pin;
++ chip->ac97_clk = clk_get(NULL, "ac97_clk");
++ if (!chip->ac97_clk)
++ goto out_free_card;
++
++ clk_enable(chip->ac97_clk);
++
++ /* Perform a codec hard reset.*/
++ /* This also enables the AC97 Controller.*/
++ snd_at91_ac97_hard_reset(chip);
++
++ err = snd_at91_ac97_mixer_new(chip);
++ if (err)
++ goto out_free_card;
++
++ err = snd_at91_ac97_pcm_new(chip);
++ if (err)
++ goto out_free_card;
++
++ strcpy(card->driver, "ac97c");
++ strcpy(card->shortname, "Atmel AC97");
++ sprintf(card->longname, "Atmel AC97 Controller at %#lx, irq %i",
++ (unsigned long) platform_resource_start(pdev, 0),
++ (int) chip->irq);
++
++ err = snd_card_register(card);
++ if (err)
++ goto out_free_card;
++
++ dev_set_drvdata(&pdev->dev, card);
++ dev++;
++ return 0;
++
++out_free_card:
++ snd_card_free(card);
++ return err;
++}
++
++static int __devexit snd_at91_ac97_remove(struct platform_device *pdev)
++{
++ struct snd_card *card = dev_get_drvdata(&pdev->dev);
++ at91_ac97_t *chip = get_chip(card);
++
++
++ snd_card_free(card);
++
++ /* Disable AC97 Controller*/
++ ac97c_writel(chip, MR, 0);
++
++ /* Disable AC97 Controller clock*/
++ clk_disable(chip->ac97_clk);
++
++ dev_set_drvdata(&pdev->dev, NULL);
++
++ return 0;
++}
++
++static struct platform_driver at91_ac97_driver = {
++ .probe = snd_at91_ac97_probe,
++ .remove = __devexit_p(snd_at91_ac97_remove),
++ .driver =
++ {
++ .name = "ac97c",
++ }
++ ,
++};
++
++static int __init at91_ac97_init(void)
++{
++ return platform_driver_register(&at91_ac97_driver);
++}
++
++static void __exit at91_ac97_exit(void)
++{
++ platform_driver_unregister(&at91_ac97_driver);
++}
++
++module_init(at91_ac97_init);
++module_exit(at91_ac97_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION("Driver for Atmel AC97 Controller");
++MODULE_AUTHOR("Atmel");
+--- /dev/null
++++ linux-2.6.30/sound/arm/at91-ac97.h
+@@ -0,0 +1,295 @@
++/*
++ * at91-ac97.h -- Hardware definition for the ac97c peripheral
++ * in the ATMEL at91sam926x processor
++ *
++ * Copyright (C) 2005 SAN People
++ * Copyright (C) 2006 Atmel
++ *
++ * Author: Patrice Vilchez <patrice.vilchez@atmel.com>
++ * ATMEL CORP.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef __AC97C_H
++#define __AC97C_H
++
++/* -------------------------------------------------------- */
++/* AC97C ID definitions for AT91SAM926x */
++/* -------------------------------------------------------- */
++#ifndef AT91C_ID_AC97C
++#define AT91C_ID_AC97C 18 /**< AC97 Controller id */
++#endif /* AT91C_ID_AC97C */
++
++/* -------------------------------------------------------- */
++/* AC97C Base Address definitions for AT91SAM926x */
++/* -------------------------------------------------------- */
++#define AT91C_BASE_AC97C 0xFFFA0000 /**< AC97C base address */
++
++/* -------------------------------------------------------- */
++/* PIO definition for AC97C hardware peripheral */
++/* -------------------------------------------------------- */
++#define AT91C_PB1_AC97CK (1 << 1) /**< */
++#define AT91C_PB0_AC97FS (1 << 0) /**< */
++#define AT91C_PB3_AC97RX (1 << 3) /**< */
++#define AT91C_PB2_AC97TX (1 << 2) /**< */
++
++/* -------------------------------------------------------- */
++/* Register offset definition for AC97C hardware peripheral */
++/* -------------------------------------------------------- */
++#define AC97C_MR (0x0008) /**< Mode Register */
++#define AC97C_ICA (0x0010) /**< Input Channel AssignementRegister */
++#define AC97C_OCA (0x0014) /**< Output Channel Assignement Register */
++#define AC97C_CARHR (0x0020) /**< Channel A Receive Holding Register */
++#define AC97C_CATHR (0x0024) /**< Channel A Transmit Holding Register */
++#define AC97C_CASR (0x0028) /**< Channel A Status Register */
++#define AC97C_CAMR (0x002C) /**< Channel A Mode Register */
++#define AC97C_CBRHR (0x0030) /**< Channel B Receive Holding Register (optional) */
++#define AC97C_CBTHR (0x0034) /**< Channel B Transmit Holding Register (optional) */
++#define AC97C_CBSR (0x0038) /**< Channel B Status Register */
++#define AC97C_CBMR (0x003C) /**< Channel B Mode Register */
++#define AC97C_CORHR (0x0040) /**< COdec Transmit Holding Register */
++#define AC97C_COTHR (0x0044) /**< COdec Transmit Holding Register */
++#define AC97C_COSR (0x0048) /**< CODEC Status Register */
++#define AC97C_COMR (0x004C) /**< CODEC Mask Status Register */
++#define AC97C_SR (0x0050) /**< Status Register */
++#define AC97C_IER (0x0054) /**< Interrupt Enable Register */
++#define AC97C_IDR (0x0058) /**< Interrupt Disable Register */
++#define AC97C_IMR (0x005C) /**< Interrupt Mask Register */
++#define AC97C_VERSION (0x00FC) /**< Version Register */
++
++/* -------------------------------------------------------- */
++/* Bitfields definition for AC97C hardware peripheral */
++/* -------------------------------------------------------- */
++/* --- Register AC97C_MR */
++#define AT91C_AC97C_ENA (0x1 << 0) /**< (AC97C) AC97 Controller Global Enable */
++#define AT91C_AC97C_WRST (0x1 << 1) /**< (AC97C) Warm Reset */
++#define AT91C_AC97C_VRA (0x1 << 2) /**< (AC97C) Variable RAte (for Data Slots) */
++/* --- Register AC97C_ICA */
++#define AT91C_AC97C_CHID3 (0x7 << 0) /**< (AC97C) Channel Id for the input slot 3 */
++#define AT91C_AC97C_CHID3_NONE 0x0 /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CA 0x1 /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CB 0x2 /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CC 0x3 /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4 (0x7 << 3) /**< (AC97C) Channel Id for the input slot 4 */
++#define AT91C_AC97C_CHID4_NONE (0x0 << 3) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CA (0x1 << 3) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CB (0x2 << 3) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CC (0x3 << 3) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5 (0x7 << 6) /**< (AC97C) Channel Id for the input slot 5 */
++#define AT91C_AC97C_CHID5_NONE (0x0 << 6) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CA (0x1 << 6) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CB (0x2 << 6) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CC (0x3 << 6) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6 (0x7 << 9) /**< (AC97C) Channel Id for the input slot 6 */
++#define AT91C_AC97C_CHID6_NONE (0x0 << 9) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CA (0x1 << 9) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CB (0x2 << 9) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CC (0x3 << 9) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7 (0x7 << 12) /**< (AC97C) Channel Id for the input slot 7 */
++#define AT91C_AC97C_CHID7_NONE (0x0 << 12) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CA (0x1 << 12) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CB (0x2 << 12) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CC (0x3 << 12) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8 (0x7 << 15) /**< (AC97C) Channel Id for the input slot 8 */
++#define AT91C_AC97C_CHID8_NONE (0x0 << 15) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CA (0x1 << 15) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CB (0x2 << 15) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CC (0x3 << 15) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9 (0x7 << 18) /**< (AC97C) Channel Id for the input slot 9 */
++#define AT91C_AC97C_CHID9_NONE (0x0 << 18) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CA (0x1 << 18) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CB (0x2 << 18) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CC (0x3 << 18) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10 (0x7 << 21) /**< (AC97C) Channel Id for the input slot 10 */
++#define AT91C_AC97C_CHID10_NONE (0x0 << 21) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CA (0x1 << 21) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CB (0x2 << 21) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CC (0x3 << 21) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11 (0x7 << 24) /**< (AC97C) Channel Id for the input slot 11 */
++#define AT91C_AC97C_CHID11_NONE (0x0 << 24) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CA (0x1 << 24) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CB (0x2 << 24) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CC (0x3 << 24) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12 (0x7 << 27) /**< (AC97C) Channel Id for the input slot 12 */
++#define AT91C_AC97C_CHID12_NONE (0x0 << 27) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CA (0x1 << 27) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CB (0x2 << 27) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CC (0x3 << 27) /**< (AC97C) Channel C data will be transmitted during this slot */
++/* --- Register AC97C_OCA */
++#define AT91C_AC97C_CHID3 (0x7 << 0) /**< (AC97C) Channel Id for the input slot 3 */
++#define AT91C_AC97C_CHID3_NONE 0x0 /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CA 0x1 /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CB 0x2 /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID3_CC 0x3 /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4 (0x7 << 3) /**< (AC97C) Channel Id for the input slot 4 */
++#define AT91C_AC97C_CHID4_NONE (0x0 << 3) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CA (0x1 << 3) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CB (0x2 << 3) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID4_CC (0x3 << 3) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5 (0x7 << 6) /**< (AC97C) Channel Id for the input slot 5 */
++#define AT91C_AC97C_CHID5_NONE (0x0 << 6) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CA (0x1 << 6) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CB (0x2 << 6) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID5_CC (0x3 << 6) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6 (0x7 << 9) /**< (AC97C) Channel Id for the input slot 6 */
++#define AT91C_AC97C_CHID6_NONE (0x0 << 9) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CA (0x1 << 9) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CB (0x2 << 9) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID6_CC (0x3 << 9) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7 (0x7 << 12) /**< (AC97C) Channel Id for the input slot 7 */
++#define AT91C_AC97C_CHID7_NONE (0x0 << 12) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CA (0x1 << 12) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CB (0x2 << 12) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID7_CC (0x3 << 12) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8 (0x7 << 15) /**< (AC97C) Channel Id for the input slot 8 */
++#define AT91C_AC97C_CHID8_NONE (0x0 << 15) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CA (0x1 << 15) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CB (0x2 << 15) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID8_CC (0x3 << 15) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9 (0x7 << 18) /**< (AC97C) Channel Id for the input slot 9 */
++#define AT91C_AC97C_CHID9_NONE (0x0 << 18) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CA (0x1 << 18) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CB (0x2 << 18) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID9_CC (0x3 << 18) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10 (0x7 << 21) /**< (AC97C) Channel Id for the input slot 10 */
++#define AT91C_AC97C_CHID10_NONE (0x0 << 21) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CA (0x1 << 21) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CB (0x2 << 21) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID10_CC (0x3 << 21) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11 (0x7 << 24) /**< (AC97C) Channel Id for the input slot 11 */
++#define AT91C_AC97C_CHID11_NONE (0x0 << 24) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CA (0x1 << 24) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CB (0x2 << 24) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID11_CC (0x3 << 24) /**< (AC97C) Channel C data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12 (0x7 << 27) /**< (AC97C) Channel Id for the input slot 12 */
++#define AT91C_AC97C_CHID12_NONE (0x0 << 27) /**< (AC97C) No data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CA (0x1 << 27) /**< (AC97C) Channel A data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CB (0x2 << 27) /**< (AC97C) Channel B data will be transmitted during this slot */
++#define AT91C_AC97C_CHID12_CC (0x3 << 27) /**< (AC97C) Channel C data will be transmitted during this slot */
++/* --- Register AC97C_CARHR */
++#define AT91C_AC97C_RDATA (0xFFFFF << 0) /**< (AC97C) Receive data */
++/* --- Register AC97C_CATHR */
++#define AT91C_AC97C_TDATA (0xFFFFF << 0) /**< (AC97C) Transmit data */
++/* --- Register AC97C_CASR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++#define AT91C_AC97C_OVRUN (0x1 << 5) /**< (AC97C) */
++#define AT91C_AC97C_ENDTX (0x1 << 10) /**< (AC97C) */
++#define AT91C_AC97C_TXBUFE (0x1 << 11) /**< (AC97C) */
++#define AT91C_AC97C_ENDRX (0x1 << 14) /**< (AC97C) */
++#define AT91C_AC97C_RXBUFF (0x1 << 15) /**< (AC97C) */
++/* --- Register AC97C_CAMR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++#define AT91C_AC97C_OVRUN (0x1 << 5) /**< (AC97C) */
++#define AT91C_AC97C_ENDTX (0x1 << 10) /**< (AC97C) */
++#define AT91C_AC97C_TXBUFE (0x1 << 11) /**< (AC97C) */
++#define AT91C_AC97C_ENDRX (0x1 << 14) /**< (AC97C) */
++#define AT91C_AC97C_RXBUFF (0x1 << 15) /**< (AC97C) */
++#define AT91C_AC97C_SIZE (0x3 << 16) /**< (AC97C) */
++#define AT91C_AC97C_SIZE_20_BITS (0x0 << 16) /**< (AC97C) Data size is 20 bits */
++#define AT91C_AC97C_SIZE_18_BITS (0x1 << 16) /**< (AC97C) Data size is 18 bits */
++#define AT91C_AC97C_SIZE_16_BITS (0x2 << 16) /**< (AC97C) Data size is 16 bits */
++#define AT91C_AC97C_SIZE_10_BITS (0x3 << 16) /**< (AC97C) Data size is 10 bits */
++#define AT91C_AC97C_CEM (0x1 << 18) /**< (AC97C) */
++#define AT91C_AC97C_CEN (0x1 << 21) /**< (AC97C) */
++#define AT91C_AC97C_PDCEN (0x1 << 22) /**< (AC97C) */
++/* --- Register AC97C_CBRHR */
++#define AT91C_AC97C_RDATA (0xFFFFF << 0) /**< (AC97C) Receive data */
++/* --- Register AC97C_CBTHR */
++#define AT91C_AC97C_TDATA (0xFFFFF << 0) /**< (AC97C) Transmit data */
++/* --- Register AC97C_CBSR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++#define AT91C_AC97C_OVRUN (0x1 << 5) /**< (AC97C) */
++/* --- Register AC97C_CBMR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++#define AT91C_AC97C_OVRUN (0x1 << 5) /**< (AC97C) */
++#define AT91C_AC97C_SIZE (0x3 << 16) /**< (AC97C) */
++#define AT91C_AC97C_SIZE_20_BITS (0x0 << 16) /**< (AC97C) Data size is 20 bits */
++#define AT91C_AC97C_SIZE_18_BITS (0x1 << 16) /**< (AC97C) Data size is 18 bits */
++#define AT91C_AC97C_SIZE_16_BITS (0x2 << 16) /**< (AC97C) Data size is 16 bits */
++#define AT91C_AC97C_SIZE_10_BITS (0x3 << 16) /**< (AC97C) Data size is 10 bits */
++#define AT91C_AC97C_CEM (0x1 << 18) /**< (AC97C) */
++#define AT91C_AC97C_CEN (0x1 << 21) /**< (AC97C) */
++/* --- Register AC97C_CORHR */
++#define AT91C_AC97C_SDATA (0xFFFF << 0) /**< (AC97C) Status Data */
++/* --- Register AC97C_COTHR */
++#define AT91C_AC97C_CDATA (0xFFFF << 0) /**< (AC97C) Command Data */
++#define AT91C_AC97C_CADDR (0x7F << 16) /**< (AC97C) COdec control register index */
++#define AT91C_AC97C_READ (0x1 << 23) /**< (AC97C) Read/Write command */
++/* --- Register AC97C_COSR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++/* --- Register AC97C_COMR */
++#define AT91C_AC97C_TXRDY (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_TXEMPTY (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_UNRUN (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_RXRDY (0x1 << 4) /**< (AC97C) */
++/* --- Register AC97C_SR */
++#define AT91C_AC97C_SOF (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_WKUP (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_COEVT (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_CAEVT (0x1 << 3) /**< (AC97C) */
++#define AT91C_AC97C_CBEVT (0x1 << 4) /**< (AC97C) */
++/* --- Register AC97C_IER */
++#define AT91C_AC97C_SOF (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_WKUP (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_COEVT (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_CAEVT (0x1 << 3) /**< (AC97C) */
++#define AT91C_AC97C_CBEVT (0x1 << 4) /**< (AC97C) */
++/* --- Register AC97C_IDR */
++#define AT91C_AC97C_SOF (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_WKUP (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_COEVT (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_CAEVT (0x1 << 3) /**< (AC97C) */
++#define AT91C_AC97C_CBEVT (0x1 << 4) /**< (AC97C) */
++/* --- Register AC97C_IMR */
++#define AT91C_AC97C_SOF (0x1 << 0) /**< (AC97C) */
++#define AT91C_AC97C_WKUP (0x1 << 1) /**< (AC97C) */
++#define AT91C_AC97C_COEVT (0x1 << 2) /**< (AC97C) */
++#define AT91C_AC97C_CAEVT (0x1 << 3) /**< (AC97C) */
++#define AT91C_AC97C_CBEVT (0x1 << 4) /**< (AC97C) */
++
++#define platform_num_resources(dev) ((dev)->num_resources)
++#define platform_resource_start(dev, i) ((dev)->resource[(i)].start)
++#define platform_resource_end(dev, i) ((dev)->resource[(i)].end)
++#define platform_resource_flags(dev, i) ((dev)->resource[(i)].flags)
++#define platform_resource_len(dev, i) \
++ (platform_resource_end((dev), (i)) - \
++ platform_resource_start((dev), (i)) + 1)
++
++#define get_chip(card) ((at91_ac97_t *)(card)->private_data)
++
++#define ac97c_writel(chip, reg, val) \
++ writel((val), (chip)->regs + AC97C_##reg)
++
++#define ac97c_readl(chip, reg) \
++ readl((chip)->regs + AC97C_##reg)
++
++#endif /* __AC97C_H */
diff --git a/recipes/linux/linux-2.6.30/calamari/defconfig b/recipes/linux/linux-2.6.30/calamari/defconfig
new file mode 100644
index 0000000000..bedde49d4b
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/calamari/defconfig
@@ -0,0 +1,1854 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.30
+# Wed Jul 15 10:59:41 2009
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_E500=y
+# CONFIG_PPC_E500MC is not set
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+CONFIG_FSL_EMB_PERFMON=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+CONFIG_PPC_MMU_NOHASH=y
+CONFIG_PPC_BOOK3E_MMU=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DTC=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+# CONFIG_AUDITSYSCALL is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_GROUP_SCHED=y
+# CONFIG_FAIR_GROUP_SCHED is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+# CONFIG_STRIP_ASM_SYMS 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_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_CLK=y
+# CONFIG_SLOW_WORK is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+# CONFIG_FREEZER is not set
+CONFIG_PPC_MSI_BITMAP=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_MPC85xx=y
+CONFIG_MPC8540_ADS=y
+CONFIG_MPC8560_ADS=y
+CONFIG_MPC85xx_CDS=y
+CONFIG_MPC85xx_MDS=y
+CONFIG_MPC8536_DS=y
+CONFIG_MPC85xx_DS=y
+CONFIG_SOCRATES=y
+CONFIG_KSI8560=y
+CONFIG_STX_GP3=y
+CONFIG_TQM8540=y
+CONFIG_TQM8541=y
+CONFIG_TQM8548=y
+CONFIG_TQM8555=y
+CONFIG_TQM8560=y
+CONFIG_SBC8548=y
+# CONFIG_SBC8560 is not set
+CONFIG_TQM85xx=y
+# CONFIG_IPIC is not set
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+CONFIG_PPC_I8259=y
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+# CONFIG_CPU_FREQ_STAT is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU Frequency drivers
+#
+CONFIG_QUICC_ENGINE=y
+CONFIG_QE_GPIO=y
+CONFIG_CPM2=y
+CONFIG_FSL_ULI1575=y
+CONFIG_CPM=y
+CONFIG_MPC8xxx_GPIO=y
+# CONFIG_SIMPLE_GPIO is not set
+
+#
+# Kernel options
+#
+CONFIG_HIGHMEM=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_SCHED_HRTICK=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_MATH_EMULATION=y
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
+# CONFIG_PPC_256K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_EXTRA_TARGETS=""
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SECCOMP is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_FSL_PCI=y
+CONFIG_PPC_PCI_CHOICE=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+# CONFIG_PCIEASPM is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_LEGACY is not set
+CONFIG_PCI_DEBUG=y
+# CONFIG_PCI_STUB is not set
+# CONFIG_PCI_IOV is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_LOWMEM_CAM_NUM=3
+CONFIG_PAGE_OFFSET=0xc0000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_PHYSICAL_START=0x00000000
+CONFIG_PHYSICAL_ALIGN=0x04000000
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=m
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=y
+CONFIG_NET_IPGRE=y
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_ARPD=y
+# 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=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+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=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
+CONFIG_INET6_XFRM_MODE_BEET=y
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA 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
+# CONFIG_PHONET is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_LIB80211 is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+CONFIG_OF_DEVICE=y
+CONFIG_OF_GPIO=y
+CONFIG_OF_I2C=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# 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=y
+# 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=131072
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+CONFIG_EEPROM_LEGACY=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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=y
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+CONFIG_SCSI_LOGGING=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_CXGB3_ISCSI 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_ADVANSYS 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_MPT2SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_FCOE is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR 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
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_SIL24 is not set
+CONFIG_SATA_FSL=y
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+CONFIG_PATA_ALI=y
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_DUMMY=y
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+CONFIG_DAVICOM_PHY=y
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+CONFIG_CICADA_PHY=y
+CONFIG_VITESSE_PHY=y
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_MDIO_BITBANG is not set
+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_ETHOC is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
+# CONFIG_ATL2 is not set
+CONFIG_FS_ENET=y
+CONFIG_FS_ENET_HAS_SCC=y
+CONFIG_FS_ENET_HAS_FCC=y
+# CONFIG_FS_ENET_MDIO_FCC is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_IGBVF 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_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_FSL_PQ_MDIO=y
+CONFIG_GIANFAR=y
+CONFIG_UCC_GETH=y
+# CONFIG_UGETH_MAGIC_PACKET is not set
+# CONFIG_UGETH_TX_ON_DEMAND is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+# CONFIG_JME is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+CONFIG_CHELSIO_T3_DEPENDS=y
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_ENIC is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_VXGE is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
+# CONFIG_SFC is not set
+# CONFIG_BE2NET is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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 is not set
+# 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_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# 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_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_XILINX_XPS_PS2 is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_CPM is not set
+# CONFIG_SERIAL_JSM is not set
+# CONFIG_SERIAL_OF_PLATFORM is not set
+CONFIG_SERIAL_QE=m
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_UDBG is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+CONFIG_NVRAM=y
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_ISCH is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+CONFIG_I2C_CPM=m
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Graphics adapter I2C/DDC channel drivers
+#
+# CONFIG_I2C_VOODOO3 is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+# CONFIG_GPIO_XILINX is not set
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_BT8XX is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_UCB1400_CORE is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MC44S803=m
+# CONFIG_DVB_DYNAMIC_MINORS is not set
+CONFIG_DVB_CAPTURE_DRIVERS=y
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+# CONFIG_TTPCI_EEPROM is not set
+# CONFIG_DVB_BUDGET_CORE is not set
+
+#
+# Supported USB Adapters
+#
+# CONFIG_DVB_USB is not set
+# CONFIG_DVB_TTUSB_BUDGET is not set
+# CONFIG_DVB_TTUSB_DEC is not set
+# CONFIG_DVB_SIANO_SMS1XXX is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_FLEXCOP is not set
+
+#
+# Supported BT878 Adapters
+#
+
+#
+# Supported Pluto2 Adapters
+#
+# CONFIG_DVB_PLUTO2 is not set
+
+#
+# Supported SDMC DM1105 Adapters
+#
+# CONFIG_DVB_DM1105 is not set
+
+#
+# Supported DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_HRTIMER is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_VMASTER=y
+CONFIG_SND_AC97_CODEC=y
+CONFIG_SND_DRIVERS=y
+# 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
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_PCI=y
+# 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_AW2 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_OXYGEN is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_CS5530 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_INDIGOIOX is not set
+# CONFIG_SND_INDIGODJX 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_HIFIER is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+CONFIG_SND_INTEL8X0=y
+# 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_VIRTUOSO is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+CONFIG_SND_PPC=y
+CONFIG_SND_USB=y
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_USX2Y is not set
+# CONFIG_SND_USB_CAIAQ is not set
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=y
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+# CONFIG_DRAGONRISE_FF is not set
+CONFIG_HID_EZKEY=y
+# CONFIG_HID_KYE is not set
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_KENSINGTON is not set
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_NTRIG is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+CONFIG_THRUSTMASTER_FF=m
+CONFIG_ZEROPLUS_FF=m
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_EHCI_HCD_PPC_OF=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PPC_OF=y
+CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
+CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
+CONFIG_USB_OHCI_HCD_PCI=y
+CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
+CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_FHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_EDAC=y
+
+#
+# Reporting subsystems
+#
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_MM_EDAC=y
+CONFIG_EDAC_MPC85XX=y
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_GENERIC is not set
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_FSL_DMA=y
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+# CONFIG_NET_DMA is not set
+# CONFIG_ASYNC_TX_DMA is not set
+# CONFIG_DMATEST is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# 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_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4_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_FILE_LOCKING=y
+CONFIG_XFS_FS=y
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_BTRFS_FS=y
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+CONFIG_VXFS_FS=m
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+# CONFIG_ROMFS_FS is not set
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# 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 is not set
+# 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=m
+# CONFIG_DLM is not set
+CONFIG_UCC_SLOW=y
+CONFIG_UCC_FAST=y
+CONFIG_UCC=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
+CONFIG_NLATTR=y
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS 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_HIGHMEM is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_TRACING_SUPPORT=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_EVENT_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_KMEMTRACE is not set
+# CONFIG_WORKQUEUE_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_CODE_PATCHING_SELFTEST is not set
+# CONFIG_FTR_FIXUP_SELFTEST is not set
+# CONFIG_MSI_BITMAP_SELFTEST is not set
+# CONFIG_XMON is not set
+# CONFIG_IRQSTACKS is not set
+CONFIG_VIRQ_DEBUG=y
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=y
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+CONFIG_CRYPTO_DEV_TALITOS=y
+CONFIG_PPC_CLOCK=y
+CONFIG_PPC_LIB_RHEAP=y
+CONFIG_VIRTUALIZATION=y
+# CONFIG_KVM_E500 is not set
+# CONFIG_VIRTIO_PCI is not set
+# CONFIG_VIRTIO_BALLOON is not set
diff --git a/recipes/linux/linux-davinci_2.6.30.bb b/recipes/linux/linux-davinci_2.6.30.bb
new file mode 100644
index 0000000000..63c87e820b
--- /dev/null
+++ b/recipes/linux/linux-davinci_2.6.30.bb
@@ -0,0 +1,34 @@
+require linux.inc
+
+DESCRIPTION = "Linux kernel for Davinci processors"
+KERNEL_IMAGETYPE = "uImage"
+
+COMPATIBLE_MACHINE = "(dm6446-evm|dm6467-evm|dm355-evm|davinci-sffsdr|dm355-leopard)"
+
+DEFAULT_PREFERENCE = "1"
+
+SRCREV = "5212151f26e688416faac9f6f33ddd958f7de96c"
+
+# The main PR is now using MACHINE_KERNEL_PR, for davinci see conf/machine/include/davinci.inc
+PV = "2.6.30-${PR}+gitr${SRCREV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git;protocol=git \
+ file://defconfig"
+
+# Need checking
+SRC_URI_append_davinci-sffsdr = " \
+ file://0001-USB-musb-cppi-bugfixes.patch;patch=1 \
+ file://0002-ARM-Mark-unsupported-syscalls-as-IGNORE.patch;patch=1 \
+ file://0003-Add-macros-for-enabling-a-UART.patch;patch=1 \
+ file://0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch;patch=1 \
+ file://0005-Add-DAS-Mini-DAS-and-AFE-USB-machine-types.patch;patch=1 \
+ file://0006-ALSA-ASoC-DaVinci-Fix-SFFSDR-compilation-error.patch;patch=1 \
+ file://0007-ALSA-ASoC-Davinci-Fix-SFFSDR-FPGA-module-codec-FS.patch;patch=1 \
+ file://0008-ALSA-ASoC-Davinci-Fix-incorrect-machine-type-for.patch;patch=1 \
+ file://0009-sound-ASoC-Fix-DaVinci-module-unload-error.patch;patch=1 \
+ file://0010-Add-generic-FPGA-bitstream-loader-driver.patch;patch=1 \
+ file://0011-Add-lyrvpss-example-driver-for-the-SFFSDR-board.patch;patch=1 \
+ file://0012-Update-SFFSDR-to-support-FPGA-and-lyrvpss-drivers.patch;patch=1 \
+ "
+
+S = "${WORKDIR}/git"
diff --git a/recipes/linux/linux-davinci_git.bb b/recipes/linux/linux-davinci_git.bb
index 7af90fa440..a39ba10d7a 100644
--- a/recipes/linux/linux-davinci_git.bb
+++ b/recipes/linux/linux-davinci_git.bb
@@ -7,10 +7,10 @@ COMPATIBLE_MACHINE = "(dm6446-evm|dm6467-evm|dm355-evm|davinci-sffsdr|dm355-leop
DEFAULT_PREFERENCE = "1"
-SRCREV = "03022e38318bef016836dae71c70b9ea975723e7"
+SRCREV = "5bbb6571043c7e3a1d73b874334037a64d10612f"
# The main PR is now using MACHINE_KERNEL_PR, for davinci see conf/machine/include/davinci.inc
-PV = "2.6.29+2.6.30-rc7-${PR}+gitr${SRCREV}"
+PV = "2.6.30-${PR}+gitr${SRCREV}"
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git;protocol=git;branch=staging/vpfe \
file://defconfig"
diff --git a/recipes/linux/linux-mainstone/0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch b/recipes/linux/linux-mainstone/0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch
new file mode 100644
index 0000000000..9d7020d9f1
--- /dev/null
+++ b/recipes/linux/linux-mainstone/0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch
@@ -0,0 +1,15 @@
+Index: linux-2.6.24/include/linux/time.h
+===================================================================
+--- a/include/linux/time.h
++++ b/include/linux/time.h
+@@ -172,6 +172,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
+ {
+ ns += a->tv_nsec;
+ while(unlikely(ns >= NSEC_PER_SEC)) {
++ /* The following asm() prevents the compiler from
++ * optimising this loop into a modulo operation. */
++ asm("" : "+r"(ns));
++
+ ns -= NSEC_PER_SEC;
+ a->tv_sec++;
+ }
diff --git a/recipes/linux/linux-mainstone_2.6.25.bb b/recipes/linux/linux-mainstone_2.6.25.bb
index d9599ef76c..f2d972dd78 100644
--- a/recipes/linux/linux-mainstone_2.6.25.bb
+++ b/recipes/linux/linux-mainstone_2.6.25.bb
@@ -3,11 +3,12 @@ require linux.inc
SECTION = "kernel"
DESCRIPTION = "Linux kernel for the Mainstone (PXA270 ref design)"
LICENSE = "GPL"
-PR = "r0"
+PR = "r1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2 \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/v2.6.25/patch-2.6.25-rc4.bz2;patch=1 \
file://mainstone-keypad.patch;patch=1 \
+ file://0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch;patch=1 \
file://defconfig"
S = "${WORKDIR}/linux-2.6.24"
diff --git a/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig b/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig
index 1aa7cf57ac..99be5246a6 100644
--- a/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig
+++ b/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29-omap1
-# Fri May 29 14:47:52 2009
+# Thu Jul 16 15:21:36 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -32,6 +32,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
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
@@ -189,8 +190,7 @@ CONFIG_ARCH_OMAP3=y
#
# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
-CONFIG_OMAP_SMARTREFLEX=y
-# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+# CONFIG_OMAP_SMARTREFLEX is not set
CONFIG_OMAP_RESET_CLOCKS=y
CONFIG_OMAP_BOOT_TAG=y
CONFIG_OMAP_BOOT_REASON=y
@@ -199,7 +199,7 @@ CONFIG_OMAP_BOOT_REASON=y
# CONFIG_OMAP_MUX is not set
CONFIG_OMAP_MCBSP=y
# CONFIG_OMAP_MBOX_FWK is not set
-# CONFIG_OMAP_IOMMU is not set
+CONFIG_OMAP_IOMMU=y
# CONFIG_OMAP_MPU_TIMER is not set
CONFIG_OMAP_32K_TIMER=y
CONFIG_OMAP_32K_TIMER_HZ=128
@@ -217,9 +217,9 @@ CONFIG_ARCH_OMAP3430=y
# CONFIG_MACH_NOKIA_RX51 is not set
# CONFIG_MACH_OMAP_LDP is not set
# CONFIG_MACH_OMAP_3430SDP is not set
-# CONFIG_MACH_OMAP3EVM is not set
+CONFIG_MACH_OMAP3EVM=y
CONFIG_MACH_OMAP3_BEAGLE=y
-# CONFIG_MACH_OVERO is not set
+CONFIG_MACH_OVERO=y
# CONFIG_MACH_OMAP3_PANDORA is not set
#
@@ -268,7 +268,7 @@ CONFIG_VMSPLIT_3G=y
# CONFIG_VMSPLIT_2G is not set
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT=y
CONFIG_HZ=128
CONFIG_AEABI=y
# CONFIG_OABI_COMPAT is not set
@@ -1034,8 +1034,43 @@ CONFIG_MACVLAN=m
CONFIG_EQUALIZER=m
CONFIG_TUN=m
CONFIG_VETH=m
-# CONFIG_NET_ETHERNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
@@ -1471,6 +1506,7 @@ CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_V4L1=m
CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_DMA_SG=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEOBUF_DVB=m
CONFIG_VIDEO_IR=m
@@ -1494,7 +1530,8 @@ CONFIG_VIDEO_VIVI=m
# CONFIG_VIDEO_SAA5246A is not set
# CONFIG_VIDEO_SAA5249 is not set
# CONFIG_VIDEO_AU0828 is not set
-# CONFIG_VIDEO_OMAP3 is not set
+CONFIG_VIDEO_OMAP3=m
+CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=m
# CONFIG_SOC_CAMERA is not set
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
@@ -1818,6 +1855,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_SOC=y
CONFIG_SND_OMAP_SOC=y
CONFIG_SND_OMAP_SOC_MCBSP=y
+# CONFIG_SND_OMAP_SOC_OVERO is not set
CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
@@ -2514,6 +2552,7 @@ CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
@@ -2551,6 +2590,7 @@ CONFIG_TRACING=y
#
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_CONTEXT_SWITCH_TRACER is not set
# CONFIG_BOOT_TRACER is not set
diff --git a/recipes/linux/linux-omap-2.6.29/beagleboard/tincantools-puppy.diff b/recipes/linux/linux-omap-2.6.29/beagleboard/tincantools-puppy.diff
new file mode 100644
index 0000000000..c7856731e5
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/beagleboard/tincantools-puppy.diff
@@ -0,0 +1,66 @@
+--- /tmp/board-omap3beagle.c 2009-07-01 01:06:44.000000000 +0200
++++ git/arch/arm/mach-omap2/board-omap3beagle.c 2009-07-01 01:06:50.000000000 +0200
+@@ -125,6 +125,13 @@
+ .wires = 8,
+ .gpio_wp = 29,
+ },
++ {
++ .mmc = 2,
++ .wires = 4,
++ .gpio_wp = 141,
++ .gpio_cd = 162,
++ .transceiver = true,
++ },
+ {} /* Terminator */
+ };
+
+@@ -132,6 +139,11 @@
+ .supply = "vmmc",
+ };
+
++static struct regulator_consumer_supply beagle_vmmc2_supply = {
++ .supply = "vmmc",
++};
++
++
+ static struct regulator_consumer_supply beagle_vsim_supply = {
+ .supply = "vmmc_aux",
+ };
+@@ -148,6 +160,7 @@
+
+ /* link regulators to MMC adapters */
+ beagle_vmmc1_supply.dev = mmc[0].dev;
++ beagle_vmmc2_supply.dev = mmc[1].dev;
+ beagle_vsim_supply.dev = mmc[0].dev;
+
+ /* REVISIT: need ehci-omap hooks for external VBUS
+@@ -209,6 +222,21 @@
+ .consumer_supplies = &beagle_vmmc1_supply,
+ };
+
++/* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */
++static struct regulator_init_data beagle_vmmc2 = {
++ .constraints = {
++ .min_uV = 2700000,
++ .max_uV = 3150000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
++ | REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &beagle_vmmc2_supply,
++};
++
+ /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
+ static struct regulator_init_data beagle_vsim = {
+ .constraints = {
+@@ -284,6 +312,7 @@
+ .gpio = &beagle_gpio_data,
+ .power = &beagle_power_data,
+ .vmmc1 = &beagle_vmmc1,
++ .vmmc2 = &beagle_vmmc2,
+ .vsim = &beagle_vsim,
+ .vdac = &beagle_vdac,
+ .vpll2 = &beagle_vpll2,
diff --git a/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch b/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch
deleted file mode 100644
index 902f87943d..0000000000
--- a/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From 742cc1e62f0d04333c51630f3020da000aeb6de1 Mon Sep 17 00:00:00 2001
-From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
-Date: Mon, 2 Mar 2009 19:36:26 +0200
-Subject: [PATCH] omap3: Add base address definitions and resources for OMAP 3 ISP
-
-This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14]
-OMAP34XX: CAM: Resources fixes".
-
-Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
----
- arch/arm/mach-omap2/devices.c | 66 ++++++++++++++++++++++++---
- arch/arm/plat-omap/include/mach/omap34xx.h | 28 +++++++++++-
- 2 files changed, 85 insertions(+), 9 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
-index dad4528..2568b0c 100644
---- a/arch/arm/mach-omap2/devices.c
-+++ b/arch/arm/mach-omap2/devices.c
-@@ -56,10 +56,60 @@ static inline void omap_init_camera(void)
-
- #elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
-
--static struct resource cam_resources[] = {
-+static struct resource omap3isp_resources[] = {
-+ {
-+ .start = OMAP3430_ISP_BASE,
-+ .end = OMAP3430_ISP_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_CBUFF_BASE,
-+ .end = OMAP3430_ISP_CBUFF_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_CCP2_BASE,
-+ .end = OMAP3430_ISP_CCP2_END,
-+ .flags = IORESOURCE_MEM,
-+ },
- {
-- .start = OMAP34XX_CAMERA_BASE,
-- .end = OMAP34XX_CAMERA_BASE + 0x1B70,
-+ .start = OMAP3430_ISP_CCDC_BASE,
-+ .end = OMAP3430_ISP_CCDC_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_HIST_BASE,
-+ .end = OMAP3430_ISP_HIST_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_H3A_BASE,
-+ .end = OMAP3430_ISP_H3A_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_PREV_BASE,
-+ .end = OMAP3430_ISP_PREV_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_RESZ_BASE,
-+ .end = OMAP3430_ISP_RESZ_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_SBL_BASE,
-+ .end = OMAP3430_ISP_SBL_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_CSI2A_BASE,
-+ .end = OMAP3430_ISP_CSI2A_END,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ {
-+ .start = OMAP3430_ISP_CSI2PHY_BASE,
-+ .end = OMAP3430_ISP_CSI2PHY_END,
- .flags = IORESOURCE_MEM,
- },
- {
-@@ -68,16 +118,16 @@ static struct resource cam_resources[] = {
- }
- };
-
--static struct platform_device omap_cam_device = {
-- .name = "omap34xxcam",
-+static struct platform_device omap3isp_device = {
-+ .name = "omap3isp",
- .id = -1,
-- .num_resources = ARRAY_SIZE(cam_resources),
-- .resource = cam_resources,
-+ .num_resources = ARRAY_SIZE(omap3isp_resources),
-+ .resource = omap3isp_resources,
- };
-
- static inline void omap_init_camera(void)
- {
-- platform_device_register(&omap_cam_device);
-+ platform_device_register(&omap3isp_device);
- }
- #else
- static inline void omap_init_camera(void)
-diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h
-index 27a1e45..3bfbdf7 100644
---- a/arch/arm/plat-omap/include/mach/omap34xx.h
-+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
-@@ -49,6 +49,33 @@
- #define OMAP343X_CTRL_BASE OMAP343X_SCM_BASE
-
- #define OMAP34XX_IC_BASE 0x48200000
-+
-+#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000)
-+#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100)
-+#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400)
-+#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600)
-+#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00)
-+#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00)
-+#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00)
-+#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000)
-+#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200)
-+#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400)
-+#define OMAP3430_ISP_CSI2A_BASE (OMAP3430_ISP_BASE + 0x1800)
-+#define OMAP3430_ISP_CSI2PHY_BASE (OMAP3430_ISP_BASE + 0x1970)
-+
-+#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F)
-+#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077)
-+#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF)
-+#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7)
-+#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047)
-+#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F)
-+#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F)
-+#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB)
-+#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB)
-+#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F)
-+#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F)
-+#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007)
-+
- #define OMAP34XX_IVA_INTC_BASE 0x40000000
- #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000)
- #define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000)
-@@ -56,7 +83,6 @@
- #define OMAP34XX_SR1_BASE 0x480C9000
- #define OMAP34XX_SR2_BASE 0x480CB000
-
--#define OMAP34XX_CAMERA_BASE (L4_34XX_BASE + 0xBC000)
- #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
-
-
---
-1.5.6.5
-
diff --git a/recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch b/recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch
new file mode 100644
index 0000000000..3390599292
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch
@@ -0,0 +1,1890 @@
+From 38f3cd5564a466e5251fc2ff47e0504148922304 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 17:18:56 +0530
+Subject: [PATCH 23/26] OMAP-Resizer: Basic Resizer refreshed with latest gitorious tree
+
+This is same resizer driver patch posted by Sergio onto
+mailing list quite a some time back. This commit refreshes
+the same patch on top of latest gitorious.org tree.
+
+List of New/Modified files:
+ modified: drivers/media/video/Kconfig
+ modified: drivers/media/video/isp/Makefile
+ modified: drivers/media/video/isp/isp.c
+ modified: drivers/media/video/isp/ispreg.h
+ new file: drivers/media/video/isp/omap_resizer.c
+ new file: include/linux/omap_resizer.h
+
+TODO:
+ - Resizer driver needs to be independent from camera and ISP
+ - Custom patches implemented ontop of PSP1.0.2 release
+ to fix some V4L2-buf layer issues.
+ -
+---
+ drivers/media/video/Kconfig | 7 +
+ drivers/media/video/isp/Makefile | 4 +
+ drivers/media/video/isp/isp.c | 15 +
+ drivers/media/video/isp/omap_resizer.c | 1634 ++++++++++++++++++++++++++++++++
+ include/linux/omap_resizer.h | 136 +++
+ 5 files changed, 1796 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/isp/omap_resizer.c
+ create mode 100644 include/linux/omap_resizer.h
+
+diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
+index 3cdb5a4..d2b4ae1 100644
+--- a/drivers/media/video/Kconfig
++++ b/drivers/media/video/Kconfig
+@@ -720,6 +720,13 @@ config VIDEO_OMAP3
+ ---help---
+ Driver for an OMAP 3 camera controller.
+
++config VIDEO_OMAP34XX_ISP_RESIZER
++ tristate "OMAP ISP Resizer"
++ depends on VIDEO_V4L2 && ARCH_OMAP34XX
++ select VIDEOBUF_GEN
++ select VIDEOBUF_DMA_SG
++ select OMAP_IOMMU
++
+ config SOC_CAMERA
+ tristate "SoC camera support"
+ depends on VIDEO_V4L2 && HAS_DMA
+diff --git a/drivers/media/video/isp/Makefile b/drivers/media/video/isp/Makefile
+index f14d617..d171fb9 100644
+--- a/drivers/media/video/isp/Makefile
++++ b/drivers/media/video/isp/Makefile
+@@ -7,6 +7,10 @@ else
+ isp-mod-objs += \
+ isp.o ispccdc.o ispmmu.o \
+ isppreview.o ispresizer.o isph3a.o isphist.o isp_af.o ispcsi2.o
++
++obj-$(CONFIG_VIDEO_OMAP34XX_ISP_RESIZER) += \
++ omap_resizer.o
++
+ endif
+
+ obj-$(CONFIG_VIDEO_OMAP3) += isp-mod.o
+diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c
+index 54c839b..f1f92b4 100644
+--- a/drivers/media/video/isp/isp.c
++++ b/drivers/media/video/isp/isp.c
+@@ -505,6 +505,12 @@ int isp_set_callback(enum isp_callback_type type, isp_callback_t callback,
+ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
+ IRQ0ENABLE_PRV_DONE_IRQ);
+ break;
++ case CBK_RESZ_DONE:
++ isp_reg_writel(IRQ0ENABLE_RSZ_DONE_IRQ,
++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS);
++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ IRQ0ENABLE_RSZ_DONE_IRQ);
++ break;
+ default:
+ break;
+ }
+@@ -556,6 +562,10 @@ int isp_unset_callback(enum isp_callback_type type)
+ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
+ ~IRQ0ENABLE_PRV_DONE_IRQ);
+ break;
++ case CBK_RESZ_DONE:
++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE,
++ ~IRQ0ENABLE_RSZ_DONE_IRQ);
++ break;
+ default:
+ break;
+ }
+@@ -938,6 +948,11 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_isp)
+ if (!ispresizer_busy())
+ ispresizer_config_shadow_registers();
+ isp_buf_process(bufs);
++ } else {
++ if (irqdis->isp_callbk[CBK_RESZ_DONE])
++ irqdis->isp_callbk[CBK_RESZ_DONE](RESZ_DONE,
++ irqdis->isp_callbk_arg1[CBK_RESZ_DONE],
++ irqdis->isp_callbk_arg2[CBK_RESZ_DONE]);
+ }
+ }
+
+diff --git a/drivers/media/video/isp/omap_resizer.c b/drivers/media/video/isp/omap_resizer.c
+new file mode 100644
+index 0000000..54bc425
+--- /dev/null
++++ b/drivers/media/video/isp/omap_resizer.c
+@@ -0,0 +1,1634 @@
++/*
++ * drivers/media/video/isp/omap_resizer.c
++ *
++ * Wrapper for Resizer module in TI's OMAP3430 ISP
++ *
++ * Copyright (C) 2008 Texas Instruments, Inc.
++ *
++ * Contributors:
++ * Sergio Aguirre <saaguirre@ti.com>
++ * Troy Laramy <t-laramy@ti.com>
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#include <linux/mutex.h>
++#include <linux/cdev.h>
++#include <linux/delay.h>
++#include <linux/device.h>
++#include <linux/fs.h>
++#include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/uaccess.h>
++#include <media/v4l2-dev.h>
++#include <asm/cacheflush.h>
++
++#include "isp.h"
++#include "ispmmu.h"
++#include "ispreg.h"
++#include "ispresizer.h"
++#include <linux/omap_resizer.h>
++
++#define OMAP_REZR_NAME "omap-resizer"
++
++/* Defines and Constants*/
++#define MAX_CHANNELS 16
++#define MAX_IMAGE_WIDTH 2047
++#define MAX_IMAGE_WIDTH_HIGH 2047
++#define ALIGNMENT 16
++#define CHANNEL_BUSY 1
++#define CHANNEL_FREE 0
++#define PIXEL_EVEN 2
++#define RATIO_MULTIPLIER 256
++/* Bit position Macro */
++/* macro for bit set and clear */
++#define BITSET(variable, bit) ((variable) | (1 << bit))
++#define BITRESET(variable, bit) ((variable) & ~(0x00000001 << (bit)))
++#define SET_BIT_INPUTRAM 28
++#define SET_BIT_CBLIN 29
++#define SET_BIT_INPTYP 27
++#define SET_BIT_YCPOS 26
++#define INPUT_RAM 1
++#define UP_RSZ_RATIO 64
++#define DOWN_RSZ_RATIO 512
++#define UP_RSZ_RATIO1 513
++#define DOWN_RSZ_RATIO1 1024
++#define RSZ_IN_SIZE_VERT_SHIFT 16
++#define MAX_HORZ_PIXEL_8BIT 31
++#define MAX_HORZ_PIXEL_16BIT 15
++#define NUM_PHASES 8
++#define NUM_TAPS 4
++#define NUM_D2PH 4 /* for downsampling * 2+x ~ 4x,
++ * number of phases
++ */
++#define NUM_D2TAPS 7 /* for downsampling * 2+x ~ 4x,
++ * number of taps
++ */
++#define ALIGN32 32
++#define MAX_COEF_COUNTER 16
++#define COEFF_ADDRESS_OFFSET 0x04
++
++/* Global structure which contains information about number of channels
++ and protection variables */
++struct device_params {
++
++ unsigned char opened; /* state of the device */
++ struct completion compl_isr; /* Completion for interrupt */
++ struct mutex reszwrap_mutex; /* Semaphore for array */
++
++ struct videobuf_queue_ops vbq_ops; /* videobuf queue operations */
++};
++
++/* Register mapped structure which contains the every register
++ information */
++struct resizer_config {
++ u32 rsz_pcr; /* pcr register mapping
++ * variable.
++ */
++ u32 rsz_in_start; /* in_start register mapping
++ * variable.
++ */
++ u32 rsz_in_size; /* in_size register mapping
++ * variable.
++ */
++ u32 rsz_out_size; /* out_size register mapping
++ * variable.
++ */
++ u32 rsz_cnt; /* rsz_cnt register mapping
++ * variable.
++ */
++ u32 rsz_sdr_inadd; /* sdr_inadd register mapping
++ * variable.
++ */
++ u32 rsz_sdr_inoff; /* sdr_inoff register mapping
++ * variable.
++ */
++ u32 rsz_sdr_outadd; /* sdr_outadd register mapping
++ * variable.
++ */
++ u32 rsz_sdr_outoff; /* sdr_outbuff register
++ * mapping variable.
++ */
++ u32 rsz_coeff_horz[16]; /* horizontal coefficients
++ * mapping array.
++ */
++ u32 rsz_coeff_vert[16]; /* vertical coefficients
++ * mapping array.
++ */
++ u32 rsz_yehn; /* yehn(luma)register mapping
++ * variable.
++ */
++};
++
++struct rsz_mult {
++ int in_hsize; /* input frame horizontal
++ * size.
++ */
++ int in_vsize; /* input frame vertical size.
++ */
++ int out_hsize; /* output frame horizontal
++ * size.
++ */
++ int out_vsize; /* output frame vertical
++ * size.
++ */
++ int in_pitch; /* offset between two rows of
++ * input frame.
++ */
++ int out_pitch; /* offset between two rows of
++ * output frame.
++ */
++ int end_hsize;
++ int end_vsize;
++ int num_htap; /* 0 = 7tap; 1 = 4tap */
++ int num_vtap; /* 0 = 7tap; 1 = 4tap */
++ int active;
++ int inptyp;
++ int vrsz;
++ int hrsz;
++ int hstph; /* for specifying horizontal
++ * starting phase.
++ */
++ int vstph;
++ int pix_fmt; /* # defined, UYVY or YUYV. */
++ int cbilin; /* # defined, filter with luma
++ * or bi-linear.
++ */
++ u16 tap4filt_coeffs[32]; /* horizontal filter
++ * coefficients.
++ */
++ u16 tap7filt_coeffs[32]; /* vertical filter
++ * coefficients.
++ */
++};
++/* Channel specific structure contains information regarding
++ the every channel */
++struct channel_config {
++ struct resizer_config register_config; /* Instance of register set
++ * mapping structure
++ */
++ int status; /* Specifies whether the
++ * channel is busy or not
++ */
++ struct mutex chanprotection_mutex;
++ enum config_done config_state;
++ u8 input_buf_index;
++ u8 output_buf_index;
++
++};
++
++/* per-filehandle data structure */
++struct rsz_fh {
++ struct rsz_params *params;
++ struct channel_config *config;
++ struct rsz_mult *multipass; /* Multipass to support
++ * resizing ration outside
++ * of 0.25x to 4x
++ */
++ spinlock_t vbq_lock; /* spinlock for videobuf
++ * queues.
++ */
++ enum v4l2_buf_type type;
++ struct videobuf_queue vbq;
++ struct device_params *device;
++
++ dma_addr_t isp_addr_read; /* Input/Output address */
++ dma_addr_t isp_addr_write; /* Input/Output address */
++ u32 rsz_bufsize; /* channel specific buffersize
++ */
++};
++
++static struct device_params *device_config;
++static struct device *rsz_device;
++static int rsz_major = -1;
++/* functions declaration */
++static void rsz_hardware_setup(struct channel_config *rsz_conf_chan);
++static int rsz_set_params(struct rsz_mult *multipass, struct rsz_params *,
++ struct channel_config *);
++static int rsz_get_params(struct rsz_params *, struct channel_config *);
++static void rsz_copy_data(struct rsz_mult *multipass,
++ struct rsz_params *params);
++static void rsz_isr(unsigned long status, isp_vbq_callback_ptr arg1,
++ void *arg2);
++static void rsz_calculate_crop(struct channel_config *rsz_conf_chan,
++ struct rsz_cropsize *cropsize);
++static int rsz_set_multipass(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan);
++static int rsz_set_ratio(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan);
++static void rsz_config_ratio(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan);
++
++/**
++ * rsz_hardware_setup - Sets hardware configuration registers
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Set hardware configuration registers
++ **/
++static void rsz_hardware_setup(struct channel_config *rsz_conf_chan)
++{
++ int coeffcounter;
++ int coeffoffset = 0;
++
++ omap_writel(rsz_conf_chan->register_config.rsz_cnt,
++ OMAP3ISP_RESZ_REG(ISPRSZ_CNT));
++
++ omap_writel(rsz_conf_chan->register_config.rsz_in_start,
++ OMAP3ISP_RESZ_REG(ISPRSZ_IN_START));
++ omap_writel(rsz_conf_chan->register_config.rsz_in_size,
++ OMAP3ISP_RESZ_REG(ISPRSZ_IN_SIZE));
++
++ omap_writel(rsz_conf_chan->register_config.rsz_out_size,
++ OMAP3ISP_RESZ_REG(ISPRSZ_OUT_SIZE));
++ omap_writel(rsz_conf_chan->register_config.rsz_sdr_inadd,
++ OMAP3ISP_RESZ_REG(ISPRSZ_SDR_INADD));
++ omap_writel(rsz_conf_chan->register_config.rsz_sdr_inoff,
++ OMAP3ISP_RESZ_REG(ISPRSZ_SDR_INOFF));
++ omap_writel(rsz_conf_chan->register_config.rsz_sdr_outadd,
++ OMAP3ISP_RESZ_REG(ISPRSZ_SDR_OUTADD));
++ omap_writel(rsz_conf_chan->register_config.rsz_sdr_outoff,
++ OMAP3ISP_RESZ_REG(ISPRSZ_SDR_OUTOFF));
++ omap_writel(rsz_conf_chan->register_config.rsz_yehn, OMAP3ISP_RESZ_REG(ISPRSZ_YENH));
++
++ for (coeffcounter = 0; coeffcounter < MAX_COEF_COUNTER;
++ coeffcounter++) {
++ omap_writel(rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter],
++ OMAP3ISP_RESZ_REG(ISPRSZ_HFILT10
++ + coeffoffset));
++
++ omap_writel(rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter],
++ OMAP3ISP_RESZ_REG(ISPRSZ_VFILT10
++ + coeffoffset));
++ coeffoffset = coeffoffset + COEFF_ADDRESS_OFFSET;
++ }
++}
++
++/**
++ * rsz_start - Enables Resizer Wrapper
++ * @arg: Currently not used.
++ * @device: Structure containing ISP resizer wrapper global information
++ *
++ * Submits a resizing task specified by the rsz_resize structure. The call can
++ * either be blocked until the task is completed or returned immediately based
++ * on the value of the blocking argument in the rsz_resize structure. If it is
++ * blocking, the status of the task can be checked by calling ioctl
++ * RSZ_G_STATUS. Only one task can be outstanding for each logical channel.
++ *
++ * Returns 0 if successful, or -EINVAL if could not set callback for RSZR IRQ
++ * event or the state of the channel is not configured.
++ **/
++int rsz_start(int *arg, struct rsz_fh *fh)
++{
++ struct channel_config *rsz_conf_chan = fh->config;
++ struct rsz_mult *multipass = fh->multipass;
++ struct videobuf_queue *q = &fh->vbq;
++ int ret;
++
++ if (rsz_conf_chan->config_state) {
++ dev_err(rsz_device, "State not configured \n");
++ goto err_einval;
++ }
++
++ rsz_conf_chan->status = CHANNEL_BUSY;
++
++ rsz_hardware_setup(rsz_conf_chan);
++
++ if (isp_set_callback(CBK_RESZ_DONE, rsz_isr, (void *) NULL,
++ (void *)NULL)) {
++ dev_err(rsz_device, "No callback for RSZR\n");
++ goto err_einval;
++ }
++mult:
++ device_config->compl_isr.done = 0;
++
++ ispresizer_enable(1);
++
++ ret = wait_for_completion_interruptible(&device_config->compl_isr);
++ if (ret != 0) {
++ dev_dbg(rsz_device, "Unexpected exit from "
++ "wait_for_completion_interruptible\n");
++ wait_for_completion(&device_config->compl_isr);
++ }
++
++ if (multipass->active) {
++ rsz_set_multipass(multipass, rsz_conf_chan);
++ goto mult;
++ }
++
++ if (fh->isp_addr_read) {
++ ispmmu_unmap(fh->isp_addr_read);
++ fh->isp_addr_read = 0;
++ }
++ if (fh->isp_addr_write) {
++ ispmmu_unmap(fh->isp_addr_write);
++ fh->isp_addr_write = 0;
++ }
++
++ rsz_conf_chan->status = CHANNEL_FREE;
++ q->bufs[rsz_conf_chan->input_buf_index]->state = VIDEOBUF_NEEDS_INIT;
++ q->bufs[rsz_conf_chan->output_buf_index]->state = VIDEOBUF_NEEDS_INIT;
++ rsz_conf_chan->register_config.rsz_sdr_outadd = 0;
++ rsz_conf_chan->register_config.rsz_sdr_inadd = 0;
++
++ /* Unmap and free the DMA memory allocated for buffers */
++ videobuf_dma_unmap(q, videobuf_to_dma(
++ q->bufs[rsz_conf_chan->input_buf_index]));
++ videobuf_dma_unmap(q, videobuf_to_dma(
++ q->bufs[rsz_conf_chan->output_buf_index]));
++ videobuf_dma_free(videobuf_to_dma(
++ q->bufs[rsz_conf_chan->input_buf_index]));
++ videobuf_dma_free(videobuf_to_dma(
++ q->bufs[rsz_conf_chan->output_buf_index]));
++
++ isp_unset_callback(CBK_RESZ_DONE);
++
++ return 0;
++err_einval:
++ return -EINVAL;
++}
++
++/**
++ * rsz_set_multipass - Set resizer multipass
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Returns always 0
++ **/
++static int rsz_set_multipass(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan)
++{
++ multipass->in_hsize = multipass->out_hsize;
++ multipass->in_vsize = multipass->out_vsize;
++ multipass->out_hsize = multipass->end_hsize;
++ multipass->out_vsize = multipass->end_vsize;
++
++ multipass->out_pitch = (multipass->inptyp ? multipass->out_hsize
++ : (multipass->out_hsize * 2));
++ multipass->in_pitch = (multipass->inptyp ? multipass->in_hsize
++ : (multipass->in_hsize * 2));
++
++ rsz_set_ratio(multipass, rsz_conf_chan);
++ rsz_config_ratio(multipass, rsz_conf_chan);
++ rsz_hardware_setup(rsz_conf_chan);
++ return 0;
++}
++
++/**
++ * rsz_copy_data - Copy data
++ * @params: Structure containing the Resizer Wrapper parameters
++ *
++ * Copy data
++ **/
++static void rsz_copy_data(struct rsz_mult *multipass, struct rsz_params *params)
++{
++ int i;
++ multipass->in_hsize = params->in_hsize;
++ multipass->in_vsize = params->in_vsize;
++ multipass->out_hsize = params->out_hsize;
++ multipass->out_vsize = params->out_vsize;
++ multipass->end_hsize = params->out_hsize;
++ multipass->end_vsize = params->out_vsize;
++ multipass->in_pitch = params->in_pitch;
++ multipass->out_pitch = params->out_pitch;
++ multipass->hstph = params->hstph;
++ multipass->vstph = params->vstph;
++ multipass->inptyp = params->inptyp;
++ multipass->pix_fmt = params->pix_fmt;
++ multipass->cbilin = params->cbilin;
++
++ for (i = 0; i < 32; i++) {
++ multipass->tap4filt_coeffs[i] = params->tap4filt_coeffs[i];
++ multipass->tap7filt_coeffs[i] = params->tap7filt_coeffs[i];
++ }
++}
++
++/**
++ * rsz_set_params - Set parameters for resizer wrapper
++ * @params: Structure containing the Resizer Wrapper parameters
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Used to set the parameters of the Resizer hardware, including input and
++ * output image size, horizontal and vertical poly-phase filter coefficients,
++ * luma enchancement filter coefficients, etc.
++ **/
++static int rsz_set_params(struct rsz_mult *multipass, struct rsz_params *params,
++ struct channel_config *rsz_conf_chan)
++{
++ int mul = 1;
++ if ((params->yenh_params.type < 0) || (params->yenh_params.type > 2)) {
++ dev_err(rsz_device, "rsz_set_params: Wrong yenh type\n");
++ return -EINVAL;
++ }
++ if ((params->in_vsize <= 0) || (params->in_hsize <= 0) ||
++ (params->out_vsize <= 0) || (params->out_hsize <= 0) ||
++ (params->in_pitch <= 0) || (params->out_pitch <= 0)) {
++ dev_err(rsz_device, "rsz_set_params: Invalid size params\n");
++ return -EINVAL;
++ }
++ if ((params->inptyp != RSZ_INTYPE_YCBCR422_16BIT) &&
++ (params->inptyp != RSZ_INTYPE_PLANAR_8BIT)) {
++ dev_err(rsz_device, "rsz_set_params: Invalid input type\n");
++ return -EINVAL;
++ }
++ if ((params->pix_fmt != RSZ_PIX_FMT_UYVY) &&
++ (params->pix_fmt != RSZ_PIX_FMT_YUYV)) {
++ dev_err(rsz_device, "rsz_set_params: Invalid pixel format\n");
++ return -EINVAL;
++ }
++ if (params->inptyp == RSZ_INTYPE_YCBCR422_16BIT)
++ mul = 2;
++ else
++ mul = 1;
++ if (params->in_pitch < (params->in_hsize * mul)) {
++ dev_err(rsz_device, "rsz_set_params: Pitch is incorrect\n");
++ return -EINVAL;
++ }
++ if (params->out_pitch < (params->out_hsize * mul)) {
++ dev_err(rsz_device, "rsz_set_params: Out pitch cannot be less"
++ " than out hsize\n");
++ return -EINVAL;
++ }
++ /* Output H size should be even */
++ if ((params->out_hsize % PIXEL_EVEN) != 0) {
++ dev_err(rsz_device, "rsz_set_params: Output H size should"
++ " be even\n");
++ return -EINVAL;
++ }
++ if (params->horz_starting_pixel < 0) {
++ dev_err(rsz_device, "rsz_set_params: Horz start pixel cannot"
++ " be less than zero\n");
++ return -EINVAL;
++ }
++
++ rsz_copy_data(multipass, params);
++ if (0 != rsz_set_ratio(multipass, rsz_conf_chan))
++ goto err_einval;
++
++ if (params->yenh_params.type) {
++ if ((multipass->num_htap && multipass->out_hsize >
++ 1280) ||
++ (!multipass->num_htap && multipass->out_hsize >
++ 640))
++ goto err_einval;
++ }
++
++ if (INPUT_RAM)
++ params->vert_starting_pixel = 0;
++
++ rsz_conf_chan->register_config.rsz_in_start =
++ (params->vert_starting_pixel
++ << ISPRSZ_IN_SIZE_VERT_SHIFT)
++ & ISPRSZ_IN_SIZE_VERT_MASK;
++
++ if (params->inptyp == RSZ_INTYPE_PLANAR_8BIT) {
++ if (params->horz_starting_pixel > MAX_HORZ_PIXEL_8BIT)
++ goto err_einval;
++ }
++ if (params->inptyp == RSZ_INTYPE_YCBCR422_16BIT) {
++ if (params->horz_starting_pixel > MAX_HORZ_PIXEL_16BIT)
++ goto err_einval;
++ }
++
++ rsz_conf_chan->register_config.rsz_in_start |=
++ params->horz_starting_pixel
++ & ISPRSZ_IN_START_HORZ_ST_MASK;
++
++ rsz_conf_chan->register_config.rsz_yehn =
++ (params->yenh_params.type
++ << ISPRSZ_YENH_ALGO_SHIFT)
++ & ISPRSZ_YENH_ALGO_MASK;
++
++ if (params->yenh_params.type) {
++ rsz_conf_chan->register_config.rsz_yehn |=
++ params->yenh_params.core
++ & ISPRSZ_YENH_CORE_MASK;
++
++ rsz_conf_chan->register_config.rsz_yehn |=
++ (params->yenh_params.gain
++ << ISPRSZ_YENH_GAIN_SHIFT)
++ & ISPRSZ_YENH_GAIN_MASK;
++
++ rsz_conf_chan->register_config.rsz_yehn |=
++ (params->yenh_params.slop
++ << ISPRSZ_YENH_SLOP_SHIFT)
++ & ISPRSZ_YENH_SLOP_MASK;
++ }
++
++ rsz_config_ratio(multipass, rsz_conf_chan);
++
++ rsz_conf_chan->config_state = STATE_CONFIGURED;
++
++ return 0;
++err_einval:
++ return -EINVAL;
++}
++
++/**
++ * rsz_set_ratio - Set ratio
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Returns 0 if successful, -EINVAL if invalid output size, upscaling ratio is
++ * being requested, or other ratio configuration value is out of bounds
++ **/
++static int rsz_set_ratio(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan)
++{
++ int alignment = 0;
++
++ rsz_conf_chan->register_config.rsz_cnt = 0;
++
++ if ((multipass->out_hsize > MAX_IMAGE_WIDTH) ||
++ (multipass->out_vsize > MAX_IMAGE_WIDTH)) {
++ dev_err(rsz_device, "Invalid output size!");
++ goto err_einval;
++ }
++ if (multipass->cbilin) {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITSET(rsz_conf_chan->register_config.rsz_cnt,
++ SET_BIT_CBLIN);
++ }
++ if (INPUT_RAM) {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITSET(rsz_conf_chan->register_config.rsz_cnt,
++ SET_BIT_INPUTRAM);
++ }
++ if (multipass->inptyp == RSZ_INTYPE_PLANAR_8BIT) {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITSET(rsz_conf_chan->register_config.rsz_cnt,
++ SET_BIT_INPTYP);
++ } else {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITRESET(rsz_conf_chan->register_config.
++ rsz_cnt, SET_BIT_INPTYP);
++
++ if (multipass->pix_fmt == RSZ_PIX_FMT_UYVY) {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITRESET(rsz_conf_chan->register_config.
++ rsz_cnt, SET_BIT_YCPOS);
++ } else if (multipass->pix_fmt == RSZ_PIX_FMT_YUYV) {
++ rsz_conf_chan->register_config.rsz_cnt =
++ BITSET(rsz_conf_chan->register_config.
++ rsz_cnt, SET_BIT_YCPOS);
++ }
++
++ }
++ multipass->vrsz =
++ (multipass->in_vsize * RATIO_MULTIPLIER) / multipass->out_vsize;
++ multipass->hrsz =
++ (multipass->in_hsize * RATIO_MULTIPLIER) / multipass->out_hsize;
++ if (UP_RSZ_RATIO > multipass->vrsz || UP_RSZ_RATIO > multipass->hrsz) {
++ dev_err(rsz_device, "Upscaling ratio not supported!");
++ goto err_einval;
++ }
++ multipass->vrsz = (multipass->in_vsize - NUM_D2TAPS) * RATIO_MULTIPLIER
++ / (multipass->out_vsize - 1);
++ multipass->hrsz = ((multipass->in_hsize - NUM_D2TAPS)
++ * RATIO_MULTIPLIER) /
++ (multipass->out_hsize - 1);
++
++ if (multipass->hrsz <= 512) {
++ multipass->hrsz = (multipass->in_hsize - NUM_TAPS)
++ * RATIO_MULTIPLIER
++ / (multipass->out_hsize - 1);
++ if (multipass->hrsz < 64)
++ multipass->hrsz = 64;
++ if (multipass->hrsz > 512)
++ multipass->hrsz = 512;
++ if (multipass->hstph > NUM_PHASES)
++ goto err_einval;
++ multipass->num_htap = 1;
++ } else if (multipass->hrsz >= 513 && multipass->hrsz <= 1024) {
++ if (multipass->hstph > NUM_D2PH)
++ goto err_einval;
++ multipass->num_htap = 0;
++ }
++
++ if (multipass->vrsz <= 512) {
++ multipass->vrsz = (multipass->in_vsize - NUM_TAPS)
++ * RATIO_MULTIPLIER
++ / (multipass->out_vsize - 1);
++ if (multipass->vrsz < 64)
++ multipass->vrsz = 64;
++ if (multipass->vrsz > 512)
++ multipass->vrsz = 512;
++ if (multipass->vstph > NUM_PHASES)
++ goto err_einval;
++ multipass->num_vtap = 1;
++ } else if (multipass->vrsz >= 513 && multipass->vrsz <= 1024) {
++ if (multipass->vstph > NUM_D2PH)
++ goto err_einval;
++ multipass->num_vtap = 0;
++ }
++
++ if ((multipass->in_pitch) % ALIGN32) {
++ dev_err(rsz_device, "Invalid input pitch: %d \n",
++ multipass->in_pitch);
++ goto err_einval;
++ }
++ if ((multipass->out_pitch) % ALIGN32) {
++ dev_err(rsz_device, "Invalid output pitch %d \n",
++ multipass->out_pitch);
++ goto err_einval;
++ }
++
++ if (multipass->vrsz < 256 &&
++ (multipass->in_vsize < multipass->out_vsize)) {
++ if (multipass->inptyp == RSZ_INTYPE_PLANAR_8BIT)
++ alignment = ALIGNMENT;
++ else if (multipass->inptyp == RSZ_INTYPE_YCBCR422_16BIT)
++ alignment = (ALIGNMENT / 2);
++ else
++ dev_err(rsz_device, "Invalid input type\n");
++
++ if (!(((multipass->out_hsize % PIXEL_EVEN) == 0)
++ && (multipass->out_hsize % alignment) == 0)) {
++ dev_err(rsz_device, "wrong hsize\n");
++ goto err_einval;
++ }
++ }
++ if (multipass->hrsz >= 64 && multipass->hrsz <= 1024) {
++ if (multipass->out_hsize > MAX_IMAGE_WIDTH) {
++ dev_err(rsz_device, "wrong width\n");
++ goto err_einval;
++ }
++ multipass->active = 0;
++
++ } else if (multipass->hrsz > 1024) {
++ if (multipass->out_hsize > MAX_IMAGE_WIDTH) {
++ dev_err(rsz_device, "wrong width\n");
++ goto err_einval;
++ }
++ if (multipass->hstph > NUM_D2PH)
++ goto err_einval;
++ multipass->num_htap = 0;
++ multipass->out_hsize = multipass->in_hsize * 256 / 1024;
++ if (multipass->out_hsize % ALIGN32) {
++ multipass->out_hsize +=
++ abs((multipass->out_hsize % ALIGN32) - ALIGN32);
++ }
++ multipass->out_pitch = ((multipass->inptyp) ?
++ multipass->out_hsize :
++ (multipass->out_hsize * 2));
++ multipass->hrsz = ((multipass->in_hsize - NUM_D2TAPS)
++ * RATIO_MULTIPLIER)
++ / (multipass->out_hsize - 1);
++ multipass->active = 1;
++
++ }
++
++ if (multipass->vrsz > 1024) {
++ if (multipass->out_vsize > MAX_IMAGE_WIDTH_HIGH) {
++ dev_err(rsz_device, "wrong width\n");
++ goto err_einval;
++ }
++
++ multipass->out_vsize = multipass->in_vsize * 256 / 1024;
++ multipass->vrsz = ((multipass->in_vsize - NUM_D2TAPS)
++ * RATIO_MULTIPLIER)
++ / (multipass->out_vsize - 1);
++ multipass->active = 1;
++ multipass->num_vtap = 0;
++
++ }
++ rsz_conf_chan->register_config.rsz_out_size =
++ multipass->out_hsize
++ & ISPRSZ_OUT_SIZE_HORZ_MASK;
++
++ rsz_conf_chan->register_config.rsz_out_size |=
++ (multipass->out_vsize
++ << ISPRSZ_OUT_SIZE_VERT_SHIFT)
++ & ISPRSZ_OUT_SIZE_VERT_MASK;
++
++ rsz_conf_chan->register_config.rsz_sdr_inoff =
++ multipass->in_pitch
++ & ISPRSZ_SDR_INOFF_OFFSET_MASK;
++
++ rsz_conf_chan->register_config.rsz_sdr_outoff =
++ multipass->out_pitch
++ & ISPRSZ_SDR_OUTOFF_OFFSET_MASK;
++
++ if (multipass->hrsz >= 64 && multipass->hrsz <= 512) {
++ if (multipass->hstph > NUM_PHASES)
++ goto err_einval;
++ } else if (multipass->hrsz >= 64 && multipass->hrsz <= 512) {
++ if (multipass->hstph > NUM_D2PH)
++ goto err_einval;
++ }
++
++ rsz_conf_chan->register_config.rsz_cnt |=
++ (multipass->hstph
++ << ISPRSZ_CNT_HSTPH_SHIFT)
++ & ISPRSZ_CNT_HSTPH_MASK;
++
++ if (multipass->vrsz >= 64 && multipass->hrsz <= 512) {
++ if (multipass->vstph > NUM_PHASES)
++ goto err_einval;
++ } else if (multipass->vrsz >= 64 && multipass->vrsz <= 512) {
++ if (multipass->vstph > NUM_D2PH)
++ goto err_einval;
++ }
++
++ rsz_conf_chan->register_config.rsz_cnt |=
++ (multipass->vstph
++ << ISPRSZ_CNT_VSTPH_SHIFT)
++ & ISPRSZ_CNT_VSTPH_MASK;
++
++ rsz_conf_chan->register_config.rsz_cnt |=
++ (multipass->hrsz - 1)
++ & ISPRSZ_CNT_HRSZ_MASK;
++
++ rsz_conf_chan->register_config.rsz_cnt |=
++ ((multipass->vrsz - 1)
++ << ISPRSZ_CNT_VRSZ_SHIFT)
++ & ISPRSZ_CNT_VRSZ_MASK;
++
++ return 0;
++err_einval:
++ return -EINVAL;
++}
++
++/**
++ * rsz_config_ratio - Configure ratio
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Configure ratio
++ **/
++static void rsz_config_ratio(struct rsz_mult *multipass,
++ struct channel_config *rsz_conf_chan)
++{
++ int hsize;
++ int vsize;
++ int coeffcounter;
++
++ if (multipass->hrsz <= 512) {
++ hsize = ((32 * multipass->hstph + (multipass->out_hsize - 1)
++ * multipass->hrsz + 16) >> 8) + 7;
++ } else {
++ hsize = ((64 * multipass->hstph + (multipass->out_hsize - 1)
++ * multipass->hrsz + 32) >> 8) + 7;
++ }
++ if (multipass->vrsz <= 512) {
++ vsize = ((32 * multipass->vstph + (multipass->out_vsize - 1)
++ * multipass->vrsz + 16) >> 8) + 4;
++ } else {
++ vsize = ((64 * multipass->vstph + (multipass->out_vsize - 1)
++ * multipass->vrsz + 32) >> 8) + 7;
++ }
++ rsz_conf_chan->register_config.rsz_in_size = hsize;
++
++ rsz_conf_chan->register_config.rsz_in_size |=
++ ((vsize << ISPRSZ_IN_SIZE_VERT_SHIFT)
++ & ISPRSZ_IN_SIZE_VERT_MASK);
++
++ for (coeffcounter = 0; coeffcounter < MAX_COEF_COUNTER;
++ coeffcounter++) {
++ if (multipass->num_htap) {
++ rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter] =
++ (multipass->tap4filt_coeffs[2
++ * coeffcounter]
++ & ISPRSZ_HFILT10_COEF0_MASK);
++ rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter] |=
++ ((multipass->tap4filt_coeffs[2
++ * coeffcounter + 1]
++ << ISPRSZ_HFILT10_COEF1_SHIFT)
++ & ISPRSZ_HFILT10_COEF1_MASK);
++ } else {
++ rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter] =
++ (multipass->tap7filt_coeffs[2
++ * coeffcounter]
++ & ISPRSZ_HFILT10_COEF0_MASK);
++
++ rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter] |=
++ ((multipass->tap7filt_coeffs[2
++ * coeffcounter + 1]
++ << ISPRSZ_HFILT10_COEF1_SHIFT)
++ & ISPRSZ_HFILT10_COEF1_MASK);
++ }
++
++ if (multipass->num_vtap) {
++ rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter] =
++ (multipass->tap4filt_coeffs[2
++ * coeffcounter]
++ & ISPRSZ_VFILT10_COEF0_MASK);
++
++ rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter] |=
++ ((multipass->tap4filt_coeffs[2
++ * coeffcounter + 1]
++ << ISPRSZ_VFILT10_COEF1_SHIFT) &
++ ISPRSZ_VFILT10_COEF1_MASK);
++ } else {
++ rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter] =
++ (multipass->tap7filt_coeffs[2
++ * coeffcounter]
++ & ISPRSZ_VFILT10_COEF0_MASK);
++ rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter] |=
++ ((multipass->tap7filt_coeffs[2
++ * coeffcounter + 1]
++ << ISPRSZ_VFILT10_COEF1_SHIFT)
++ & ISPRSZ_VFILT10_COEF1_MASK);
++ }
++ }
++}
++
++/**
++ * rsz_get_params - Gets the parameter values
++ * @params: Structure containing the Resizer Wrapper parameters
++ * @rsz_conf_chan: Structure containing channel configuration
++ *
++ * Used to get the Resizer hardware settings associated with the
++ * current logical channel represented by fd.
++ **/
++static int rsz_get_params(struct rsz_params *params,
++ struct channel_config *rsz_conf_chan)
++{
++ int coeffcounter;
++
++ if (rsz_conf_chan->config_state) {
++ dev_err(rsz_device, "state not configured\n");
++ return -EINVAL;
++ }
++
++ params->in_hsize = rsz_conf_chan->register_config.rsz_in_size
++ & ISPRSZ_IN_SIZE_HORZ_MASK;
++ params->in_vsize = (rsz_conf_chan->register_config.rsz_in_size
++ & ISPRSZ_IN_SIZE_VERT_MASK)
++ >> ISPRSZ_IN_SIZE_VERT_SHIFT;
++
++ params->in_pitch = rsz_conf_chan->register_config.rsz_sdr_inoff
++ & ISPRSZ_SDR_INOFF_OFFSET_MASK;
++
++ params->out_hsize = rsz_conf_chan->register_config.rsz_out_size
++ & ISPRSZ_OUT_SIZE_HORZ_MASK;
++
++ params->out_vsize = (rsz_conf_chan->register_config.rsz_out_size
++ & ISPRSZ_OUT_SIZE_VERT_MASK)
++ >> ISPRSZ_OUT_SIZE_VERT_SHIFT;
++
++ params->out_pitch = rsz_conf_chan->register_config.rsz_sdr_outoff
++ & ISPRSZ_SDR_OUTOFF_OFFSET_MASK;
++
++ params->cbilin = (rsz_conf_chan->register_config.rsz_cnt
++ & SET_BIT_CBLIN) >> SET_BIT_CBLIN;
++
++ params->inptyp = (rsz_conf_chan->register_config.rsz_cnt
++ & ISPRSZ_CNT_INPTYP_MASK)
++ >> SET_BIT_INPTYP;
++ params->horz_starting_pixel = ((rsz_conf_chan->register_config.
++ rsz_in_start
++ & ISPRSZ_IN_START_HORZ_ST_MASK));
++ params->vert_starting_pixel = ((rsz_conf_chan->register_config.
++ rsz_in_start
++ & ISPRSZ_IN_START_VERT_ST_MASK)
++ >> ISPRSZ_IN_START_VERT_ST_SHIFT);
++
++ params->hstph = ((rsz_conf_chan->register_config.rsz_cnt
++ & ISPRSZ_CNT_HSTPH_MASK
++ >> ISPRSZ_CNT_HSTPH_SHIFT));
++ params->vstph = ((rsz_conf_chan->register_config.rsz_cnt
++ & ISPRSZ_CNT_VSTPH_MASK
++ >> ISPRSZ_CNT_VSTPH_SHIFT));
++
++ for (coeffcounter = 0; coeffcounter < MAX_COEF_COUNTER;
++ coeffcounter++) {
++ params->tap4filt_coeffs[2 * coeffcounter] =
++ rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter]
++ & ISPRSZ_HFILT10_COEF0_MASK;
++
++ params->tap4filt_coeffs[2 * coeffcounter + 1] =
++ (rsz_conf_chan->register_config.
++ rsz_coeff_horz[coeffcounter]
++ & ISPRSZ_HFILT10_COEF1_MASK)
++ >> ISPRSZ_HFILT10_COEF1_SHIFT;
++
++ params->tap7filt_coeffs[2 * coeffcounter] =
++ rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter]
++ & ISPRSZ_VFILT10_COEF0_MASK;
++
++ params->tap7filt_coeffs[2 * coeffcounter + 1] =
++ (rsz_conf_chan->register_config.
++ rsz_coeff_vert[coeffcounter]
++ & ISPRSZ_VFILT10_COEF1_MASK)
++ >> ISPRSZ_VFILT10_COEF1_SHIFT;
++
++ }
++
++ params->yenh_params.type = (rsz_conf_chan->register_config.rsz_yehn
++ & ISPRSZ_YENH_ALGO_MASK)
++ >> ISPRSZ_YENH_ALGO_SHIFT;
++
++ params->yenh_params.core = rsz_conf_chan->register_config.rsz_yehn
++ & ISPRSZ_YENH_CORE_MASK;
++
++ params->yenh_params.gain = (rsz_conf_chan->register_config.rsz_yehn
++ & ISPRSZ_YENH_GAIN_MASK)
++ >> ISPRSZ_YENH_GAIN_SHIFT;
++
++ params->yenh_params.slop = (rsz_conf_chan->register_config.rsz_yehn
++ & ISPRSZ_YENH_SLOP_MASK)
++ >> ISPRSZ_YENH_SLOP_SHIFT;
++
++ params->pix_fmt = ((rsz_conf_chan->register_config.rsz_cnt
++ & ISPRSZ_CNT_PIXFMT_MASK)
++ >> SET_BIT_YCPOS);
++
++ if (params->pix_fmt)
++ params->pix_fmt = RSZ_PIX_FMT_UYVY;
++ else
++ params->pix_fmt = RSZ_PIX_FMT_YUYV;
++
++ return 0;
++}
++
++/**
++ * rsz_calculate_crop - Calculate Crop values
++ * @rsz_conf_chan: Structure containing channel configuration
++ * @cropsize: Structure containing crop parameters
++ *
++ * Calculate Crop values
++ **/
++static void rsz_calculate_crop(struct channel_config *rsz_conf_chan,
++ struct rsz_cropsize *cropsize)
++{
++ int luma_enable;
++
++ cropsize->hcrop = 0;
++ cropsize->vcrop = 0;
++
++ luma_enable = (rsz_conf_chan->register_config.rsz_yehn
++ & ISPRSZ_YENH_ALGO_MASK)
++ >> ISPRSZ_YENH_ALGO_SHIFT;
++
++ if (luma_enable)
++ cropsize->hcrop += 2;
++}
++
++/**
++ * rsz_vbq_release - Videobuffer queue release
++ * @q: Structure containing the videobuffer queue file handle, and device
++ * structure which contains the actual configuration.
++ * @vb: Structure containing the videobuffer used for resizer processing.
++ **/
++static void rsz_vbq_release(struct videobuf_queue *q,
++ struct videobuf_buffer *vb)
++{
++ int i;
++ struct rsz_fh *fh = q->priv_data;
++
++ for (i = 0; i < VIDEO_MAX_FRAME; i++) {
++ struct videobuf_dmabuf *dma = NULL;
++ if (!q->bufs[i])
++ continue;
++ if (q->bufs[i]->memory != V4L2_MEMORY_MMAP)
++ continue;
++ dma = videobuf_to_dma(q->bufs[i]);
++ videobuf_dma_unmap(q, dma);
++ videobuf_dma_free(dma);
++ }
++
++ ispmmu_unmap(fh->isp_addr_read);
++ ispmmu_unmap(fh->isp_addr_write);
++ fh->isp_addr_read = 0;
++ fh->isp_addr_write = 0;
++ spin_lock(&fh->vbq_lock);
++ vb->state = VIDEOBUF_NEEDS_INIT;
++ spin_unlock(&fh->vbq_lock);
++
++}
++
++/**
++ * rsz_vbq_setup - Sets up the videobuffer size and validates count.
++ * @q: Structure containing the videobuffer queue file handle, and device
++ * structure which contains the actual configuration.
++ * @cnt: Number of buffers requested
++ * @size: Size in bytes of the buffer used for previewing
++ *
++ * Always returns 0.
++ **/
++static int rsz_vbq_setup(struct videobuf_queue *q, unsigned int *cnt,
++ unsigned int *size)
++{
++ struct rsz_fh *fh = q->priv_data;
++ struct rsz_mult *multipass = fh->multipass;
++ u32 insize, outsize;
++
++ spin_lock(&fh->vbq_lock);
++ if (*cnt <= 0)
++ *cnt = VIDEO_MAX_FRAME;
++
++ if (*cnt > VIDEO_MAX_FRAME)
++ *cnt = VIDEO_MAX_FRAME;
++
++ outsize = multipass->out_pitch * multipass->out_vsize;
++ insize = multipass->in_pitch * multipass->in_vsize;
++ if (*cnt == 1 && (outsize > insize)) {
++ dev_err(rsz_device, "2 buffers are required for Upscaling "
++ "mode\n");
++ goto err_einval;
++ }
++ if (!fh->params->in_hsize || !fh->params->in_vsize) {
++ dev_err(rsz_device, "Can't setup buffer size\n");
++ goto err_einval;
++ } else {
++ if (outsize > insize)
++ *size = outsize;
++ else
++ *size = insize;
++
++ fh->rsz_bufsize = *size;
++ }
++ spin_unlock(&fh->vbq_lock);
++
++ return 0;
++err_einval:
++ spin_unlock(&fh->vbq_lock);
++ return -EINVAL;
++}
++
++/**
++ * rsz_vbq_prepare - Videobuffer is prepared and mmapped.
++ * @q: Structure containing the videobuffer queue file handle, and device
++ * structure which contains the actual configuration.
++ * @vb: Structure containing the videobuffer used for resizer processing.
++ * @field: Type of field to set in videobuffer device.
++ *
++ * Returns 0 if successful, or -EINVAL if buffer couldn't get allocated, or
++ * -EIO if the ISP MMU mapping fails
++ **/
++static int rsz_vbq_prepare(struct videobuf_queue *q,
++ struct videobuf_buffer *vb,
++ enum v4l2_field field)
++{
++ struct rsz_fh *fh = q->priv_data;
++ struct channel_config *rsz_conf_chan = fh->config;
++ struct rsz_mult *multipass = fh->multipass;
++ int err = 0;
++ unsigned int isp_addr, insize, outsize;
++ struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
++
++ spin_lock(&fh->vbq_lock);
++ if (vb->baddr) {
++ vb->size = fh->rsz_bufsize;
++ vb->bsize = fh->rsz_bufsize;
++ } else {
++ spin_unlock(&fh->vbq_lock);
++ dev_err(rsz_device, "No user buffer allocated\n");
++ goto out;
++ }
++ if (vb->i) {
++ vb->width = fh->params->out_hsize;
++ vb->height = fh->params->out_vsize;
++ } else {
++ vb->width = fh->params->in_hsize;
++ vb->height = fh->params->in_vsize;
++ }
++
++ vb->field = field;
++ spin_unlock(&fh->vbq_lock);
++
++ if (vb->state == VIDEOBUF_NEEDS_INIT) {
++ err = videobuf_iolock(q, vb, NULL);
++ if (!err) {
++ isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
++ if (!isp_addr)
++ err = -EIO;
++ else {
++ if (vb->i) {
++ rsz_conf_chan->register_config.
++ rsz_sdr_outadd
++ = isp_addr;
++ fh->isp_addr_write = isp_addr;
++ rsz_conf_chan->output_buf_index = vb->i;
++ } else {
++ rsz_conf_chan->register_config.
++ rsz_sdr_inadd
++ = isp_addr;
++ rsz_conf_chan->input_buf_index = vb->i;
++ outsize = multipass->out_pitch *
++ multipass->out_vsize;
++ insize = multipass->in_pitch *
++ multipass->in_vsize;
++ if (outsize < insize) {
++ rsz_conf_chan->register_config.
++ rsz_sdr_outadd
++ = isp_addr;
++ rsz_conf_chan->
++ output_buf_index =
++ vb->i;
++ }
++
++ fh->isp_addr_read = isp_addr;
++ }
++ }
++ }
++
++ }
++
++ if (!err) {
++ spin_lock(&fh->vbq_lock);
++ vb->state = VIDEOBUF_PREPARED;
++ spin_unlock(&fh->vbq_lock);
++ flush_cache_user_range(NULL, vb->baddr, (vb->baddr
++ + vb->bsize));
++ } else
++ rsz_vbq_release(q, vb);
++
++out:
++ return err;
++}
++
++static void rsz_vbq_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
++{
++ return;
++}
++
++/**
++ * rsz_open - Initializes and opens the Resizer Wrapper
++ * @inode: Inode structure associated with the Resizer Wrapper
++ * @filp: File structure associated with the Resizer Wrapper
++ *
++ * Returns 0 if successful, -EBUSY if its already opened or the ISP module is
++ * not available, or -ENOMEM if its unable to allocate the device in kernel
++ * space memory.
++ **/
++static int rsz_open(struct inode *inode, struct file *filp)
++{
++ int ret = 0;
++ struct channel_config *rsz_conf_chan;
++ struct rsz_fh *fh;
++ struct device_params *device = device_config;
++ struct rsz_params *params;
++ struct rsz_mult *multipass;
++
++ if ((filp->f_flags & O_NONBLOCK) == O_NONBLOCK) {
++ printk(KERN_DEBUG "omap-resizer: Device is opened in "
++ "non blocking mode\n");
++ } else {
++ printk(KERN_DEBUG "omap-resizer: Device is opened in blocking "
++ "mode\n");
++ }
++ fh = kzalloc(sizeof(struct rsz_fh), GFP_KERNEL);
++ if (NULL == fh)
++ return -ENOMEM;
++
++ isp_get();
++
++ rsz_conf_chan = kzalloc(sizeof(struct channel_config), GFP_KERNEL);
++ if (rsz_conf_chan == NULL) {
++ dev_err(rsz_device, "\n cannot allocate memory to config");
++ ret = -ENOMEM;
++ goto err_enomem0;
++ }
++ params = kzalloc(sizeof(struct rsz_params), GFP_KERNEL);
++ if (params == NULL) {
++ dev_err(rsz_device, "\n cannot allocate memory to params");
++ ret = -ENOMEM;
++ goto err_enomem1;
++ }
++ multipass = kzalloc(sizeof(struct rsz_mult), GFP_KERNEL);
++ if (multipass == NULL) {
++ dev_err(rsz_device, "\n cannot allocate memory to multipass");
++ ret = -ENOMEM;
++ goto err_enomem2;
++ }
++
++ fh->multipass = multipass;
++ fh->params = params;
++ fh->config = rsz_conf_chan;
++
++ if (mutex_lock_interruptible(&device->reszwrap_mutex)) {
++ ret = -EINTR;
++ goto err_enomem2;
++ }
++ device->opened++;
++ mutex_unlock(&device->reszwrap_mutex);
++
++ rsz_conf_chan->config_state = STATE_NOT_CONFIGURED;
++ rsz_conf_chan->status = CHANNEL_FREE;
++
++ filp->private_data = fh;
++ fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++ fh->device = device;
++
++ videobuf_queue_sg_init(&fh->vbq, &device->vbq_ops, NULL,
++ &fh->vbq_lock, fh->type,
++ V4L2_FIELD_NONE,
++ sizeof(struct videobuf_buffer), fh);
++
++ spin_lock_init(&fh->vbq_lock);
++ mutex_init(&rsz_conf_chan->chanprotection_mutex);
++
++ return 0;
++err_enomem2:
++ kfree(params);
++err_enomem1:
++ kfree(rsz_conf_chan);
++err_enomem0:
++ kfree(fh);
++ return ret;
++}
++
++/**
++ * rsz_release - Releases Resizer Wrapper and frees up allocated memory
++ * @inode: Inode structure associated with the Resizer Wrapper
++ * @filp: File structure associated with the Resizer Wrapper
++ *
++ * Returns 0 if successful, or -EBUSY if channel is being used.
++ **/
++static int rsz_release(struct inode *inode, struct file *filp)
++{
++ u32 timeout = 0;
++ struct rsz_fh *fh = filp->private_data;
++ struct channel_config *rsz_conf_chan = fh->config;
++ struct rsz_params *params = fh->params;
++ struct rsz_mult *multipass = fh->multipass;
++ struct videobuf_queue *q = &fh->vbq;
++
++ while ((rsz_conf_chan->status != CHANNEL_FREE) && (timeout < 20)) {
++ timeout++;
++ schedule();
++ }
++ if (mutex_lock_interruptible(&device_config->reszwrap_mutex))
++ return -EINTR;
++ device_config->opened--;
++ mutex_unlock(&device_config->reszwrap_mutex);
++ /* This will Free memory allocated to the buffers,
++ * and flushes the queue
++ */
++ videobuf_queue_cancel(q);
++ fh->params = NULL;
++ fh->config = NULL;
++
++ fh->rsz_bufsize = 0;
++ filp->private_data = NULL;
++
++ kfree(rsz_conf_chan);
++ kfree(params);
++ kfree(multipass);
++ kfree(fh);
++
++ isp_put();
++
++ return 0;
++}
++
++/**
++ * rsz_mmap - Memory maps the Resizer Wrapper module.
++ * @file: File structure associated with the Resizer Wrapper
++ * @vma: Virtual memory area structure.
++ *
++ * Returns 0 if successful, or returned value by the videobuf_mmap_mapper()
++ * function.
++ **/
++static int rsz_mmap(struct file *file, struct vm_area_struct *vma)
++{
++ struct rsz_fh *fh = file->private_data;
++
++ return videobuf_mmap_mapper(&fh->vbq, vma);
++}
++
++/**
++ * rsz_ioctl - I/O control function for Resizer Wrapper
++ * @inode: Inode structure associated with the Resizer Wrapper.
++ * @file: File structure associated with the Resizer Wrapper.
++ * @cmd: Type of command to execute.
++ * @arg: Argument to send to requested command.
++ *
++ * Returns 0 if successful, -EBUSY if channel is being used, -1 if bad command
++ * passed or access is denied, -EFAULT if copy_from_user() or copy_to_user()
++ * fails, -EINVAL if parameter validation fails or parameter structure is not
++ * present.
++ **/
++static long rsz_unlocked_ioctl(struct file *file, unsigned int cmd,
++ unsigned long arg)
++{
++ int ret = 0;
++ struct rsz_fh *fh = file->private_data;
++ struct device_params *device = fh->device;
++ struct channel_config *rsz_conf_chan = fh->config;
++
++ if ((_IOC_TYPE(cmd) != RSZ_IOC_BASE)
++ || (_IOC_NR(cmd) > RSZ_IOC_MAXNR)) {
++ dev_err(rsz_device, "Bad command value \n");
++ return -1;
++ }
++
++ if (_IOC_DIR(cmd) & _IOC_READ)
++ ret = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
++ else if (_IOC_DIR(cmd) & _IOC_WRITE)
++ ret = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
++
++ if (ret) {
++ dev_err(rsz_device, "Access denied\n");
++ return -1;
++ }
++
++ switch (cmd) {
++ case RSZ_REQBUF:
++ {
++ struct v4l2_requestbuffers req_buf;
++ if (copy_from_user(&req_buf, (struct v4l2_requestbuffers *)arg,
++ sizeof(struct v4l2_requestbuffers))) {
++ return -EFAULT;
++ }
++ if (mutex_lock_interruptible(&rsz_conf_chan->
++ chanprotection_mutex))
++ return -EINTR;
++ ret = videobuf_reqbufs(&fh->vbq, (void *)&req_buf);
++ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ break;
++ }
++ case RSZ_QUERYBUF:
++ {
++ struct v4l2_buffer buf;
++ if (copy_from_user(&buf, (struct v4l2_buffer *)arg,
++ sizeof(struct v4l2_buffer))) {
++ return -EFAULT;
++ }
++ if (mutex_lock_interruptible(&rsz_conf_chan->
++ chanprotection_mutex))
++ return -EINTR;
++ ret = videobuf_querybuf(&fh->vbq, (void *)&buf);
++ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ if (copy_to_user((struct v4l2_buffer *)arg, &buf,
++ sizeof(struct v4l2_buffer)))
++ return -EFAULT;
++ break;
++ }
++ case RSZ_QUEUEBUF:
++ {
++ struct v4l2_buffer buf;
++ if (copy_from_user(&buf, (struct v4l2_buffer *)arg,
++ sizeof(struct v4l2_buffer))) {
++ return -EFAULT;
++ }
++ if (mutex_lock_interruptible(&rsz_conf_chan->
++ chanprotection_mutex))
++ return -EINTR;
++ ret = videobuf_qbuf(&fh->vbq, (void *)&buf);
++ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ break;
++ }
++ case RSZ_S_PARAM:
++ {
++ struct rsz_params *params = fh->params;
++ if (copy_from_user(params, (struct rsz_params *)arg,
++ sizeof(struct rsz_params))) {
++ return -EFAULT;
++ }
++ if (mutex_lock_interruptible(&rsz_conf_chan->
++ chanprotection_mutex))
++ return -EINTR;
++ ret = rsz_set_params(fh->multipass, params, rsz_conf_chan);
++ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ break;
++ }
++ case RSZ_G_PARAM:
++ ret = rsz_get_params((struct rsz_params *)arg, rsz_conf_chan);
++ break;
++
++ case RSZ_G_STATUS:
++ {
++ struct rsz_status *status;
++ status = (struct rsz_status *)arg;
++ status->chan_busy = rsz_conf_chan->status;
++ status->hw_busy = ispresizer_busy();
++ status->src = INPUT_RAM;
++ break;
++ }
++ case RSZ_RESIZE:
++ if (file->f_flags & O_NONBLOCK) {
++ if (ispresizer_busy())
++ return -EBUSY;
++ else {
++ if (!mutex_trylock(&device->reszwrap_mutex))
++ return -EBUSY;
++ }
++ } else {
++ if (mutex_lock_interruptible(&device->reszwrap_mutex))
++ return -EINTR;
++ }
++ ret = rsz_start((int *)arg, fh);
++ mutex_unlock(&device->reszwrap_mutex);
++ break;
++ case RSZ_GET_CROPSIZE:
++ rsz_calculate_crop(rsz_conf_chan, (struct rsz_cropsize *)arg);
++ break;
++
++ default:
++ dev_err(rsz_device, "resizer_ioctl: Invalid Command Value");
++ return -EINVAL;
++ }
++
++ return (long)ret;
++}
++
++static struct file_operations rsz_fops = {
++ .owner = THIS_MODULE,
++ .open = rsz_open,
++ .release = rsz_release,
++ .mmap = rsz_mmap,
++ .unlocked_ioctl = rsz_unlocked_ioctl,
++};
++
++/**
++ * rsz_isr - Interrupt Service Routine for Resizer wrapper
++ * @status: ISP IRQ0STATUS register value
++ * @arg1: Currently not used
++ * @arg2: Currently not used
++ *
++ * Interrupt Service Routine for Resizer wrapper
++ **/
++static void rsz_isr(unsigned long status, isp_vbq_callback_ptr arg1, void *arg2)
++{
++
++ if ((status & RESZ_DONE) != RESZ_DONE)
++ return;
++
++ complete(&(device_config->compl_isr));
++
++}
++
++/**
++ * resizer_platform_release - Acts when Reference count is zero
++ * @device: Structure containing ISP resizer wrapper global information
++ *
++ * This is called when the reference count goes to zero.
++ **/
++static void resizer_platform_release(struct device *device)
++{
++}
++
++/**
++ * resizer_probe - Checks for device presence
++ * @device: Structure containing details of the current device.
++ *
++ * Always returns 0.
++ **/
++static int __init resizer_probe(struct platform_device *device)
++{
++ return 0;
++}
++
++/**
++ * resizer_remove - Handles the removal of the driver
++ * @omap_resizer_device: Structure containing details of the current device.
++ *
++ * Always returns 0.
++ **/
++static int resizer_remove(struct platform_device *omap_resizer_device)
++{
++ return 0;
++}
++
++static struct class *rsz_class;
++static struct cdev c_dev;
++static dev_t dev;
++static struct platform_device omap_resizer_device = {
++ .name = OMAP_REZR_NAME,
++ .id = 2,
++ .dev = {
++ .release = resizer_platform_release,}
++};
++
++static struct platform_driver omap_resizer_driver = {
++ .probe = resizer_probe,
++ .remove = resizer_remove,
++ .driver = {
++ .bus = &platform_bus_type,
++ .name = OMAP_REZR_NAME,
++ },
++};
++
++/**
++ * omap_rsz_init - Initialization of Resizer Wrapper
++ *
++ * Returns 0 if successful, -ENOMEM if could not allocate memory, -ENODEV if
++ * could not register the wrapper as a character device, or other errors if the
++ * device or driver can't register.
++ **/
++static int __init omap_rsz_init(void)
++{
++ int ret = 0;
++ struct device_params *device;
++ device = kzalloc(sizeof(struct device_params), GFP_KERNEL);
++ if (!device) {
++ dev_err(rsz_device, OMAP_REZR_NAME ": could not allocate "
++ "memory\n");
++ return -ENOMEM;
++ }
++
++ ret = alloc_chrdev_region(&dev, 0, 1, OMAP_REZR_NAME);
++ if (ret < 0) {
++ dev_err(rsz_device, OMAP_REZR_NAME ": intialization failed. "
++ "Could not allocate region "
++ "for character device\n");
++ kfree(device);
++ return -ENODEV;
++ }
++
++ /* Register the driver in the kernel */
++ /* Initialize of character device */
++ cdev_init(&c_dev, &rsz_fops);
++ c_dev.owner = THIS_MODULE;
++ c_dev.ops = &rsz_fops;
++
++ /* Addding character device */
++ ret = cdev_add(&c_dev, dev, 1);
++ if (ret) {
++ dev_err(rsz_device, OMAP_REZR_NAME ": Error adding "
++ "device - %d\n", ret);
++ goto fail2;
++ }
++ rsz_major = MAJOR(dev);
++
++ /* register driver as a platform driver */
++ ret = platform_driver_register(&omap_resizer_driver);
++ if (ret) {
++ dev_err(rsz_device, OMAP_REZR_NAME
++ ": Failed to register platform driver!\n");
++ goto fail3;
++ }
++
++ /* Register the drive as a platform device */
++ ret = platform_device_register(&omap_resizer_device);
++ if (ret) {
++ dev_err(rsz_device, OMAP_REZR_NAME
++ ": Failed to register platform device!\n");
++ goto fail4;
++ }
++
++ rsz_class = class_create(THIS_MODULE, OMAP_REZR_NAME);
++ if (!rsz_class) {
++ dev_err(rsz_device, OMAP_REZR_NAME
++ ": Failed to create class!\n");
++ goto fail5;
++ }
++
++ /* make entry in the devfs */
++ rsz_device = device_create(rsz_class, rsz_device,
++ MKDEV(rsz_major, 0), NULL,
++ OMAP_REZR_NAME);
++ dev_dbg(rsz_device, OMAP_REZR_NAME ": Registered Resizer Wrapper\n");
++ device->opened = 0;
++
++ device->vbq_ops.buf_setup = rsz_vbq_setup;
++ device->vbq_ops.buf_prepare = rsz_vbq_prepare;
++ device->vbq_ops.buf_release = rsz_vbq_release;
++ device->vbq_ops.buf_queue = rsz_vbq_queue;
++ init_completion(&device->compl_isr);
++ mutex_init(&device->reszwrap_mutex);
++
++ device_config = device;
++ return 0;
++
++fail5:
++ platform_device_unregister(&omap_resizer_device);
++fail4:
++ platform_driver_unregister(&omap_resizer_driver);
++fail3:
++ cdev_del(&c_dev);
++fail2:
++ unregister_chrdev_region(dev, 1);
++ kfree(device);
++ return ret;
++}
++
++/**
++ * omap_rsz_exit - Close of Resizer Wrapper
++ **/
++void __exit omap_rsz_exit(void)
++{
++ device_destroy(rsz_class, dev);
++ class_destroy(rsz_class);
++ platform_device_unregister(&omap_resizer_device);
++ platform_driver_unregister(&omap_resizer_driver);
++ cdev_del(&c_dev);
++ unregister_chrdev_region(dev, 1);
++ kfree(device_config);
++}
++
++module_init(omap_rsz_init)
++module_exit(omap_rsz_exit)
++
++MODULE_AUTHOR("Texas Instruments");
++MODULE_DESCRIPTION("OMAP ISP Resizer");
++MODULE_LICENSE("GPL");
+diff --git a/include/linux/omap_resizer.h b/include/linux/omap_resizer.h
+new file mode 100644
+index 0000000..5ac0c88
+--- /dev/null
++++ b/include/linux/omap_resizer.h
+@@ -0,0 +1,136 @@
++/*
++ * drivers/media/video/isp/omap_resizer.h
++ *
++ * Include file for Resizer module wrapper in TI's OMAP3430 ISP
++ *
++ * Copyright (C) 2008 Texas Instruments, Inc.
++ *
++ * This package 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.
++ *
++ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++#ifndef OMAP_RESIZER_H
++#define OMAP_RESIZER_H
++
++#include <linux/types.h>
++
++/* ioctls definition */
++#define RSZ_IOC_BASE 'R'
++#define RSZ_IOC_MAXNR 8
++
++/*Ioctl options which are to be passed while calling the ioctl*/
++#define RSZ_REQBUF _IOWR(RSZ_IOC_BASE, 1,\
++ struct v4l2_requestbuffers)
++#define RSZ_QUERYBUF _IOWR(RSZ_IOC_BASE, 2, struct v4l2_buffer)
++#define RSZ_S_PARAM _IOWR(RSZ_IOC_BASE, 3, struct rsz_params)
++#define RSZ_G_PARAM _IOWR(RSZ_IOC_BASE, 4, struct rsz_params)
++#define RSZ_RESIZE _IOWR(RSZ_IOC_BASE, 5, __s32)
++#define RSZ_G_STATUS _IOWR(RSZ_IOC_BASE, 6, struct rsz_status)
++#define RSZ_QUEUEBUF _IOWR(RSZ_IOC_BASE, 7, struct v4l2_buffer)
++#define RSZ_GET_CROPSIZE _IOWR(RSZ_IOC_BASE, 8, struct rsz_cropsize)
++
++#define RSZ_INTYPE_YCBCR422_16BIT 0
++#define RSZ_INTYPE_PLANAR_8BIT 1
++#define RSZ_PIX_FMT_UYVY 1 /* cb:y:cr:y */
++#define RSZ_PIX_FMT_YUYV 0 /* y:cb:y:cr */
++
++enum config_done {
++ STATE_CONFIGURED, /* Resizer driver configured
++ * by application.
++ */
++ STATE_NOT_CONFIGURED /* Resizer driver not
++ * configured by application.
++ */
++};
++
++/* Structure Definitions */
++
++/* used to luma enhancement options */
++
++struct rsz_yenh {
++ __s32 type; /* represents luma enable or
++ * disable.
++ */
++ __u8 gain; /* represents gain. */
++ __u8 slop; /* represents slop. */
++ __u8 core; /* Represents core value. */
++};
++
++/* Conatins all the parameters for resizing. This structure
++ * is used to configure resiser parameters
++ */
++struct rsz_params {
++ __s32 in_hsize; /* input frame horizontal
++ * size.
++ */
++ __s32 in_vsize; /* input frame vertical size */
++ __s32 in_pitch; /* offset between two rows of
++ * input frame.
++ */
++ __s32 inptyp; /* for determining 16 bit or
++ * 8 bit data.
++ */
++ __s32 vert_starting_pixel; /* for specifying vertical
++ * starting pixel in input.
++ */
++ __s32 horz_starting_pixel; /* for specyfing horizontal
++ * starting pixel in input.
++ */
++ __s32 cbilin; /* # defined, filter with luma
++ * or bi-linear interpolation.
++ */
++ __s32 pix_fmt; /* # defined, UYVY or YUYV */
++ __s32 out_hsize; /* output frame horizontal
++ * size.
++ */
++ __s32 out_vsize; /* output frame vertical
++ * size.
++ */
++ __s32 out_pitch; /* offset between two rows of
++ * output frame.
++ */
++ __s32 hstph; /* for specifying horizontal
++ * starting phase.
++ */
++ __s32 vstph; /* for specifying vertical
++ * starting phase.
++ */
++ __u16 tap4filt_coeffs[32]; /* horizontal filter
++ * coefficients.
++ */
++ __u16 tap7filt_coeffs[32]; /* vertical filter
++ * coefficients.
++ */
++ struct rsz_yenh yenh_params;
++};
++
++/* Contains the status of hardware and channel */
++struct rsz_status {
++ __s32 chan_busy; /* 1: channel is busy,
++ * 0: channel is not busy
++ */
++ __s32 hw_busy; /* 1: hardware is busy,
++ * 0: hardware is not busy
++ */
++ __s32 src; /* # defined, can be either
++ * SD-RAM or CCDC/PREVIEWER
++ */
++};
++
++/* Passed by application for getting crop size */
++struct rsz_cropsize {
++ __u32 hcrop; /* Number of pixels per line
++ * cropped in output image.
++ */
++
++ __u32 vcrop; /* Number of lines cropped
++ * in output image.
++ */
++};
++
++#endif
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch b/recipes/linux/linux-omap-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch
new file mode 100644
index 0000000000..2c3023643e
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch
@@ -0,0 +1,729 @@
+From ad3bbadb7fc39a946dfd0cdac19e2ec8647b2c2c Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 17:20:27 +0530
+Subject: [PATCH 24/26] OMAP3-Resizer: V4L2-buf layer issues fixed
+
+V4L2-Buffer layer issues fixed under this commit.
+This patch is same as available with PSP1.0.2 release
+
+The discussion is initiated on this with V4L2 mailing list.
+
+Please note that this patch is not being tested.
+---
+ drivers/media/video/isp/omap_resizer.c | 417 ++++++++++++++++++++++++--------
+ include/linux/omap_resizer.h | 3 +-
+ 2 files changed, 321 insertions(+), 99 deletions(-)
+
+diff --git a/drivers/media/video/isp/omap_resizer.c b/drivers/media/video/isp/omap_resizer.c
+index 54bc425..8059c70 100644
+--- a/drivers/media/video/isp/omap_resizer.c
++++ b/drivers/media/video/isp/omap_resizer.c
+@@ -28,6 +28,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+ #include <linux/uaccess.h>
++#include <linux/pci.h>
+ #include <media/v4l2-dev.h>
+ #include <asm/cacheflush.h>
+
+@@ -76,6 +77,10 @@
+ #define MAX_COEF_COUNTER 16
+ #define COEFF_ADDRESS_OFFSET 0x04
+
++#define RSZ_DEF_REQ_EXP 0xE /* Default read operation expand
++ * for the Resizer driver; value
++ * taken from Davinci.
++ */
+ /* Global structure which contains information about number of channels
+ and protection variables */
+ struct device_params {
+@@ -85,6 +90,7 @@ struct device_params {
+ struct mutex reszwrap_mutex; /* Semaphore for array */
+
+ struct videobuf_queue_ops vbq_ops; /* videobuf queue operations */
++ unsigned long extra_page_addr;
+ };
+
+ /* Register mapped structure which contains the every register
+@@ -126,6 +132,9 @@ struct resizer_config {
+ u32 rsz_yehn; /* yehn(luma)register mapping
+ * variable.
+ */
++ u32 sdr_req_exp; /* Configuration for Non
++ * real time read expand
++ */
+ };
+
+ struct rsz_mult {
+@@ -179,6 +188,7 @@ struct channel_config {
+ * channel is busy or not
+ */
+ struct mutex chanprotection_mutex;
++ int buf_address[VIDEO_MAX_FRAME];
+ enum config_done config_state;
+ u8 input_buf_index;
+ u8 output_buf_index;
+@@ -200,8 +210,6 @@ struct rsz_fh {
+ struct videobuf_queue vbq;
+ struct device_params *device;
+
+- dma_addr_t isp_addr_read; /* Input/Output address */
+- dma_addr_t isp_addr_write; /* Input/Output address */
+ u32 rsz_bufsize; /* channel specific buffersize
+ */
+ };
+@@ -227,6 +235,10 @@ static int rsz_set_ratio(struct rsz_mult *multipass,
+ static void rsz_config_ratio(struct rsz_mult *multipass,
+ struct channel_config *rsz_conf_chan);
+
++static void inline rsz_set_exp(unsigned int exp)
++{
++ omap_writel(((exp & 0x3FF) << 10), OMAP3ISP_SBL_REG(0xF8));
++}
+ /**
+ * rsz_hardware_setup - Sets hardware configuration registers
+ * @rsz_conf_chan: Structure containing channel configuration
+@@ -271,12 +283,15 @@ static void rsz_hardware_setup(struct channel_config *rsz_conf_chan)
+ + coeffoffset));
+ coeffoffset = coeffoffset + COEFF_ADDRESS_OFFSET;
+ }
++ /* Configure the read expand register */
++ rsz_set_exp(rsz_conf_chan->register_config.sdr_req_exp);
+ }
+
+ /**
+ * rsz_start - Enables Resizer Wrapper
+ * @arg: Currently not used.
+- * @device: Structure containing ISP resizer wrapper global information
++ * @fh: File structure containing ISP resizer information specific to
++ * channel opened.
+ *
+ * Submits a resizing task specified by the rsz_resize structure. The call can
+ * either be blocked until the task is completed or returned immediately based
+@@ -292,12 +307,18 @@ int rsz_start(int *arg, struct rsz_fh *fh)
+ struct channel_config *rsz_conf_chan = fh->config;
+ struct rsz_mult *multipass = fh->multipass;
+ struct videobuf_queue *q = &fh->vbq;
++ struct videobuf_buffer *buf;
+ int ret;
+
+ if (rsz_conf_chan->config_state) {
+ dev_err(rsz_device, "State not configured \n");
+ goto err_einval;
+ }
++ if (!rsz_conf_chan->register_config.rsz_sdr_inadd ||
++ !rsz_conf_chan->register_config.rsz_sdr_outadd) {
++ dev_err(rsz_device, "address is null\n");
++ goto err_einval;
++ }
+
+ rsz_conf_chan->status = CHANNEL_BUSY;
+
+@@ -325,33 +346,22 @@ mult:
+ goto mult;
+ }
+
+- if (fh->isp_addr_read) {
+- ispmmu_unmap(fh->isp_addr_read);
+- fh->isp_addr_read = 0;
+- }
+- if (fh->isp_addr_write) {
+- ispmmu_unmap(fh->isp_addr_write);
+- fh->isp_addr_write = 0;
+- }
+-
+ rsz_conf_chan->status = CHANNEL_FREE;
+- q->bufs[rsz_conf_chan->input_buf_index]->state = VIDEOBUF_NEEDS_INIT;
+- q->bufs[rsz_conf_chan->output_buf_index]->state = VIDEOBUF_NEEDS_INIT;
+ rsz_conf_chan->register_config.rsz_sdr_outadd = 0;
+ rsz_conf_chan->register_config.rsz_sdr_inadd = 0;
+
+- /* Unmap and free the DMA memory allocated for buffers */
+- videobuf_dma_unmap(q, videobuf_to_dma(
+- q->bufs[rsz_conf_chan->input_buf_index]));
+- videobuf_dma_unmap(q, videobuf_to_dma(
+- q->bufs[rsz_conf_chan->output_buf_index]));
+- videobuf_dma_free(videobuf_to_dma(
+- q->bufs[rsz_conf_chan->input_buf_index]));
+- videobuf_dma_free(videobuf_to_dma(
+- q->bufs[rsz_conf_chan->output_buf_index]));
+-
+ isp_unset_callback(CBK_RESZ_DONE);
+
++ /* Empty the Videobuf queue which was filled during the qbuf */
++ buf = q->bufs[rsz_conf_chan->input_buf_index];
++ buf->state = VIDEOBUF_IDLE;
++ list_del(&buf->stream);
++ if (rsz_conf_chan->input_buf_index != rsz_conf_chan->output_buf_index) {
++ buf = q->bufs[rsz_conf_chan->output_buf_index];
++ buf->state = VIDEOBUF_IDLE;
++ list_del(&buf->stream);
++ }
++
+ return 0;
+ err_einval:
+ return -EINVAL;
+@@ -359,6 +369,8 @@ err_einval:
+
+ /**
+ * rsz_set_multipass - Set resizer multipass
++ * @multipass: Structure containing channel configuration
++ for multipass support
+ * @rsz_conf_chan: Structure containing channel configuration
+ *
+ * Returns always 0
+@@ -384,6 +396,8 @@ static int rsz_set_multipass(struct rsz_mult *multipass,
+
+ /**
+ * rsz_copy_data - Copy data
++ * @multipass: Structure containing channel configuration
++ for multipass support
+ * @params: Structure containing the Resizer Wrapper parameters
+ *
+ * Copy data
+@@ -413,6 +427,8 @@ static void rsz_copy_data(struct rsz_mult *multipass, struct rsz_params *params)
+
+ /**
+ * rsz_set_params - Set parameters for resizer wrapper
++ * @multipass: Structure containing channel configuration
++ for multipass support
+ * @params: Structure containing the Resizer Wrapper parameters
+ * @rsz_conf_chan: Structure containing channel configuration
+ *
+@@ -524,6 +540,8 @@ static int rsz_set_params(struct rsz_mult *multipass, struct rsz_params *params,
+ }
+
+ rsz_config_ratio(multipass, rsz_conf_chan);
++ /* Default value for read expand:Taken from Davinci */
++ rsz_conf_chan->register_config.sdr_req_exp = RSZ_DEF_REQ_EXP;
+
+ rsz_conf_chan->config_state = STATE_CONFIGURED;
+
+@@ -534,6 +552,8 @@ err_einval:
+
+ /**
+ * rsz_set_ratio - Set ratio
++ * @multipass: Structure containing channel configuration
++ for multipass support
+ * @rsz_conf_chan: Structure containing channel configuration
+ *
+ * Returns 0 if successful, -EINVAL if invalid output size, upscaling ratio is
+@@ -548,7 +568,8 @@ static int rsz_set_ratio(struct rsz_mult *multipass,
+
+ if ((multipass->out_hsize > MAX_IMAGE_WIDTH) ||
+ (multipass->out_vsize > MAX_IMAGE_WIDTH)) {
+- dev_err(rsz_device, "Invalid output size!");
++ dev_err(rsz_device, "Invalid output size! - %d", \
++ multipass->out_hsize);
+ goto err_einval;
+ }
+ if (multipass->cbilin) {
+@@ -758,6 +779,8 @@ err_einval:
+
+ /**
+ * rsz_config_ratio - Configure ratio
++ * @multipass: Structure containing channel configuration
++ for multipass support
+ * @rsz_conf_chan: Structure containing channel configuration
+ *
+ * Configure ratio
+@@ -789,6 +812,20 @@ static void rsz_config_ratio(struct rsz_mult *multipass,
+ ((vsize << ISPRSZ_IN_SIZE_VERT_SHIFT)
+ & ISPRSZ_IN_SIZE_VERT_MASK);
+
++ /* This is another workaround for the ISP-MMU translation fault.
++ For the parameters whose image size comes exactly to PAGE_SIZE
++ generates ISP-MMU translation fault. The root-cause is the equation
++ input width = (32*sph + (ow - 1)*hrsz + 16) >> 8 + 7
++ = (64*sph + (ow - 1)*hrsz + 32) >> 8 + 7
++ input height = (32*spv + (oh - 1)*vrsz + 16) >> 8 + 4
++ = (64*spv + (oh - 1)*vrsz + 32) >> 8 + 7
++
++ we are adjusting the input width to suit for Resizer module,
++ application should use this configuration henceforth.
++ */
++ multipass->in_hsize = hsize;
++ multipass->in_vsize = vsize;
++
+ for (coeffcounter = 0; coeffcounter < MAX_COEF_COUNTER;
+ coeffcounter++) {
+ if (multipass->num_htap) {
+@@ -990,24 +1027,15 @@ static void rsz_calculate_crop(struct channel_config *rsz_conf_chan,
+ static void rsz_vbq_release(struct videobuf_queue *q,
+ struct videobuf_buffer *vb)
+ {
+- int i;
+ struct rsz_fh *fh = q->priv_data;
++ struct videobuf_dmabuf *dma = NULL;
+
+- for (i = 0; i < VIDEO_MAX_FRAME; i++) {
+- struct videobuf_dmabuf *dma = NULL;
+- if (!q->bufs[i])
+- continue;
+- if (q->bufs[i]->memory != V4L2_MEMORY_MMAP)
+- continue;
+- dma = videobuf_to_dma(q->bufs[i]);
+- videobuf_dma_unmap(q, dma);
+- videobuf_dma_free(dma);
+- }
++ dma = videobuf_to_dma(q->bufs[vb->i]);
++ videobuf_dma_unmap(q, dma);
++ videobuf_dma_free(dma);
++ ispmmu_unmap(fh->config->buf_address[vb->i]);
++ fh->config->buf_address[vb->i] = 0;
+
+- ispmmu_unmap(fh->isp_addr_read);
+- ispmmu_unmap(fh->isp_addr_write);
+- fh->isp_addr_read = 0;
+- fh->isp_addr_write = 0;
+ spin_lock(&fh->vbq_lock);
+ vb->state = VIDEOBUF_NEEDS_INIT;
+ spin_unlock(&fh->vbq_lock);
+@@ -1062,7 +1090,105 @@ err_einval:
+ spin_unlock(&fh->vbq_lock);
+ return -EINVAL;
+ }
++/*
++ * This function is work around for the videobuf_iolock API,
++ * for User memory allocated with ioremap (VM_IO flag) the API
++ * get_user_pages fails.
++ *
++ * To fulfill this requirement, we have completely ignored VM layer of
++ * Linux, and configuring the ISP MMU with physical address.
++ */
++static int omap_videobuf_dma_init_user(struct videobuf_buffer *vb,
++ unsigned long physp, unsigned long asize)
++{
++ struct videobuf_dmabuf *dma;
++ struct scatterlist *sglist;
++ unsigned long data, first, last;
++ int len, i = 0;
++
++ dma = videobuf_to_dma(vb);
++ data = vb->baddr;
++
++ first = (data & PAGE_MASK) >> PAGE_SHIFT;
++ last = ((data+asize-1) & PAGE_MASK) >> PAGE_SHIFT;
++ dma->offset = data & ~PAGE_MASK;
++ dma->nr_pages = last-first+1;
++
++ dma->direction = PCI_DMA_FROMDEVICE;
++ /*
++ * Allocate array of sglen + 1, to add entry of extra page
++ * for input buffer. Driver always uses 0th buffer as input buffer.
++ */
++ len = dma->nr_pages + (vb->i ? 0 : 1);
++ sglist = kcalloc(len, sizeof(*sglist), GFP_KERNEL);
++ if (NULL == sglist)
++ return -ENOMEM;
++
++ sglist[0].offset = 0;
++ sglist[0].length = PAGE_SIZE - dma->offset;
++ sglist[0].dma_address = (dma_addr_t)physp;
++ physp += sglist[0].length;
++ /*
++ * Iterate in a loop for the number of pages
++ */
++ for (i = 1; i < (len - (vb->i ? 0 : 1)); i++) {
++ sglist[i].offset = 0;
++ sglist[i].length = PAGE_SIZE;
++ sglist[i].dma_address = (dma_addr_t)physp;
++ physp += PAGE_SIZE;
++ }
++ if (0 == vb->i) {
++ sglist[i].offset = 0;
++ sglist[i].length = PAGE_SIZE;
++ sglist[i].dma_address =
++ (dma_addr_t)device_config->extra_page_addr;
++ }
++ dma->sglist = sglist;
++ dma->sglen = len;
++ return 0;
++
++ }
++/*
++ * This function is workaround for the issue, where ISP-MMU generated
++ * translation fault for specific params whose size is aligned to PAGE_SIZE.
++
++ * As a workaround we are padding one extra page for input buffer. This page
++ * we are allocating during init time and will not be released through-out
++ * life time of resizer driver. Please note that Resizer module only reads
++ * from this extra page.
++ */
++int omap_create_sg(struct videobuf_queue *q, struct videobuf_dmabuf *dma)
++{
++ struct scatterlist *sglist;
++ int sglen;
+
++ sglen = dma->sglen;
++ sglist = kcalloc(sglen + 1, sizeof(*sglist), GFP_KERNEL);
++ if (NULL == sglist)
++ return -ENOMEM;
++ /*
++ * Copy the sglist locally
++ */
++ memcpy(sglist, dma->sglist, sglen * sizeof(*sglist));
++ /*
++ * Release the old sglist, since we already copied it locally
++ */
++ videobuf_dma_unmap(q, dma);
++ /*
++ * Add extra entry to sglist to work with specific params, whose
++ * buffer address alined to PAGE_SIZE.
++ */
++ sglist[sglen].offset = 0;
++ sglist[sglen].length = PAGE_SIZE;
++ sglist[sglen].dma_address = (dma_addr_t)device_config->extra_page_addr;
++ sglen++;
++ /*
++ * Save the sglist for mapping to ISP-MMU space
++ */
++ dma->sglist = sglist;
++ dma->sglen = sglen;
++ return 0;
++}
+ /**
+ * rsz_vbq_prepare - Videobuffer is prepared and mmapped.
+ * @q: Structure containing the videobuffer queue file handle, and device
+@@ -1079,19 +1205,24 @@ static int rsz_vbq_prepare(struct videobuf_queue *q,
+ {
+ struct rsz_fh *fh = q->priv_data;
+ struct channel_config *rsz_conf_chan = fh->config;
+- struct rsz_mult *multipass = fh->multipass;
+ int err = 0;
+ unsigned int isp_addr, insize, outsize;
+- struct videobuf_dmabuf *dma = videobuf_to_dma(vb);
+-
++ struct rsz_mult *multipass = fh->multipass;
+ spin_lock(&fh->vbq_lock);
+ if (vb->baddr) {
++ /* Check for 32 byte alignement */
++ if (vb->baddr != (vb->baddr & ~0x1F)) {
++ spin_unlock(&fh->vbq_lock);
++ dev_err(rsz_device, "Buffer address should be aligned \
++ to 32 byte\n");
++ return -EINVAL;
++ }
+ vb->size = fh->rsz_bufsize;
+ vb->bsize = fh->rsz_bufsize;
+ } else {
+ spin_unlock(&fh->vbq_lock);
+ dev_err(rsz_device, "No user buffer allocated\n");
+- goto out;
++ return -EINVAL;
+ }
+ if (vb->i) {
+ vb->width = fh->params->out_hsize;
+@@ -1103,55 +1234,128 @@ static int rsz_vbq_prepare(struct videobuf_queue *q,
+
+ vb->field = field;
+ spin_unlock(&fh->vbq_lock);
++ /*
++ * Calculate input and output sizes, will be used while mapping
++ * user pages
++ */
++ outsize = multipass->out_pitch * multipass->out_vsize;
++ insize = multipass->in_pitch * multipass->in_vsize;
+
+ if (vb->state == VIDEOBUF_NEEDS_INIT) {
+- err = videobuf_iolock(q, vb, NULL);
+- if (!err) {
+- isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
+- if (!isp_addr)
+- err = -EIO;
+- else {
+- if (vb->i) {
+- rsz_conf_chan->register_config.
+- rsz_sdr_outadd
+- = isp_addr;
+- fh->isp_addr_write = isp_addr;
+- rsz_conf_chan->output_buf_index = vb->i;
+- } else {
++ struct videobuf_dmabuf *dma;
++ struct vm_area_struct *vma;
++ spin_lock(&fh->vbq_lock);
++ dma = videobuf_to_dma(vb);
++ vma = find_vma(current->mm, vb->baddr);
++ if ((vma) && (vma->vm_flags & VM_IO) && (vma->vm_pgoff)) {
++ /* This will catch ioremaped buffers to the kernel.
++ * It gives two possible scenarios -
++ * - Driver allocates buffer using either
++ * dma_alloc_coherent or get_free_pages,
++ * and maps to user space using
++ * io_remap_pfn_range/remap_pfn_range
++ * - Drivers maps memory outside from Linux using
++ * io_remap
++ */
++ unsigned long physp = 0, asize;
++ asize = vb->i ? outsize : insize;
++ if ((vb->baddr + asize) > vma->vm_end) {
++ spin_unlock(&fh->vbq_lock);
++ dev_err(rsz_device, "User Buffer Allocation:" \
++ "err=%lu[%lu]\n",\
++ (vma->vm_end - vb->baddr), asize);
++ return -ENOMEM;
++ }
++ physp = (vma->vm_pgoff << PAGE_SHIFT) +
++ (vb->baddr - vma->vm_start);
++ err = omap_videobuf_dma_init_user(vb, physp, asize);
++ spin_unlock(&fh->vbq_lock);
++ if (0 != err)
++ return err;
++ } else {
++ err = videobuf_iolock(q, vb, NULL);
++ /*
++ * In case of user pointer mode, the get_user_pages
++ * will fail if user has allocated less memory than
++ * vb->size. But it is not error from resizer driver
++ * point of view. so handled seperately
++ */
++ if ((err < 0) && (dma->nr_pages > 0))
++ err = videobuf_dma_map(q, dma);
++ if (err)
++ goto buf_release;
++ /*
++ * Add one extra page for input buffer
++ */
++ if (0 == vb->i)
++ err = omap_create_sg(q, dma);
++ if (err)
++ goto buf_release;
++ spin_unlock(&fh->vbq_lock);
++ }
++ isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
++ if (!isp_addr)
++ err = -EIO;
++ else {
++ if (vb->i) {
++ rsz_conf_chan->buf_address[vb->i] = isp_addr;
++ rsz_conf_chan->register_config.
++ rsz_sdr_outadd
++ = isp_addr;
++ rsz_conf_chan->output_buf_index = vb->i;
++ } else {
++ rsz_conf_chan->buf_address[vb->i] = isp_addr;
++ rsz_conf_chan->register_config.
++ rsz_sdr_inadd
++ = isp_addr;
++ rsz_conf_chan->input_buf_index = vb->i;
++ if (outsize < insize && rsz_conf_chan->
++ register_config.
++ rsz_sdr_outadd == 0) {
+ rsz_conf_chan->register_config.
+- rsz_sdr_inadd
+- = isp_addr;
+- rsz_conf_chan->input_buf_index = vb->i;
+- outsize = multipass->out_pitch *
+- multipass->out_vsize;
+- insize = multipass->in_pitch *
+- multipass->in_vsize;
+- if (outsize < insize) {
+- rsz_conf_chan->register_config.
+- rsz_sdr_outadd
+- = isp_addr;
+- rsz_conf_chan->
+- output_buf_index =
+- vb->i;
+- }
+-
+- fh->isp_addr_read = isp_addr;
++ rsz_sdr_outadd
++ = isp_addr;
++ rsz_conf_chan->
++ output_buf_index =
++ vb->i;
+ }
+ }
+ }
+
+- }
++ } else {
++ if(vb->i) {
++ rsz_conf_chan->register_config.
++ rsz_sdr_outadd =
++ rsz_conf_chan->buf_address[vb->i];
++ rsz_conf_chan->output_buf_index = vb->i;
++ } else {
++ rsz_conf_chan->register_config.
++ rsz_sdr_inadd =
++ rsz_conf_chan->buf_address[vb->i];
++ rsz_conf_chan->input_buf_index = vb->i;
++ if(outsize < insize && rsz_conf_chan->
++ register_config.
++ rsz_sdr_outadd == 0) {
++ rsz_conf_chan->register_config.
++ rsz_sdr_outadd
++ = rsz_conf_chan->buf_address[vb->i];
++ rsz_conf_chan->output_buf_index = vb->i;
++ }
++
++ }
+
++ }
+ if (!err) {
+ spin_lock(&fh->vbq_lock);
+ vb->state = VIDEOBUF_PREPARED;
+ spin_unlock(&fh->vbq_lock);
+- flush_cache_user_range(NULL, vb->baddr, (vb->baddr
+- + vb->bsize));
+ } else
+ rsz_vbq_release(q, vb);
+
+-out:
++ return err;
++buf_release:
++ spin_unlock(&fh->vbq_lock);
++ rsz_vbq_release(q, vb);
+ return err;
+ }
+
+@@ -1255,7 +1459,8 @@ err_enomem0:
+ **/
+ static int rsz_release(struct inode *inode, struct file *filp)
+ {
+- u32 timeout = 0;
++ int i;
++ unsigned int timeout = 0;
+ struct rsz_fh *fh = filp->private_data;
+ struct channel_config *rsz_conf_chan = fh->config;
+ struct rsz_params *params = fh->params;
+@@ -1266,17 +1471,17 @@ static int rsz_release(struct inode *inode, struct file *filp)
+ timeout++;
+ schedule();
+ }
+- if (mutex_lock_interruptible(&device_config->reszwrap_mutex))
+- return -EINTR;
+- device_config->opened--;
+- mutex_unlock(&device_config->reszwrap_mutex);
+- /* This will Free memory allocated to the buffers,
+- * and flushes the queue
+- */
+- videobuf_queue_cancel(q);
+- fh->params = NULL;
+- fh->config = NULL;
++ /* Free memory allocated to the buffers */
++ for (i = 0 ; i < VIDEO_MAX_FRAME ; i++) {
++ struct videobuf_dmabuf *dma = NULL;
++ if (!q->bufs[i])
++ continue;
++ dma = videobuf_to_dma(q->bufs[i]);
++ videobuf_dma_unmap(q, dma);
++ videobuf_dma_free(dma);
++ }
+
++ videobuf_mmap_free(q);
+ fh->rsz_bufsize = 0;
+ filp->private_data = NULL;
+
+@@ -1286,7 +1491,8 @@ static int rsz_release(struct inode *inode, struct file *filp)
+ kfree(fh);
+
+ isp_put();
+-
++ fh->params = NULL;
++ fh->config = NULL;
+ return 0;
+ }
+
+@@ -1353,6 +1559,12 @@ static long rsz_unlocked_ioctl(struct file *file, unsigned int cmd,
+ chanprotection_mutex))
+ return -EINTR;
+ ret = videobuf_reqbufs(&fh->vbq, (void *)&req_buf);
++ if (ret >= 0) {
++ if (copy_to_user((struct v4l2_requestbuffers *)arg,
++ &req_buf, sizeof(struct
++ v4l2_requestbuffers)))
++ return -EFAULT;
++ }
+ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
+ break;
+ }
+@@ -1394,11 +1606,7 @@ static long rsz_unlocked_ioctl(struct file *file, unsigned int cmd,
+ sizeof(struct rsz_params))) {
+ return -EFAULT;
+ }
+- if (mutex_lock_interruptible(&rsz_conf_chan->
+- chanprotection_mutex))
+- return -EINTR;
+- ret = rsz_set_params(fh->multipass, params, rsz_conf_chan);
+- mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ ret = rsz_set_params(fh->multipass, fh->params, rsz_conf_chan);
+ break;
+ }
+ case RSZ_G_PARAM:
+@@ -1433,6 +1641,12 @@ static long rsz_unlocked_ioctl(struct file *file, unsigned int cmd,
+ rsz_calculate_crop(rsz_conf_chan, (struct rsz_cropsize *)arg);
+ break;
+
++ case RSZ_S_EXP:
++ if (mutex_lock_interruptible(&rsz_conf_chan->chanprotection_mutex))
++ return -EINTR;
++ rsz_conf_chan->register_config.sdr_req_exp = *((unsigned int *)arg);
++ mutex_unlock(&rsz_conf_chan->chanprotection_mutex);
++ break;
+ default:
+ dev_err(rsz_device, "resizer_ioctl: Invalid Command Value");
+ return -EINVAL;
+@@ -1535,14 +1749,18 @@ static int __init omap_rsz_init(void)
+ "memory\n");
+ return -ENOMEM;
+ }
+-
++ device->extra_page_addr = __get_free_pages(GFP_KERNEL | GFP_DMA, 0);
++ if (!device->extra_page_addr) {
++ dev_err(rsz_device, OMAP_REZR_NAME ":Allocation failed. ");
++ kfree(device);
++ return -ENOMEM;
++ }
+ ret = alloc_chrdev_region(&dev, 0, 1, OMAP_REZR_NAME);
+ if (ret < 0) {
+ dev_err(rsz_device, OMAP_REZR_NAME ": intialization failed. "
+ "Could not allocate region "
+ "for character device\n");
+- kfree(device);
+- return -ENODEV;
++ goto fail1;
+ }
+
+ /* Register the driver in the kernel */
+@@ -1608,6 +1826,8 @@ fail3:
+ cdev_del(&c_dev);
+ fail2:
+ unregister_chrdev_region(dev, 1);
++fail1:
++ free_pages((unsigned long)device->extra_page_addr, 0);
+ kfree(device);
+ return ret;
+ }
+@@ -1623,6 +1843,7 @@ void __exit omap_rsz_exit(void)
+ platform_driver_unregister(&omap_resizer_driver);
+ cdev_del(&c_dev);
+ unregister_chrdev_region(dev, 1);
++ free_pages((unsigned long)device_config->extra_page_addr, 0);
+ kfree(device_config);
+ }
+
+diff --git a/include/linux/omap_resizer.h b/include/linux/omap_resizer.h
+index 5ac0c88..47b8dd8 100644
+--- a/include/linux/omap_resizer.h
++++ b/include/linux/omap_resizer.h
+@@ -21,7 +21,7 @@
+
+ /* ioctls definition */
+ #define RSZ_IOC_BASE 'R'
+-#define RSZ_IOC_MAXNR 8
++#define RSZ_IOC_MAXNR 9
+
+ /*Ioctl options which are to be passed while calling the ioctl*/
+ #define RSZ_REQBUF _IOWR(RSZ_IOC_BASE, 1,\
+@@ -33,6 +33,7 @@
+ #define RSZ_G_STATUS _IOWR(RSZ_IOC_BASE, 6, struct rsz_status)
+ #define RSZ_QUEUEBUF _IOWR(RSZ_IOC_BASE, 7, struct v4l2_buffer)
+ #define RSZ_GET_CROPSIZE _IOWR(RSZ_IOC_BASE, 8, struct rsz_cropsize)
++#define RSZ_S_EXP _IOWR(RSZ_IOC_BASE, 9, __s32)
+
+ #define RSZ_INTYPE_YCBCR422_16BIT 0
+ #define RSZ_INTYPE_PLANAR_8BIT 1
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch b/recipes/linux/linux-omap-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch
new file mode 100644
index 0000000000..143a846e3c
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch
@@ -0,0 +1,36 @@
+From 9fec955e98b4ef7922f629e3a81d2d1af216e028 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com>
+Date: Wed, 29 Apr 2009 18:12:42 +0530
+Subject: [PATCH 25/26] OMAP3-Resizer: Build issues fixed
+
+There were some building issues with latest gitorious tree,
+fixed them.
+---
+ drivers/media/video/isp/omap_resizer.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/video/isp/omap_resizer.c b/drivers/media/video/isp/omap_resizer.c
+index 8059c70..dd90b24 100644
+--- a/drivers/media/video/isp/omap_resizer.c
++++ b/drivers/media/video/isp/omap_resizer.c
+@@ -1033,7 +1033,7 @@ static void rsz_vbq_release(struct videobuf_queue *q,
+ dma = videobuf_to_dma(q->bufs[vb->i]);
+ videobuf_dma_unmap(q, dma);
+ videobuf_dma_free(dma);
+- ispmmu_unmap(fh->config->buf_address[vb->i]);
++ ispmmu_vunmap(fh->config->buf_address[vb->i]);
+ fh->config->buf_address[vb->i] = 0;
+
+ spin_lock(&fh->vbq_lock);
+@@ -1293,7 +1293,7 @@ static int rsz_vbq_prepare(struct videobuf_queue *q,
+ goto buf_release;
+ spin_unlock(&fh->vbq_lock);
+ }
+- isp_addr = ispmmu_map_sg(dma->sglist, dma->sglen);
++ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen);
+ if (!isp_addr)
+ err = -EIO;
+ else {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-2.6.29/vfp/01-vfp-pm.patch b/recipes/linux/linux-omap-2.6.29/vfp/01-vfp-pm.patch
new file mode 100644
index 0000000000..70d4d1efc5
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/vfp/01-vfp-pm.patch
@@ -0,0 +1,128 @@
+From: Ben Dooks <ben-linux@fluff.org>
+Date: Thu, 18 Dec 2008 10:26:54 +0000 (+0100)
+Subject: 5349/1: VFP: Add PM code to save and restore current VFP state
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=d504d72ad38e54b5feda67e956834348d6a500e1
+
+5349/1: VFP: Add PM code to save and restore current VFP state
+
+[ARM] 5349/1: VFP: Add PM code to save and restore current VFP state
+
+When CONFIG_PM is selected, the VFP code does not have any handler
+installed to deal with either saving the VFP state of the current
+task, nor does it do anything to try and restore the VFP after a
+resume.
+
+On resume, the VFP will have been reset and the co-processor access
+control registers are in an indeterminate state (very probably the
+CP10 and CP11 the VFP uses will have been disabled by the ARM core
+reset). When this happens, resume will break as soon as it tries to
+unfreeze the tasks and restart scheduling.
+
+Add a sys device to allow us to hook the suspend call to save the
+current thread state if the thread is using VFP and a resume hook
+which restores the CP10/CP11 access and ensures the VFP is disabled
+so that the lazy swapping will take place on next access.
+
+Signed-off-by: Ben Dooks <ben-linux@fluff.org>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
+index c85860b..8de86e4 100644
+--- a/arch/arm/vfp/vfp.h
++++ b/arch/arm/vfp/vfp.h
+@@ -377,6 +377,6 @@ struct op {
+ u32 flags;
+ };
+
+-#ifdef CONFIG_SMP
++#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ extern void vfp_save_state(void *location, u32 fpexc);
+ #endif
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index a62dcf7..b21f43f 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -166,7 +166,7 @@ process_exception:
+ @ retry the faulted instruction
+ ENDPROC(vfp_support_entry)
+
+-#ifdef CONFIG_SMP
++#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ ENTRY(vfp_save_state)
+ @ Save the current VFP state
+ @ r0 - save location
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 67ca340..9f476a1 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -322,6 +322,61 @@ static void vfp_enable(void *unused)
+ set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
+ }
+
++#ifdef CONFIG_PM
++#include <linux/sysdev.h>
++
++static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
++{
++ struct thread_info *ti = current_thread_info();
++ u32 fpexc = fmrx(FPEXC);
++
++ /* if vfp is on, then save state for resumption */
++ if (fpexc & FPEXC_EN) {
++ printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
++ vfp_save_state(&ti->vfpstate, fpexc);
++
++ /* disable, just in case */
++ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
++ }
++
++ /* clear any information we had about last context state */
++ memset(last_VFP_context, 0, sizeof(last_VFP_context));
++
++ return 0;
++}
++
++static int vfp_pm_resume(struct sys_device *dev)
++{
++ /* ensure we have access to the vfp */
++ vfp_enable(NULL);
++
++ /* and disable it to ensure the next usage restores the state */
++ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
++
++ return 0;
++}
++
++static struct sysdev_class vfp_pm_sysclass = {
++ .name = "vfp",
++ .suspend = vfp_pm_suspend,
++ .resume = vfp_pm_resume,
++};
++
++static struct sys_device vfp_pm_sysdev = {
++ .cls = &vfp_pm_sysclass,
++};
++
++static void vfp_pm_init(void)
++{
++ sysdev_class_register(&vfp_pm_sysclass);
++ sysdev_register(&vfp_pm_sysdev);
++}
++
++
++#else
++static inline void vfp_pm_init(void) { }
++#endif /* CONFIG_PM */
++
+ #include <linux/smp.h>
+
+ /*
+@@ -365,6 +420,7 @@ static int __init vfp_init(void)
+ vfp_vector = vfp_support_entry;
+
+ thread_register_notifier(&vfp_notifier_block);
++ vfp_pm_init();
+
+ /*
+ * We detected VFP, and the support code is
diff --git a/recipes/linux/linux-omap-2.6.29/vfp/02-vfp-ptrace.patch b/recipes/linux/linux-omap-2.6.29/vfp/02-vfp-ptrace.patch
new file mode 100644
index 0000000000..feba206f95
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/vfp/02-vfp-ptrace.patch
@@ -0,0 +1,231 @@
+From: Catalin Marinas <catalin.marinas@arm.com>
+Date: Wed, 11 Feb 2009 11:12:56 +0000 (+0100)
+Subject: 5387/1: Add ptrace VFP support on ARM
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4dd5beb2244f15c895aba46474bd89545327d1a6
+
+5387/1: Add ptrace VFP support on ARM
+
+[ARM] 5387/1: Add ptrace VFP support on ARM
+
+This patch adds ptrace support for setting and getting the VFP registers
+using PTRACE_SETVFPREGS and PTRACE_GETVFPREGS. The user_vfp structure
+defined in asm/user.h contains 32 double registers (to cover VFPv3 and
+Neon hardware) and the FPSCR register.
+
+Cc: Paul Brook <paul@codesourcery.com>
+Cc: Daniel Jacobowitz <dan@codesourcery.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
+index 7319261..236a06b 100644
+--- a/arch/arm/include/asm/ptrace.h
++++ b/arch/arm/include/asm/ptrace.h
+@@ -27,6 +27,8 @@
+ /* PTRACE_SYSCALL is 24 */
+ #define PTRACE_GETCRUNCHREGS 25
+ #define PTRACE_SETCRUNCHREGS 26
++#define PTRACE_GETVFPREGS 27
++#define PTRACE_SETVFPREGS 28
+
+ /*
+ * PSR bits
+diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
+index 68b9ec8..b9dc8a8 100644
+--- a/arch/arm/include/asm/thread_info.h
++++ b/arch/arm/include/asm/thread_info.h
+@@ -113,6 +113,8 @@ extern void iwmmxt_task_restore(struct thread_info *, void *);
+ extern void iwmmxt_task_release(struct thread_info *);
+ extern void iwmmxt_task_switch(struct thread_info *);
+
++extern void vfp_sync_state(struct thread_info *thread);
++
+ #endif
+
+ /*
+diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
+index 825c1e7..df95e05 100644
+--- a/arch/arm/include/asm/user.h
++++ b/arch/arm/include/asm/user.h
+@@ -81,4 +81,13 @@ struct user{
+ #define HOST_TEXT_START_ADDR (u.start_code)
+ #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
++/*
++ * User specific VFP registers. If only VFPv2 is present, registers 16 to 31
++ * are ignored by the ptrace system call.
++ */
++struct user_vfp {
++ unsigned long long fpregs[32];
++ unsigned long fpscr;
++};
++
+ #endif /* _ARM_USER_H */
+diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
+index df653ea..89882a1 100644
+--- a/arch/arm/kernel/ptrace.c
++++ b/arch/arm/kernel/ptrace.c
+@@ -653,6 +653,54 @@ static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp)
+ }
+ #endif
+
++#ifdef CONFIG_VFP
++/*
++ * Get the child VFP state.
++ */
++static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
++{
++ struct thread_info *thread = task_thread_info(tsk);
++ union vfp_state *vfp = &thread->vfpstate;
++ struct user_vfp __user *ufp = data;
++
++ vfp_sync_state(thread);
++
++ /* copy the floating point registers */
++ if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
++ sizeof(vfp->hard.fpregs)))
++ return -EFAULT;
++
++ /* copy the status and control register */
++ if (put_user(vfp->hard.fpscr, &ufp->fpscr))
++ return -EFAULT;
++
++ return 0;
++}
++
++/*
++ * Set the child VFP state.
++ */
++static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
++{
++ struct thread_info *thread = task_thread_info(tsk);
++ union vfp_state *vfp = &thread->vfpstate;
++ struct user_vfp __user *ufp = data;
++
++ vfp_sync_state(thread);
++
++ /* copy the floating point registers */
++ if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
++ sizeof(vfp->hard.fpregs)))
++ return -EFAULT;
++
++ /* copy the status and control register */
++ if (get_user(vfp->hard.fpscr, &ufp->fpscr))
++ return -EFAULT;
++
++ return 0;
++}
++#endif
++
+ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
+ {
+ int ret;
+@@ -775,6 +823,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
+ break;
+ #endif
+
++#ifdef CONFIG_VFP
++ case PTRACE_GETVFPREGS:
++ ret = ptrace_getvfpregs(child, (void __user *)data);
++ break;
++
++ case PTRACE_SETVFPREGS:
++ ret = ptrace_setvfpregs(child, (void __user *)data);
++ break;
++#endif
++
+ default:
+ ret = ptrace_request(child, request, addr, data);
+ break;
+diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
+index 8de86e4..c8c98dd 100644
+--- a/arch/arm/vfp/vfp.h
++++ b/arch/arm/vfp/vfp.h
+@@ -377,6 +377,4 @@ struct op {
+ u32 flags;
+ };
+
+-#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ extern void vfp_save_state(void *location, u32 fpexc);
+-#endif
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index b21f43f..902d396 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -166,7 +166,6 @@ process_exception:
+ @ retry the faulted instruction
+ ENDPROC(vfp_support_entry)
+
+-#if defined(CONFIG_SMP) || defined(CONFIG_PM)
+ ENTRY(vfp_save_state)
+ @ Save the current VFP state
+ @ r0 - save location
+@@ -181,7 +180,6 @@ ENTRY(vfp_save_state)
+ stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2
+ mov pc, lr
+ ENDPROC(vfp_save_state)
+-#endif
+
+ last_VFP_context_address:
+ .word last_VFP_context
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 9f476a1..7e12390 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -377,6 +377,55 @@ static void vfp_pm_init(void)
+ static inline void vfp_pm_init(void) { }
+ #endif /* CONFIG_PM */
+
++/*
++ * Synchronise the hardware VFP state of a thread other than current with the
++ * saved one. This function is used by the ptrace mechanism.
++ */
++#ifdef CONFIG_SMP
++void vfp_sync_state(struct thread_info *thread)
++{
++ /*
++ * On SMP systems, the VFP state is automatically saved at every
++ * context switch. We mark the thread VFP state as belonging to a
++ * non-existent CPU so that the saved one will be reloaded when
++ * needed.
++ */
++ thread->vfpstate.hard.cpu = NR_CPUS;
++}
++#else
++void vfp_sync_state(struct thread_info *thread)
++{
++ unsigned int cpu = get_cpu();
++ u32 fpexc = fmrx(FPEXC);
++
++ /*
++ * If VFP is enabled, the previous state was already saved and
++ * last_VFP_context updated.
++ */
++ if (fpexc & FPEXC_EN)
++ goto out;
++
++ if (!last_VFP_context[cpu])
++ goto out;
++
++ /*
++ * Save the last VFP state on this CPU.
++ */
++ fmxr(FPEXC, fpexc | FPEXC_EN);
++ vfp_save_state(last_VFP_context[cpu], fpexc);
++ fmxr(FPEXC, fpexc);
++
++ /*
++ * Set the context to NULL to force a reload the next time the thread
++ * uses the VFP.
++ */
++ last_VFP_context[cpu] = NULL;
++
++out:
++ put_cpu();
++}
++#endif
++
+ #include <linux/smp.h>
+
+ /*
diff --git a/recipes/linux/linux-omap-2.6.29/vfp/03-vfp-corruption.patch b/recipes/linux/linux-omap-2.6.29/vfp/03-vfp-corruption.patch
new file mode 100644
index 0000000000..216d4f5eaa
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/vfp/03-vfp-corruption.patch
@@ -0,0 +1,136 @@
+From: George G. Davis <gdavis@mvista.com>
+Date: Wed, 1 Apr 2009 18:27:18 +0000 (+0100)
+Subject: 5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4f7720780dc4a298a6d59c0ec39f7687022cc36f
+
+5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+
+[ARM] 5440/1: Fix VFP state corruption due to preemption during VFP exceptions
+
+We've observed that ARM VFP state can be corrupted during VFP exception
+handling when PREEMPT is enabled. The exact conditions are difficult
+to reproduce but appear to occur during VFP exception handling when a
+task causes a VFP exception which is handled via VFP_bounce and is then
+preempted by yet another task which in turn causes yet another VFP
+exception. Since the VFP_bounce code is not preempt safe, VFP state then
+becomes corrupt. In order to prevent preemption from occuring while
+handling a VFP exception, this patch disables preemption while handling
+VFP exceptions.
+
+Signed-off-by: George G. Davis <gdavis@mvista.com>
+Acked-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+---
+
+diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
+index ba592a9..a2bed62 100644
+--- a/arch/arm/vfp/entry.S
++++ b/arch/arm/vfp/entry.S
+@@ -15,13 +15,16 @@
+ * r10 = thread_info structure
+ * lr = failure return
+ */
+-#include <linux/linkage.h>
+-#include <linux/init.h>
+-#include <asm/asm-offsets.h>
+-#include <asm/assembler.h>
++#include <asm/thread_info.h>
+ #include <asm/vfpmacros.h>
++#include "../kernel/entry-header.S"
+
+ ENTRY(do_vfp)
++#ifdef CONFIG_PREEMPT
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ add r11, r4, #1 @ increment it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ enable_irq
+ ldr r4, .LCvfp
+ ldr r11, [r10, #TI_CPU] @ CPU number
+@@ -30,6 +33,12 @@ ENTRY(do_vfp)
+ ENDPROC(do_vfp)
+
+ ENTRY(vfp_null_entry)
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, lr
+ ENDPROC(vfp_null_entry)
+
+@@ -41,6 +50,12 @@ ENDPROC(vfp_null_entry)
+
+ __INIT
+ ENTRY(vfp_testing_entry)
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ ldr r0, VFP_arch_address
+ str r5, [r0] @ known non-zero value
+ mov pc, r9 @ we have handled the fault
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index 902d396..ea0a156 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -131,6 +131,12 @@ check_for_exception:
+ VFPFMXR FPEXC, r1 @ restore FPEXC last
+ sub r2, r2, #4
+ str r2, [sp, #S_PC] @ retry the instruction
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, r9 @ we think we have handled things
+
+
+@@ -149,6 +155,12 @@ look_for_VFP_exceptions:
+ @ not recognised by VFP
+
+ DBGSTR "not VFP"
++#ifdef CONFIG_PREEMPT
++ get_thread_info r10
++ ldr r4, [r10, #TI_PREEMPT] @ get preempt count
++ sub r11, r4, #1 @ decrement it
++ str r11, [r10, #TI_PREEMPT]
++#endif
+ mov pc, lr
+
+ process_exception:
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 75457b3..01599c4 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -266,7 +266,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ * on VFP subarch 1.
+ */
+ vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs);
+- return;
++ goto exit;
+ }
+
+ /*
+@@ -297,7 +297,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1.
+ */
+ if (fpexc ^ (FPEXC_EX | FPEXC_FP2V))
+- return;
++ goto exit;
+
+ /*
+ * The barrier() here prevents fpinst2 being read
+@@ -310,6 +310,8 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
+ exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs);
+ if (exceptions)
+ vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs);
++ exit:
++ preempt_enable();
+ }
+
+ static void vfp_enable(void *unused)
diff --git a/recipes/linux/linux-omap-2.6.29/vfp/04-vfp-threads.patch b/recipes/linux/linux-omap-2.6.29/vfp/04-vfp-threads.patch
new file mode 100644
index 0000000000..221b2774a1
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/vfp/04-vfp-threads.patch
@@ -0,0 +1,98 @@
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 1 Jul 2009 21:20:59 +0000 (+0300)
+Subject: So far vfp_sync_state worked only for threads other than the current one. This worked...
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=23671113997664ae55c8132fc4a56e676d5b46c7
+
+So far vfp_sync_state worked only for threads other than the current one. This worked for tracing other threads, but not for PTRACE_TRACEME. Syncing for the current thread will also be needed by an upcoming patch adding support for VFP context save / restore around signal handlers.
+
+For SMP we need get_cpu now, since we have to protect the FPEXC
+register, other than this things remained the same for threads other
+than the current.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+
+diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
+index 01599c4..969b77a 100644
+--- a/arch/arm/vfp/vfpmodule.c
++++ b/arch/arm/vfp/vfpmodule.c
+@@ -380,12 +380,19 @@ static inline void vfp_pm_init(void) { }
+ #endif /* CONFIG_PM */
+
+ /*
+- * Synchronise the hardware VFP state of a thread other than current with the
+- * saved one. This function is used by the ptrace mechanism.
++ * Synchronise the hardware VFP state of a thread with the saved one.
++ * This function is used by the ptrace mechanism and the signal handler path.
+ */
+-#ifdef CONFIG_SMP
+ void vfp_sync_state(struct thread_info *thread)
+ {
++ unsigned int cpu = get_cpu();
++ u32 fpexc = fmrx(FPEXC);
++ int vfp_enabled;
++ int self;
++
++ vfp_enabled = fpexc & FPEXC_EN;
++ self = thread == current_thread_info();
++#ifdef CONFIG_SMP
+ /*
+ * On SMP systems, the VFP state is automatically saved at every
+ * context switch. We mark the thread VFP state as belonging to a
+@@ -393,18 +400,22 @@ void vfp_sync_state(struct thread_info *thread)
+ * needed.
+ */
+ thread->vfpstate.hard.cpu = NR_CPUS;
+-}
+-#else
+-void vfp_sync_state(struct thread_info *thread)
+-{
+- unsigned int cpu = get_cpu();
+- u32 fpexc = fmrx(FPEXC);
+-
+ /*
+- * If VFP is enabled, the previous state was already saved and
+- * last_VFP_context updated.
++ * Only the current thread's saved VFP context can be out-of-date.
++ * For others there is nothing else to do, since we already ensured
++ * force loading above.
+ */
+- if (fpexc & FPEXC_EN)
++ if (!self)
++ goto out;
++#endif
++ /*
++ * If the VFP is enabled only the current thread's saved VFP
++ * context can get out-of-date. For other threads the context
++ * was updated when the current thread started to use the VFP.
++ * This also means that the context will be reloaded next time
++ * the thread uses the VFP, so no need to enforce it.
++ */
++ if (vfp_enabled && !self)
+ goto out;
+
+ if (!last_VFP_context[cpu])
+@@ -413,8 +424,14 @@ void vfp_sync_state(struct thread_info *thread)
+ /*
+ * Save the last VFP state on this CPU.
+ */
+- fmxr(FPEXC, fpexc | FPEXC_EN);
++ if (!vfp_enabled)
++ fmxr(FPEXC, fpexc | FPEXC_EN);
+ vfp_save_state(last_VFP_context[cpu], fpexc);
++ /*
++ * Disable VFP in case it was enabled so that the force reload
++ * can happen.
++ */
++ fpexc &= ~FPEXC_EN;
+ fmxr(FPEXC, fpexc);
+
+ /*
+@@ -426,7 +443,6 @@ void vfp_sync_state(struct thread_info *thread)
+ out:
+ put_cpu();
+ }
+-#endif
+
+ #include <linux/smp.h>
+
diff --git a/recipes/linux/linux-omap-2.6.29/vfp/05-vfp-signal-handlers.patch b/recipes/linux/linux-omap-2.6.29/vfp/05-vfp-signal-handlers.patch
new file mode 100644
index 0000000000..f648188584
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.29/vfp/05-vfp-signal-handlers.patch
@@ -0,0 +1,148 @@
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 1 Jul 2009 21:21:06 +0000 (+0300)
+Subject: Signal handlers can use floating point, so prevent them to corrupt the main thread...
+X-Git-Url: http://siarhei.siamashka.name/gitweb/?p=linux-omap-2.6.git;a=commitdiff_plain;h=4daa6b5d833c401a9de6f136ea23daa971fc4fdc
+
+Signal handlers can use floating point, so prevent them to corrupt the main thread's VFP context. So far there were two signal stack frame formats defined based on the VFP implementation, but recently a new user struct was added for ptrace that covers all possibilities, so use it for the signal stack too.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+
+diff --git a/arch/arm/include/asm/ucontext.h b/arch/arm/include/asm/ucontext.h
+index bf65e9f..5534653 100644
+--- a/arch/arm/include/asm/ucontext.h
++++ b/arch/arm/include/asm/ucontext.h
+@@ -59,23 +59,19 @@ struct iwmmxt_sigframe {
+ #endif /* CONFIG_IWMMXT */
+
+ #ifdef CONFIG_VFP
+-#if __LINUX_ARM_ARCH__ < 6
+-/* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
+- * word after the registers, and a word of padding at the end for
+- * alignment. */
+ #define VFP_MAGIC 0x56465001
+-#define VFP_STORAGE_SIZE 152
+-#else
+-#define VFP_MAGIC 0x56465002
+-#define VFP_STORAGE_SIZE 144
+-#endif
+
+ struct vfp_sigframe
+ {
+ unsigned long magic;
+ unsigned long size;
+- union vfp_state storage;
+-};
++ struct user_vfp ufp;
++ unsigned long reserved;
++} __attribute__((__aligned__(8)));
++
++/* 8 byte for magic and size, 260 byte for ufp and 4 byte padding */
++#define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
++
+ #endif /* CONFIG_VFP */
+
+ /*
+@@ -91,7 +87,7 @@ struct aux_sigframe {
+ #ifdef CONFIG_IWMMXT
+ struct iwmmxt_sigframe iwmmxt;
+ #endif
+-#if 0 && defined CONFIG_VFP /* Not yet saved. */
++#ifdef CONFIG_VFP
+ struct vfp_sigframe vfp;
+ #endif
+ /* Something that isn't a valid magic number for any coprocessor. */
+diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
+index 80b8b5c..a5ef7f5 100644
+--- a/arch/arm/kernel/signal.c
++++ b/arch/arm/kernel/signal.c
+@@ -196,6 +196,67 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
+
+ #endif
+
++#ifdef CONFIG_VFP
++
++static int preserve_vfp_context(struct vfp_sigframe __user *frame)
++{
++ struct thread_info *thread = current_thread_info();
++ struct vfp_hard_struct *h = &thread->vfpstate.hard;
++ const unsigned long magic = VFP_MAGIC;
++ const unsigned long size = VFP_STORAGE_SIZE;
++ int err = 0;
++
++ vfp_sync_state(thread);
++ __put_user_error(magic, &frame->magic, err);
++ __put_user_error(size, &frame->size, err);
++
++ /*
++ * Copy the floating point registers. There can be unused
++ * registers see asm/hwcap.h for details.
++ */
++ err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs,
++ sizeof(h->fpregs));
++ /*
++ * Copy the status and control register.
++ */
++ __put_user_error(h->fpscr, &frame->ufp.fpscr, err);
++
++ return err ? -EFAULT : 0;
++}
++
++static int restore_vfp_context(struct vfp_sigframe __user *frame)
++{
++ struct thread_info *thread = current_thread_info();
++ struct vfp_hard_struct *h = &thread->vfpstate.hard;
++ unsigned long magic;
++ unsigned long size;
++ int err = 0;
++
++ vfp_sync_state(thread);
++ __get_user_error(magic, &frame->magic, err);
++ __get_user_error(size, &frame->size, err);
++
++ if (err)
++ return -EFAULT;
++ if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
++ return -EINVAL;
++
++ /*
++ * Copy the floating point registers. There can be unused
++ * registers see asm/hwcap.h for details.
++ */
++ err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs,
++ sizeof(h->fpregs));
++ /*
++ * Copy the status and control register.
++ */
++ __get_user_error(h->fpscr, &frame->ufp.fpscr, err);
++
++ return err ? -EFAULT : 0;
++}
++
++#endif
++
+ /*
+ * Do a signal return; undo the signal stack. These are aligned to 64-bit.
+ */
+@@ -254,8 +315,8 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
+ err |= restore_iwmmxt_context(&aux->iwmmxt);
+ #endif
+ #ifdef CONFIG_VFP
+-// if (err == 0)
+-// err |= vfp_restore_state(&sf->aux.vfp);
++ if (err == 0)
++ err |= restore_vfp_context(&aux->vfp);
+ #endif
+
+ return err;
+@@ -369,8 +430,8 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
+ err |= preserve_iwmmxt_context(&aux->iwmmxt);
+ #endif
+ #ifdef CONFIG_VFP
+-// if (err == 0)
+-// err |= vfp_save_state(&sf->aux.vfp);
++ if (err == 0)
++ err |= preserve_vfp_context(&aux->vfp);
+ #endif
+ __put_user_error(0, &aux->end_magic, err);
+
diff --git a/recipes/linux/linux-omap-2.6.31/omapzoom2/defconfig b/recipes/linux/linux-omap-2.6.31/omapzoom2/defconfig
new file mode 100644
index 0000000000..366e259870
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.31/omapzoom2/defconfig
@@ -0,0 +1,1366 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.31-rc1-omap1
+# Fri Jul 10 18:12:43 2009
+#
+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_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_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_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+
+#
+# Performance Counters
+#
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_STRIP_ASM_SYMS is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_SLOW_WORK is not set
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+# CONFIG_FREEZER is not set
+
+#
+# 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_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X 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_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+# CONFIG_ARCH_OMAP4 is not set
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+# CONFIG_OMAP_RESET_CLOCKS is not set
+CONFIG_OMAP_MUX=y
+CONFIG_OMAP_MUX_DEBUG=y
+CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+CONFIG_MACH_OMAP_ZOOM2=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+CONFIG_COMMON_CLKDEV=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+# CONFIG_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# 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=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE 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_LRO is not set
+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_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_NET_DSA 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
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD 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_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# 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_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8842 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP 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 is not set
+# CONFIG_INPUT_JOYDEV 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_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_AD7877 is not set
+# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
+# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_EETI is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+# CONFIG_TOUCHSCREEN_W90X900 is not set
+# 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MAX3100 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+CONFIG_W1=y
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2482 is not set
+# CONFIG_W1_MASTER_DS1WM is not set
+# CONFIG_W1_MASTER_GPIO is not set
+# CONFIG_HDQ_MASTER_OMAP is not set
+
+#
+# 1-wire Slaves
+#
+# CONFIG_W1_SLAVE_THERM is not set
+# CONFIG_W1_SLAVE_SMEM is not set
+# CONFIG_W1_SLAVE_DS2431 is not set
+# CONFIG_W1_SLAVE_DS2433 is not set
+# CONFIG_W1_SLAVE_DS2760 is not set
+# CONFIG_W1_SLAVE_BQ27000 is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_OMAP_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_AB3100_CORE is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# 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_UVESA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+CONFIG_FB_OMAP=y
+# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
+# CONFIG_FB_OMAP_LCD_MIPID is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=m
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+# CONFIG_LCD_PLATFORM is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=m
+CONFIG_BACKLIGHT_GENERIC=m
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT 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
+CONFIG_SOUND=y
+# CONFIG_SOUND_OSS_CORE is not set
+CONFIG_SND=y
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_HRTIMER 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
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_DRIVERS=y
+# 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
+CONFIG_SND_ARM=y
+CONFIG_SND_SPI=y
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_NEW_LEDS is not set
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE 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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+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_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK 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=y
+# 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
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_PAGE_POISONING is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
diff --git a/recipes/linux/linux-omap-pm-2.6.31/beagleboard/defconfig b/recipes/linux/linux-omap-pm-2.6.31/beagleboard/defconfig
new file mode 100644
index 0000000000..f43c8f5fbb
--- /dev/null
+++ b/recipes/linux/linux-omap-pm-2.6.31/beagleboard/defconfig
@@ -0,0 +1,2765 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.31-rc1-omap1
+# Thu Jul 30 12:51:41 2009
+#
+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_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_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_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+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 is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+
+#
+# Performance Counters
+#
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_STRIP_ASM_SYMS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+CONFIG_MARKERS=y
+CONFIG_OPROFILE=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+CONFIG_SLOW_WORK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_BLK_DEV_INTEGRITY=y
+
+#
+# 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X 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_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+# CONFIG_ARCH_OMAP4 is not set
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+CONFIG_OMAP_LL_DEBUG_UART3=y
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+CONFIG_MACH_OMAP3_BEAGLE=y
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+# CONFIG_MACH_OMAP_ZOOM2 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+CONFIG_COMMON_CLKDEV=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_LEDS=y
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_ARM_ERRATUM_451034 is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+# CONFIG_DEFAULT_BIC is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_MIP6=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_ACCT=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_DCCP=m
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+# CONFIG_NETFILTER_TPROXY is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+CONFIG_NETFILTER_XT_TARGET_HL=m
+CONFIG_NETFILTER_XT_TARGET_LED=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+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
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_HL=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+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_TIME=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
+CONFIG_NETFILTER_XT_MATCH_OSF=m
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+CONFIG_IP_VS_DEBUG=y
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_DCCP=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_RAW=m
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=y
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_CCID3_RTO=100
+CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+# CONFIG_TIPC_ADVANCED is not set
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# 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=m
+# CONFIG_PHONET is not set
+CONFIG_IEEE802154=m
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_MULTIQ=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_DRR=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FLOW=m
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=m
+CONFIG_CAN_DEV=m
+# CONFIG_CAN_CALC_BITTIMING is not set
+CONFIG_CAN_SJA1000=m
+CONFIG_CAN_SJA1000_PLATFORM=m
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+# CONFIG_ACT200L_DONGLE is not set
+CONFIG_KINGSUN_DONGLE=m
+CONFIG_KSDAZZLE_DONGLE=m
+CONFIG_KS959_DONGLE=m
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTSDIO=y
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+CONFIG_BT_HCIBFUSB=y
+# CONFIG_BT_HCIVHCI is not set
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+# CONFIG_CFG80211_DEBUGFS is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=y
+CONFIG_LIB80211_CRYPT_WEP=y
+CONFIG_LIB80211_CRYPT_CCMP=y
+CONFIG_LIB80211_CRYPT_TKIP=y
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+CONFIG_MAC80211_DEFAULT_PS=y
+CONFIG_MAC80211_DEFAULT_PS_VALUE=1
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_WIMAX=m
+CONFIG_WIMAX_DEBUG_LEVEL=8
+# CONFIG_RFKILL is not set
+CONFIG_NET_9P=m
+# CONFIG_NET_9P_DEBUG is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=m
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+CONFIG_EEPROM_93CX6=y
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+CONFIG_SCSI_NETLINK=y
+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=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=m
+CONFIG_SCSI_MULTI_LUN=y
+# 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=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+CONFIG_ISCSI_TCP=m
+CONFIG_LIBFC=m
+CONFIG_LIBFCOE=m
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_SCSI_OSD_INITIATOR=m
+CONFIG_SCSI_OSD_ULD=m
+CONFIG_SCSI_OSD_DPRINT_SENSE=1
+# CONFIG_SCSI_OSD_DEBUG is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID6_PQ=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_LOG_USERSPACE=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_QL=m
+CONFIG_DM_MULTIPATH_ST=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_MACVLAN=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_VETH=m
+# CONFIG_NET_ETHERNET is not set
+CONFIG_MII=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+CONFIG_WLAN_80211=y
+CONFIG_LIBERTAS=y
+CONFIG_LIBERTAS_USB=y
+# CONFIG_LIBERTAS_SDIO is not set
+CONFIG_LIBERTAS_SPI=m
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_AT76C50X_USB=m
+CONFIG_USB_ZD1201=y
+CONFIG_USB_NET_RNDIS_WLAN=y
+CONFIG_RTL8187=y
+CONFIG_RTL8187_LEDS=y
+# CONFIG_MAC80211_HWSIM is not set
+CONFIG_P54_COMMON=y
+CONFIG_P54_USB=y
+# CONFIG_P54_SPI is not set
+CONFIG_P54_LEDS=y
+CONFIG_ATH_COMMON=m
+CONFIG_AR9170_USB=m
+CONFIG_AR9170_LEDS=y
+CONFIG_HOSTAP=y
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_B43=y
+CONFIG_B43_LEDS=y
+CONFIG_B43_HWRNG=y
+# CONFIG_B43_DEBUG is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_ZD1211RW=y
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_RT2X00=y
+CONFIG_RT2500USB=y
+CONFIG_RT73USB=y
+CONFIG_RT2800USB=m
+CONFIG_RT2X00_LIB_USB=y
+CONFIG_RT2X00_LIB=y
+CONFIG_RT2X00_LIB_HT=y
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_RFKILL=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+CONFIG_WL12XX=m
+CONFIG_IWM=m
+# CONFIG_IWM_DEBUG is not set
+
+#
+# WiMAX Wireless Broadband devices
+#
+# CONFIG_WIMAX_I2400M_USB is not set
+# CONFIG_WIMAX_I2400M_SDIO is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=y
+CONFIG_USB_KAWETH=y
+CONFIG_USB_PEGASUS=y
+CONFIG_USB_RTL8150=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_DM9601=y
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_GL620A=y
+CONFIG_USB_NET_NET1080=y
+CONFIG_USB_NET_PLUSB=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=y
+CONFIG_USB_NET_INT51X1=m
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+CONFIG_IEEE802154_DRIVERS=m
+CONFIG_IEEE802154_FAKEHARD=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOATM is not set
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=y
+CONFIG_INPUT_POLLDEV=y
+
+#
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_LM8323 is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+CONFIG_MOUSE_SYNAPTICS_I2C=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_TWL4030_PWRBUTTON=y
+CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
+
+#
+# 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MAX3100 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_TIMERIOMEM=m
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_OMAP24XX is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_G760A 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_LM70 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_LTC4215 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_LM95241 is not set
+# CONFIG_SENSORS_MAX1111 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_PCF8591 is not set
+# CONFIG_SENSORS_SHT15 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_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_TMP401 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_TWL4030_WATCHDOG=m
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=y
+# CONFIG_SSB_SILENT is not set
+# CONFIG_SSB_DEBUG is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_AB3100_CORE is not set
+# CONFIG_EZX_PCAP is not set
+CONFIG_MEDIA_SUPPORT=m
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_MEDIA_TUNER_MXL5007T=m
+CONFIG_MEDIA_TUNER_MC44S803=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DVB=m
+CONFIG_VIDEO_IR=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_IR_I2C=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+CONFIG_VIDEO_VIVI=m
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_STV06XX=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+CONFIG_USB_GSPCA_MARS=m
+CONFIG_USB_GSPCA_MR97310A=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_OV534=m
+CONFIG_USB_GSPCA_PAC207=m
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_SQ905=m
+CONFIG_USB_GSPCA_SQ905C=m
+CONFIG_USB_GSPCA_STK014=m
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_HDPVR=m
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_CX231XX=m
+CONFIG_VIDEO_CX231XX_ALSA=m
+CONFIG_VIDEO_CX231XX_DVB=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+CONFIG_USB_ET61X251=m
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+CONFIG_USB_ZC0301=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_PWC_INPUT_EVDEV=y
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+CONFIG_DVB_DYNAMIC_MINORS=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_DW2102=m
+CONFIG_DVB_USB_CINERGY_T2=m
+CONFIG_DVB_USB_ANYSEE=m
+CONFIG_DVB_USB_DTV5100=m
+CONFIG_DVB_USB_AF9015=m
+CONFIG_DVB_USB_CE6230=m
+CONFIG_DVB_SIANO_SMS1XXX=m
+CONFIG_DVB_SIANO_SMS1XXX_SMS_IDS=y
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_STV0288=m
+CONFIG_DVB_STB6000=m
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TUNER_CX24113=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_CX24116=m
+CONFIG_DVB_SI21XX=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+CONFIG_DVB_AF9013=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_LGDT3305=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_S5H1411=m
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_LGS8GL5=m
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+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_UVESA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_FB_BROADSHEET=m
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C=m
+# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
+# CONFIG_PANEL_N800 is not set
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_JACK=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=m
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=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
+CONFIG_SND_RAWMIDI_SEQ=m
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL4030=y
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+# CONFIG_HID_DRAGONRISE is not set
+CONFIG_HID_EZKEY=y
+# CONFIG_HID_KYE is not set
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_KENSINGTON is not set
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_HID_GREENASIA is not set
+CONFIG_HID_SMARTJOYPLUS=m
+# CONFIG_SMARTJOYPLUS_FF is not set
+CONFIG_HID_TOPSEED=y
+# CONFIG_HID_THRUSTMASTER is not set
+CONFIG_HID_WACOM=m
+# CONFIG_HID_ZEROPLUS is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_OXU210HP_HCD=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_U132_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+CONFIG_USB_TMC=m
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP210X=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_QUALCOMM=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_SYMBOL=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_OPTICON=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_BERRY_CHARGE=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+# CONFIG_USB_APPLEDISPLAY is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_TEST=m
+# CONFIG_USB_ISIGHTFW is not set
+CONFIG_USB_VST=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C_HSOTG is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LANGWELL is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ZERO_HNPTEST=y
+CONFIG_USB_AUDIO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_USB_G_PRINTER=m
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=m
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+CONFIG_LEDS_OMAP=y
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_GPIO_PLATFORM=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_BD2802 is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+CONFIG_REGULATOR_USERSPACE_CONSUMER=m
+# CONFIG_REGULATOR_BQ24022 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+CONFIG_REGULATOR_TWL4030=y
+# CONFIG_REGULATOR_LP3971 is not set
+CONFIG_UIO=m
+CONFIG_UIO_PDRV=m
+CONFIG_UIO_PDRV_GENIRQ=m
+# CONFIG_UIO_SMX is not set
+# CONFIG_UIO_SERCOS3 is not set
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_MEILHAUS is not set
+# CONFIG_USB_IP_COMMON is not set
+CONFIG_W35UND=m
+# CONFIG_PRISM2_USB is not set
+# CONFIG_ECHO is not set
+CONFIG_USB_ATMEL=m
+# CONFIG_AGNX is not set
+CONFIG_OTUS=m
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_INPUT_MIMIO is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_LOGGER=m
+CONFIG_ANDROID_RAM_CONSOLE=y
+CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y
+# CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION is not set
+# CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT is not set
+CONFIG_ANDROID_TIMED_OUTPUT=y
+CONFIG_ANDROID_TIMED_GPIO=m
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
+# CONFIG_DST is not set
+CONFIG_POHMELFS=m
+# CONFIG_POHMELFS_DEBUG is not set
+CONFIG_POHMELFS_CRYPTO=y
+# CONFIG_STLC45XX is not set
+CONFIG_USB_SERIAL_ATEN2011=m
+# CONFIG_B3DFG is not set
+# CONFIG_PLAN9AUTH is not set
+# CONFIG_HECI is not set
+# CONFIG_LINE6_USB is not set
+CONFIG_USB_SERIAL_QUATECH2=m
+CONFIG_USB_CPC=m
+# CONFIG_FB_UDL is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=m
+# CONFIG_EXT4DEV_COMPAT is not set
+CONFIG_EXT4_FS_XATTR=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+# CONFIG_REISERFS_FS_POSIX_ACL is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+CONFIG_GFS2_FS=m
+# CONFIG_GFS2_FS_LOCKING_DLM is not set
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_FS_O2CB=m
+CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
+CONFIG_OCFS2_FS_STATS=y
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_FS_POSIX_ACL is not set
+CONFIG_BTRFS_FS=m
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+CONFIG_ADFS_FS=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+# CONFIG_ECRYPT_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+CONFIG_CRAMFS=m
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+CONFIG_VXFS_FS=m
+CONFIG_MINIX_FS=m
+CONFIG_OMFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_ROMFS_BACKED_BY_BLOCK=y
+# CONFIG_ROMFS_BACKED_BY_MTD is not set
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+CONFIG_ROMFS_ON_BLOCK=y
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+# CONFIG_EXOFS_FS is not set
+CONFIG_NILFS2_FS=m
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_DFS_UPCALL is not set
+CONFIG_CIFS_EXPERIMENTAL=y
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_CODA_FS=m
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK 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=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_PAGE_POISONING is not set
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_TRACING=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_FIPS=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_ZLIB=m
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+CONFIG_CRYPTO_HW=y
+CONFIG_BINARY_PRINTF=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
diff --git a/recipes/linux/linux-omap-pm/beagle-writable-uboot.diff b/recipes/linux/linux-omap-pm/beagle-writable-uboot.diff
new file mode 100644
index 0000000000..7c5a36df9e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/beagle-writable-uboot.diff
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-omap2/board-omap3beagle.c 2009-07-08 16:30:01.000000000 -0700
++++ b/arch/arm/mach-omap2/board-omap3beagle.c 2009-07-13 13:56:37.000000000 -0700
+@@ -68,7 +68,6 @@ static struct mtd_partition omap3beagle_
+ .name = "U-Boot",
+ .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
+ .size = 15 * NAND_BLOCK_SIZE,
+- .mask_flags = MTD_WRITEABLE, /* force read-only */
+ },
+ {
+ .name = "U-Boot Env",
diff --git a/recipes/linux/linux-omap-pm/beagleboard/ehci.patch b/recipes/linux/linux-omap-pm/beagleboard/ehci.patch
index 5a8c84471b..c55ff601c4 100644
--- a/recipes/linux/linux-omap-pm/beagleboard/ehci.patch
+++ b/recipes/linux/linux-omap-pm/beagleboard/ehci.patch
@@ -1,131 +1,46 @@
-Index: git/arch/arm/mach-omap2/board-omap3beagle.c
-===================================================================
---- git.orig/arch/arm/mach-omap2/board-omap3beagle.c
-+++ git/arch/arm/mach-omap2/board-omap3beagle.c
-@@ -154,6 +154,7 @@ static int beagle_twl_gpio_setup(struct
+From f8f10f496bce396416d7156da876222c6ce8c341 Mon Sep 17 00:00:00 2001
+From: Steven Kipisz <skipisz@beagleboard.org>
+Date: Wed, 9 Jan 2009 12:01:11 -0600
+Subject: [PATCH-USB] Omap3 beagleboard: add support for EHCI in revision C1 boards
+
+Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 10 +---------
+ arch/arm/mach-omap2/usb-ehci.c | 4 +---
+ drivers/usb/host/ehci-omap.c | 26 ++++++++++++++++++++++++++
+ 3 files changed, 28 insertions(+), 12 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index fe97bab..de81153 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -140,15 +140,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
* power switch and overcurrent detect
*/
-+#if 0 /* TODO: This needs to be modified to not rely on u-boot */
- gpio_request(gpio + 1, "EHCI_nOC");
- gpio_direction_input(gpio + 1);
-
-@@ -163,7 +164,7 @@ static int beagle_twl_gpio_setup(struct
-
- /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
- gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+- gpio_request(gpio + 1, "EHCI_nOC");
+- gpio_direction_input(gpio + 1);
-
-+#endif
+- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+-
+- /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+- gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
++ /* TODO: This needs to be modified to not rely on u-boot */
+
return 0;
}
+--- /tmp/usb-ehci.c 2009-07-30 13:14:34.000000000 +0200
++++ git/arch/arm/mach-omap2/usb-ehci.c 2009-07-30 13:16:03.000000000 +0200
+@@ -170,9 +170,7 @@
-Index: git/arch/arm/mach-omap2/usb-ehci.c
-===================================================================
---- git.orig/arch/arm/mach-omap2/usb-ehci.c
-+++ git/arch/arm/mach-omap2/usb-ehci.c
-@@ -147,9 +147,11 @@ static void setup_ehci_io_mux(void)
+ platform_device_add_data(&ehci_device, &pdata, sizeof(pdata));
- void __init usb_ehci_init(void)
- {
-+#if 0 /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
- /* Setup Pin IO MUX for EHCI */
- if (cpu_is_omap34xx())
- setup_ehci_io_mux();
-+#endif
+- /* Setup Pin IO MUX for EHCI */
+- if (cpu_is_omap34xx())
+- setup_ehci_io_mux();
++ /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
if (platform_device_register(&ehci_device) < 0) {
printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
-Index: git/drivers/usb/host/ehci-omap.c
-===================================================================
---- git.orig/drivers/usb/host/ehci-omap.c
-+++ git/drivers/usb/host/ehci-omap.c
-@@ -48,16 +48,25 @@
- * to get the PHY state machine in working state
- */
- #define EXTERNAL_PHY_RESET
-+#ifdef CONFIG_MACH_OMAP3_BEAGLE
-+#define EXT_PHY_RESET_GPIO_PORT2 (147)
-+#else
- #define EXT_PHY_RESET_GPIO_PORT1 (57)
- #define EXT_PHY_RESET_GPIO_PORT2 (61)
-+#endif
- #define EXT_PHY_RESET_DELAY (10)
-
-+#define PHY_STP_PULLUP_ENABLE (0x10)
-+#define PHY_STP_PULLUP_DISABLE (0x90)
-+
- /* ISSUE2:
- * USBHOST supports External charge pump PHYs only
- * Use the VBUS from Port1 to power VBUS of Port2 externally
- * So use Port2 as the working ULPI port
- */
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
- #define VBUS_INTERNAL_CHARGEPUMP_HACK
-+#endif
-
- #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
-
-@@ -225,14 +234,43 @@ static int omap_start_ehc(struct platfor
-
- #ifdef EXTERNAL_PHY_RESET
- /* Refer: ISSUE1 */
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
- gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
- gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
-+#endif
- gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
- gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
-+ gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
- /* Hold the PHY in RESET for enough time till DIR is high */
- udelay(EXT_PHY_RESET_DELAY);
- #endif
-
-+ /*
-+ * The PHY register 0x7 - Interface Control register is
-+ * configured to disable the integrated STP pull-up resistor
-+ * used for interface protection.
-+ *
-+ * May not need to be here.
-+ */
-+ omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
-+ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
-+ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
-+ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
-+ (PHY_STP_PULLUP_DISABLE),
-+ EHCI_INSNREG05_ULPI);
-+
-+ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
-+
-+ /* Force PHY to HS */
-+ omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
-+ (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
-+ (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
-+ (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
-+ (0x40),
-+ EHCI_INSNREG05_ULPI);
-+
-+ while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
-+
- /* Configure TLL for 60Mhz clk for ULPI */
- ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
- if (IS_ERR(ehci_clocks->usbtll_fck_clk))
-@@ -307,7 +345,9 @@ static int omap_start_ehc(struct platfor
- * Hold the PHY in RESET for enough time till PHY is settled and ready
- */
- udelay(EXT_PHY_RESET_DELAY);
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
- gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
-+#endif
- gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
- #endif
-
-@@ -393,7 +433,9 @@ static void omap_stop_ehc(struct platfor
-
-
- #ifdef EXTERNAL_PHY_RESET
-+#ifndef CONFIG_MACH_OMAP3_BEAGLE
- gpio_free(EXT_PHY_RESET_GPIO_PORT1);
-+#endif
- gpio_free(EXT_PHY_RESET_GPIO_PORT2);
- #endif
-
diff --git a/recipes/linux/linux-omap-pm/dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch b/recipes/linux/linux-omap-pm/dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch
new file mode 100644
index 0000000000..90151db610
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch
@@ -0,0 +1,1297 @@
+From 6ded8e833fa9559202dbd4c70a1bd95ffffacc5d Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 11 Feb 2009 16:33:02 +0200
+Subject: [PATCH 001/146] OMAPFB: move omapfb.h to include/linux/
+
+This is needed so that omapfb.h is automatically exported to user space.
+
+omapfb.h should be cleaned up later. Some stuff can probably be moved
+to omapfb's private include file.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/mach-omap1/board-nokia770.c | 2 +-
+ arch/arm/mach-omap2/board-n800.c | 2 +-
+ arch/arm/mach-omap2/io.c | 2 +-
+ arch/arm/plat-omap/fb.c | 2 +-
+ arch/arm/plat-omap/include/mach/omapfb.h | 398 ------------------------------
+ drivers/video/omap/blizzard.c | 2 +-
+ drivers/video/omap/dispc.c | 2 +-
+ drivers/video/omap/hwa742.c | 2 +-
+ drivers/video/omap/lcd_2430sdp.c | 2 +-
+ drivers/video/omap/lcd_ams_delta.c | 2 +-
+ drivers/video/omap/lcd_apollon.c | 2 +-
+ drivers/video/omap/lcd_h3.c | 2 +-
+ drivers/video/omap/lcd_h4.c | 3 +-
+ drivers/video/omap/lcd_inn1510.c | 2 +-
+ drivers/video/omap/lcd_inn1610.c | 2 +-
+ drivers/video/omap/lcd_ldp.c | 2 +-
+ drivers/video/omap/lcd_mipid.c | 2 +-
+ drivers/video/omap/lcd_omap2evm.c | 2 +-
+ drivers/video/omap/lcd_omap3beagle.c | 2 +-
+ drivers/video/omap/lcd_omap3evm.c | 2 +-
+ drivers/video/omap/lcd_osk.c | 2 +-
+ drivers/video/omap/lcd_overo.c | 2 +-
+ drivers/video/omap/lcd_palmte.c | 2 +-
+ drivers/video/omap/lcd_palmtt.c | 2 +-
+ drivers/video/omap/lcd_palmz71.c | 3 +-
+ drivers/video/omap/lcdc.c | 2 +-
+ drivers/video/omap/omapfb_main.c | 2 +-
+ drivers/video/omap/rfbi.c | 3 +-
+ drivers/video/omap/sossi.c | 2 +-
+ include/linux/omapfb.h | 398 ++++++++++++++++++++++++++++++
+ 30 files changed, 426 insertions(+), 429 deletions(-)
+ delete mode 100644 arch/arm/plat-omap/include/mach/omapfb.h
+ create mode 100644 include/linux/omapfb.h
+
+diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
+index ed2a48a..63be1bc 100644
+--- a/arch/arm/mach-omap1/board-nokia770.c
++++ b/arch/arm/mach-omap1/board-nokia770.c
+@@ -18,6 +18,7 @@
+ #include <linux/spi/spi.h>
+ #include <linux/spi/ads7846.h>
+ #include <linux/workqueue.h>
++#include <linux/omapfb.h>
+ #include <linux/delay.h>
+
+ #include <mach/hardware.h>
+@@ -32,7 +33,6 @@
+ #include <mach/keypad.h>
+ #include <mach/common.h>
+ #include <mach/dsp_common.h>
+-#include <mach/omapfb.h>
+ #include <mach/hwa742.h>
+ #include <mach/lcd_mipid.h>
+ #include <mach/mmc.h>
+diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
+index 23296e9..e2907ac 100644
+--- a/arch/arm/mach-omap2/board-n800.c
++++ b/arch/arm/mach-omap2/board-n800.c
+@@ -22,6 +22,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/irq.h>
+ #include <linux/i2c.h>
++#include <linux/omapfb.h>
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+@@ -34,7 +35,6 @@
+ #include <mach/lcd_mipid.h>
+ #include <mach/clock.h>
+ #include <mach/menelaus.h>
+-#include <mach/omapfb.h>
+ #include <mach/blizzard.h>
+ #include <mach/onenand.h>
+ #include <mach/board-nokia.h>
+diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
+index 3a86b0f..5c91f36 100644
+--- a/arch/arm/mach-omap2/io.c
++++ b/arch/arm/mach-omap2/io.c
+@@ -20,6 +20,7 @@
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+ #include <linux/init.h>
++#include <linux/omapfb.h>
+ #include <linux/io.h>
+ #include <linux/clk.h>
+
+@@ -28,7 +29,6 @@
+ #include <asm/mach/map.h>
+
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <mach/sram.h>
+ #include <mach/sdrc.h>
+ #include <mach/gpmc.h>
+diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
+index 3746222..40615a6 100644
+--- a/arch/arm/plat-omap/fb.c
++++ b/arch/arm/plat-omap/fb.c
+@@ -28,13 +28,13 @@
+ #include <linux/platform_device.h>
+ #include <linux/bootmem.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach/map.h>
+
+ #include <mach/board.h>
+ #include <mach/sram.h>
+-#include <mach/omapfb.h>
+
+ #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
+
+diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/mach/omapfb.h
+deleted file mode 100644
+index b226bdf..0000000
+--- a/arch/arm/plat-omap/include/mach/omapfb.h
++++ /dev/null
+@@ -1,398 +0,0 @@
+-/*
+- * File: arch/arm/plat-omap/include/mach/omapfb.h
+- *
+- * Framebuffer driver for TI OMAP boards
+- *
+- * Copyright (C) 2004 Nokia Corporation
+- * Author: Imre Deak <imre.deak@nokia.com>
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License as published by the
+- * Free Software Foundation; either version 2 of the License, or (at your
+- * option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful, but
+- * WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- * General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License along
+- * with this program; if not, write to the Free Software Foundation, Inc.,
+- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+- */
+-
+-#ifndef __OMAPFB_H
+-#define __OMAPFB_H
+-
+-#include <asm/ioctl.h>
+-#include <asm/types.h>
+-
+-/* IOCTL commands. */
+-
+-#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
+-#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
+-#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
+-#define OMAP_IO(num) _IO('O', num)
+-
+-#define OMAPFB_MIRROR OMAP_IOW(31, int)
+-#define OMAPFB_SYNC_GFX OMAP_IO(37)
+-#define OMAPFB_VSYNC OMAP_IO(38)
+-#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
+-#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
+-#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
+-#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
+-#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
+-#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
+-#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
+-#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
+-#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
+-#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
+-#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
+-#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
+-#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
+-
+-#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+-#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+-#define OMAPFB_CAPS_PANEL_MASK 0xff000000
+-
+-#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
+-#define OMAPFB_CAPS_TEARSYNC 0x00002000
+-#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
+-#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
+-#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
+-#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
+-#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
+-#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
+-#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
+-
+-/* Values from DSP must map to lower 16-bits */
+-#define OMAPFB_FORMAT_MASK 0x00ff
+-#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
+-#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
+-#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
+-#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
+-#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
+-
+-#define OMAPFB_EVENT_READY 1
+-#define OMAPFB_EVENT_DISABLED 2
+-
+-#define OMAPFB_MEMTYPE_SDRAM 0
+-#define OMAPFB_MEMTYPE_SRAM 1
+-#define OMAPFB_MEMTYPE_MAX 1
+-
+-enum omapfb_color_format {
+- OMAPFB_COLOR_RGB565 = 0,
+- OMAPFB_COLOR_YUV422,
+- OMAPFB_COLOR_YUV420,
+- OMAPFB_COLOR_CLUT_8BPP,
+- OMAPFB_COLOR_CLUT_4BPP,
+- OMAPFB_COLOR_CLUT_2BPP,
+- OMAPFB_COLOR_CLUT_1BPP,
+- OMAPFB_COLOR_RGB444,
+- OMAPFB_COLOR_YUY422,
+-};
+-
+-struct omapfb_update_window {
+- __u32 x, y;
+- __u32 width, height;
+- __u32 format;
+- __u32 out_x, out_y;
+- __u32 out_width, out_height;
+- __u32 reserved[8];
+-};
+-
+-struct omapfb_update_window_old {
+- __u32 x, y;
+- __u32 width, height;
+- __u32 format;
+-};
+-
+-enum omapfb_plane {
+- OMAPFB_PLANE_GFX = 0,
+- OMAPFB_PLANE_VID1,
+- OMAPFB_PLANE_VID2,
+-};
+-
+-enum omapfb_channel_out {
+- OMAPFB_CHANNEL_OUT_LCD = 0,
+- OMAPFB_CHANNEL_OUT_DIGIT,
+-};
+-
+-struct omapfb_plane_info {
+- __u32 pos_x;
+- __u32 pos_y;
+- __u8 enabled;
+- __u8 channel_out;
+- __u8 mirror;
+- __u8 reserved1;
+- __u32 out_width;
+- __u32 out_height;
+- __u32 reserved2[12];
+-};
+-
+-struct omapfb_mem_info {
+- __u32 size;
+- __u8 type;
+- __u8 reserved[3];
+-};
+-
+-struct omapfb_caps {
+- __u32 ctrl;
+- __u32 plane_color;
+- __u32 wnd_color;
+-};
+-
+-enum omapfb_color_key_type {
+- OMAPFB_COLOR_KEY_DISABLED = 0,
+- OMAPFB_COLOR_KEY_GFX_DST,
+- OMAPFB_COLOR_KEY_VID_SRC,
+-};
+-
+-struct omapfb_color_key {
+- __u8 channel_out;
+- __u32 background;
+- __u32 trans_key;
+- __u8 key_type;
+-};
+-
+-enum omapfb_update_mode {
+- OMAPFB_UPDATE_DISABLED = 0,
+- OMAPFB_AUTO_UPDATE,
+- OMAPFB_MANUAL_UPDATE
+-};
+-
+-#ifdef __KERNEL__
+-
+-#include <linux/completion.h>
+-#include <linux/interrupt.h>
+-#include <linux/fb.h>
+-#include <linux/mutex.h>
+-
+-#include <mach/board.h>
+-
+-#define OMAP_LCDC_INV_VSYNC 0x0001
+-#define OMAP_LCDC_INV_HSYNC 0x0002
+-#define OMAP_LCDC_INV_PIX_CLOCK 0x0004
+-#define OMAP_LCDC_INV_OUTPUT_EN 0x0008
+-#define OMAP_LCDC_HSVS_RISING_EDGE 0x0010
+-#define OMAP_LCDC_HSVS_OPPOSITE 0x0020
+-
+-#define OMAP_LCDC_SIGNAL_MASK 0x003f
+-
+-#define OMAP_LCDC_PANEL_TFT 0x0100
+-
+-#define OMAPFB_PLANE_XRES_MIN 8
+-#define OMAPFB_PLANE_YRES_MIN 8
+-
+-#ifdef CONFIG_ARCH_OMAP1
+-#define OMAPFB_PLANE_NUM 1
+-#else
+-#define OMAPFB_PLANE_NUM 3
+-#endif
+-
+-struct omapfb_device;
+-
+-struct lcd_panel {
+- const char *name;
+- int config; /* TFT/STN, signal inversion */
+- int bpp; /* Pixel format in fb mem */
+- int data_lines; /* Lines on LCD HW interface */
+-
+- int x_res, y_res;
+- int pixel_clock; /* In kHz */
+- int hsw; /* Horizontal synchronization
+- pulse width */
+- int hfp; /* Horizontal front porch */
+- int hbp; /* Horizontal back porch */
+- int vsw; /* Vertical synchronization
+- pulse width */
+- int vfp; /* Vertical front porch */
+- int vbp; /* Vertical back porch */
+- int acb; /* ac-bias pin frequency */
+- int pcd; /* pixel clock divider.
+- Obsolete use pixel_clock instead */
+-
+- int (*init) (struct lcd_panel *panel,
+- struct omapfb_device *fbdev);
+- void (*cleanup) (struct lcd_panel *panel);
+- int (*enable) (struct lcd_panel *panel);
+- void (*disable) (struct lcd_panel *panel);
+- unsigned long (*get_caps) (struct lcd_panel *panel);
+- int (*set_bklight_level)(struct lcd_panel *panel,
+- unsigned int level);
+- unsigned int (*get_bklight_level)(struct lcd_panel *panel);
+- unsigned int (*get_bklight_max) (struct lcd_panel *panel);
+- int (*run_test) (struct lcd_panel *panel, int test_num);
+-};
+-
+-struct extif_timings {
+- int cs_on_time;
+- int cs_off_time;
+- int we_on_time;
+- int we_off_time;
+- int re_on_time;
+- int re_off_time;
+- int we_cycle_time;
+- int re_cycle_time;
+- int cs_pulse_width;
+- int access_time;
+-
+- int clk_div;
+-
+- u32 tim[5]; /* set by extif->convert_timings */
+-
+- int converted;
+-};
+-
+-struct lcd_ctrl_extif {
+- int (*init) (struct omapfb_device *fbdev);
+- void (*cleanup) (void);
+- void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
+- unsigned long (*get_max_tx_rate)(void);
+- int (*convert_timings) (struct extif_timings *timings);
+- void (*set_timings) (const struct extif_timings *timings);
+- void (*set_bits_per_cycle)(int bpc);
+- void (*write_command) (const void *buf, unsigned int len);
+- void (*read_data) (void *buf, unsigned int len);
+- void (*write_data) (const void *buf, unsigned int len);
+- void (*transfer_area) (int width, int height,
+- void (callback)(void * data), void *data);
+- int (*setup_tearsync) (unsigned pin_cnt,
+- unsigned hs_pulse_time, unsigned vs_pulse_time,
+- int hs_pol_inv, int vs_pol_inv, int div);
+- int (*enable_tearsync) (int enable, unsigned line);
+-
+- unsigned long max_transmit_size;
+-};
+-
+-struct omapfb_notifier_block {
+- struct notifier_block nb;
+- void *data;
+- int plane_idx;
+-};
+-
+-typedef int (*omapfb_notifier_callback_t)(struct notifier_block *,
+- unsigned long event,
+- void *fbi);
+-
+-struct omapfb_mem_region {
+- u32 paddr;
+- void __iomem *vaddr;
+- unsigned long size;
+- u8 type; /* OMAPFB_PLANE_MEM_* */
+- unsigned alloc:1; /* allocated by the driver */
+- unsigned map:1; /* kernel mapped by the driver */
+-};
+-
+-struct omapfb_mem_desc {
+- int region_cnt;
+- struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
+-};
+-
+-struct lcd_ctrl {
+- const char *name;
+- void *data;
+-
+- int (*init) (struct omapfb_device *fbdev,
+- int ext_mode,
+- struct omapfb_mem_desc *req_md);
+- void (*cleanup) (void);
+- void (*bind_client) (struct omapfb_notifier_block *nb);
+- void (*get_caps) (int plane, struct omapfb_caps *caps);
+- int (*set_update_mode)(enum omapfb_update_mode mode);
+- enum omapfb_update_mode (*get_update_mode)(void);
+- int (*setup_plane) (int plane, int channel_out,
+- unsigned long offset,
+- int screen_width,
+- int pos_x, int pos_y, int width,
+- int height, int color_mode);
+- int (*set_rotate) (int angle);
+- int (*setup_mem) (int plane, size_t size,
+- int mem_type, unsigned long *paddr);
+- int (*mmap) (struct fb_info *info,
+- struct vm_area_struct *vma);
+- int (*set_scale) (int plane,
+- int orig_width, int orig_height,
+- int out_width, int out_height);
+- int (*enable_plane) (int plane, int enable);
+- int (*update_window) (struct fb_info *fbi,
+- struct omapfb_update_window *win,
+- void (*callback)(void *),
+- void *callback_data);
+- void (*sync) (void);
+- void (*suspend) (void);
+- void (*resume) (void);
+- int (*run_test) (int test_num);
+- int (*setcolreg) (u_int regno, u16 red, u16 green,
+- u16 blue, u16 transp,
+- int update_hw_mem);
+- int (*set_color_key) (struct omapfb_color_key *ck);
+- int (*get_color_key) (struct omapfb_color_key *ck);
+-};
+-
+-enum omapfb_state {
+- OMAPFB_DISABLED = 0,
+- OMAPFB_SUSPENDED= 99,
+- OMAPFB_ACTIVE = 100
+-};
+-
+-struct omapfb_plane_struct {
+- int idx;
+- struct omapfb_plane_info info;
+- enum omapfb_color_format color_mode;
+- struct omapfb_device *fbdev;
+-};
+-
+-struct omapfb_device {
+- int state;
+- int ext_lcdc; /* Using external
+- LCD controller */
+- struct mutex rqueue_mutex;
+-
+- int palette_size;
+- u32 pseudo_palette[17];
+-
+- struct lcd_panel *panel; /* LCD panel */
+- const struct lcd_ctrl *ctrl; /* LCD controller */
+- const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
+- struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
+- interface */
+- struct device *dev;
+- struct fb_var_screeninfo new_var; /* for mode changes */
+-
+- struct omapfb_mem_desc mem_desc;
+- struct fb_info *fb_info[OMAPFB_PLANE_NUM];
+-};
+-
+-struct omapfb_platform_data {
+- struct omap_lcd_config lcd;
+- struct omapfb_mem_desc mem_desc;
+- void *ctrl_platform_data;
+-};
+-
+-#ifdef CONFIG_ARCH_OMAP1
+-extern struct lcd_ctrl omap1_lcd_ctrl;
+-#else
+-extern struct lcd_ctrl omap2_disp_ctrl;
+-#endif
+-
+-extern void omapfb_reserve_sdram(void);
+-extern void omapfb_register_panel(struct lcd_panel *panel);
+-extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
+-extern void omapfb_notify_clients(struct omapfb_device *fbdev,
+- unsigned long event);
+-extern int omapfb_register_client(struct omapfb_notifier_block *nb,
+- omapfb_notifier_callback_t callback,
+- void *callback_data);
+-extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
+-extern int omapfb_update_window_async(struct fb_info *fbi,
+- struct omapfb_update_window *win,
+- void (*callback)(void *),
+- void *callback_data);
+-
+-/* in arch/arm/plat-omap/fb.c */
+-extern void omapfb_set_ctrl_platform_data(void *pdata);
+-
+-#endif /* __KERNEL__ */
+-
+-#endif /* __OMAPFB_H */
+diff --git a/drivers/video/omap/blizzard.c b/drivers/video/omap/blizzard.c
+index d5e5955..56097ae 100644
+--- a/drivers/video/omap/blizzard.c
++++ b/drivers/video/omap/blizzard.c
+@@ -25,9 +25,9 @@
+ #include <linux/fb.h>
+ #include <linux/delay.h>
+ #include <linux/clk.h>
++#include <linux/omapfb.h>
+
+ #include <mach/dma.h>
+-#include <mach/omapfb.h>
+ #include <mach/blizzard.h>
+
+ #include "dispc.h"
+diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
+index 350b444..9f04e34 100644
+--- a/drivers/video/omap/dispc.c
++++ b/drivers/video/omap/dispc.c
+@@ -24,9 +24,9 @@
+ #include <linux/vmalloc.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/sram.h>
+-#include <mach/omapfb.h>
+ #include <mach/board.h>
+
+ #include "dispc.h"
+diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
+index ca51583..e93a51b 100644
+--- a/drivers/video/omap/hwa742.c
++++ b/drivers/video/omap/hwa742.c
+@@ -25,9 +25,9 @@
+ #include <linux/fb.h>
+ #include <linux/delay.h>
+ #include <linux/clk.h>
++#include <linux/omapfb.h>
+
+ #include <mach/dma.h>
+-#include <mach/omapfb.h>
+ #include <mach/hwa742.h>
+
+ #define HWA742_REV_CODE_REG 0x0
+diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c
+index 13c822e..e199bba 100644
+--- a/drivers/video/omap/lcd_2430sdp.c
++++ b/drivers/video/omap/lcd_2430sdp.c
+@@ -26,9 +26,9 @@
+ #include <linux/delay.h>
+ #include <linux/gpio.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
+diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
+index 1f74399..e480b6b 100644
+--- a/drivers/video/omap/lcd_ams_delta.c
++++ b/drivers/video/omap/lcd_ams_delta.c
+@@ -24,10 +24,10 @@
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+ #include <linux/delay.h>
++#include <linux/omapfb.h>
+
+ #include <mach/board-ams-delta.h>
+ #include <mach/hardware.h>
+-#include <mach/omapfb.h>
+
+ #define AMS_DELTA_DEFAULT_CONTRAST 112
+
+diff --git a/drivers/video/omap/lcd_apollon.c b/drivers/video/omap/lcd_apollon.c
+index 626ae3a..15a0ced 100644
+--- a/drivers/video/omap/lcd_apollon.c
++++ b/drivers/video/omap/lcd_apollon.c
+@@ -23,10 +23,10 @@
+
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+
+ /* #define USE_35INCH_LCD 1 */
+
+diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
+index 2486237..f7264ea 100644
+--- a/drivers/video/omap/lcd_h3.c
++++ b/drivers/video/omap/lcd_h3.c
+@@ -22,9 +22,9 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/i2c/tps65010.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+-#include <mach/omapfb.h>
+
+ #define MODULE_NAME "omapfb-lcd_h3"
+
+diff --git a/drivers/video/omap/lcd_h4.c b/drivers/video/omap/lcd_h4.c
+index 6ff5643..d72df0c 100644
+--- a/drivers/video/omap/lcd_h4.c
++++ b/drivers/video/omap/lcd_h4.c
+@@ -21,8 +21,7 @@
+
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+-
+-#include <mach/omapfb.h>
++#include <linux/omapfb.h>
+
+ static int h4_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
+ {
+diff --git a/drivers/video/omap/lcd_inn1510.c b/drivers/video/omap/lcd_inn1510.c
+index 6953ed4..f6e05d7 100644
+--- a/drivers/video/omap/lcd_inn1510.c
++++ b/drivers/video/omap/lcd_inn1510.c
+@@ -22,9 +22,9 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/fpga.h>
+-#include <mach/omapfb.h>
+
+ static int innovator1510_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
+index 4c4f7ee..c599e41 100644
+--- a/drivers/video/omap/lcd_inn1610.c
++++ b/drivers/video/omap/lcd_inn1610.c
+@@ -21,9 +21,9 @@
+
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+-#include <mach/omapfb.h>
+
+ #define MODULE_NAME "omapfb-lcd_h3"
+
+diff --git a/drivers/video/omap/lcd_ldp.c b/drivers/video/omap/lcd_ldp.c
+index 8925230..1c25186 100644
+--- a/drivers/video/omap/lcd_ldp.c
++++ b/drivers/video/omap/lcd_ldp.c
+@@ -25,10 +25,10 @@
+ #include <linux/platform_device.h>
+ #include <linux/delay.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define LCD_PANEL_BACKLIGHT_GPIO (15 + OMAP_MAX_GPIO_LINES)
+diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
+index 3165d3d..025ee97 100644
+--- a/drivers/video/omap/lcd_mipid.c
++++ b/drivers/video/omap/lcd_mipid.c
+@@ -22,8 +22,8 @@
+ #include <linux/delay.h>
+ #include <linux/workqueue.h>
+ #include <linux/spi/spi.h>
++#include <linux/omapfb.h>
+
+-#include <mach/omapfb.h>
+ #include <mach/lcd_mipid.h>
+
+ #define MIPID_MODULE_NAME "lcd_mipid"
+diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c
+index 2fc46c2..1908a2b 100644
+--- a/drivers/video/omap/lcd_omap2evm.c
++++ b/drivers/video/omap/lcd_omap2evm.c
+@@ -25,9 +25,9 @@
+ #include <linux/platform_device.h>
+ #include <linux/gpio.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define LCD_PANEL_ENABLE_GPIO 154
+diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c
+index 40454dc..dbb832c 100644
+--- a/drivers/video/omap/lcd_omap3beagle.c
++++ b/drivers/video/omap/lcd_omap3beagle.c
+@@ -24,9 +24,9 @@
+ #include <linux/platform_device.h>
+ #include <linux/gpio.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define LCD_PANEL_ENABLE_GPIO 170
+diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c
+index 1c3d814..10ba48c 100644
+--- a/drivers/video/omap/lcd_omap3evm.c
++++ b/drivers/video/omap/lcd_omap3evm.c
+@@ -24,9 +24,9 @@
+ #include <linux/platform_device.h>
+ #include <linux/gpio.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define LCD_PANEL_ENABLE_GPIO 153
+diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
+index 379c96d..d6b193e 100644
+--- a/drivers/video/omap/lcd_osk.c
++++ b/drivers/video/omap/lcd_osk.c
+@@ -22,10 +22,10 @@
+
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+
+ static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
+ {
+diff --git a/drivers/video/omap/lcd_overo.c b/drivers/video/omap/lcd_overo.c
+index 2bc5c92..40c2026 100644
+--- a/drivers/video/omap/lcd_overo.c
++++ b/drivers/video/omap/lcd_overo.c
+@@ -22,10 +22,10 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+ #include <mach/mux.h>
+-#include <mach/omapfb.h>
+ #include <asm/mach-types.h>
+
+ #define LCD_ENABLE 144
+diff --git a/drivers/video/omap/lcd_palmte.c b/drivers/video/omap/lcd_palmte.c
+index 2183173..dcb456c 100644
+--- a/drivers/video/omap/lcd_palmte.c
++++ b/drivers/video/omap/lcd_palmte.c
+@@ -22,9 +22,9 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/fpga.h>
+-#include <mach/omapfb.h>
+
+ static int palmte_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+diff --git a/drivers/video/omap/lcd_palmtt.c b/drivers/video/omap/lcd_palmtt.c
+index 57b0f6c..e8adab8 100644
+--- a/drivers/video/omap/lcd_palmtt.c
++++ b/drivers/video/omap/lcd_palmtt.c
+@@ -28,9 +28,9 @@ GPIO13 - screen blanking
+ #include <linux/platform_device.h>
+ #include <linux/module.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/gpio.h>
+-#include <mach/omapfb.h>
+
+ static int palmtt_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+diff --git a/drivers/video/omap/lcd_palmz71.c b/drivers/video/omap/lcd_palmz71.c
+index d33d78b..d5b3f82 100644
+--- a/drivers/video/omap/lcd_palmz71.c
++++ b/drivers/video/omap/lcd_palmz71.c
+@@ -23,8 +23,7 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+-
+-#include <mach/omapfb.h>
++#include <linux/omapfb.h>
+
+ static int palmz71_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
+index ab39492..633e33c 100644
+--- a/drivers/video/omap/lcdc.c
++++ b/drivers/video/omap/lcdc.c
+@@ -28,9 +28,9 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/vmalloc.h>
+ #include <linux/clk.h>
++#include <linux/omapfb.h>
+
+ #include <mach/dma.h>
+-#include <mach/omapfb.h>
+
+ #include <asm/mach-types.h>
+
+diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
+index 0df4523..a06f964 100644
+--- a/drivers/video/omap/omapfb_main.c
++++ b/drivers/video/omap/omapfb_main.c
+@@ -27,9 +27,9 @@
+ #include <linux/platform_device.h>
+ #include <linux/mm.h>
+ #include <linux/uaccess.h>
++#include <linux/omapfb.h>
+
+ #include <mach/dma.h>
+-#include <mach/omapfb.h>
+
+ #include "lcdc.h"
+ #include "dispc.h"
+diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c
+index ee01e84..9040678 100644
+--- a/drivers/video/omap/rfbi.c
++++ b/drivers/video/omap/rfbi.c
+@@ -26,8 +26,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
+-
+-#include <mach/omapfb.h>
++#include <linux/omapfb.h>
+
+ #include "dispc.h"
+
+diff --git a/drivers/video/omap/sossi.c b/drivers/video/omap/sossi.c
+index a769462..cab398f 100644
+--- a/drivers/video/omap/sossi.c
++++ b/drivers/video/omap/sossi.c
+@@ -23,9 +23,9 @@
+ #include <linux/clk.h>
+ #include <linux/irq.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <mach/dma.h>
+-#include <mach/omapfb.h>
+
+ #include "lcdc.h"
+
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+new file mode 100644
+index 0000000..b226bdf
+--- /dev/null
++++ b/include/linux/omapfb.h
+@@ -0,0 +1,398 @@
++/*
++ * File: arch/arm/plat-omap/include/mach/omapfb.h
++ *
++ * Framebuffer driver for TI OMAP boards
++ *
++ * Copyright (C) 2004 Nokia Corporation
++ * Author: Imre Deak <imre.deak@nokia.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write to the Free Software Foundation, Inc.,
++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++#ifndef __OMAPFB_H
++#define __OMAPFB_H
++
++#include <asm/ioctl.h>
++#include <asm/types.h>
++
++/* IOCTL commands. */
++
++#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
++#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
++#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
++#define OMAP_IO(num) _IO('O', num)
++
++#define OMAPFB_MIRROR OMAP_IOW(31, int)
++#define OMAPFB_SYNC_GFX OMAP_IO(37)
++#define OMAPFB_VSYNC OMAP_IO(38)
++#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
++#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
++#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
++#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
++#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
++#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
++#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
++#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
++#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
++#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
++#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
++#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
++#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
++
++#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
++#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
++#define OMAPFB_CAPS_PANEL_MASK 0xff000000
++
++#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
++#define OMAPFB_CAPS_TEARSYNC 0x00002000
++#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
++#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
++#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
++#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
++#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
++#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
++#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
++
++/* Values from DSP must map to lower 16-bits */
++#define OMAPFB_FORMAT_MASK 0x00ff
++#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
++#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
++#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
++#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
++#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
++
++#define OMAPFB_EVENT_READY 1
++#define OMAPFB_EVENT_DISABLED 2
++
++#define OMAPFB_MEMTYPE_SDRAM 0
++#define OMAPFB_MEMTYPE_SRAM 1
++#define OMAPFB_MEMTYPE_MAX 1
++
++enum omapfb_color_format {
++ OMAPFB_COLOR_RGB565 = 0,
++ OMAPFB_COLOR_YUV422,
++ OMAPFB_COLOR_YUV420,
++ OMAPFB_COLOR_CLUT_8BPP,
++ OMAPFB_COLOR_CLUT_4BPP,
++ OMAPFB_COLOR_CLUT_2BPP,
++ OMAPFB_COLOR_CLUT_1BPP,
++ OMAPFB_COLOR_RGB444,
++ OMAPFB_COLOR_YUY422,
++};
++
++struct omapfb_update_window {
++ __u32 x, y;
++ __u32 width, height;
++ __u32 format;
++ __u32 out_x, out_y;
++ __u32 out_width, out_height;
++ __u32 reserved[8];
++};
++
++struct omapfb_update_window_old {
++ __u32 x, y;
++ __u32 width, height;
++ __u32 format;
++};
++
++enum omapfb_plane {
++ OMAPFB_PLANE_GFX = 0,
++ OMAPFB_PLANE_VID1,
++ OMAPFB_PLANE_VID2,
++};
++
++enum omapfb_channel_out {
++ OMAPFB_CHANNEL_OUT_LCD = 0,
++ OMAPFB_CHANNEL_OUT_DIGIT,
++};
++
++struct omapfb_plane_info {
++ __u32 pos_x;
++ __u32 pos_y;
++ __u8 enabled;
++ __u8 channel_out;
++ __u8 mirror;
++ __u8 reserved1;
++ __u32 out_width;
++ __u32 out_height;
++ __u32 reserved2[12];
++};
++
++struct omapfb_mem_info {
++ __u32 size;
++ __u8 type;
++ __u8 reserved[3];
++};
++
++struct omapfb_caps {
++ __u32 ctrl;
++ __u32 plane_color;
++ __u32 wnd_color;
++};
++
++enum omapfb_color_key_type {
++ OMAPFB_COLOR_KEY_DISABLED = 0,
++ OMAPFB_COLOR_KEY_GFX_DST,
++ OMAPFB_COLOR_KEY_VID_SRC,
++};
++
++struct omapfb_color_key {
++ __u8 channel_out;
++ __u32 background;
++ __u32 trans_key;
++ __u8 key_type;
++};
++
++enum omapfb_update_mode {
++ OMAPFB_UPDATE_DISABLED = 0,
++ OMAPFB_AUTO_UPDATE,
++ OMAPFB_MANUAL_UPDATE
++};
++
++#ifdef __KERNEL__
++
++#include <linux/completion.h>
++#include <linux/interrupt.h>
++#include <linux/fb.h>
++#include <linux/mutex.h>
++
++#include <mach/board.h>
++
++#define OMAP_LCDC_INV_VSYNC 0x0001
++#define OMAP_LCDC_INV_HSYNC 0x0002
++#define OMAP_LCDC_INV_PIX_CLOCK 0x0004
++#define OMAP_LCDC_INV_OUTPUT_EN 0x0008
++#define OMAP_LCDC_HSVS_RISING_EDGE 0x0010
++#define OMAP_LCDC_HSVS_OPPOSITE 0x0020
++
++#define OMAP_LCDC_SIGNAL_MASK 0x003f
++
++#define OMAP_LCDC_PANEL_TFT 0x0100
++
++#define OMAPFB_PLANE_XRES_MIN 8
++#define OMAPFB_PLANE_YRES_MIN 8
++
++#ifdef CONFIG_ARCH_OMAP1
++#define OMAPFB_PLANE_NUM 1
++#else
++#define OMAPFB_PLANE_NUM 3
++#endif
++
++struct omapfb_device;
++
++struct lcd_panel {
++ const char *name;
++ int config; /* TFT/STN, signal inversion */
++ int bpp; /* Pixel format in fb mem */
++ int data_lines; /* Lines on LCD HW interface */
++
++ int x_res, y_res;
++ int pixel_clock; /* In kHz */
++ int hsw; /* Horizontal synchronization
++ pulse width */
++ int hfp; /* Horizontal front porch */
++ int hbp; /* Horizontal back porch */
++ int vsw; /* Vertical synchronization
++ pulse width */
++ int vfp; /* Vertical front porch */
++ int vbp; /* Vertical back porch */
++ int acb; /* ac-bias pin frequency */
++ int pcd; /* pixel clock divider.
++ Obsolete use pixel_clock instead */
++
++ int (*init) (struct lcd_panel *panel,
++ struct omapfb_device *fbdev);
++ void (*cleanup) (struct lcd_panel *panel);
++ int (*enable) (struct lcd_panel *panel);
++ void (*disable) (struct lcd_panel *panel);
++ unsigned long (*get_caps) (struct lcd_panel *panel);
++ int (*set_bklight_level)(struct lcd_panel *panel,
++ unsigned int level);
++ unsigned int (*get_bklight_level)(struct lcd_panel *panel);
++ unsigned int (*get_bklight_max) (struct lcd_panel *panel);
++ int (*run_test) (struct lcd_panel *panel, int test_num);
++};
++
++struct extif_timings {
++ int cs_on_time;
++ int cs_off_time;
++ int we_on_time;
++ int we_off_time;
++ int re_on_time;
++ int re_off_time;
++ int we_cycle_time;
++ int re_cycle_time;
++ int cs_pulse_width;
++ int access_time;
++
++ int clk_div;
++
++ u32 tim[5]; /* set by extif->convert_timings */
++
++ int converted;
++};
++
++struct lcd_ctrl_extif {
++ int (*init) (struct omapfb_device *fbdev);
++ void (*cleanup) (void);
++ void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div);
++ unsigned long (*get_max_tx_rate)(void);
++ int (*convert_timings) (struct extif_timings *timings);
++ void (*set_timings) (const struct extif_timings *timings);
++ void (*set_bits_per_cycle)(int bpc);
++ void (*write_command) (const void *buf, unsigned int len);
++ void (*read_data) (void *buf, unsigned int len);
++ void (*write_data) (const void *buf, unsigned int len);
++ void (*transfer_area) (int width, int height,
++ void (callback)(void * data), void *data);
++ int (*setup_tearsync) (unsigned pin_cnt,
++ unsigned hs_pulse_time, unsigned vs_pulse_time,
++ int hs_pol_inv, int vs_pol_inv, int div);
++ int (*enable_tearsync) (int enable, unsigned line);
++
++ unsigned long max_transmit_size;
++};
++
++struct omapfb_notifier_block {
++ struct notifier_block nb;
++ void *data;
++ int plane_idx;
++};
++
++typedef int (*omapfb_notifier_callback_t)(struct notifier_block *,
++ unsigned long event,
++ void *fbi);
++
++struct omapfb_mem_region {
++ u32 paddr;
++ void __iomem *vaddr;
++ unsigned long size;
++ u8 type; /* OMAPFB_PLANE_MEM_* */
++ unsigned alloc:1; /* allocated by the driver */
++ unsigned map:1; /* kernel mapped by the driver */
++};
++
++struct omapfb_mem_desc {
++ int region_cnt;
++ struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
++};
++
++struct lcd_ctrl {
++ const char *name;
++ void *data;
++
++ int (*init) (struct omapfb_device *fbdev,
++ int ext_mode,
++ struct omapfb_mem_desc *req_md);
++ void (*cleanup) (void);
++ void (*bind_client) (struct omapfb_notifier_block *nb);
++ void (*get_caps) (int plane, struct omapfb_caps *caps);
++ int (*set_update_mode)(enum omapfb_update_mode mode);
++ enum omapfb_update_mode (*get_update_mode)(void);
++ int (*setup_plane) (int plane, int channel_out,
++ unsigned long offset,
++ int screen_width,
++ int pos_x, int pos_y, int width,
++ int height, int color_mode);
++ int (*set_rotate) (int angle);
++ int (*setup_mem) (int plane, size_t size,
++ int mem_type, unsigned long *paddr);
++ int (*mmap) (struct fb_info *info,
++ struct vm_area_struct *vma);
++ int (*set_scale) (int plane,
++ int orig_width, int orig_height,
++ int out_width, int out_height);
++ int (*enable_plane) (int plane, int enable);
++ int (*update_window) (struct fb_info *fbi,
++ struct omapfb_update_window *win,
++ void (*callback)(void *),
++ void *callback_data);
++ void (*sync) (void);
++ void (*suspend) (void);
++ void (*resume) (void);
++ int (*run_test) (int test_num);
++ int (*setcolreg) (u_int regno, u16 red, u16 green,
++ u16 blue, u16 transp,
++ int update_hw_mem);
++ int (*set_color_key) (struct omapfb_color_key *ck);
++ int (*get_color_key) (struct omapfb_color_key *ck);
++};
++
++enum omapfb_state {
++ OMAPFB_DISABLED = 0,
++ OMAPFB_SUSPENDED= 99,
++ OMAPFB_ACTIVE = 100
++};
++
++struct omapfb_plane_struct {
++ int idx;
++ struct omapfb_plane_info info;
++ enum omapfb_color_format color_mode;
++ struct omapfb_device *fbdev;
++};
++
++struct omapfb_device {
++ int state;
++ int ext_lcdc; /* Using external
++ LCD controller */
++ struct mutex rqueue_mutex;
++
++ int palette_size;
++ u32 pseudo_palette[17];
++
++ struct lcd_panel *panel; /* LCD panel */
++ const struct lcd_ctrl *ctrl; /* LCD controller */
++ const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
++ struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
++ interface */
++ struct device *dev;
++ struct fb_var_screeninfo new_var; /* for mode changes */
++
++ struct omapfb_mem_desc mem_desc;
++ struct fb_info *fb_info[OMAPFB_PLANE_NUM];
++};
++
++struct omapfb_platform_data {
++ struct omap_lcd_config lcd;
++ struct omapfb_mem_desc mem_desc;
++ void *ctrl_platform_data;
++};
++
++#ifdef CONFIG_ARCH_OMAP1
++extern struct lcd_ctrl omap1_lcd_ctrl;
++#else
++extern struct lcd_ctrl omap2_disp_ctrl;
++#endif
++
++extern void omapfb_reserve_sdram(void);
++extern void omapfb_register_panel(struct lcd_panel *panel);
++extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
++extern void omapfb_notify_clients(struct omapfb_device *fbdev,
++ unsigned long event);
++extern int omapfb_register_client(struct omapfb_notifier_block *nb,
++ omapfb_notifier_callback_t callback,
++ void *callback_data);
++extern int omapfb_unregister_client(struct omapfb_notifier_block *nb);
++extern int omapfb_update_window_async(struct fb_info *fbi,
++ struct omapfb_update_window *win,
++ void (*callback)(void *),
++ void *callback_data);
++
++/* in arch/arm/plat-omap/fb.c */
++extern void omapfb_set_ctrl_platform_data(void *pdata);
++
++#endif /* __KERNEL__ */
++
++#endif /* __OMAPFB_H */
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch b/recipes/linux/linux-omap-pm/dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch
new file mode 100644
index 0000000000..0b8e2e2c6b
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch
@@ -0,0 +1,14450 @@
+From 8dd3bdbcdeba2b9ebba84ac6dde99c3673c08437 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 10:23:42 +0300
+Subject: [PATCH 002/146] DSS2: OMAP2/3 Display Subsystem driver
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ Documentation/arm/OMAP/DSS | 311 +++
+ arch/arm/plat-omap/Makefile | 2 +-
+ arch/arm/plat-omap/include/mach/display.h | 520 ++++
+ arch/arm/plat-omap/include/mach/vram.h | 33 +
+ arch/arm/plat-omap/include/mach/vrfb.h | 47 +
+ arch/arm/plat-omap/vram.c | 615 +++++
+ arch/arm/plat-omap/vrfb.c | 159 ++
+ drivers/video/Kconfig | 1 +
+ drivers/video/Makefile | 1 +
+ drivers/video/omap2/Kconfig | 3 +
+ drivers/video/omap2/Makefile | 4 +
+ drivers/video/omap2/dss/Kconfig | 89 +
+ drivers/video/omap2/dss/Makefile | 6 +
+ drivers/video/omap2/dss/core.c | 641 +++++
+ drivers/video/omap2/dss/dispc.c | 2968 +++++++++++++++++++++++
+ drivers/video/omap2/dss/display.c | 693 ++++++
+ drivers/video/omap2/dss/dpi.c | 393 +++
+ drivers/video/omap2/dss/dsi.c | 3752 +++++++++++++++++++++++++++++
+ drivers/video/omap2/dss/dss.c | 345 +++
+ drivers/video/omap2/dss/dss.h | 331 +++
+ drivers/video/omap2/dss/manager.c | 576 +++++
+ drivers/video/omap2/dss/overlay.c | 587 +++++
+ drivers/video/omap2/dss/rfbi.c | 1304 ++++++++++
+ drivers/video/omap2/dss/sdi.c | 245 ++
+ drivers/video/omap2/dss/venc.c | 600 +++++
+ 25 files changed, 14225 insertions(+), 1 deletions(-)
+ create mode 100644 Documentation/arm/OMAP/DSS
+ create mode 100644 arch/arm/plat-omap/include/mach/display.h
+ create mode 100644 arch/arm/plat-omap/include/mach/vram.h
+ create mode 100644 arch/arm/plat-omap/include/mach/vrfb.h
+ create mode 100644 arch/arm/plat-omap/vram.c
+ create mode 100644 arch/arm/plat-omap/vrfb.c
+ create mode 100644 drivers/video/omap2/Kconfig
+ create mode 100644 drivers/video/omap2/Makefile
+ create mode 100644 drivers/video/omap2/dss/Kconfig
+ create mode 100644 drivers/video/omap2/dss/Makefile
+ create mode 100644 drivers/video/omap2/dss/core.c
+ create mode 100644 drivers/video/omap2/dss/dispc.c
+ create mode 100644 drivers/video/omap2/dss/display.c
+ create mode 100644 drivers/video/omap2/dss/dpi.c
+ create mode 100644 drivers/video/omap2/dss/dsi.c
+ create mode 100644 drivers/video/omap2/dss/dss.c
+ create mode 100644 drivers/video/omap2/dss/dss.h
+ create mode 100644 drivers/video/omap2/dss/manager.c
+ create mode 100644 drivers/video/omap2/dss/overlay.c
+ create mode 100644 drivers/video/omap2/dss/rfbi.c
+ create mode 100644 drivers/video/omap2/dss/sdi.c
+ create mode 100644 drivers/video/omap2/dss/venc.c
+
+diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
+new file mode 100644
+index 0000000..9e902a2
+--- /dev/null
++++ b/Documentation/arm/OMAP/DSS
+@@ -0,0 +1,311 @@
++OMAP2/3 Display Subsystem
++-------------------------
++
++This is an almost total rewrite of the OMAP FB driver in drivers/video/omap
++(let's call it DSS1). The main differences between DSS1 and DSS2 are DSI,
++TV-out and multiple display support, but there are lots of small improvements
++also.
++
++The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB,
++panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live
++currently side by side, you can choose which one to use.
++
++Features
++--------
++
++Working and tested features include:
++
++- MIPI DPI (parallel) output
++- MIPI DSI output in command mode
++- MIPI DBI (RFBI) output
++- SDI output
++- TV output
++- All pieces can be compiled as a module or inside kernel
++- Use DISPC to update any of the outputs
++- Use CPU to update RFBI or DSI output
++- OMAP DISPC planes
++- RGB16, RGB24 packed, RGB24 unpacked
++- YUV2, UYVY
++- Scaling
++- Adjusting DSS FCK to find a good pixel clock
++- Use DSI DPLL to create DSS FCK
++
++Tested boards include:
++- OMAP3 SDP board
++- Beagle board
++- N810
++
++omapdss driver
++--------------
++
++The DSS driver does not itself have any support for Linux framebuffer, V4L or
++such like the current ones, but it has an internal kernel API that upper level
++drivers can use.
++
++The DSS driver models OMAP's overlays, overlay managers and displays in a
++flexible way to enable non-common multi-display configuration. In addition to
++modelling the hardware overlays, omapdss supports virtual overlays and overlay
++managers. These can be used when updating a display with CPU or system DMA.
++
++Panel and controller drivers
++----------------------------
++
++The drivers implement panel or controller specific functionality and are not
++usually visible to users except through omapfb driver. They register
++themselves to the DSS driver.
++
++omapfb driver
++-------------
++
++The omapfb driver implements arbitrary number of standard linux framebuffers.
++These framebuffers can be routed flexibly to any overlays, thus allowing very
++dynamic display architecture.
++
++The driver exports some omapfb specific ioctls, which are compatible with the
++ioctls in the old driver.
++
++The rest of the non standard features are exported via sysfs. Whether the final
++implementation will use sysfs, or ioctls, is still open.
++
++V4L2 drivers
++------------
++
++V4L2 is being implemented in TI.
++
++From omapdss point of view the V4L2 drivers should be similar to framebuffer
++driver.
++
++Architecture
++--------------------
++
++Some clarification what the different components do:
++
++ - Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the
++ pixel data for the image. Framebuffer has width and height and color
++ depth.
++ - Overlay defines where the pixels are read from and where they go on the
++ screen. The overlay may be smaller than framebuffer, thus displaying only
++ part of the framebuffer. The position of the overlay may be changed if
++ the overlay is smaller than the display.
++ - Overlay manager combines the overlays in to one image and feeds them to
++ display.
++ - Display is the actual physical display device.
++
++A framebuffer can be connected to multiple overlays to show the same pixel data
++on all of the overlays. Note that in this case the overlay input sizes must be
++the same, but, in case of video overlays, the output size can be different. Any
++framebuffer can be connected to any overlay.
++
++An overlay can be connected to one overlay manager. Also DISPC overlays can be
++connected only to DISPC overlay managers, and virtual overlays can be only
++connected to virtual overlays.
++
++An overlay manager can be connected to one display. There are certain
++restrictions which kinds of displays an overlay manager can be connected:
++
++ - DISPC TV overlay manager can be only connected to TV display.
++ - Virtual overlay managers can only be connected to DBI or DSI displays.
++ - DISPC LCD overlay manager can be connected to all displays, except TV
++ display.
++
++Sysfs
++-----
++The sysfs interface is mainly used for testing. I don't think sysfs
++interface is the best for this in the final version, but I don't quite know
++what would be the best interfaces for these things.
++
++The sysfs interface is divided to two parts: DSS and FB.
++
++/sys/class/graphics/fb? directory:
++mirror 0=off, 1=on
++rotate Rotation 0-3 for 0, 90, 180, 270 degrees
++rotate_type 0 = DMA rotation, 1 = VRFB rotation
++overlays List of overlay numbers to which framebuffer pixels go
++phys_addr Physical address of the framebuffer
++virt_addr Virtual address of the framebuffer
++size Size of the framebuffer
++
++/sys/devices/platform/omapdss/overlay? directory:
++enabled 0=off, 1=on
++input_size width,height (ie. the framebuffer size)
++manager Destination overlay manager name
++name
++output_size width,height
++position x,y
++screen_width width
++
++/sys/devices/platform/omapdss/manager? directory:
++display Destination display
++name
++
++/sys/devices/platform/omapdss/display? directory:
++ctrl_name Controller name
++mirror 0=off, 1=on
++update_mode 0=off, 1=auto, 2=manual
++enabled 0=off, 1=on
++name
++rotate Rotation 0-3 for 0, 90, 180, 270 degrees
++timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
++ When writing, two special timings are accepted for tv-out:
++ "pal" and "ntsc"
++panel_name
++tear_elim Tearing elimination 0=off, 1=on
++
++There are also some debugfs files at <debugfs>/omapdss/ which show information
++about clocks and registers.
++
++Examples
++--------
++
++The following definitions have been made for the examples below:
++
++ovl0=/sys/devices/platform/omapdss/overlay0
++ovl1=/sys/devices/platform/omapdss/overlay1
++ovl2=/sys/devices/platform/omapdss/overlay2
++
++mgr0=/sys/devices/platform/omapdss/manager0
++mgr1=/sys/devices/platform/omapdss/manager1
++
++lcd=/sys/devices/platform/omapdss/display0
++dvi=/sys/devices/platform/omapdss/display1
++tv=/sys/devices/platform/omapdss/display2
++
++fb0=/sys/class/graphics/fb0
++fb1=/sys/class/graphics/fb1
++fb2=/sys/class/graphics/fb2
++
++Default setup on OMAP3 SDP
++--------------------------
++
++Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
++and TV-out are not in use. The columns from left to right are:
++framebuffers, overlays, overlay managers, displays. Framebuffers are
++handled by omapfb, and the rest by the DSS.
++
++FB0 --- GFX -\ DVI
++FB1 --- VID1 --+- LCD ---- LCD
++FB2 --- VID2 -/ TV ----- TV
++
++Example: Switch from LCD to DVI
++----------------------
++
++w=`cat $dvi/horizontal | cut -d "," -f 1`
++h=`cat $dvi/vertical | cut -d "," -f 1`
++
++echo "0" > $lcd/enabled
++echo "" > $mgr0/display
++fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
++# at this point you have to switch the dvi/lcd dip-switch from the omap board
++echo "dvi" > $mgr0/display
++echo "1" > $dvi/enabled
++
++After this the configuration looks like:
++
++FB0 --- GFX -\ -- DVI
++FB1 --- VID1 --+- LCD -/ LCD
++FB2 --- VID2 -/ TV ----- TV
++
++Example: Clone GFX overlay to LCD and TV
++-------------------------------
++
++w=`cat $tv/horizontal | cut -d "," -f 1`
++h=`cat $tv/vertical | cut -d "," -f 1`
++
++echo "0" > $ovl0/enabled
++echo "0" > $ovl1/enabled
++
++echo "" > $fb1/overlays
++echo "0,1" > $fb0/overlays
++
++echo "$w,$h" > $ovl1/output_size
++echo "tv" > $ovl1/manager
++
++echo "1" > $ovl0/enabled
++echo "1" > $ovl1/enabled
++
++echo "1" > $tv/enabled
++
++After this the configuration looks like (only relevant parts shown):
++
++FB0 +-- GFX ---- LCD ---- LCD
++ \- VID1 ---- TV ---- TV
++
++Misc notes
++----------
++
++OMAP FB allocates the framebuffer memory using the OMAP VRAM allocator.
++
++Using DSI DPLL to generate pixel clock it is possible produce the pixel clock
++of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI.
++
++Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB
++does not support mirroring.
++
++VRFB rotation requires much more memory than non-rotated framebuffer, so you
++probably need to increase your vram setting before using VRFB rotation. Also,
++many applications may not work with VRFB if they do not pay attention to all
++framebuffer parameters.
++
++Kernel boot arguments
++---------------------
++
++vram=<size>
++ - Amount of total VRAM to preallocate. For example, "10M". omapfb
++ allocates memory for framebuffers from VRAM.
++
++omapfb.mode=<display>:<mode>[,...]
++ - Default video mode for specified displays. For example,
++ "dvi:800x400MR-24@60". See drivers/video/modedb.c.
++ There are also two special modes: "pal" and "ntsc" that
++ can be used to tv out.
++
++omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]
++ - VRAM allocated for a framebuffer. Normally omapfb allocates vram
++ depending on the display size. With this you can manually allocate
++ more or define the physical address of each framebuffer. For example,
++ "1:4M" to allocate 4M for fb1.
++
++omapfb.debug=<y|n>
++ - Enable debug printing. You have to have OMAPFB debug support enabled
++ in kernel config.
++
++omapfb.test=<y|n>
++ - Draw test pattern to framebuffer whenever framebuffer settings change.
++ You need to have OMAPFB debug support enabled in kernel config.
++
++omapfb.vrfb=<y|n>
++ - Use VRFB rotation for all framebuffers.
++
++omapfb.rotate=<angle>
++ - Default rotation applied to all framebuffers.
++ 0 - 0 degree rotation
++ 1 - 90 degree rotation
++ 2 - 180 degree rotation
++ 3 - 270 degree rotation
++
++omapfb.mirror=<y|n>
++ - Default mirror for all framebuffers. Only works with DMA rotation.
++
++omapdss.def_disp=<display>
++ - Name of default display, to which all overlays will be connected.
++ Common examples are "lcd" or "tv".
++
++omapdss.debug=<y|n>
++ - Enable debug printing. You have to have DSS debug support enabled in
++ kernel config.
++
++TODO
++----
++
++DSS locking
++
++Error checking
++- Lots of checks are missing or implemented just as BUG()
++
++System DMA update for DSI
++- Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
++ to skip the empty byte?)
++
++OMAP1 support
++- Not sure if needed
++
+diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
+index a832795..cfc0967 100644
+--- a/arch/arm/plat-omap/Makefile
++++ b/arch/arm/plat-omap/Makefile
+@@ -4,7 +4,7 @@
+
+ # Common support
+ obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
+- usb.o fb.o io.o
++ usb.o fb.o vram.o vrfb.o io.o
+ obj-m :=
+ obj-n :=
+ obj- :=
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+new file mode 100644
+index 0000000..6288353
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -0,0 +1,520 @@
++/*
++ * linux/include/asm-arm/arch-omap/display.h
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef __ASM_ARCH_OMAP_DISPLAY_H
++#define __ASM_ARCH_OMAP_DISPLAY_H
++
++#include <linux/list.h>
++#include <linux/kobject.h>
++#include <asm/atomic.h>
++
++#define DISPC_IRQ_FRAMEDONE (1 << 0)
++#define DISPC_IRQ_VSYNC (1 << 1)
++#define DISPC_IRQ_EVSYNC_EVEN (1 << 2)
++#define DISPC_IRQ_EVSYNC_ODD (1 << 3)
++#define DISPC_IRQ_ACBIAS_COUNT_STAT (1 << 4)
++#define DISPC_IRQ_PROG_LINE_NUM (1 << 5)
++#define DISPC_IRQ_GFX_FIFO_UNDERFLOW (1 << 6)
++#define DISPC_IRQ_GFX_END_WIN (1 << 7)
++#define DISPC_IRQ_PAL_GAMMA_MASK (1 << 8)
++#define DISPC_IRQ_OCP_ERR (1 << 9)
++#define DISPC_IRQ_VID1_FIFO_UNDERFLOW (1 << 10)
++#define DISPC_IRQ_VID1_END_WIN (1 << 11)
++#define DISPC_IRQ_VID2_FIFO_UNDERFLOW (1 << 12)
++#define DISPC_IRQ_VID2_END_WIN (1 << 13)
++#define DISPC_IRQ_SYNC_LOST (1 << 14)
++#define DISPC_IRQ_SYNC_LOST_DIGIT (1 << 15)
++#define DISPC_IRQ_WAKEUP (1 << 16)
++
++enum omap_display_type {
++ OMAP_DISPLAY_TYPE_NONE = 0,
++ OMAP_DISPLAY_TYPE_DPI = 1 << 0,
++ OMAP_DISPLAY_TYPE_DBI = 1 << 1,
++ OMAP_DISPLAY_TYPE_SDI = 1 << 2,
++ OMAP_DISPLAY_TYPE_DSI = 1 << 3,
++ OMAP_DISPLAY_TYPE_VENC = 1 << 4,
++};
++
++enum omap_plane {
++ OMAP_DSS_GFX = 0,
++ OMAP_DSS_VIDEO1 = 1,
++ OMAP_DSS_VIDEO2 = 2
++};
++
++enum omap_channel {
++ OMAP_DSS_CHANNEL_LCD = 0,
++ OMAP_DSS_CHANNEL_DIGIT = 1,
++};
++
++enum omap_color_mode {
++ OMAP_DSS_COLOR_CLUT1 = 1 << 0, /* BITMAP 1 */
++ OMAP_DSS_COLOR_CLUT2 = 1 << 1, /* BITMAP 2 */
++ OMAP_DSS_COLOR_CLUT4 = 1 << 2, /* BITMAP 4 */
++ OMAP_DSS_COLOR_CLUT8 = 1 << 3, /* BITMAP 8 */
++ OMAP_DSS_COLOR_RGB12U = 1 << 4, /* RGB12, 16-bit container */
++ OMAP_DSS_COLOR_ARGB16 = 1 << 5, /* ARGB16 */
++ OMAP_DSS_COLOR_RGB16 = 1 << 6, /* RGB16 */
++ OMAP_DSS_COLOR_RGB24U = 1 << 7, /* RGB24, 32-bit container */
++ OMAP_DSS_COLOR_RGB24P = 1 << 8, /* RGB24, 24-bit container */
++ OMAP_DSS_COLOR_YUV2 = 1 << 9, /* YUV2 4:2:2 co-sited */
++ OMAP_DSS_COLOR_UYVY = 1 << 10, /* UYVY 4:2:2 co-sited */
++ OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */
++ OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */
++ OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */
++
++ OMAP_DSS_COLOR_GFX_OMAP3 =
++ OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 |
++ OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 |
++ OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
++ OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
++ OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 |
++ OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32,
++
++ OMAP_DSS_COLOR_VID_OMAP3 =
++ OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
++ OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
++ OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 |
++ OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 |
++ OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY,
++};
++
++enum omap_lcd_display_type {
++ OMAP_DSS_LCD_DISPLAY_STN,
++ OMAP_DSS_LCD_DISPLAY_TFT,
++};
++
++enum omap_dss_load_mode {
++ OMAP_DSS_LOAD_CLUT_AND_FRAME = 0,
++ OMAP_DSS_LOAD_CLUT_ONLY = 1,
++ OMAP_DSS_LOAD_FRAME_ONLY = 2,
++ OMAP_DSS_LOAD_CLUT_ONCE_FRAME = 3,
++};
++
++enum omap_dss_color_key_type {
++ OMAP_DSS_COLOR_KEY_GFX_DST = 0,
++ OMAP_DSS_COLOR_KEY_VID_SRC = 1,
++};
++
++enum omap_rfbi_te_mode {
++ OMAP_DSS_RFBI_TE_MODE_1 = 1,
++ OMAP_DSS_RFBI_TE_MODE_2 = 2,
++};
++
++enum omap_panel_config {
++ OMAP_DSS_LCD_IVS = 1<<0,
++ OMAP_DSS_LCD_IHS = 1<<1,
++ OMAP_DSS_LCD_IPC = 1<<2,
++ OMAP_DSS_LCD_IEO = 1<<3,
++ OMAP_DSS_LCD_RF = 1<<4,
++ OMAP_DSS_LCD_ONOFF = 1<<5,
++
++ OMAP_DSS_LCD_TFT = 1<<20,
++};
++
++enum omap_dss_venc_type {
++ OMAP_DSS_VENC_TYPE_COMPOSITE,
++ OMAP_DSS_VENC_TYPE_SVIDEO,
++};
++
++struct omap_display;
++struct omap_panel;
++struct omap_ctrl;
++
++/* RFBI */
++
++struct rfbi_timings {
++ int cs_on_time;
++ int cs_off_time;
++ int we_on_time;
++ int we_off_time;
++ int re_on_time;
++ int re_off_time;
++ int we_cycle_time;
++ int re_cycle_time;
++ int cs_pulse_width;
++ int access_time;
++
++ int clk_div;
++
++ u32 tim[5]; /* set by rfbi_convert_timings() */
++
++ int converted;
++};
++
++void omap_rfbi_write_command(const void *buf, u32 len);
++void omap_rfbi_read_data(void *buf, u32 len);
++void omap_rfbi_write_data(const void *buf, u32 len);
++void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width,
++ u16 x, u16 y,
++ u16 w, u16 h);
++int omap_rfbi_enable_te(bool enable, unsigned line);
++int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
++ unsigned hs_pulse_time, unsigned vs_pulse_time,
++ int hs_pol_inv, int vs_pol_inv, int extif_div);
++
++/* DSI */
++int dsi_vc_dcs_write(int channel, u8 *data, int len);
++int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len);
++int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen);
++int dsi_vc_set_max_rx_packet_size(int channel, u16 len);
++int dsi_vc_send_null(int channel);
++
++/* Board specific data */
++struct omap_dss_display_config {
++ enum omap_display_type type;
++
++ union {
++ struct {
++ u8 data_lines;
++ } dpi;
++
++ struct {
++ u8 channel;
++ u8 data_lines;
++ } rfbi;
++
++ struct {
++ u8 datapairs;
++ } sdi;
++
++ struct {
++ u8 clk_lane;
++ u8 clk_pol;
++ u8 data1_lane;
++ u8 data1_pol;
++ u8 data2_lane;
++ u8 data2_pol;
++ unsigned long ddr_clk_hz;
++ } dsi;
++
++ struct {
++ enum omap_dss_venc_type type;
++ } venc;
++ } u;
++
++ int panel_reset_gpio;
++ int ctrl_reset_gpio;
++
++ const char *name; /* for debug */
++ const char *ctrl_name;
++ const char *panel_name;
++
++ void *panel_data;
++ void *ctrl_data;
++
++ /* platform specific enable/disable */
++ int (*panel_enable)(struct omap_display *display);
++ void (*panel_disable)(struct omap_display *display);
++ int (*ctrl_enable)(struct omap_display *display);
++ void (*ctrl_disable)(struct omap_display *display);
++ int (*set_backlight)(struct omap_display *display,
++ int level);
++};
++
++struct device;
++
++/* Board specific data */
++struct omap_dss_board_info {
++ unsigned (*get_last_off_on_transaction_id)(struct device *dev);
++ int (*dsi_power_up)(void);
++ void (*dsi_power_down)(void);
++ int num_displays;
++ struct omap_dss_display_config *displays[];
++};
++
++struct omap_ctrl {
++ struct module *owner;
++
++ const char *name;
++
++ int (*init)(struct omap_display *display);
++ void (*cleanup)(struct omap_display *display);
++ int (*enable)(struct omap_display *display);
++ void (*disable)(struct omap_display *display);
++ int (*suspend)(struct omap_display *display);
++ int (*resume)(struct omap_display *display);
++ void (*setup_update)(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h);
++
++ int (*enable_te)(struct omap_display *display, bool enable);
++
++ u8 (*get_rotate)(struct omap_display *display);
++ int (*set_rotate)(struct omap_display *display, u8 rotate);
++
++ bool (*get_mirror)(struct omap_display *display);
++ int (*set_mirror)(struct omap_display *display, bool enable);
++
++ int (*run_test)(struct omap_display *display, int test);
++ int (*memory_read)(struct omap_display *display,
++ void *buf, size_t size,
++ u16 x, u16 y, u16 w, u16 h);
++
++ u8 pixel_size;
++
++ struct rfbi_timings timings;
++
++ void *priv;
++};
++
++struct omap_video_timings {
++ /* Unit: pixels */
++ u16 x_res;
++ /* Unit: pixels */
++ u16 y_res;
++ /* Unit: KHz */
++ u32 pixel_clock;
++ /* Unit: pixel clocks */
++ u16 hsw; /* Horizontal synchronization pulse width */
++ /* Unit: pixel clocks */
++ u16 hfp; /* Horizontal front porch */
++ /* Unit: pixel clocks */
++ u16 hbp; /* Horizontal back porch */
++ /* Unit: line clocks */
++ u16 vsw; /* Vertical synchronization pulse width */
++ /* Unit: line clocks */
++ u16 vfp; /* Vertical front porch */
++ /* Unit: line clocks */
++ u16 vbp; /* Vertical back porch */
++
++};
++
++#ifdef CONFIG_OMAP2_DSS_VENC
++/* Hardcoded timings for tv modes. Venc only uses these to
++ * identify the mode, and does not actually use the configs
++ * itself. However, the configs should be something that
++ * a normal monitor can also show */
++const extern struct omap_video_timings omap_dss_pal_timings;
++const extern struct omap_video_timings omap_dss_ntsc_timings;
++#endif
++
++struct omap_panel {
++ struct module *owner;
++
++ const char *name;
++
++ int (*init)(struct omap_display *display);
++ void (*cleanup)(struct omap_display *display);
++ int (*remove)(struct omap_display *display);
++ int (*enable)(struct omap_display *display);
++ void (*disable)(struct omap_display *display);
++ int (*suspend)(struct omap_display *display);
++ int (*resume)(struct omap_display *display);
++ int (*run_test)(struct omap_display *display, int test);
++
++ struct omap_video_timings timings;
++
++ int acbi; /* ac-bias pin transitions per interrupt */
++ /* Unit: line clocks */
++ int acb; /* ac-bias pin frequency */
++
++ enum omap_panel_config config;
++
++ u8 recommended_bpp;
++
++ void *priv;
++};
++
++/* XXX perhaps this should be removed */
++enum omap_dss_overlay_managers {
++ OMAP_DSS_OVL_MGR_LCD,
++ OMAP_DSS_OVL_MGR_TV,
++};
++
++struct omap_overlay_manager;
++
++struct omap_overlay_info {
++ bool enabled;
++
++ u32 paddr;
++ void __iomem *vaddr;
++ u16 screen_width;
++ u16 width;
++ u16 height;
++ enum omap_color_mode color_mode;
++ u8 rotation;
++ bool mirror;
++
++ u16 pos_x;
++ u16 pos_y;
++ u16 out_width; /* if 0, out_width == width */
++ u16 out_height; /* if 0, out_height == height */
++};
++
++enum omap_overlay_caps {
++ OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
++ OMAP_DSS_OVL_CAP_DISPC = 1 << 1,
++};
++
++struct omap_overlay {
++ struct kobject kobj;
++ struct list_head list;
++
++ const char *name;
++ int id;
++ struct omap_overlay_manager *manager;
++ enum omap_color_mode supported_modes;
++ struct omap_overlay_info info;
++ enum omap_overlay_caps caps;
++
++ int (*set_manager)(struct omap_overlay *ovl,
++ struct omap_overlay_manager *mgr);
++ int (*unset_manager)(struct omap_overlay *ovl);
++
++ int (*set_overlay_info)(struct omap_overlay *ovl,
++ struct omap_overlay_info *info);
++ void (*get_overlay_info)(struct omap_overlay *ovl,
++ struct omap_overlay_info *info);
++};
++
++enum omap_overlay_manager_caps {
++ OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0,
++};
++
++struct omap_overlay_manager {
++ struct kobject kobj;
++ struct list_head list;
++
++ const char *name;
++ int id;
++ enum omap_overlay_manager_caps caps;
++ struct omap_display *display;
++ int num_overlays;
++ struct omap_overlay **overlays;
++ enum omap_display_type supported_displays;
++
++ int (*set_display)(struct omap_overlay_manager *mgr,
++ struct omap_display *display);
++ int (*unset_display)(struct omap_overlay_manager *mgr);
++
++ int (*apply)(struct omap_overlay_manager *mgr);
++
++ void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
++ void (*set_trans_key)(struct omap_overlay_manager *mgr,
++ enum omap_dss_color_key_type type,
++ u32 trans_key);
++ void (*enable_trans_key)(struct omap_overlay_manager *mgr,
++ bool enable);
++};
++
++enum omap_display_caps {
++ OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0,
++};
++
++enum omap_dss_update_mode {
++ OMAP_DSS_UPDATE_DISABLED = 0,
++ OMAP_DSS_UPDATE_AUTO,
++ OMAP_DSS_UPDATE_MANUAL,
++};
++
++enum omap_dss_display_state {
++ OMAP_DSS_DISPLAY_DISABLED = 0,
++ OMAP_DSS_DISPLAY_ACTIVE,
++ OMAP_DSS_DISPLAY_SUSPENDED,
++};
++
++struct omap_display {
++ struct kobject kobj;
++ struct list_head list;
++
++ /*atomic_t ref_count;*/
++ int ref_count;
++ /* helper variable for driver suspend/resume */
++ int activate_after_resume;
++
++ enum omap_display_type type;
++ const char *name;
++
++ enum omap_display_caps caps;
++
++ struct omap_overlay_manager *manager;
++
++ enum omap_dss_display_state state;
++
++ struct omap_dss_display_config hw_config; /* board specific data */
++ struct omap_ctrl *ctrl; /* static common data */
++ struct omap_panel *panel; /* static common data */
++
++ int (*enable)(struct omap_display *display);
++ void (*disable)(struct omap_display *display);
++
++ int (*suspend)(struct omap_display *display);
++ int (*resume)(struct omap_display *display);
++
++ void (*get_resolution)(struct omap_display *display,
++ u16 *xres, u16 *yres);
++ int (*get_recommended_bpp)(struct omap_display *display);
++
++ int (*check_timings)(struct omap_display *display,
++ struct omap_video_timings *timings);
++ void (*set_timings)(struct omap_display *display,
++ struct omap_video_timings *timings);
++ void (*get_timings)(struct omap_display *display,
++ struct omap_video_timings *timings);
++ int (*update)(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h);
++ int (*sync)(struct omap_display *display);
++ int (*wait_vsync)(struct omap_display *display);
++
++ int (*set_update_mode)(struct omap_display *display,
++ enum omap_dss_update_mode);
++ enum omap_dss_update_mode (*get_update_mode)
++ (struct omap_display *display);
++
++ int (*enable_te)(struct omap_display *display, bool enable);
++ int (*get_te)(struct omap_display *display);
++
++ u8 (*get_rotate)(struct omap_display *display);
++ int (*set_rotate)(struct omap_display *display, u8 rotate);
++
++ bool (*get_mirror)(struct omap_display *display);
++ int (*set_mirror)(struct omap_display *display, bool enable);
++
++ int (*run_test)(struct omap_display *display, int test);
++ int (*memory_read)(struct omap_display *display,
++ void *buf, size_t size,
++ u16 x, u16 y, u16 w, u16 h);
++
++ void (*configure_overlay)(struct omap_overlay *overlay);
++};
++
++int omap_dss_get_num_displays(void);
++struct omap_display *omap_dss_get_display(int no);
++void omap_dss_put_display(struct omap_display *display);
++
++void omap_dss_register_ctrl(struct omap_ctrl *ctrl);
++void omap_dss_unregister_ctrl(struct omap_ctrl *ctrl);
++
++void omap_dss_register_panel(struct omap_panel *panel);
++void omap_dss_unregister_panel(struct omap_panel *panel);
++
++int omap_dss_get_num_overlay_managers(void);
++struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
++
++int omap_dss_get_num_overlays(void);
++struct omap_overlay *omap_dss_get_overlay(int num);
++
++typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
++int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
++int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
++
++int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
++int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
++ unsigned long timeout);
++
++#endif
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+new file mode 100644
+index 0000000..f176562
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -0,0 +1,33 @@
++/*
++ * File: arch/arm/plat-omap/include/mach/vram.h
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write to the Free Software Foundation, Inc.,
++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++#ifndef __OMAPVRAM_H
++#define __OMAPVRAM_H
++
++#include <asm/types.h>
++
++extern int omap_vram_free(unsigned long paddr, size_t size);
++extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
++extern int omap_vram_reserve(unsigned long paddr, size_t size);
++extern void omap2_set_sdram_vram(u32 size, u32 start);
++extern void omap2_set_sram_vram(u32 size, u32 start);
++
++#endif
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+new file mode 100644
+index 0000000..2047862
+--- /dev/null
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -0,0 +1,47 @@
++/*
++ * File: arch/arm/plat-omap/include/mach/vrfb.h
++ *
++ * VRFB
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write to the Free Software Foundation, Inc.,
++ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++#ifndef __VRFB_H
++#define __VRFB_H
++
++#define OMAP_VRFB_LINE_LEN 2048
++
++struct vrfb
++{
++ u8 context;
++ void __iomem *vaddr[4];
++ unsigned long paddr[4];
++ u16 xoffset;
++ u16 yoffset;
++ u8 bytespp;
++};
++
++extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
++extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
++extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
++ u8 bytespp);
++extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
++ u16 width, u16 height,
++ u8 bytespp);
++
++#endif /* __VRFB_H */
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+new file mode 100644
+index 0000000..f24a110
+--- /dev/null
++++ b/arch/arm/plat-omap/vram.c
+@@ -0,0 +1,615 @@
++/*
++ * linux/arch/arm/plat-omap/vram.c
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++/*#define DEBUG*/
++
++#include <linux/vmalloc.h>
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/list.h>
++#include <linux/dma-mapping.h>
++#include <linux/proc_fs.h>
++#include <linux/seq_file.h>
++#include <linux/bootmem.h>
++#include <linux/omapfb.h>
++
++#include <asm/setup.h>
++
++#include <mach/sram.h>
++#include <mach/vram.h>
++
++#ifdef DEBUG
++#define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__)
++#else
++#define DBG(format, ...)
++#endif
++
++#define OMAP2_SRAM_START 0x40200000
++/* Maximum size, in reality this is smaller if SRAM is partially locked. */
++#define OMAP2_SRAM_SIZE 0xa0000 /* 640k */
++
++#define REG_MAP_SIZE(_page_cnt) \
++ ((_page_cnt + (sizeof(unsigned long) * 8) - 1) / 8)
++#define REG_MAP_PTR(_rg, _page_nr) \
++ (((_rg)->map) + (_page_nr) / (sizeof(unsigned long) * 8))
++#define REG_MAP_MASK(_page_nr) \
++ (1 << ((_page_nr) & (sizeof(unsigned long) * 8 - 1)))
++
++#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
++
++/* postponed regions are used to temporarily store region information at boot
++ * time when we cannot yet allocate the region list */
++#define MAX_POSTPONED_REGIONS 10
++
++static int postponed_cnt __initdata;
++static struct {
++ unsigned long paddr;
++ size_t size;
++} postponed_regions[MAX_POSTPONED_REGIONS] __initdata;
++
++struct vram_alloc {
++ struct list_head list;
++ unsigned long paddr;
++ unsigned pages;
++};
++
++struct vram_region {
++ struct list_head list;
++ struct list_head alloc_list;
++ unsigned long paddr;
++ unsigned pages;
++};
++
++static DEFINE_MUTEX(region_mutex);
++static LIST_HEAD(region_list);
++
++static inline int region_mem_type(unsigned long paddr)
++{
++ if (paddr >= OMAP2_SRAM_START &&
++ paddr < OMAP2_SRAM_START + OMAP2_SRAM_SIZE)
++ return OMAPFB_MEMTYPE_SRAM;
++ else
++ return OMAPFB_MEMTYPE_SDRAM;
++}
++
++static struct vram_region *omap_vram_create_region(unsigned long paddr,
++ unsigned pages)
++{
++ struct vram_region *rm;
++
++ rm = kzalloc(sizeof(*rm), GFP_KERNEL);
++
++ if (rm) {
++ INIT_LIST_HEAD(&rm->alloc_list);
++ rm->paddr = paddr;
++ rm->pages = pages;
++ }
++
++ return rm;
++}
++
++#if 0
++static void omap_vram_free_region(struct vram_region *vr)
++{
++ list_del(&vr->list);
++ kfree(vr);
++}
++#endif
++
++static struct vram_alloc *omap_vram_create_allocation(struct vram_region *vr,
++ unsigned long paddr, unsigned pages)
++{
++ struct vram_alloc *va;
++ struct vram_alloc *new;
++
++ new = kzalloc(sizeof(*va), GFP_KERNEL);
++
++ if (!new)
++ return NULL;
++
++ new->paddr = paddr;
++ new->pages = pages;
++
++ list_for_each_entry(va, &vr->alloc_list, list) {
++ if (va->paddr > new->paddr)
++ break;
++ }
++
++ list_add_tail(&new->list, &va->list);
++
++ return new;
++}
++
++static void omap_vram_free_allocation(struct vram_alloc *va)
++{
++ list_del(&va->list);
++ kfree(va);
++}
++
++static __init int omap_vram_add_region_postponed(unsigned long paddr,
++ size_t size)
++{
++ if (postponed_cnt == MAX_POSTPONED_REGIONS)
++ return -ENOMEM;
++
++ postponed_regions[postponed_cnt].paddr = paddr;
++ postponed_regions[postponed_cnt].size = size;
++
++ ++postponed_cnt;
++
++ return 0;
++}
++
++/* add/remove_region can be exported if there's need to add/remove regions
++ * runtime */
++static int omap_vram_add_region(unsigned long paddr, size_t size)
++{
++ struct vram_region *rm;
++ unsigned pages;
++
++ DBG("adding region paddr %08lx size %d\n",
++ paddr, size);
++
++ size &= PAGE_MASK;
++ pages = size >> PAGE_SHIFT;
++
++ rm = omap_vram_create_region(paddr, pages);
++ if (rm == NULL)
++ return -ENOMEM;
++
++ list_add(&rm->list, &region_list);
++
++ return 0;
++}
++
++int omap_vram_free(unsigned long paddr, size_t size)
++{
++ struct vram_region *rm;
++ struct vram_alloc *alloc;
++ unsigned start, end;
++
++ DBG("free mem paddr %08lx size %d\n", paddr, size);
++
++ size = PAGE_ALIGN(size);
++
++ mutex_lock(&region_mutex);
++
++ list_for_each_entry(rm, &region_list, list) {
++ list_for_each_entry(alloc, &rm->alloc_list, list) {
++ start = alloc->paddr;
++ end = alloc->paddr + (alloc->pages >> PAGE_SHIFT);
++
++ if (start >= paddr && end < paddr + size)
++ goto found;
++ }
++ }
++
++ mutex_unlock(&region_mutex);
++ return -EINVAL;
++
++found:
++ omap_vram_free_allocation(alloc);
++
++ mutex_unlock(&region_mutex);
++ return 0;
++}
++EXPORT_SYMBOL(omap_vram_free);
++
++static int _omap_vram_reserve(unsigned long paddr, unsigned pages)
++{
++ struct vram_region *rm;
++ struct vram_alloc *alloc;
++ size_t size;
++
++ size = pages << PAGE_SHIFT;
++
++ list_for_each_entry(rm, &region_list, list) {
++ unsigned long start, end;
++
++ DBG("checking region %lx %d\n", rm->paddr, rm->pages);
++
++ if (region_mem_type(rm->paddr) != region_mem_type(paddr))
++ continue;
++
++ start = rm->paddr;
++ end = start + (rm->pages << PAGE_SHIFT) - 1;
++ if (start > paddr || end < paddr + size - 1)
++ continue;
++
++ DBG("block ok, checking allocs\n");
++
++ list_for_each_entry(alloc, &rm->alloc_list, list) {
++ end = alloc->paddr - 1;
++
++ if (start <= paddr && end >= paddr + size - 1)
++ goto found;
++
++ start = alloc->paddr + (alloc->pages << PAGE_SHIFT);
++ }
++
++ end = rm->paddr + (rm->pages << PAGE_SHIFT) - 1;
++
++ if (!(start <= paddr && end >= paddr + size - 1))
++ continue;
++found:
++ DBG("FOUND area start %lx, end %lx\n", start, end);
++
++ if (omap_vram_create_allocation(rm, paddr, pages) == NULL)
++ return -ENOMEM;
++
++ return 0;
++ }
++
++ return -ENOMEM;
++}
++
++int omap_vram_reserve(unsigned long paddr, size_t size)
++{
++ unsigned pages;
++ int r;
++
++ DBG("reserve mem paddr %08lx size %d\n", paddr, size);
++
++ size = PAGE_ALIGN(size);
++ pages = size >> PAGE_SHIFT;
++
++ mutex_lock(&region_mutex);
++
++ r = _omap_vram_reserve(paddr, pages);
++
++ mutex_unlock(&region_mutex);
++
++ return r;
++}
++EXPORT_SYMBOL(omap_vram_reserve);
++
++static int _omap_vram_alloc(int mtype, unsigned pages, unsigned long *paddr)
++{
++ struct vram_region *rm;
++ struct vram_alloc *alloc;
++
++ list_for_each_entry(rm, &region_list, list) {
++ unsigned long start, end;
++
++ DBG("checking region %lx %d\n", rm->paddr, rm->pages);
++
++ if (region_mem_type(rm->paddr) != mtype)
++ continue;
++
++ start = rm->paddr;
++
++ list_for_each_entry(alloc, &rm->alloc_list, list) {
++ end = alloc->paddr;
++
++ if (end - start >= pages << PAGE_SHIFT)
++ goto found;
++
++ start = alloc->paddr + (alloc->pages << PAGE_SHIFT);
++ }
++
++ end = rm->paddr + (rm->pages << PAGE_SHIFT);
++found:
++ if (end - start < pages << PAGE_SHIFT)
++ continue;
++
++ DBG("FOUND %lx, end %lx\n", start, end);
++
++ alloc = omap_vram_create_allocation(rm, start, pages);
++ if (alloc == NULL)
++ return -ENOMEM;
++
++ *paddr = start;
++
++ return 0;
++ }
++
++ return -ENOMEM;
++}
++
++int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr)
++{
++ unsigned pages;
++ int r;
++
++ BUG_ON(mtype > OMAPFB_MEMTYPE_MAX || !size);
++
++ DBG("alloc mem type %d size %d\n", mtype, size);
++
++ size = PAGE_ALIGN(size);
++ pages = size >> PAGE_SHIFT;
++
++ mutex_lock(&region_mutex);
++
++ r = _omap_vram_alloc(mtype, pages, paddr);
++
++ mutex_unlock(&region_mutex);
++
++ return r;
++}
++EXPORT_SYMBOL(omap_vram_alloc);
++
++#ifdef CONFIG_PROC_FS
++static void *r_next(struct seq_file *m, void *v, loff_t *pos)
++{
++ struct list_head *l = v;
++
++ (*pos)++;
++
++ if (list_is_last(l, &region_list))
++ return NULL;
++
++ return l->next;
++}
++
++static void *r_start(struct seq_file *m, loff_t *pos)
++{
++ loff_t p = *pos;
++ struct list_head *l = &region_list;
++
++ mutex_lock(&region_mutex);
++
++ do {
++ l = l->next;
++ if (l == &region_list)
++ return NULL;
++ } while (p--);
++
++ return l;
++}
++
++static void r_stop(struct seq_file *m, void *v)
++{
++ mutex_unlock(&region_mutex);
++}
++
++static int r_show(struct seq_file *m, void *v)
++{
++ struct vram_region *vr;
++ struct vram_alloc *va;
++ unsigned size;
++
++ vr = list_entry(v, struct vram_region, list);
++
++ size = vr->pages << PAGE_SHIFT;
++
++ seq_printf(m, "%08lx-%08lx (%d bytes)\n",
++ vr->paddr, vr->paddr + size - 1,
++ size);
++
++ list_for_each_entry(va, &vr->alloc_list, list) {
++ size = va->pages << PAGE_SHIFT;
++ seq_printf(m, " %08lx-%08lx (%d bytes)\n",
++ va->paddr, va->paddr + size - 1,
++ size);
++ }
++
++
++
++ return 0;
++}
++
++static const struct seq_operations resource_op = {
++ .start = r_start,
++ .next = r_next,
++ .stop = r_stop,
++ .show = r_show,
++};
++
++static int vram_open(struct inode *inode, struct file *file)
++{
++ return seq_open(file, &resource_op);
++}
++
++static const struct file_operations proc_vram_operations = {
++ .open = vram_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = seq_release,
++};
++
++static int __init omap_vram_create_proc(void)
++{
++ proc_create("omap-vram", 0, NULL, &proc_vram_operations);
++
++ return 0;
++}
++#endif
++
++static __init int omap_vram_init(void)
++{
++ int i, r;
++
++ for (i = 0; i < postponed_cnt; i++)
++ omap_vram_add_region(postponed_regions[i].paddr,
++ postponed_regions[i].size);
++
++#ifdef CONFIG_PROC_FS
++ r = omap_vram_create_proc();
++ if (r)
++ return -ENOMEM;
++#endif
++
++ return 0;
++}
++
++arch_initcall(omap_vram_init);
++
++/* boottime vram alloc stuff */
++
++/* set from board file */
++static u32 omapfb_sram_vram_start __initdata;
++static u32 omapfb_sram_vram_size __initdata;
++
++/* set from board file */
++static u32 omapfb_sdram_vram_start __initdata;
++static u32 omapfb_sdram_vram_size __initdata;
++
++/* set from kernel cmdline */
++static u32 omapfb_def_sdram_vram_size __initdata;
++static u32 omapfb_def_sdram_vram_start __initdata;
++
++static void __init omapfb_early_vram(char **p)
++{
++ omapfb_def_sdram_vram_size = memparse(*p, p);
++ if (**p == ',')
++ omapfb_def_sdram_vram_start = simple_strtoul((*p) + 1, p, 16);
++
++ printk("omapfb_early_vram, %d, 0x%x\n",
++ omapfb_def_sdram_vram_size,
++ omapfb_def_sdram_vram_start);
++}
++__early_param("vram=", omapfb_early_vram);
++
++/*
++ * Called from map_io. We need to call to this early enough so that we
++ * can reserve the fixed SDRAM regions before VM could get hold of them.
++ */
++void __init omapfb_reserve_sdram(void)
++{
++ struct bootmem_data *bdata;
++ unsigned long sdram_start, sdram_size;
++ u32 paddr;
++ u32 size = 0;
++
++ /* cmdline arg overrides the board file definition */
++ if (omapfb_def_sdram_vram_size) {
++ size = omapfb_def_sdram_vram_size;
++ paddr = omapfb_def_sdram_vram_start;
++ }
++
++ if (!size) {
++ size = omapfb_sdram_vram_size;
++ paddr = omapfb_sdram_vram_start;
++ }
++
++#ifdef CONFIG_OMAP2_DSS_VRAM_SIZE
++ if (!size) {
++ size = CONFIG_OMAP2_DSS_VRAM_SIZE * 1024 * 1024;
++ paddr = 0;
++ }
++#endif
++
++ if (!size)
++ return;
++
++ size = PAGE_ALIGN(size);
++
++ bdata = NODE_DATA(0)->bdata;
++ sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
++ sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
++
++ if (paddr) {
++ if ((paddr & ~PAGE_MASK) || paddr < sdram_start ||
++ paddr + size > sdram_start + sdram_size) {
++ printk(KERN_ERR "Illegal SDRAM region for VRAM\n");
++ return;
++ }
++
++ reserve_bootmem(paddr, size, BOOTMEM_DEFAULT);
++ } else {
++ if (size > sdram_size) {
++ printk(KERN_ERR "Illegal SDRAM size for VRAM\n");
++ return;
++ }
++
++ paddr = virt_to_phys(alloc_bootmem_pages(size));
++ BUG_ON(paddr & ~PAGE_MASK);
++ }
++
++ omap_vram_add_region_postponed(paddr, size);
++
++ pr_info("Reserving %u bytes SDRAM for VRAM\n", size);
++}
++
++/*
++ * Called at sram init time, before anything is pushed to the SRAM stack.
++ * Because of the stack scheme, we will allocate everything from the
++ * start of the lowest address region to the end of SRAM. This will also
++ * include padding for page alignment and possible holes between regions.
++ *
++ * As opposed to the SDRAM case, we'll also do any dynamic allocations at
++ * this point, since the driver built as a module would have problem with
++ * freeing / reallocating the regions.
++ */
++unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
++ unsigned long sram_vstart,
++ unsigned long sram_size,
++ unsigned long pstart_avail,
++ unsigned long size_avail)
++{
++ unsigned long pend_avail;
++ unsigned long reserved;
++ u32 paddr;
++ u32 size;
++
++ paddr = omapfb_sram_vram_start;
++ size = omapfb_sram_vram_size;
++
++ if (!size)
++ return 0;
++
++ reserved = 0;
++ pend_avail = pstart_avail + size_avail;
++
++ if (!paddr) {
++ /* Dynamic allocation */
++ if ((size_avail & PAGE_MASK) < size) {
++ printk(KERN_ERR "Not enough SRAM for VRAM\n");
++ return 0;
++ }
++ size_avail = (size_avail - size) & PAGE_MASK;
++ paddr = pstart_avail + size_avail;
++ }
++
++ if (paddr < sram_pstart ||
++ paddr + size > sram_pstart + sram_size) {
++ printk(KERN_ERR "Illegal SRAM region for VRAM\n");
++ return 0;
++ }
++
++ /* Reserve everything above the start of the region. */
++ if (pend_avail - paddr > reserved)
++ reserved = pend_avail - paddr;
++ size_avail = pend_avail - reserved - pstart_avail;
++
++ omap_vram_add_region_postponed(paddr, size);
++
++ if (reserved)
++ pr_info("Reserving %lu bytes SRAM for VRAM\n", reserved);
++
++ return reserved;
++}
++
++void __init omap2_set_sdram_vram(u32 size, u32 start)
++{
++ omapfb_sdram_vram_start = start;
++ omapfb_sdram_vram_size = size;
++}
++
++void __init omap2_set_sram_vram(u32 size, u32 start)
++{
++ omapfb_sram_vram_start = start;
++ omapfb_sram_vram_size = size;
++}
++
++#endif
++
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+new file mode 100644
+index 0000000..7e0f8fc
+--- /dev/null
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -0,0 +1,159 @@
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/ioport.h>
++#include <asm/io.h>
++
++#include <mach/io.h>
++#include <mach/vrfb.h>
++
++/*#define DEBUG*/
++
++#ifdef DEBUG
++#define DBG(format, ...) printk(KERN_DEBUG "VRFB: " format, ## __VA_ARGS__)
++#else
++#define DBG(format, ...)
++#endif
++
++#define SMS_ROT_VIRT_BASE(context, rot) \
++ (((context >= 4) ? 0xD0000000 : 0x70000000) \
++ | 0x4000000 * (context) \
++ | 0x1000000 * (rot))
++
++#define OMAP_VRFB_SIZE (2048 * 2048 * 4)
++
++#define VRFB_PAGE_WIDTH_EXP 5 /* Assuming SDRAM pagesize= 1024 */
++#define VRFB_PAGE_HEIGHT_EXP 5 /* 1024 = 2^5 * 2^5 */
++#define VRFB_PAGE_WIDTH (1 << VRFB_PAGE_WIDTH_EXP)
++#define VRFB_PAGE_HEIGHT (1 << VRFB_PAGE_HEIGHT_EXP)
++#define SMS_IMAGEHEIGHT_OFFSET 16
++#define SMS_IMAGEWIDTH_OFFSET 0
++#define SMS_PH_OFFSET 8
++#define SMS_PW_OFFSET 4
++#define SMS_PS_OFFSET 0
++
++#define OMAP_SMS_BASE 0x6C000000
++#define SMS_ROT_CONTROL(context) (OMAP_SMS_BASE + 0x180 + 0x10 * context)
++#define SMS_ROT_SIZE(context) (OMAP_SMS_BASE + 0x184 + 0x10 * context)
++#define SMS_ROT_PHYSICAL_BA(context) (OMAP_SMS_BASE + 0x188 + 0x10 * context)
++
++#define VRFB_NUM_CTXS 12
++/* bitmap of reserved contexts */
++static unsigned ctx_map;
++
++void omap_vrfb_adjust_size(u16 *width, u16 *height,
++ u8 bytespp)
++{
++ *width = ALIGN(*width * bytespp, VRFB_PAGE_WIDTH) / bytespp;
++ *height = ALIGN(*height, VRFB_PAGE_HEIGHT);
++}
++EXPORT_SYMBOL(omap_vrfb_adjust_size);
++
++void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
++ u16 width, u16 height,
++ u8 bytespp)
++{
++ unsigned pixel_size_exp;
++ u16 vrfb_width;
++ u16 vrfb_height;
++ u8 ctx = vrfb->context;
++
++ DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
++ width, height, bytespp);
++
++ if (bytespp == 4)
++ pixel_size_exp = 2;
++ else if (bytespp == 2)
++ pixel_size_exp = 1;
++ else
++ BUG();
++
++ vrfb_width = ALIGN(width * bytespp, VRFB_PAGE_WIDTH) / bytespp;
++ vrfb_height = ALIGN(height, VRFB_PAGE_HEIGHT);
++
++ DBG("vrfb w %u, h %u\n", vrfb_width, vrfb_height);
++
++ omap_writel(paddr, SMS_ROT_PHYSICAL_BA(ctx));
++ omap_writel((vrfb_width << SMS_IMAGEWIDTH_OFFSET) |
++ (vrfb_height << SMS_IMAGEHEIGHT_OFFSET),
++ SMS_ROT_SIZE(ctx));
++
++ omap_writel(pixel_size_exp << SMS_PS_OFFSET |
++ VRFB_PAGE_WIDTH_EXP << SMS_PW_OFFSET |
++ VRFB_PAGE_HEIGHT_EXP << SMS_PH_OFFSET,
++ SMS_ROT_CONTROL(ctx));
++
++ DBG("vrfb offset pixels %d, %d\n",
++ vrfb_width - width, vrfb_height - height);
++
++ vrfb->xoffset = vrfb_width - width;
++ vrfb->yoffset = vrfb_height - height;
++ vrfb->bytespp = bytespp;
++}
++EXPORT_SYMBOL(omap_vrfb_setup);
++
++void omap_vrfb_release_ctx(struct vrfb *vrfb)
++{
++ int rot;
++
++ if (vrfb->context == 0xff)
++ return;
++
++ DBG("release ctx %d\n", vrfb->context);
++
++ ctx_map &= ~(1 << vrfb->context);
++
++ for (rot = 0; rot < 4; ++rot) {
++ if(vrfb->paddr[rot]) {
++ release_mem_region(vrfb->paddr[rot], OMAP_VRFB_SIZE);
++ vrfb->paddr[rot] = 0;
++ }
++ }
++
++ vrfb->context = 0xff;
++}
++EXPORT_SYMBOL(omap_vrfb_release_ctx);
++
++int omap_vrfb_request_ctx(struct vrfb *vrfb)
++{
++ int rot;
++ u32 paddr;
++ u8 ctx;
++
++ DBG("request ctx\n");
++
++ for (ctx = 0; ctx < VRFB_NUM_CTXS; ++ctx)
++ if ((ctx_map & (1 << ctx)) == 0)
++ break;
++
++ if (ctx == VRFB_NUM_CTXS) {
++ printk(KERN_ERR "vrfb: no free contexts\n");
++ return -EBUSY;
++ }
++
++ DBG("found free ctx %d\n", ctx);
++
++ ctx_map |= 1 << ctx;
++
++ memset(vrfb, 0, sizeof(*vrfb));
++
++ vrfb->context = ctx;
++
++ for (rot = 0; rot < 4; ++rot) {
++ paddr = SMS_ROT_VIRT_BASE(ctx, rot);
++ if (!request_mem_region(paddr, OMAP_VRFB_SIZE, "vrfb")) {
++ printk(KERN_ERR "vrfb: failed to reserve VRFB "
++ "area for ctx %d, rotation %d\n",
++ ctx, rot * 90);
++ omap_vrfb_release_ctx(vrfb);
++ return -ENOMEM;
++ }
++
++ vrfb->paddr[rot] = paddr;
++
++ DBG("VRFB %d/%d: %lx\n", ctx, rot*90, vrfb->paddr[rot]);
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL(omap_vrfb_request_ctx);
++
+diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
+index d6d65ef..95e03fd 100644
+--- a/drivers/video/Kconfig
++++ b/drivers/video/Kconfig
+@@ -2146,6 +2146,7 @@ config FB_BROADSHEET
+ a bridge adapter.
+
+ source "drivers/video/omap/Kconfig"
++source "drivers/video/omap2/Kconfig"
+
+ source "drivers/video/backlight/Kconfig"
+ source "drivers/video/display/Kconfig"
+diff --git a/drivers/video/Makefile b/drivers/video/Makefile
+index 01a819f..01bf7a5 100644
+--- a/drivers/video/Makefile
++++ b/drivers/video/Makefile
+@@ -123,6 +123,7 @@ obj-$(CONFIG_FB_SM501) += sm501fb.o
+ obj-$(CONFIG_FB_XILINX) += xilinxfb.o
+ obj-$(CONFIG_FB_SH_MOBILE_LCDC) += sh_mobile_lcdcfb.o
+ obj-$(CONFIG_FB_OMAP) += omap/
++obj-$(CONFIG_OMAP2_DSS) += omap2/
+ obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o
+ obj-$(CONFIG_FB_CARMINE) += carminefb.o
+ obj-$(CONFIG_FB_MB862XX) += mb862xx/
+diff --git a/drivers/video/omap2/Kconfig b/drivers/video/omap2/Kconfig
+new file mode 100644
+index 0000000..89bf210
+--- /dev/null
++++ b/drivers/video/omap2/Kconfig
+@@ -0,0 +1,3 @@
++source "drivers/video/omap2/dss/Kconfig"
++source "drivers/video/omap2/displays/Kconfig"
++source "drivers/video/omap2/omapfb/Kconfig"
+diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile
+new file mode 100644
+index 0000000..72134db
+--- /dev/null
++++ b/drivers/video/omap2/Makefile
+@@ -0,0 +1,4 @@
++# OMAP2/3 Display Subsystem
++obj-y += dss/
++obj-y += displays/
++obj-y += omapfb/
+diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
+new file mode 100644
+index 0000000..f2ce068
+--- /dev/null
++++ b/drivers/video/omap2/dss/Kconfig
+@@ -0,0 +1,89 @@
++menuconfig OMAP2_DSS
++ tristate "OMAP2/3 Display Subsystem support (EXPERIMENTAL)"
++ depends on ARCH_OMAP2 || ARCH_OMAP3
++ help
++ OMAP2/3 Display Subsystem support.
++
++if OMAP2_DSS
++
++config OMAP2_DSS_VRAM_SIZE
++ int "VRAM size (MB)"
++ range 0 32
++ default 4
++ help
++ The amount of SDRAM to reserve at boot time for video RAM use.
++ This VRAM will be used by omapfb and other drivers that need
++ large continuous RAM area for video use.
++
++ You can also set this with "vram=<bytes>" kernel argument, or
++ in the board file.
++
++config OMAP2_DSS_DEBUG_SUPPORT
++ bool "Debug support"
++ default y
++ help
++ This enables debug messages. You need to enable printing
++ with 'debug' module parameter.
++
++config OMAP2_DSS_RFBI
++ bool "RFBI support"
++ default n
++ help
++ MIPI DBI, or RFBI (Remote Framebuffer Interface), support.
++
++config OMAP2_DSS_VENC
++ bool "VENC support"
++ default y
++ help
++ OMAP Video Encoder support.
++
++config OMAP2_DSS_SDI
++ bool "SDI support"
++ depends on ARCH_OMAP3
++ default n
++ help
++ SDI (Serial Display Interface) support.
++
++config OMAP2_DSS_DSI
++ bool "DSI support"
++ depends on ARCH_OMAP3
++ default n
++ help
++ MIPI DSI support.
++
++config OMAP2_DSS_USE_DSI_PLL
++ bool "Use DSI PLL for PCLK (EXPERIMENTAL)"
++ default n
++ depends on OMAP2_DSS_DSI
++ help
++ Use DSI PLL to generate pixel clock. Currently only for DPI output.
++ DSI PLL can be used to generate higher and more precise pixel clocks.
++
++config OMAP2_DSS_FAKE_VSYNC
++ bool "Fake VSYNC irq from manual update displays"
++ default n
++ help
++ If this is selected, DSI will generate a fake DISPC VSYNC interrupt
++ when DSI has sent a frame. This is only needed with DSI or RFBI
++ displays using manual mode, and you want VSYNC to, for example,
++ time animation.
++
++config OMAP2_DSS_MIN_FCK_PER_PCK
++ int "Minimum FCK/PCK ratio (for scaling)"
++ range 0 32
++ default 0
++ help
++ This can be used to adjust the minimum FCK/PCK ratio.
++
++ With this you can make sure that DISPC FCK is at least
++ n x PCK. Video plane scaling requires higher FCK than
++ normally.
++
++ If this is set to 0, there's no extra constraint on the
++ DISPC FCK. However, the FCK will at minimum be
++ 2xPCK (if active matrix) or 3xPCK (if passive matrix).
++
++ Max FCK is 173MHz, so this doesn't work if your PCK
++ is very high.
++
++endif
+diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
+new file mode 100644
+index 0000000..980c72c
+--- /dev/null
++++ b/drivers/video/omap2/dss/Makefile
+@@ -0,0 +1,6 @@
++obj-$(CONFIG_OMAP2_DSS) += omapdss.o
++omapdss-y := core.o dss.o dispc.o dpi.o display.o manager.o overlay.o
++omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o
++omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
++omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
++omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+new file mode 100644
+index 0000000..ae7cd06
+--- /dev/null
++++ b/drivers/video/omap2/dss/core.c
+@@ -0,0 +1,641 @@
++/*
++ * linux/drivers/video/omap2/dss/core.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "CORE"
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/platform_device.h>
++#include <linux/seq_file.h>
++#include <linux/debugfs.h>
++#include <linux/io.h>
++
++#include <mach/display.h>
++#include <mach/clock.h>
++
++#include "dss.h"
++
++static struct {
++ struct platform_device *pdev;
++ unsigned ctx_id;
++
++ struct clk *dss_ick;
++ struct clk *dss1_fck;
++ struct clk *dss2_fck;
++ struct clk *dss_54m_fck;
++ struct clk *dss_96m_fck;
++ unsigned num_clks_enabled;
++} core;
++
++static void dss_clk_enable_all_no_ctx(void);
++static void dss_clk_disable_all_no_ctx(void);
++static void dss_clk_enable_no_ctx(enum dss_clock clks);
++static void dss_clk_disable_no_ctx(enum dss_clock clks);
++
++static char *def_disp_name;
++module_param_named(def_disp, def_disp_name, charp, 0);
++MODULE_PARM_DESC(def_disp_name, "default display name");
++
++#ifdef DEBUG
++unsigned int dss_debug;
++module_param_named(debug, dss_debug, bool, 0644);
++#endif
++
++/* CONTEXT */
++static unsigned dss_get_ctx_id(void)
++{
++ struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
++
++ if (!pdata->get_last_off_on_transaction_id)
++ return 0;
++
++ return pdata->get_last_off_on_transaction_id(&core.pdev->dev);
++}
++
++int dss_need_ctx_restore(void)
++{
++ int id = dss_get_ctx_id();
++
++ if (id != core.ctx_id) {
++ DSSDBG("ctx id %u -> id %u\n",
++ core.ctx_id, id);
++ core.ctx_id = id;
++ return 1;
++ } else {
++ return 0;
++ }
++}
++
++static void save_all_ctx(void)
++{
++ DSSDBG("save context\n");
++
++ dss_clk_enable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ dss_save_context();
++ dispc_save_context();
++#ifdef CONFIG_OMAP2_DSS_DSI
++ dsi_save_context();
++#endif
++
++ dss_clk_disable_no_ctx(DSS_CLK_ICK | DSS_CLK_FCK1);
++}
++
++static void restore_all_ctx(void)
++{
++ DSSDBG("restore context\n");
++
++ dss_clk_enable_all_no_ctx();
++
++ dss_restore_context();
++ dispc_restore_context();
++#ifdef CONFIG_OMAP2_DSS_DSI
++ dsi_restore_context();
++#endif
++
++ dss_clk_disable_all_no_ctx();
++}
++
++/* CLOCKS */
++void dss_dump_clocks(struct seq_file *s)
++{
++ int i;
++ struct clk *clocks[5] = {
++ core.dss_ick,
++ core.dss1_fck,
++ core.dss2_fck,
++ core.dss_54m_fck,
++ core.dss_96m_fck
++ };
++
++ seq_printf(s, "- dss -\n");
++
++ seq_printf(s, "internal clk count\t%u\n", core.num_clks_enabled);
++
++ for (i = 0; i < 5; i++) {
++ if (!clocks[i])
++ continue;
++ seq_printf(s, "%-15s\t%lu\t%d\n",
++ clocks[i]->name,
++ clk_get_rate(clocks[i]),
++ clocks[i]->usecount);
++ }
++}
++
++static int dss_get_clocks(void)
++{
++ const struct {
++ struct clk **clock;
++ char *omap2_name;
++ char *omap3_name;
++ } clocks[5] = {
++ { &core.dss_ick, "dss_ick", "dss_ick" }, /* L3 & L4 ick */
++ { &core.dss1_fck, "dss1_fck", "dss1_alwon_fck" },
++ { &core.dss2_fck, "dss2_fck", "dss2_alwon_fck" },
++ { &core.dss_54m_fck, "dss_54m_fck", "dss_tv_fck" },
++ { &core.dss_96m_fck, NULL, "dss_96m_fck" },
++ };
++
++ int r = 0;
++ int i;
++ const int num_clocks = 5;
++
++ for (i = 0; i < num_clocks; i++)
++ *clocks[i].clock = NULL;
++
++ for (i = 0; i < num_clocks; i++) {
++ struct clk *clk;
++ const char *clk_name;
++
++ clk_name = cpu_is_omap34xx() ? clocks[i].omap3_name
++ : clocks[i].omap2_name;
++
++ if (!clk_name)
++ continue;
++
++ clk = clk_get(NULL, clk_name);
++
++ if (IS_ERR(clk)) {
++ DSSERR("can't get clock %s", clk_name);
++ r = PTR_ERR(clk);
++ goto err;
++ }
++
++ DSSDBG("clk %s, rate %ld\n",
++ clk_name, clk_get_rate(clk));
++
++ *clocks[i].clock = clk;
++ }
++
++ return 0;
++
++err:
++ for (i = 0; i < num_clocks; i++) {
++ if (!IS_ERR(*clocks[i].clock))
++ clk_put(*clocks[i].clock);
++ }
++
++ return r;
++}
++
++static void dss_put_clocks(void)
++{
++ if (core.dss_96m_fck)
++ clk_put(core.dss_96m_fck);
++ clk_put(core.dss_54m_fck);
++ clk_put(core.dss1_fck);
++ clk_put(core.dss2_fck);
++ clk_put(core.dss_ick);
++}
++
++unsigned long dss_clk_get_rate(enum dss_clock clk)
++{
++ switch (clk) {
++ case DSS_CLK_ICK:
++ return clk_get_rate(core.dss_ick);
++ case DSS_CLK_FCK1:
++ return clk_get_rate(core.dss1_fck);
++ case DSS_CLK_FCK2:
++ return clk_get_rate(core.dss2_fck);
++ case DSS_CLK_54M:
++ return clk_get_rate(core.dss_54m_fck);
++ case DSS_CLK_96M:
++ return clk_get_rate(core.dss_96m_fck);
++ }
++
++ BUG();
++ return 0;
++}
++
++static unsigned count_clk_bits(enum dss_clock clks)
++{
++ unsigned num_clks = 0;
++
++ if (clks & DSS_CLK_ICK)
++ ++num_clks;
++ if (clks & DSS_CLK_FCK1)
++ ++num_clks;
++ if (clks & DSS_CLK_FCK2)
++ ++num_clks;
++ if (clks & DSS_CLK_54M)
++ ++num_clks;
++ if (clks & DSS_CLK_96M)
++ ++num_clks;
++
++ return num_clks;
++}
++
++static void dss_clk_enable_no_ctx(enum dss_clock clks)
++{
++ unsigned num_clks = count_clk_bits(clks);
++
++ if (clks & DSS_CLK_ICK)
++ clk_enable(core.dss_ick);
++ if (clks & DSS_CLK_FCK1)
++ clk_enable(core.dss1_fck);
++ if (clks & DSS_CLK_FCK2)
++ clk_enable(core.dss2_fck);
++ if (clks & DSS_CLK_54M)
++ clk_enable(core.dss_54m_fck);
++ if (clks & DSS_CLK_96M)
++ clk_enable(core.dss_96m_fck);
++
++ core.num_clks_enabled += num_clks;
++}
++
++void dss_clk_enable(enum dss_clock clks)
++{
++ dss_clk_enable_no_ctx(clks);
++
++ if (cpu_is_omap34xx() && dss_need_ctx_restore())
++ restore_all_ctx();
++}
++
++static void dss_clk_disable_no_ctx(enum dss_clock clks)
++{
++ unsigned num_clks = count_clk_bits(clks);
++
++ if (clks & DSS_CLK_ICK)
++ clk_disable(core.dss_ick);
++ if (clks & DSS_CLK_FCK1)
++ clk_disable(core.dss1_fck);
++ if (clks & DSS_CLK_FCK2)
++ clk_disable(core.dss2_fck);
++ if (clks & DSS_CLK_54M)
++ clk_disable(core.dss_54m_fck);
++ if (clks & DSS_CLK_96M)
++ clk_disable(core.dss_96m_fck);
++
++ core.num_clks_enabled -= num_clks;
++}
++
++void dss_clk_disable(enum dss_clock clks)
++{
++ if (cpu_is_omap34xx()) {
++ unsigned num_clks = count_clk_bits(clks);
++
++ BUG_ON(core.num_clks_enabled < num_clks);
++
++ if (core.num_clks_enabled == num_clks)
++ save_all_ctx();
++ }
++
++ dss_clk_disable_no_ctx(clks);
++}
++
++static void dss_clk_enable_all_no_ctx(void)
++{
++ enum dss_clock clks;
++
++ clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
++ if (cpu_is_omap34xx())
++ clks |= DSS_CLK_96M;
++ dss_clk_enable_no_ctx(clks);
++}
++
++static void dss_clk_disable_all_no_ctx(void)
++{
++ enum dss_clock clks;
++
++ clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
++ if (cpu_is_omap34xx())
++ clks |= DSS_CLK_96M;
++ dss_clk_disable_no_ctx(clks);
++}
++
++static void dss_clk_disable_all(void)
++{
++ enum dss_clock clks;
++
++ clks = DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_FCK2 | DSS_CLK_54M;
++ if (cpu_is_omap34xx())
++ clks |= DSS_CLK_96M;
++ dss_clk_disable(clks);
++}
++
++/* DEBUGFS */
++#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
++static void dss_debug_dump_clocks(struct seq_file *s)
++{
++ dss_dump_clocks(s);
++ dispc_dump_clocks(s);
++#ifdef CONFIG_OMAP2_DSS_DSI
++ dsi_dump_clocks(s);
++#endif
++}
++
++static int dss_debug_show(struct seq_file *s, void *unused)
++{
++ void (*func)(struct seq_file *) = s->private;
++ func(s);
++ return 0;
++}
++
++static int dss_debug_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, dss_debug_show, inode->i_private);
++}
++
++static const struct file_operations dss_debug_fops = {
++ .open = dss_debug_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++
++static struct dentry *dss_debugfs_dir;
++
++static int dss_initialize_debugfs(void)
++{
++ dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
++ if (IS_ERR(dss_debugfs_dir)) {
++ int err = PTR_ERR(dss_debugfs_dir);
++ dss_debugfs_dir = NULL;
++ return err;
++ }
++
++ debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
++ &dss_debug_dump_clocks, &dss_debug_fops);
++
++ debugfs_create_file("dss", S_IRUGO, dss_debugfs_dir,
++ &dss_dump_regs, &dss_debug_fops);
++ debugfs_create_file("dispc", S_IRUGO, dss_debugfs_dir,
++ &dispc_dump_regs, &dss_debug_fops);
++#ifdef CONFIG_OMAP2_DSS_RFBI
++ debugfs_create_file("rfbi", S_IRUGO, dss_debugfs_dir,
++ &rfbi_dump_regs, &dss_debug_fops);
++#endif
++#ifdef CONFIG_OMAP2_DSS_DSI
++ debugfs_create_file("dsi", S_IRUGO, dss_debugfs_dir,
++ &dsi_dump_regs, &dss_debug_fops);
++#endif
++ return 0;
++}
++
++static void dss_uninitialize_debugfs(void)
++{
++ if (dss_debugfs_dir)
++ debugfs_remove_recursive(dss_debugfs_dir);
++}
++#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
++
++
++/* DSI powers */
++int dss_dsi_power_up(void)
++{
++ struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
++
++ if (!pdata->dsi_power_up)
++ return 0; /* presume power is always on then */
++
++ return pdata->dsi_power_up();
++}
++
++void dss_dsi_power_down(void)
++{
++ struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
++
++ if (!pdata->dsi_power_down)
++ return;
++
++ pdata->dsi_power_down();
++}
++
++
++
++/* PLATFORM DEVICE */
++static int omap_dss_probe(struct platform_device *pdev)
++{
++ int skip_init = 0;
++ int r;
++
++ core.pdev = pdev;
++
++ r = dss_get_clocks();
++ if (r)
++ goto fail0;
++
++ dss_clk_enable_all_no_ctx();
++
++ core.ctx_id = dss_get_ctx_id();
++ DSSDBG("initial ctx id %u\n", core.ctx_id);
++
++#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
++ /* DISPC_CONTROL */
++ if (omap_readl(0x48050440) & 1) /* LCD enabled? */
++ skip_init = 1;
++#endif
++
++ r = dss_init(skip_init);
++ if (r) {
++ DSSERR("Failed to initialize DSS\n");
++ goto fail0;
++ }
++
++#ifdef CONFIG_OMAP2_DSS_RFBI
++ r = rfbi_init();
++ if (r) {
++ DSSERR("Failed to initialize rfbi\n");
++ goto fail0;
++ }
++#endif
++
++ r = dpi_init();
++ if (r) {
++ DSSERR("Failed to initialize dpi\n");
++ goto fail0;
++ }
++
++ r = dispc_init();
++ if (r) {
++ DSSERR("Failed to initialize dispc\n");
++ goto fail0;
++ }
++#ifdef CONFIG_OMAP2_DSS_VENC
++ r = venc_init();
++ if (r) {
++ DSSERR("Failed to initialize venc\n");
++ goto fail0;
++ }
++#endif
++ if (cpu_is_omap34xx()) {
++#ifdef CONFIG_OMAP2_DSS_SDI
++ r = sdi_init(skip_init);
++ if (r) {
++ DSSERR("Failed to initialize SDI\n");
++ goto fail0;
++ }
++#endif
++#ifdef CONFIG_OMAP2_DSS_DSI
++ r = dsi_init();
++ if (r) {
++ DSSERR("Failed to initialize DSI\n");
++ goto fail0;
++ }
++#endif
++ }
++
++#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
++ r = dss_initialize_debugfs();
++ if (r)
++ goto fail0;
++#endif
++
++ dss_init_displays(pdev);
++ dss_init_overlay_managers(pdev);
++ dss_init_overlays(pdev, def_disp_name);
++
++ dss_clk_disable_all();
++
++ return 0;
++
++ /* XXX fail correctly */
++fail0:
++ return r;
++}
++
++static int omap_dss_remove(struct platform_device *pdev)
++{
++ int c;
++
++ dss_uninit_overlays(pdev);
++ dss_uninit_overlay_managers(pdev);
++ dss_uninit_displays(pdev);
++
++#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
++ dss_uninitialize_debugfs();
++#endif
++
++#ifdef CONFIG_OMAP2_DSS_VENC
++ venc_exit();
++#endif
++ dispc_exit();
++ dpi_exit();
++#ifdef CONFIG_OMAP2_DSS_RFBI
++ rfbi_exit();
++#endif
++ if (cpu_is_omap34xx()) {
++#ifdef CONFIG_OMAP2_DSS_DSI
++ dsi_exit();
++#endif
++#ifdef CONFIG_OMAP2_DSS_SDI
++ sdi_exit();
++#endif
++ }
++
++ dss_exit();
++
++ /* these should be removed at some point */
++ c = core.dss_ick->usecount;
++ if (c > 0) {
++ DSSERR("warning: dss_ick usecount %d, disabling\n", c);
++ while (c-- > 0)
++ clk_disable(core.dss_ick);
++ }
++
++ c = core.dss1_fck->usecount;
++ if (c > 0) {
++ DSSERR("warning: dss1_fck usecount %d, disabling\n", c);
++ while (c-- > 0)
++ clk_disable(core.dss1_fck);
++ }
++
++ c = core.dss2_fck->usecount;
++ if (c > 0) {
++ DSSERR("warning: dss2_fck usecount %d, disabling\n", c);
++ while (c-- > 0)
++ clk_disable(core.dss2_fck);
++ }
++
++ c = core.dss_54m_fck->usecount;
++ if (c > 0) {
++ DSSERR("warning: dss_54m_fck usecount %d, disabling\n", c);
++ while (c-- > 0)
++ clk_disable(core.dss_54m_fck);
++ }
++
++ if (core.dss_96m_fck) {
++ c = core.dss_96m_fck->usecount;
++ if (c > 0) {
++ DSSERR("warning: dss_96m_fck usecount %d, disabling\n",
++ c);
++ while (c-- > 0)
++ clk_disable(core.dss_96m_fck);
++ }
++ }
++
++ dss_put_clocks();
++
++ return 0;
++}
++
++static void omap_dss_shutdown(struct platform_device *pdev)
++{
++ DSSDBG("shutdown\n");
++}
++
++static int omap_dss_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ DSSDBG("suspend %d\n", state.event);
++
++ return dss_suspend_all_displays();
++}
++
++static int omap_dss_resume(struct platform_device *pdev)
++{
++ DSSDBG("resume\n");
++
++ return dss_resume_all_displays();
++}
++
++static struct platform_driver omap_dss_driver = {
++ .probe = omap_dss_probe,
++ .remove = omap_dss_remove,
++ .shutdown = omap_dss_shutdown,
++ .suspend = omap_dss_suspend,
++ .resume = omap_dss_resume,
++ .driver = {
++ .name = "omapdss",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init omap_dss_init(void)
++{
++ return platform_driver_register(&omap_dss_driver);
++}
++
++static void __exit omap_dss_exit(void)
++{
++ platform_driver_unregister(&omap_dss_driver);
++}
++
++subsys_initcall(omap_dss_init);
++module_exit(omap_dss_exit);
++
++
++MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
++MODULE_DESCRIPTION("OMAP2/3 Display Subsystem");
++MODULE_LICENSE("GPL v2");
++
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+new file mode 100644
+index 0000000..ffb5648
+--- /dev/null
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -0,0 +1,2968 @@
++/*
++ * linux/drivers/video/omap2/dss/dispc.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "DISPC"
++
++#include <linux/kernel.h>
++#include <linux/dma-mapping.h>
++#include <linux/vmalloc.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <linux/jiffies.h>
++#include <linux/seq_file.h>
++#include <linux/delay.h>
++#include <linux/workqueue.h>
++
++#include <mach/sram.h>
++#include <mach/board.h>
++#include <mach/clock.h>
++
++#include <mach/display.h>
++
++#include "dss.h"
++
++/* DISPC */
++#define DISPC_BASE 0x48050400
++
++#define DISPC_SZ_REGS SZ_1K
++
++struct dispc_reg { u16 idx; };
++
++#define DISPC_REG(idx) ((const struct dispc_reg) { idx })
++
++/* DISPC common */
++#define DISPC_REVISION DISPC_REG(0x0000)
++#define DISPC_SYSCONFIG DISPC_REG(0x0010)
++#define DISPC_SYSSTATUS DISPC_REG(0x0014)
++#define DISPC_IRQSTATUS DISPC_REG(0x0018)
++#define DISPC_IRQENABLE DISPC_REG(0x001C)
++#define DISPC_CONTROL DISPC_REG(0x0040)
++#define DISPC_CONFIG DISPC_REG(0x0044)
++#define DISPC_CAPABLE DISPC_REG(0x0048)
++#define DISPC_DEFAULT_COLOR0 DISPC_REG(0x004C)
++#define DISPC_DEFAULT_COLOR1 DISPC_REG(0x0050)
++#define DISPC_TRANS_COLOR0 DISPC_REG(0x0054)
++#define DISPC_TRANS_COLOR1 DISPC_REG(0x0058)
++#define DISPC_LINE_STATUS DISPC_REG(0x005C)
++#define DISPC_LINE_NUMBER DISPC_REG(0x0060)
++#define DISPC_TIMING_H DISPC_REG(0x0064)
++#define DISPC_TIMING_V DISPC_REG(0x0068)
++#define DISPC_POL_FREQ DISPC_REG(0x006C)
++#define DISPC_DIVISOR DISPC_REG(0x0070)
++#define DISPC_GLOBAL_ALPHA DISPC_REG(0x0074)
++#define DISPC_SIZE_DIG DISPC_REG(0x0078)
++#define DISPC_SIZE_LCD DISPC_REG(0x007C)
++
++/* DISPC GFX plane */
++#define DISPC_GFX_BA0 DISPC_REG(0x0080)
++#define DISPC_GFX_BA1 DISPC_REG(0x0084)
++#define DISPC_GFX_POSITION DISPC_REG(0x0088)
++#define DISPC_GFX_SIZE DISPC_REG(0x008C)
++#define DISPC_GFX_ATTRIBUTES DISPC_REG(0x00A0)
++#define DISPC_GFX_FIFO_THRESHOLD DISPC_REG(0x00A4)
++#define DISPC_GFX_FIFO_SIZE_STATUS DISPC_REG(0x00A8)
++#define DISPC_GFX_ROW_INC DISPC_REG(0x00AC)
++#define DISPC_GFX_PIXEL_INC DISPC_REG(0x00B0)
++#define DISPC_GFX_WINDOW_SKIP DISPC_REG(0x00B4)
++#define DISPC_GFX_TABLE_BA DISPC_REG(0x00B8)
++
++#define DISPC_DATA_CYCLE1 DISPC_REG(0x01D4)
++#define DISPC_DATA_CYCLE2 DISPC_REG(0x01D8)
++#define DISPC_DATA_CYCLE3 DISPC_REG(0x01DC)
++
++#define DISPC_CPR_COEF_R DISPC_REG(0x0220)
++#define DISPC_CPR_COEF_G DISPC_REG(0x0224)
++#define DISPC_CPR_COEF_B DISPC_REG(0x0228)
++
++#define DISPC_GFX_PRELOAD DISPC_REG(0x022C)
++
++/* DISPC Video plane, n = 0 for VID1 and n = 1 for VID2 */
++#define DISPC_VID_REG(n, idx) DISPC_REG(0x00BC + (n)*0x90 + idx)
++
++#define DISPC_VID_BA0(n) DISPC_VID_REG(n, 0x0000)
++#define DISPC_VID_BA1(n) DISPC_VID_REG(n, 0x0004)
++#define DISPC_VID_POSITION(n) DISPC_VID_REG(n, 0x0008)
++#define DISPC_VID_SIZE(n) DISPC_VID_REG(n, 0x000C)
++#define DISPC_VID_ATTRIBUTES(n) DISPC_VID_REG(n, 0x0010)
++#define DISPC_VID_FIFO_THRESHOLD(n) DISPC_VID_REG(n, 0x0014)
++#define DISPC_VID_FIFO_SIZE_STATUS(n) DISPC_VID_REG(n, 0x0018)
++#define DISPC_VID_ROW_INC(n) DISPC_VID_REG(n, 0x001C)
++#define DISPC_VID_PIXEL_INC(n) DISPC_VID_REG(n, 0x0020)
++#define DISPC_VID_FIR(n) DISPC_VID_REG(n, 0x0024)
++#define DISPC_VID_PICTURE_SIZE(n) DISPC_VID_REG(n, 0x0028)
++#define DISPC_VID_ACCU0(n) DISPC_VID_REG(n, 0x002C)
++#define DISPC_VID_ACCU1(n) DISPC_VID_REG(n, 0x0030)
++
++/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
++#define DISPC_VID_FIR_COEF_H(n, i) DISPC_REG(0x00F0 + (n)*0x90 + (i)*0x8)
++/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
++#define DISPC_VID_FIR_COEF_HV(n, i) DISPC_REG(0x00F4 + (n)*0x90 + (i)*0x8)
++/* coef index i = {0, 1, 2, 3, 4} */
++#define DISPC_VID_CONV_COEF(n, i) DISPC_REG(0x0130 + (n)*0x90 + (i)*0x4)
++/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
++#define DISPC_VID_FIR_COEF_V(n, i) DISPC_REG(0x01E0 + (n)*0x20 + (i)*0x4)
++
++#define DISPC_VID_PRELOAD(n) DISPC_REG(0x230 + (n)*0x04)
++
++
++#define DISPC_IRQ_MASK_ERROR (DISPC_IRQ_GFX_FIFO_UNDERFLOW | \
++ DISPC_IRQ_OCP_ERR | \
++ DISPC_IRQ_VID1_FIFO_UNDERFLOW | \
++ DISPC_IRQ_VID2_FIFO_UNDERFLOW | \
++ DISPC_IRQ_SYNC_LOST | \
++ DISPC_IRQ_SYNC_LOST_DIGIT)
++
++#define DISPC_MAX_NR_ISRS 8
++
++struct omap_dispc_isr_data {
++ omap_dispc_isr_t isr;
++ void *arg;
++ u32 mask;
++};
++
++#define REG_GET(idx, start, end) \
++ FLD_GET(dispc_read_reg(idx), start, end)
++
++#define REG_FLD_MOD(idx, val, start, end) \
++ dispc_write_reg(idx, FLD_MOD(dispc_read_reg(idx), val, start, end))
++
++static const struct dispc_reg dispc_reg_att[] = { DISPC_GFX_ATTRIBUTES,
++ DISPC_VID_ATTRIBUTES(0),
++ DISPC_VID_ATTRIBUTES(1) };
++
++static struct {
++ void __iomem *base;
++
++ struct clk *dpll4_m4_ck;
++
++ spinlock_t irq_lock;
++
++ unsigned long cache_req_pck;
++ unsigned long cache_prate;
++ struct dispc_clock_info cache_cinfo;
++
++ u32 irq_error_mask;
++ struct omap_dispc_isr_data registered_isr[DISPC_MAX_NR_ISRS];
++
++ spinlock_t error_lock;
++ u32 error_irqs;
++ struct work_struct error_work;
++
++ u32 ctx[DISPC_SZ_REGS / sizeof(u32)];
++} dispc;
++
++static void omap_dispc_set_irqs(void);
++
++static inline void dispc_write_reg(const struct dispc_reg idx, u32 val)
++{
++ __raw_writel(val, dispc.base + idx.idx);
++}
++
++static inline u32 dispc_read_reg(const struct dispc_reg idx)
++{
++ return __raw_readl(dispc.base + idx.idx);
++}
++
++#define SR(reg) \
++ dispc.ctx[(DISPC_##reg).idx / sizeof(u32)] = dispc_read_reg(DISPC_##reg)
++#define RR(reg) \
++ dispc_write_reg(DISPC_##reg, dispc.ctx[(DISPC_##reg).idx / sizeof(u32)])
++
++void dispc_save_context(void)
++{
++ if (cpu_is_omap24xx())
++ return;
++
++ SR(SYSCONFIG);
++ SR(IRQENABLE);
++ SR(CONTROL);
++ SR(CONFIG);
++ SR(DEFAULT_COLOR0);
++ SR(DEFAULT_COLOR1);
++ SR(TRANS_COLOR0);
++ SR(TRANS_COLOR1);
++ SR(LINE_NUMBER);
++ SR(TIMING_H);
++ SR(TIMING_V);
++ SR(POL_FREQ);
++ SR(DIVISOR);
++ SR(GLOBAL_ALPHA);
++ SR(SIZE_DIG);
++ SR(SIZE_LCD);
++
++ SR(GFX_BA0);
++ SR(GFX_BA1);
++ SR(GFX_POSITION);
++ SR(GFX_SIZE);
++ SR(GFX_ATTRIBUTES);
++ SR(GFX_FIFO_THRESHOLD);
++ SR(GFX_ROW_INC);
++ SR(GFX_PIXEL_INC);
++ SR(GFX_WINDOW_SKIP);
++ SR(GFX_TABLE_BA);
++
++ SR(DATA_CYCLE1);
++ SR(DATA_CYCLE2);
++ SR(DATA_CYCLE3);
++
++ SR(CPR_COEF_R);
++ SR(CPR_COEF_G);
++ SR(CPR_COEF_B);
++
++ SR(GFX_PRELOAD);
++
++ /* VID1 */
++ SR(VID_BA0(0));
++ SR(VID_BA1(0));
++ SR(VID_POSITION(0));
++ SR(VID_SIZE(0));
++ SR(VID_ATTRIBUTES(0));
++ SR(VID_FIFO_THRESHOLD(0));
++ SR(VID_ROW_INC(0));
++ SR(VID_PIXEL_INC(0));
++ SR(VID_FIR(0));
++ SR(VID_PICTURE_SIZE(0));
++ SR(VID_ACCU0(0));
++ SR(VID_ACCU1(0));
++
++ SR(VID_FIR_COEF_H(0, 0));
++ SR(VID_FIR_COEF_H(0, 1));
++ SR(VID_FIR_COEF_H(0, 2));
++ SR(VID_FIR_COEF_H(0, 3));
++ SR(VID_FIR_COEF_H(0, 4));
++ SR(VID_FIR_COEF_H(0, 5));
++ SR(VID_FIR_COEF_H(0, 6));
++ SR(VID_FIR_COEF_H(0, 7));
++
++ SR(VID_FIR_COEF_HV(0, 0));
++ SR(VID_FIR_COEF_HV(0, 1));
++ SR(VID_FIR_COEF_HV(0, 2));
++ SR(VID_FIR_COEF_HV(0, 3));
++ SR(VID_FIR_COEF_HV(0, 4));
++ SR(VID_FIR_COEF_HV(0, 5));
++ SR(VID_FIR_COEF_HV(0, 6));
++ SR(VID_FIR_COEF_HV(0, 7));
++
++ SR(VID_CONV_COEF(0, 0));
++ SR(VID_CONV_COEF(0, 1));
++ SR(VID_CONV_COEF(0, 2));
++ SR(VID_CONV_COEF(0, 3));
++ SR(VID_CONV_COEF(0, 4));
++
++ SR(VID_FIR_COEF_V(0, 0));
++ SR(VID_FIR_COEF_V(0, 1));
++ SR(VID_FIR_COEF_V(0, 2));
++ SR(VID_FIR_COEF_V(0, 3));
++ SR(VID_FIR_COEF_V(0, 4));
++ SR(VID_FIR_COEF_V(0, 5));
++ SR(VID_FIR_COEF_V(0, 6));
++ SR(VID_FIR_COEF_V(0, 7));
++
++ SR(VID_PRELOAD(0));
++
++ /* VID2 */
++ SR(VID_BA0(1));
++ SR(VID_BA1(1));
++ SR(VID_POSITION(1));
++ SR(VID_SIZE(1));
++ SR(VID_ATTRIBUTES(1));
++ SR(VID_FIFO_THRESHOLD(1));
++ SR(VID_ROW_INC(1));
++ SR(VID_PIXEL_INC(1));
++ SR(VID_FIR(1));
++ SR(VID_PICTURE_SIZE(1));
++ SR(VID_ACCU0(1));
++ SR(VID_ACCU1(1));
++
++ SR(VID_FIR_COEF_H(1, 0));
++ SR(VID_FIR_COEF_H(1, 1));
++ SR(VID_FIR_COEF_H(1, 2));
++ SR(VID_FIR_COEF_H(1, 3));
++ SR(VID_FIR_COEF_H(1, 4));
++ SR(VID_FIR_COEF_H(1, 5));
++ SR(VID_FIR_COEF_H(1, 6));
++ SR(VID_FIR_COEF_H(1, 7));
++
++ SR(VID_FIR_COEF_HV(1, 0));
++ SR(VID_FIR_COEF_HV(1, 1));
++ SR(VID_FIR_COEF_HV(1, 2));
++ SR(VID_FIR_COEF_HV(1, 3));
++ SR(VID_FIR_COEF_HV(1, 4));
++ SR(VID_FIR_COEF_HV(1, 5));
++ SR(VID_FIR_COEF_HV(1, 6));
++ SR(VID_FIR_COEF_HV(1, 7));
++
++ SR(VID_CONV_COEF(1, 0));
++ SR(VID_CONV_COEF(1, 1));
++ SR(VID_CONV_COEF(1, 2));
++ SR(VID_CONV_COEF(1, 3));
++ SR(VID_CONV_COEF(1, 4));
++
++ SR(VID_FIR_COEF_V(1, 0));
++ SR(VID_FIR_COEF_V(1, 1));
++ SR(VID_FIR_COEF_V(1, 2));
++ SR(VID_FIR_COEF_V(1, 3));
++ SR(VID_FIR_COEF_V(1, 4));
++ SR(VID_FIR_COEF_V(1, 5));
++ SR(VID_FIR_COEF_V(1, 6));
++ SR(VID_FIR_COEF_V(1, 7));
++
++ SR(VID_PRELOAD(1));
++}
++
++void dispc_restore_context(void)
++{
++ RR(SYSCONFIG);
++ RR(IRQENABLE);
++ /*RR(CONTROL);*/
++ RR(CONFIG);
++ RR(DEFAULT_COLOR0);
++ RR(DEFAULT_COLOR1);
++ RR(TRANS_COLOR0);
++ RR(TRANS_COLOR1);
++ RR(LINE_NUMBER);
++ RR(TIMING_H);
++ RR(TIMING_V);
++ RR(POL_FREQ);
++ RR(DIVISOR);
++ RR(GLOBAL_ALPHA);
++ RR(SIZE_DIG);
++ RR(SIZE_LCD);
++
++ RR(GFX_BA0);
++ RR(GFX_BA1);
++ RR(GFX_POSITION);
++ RR(GFX_SIZE);
++ RR(GFX_ATTRIBUTES);
++ RR(GFX_FIFO_THRESHOLD);
++ RR(GFX_ROW_INC);
++ RR(GFX_PIXEL_INC);
++ RR(GFX_WINDOW_SKIP);
++ RR(GFX_TABLE_BA);
++
++ RR(DATA_CYCLE1);
++ RR(DATA_CYCLE2);
++ RR(DATA_CYCLE3);
++
++ RR(CPR_COEF_R);
++ RR(CPR_COEF_G);
++ RR(CPR_COEF_B);
++
++ RR(GFX_PRELOAD);
++
++ /* VID1 */
++ RR(VID_BA0(0));
++ RR(VID_BA1(0));
++ RR(VID_POSITION(0));
++ RR(VID_SIZE(0));
++ RR(VID_ATTRIBUTES(0));
++ RR(VID_FIFO_THRESHOLD(0));
++ RR(VID_ROW_INC(0));
++ RR(VID_PIXEL_INC(0));
++ RR(VID_FIR(0));
++ RR(VID_PICTURE_SIZE(0));
++ RR(VID_ACCU0(0));
++ RR(VID_ACCU1(0));
++
++ RR(VID_FIR_COEF_H(0, 0));
++ RR(VID_FIR_COEF_H(0, 1));
++ RR(VID_FIR_COEF_H(0, 2));
++ RR(VID_FIR_COEF_H(0, 3));
++ RR(VID_FIR_COEF_H(0, 4));
++ RR(VID_FIR_COEF_H(0, 5));
++ RR(VID_FIR_COEF_H(0, 6));
++ RR(VID_FIR_COEF_H(0, 7));
++
++ RR(VID_FIR_COEF_HV(0, 0));
++ RR(VID_FIR_COEF_HV(0, 1));
++ RR(VID_FIR_COEF_HV(0, 2));
++ RR(VID_FIR_COEF_HV(0, 3));
++ RR(VID_FIR_COEF_HV(0, 4));
++ RR(VID_FIR_COEF_HV(0, 5));
++ RR(VID_FIR_COEF_HV(0, 6));
++ RR(VID_FIR_COEF_HV(0, 7));
++
++ RR(VID_CONV_COEF(0, 0));
++ RR(VID_CONV_COEF(0, 1));
++ RR(VID_CONV_COEF(0, 2));
++ RR(VID_CONV_COEF(0, 3));
++ RR(VID_CONV_COEF(0, 4));
++
++ RR(VID_FIR_COEF_V(0, 0));
++ RR(VID_FIR_COEF_V(0, 1));
++ RR(VID_FIR_COEF_V(0, 2));
++ RR(VID_FIR_COEF_V(0, 3));
++ RR(VID_FIR_COEF_V(0, 4));
++ RR(VID_FIR_COEF_V(0, 5));
++ RR(VID_FIR_COEF_V(0, 6));
++ RR(VID_FIR_COEF_V(0, 7));
++
++ RR(VID_PRELOAD(0));
++
++ /* VID2 */
++ RR(VID_BA0(1));
++ RR(VID_BA1(1));
++ RR(VID_POSITION(1));
++ RR(VID_SIZE(1));
++ RR(VID_ATTRIBUTES(1));
++ RR(VID_FIFO_THRESHOLD(1));
++ RR(VID_ROW_INC(1));
++ RR(VID_PIXEL_INC(1));
++ RR(VID_FIR(1));
++ RR(VID_PICTURE_SIZE(1));
++ RR(VID_ACCU0(1));
++ RR(VID_ACCU1(1));
++
++ RR(VID_FIR_COEF_H(1, 0));
++ RR(VID_FIR_COEF_H(1, 1));
++ RR(VID_FIR_COEF_H(1, 2));
++ RR(VID_FIR_COEF_H(1, 3));
++ RR(VID_FIR_COEF_H(1, 4));
++ RR(VID_FIR_COEF_H(1, 5));
++ RR(VID_FIR_COEF_H(1, 6));
++ RR(VID_FIR_COEF_H(1, 7));
++
++ RR(VID_FIR_COEF_HV(1, 0));
++ RR(VID_FIR_COEF_HV(1, 1));
++ RR(VID_FIR_COEF_HV(1, 2));
++ RR(VID_FIR_COEF_HV(1, 3));
++ RR(VID_FIR_COEF_HV(1, 4));
++ RR(VID_FIR_COEF_HV(1, 5));
++ RR(VID_FIR_COEF_HV(1, 6));
++ RR(VID_FIR_COEF_HV(1, 7));
++
++ RR(VID_CONV_COEF(1, 0));
++ RR(VID_CONV_COEF(1, 1));
++ RR(VID_CONV_COEF(1, 2));
++ RR(VID_CONV_COEF(1, 3));
++ RR(VID_CONV_COEF(1, 4));
++
++ RR(VID_FIR_COEF_V(1, 0));
++ RR(VID_FIR_COEF_V(1, 1));
++ RR(VID_FIR_COEF_V(1, 2));
++ RR(VID_FIR_COEF_V(1, 3));
++ RR(VID_FIR_COEF_V(1, 4));
++ RR(VID_FIR_COEF_V(1, 5));
++ RR(VID_FIR_COEF_V(1, 6));
++ RR(VID_FIR_COEF_V(1, 7));
++
++ RR(VID_PRELOAD(1));
++
++ /* enable last, because LCD & DIGIT enable are here */
++ RR(CONTROL);
++}
++
++#undef SR
++#undef RR
++
++static inline void enable_clocks(bool enable)
++{
++ if (enable)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ else
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++}
++
++void dispc_go(enum omap_channel channel)
++{
++ int bit;
++ unsigned long tmo;
++
++ enable_clocks(1);
++
++ if (channel == OMAP_DSS_CHANNEL_LCD)
++ bit = 0; /* LCDENABLE */
++ else
++ bit = 1; /* DIGITALENABLE */
++
++ /* if the channel is not enabled, we don't need GO */
++ if (REG_GET(DISPC_CONTROL, bit, bit) == 0)
++ goto end;
++
++ if (channel == OMAP_DSS_CHANNEL_LCD)
++ bit = 5; /* GOLCD */
++ else
++ bit = 6; /* GODIGIT */
++
++ tmo = jiffies + msecs_to_jiffies(200);
++ while (REG_GET(DISPC_CONTROL, bit, bit) == 1) {
++ if (time_after(jiffies, tmo)) {
++ DSSERR("timeout waiting GO flag\n");
++ goto end;
++ }
++ cpu_relax();
++ }
++
++ DSSDBG("GO %s\n", channel == OMAP_DSS_CHANNEL_LCD ? "LCD" : "DIGIT");
++
++ REG_FLD_MOD(DISPC_CONTROL, 1, bit, bit);
++end:
++ enable_clocks(0);
++}
++
++static void _dispc_write_firh_reg(enum omap_plane plane, int reg, u32 value)
++{
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ dispc_write_reg(DISPC_VID_FIR_COEF_H(plane-1, reg), value);
++}
++
++static void _dispc_write_firhv_reg(enum omap_plane plane, int reg, u32 value)
++{
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ dispc_write_reg(DISPC_VID_FIR_COEF_HV(plane-1, reg), value);
++}
++
++static void _dispc_write_firv_reg(enum omap_plane plane, int reg, u32 value)
++{
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ dispc_write_reg(DISPC_VID_FIR_COEF_V(plane-1, reg), value);
++}
++
++static void _dispc_set_scale_coef(enum omap_plane plane, int hscaleup,
++ int vscaleup, int five_taps)
++{
++ /* Coefficients for horizontal up-sampling */
++ static const u32 coef_hup[8] = {
++ 0x00800000,
++ 0x0D7CF800,
++ 0x1E70F5FF,
++ 0x335FF5FE,
++ 0xF74949F7,
++ 0xF55F33FB,
++ 0xF5701EFE,
++ 0xF87C0DFF,
++ };
++
++ /* Coefficients for horizontal down-sampling */
++ static const u32 coef_hdown[8] = {
++ 0x24382400,
++ 0x28371FFE,
++ 0x2C361BFB,
++ 0x303516F9,
++ 0x11343311,
++ 0x1635300C,
++ 0x1B362C08,
++ 0x1F372804,
++ };
++
++ /* Coefficients for horizontal and vertical up-sampling */
++ static const u32 coef_hvup[2][8] = {
++ {
++ 0x00800000,
++ 0x037B02FF,
++ 0x0C6F05FE,
++ 0x205907FB,
++ 0x00404000,
++ 0x075920FE,
++ 0x056F0CFF,
++ 0x027B0300,
++ },
++ {
++ 0x00800000,
++ 0x0D7CF8FF,
++ 0x1E70F5FE,
++ 0x335FF5FB,
++ 0xF7404000,
++ 0xF55F33FE,
++ 0xF5701EFF,
++ 0xF87C0D00,
++ },
++ };
++
++ /* Coefficients for horizontal and vertical down-sampling */
++ static const u32 coef_hvdown[2][8] = {
++ {
++ 0x24382400,
++ 0x28391F04,
++ 0x2D381B08,
++ 0x3237170C,
++ 0x123737F7,
++ 0x173732F9,
++ 0x1B382DFB,
++ 0x1F3928FE,
++ },
++ {
++ 0x24382400,
++ 0x28371F04,
++ 0x2C361B08,
++ 0x3035160C,
++ 0x113433F7,
++ 0x163530F9,
++ 0x1B362CFB,
++ 0x1F3728FE,
++ },
++ };
++
++ /* Coefficients for vertical up-sampling */
++ static const u32 coef_vup[8] = {
++ 0x00000000,
++ 0x0000FF00,
++ 0x0000FEFF,
++ 0x0000FBFE,
++ 0x000000F7,
++ 0x0000FEFB,
++ 0x0000FFFE,
++ 0x000000FF,
++ };
++
++
++ /* Coefficients for vertical down-sampling */
++ static const u32 coef_vdown[8] = {
++ 0x00000000,
++ 0x000004FE,
++ 0x000008FB,
++ 0x00000CF9,
++ 0x0000F711,
++ 0x0000F90C,
++ 0x0000FB08,
++ 0x0000FE04,
++ };
++
++ const u32 *h_coef;
++ const u32 *hv_coef;
++ const u32 *hv_coef_mod;
++ const u32 *v_coef;
++ int i;
++
++ if (hscaleup)
++ h_coef = coef_hup;
++ else
++ h_coef = coef_hdown;
++
++ if (vscaleup) {
++ hv_coef = coef_hvup[five_taps];
++ v_coef = coef_vup;
++
++ if (hscaleup)
++ hv_coef_mod = NULL;
++ else
++ hv_coef_mod = coef_hvdown[five_taps];
++ } else {
++ hv_coef = coef_hvdown[five_taps];
++ v_coef = coef_vdown;
++
++ if (hscaleup)
++ hv_coef_mod = coef_hvup[five_taps];
++ else
++ hv_coef_mod = NULL;
++ }
++
++ for (i = 0; i < 8; i++) {
++ u32 h, hv;
++
++ h = h_coef[i];
++
++ hv = hv_coef[i];
++
++ if (hv_coef_mod) {
++ hv &= 0xffffff00;
++ hv |= (hv_coef_mod[i] & 0xff);
++ }
++
++ _dispc_write_firh_reg(plane, i, h);
++ _dispc_write_firhv_reg(plane, i, hv);
++ }
++
++ if (!five_taps)
++ return;
++
++ for (i = 0; i < 8; i++) {
++ u32 v;
++ v = v_coef[i];
++ _dispc_write_firv_reg(plane, i, v);
++ }
++}
++
++static void _dispc_setup_color_conv_coef(void)
++{
++ const struct color_conv_coef {
++ int ry, rcr, rcb, gy, gcr, gcb, by, bcr, bcb;
++ int full_range;
++ } ctbl_bt601_5 = {
++ 298, 409, 0, 298, -208, -100, 298, 0, 517, 0,
++ };
++
++ const struct color_conv_coef *ct;
++
++#define CVAL(x, y) (FLD_VAL(x, 26, 16) | FLD_VAL(y, 10, 0))
++
++ ct = &ctbl_bt601_5;
++
++ dispc_write_reg(DISPC_VID_CONV_COEF(0, 0), CVAL(ct->rcr, ct->ry));
++ dispc_write_reg(DISPC_VID_CONV_COEF(0, 1), CVAL(ct->gy, ct->rcb));
++ dispc_write_reg(DISPC_VID_CONV_COEF(0, 2), CVAL(ct->gcb, ct->gcr));
++ dispc_write_reg(DISPC_VID_CONV_COEF(0, 3), CVAL(ct->bcr, ct->by));
++ dispc_write_reg(DISPC_VID_CONV_COEF(0, 4), CVAL(0, ct->bcb));
++
++ dispc_write_reg(DISPC_VID_CONV_COEF(1, 0), CVAL(ct->rcr, ct->ry));
++ dispc_write_reg(DISPC_VID_CONV_COEF(1, 1), CVAL(ct->gy, ct->rcb));
++ dispc_write_reg(DISPC_VID_CONV_COEF(1, 2), CVAL(ct->gcb, ct->gcr));
++ dispc_write_reg(DISPC_VID_CONV_COEF(1, 3), CVAL(ct->bcr, ct->by));
++ dispc_write_reg(DISPC_VID_CONV_COEF(1, 4), CVAL(0, ct->bcb));
++
++#undef CVAL
++
++ REG_FLD_MOD(DISPC_VID_ATTRIBUTES(0), ct->full_range, 11, 11);
++ REG_FLD_MOD(DISPC_VID_ATTRIBUTES(1), ct->full_range, 11, 11);
++}
++
++
++static void _dispc_set_plane_ba0(enum omap_plane plane, u32 paddr)
++{
++ const struct dispc_reg ba0_reg[] = { DISPC_GFX_BA0,
++ DISPC_VID_BA0(0),
++ DISPC_VID_BA0(1) };
++
++ dispc_write_reg(ba0_reg[plane], paddr);
++}
++
++static void _dispc_set_plane_ba1(enum omap_plane plane, u32 paddr)
++{
++ const struct dispc_reg ba1_reg[] = { DISPC_GFX_BA1,
++ DISPC_VID_BA1(0),
++ DISPC_VID_BA1(1) };
++
++ dispc_write_reg(ba1_reg[plane], paddr);
++}
++
++static void _dispc_set_plane_pos(enum omap_plane plane, int x, int y)
++{
++ const struct dispc_reg pos_reg[] = { DISPC_GFX_POSITION,
++ DISPC_VID_POSITION(0),
++ DISPC_VID_POSITION(1) };
++
++ u32 val = FLD_VAL(y, 26, 16) | FLD_VAL(x, 10, 0);
++ dispc_write_reg(pos_reg[plane], val);
++}
++
++static void _dispc_set_pic_size(enum omap_plane plane, int width, int height)
++{
++ const struct dispc_reg siz_reg[] = { DISPC_GFX_SIZE,
++ DISPC_VID_PICTURE_SIZE(0),
++ DISPC_VID_PICTURE_SIZE(1) };
++ u32 val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0);
++ dispc_write_reg(siz_reg[plane], val);
++}
++
++static void _dispc_set_vid_size(enum omap_plane plane, int width, int height)
++{
++ u32 val;
++ const struct dispc_reg vsi_reg[] = { DISPC_VID_SIZE(0),
++ DISPC_VID_SIZE(1) };
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0);
++ dispc_write_reg(vsi_reg[plane-1], val);
++}
++
++static void _dispc_set_pix_inc(enum omap_plane plane, u16 inc)
++{
++ const struct dispc_reg ri_reg[] = { DISPC_GFX_PIXEL_INC,
++ DISPC_VID_PIXEL_INC(0),
++ DISPC_VID_PIXEL_INC(1) };
++
++ dispc_write_reg(ri_reg[plane], inc);
++}
++
++static void _dispc_set_row_inc(enum omap_plane plane, u16 inc)
++{
++ const struct dispc_reg ri_reg[] = { DISPC_GFX_ROW_INC,
++ DISPC_VID_ROW_INC(0),
++ DISPC_VID_ROW_INC(1) };
++
++ dispc_write_reg(ri_reg[plane], inc);
++}
++
++static void _dispc_set_color_mode(enum omap_plane plane,
++ enum omap_color_mode color_mode)
++{
++ u32 m = 0;
++
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_CLUT1:
++ m = 0x0; break;
++ case OMAP_DSS_COLOR_CLUT2:
++ m = 0x1; break;
++ case OMAP_DSS_COLOR_CLUT4:
++ m = 0x2; break;
++ case OMAP_DSS_COLOR_CLUT8:
++ m = 0x3; break;
++ case OMAP_DSS_COLOR_RGB12U:
++ m = 0x4; break;
++ case OMAP_DSS_COLOR_ARGB16:
++ m = 0x5; break;
++ case OMAP_DSS_COLOR_RGB16:
++ m = 0x6; break;
++ case OMAP_DSS_COLOR_RGB24U:
++ m = 0x8; break;
++ case OMAP_DSS_COLOR_RGB24P:
++ m = 0x9; break;
++ case OMAP_DSS_COLOR_YUV2:
++ m = 0xa; break;
++ case OMAP_DSS_COLOR_UYVY:
++ m = 0xb; break;
++ case OMAP_DSS_COLOR_ARGB32:
++ m = 0xc; break;
++ case OMAP_DSS_COLOR_RGBA32:
++ m = 0xd; break;
++ case OMAP_DSS_COLOR_RGBX32:
++ m = 0xe; break;
++ default:
++ BUG(); break;
++ }
++
++ REG_FLD_MOD(dispc_reg_att[plane], m, 4, 1);
++}
++
++static void _dispc_set_channel_out(enum omap_plane plane,
++ enum omap_channel channel)
++{
++ int shift;
++ u32 val;
++
++ switch (plane) {
++ case OMAP_DSS_GFX:
++ shift = 8;
++ break;
++ case OMAP_DSS_VIDEO1:
++ case OMAP_DSS_VIDEO2:
++ shift = 16;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ val = dispc_read_reg(dispc_reg_att[plane]);
++ val = FLD_MOD(val, channel, shift, shift);
++ dispc_write_reg(dispc_reg_att[plane], val);
++}
++
++void dispc_set_burst_size(enum omap_plane plane,
++ enum omap_burst_size burst_size)
++{
++ int shift;
++ u32 val;
++
++ enable_clocks(1);
++
++ switch (plane) {
++ case OMAP_DSS_GFX:
++ shift = 6;
++ break;
++ case OMAP_DSS_VIDEO1:
++ case OMAP_DSS_VIDEO2:
++ shift = 14;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ val = dispc_read_reg(dispc_reg_att[plane]);
++ val = FLD_MOD(val, burst_size, shift+1, shift);
++ dispc_write_reg(dispc_reg_att[plane], val);
++
++ enable_clocks(0);
++}
++
++static void _dispc_set_vid_color_conv(enum omap_plane plane, bool enable)
++{
++ u32 val;
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ val = dispc_read_reg(dispc_reg_att[plane]);
++ val = FLD_MOD(val, enable, 9, 9);
++ dispc_write_reg(dispc_reg_att[plane], val);
++}
++
++void dispc_set_lcd_size(u16 width, u16 height)
++{
++ u32 val;
++ BUG_ON((width > (1 << 11)) || (height > (1 << 11)));
++ val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0);
++ enable_clocks(1);
++ dispc_write_reg(DISPC_SIZE_LCD, val);
++ enable_clocks(0);
++}
++
++void dispc_set_digit_size(u16 width, u16 height)
++{
++ u32 val;
++ BUG_ON((width > (1 << 11)) || (height > (1 << 11)));
++ val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0);
++ enable_clocks(1);
++ dispc_write_reg(DISPC_SIZE_DIG, val);
++ enable_clocks(0);
++}
++
++u32 dispc_get_plane_fifo_size(enum omap_plane plane)
++{
++ const struct dispc_reg fsz_reg[] = { DISPC_GFX_FIFO_SIZE_STATUS,
++ DISPC_VID_FIFO_SIZE_STATUS(0),
++ DISPC_VID_FIFO_SIZE_STATUS(1) };
++ u32 size;
++
++ enable_clocks(1);
++
++ if (cpu_is_omap24xx())
++ size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 8, 0);
++ else if (cpu_is_omap34xx())
++ size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 10, 0);
++ else
++ BUG();
++
++ if (cpu_is_omap34xx()) {
++ /* FIFOMERGE */
++ if (REG_GET(DISPC_CONFIG, 14, 14))
++ size *= 3;
++ }
++
++ enable_clocks(0);
++
++ return size;
++}
++
++void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high)
++{
++ const struct dispc_reg ftrs_reg[] = { DISPC_GFX_FIFO_THRESHOLD,
++ DISPC_VID_FIFO_THRESHOLD(0),
++ DISPC_VID_FIFO_THRESHOLD(1) };
++ u32 size;
++
++ enable_clocks(1);
++
++ size = dispc_get_plane_fifo_size(plane);
++
++ BUG_ON(low > size || high > size);
++
++ DSSDBG("fifo(%d) size %d, low/high old %u/%u, new %u/%u\n",
++ plane, size,
++ REG_GET(ftrs_reg[plane], 11, 0),
++ REG_GET(ftrs_reg[plane], 27, 16),
++ low, high);
++
++ if (cpu_is_omap24xx())
++ dispc_write_reg(ftrs_reg[plane],
++ FLD_VAL(high, 24, 16) | FLD_VAL(low, 8, 0));
++ else
++ dispc_write_reg(ftrs_reg[plane],
++ FLD_VAL(high, 27, 16) | FLD_VAL(low, 11, 0));
++
++ enable_clocks(0);
++}
++
++void dispc_enable_fifomerge(bool enable)
++{
++ enable_clocks(1);
++
++ DSSDBG("FIFO merge %s\n", enable ? "enabled" : "disabled");
++ REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 14, 14);
++
++ enable_clocks(0);
++}
++
++static void _dispc_set_fir(enum omap_plane plane, int hinc, int vinc)
++{
++ u32 val;
++ const struct dispc_reg fir_reg[] = { DISPC_VID_FIR(0),
++ DISPC_VID_FIR(1) };
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0);
++ dispc_write_reg(fir_reg[plane-1], val);
++}
++
++static void _dispc_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
++{
++ u32 val;
++ const struct dispc_reg ac0_reg[] = { DISPC_VID_ACCU0(0),
++ DISPC_VID_ACCU0(1) };
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ val = FLD_VAL(vaccu, 25, 16) | FLD_VAL(haccu, 9, 0);
++ dispc_write_reg(ac0_reg[plane-1], val);
++}
++
++static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
++{
++ u32 val;
++ const struct dispc_reg ac1_reg[] = { DISPC_VID_ACCU1(0),
++ DISPC_VID_ACCU1(1) };
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ val = FLD_VAL(vaccu, 25, 16) | FLD_VAL(haccu, 9, 0);
++ dispc_write_reg(ac1_reg[plane-1], val);
++}
++
++
++static void _dispc_set_scaling(enum omap_plane plane,
++ u16 orig_width, u16 orig_height,
++ u16 out_width, u16 out_height,
++ bool ilace)
++{
++ int fir_hinc;
++ int fir_vinc;
++ int hscaleup, vscaleup, five_taps;
++ int fieldmode = 0;
++ int accu0 = 0;
++ int accu1 = 0;
++ u32 l;
++
++ BUG_ON(plane == OMAP_DSS_GFX);
++
++ hscaleup = orig_width <= out_width;
++ vscaleup = orig_height <= out_height;
++ five_taps = orig_height > out_height * 2;
++
++ _dispc_set_scale_coef(plane, hscaleup, vscaleup, five_taps);
++
++ if (!orig_width || orig_width == out_width)
++ fir_hinc = 0;
++ else
++ fir_hinc = 1024 * orig_width / out_width;
++
++ if (!orig_height || orig_height == out_height)
++ fir_vinc = 0;
++ else
++ fir_vinc = 1024 * orig_height / out_height;
++
++ _dispc_set_fir(plane, fir_hinc, fir_vinc);
++
++ l = dispc_read_reg(dispc_reg_att[plane]);
++ l &= ~((0x0f << 5) | (0x3 << 21));
++
++ l |= fir_hinc ? (1 << 5) : 0;
++ l |= fir_vinc ? (1 << 6) : 0;
++
++ l |= hscaleup ? 0 : (1 << 7);
++ l |= vscaleup ? 0 : (1 << 8);
++
++ l |= five_taps ? (1 << 21) : 0;
++ l |= five_taps ? (1 << 22) : 0;
++
++ dispc_write_reg(dispc_reg_att[plane], l);
++
++ if (ilace) {
++ if (fieldmode) {
++ accu0 = fir_vinc / 2;
++ accu1 = 0;
++ } else {
++ accu0 = 0;
++ accu1 = fir_vinc / 2;
++ if (accu1 >= 1024/2) {
++ accu0 = 1024/2;
++ accu1 -= accu0;
++ }
++ }
++ }
++
++ _dispc_set_vid_accu0(plane, 0, accu0);
++ _dispc_set_vid_accu1(plane, 0, accu1);
++}
++
++static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
++ bool mirroring, enum omap_color_mode color_mode)
++{
++ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
++ color_mode == OMAP_DSS_COLOR_UYVY) {
++ int vidrot = 0;
++
++ if (mirroring) {
++ switch (rotation) {
++ case 0: vidrot = 2; break;
++ case 1: vidrot = 3; break;
++ case 2: vidrot = 0; break;
++ case 3: vidrot = 1; break;
++ }
++ } else {
++ switch (rotation) {
++ case 0: vidrot = 0; break;
++ case 1: vidrot = 1; break;
++ case 2: vidrot = 2; break;
++ case 3: vidrot = 1; break;
++ }
++ }
++
++ REG_FLD_MOD(dispc_reg_att[plane], vidrot, 13, 12);
++
++ if (rotation == 1 || rotation == 3)
++ REG_FLD_MOD(dispc_reg_att[plane], 0x1, 18, 18);
++ else
++ REG_FLD_MOD(dispc_reg_att[plane], 0x0, 18, 18);
++ } else {
++ REG_FLD_MOD(dispc_reg_att[plane], 0, 13, 12);
++ REG_FLD_MOD(dispc_reg_att[plane], 0, 18, 18);
++ }
++}
++
++static int pixinc(int pixels, u8 ps)
++{
++ if (pixels == 1)
++ return 1;
++ else if (pixels > 1)
++ return 1 + (pixels - 1) * ps;
++ else if (pixels < 0)
++ return 1 - (-pixels + 1) * ps;
++ else
++ BUG();
++}
++
++static void calc_rotation_offset(u8 rotation, bool mirror,
++ u16 screen_width,
++ u16 width, u16 height,
++ enum omap_color_mode color_mode, bool fieldmode,
++ unsigned *offset0, unsigned *offset1,
++ u16 *row_inc, u16 *pix_inc)
++{
++ u8 ps;
++ u16 fbw, fbh;
++
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_ARGB16:
++ ps = 2;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24P:
++ ps = 3;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ ps = 4;
++ break;
++
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ ps = 2;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
++ width, height);
++
++ /* width & height are overlay sizes, convert to fb sizes */
++
++ if (rotation == 0 || rotation == 2) {
++ fbw = width;
++ fbh = height;
++ } else {
++ fbw = height;
++ fbh = width;
++ }
++
++ switch (rotation + mirror * 4) {
++ case 0:
++ *offset0 = 0;
++ if (fieldmode)
++ *offset1 = screen_width * ps;
++ else
++ *offset1 = 0;
++ *row_inc = pixinc(1 + (screen_width - fbw) +
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(1, ps);
++ break;
++ case 1:
++ *offset0 = screen_width * (fbh - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 + ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(screen_width * (fbh - 1) + 1 +
++ (fieldmode ? 1 : 0), ps);
++ *pix_inc = pixinc(-screen_width, ps);
++ break;
++ case 2:
++ *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 - screen_width * ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(-1 -
++ (screen_width - fbw) -
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(-1, ps);
++ break;
++ case 3:
++ *offset0 = (fbw - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 - ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(-screen_width * (fbh - 1) - 1 -
++ (fieldmode ? 1 : 0), ps);
++ *pix_inc = pixinc(screen_width, ps);
++ break;
++
++ /* mirroring */
++ case 0 + 4:
++ *offset0 = (fbw - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 + screen_width * ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(screen_width * 2 - 1 +
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(-1, ps);
++ break;
++
++ case 1 + 4:
++ *offset0 = 0;
++ if (fieldmode)
++ *offset1 = *offset0 + screen_width * ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(-screen_width * (fbh - 1) + 1 +
++ (fieldmode ? 1 : 0),
++ ps);
++ *pix_inc = pixinc(screen_width, ps);
++ break;
++
++ case 2 + 4:
++ *offset0 = screen_width * (fbh - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 + screen_width * ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(1 - screen_width * 2 -
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(1, ps);
++ break;
++
++ case 3 + 4:
++ *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
++ if (fieldmode)
++ *offset1 = *offset0 + screen_width * ps;
++ else
++ *offset1 = *offset0;
++ *row_inc = pixinc(screen_width * (fbh - 1) - 1 -
++ (fieldmode ? 1 : 0),
++ ps);
++ *pix_inc = pixinc(-screen_width, ps);
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++static int _dispc_setup_plane(enum omap_plane plane,
++ enum omap_channel channel_out,
++ u32 paddr, u16 screen_width,
++ u16 pos_x, u16 pos_y,
++ u16 width, u16 height,
++ u16 out_width, u16 out_height,
++ enum omap_color_mode color_mode,
++ bool ilace,
++ u8 rotation, int mirror)
++{
++ const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
++ bool five_taps = height > out_height * 2;
++ bool fieldmode = 0;
++ int cconv = 0;
++ unsigned offset0, offset1;
++ u16 row_inc;
++ u16 pix_inc;
++
++ if (plane == OMAP_DSS_GFX) {
++ if (width != out_width || height != out_height)
++ return -EINVAL;
++
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_ARGB16:
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_RGB24P:
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ break;
++
++ default:
++ return -EINVAL;
++ }
++ } else {
++ /* video plane */
++ if (width > (2048 >> five_taps))
++ return -EINVAL;
++
++ if (out_width < width / maxdownscale ||
++ out_width > width * 8)
++ return -EINVAL;
++
++ if (out_height < height / maxdownscale ||
++ out_height > height * 8)
++ return -EINVAL;
++
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_RGB24P:
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_RGBX32:
++ break;
++
++ case OMAP_DSS_COLOR_ARGB16:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ if (plane == OMAP_DSS_VIDEO1)
++ return -EINVAL;
++ break;
++
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ cconv = 1;
++ break;
++
++ default:
++ return -EINVAL;
++ }
++ }
++
++ if (ilace && height >= out_height)
++ fieldmode = 1;
++
++ calc_rotation_offset(rotation, mirror,
++ screen_width, width, height, color_mode,
++ fieldmode,
++ &offset0, &offset1, &row_inc, &pix_inc);
++
++ DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
++ offset0, offset1, row_inc, pix_inc);
++
++ if (ilace) {
++ if (fieldmode)
++ height /= 2;
++ pos_y /= 2;
++ out_height /= 2;
++
++ DSSDBG("adjusting for ilace: height %d, pos_y %d, "
++ "out_height %d\n",
++ height, pos_y, out_height);
++ }
++
++ _dispc_set_channel_out(plane, channel_out);
++ _dispc_set_color_mode(plane, color_mode);
++
++ _dispc_set_plane_ba0(plane, paddr + offset0);
++ _dispc_set_plane_ba1(plane, paddr + offset1);
++
++ _dispc_set_row_inc(plane, row_inc);
++ _dispc_set_pix_inc(plane, pix_inc);
++
++ DSSDBG("%d,%d %dx%d -> %dx%d\n", pos_x, pos_y, width, height,
++ out_width, out_height);
++
++ _dispc_set_plane_pos(plane, pos_x, pos_y);
++
++ _dispc_set_pic_size(plane, width, height);
++
++ if (plane != OMAP_DSS_GFX) {
++ _dispc_set_scaling(plane, width, height,
++ out_width, out_height,
++ ilace);
++ _dispc_set_vid_size(plane, out_width, out_height);
++ _dispc_set_vid_color_conv(plane, cconv);
++ }
++
++ _dispc_set_rotation_attrs(plane, rotation, mirror, color_mode);
++
++ return 0;
++}
++
++static void _dispc_enable_plane(enum omap_plane plane, bool enable)
++{
++ REG_FLD_MOD(dispc_reg_att[plane], enable ? 1 : 0, 0, 0);
++}
++
++static void dispc_disable_isr(void *data, u32 mask)
++{
++ struct completion *compl = data;
++ complete(compl);
++}
++
++static void _enable_lcd_out(bool enable)
++{
++ REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 0, 0);
++}
++
++void dispc_enable_lcd_out(bool enable)
++{
++ struct completion frame_done_completion;
++ bool is_on;
++ int r;
++
++ enable_clocks(1);
++
++ /* When we disable LCD output, we need to wait until frame is done.
++ * Otherwise the DSS is still working, and turning off the clocks
++ * prevents DSS from going to OFF mode */
++ is_on = REG_GET(DISPC_CONTROL, 0, 0);
++
++ if (!enable && is_on) {
++ init_completion(&frame_done_completion);
++
++ r = omap_dispc_register_isr(dispc_disable_isr,
++ &frame_done_completion,
++ DISPC_IRQ_FRAMEDONE);
++
++ if (r)
++ DSSERR("failed to register FRAMEDONE isr\n");
++ }
++
++ _enable_lcd_out(enable);
++
++ if (!enable && is_on) {
++ if (!wait_for_completion_timeout(&frame_done_completion,
++ msecs_to_jiffies(100)))
++ DSSERR("timeout waiting for FRAME DONE\n");
++
++ r = omap_dispc_unregister_isr(dispc_disable_isr,
++ &frame_done_completion,
++ DISPC_IRQ_FRAMEDONE);
++
++ if (r)
++ DSSERR("failed to unregister FRAMEDONE isr\n");
++ }
++
++ enable_clocks(0);
++}
++
++static void _enable_digit_out(bool enable)
++{
++ REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 1, 1);
++}
++
++void dispc_enable_digit_out(bool enable)
++{
++ struct completion frame_done_completion;
++ int r;
++
++ enable_clocks(1);
++
++ if (REG_GET(DISPC_CONTROL, 1, 1) == enable) {
++ enable_clocks(0);
++ return;
++ }
++
++ if (enable) {
++ /* When we enable digit output, we'll get an extra digit
++ * sync lost interrupt, that we need to ignore */
++ dispc.irq_error_mask &= ~DISPC_IRQ_SYNC_LOST_DIGIT;
++ omap_dispc_set_irqs();
++ }
++
++ /* When we disable digit output, we need to wait until fields are done.
++ * Otherwise the DSS is still working, and turning off the clocks
++ * prevents DSS from going to OFF mode. And when enabling, we need to
++ * wait for the extra sync losts */
++ init_completion(&frame_done_completion);
++
++ r = omap_dispc_register_isr(dispc_disable_isr, &frame_done_completion,
++ DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD);
++ if (r)
++ DSSERR("failed to register EVSYNC isr\n");
++
++ _enable_digit_out(enable);
++
++ /* XXX I understand from TRM that we should only wait for the
++ * current field to complete. But it seems we have to wait
++ * for both fields */
++ if (!wait_for_completion_timeout(&frame_done_completion,
++ msecs_to_jiffies(100)))
++ DSSERR("timeout waiting for EVSYNC\n");
++
++ if (!wait_for_completion_timeout(&frame_done_completion,
++ msecs_to_jiffies(100)))
++ DSSERR("timeout waiting for EVSYNC\n");
++
++ r = omap_dispc_unregister_isr(dispc_disable_isr,
++ &frame_done_completion,
++ DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD);
++ if (r)
++ DSSERR("failed to unregister EVSYNC isr\n");
++
++ if (enable) {
++ dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
++ dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT);
++ omap_dispc_set_irqs();
++ }
++
++ enable_clocks(0);
++}
++
++void dispc_lcd_enable_signal_polarity(bool act_high)
++{
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONTROL, act_high ? 1 : 0, 29, 29);
++ enable_clocks(0);
++}
++
++void dispc_lcd_enable_signal(bool enable)
++{
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 28, 28);
++ enable_clocks(0);
++}
++
++void dispc_pck_free_enable(bool enable)
++{
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 27, 27);
++ enable_clocks(0);
++}
++
++void dispc_enable_fifohandcheck(bool enable)
++{
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 16, 16);
++ enable_clocks(0);
++}
++
++
++void dispc_set_lcd_display_type(enum omap_lcd_display_type type)
++{
++ int mode;
++
++ switch (type) {
++ case OMAP_DSS_LCD_DISPLAY_STN:
++ mode = 0;
++ break;
++
++ case OMAP_DSS_LCD_DISPLAY_TFT:
++ mode = 1;
++ break;
++
++ default:
++ BUG();
++ return;
++ }
++
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONTROL, mode, 3, 3);
++ enable_clocks(0);
++}
++
++void dispc_set_loadmode(enum omap_dss_load_mode mode)
++{
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONFIG, mode, 2, 1);
++ enable_clocks(0);
++}
++
++
++void dispc_set_default_color(enum omap_channel channel, u32 color)
++{
++ const struct dispc_reg def_reg[] = { DISPC_DEFAULT_COLOR0,
++ DISPC_DEFAULT_COLOR1 };
++
++ enable_clocks(1);
++ dispc_write_reg(def_reg[channel], color);
++ enable_clocks(0);
++}
++
++u32 dispc_get_default_color(enum omap_channel channel)
++{
++ const struct dispc_reg def_reg[] = { DISPC_DEFAULT_COLOR0,
++ DISPC_DEFAULT_COLOR1 };
++ u32 l;
++
++ BUG_ON(channel != OMAP_DSS_CHANNEL_DIGIT &&
++ channel != OMAP_DSS_CHANNEL_LCD);
++
++ enable_clocks(1);
++ l = dispc_read_reg(def_reg[channel]);
++ enable_clocks(0);
++
++ return l;
++}
++
++void dispc_set_trans_key(enum omap_channel ch,
++ enum omap_dss_color_key_type type,
++ u32 trans_key)
++{
++ const struct dispc_reg tr_reg[] = {
++ DISPC_TRANS_COLOR0, DISPC_TRANS_COLOR1 };
++
++ enable_clocks(1);
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ REG_FLD_MOD(DISPC_CONFIG, type, 11, 11);
++ else /* OMAP_DSS_CHANNEL_DIGIT */
++ REG_FLD_MOD(DISPC_CONFIG, type, 13, 13);
++
++ dispc_write_reg(tr_reg[ch], trans_key);
++ enable_clocks(0);
++}
++
++void dispc_get_trans_key(enum omap_channel ch,
++ enum omap_dss_color_key_type *type,
++ u32 *trans_key)
++{
++ const struct dispc_reg tr_reg[] = {
++ DISPC_TRANS_COLOR0, DISPC_TRANS_COLOR1 };
++
++ enable_clocks(1);
++ if (type) {
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ *type = REG_GET(DISPC_CONFIG, 11, 11) >> 11;
++ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
++ *type = REG_GET(DISPC_CONFIG, 13, 13) >> 13;
++ else
++ BUG();
++ }
++
++ if (trans_key)
++ *trans_key = dispc_read_reg(tr_reg[ch]);
++ enable_clocks(0);
++}
++
++void dispc_enable_trans_key(enum omap_channel ch, bool enable)
++{
++ enable_clocks(1);
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ REG_FLD_MOD(DISPC_CONFIG, enable, 10, 10);
++ else /* OMAP_DSS_CHANNEL_DIGIT */
++ REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12);
++ enable_clocks(0);
++}
++
++bool dispc_trans_key_enabled(enum omap_channel ch)
++{
++ bool enabled;
++
++ enable_clocks(1);
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ enabled = REG_GET(DISPC_CONFIG, 10, 10);
++ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
++ enabled = REG_GET(DISPC_CONFIG, 12, 12);
++ else BUG();
++ enable_clocks(0);
++
++ return enabled;
++}
++
++
++void dispc_set_tft_data_lines(u8 data_lines)
++{
++ int code;
++
++ switch (data_lines) {
++ case 12:
++ code = 0;
++ break;
++ case 16:
++ code = 1;
++ break;
++ case 18:
++ code = 2;
++ break;
++ case 24:
++ code = 3;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ enable_clocks(1);
++ REG_FLD_MOD(DISPC_CONTROL, code, 9, 8);
++ enable_clocks(0);
++}
++
++void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode)
++{
++ u32 l;
++ int stallmode;
++ int gpout0 = 1;
++ int gpout1;
++
++ switch (mode) {
++ case OMAP_DSS_PARALLELMODE_BYPASS:
++ stallmode = 0;
++ gpout1 = 1;
++ break;
++
++ case OMAP_DSS_PARALLELMODE_RFBI:
++ stallmode = 1;
++ gpout1 = 0;
++ break;
++
++ case OMAP_DSS_PARALLELMODE_DSI:
++ stallmode = 1;
++ gpout1 = 1;
++ break;
++
++ default:
++ BUG();
++ return;
++ }
++
++ enable_clocks(1);
++
++ l = dispc_read_reg(DISPC_CONTROL);
++
++ l = FLD_MOD(l, stallmode, 11, 11);
++ l = FLD_MOD(l, gpout0, 15, 15);
++ l = FLD_MOD(l, gpout1, 16, 16);
++
++ dispc_write_reg(DISPC_CONTROL, l);
++
++ enable_clocks(0);
++}
++
++static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp,
++ int vsw, int vfp, int vbp)
++{
++ u32 timing_h, timing_v;
++
++ if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
++ BUG_ON(hsw < 1 || hsw > 64);
++ BUG_ON(hfp < 1 || hfp > 256);
++ BUG_ON(hbp < 1 || hbp > 256);
++
++ BUG_ON(vsw < 1 || vsw > 64);
++ BUG_ON(vfp < 0 || vfp > 255);
++ BUG_ON(vbp < 0 || vbp > 255);
++
++ timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
++ FLD_VAL(hbp-1, 27, 20);
++
++ timing_v = FLD_VAL(vsw-1, 5, 0) | FLD_VAL(vfp, 15, 8) |
++ FLD_VAL(vbp, 27, 20);
++ } else {
++ BUG_ON(hsw < 1 || hsw > 256);
++ BUG_ON(hfp < 1 || hfp > 4096);
++ BUG_ON(hbp < 1 || hbp > 4096);
++
++ BUG_ON(vsw < 1 || vsw > 256);
++ BUG_ON(vfp < 0 || vfp > 4095);
++ BUG_ON(vbp < 0 || vbp > 4095);
++
++ timing_h = FLD_VAL(hsw-1, 7, 0) | FLD_VAL(hfp-1, 19, 8) |
++ FLD_VAL(hbp-1, 31, 20);
++
++ timing_v = FLD_VAL(vsw-1, 7, 0) | FLD_VAL(vfp, 19, 8) |
++ FLD_VAL(vbp, 31, 20);
++ }
++
++ enable_clocks(1);
++ dispc_write_reg(DISPC_TIMING_H, timing_h);
++ dispc_write_reg(DISPC_TIMING_V, timing_v);
++ enable_clocks(0);
++}
++
++/* change name to mode? */
++void dispc_set_lcd_timings(struct omap_video_timings *timings)
++{
++ unsigned xtot, ytot;
++ unsigned long ht, vt;
++
++ _dispc_set_lcd_timings(timings->hsw, timings->hfp, timings->hbp,
++ timings->vsw, timings->vfp, timings->vbp);
++
++ dispc_set_lcd_size(timings->x_res, timings->y_res);
++
++ xtot = timings->x_res + timings->hfp + timings->hsw + timings->hbp;
++ ytot = timings->y_res + timings->vfp + timings->vsw + timings->vbp;
++
++ ht = (timings->pixel_clock * 1000) / xtot;
++ vt = (timings->pixel_clock * 1000) / xtot / ytot;
++
++ DSSDBG("xres %u yres %u\n", timings->x_res, timings->y_res);
++ DSSDBG("pck %u\n", timings->pixel_clock);
++ DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n",
++ timings->hsw, timings->hfp, timings->hbp,
++ timings->vsw, timings->vfp, timings->vbp);
++
++ DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt);
++}
++
++void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div)
++{
++ BUG_ON(lck_div < 1);
++ BUG_ON(pck_div < 2);
++
++ enable_clocks(1);
++ dispc_write_reg(DISPC_DIVISOR,
++ FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0));
++ enable_clocks(0);
++}
++
++static void dispc_get_lcd_divisor(int *lck_div, int *pck_div)
++{
++ u32 l;
++ l = dispc_read_reg(DISPC_DIVISOR);
++ *lck_div = FLD_GET(l, 23, 16);
++ *pck_div = FLD_GET(l, 7, 0);
++}
++
++unsigned long dispc_fclk_rate(void)
++{
++ unsigned long r = 0;
++
++ if (dss_get_dispc_clk_source() == 0)
++ r = dss_clk_get_rate(DSS_CLK_FCK1);
++ else
++#ifdef CONFIG_OMAP2_DSS_DSI
++ r = dsi_get_dsi1_pll_rate();
++#else
++ BUG();
++#endif
++ return r;
++}
++
++unsigned long dispc_pclk_rate(void)
++{
++ int lcd, pcd;
++ unsigned long r;
++ u32 l;
++
++ l = dispc_read_reg(DISPC_DIVISOR);
++
++ lcd = FLD_GET(l, 23, 16);
++ pcd = FLD_GET(l, 7, 0);
++
++ r = dispc_fclk_rate();
++
++ return r / lcd / pcd;
++}
++
++void dispc_dump_clocks(struct seq_file *s)
++{
++ int lcd, pcd;
++
++ enable_clocks(1);
++
++ dispc_get_lcd_divisor(&lcd, &pcd);
++
++ seq_printf(s, "- dispc -\n");
++
++ seq_printf(s, "dispc fclk source = %s\n",
++ dss_get_dispc_clk_source() == 0 ?
++ "dss1_alwon_fclk" : "dsi1_pll_fclk");
++
++ seq_printf(s, "pixel clk = %lu / %d / %d = %lu\n",
++ dispc_fclk_rate(),
++ lcd, pcd,
++ dispc_pclk_rate());
++
++ enable_clocks(0);
++}
++
++void dispc_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dispc_read_reg(r))
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ DUMPREG(DISPC_REVISION);
++ DUMPREG(DISPC_SYSCONFIG);
++ DUMPREG(DISPC_SYSSTATUS);
++ DUMPREG(DISPC_IRQSTATUS);
++ DUMPREG(DISPC_IRQENABLE);
++ DUMPREG(DISPC_CONTROL);
++ DUMPREG(DISPC_CONFIG);
++ DUMPREG(DISPC_CAPABLE);
++ DUMPREG(DISPC_DEFAULT_COLOR0);
++ DUMPREG(DISPC_DEFAULT_COLOR1);
++ DUMPREG(DISPC_TRANS_COLOR0);
++ DUMPREG(DISPC_TRANS_COLOR1);
++ DUMPREG(DISPC_LINE_STATUS);
++ DUMPREG(DISPC_LINE_NUMBER);
++ DUMPREG(DISPC_TIMING_H);
++ DUMPREG(DISPC_TIMING_V);
++ DUMPREG(DISPC_POL_FREQ);
++ DUMPREG(DISPC_DIVISOR);
++ DUMPREG(DISPC_GLOBAL_ALPHA);
++ DUMPREG(DISPC_SIZE_DIG);
++ DUMPREG(DISPC_SIZE_LCD);
++
++ DUMPREG(DISPC_GFX_BA0);
++ DUMPREG(DISPC_GFX_BA1);
++ DUMPREG(DISPC_GFX_POSITION);
++ DUMPREG(DISPC_GFX_SIZE);
++ DUMPREG(DISPC_GFX_ATTRIBUTES);
++ DUMPREG(DISPC_GFX_FIFO_THRESHOLD);
++ DUMPREG(DISPC_GFX_FIFO_SIZE_STATUS);
++ DUMPREG(DISPC_GFX_ROW_INC);
++ DUMPREG(DISPC_GFX_PIXEL_INC);
++ DUMPREG(DISPC_GFX_WINDOW_SKIP);
++ DUMPREG(DISPC_GFX_TABLE_BA);
++
++ DUMPREG(DISPC_DATA_CYCLE1);
++ DUMPREG(DISPC_DATA_CYCLE2);
++ DUMPREG(DISPC_DATA_CYCLE3);
++
++ DUMPREG(DISPC_CPR_COEF_R);
++ DUMPREG(DISPC_CPR_COEF_G);
++ DUMPREG(DISPC_CPR_COEF_B);
++
++ DUMPREG(DISPC_GFX_PRELOAD);
++
++ DUMPREG(DISPC_VID_BA0(0));
++ DUMPREG(DISPC_VID_BA1(0));
++ DUMPREG(DISPC_VID_POSITION(0));
++ DUMPREG(DISPC_VID_SIZE(0));
++ DUMPREG(DISPC_VID_ATTRIBUTES(0));
++ DUMPREG(DISPC_VID_FIFO_THRESHOLD(0));
++ DUMPREG(DISPC_VID_FIFO_SIZE_STATUS(0));
++ DUMPREG(DISPC_VID_ROW_INC(0));
++ DUMPREG(DISPC_VID_PIXEL_INC(0));
++ DUMPREG(DISPC_VID_FIR(0));
++ DUMPREG(DISPC_VID_PICTURE_SIZE(0));
++ DUMPREG(DISPC_VID_ACCU0(0));
++ DUMPREG(DISPC_VID_ACCU1(0));
++
++ DUMPREG(DISPC_VID_BA0(1));
++ DUMPREG(DISPC_VID_BA1(1));
++ DUMPREG(DISPC_VID_POSITION(1));
++ DUMPREG(DISPC_VID_SIZE(1));
++ DUMPREG(DISPC_VID_ATTRIBUTES(1));
++ DUMPREG(DISPC_VID_FIFO_THRESHOLD(1));
++ DUMPREG(DISPC_VID_FIFO_SIZE_STATUS(1));
++ DUMPREG(DISPC_VID_ROW_INC(1));
++ DUMPREG(DISPC_VID_PIXEL_INC(1));
++ DUMPREG(DISPC_VID_FIR(1));
++ DUMPREG(DISPC_VID_PICTURE_SIZE(1));
++ DUMPREG(DISPC_VID_ACCU0(1));
++ DUMPREG(DISPC_VID_ACCU1(1));
++
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_H(0, 7));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(0, 7));
++ DUMPREG(DISPC_VID_CONV_COEF(0, 0));
++ DUMPREG(DISPC_VID_CONV_COEF(0, 1));
++ DUMPREG(DISPC_VID_CONV_COEF(0, 2));
++ DUMPREG(DISPC_VID_CONV_COEF(0, 3));
++ DUMPREG(DISPC_VID_CONV_COEF(0, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_V(0, 7));
++
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_H(1, 7));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_HV(1, 7));
++ DUMPREG(DISPC_VID_CONV_COEF(1, 0));
++ DUMPREG(DISPC_VID_CONV_COEF(1, 1));
++ DUMPREG(DISPC_VID_CONV_COEF(1, 2));
++ DUMPREG(DISPC_VID_CONV_COEF(1, 3));
++ DUMPREG(DISPC_VID_CONV_COEF(1, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 0));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 1));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 2));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 3));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 4));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 5));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 6));
++ DUMPREG(DISPC_VID_FIR_COEF_V(1, 7));
++
++ DUMPREG(DISPC_VID_PRELOAD(0));
++ DUMPREG(DISPC_VID_PRELOAD(1));
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++#undef DUMPREG
++}
++
++static void _dispc_set_pol_freq(bool onoff, bool rf, bool ieo, bool ipc,
++ bool ihs, bool ivs, u8 acbi, u8 acb)
++{
++ u32 l = 0;
++
++ DSSDBG("onoff %d rf %d ieo %d ipc %d ihs %d ivs %d acbi %d acb %d\n",
++ onoff, rf, ieo, ipc, ihs, ivs, acbi, acb);
++
++ l |= FLD_VAL(onoff, 17, 17);
++ l |= FLD_VAL(rf, 16, 16);
++ l |= FLD_VAL(ieo, 15, 15);
++ l |= FLD_VAL(ipc, 14, 14);
++ l |= FLD_VAL(ihs, 13, 13);
++ l |= FLD_VAL(ivs, 12, 12);
++ l |= FLD_VAL(acbi, 11, 8);
++ l |= FLD_VAL(acb, 7, 0);
++
++ enable_clocks(1);
++ dispc_write_reg(DISPC_POL_FREQ, l);
++ enable_clocks(0);
++}
++
++void dispc_set_pol_freq(struct omap_panel *panel)
++{
++ _dispc_set_pol_freq((panel->config & OMAP_DSS_LCD_ONOFF) != 0,
++ (panel->config & OMAP_DSS_LCD_RF) != 0,
++ (panel->config & OMAP_DSS_LCD_IEO) != 0,
++ (panel->config & OMAP_DSS_LCD_IPC) != 0,
++ (panel->config & OMAP_DSS_LCD_IHS) != 0,
++ (panel->config & OMAP_DSS_LCD_IVS) != 0,
++ panel->acbi, panel->acb);
++}
++
++void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
++ u16 *lck_div, u16 *pck_div)
++{
++ u16 pcd_min = is_tft ? 2 : 3;
++ unsigned long best_pck;
++ u16 best_ld, cur_ld;
++ u16 best_pd, cur_pd;
++
++ best_pck = 0;
++ best_ld = 0;
++ best_pd = 0;
++
++ for (cur_ld = 1; cur_ld <= 255; ++cur_ld) {
++ unsigned long lck = fck / cur_ld;
++
++ for (cur_pd = pcd_min; cur_pd <= 255; ++cur_pd) {
++ unsigned long pck = lck / cur_pd;
++ long old_delta = abs(best_pck - req_pck);
++ long new_delta = abs(pck - req_pck);
++
++ if (best_pck == 0 || new_delta < old_delta) {
++ best_pck = pck;
++ best_ld = cur_ld;
++ best_pd = cur_pd;
++
++ if (pck == req_pck)
++ goto found;
++ }
++
++ if (pck < req_pck)
++ break;
++ }
++
++ if (lck / pcd_min < req_pck)
++ break;
++ }
++
++found:
++ *lck_div = best_ld;
++ *pck_div = best_pd;
++}
++
++int dispc_calc_clock_div(bool is_tft, unsigned long req_pck,
++ struct dispc_clock_info *cinfo)
++{
++ unsigned long prate;
++ struct dispc_clock_info cur, best;
++ int match = 0;
++ int min_fck_per_pck;
++ unsigned long fck_rate = dss_clk_get_rate(DSS_CLK_FCK1);
++
++ if (cpu_is_omap34xx())
++ prate = clk_get_rate(clk_get_parent(dispc.dpll4_m4_ck));
++ else
++ prate = 0;
++
++ if (req_pck == dispc.cache_req_pck &&
++ ((cpu_is_omap34xx() && prate == dispc.cache_prate) ||
++ dispc.cache_cinfo.fck == fck_rate)) {
++ DSSDBG("dispc clock info found from cache.\n");
++ *cinfo = dispc.cache_cinfo;
++ return 0;
++ }
++
++ min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
++
++ if (min_fck_per_pck &&
++ req_pck * min_fck_per_pck > DISPC_MAX_FCK) {
++ DSSERR("Requested pixel clock not possible with the current "
++ "OMAP2_DSS_MIN_FCK_PER_PCK setting. Turning "
++ "the constraint off.\n");
++ min_fck_per_pck = 0;
++ }
++
++retry:
++ memset(&cur, 0, sizeof(cur));
++ memset(&best, 0, sizeof(best));
++
++ if (cpu_is_omap24xx()) {
++ /* XXX can we change the clock on omap2? */
++ cur.fck = dss_clk_get_rate(DSS_CLK_FCK1);
++ cur.fck_div = 1;
++
++ match = 1;
++
++ find_lck_pck_divs(is_tft, req_pck, cur.fck,
++ &cur.lck_div, &cur.pck_div);
++
++ cur.lck = cur.fck / cur.lck_div;
++ cur.pck = cur.lck / cur.pck_div;
++
++ best = cur;
++
++ goto found;
++ } else if (cpu_is_omap34xx()) {
++ for (cur.fck_div = 16; cur.fck_div > 0; --cur.fck_div) {
++ cur.fck = prate / cur.fck_div * 2;
++
++ if (cur.fck > DISPC_MAX_FCK)
++ continue;
++
++ if (min_fck_per_pck &&
++ cur.fck < req_pck * min_fck_per_pck)
++ continue;
++
++ match = 1;
++
++ find_lck_pck_divs(is_tft, req_pck, cur.fck,
++ &cur.lck_div, &cur.pck_div);
++
++ cur.lck = cur.fck / cur.lck_div;
++ cur.pck = cur.lck / cur.pck_div;
++
++ if (abs(cur.pck - req_pck) < abs(best.pck - req_pck)) {
++ best = cur;
++
++ if (cur.pck == req_pck)
++ goto found;
++ }
++ }
++ } else {
++ BUG();
++ }
++
++found:
++ if (!match) {
++ if (min_fck_per_pck) {
++ DSSERR("Could not find suitable clock settings.\n"
++ "Turning FCK/PCK constraint off and"
++ "trying again.\n");
++ min_fck_per_pck = 0;
++ goto retry;
++ }
++
++ DSSERR("Could not find suitable clock settings.\n");
++
++ return -EINVAL;
++ }
++
++ if (cinfo)
++ *cinfo = best;
++
++ dispc.cache_req_pck = req_pck;
++ dispc.cache_prate = prate;
++ dispc.cache_cinfo = best;
++
++ return 0;
++}
++
++int dispc_set_clock_div(struct dispc_clock_info *cinfo)
++{
++ unsigned long prate;
++ int r;
++
++ if (cpu_is_omap34xx()) {
++ prate = clk_get_rate(clk_get_parent(dispc.dpll4_m4_ck));
++ DSSDBG("dpll4_m4 = %ld\n", prate);
++ }
++
++ DSSDBG("fck = %ld (%d)\n", cinfo->fck, cinfo->fck_div);
++ DSSDBG("lck = %ld (%d)\n", cinfo->lck, cinfo->lck_div);
++ DSSDBG("pck = %ld (%d)\n", cinfo->pck, cinfo->pck_div);
++
++ if (cpu_is_omap34xx()) {
++ r = clk_set_rate(dispc.dpll4_m4_ck, prate / cinfo->fck_div);
++ if (r)
++ return r;
++ }
++
++ dispc_set_lcd_divisor(cinfo->lck_div, cinfo->pck_div);
++
++ return 0;
++}
++
++int dispc_get_clock_div(struct dispc_clock_info *cinfo)
++{
++ cinfo->fck = dss_clk_get_rate(DSS_CLK_FCK1);
++
++ if (cpu_is_omap34xx()) {
++ unsigned long prate;
++ prate = clk_get_rate(clk_get_parent(dispc.dpll4_m4_ck));
++ cinfo->fck_div = prate / (cinfo->fck / 2);
++ } else {
++ cinfo->fck_div = 0;
++ }
++
++ cinfo->lck_div = REG_GET(DISPC_DIVISOR, 23, 16);
++ cinfo->pck_div = REG_GET(DISPC_DIVISOR, 7, 0);
++
++ cinfo->lck = cinfo->fck / cinfo->lck_div;
++ cinfo->pck = cinfo->lck / cinfo->pck_div;
++
++ return 0;
++}
++
++static void omap_dispc_set_irqs(void)
++{
++ unsigned long flags;
++ u32 mask = dispc.irq_error_mask;
++ int i;
++ struct omap_dispc_isr_data *isr_data;
++
++ spin_lock_irqsave(&dispc.irq_lock, flags);
++
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ isr_data = &dispc.registered_isr[i];
++
++ if (isr_data->isr == NULL)
++ continue;
++
++ mask |= isr_data->mask;
++ }
++
++ enable_clocks(1);
++ dispc_write_reg(DISPC_IRQENABLE, mask);
++ enable_clocks(0);
++
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
++}
++
++int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
++{
++ int i;
++ int ret;
++ unsigned long flags;
++ struct omap_dispc_isr_data *isr_data;
++
++ if (isr == NULL)
++ return -EINVAL;
++
++ spin_lock_irqsave(&dispc.irq_lock, flags);
++
++ /* check for duplicate entry */
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ isr_data = &dispc.registered_isr[i];
++ if (isr_data->isr == isr && isr_data->arg == arg &&
++ isr_data->mask == mask) {
++ ret = -EINVAL;
++ goto err;
++ }
++ }
++
++ isr_data = NULL;
++ ret = -EBUSY;
++
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ isr_data = &dispc.registered_isr[i];
++
++ if (isr_data->isr != NULL)
++ continue;
++
++ isr_data->isr = isr;
++ isr_data->arg = arg;
++ isr_data->mask = mask;
++ ret = 0;
++
++ break;
++ }
++err:
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
++
++ if (ret == 0)
++ omap_dispc_set_irqs();
++
++ return ret;
++}
++EXPORT_SYMBOL(omap_dispc_register_isr);
++
++int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
++{
++ int i;
++ unsigned long flags;
++ int ret = -EINVAL;
++ struct omap_dispc_isr_data *isr_data;
++
++ spin_lock_irqsave(&dispc.irq_lock, flags);
++
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ isr_data = &dispc.registered_isr[i];
++ if (isr_data->isr != isr || isr_data->arg != arg ||
++ isr_data->mask != mask)
++ continue;
++
++ /* found the correct isr */
++
++ isr_data->isr = NULL;
++ isr_data->arg = NULL;
++ isr_data->mask = 0;
++
++ ret = 0;
++ break;
++ }
++
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
++
++ if (ret == 0)
++ omap_dispc_set_irqs();
++
++ return ret;
++}
++EXPORT_SYMBOL(omap_dispc_unregister_isr);
++
++#ifdef DEBUG
++static void print_irq_status(u32 status)
++{
++ if ((status & dispc.irq_error_mask) == 0)
++ return;
++
++ printk(KERN_DEBUG "DISPC IRQ: 0x%x: ", status);
++
++#define PIS(x) \
++ if (status & DISPC_IRQ_##x) \
++ printk(#x " ");
++ PIS(GFX_FIFO_UNDERFLOW);
++ PIS(OCP_ERR);
++ PIS(VID1_FIFO_UNDERFLOW);
++ PIS(VID2_FIFO_UNDERFLOW);
++ PIS(SYNC_LOST);
++ PIS(SYNC_LOST_DIGIT);
++#undef PIS
++
++ printk("\n");
++}
++#endif
++
++/* Called from dss.c. Note that we don't touch clocks here,
++ * but we presume they are on because we got an IRQ. However,
++ * an irq handler may turn the clocks off, so we may not have
++ * clock later in the function. */
++void dispc_irq_handler(void)
++{
++ int i;
++ u32 irqstatus = dispc_read_reg(DISPC_IRQSTATUS);
++ u32 handledirqs = 0;
++ u32 unhandled_errors;
++ struct omap_dispc_isr_data *isr_data;
++
++#ifdef DEBUG
++ if (dss_debug)
++ print_irq_status(irqstatus);
++#endif
++ /* Ack the interrupt. Do it here before clocks are possibly turned
++ * off */
++ dispc_write_reg(DISPC_IRQSTATUS, irqstatus);
++
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ isr_data = &dispc.registered_isr[i];
++
++ if (!isr_data->isr)
++ continue;
++
++ if (isr_data->mask & irqstatus) {
++ isr_data->isr(isr_data->arg, irqstatus);
++ handledirqs |= isr_data->mask;
++ }
++ }
++
++ unhandled_errors = irqstatus & ~handledirqs & dispc.irq_error_mask;
++
++ if (unhandled_errors) {
++ spin_lock(&dispc.error_lock);
++ dispc.error_irqs |= unhandled_errors;
++ spin_unlock(&dispc.error_lock);
++
++ dispc.irq_error_mask &= ~unhandled_errors;
++ omap_dispc_set_irqs();
++
++ schedule_work(&dispc.error_work);
++ }
++}
++
++static void dispc_error_worker(struct work_struct *work)
++{
++ int i;
++ u32 errors;
++ unsigned long flags;
++
++ spin_lock_irqsave(&dispc.error_lock, flags);
++ errors = dispc.error_irqs;
++ dispc.error_irqs = 0;
++ spin_unlock_irqrestore(&dispc.error_lock, flags);
++
++ if (errors & DISPC_IRQ_GFX_FIFO_UNDERFLOW) {
++ DSSERR("GFX_FIFO_UNDERFLOW, disabling GFX\n");
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (ovl->id == 0) {
++ dispc_enable_plane(ovl->id, 0);
++ dispc_go(ovl->manager->id);
++ mdelay(50);
++ break;
++ }
++ }
++ }
++
++ if (errors & DISPC_IRQ_VID1_FIFO_UNDERFLOW) {
++ DSSERR("VID1_FIFO_UNDERFLOW, disabling VID1\n");
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (ovl->id == 1) {
++ dispc_enable_plane(ovl->id, 0);
++ dispc_go(ovl->manager->id);
++ mdelay(50);
++ break;
++ }
++ }
++ }
++
++ if (errors & DISPC_IRQ_VID2_FIFO_UNDERFLOW) {
++ DSSERR("VID2_FIFO_UNDERFLOW, disabling VID2\n");
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (ovl->id == 2) {
++ dispc_enable_plane(ovl->id, 0);
++ dispc_go(ovl->manager->id);
++ mdelay(50);
++ break;
++ }
++ }
++ }
++
++ if (errors & DISPC_IRQ_SYNC_LOST) {
++ DSSERR("SYNC_LOST, disabling LCD\n");
++ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
++ struct omap_overlay_manager *mgr;
++ mgr = omap_dss_get_overlay_manager(i);
++
++ if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
++ mgr->display->disable(mgr->display);
++ break;
++ }
++ }
++ }
++
++ if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
++ DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
++ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
++ struct omap_overlay_manager *mgr;
++ mgr = omap_dss_get_overlay_manager(i);
++
++ if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
++ mgr->display->disable(mgr->display);
++ break;
++ }
++ }
++ }
++
++ if (errors & DISPC_IRQ_OCP_ERR) {
++ DSSERR("OCP_ERR\n");
++ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
++ struct omap_overlay_manager *mgr;
++ mgr = omap_dss_get_overlay_manager(i);
++
++ if (mgr->caps & OMAP_DSS_OVL_CAP_DISPC)
++ mgr->display->disable(mgr->display);
++ }
++ }
++
++ dispc.irq_error_mask |= errors;
++ omap_dispc_set_irqs();
++}
++
++int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
++{
++ void dispc_irq_wait_handler(void *data, u32 mask)
++ {
++ complete((struct completion *)data);
++ }
++
++ int r;
++ DECLARE_COMPLETION_ONSTACK(completion);
++
++ r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
++ irqmask);
++
++ if (r)
++ return r;
++
++ timeout = wait_for_completion_timeout(&completion, timeout);
++
++ omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
++
++ if (timeout == 0)
++ return -ETIMEDOUT;
++
++ if (timeout == -ERESTARTSYS)
++ return -ERESTARTSYS;
++
++ return 0;
++}
++
++int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
++ unsigned long timeout)
++{
++ void dispc_irq_wait_handler(void *data, u32 mask)
++ {
++ complete((struct completion *)data);
++ }
++
++ int r;
++ DECLARE_COMPLETION_ONSTACK(completion);
++
++ r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
++ irqmask);
++
++ if (r)
++ return r;
++
++ timeout = wait_for_completion_interruptible_timeout(&completion,
++ timeout);
++
++ omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
++
++ if (timeout == 0)
++ return -ETIMEDOUT;
++
++ if (timeout == -ERESTARTSYS)
++ return -ERESTARTSYS;
++
++ return 0;
++}
++
++#ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
++void dispc_fake_vsync_irq(void)
++{
++ u32 irqstatus = DISPC_IRQ_VSYNC;
++ int i;
++
++ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
++ struct omap_dispc_isr_data *isr_data;
++ isr_data = &dispc.registered_isr[i];
++
++ if (!isr_data->isr)
++ continue;
++
++ if (isr_data->mask & irqstatus)
++ isr_data->isr(isr_data->arg, irqstatus);
++ }
++}
++#endif
++
++static void _omap_dispc_initialize_irq(void)
++{
++ memset(dispc.registered_isr, 0, sizeof(dispc.registered_isr));
++
++ dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
++
++ /* there's SYNC_LOST_DIGIT waiting after enabling the DSS,
++ * so clear it */
++ dispc_write_reg(DISPC_IRQSTATUS, dispc_read_reg(DISPC_IRQSTATUS));
++
++ omap_dispc_set_irqs();
++}
++
++static void _omap_dispc_initial_config(void)
++{
++ u32 l;
++
++ l = dispc_read_reg(DISPC_SYSCONFIG);
++ l = FLD_MOD(l, 2, 13, 12); /* MIDLEMODE: smart standby */
++ l = FLD_MOD(l, 2, 4, 3); /* SIDLEMODE: smart idle */
++ l = FLD_MOD(l, 1, 2, 2); /* ENWAKEUP */
++ l = FLD_MOD(l, 1, 0, 0); /* AUTOIDLE */
++ dispc_write_reg(DISPC_SYSCONFIG, l);
++
++ /* FUNCGATED */
++ REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9);
++
++ /* L3 firewall setting: enable access to OCM RAM */
++ if (cpu_is_omap24xx())
++ __raw_writel(0x402000b0, IO_ADDRESS(0x680050a0));
++
++ _dispc_setup_color_conv_coef();
++
++ dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);
++}
++
++int dispc_init(void)
++{
++ u32 rev;
++
++ spin_lock_init(&dispc.irq_lock);
++ spin_lock_init(&dispc.error_lock);
++
++ INIT_WORK(&dispc.error_work, dispc_error_worker);
++
++ dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
++ if (!dispc.base) {
++ DSSERR("can't ioremap DISPC\n");
++ return -ENOMEM;
++ }
++
++ if (cpu_is_omap34xx()) {
++ dispc.dpll4_m4_ck = clk_get(NULL, "dpll4_m4_ck");
++ if (IS_ERR(dispc.dpll4_m4_ck)) {
++ DSSERR("Failed to get dpll4_m4_ck\n");
++ return -ENODEV;
++ }
++ }
++
++ enable_clocks(1);
++
++ _omap_dispc_initial_config();
++
++ _omap_dispc_initialize_irq();
++
++ dispc_save_context();
++
++ rev = dispc_read_reg(DISPC_REVISION);
++ printk(KERN_INFO "OMAP DISPC rev %d.%d\n",
++ FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
++
++ enable_clocks(0);
++
++ return 0;
++}
++
++void dispc_exit(void)
++{
++ if (cpu_is_omap34xx())
++ clk_put(dispc.dpll4_m4_ck);
++ iounmap(dispc.base);
++}
++
++int dispc_enable_plane(enum omap_plane plane, bool enable)
++{
++ DSSDBG("dispc_enable_plane %d, %d\n", plane, enable);
++
++ enable_clocks(1);
++ _dispc_enable_plane(plane, enable);
++ enable_clocks(0);
++
++ return 0;
++}
++
++int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
++ u32 paddr, u16 screen_width,
++ u16 pos_x, u16 pos_y,
++ u16 width, u16 height,
++ u16 out_width, u16 out_height,
++ enum omap_color_mode color_mode,
++ bool ilace,
++ u8 rotation, bool mirror)
++{
++ int r = 0;
++
++ DSSDBG("dispc_setup_plane %d, ch %d, pa %x, sw %d, %d,%d, %dx%d -> "
++ "%dx%d, ilace %d, cmode %x, rot %d, mir %d\n",
++ plane, channel_out, paddr, screen_width, pos_x, pos_y,
++ width, height,
++ out_width, out_height,
++ ilace, color_mode,
++ rotation, mirror);
++
++ enable_clocks(1);
++
++ r = _dispc_setup_plane(plane, channel_out,
++ paddr, screen_width,
++ pos_x, pos_y,
++ width, height,
++ out_width, out_height,
++ color_mode, ilace,
++ rotation, mirror);
++
++ enable_clocks(0);
++
++ return r;
++}
++
++static int dispc_is_intersecting(int x1, int y1, int w1, int h1,
++ int x2, int y2, int w2, int h2)
++{
++ if (x1 >= (x2+w2))
++ return 0;
++
++ if ((x1+w1) <= x2)
++ return 0;
++
++ if (y1 >= (y2+h2))
++ return 0;
++
++ if ((y1+h1) <= y2)
++ return 0;
++
++ return 1;
++}
++
++static int dispc_is_overlay_scaled(struct omap_overlay_info *pi)
++{
++ if (pi->width != pi->out_width)
++ return 1;
++
++ if (pi->height != pi->out_height)
++ return 1;
++
++ return 0;
++}
++
++/* returns the area that needs updating */
++void dispc_setup_partial_planes(struct omap_display *display,
++ u16 *xi, u16 *yi, u16 *wi, u16 *hi)
++{
++ struct omap_overlay_manager *mgr;
++ int i;
++
++ int x, y, w, h;
++
++ x = *xi;
++ y = *yi;
++ w = *wi;
++ h = *hi;
++
++ DSSDBG("dispc_setup_partial_planes %d,%d %dx%d\n",
++ *xi, *yi, *wi, *hi);
++
++
++ mgr = display->manager;
++
++ if (!mgr) {
++ DSSDBG("no manager\n");
++ return;
++ }
++
++ for (i = 0; i < mgr->num_overlays; i++) {
++ struct omap_overlay *ovl;
++ struct omap_overlay_info *pi;
++ ovl = mgr->overlays[i];
++
++ if (ovl->manager != mgr)
++ continue;
++
++ if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0)
++ continue;
++
++ pi = &ovl->info;
++
++ if (!pi->enabled)
++ continue;
++ /*
++ * If the plane is intersecting and scaled, we
++ * enlarge the update region to accomodate the
++ * whole area
++ */
++
++ if (dispc_is_intersecting(x, y, w, h,
++ pi->pos_x, pi->pos_y,
++ pi->out_width, pi->out_height)) {
++ if (dispc_is_overlay_scaled(pi)) {
++
++ int x1, y1, x2, y2;
++
++ if (x > pi->pos_x)
++ x1 = pi->pos_x;
++ else
++ x1 = x;
++
++ if (y > pi->pos_y)
++ y1 = pi->pos_y;
++ else
++ y1 = y;
++
++ if ((x + w) < (pi->pos_x + pi->out_width))
++ x2 = pi->pos_x + pi->out_width;
++ else
++ x2 = x + w;
++
++ if ((y + h) < (pi->pos_y + pi->out_height))
++ y2 = pi->pos_y + pi->out_height;
++ else
++ y2 = y + h;
++
++ x = x1;
++ y = y1;
++ w = x2 - x1;
++ h = y2 - y1;
++
++ DSSDBG("Update area after enlarge due to "
++ "scaling %d, %d %dx%d\n",
++ x, y, w, h);
++ }
++ }
++ }
++
++ for (i = 0; i < mgr->num_overlays; i++) {
++ struct omap_overlay *ovl = mgr->overlays[i];
++ struct omap_overlay_info *pi = &ovl->info;
++
++ int px = pi->pos_x;
++ int py = pi->pos_y;
++ int pw = pi->width;
++ int ph = pi->height;
++ int pow = pi->out_width;
++ int poh = pi->out_height;
++ u32 pa = pi->paddr;
++ int psw = pi->screen_width;
++ int bpp;
++
++ if (ovl->manager != mgr)
++ continue;
++
++ /*
++ * If plane is not enabled or the update region
++ * does not intersect with the plane in question,
++ * we really disable the plane from hardware
++ */
++
++ if (!pi->enabled ||
++ !dispc_is_intersecting(x, y, w, h,
++ px, py, pow, poh)) {
++ dispc_enable_plane(ovl->id, 0);
++ continue;
++ }
++
++ switch (pi->color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_ARGB16:
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ bpp = 16;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24P:
++ bpp = 24;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ bpp = 32;
++ break;
++
++ default:
++ BUG();
++ return;
++ }
++
++ if (x > pi->pos_x) {
++ px = 0;
++ pw -= (x - pi->pos_x);
++ pa += (x - pi->pos_x) * bpp / 8;
++ } else {
++ px = pi->pos_x - x;
++ }
++
++ if (y > pi->pos_y) {
++ py = 0;
++ ph -= (y - pi->pos_y);
++ pa += (y - pi->pos_y) * psw * bpp / 8;
++ } else {
++ py = pi->pos_y - y;
++ }
++
++ if (w < (px+pw))
++ pw -= (px+pw) - (w);
++
++ if (h < (py+ph))
++ ph -= (py+ph) - (h);
++
++ /* Can't scale the GFX plane */
++ if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0 ||
++ dispc_is_overlay_scaled(pi) == 0) {
++ pow = pw;
++ poh = ph;
++ }
++
++ DSSDBG("calc plane %d, %x, sw %d, %d,%d, %dx%d -> %dx%d\n",
++ ovl->id, pa, psw, px, py, pw, ph, pow, poh);
++
++ dispc_setup_plane(ovl->id, mgr->id,
++ pa, psw,
++ px, py,
++ pw, ph,
++ pow, poh,
++ pi->color_mode, 0,
++ pi->rotation, // XXX rotation probably wrong
++ pi->mirror);
++
++ dispc_enable_plane(ovl->id, 1);
++ }
++
++ *xi = x;
++ *yi = y;
++ *wi = w;
++ *hi = h;
++
++}
++
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+new file mode 100644
+index 0000000..9aaf392
+--- /dev/null
++++ b/drivers/video/omap2/dss/display.c
+@@ -0,0 +1,693 @@
++/*
++ * linux/drivers/video/omap2/dss/display.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "DISPLAY"
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/jiffies.h>
++#include <linux/list.h>
++#include <linux/platform_device.h>
++
++#include <mach/display.h>
++#include "dss.h"
++
++static int num_displays;
++static LIST_HEAD(display_list);
++
++static ssize_t display_name_show(struct omap_display *display, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n", display->name);
++}
++
++static ssize_t display_enabled_show(struct omap_display *display, char *buf)
++{
++ bool enabled = display->state != OMAP_DSS_DISPLAY_DISABLED;
++
++ return snprintf(buf, PAGE_SIZE, "%d\n", enabled);
++}
++
++static ssize_t display_enabled_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ bool enabled, r;
++
++ enabled = simple_strtoul(buf, NULL, 10);
++
++ if (enabled != (display->state != OMAP_DSS_DISPLAY_DISABLED)) {
++ if (enabled) {
++ r = display->enable(display);
++ if (r)
++ return r;
++ } else {
++ display->disable(display);
++ }
++ }
++
++ return size;
++}
++
++static ssize_t display_upd_mode_show(struct omap_display *display, char *buf)
++{
++ enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO;
++ if (display->get_update_mode)
++ mode = display->get_update_mode(display);
++ return snprintf(buf, PAGE_SIZE, "%d\n", mode);
++}
++
++static ssize_t display_upd_mode_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ int val, r;
++ enum omap_dss_update_mode mode;
++
++ val = simple_strtoul(buf, NULL, 10);
++
++ switch (val) {
++ case OMAP_DSS_UPDATE_DISABLED:
++ case OMAP_DSS_UPDATE_AUTO:
++ case OMAP_DSS_UPDATE_MANUAL:
++ mode = (enum omap_dss_update_mode)val;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ if ((r = display->set_update_mode(display, mode)))
++ return r;
++
++ return size;
++}
++
++static ssize_t display_tear_show(struct omap_display *display, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n",
++ display->get_te ? display->get_te(display) : 0);
++}
++
++static ssize_t display_tear_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ unsigned long te;
++ int r;
++
++ if (!display->enable_te || !display->get_te)
++ return -ENOENT;
++
++ te = simple_strtoul(buf, NULL, 0);
++
++ if ((r = display->enable_te(display, te)))
++ return r;
++
++ return size;
++}
++
++static ssize_t display_timings_show(struct omap_display *display, char *buf)
++{
++ struct omap_video_timings t;
++
++ if (!display->get_timings)
++ return -ENOENT;
++
++ display->get_timings(display, &t);
++
++ return snprintf(buf, PAGE_SIZE, "%u,%u/%u/%u/%u,%u/%u/%u/%u\n",
++ t.pixel_clock,
++ t.x_res, t.hfp, t.hbp, t.hsw,
++ t.y_res, t.vfp, t.vbp, t.vsw);
++}
++
++static ssize_t display_timings_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ struct omap_video_timings t;
++ int r, found;
++
++ if (!display->set_timings || !display->check_timings)
++ return -ENOENT;
++
++ found = 0;
++#ifdef CONFIG_OMAP2_DSS_VENC
++ if (strncmp("pal", buf, 3) == 0) {
++ t = omap_dss_pal_timings;
++ found = 1;
++ } else if (strncmp("ntsc", buf, 4) == 0) {
++ t = omap_dss_ntsc_timings;
++ found = 1;
++ }
++#endif
++ if (!found && sscanf(buf, "%u,%hu/%hu/%hu/%hu,%hu/%hu/%hu/%hu",
++ &t.pixel_clock,
++ &t.x_res, &t.hfp, &t.hbp, &t.hsw,
++ &t.y_res, &t.vfp, &t.vbp, &t.vsw) != 9)
++ return -EINVAL;
++
++ if ((r = display->check_timings(display, &t)))
++ return r;
++
++ display->set_timings(display, &t);
++
++ return size;
++}
++
++static ssize_t display_rotate_show(struct omap_display *display, char *buf)
++{
++ int rotate;
++ if (!display->get_rotate)
++ return -ENOENT;
++ rotate = display->get_rotate(display);
++ return snprintf(buf, PAGE_SIZE, "%u\n", rotate);
++}
++
++static ssize_t display_rotate_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ unsigned long rot;
++ int r;
++
++ if (!display->set_rotate || !display->get_rotate)
++ return -ENOENT;
++
++ rot = simple_strtoul(buf, NULL, 0);
++
++ if ((r = display->set_rotate(display, rot)))
++ return r;
++
++ return size;
++}
++
++static ssize_t display_mirror_show(struct omap_display *display, char *buf)
++{
++ int mirror;
++ if (!display->get_mirror)
++ return -ENOENT;
++ mirror = display->get_mirror(display);
++ return snprintf(buf, PAGE_SIZE, "%u\n", mirror);
++}
++
++static ssize_t display_mirror_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ unsigned long mirror;
++ int r;
++
++ if (!display->set_mirror || !display->get_mirror)
++ return -ENOENT;
++
++ mirror = simple_strtoul(buf, NULL, 0);
++
++ if ((r = display->set_mirror(display, mirror)))
++ return r;
++
++ return size;
++}
++
++static ssize_t display_panel_name_show(struct omap_display *display, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ display->panel ? display->panel->name : "");
++}
++
++static ssize_t display_ctrl_name_show(struct omap_display *display, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ display->ctrl ? display->ctrl->name : "");
++}
++
++struct display_attribute {
++ struct attribute attr;
++ ssize_t (*show)(struct omap_display *, char *);
++ ssize_t (*store)(struct omap_display *, const char *, size_t);
++};
++
++#define DISPLAY_ATTR(_name, _mode, _show, _store) \
++ struct display_attribute display_attr_##_name = \
++ __ATTR(_name, _mode, _show, _store)
++
++static DISPLAY_ATTR(name, S_IRUGO, display_name_show, NULL);
++static DISPLAY_ATTR(enabled, S_IRUGO|S_IWUSR,
++ display_enabled_show, display_enabled_store);
++static DISPLAY_ATTR(update_mode, S_IRUGO|S_IWUSR,
++ display_upd_mode_show, display_upd_mode_store);
++static DISPLAY_ATTR(tear_elim, S_IRUGO|S_IWUSR,
++ display_tear_show, display_tear_store);
++static DISPLAY_ATTR(timings, S_IRUGO|S_IWUSR,
++ display_timings_show, display_timings_store);
++static DISPLAY_ATTR(rotate, S_IRUGO|S_IWUSR,
++ display_rotate_show, display_rotate_store);
++static DISPLAY_ATTR(mirror, S_IRUGO|S_IWUSR,
++ display_mirror_show, display_mirror_store);
++static DISPLAY_ATTR(panel_name, S_IRUGO, display_panel_name_show, NULL);
++static DISPLAY_ATTR(ctrl_name, S_IRUGO, display_ctrl_name_show, NULL);
++
++static struct attribute *display_sysfs_attrs[] = {
++ &display_attr_name.attr,
++ &display_attr_enabled.attr,
++ &display_attr_update_mode.attr,
++ &display_attr_tear_elim.attr,
++ &display_attr_timings.attr,
++ &display_attr_rotate.attr,
++ &display_attr_mirror.attr,
++ &display_attr_panel_name.attr,
++ &display_attr_ctrl_name.attr,
++ NULL
++};
++
++static ssize_t display_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
++{
++ struct omap_display *display;
++ struct display_attribute *display_attr;
++
++ display = container_of(kobj, struct omap_display, kobj);
++ display_attr = container_of(attr, struct display_attribute, attr);
++
++ if (!display_attr->show)
++ return -ENOENT;
++
++ return display_attr->show(display, buf);
++}
++
++static ssize_t display_attr_store(struct kobject *kobj, struct attribute *attr,
++ const char *buf, size_t size)
++{
++ struct omap_display *display;
++ struct display_attribute *display_attr;
++
++ display = container_of(kobj, struct omap_display, kobj);
++ display_attr = container_of(attr, struct display_attribute, attr);
++
++ if (!display_attr->store)
++ return -ENOENT;
++
++ return display_attr->store(display, buf, size);
++}
++
++static struct sysfs_ops display_sysfs_ops = {
++ .show = display_attr_show,
++ .store = display_attr_store,
++};
++
++static struct kobj_type display_ktype = {
++ .sysfs_ops = &display_sysfs_ops,
++ .default_attrs = display_sysfs_attrs,
++};
++
++static void default_get_resolution(struct omap_display *display,
++ u16 *xres, u16 *yres)
++{
++ *xres = display->panel->timings.x_res;
++ *yres = display->panel->timings.y_res;
++}
++
++static void default_configure_overlay(struct omap_overlay *ovl)
++{
++ unsigned low, high, size;
++ enum omap_burst_size burst;
++ enum omap_plane plane = ovl->id;
++
++ burst = OMAP_DSS_BURST_16x32;
++ size = 16 * 32 / 8;
++
++ dispc_set_burst_size(plane, burst);
++
++ high = dispc_get_plane_fifo_size(plane) - 1;
++ low = dispc_get_plane_fifo_size(plane) - size;
++
++ dispc_setup_plane_fifo(plane, low, high);
++}
++
++static int default_wait_vsync(struct omap_display *display)
++{
++ unsigned long timeout = msecs_to_jiffies(500);
++ u32 irq;
++
++ if (display->type == OMAP_DISPLAY_TYPE_VENC)
++ irq = DISPC_IRQ_EVSYNC_ODD;
++ else
++ irq = DISPC_IRQ_VSYNC;
++
++ return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
++}
++
++static int default_get_recommended_bpp(struct omap_display *display)
++{
++ if (display->panel->recommended_bpp)
++ return display->panel->recommended_bpp;
++
++ switch (display->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++ if (display->hw_config.u.dpi.data_lines == 24)
++ return 24;
++ else
++ return 16;
++
++ case OMAP_DISPLAY_TYPE_DBI:
++ case OMAP_DISPLAY_TYPE_DSI:
++ if (display->ctrl->pixel_size == 24)
++ return 24;
++ else
++ return 16;
++ case OMAP_DISPLAY_TYPE_VENC:
++ case OMAP_DISPLAY_TYPE_SDI:
++ return 24;
++ return 24;
++ default:
++ BUG();
++ }
++}
++
++void dss_init_displays(struct platform_device *pdev)
++{
++ struct omap_dss_board_info *pdata = pdev->dev.platform_data;
++ int i, r;
++
++ INIT_LIST_HEAD(&display_list);
++
++ num_displays = 0;
++
++ for (i = 0; i < pdata->num_displays; ++i) {
++ struct omap_display *display;
++
++ switch (pdata->displays[i]->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++#ifdef CONFIG_OMAP2_DSS_RFBI
++ case OMAP_DISPLAY_TYPE_DBI:
++#endif
++#ifdef CONFIG_OMAP2_DSS_SDI
++ case OMAP_DISPLAY_TYPE_SDI:
++#endif
++#ifdef CONFIG_OMAP2_DSS_DSI
++ case OMAP_DISPLAY_TYPE_DSI:
++#endif
++#ifdef CONFIG_OMAP2_DSS_VENC
++ case OMAP_DISPLAY_TYPE_VENC:
++#endif
++ break;
++ default:
++ DSSERR("Support for display '%s' not compiled in.\n",
++ pdata->displays[i]->name);
++ continue;
++ }
++
++ display = kzalloc(sizeof(*display), GFP_KERNEL);
++
++ /*atomic_set(&display->ref_count, 0);*/
++ display->ref_count = 0;
++
++ display->hw_config = *pdata->displays[i];
++ display->type = pdata->displays[i]->type;
++ display->name = pdata->displays[i]->name;
++
++ display->get_resolution = default_get_resolution;
++ display->get_recommended_bpp = default_get_recommended_bpp;
++ display->configure_overlay = default_configure_overlay;
++ display->wait_vsync = default_wait_vsync;
++
++ switch (display->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++ dpi_init_display(display);
++ break;
++#ifdef CONFIG_OMAP2_DSS_RFBI
++ case OMAP_DISPLAY_TYPE_DBI:
++ rfbi_init_display(display);
++ break;
++#endif
++#ifdef CONFIG_OMAP2_DSS_VENC
++ case OMAP_DISPLAY_TYPE_VENC:
++ venc_init_display(display);
++ break;
++#endif
++#ifdef CONFIG_OMAP2_DSS_SDI
++ case OMAP_DISPLAY_TYPE_SDI:
++ sdi_init_display(display);
++ break;
++#endif
++#ifdef CONFIG_OMAP2_DSS_DSI
++ case OMAP_DISPLAY_TYPE_DSI:
++ dsi_init_display(display);
++ break;
++#endif
++ default:
++ BUG();
++ }
++
++ r = kobject_init_and_add(&display->kobj, &display_ktype,
++ &pdev->dev.kobj, "display%d", num_displays);
++
++ if (r) {
++ DSSERR("failed to create sysfs file\n");
++ continue;
++ }
++
++ num_displays++;
++
++ list_add_tail(&display->list, &display_list);
++ }
++}
++
++void dss_uninit_displays(struct platform_device *pdev)
++{
++ struct omap_display *display;
++
++ while (!list_empty(&display_list)) {
++ display = list_first_entry(&display_list,
++ struct omap_display, list);
++ list_del(&display->list);
++ kobject_del(&display->kobj);
++ kobject_put(&display->kobj);
++ kfree(display);
++ }
++
++ num_displays = 0;
++}
++
++int dss_suspend_all_displays(void)
++{
++ int r;
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE) {
++ display->activate_after_resume = 0;
++ continue;
++ }
++
++ if (!display->suspend) {
++ DSSERR("display '%s' doesn't implement suspend\n",
++ display->name);
++ r = -ENOSYS;
++ goto err;
++ }
++
++ r = display->suspend(display);
++
++ if (r)
++ goto err;
++
++ display->activate_after_resume = 1;
++ }
++
++ return 0;
++err:
++ /* resume all displays that were suspended */
++ dss_resume_all_displays();
++ return r;
++}
++
++int dss_resume_all_displays(void)
++{
++ int r;
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->activate_after_resume && display->resume) {
++ r = display->resume(display);
++ if (r)
++ return r;
++ }
++
++ display->activate_after_resume = 0;
++ }
++
++ return 0;
++}
++
++int omap_dss_get_num_displays(void)
++{
++ return num_displays;
++}
++EXPORT_SYMBOL(omap_dss_get_num_displays);
++
++struct omap_display *dss_get_display(int no)
++{
++ int i = 0;
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (i++ == no)
++ return display;
++ }
++
++ return NULL;
++}
++
++struct omap_display *omap_dss_get_display(int no)
++{
++ struct omap_display *display;
++
++ display = dss_get_display(no);
++
++ if (!display)
++ return NULL;
++
++ switch (display->type) {
++ case OMAP_DISPLAY_TYPE_VENC:
++ break;
++
++ case OMAP_DISPLAY_TYPE_DPI:
++ case OMAP_DISPLAY_TYPE_SDI:
++ if (display->panel == NULL)
++ return NULL;
++ break;
++
++ case OMAP_DISPLAY_TYPE_DBI:
++ case OMAP_DISPLAY_TYPE_DSI:
++ if (display->panel == NULL || display->ctrl == NULL)
++ return NULL;
++ break;
++
++ default:
++ return NULL;
++ }
++
++ if (display->ctrl) {
++ if (!try_module_get(display->ctrl->owner))
++ goto err0;
++
++ if (display->ctrl->init)
++ if (display->ctrl->init(display) != 0)
++ goto err1;
++ }
++
++ if (display->panel) {
++ if (!try_module_get(display->panel->owner))
++ goto err2;
++
++ if (display->panel->init)
++ if (display->panel->init(display) != 0)
++ goto err3;
++ }
++
++ display->ref_count++;
++ /*
++ if (atomic_cmpxchg(&display->ref_count, 0, 1) != 0)
++ return 0;
++*/
++
++ return display;
++err3:
++ if (display->panel)
++ module_put(display->panel->owner);
++err2:
++ if (display->ctrl && display->ctrl->cleanup)
++ display->ctrl->cleanup(display);
++err1:
++ if (display->ctrl)
++ module_put(display->ctrl->owner);
++err0:
++ return NULL;
++}
++EXPORT_SYMBOL(omap_dss_get_display);
++
++void omap_dss_put_display(struct omap_display *display)
++{
++ if (--display->ref_count > 0)
++ return;
++/*
++ if (atomic_cmpxchg(&display->ref_count, 1, 0) != 1)
++ return;
++*/
++ if (display->ctrl) {
++ if (display->ctrl->cleanup)
++ display->ctrl->cleanup(display);
++ module_put(display->ctrl->owner);
++ }
++
++ if (display->panel) {
++ if (display->panel->cleanup)
++ display->panel->cleanup(display);
++ module_put(display->panel->owner);
++ }
++}
++EXPORT_SYMBOL(omap_dss_put_display);
++
++void omap_dss_register_ctrl(struct omap_ctrl *ctrl)
++{
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->hw_config.ctrl_name &&
++ strcmp(display->hw_config.ctrl_name, ctrl->name) == 0) {
++ display->ctrl = ctrl;
++ DSSDBG("ctrl '%s' registered\n", ctrl->name);
++ }
++ }
++}
++EXPORT_SYMBOL(omap_dss_register_ctrl);
++
++void omap_dss_register_panel(struct omap_panel *panel)
++{
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->hw_config.panel_name &&
++ strcmp(display->hw_config.panel_name, panel->name) == 0) {
++ display->panel = panel;
++ DSSDBG("panel '%s' registered\n", panel->name);
++ }
++ }
++}
++EXPORT_SYMBOL(omap_dss_register_panel);
++
++void omap_dss_unregister_ctrl(struct omap_ctrl *ctrl)
++{
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->hw_config.ctrl_name &&
++ strcmp(display->hw_config.ctrl_name, ctrl->name) == 0)
++ display->ctrl = NULL;
++ }
++}
++EXPORT_SYMBOL(omap_dss_unregister_ctrl);
++
++void omap_dss_unregister_panel(struct omap_panel *panel)
++{
++ struct omap_display *display;
++
++ list_for_each_entry(display, &display_list, list) {
++ if (display->hw_config.panel_name &&
++ strcmp(display->hw_config.panel_name, panel->name) == 0)
++ display->panel = NULL;
++ }
++}
++EXPORT_SYMBOL(omap_dss_unregister_panel);
+diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
+new file mode 100644
+index 0000000..71fffca
+--- /dev/null
++++ b/drivers/video/omap2/dss/dpi.c
+@@ -0,0 +1,393 @@
++/*
++ * linux/drivers/video/omap2/dss/dpi.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/kernel.h>
++#include <linux/clk.h>
++#include <linux/delay.h>
++#include <linux/errno.h>
++
++#include <mach/board.h>
++#include <mach/display.h>
++#include <mach/cpu.h>
++
++#include "dss.h"
++
++static struct {
++ int update_enabled;
++} dpi;
++
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++static int dpi_set_dsi_clk(bool is_tft, unsigned long pck_req,
++ unsigned long *fck, int *lck_div, int *pck_div)
++{
++ struct dsi_clock_info cinfo;
++ int r;
++
++ r = dsi_pll_calc_pck(is_tft, pck_req, &cinfo);
++ if (r)
++ return r;
++
++ r = dsi_pll_program(&cinfo);
++ if (r)
++ return r;
++
++ dss_select_clk_source(0, 1);
++
++ dispc_set_lcd_divisor(cinfo.lck_div, cinfo.pck_div);
++
++ *fck = cinfo.dsi1_pll_fclk;
++ *lck_div = cinfo.lck_div;
++ *pck_div = cinfo.pck_div;
++
++ return 0;
++}
++#else
++static int dpi_set_dispc_clk(bool is_tft, unsigned long pck_req,
++ unsigned long *fck, int *lck_div, int *pck_div)
++{
++ struct dispc_clock_info cinfo;
++ int r;
++
++ r = dispc_calc_clock_div(is_tft, pck_req, &cinfo);
++ if (r)
++ return r;
++
++ r = dispc_set_clock_div(&cinfo);
++ if (r)
++ return r;
++
++ *fck = cinfo.fck;
++ *lck_div = cinfo.lck_div;
++ *pck_div = cinfo.pck_div;
++
++ return 0;
++}
++#endif
++
++static int dpi_set_mode(struct omap_display *display)
++{
++ struct omap_panel *panel = display->panel;
++ int lck_div, pck_div;
++ unsigned long fck;
++ unsigned long pck;
++ bool is_tft;
++ int r = 0;
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ dispc_set_pol_freq(panel);
++
++ is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++ r = dpi_set_dsi_clk(is_tft, panel->timings.pixel_clock * 1000,
++ &fck, &lck_div, &pck_div);
++#else
++ r = dpi_set_dispc_clk(is_tft, panel->timings.pixel_clock * 1000,
++ &fck, &lck_div, &pck_div);
++#endif
++ if (r)
++ goto err0;
++
++ pck = fck / lck_div / pck_div / 1000;
++
++ if (pck != panel->timings.pixel_clock) {
++ DSSWARN("Could not find exact pixel clock. "
++ "Requested %d kHz, got %lu kHz\n",
++ panel->timings.pixel_clock, pck);
++
++ panel->timings.pixel_clock = pck;
++ }
++
++ dispc_set_lcd_timings(&panel->timings);
++
++err0:
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ return r;
++}
++
++static int dpi_basic_init(struct omap_display *display)
++{
++ bool is_tft;
++
++ is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++
++ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
++ dispc_set_lcd_display_type(is_tft ? OMAP_DSS_LCD_DISPLAY_TFT :
++ OMAP_DSS_LCD_DISPLAY_STN);
++ dispc_set_tft_data_lines(display->hw_config.u.dpi.data_lines);
++
++ return 0;
++}
++
++static int dpi_display_enable(struct omap_display *display)
++{
++ struct omap_panel *panel = display->panel;
++ int r;
++
++ if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ DSSERR("display already enabled\n");
++ return -EINVAL;
++ }
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ r = dpi_basic_init(display);
++ if (r)
++ goto err0;
++
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++ dss_clk_enable(DSS_CLK_FCK2);
++ r = dsi_pll_init(0, 1);
++ if (r)
++ goto err1;
++#endif
++ r = dpi_set_mode(display);
++ if (r)
++ goto err2;
++
++ mdelay(2);
++
++ dispc_enable_lcd_out(1);
++
++ r = panel->enable(display);
++ if (r)
++ goto err3;
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ return 0;
++
++err3:
++ dispc_enable_lcd_out(0);
++err2:
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++ dsi_pll_uninit();
++err1:
++ dss_clk_disable(DSS_CLK_FCK2);
++#endif
++err0:
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ return r;
++}
++
++static int dpi_display_resume(struct omap_display *display);
++
++static void dpi_display_disable(struct omap_display *display)
++{
++ if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ return;
++
++ if (display->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ dpi_display_resume(display);
++
++ display->panel->disable(display);
++
++ dispc_enable_lcd_out(0);
++
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++ dss_select_clk_source(0, 0);
++ dsi_pll_uninit();
++ dss_clk_disable(DSS_CLK_FCK2);
++#endif
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++}
++
++static int dpi_display_suspend(struct omap_display *display)
++{
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return -EINVAL;
++
++ DSSDBG("dpi_display_suspend\n");
++
++ if (display->panel->suspend)
++ display->panel->suspend(display);
++
++ dispc_enable_lcd_out(0);
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++
++ return 0;
++}
++
++static int dpi_display_resume(struct omap_display *display)
++{
++ if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
++ return -EINVAL;
++
++ DSSDBG("dpi_display_resume\n");
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ dispc_enable_lcd_out(1);
++
++ if (display->panel->resume)
++ display->panel->resume(display);
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ return 0;
++}
++
++static void dpi_set_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ DSSDBG("dpi_set_timings\n");
++ display->panel->timings = *timings;
++ if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
++ dpi_set_mode(display);
++ dispc_go(OMAP_DSS_CHANNEL_LCD);
++ }
++}
++
++static int dpi_check_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ bool is_tft;
++ int r;
++ int lck_div, pck_div;
++ unsigned long fck;
++ unsigned long pck;
++
++ if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
++ if (timings->hsw < 1 || timings->hsw > 64 ||
++ timings->hfp < 1 || timings->hfp > 256 ||
++ timings->hbp < 1 || timings->hbp > 256) {
++ return -EINVAL;
++ }
++
++ if (timings->vsw < 1 || timings->vsw > 64 ||
++ timings->vfp > 255 || timings->vbp > 255) {
++ return -EINVAL;
++ }
++ } else {
++ if (timings->hsw < 1 || timings->hsw > 256 ||
++ timings->hfp < 1 || timings->hfp > 4096 ||
++ timings->hbp < 1 || timings->hbp > 4096) {
++ return -EINVAL;
++ }
++
++ if (timings->vsw < 1 || timings->vsw > 64 ||
++ timings->vfp > 4095 || timings->vbp > 4095) {
++ return -EINVAL;
++ }
++ }
++
++ if (timings->pixel_clock == 0)
++ return -EINVAL;
++
++ is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++
++#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
++ {
++ struct dsi_clock_info cinfo;
++ r = dsi_pll_calc_pck(is_tft, timings->pixel_clock * 1000,
++ &cinfo);
++
++ if (r)
++ return r;
++
++ fck = cinfo.dsi1_pll_fclk;
++ lck_div = cinfo.lck_div;
++ pck_div = cinfo.pck_div;
++ }
++#else
++ {
++ struct dispc_clock_info cinfo;
++ r = dispc_calc_clock_div(is_tft, timings->pixel_clock * 1000,
++ &cinfo);
++
++ if (r)
++ return r;
++
++ fck = cinfo.fck;
++ lck_div = cinfo.lck_div;
++ pck_div = cinfo.pck_div;
++ }
++#endif
++
++ pck = fck / lck_div / pck_div / 1000;
++
++ timings->pixel_clock = pck;
++
++ return 0;
++}
++
++static void dpi_get_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ *timings = display->panel->timings;
++}
++
++static int dpi_display_set_update_mode(struct omap_display *display,
++ enum omap_dss_update_mode mode)
++{
++ if (mode == OMAP_DSS_UPDATE_MANUAL)
++ return -EINVAL;
++
++ if (mode == OMAP_DSS_UPDATE_DISABLED) {
++ dispc_enable_lcd_out(0);
++ dpi.update_enabled = 0;
++ } else {
++ dispc_enable_lcd_out(1);
++ dpi.update_enabled = 1;
++ }
++
++ return 0;
++}
++
++static enum omap_dss_update_mode dpi_display_get_update_mode(
++ struct omap_display *display)
++{
++ return dpi.update_enabled ? OMAP_DSS_UPDATE_AUTO :
++ OMAP_DSS_UPDATE_DISABLED;
++}
++
++void dpi_init_display(struct omap_display *display)
++{
++ DSSDBG("DPI init_display\n");
++
++ display->enable = dpi_display_enable;
++ display->disable = dpi_display_disable;
++ display->suspend = dpi_display_suspend;
++ display->resume = dpi_display_resume;
++ display->set_timings = dpi_set_timings;
++ display->check_timings = dpi_check_timings;
++ display->get_timings = dpi_get_timings;
++ display->set_update_mode = dpi_display_set_update_mode;
++ display->get_update_mode = dpi_display_get_update_mode;
++}
++
++int dpi_init(void)
++{
++ return 0;
++}
++
++void dpi_exit(void)
++{
++}
++
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+new file mode 100644
+index 0000000..4442931
+--- /dev/null
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -0,0 +1,3752 @@
++/*
++ * linux/drivers/video/omap2/dss/dsi.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "DSI"
++
++#include <linux/kernel.h>
++#include <linux/io.h>
++#include <linux/clk.h>
++#include <linux/device.h>
++#include <linux/err.h>
++#include <linux/interrupt.h>
++#include <linux/delay.h>
++#include <linux/workqueue.h>
++#include <linux/mutex.h>
++#include <linux/seq_file.h>
++#include <linux/kfifo.h>
++
++#include <mach/board.h>
++#include <mach/display.h>
++#include <mach/clock.h>
++
++#include "dss.h"
++
++/*#define VERBOSE_IRQ*/
++
++#define DSI_BASE 0x4804FC00
++
++struct dsi_reg { u16 idx; };
++
++#define DSI_REG(idx) ((const struct dsi_reg) { idx })
++
++#define DSI_SZ_REGS SZ_1K
++/* DSI Protocol Engine */
++
++#define DSI_REVISION DSI_REG(0x0000)
++#define DSI_SYSCONFIG DSI_REG(0x0010)
++#define DSI_SYSSTATUS DSI_REG(0x0014)
++#define DSI_IRQSTATUS DSI_REG(0x0018)
++#define DSI_IRQENABLE DSI_REG(0x001C)
++#define DSI_CTRL DSI_REG(0x0040)
++#define DSI_COMPLEXIO_CFG1 DSI_REG(0x0048)
++#define DSI_COMPLEXIO_IRQ_STATUS DSI_REG(0x004C)
++#define DSI_COMPLEXIO_IRQ_ENABLE DSI_REG(0x0050)
++#define DSI_CLK_CTRL DSI_REG(0x0054)
++#define DSI_TIMING1 DSI_REG(0x0058)
++#define DSI_TIMING2 DSI_REG(0x005C)
++#define DSI_VM_TIMING1 DSI_REG(0x0060)
++#define DSI_VM_TIMING2 DSI_REG(0x0064)
++#define DSI_VM_TIMING3 DSI_REG(0x0068)
++#define DSI_CLK_TIMING DSI_REG(0x006C)
++#define DSI_TX_FIFO_VC_SIZE DSI_REG(0x0070)
++#define DSI_RX_FIFO_VC_SIZE DSI_REG(0x0074)
++#define DSI_COMPLEXIO_CFG2 DSI_REG(0x0078)
++#define DSI_RX_FIFO_VC_FULLNESS DSI_REG(0x007C)
++#define DSI_VM_TIMING4 DSI_REG(0x0080)
++#define DSI_TX_FIFO_VC_EMPTINESS DSI_REG(0x0084)
++#define DSI_VM_TIMING5 DSI_REG(0x0088)
++#define DSI_VM_TIMING6 DSI_REG(0x008C)
++#define DSI_VM_TIMING7 DSI_REG(0x0090)
++#define DSI_STOPCLK_TIMING DSI_REG(0x0094)
++#define DSI_VC_CTRL(n) DSI_REG(0x0100 + (n * 0x20))
++#define DSI_VC_TE(n) DSI_REG(0x0104 + (n * 0x20))
++#define DSI_VC_LONG_PACKET_HEADER(n) DSI_REG(0x0108 + (n * 0x20))
++#define DSI_VC_LONG_PACKET_PAYLOAD(n) DSI_REG(0x010C + (n * 0x20))
++#define DSI_VC_SHORT_PACKET_HEADER(n) DSI_REG(0x0110 + (n * 0x20))
++#define DSI_VC_IRQSTATUS(n) DSI_REG(0x0118 + (n * 0x20))
++#define DSI_VC_IRQENABLE(n) DSI_REG(0x011C + (n * 0x20))
++
++/* DSIPHY_SCP */
++
++#define DSI_DSIPHY_CFG0 DSI_REG(0x200 + 0x0000)
++#define DSI_DSIPHY_CFG1 DSI_REG(0x200 + 0x0004)
++#define DSI_DSIPHY_CFG2 DSI_REG(0x200 + 0x0008)
++#define DSI_DSIPHY_CFG5 DSI_REG(0x200 + 0x0014)
++
++/* DSI_PLL_CTRL_SCP */
++
++#define DSI_PLL_CONTROL DSI_REG(0x300 + 0x0000)
++#define DSI_PLL_STATUS DSI_REG(0x300 + 0x0004)
++#define DSI_PLL_GO DSI_REG(0x300 + 0x0008)
++#define DSI_PLL_CONFIGURATION1 DSI_REG(0x300 + 0x000C)
++#define DSI_PLL_CONFIGURATION2 DSI_REG(0x300 + 0x0010)
++
++#define REG_GET(idx, start, end) \
++ FLD_GET(dsi_read_reg(idx), start, end)
++
++#define REG_FLD_MOD(idx, val, start, end) \
++ dsi_write_reg(idx, FLD_MOD(dsi_read_reg(idx), val, start, end))
++
++/* Global interrupts */
++#define DSI_IRQ_VC0 (1 << 0)
++#define DSI_IRQ_VC1 (1 << 1)
++#define DSI_IRQ_VC2 (1 << 2)
++#define DSI_IRQ_VC3 (1 << 3)
++#define DSI_IRQ_WAKEUP (1 << 4)
++#define DSI_IRQ_RESYNC (1 << 5)
++#define DSI_IRQ_PLL_LOCK (1 << 7)
++#define DSI_IRQ_PLL_UNLOCK (1 << 8)
++#define DSI_IRQ_PLL_RECALL (1 << 9)
++#define DSI_IRQ_COMPLEXIO_ERR (1 << 10)
++#define DSI_IRQ_HS_TX_TIMEOUT (1 << 14)
++#define DSI_IRQ_LP_RX_TIMEOUT (1 << 15)
++#define DSI_IRQ_TE_TRIGGER (1 << 16)
++#define DSI_IRQ_ACK_TRIGGER (1 << 17)
++#define DSI_IRQ_SYNC_LOST (1 << 18)
++#define DSI_IRQ_LDO_POWER_GOOD (1 << 19)
++#define DSI_IRQ_TA_TIMEOUT (1 << 20)
++#define DSI_IRQ_ERROR_MASK \
++ (DSI_IRQ_HS_TX_TIMEOUT | DSI_IRQ_LP_RX_TIMEOUT | DSI_IRQ_SYNC_LOST | \
++ DSI_IRQ_TA_TIMEOUT)
++#define DSI_IRQ_CHANNEL_MASK 0xf
++
++/* Virtual channel interrupts */
++#define DSI_VC_IRQ_CS (1 << 0)
++#define DSI_VC_IRQ_ECC_CORR (1 << 1)
++#define DSI_VC_IRQ_PACKET_SENT (1 << 2)
++#define DSI_VC_IRQ_FIFO_TX_OVF (1 << 3)
++#define DSI_VC_IRQ_FIFO_RX_OVF (1 << 4)
++#define DSI_VC_IRQ_BTA (1 << 5)
++#define DSI_VC_IRQ_ECC_NO_CORR (1 << 6)
++#define DSI_VC_IRQ_FIFO_TX_UDF (1 << 7)
++#define DSI_VC_IRQ_PP_BUSY_CHANGE (1 << 8)
++#define DSI_VC_IRQ_ERROR_MASK \
++ (DSI_VC_IRQ_CS | DSI_VC_IRQ_ECC_CORR | DSI_VC_IRQ_FIFO_TX_OVF | \
++ DSI_VC_IRQ_FIFO_RX_OVF | DSI_VC_IRQ_ECC_NO_CORR | \
++ DSI_VC_IRQ_FIFO_TX_UDF)
++
++/* ComplexIO interrupts */
++#define DSI_CIO_IRQ_ERRSYNCESC1 (1 << 0)
++#define DSI_CIO_IRQ_ERRSYNCESC2 (1 << 1)
++#define DSI_CIO_IRQ_ERRSYNCESC3 (1 << 2)
++#define DSI_CIO_IRQ_ERRESC1 (1 << 5)
++#define DSI_CIO_IRQ_ERRESC2 (1 << 6)
++#define DSI_CIO_IRQ_ERRESC3 (1 << 7)
++#define DSI_CIO_IRQ_ERRCONTROL1 (1 << 10)
++#define DSI_CIO_IRQ_ERRCONTROL2 (1 << 11)
++#define DSI_CIO_IRQ_ERRCONTROL3 (1 << 12)
++#define DSI_CIO_IRQ_STATEULPS1 (1 << 15)
++#define DSI_CIO_IRQ_STATEULPS2 (1 << 16)
++#define DSI_CIO_IRQ_STATEULPS3 (1 << 17)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP0_1 (1 << 20)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP1_1 (1 << 21)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP0_2 (1 << 22)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP1_2 (1 << 23)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP0_3 (1 << 24)
++#define DSI_CIO_IRQ_ERRCONTENTIONLP1_3 (1 << 25)
++#define DSI_CIO_IRQ_ULPSACTIVENOT_ALL0 (1 << 30)
++#define DSI_CIO_IRQ_ULPSACTIVENOT_ALL1 (1 << 31)
++
++#define DSI_DT_DCS_SHORT_WRITE_0 0x05
++#define DSI_DT_DCS_SHORT_WRITE_1 0x15
++#define DSI_DT_DCS_READ 0x06
++#define DSI_DT_SET_MAX_RET_PKG_SIZE 0x37
++#define DSI_DT_NULL_PACKET 0x09
++#define DSI_DT_DCS_LONG_WRITE 0x39
++
++#define DSI_DT_RX_ACK_WITH_ERR 0x02
++#define DSI_DT_RX_DCS_LONG_READ 0x1c
++#define DSI_DT_RX_SHORT_READ_1 0x21
++#define DSI_DT_RX_SHORT_READ_2 0x22
++
++#define FINT_MAX 2100000
++#define FINT_MIN 750000
++#define REGN_MAX (1 << 7)
++#define REGM_MAX ((1 << 11) - 1)
++#define REGM3_MAX (1 << 4)
++#define REGM4_MAX (1 << 4)
++
++enum fifo_size {
++ DSI_FIFO_SIZE_0 = 0,
++ DSI_FIFO_SIZE_32 = 1,
++ DSI_FIFO_SIZE_64 = 2,
++ DSI_FIFO_SIZE_96 = 3,
++ DSI_FIFO_SIZE_128 = 4,
++};
++
++#define DSI_CMD_FIFO_LEN 16
++
++struct dsi_cmd_update {
++ int bytespp;
++ u16 x;
++ u16 y;
++ u16 w;
++ u16 h;
++};
++
++struct dsi_cmd_mem_read {
++ void *buf;
++ size_t size;
++ u16 x;
++ u16 y;
++ u16 w;
++ u16 h;
++ size_t *ret_size;
++ struct completion *completion;
++};
++
++struct dsi_cmd_test {
++ int test_num;
++ int *result;
++ struct completion *completion;
++};
++
++enum dsi_cmd {
++ DSI_CMD_UPDATE,
++ DSI_CMD_AUTOUPDATE,
++ DSI_CMD_SYNC,
++ DSI_CMD_MEM_READ,
++ DSI_CMD_TEST,
++ DSI_CMD_SET_TE,
++ DSI_CMD_SET_UPDATE_MODE,
++ DSI_CMD_SET_ROTATE,
++ DSI_CMD_SET_MIRROR,
++};
++
++struct dsi_cmd_item {
++ struct omap_display *display;
++
++ enum dsi_cmd cmd;
++
++ union {
++ struct dsi_cmd_update r;
++ struct completion *sync;
++ struct dsi_cmd_mem_read mem_read;
++ struct dsi_cmd_test test;
++ int te;
++ enum omap_dss_update_mode update_mode;
++ int rotate;
++ int mirror;
++ } u;
++};
++
++static struct
++{
++ void __iomem *base;
++
++ unsigned long dsi1_pll_fclk; /* Hz */
++ unsigned long dsi2_pll_fclk; /* Hz */
++ unsigned long dsiphy; /* Hz */
++ unsigned long ddr_clk; /* Hz */
++
++ struct {
++ struct omap_display *display;
++ enum fifo_size fifo_size;
++ int dest_per; /* destination peripheral 0-3 */
++ } vc[4];
++
++ struct mutex lock;
++
++ unsigned pll_locked;
++
++ struct completion bta_completion;
++
++ struct work_struct framedone_work;
++ struct work_struct process_work;
++ struct workqueue_struct *workqueue;
++
++ enum omap_dss_update_mode user_update_mode;
++ enum omap_dss_update_mode target_update_mode;
++ enum omap_dss_update_mode update_mode;
++ int use_te;
++ int framedone_scheduled; /* helps to catch strange framedone bugs */
++
++ unsigned long cache_req_pck;
++ unsigned long cache_clk_freq;
++ struct dsi_clock_info cache_cinfo;
++
++ struct kfifo *cmd_fifo;
++ spinlock_t cmd_lock;
++ struct completion cmd_done;
++ atomic_t cmd_fifo_full;
++ atomic_t cmd_pending;
++
++ bool autoupdate_setup;
++
++#ifdef DEBUG
++ ktime_t perf_setup_time;
++ ktime_t perf_start_time;
++ int perf_measure_frames;
++
++ struct {
++ int x, y, w, h;
++ int bytespp;
++ } update_region;
++
++#endif
++ int debug_process;
++ int debug_read;
++ int debug_write;
++} dsi;
++
++#ifdef DEBUG
++static unsigned int dsi_perf;
++module_param_named(dsi_perf, dsi_perf, bool, 0644);
++#endif
++
++static void dsi_process_cmd_fifo(struct work_struct *work);
++static void dsi_push_update(struct omap_display *display,
++ int x, int y, int w, int h);
++static void dsi_push_autoupdate(struct omap_display *display);
++
++static inline void dsi_write_reg(const struct dsi_reg idx, u32 val)
++{
++ __raw_writel(val, dsi.base + idx.idx);
++}
++
++static inline u32 dsi_read_reg(const struct dsi_reg idx)
++{
++ return __raw_readl(dsi.base + idx.idx);
++}
++
++
++void dsi_save_context(void)
++{
++}
++
++void dsi_restore_context(void)
++{
++}
++
++static inline int wait_for_bit_change(const struct dsi_reg idx, int bitnum,
++ int value)
++{
++ int t = 100000;
++
++ while (REG_GET(idx, bitnum, bitnum) != value) {
++ if (--t == 0)
++ return !value;
++ }
++
++ return value;
++}
++
++#ifdef DEBUG
++static void perf_mark_setup(void)
++{
++ dsi.perf_setup_time = ktime_get();
++}
++
++static void perf_mark_start(void)
++{
++ dsi.perf_start_time = ktime_get();
++}
++
++static void perf_show(const char *name)
++{
++ ktime_t t, setup_time, trans_time;
++ u32 total_bytes;
++ u32 setup_us, trans_us, total_us;
++ const int numframes = 100;
++ static u32 s_trans_us, s_min_us = 0xffffffff, s_max_us;
++
++ if (!dsi_perf)
++ return;
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
++ return;
++
++ t = ktime_get();
++
++ setup_time = ktime_sub(dsi.perf_start_time, dsi.perf_setup_time);
++ setup_us = (u32)ktime_to_us(setup_time);
++ if (setup_us == 0)
++ setup_us = 1;
++
++ trans_time = ktime_sub(t, dsi.perf_start_time);
++ trans_us = (u32)ktime_to_us(trans_time);
++ if (trans_us == 0)
++ trans_us = 1;
++
++ total_us = setup_us + trans_us;
++
++ total_bytes = dsi.update_region.w *
++ dsi.update_region.h *
++ dsi.update_region.bytespp;
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) {
++ dsi.perf_measure_frames++;
++
++ if (trans_us < s_min_us)
++ s_min_us = trans_us;
++
++ if (trans_us > s_max_us)
++ s_max_us = trans_us;
++
++ s_trans_us += trans_us;
++
++ if (dsi.perf_measure_frames < numframes)
++ return;
++
++ DSSINFO("%s update: %d frames in %u us "
++ "(min/max/avg %u/%u/%u), %u fps\n",
++ name, numframes,
++ s_trans_us,
++ s_min_us,
++ s_max_us,
++ s_trans_us / numframes,
++ 1000*1000 / (s_trans_us / numframes));
++
++ dsi.perf_measure_frames = 0;
++ s_trans_us = 0;
++ s_min_us = 0xffffffff;
++ s_max_us = 0;
++ } else {
++ DSSINFO("%s update %u us + %u us = %u us (%uHz), %u bytes, "
++ "%u kbytes/sec\n",
++ name,
++ setup_us,
++ trans_us,
++ total_us,
++ 1000*1000 / total_us,
++ total_bytes,
++ total_bytes * 1000 / total_us);
++ }
++}
++#else
++#define perf_mark_setup()
++#define perf_mark_start()
++#define perf_show(x)
++#endif
++
++static void print_irq_status(u32 status)
++{
++#ifndef VERBOSE_IRQ
++ if ((status & ~DSI_IRQ_CHANNEL_MASK) == 0)
++ return;
++#endif
++ printk(KERN_DEBUG "DSI IRQ: 0x%x: ", status);
++
++#define PIS(x) \
++ if (status & DSI_IRQ_##x) \
++ printk(#x " ");
++#ifdef VERBOSE_IRQ
++ PIS(VC0);
++ PIS(VC1);
++ PIS(VC2);
++ PIS(VC3);
++#endif
++ PIS(WAKEUP);
++ PIS(RESYNC);
++ PIS(PLL_LOCK);
++ PIS(PLL_UNLOCK);
++ PIS(PLL_RECALL);
++ PIS(COMPLEXIO_ERR);
++ PIS(HS_TX_TIMEOUT);
++ PIS(LP_RX_TIMEOUT);
++ PIS(TE_TRIGGER);
++ PIS(ACK_TRIGGER);
++ PIS(SYNC_LOST);
++ PIS(LDO_POWER_GOOD);
++ PIS(TA_TIMEOUT);
++#undef PIS
++
++ printk("\n");
++}
++
++static void print_irq_status_vc(int channel, u32 status)
++{
++#ifndef VERBOSE_IRQ
++ if ((status & ~DSI_VC_IRQ_PACKET_SENT) == 0)
++ return;
++#endif
++ printk(KERN_DEBUG "DSI VC(%d) IRQ 0x%x: ", channel, status);
++
++#define PIS(x) \
++ if (status & DSI_VC_IRQ_##x) \
++ printk(#x " ");
++ PIS(CS);
++ PIS(ECC_CORR);
++#ifdef VERBOSE_IRQ
++ PIS(PACKET_SENT);
++#endif
++ PIS(FIFO_TX_OVF);
++ PIS(FIFO_RX_OVF);
++ PIS(BTA);
++ PIS(ECC_NO_CORR);
++ PIS(FIFO_TX_UDF);
++ PIS(PP_BUSY_CHANGE);
++#undef PIS
++ printk("\n");
++}
++
++static void print_irq_status_cio(u32 status)
++{
++ printk(KERN_DEBUG "DSI CIO IRQ 0x%x: ", status);
++
++#define PIS(x) \
++ if (status & DSI_CIO_IRQ_##x) \
++ printk(#x " ");
++ PIS(ERRSYNCESC1);
++ PIS(ERRSYNCESC2);
++ PIS(ERRSYNCESC3);
++ PIS(ERRESC1);
++ PIS(ERRESC2);
++ PIS(ERRESC3);
++ PIS(ERRCONTROL1);
++ PIS(ERRCONTROL2);
++ PIS(ERRCONTROL3);
++ PIS(STATEULPS1);
++ PIS(STATEULPS2);
++ PIS(STATEULPS3);
++ PIS(ERRCONTENTIONLP0_1);
++ PIS(ERRCONTENTIONLP1_1);
++ PIS(ERRCONTENTIONLP0_2);
++ PIS(ERRCONTENTIONLP1_2);
++ PIS(ERRCONTENTIONLP0_3);
++ PIS(ERRCONTENTIONLP1_3);
++ PIS(ULPSACTIVENOT_ALL0);
++ PIS(ULPSACTIVENOT_ALL1);
++#undef PIS
++
++ printk("\n");
++}
++
++static int debug_irq;
++
++/* called from dss */
++void dsi_irq_handler(void)
++{
++ u32 irqstatus, vcstatus, ciostatus;
++ int i;
++
++ irqstatus = dsi_read_reg(DSI_IRQSTATUS);
++
++ if (irqstatus & DSI_IRQ_ERROR_MASK) {
++ DSSERR("DSI error, irqstatus %x\n", irqstatus);
++ print_irq_status(irqstatus);
++ } else if (debug_irq) {
++ print_irq_status(irqstatus);
++ }
++
++ for (i = 0; i < 4; ++i) {
++ if ((irqstatus & (1<<i)) == 0)
++ continue;
++
++ vcstatus = dsi_read_reg(DSI_VC_IRQSTATUS(i));
++
++ if (vcstatus & DSI_VC_IRQ_BTA)
++ complete(&dsi.bta_completion);
++
++ if (vcstatus & DSI_VC_IRQ_ERROR_MASK) {
++ DSSERR("DSI VC(%d) error, vc irqstatus %x\n",
++ i, vcstatus);
++ print_irq_status_vc(i, vcstatus);
++ } else if (debug_irq) {
++ print_irq_status_vc(i, vcstatus);
++ }
++
++ dsi_write_reg(DSI_VC_IRQSTATUS(i), vcstatus);
++ }
++
++ if (irqstatus & DSI_IRQ_COMPLEXIO_ERR) {
++ ciostatus = dsi_read_reg(DSI_COMPLEXIO_IRQ_STATUS);
++
++ dsi_write_reg(DSI_COMPLEXIO_IRQ_STATUS, ciostatus);
++
++ DSSERR("DSI CIO error, cio irqstatus %x\n", ciostatus);
++ print_irq_status_cio(ciostatus);
++ }
++
++ dsi_write_reg(DSI_IRQSTATUS, irqstatus & ~DSI_IRQ_CHANNEL_MASK);
++}
++
++
++static void _dsi_initialize_irq(void)
++{
++ u32 l;
++ int i;
++
++ /* disable all interrupts */
++ dsi_write_reg(DSI_IRQENABLE, 0);
++ for (i = 0; i < 4; ++i)
++ dsi_write_reg(DSI_VC_IRQENABLE(i), 0);
++ dsi_write_reg(DSI_COMPLEXIO_IRQ_ENABLE, 0);
++
++ /* clear interrupt status */
++ l = dsi_read_reg(DSI_IRQSTATUS);
++ dsi_write_reg(DSI_IRQSTATUS, l & ~DSI_IRQ_CHANNEL_MASK);
++
++ for (i = 0; i < 4; ++i) {
++ l = dsi_read_reg(DSI_VC_IRQSTATUS(i));
++ dsi_write_reg(DSI_VC_IRQSTATUS(i), l);
++ }
++
++ l = dsi_read_reg(DSI_COMPLEXIO_IRQ_STATUS);
++ dsi_write_reg(DSI_COMPLEXIO_IRQ_STATUS, l);
++
++ /* enable error irqs */
++ l = DSI_IRQ_ERROR_MASK;
++ dsi_write_reg(DSI_IRQENABLE, l);
++
++ l = DSI_VC_IRQ_ERROR_MASK;
++ for (i = 0; i < 4; ++i)
++ dsi_write_reg(DSI_VC_IRQENABLE(i), l);
++
++ /* XXX zonda responds incorrectly, causing control error:
++ Exit from LP-ESC mode to LP11 uses wrong transition states on the
++ data lines LP0 and LN0. */
++ dsi_write_reg(DSI_COMPLEXIO_IRQ_ENABLE,
++ -1 & (~DSI_CIO_IRQ_ERRCONTROL2));
++}
++
++static void dsi_vc_enable_bta_irq(int channel)
++{
++ u32 l;
++
++ l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
++ l |= DSI_VC_IRQ_BTA;
++ dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
++}
++
++static void dsi_vc_disable_bta_irq(int channel)
++{
++ u32 l;
++
++ l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
++ l &= ~DSI_VC_IRQ_BTA;
++ dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
++}
++
++/* DSI func clock. this could also be DSI2_PLL_FCLK */
++static inline void enable_clocks(bool enable)
++{
++ if (enable)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ else
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++}
++
++/* source clock for DSI PLL. this could also be PCLKFREE */
++static inline void dsi_enable_pll_clock(bool enable)
++{
++ if (enable)
++ dss_clk_enable(DSS_CLK_FCK2);
++ else
++ dss_clk_disable(DSS_CLK_FCK2);
++
++ if (enable && dsi.pll_locked) {
++ if (wait_for_bit_change(DSI_PLL_STATUS, 1, 1) != 1)
++ DSSERR("cannot lock PLL when enabling clocks\n");
++ }
++}
++
++#ifdef DEBUG
++static void _dsi_print_reset_status(void)
++{
++ u32 l;
++
++ if (!dss_debug)
++ return;
++
++ /* A dummy read using the SCP interface to any DSIPHY register is
++ * required after DSIPHY reset to complete the reset of the DSI complex
++ * I/O. */
++ l = dsi_read_reg(DSI_DSIPHY_CFG5);
++
++ printk(KERN_DEBUG "DSI resets: ");
++
++ l = dsi_read_reg(DSI_PLL_STATUS);
++ printk("PLL (%d) ", FLD_GET(l, 0, 0));
++
++ l = dsi_read_reg(DSI_COMPLEXIO_CFG1);
++ printk("CIO (%d) ", FLD_GET(l, 29, 29));
++
++ l = dsi_read_reg(DSI_DSIPHY_CFG5);
++ printk("PHY (%x, %d, %d, %d)\n",
++ FLD_GET(l, 28, 26),
++ FLD_GET(l, 29, 29),
++ FLD_GET(l, 30, 30),
++ FLD_GET(l, 31, 31));
++}
++#else
++#define _dsi_print_reset_status()
++#endif
++
++static inline int dsi_if_enable(bool enable)
++{
++ DSSDBG("dsi_if_enable(%d)\n", enable);
++
++ enable = enable ? 1 : 0;
++ REG_FLD_MOD(DSI_CTRL, enable, 0, 0); /* IF_EN */
++
++ if (wait_for_bit_change(DSI_CTRL, 0, enable) != enable) {
++ DSSERR("Failed to set dsi_if_enable to %d\n", enable);
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static unsigned long dsi_fclk_rate(void)
++{
++ unsigned long r;
++
++ if (dss_get_dsi_clk_source() == 0) {
++ /* DSI FCLK source is DSS1_ALWON_FCK, which is dss1_fck */
++ r = dss_clk_get_rate(DSS_CLK_FCK1);
++ } else {
++ /* DSI FCLK source is DSI2_PLL_FCLK */
++ r = dsi.dsi2_pll_fclk;
++ }
++
++ return r;
++}
++
++static int dsi_set_lp_clk_divisor(void)
++{
++ int n;
++ unsigned long dsi_fclk;
++ unsigned long mhz;
++
++ /* LP_CLK_DIVISOR, DSI fclk/n, should be 20MHz - 32kHz */
++
++ dsi_fclk = dsi_fclk_rate();
++
++ for (n = 1; n < (1 << 13) - 1; ++n) {
++ mhz = dsi_fclk / n;
++ if (mhz <= 20*1000*1000)
++ break;
++ }
++
++ if (n == (1 << 13) - 1) {
++ DSSERR("Failed to find LP_CLK_DIVISOR\n");
++ return -EINVAL;
++ }
++
++ DSSDBG("LP_CLK_DIV %d, LP_CLK %ld\n", n, mhz);
++
++ REG_FLD_MOD(DSI_CLK_CTRL, n, 12, 0); /* LP_CLK_DIVISOR */
++ if (dsi_fclk > 30*1000*1000)
++ REG_FLD_MOD(DSI_CLK_CTRL, 1, 21, 21); /* LP_RX_SYNCHRO_ENABLE */
++
++ return 0;
++}
++
++
++enum dsi_pll_power_state {
++ DSI_PLL_POWER_OFF = 0x0,
++ DSI_PLL_POWER_ON_HSCLK = 0x1,
++ DSI_PLL_POWER_ON_ALL = 0x2,
++ DSI_PLL_POWER_ON_DIV = 0x3,
++};
++
++static int dsi_pll_power(enum dsi_pll_power_state state)
++{
++ int t = 0;
++
++ REG_FLD_MOD(DSI_CLK_CTRL, state, 31, 30); /* PLL_PWR_CMD */
++
++ /* PLL_PWR_STATUS */
++ while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) {
++ udelay(1);
++ if (t++ > 1000) {
++ DSSERR("Failed to set DSI PLL power mode to %d\n",
++ state);
++ return -ENODEV;
++ }
++ }
++
++ return 0;
++}
++
++int dsi_pll_calc_pck(bool is_tft, unsigned long req_pck,
++ struct dsi_clock_info *cinfo)
++{
++ struct dsi_clock_info cur, best;
++ int min_fck_per_pck;
++ int match = 0;
++
++ if (req_pck == dsi.cache_req_pck &&
++ dsi.cache_cinfo.clkin == dss_clk_get_rate(DSS_CLK_FCK2)) {
++ DSSDBG("DSI clock info found from cache\n");
++ *cinfo = dsi.cache_cinfo;
++ return 0;
++ }
++
++ min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
++
++ if (min_fck_per_pck &&
++ req_pck * min_fck_per_pck > DISPC_MAX_FCK) {
++ DSSERR("Requested pixel clock not possible with the current "
++ "OMAP2_DSS_MIN_FCK_PER_PCK setting. Turning "
++ "the constraint off.\n");
++ min_fck_per_pck = 0;
++ }
++
++ DSSDBG("dsi_pll_calc\n");
++
++retry:
++ memset(&best, 0, sizeof(best));
++
++ memset(&cur, 0, sizeof(cur));
++ cur.clkin = dss_clk_get_rate(DSS_CLK_FCK2);
++ cur.use_dss2_fck = 1;
++ cur.highfreq = 0;
++
++ /* no highfreq: 0.75MHz < Fint = clkin / regn < 2.1MHz */
++ /* highfreq: 0.75MHz < Fint = clkin / (2*regn) < 2.1MHz */
++ /* To reduce PLL lock time, keep Fint high (around 2 MHz) */
++ for (cur.regn = 1; cur.regn < REGN_MAX; ++cur.regn) {
++ if (cur.highfreq == 0)
++ cur.fint = cur.clkin / cur.regn;
++ else
++ cur.fint = cur.clkin / (2 * cur.regn);
++
++ if (cur.fint > FINT_MAX || cur.fint < FINT_MIN)
++ continue;
++
++ /* DSIPHY(MHz) = (2 * regm / regn) * (clkin / (highfreq + 1)) */
++ for (cur.regm = 1; cur.regm < REGM_MAX; ++cur.regm) {
++ unsigned long a, b;
++
++ a = 2 * cur.regm * (cur.clkin/1000);
++ b = cur.regn * (cur.highfreq + 1);
++ cur.dsiphy = a / b * 1000;
++
++ if (cur.dsiphy > 1800 * 1000 * 1000)
++ break;
++
++ /* DSI1_PLL_FCLK(MHz) = DSIPHY(MHz) / regm3 < 173MHz */
++ for (cur.regm3 = 1; cur.regm3 < REGM3_MAX;
++ ++cur.regm3) {
++ cur.dsi1_pll_fclk = cur.dsiphy / cur.regm3;
++
++ /* this will narrow down the search a bit,
++ * but still give pixclocks below what was
++ * requested */
++ if (cur.dsi1_pll_fclk < req_pck)
++ break;
++
++ if (cur.dsi1_pll_fclk > DISPC_MAX_FCK)
++ continue;
++
++ if (min_fck_per_pck &&
++ cur.dsi1_pll_fclk <
++ req_pck * min_fck_per_pck)
++ continue;
++
++ match = 1;
++
++ find_lck_pck_divs(is_tft, req_pck,
++ cur.dsi1_pll_fclk,
++ &cur.lck_div,
++ &cur.pck_div);
++
++ cur.lck = cur.dsi1_pll_fclk / cur.lck_div;
++ cur.pck = cur.lck / cur.pck_div;
++
++ if (abs(cur.pck - req_pck) <
++ abs(best.pck - req_pck)) {
++ best = cur;
++
++ if (cur.pck == req_pck)
++ goto found;
++ }
++ }
++ }
++ }
++found:
++ if (!match) {
++ if (min_fck_per_pck) {
++ DSSERR("Could not find suitable clock settings.\n"
++ "Turning FCK/PCK constraint off and"
++ "trying again.\n");
++ min_fck_per_pck = 0;
++ goto retry;
++ }
++
++ DSSERR("Could not find suitable clock settings.\n");
++
++ return -EINVAL;
++ }
++
++ /* DSI2_PLL_FCLK (regm4) is not used. Set it to something sane. */
++ best.regm4 = best.dsiphy / 48000000;
++ if (best.regm4 > REGM4_MAX)
++ best.regm4 = REGM4_MAX;
++ else if (best.regm4 == 0)
++ best.regm4 = 1;
++ best.dsi2_pll_fclk = best.dsiphy / best.regm4;
++
++ if (cinfo)
++ *cinfo = best;
++
++ dsi.cache_req_pck = req_pck;
++ dsi.cache_clk_freq = 0;
++ dsi.cache_cinfo = best;
++
++ return 0;
++}
++
++static int dsi_pll_calc_ddrfreq(unsigned long clk_freq,
++ struct dsi_clock_info *cinfo)
++{
++ struct dsi_clock_info cur, best;
++ const bool use_dss2_fck = 1;
++ unsigned long datafreq;
++
++ DSSDBG("dsi_pll_calc_ddrfreq\n");
++
++ if (clk_freq == dsi.cache_clk_freq &&
++ dsi.cache_cinfo.clkin == dss_clk_get_rate(DSS_CLK_FCK2)) {
++ DSSDBG("DSI clock info found from cache\n");
++ *cinfo = dsi.cache_cinfo;
++ return 0;
++ }
++
++ datafreq = clk_freq * 4;
++
++ memset(&best, 0, sizeof(best));
++
++ memset(&cur, 0, sizeof(cur));
++ cur.use_dss2_fck = use_dss2_fck;
++ if (use_dss2_fck) {
++ cur.clkin = dss_clk_get_rate(DSS_CLK_FCK2);
++ cur.highfreq = 0;
++ } else {
++ cur.clkin = dispc_pclk_rate();
++ if (cur.clkin < 32000000)
++ cur.highfreq = 0;
++ else
++ cur.highfreq = 1;
++ }
++
++ /* no highfreq: 0.75MHz < Fint = clkin / regn < 2.1MHz */
++ /* highfreq: 0.75MHz < Fint = clkin / (2*regn) < 2.1MHz */
++ /* To reduce PLL lock time, keep Fint high (around 2 MHz) */
++ for (cur.regn = 1; cur.regn < REGN_MAX; ++cur.regn) {
++ if (cur.highfreq == 0)
++ cur.fint = cur.clkin / cur.regn;
++ else
++ cur.fint = cur.clkin / (2 * cur.regn);
++
++ if (cur.fint > FINT_MAX || cur.fint < FINT_MIN)
++ continue;
++
++ /* DSIPHY(MHz) = (2 * regm / regn) * (clkin / (highfreq + 1)) */
++ for (cur.regm = 1; cur.regm < REGM_MAX; ++cur.regm) {
++ unsigned long a, b;
++
++ a = 2 * cur.regm * (cur.clkin/1000);
++ b = cur.regn * (cur.highfreq + 1);
++ cur.dsiphy = a / b * 1000;
++
++ if (cur.dsiphy > 1800 * 1000 * 1000)
++ break;
++
++ if (abs(cur.dsiphy - datafreq) <
++ abs(best.dsiphy - datafreq)) {
++ best = cur;
++ /* DSSDBG("best %ld\n", best.dsiphy); */
++ }
++
++ if (cur.dsiphy == datafreq)
++ goto found;
++ }
++ }
++found:
++ /* DSI1_PLL_FCLK (regm3) is not used. Set it to something sane. */
++ best.regm3 = best.dsiphy / 48000000;
++ if (best.regm3 > REGM3_MAX)
++ best.regm3 = REGM3_MAX;
++ else if (best.regm3 == 0)
++ best.regm3 = 1;
++ best.dsi1_pll_fclk = best.dsiphy / best.regm3;
++
++ /* DSI2_PLL_FCLK (regm4) is not used. Set it to something sane. */
++ best.regm4 = best.dsiphy / 48000000;
++ if (best.regm4 > REGM4_MAX)
++ best.regm4 = REGM4_MAX;
++ else if (best.regm4 == 0)
++ best.regm4 = 1;
++ best.dsi2_pll_fclk = best.dsiphy / best.regm4;
++
++ if (cinfo)
++ *cinfo = best;
++
++ dsi.cache_clk_freq = clk_freq;
++ dsi.cache_req_pck = 0;
++ dsi.cache_cinfo = best;
++
++ return 0;
++}
++
++int dsi_pll_program(struct dsi_clock_info *cinfo)
++{
++ int r = 0;
++ u32 l;
++
++ DSSDBG("dsi_pll_program\n");
++
++ dsi.dsiphy = cinfo->dsiphy;
++ dsi.ddr_clk = dsi.dsiphy / 4;
++ dsi.dsi1_pll_fclk = cinfo->dsi1_pll_fclk;
++ dsi.dsi2_pll_fclk = cinfo->dsi2_pll_fclk;
++
++ DSSDBG("DSI Fint %ld\n", cinfo->fint);
++
++ DSSDBG("clkin (%s) rate %ld, highfreq %d\n",
++ cinfo->use_dss2_fck ? "dss2_fck" : "pclkfree",
++ cinfo->clkin,
++ cinfo->highfreq);
++
++ /* DSIPHY == CLKIN4DDR */
++ DSSDBG("DSIPHY = 2 * %d / %d * %lu / %d = %lu\n",
++ cinfo->regm,
++ cinfo->regn,
++ cinfo->clkin,
++ cinfo->highfreq + 1,
++ cinfo->dsiphy);
++
++ DSSDBG("Data rate on 1 DSI lane %ld Mbps\n",
++ dsi.dsiphy / 1000 / 1000 / 2);
++
++ DSSDBG("Clock lane freq %ld Hz\n", dsi.ddr_clk);
++
++ DSSDBG("regm3 = %d, dsi1_pll_fclk = %lu\n",
++ cinfo->regm3, cinfo->dsi1_pll_fclk);
++ DSSDBG("regm4 = %d, dsi2_pll_fclk = %lu\n",
++ cinfo->regm4, cinfo->dsi2_pll_fclk);
++
++ REG_FLD_MOD(DSI_PLL_CONTROL, 0, 0, 0); /* DSI_PLL_AUTOMODE = manual */
++
++ l = dsi_read_reg(DSI_PLL_CONFIGURATION1);
++ l = FLD_MOD(l, 1, 0, 0); /* DSI_PLL_STOPMODE */
++ l = FLD_MOD(l, cinfo->regn - 1, 7, 1); /* DSI_PLL_REGN */
++ l = FLD_MOD(l, cinfo->regm, 18, 8); /* DSI_PLL_REGM */
++ l = FLD_MOD(l, cinfo->regm3 - 1, 22, 19); /* DSI_CLOCK_DIV */
++ l = FLD_MOD(l, cinfo->regm4 - 1, 26, 23); /* DSIPROTO_CLOCK_DIV */
++ dsi_write_reg(DSI_PLL_CONFIGURATION1, l);
++
++ l = dsi_read_reg(DSI_PLL_CONFIGURATION2);
++ l = FLD_MOD(l, 7, 4, 1); /* DSI_PLL_FREQSEL */
++ /* DSI_PLL_CLKSEL */
++ l = FLD_MOD(l, cinfo->use_dss2_fck ? 0 : 1, 11, 11);
++ l = FLD_MOD(l, cinfo->highfreq, 12, 12); /* DSI_PLL_HIGHFREQ */
++ l = FLD_MOD(l, 1, 13, 13); /* DSI_PLL_REFEN */
++ l = FLD_MOD(l, 0, 14, 14); /* DSIPHY_CLKINEN */
++ l = FLD_MOD(l, 1, 20, 20); /* DSI_HSDIVBYPASS */
++ dsi_write_reg(DSI_PLL_CONFIGURATION2, l);
++
++ REG_FLD_MOD(DSI_PLL_GO, 1, 0, 0); /* DSI_PLL_GO */
++
++ if (wait_for_bit_change(DSI_PLL_GO, 0, 0) != 0) {
++ DSSERR("dsi pll go bit not going down.\n");
++ r = -EIO;
++ goto err;
++ }
++
++ if (wait_for_bit_change(DSI_PLL_STATUS, 1, 1) != 1) {
++ DSSERR("cannot lock PLL\n");
++ r = -EIO;
++ goto err;
++ }
++
++ dsi.pll_locked = 1;
++
++ l = dsi_read_reg(DSI_PLL_CONFIGURATION2);
++ l = FLD_MOD(l, 0, 0, 0); /* DSI_PLL_IDLE */
++ l = FLD_MOD(l, 0, 5, 5); /* DSI_PLL_PLLLPMODE */
++ l = FLD_MOD(l, 0, 6, 6); /* DSI_PLL_LOWCURRSTBY */
++ l = FLD_MOD(l, 0, 7, 7); /* DSI_PLL_TIGHTPHASELOCK */
++ l = FLD_MOD(l, 0, 8, 8); /* DSI_PLL_DRIFTGUARDEN */
++ l = FLD_MOD(l, 0, 10, 9); /* DSI_PLL_LOCKSEL */
++ l = FLD_MOD(l, 1, 13, 13); /* DSI_PLL_REFEN */
++ l = FLD_MOD(l, 1, 14, 14); /* DSIPHY_CLKINEN */
++ l = FLD_MOD(l, 0, 15, 15); /* DSI_BYPASSEN */
++ l = FLD_MOD(l, 1, 16, 16); /* DSS_CLOCK_EN */
++ l = FLD_MOD(l, 0, 17, 17); /* DSS_CLOCK_PWDN */
++ l = FLD_MOD(l, 1, 18, 18); /* DSI_PROTO_CLOCK_EN */
++ l = FLD_MOD(l, 0, 19, 19); /* DSI_PROTO_CLOCK_PWDN */
++ l = FLD_MOD(l, 0, 20, 20); /* DSI_HSDIVBYPASS */
++ dsi_write_reg(DSI_PLL_CONFIGURATION2, l);
++
++ DSSDBG("PLL config done\n");
++err:
++ return r;
++}
++
++int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
++{
++ int r = 0;
++ enum dsi_pll_power_state pwstate;
++ struct dispc_clock_info cinfo;
++
++ DSSDBG("PLL init\n");
++
++ enable_clocks(1);
++ dsi_enable_pll_clock(1);
++
++ /* configure dispc fck and pixel clock to something sane */
++ r = dispc_calc_clock_div(1, 48 * 1000 * 1000, &cinfo);
++ if (r)
++ goto err0;
++
++ r = dispc_set_clock_div(&cinfo);
++ if (r) {
++ DSSERR("Failed to set basic clocks\n");
++ goto err0;
++ }
++
++ r = dss_dsi_power_up();
++ if (r)
++ goto err0;
++
++ /* PLL does not come out of reset without this... */
++ dispc_pck_free_enable(1);
++
++ if (wait_for_bit_change(DSI_PLL_STATUS, 0, 1) != 1) {
++ DSSERR("PLL not coming out of reset.\n");
++ r = -ENODEV;
++ goto err1;
++ }
++
++ /* ... but if left on, we get problems when planes do not
++ * fill the whole display. No idea about this XXX */
++ dispc_pck_free_enable(0);
++
++ if (enable_hsclk && enable_hsdiv)
++ pwstate = DSI_PLL_POWER_ON_ALL;
++ else if (enable_hsclk)
++ pwstate = DSI_PLL_POWER_ON_HSCLK;
++ else if (enable_hsdiv)
++ pwstate = DSI_PLL_POWER_ON_DIV;
++ else
++ pwstate = DSI_PLL_POWER_OFF;
++
++ r = dsi_pll_power(pwstate);
++
++ if (r)
++ goto err1;
++
++ DSSDBG("PLL init done\n");
++
++ return 0;
++err1:
++ dss_dsi_power_down();
++err0:
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++ return r;
++}
++
++void dsi_pll_uninit(void)
++{
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++
++ dsi.pll_locked = 0;
++ dsi_pll_power(DSI_PLL_POWER_OFF);
++ dss_dsi_power_down();
++ DSSDBG("PLL uninit done\n");
++}
++
++unsigned long dsi_get_dsi1_pll_rate(void)
++{
++ return dsi.dsi1_pll_fclk;
++}
++
++unsigned long dsi_get_dsi2_pll_rate(void)
++{
++ return dsi.dsi2_pll_fclk;
++}
++
++void dsi_dump_clocks(struct seq_file *s)
++{
++ int clksel;
++
++ enable_clocks(1);
++
++ clksel = REG_GET(DSI_PLL_CONFIGURATION2, 11, 11);
++
++ seq_printf(s, "- dsi -\n");
++
++ seq_printf(s, "dsi fclk source = %s\n",
++ dss_get_dsi_clk_source() == 0 ?
++ "dss1_alwon_fclk" : "dsi2_pll_fclk");
++
++ seq_printf(s, "dsi pll source = %s\n",
++ clksel == 0 ?
++ "dss2_alwon_fclk" : "pclkfree");
++
++ seq_printf(s, "DSIPHY\t\t%lu\nDDR_CLK\t\t%lu\n",
++ dsi.dsiphy, dsi.ddr_clk);
++
++ seq_printf(s, "dsi1_pll_fck\t%lu (%s)\n"
++ "dsi2_pll_fck\t%lu (%s)\n",
++ dsi.dsi1_pll_fclk,
++ dss_get_dispc_clk_source() == 0 ? "off" : "on",
++ dsi.dsi2_pll_fclk,
++ dss_get_dsi_clk_source() == 0 ? "off" : "on");
++
++ enable_clocks(0);
++}
++
++void dsi_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(r))
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ DUMPREG(DSI_REVISION);
++ DUMPREG(DSI_SYSCONFIG);
++ DUMPREG(DSI_SYSSTATUS);
++ DUMPREG(DSI_IRQSTATUS);
++ DUMPREG(DSI_IRQENABLE);
++ DUMPREG(DSI_CTRL);
++ DUMPREG(DSI_COMPLEXIO_CFG1);
++ DUMPREG(DSI_COMPLEXIO_IRQ_STATUS);
++ DUMPREG(DSI_COMPLEXIO_IRQ_ENABLE);
++ DUMPREG(DSI_CLK_CTRL);
++ DUMPREG(DSI_TIMING1);
++ DUMPREG(DSI_TIMING2);
++ DUMPREG(DSI_VM_TIMING1);
++ DUMPREG(DSI_VM_TIMING2);
++ DUMPREG(DSI_VM_TIMING3);
++ DUMPREG(DSI_CLK_TIMING);
++ DUMPREG(DSI_TX_FIFO_VC_SIZE);
++ DUMPREG(DSI_RX_FIFO_VC_SIZE);
++ DUMPREG(DSI_COMPLEXIO_CFG2);
++ DUMPREG(DSI_RX_FIFO_VC_FULLNESS);
++ DUMPREG(DSI_VM_TIMING4);
++ DUMPREG(DSI_TX_FIFO_VC_EMPTINESS);
++ DUMPREG(DSI_VM_TIMING5);
++ DUMPREG(DSI_VM_TIMING6);
++ DUMPREG(DSI_VM_TIMING7);
++ DUMPREG(DSI_STOPCLK_TIMING);
++
++ DUMPREG(DSI_VC_CTRL(0));
++ DUMPREG(DSI_VC_TE(0));
++ DUMPREG(DSI_VC_LONG_PACKET_HEADER(0));
++ DUMPREG(DSI_VC_LONG_PACKET_PAYLOAD(0));
++ DUMPREG(DSI_VC_SHORT_PACKET_HEADER(0));
++ DUMPREG(DSI_VC_IRQSTATUS(0));
++ DUMPREG(DSI_VC_IRQENABLE(0));
++
++ DUMPREG(DSI_VC_CTRL(1));
++ DUMPREG(DSI_VC_TE(1));
++ DUMPREG(DSI_VC_LONG_PACKET_HEADER(1));
++ DUMPREG(DSI_VC_LONG_PACKET_PAYLOAD(1));
++ DUMPREG(DSI_VC_SHORT_PACKET_HEADER(1));
++ DUMPREG(DSI_VC_IRQSTATUS(1));
++ DUMPREG(DSI_VC_IRQENABLE(1));
++
++ DUMPREG(DSI_VC_CTRL(2));
++ DUMPREG(DSI_VC_TE(2));
++ DUMPREG(DSI_VC_LONG_PACKET_HEADER(2));
++ DUMPREG(DSI_VC_LONG_PACKET_PAYLOAD(2));
++ DUMPREG(DSI_VC_SHORT_PACKET_HEADER(2));
++ DUMPREG(DSI_VC_IRQSTATUS(2));
++ DUMPREG(DSI_VC_IRQENABLE(2));
++
++ DUMPREG(DSI_VC_CTRL(3));
++ DUMPREG(DSI_VC_TE(3));
++ DUMPREG(DSI_VC_LONG_PACKET_HEADER(3));
++ DUMPREG(DSI_VC_LONG_PACKET_PAYLOAD(3));
++ DUMPREG(DSI_VC_SHORT_PACKET_HEADER(3));
++ DUMPREG(DSI_VC_IRQSTATUS(3));
++ DUMPREG(DSI_VC_IRQENABLE(3));
++
++ DUMPREG(DSI_DSIPHY_CFG0);
++ DUMPREG(DSI_DSIPHY_CFG1);
++ DUMPREG(DSI_DSIPHY_CFG2);
++ DUMPREG(DSI_DSIPHY_CFG5);
++
++ DUMPREG(DSI_PLL_CONTROL);
++ DUMPREG(DSI_PLL_STATUS);
++ DUMPREG(DSI_PLL_GO);
++ DUMPREG(DSI_PLL_CONFIGURATION1);
++ DUMPREG(DSI_PLL_CONFIGURATION2);
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++#undef DUMPREG
++}
++
++enum dsi_complexio_power_state {
++ DSI_COMPLEXIO_POWER_OFF = 0x0,
++ DSI_COMPLEXIO_POWER_ON = 0x1,
++ DSI_COMPLEXIO_POWER_ULPS = 0x2,
++};
++
++static int dsi_complexio_power(enum dsi_complexio_power_state state)
++{
++ int t = 0;
++
++ /* PWR_CMD */
++ REG_FLD_MOD(DSI_COMPLEXIO_CFG1, state, 28, 27);
++
++ /* PWR_STATUS */
++ while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) {
++ udelay(1);
++ if (t++ > 1000) {
++ DSSERR("failed to set complexio power state to "
++ "%d\n", state);
++ return -ENODEV;
++ }
++ }
++
++ return 0;
++}
++
++static void dsi_complexio_config(struct omap_display *display)
++{
++ u32 r;
++
++ int clk_lane = display->hw_config.u.dsi.clk_lane;
++ int data1_lane = display->hw_config.u.dsi.data1_lane;
++ int data2_lane = display->hw_config.u.dsi.data2_lane;
++ int clk_pol = display->hw_config.u.dsi.clk_pol;
++ int data1_pol = display->hw_config.u.dsi.data1_pol;
++ int data2_pol = display->hw_config.u.dsi.data2_pol;
++
++ r = dsi_read_reg(DSI_COMPLEXIO_CFG1);
++ r = FLD_MOD(r, clk_lane, 2, 0);
++ r = FLD_MOD(r, clk_pol, 3, 3);
++ r = FLD_MOD(r, data1_lane, 6, 4);
++ r = FLD_MOD(r, data1_pol, 7, 7);
++ r = FLD_MOD(r, data2_lane, 10, 8);
++ r = FLD_MOD(r, data2_pol, 11, 11);
++ dsi_write_reg(DSI_COMPLEXIO_CFG1, r);
++
++ /* The configuration of the DSI complex I/O (number of data lanes,
++ position, differential order) should not be changed while
++ DSS.DSI_CLK_CRTRL[20] LP_CLK_ENABLE bit is set to 1. In order for
++ the hardware to take into account a new configuration of the complex
++ I/O (done in DSS.DSI_COMPLEXIO_CFG1 register), it is recommended to
++ follow this sequence: First set the DSS.DSI_CTRL[0] IF_EN bit to 1,
++ then reset the DSS.DSI_CTRL[0] IF_EN to 0, then set
++ DSS.DSI_CLK_CTRL[20] LP_CLK_ENABLE to 1 and finally set again the
++ DSS.DSI_CTRL[0] IF_EN bit to 1. If the sequence is not followed, the
++ DSI complex I/O configuration is unknown. */
++
++ /*
++ REG_FLD_MOD(DSI_CTRL, 1, 0, 0);
++ REG_FLD_MOD(DSI_CTRL, 0, 0, 0);
++ REG_FLD_MOD(DSI_CLK_CTRL, 1, 20, 20);
++ REG_FLD_MOD(DSI_CTRL, 1, 0, 0);
++ */
++}
++
++static inline unsigned ns2ddr(unsigned ns)
++{
++ /* convert time in ns to ddr ticks, rounding up */
++ return (ns * (dsi.ddr_clk/1000/1000) + 999) / 1000;
++}
++
++static inline unsigned ddr2ns(unsigned ddr)
++{
++ return ddr * 1000 * 1000 / (dsi.ddr_clk / 1000);
++}
++
++static void dsi_complexio_timings(void)
++{
++ u32 r;
++ u32 ths_prepare, ths_prepare_ths_zero, ths_trail, ths_exit;
++ u32 tlpx_half, tclk_trail, tclk_zero;
++ u32 tclk_prepare;
++
++ /* calculate timings */
++
++ /* 1 * DDR_CLK = 2 * UI */
++
++ /* min 40ns + 4*UI max 85ns + 6*UI */
++ ths_prepare = ns2ddr(59) + 2;
++
++ /* min 145ns + 10*UI */
++ ths_prepare_ths_zero = ns2ddr(145) + 5;
++
++ /* min max(8*UI, 60ns+4*UI) */
++ ths_trail = max((unsigned)4, ns2ddr(60) + 2);
++
++ /* min 100ns */
++ ths_exit = ns2ddr(100);
++
++ /* tlpx min 50n */
++ tlpx_half = ns2ddr(25);
++
++ /* min 60ns */
++ tclk_trail = ns2ddr(60);
++
++ /* min 38ns, max 95ns */
++ tclk_prepare = ns2ddr(38);
++
++ /* min tclk-prepare + tclk-zero = 300ns */
++ tclk_zero = ns2ddr(300 - 38);
++
++ DSSDBG("ths_prepare %u (%uns), ths_prepare_ths_zero %u (%uns)\n",
++ ths_prepare, ddr2ns(ths_prepare),
++ ths_prepare_ths_zero, ddr2ns(ths_prepare_ths_zero));
++ DSSDBG("ths_trail %u (%uns), ths_exit %u (%uns)\n",
++ ths_trail, ddr2ns(ths_trail),
++ ths_exit, ddr2ns(ths_exit));
++
++ DSSDBG("tlpx_half %u (%uns), tclk_trail %u (%uns), "
++ "tclk_zero %u (%uns)\n",
++ tlpx_half, ddr2ns(tlpx_half),
++ tclk_trail, ddr2ns(tclk_trail),
++ tclk_zero, ddr2ns(tclk_zero));
++ DSSDBG("tclk_prepare %u (%uns)\n",
++ tclk_prepare, ddr2ns(tclk_prepare));
++
++ /* program timings */
++
++ r = dsi_read_reg(DSI_DSIPHY_CFG0);
++ r = FLD_MOD(r, ths_prepare, 31, 24);
++ r = FLD_MOD(r, ths_prepare_ths_zero, 23, 16);
++ r = FLD_MOD(r, ths_trail, 15, 8);
++ r = FLD_MOD(r, ths_exit, 7, 0);
++ dsi_write_reg(DSI_DSIPHY_CFG0, r);
++
++ r = dsi_read_reg(DSI_DSIPHY_CFG1);
++ r = FLD_MOD(r, tlpx_half, 22, 16);
++ r = FLD_MOD(r, tclk_trail, 15, 8);
++ r = FLD_MOD(r, tclk_zero, 7, 0);
++ dsi_write_reg(DSI_DSIPHY_CFG1, r);
++
++ r = dsi_read_reg(DSI_DSIPHY_CFG2);
++ r = FLD_MOD(r, tclk_prepare, 7, 0);
++ dsi_write_reg(DSI_DSIPHY_CFG2, r);
++}
++
++
++static int dsi_complexio_init(struct omap_display *display)
++{
++ int r = 0;
++
++ DSSDBG("dsi_complexio_init\n");
++
++ /* CIO_CLK_ICG, enable L3 clk to CIO */
++ REG_FLD_MOD(DSI_CLK_CTRL, 1, 14, 14);
++
++ /* A dummy read using the SCP interface to any DSIPHY register is
++ * required after DSIPHY reset to complete the reset of the DSI complex
++ * I/O. */
++ dsi_read_reg(DSI_DSIPHY_CFG5);
++
++ if (wait_for_bit_change(DSI_DSIPHY_CFG5, 30, 1) != 1) {
++ DSSERR("ComplexIO PHY not coming out of reset.\n");
++ r = -ENODEV;
++ goto err;
++ }
++
++ dsi_complexio_config(display);
++
++ r = dsi_complexio_power(DSI_COMPLEXIO_POWER_ON);
++
++ if (r)
++ goto err;
++
++ if (wait_for_bit_change(DSI_COMPLEXIO_CFG1, 29, 1) != 1) {
++ DSSERR("ComplexIO not coming out of reset.\n");
++ r = -ENODEV;
++ goto err;
++ }
++
++ if (wait_for_bit_change(DSI_COMPLEXIO_CFG1, 21, 1) != 1) {
++ DSSERR("ComplexIO LDO power down.\n");
++ r = -ENODEV;
++ goto err;
++ }
++
++ dsi_complexio_timings();
++
++ /*
++ The configuration of the DSI complex I/O (number of data lanes,
++ position, differential order) should not be changed while
++ DSS.DSI_CLK_CRTRL[20] LP_CLK_ENABLE bit is set to 1. For the
++ hardware to recognize a new configuration of the complex I/O (done
++ in DSS.DSI_COMPLEXIO_CFG1 register), it is recommended to follow
++ this sequence: First set the DSS.DSI_CTRL[0] IF_EN bit to 1, next
++ reset the DSS.DSI_CTRL[0] IF_EN to 0, then set DSS.DSI_CLK_CTRL[20]
++ LP_CLK_ENABLE to 1, and finally, set again the DSS.DSI_CTRL[0] IF_EN
++ bit to 1. If the sequence is not followed, the DSi complex I/O
++ configuration is undetermined.
++ */
++ dsi_if_enable(1);
++ dsi_if_enable(0);
++ REG_FLD_MOD(DSI_CLK_CTRL, 1, 20, 20); /* LP_CLK_ENABLE */
++ dsi_if_enable(1);
++ dsi_if_enable(0);
++
++ DSSDBG("CIO init done\n");
++err:
++ return r;
++}
++
++static void dsi_complexio_uninit(void)
++{
++ dsi_complexio_power(DSI_COMPLEXIO_POWER_OFF);
++}
++
++static int _dsi_wait_reset(void)
++{
++ int i = 0;
++
++ while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) {
++ if (i++ > 5) {
++ DSSERR("soft reset failed\n");
++ return -ENODEV;
++ }
++ udelay(1);
++ }
++
++ return 0;
++}
++
++static int _dsi_reset(void)
++{
++ /* Soft reset */
++ REG_FLD_MOD(DSI_SYSCONFIG, 1, 1, 1);
++ return _dsi_wait_reset();
++}
++
++
++static void dsi_config_tx_fifo(enum fifo_size size1, enum fifo_size size2,
++ enum fifo_size size3, enum fifo_size size4)
++{
++ u32 r = 0;
++ int add = 0;
++ int i;
++
++ dsi.vc[0].fifo_size = size1;
++ dsi.vc[1].fifo_size = size2;
++ dsi.vc[2].fifo_size = size3;
++ dsi.vc[3].fifo_size = size4;
++
++ for (i = 0; i < 4; i++) {
++ u8 v;
++ int size = dsi.vc[i].fifo_size;
++
++ if (add + size > 4) {
++ DSSERR("Illegal FIFO configuration\n");
++ BUG();
++ }
++
++ v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4);
++ r |= v << (8 * i);
++ /*DSSDBG("TX FIFO vc %d: size %d, add %d\n", i, size, add); */
++ add += size;
++ }
++
++ dsi_write_reg(DSI_TX_FIFO_VC_SIZE, r);
++}
++
++static void dsi_config_rx_fifo(enum fifo_size size1, enum fifo_size size2,
++ enum fifo_size size3, enum fifo_size size4)
++{
++ u32 r = 0;
++ int add = 0;
++ int i;
++
++ dsi.vc[0].fifo_size = size1;
++ dsi.vc[1].fifo_size = size2;
++ dsi.vc[2].fifo_size = size3;
++ dsi.vc[3].fifo_size = size4;
++
++ for (i = 0; i < 4; i++) {
++ u8 v;
++ int size = dsi.vc[i].fifo_size;
++
++ if (add + size > 4) {
++ DSSERR("Illegal FIFO configuration\n");
++ BUG();
++ }
++
++ v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4);
++ r |= v << (8 * i);
++ /*DSSDBG("RX FIFO vc %d: size %d, add %d\n", i, size, add); */
++ add += size;
++ }
++
++ dsi_write_reg(DSI_RX_FIFO_VC_SIZE, r);
++}
++
++static int dsi_force_tx_stop_mode_io(void)
++{
++ u32 r;
++
++ r = dsi_read_reg(DSI_TIMING1);
++ r = FLD_MOD(r, 1, 15, 15); /* FORCE_TX_STOP_MODE_IO */
++ dsi_write_reg(DSI_TIMING1, r);
++
++ if (wait_for_bit_change(DSI_TIMING1, 15, 0) != 0) {
++ DSSERR("TX_STOP bit not going down\n");
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static void dsi_vc_print_status(int channel)
++{
++ u32 r;
++
++ r = dsi_read_reg(DSI_VC_CTRL(channel));
++ DSSDBG("vc %d: TX_FIFO_NOT_EMPTY %d, BTA_EN %d, VC_BUSY %d, "
++ "TX_FIFO_FULL %d, RX_FIFO_NOT_EMPTY %d, ",
++ channel,
++ FLD_GET(r, 5, 5),
++ FLD_GET(r, 6, 6),
++ FLD_GET(r, 15, 15),
++ FLD_GET(r, 16, 16),
++ FLD_GET(r, 20, 20));
++
++ r = dsi_read_reg(DSI_TX_FIFO_VC_EMPTINESS);
++ DSSDBG("EMPTINESS %d\n", (r >> (8 * channel)) & 0xff);
++}
++
++static void dsi_vc_config(int channel)
++{
++ u32 r;
++
++ DSSDBG("dsi_vc_config %d\n", channel);
++
++ r = dsi_read_reg(DSI_VC_CTRL(channel));
++
++ r = FLD_MOD(r, 0, 1, 1); /* SOURCE, 0 = L4 */
++ r = FLD_MOD(r, 0, 2, 2); /* BTA_SHORT_EN */
++ r = FLD_MOD(r, 0, 3, 3); /* BTA_LONG_EN */
++ r = FLD_MOD(r, 0, 4, 4); /* MODE, 0 = command */
++ r = FLD_MOD(r, 1, 7, 7); /* CS_TX_EN */
++ r = FLD_MOD(r, 1, 8, 8); /* ECC_TX_EN */
++ r = FLD_MOD(r, 0, 9, 9); /* MODE_SPEED, high speed on/off */
++
++ r = FLD_MOD(r, 4, 29, 27); /* DMA_RX_REQ_NB = no dma */
++ r = FLD_MOD(r, 4, 23, 21); /* DMA_TX_REQ_NB = no dma */
++
++ dsi_write_reg(DSI_VC_CTRL(channel), r);
++}
++
++static void dsi_vc_config_vp(int channel)
++{
++ u32 r;
++
++ DSSDBG("dsi_vc_config_vp\n");
++
++ r = dsi_read_reg(DSI_VC_CTRL(channel));
++
++ r = FLD_MOD(r, 1, 1, 1); /* SOURCE, 1 = video port */
++ r = FLD_MOD(r, 0, 2, 2); /* BTA_SHORT_EN */
++ r = FLD_MOD(r, 0, 3, 3); /* BTA_LONG_EN */
++ r = FLD_MOD(r, 0, 4, 4); /* MODE, 0 = command */
++ r = FLD_MOD(r, 1, 7, 7); /* CS_TX_EN */
++ r = FLD_MOD(r, 1, 8, 8); /* ECC_TX_EN */
++ r = FLD_MOD(r, 1, 9, 9); /* MODE_SPEED, high speed on/off */
++
++ r = FLD_MOD(r, 4, 29, 27); /* DMA_RX_REQ_NB = no dma */
++ r = FLD_MOD(r, 4, 23, 21); /* DMA_TX_REQ_NB = no dma */
++
++ dsi_write_reg(DSI_VC_CTRL(channel), r);
++}
++
++
++static int dsi_vc_enable(int channel, bool enable)
++{
++ DSSDBG("dsi_vc_enable channel %d, enable %d\n", channel, enable);
++
++ enable = enable ? 1 : 0;
++
++ REG_FLD_MOD(DSI_VC_CTRL(channel), enable, 0, 0);
++
++ if (wait_for_bit_change(DSI_VC_CTRL(channel), 0, enable) != enable) {
++ DSSERR("Failed to set dsi_vc_enable to %d\n", enable);
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static void dsi_vc_enable_hs(int channel, bool enable)
++{
++ DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable);
++
++ dsi_vc_enable(channel, 0);
++ dsi_if_enable(0);
++
++ REG_FLD_MOD(DSI_VC_CTRL(channel), enable, 9, 9);
++
++ dsi_vc_enable(channel, 1);
++ dsi_if_enable(1);
++
++ dsi_force_tx_stop_mode_io();
++}
++
++static void dsi_vc_flush_long_data(int channel)
++{
++ while (REG_GET(DSI_VC_CTRL(channel), 20, 20)) {
++ u32 val;
++ val = dsi_read_reg(DSI_VC_SHORT_PACKET_HEADER(channel));
++ DSSDBG("\t\tb1 %#02x b2 %#02x b3 %#02x b4 %#02x\n",
++ (val >> 0) & 0xff,
++ (val >> 8) & 0xff,
++ (val >> 16) & 0xff,
++ (val >> 24) & 0xff);
++ }
++}
++
++static void dsi_show_rx_ack_with_err(u16 err)
++{
++ DSSERR("\tACK with ERROR (%#x):\n", err);
++ if (err & (1 << 0))
++ DSSERR("\t\tSoT Error\n");
++ if (err & (1 << 1))
++ DSSERR("\t\tSoT Sync Error\n");
++ if (err & (1 << 2))
++ DSSERR("\t\tEoT Sync Error\n");
++ if (err & (1 << 3))
++ DSSERR("\t\tEscape Mode Entry Command Error\n");
++ if (err & (1 << 4))
++ DSSERR("\t\tLP Transmit Sync Error\n");
++ if (err & (1 << 5))
++ DSSERR("\t\tHS Receive Timeout Error\n");
++ if (err & (1 << 6))
++ DSSERR("\t\tFalse Control Error\n");
++ if (err & (1 << 7))
++ DSSERR("\t\t(reserved7)\n");
++ if (err & (1 << 8))
++ DSSERR("\t\tECC Error, single-bit (corrected)\n");
++ if (err & (1 << 9))
++ DSSERR("\t\tECC Error, multi-bit (not corrected)\n");
++ if (err & (1 << 10))
++ DSSERR("\t\tChecksum Error\n");
++ if (err & (1 << 11))
++ DSSERR("\t\tData type not recognized\n");
++ if (err & (1 << 12))
++ DSSERR("\t\tInvalid VC ID\n");
++ if (err & (1 << 13))
++ DSSERR("\t\tInvalid Transmission Length\n");
++ if (err & (1 << 14))
++ DSSERR("\t\t(reserved14)\n");
++ if (err & (1 << 15))
++ DSSERR("\t\tDSI Protocol Violation\n");
++}
++
++static u16 dsi_vc_flush_receive_data(int channel)
++{
++ /* RX_FIFO_NOT_EMPTY */
++ while (REG_GET(DSI_VC_CTRL(channel), 20, 20)) {
++ u32 val;
++ u8 dt;
++ val = dsi_read_reg(DSI_VC_SHORT_PACKET_HEADER(channel));
++ DSSDBG("\trawval %#08x\n", val);
++ dt = FLD_GET(val, 5, 0);
++ if (dt == DSI_DT_RX_ACK_WITH_ERR) {
++ u16 err = FLD_GET(val, 23, 8);
++ dsi_show_rx_ack_with_err(err);
++ } else if (dt == DSI_DT_RX_SHORT_READ_1) {
++ DSSDBG("\tDCS short response, 1 byte: %#x\n",
++ FLD_GET(val, 23, 8));
++ } else if (dt == DSI_DT_RX_SHORT_READ_2) {
++ DSSDBG("\tDCS short response, 2 byte: %#x\n",
++ FLD_GET(val, 23, 8));
++ } else if (dt == DSI_DT_RX_DCS_LONG_READ) {
++ DSSDBG("\tDCS long response, len %d\n",
++ FLD_GET(val, 23, 8));
++ dsi_vc_flush_long_data(channel);
++ } else {
++ DSSERR("\tunknown datatype 0x%02x\n", dt);
++ }
++ }
++ return 0;
++}
++
++static int dsi_vc_send_bta(int channel)
++{
++ unsigned long tmo;
++
++ /*DSSDBG("dsi_vc_send_bta_sync %d\n", channel); */
++
++ if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) { /* RX_FIFO_NOT_EMPTY */
++ DSSERR("rx fifo not empty when sending BTA, dumping data:\n");
++ dsi_vc_flush_receive_data(channel);
++ }
++
++ REG_FLD_MOD(DSI_VC_CTRL(channel), 1, 6, 6); /* BTA_EN */
++
++ tmo = jiffies + msecs_to_jiffies(10);
++ while (REG_GET(DSI_VC_CTRL(channel), 6, 6) == 1) {
++ if (time_after(jiffies, tmo)) {
++ DSSERR("Failed to send BTA\n");
++ return -EIO;
++ }
++ }
++
++ return 0;
++}
++
++static int dsi_vc_send_bta_sync(int channel)
++{
++ int r = 0;
++
++ init_completion(&dsi.bta_completion);
++
++ dsi_vc_enable_bta_irq(channel);
++
++ r = dsi_vc_send_bta(channel);
++ if (r)
++ goto err;
++
++ if (wait_for_completion_timeout(&dsi.bta_completion,
++ msecs_to_jiffies(500)) == 0) {
++ DSSERR("Failed to receive BTA\n");
++ r = -EIO;
++ goto err;
++ }
++err:
++ dsi_vc_disable_bta_irq(channel);
++
++ return r;
++}
++
++static inline void dsi_vc_write_long_header(int channel, u8 data_type,
++ u16 len, u8 ecc)
++{
++ u32 val;
++ u8 data_id;
++
++ /*data_id = data_type | channel << 6; */
++ data_id = data_type | dsi.vc[channel].dest_per << 6;
++
++ val = FLD_VAL(data_id, 7, 0) | FLD_VAL(len, 23, 8) |
++ FLD_VAL(ecc, 31, 24);
++
++ dsi_write_reg(DSI_VC_LONG_PACKET_HEADER(channel), val);
++}
++
++static inline void dsi_vc_write_long_payload(int channel,
++ u8 b1, u8 b2, u8 b3, u8 b4)
++{
++ u32 val;
++
++ val = b4 << 24 | b3 << 16 | b2 << 8 | b1 << 0;
++
++/* DSSDBG("\twriting %02x, %02x, %02x, %02x (%#010x)\n",
++ b1, b2, b3, b4, val); */
++
++ dsi_write_reg(DSI_VC_LONG_PACKET_PAYLOAD(channel), val);
++}
++
++static int dsi_vc_send_long(int channel, u8 data_type, u8 *data, u16 len,
++ u8 ecc)
++{
++ /*u32 val; */
++ int i;
++ u8 *p;
++ int r = 0;
++ u8 b1, b2, b3, b4;
++
++ if (dsi.debug_write)
++ DSSDBG("dsi_vc_send_long, %d bytes\n", len);
++
++ /* len + header */
++ if (dsi.vc[channel].fifo_size * 32 * 4 < len + 4) {
++ DSSERR("unable to send long packet: packet too long.\n");
++ return -EINVAL;
++ }
++
++ dsi_vc_write_long_header(channel, data_type, len, ecc);
++
++ /*dsi_vc_print_status(0); */
++
++ p = data;
++ for (i = 0; i < len >> 2; i++) {
++ if (dsi.debug_write)
++ DSSDBG("\tsending full packet %d\n", i);
++ /*dsi_vc_print_status(0); */
++
++ b1 = *p++;
++ b2 = *p++;
++ b3 = *p++;
++ b4 = *p++;
++
++ dsi_vc_write_long_payload(channel, b1, b2, b3, b4);
++ }
++
++ i = len % 4;
++ if (i) {
++ b1 = 0; b2 = 0; b3 = 0;
++
++ if (dsi.debug_write)
++ DSSDBG("\tsending remainder bytes %d\n", i);
++
++ switch (i) {
++ case 3:
++ b1 = *p++;
++ b2 = *p++;
++ b3 = *p++;
++ break;
++ case 2:
++ b1 = *p++;
++ b2 = *p++;
++ break;
++ case 1:
++ b1 = *p++;
++ break;
++ }
++
++ dsi_vc_write_long_payload(channel, b1, b2, b3, 0);
++ }
++
++ return r;
++}
++
++static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
++{
++ u32 r;
++ u8 data_id;
++
++ if (dsi.debug_write)
++ DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n",
++ channel,
++ data_type, data & 0xff, (data >> 8) & 0xff);
++
++ if (FLD_GET(dsi_read_reg(DSI_VC_CTRL(channel)), 16, 16)) {
++ DSSERR("ERROR FIFO FULL, aborting transfer\n");
++ return -EINVAL;
++ }
++
++ data_id = data_type | channel << 6;
++
++ r = (data_id << 0) | (data << 8) | (ecc << 24);
++
++ dsi_write_reg(DSI_VC_SHORT_PACKET_HEADER(channel), r);
++
++ return 0;
++}
++
++int dsi_vc_send_null(int channel)
++{
++ u8 nullpkg[] = {0, 0, 0, 0};
++ return dsi_vc_send_long(0, DSI_DT_NULL_PACKET, nullpkg, 4, 0);
++}
++EXPORT_SYMBOL(dsi_vc_send_null);
++
++int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len)
++{
++ int r;
++
++ BUG_ON(len == 0);
++
++ if (len == 1) {
++ r = dsi_vc_send_short(channel, DSI_DT_DCS_SHORT_WRITE_0,
++ data[0], 0);
++ } else if (len == 2) {
++ r = dsi_vc_send_short(channel, DSI_DT_DCS_SHORT_WRITE_1,
++ data[0] | (data[1] << 8), 0);
++ } else {
++ /* 0x39 = DCS Long Write */
++ r = dsi_vc_send_long(channel, DSI_DT_DCS_LONG_WRITE,
++ data, len, 0);
++ }
++
++ return r;
++}
++EXPORT_SYMBOL(dsi_vc_dcs_write_nosync);
++
++int dsi_vc_dcs_write(int channel, u8 *data, int len)
++{
++ int r;
++
++ r = dsi_vc_dcs_write_nosync(channel, data, len);
++ if (r)
++ return r;
++
++ /* Some devices need time to process the msg in low power mode.
++ This also makes the write synchronous, and checks that
++ the peripheral is still alive */
++ r = dsi_vc_send_bta_sync(channel);
++
++ return r;
++}
++EXPORT_SYMBOL(dsi_vc_dcs_write);
++
++int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen)
++{
++ u32 val;
++ u8 dt;
++ int r;
++
++ if (dsi.debug_read)
++ DSSDBG("dsi_vc_dcs_read\n");
++
++ r = dsi_vc_send_short(channel, DSI_DT_DCS_READ, dcs_cmd, 0);
++ if (r)
++ return r;
++
++ r = dsi_vc_send_bta_sync(channel);
++ if (r)
++ return r;
++
++ if (REG_GET(DSI_VC_CTRL(channel), 20, 20) == 0) { /* RX_FIFO_NOT_EMPTY */
++ DSSERR("RX fifo empty when trying to read.\n");
++ return -EIO;
++ }
++
++ val = dsi_read_reg(DSI_VC_SHORT_PACKET_HEADER(channel));
++ if (dsi.debug_read)
++ DSSDBG("\theader: %08x\n", val);
++ dt = FLD_GET(val, 5, 0);
++ if (dt == DSI_DT_RX_ACK_WITH_ERR) {
++ u16 err = FLD_GET(val, 23, 8);
++ dsi_show_rx_ack_with_err(err);
++ return -1;
++
++ } else if (dt == DSI_DT_RX_SHORT_READ_1) {
++ u8 data = FLD_GET(val, 15, 8);
++ if (dsi.debug_read)
++ DSSDBG("\tDCS short response, 1 byte: %02x\n", data);
++
++ if (buflen < 1)
++ return -1;
++
++ buf[0] = data;
++
++ return 1;
++ } else if (dt == DSI_DT_RX_SHORT_READ_2) {
++ u16 data = FLD_GET(val, 23, 8);
++ if (dsi.debug_read)
++ DSSDBG("\tDCS short response, 2 byte: %04x\n", data);
++
++ if (buflen < 2)
++ return -1;
++
++ buf[0] = data & 0xff;
++ buf[1] = (data >> 8) & 0xff;
++
++ return 2;
++ } else if (dt == DSI_DT_RX_DCS_LONG_READ) {
++ int w;
++ int len = FLD_GET(val, 23, 8);
++ if (dsi.debug_read)
++ DSSDBG("\tDCS long response, len %d\n", len);
++
++ if (len > buflen)
++ return -1;
++
++ /* two byte checksum ends the packet, not included in len */
++ for (w = 0; w < len + 2;) {
++ int b;
++ val = dsi_read_reg(DSI_VC_SHORT_PACKET_HEADER(channel));
++ if (dsi.debug_read)
++ DSSDBG("\t\t%02x %02x %02x %02x\n",
++ (val >> 0) & 0xff,
++ (val >> 8) & 0xff,
++ (val >> 16) & 0xff,
++ (val >> 24) & 0xff);
++
++ for (b = 0; b < 4; ++b) {
++ if (w < len)
++ buf[w] = (val >> (b * 8)) & 0xff;
++ /* we discard the 2 byte checksum */
++ ++w;
++ }
++ }
++
++ return len;
++
++ } else {
++ DSSERR("\tunknown datatype 0x%02x\n", dt);
++ return -1;
++ }
++}
++EXPORT_SYMBOL(dsi_vc_dcs_read);
++
++
++int dsi_vc_set_max_rx_packet_size(int channel, u16 len)
++{
++ return dsi_vc_send_short(channel, DSI_DT_SET_MAX_RET_PKG_SIZE,
++ len, 0);
++}
++EXPORT_SYMBOL(dsi_vc_set_max_rx_packet_size);
++
++
++static int dsi_set_lp_rx_timeout(int ns, int x4, int x16)
++{
++ u32 r;
++ unsigned long fck;
++ int ticks;
++
++ /* ticks in DSI_FCK */
++
++ fck = dsi_fclk_rate();
++ ticks = (fck / 1000 / 1000) * ns / 1000;
++
++ if (ticks > 0x1fff) {
++ DSSERR("LP_TX_TO too high\n");
++ return -EINVAL;
++ }
++
++ r = dsi_read_reg(DSI_TIMING2);
++ r = FLD_MOD(r, 1, 15, 15); /* LP_RX_TO */
++ r = FLD_MOD(r, x16, 14, 14); /* LP_RX_TO_X16 */
++ r = FLD_MOD(r, x4, 13, 13); /* LP_RX_TO_X4 */
++ r = FLD_MOD(r, ticks, 12, 0); /* LP_RX_COUNTER */
++ dsi_write_reg(DSI_TIMING2, r);
++
++ DSSDBG("LP_RX_TO %ld ns (%#x ticks)\n",
++ (ticks * (x16 ? 16 : 1) * (x4 ? 4 : 1) * 1000) /
++ (fck / 1000 / 1000),
++ ticks);
++
++ return 0;
++}
++
++static int dsi_set_ta_timeout(int ns, int x8, int x16)
++{
++ u32 r;
++ unsigned long fck;
++ int ticks;
++
++ /* ticks in DSI_FCK */
++
++ fck = dsi_fclk_rate();
++ ticks = (fck / 1000 / 1000) * ns / 1000;
++
++ if (ticks > 0x1fff) {
++ DSSERR("TA_TO too high\n");
++ return -EINVAL;
++ }
++
++ r = dsi_read_reg(DSI_TIMING1);
++ r = FLD_MOD(r, 1, 31, 31); /* TA_TO */
++ r = FLD_MOD(r, x16, 30, 30); /* TA_TO_X16 */
++ r = FLD_MOD(r, x8, 29, 29); /* TA_TO_X8 */
++ r = FLD_MOD(r, ticks, 28, 16); /* TA_TO_COUNTER */
++ dsi_write_reg(DSI_TIMING1, r);
++
++ DSSDBG("TA_TO %ld ns (%#x ticks)\n",
++ (ticks * (x16 ? 16 : 1) * (x8 ? 8 : 1) * 1000) /
++ (fck / 1000 / 1000),
++ ticks);
++
++ return 0;
++}
++
++static int dsi_set_stop_state_counter(int ns, int x4, int x16)
++{
++ u32 r;
++ unsigned long fck;
++ int ticks;
++
++ /* ticks in DSI_FCK */
++
++ fck = dsi_fclk_rate();
++ ticks = (fck / 1000 / 1000) * ns / 1000;
++
++ if (ticks > 0x1fff) {
++ DSSERR("STOP_STATE_COUNTER_IO too high\n");
++ return -EINVAL;
++ }
++
++ r = dsi_read_reg(DSI_TIMING1);
++ r = FLD_MOD(r, 1, 15, 15); /* FORCE_TX_STOP_MODE_IO */
++ r = FLD_MOD(r, x16, 14, 14); /* STOP_STATE_X16_IO */
++ r = FLD_MOD(r, x4, 13, 13); /* STOP_STATE_X4_IO */
++ r = FLD_MOD(r, ticks, 12, 0); /* STOP_STATE_COUNTER_IO */
++ dsi_write_reg(DSI_TIMING1, r);
++
++ DSSDBG("STOP_STATE_COUNTER %ld ns (%#x ticks)\n",
++ (ticks * (x16 ? 16 : 1) * (x4 ? 4 : 1) * 1000) /
++ (fck / 1000 / 1000),
++ ticks);
++
++ return 0;
++}
++
++static int dsi_set_hs_tx_timeout(int ns, int x4, int x16)
++{
++ u32 r;
++ unsigned long fck;
++ int ticks;
++
++ /* ticks in TxByteClkHS */
++
++ fck = dsi.ddr_clk / 4;
++ ticks = (fck / 1000 / 1000) * ns / 1000;
++
++ if (ticks > 0x1fff) {
++ DSSERR("HS_TX_TO too high\n");
++ return -EINVAL;
++ }
++
++ r = dsi_read_reg(DSI_TIMING2);
++ r = FLD_MOD(r, 1, 31, 31); /* HS_TX_TO */
++ r = FLD_MOD(r, x16, 30, 30); /* HS_TX_TO_X16 */
++ r = FLD_MOD(r, x4, 29, 29); /* HS_TX_TO_X8 (4 really) */
++ r = FLD_MOD(r, ticks, 28, 16); /* HS_TX_TO_COUNTER */
++ dsi_write_reg(DSI_TIMING2, r);
++
++ DSSDBG("HS_TX_TO %ld ns (%#x ticks)\n",
++ (ticks * (x16 ? 16 : 1) * (x4 ? 4 : 1) * 1000) /
++ (fck / 1000 / 1000),
++ ticks);
++
++ return 0;
++}
++static int dsi_proto_config(struct omap_display *display)
++{
++ u32 r;
++ int buswidth = 0;
++
++ dsi_config_tx_fifo(DSI_FIFO_SIZE_128,
++ DSI_FIFO_SIZE_0,
++ DSI_FIFO_SIZE_0,
++ DSI_FIFO_SIZE_0);
++
++ dsi_config_rx_fifo(DSI_FIFO_SIZE_128,
++ DSI_FIFO_SIZE_0,
++ DSI_FIFO_SIZE_0,
++ DSI_FIFO_SIZE_0);
++
++ /* XXX what values for the timeouts? */
++ dsi_set_stop_state_counter(1000, 0, 0);
++
++ dsi_set_ta_timeout(50000, 1, 1);
++
++ /* 3000ns * 16 */
++ dsi_set_lp_rx_timeout(3000, 0, 1);
++
++ /* 10000ns * 4 */
++ dsi_set_hs_tx_timeout(10000, 1, 0);
++
++ switch (display->ctrl->pixel_size) {
++ case 16:
++ buswidth = 0;
++ break;
++ case 18:
++ buswidth = 1;
++ break;
++ case 24:
++ buswidth = 2;
++ break;
++ default:
++ BUG();
++ }
++
++ r = dsi_read_reg(DSI_CTRL);
++ r = FLD_MOD(r, 1, 1, 1); /* CS_RX_EN */
++ r = FLD_MOD(r, 1, 2, 2); /* ECC_RX_EN */
++ r = FLD_MOD(r, 1, 3, 3); /* TX_FIFO_ARBITRATION */
++ /* XXX what should the ratio be */
++ r = FLD_MOD(r, 0, 4, 4); /* VP_CLK_RATIO, VP_PCLK = VP_CLK/2 */
++ r = FLD_MOD(r, buswidth, 7, 6); /* VP_DATA_BUS_WIDTH */
++ r = FLD_MOD(r, 0, 8, 8); /* VP_CLK_POL */
++ r = FLD_MOD(r, 2, 13, 12); /* LINE_BUFFER, 2 lines */
++ r = FLD_MOD(r, 1, 14, 14); /* TRIGGER_RESET_MODE */
++ r = FLD_MOD(r, 1, 19, 19); /* EOT_ENABLE */
++ r = FLD_MOD(r, 1, 24, 24); /* DCS_CMD_ENABLE */
++ r = FLD_MOD(r, 0, 25, 25); /* DCS_CMD_CODE, 1=start, 0=continue */
++
++ dsi_write_reg(DSI_CTRL, r);
++
++ /* we configure vc0 for L4 communication, and
++ * vc1 for dispc */
++ dsi_vc_config(0);
++ dsi_vc_config_vp(1);
++
++ /* set all vc targets to peripheral 0 */
++ dsi.vc[0].dest_per = 0;
++ dsi.vc[1].dest_per = 0;
++ dsi.vc[2].dest_per = 0;
++ dsi.vc[3].dest_per = 0;
++
++ return 0;
++}
++
++static void dsi_proto_timings(void)
++{
++ int tlpx_half, tclk_zero, tclk_prepare, tclk_trail;
++ int tclk_pre, tclk_post;
++ int ddr_clk_pre, ddr_clk_post;
++ u32 r;
++
++ r = dsi_read_reg(DSI_DSIPHY_CFG1);
++ tlpx_half = FLD_GET(r, 22, 16);
++ tclk_trail = FLD_GET(r, 15, 8);
++ tclk_zero = FLD_GET(r, 7, 0);
++
++ r = dsi_read_reg(DSI_DSIPHY_CFG2);
++ tclk_prepare = FLD_GET(r, 7, 0);
++
++ /* min 8*UI */
++ tclk_pre = 20;
++ /* min 60ns + 52*UI */
++ tclk_post = ns2ddr(60) + 26;
++
++ ddr_clk_pre = (tclk_pre + tlpx_half*2 + tclk_zero + tclk_prepare) / 4;
++ ddr_clk_post = (tclk_post + tclk_trail) / 4;
++
++ r = dsi_read_reg(DSI_CLK_TIMING);
++ r = FLD_MOD(r, ddr_clk_pre, 15, 8);
++ r = FLD_MOD(r, ddr_clk_post, 7, 0);
++ dsi_write_reg(DSI_CLK_TIMING, r);
++
++ DSSDBG("ddr_clk_pre %d, ddr_clk_post %d\n",
++ ddr_clk_pre,
++ ddr_clk_post);
++}
++
++
++#define DSI_DECL_VARS \
++ int __dsi_cb = 0; u32 __dsi_cv = 0;
++
++#define DSI_FLUSH(ch) \
++ if (__dsi_cb > 0) { \
++ /*DSSDBG("sending long packet %#010x\n", __dsi_cv);*/ \
++ dsi_write_reg(DSI_VC_LONG_PACKET_PAYLOAD(ch), __dsi_cv); \
++ __dsi_cb = __dsi_cv = 0; \
++ }
++
++#define DSI_PUSH(ch, data) \
++ do { \
++ __dsi_cv |= (data) << (__dsi_cb * 8); \
++ /*DSSDBG("cv = %#010x, cb = %d\n", __dsi_cv, __dsi_cb);*/ \
++ if (++__dsi_cb > 3) \
++ DSI_FLUSH(ch); \
++ } while (0)
++
++static int dsi_update_screen_l4(struct omap_display *display,
++ int x, int y, int w, int h)
++{
++ /* Note: supports only 24bit colors in 32bit container */
++ int first = 1;
++ int fifo_stalls = 0;
++ int max_dsi_packet_size;
++ int max_data_per_packet;
++ int max_pixels_per_packet;
++ int pixels_left;
++ int bytespp = 3;
++ int scr_width;
++ u32 __iomem *data;
++ int start_offset;
++ int horiz_inc;
++ int current_x;
++ struct omap_overlay *ovl;
++
++ debug_irq = 0;
++
++ DSSDBG("dsi_update_screen_l4 (%d,%d %dx%d)\n",
++ x, y, w, h);
++
++ ovl = display->manager->overlays[0];
++
++ if (ovl->info.color_mode != OMAP_DSS_COLOR_RGB24U)
++ return -EINVAL;
++
++ if (display->ctrl->pixel_size != 24)
++ return -EINVAL;
++
++ scr_width = ovl->info.screen_width;
++ data = ovl->info.vaddr;
++
++ start_offset = scr_width * y + x;
++ horiz_inc = scr_width - w;
++ current_x = x;
++
++ /* We need header(4) + DCSCMD(1) + pixels(numpix*bytespp) bytes
++ * in fifo */
++
++ /* When using CPU, max long packet size is TX buffer size */
++ max_dsi_packet_size = dsi.vc[0].fifo_size * 32 * 4;
++
++ /* we seem to get better perf if we divide the tx fifo to half,
++ and while the other half is being sent, we fill the other half
++ max_dsi_packet_size /= 2; */
++
++ max_data_per_packet = max_dsi_packet_size - 4 - 1;
++
++ max_pixels_per_packet = max_data_per_packet / bytespp;
++
++ DSSDBG("max_pixels_per_packet %d\n", max_pixels_per_packet);
++
++ display->ctrl->setup_update(display, x, y, w, h);
++
++ pixels_left = w * h;
++
++ DSSDBG("total pixels %d\n", pixels_left);
++
++ data += start_offset;
++
++#ifdef DEBUG
++ dsi.update_region.x = x;
++ dsi.update_region.y = y;
++ dsi.update_region.w = w;
++ dsi.update_region.h = h;
++ dsi.update_region.bytespp = bytespp;
++#endif
++
++ perf_mark_start();
++
++ while (pixels_left > 0) {
++ /* 0x2c = write_memory_start */
++ /* 0x3c = write_memory_continue */
++ u8 dcs_cmd = first ? 0x2c : 0x3c;
++ int pixels;
++ DSI_DECL_VARS;
++ first = 0;
++
++#if 1
++ /* using fifo not empty */
++ /* TX_FIFO_NOT_EMPTY */
++ while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
++ udelay(1);
++ fifo_stalls++;
++ if (fifo_stalls > 0xfffff) {
++ DSSERR("fifo stalls overflow, pixels left %d\n",
++ pixels_left);
++ dsi_if_enable(0);
++ return -EIO;
++ }
++ }
++#elif 1
++ /* using fifo emptiness */
++ while ((REG_GET(DSI_TX_FIFO_VC_EMPTINESS, 7, 0)+1)*4 <
++ max_dsi_packet_size) {
++ fifo_stalls++;
++ if (fifo_stalls > 0xfffff) {
++ DSSERR("fifo stalls overflow, pixels left %d\n",
++ pixels_left);
++ dsi_if_enable(0);
++ return -EIO;
++ }
++ }
++#else
++ while ((REG_GET(DSI_TX_FIFO_VC_EMPTINESS, 7, 0)+1)*4 == 0) {
++ fifo_stalls++;
++ if (fifo_stalls > 0xfffff) {
++ DSSERR("fifo stalls overflow, pixels left %d\n",
++ pixels_left);
++ dsi_if_enable(0);
++ return -EIO;
++ }
++ }
++#endif
++ pixels = min(max_pixels_per_packet, pixels_left);
++
++ pixels_left -= pixels;
++
++ dsi_vc_write_long_header(0, DSI_DT_DCS_LONG_WRITE,
++ 1 + pixels * bytespp, 0);
++
++ DSI_PUSH(0, dcs_cmd);
++
++ while (pixels-- > 0) {
++ u32 pix = __raw_readl(data++);
++
++ DSI_PUSH(0, (pix >> 16) & 0xff);
++ DSI_PUSH(0, (pix >> 8) & 0xff);
++ DSI_PUSH(0, (pix >> 0) & 0xff);
++
++ current_x++;
++ if (current_x == x+w) {
++ current_x = x;
++ data += horiz_inc;
++ }
++ }
++
++ DSI_FLUSH(0);
++ }
++
++ perf_show("L4");
++
++ return 0;
++}
++
++#if 0
++static void dsi_clear_screen_l4(struct omap_display *display,
++ int x, int y, int w, int h)
++{
++ int first = 1;
++ int fifo_stalls = 0;
++ int max_dsi_packet_size;
++ int max_data_per_packet;
++ int max_pixels_per_packet;
++ int pixels_left;
++ int bytespp = 3;
++ int pixnum;
++
++ debug_irq = 0;
++
++ DSSDBG("dsi_clear_screen_l4 (%d,%d %dx%d)\n",
++ x, y, w, h);
++
++ if (display->ctrl->bpp != 24)
++ return -EINVAL;
++
++ /* We need header(4) + DCSCMD(1) + pixels(numpix*bytespp)
++ * bytes in fifo */
++
++ /* When using CPU, max long packet size is TX buffer size */
++ max_dsi_packet_size = dsi.vc[0].fifo_size * 32 * 4;
++
++ max_data_per_packet = max_dsi_packet_size - 4 - 1;
++
++ max_pixels_per_packet = max_data_per_packet / bytespp;
++
++ enable_clocks(1);
++
++ display->ctrl->setup_update(display, x, y, w, h);
++
++ pixels_left = w * h;
++
++ dsi.update_region.x = x;
++ dsi.update_region.y = y;
++ dsi.update_region.w = w;
++ dsi.update_region.h = h;
++ dsi.update_region.bytespp = bytespp;
++
++ start_measuring();
++
++ pixnum = 0;
++
++ while (pixels_left > 0) {
++ /* 0x2c = write_memory_start */
++ /* 0x3c = write_memory_continue */
++ u8 dcs_cmd = first ? 0x2c : 0x3c;
++ int pixels;
++ DSI_DECL_VARS;
++ first = 0;
++
++ /* TX_FIFO_NOT_EMPTY */
++ while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
++ fifo_stalls++;
++ if (fifo_stalls > 0xfffff) {
++ DSSERR("fifo stalls overflow\n");
++ dsi_if_enable(0);
++ enable_clocks(0);
++ return;
++ }
++ }
++
++ pixels = min(max_pixels_per_packet, pixels_left);
++
++ pixels_left -= pixels;
++
++ dsi_vc_write_long_header(0, DSI_DT_DCS_LONG_WRITE,
++ 1 + pixels * bytespp, 0);
++
++ DSI_PUSH(0, dcs_cmd);
++
++ while (pixels-- > 0) {
++ u32 pix;
++
++ pix = 0x000000;
++
++ DSI_PUSH(0, (pix >> 16) & 0xff);
++ DSI_PUSH(0, (pix >> 8) & 0xff);
++ DSI_PUSH(0, (pix >> 0) & 0xff);
++ }
++
++ DSI_FLUSH(0);
++ }
++
++ enable_clocks(0);
++
++ end_measuring("L4 CLEAR");
++}
++#endif
++
++static void dsi_setup_update_dispc(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ DSSDBG("dsi_setup_update_dispc(%d,%d %dx%d)\n",
++ x, y, w, h);
++
++#ifdef DEBUG
++ dsi.update_region.x = x;
++ dsi.update_region.y = y;
++ dsi.update_region.w = w;
++ dsi.update_region.h = h;
++ dsi.update_region.bytespp = 3; // XXX
++#endif
++
++ dispc_setup_partial_planes(display, &x, &y, &w, &h);
++
++ dispc_set_lcd_size(w, h);
++}
++
++static void dsi_setup_autoupdate_dispc(struct omap_display *display)
++{
++ u16 w, h;
++
++ display->get_resolution(display, &w, &h);
++
++#ifdef DEBUG
++ dsi.update_region.x = 0;
++ dsi.update_region.y = 0;
++ dsi.update_region.w = w;
++ dsi.update_region.h = h;
++ dsi.update_region.bytespp = 3; // XXX
++#endif
++
++ /* the overlay settings may not have been applied, if we were in manual
++ * mode earlier, so do it here */
++ display->manager->apply(display->manager);
++
++ dispc_set_lcd_size(w, h);
++
++ dsi.autoupdate_setup = 0;
++}
++
++static void dsi_update_screen_dispc(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ int bytespp = 3;
++ int total_len;
++ int line_packet_len;
++ u32 l;
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
++ DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
++ x, y, w, h);
++
++ /* TODO: one packet could be longer, I think? Max is the line buffer */
++ line_packet_len = w * bytespp + 1; /* 1 byte for DCS cmd */
++ total_len = line_packet_len * h;
++
++ display->ctrl->setup_update(display, x, y, w, h);
++
++ if (0)
++ dsi_vc_print_status(1);
++
++ perf_mark_start();
++
++ l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
++ dsi_write_reg(DSI_VC_TE(1), l);
++
++ dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, line_packet_len, 0);
++
++ if (dsi.use_te)
++ l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
++ else
++ l = FLD_MOD(l, 1, 31, 31); /* TE_START */
++ dsi_write_reg(DSI_VC_TE(1), l);
++
++ dispc_enable_lcd_out(1);
++
++ if (dsi.use_te)
++ dsi_vc_send_bta(1);
++}
++
++static void framedone_callback(void *data, u32 mask)
++{
++ if (dsi.framedone_scheduled) {
++ DSSERR("Framedone already scheduled. Bogus FRAMEDONE IRQ?\n");
++ return;
++ }
++
++ dsi.framedone_scheduled = 1;
++
++ /* We get FRAMEDONE when DISPC has finished sending pixels and turns
++ * itself off. However, DSI still has the pixels in its buffers, and
++ * is sending the data. Thus we have to wait until we can do a new
++ * transfer or turn the clocks off. We do that in a separate work
++ * func. */
++ queue_work(dsi.workqueue, &dsi.framedone_work);
++}
++
++static void framedone_worker(struct work_struct *work)
++{
++ u32 l;
++ unsigned long tmo;
++ int i = 0;
++
++ l = REG_GET(DSI_VC_TE(1), 23, 0); /* TE_SIZE */
++
++ /* There shouldn't be much stuff in DSI buffers, if any, so we'll
++ * just busyloop */
++ if (l > 0) {
++ tmo = jiffies + msecs_to_jiffies(50);
++ while (REG_GET(DSI_VC_TE(1), 23, 0) > 0) { /* TE_SIZE */
++ i++;
++ if (time_after(jiffies, tmo)) {
++ DSSERR("timeout waiting TE_SIZE to zero\n");
++ break;
++ }
++ cpu_relax();
++ }
++ }
++
++ if (REG_GET(DSI_VC_TE(1), 30, 30))
++ DSSERR("TE_EN not zero\n");
++
++ if (REG_GET(DSI_VC_TE(1), 31, 31))
++ DSSERR("TE_START not zero\n");
++
++ perf_show("DISPC");
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
++ DSSDBG("FRAMEDONE\n");
++
++#if 0
++ if (l)
++ DSSWARN("FRAMEDONE irq too early, %d bytes, %d loops\n", l, i);
++#else
++ if (l > 1024*3)
++ DSSWARN("FRAMEDONE irq too early, %d bytes, %d loops\n", l, i);
++#endif
++
++#ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
++ dispc_fake_vsync_irq();
++#endif
++ dsi.framedone_scheduled = 0;
++
++ /* XXX check that fifo is not full. otherwise we would sleep and never
++ * get to process_cmd_fifo below */
++ /* We check for target_update_mode, not update_mode. No reason to push
++ * new updates if we're turning auto update off */
++ if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_push_autoupdate(dsi.vc[1].display);
++
++ atomic_set(&dsi.cmd_pending, 0);
++ dsi_process_cmd_fifo(NULL);
++}
++
++static void dsi_start_auto_update(struct omap_display *display)
++{
++ DSSDBG("starting auto update\n");
++
++ dsi.autoupdate_setup = 1;
++
++ dsi_push_autoupdate(display);
++}
++
++
++
++
++
++
++
++
++
++
++
++
++
++/* FIFO functions */
++
++static void dsi_signal_fifo_waiters(void)
++{
++ if (atomic_read(&dsi.cmd_fifo_full) > 0) {
++ DSSDBG("SIGNALING: Fifo not full for waiter!\n");
++ complete(&dsi.cmd_done);
++ atomic_dec(&dsi.cmd_fifo_full);
++ }
++}
++
++/* returns 1 for async op, and 0 for sync op */
++static int dsi_do_update(struct omap_display *display,
++ struct dsi_cmd_update *upd)
++{
++ int r;
++ u16 x = upd->x, y = upd->y, w = upd->w, h = upd->h;
++ u16 dw, dh;
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
++ return 0;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return 0;
++
++ display->get_resolution(display, &dw, &dh);
++ if (x > dw || y > dh)
++ return 0;
++
++ if (x + w > dw)
++ w = dw - x;
++
++ if (y + h > dh)
++ h = dh - y;
++
++ DSSDBGF("%d,%d %dx%d", x, y, w, h);
++
++ perf_mark_setup();
++
++ if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ dsi_setup_update_dispc(display, x, y, w, h);
++ dsi_update_screen_dispc(display, x, y, w, h);
++ return 1;
++ } else {
++ r = dsi_update_screen_l4(display, x, y, w, h);
++ if (r)
++ DSSERR("L4 update failed\n");
++ return 0;
++ }
++}
++
++/* returns 1 for async op, and 0 for sync op */
++static int dsi_do_autoupdate(struct omap_display *display)
++{
++ int r;
++ u16 w, h;
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
++ return 0;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return 0;
++
++ display->get_resolution(display, &w, &h);
++
++ perf_mark_setup();
++
++ if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ if (dsi.autoupdate_setup)
++ dsi_setup_autoupdate_dispc(display);
++ dsi_update_screen_dispc(display, 0, 0, w, h);
++ return 1;
++ } else {
++ r = dsi_update_screen_l4(display, 0, 0, w, h);
++ if (r)
++ DSSERR("L4 update failed\n");
++ return 0;
++ }
++}
++
++static void dsi_do_cmd_mem_read(struct omap_display *display,
++ struct dsi_cmd_mem_read *mem_read)
++{
++ int r;
++ r = display->ctrl->memory_read(display,
++ mem_read->buf,
++ mem_read->size,
++ mem_read->x,
++ mem_read->y,
++ mem_read->w,
++ mem_read->h);
++
++ *mem_read->ret_size = (size_t)r;
++ complete(mem_read->completion);
++}
++
++static void dsi_do_cmd_test(struct omap_display *display,
++ struct dsi_cmd_test *test)
++{
++ int r = 0;
++
++ DSSDBGF("");
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return;
++
++ /* run test first in low speed mode */
++ dsi_vc_enable_hs(0, 0);
++
++ if (display->ctrl->run_test) {
++ r = display->ctrl->run_test(display, test->test_num);
++ if (r)
++ goto end;
++ }
++
++ if (display->panel->run_test) {
++ r = display->panel->run_test(display, test->test_num);
++ if (r)
++ goto end;
++ }
++
++ /* then in high speed */
++ dsi_vc_enable_hs(0, 1);
++
++ if (display->ctrl->run_test) {
++ r = display->ctrl->run_test(display, test->test_num);
++ if (r)
++ goto end;
++ }
++
++ if (display->panel->run_test)
++ r = display->panel->run_test(display, test->test_num);
++
++end:
++ dsi_vc_enable_hs(0, 1);
++
++ *test->result = r;
++ complete(test->completion);
++
++ DSSDBG("test end\n");
++}
++
++static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
++{
++ dsi.use_te = enable;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return;
++
++ display->ctrl->enable_te(display, enable);
++
++ if (enable) {
++ /* disable LP_RX_TO, so that we can receive TE.
++ * Time to wait for TE is longer than the timer allows */
++ REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
++ } else {
++ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
++ }
++}
++
++static void dsi_do_cmd_set_update_mode(struct omap_display *display,
++ enum omap_dss_update_mode mode)
++{
++ dsi.update_mode = mode;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return;
++
++ if (mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_start_auto_update(display);
++}
++
++static void dsi_process_cmd_fifo(struct work_struct *work)
++{
++ int len;
++ struct dsi_cmd_item p;
++ unsigned long flags;
++ struct omap_display *display;
++ int exit = 0;
++
++ if (dsi.debug_process)
++ DSSDBGF("");
++
++ if (atomic_cmpxchg(&dsi.cmd_pending, 0, 1) == 1) {
++ if (dsi.debug_process)
++ DSSDBG("cmd pending, skip process\n");
++ return;
++ }
++
++ while (!exit) {
++ spin_lock_irqsave(dsi.cmd_fifo->lock, flags);
++
++ len = __kfifo_get(dsi.cmd_fifo, (unsigned char *)&p,
++ sizeof(p));
++ if (len == 0) {
++ if (dsi.debug_process)
++ DSSDBG("nothing more in fifo, atomic clear\n");
++ atomic_set(&dsi.cmd_pending, 0);
++ spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
++ break;
++ }
++
++ spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
++
++ BUG_ON(len != sizeof(p));
++
++ display = p.display;
++
++ if (dsi.debug_process)
++ DSSDBG("processing cmd %d\n", p.cmd);
++
++ switch (p.cmd) {
++ case DSI_CMD_UPDATE:
++ if (dsi_do_update(display, &p.u.r)) {
++ if (dsi.debug_process)
++ DSSDBG("async update\n");
++ exit = 1;
++ } else {
++ if (dsi.debug_process)
++ DSSDBG("sync update\n");
++ }
++ break;
++
++ case DSI_CMD_AUTOUPDATE:
++ if (dsi_do_autoupdate(display)) {
++ if (dsi.debug_process)
++ DSSDBG("async autoupdate\n");
++ exit = 1;
++ } else {
++ if (dsi.debug_process)
++ DSSDBG("sync autoupdate\n");
++ }
++ break;
++
++ case DSI_CMD_SYNC:
++ if (dsi.debug_process)
++ DSSDBG("Signaling SYNC done!\n");
++ complete(p.u.sync);
++ break;
++
++ case DSI_CMD_MEM_READ:
++ dsi_do_cmd_mem_read(display, &p.u.mem_read);
++ break;
++
++ case DSI_CMD_TEST:
++ dsi_do_cmd_test(display, &p.u.test);
++ break;
++
++ case DSI_CMD_SET_TE:
++ dsi_do_cmd_set_te(display, p.u.te);
++ break;
++
++ case DSI_CMD_SET_UPDATE_MODE:
++ dsi_do_cmd_set_update_mode(display, p.u.update_mode);
++ break;
++
++ case DSI_CMD_SET_ROTATE:
++ display->ctrl->set_rotate(display, p.u.rotate);
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
++ dsi.autoupdate_setup = 1;
++ break;
++
++ case DSI_CMD_SET_MIRROR:
++ display->ctrl->set_mirror(display, p.u.mirror);
++ break;
++
++ default:
++ BUG();
++ }
++ }
++
++ if (dsi.debug_process)
++ DSSDBG("exit dsi_process_cmd_fifo\n");
++
++ dsi_signal_fifo_waiters();
++}
++
++static void dsi_push_cmd(struct dsi_cmd_item *p)
++{
++ int ret;
++
++ if (dsi.debug_process)
++ DSSDBGF("");
++
++ while (1) {
++ unsigned long flags;
++ unsigned avail, used;
++
++ spin_lock_irqsave(dsi.cmd_fifo->lock, flags);
++ used = __kfifo_len(dsi.cmd_fifo) / sizeof(struct dsi_cmd_item);
++ avail = DSI_CMD_FIFO_LEN - used;
++
++ if (dsi.debug_process)
++ DSSDBG("%u/%u items left in fifo\n", avail, used);
++
++ if (avail == 0) {
++ if (dsi.debug_process)
++ DSSDBG("cmd fifo full, waiting...\n");
++ spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
++ atomic_inc(&dsi.cmd_fifo_full);
++ wait_for_completion(&dsi.cmd_done);
++ if (dsi.debug_process)
++ DSSDBG("cmd fifo not full, woke up\n");
++ continue;
++ }
++
++ ret = __kfifo_put(dsi.cmd_fifo, (unsigned char *)p,
++ sizeof(*p));
++
++ spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
++
++ BUG_ON(ret != sizeof(*p));
++
++ break;
++ }
++
++ queue_work(dsi.workqueue, &dsi.process_work);
++}
++
++static void dsi_push_update(struct omap_display *display,
++ int x, int y, int w, int h)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_UPDATE;
++
++ p.u.r.x = x;
++ p.u.r.y = y;
++ p.u.r.w = w;
++ p.u.r.h = h;
++
++ DSSDBG("pushing UPDATE %d,%d %dx%d\n", x, y, w, h);
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_autoupdate(struct omap_display *display)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_AUTOUPDATE;
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_sync(struct omap_display *display,
++ struct completion *sync_comp)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_SYNC;
++ p.u.sync = sync_comp;
++
++ DSSDBG("pushing SYNC\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_mem_read(struct omap_display *display,
++ struct dsi_cmd_mem_read *mem_read)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_MEM_READ;
++ p.u.mem_read = *mem_read;
++
++ DSSDBG("pushing MEM_READ\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_test(struct omap_display *display, int test_num,
++ int *result, struct completion *completion)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_TEST;
++ p.u.test.test_num = test_num;
++ p.u.test.result = result;
++ p.u.test.completion = completion;
++
++ DSSDBG("pushing TEST\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_set_te(struct omap_display *display, bool enable)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_SET_TE;
++ p.u.te = enable;
++
++ DSSDBG("pushing SET_TE\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_set_update_mode(struct omap_display *display,
++ enum omap_dss_update_mode mode)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_SET_UPDATE_MODE;
++ p.u.update_mode = mode;
++
++ DSSDBG("pushing SET_UPDATE_MODE\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_set_rotate(struct omap_display *display, int rotate)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_SET_ROTATE;
++ p.u.rotate = rotate;
++
++ DSSDBG("pushing SET_ROTATE\n");
++
++ dsi_push_cmd(&p);
++}
++
++static void dsi_push_set_mirror(struct omap_display *display, int mirror)
++{
++ struct dsi_cmd_item p;
++
++ p.display = display;
++ p.cmd = DSI_CMD_SET_MIRROR;
++ p.u.mirror = mirror;
++
++ DSSDBG("pushing SET_MIRROR\n");
++
++ dsi_push_cmd(&p);
++}
++
++static int dsi_wait_sync(struct omap_display *display)
++{
++ long wait = msecs_to_jiffies(60000);
++ struct completion compl;
++
++ DSSDBGF("");
++
++ init_completion(&compl);
++ dsi_push_sync(display, &compl);
++
++ DSSDBG("Waiting for SYNC to happen...\n");
++ wait = wait_for_completion_timeout(&compl, wait);
++ DSSDBG("Released from SYNC\n");
++
++ if (wait == 0) {
++ DSSERR("timeout waiting sync\n");
++ return -ETIME;
++ }
++
++ return 0;
++}
++
++
++
++
++
++
++
++
++
++
++
++
++/* Display funcs */
++
++static int dsi_display_init_dispc(struct omap_display *display)
++{
++ int r;
++
++ r = omap_dispc_register_isr(framedone_callback, NULL,
++ DISPC_IRQ_FRAMEDONE);
++ if (r) {
++ DSSERR("can't get FRAMEDONE irq\n");
++ return r;
++ }
++
++ dispc_set_lcd_display_type(OMAP_DSS_LCD_DISPLAY_TFT);
++
++ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_DSI);
++ dispc_enable_fifohandcheck(1);
++
++ dispc_set_tft_data_lines(display->ctrl->pixel_size);
++
++ {
++ struct omap_video_timings timings = {
++ .hsw = 1,
++ .hfp = 1,
++ .hbp = 1,
++ .vsw = 1,
++ .vfp = 0,
++ .vbp = 0,
++ };
++
++ dispc_set_lcd_timings(&timings);
++ }
++
++ return 0;
++}
++
++static void dsi_display_uninit_dispc(struct omap_display *display)
++{
++ omap_dispc_unregister_isr(framedone_callback, NULL,
++ DISPC_IRQ_FRAMEDONE);
++}
++
++static int dsi_display_init_dsi(struct omap_display *display)
++{
++ struct dsi_clock_info cinfo;
++ int r;
++
++ _dsi_print_reset_status();
++
++ r = dsi_pll_init(1, 0);
++ if (r)
++ goto err0;
++
++ r = dsi_pll_calc_ddrfreq(display->hw_config.u.dsi.ddr_clk_hz, &cinfo);
++ if (r)
++ goto err1;
++
++ r = dsi_pll_program(&cinfo);
++ if (r)
++ goto err1;
++
++ DSSDBG("PLL OK\n");
++
++ r = dsi_complexio_init(display);
++ if (r)
++ goto err1;
++
++ _dsi_print_reset_status();
++
++ dsi_proto_timings();
++ dsi_set_lp_clk_divisor();
++
++ if (1)
++ _dsi_print_reset_status();
++
++ r = dsi_proto_config(display);
++ if (r)
++ goto err2;
++
++ /* enable interface */
++ dsi_vc_enable(0, 1);
++ dsi_vc_enable(1, 1);
++ dsi_if_enable(1);
++ dsi_force_tx_stop_mode_io();
++
++ if (display->ctrl && display->ctrl->enable) {
++ r = display->ctrl->enable(display);
++ if (r)
++ goto err3;
++ }
++
++ if (display->panel && display->panel->enable) {
++ r = display->panel->enable(display);
++ if (r)
++ goto err4;
++ }
++
++ /* enable high-speed after initial config */
++ dsi_vc_enable_hs(0, 1);
++
++ return 0;
++err4:
++ if (display->ctrl && display->ctrl->disable)
++ display->ctrl->disable(display);
++err3:
++ dsi_if_enable(0);
++err2:
++ dsi_complexio_uninit();
++err1:
++ dsi_pll_uninit();
++err0:
++ return r;
++}
++
++static void dsi_display_uninit_dsi(struct omap_display *display)
++{
++ if (display->panel && display->panel->disable)
++ display->panel->disable(display);
++ if (display->ctrl && display->ctrl->disable)
++ display->ctrl->disable(display);
++
++ dsi_complexio_uninit();
++ dsi_pll_uninit();
++}
++
++static int dsi_core_init(void)
++{
++ /* Autoidle */
++ REG_FLD_MOD(DSI_SYSCONFIG, 1, 0, 0);
++
++ /* ENWAKEUP */
++ REG_FLD_MOD(DSI_SYSCONFIG, 1, 2, 2);
++
++ /* SIDLEMODE smart-idle */
++ REG_FLD_MOD(DSI_SYSCONFIG, 2, 4, 3);
++
++ _dsi_initialize_irq();
++
++ return 0;
++}
++
++static int dsi_display_enable(struct omap_display *display)
++{
++ int r = 0;
++
++ DSSDBG("dsi_display_enable\n");
++
++ mutex_lock(&dsi.lock);
++
++ if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ DSSERR("display already enabled\n");
++ r = -EINVAL;
++ goto err0;
++ }
++
++ enable_clocks(1);
++ dsi_enable_pll_clock(1);
++
++ r = _dsi_reset();
++ if (r)
++ return r;
++
++ dsi_core_init();
++
++ r = dsi_display_init_dispc(display);
++ if (r)
++ goto err1;
++
++ r = dsi_display_init_dsi(display);
++ if (r)
++ goto err2;
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ if (dsi.use_te)
++ dsi_push_set_te(display, 1);
++
++ dsi_push_set_update_mode(display, dsi.user_update_mode);
++ dsi.target_update_mode = dsi.user_update_mode;
++
++ mutex_unlock(&dsi.lock);
++
++ return dsi_wait_sync(display);
++
++err2:
++ dsi_display_uninit_dispc(display);
++err1:
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++err0:
++ mutex_unlock(&dsi.lock);
++ DSSDBG("dsi_display_enable FAILED\n");
++ return r;
++}
++
++static void dsi_display_disable(struct omap_display *display)
++{
++ DSSDBG("dsi_display_disable\n");
++
++ mutex_lock(&dsi.lock);
++
++ if (display->state == OMAP_DSS_DISPLAY_DISABLED ||
++ display->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ goto end;
++
++ if (dsi.target_update_mode != OMAP_DSS_UPDATE_DISABLED) {
++ dsi_push_set_update_mode(display, OMAP_DSS_UPDATE_DISABLED);
++ dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
++ }
++
++ dsi_wait_sync(display);
++
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++
++ dsi_display_uninit_dispc(display);
++
++ dsi_display_uninit_dsi(display);
++
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++end:
++ mutex_unlock(&dsi.lock);
++}
++
++static int dsi_display_suspend(struct omap_display *display)
++{
++ DSSDBG("dsi_display_suspend\n");
++
++ dsi_display_disable(display);
++
++ display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++
++ return 0;
++}
++
++static int dsi_display_resume(struct omap_display *display)
++{
++ DSSDBG("dsi_display_resume\n");
++
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++ return dsi_display_enable(display);
++}
++
++static int dsi_display_update(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ DSSDBG("dsi_display_update(%d,%d %dx%d)\n", x, y, w, h);
++
++ if (w == 0 || h == 0)
++ return 0;
++
++ mutex_lock(&dsi.lock);
++
++ if (dsi.target_update_mode == OMAP_DSS_UPDATE_MANUAL)
++ dsi_push_update(display, x, y, w, h);
++ /* XXX else return error? */
++
++ mutex_unlock(&dsi.lock);
++
++ return 0;
++}
++
++static int dsi_display_sync(struct omap_display *display)
++{
++ DSSDBGF("");
++ return dsi_wait_sync(display);
++}
++
++static int dsi_display_set_update_mode(struct omap_display *display,
++ enum omap_dss_update_mode mode)
++{
++ DSSDBGF("%d", mode);
++
++ mutex_lock(&dsi.lock);
++
++ if (dsi.target_update_mode != mode) {
++ dsi_push_set_update_mode(display, mode);
++
++ dsi.target_update_mode = mode;
++ dsi.user_update_mode = mode;
++ }
++
++ mutex_unlock(&dsi.lock);
++
++ return dsi_wait_sync(display);
++}
++
++static enum omap_dss_update_mode dsi_display_get_update_mode(
++ struct omap_display *display)
++{
++ return dsi.update_mode;
++}
++
++static int dsi_display_enable_te(struct omap_display *display, bool enable)
++{
++ DSSDBGF("%d", enable);
++
++ if (!display->ctrl->enable_te)
++ return -ENOENT;
++
++ dsi_push_set_te(display, enable);
++
++ return dsi_wait_sync(display);
++}
++
++static int dsi_display_get_te(struct omap_display *display)
++{
++ return dsi.use_te;
++}
++
++
++
++static int dsi_display_set_rotate(struct omap_display *display, u8 rotate)
++{
++ DSSDBGF("%d", rotate);
++
++ if (!display->ctrl->set_rotate || !display->ctrl->get_rotate)
++ return -EINVAL;
++
++ dsi_push_set_rotate(display, rotate);
++
++ return dsi_wait_sync(display);
++}
++
++static u8 dsi_display_get_rotate(struct omap_display *display)
++{
++ if (!display->ctrl->set_rotate || !display->ctrl->get_rotate)
++ return 0;
++
++ return display->ctrl->get_rotate(display);
++}
++
++static int dsi_display_set_mirror(struct omap_display *display, bool mirror)
++{
++ DSSDBGF("%d", mirror);
++
++ if (!display->ctrl->set_mirror || !display->ctrl->get_mirror)
++ return -EINVAL;
++
++ dsi_push_set_mirror(display, mirror);
++
++ return dsi_wait_sync(display);
++}
++
++static bool dsi_display_get_mirror(struct omap_display *display)
++{
++ if (!display->ctrl->set_mirror || !display->ctrl->get_mirror)
++ return 0;
++
++ return display->ctrl->get_mirror(display);
++}
++
++static int dsi_display_run_test(struct omap_display *display, int test_num)
++{
++ long wait = msecs_to_jiffies(60000);
++ struct completion compl;
++ int result;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return -EIO;
++
++ DSSDBGF("%d", test_num);
++
++ init_completion(&compl);
++
++ dsi_push_test(display, test_num, &result, &compl);
++
++ DSSDBG("Waiting for SYNC to happen...\n");
++ wait = wait_for_completion_timeout(&compl, wait);
++ DSSDBG("Released from SYNC\n");
++
++ if (wait == 0) {
++ DSSERR("timeout waiting test sync\n");
++ return -ETIME;
++ }
++
++ return result;
++}
++
++static int dsi_display_memory_read(struct omap_display *display,
++ void *buf, size_t size,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ long wait = msecs_to_jiffies(60000);
++ struct completion compl;
++ struct dsi_cmd_mem_read mem_read;
++ size_t ret_size;
++
++ DSSDBGF("");
++
++ if (!display->ctrl->memory_read)
++ return -EINVAL;
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return -EIO;
++
++ init_completion(&compl);
++
++ mem_read.x = x;
++ mem_read.y = y;
++ mem_read.w = w;
++ mem_read.h = h;
++ mem_read.buf = buf;
++ mem_read.size = size;
++ mem_read.ret_size = &ret_size;
++ mem_read.completion = &compl;
++
++ dsi_push_mem_read(display, &mem_read);
++
++ DSSDBG("Waiting for SYNC to happen...\n");
++ wait = wait_for_completion_timeout(&compl, wait);
++ DSSDBG("Released from SYNC\n");
++
++ if (wait == 0) {
++ DSSERR("timeout waiting mem read sync\n");
++ return -ETIME;
++ }
++
++ return ret_size;
++}
++
++static void dsi_configure_overlay(struct omap_overlay *ovl)
++{
++ unsigned low, high, size;
++ enum omap_burst_size burst;
++ enum omap_plane plane = ovl->id;
++
++ burst = OMAP_DSS_BURST_16x32;
++ size = 16 * 32 / 8;
++
++ dispc_set_burst_size(plane, burst);
++
++ high = dispc_get_plane_fifo_size(plane) - size;
++ low = 0;
++ dispc_setup_plane_fifo(plane, low, high);
++}
++
++void dsi_init_display(struct omap_display *display)
++{
++ DSSDBG("DSI init\n");
++
++ display->enable = dsi_display_enable;
++ display->disable = dsi_display_disable;
++ display->suspend = dsi_display_suspend;
++ display->resume = dsi_display_resume;
++ display->update = dsi_display_update;
++ display->sync = dsi_display_sync;
++ display->set_update_mode = dsi_display_set_update_mode;
++ display->get_update_mode = dsi_display_get_update_mode;
++ display->enable_te = dsi_display_enable_te;
++ display->get_te = dsi_display_get_te;
++
++ display->get_rotate = dsi_display_get_rotate;
++ display->set_rotate = dsi_display_set_rotate;
++
++ display->get_mirror = dsi_display_get_mirror;
++ display->set_mirror = dsi_display_set_mirror;
++
++ display->run_test = dsi_display_run_test;
++ display->memory_read = dsi_display_memory_read;
++
++ display->configure_overlay = dsi_configure_overlay;
++
++ display->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++
++ dsi.vc[0].display = display;
++ dsi.vc[1].display = display;
++}
++
++int dsi_init(void)
++{
++ u32 rev;
++
++ spin_lock_init(&dsi.cmd_lock);
++ dsi.cmd_fifo = kfifo_alloc(
++ DSI_CMD_FIFO_LEN * sizeof(struct dsi_cmd_item),
++ GFP_KERNEL,
++ &dsi.cmd_lock);
++
++ init_completion(&dsi.cmd_done);
++ atomic_set(&dsi.cmd_fifo_full, 0);
++ atomic_set(&dsi.cmd_pending, 0);
++
++ init_completion(&dsi.bta_completion);
++
++ dsi.workqueue = create_singlethread_workqueue("dsi");
++ INIT_WORK(&dsi.framedone_work, framedone_worker);
++ INIT_WORK(&dsi.process_work, dsi_process_cmd_fifo);
++
++ mutex_init(&dsi.lock);
++
++ dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
++ dsi.user_update_mode = OMAP_DSS_UPDATE_DISABLED;
++
++ dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
++ if (!dsi.base) {
++ DSSERR("can't ioremap DSI\n");
++ return -ENOMEM;
++ }
++
++ enable_clocks(1);
++
++ rev = dsi_read_reg(DSI_REVISION);
++ printk(KERN_INFO "OMAP DSI rev %d.%d\n",
++ FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
++
++ enable_clocks(0);
++
++ return 0;
++}
++
++void dsi_exit(void)
++{
++ flush_workqueue(dsi.workqueue);
++ destroy_workqueue(dsi.workqueue);
++
++ iounmap(dsi.base);
++
++ kfifo_free(dsi.cmd_fifo);
++
++ DSSDBG("omap_dsi_exit\n");
++}
++
+diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
+new file mode 100644
+index 0000000..adc1f34
+--- /dev/null
++++ b/drivers/video/omap2/dss/dss.c
+@@ -0,0 +1,345 @@
++/*
++ * linux/drivers/video/omap2/dss/dss.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "DSS"
++
++#include <linux/kernel.h>
++#include <linux/io.h>
++#include <linux/err.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/seq_file.h>
++
++#include <mach/display.h>
++#include "dss.h"
++
++#define DSS_BASE 0x48050000
++
++#define DSS_SZ_REGS SZ_512
++
++struct dss_reg {
++ u16 idx;
++};
++
++#define DSS_REG(idx) ((const struct dss_reg) { idx })
++
++#define DSS_REVISION DSS_REG(0x0000)
++#define DSS_SYSCONFIG DSS_REG(0x0010)
++#define DSS_SYSSTATUS DSS_REG(0x0014)
++#define DSS_IRQSTATUS DSS_REG(0x0018)
++#define DSS_CONTROL DSS_REG(0x0040)
++#define DSS_SDI_CONTROL DSS_REG(0x0044)
++#define DSS_PLL_CONTROL DSS_REG(0x0048)
++#define DSS_SDI_STATUS DSS_REG(0x005C)
++
++#define REG_GET(idx, start, end) \
++ FLD_GET(dss_read_reg(idx), start, end)
++
++#define REG_FLD_MOD(idx, val, start, end) \
++ dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
++
++static struct {
++ void __iomem *base;
++
++ u32 ctx[DSS_SZ_REGS / sizeof(u32)];
++} dss;
++
++static int _omap_dss_wait_reset(void);
++
++static inline void dss_write_reg(const struct dss_reg idx, u32 val)
++{
++ __raw_writel(val, dss.base + idx.idx);
++}
++
++static inline u32 dss_read_reg(const struct dss_reg idx)
++{
++ return __raw_readl(dss.base + idx.idx);
++}
++
++#define SR(reg) \
++ dss.ctx[(DSS_##reg).idx / sizeof(u32)] = dss_read_reg(DSS_##reg)
++#define RR(reg) \
++ dss_write_reg(DSS_##reg, dss.ctx[(DSS_##reg).idx / sizeof(u32)])
++
++void dss_save_context(void)
++{
++ if (cpu_is_omap24xx())
++ return;
++
++ SR(SYSCONFIG);
++ SR(CONTROL);
++
++#ifdef CONFIG_OMAP2_DSS_SDI
++ SR(SDI_CONTROL);
++ SR(PLL_CONTROL);
++#endif
++}
++
++void dss_restore_context(void)
++{
++ if (_omap_dss_wait_reset())
++ DSSERR("DSS not coming out of reset after sleep\n");
++
++ RR(SYSCONFIG);
++ RR(CONTROL);
++
++#ifdef CONFIG_OMAP2_DSS_SDI
++ RR(SDI_CONTROL);
++ RR(PLL_CONTROL);
++#endif
++}
++
++#undef SR
++#undef RR
++
++void dss_sdi_init(u8 datapairs)
++{
++ u32 l;
++
++ BUG_ON(datapairs > 3 || datapairs < 1);
++
++ l = dss_read_reg(DSS_SDI_CONTROL);
++ l = FLD_MOD(l, 0xf, 19, 15); /* SDI_PDIV */
++ l = FLD_MOD(l, datapairs-1, 3, 2); /* SDI_PRSEL */
++ l = FLD_MOD(l, 2, 1, 0); /* SDI_BWSEL */
++ dss_write_reg(DSS_SDI_CONTROL, l);
++
++ l = dss_read_reg(DSS_PLL_CONTROL);
++ l = FLD_MOD(l, 0x7, 25, 22); /* SDI_PLL_FREQSEL */
++ l = FLD_MOD(l, 0xb, 16, 11); /* SDI_PLL_REGN */
++ l = FLD_MOD(l, 0xb4, 10, 1); /* SDI_PLL_REGM */
++ dss_write_reg(DSS_PLL_CONTROL, l);
++}
++
++void dss_sdi_enable(void)
++{
++ dispc_pck_free_enable(1);
++
++ /* Reset SDI PLL */
++ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 18, 18); /* SDI_PLL_SYSRESET */
++ udelay(1); /* wait 2x PCLK */
++
++ /* Lock SDI PLL */
++ REG_FLD_MOD(DSS_PLL_CONTROL, 1, 28, 28); /* SDI_PLL_GOBIT */
++
++ /* Waiting for PLL lock request to complete */
++ while (dss_read_reg(DSS_SDI_STATUS) & (1 << 6))
++ ;
++
++ /* Clearing PLL_GO bit */
++ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 28, 28);
++
++ /* Waiting for PLL to lock */
++ while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 5)))
++ ;
++
++ dispc_lcd_enable_signal(1);
++
++ /* Waiting for SDI reset to complete */
++ while (!(dss_read_reg(DSS_SDI_STATUS) & (1 << 2)))
++ ;
++}
++
++void dss_sdi_disable(void)
++{
++ dispc_lcd_enable_signal(0);
++
++ dispc_pck_free_enable(0);
++
++ /* Reset SDI PLL */
++ REG_FLD_MOD(DSS_PLL_CONTROL, 0, 18, 18); /* SDI_PLL_SYSRESET */
++}
++
++void dss_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dss_read_reg(r))
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ DUMPREG(DSS_REVISION);
++ DUMPREG(DSS_SYSCONFIG);
++ DUMPREG(DSS_SYSSTATUS);
++ DUMPREG(DSS_IRQSTATUS);
++ DUMPREG(DSS_CONTROL);
++ DUMPREG(DSS_SDI_CONTROL);
++ DUMPREG(DSS_PLL_CONTROL);
++ DUMPREG(DSS_SDI_STATUS);
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++#undef DUMPREG
++}
++
++void dss_select_clk_source(bool dsi, bool dispc)
++{
++ u32 r;
++ r = dss_read_reg(DSS_CONTROL);
++ r = FLD_MOD(r, dsi, 1, 1); /* DSI_CLK_SWITCH */
++ r = FLD_MOD(r, dispc, 0, 0); /* DISPC_CLK_SWITCH */
++ dss_write_reg(DSS_CONTROL, r);
++}
++
++int dss_get_dsi_clk_source(void)
++{
++ return FLD_GET(dss_read_reg(DSS_CONTROL), 1, 1);
++}
++
++int dss_get_dispc_clk_source(void)
++{
++ return FLD_GET(dss_read_reg(DSS_CONTROL), 0, 0);
++}
++
++static irqreturn_t dss_irq_handler_omap2(int irq, void *arg)
++{
++ dispc_irq_handler();
++
++ return IRQ_HANDLED;
++}
++
++static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)
++{
++ u32 irqstatus;
++
++ irqstatus = dss_read_reg(DSS_IRQSTATUS);
++
++ if (irqstatus & (1<<0)) /* DISPC_IRQ */
++ dispc_irq_handler();
++#ifdef CONFIG_OMAP2_DSS_DSI
++ if (irqstatus & (1<<1)) /* DSI_IRQ */
++ dsi_irq_handler();
++#endif
++
++ return IRQ_HANDLED;
++}
++
++static int _omap_dss_wait_reset(void)
++{
++ unsigned timeout = 1000;
++
++ while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) {
++ udelay(1);
++ if (!--timeout) {
++ DSSERR("soft reset failed\n");
++ return -ENODEV;
++ }
++ }
++
++ return 0;
++}
++
++static int _omap_dss_reset(void)
++{
++ /* Soft reset */
++ REG_FLD_MOD(DSS_SYSCONFIG, 1, 1, 1);
++ return _omap_dss_wait_reset();
++}
++
++void dss_set_venc_output(enum omap_dss_venc_type type)
++{
++ int l = 0;
++
++ if (type == OMAP_DSS_VENC_TYPE_COMPOSITE)
++ l = 0;
++ else if (type == OMAP_DSS_VENC_TYPE_SVIDEO)
++ l = 1;
++ else
++ BUG();
++
++ /* venc out selection. 0 = comp, 1 = svideo */
++ REG_FLD_MOD(DSS_CONTROL, l, 6, 6);
++}
++
++void dss_set_dac_pwrdn_bgz(bool enable)
++{
++ REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
++}
++
++int dss_init(bool skip_init)
++{
++ int r;
++ u32 rev;
++
++ dss.base = ioremap(DSS_BASE, DSS_SZ_REGS);
++ if (!dss.base) {
++ DSSERR("can't ioremap DSS\n");
++ r = -ENOMEM;
++ goto fail0;
++ }
++
++ if (!skip_init) {
++ /* We need to wait here a bit, otherwise we sometimes start to
++ * get synclost errors, and after that only power cycle will
++ * restore DSS functionality. I have no idea why this happens.
++ * And we have to wait _before_ resetting the DSS, but after
++ * enabling clocks.
++ */
++ msleep(50);
++
++ _omap_dss_reset();
++
++ }
++ else
++ printk("DSS SKIP RESET\n");
++
++ /* autoidle */
++ REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
++
++ /* Select DPLL */
++ REG_FLD_MOD(DSS_CONTROL, 0, 0, 0);
++
++#ifdef CONFIG_OMAP2_DSS_VENC
++ REG_FLD_MOD(DSS_CONTROL, 1, 4, 4); /* venc dac demen */
++ REG_FLD_MOD(DSS_CONTROL, 1, 3, 3); /* venc clock 4x enable */
++ REG_FLD_MOD(DSS_CONTROL, 0, 2, 2); /* venc clock mode = normal */
++#endif
++
++ r = request_irq(INT_24XX_DSS_IRQ,
++ cpu_is_omap24xx()
++ ? dss_irq_handler_omap2
++ : dss_irq_handler_omap3,
++ 0, "OMAP DSS", NULL);
++
++ if (r < 0) {
++ DSSERR("omap2 dss: request_irq failed\n");
++ goto fail1;
++ }
++
++ dss_save_context();
++
++ rev = dss_read_reg(DSS_REVISION);
++ printk(KERN_INFO "OMAP DSS rev %d.%d\n",
++ FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
++
++ return 0;
++
++fail1:
++ iounmap(dss.base);
++fail0:
++ return r;
++}
++
++void dss_exit(void)
++{
++ free_irq(INT_24XX_DSS_IRQ, NULL);
++
++ iounmap(dss.base);
++}
++
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+new file mode 100644
+index 0000000..bac5ece
+--- /dev/null
++++ b/drivers/video/omap2/dss/dss.h
+@@ -0,0 +1,331 @@
++/*
++ * linux/drivers/video/omap2/dss/dss.h
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef __OMAP2_DSS_H
++#define __OMAP2_DSS_H
++
++#ifdef CONFIG_OMAP2_DSS_DEBUG_SUPPORT
++#define DEBUG
++#endif
++
++#ifdef DEBUG
++extern unsigned int dss_debug;
++#ifdef DSS_SUBSYS_NAME
++#define DSSDBG(format, ...) \
++ if (dss_debug) \
++ printk(KERN_DEBUG "omapdss " DSS_SUBSYS_NAME ": " format, \
++ ## __VA_ARGS__)
++#else
++#define DSSDBG(format, ...) \
++ if (dss_debug) \
++ printk(KERN_DEBUG "omapdss: " format, ## __VA_ARGS__)
++#endif
++
++#ifdef DSS_SUBSYS_NAME
++#define DSSDBGF(format, ...) \
++ if (dss_debug) \
++ printk(KERN_DEBUG "omapdss " DSS_SUBSYS_NAME \
++ ": %s(" format ")\n", \
++ __func__, \
++ ## __VA_ARGS__)
++#else
++#define DSSDBGF(format, ...) \
++ if (dss_debug) \
++ printk(KERN_DEBUG "omapdss: " \
++ ": %s(" format ")\n", \
++ __func__, \
++ ## __VA_ARGS__)
++#endif
++
++#else /* DEBUG */
++#define DSSDBG(format, ...)
++#define DSSDBGF(format, ...)
++#endif
++
++
++#ifdef DSS_SUBSYS_NAME
++#define DSSERR(format, ...) \
++ printk(KERN_ERR "omapdss " DSS_SUBSYS_NAME " error: " format, \
++ ## __VA_ARGS__)
++#else
++#define DSSERR(format, ...) \
++ printk(KERN_ERR "omapdss error: " format, ## __VA_ARGS__)
++#endif
++
++#ifdef DSS_SUBSYS_NAME
++#define DSSINFO(format, ...) \
++ printk(KERN_INFO "omapdss " DSS_SUBSYS_NAME ": " format, \
++ ## __VA_ARGS__)
++#else
++#define DSSINFO(format, ...) \
++ printk(KERN_INFO "omapdss: " format, ## __VA_ARGS__)
++#endif
++
++#ifdef DSS_SUBSYS_NAME
++#define DSSWARN(format, ...) \
++ printk(KERN_WARNING "omapdss " DSS_SUBSYS_NAME ": " format, \
++ ## __VA_ARGS__)
++#else
++#define DSSWARN(format, ...) \
++ printk(KERN_WARNING "omapdss: " format, ## __VA_ARGS__)
++#endif
++
++/* OMAP TRM gives bitfields as start:end, where start is the higher bit
++ number. For example 7:0 */
++#define FLD_MASK(start, end) (((1 << (start - end + 1)) - 1) << (end))
++#define FLD_VAL(val, start, end) (((val) << end) & FLD_MASK(start, end))
++#define FLD_GET(val, start, end) (((val) & FLD_MASK(start, end)) >> (end))
++#define FLD_MOD(orig, val, start, end) \
++ (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end))
++
++#define DISPC_MAX_FCK 173000000
++
++enum omap_burst_size {
++ OMAP_DSS_BURST_4x32 = 0,
++ OMAP_DSS_BURST_8x32 = 1,
++ OMAP_DSS_BURST_16x32 = 2,
++};
++
++enum omap_parallel_interface_mode {
++ OMAP_DSS_PARALLELMODE_BYPASS, /* MIPI DPI */
++ OMAP_DSS_PARALLELMODE_RFBI, /* MIPI DBI */
++ OMAP_DSS_PARALLELMODE_DSI,
++};
++
++enum dss_clock {
++ DSS_CLK_ICK = 1 << 0,
++ DSS_CLK_FCK1 = 1 << 1,
++ DSS_CLK_FCK2 = 1 << 2,
++ DSS_CLK_54M = 1 << 3,
++ DSS_CLK_96M = 1 << 4,
++};
++
++struct dispc_clock_info {
++ /* rates that we get with dividers below */
++ unsigned long fck;
++ unsigned long lck;
++ unsigned long pck;
++
++ /* dividers */
++ u16 fck_div;
++ u16 lck_div;
++ u16 pck_div;
++};
++
++struct dsi_clock_info {
++ /* rates that we get with dividers below */
++ unsigned long fint;
++ unsigned long dsiphy;
++ unsigned long clkin;
++ unsigned long dsi1_pll_fclk;
++ unsigned long dsi2_pll_fclk;
++ unsigned long lck;
++ unsigned long pck;
++
++ /* dividers */
++ u16 regn;
++ u16 regm;
++ u16 regm3;
++ u16 regm4;
++
++ u16 lck_div;
++ u16 pck_div;
++
++ u8 highfreq;
++ bool use_dss2_fck;
++};
++
++struct seq_file;
++struct platform_device;
++
++/* core */
++void dss_clk_enable(enum dss_clock clks);
++void dss_clk_disable(enum dss_clock clks);
++unsigned long dss_clk_get_rate(enum dss_clock clk);
++int dss_need_ctx_restore(void);
++void dss_dump_clocks(struct seq_file *s);
++
++int dss_dsi_power_up(void);
++void dss_dsi_power_down(void);
++
++/* display */
++void dss_init_displays(struct platform_device *pdev);
++void dss_uninit_displays(struct platform_device *pdev);
++int dss_suspend_all_displays(void);
++int dss_resume_all_displays(void);
++struct omap_display *dss_get_display(int no);
++
++/* manager */
++int dss_init_overlay_managers(struct platform_device *pdev);
++void dss_uninit_overlay_managers(struct platform_device *pdev);
++
++/* overlay */
++void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name);
++void dss_uninit_overlays(struct platform_device *pdev);
++int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display);
++void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
++
++/* DSS */
++int dss_init(bool skip_init);
++void dss_exit(void);
++
++void dss_save_context(void);
++void dss_restore_context(void);
++
++void dss_dump_regs(struct seq_file *s);
++
++void dss_sdi_init(u8 datapairs);
++void dss_sdi_enable(void);
++void dss_sdi_disable(void);
++
++void dss_select_clk_source(bool dsi, bool dispc);
++int dss_get_dsi_clk_source(void);
++int dss_get_dispc_clk_source(void);
++void dss_set_venc_output(enum omap_dss_venc_type type);
++void dss_set_dac_pwrdn_bgz(bool enable);
++
++/* SDI */
++int sdi_init(bool skip_init);
++void sdi_exit(void);
++void sdi_init_display(struct omap_display *display);
++
++/* DSI */
++int dsi_init(void);
++void dsi_exit(void);
++
++void dsi_dump_clocks(struct seq_file *s);
++void dsi_dump_regs(struct seq_file *s);
++
++void dsi_save_context(void);
++void dsi_restore_context(void);
++
++void dsi_init_display(struct omap_display *display);
++void dsi_irq_handler(void);
++unsigned long dsi_get_dsi1_pll_rate(void);
++unsigned long dsi_get_dsi2_pll_rate(void);
++int dsi_pll_calc_pck(bool is_tft, unsigned long req_pck,
++ struct dsi_clock_info *cinfo);
++int dsi_pll_program(struct dsi_clock_info *cinfo);
++int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv);
++void dsi_pll_uninit(void);
++
++/* DPI */
++int dpi_init(void);
++void dpi_exit(void);
++void dpi_init_display(struct omap_display *display);
++
++/* DISPC */
++int dispc_init(void);
++void dispc_exit(void);
++void dispc_dump_clocks(struct seq_file *s);
++void dispc_dump_regs(struct seq_file *s);
++void dispc_irq_handler(void);
++void dispc_fake_vsync_irq(void);
++
++void dispc_save_context(void);
++void dispc_restore_context(void);
++
++void dispc_lcd_enable_signal_polarity(bool act_high);
++void dispc_lcd_enable_signal(bool enable);
++void dispc_pck_free_enable(bool enable);
++void dispc_enable_fifohandcheck(bool enable);
++
++void dispc_set_lcd_size(u16 width, u16 height);
++void dispc_set_digit_size(u16 width, u16 height);
++u32 dispc_get_plane_fifo_size(enum omap_plane plane);
++void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high);
++void dispc_enable_fifomerge(bool enable);
++void dispc_set_burst_size(enum omap_plane plane,
++ enum omap_burst_size burst_size);
++
++void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
++void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
++void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
++void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
++
++int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
++ u32 paddr, u16 screen_width,
++ u16 pos_x, u16 pos_y,
++ u16 width, u16 height,
++ u16 out_width, u16 out_height,
++ enum omap_color_mode color_mode,
++ bool ilace,
++ u8 rotation, bool mirror);
++
++void dispc_go(enum omap_channel channel);
++void dispc_enable_lcd_out(bool enable);
++void dispc_enable_digit_out(bool enable);
++int dispc_enable_plane(enum omap_plane plane, bool enable);
++
++void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode);
++void dispc_set_tft_data_lines(u8 data_lines);
++void dispc_set_lcd_display_type(enum omap_lcd_display_type type);
++void dispc_set_loadmode(enum omap_dss_load_mode mode);
++
++void dispc_set_default_color(enum omap_channel channel, u32 color);
++u32 dispc_get_default_color(enum omap_channel channel);
++void dispc_set_trans_key(enum omap_channel ch,
++ enum omap_dss_color_key_type type,
++ u32 trans_key);
++void dispc_get_trans_key(enum omap_channel ch,
++ enum omap_dss_color_key_type *type,
++ u32 *trans_key);
++void dispc_enable_trans_key(enum omap_channel ch, bool enable);
++bool dispc_trans_key_enabled(enum omap_channel ch);
++
++void dispc_set_lcd_timings(struct omap_video_timings *timings);
++unsigned long dispc_fclk_rate(void);
++unsigned long dispc_pclk_rate(void);
++void dispc_set_pol_freq(struct omap_panel *panel);
++void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
++ u16 *lck_div, u16 *pck_div);
++int dispc_calc_clock_div(bool is_tft, unsigned long req_pck,
++ struct dispc_clock_info *cinfo);
++int dispc_set_clock_div(struct dispc_clock_info *cinfo);
++int dispc_get_clock_div(struct dispc_clock_info *cinfo);
++void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div);
++
++void dispc_setup_partial_planes(struct omap_display *display,
++ u16 *x, u16 *y, u16 *w, u16 *h);
++void dispc_draw_partial_planes(struct omap_display *display);
++
++
++/* VENC */
++int venc_init(void);
++void venc_exit(void);
++void venc_dump_regs(struct seq_file *s);
++void venc_init_display(struct omap_display *display);
++
++/* RFBI */
++int rfbi_init(void);
++void rfbi_exit(void);
++void rfbi_dump_regs(struct seq_file *s);
++
++int rfbi_configure(int rfbi_module, int bpp, int lines);
++void rfbi_enable_rfbi(bool enable);
++void rfbi_transfer_area(u16 width, u16 height,
++ void (callback)(void *data), void *data);
++void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t);
++unsigned long rfbi_get_max_tx_rate(void);
++void rfbi_init_display(struct omap_display *display);
++
++#endif
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+new file mode 100644
+index 0000000..b0fee80
+--- /dev/null
++++ b/drivers/video/omap2/dss/manager.c
+@@ -0,0 +1,576 @@
++/*
++ * linux/drivers/video/omap2/dss/manager.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "MANAGER"
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++
++#include <mach/display.h>
++
++#include "dss.h"
++
++static int num_managers;
++static struct list_head manager_list;
++
++static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n", mgr->name);
++}
++
++static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ mgr->display ? mgr->display->name : "<none>");
++}
++
++static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const char *buf, size_t size)
++{
++ int r, i;
++ int len = size;
++ struct omap_display *display = NULL;
++
++ if (buf[size-1] == '\n')
++ --len;
++
++ if (len > 0) {
++ for (i = 0; i < omap_dss_get_num_displays(); ++i) {
++ display = dss_get_display(i);
++
++ if (strncmp(buf, display->name, len) == 0)
++ break;
++
++ display = NULL;
++ }
++ }
++
++ if (len > 0 && display == NULL)
++ return -EINVAL;
++
++ if (display)
++ DSSDBG("display %s found\n", display->name);
++
++ if (mgr->display) {
++ r = mgr->unset_display(mgr);
++ if (r) {
++ DSSERR("failed to unset display\n");
++ return r;
++ }
++ }
++
++ if (display) {
++ r = mgr->set_display(mgr, display);
++ if (r) {
++ DSSERR("failed to set manager\n");
++ return r;
++ }
++
++ r = mgr->apply(mgr);
++ if (r) {
++ DSSERR("failed to apply dispc config\n");
++ return r;
++ }
++ }
++
++ return size;
++}
++
++static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
++ char *buf)
++{
++ u32 default_color;
++
++ default_color = dispc_get_default_color(mgr->id);
++ return snprintf(buf, PAGE_SIZE, "%d", default_color);
++}
++
++static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
++{
++ u32 default_color;
++
++ if (sscanf(buf, "%d", &default_color) != 1)
++ return -EINVAL;
++ dispc_set_default_color(mgr->id, default_color);
++
++ return size;
++}
++
++static const char *color_key_type_str[] = {
++ "gfx-destination",
++ "video-source",
++};
++
++static ssize_t manager_color_key_type_show(struct omap_overlay_manager *mgr,
++ char *buf)
++{
++ enum omap_dss_color_key_type key_type;
++
++ dispc_get_trans_key(mgr->id, &key_type, NULL);
++ BUG_ON(key_type >= ARRAY_SIZE(color_key_type_str));
++
++ return snprintf(buf, PAGE_SIZE, "%s\n", color_key_type_str[key_type]);
++}
++
++static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
++{
++ enum omap_dss_color_key_type key_type;
++ u32 key_value;
++
++ for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
++ key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
++ if (sysfs_streq(buf, color_key_type_str[key_type]))
++ break;
++ }
++ if (key_type == ARRAY_SIZE(color_key_type_str))
++ return -EINVAL;
++ dispc_get_trans_key(mgr->id, NULL, &key_value);
++ dispc_set_trans_key(mgr->id, key_type, key_value);
++
++ return size;
++}
++
++static ssize_t manager_color_key_value_show(struct omap_overlay_manager *mgr,
++ char *buf)
++{
++ u32 key_value;
++
++ dispc_get_trans_key(mgr->id, NULL, &key_value);
++
++ return snprintf(buf, PAGE_SIZE, "%d\n", key_value);
++}
++
++static ssize_t manager_color_key_value_store(struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
++{
++ enum omap_dss_color_key_type key_type;
++ u32 key_value;
++
++ if (sscanf(buf, "%d", &key_value) != 1)
++ return -EINVAL;
++ dispc_get_trans_key(mgr->id, &key_type, NULL);
++ dispc_set_trans_key(mgr->id, key_type, key_value);
++
++ return size;
++}
++
++static ssize_t manager_color_key_enabled_show(struct omap_overlay_manager *mgr,
++ char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n",
++ dispc_trans_key_enabled(mgr->id));
++}
++
++static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
++{
++ int enable;
++
++ if (sscanf(buf, "%d", &enable) != 1)
++ return -EINVAL;
++
++ dispc_enable_trans_key(mgr->id, enable);
++
++ return size;
++}
++
++
++struct manager_attribute {
++ struct attribute attr;
++ ssize_t (*show)(struct omap_overlay_manager *, char *);
++ ssize_t (*store)(struct omap_overlay_manager *, const char *, size_t);
++};
++
++#define MANAGER_ATTR(_name, _mode, _show, _store) \
++ struct manager_attribute manager_attr_##_name = \
++ __ATTR(_name, _mode, _show, _store)
++
++static MANAGER_ATTR(name, S_IRUGO, manager_name_show, NULL);
++static MANAGER_ATTR(display, S_IRUGO|S_IWUSR,
++ manager_display_show, manager_display_store);
++static MANAGER_ATTR(default_color, S_IRUGO|S_IWUSR,
++ manager_default_color_show, manager_default_color_store);
++static MANAGER_ATTR(color_key_type, S_IRUGO|S_IWUSR,
++ manager_color_key_type_show, manager_color_key_type_store);
++static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR,
++ manager_color_key_value_show, manager_color_key_value_store);
++static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR,
++ manager_color_key_enabled_show, manager_color_key_enabled_store);
++
++static struct attribute *manager_sysfs_attrs[] = {
++ &manager_attr_name.attr,
++ &manager_attr_display.attr,
++ &manager_attr_default_color.attr,
++ &manager_attr_color_key_type.attr,
++ &manager_attr_color_key_value.attr,
++ &manager_attr_color_key_enabled.attr,
++ NULL
++};
++
++static ssize_t manager_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
++{
++ struct omap_overlay_manager *manager;
++ struct manager_attribute *manager_attr;
++
++ manager = container_of(kobj, struct omap_overlay_manager, kobj);
++ manager_attr = container_of(attr, struct manager_attribute, attr);
++
++ if (!manager_attr->show)
++ return -ENOENT;
++
++ return manager_attr->show(manager, buf);
++}
++
++static ssize_t manager_attr_store(struct kobject *kobj, struct attribute *attr,
++ const char *buf, size_t size)
++{
++ struct omap_overlay_manager *manager;
++ struct manager_attribute *manager_attr;
++
++ manager = container_of(kobj, struct omap_overlay_manager, kobj);
++ manager_attr = container_of(attr, struct manager_attribute, attr);
++
++ if (!manager_attr->store)
++ return -ENOENT;
++
++ return manager_attr->store(manager, buf, size);
++}
++
++static struct sysfs_ops manager_sysfs_ops = {
++ .show = manager_attr_show,
++ .store = manager_attr_store,
++};
++
++static struct kobj_type manager_ktype = {
++ .sysfs_ops = &manager_sysfs_ops,
++ .default_attrs = manager_sysfs_attrs,
++};
++
++static int omap_dss_set_display(struct omap_overlay_manager *mgr,
++ struct omap_display *display)
++{
++ int i;
++ int r;
++
++ if (display->manager) {
++ DSSERR("display '%s' already has a manager '%s'\n",
++ display->name, display->manager->name);
++ return -EINVAL;
++ }
++
++ if ((mgr->supported_displays & display->type) == 0) {
++ DSSERR("display '%s' does not support manager '%s'\n",
++ display->name, mgr->name);
++ return -EINVAL;
++ }
++
++ for (i = 0; i < mgr->num_overlays; i++) {
++ struct omap_overlay *ovl = mgr->overlays[i];
++
++ if (ovl->manager != mgr || !ovl->info.enabled)
++ continue;
++
++ r = dss_check_overlay(ovl, display);
++ if (r)
++ return r;
++ }
++
++ display->manager = mgr;
++ mgr->display = display;
++
++ return 0;
++}
++
++static int omap_dss_unset_display(struct omap_overlay_manager *mgr)
++{
++ if (!mgr->display) {
++ DSSERR("failed to unset display, display not set.\n");
++ return -EINVAL;
++ }
++
++ mgr->display->manager = NULL;
++ mgr->display = NULL;
++
++ return 0;
++}
++
++
++static int overlay_enabled(struct omap_overlay *ovl)
++{
++ return ovl->info.enabled && ovl->manager && ovl->manager->display;
++}
++
++/* We apply settings to both managers here so that we can use optimizations
++ * like fifomerge. Shadow registers can be changed first and the non-shadowed
++ * should be changed last, at the same time with GO */
++static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
++{
++ int i;
++ int ret = 0;
++ enum omap_dss_update_mode mode;
++ struct omap_display *display;
++ struct omap_overlay *ovl;
++ bool ilace = 0;
++ int outw, outh;
++ int r;
++ int num_planes_enabled = 0;
++
++ DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ /* Configure normal overlay parameters and disable unused overlays */
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (!overlay_enabled(ovl)) {
++ dispc_enable_plane(ovl->id, 0);
++ continue;
++ }
++
++ display = ovl->manager->display;
++
++ if (dss_check_overlay(ovl, display)) {
++ dispc_enable_plane(ovl->id, 0);
++ continue;
++ }
++
++ ++num_planes_enabled;
++
++ /* On a manual update display, in manual update mode, update()
++ * handles configuring planes */
++ mode = OMAP_DSS_UPDATE_AUTO;
++ if (display->get_update_mode)
++ mode = display->get_update_mode(mgr->display);
++
++ if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
++ mode != OMAP_DSS_UPDATE_AUTO)
++ continue;
++
++ if (display->type == OMAP_DISPLAY_TYPE_VENC)
++ ilace = 1;
++
++ if (ovl->info.out_width == 0)
++ outw = ovl->info.width;
++ else
++ outw = ovl->info.out_width;
++
++ if (ovl->info.out_height == 0)
++ outh = ovl->info.height;
++ else
++ outh = ovl->info.out_height;
++
++ r = dispc_setup_plane(ovl->id, ovl->manager->id,
++ ovl->info.paddr,
++ ovl->info.screen_width,
++ ovl->info.pos_x,
++ ovl->info.pos_y,
++ ovl->info.width,
++ ovl->info.height,
++ outw,
++ outh,
++ ovl->info.color_mode,
++ ilace,
++ ovl->info.rotation,
++ ovl->info.mirror);
++
++ if (r) {
++ DSSERR("dispc_setup_plane failed for ovl %d\n",
++ ovl->id);
++ dispc_enable_plane(ovl->id, 0);
++ continue;
++ }
++
++ dispc_enable_plane(ovl->id, 1);
++ }
++
++ /* Enable fifo merge if possible */
++ dispc_enable_fifomerge(num_planes_enabled == 1);
++
++ /* Go through overlays again. This time we configure fifos. We have to
++ * do this after enabling/disabling fifomerge so that we have correct
++ * knowledge of fifo sizes */
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (!overlay_enabled(ovl)) {
++ continue;
++ }
++
++ ovl->manager->display->configure_overlay(ovl);
++ }
++
++ /* Issue GO for managers */
++ list_for_each_entry(mgr, &manager_list, list) {
++ if (!(mgr->caps & OMAP_DSS_OVL_MGR_CAP_DISPC))
++ continue;
++
++ display = mgr->display;
++
++ if (!display)
++ continue;
++
++ /* We don't need GO with manual update display. LCD iface will
++ * always be turned off after frame, and new settings will
++ * be taken in to use at next update */
++ if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
++ continue;
++
++ dispc_go(mgr->id);
++ }
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ return ret;
++}
++
++static void omap_dss_mgr_set_def_color(struct omap_overlay_manager *mgr,
++ u32 color)
++{
++ dispc_set_default_color(mgr->id, color);
++}
++
++static void omap_dss_mgr_set_trans_key(struct omap_overlay_manager *mgr,
++ enum omap_dss_color_key_type type,
++ u32 trans_key)
++{
++ dispc_set_trans_key(mgr->id, type, trans_key);
++}
++
++static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
++ bool enable)
++{
++ dispc_enable_trans_key(mgr->id, enable);
++}
++
++static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
++{
++ ++num_managers;
++ list_add_tail(&manager->list, &manager_list);
++}
++
++int dss_init_overlay_managers(struct platform_device *pdev)
++{
++ int i, r;
++
++ INIT_LIST_HEAD(&manager_list);
++
++ num_managers = 0;
++
++ for (i = 0; i < 2; ++i) {
++ struct omap_overlay_manager *mgr;
++ mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
++
++ BUG_ON(mgr == NULL);
++
++ switch (i) {
++ case 0:
++ mgr->name = "lcd";
++ mgr->id = OMAP_DSS_CHANNEL_LCD;
++ mgr->supported_displays =
++ OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
++ OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI;
++ break;
++ case 1:
++ mgr->name = "tv";
++ mgr->id = OMAP_DSS_CHANNEL_DIGIT;
++ mgr->supported_displays = OMAP_DISPLAY_TYPE_VENC;
++ break;
++ }
++
++ mgr->set_display = &omap_dss_set_display,
++ mgr->unset_display = &omap_dss_unset_display,
++ mgr->apply = &omap_dss_mgr_apply,
++ mgr->set_default_color = &omap_dss_mgr_set_def_color,
++ mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
++ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
++ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
++
++ dss_overlay_setup_dispc_manager(mgr);
++
++ omap_dss_add_overlay_manager(mgr);
++
++ r = kobject_init_and_add(&mgr->kobj, &manager_ktype,
++ &pdev->dev.kobj, "manager%d", i);
++
++ if (r) {
++ DSSERR("failed to create sysfs file\n");
++ continue;
++ }
++ }
++
++ return 0;
++}
++
++void dss_uninit_overlay_managers(struct platform_device *pdev)
++{
++ struct omap_overlay_manager *mgr;
++
++ while (!list_empty(&manager_list)) {
++ mgr = list_first_entry(&manager_list,
++ struct omap_overlay_manager, list);
++ list_del(&mgr->list);
++ kobject_del(&mgr->kobj);
++ kobject_put(&mgr->kobj);
++ kfree(mgr);
++ }
++
++ num_managers = 0;
++}
++
++int omap_dss_get_num_overlay_managers(void)
++{
++ return num_managers;
++}
++EXPORT_SYMBOL(omap_dss_get_num_overlay_managers);
++
++struct omap_overlay_manager *omap_dss_get_overlay_manager(int num)
++{
++ int i = 0;
++ struct omap_overlay_manager *mgr;
++
++ list_for_each_entry(mgr, &manager_list, list) {
++ if (i++ == num)
++ return mgr;
++ }
++
++ return NULL;
++}
++EXPORT_SYMBOL(omap_dss_get_overlay_manager);
++
++#ifdef L4_EXAMPLE
++static int ovl_mgr_apply_l4(struct omap_overlay_manager *mgr)
++{
++ DSSDBG("omap_dss_mgr_apply_l4(%s)\n", mgr->name);
++
++ return 0;
++}
++#endif
++
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+new file mode 100644
+index 0000000..968edbe
+--- /dev/null
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -0,0 +1,587 @@
++/*
++ * linux/drivers/video/omap2/dss/overlay.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "OVERLAY"
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/err.h>
++#include <linux/sysfs.h>
++#include <linux/kobject.h>
++#include <linux/platform_device.h>
++
++#include <mach/display.h>
++
++#include "dss.h"
++
++static int num_overlays;
++static struct list_head overlay_list;
++
++static ssize_t overlay_name_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n", ovl->name);
++}
++
++static ssize_t overlay_manager_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ ovl->manager ? ovl->manager->name : "<none>");
++}
++
++static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf, size_t size)
++{
++ int i, r;
++ struct omap_overlay_manager *mgr = NULL;
++ int len = size;
++
++ if (buf[size-1] == '\n')
++ --len;
++
++ if (len > 0) {
++ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
++ mgr = omap_dss_get_overlay_manager(i);
++
++ if (strncmp(buf, mgr->name, len) == 0)
++ break;
++
++ mgr = NULL;
++ }
++ }
++
++ if (len > 0 && mgr == NULL)
++ return -EINVAL;
++
++ if (mgr)
++ DSSDBG("manager %s found\n", mgr->name);
++
++ if (mgr != ovl->manager) {
++ /* detach old manager */
++ if (ovl->manager) {
++ r = ovl->unset_manager(ovl);
++ if (r) {
++ DSSERR("detach failed\n");
++ return r;
++ }
++ }
++
++ if (mgr) {
++ r = ovl->set_manager(ovl, mgr);
++ if (r) {
++ DSSERR("Failed to attach overlay\n");
++ return r;
++ }
++ }
++ }
++
++ if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
++ return r;
++
++ return size;
++}
++
++static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d,%d\n",
++ ovl->info.width, ovl->info.height);
++}
++
++static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.screen_width);
++}
++
++static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d,%d\n",
++ ovl->info.pos_x, ovl->info.pos_y);
++}
++
++static ssize_t overlay_position_store(struct omap_overlay *ovl,
++ const char *buf, size_t size)
++{
++ int r;
++ char *last;
++ struct omap_overlay_info info;
++
++ ovl->get_overlay_info(ovl, &info);
++
++ info.pos_x = simple_strtoul(buf, &last, 10);
++ ++last;
++ if (last - buf >= size)
++ return -EINVAL;
++
++ info.pos_y = simple_strtoul(last, &last, 10);
++
++ if ((r = ovl->set_overlay_info(ovl, &info)))
++ return r;
++
++ if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
++ return r;
++
++ return size;
++}
++
++static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d,%d\n",
++ ovl->info.out_width, ovl->info.out_height);
++}
++
++static ssize_t overlay_output_size_store(struct omap_overlay *ovl,
++ const char *buf, size_t size)
++{
++ int r;
++ char *last;
++ struct omap_overlay_info info;
++
++ ovl->get_overlay_info(ovl, &info);
++
++ info.out_width = simple_strtoul(buf, &last, 10);
++ ++last;
++ if (last - buf >= size)
++ return -EINVAL;
++
++ info.out_height = simple_strtoul(last, &last, 10);
++
++ if ((r = ovl->set_overlay_info(ovl, &info)))
++ return r;
++
++ if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
++ return r;
++
++ return size;
++}
++
++static ssize_t overlay_enabled_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.enabled);
++}
++
++static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf, size_t size)
++{
++ int r;
++ struct omap_overlay_info info;
++
++ ovl->get_overlay_info(ovl, &info);
++
++ info.enabled = simple_strtoul(buf, NULL, 10);
++
++ if ((r = ovl->set_overlay_info(ovl, &info)))
++ return r;
++
++ if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
++ return r;
++
++ return size;
++}
++
++struct overlay_attribute {
++ struct attribute attr;
++ ssize_t (*show)(struct omap_overlay *, char *);
++ ssize_t (*store)(struct omap_overlay *, const char *, size_t);
++};
++
++#define OVERLAY_ATTR(_name, _mode, _show, _store) \
++ struct overlay_attribute overlay_attr_##_name = \
++ __ATTR(_name, _mode, _show, _store)
++
++static OVERLAY_ATTR(name, S_IRUGO, overlay_name_show, NULL);
++static OVERLAY_ATTR(manager, S_IRUGO|S_IWUSR,
++ overlay_manager_show, overlay_manager_store);
++static OVERLAY_ATTR(input_size, S_IRUGO, overlay_input_size_show, NULL);
++static OVERLAY_ATTR(screen_width, S_IRUGO, overlay_screen_width_show, NULL);
++static OVERLAY_ATTR(position, S_IRUGO|S_IWUSR,
++ overlay_position_show, overlay_position_store);
++static OVERLAY_ATTR(output_size, S_IRUGO|S_IWUSR,
++ overlay_output_size_show, overlay_output_size_store);
++static OVERLAY_ATTR(enabled, S_IRUGO|S_IWUSR,
++ overlay_enabled_show, overlay_enabled_store);
++
++static struct attribute *overlay_sysfs_attrs[] = {
++ &overlay_attr_name.attr,
++ &overlay_attr_manager.attr,
++ &overlay_attr_input_size.attr,
++ &overlay_attr_screen_width.attr,
++ &overlay_attr_position.attr,
++ &overlay_attr_output_size.attr,
++ &overlay_attr_enabled.attr,
++ NULL
++};
++
++static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
++{
++ struct omap_overlay *overlay;
++ struct overlay_attribute *overlay_attr;
++
++ overlay = container_of(kobj, struct omap_overlay, kobj);
++ overlay_attr = container_of(attr, struct overlay_attribute, attr);
++
++ if (!overlay_attr->show)
++ return -ENOENT;
++
++ return overlay_attr->show(overlay, buf);
++}
++
++static ssize_t overlay_attr_store(struct kobject *kobj, struct attribute *attr,
++ const char *buf, size_t size)
++{
++ struct omap_overlay *overlay;
++ struct overlay_attribute *overlay_attr;
++
++ overlay = container_of(kobj, struct omap_overlay, kobj);
++ overlay_attr = container_of(attr, struct overlay_attribute, attr);
++
++ if (!overlay_attr->store)
++ return -ENOENT;
++
++ return overlay_attr->store(overlay, buf, size);
++}
++
++static struct sysfs_ops overlay_sysfs_ops = {
++ .show = overlay_attr_show,
++ .store = overlay_attr_store,
++};
++
++static struct kobj_type overlay_ktype = {
++ .sysfs_ops = &overlay_sysfs_ops,
++ .default_attrs = overlay_sysfs_attrs,
++};
++
++/* Check if overlay parameters are compatible with display */
++int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
++{
++ struct omap_overlay_info *info;
++ u16 outw, outh;
++ u16 dw, dh;
++
++ if (!display)
++ return 0;
++
++ if (!ovl->info.enabled)
++ return 0;
++
++ info = &ovl->info;
++
++ display->get_resolution(display, &dw, &dh);
++
++ DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
++ ovl->id,
++ info->pos_x, info->pos_y,
++ info->width, info->height,
++ info->out_width, info->out_height,
++ dw, dh);
++
++ if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
++ outw = info->width;
++ outh = info->height;
++ } else {
++ if (info->out_width == 0)
++ outw = info->width;
++ else
++ outw = info->out_width;
++
++ if (info->out_height == 0)
++ outh = info->height;
++ else
++ outh = info->out_height;
++ }
++
++ if (dw < info->pos_x + outw) {
++ DSSDBG("check_overlay failed 1: %d < %d + %d\n",
++ dw, info->pos_x, outw);
++ return -EINVAL;
++ }
++
++ if (dh < info->pos_y + outh) {
++ DSSDBG("check_overlay failed 2: %d < %d + %d\n",
++ dh, info->pos_y, outh);
++ return -EINVAL;
++ }
++
++ if ((ovl->supported_modes & info->color_mode) == 0) {
++ DSSERR("overlay doesn't support mode %d\n", info->color_mode);
++ return -EINVAL;
++ }
++
++ return 0;
++}
++
++static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
++ struct omap_overlay_info *info)
++{
++ int r;
++ struct omap_overlay_info old_info;
++
++ old_info = ovl->info;
++ ovl->info = *info;
++
++ if (ovl->manager) {
++ r = dss_check_overlay(ovl, ovl->manager->display);
++ if (r) {
++ ovl->info = old_info;
++ return r;
++ }
++ }
++
++ return 0;
++}
++
++static void dss_ovl_get_overlay_info(struct omap_overlay *ovl,
++ struct omap_overlay_info *info)
++{
++ *info = ovl->info;
++}
++
++static int omap_dss_set_manager(struct omap_overlay *ovl,
++ struct omap_overlay_manager *mgr)
++{
++ int r;
++
++ if (ovl->manager) {
++ DSSERR("overlay '%s' already has a manager '%s'\n",
++ ovl->name, ovl->manager->name);
++ }
++
++ r = dss_check_overlay(ovl, mgr->display);
++ if (r)
++ return r;
++
++ ovl->manager = mgr;
++
++ return 0;
++}
++
++static int omap_dss_unset_manager(struct omap_overlay *ovl)
++{
++ if (!ovl->manager) {
++ DSSERR("failed to detach overlay: manager not set\n");
++ return -EINVAL;
++ }
++
++ ovl->manager = NULL;
++
++ return 0;
++}
++
++int omap_dss_get_num_overlays(void)
++{
++ return num_overlays;
++}
++EXPORT_SYMBOL(omap_dss_get_num_overlays);
++
++struct omap_overlay *omap_dss_get_overlay(int num)
++{
++ int i = 0;
++ struct omap_overlay *ovl;
++
++ list_for_each_entry(ovl, &overlay_list, list) {
++ if (i++ == num)
++ return ovl;
++ }
++
++ return NULL;
++}
++EXPORT_SYMBOL(omap_dss_get_overlay);
++
++static void omap_dss_add_overlay(struct omap_overlay *overlay)
++{
++ ++num_overlays;
++ list_add_tail(&overlay->list, &overlay_list);
++}
++
++static struct omap_overlay *dispc_overlays[3];
++
++void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr)
++{
++ mgr->num_overlays = 3;
++ mgr->overlays = dispc_overlays;
++}
++
++void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
++{
++ int i, r;
++ struct omap_overlay_manager *lcd_mgr;
++ struct omap_overlay_manager *tv_mgr;
++ struct omap_overlay_manager *def_mgr = NULL;
++
++ INIT_LIST_HEAD(&overlay_list);
++
++ num_overlays = 0;
++
++ for (i = 0; i < 3; ++i) {
++ struct omap_overlay *ovl;
++ ovl = kzalloc(sizeof(*ovl), GFP_KERNEL);
++
++ BUG_ON(ovl == NULL);
++
++ switch (i) {
++ case 0:
++ ovl->name = "gfx";
++ ovl->id = OMAP_DSS_GFX;
++ ovl->supported_modes = OMAP_DSS_COLOR_GFX_OMAP3;
++ ovl->caps = OMAP_DSS_OVL_CAP_DISPC;
++ break;
++ case 1:
++ ovl->name = "vid1";
++ ovl->id = OMAP_DSS_VIDEO1;
++ ovl->supported_modes = OMAP_DSS_COLOR_VID_OMAP3;
++ ovl->caps = OMAP_DSS_OVL_CAP_SCALE |
++ OMAP_DSS_OVL_CAP_DISPC;
++ break;
++ case 2:
++ ovl->name = "vid2";
++ ovl->id = OMAP_DSS_VIDEO2;
++ ovl->supported_modes = OMAP_DSS_COLOR_VID_OMAP3;
++ ovl->caps = OMAP_DSS_OVL_CAP_SCALE |
++ OMAP_DSS_OVL_CAP_DISPC;
++ break;
++ }
++
++ ovl->set_manager = &omap_dss_set_manager;
++ ovl->unset_manager = &omap_dss_unset_manager;
++ ovl->set_overlay_info = &dss_ovl_set_overlay_info;
++ ovl->get_overlay_info = &dss_ovl_get_overlay_info;
++
++ omap_dss_add_overlay(ovl);
++
++ r = kobject_init_and_add(&ovl->kobj, &overlay_ktype,
++ &pdev->dev.kobj, "overlay%d", i);
++
++ if (r) {
++ DSSERR("failed to create sysfs file\n");
++ continue;
++ }
++
++ dispc_overlays[i] = ovl;
++ }
++
++ lcd_mgr = omap_dss_get_overlay_manager(OMAP_DSS_OVL_MGR_LCD);
++ tv_mgr = omap_dss_get_overlay_manager(OMAP_DSS_OVL_MGR_TV);
++
++ if (def_disp_name) {
++ for (i = 0; i < omap_dss_get_num_displays() ; i++) {
++ struct omap_display *display = dss_get_display(i);
++
++ if (strcmp(display->name, def_disp_name) == 0) {
++ if (display->type != OMAP_DISPLAY_TYPE_VENC) {
++ lcd_mgr->set_display(lcd_mgr, display);
++ def_mgr = lcd_mgr;
++ } else {
++ lcd_mgr->set_display(tv_mgr, display);
++ def_mgr = tv_mgr;
++ }
++
++ break;
++ }
++ }
++
++ if (!def_mgr)
++ DSSWARN("default display %s not found\n",
++ def_disp_name);
++ }
++
++ if (def_mgr != lcd_mgr) {
++ /* connect lcd manager to first non-VENC display found */
++ for (i = 0; i < omap_dss_get_num_displays(); i++) {
++ struct omap_display *display = dss_get_display(i);
++ if (display->type != OMAP_DISPLAY_TYPE_VENC) {
++ lcd_mgr->set_display(lcd_mgr, display);
++
++ if (!def_mgr)
++ def_mgr = lcd_mgr;
++
++ break;
++ }
++ }
++ }
++
++ if (def_mgr != tv_mgr) {
++ /* connect tv manager to first VENC display found */
++ for (i = 0; i < omap_dss_get_num_displays(); i++) {
++ struct omap_display *display = dss_get_display(i);
++ if (display->type == OMAP_DISPLAY_TYPE_VENC) {
++ tv_mgr->set_display(tv_mgr, display);
++
++ if (!def_mgr)
++ def_mgr = tv_mgr;
++
++ break;
++ }
++ }
++ }
++
++ /* connect all dispc overlays to def_mgr */
++ if (def_mgr) {
++ for (i = 0; i < 3; i++) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++ omap_dss_set_manager(ovl, def_mgr);
++ }
++ }
++
++#ifdef L4_EXAMPLE
++ /* setup L4 overlay as an example */
++ {
++ static struct omap_overlay ovl = {
++ .name = "l4-ovl",
++ .supported_modes = OMAP_DSS_COLOR_RGB24U,
++ .set_manager = &omap_dss_set_manager,
++ .unset_manager = &omap_dss_unset_manager,
++ .setup_input = &omap_dss_setup_overlay_input,
++ .setup_output = &omap_dss_setup_overlay_output,
++ .enable = &omap_dss_enable_overlay,
++ };
++
++ static struct omap_overlay_manager mgr = {
++ .name = "l4",
++ .num_overlays = 1,
++ .overlays = &ovl,
++ .set_display = &omap_dss_set_display,
++ .unset_display = &omap_dss_unset_display,
++ .apply = &ovl_mgr_apply_l4,
++ .supported_displays =
++ OMAP_DISPLAY_TYPE_DBI | OMAP_DISPLAY_TYPE_DSI,
++ };
++
++ omap_dss_add_overlay(&ovl);
++ omap_dss_add_overlay_manager(&mgr);
++ omap_dss_set_manager(&ovl, &mgr);
++ }
++#endif
++}
++
++void dss_uninit_overlays(struct platform_device *pdev)
++{
++ struct omap_overlay *ovl;
++
++ while (!list_empty(&overlay_list)) {
++ ovl = list_first_entry(&overlay_list,
++ struct omap_overlay, list);
++ list_del(&ovl->list);
++ kobject_del(&ovl->kobj);
++ kobject_put(&ovl->kobj);
++ kfree(ovl);
++ }
++
++ num_overlays = 0;
++}
++
+diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
+new file mode 100644
+index 0000000..3e9ae1e
+--- /dev/null
++++ b/drivers/video/omap2/dss/rfbi.c
+@@ -0,0 +1,1304 @@
++/*
++ * linux/drivers/video/omap2/dss/rfbi.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "RFBI"
++
++#include <linux/kernel.h>
++#include <linux/dma-mapping.h>
++#include <linux/vmalloc.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <linux/delay.h>
++#include <linux/kfifo.h>
++#include <linux/ktime.h>
++#include <linux/hrtimer.h>
++#include <linux/seq_file.h>
++
++#include <mach/board.h>
++#include <mach/display.h>
++#include "dss.h"
++
++/*#define MEASURE_PERF*/
++
++#define RFBI_BASE 0x48050800
++
++struct rfbi_reg { u16 idx; };
++
++#define RFBI_REG(idx) ((const struct rfbi_reg) { idx })
++
++#define RFBI_REVISION RFBI_REG(0x0000)
++#define RFBI_SYSCONFIG RFBI_REG(0x0010)
++#define RFBI_SYSSTATUS RFBI_REG(0x0014)
++#define RFBI_CONTROL RFBI_REG(0x0040)
++#define RFBI_PIXEL_CNT RFBI_REG(0x0044)
++#define RFBI_LINE_NUMBER RFBI_REG(0x0048)
++#define RFBI_CMD RFBI_REG(0x004c)
++#define RFBI_PARAM RFBI_REG(0x0050)
++#define RFBI_DATA RFBI_REG(0x0054)
++#define RFBI_READ RFBI_REG(0x0058)
++#define RFBI_STATUS RFBI_REG(0x005c)
++
++#define RFBI_CONFIG(n) RFBI_REG(0x0060 + (n)*0x18)
++#define RFBI_ONOFF_TIME(n) RFBI_REG(0x0064 + (n)*0x18)
++#define RFBI_CYCLE_TIME(n) RFBI_REG(0x0068 + (n)*0x18)
++#define RFBI_DATA_CYCLE1(n) RFBI_REG(0x006c + (n)*0x18)
++#define RFBI_DATA_CYCLE2(n) RFBI_REG(0x0070 + (n)*0x18)
++#define RFBI_DATA_CYCLE3(n) RFBI_REG(0x0074 + (n)*0x18)
++
++#define RFBI_VSYNC_WIDTH RFBI_REG(0x0090)
++#define RFBI_HSYNC_WIDTH RFBI_REG(0x0094)
++
++#define RFBI_CMD_FIFO_LEN_BYTES (16 * sizeof(struct update_param))
++
++#define REG_FLD_MOD(idx, val, start, end) \
++ rfbi_write_reg(idx, FLD_MOD(rfbi_read_reg(idx), val, start, end))
++
++/* To work around an RFBI transfer rate limitation */
++#define OMAP_RFBI_RATE_LIMIT 1
++
++enum omap_rfbi_cycleformat {
++ OMAP_DSS_RFBI_CYCLEFORMAT_1_1 = 0,
++ OMAP_DSS_RFBI_CYCLEFORMAT_2_1 = 1,
++ OMAP_DSS_RFBI_CYCLEFORMAT_3_1 = 2,
++ OMAP_DSS_RFBI_CYCLEFORMAT_3_2 = 3,
++};
++
++enum omap_rfbi_datatype {
++ OMAP_DSS_RFBI_DATATYPE_12 = 0,
++ OMAP_DSS_RFBI_DATATYPE_16 = 1,
++ OMAP_DSS_RFBI_DATATYPE_18 = 2,
++ OMAP_DSS_RFBI_DATATYPE_24 = 3,
++};
++
++enum omap_rfbi_parallelmode {
++ OMAP_DSS_RFBI_PARALLELMODE_8 = 0,
++ OMAP_DSS_RFBI_PARALLELMODE_9 = 1,
++ OMAP_DSS_RFBI_PARALLELMODE_12 = 2,
++ OMAP_DSS_RFBI_PARALLELMODE_16 = 3,
++};
++
++enum update_cmd {
++ RFBI_CMD_UPDATE = 0,
++ RFBI_CMD_SYNC = 1,
++};
++
++static int rfbi_convert_timings(struct rfbi_timings *t);
++static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div);
++static void process_cmd_fifo(void);
++
++static struct {
++ void __iomem *base;
++
++ unsigned long l4_khz;
++
++ enum omap_rfbi_datatype datatype;
++ enum omap_rfbi_parallelmode parallelmode;
++
++ enum omap_rfbi_te_mode te_mode;
++ int te_enabled;
++
++ void (*framedone_callback)(void *data);
++ void *framedone_callback_data;
++
++ struct omap_display *display[2];
++
++ struct kfifo *cmd_fifo;
++ spinlock_t cmd_lock;
++ struct completion cmd_done;
++ atomic_t cmd_fifo_full;
++ atomic_t cmd_pending;
++#ifdef MEASURE_PERF
++ unsigned perf_bytes;
++ ktime_t perf_setup_time;
++ ktime_t perf_start_time;
++#endif
++} rfbi;
++
++struct update_region {
++ u16 x;
++ u16 y;
++ u16 w;
++ u16 h;
++};
++
++struct update_param {
++ u8 rfbi_module;
++ u8 cmd;
++
++ union {
++ struct update_region r;
++ struct completion *sync;
++ } par;
++};
++
++static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val)
++{
++ __raw_writel(val, rfbi.base + idx.idx);
++}
++
++static inline u32 rfbi_read_reg(const struct rfbi_reg idx)
++{
++ return __raw_readl(rfbi.base + idx.idx);
++}
++
++static void rfbi_enable_clocks(bool enable)
++{
++ if (enable)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ else
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++}
++
++void omap_rfbi_write_command(const void *buf, u32 len)
++{
++ rfbi_enable_clocks(1);
++ switch (rfbi.parallelmode) {
++ case OMAP_DSS_RFBI_PARALLELMODE_8:
++ {
++ const u8 *b = buf;
++ for (; len; len--)
++ rfbi_write_reg(RFBI_CMD, *b++);
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_16:
++ {
++ const u16 *w = buf;
++ BUG_ON(len & 1);
++ for (; len; len -= 2)
++ rfbi_write_reg(RFBI_CMD, *w++);
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_9:
++ case OMAP_DSS_RFBI_PARALLELMODE_12:
++ default:
++ BUG();
++ }
++ rfbi_enable_clocks(0);
++}
++EXPORT_SYMBOL(omap_rfbi_write_command);
++
++void omap_rfbi_read_data(void *buf, u32 len)
++{
++ rfbi_enable_clocks(1);
++ switch (rfbi.parallelmode) {
++ case OMAP_DSS_RFBI_PARALLELMODE_8:
++ {
++ u8 *b = buf;
++ for (; len; len--) {
++ rfbi_write_reg(RFBI_READ, 0);
++ *b++ = rfbi_read_reg(RFBI_READ);
++ }
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_16:
++ {
++ u16 *w = buf;
++ BUG_ON(len & ~1);
++ for (; len; len -= 2) {
++ rfbi_write_reg(RFBI_READ, 0);
++ *w++ = rfbi_read_reg(RFBI_READ);
++ }
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_9:
++ case OMAP_DSS_RFBI_PARALLELMODE_12:
++ default:
++ BUG();
++ }
++ rfbi_enable_clocks(0);
++}
++EXPORT_SYMBOL(omap_rfbi_read_data);
++
++void omap_rfbi_write_data(const void *buf, u32 len)
++{
++ rfbi_enable_clocks(1);
++ switch (rfbi.parallelmode) {
++ case OMAP_DSS_RFBI_PARALLELMODE_8:
++ {
++ const u8 *b = buf;
++ for (; len; len--)
++ rfbi_write_reg(RFBI_PARAM, *b++);
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_16:
++ {
++ const u16 *w = buf;
++ BUG_ON(len & 1);
++ for (; len; len -= 2)
++ rfbi_write_reg(RFBI_PARAM, *w++);
++ break;
++ }
++
++ case OMAP_DSS_RFBI_PARALLELMODE_9:
++ case OMAP_DSS_RFBI_PARALLELMODE_12:
++ default:
++ BUG();
++
++ }
++ rfbi_enable_clocks(0);
++}
++EXPORT_SYMBOL(omap_rfbi_write_data);
++
++void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width,
++ u16 x, u16 y,
++ u16 w, u16 h)
++{
++ int start_offset = scr_width * y + x;
++ int horiz_offset = scr_width - w;
++ int i;
++
++ rfbi_enable_clocks(1);
++
++ if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_16 &&
++ rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_8) {
++ const u16 __iomem *pd = buf;
++ pd += start_offset;
++
++ for (; h; --h) {
++ for (i = 0; i < w; ++i) {
++ const u8 __iomem *b = (const u8 __iomem *)pd;
++ rfbi_write_reg(RFBI_PARAM, __raw_readb(b+1));
++ rfbi_write_reg(RFBI_PARAM, __raw_readb(b+0));
++ ++pd;
++ }
++ pd += horiz_offset;
++ }
++ } else if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_24 &&
++ rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_8) {
++ const u32 __iomem *pd = buf;
++ pd += start_offset;
++
++ for (; h; --h) {
++ for (i = 0; i < w; ++i) {
++ const u8 __iomem *b = (const u8 __iomem *)pd;
++ rfbi_write_reg(RFBI_PARAM, __raw_readb(b+2));
++ rfbi_write_reg(RFBI_PARAM, __raw_readb(b+1));
++ rfbi_write_reg(RFBI_PARAM, __raw_readb(b+0));
++ ++pd;
++ }
++ pd += horiz_offset;
++ }
++ } else if (rfbi.datatype == OMAP_DSS_RFBI_DATATYPE_16 &&
++ rfbi.parallelmode == OMAP_DSS_RFBI_PARALLELMODE_16) {
++ const u16 __iomem *pd = buf;
++ pd += start_offset;
++
++ for (; h; --h) {
++ for (i = 0; i < w; ++i) {
++ rfbi_write_reg(RFBI_PARAM, __raw_readw(pd));
++ ++pd;
++ }
++ pd += horiz_offset;
++ }
++ } else {
++ BUG();
++ }
++
++ rfbi_enable_clocks(0);
++}
++EXPORT_SYMBOL(omap_rfbi_write_pixels);
++
++#ifdef MEASURE_PERF
++static void perf_mark_setup(void)
++{
++ rfbi.perf_setup_time = ktime_get();
++}
++
++static void perf_mark_start(void)
++{
++ rfbi.perf_start_time = ktime_get();
++}
++
++static void perf_show(const char *name)
++{
++ ktime_t t, setup_time, trans_time;
++ u32 total_bytes;
++ u32 setup_us, trans_us, total_us;
++
++ t = ktime_get();
++
++ setup_time = ktime_sub(rfbi.perf_start_time, rfbi.perf_setup_time);
++ setup_us = (u32)ktime_to_us(setup_time);
++ if (setup_us == 0)
++ setup_us = 1;
++
++ trans_time = ktime_sub(t, rfbi.perf_start_time);
++ trans_us = (u32)ktime_to_us(trans_time);
++ if (trans_us == 0)
++ trans_us = 1;
++
++ total_us = setup_us + trans_us;
++
++ total_bytes = rfbi.perf_bytes;
++
++ DSSINFO("%s update %u us + %u us = %u us (%uHz), %u bytes, "
++ "%u kbytes/sec\n",
++ name,
++ setup_us,
++ trans_us,
++ total_us,
++ 1000*1000 / total_us,
++ total_bytes,
++ total_bytes * 1000 / total_us);
++}
++#else
++#define perf_mark_setup()
++#define perf_mark_start()
++#define perf_show(x)
++#endif
++
++void rfbi_transfer_area(u16 width, u16 height,
++ void (callback)(void *data), void *data)
++{
++ u32 l;
++
++ /*BUG_ON(callback == 0);*/
++ BUG_ON(rfbi.framedone_callback != NULL);
++
++ DSSDBG("rfbi_transfer_area %dx%d\n", width, height);
++
++ dispc_set_lcd_size(width, height);
++
++ dispc_enable_lcd_out(1);
++
++ rfbi.framedone_callback = callback;
++ rfbi.framedone_callback_data = data;
++
++ rfbi_enable_clocks(1);
++
++ rfbi_write_reg(RFBI_PIXEL_CNT, width * height);
++
++ l = rfbi_read_reg(RFBI_CONTROL);
++ l = FLD_MOD(l, 1, 0, 0); /* enable */
++ if (!rfbi.te_enabled)
++ l = FLD_MOD(l, 1, 4, 4); /* ITE */
++
++ perf_mark_start();
++
++ rfbi_write_reg(RFBI_CONTROL, l);
++}
++
++static void framedone_callback(void *data, u32 mask)
++{
++ void (*callback)(void *data);
++
++ DSSDBG("FRAMEDONE\n");
++
++ perf_show("DISPC");
++
++ REG_FLD_MOD(RFBI_CONTROL, 0, 0, 0);
++
++ rfbi_enable_clocks(0);
++
++ callback = rfbi.framedone_callback;
++ rfbi.framedone_callback = NULL;
++
++ /*callback(rfbi.framedone_callback_data);*/
++
++ atomic_set(&rfbi.cmd_pending, 0);
++
++ process_cmd_fifo();
++}
++
++#if 1 /* VERBOSE */
++static void rfbi_print_timings(void)
++{
++ u32 l;
++ u32 time;
++
++ l = rfbi_read_reg(RFBI_CONFIG(0));
++ time = 1000000000 / rfbi.l4_khz;
++ if (l & (1 << 4))
++ time *= 2;
++
++ DSSDBG("Tick time %u ps\n", time);
++ l = rfbi_read_reg(RFBI_ONOFF_TIME(0));
++ DSSDBG("CSONTIME %d, CSOFFTIME %d, WEONTIME %d, WEOFFTIME %d, "
++ "REONTIME %d, REOFFTIME %d\n",
++ l & 0x0f, (l >> 4) & 0x3f, (l >> 10) & 0x0f, (l >> 14) & 0x3f,
++ (l >> 20) & 0x0f, (l >> 24) & 0x3f);
++
++ l = rfbi_read_reg(RFBI_CYCLE_TIME(0));
++ DSSDBG("WECYCLETIME %d, RECYCLETIME %d, CSPULSEWIDTH %d, "
++ "ACCESSTIME %d\n",
++ (l & 0x3f), (l >> 6) & 0x3f, (l >> 12) & 0x3f,
++ (l >> 22) & 0x3f);
++}
++#else
++static void rfbi_print_timings(void) {}
++#endif
++
++
++
++
++static u32 extif_clk_period;
++
++static inline unsigned long round_to_extif_ticks(unsigned long ps, int div)
++{
++ int bus_tick = extif_clk_period * div;
++ return (ps + bus_tick - 1) / bus_tick * bus_tick;
++}
++
++static int calc_reg_timing(struct rfbi_timings *t, int div)
++{
++ t->clk_div = div;
++
++ t->cs_on_time = round_to_extif_ticks(t->cs_on_time, div);
++
++ t->we_on_time = round_to_extif_ticks(t->we_on_time, div);
++ t->we_off_time = round_to_extif_ticks(t->we_off_time, div);
++ t->we_cycle_time = round_to_extif_ticks(t->we_cycle_time, div);
++
++ t->re_on_time = round_to_extif_ticks(t->re_on_time, div);
++ t->re_off_time = round_to_extif_ticks(t->re_off_time, div);
++ t->re_cycle_time = round_to_extif_ticks(t->re_cycle_time, div);
++
++ t->access_time = round_to_extif_ticks(t->access_time, div);
++ t->cs_off_time = round_to_extif_ticks(t->cs_off_time, div);
++ t->cs_pulse_width = round_to_extif_ticks(t->cs_pulse_width, div);
++
++ DSSDBG("[reg]cson %d csoff %d reon %d reoff %d\n",
++ t->cs_on_time, t->cs_off_time, t->re_on_time, t->re_off_time);
++ DSSDBG("[reg]weon %d weoff %d recyc %d wecyc %d\n",
++ t->we_on_time, t->we_off_time, t->re_cycle_time,
++ t->we_cycle_time);
++ DSSDBG("[reg]rdaccess %d cspulse %d\n",
++ t->access_time, t->cs_pulse_width);
++
++ return rfbi_convert_timings(t);
++}
++
++static int calc_extif_timings(struct rfbi_timings *t)
++{
++ u32 max_clk_div;
++ int div;
++
++ rfbi_get_clk_info(&extif_clk_period, &max_clk_div);
++ for (div = 1; div <= max_clk_div; div++) {
++ if (calc_reg_timing(t, div) == 0)
++ break;
++ }
++
++ if (div <= max_clk_div)
++ return 0;
++
++ DSSERR("can't setup timings\n");
++ return -1;
++}
++
++
++void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t)
++{
++ int r;
++
++ if (!t->converted) {
++ r = calc_extif_timings(t);
++ if (r < 0)
++ DSSERR("Failed to calc timings\n");
++ }
++
++ BUG_ON(!t->converted);
++
++ rfbi_enable_clocks(1);
++ rfbi_write_reg(RFBI_ONOFF_TIME(rfbi_module), t->tim[0]);
++ rfbi_write_reg(RFBI_CYCLE_TIME(rfbi_module), t->tim[1]);
++
++ /* TIMEGRANULARITY */
++ REG_FLD_MOD(RFBI_CONFIG(rfbi_module),
++ (t->tim[2] ? 1 : 0), 4, 4);
++
++ rfbi_print_timings();
++ rfbi_enable_clocks(0);
++}
++
++static int ps_to_rfbi_ticks(int time, int div)
++{
++ unsigned long tick_ps;
++ int ret;
++
++ /* Calculate in picosecs to yield more exact results */
++ tick_ps = 1000000000 / (rfbi.l4_khz) * div;
++
++ ret = (time + tick_ps - 1) / tick_ps;
++
++ return ret;
++}
++
++#ifdef OMAP_RFBI_RATE_LIMIT
++unsigned long rfbi_get_max_tx_rate(void)
++{
++ unsigned long l4_rate, dss1_rate;
++ int min_l4_ticks = 0;
++ int i;
++
++ /* According to TI this can't be calculated so make the
++ * adjustments for a couple of known frequencies and warn for
++ * others.
++ */
++ static const struct {
++ unsigned long l4_clk; /* HZ */
++ unsigned long dss1_clk; /* HZ */
++ unsigned long min_l4_ticks;
++ } ftab[] = {
++ { 55, 132, 7, }, /* 7.86 MPix/s */
++ { 110, 110, 12, }, /* 9.16 MPix/s */
++ { 110, 132, 10, }, /* 11 Mpix/s */
++ { 120, 120, 10, }, /* 12 Mpix/s */
++ { 133, 133, 10, }, /* 13.3 Mpix/s */
++ };
++
++ l4_rate = rfbi.l4_khz / 1000;
++ dss1_rate = dss_clk_get_rate(DSS_CLK_FCK1) / 1000000;
++
++ for (i = 0; i < ARRAY_SIZE(ftab); i++) {
++ /* Use a window instead of an exact match, to account
++ * for different DPLL multiplier / divider pairs.
++ */
++ if (abs(ftab[i].l4_clk - l4_rate) < 3 &&
++ abs(ftab[i].dss1_clk - dss1_rate) < 3) {
++ min_l4_ticks = ftab[i].min_l4_ticks;
++ break;
++ }
++ }
++ if (i == ARRAY_SIZE(ftab)) {
++ /* Can't be sure, return anyway the maximum not
++ * rate-limited. This might cause a problem only for the
++ * tearing synchronisation.
++ */
++ DSSERR("can't determine maximum RFBI transfer rate\n");
++ return rfbi.l4_khz * 1000;
++ }
++ return rfbi.l4_khz * 1000 / min_l4_ticks;
++}
++#else
++int rfbi_get_max_tx_rate(void)
++{
++ return rfbi.l4_khz * 1000;
++}
++#endif
++
++static void rfbi_get_clk_info(u32 *clk_period, u32 *max_clk_div)
++{
++ *clk_period = 1000000000 / rfbi.l4_khz;
++ *max_clk_div = 2;
++}
++
++static int rfbi_convert_timings(struct rfbi_timings *t)
++{
++ u32 l;
++ int reon, reoff, weon, weoff, cson, csoff, cs_pulse;
++ int actim, recyc, wecyc;
++ int div = t->clk_div;
++
++ if (div <= 0 || div > 2)
++ return -1;
++
++ /* Make sure that after conversion it still holds that:
++ * weoff > weon, reoff > reon, recyc >= reoff, wecyc >= weoff,
++ * csoff > cson, csoff >= max(weoff, reoff), actim > reon
++ */
++ weon = ps_to_rfbi_ticks(t->we_on_time, div);
++ weoff = ps_to_rfbi_ticks(t->we_off_time, div);
++ if (weoff <= weon)
++ weoff = weon + 1;
++ if (weon > 0x0f)
++ return -1;
++ if (weoff > 0x3f)
++ return -1;
++
++ reon = ps_to_rfbi_ticks(t->re_on_time, div);
++ reoff = ps_to_rfbi_ticks(t->re_off_time, div);
++ if (reoff <= reon)
++ reoff = reon + 1;
++ if (reon > 0x0f)
++ return -1;
++ if (reoff > 0x3f)
++ return -1;
++
++ cson = ps_to_rfbi_ticks(t->cs_on_time, div);
++ csoff = ps_to_rfbi_ticks(t->cs_off_time, div);
++ if (csoff <= cson)
++ csoff = cson + 1;
++ if (csoff < max(weoff, reoff))
++ csoff = max(weoff, reoff);
++ if (cson > 0x0f)
++ return -1;
++ if (csoff > 0x3f)
++ return -1;
++
++ l = cson;
++ l |= csoff << 4;
++ l |= weon << 10;
++ l |= weoff << 14;
++ l |= reon << 20;
++ l |= reoff << 24;
++
++ t->tim[0] = l;
++
++ actim = ps_to_rfbi_ticks(t->access_time, div);
++ if (actim <= reon)
++ actim = reon + 1;
++ if (actim > 0x3f)
++ return -1;
++
++ wecyc = ps_to_rfbi_ticks(t->we_cycle_time, div);
++ if (wecyc < weoff)
++ wecyc = weoff;
++ if (wecyc > 0x3f)
++ return -1;
++
++ recyc = ps_to_rfbi_ticks(t->re_cycle_time, div);
++ if (recyc < reoff)
++ recyc = reoff;
++ if (recyc > 0x3f)
++ return -1;
++
++ cs_pulse = ps_to_rfbi_ticks(t->cs_pulse_width, div);
++ if (cs_pulse > 0x3f)
++ return -1;
++
++ l = wecyc;
++ l |= recyc << 6;
++ l |= cs_pulse << 12;
++ l |= actim << 22;
++
++ t->tim[1] = l;
++
++ t->tim[2] = div - 1;
++
++ t->converted = 1;
++
++ return 0;
++}
++
++/* xxx FIX module selection missing */
++int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
++ unsigned hs_pulse_time, unsigned vs_pulse_time,
++ int hs_pol_inv, int vs_pol_inv, int extif_div)
++{
++ int hs, vs;
++ int min;
++ u32 l;
++
++ hs = ps_to_rfbi_ticks(hs_pulse_time, 1);
++ vs = ps_to_rfbi_ticks(vs_pulse_time, 1);
++ if (hs < 2)
++ return -EDOM;
++ if (mode == OMAP_DSS_RFBI_TE_MODE_2)
++ min = 2;
++ else /* OMAP_DSS_RFBI_TE_MODE_1 */
++ min = 4;
++ if (vs < min)
++ return -EDOM;
++ if (vs == hs)
++ return -EINVAL;
++ rfbi.te_mode = mode;
++ DSSDBG("setup_te: mode %d hs %d vs %d hs_inv %d vs_inv %d\n",
++ mode, hs, vs, hs_pol_inv, vs_pol_inv);
++
++ rfbi_enable_clocks(1);
++ rfbi_write_reg(RFBI_HSYNC_WIDTH, hs);
++ rfbi_write_reg(RFBI_VSYNC_WIDTH, vs);
++
++ l = rfbi_read_reg(RFBI_CONFIG(0));
++ if (hs_pol_inv)
++ l &= ~(1 << 21);
++ else
++ l |= 1 << 21;
++ if (vs_pol_inv)
++ l &= ~(1 << 20);
++ else
++ l |= 1 << 20;
++ rfbi_enable_clocks(0);
++
++ return 0;
++}
++EXPORT_SYMBOL(omap_rfbi_setup_te);
++
++/* xxx FIX module selection missing */
++int omap_rfbi_enable_te(bool enable, unsigned line)
++{
++ u32 l;
++
++ DSSDBG("te %d line %d mode %d\n", enable, line, rfbi.te_mode);
++ if (line > (1 << 11) - 1)
++ return -EINVAL;
++
++ rfbi_enable_clocks(1);
++ l = rfbi_read_reg(RFBI_CONFIG(0));
++ l &= ~(0x3 << 2);
++ if (enable) {
++ rfbi.te_enabled = 1;
++ l |= rfbi.te_mode << 2;
++ } else
++ rfbi.te_enabled = 0;
++ rfbi_write_reg(RFBI_CONFIG(0), l);
++ rfbi_write_reg(RFBI_LINE_NUMBER, line);
++ rfbi_enable_clocks(0);
++
++ return 0;
++}
++EXPORT_SYMBOL(omap_rfbi_enable_te);
++
++#if 0
++static void rfbi_enable_config(int enable1, int enable2)
++{
++ u32 l;
++ int cs = 0;
++
++ if (enable1)
++ cs |= 1<<0;
++ if (enable2)
++ cs |= 1<<1;
++
++ rfbi_enable_clocks(1);
++
++ l = rfbi_read_reg(RFBI_CONTROL);
++
++ l = FLD_MOD(l, cs, 3, 2);
++ l = FLD_MOD(l, 0, 1, 1);
++
++ rfbi_write_reg(RFBI_CONTROL, l);
++
++
++ l = rfbi_read_reg(RFBI_CONFIG(0));
++ l = FLD_MOD(l, 0, 3, 2); /* TRIGGERMODE: ITE */
++ /*l |= FLD_VAL(2, 8, 7); */ /* L4FORMAT, 2pix/L4 */
++ /*l |= FLD_VAL(0, 8, 7); */ /* L4FORMAT, 1pix/L4 */
++
++ l = FLD_MOD(l, 0, 16, 16); /* A0POLARITY */
++ l = FLD_MOD(l, 1, 20, 20); /* TE_VSYNC_POLARITY */
++ l = FLD_MOD(l, 1, 21, 21); /* HSYNCPOLARITY */
++
++ l = FLD_MOD(l, OMAP_DSS_RFBI_PARALLELMODE_8, 1, 0);
++ rfbi_write_reg(RFBI_CONFIG(0), l);
++
++ rfbi_enable_clocks(0);
++}
++#endif
++
++int rfbi_configure(int rfbi_module, int bpp, int lines)
++{
++ u32 l;
++ int cycle1 = 0, cycle2 = 0, cycle3 = 0;
++ enum omap_rfbi_cycleformat cycleformat;
++ enum omap_rfbi_datatype datatype;
++ enum omap_rfbi_parallelmode parallelmode;
++
++ switch (bpp) {
++ case 12:
++ datatype = OMAP_DSS_RFBI_DATATYPE_12;
++ break;
++ case 16:
++ datatype = OMAP_DSS_RFBI_DATATYPE_16;
++ break;
++ case 18:
++ datatype = OMAP_DSS_RFBI_DATATYPE_18;
++ break;
++ case 24:
++ datatype = OMAP_DSS_RFBI_DATATYPE_24;
++ break;
++ default:
++ BUG();
++ return 1;
++ }
++ rfbi.datatype = datatype;
++
++ switch (lines) {
++ case 8:
++ parallelmode = OMAP_DSS_RFBI_PARALLELMODE_8;
++ break;
++ case 9:
++ parallelmode = OMAP_DSS_RFBI_PARALLELMODE_9;
++ break;
++ case 12:
++ parallelmode = OMAP_DSS_RFBI_PARALLELMODE_12;
++ break;
++ case 16:
++ parallelmode = OMAP_DSS_RFBI_PARALLELMODE_16;
++ break;
++ default:
++ BUG();
++ return 1;
++ }
++ rfbi.parallelmode = parallelmode;
++
++ if ((bpp % lines) == 0) {
++ switch (bpp / lines) {
++ case 1:
++ cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_1_1;
++ break;
++ case 2:
++ cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_2_1;
++ break;
++ case 3:
++ cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_3_1;
++ break;
++ default:
++ BUG();
++ return 1;
++ }
++ } else if ((2 * bpp % lines) == 0) {
++ if ((2 * bpp / lines) == 3)
++ cycleformat = OMAP_DSS_RFBI_CYCLEFORMAT_3_2;
++ else {
++ BUG();
++ return 1;
++ }
++ } else {
++ BUG();
++ return 1;
++ }
++
++ switch (cycleformat) {
++ case OMAP_DSS_RFBI_CYCLEFORMAT_1_1:
++ cycle1 = lines;
++ break;
++
++ case OMAP_DSS_RFBI_CYCLEFORMAT_2_1:
++ cycle1 = lines;
++ cycle2 = lines;
++ break;
++
++ case OMAP_DSS_RFBI_CYCLEFORMAT_3_1:
++ cycle1 = lines;
++ cycle2 = lines;
++ cycle3 = lines;
++ break;
++
++ case OMAP_DSS_RFBI_CYCLEFORMAT_3_2:
++ cycle1 = lines;
++ cycle2 = (lines / 2) | ((lines / 2) << 16);
++ cycle3 = (lines << 16);
++ break;
++ }
++
++ rfbi_enable_clocks(1);
++
++ REG_FLD_MOD(RFBI_CONTROL, 0, 3, 2); /* clear CS */
++
++ l = 0;
++ l |= FLD_VAL(parallelmode, 1, 0);
++ l |= FLD_VAL(0, 3, 2); /* TRIGGERMODE: ITE */
++ l |= FLD_VAL(0, 4, 4); /* TIMEGRANULARITY */
++ l |= FLD_VAL(datatype, 6, 5);
++ /* l |= FLD_VAL(2, 8, 7); */ /* L4FORMAT, 2pix/L4 */
++ l |= FLD_VAL(0, 8, 7); /* L4FORMAT, 1pix/L4 */
++ l |= FLD_VAL(cycleformat, 10, 9);
++ l |= FLD_VAL(0, 12, 11); /* UNUSEDBITS */
++ l |= FLD_VAL(0, 16, 16); /* A0POLARITY */
++ l |= FLD_VAL(0, 17, 17); /* REPOLARITY */
++ l |= FLD_VAL(0, 18, 18); /* WEPOLARITY */
++ l |= FLD_VAL(0, 19, 19); /* CSPOLARITY */
++ l |= FLD_VAL(1, 20, 20); /* TE_VSYNC_POLARITY */
++ l |= FLD_VAL(1, 21, 21); /* HSYNCPOLARITY */
++ rfbi_write_reg(RFBI_CONFIG(rfbi_module), l);
++
++ rfbi_write_reg(RFBI_DATA_CYCLE1(rfbi_module), cycle1);
++ rfbi_write_reg(RFBI_DATA_CYCLE2(rfbi_module), cycle2);
++ rfbi_write_reg(RFBI_DATA_CYCLE3(rfbi_module), cycle3);
++
++
++ l = rfbi_read_reg(RFBI_CONTROL);
++ l = FLD_MOD(l, rfbi_module+1, 3, 2); /* Select CSx */
++ l = FLD_MOD(l, 0, 1, 1); /* clear bypass */
++ rfbi_write_reg(RFBI_CONTROL, l);
++
++
++ DSSDBG("RFBI config: bpp %d, lines %d, cycles: 0x%x 0x%x 0x%x\n",
++ bpp, lines, cycle1, cycle2, cycle3);
++
++ rfbi_enable_clocks(0);
++
++ return 0;
++}
++EXPORT_SYMBOL(rfbi_configure);
++
++static int rfbi_find_display(struct omap_display *disp)
++{
++ if (disp == rfbi.display[0])
++ return 0;
++
++ if (disp == rfbi.display[1])
++ return 1;
++
++ BUG();
++ return -1;
++}
++
++
++static void signal_fifo_waiters(void)
++{
++ if (atomic_read(&rfbi.cmd_fifo_full) > 0) {
++ /* DSSDBG("SIGNALING: Fifo not full for waiter!\n"); */
++ complete(&rfbi.cmd_done);
++ atomic_dec(&rfbi.cmd_fifo_full);
++ }
++}
++
++/* returns 1 for async op, and 0 for sync op */
++static int do_update(struct omap_display *display, struct update_region *upd)
++{
++ u16 x = upd->x;
++ u16 y = upd->y;
++ u16 w = upd->w;
++ u16 h = upd->h;
++
++ perf_mark_setup();
++
++ if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ /*display->ctrl->enable_te(display, 1); */
++ dispc_setup_partial_planes(display, &x, &y, &w, &h);
++ }
++
++#ifdef MEASURE_PERF
++ rfbi.perf_bytes = w * h * 2; /* XXX always 16bit */
++#endif
++
++ display->ctrl->setup_update(display, x, y, w, h);
++
++ if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ rfbi_transfer_area(w, h, NULL, NULL);
++ return 1;
++ } else {
++ struct omap_overlay *ovl;
++ void __iomem *addr;
++ int scr_width;
++
++ ovl = display->manager->overlays[0];
++ scr_width = ovl->info.screen_width;
++ addr = ovl->info.vaddr;
++
++ omap_rfbi_write_pixels(addr, scr_width, x, y, w, h);
++
++ perf_show("L4");
++
++ return 0;
++ }
++}
++
++static void process_cmd_fifo(void)
++{
++ int len;
++ struct update_param p;
++ struct omap_display *display;
++ unsigned long flags;
++
++ if (atomic_inc_return(&rfbi.cmd_pending) != 1)
++ return;
++
++ while (true) {
++ spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
++
++ len = __kfifo_get(rfbi.cmd_fifo, (unsigned char *)&p,
++ sizeof(struct update_param));
++ if (len == 0) {
++ DSSDBG("nothing more in fifo\n");
++ atomic_set(&rfbi.cmd_pending, 0);
++ spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
++ break;
++ }
++
++ /* DSSDBG("fifo full %d\n", rfbi.cmd_fifo_full.counter);*/
++
++ spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
++
++ BUG_ON(len != sizeof(struct update_param));
++ BUG_ON(p.rfbi_module > 1);
++
++ display = rfbi.display[p.rfbi_module];
++
++ if (p.cmd == RFBI_CMD_UPDATE) {
++ if (do_update(display, &p.par.r))
++ break; /* async op */
++ } else if (p.cmd == RFBI_CMD_SYNC) {
++ DSSDBG("Signaling SYNC done!\n");
++ complete(p.par.sync);
++ } else
++ BUG();
++ }
++
++ signal_fifo_waiters();
++}
++
++static void rfbi_push_cmd(struct update_param *p)
++{
++ int ret;
++
++ while (1) {
++ unsigned long flags;
++ int available;
++
++ spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
++ available = RFBI_CMD_FIFO_LEN_BYTES -
++ __kfifo_len(rfbi.cmd_fifo);
++
++/* DSSDBG("%d bytes left in fifo\n", available); */
++ if (available < sizeof(struct update_param)) {
++ DSSDBG("Going to wait because FIFO FULL..\n");
++ spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
++ atomic_inc(&rfbi.cmd_fifo_full);
++ wait_for_completion(&rfbi.cmd_done);
++ /*DSSDBG("Woke up because fifo not full anymore\n");*/
++ continue;
++ }
++
++ ret = __kfifo_put(rfbi.cmd_fifo, (unsigned char *)p,
++ sizeof(struct update_param));
++/* DSSDBG("pushed %d bytes\n", ret);*/
++
++ spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
++
++ BUG_ON(ret != sizeof(struct update_param));
++
++ break;
++ }
++}
++
++static void rfbi_push_update(int rfbi_module, int x, int y, int w, int h)
++{
++ struct update_param p;
++
++ p.rfbi_module = rfbi_module;
++ p.cmd = RFBI_CMD_UPDATE;
++
++ p.par.r.x = x;
++ p.par.r.y = y;
++ p.par.r.w = w;
++ p.par.r.h = h;
++
++ DSSDBG("RFBI pushed %d,%d %dx%d\n", x, y, w, h);
++
++ rfbi_push_cmd(&p);
++
++ process_cmd_fifo();
++}
++
++static void rfbi_push_sync(int rfbi_module, struct completion *sync_comp)
++{
++ struct update_param p;
++
++ p.rfbi_module = rfbi_module;
++ p.cmd = RFBI_CMD_SYNC;
++ p.par.sync = sync_comp;
++
++ rfbi_push_cmd(&p);
++
++ DSSDBG("RFBI sync pushed to cmd fifo\n");
++
++ process_cmd_fifo();
++}
++
++void rfbi_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r))
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ DUMPREG(RFBI_REVISION);
++ DUMPREG(RFBI_SYSCONFIG);
++ DUMPREG(RFBI_SYSSTATUS);
++ DUMPREG(RFBI_CONTROL);
++ DUMPREG(RFBI_PIXEL_CNT);
++ DUMPREG(RFBI_LINE_NUMBER);
++ DUMPREG(RFBI_CMD);
++ DUMPREG(RFBI_PARAM);
++ DUMPREG(RFBI_DATA);
++ DUMPREG(RFBI_READ);
++ DUMPREG(RFBI_STATUS);
++
++ DUMPREG(RFBI_CONFIG(0));
++ DUMPREG(RFBI_ONOFF_TIME(0));
++ DUMPREG(RFBI_CYCLE_TIME(0));
++ DUMPREG(RFBI_DATA_CYCLE1(0));
++ DUMPREG(RFBI_DATA_CYCLE2(0));
++ DUMPREG(RFBI_DATA_CYCLE3(0));
++
++ DUMPREG(RFBI_CONFIG(1));
++ DUMPREG(RFBI_ONOFF_TIME(1));
++ DUMPREG(RFBI_CYCLE_TIME(1));
++ DUMPREG(RFBI_DATA_CYCLE1(1));
++ DUMPREG(RFBI_DATA_CYCLE2(1));
++ DUMPREG(RFBI_DATA_CYCLE3(1));
++
++ DUMPREG(RFBI_VSYNC_WIDTH);
++ DUMPREG(RFBI_HSYNC_WIDTH);
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++#undef DUMPREG
++}
++
++int rfbi_init(void)
++{
++ u32 rev;
++ u32 l;
++
++ spin_lock_init(&rfbi.cmd_lock);
++ rfbi.cmd_fifo = kfifo_alloc(RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL,
++ &rfbi.cmd_lock);
++ if (IS_ERR(rfbi.cmd_fifo))
++ return -ENOMEM;
++
++ init_completion(&rfbi.cmd_done);
++ atomic_set(&rfbi.cmd_fifo_full, 0);
++ atomic_set(&rfbi.cmd_pending, 0);
++
++ rfbi.base = ioremap(RFBI_BASE, SZ_256);
++ if (!rfbi.base) {
++ DSSERR("can't ioremap RFBI\n");
++ return -ENOMEM;
++ }
++
++ rfbi_enable_clocks(1);
++
++ msleep(10);
++
++ rfbi.l4_khz = dss_clk_get_rate(DSS_CLK_ICK) / 1000;
++
++ /* Enable autoidle and smart-idle */
++ l = rfbi_read_reg(RFBI_SYSCONFIG);
++ l |= (1 << 0) | (2 << 3);
++ rfbi_write_reg(RFBI_SYSCONFIG, l);
++
++ rev = rfbi_read_reg(RFBI_REVISION);
++ printk(KERN_INFO "OMAP RFBI rev %d.%d\n",
++ FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
++
++ rfbi_enable_clocks(0);
++
++ return 0;
++}
++
++void rfbi_exit(void)
++{
++ DSSDBG("rfbi_exit\n");
++
++ kfifo_free(rfbi.cmd_fifo);
++
++ iounmap(rfbi.base);
++}
++
++/* struct omap_display support */
++static int rfbi_display_update(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ int rfbi_module;
++
++ if (w == 0 || h == 0)
++ return 0;
++
++ rfbi_module = rfbi_find_display(display);
++
++ rfbi_push_update(rfbi_module, x, y, w, h);
++
++ return 0;
++}
++
++static int rfbi_display_sync(struct omap_display *display)
++{
++ struct completion sync_comp;
++ int rfbi_module;
++
++ rfbi_module = rfbi_find_display(display);
++
++ init_completion(&sync_comp);
++ rfbi_push_sync(rfbi_module, &sync_comp);
++ DSSDBG("Waiting for SYNC to happen...\n");
++ wait_for_completion(&sync_comp);
++ DSSDBG("Released from SYNC\n");
++ return 0;
++}
++
++static int rfbi_display_enable_te(struct omap_display *display, bool enable)
++{
++ display->ctrl->enable_te(display, enable);
++ return 0;
++}
++
++static int rfbi_display_enable(struct omap_display *display)
++{
++ int r;
++
++ BUG_ON(display->panel == NULL || display->ctrl == NULL);
++
++ r = omap_dispc_register_isr(framedone_callback, NULL,
++ DISPC_IRQ_FRAMEDONE);
++ if (r) {
++ DSSERR("can't get FRAMEDONE irq\n");
++ return r;
++ }
++
++ dispc_set_lcd_display_type(OMAP_DSS_LCD_DISPLAY_TFT);
++
++ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_RFBI);
++
++ dispc_set_tft_data_lines(display->ctrl->pixel_size);
++
++ rfbi_configure(display->hw_config.u.rfbi.channel,
++ display->ctrl->pixel_size,
++ display->hw_config.u.rfbi.data_lines);
++
++ rfbi_set_timings(display->hw_config.u.rfbi.channel,
++ &display->ctrl->timings);
++
++
++ if (display->ctrl && display->ctrl->enable) {
++ r = display->ctrl->enable(display);
++ if (r)
++ goto err;
++ }
++
++ if (display->panel && display->panel->enable) {
++ r = display->panel->enable(display);
++ if (r)
++ goto err;
++ }
++
++ return 0;
++err:
++ return -ENODEV;
++}
++
++static void rfbi_display_disable(struct omap_display *display)
++{
++ display->ctrl->disable(display);
++ omap_dispc_unregister_isr(framedone_callback, NULL,
++ DISPC_IRQ_FRAMEDONE);
++}
++
++void rfbi_init_display(struct omap_display *display)
++{
++ display->enable = rfbi_display_enable;
++ display->disable = rfbi_display_disable;
++ display->update = rfbi_display_update;
++ display->sync = rfbi_display_sync;
++ display->enable_te = rfbi_display_enable_te;
++
++ rfbi.display[display->hw_config.u.rfbi.channel] = display;
++
++ display->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++}
+diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
+new file mode 100644
+index 0000000..fbff2b2
+--- /dev/null
++++ b/drivers/video/omap2/dss/sdi.c
+@@ -0,0 +1,245 @@
++/*
++ * linux/drivers/video/omap2/dss/sdi.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "SDI"
++
++#include <linux/kernel.h>
++#include <linux/clk.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++
++#include <mach/board.h>
++#include <mach/display.h>
++#include "dss.h"
++
++
++static struct {
++ bool skip_init;
++ bool update_enabled;
++} sdi;
++
++static void sdi_basic_init(void)
++{
++ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
++
++ dispc_set_lcd_display_type(OMAP_DSS_LCD_DISPLAY_TFT);
++ dispc_set_tft_data_lines(24);
++ dispc_lcd_enable_signal_polarity(1);
++}
++
++static int sdi_display_enable(struct omap_display *display)
++{
++ struct dispc_clock_info cinfo;
++ u16 lck_div, pck_div;
++ unsigned long fck;
++ struct omap_panel *panel = display->panel;
++ unsigned long pck;
++ int r;
++
++ if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ DSSERR("display already enabled\n");
++ return -EINVAL;
++ }
++
++ /* In case of skip_init sdi_init has already enabled the clocks */
++ if (!sdi.skip_init)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ sdi_basic_init();
++
++ /* 15.5.9.1.2 */
++ panel->config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
++
++ dispc_set_pol_freq(panel);
++
++ if (!sdi.skip_init)
++ r = dispc_calc_clock_div(1, panel->timings.pixel_clock * 1000,
++ &cinfo);
++ else
++ r = dispc_get_clock_div(&cinfo);
++
++ if (r)
++ goto err0;
++
++ fck = cinfo.fck;
++ lck_div = cinfo.lck_div;
++ pck_div = cinfo.pck_div;
++
++ pck = fck / lck_div / pck_div / 1000;
++
++ if (pck != panel->timings.pixel_clock) {
++ DSSWARN("Could not find exact pixel clock. Requested %d kHz, "
++ "got %lu kHz\n",
++ panel->timings.pixel_clock, pck);
++
++ panel->timings.pixel_clock = pck;
++ }
++
++
++ dispc_set_lcd_timings(&panel->timings);
++
++ r = dispc_set_clock_div(&cinfo);
++ if (r)
++ goto err1;
++
++ if (!sdi.skip_init) {
++ dss_sdi_init(display->hw_config.u.sdi.datapairs);
++ dss_sdi_enable();
++ mdelay(2);
++ }
++
++ dispc_enable_lcd_out(1);
++
++ r = panel->enable(display);
++ if (r)
++ goto err2;
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ sdi.skip_init = 0;
++
++ return 0;
++err2:
++ dispc_enable_lcd_out(0);
++err1:
++err0:
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ return r;
++}
++
++static int sdi_display_resume(struct omap_display *display);
++
++static void sdi_display_disable(struct omap_display *display)
++{
++ if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ return;
++
++ if (display->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ sdi_display_resume(display);
++
++ display->panel->disable(display);
++
++ dispc_enable_lcd_out(0);
++
++ dss_sdi_disable();
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++}
++
++static int sdi_display_suspend(struct omap_display *display)
++{
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ return -EINVAL;
++
++ if (display->panel->suspend)
++ display->panel->suspend(display);
++
++ dispc_enable_lcd_out(0);
++
++ dss_sdi_disable();
++
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++
++ return 0;
++}
++
++static int sdi_display_resume(struct omap_display *display)
++{
++ if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
++ return -EINVAL;
++
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
++ dss_sdi_enable();
++ mdelay(2);
++
++ dispc_enable_lcd_out(1);
++
++ if (display->panel->resume)
++ display->panel->resume(display);
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ return 0;
++}
++
++static int sdi_display_set_update_mode(struct omap_display *display,
++ enum omap_dss_update_mode mode)
++{
++ if (mode == OMAP_DSS_UPDATE_MANUAL)
++ return -EINVAL;
++
++ if (mode == OMAP_DSS_UPDATE_DISABLED) {
++ dispc_enable_lcd_out(0);
++ sdi.update_enabled = 0;
++ } else {
++ dispc_enable_lcd_out(1);
++ sdi.update_enabled = 1;
++ }
++
++ return 0;
++}
++
++static enum omap_dss_update_mode sdi_display_get_update_mode(
++ struct omap_display *display)
++{
++ return sdi.update_enabled ? OMAP_DSS_UPDATE_AUTO :
++ OMAP_DSS_UPDATE_DISABLED;
++}
++
++static void sdi_get_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ *timings = display->panel->timings;
++}
++
++void sdi_init_display(struct omap_display *display)
++{
++ DSSDBG("SDI init\n");
++
++ display->enable = sdi_display_enable;
++ display->disable = sdi_display_disable;
++ display->suspend = sdi_display_suspend;
++ display->resume = sdi_display_resume;
++ display->set_update_mode = sdi_display_set_update_mode;
++ display->get_update_mode = sdi_display_get_update_mode;
++ display->get_timings = sdi_get_timings;
++}
++
++int sdi_init(bool skip_init)
++{
++ /* we store this for first display enable, then clear it */
++ sdi.skip_init = skip_init;
++
++ /*
++ * Enable clocks already here, otherwise there would be a toggle
++ * of them until sdi_display_enable is called.
++ */
++ if (skip_init)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ return 0;
++}
++
++void sdi_exit(void)
++{
++}
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+new file mode 100644
+index 0000000..aceed9f
+--- /dev/null
++++ b/drivers/video/omap2/dss/venc.c
+@@ -0,0 +1,600 @@
++/*
++ * linux/drivers/video/omap2/dss/venc.c
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * VENC settings from TI's DSS driver
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#define DSS_SUBSYS_NAME "VENC"
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/io.h>
++#include <linux/mutex.h>
++#include <linux/completion.h>
++#include <linux/delay.h>
++#include <linux/string.h>
++
++#include <mach/display.h>
++#include <mach/cpu.h>
++
++#include "dss.h"
++
++#define VENC_BASE 0x48050C00
++
++/* Venc registers */
++#define VENC_REV_ID 0x00
++#define VENC_STATUS 0x04
++#define VENC_F_CONTROL 0x08
++#define VENC_VIDOUT_CTRL 0x10
++#define VENC_SYNC_CTRL 0x14
++#define VENC_LLEN 0x1C
++#define VENC_FLENS 0x20
++#define VENC_HFLTR_CTRL 0x24
++#define VENC_CC_CARR_WSS_CARR 0x28
++#define VENC_C_PHASE 0x2C
++#define VENC_GAIN_U 0x30
++#define VENC_GAIN_V 0x34
++#define VENC_GAIN_Y 0x38
++#define VENC_BLACK_LEVEL 0x3C
++#define VENC_BLANK_LEVEL 0x40
++#define VENC_X_COLOR 0x44
++#define VENC_M_CONTROL 0x48
++#define VENC_BSTAMP_WSS_DATA 0x4C
++#define VENC_S_CARR 0x50
++#define VENC_LINE21 0x54
++#define VENC_LN_SEL 0x58
++#define VENC_L21__WC_CTL 0x5C
++#define VENC_HTRIGGER_VTRIGGER 0x60
++#define VENC_SAVID__EAVID 0x64
++#define VENC_FLEN__FAL 0x68
++#define VENC_LAL__PHASE_RESET 0x6C
++#define VENC_HS_INT_START_STOP_X 0x70
++#define VENC_HS_EXT_START_STOP_X 0x74
++#define VENC_VS_INT_START_X 0x78
++#define VENC_VS_INT_STOP_X__VS_INT_START_Y 0x7C
++#define VENC_VS_INT_STOP_Y__VS_EXT_START_X 0x80
++#define VENC_VS_EXT_STOP_X__VS_EXT_START_Y 0x84
++#define VENC_VS_EXT_STOP_Y 0x88
++#define VENC_AVID_START_STOP_X 0x90
++#define VENC_AVID_START_STOP_Y 0x94
++#define VENC_FID_INT_START_X__FID_INT_START_Y 0xA0
++#define VENC_FID_INT_OFFSET_Y__FID_EXT_START_X 0xA4
++#define VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y 0xA8
++#define VENC_TVDETGP_INT_START_STOP_X 0xB0
++#define VENC_TVDETGP_INT_START_STOP_Y 0xB4
++#define VENC_GEN_CTRL 0xB8
++#define VENC_OUTPUT_CONTROL 0xC4
++#define VENC_DAC_B__DAC_C 0xC8
++
++struct venc_config {
++ u32 f_control;
++ u32 vidout_ctrl;
++ u32 sync_ctrl;
++ u32 llen;
++ u32 flens;
++ u32 hfltr_ctrl;
++ u32 cc_carr_wss_carr;
++ u32 c_phase;
++ u32 gain_u;
++ u32 gain_v;
++ u32 gain_y;
++ u32 black_level;
++ u32 blank_level;
++ u32 x_color;
++ u32 m_control;
++ u32 bstamp_wss_data;
++ u32 s_carr;
++ u32 line21;
++ u32 ln_sel;
++ u32 l21__wc_ctl;
++ u32 htrigger_vtrigger;
++ u32 savid__eavid;
++ u32 flen__fal;
++ u32 lal__phase_reset;
++ u32 hs_int_start_stop_x;
++ u32 hs_ext_start_stop_x;
++ u32 vs_int_start_x;
++ u32 vs_int_stop_x__vs_int_start_y;
++ u32 vs_int_stop_y__vs_ext_start_x;
++ u32 vs_ext_stop_x__vs_ext_start_y;
++ u32 vs_ext_stop_y;
++ u32 avid_start_stop_x;
++ u32 avid_start_stop_y;
++ u32 fid_int_start_x__fid_int_start_y;
++ u32 fid_int_offset_y__fid_ext_start_x;
++ u32 fid_ext_start_y__fid_ext_offset_y;
++ u32 tvdetgp_int_start_stop_x;
++ u32 tvdetgp_int_start_stop_y;
++ u32 gen_ctrl;
++};
++
++/* from TRM */
++static const struct venc_config venc_config_pal_trm = {
++ .f_control = 0,
++ .vidout_ctrl = 1,
++ .sync_ctrl = 0x40,
++ .llen = 0x35F, /* 863 */
++ .flens = 0x270, /* 624 */
++ .hfltr_ctrl = 0,
++ .cc_carr_wss_carr = 0x2F7225ED,
++ .c_phase = 0,
++ .gain_u = 0x111,
++ .gain_v = 0x181,
++ .gain_y = 0x140,
++ .black_level = 0x3B,
++ .blank_level = 0x3B,
++ .x_color = 0x7,
++ .m_control = 0x2,
++ .bstamp_wss_data = 0x3F,
++ .s_carr = 0x2A098ACB,
++ .line21 = 0,
++ .ln_sel = 0x01290015,
++ .l21__wc_ctl = 0x0000F603,
++ .htrigger_vtrigger = 0,
++
++ .savid__eavid = 0x06A70108,
++ .flen__fal = 0x00180270,
++ .lal__phase_reset = 0x00040135,
++ .hs_int_start_stop_x = 0x00880358,
++ .hs_ext_start_stop_x = 0x000F035F,
++ .vs_int_start_x = 0x01A70000,
++ .vs_int_stop_x__vs_int_start_y = 0x000001A7,
++ .vs_int_stop_y__vs_ext_start_x = 0x01AF0000,
++ .vs_ext_stop_x__vs_ext_start_y = 0x000101AF,
++ .vs_ext_stop_y = 0x00000025,
++ .avid_start_stop_x = 0x03530083,
++ .avid_start_stop_y = 0x026C002E,
++ .fid_int_start_x__fid_int_start_y = 0x0001008A,
++ .fid_int_offset_y__fid_ext_start_x = 0x002E0138,
++ .fid_ext_start_y__fid_ext_offset_y = 0x01380001,
++
++ .tvdetgp_int_start_stop_x = 0x00140001,
++ .tvdetgp_int_start_stop_y = 0x00010001,
++ .gen_ctrl = 0x00FF0000,
++};
++
++/* from TRM */
++static const struct venc_config venc_config_ntsc_trm = {
++ .f_control = 0,
++ .vidout_ctrl = 1,
++ .sync_ctrl = 0x8040,
++ .llen = 0x359,
++ .flens = 0x20C,
++ .hfltr_ctrl = 0,
++ .cc_carr_wss_carr = 0x043F2631,
++ .c_phase = 0,
++ .gain_u = 0x102,
++ .gain_v = 0x16C,
++ .gain_y = 0x12F,
++ .black_level = 0x43,
++ .blank_level = 0x38,
++ .x_color = 0x7,
++ .m_control = 0x1,
++ .bstamp_wss_data = 0x38,
++ .s_carr = 0x21F07C1F,
++ .line21 = 0,
++ .ln_sel = 0x01310011,
++ .l21__wc_ctl = 0x0000F003,
++ .htrigger_vtrigger = 0,
++
++ .savid__eavid = 0x069300F4,
++ .flen__fal = 0x0016020C,
++ .lal__phase_reset = 0x00060107,
++ .hs_int_start_stop_x = 0x008E0350,
++ .hs_ext_start_stop_x = 0x000F0359,
++ .vs_int_start_x = 0x01A00000,
++ .vs_int_stop_x__vs_int_start_y = 0x020701A0,
++ .vs_int_stop_y__vs_ext_start_x = 0x01AC0024,
++ .vs_ext_stop_x__vs_ext_start_y = 0x020D01AC,
++ .vs_ext_stop_y = 0x00000006,
++ .avid_start_stop_x = 0x03480078,
++ .avid_start_stop_y = 0x02060024,
++ .fid_int_start_x__fid_int_start_y = 0x0001008A,
++ .fid_int_offset_y__fid_ext_start_x = 0x01AC0106,
++ .fid_ext_start_y__fid_ext_offset_y = 0x01060006,
++
++ .tvdetgp_int_start_stop_x = 0x00140001,
++ .tvdetgp_int_start_stop_y = 0x00010001,
++ .gen_ctrl = 0x00F90000,
++};
++
++static const struct venc_config venc_config_pal_bdghi = {
++ .f_control = 0,
++ .vidout_ctrl = 0,
++ .sync_ctrl = 0,
++ .hfltr_ctrl = 0,
++ .x_color = 0,
++ .line21 = 0,
++ .ln_sel = 21,
++ .htrigger_vtrigger = 0,
++ .tvdetgp_int_start_stop_x = 0x00140001,
++ .tvdetgp_int_start_stop_y = 0x00010001,
++ .gen_ctrl = 0x00FB0000,
++
++ .llen = 864-1,
++ .flens = 625-1,
++ .cc_carr_wss_carr = 0x2F7625ED,
++ .c_phase = 0xDF,
++ .gain_u = 0x111,
++ .gain_v = 0x181,
++ .gain_y = 0x140,
++ .black_level = 0x3e,
++ .blank_level = 0x3e,
++ .m_control = 0<<2 | 1<<1,
++ .bstamp_wss_data = 0x42,
++ .s_carr = 0x2a098acb,
++ .l21__wc_ctl = 0<<13 | 0x16<<8 | 0<<0,
++ .savid__eavid = 0x06A70108,
++ .flen__fal = 23<<16 | 624<<0,
++ .lal__phase_reset = 2<<17 | 310<<0,
++ .hs_int_start_stop_x = 0x00920358,
++ .hs_ext_start_stop_x = 0x000F035F,
++ .vs_int_start_x = 0x1a7<<16,
++ .vs_int_stop_x__vs_int_start_y = 0x000601A7,
++ .vs_int_stop_y__vs_ext_start_x = 0x01AF0036,
++ .vs_ext_stop_x__vs_ext_start_y = 0x27101af,
++ .vs_ext_stop_y = 0x05,
++ .avid_start_stop_x = 0x03530082,
++ .avid_start_stop_y = 0x0270002E,
++ .fid_int_start_x__fid_int_start_y = 0x0005008A,
++ .fid_int_offset_y__fid_ext_start_x = 0x002E0138,
++ .fid_ext_start_y__fid_ext_offset_y = 0x01380005,
++};
++
++const struct omap_video_timings omap_dss_pal_timings = {
++ .x_res = 720,
++ .y_res = 574,
++ .pixel_clock = 26181,
++ .hsw = 32,
++ .hfp = 80,
++ .hbp = 48,
++ .vsw = 7,
++ .vfp = 3,
++ .vbp = 6,
++};
++EXPORT_SYMBOL(omap_dss_pal_timings);
++
++const struct omap_video_timings omap_dss_ntsc_timings = {
++ .x_res = 720,
++ .y_res = 482,
++ .pixel_clock = 22153,
++ .hsw = 32,
++ .hfp = 80,
++ .hbp = 48,
++ .vsw = 10,
++ .vfp = 3,
++ .vbp = 6,
++};
++EXPORT_SYMBOL(omap_dss_ntsc_timings);
++
++static struct {
++ void __iomem *base;
++ struct mutex venc_lock;
++} venc;
++
++static struct omap_panel venc_panel = {
++ .name = "tv-out",
++};
++
++static inline void venc_write_reg(int idx, u32 val)
++{
++ __raw_writel(val, venc.base + idx);
++}
++
++static inline u32 venc_read_reg(int idx)
++{
++ u32 l = __raw_readl(venc.base + idx);
++ return l;
++}
++
++static void venc_write_config(const struct venc_config *config)
++{
++ DSSDBG("write venc conf\n");
++
++ venc_write_reg(VENC_LLEN, config->llen);
++ venc_write_reg(VENC_FLENS, config->flens);
++ venc_write_reg(VENC_CC_CARR_WSS_CARR, config->cc_carr_wss_carr);
++ venc_write_reg(VENC_C_PHASE, config->c_phase);
++ venc_write_reg(VENC_GAIN_U, config->gain_u);
++ venc_write_reg(VENC_GAIN_V, config->gain_v);
++ venc_write_reg(VENC_GAIN_Y, config->gain_y);
++ venc_write_reg(VENC_BLACK_LEVEL, config->black_level);
++ venc_write_reg(VENC_BLANK_LEVEL, config->blank_level);
++ venc_write_reg(VENC_M_CONTROL, config->m_control);
++ venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data);
++ venc_write_reg(VENC_S_CARR, config->s_carr);
++ venc_write_reg(VENC_L21__WC_CTL, config->l21__wc_ctl);
++ venc_write_reg(VENC_SAVID__EAVID, config->savid__eavid);
++ venc_write_reg(VENC_FLEN__FAL, config->flen__fal);
++ venc_write_reg(VENC_LAL__PHASE_RESET, config->lal__phase_reset);
++ venc_write_reg(VENC_HS_INT_START_STOP_X, config->hs_int_start_stop_x);
++ venc_write_reg(VENC_HS_EXT_START_STOP_X, config->hs_ext_start_stop_x);
++ venc_write_reg(VENC_VS_INT_START_X, config->vs_int_start_x);
++ venc_write_reg(VENC_VS_INT_STOP_X__VS_INT_START_Y,
++ config->vs_int_stop_x__vs_int_start_y);
++ venc_write_reg(VENC_VS_INT_STOP_Y__VS_EXT_START_X,
++ config->vs_int_stop_y__vs_ext_start_x);
++ venc_write_reg(VENC_VS_EXT_STOP_X__VS_EXT_START_Y,
++ config->vs_ext_stop_x__vs_ext_start_y);
++ venc_write_reg(VENC_VS_EXT_STOP_Y, config->vs_ext_stop_y);
++ venc_write_reg(VENC_AVID_START_STOP_X, config->avid_start_stop_x);
++ venc_write_reg(VENC_AVID_START_STOP_Y, config->avid_start_stop_y);
++ venc_write_reg(VENC_FID_INT_START_X__FID_INT_START_Y,
++ config->fid_int_start_x__fid_int_start_y);
++ venc_write_reg(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X,
++ config->fid_int_offset_y__fid_ext_start_x);
++ venc_write_reg(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y,
++ config->fid_ext_start_y__fid_ext_offset_y);
++
++ venc_write_reg(VENC_DAC_B__DAC_C, venc_read_reg(VENC_DAC_B__DAC_C));
++ venc_write_reg(VENC_VIDOUT_CTRL, config->vidout_ctrl);
++ venc_write_reg(VENC_HFLTR_CTRL, config->hfltr_ctrl);
++ venc_write_reg(VENC_X_COLOR, config->x_color);
++ venc_write_reg(VENC_LINE21, config->line21);
++ venc_write_reg(VENC_LN_SEL, config->ln_sel);
++ venc_write_reg(VENC_HTRIGGER_VTRIGGER, config->htrigger_vtrigger);
++ venc_write_reg(VENC_TVDETGP_INT_START_STOP_X,
++ config->tvdetgp_int_start_stop_x);
++ venc_write_reg(VENC_TVDETGP_INT_START_STOP_Y,
++ config->tvdetgp_int_start_stop_y);
++ venc_write_reg(VENC_GEN_CTRL, config->gen_ctrl);
++ venc_write_reg(VENC_F_CONTROL, config->f_control);
++ venc_write_reg(VENC_SYNC_CTRL, config->sync_ctrl);
++}
++
++static void venc_reset(void)
++{
++ int t = 1000;
++
++ venc_write_reg(VENC_F_CONTROL, 1<<8);
++ while (venc_read_reg(VENC_F_CONTROL) & (1<<8)) {
++ if (--t == 0) {
++ DSSERR("Failed to reset venc\n");
++ return;
++ }
++ }
++
++ /* the magical sleep that makes things work */
++ msleep(20);
++}
++
++static void venc_enable_clocks(int enable)
++{
++ if (enable)
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M |
++ DSS_CLK_96M);
++ else
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M |
++ DSS_CLK_96M);
++}
++
++static const struct venc_config *venc_timings_to_config(
++ struct omap_video_timings *timings)
++{
++ if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
++ return &venc_config_pal_trm;
++
++ if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
++ return &venc_config_ntsc_trm;
++
++ BUG();
++}
++
++int venc_init(void)
++{
++ u8 rev_id;
++
++ mutex_init(&venc.venc_lock);
++
++ venc_panel.timings = omap_dss_pal_timings;
++
++ venc.base = ioremap(VENC_BASE, SZ_1K);
++ if (!venc.base) {
++ DSSERR("can't ioremap VENC\n");
++ return -ENOMEM;
++ }
++
++ venc_enable_clocks(1);
++
++ rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
++ printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
++
++ venc_enable_clocks(0);
++
++ return 0;
++}
++
++void venc_exit(void)
++{
++ iounmap(venc.base);
++}
++
++static void venc_power_on(struct omap_display *display)
++{
++ venc_enable_clocks(1);
++
++ venc_reset();
++ venc_write_config(venc_timings_to_config(&display->panel->timings));
++
++ dss_set_venc_output(display->hw_config.u.venc.type);
++ dss_set_dac_pwrdn_bgz(1);
++
++ if (display->hw_config.u.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) {
++ if (cpu_is_omap24xx())
++ venc_write_reg(VENC_OUTPUT_CONTROL, 0x2);
++ else
++ venc_write_reg(VENC_OUTPUT_CONTROL, 0xa);
++ } else { /* S-Video */
++ venc_write_reg(VENC_OUTPUT_CONTROL, 0xd);
++ }
++
++ dispc_set_digit_size(display->panel->timings.x_res,
++ display->panel->timings.y_res/2);
++
++ if (display->hw_config.panel_enable)
++ display->hw_config.panel_enable(display);
++
++ dispc_enable_digit_out(1);
++}
++
++static void venc_power_off(struct omap_display *display)
++{
++ venc_write_reg(VENC_OUTPUT_CONTROL, 0);
++ dss_set_dac_pwrdn_bgz(0);
++
++ dispc_enable_digit_out(0);
++
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++
++ venc_enable_clocks(0);
++}
++
++static int venc_enable_display(struct omap_display *display)
++{
++ int r = 0;
++
++ DSSDBG("venc_enable_display\n");
++
++ mutex_lock(&venc.venc_lock);
++
++ if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ r = -EINVAL;
++ goto err;
++ }
++
++ venc_power_on(display);
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++err:
++ mutex_unlock(&venc.venc_lock);
++
++ return r;
++}
++
++static void venc_disable_display(struct omap_display *display)
++{
++ DSSDBG("venc_disable_display\n");
++
++ mutex_lock(&venc.venc_lock);
++
++ if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ goto end;
++
++ if (display->state == OMAP_DSS_DISPLAY_SUSPENDED) {
++ /* suspended is the same as disabled with venc */
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++ goto end;
++ }
++
++ venc_power_off(display);
++
++ display->state = OMAP_DSS_DISPLAY_DISABLED;
++end:
++ mutex_unlock(&venc.venc_lock);
++}
++
++static int venc_display_suspend(struct omap_display *display)
++{
++ int r = 0;
++
++ DSSDBG("venc_display_suspend\n");
++
++ mutex_lock(&venc.venc_lock);
++
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE) {
++ r = -EINVAL;
++ goto err;
++ }
++
++ venc_power_off(display);
++
++ display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++err:
++ mutex_unlock(&venc.venc_lock);
++
++ return r;
++}
++
++static int venc_display_resume(struct omap_display *display)
++{
++ int r = 0;
++
++ DSSDBG("venc_display_resume\n");
++
++ mutex_lock(&venc.venc_lock);
++
++ if (display->state != OMAP_DSS_DISPLAY_SUSPENDED) {
++ r = -EINVAL;
++ goto err;
++ }
++
++ venc_power_on(display);
++
++ display->state = OMAP_DSS_DISPLAY_ACTIVE;
++err:
++ mutex_unlock(&venc.venc_lock);
++
++ return r;
++}
++
++static void venc_get_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ *timings = venc_panel.timings;
++}
++
++static void venc_set_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ DSSDBG("venc_set_timings\n");
++ display->panel->timings = *timings;
++ if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
++ /* turn the venc off and on to get new timings to use */
++ venc_disable_display(display);
++ venc_enable_display(display);
++ }
++}
++
++static int venc_check_timings(struct omap_display *display,
++ struct omap_video_timings *timings)
++{
++ DSSDBG("venc_check_timings\n");
++
++ if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
++ return 0;
++
++ if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
++ return 0;
++
++ return -EINVAL;
++}
++
++void venc_init_display(struct omap_display *display)
++{
++ display->panel = &venc_panel;
++ display->enable = venc_enable_display;
++ display->disable = venc_disable_display;
++ display->suspend = venc_display_suspend;
++ display->resume = venc_display_resume;
++ display->get_timings = venc_get_timings;
++ display->set_timings = venc_set_timings;
++ display->check_timings = venc_check_timings;
++}
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP-framebuffer-driver.patch b/recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP-framebuffer-driver.patch
new file mode 100644
index 0000000000..994bd23b82
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0003-DSS2-OMAP-framebuffer-driver.patch
@@ -0,0 +1,3403 @@
+From 0612cfdea0354b6c8b2deacbcd805427fb3b4c1f Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 10:25:48 +0300
+Subject: [PATCH 003/146] DSS2: OMAP framebuffer driver
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/fb.c | 28 +
+ drivers/video/omap/Kconfig | 5 +-
+ drivers/video/omap2/omapfb/Kconfig | 35 +
+ drivers/video/omap2/omapfb/Makefile | 2 +
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 656 ++++++++++
+ drivers/video/omap2/omapfb/omapfb-main.c | 2010 +++++++++++++++++++++++++++++
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 371 ++++++
+ drivers/video/omap2/omapfb/omapfb.h | 153 +++
+ include/linux/omapfb.h | 20 +
+ 9 files changed, 3278 insertions(+), 2 deletions(-)
+ create mode 100644 drivers/video/omap2/omapfb/Kconfig
+ create mode 100644 drivers/video/omap2/omapfb/Makefile
+ create mode 100644 drivers/video/omap2/omapfb/omapfb-ioctl.c
+ create mode 100644 drivers/video/omap2/omapfb/omapfb-main.c
+ create mode 100644 drivers/video/omap2/omapfb/omapfb-sysfs.c
+ create mode 100644 drivers/video/omap2/omapfb/omapfb.h
+
+diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
+index 40615a6..1dc3415 100644
+--- a/arch/arm/plat-omap/fb.c
++++ b/arch/arm/plat-omap/fb.c
+@@ -327,6 +327,34 @@ static inline int omap_init_fb(void)
+
+ arch_initcall(omap_init_fb);
+
++#elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
++
++static u64 omap_fb_dma_mask = ~(u32)0;
++static struct omapfb_platform_data omapfb_config;
++
++static struct platform_device omap_fb_device = {
++ .name = "omapfb",
++ .id = -1,
++ .dev = {
++ .dma_mask = &omap_fb_dma_mask,
++ .coherent_dma_mask = ~(u32)0,
++ .platform_data = &omapfb_config,
++ },
++ .num_resources = 0,
++};
++
++void omapfb_set_platform_data(struct omapfb_platform_data *data)
++{
++ omapfb_config = *data;
++}
++
++static inline int omap_init_fb(void)
++{
++ return platform_device_register(&omap_fb_device);
++}
++
++arch_initcall(omap_init_fb);
++
+ #else
+
+ void omapfb_reserve_sdram(void) {}
+diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig
+index 551e3e9..455c605 100644
+--- a/drivers/video/omap/Kconfig
++++ b/drivers/video/omap/Kconfig
+@@ -1,6 +1,7 @@
+ config FB_OMAP
+ tristate "OMAP frame buffer support (EXPERIMENTAL)"
+- depends on FB && ARCH_OMAP
++ depends on FB && ARCH_OMAP && (OMAP2_DSS = "n")
++
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+@@ -72,7 +73,7 @@ config FB_OMAP_LCD_MIPID
+
+ config FB_OMAP_BOOTLOADER_INIT
+ bool "Check bootloader initialization"
+- depends on FB_OMAP
++ depends on FB_OMAP || FB_OMAP2
+ help
+ Say Y here if you want to enable checking if the bootloader has
+ already initialized the display controller. In this case the
+diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig
+new file mode 100644
+index 0000000..4f66033
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/Kconfig
+@@ -0,0 +1,35 @@
++menuconfig FB_OMAP2
++ tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
++ depends on FB && OMAP2_DSS
++
++ select FB_CFB_FILLRECT
++ select FB_CFB_COPYAREA
++ select FB_CFB_IMAGEBLIT
++ help
++ Frame buffer driver for OMAP2/3 based boards.
++
++config FB_OMAP2_DEBUG_SUPPORT
++ bool "Debug support for OMAP2/3 FB"
++ default y
++ depends on FB_OMAP2
++ help
++ Support for debug output. You have to enable the actual printing
++ with debug module parameter.
++
++config FB_OMAP2_FORCE_AUTO_UPDATE
++ bool "Force main display to automatic update mode"
++ depends on FB_OMAP2
++ help
++ Forces main display to automatic update mode (if possible),
++ and also enables tearsync (if possible). By default
++ displays that support manual update are started in manual
++ update mode.
++
++config FB_OMAP2_NUM_FBS
++ int "Number of framebuffers"
++ range 1 10
++ default 3
++ depends on FB_OMAP2
++ help
++ Select the number of framebuffers created. OMAP2/3 has 3 overlays
++ so normally this would be 3.
+diff --git a/drivers/video/omap2/omapfb/Makefile b/drivers/video/omap2/omapfb/Makefile
+new file mode 100644
+index 0000000..51c2e00
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/Makefile
+@@ -0,0 +1,2 @@
++obj-$(CONFIG_FB_OMAP2) += omapfb.o
++omapfb-y := omapfb-main.o omapfb-sysfs.o omapfb-ioctl.o
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+new file mode 100644
+index 0000000..7f18d2a
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -0,0 +1,656 @@
++/*
++ * linux/drivers/video/omap2/omapfb-ioctl.c
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/fb.h>
++#include <linux/device.h>
++#include <linux/uaccess.h>
++#include <linux/platform_device.h>
++#include <linux/mm.h>
++#include <linux/omapfb.h>
++#include <linux/vmalloc.h>
++
++#include <mach/display.h>
++#include <mach/vrfb.h>
++
++#include "omapfb.h"
++
++static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ struct omap_overlay *ovl;
++ struct omap_overlay_info info;
++ int r = 0;
++
++ DBG("omapfb_setup_plane\n");
++
++ omapfb_lock(fbdev);
++
++ if (ofbi->num_overlays != 1) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ /* XXX uses only the first overlay */
++ ovl = ofbi->overlays[0];
++
++ if (pi->enabled && !ofbi->region.size) {
++ /*
++ * This plane's memory was freed, can't enable it
++ * until it's reallocated.
++ */
++ r = -EINVAL;
++ goto out;
++ }
++
++ ovl->get_overlay_info(ovl, &info);
++
++ info.pos_x = pi->pos_x;
++ info.pos_y = pi->pos_y;
++ info.out_width = pi->out_width;
++ info.out_height = pi->out_height;
++ info.enabled = pi->enabled;
++
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r)
++ goto out;
++
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ goto out;
++ }
++
++ if (display) {
++ u16 w, h;
++
++ if (display->sync)
++ display->sync(display);
++
++ display->get_resolution(display, &w, &h);
++
++ if (display->update)
++ display->update(display, 0, 0, w, h);
++ }
++
++out:
++ omapfb_unlock(fbdev);
++ if (r)
++ dev_err(fbdev->dev, "setup_plane failed\n");
++ return r;
++}
++
++static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++
++ omapfb_lock(fbdev);
++
++ if (ofbi->num_overlays != 1) {
++ memset(pi, 0, sizeof(*pi));
++ } else {
++ struct omap_overlay_info *ovli;
++ struct omap_overlay *ovl;
++
++ ovl = ofbi->overlays[0];
++ ovli = &ovl->info;
++
++ pi->pos_x = ovli->pos_x;
++ pi->pos_y = ovli->pos_y;
++ pi->enabled = ovli->enabled;
++ pi->channel_out = 0; /* xxx */
++ pi->mirror = 0;
++ pi->out_width = ovli->out_width;
++ pi->out_height = ovli->out_height;
++ }
++
++ omapfb_unlock(fbdev);
++
++ return 0;
++}
++
++static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omapfb2_mem_region *rg;
++ int r, i;
++ size_t size;
++
++ if (mi->type > OMAPFB_MEMTYPE_MAX)
++ return -EINVAL;
++
++ size = PAGE_ALIGN(mi->size);
++
++ rg = &ofbi->region;
++
++ omapfb_lock(fbdev);
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ofbi->overlays[i]->info.enabled) {
++ r = -EBUSY;
++ goto out;
++ }
++ }
++
++ if (rg->size != size || rg->type != mi->type) {
++ r = omapfb_realloc_fbmem(fbi, size, mi->type);
++ if (r) {
++ dev_err(fbdev->dev, "realloc fbmem failed\n");
++ goto out;
++ }
++ }
++
++ r = 0;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omapfb2_mem_region *rg;
++
++ rg = &ofbi->region;
++ memset(mi, 0, sizeof(*mi));
++
++ omapfb_lock(fbdev);
++ mi->size = rg->size;
++ mi->type = rg->type;
++ omapfb_unlock(fbdev);
++
++ return 0;
++}
++
++static int omapfb_update_window(struct fb_info *fbi,
++ u32 x, u32 y, u32 w, u32 h)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ u16 dw, dh;
++
++ if (!display)
++ return 0;
++
++ if (w == 0 || h == 0)
++ return 0;
++
++ display->get_resolution(display, &dw, &dh);
++
++ if (x + w > dw || y + h > dh)
++ return -EINVAL;
++
++ omapfb_lock(fbdev);
++ display->update(display, x, y, w, h);
++ omapfb_unlock(fbdev);
++
++ return 0;
++}
++
++static int omapfb_set_update_mode(struct fb_info *fbi,
++ enum omapfb_update_mode mode)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ enum omap_dss_update_mode um;
++ int r;
++
++ if (!display || !display->set_update_mode)
++ return -EINVAL;
++
++ switch (mode) {
++ case OMAPFB_UPDATE_DISABLED:
++ um = OMAP_DSS_UPDATE_DISABLED;
++ break;
++
++ case OMAPFB_AUTO_UPDATE:
++ um = OMAP_DSS_UPDATE_AUTO;
++ break;
++
++ case OMAPFB_MANUAL_UPDATE:
++ um = OMAP_DSS_UPDATE_MANUAL;
++ break;
++
++ default:
++ return -EINVAL;
++ }
++
++ omapfb_lock(fbdev);
++ r = display->set_update_mode(display, um);
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static int omapfb_get_update_mode(struct fb_info *fbi,
++ enum omapfb_update_mode *mode)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ enum omap_dss_update_mode m;
++
++ if (!display || !display->get_update_mode)
++ return -EINVAL;
++
++ omapfb_lock(fbdev);
++ m = display->get_update_mode(display);
++ omapfb_unlock(fbdev);
++
++ switch (m) {
++ case OMAP_DSS_UPDATE_DISABLED:
++ *mode = OMAPFB_UPDATE_DISABLED;
++ break;
++ case OMAP_DSS_UPDATE_AUTO:
++ *mode = OMAPFB_AUTO_UPDATE;
++ break;
++ case OMAP_DSS_UPDATE_MANUAL:
++ *mode = OMAPFB_MANUAL_UPDATE;
++ break;
++ default:
++ BUG();
++ }
++
++ return 0;
++}
++
++/* XXX this color key handling is a hack... */
++static struct omapfb_color_key omapfb_color_keys[2];
++
++static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
++ struct omapfb_color_key *ck)
++{
++ enum omap_dss_color_key_type kt;
++
++ if(!mgr->set_default_color || !mgr->set_trans_key ||
++ !mgr->enable_trans_key)
++ return 0;
++
++ if (ck->key_type == OMAPFB_COLOR_KEY_DISABLED) {
++ mgr->enable_trans_key(mgr, 0);
++ omapfb_color_keys[mgr->id] = *ck;
++ return 0;
++ }
++
++ switch(ck->key_type) {
++ case OMAPFB_COLOR_KEY_GFX_DST:
++ kt = OMAP_DSS_COLOR_KEY_GFX_DST;
++ break;
++ case OMAPFB_COLOR_KEY_VID_SRC:
++ kt = OMAP_DSS_COLOR_KEY_VID_SRC;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ mgr->set_default_color(mgr, ck->background);
++ mgr->set_trans_key(mgr, kt, ck->trans_key);
++ mgr->enable_trans_key(mgr, 1);
++
++ omapfb_color_keys[mgr->id] = *ck;
++
++ return 0;
++}
++
++static int omapfb_set_color_key(struct fb_info *fbi,
++ struct omapfb_color_key *ck)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ int r;
++ int i;
++ struct omap_overlay_manager *mgr = NULL;
++
++ omapfb_lock(fbdev);
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ofbi->overlays[i]->manager) {
++ mgr = ofbi->overlays[i]->manager;
++ break;
++ }
++ }
++
++ if (!mgr) {
++ r = -EINVAL;
++ goto err;
++ }
++
++ if(!mgr->set_default_color || !mgr->set_trans_key ||
++ !mgr->enable_trans_key) {
++ r = -ENODEV;
++ goto err;
++ }
++
++ r = _omapfb_set_color_key(mgr, ck);
++err:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static int omapfb_get_color_key(struct fb_info *fbi,
++ struct omapfb_color_key *ck)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_overlay_manager *mgr = NULL;
++ int r = 0;
++ int i;
++
++ omapfb_lock(fbdev);
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ofbi->overlays[i]->manager) {
++ mgr = ofbi->overlays[i]->manager;
++ break;
++ }
++ }
++
++ if (!mgr) {
++ r = -EINVAL;
++ goto err;
++ }
++
++ if(!mgr->set_default_color || !mgr->set_trans_key ||
++ !mgr->enable_trans_key) {
++ r = -ENODEV;
++ goto err;
++ }
++
++ *ck = omapfb_color_keys[mgr->id];
++err:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static int omapfb_memory_read(struct fb_info *fbi,
++ struct omapfb_memory_read *mr)
++{
++ struct omap_display *display = fb2display(fbi);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ void *buf;
++ int r;
++
++ if (!display || !display->memory_read)
++ return -ENOENT;
++
++ if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size))
++ return -EFAULT;
++
++ if (mr->w * mr->h * 3 > mr->buffer_size)
++ return -EINVAL;
++
++ buf = vmalloc(mr->buffer_size);
++ if (!buf) {
++ DBG("vmalloc failed\n");
++ return -ENOMEM;
++ }
++
++ omapfb_lock(fbdev);
++
++ r = display->memory_read(display, buf, mr->buffer_size,
++ mr->x, mr->y, mr->w, mr->h);
++
++ if (r > 0) {
++ if (copy_to_user(mr->buffer, buf, mr->buffer_size))
++ r = -EFAULT;
++ }
++
++ vfree(buf);
++
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++
++ union {
++ struct omapfb_update_window_old uwnd_o;
++ struct omapfb_update_window uwnd;
++ struct omapfb_plane_info plane_info;
++ struct omapfb_caps caps;
++ struct omapfb_mem_info mem_info;
++ struct omapfb_color_key color_key;
++ enum omapfb_update_mode update_mode;
++ int test_num;
++ struct omapfb_memory_read memory_read;
++ } p;
++
++ int r = 0;
++
++ switch (cmd) {
++ case OMAPFB_SYNC_GFX:
++ DBG("ioctl SYNC_GFX\n");
++ if (!display || !display->sync) {
++ /* DSS1 never returns an error here, so we neither */
++ /*r = -EINVAL;*/
++ break;
++ }
++
++ omapfb_lock(fbdev);
++ r = display->sync(display);
++ omapfb_unlock(fbdev);
++ break;
++
++ case OMAPFB_UPDATE_WINDOW_OLD:
++ DBG("ioctl UPDATE_WINDOW_OLD\n");
++ if (!display || !display->update) {
++ r = -EINVAL;
++ break;
++ }
++
++ if (copy_from_user(&p.uwnd_o,
++ (void __user *)arg,
++ sizeof(p.uwnd_o))) {
++ r = -EFAULT;
++ break;
++ }
++
++ r = omapfb_update_window(fbi, p.uwnd_o.x, p.uwnd_o.y,
++ p.uwnd_o.width, p.uwnd_o.height);
++ break;
++
++ case OMAPFB_UPDATE_WINDOW:
++ DBG("ioctl UPDATE_WINDOW\n");
++ if (!display || !display->update) {
++ r = -EINVAL;
++ break;
++ }
++
++ if (copy_from_user(&p.uwnd, (void __user *)arg,
++ sizeof(p.uwnd))) {
++ r = -EFAULT;
++ break;
++ }
++
++ r = omapfb_update_window(fbi, p.uwnd.x, p.uwnd.y,
++ p.uwnd.width, p.uwnd.height);
++ break;
++
++ case OMAPFB_SETUP_PLANE:
++ DBG("ioctl SETUP_PLANE\n");
++ if (copy_from_user(&p.plane_info, (void __user *)arg,
++ sizeof(p.plane_info)))
++ r = -EFAULT;
++ else
++ r = omapfb_setup_plane(fbi, &p.plane_info);
++ break;
++
++ case OMAPFB_QUERY_PLANE:
++ DBG("ioctl QUERY_PLANE\n");
++ r = omapfb_query_plane(fbi, &p.plane_info);
++ if (r < 0)
++ break;
++ if (copy_to_user((void __user *)arg, &p.plane_info,
++ sizeof(p.plane_info)))
++ r = -EFAULT;
++ break;
++
++ case OMAPFB_SETUP_MEM:
++ DBG("ioctl SETUP_MEM\n");
++ if (copy_from_user(&p.mem_info, (void __user *)arg,
++ sizeof(p.mem_info)))
++ r = -EFAULT;
++ else
++ r = omapfb_setup_mem(fbi, &p.mem_info);
++ break;
++
++ case OMAPFB_QUERY_MEM:
++ DBG("ioctl QUERY_MEM\n");
++ r = omapfb_query_mem(fbi, &p.mem_info);
++ if (r < 0)
++ break;
++ if (copy_to_user((void __user *)arg, &p.mem_info,
++ sizeof(p.mem_info)))
++ r = -EFAULT;
++ break;
++
++ case OMAPFB_GET_CAPS:
++ DBG("ioctl GET_CAPS\n");
++ if (!display) {
++ r = -EINVAL;
++ break;
++ }
++
++ p.caps.ctrl = display->caps;
++
++ if (copy_to_user((void __user *)arg, &p.caps, sizeof(p.caps)))
++ r = -EFAULT;
++ break;
++
++ case OMAPFB_SET_UPDATE_MODE:
++ DBG("ioctl SET_UPDATE_MODE\n");
++ if (get_user(p.update_mode, (int __user *)arg))
++ r = -EFAULT;
++ else
++ r = omapfb_set_update_mode(fbi, p.update_mode);
++ break;
++
++ case OMAPFB_GET_UPDATE_MODE:
++ DBG("ioctl GET_UPDATE_MODE\n");
++ r = omapfb_get_update_mode(fbi, &p.update_mode);
++ if (r)
++ break;
++ if (put_user(p.update_mode,
++ (enum omapfb_update_mode __user *)arg))
++ r = -EFAULT;
++ break;
++
++ case OMAPFB_SET_COLOR_KEY:
++ DBG("ioctl SET_COLOR_KEY\n");
++ if (copy_from_user(&p.color_key, (void __user *)arg,
++ sizeof(p.color_key)))
++ r = -EFAULT;
++ else
++ r = omapfb_set_color_key(fbi, &p.color_key);
++ break;
++
++ case OMAPFB_GET_COLOR_KEY:
++ DBG("ioctl GET_COLOR_KEY\n");
++ if ((r = omapfb_get_color_key(fbi, &p.color_key)) < 0)
++ break;
++ if (copy_to_user((void __user *)arg, &p.color_key,
++ sizeof(p.color_key)))
++ r = -EFAULT;
++ break;
++
++ case OMAPFB_WAITFORVSYNC:
++ DBG("ioctl WAITFORVSYNC\n");
++ if (!display) {
++ r = -EINVAL;
++ break;
++ }
++
++ r = display->wait_vsync(display);
++ break;
++
++ /* LCD and CTRL tests do the same thing for backward
++ * compatibility */
++ case OMAPFB_LCD_TEST:
++ DBG("ioctl LCD_TEST\n");
++ if (get_user(p.test_num, (int __user *)arg)) {
++ r = -EFAULT;
++ break;
++ }
++ if (!display || !display->run_test) {
++ r = -EINVAL;
++ break;
++ }
++
++ r = display->run_test(display, p.test_num);
++
++ break;
++
++ case OMAPFB_CTRL_TEST:
++ DBG("ioctl CTRL_TEST\n");
++ if (get_user(p.test_num, (int __user *)arg)) {
++ r = -EFAULT;
++ break;
++ }
++ if (!display || !display->run_test) {
++ r = -EINVAL;
++ break;
++ }
++
++ r = display->run_test(display, p.test_num);
++
++ break;
++
++ case OMAPFB_MEMORY_READ:
++ DBG("ioctl MEMORY_READ\n");
++
++ if (copy_from_user(&p.memory_read, (void __user *)arg,
++ sizeof(p.memory_read))) {
++ r = -EFAULT;
++ break;
++ }
++
++ r = omapfb_memory_read(fbi, &p.memory_read);
++
++ break;
++
++ default:
++ dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd);
++ r = -EINVAL;
++ }
++
++ if (r < 0)
++ DBG("ioctl failed: %d\n", r);
++
++ return r;
++}
++
++
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+new file mode 100644
+index 0000000..852abe5
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -0,0 +1,2010 @@
++/*
++ * linux/drivers/video/omap2/omapfb-main.c
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++#include <linux/fb.h>
++#include <linux/dma-mapping.h>
++#include <linux/vmalloc.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/omapfb.h>
++
++#include <mach/display.h>
++#include <mach/vram.h>
++#include <mach/vrfb.h>
++
++#include "omapfb.h"
++
++#define MODULE_NAME "omapfb"
++
++static char *def_mode;
++static char *def_vram;
++static int def_vrfb;
++static int def_rotate;
++static int def_mirror;
++
++#ifdef DEBUG
++unsigned int omapfb_debug;
++module_param_named(debug, omapfb_debug, bool, 0644);
++static unsigned int omapfb_test_pattern;
++module_param_named(test, omapfb_test_pattern, bool, 0644);
++#endif
++
++#ifdef DEBUG
++static void draw_pixel(struct fb_info *fbi, int x, int y, unsigned color)
++{
++ struct fb_var_screeninfo *var = &fbi->var;
++ struct fb_fix_screeninfo *fix = &fbi->fix;
++ void __iomem *addr = fbi->screen_base;
++ const unsigned bytespp = var->bits_per_pixel >> 3;
++ const unsigned line_len = fix->line_length / bytespp;
++
++ int r = (color >> 16) & 0xff;
++ int g = (color >> 8) & 0xff;
++ int b = (color >> 0) & 0xff;
++
++ if (var->bits_per_pixel == 16) {
++ u16 __iomem *p = (u16 __iomem *)addr;
++ p += y * line_len + x;
++
++ r = r * 32 / 256;
++ g = g * 64 / 256;
++ b = b * 32 / 256;
++
++ __raw_writew((r << 11) | (g << 5) | (b << 0), p);
++ } else if (var->bits_per_pixel == 24) {
++ u8 __iomem *p = (u8 __iomem *)addr;
++ p += (y * line_len + x) * 3;
++
++ __raw_writeb(b, p + 0);
++ __raw_writeb(g, p + 1);
++ __raw_writeb(r, p + 2);
++ } else if (var->bits_per_pixel == 32) {
++ u32 __iomem *p = (u32 __iomem *)addr;
++ p += y * line_len + x;
++ __raw_writel(color, p);
++ }
++}
++
++static void fill_fb(struct fb_info *fbi)
++{
++ struct fb_var_screeninfo *var = &fbi->var;
++ const short w = var->xres_virtual;
++ const short h = var->yres_virtual;
++ void __iomem *addr = fbi->screen_base;
++ int y, x;
++
++ if (!addr)
++ return;
++
++ DBG("fill_fb %dx%d, line_len %d bytes\n", w, h, fbi->fix.line_length);
++
++ for (y = 0; y < h; y++) {
++ for (x = 0; x < w; x++) {
++ if (x < 20 && y < 20)
++ draw_pixel(fbi, x, y, 0xffffff);
++ else if (x < 20 && (y > 20 && y < h - 20))
++ draw_pixel(fbi, x, y, 0xff);
++ else if (y < 20 && (x > 20 && x < w - 20))
++ draw_pixel(fbi, x, y, 0xff00);
++ else if (x > w - 20 && (y > 20 && y < h - 20))
++ draw_pixel(fbi, x, y, 0xff0000);
++ else if (y > h - 20 && (x > 20 && x < w - 20))
++ draw_pixel(fbi, x, y, 0xffff00);
++ else if (x == 20 || x == w - 20 ||
++ y == 20 || y == h - 20)
++ draw_pixel(fbi, x, y, 0xffffff);
++ else if (x == y || w - x == h - y)
++ draw_pixel(fbi, x, y, 0xff00ff);
++ else if (w - x == y || x == h - y)
++ draw_pixel(fbi, x, y, 0x00ffff);
++ else if (x > 20 && y > 20 && x < w - 20 && y < h - 20) {
++ int t = x * 3 / w;
++ unsigned r = 0, g = 0, b = 0;
++ unsigned c;
++ if (var->bits_per_pixel == 16) {
++ if (t == 0)
++ b = (y % 32) * 256 / 32;
++ else if (t == 1)
++ g = (y % 64) * 256 / 64;
++ else if (t == 2)
++ r = (y % 32) * 256 / 32;
++ } else {
++ if (t == 0)
++ b = (y % 256);
++ else if (t == 1)
++ g = (y % 256);
++ else if (t == 2)
++ r = (y % 256);
++ }
++ c = (r << 16) | (g << 8) | (b << 0);
++ draw_pixel(fbi, x, y, c);
++ } else {
++ draw_pixel(fbi, x, y, 0);
++ }
++ }
++ }
++}
++#endif
++
++static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
++{
++ struct vrfb *vrfb = &ofbi->region.vrfb;
++ unsigned offset;
++
++ switch (rot) {
++ case FB_ROTATE_UR:
++ offset = 0;
++ break;
++ case FB_ROTATE_CW:
++ offset = vrfb->yoffset;
++ break;
++ case FB_ROTATE_UD:
++ offset = vrfb->yoffset * OMAP_VRFB_LINE_LEN + vrfb->xoffset;
++ break;
++ case FB_ROTATE_CCW:
++ offset = vrfb->xoffset * OMAP_VRFB_LINE_LEN;
++ break;
++ default:
++ BUG();
++ }
++
++ offset *= vrfb->bytespp;
++
++ return offset;
++}
++
++static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
++{
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ unsigned offset;
++ int rot;
++
++ rot = ofbi->rotation;
++
++ offset = omapfb_get_vrfb_offset(ofbi, rot);
++
++ return ofbi->region.vrfb.paddr[rot] + offset;
++ } else {
++ return ofbi->region.paddr;
++ }
++}
++
++u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
++{
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ return ofbi->region.vrfb.paddr[0];
++ else
++ return ofbi->region.paddr;
++}
++
++void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
++{
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ return ofbi->region.vrfb.vaddr[0];
++ else
++ return ofbi->region.vaddr;
++}
++
++static struct omapfb_colormode omapfb_colormodes[] = {
++ {
++ .dssmode = OMAP_DSS_COLOR_UYVY,
++ .bits_per_pixel = 16,
++ .nonstd = OMAPFB_COLOR_YUV422,
++ }, {
++ .dssmode = OMAP_DSS_COLOR_YUV2,
++ .bits_per_pixel = 16,
++ .nonstd = OMAPFB_COLOR_YUY422,
++ }, {
++ .dssmode = OMAP_DSS_COLOR_ARGB16,
++ .bits_per_pixel = 16,
++ .red = { .length = 4, .offset = 8, .msb_right = 0 },
++ .green = { .length = 4, .offset = 4, .msb_right = 0 },
++ .blue = { .length = 4, .offset = 0, .msb_right = 0 },
++ .transp = { .length = 4, .offset = 12, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_RGB16,
++ .bits_per_pixel = 16,
++ .red = { .length = 5, .offset = 11, .msb_right = 0 },
++ .green = { .length = 6, .offset = 5, .msb_right = 0 },
++ .blue = { .length = 5, .offset = 0, .msb_right = 0 },
++ .transp = { .length = 0, .offset = 0, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_RGB24P,
++ .bits_per_pixel = 24,
++ .red = { .length = 8, .offset = 16, .msb_right = 0 },
++ .green = { .length = 8, .offset = 8, .msb_right = 0 },
++ .blue = { .length = 8, .offset = 0, .msb_right = 0 },
++ .transp = { .length = 0, .offset = 0, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_RGB24U,
++ .bits_per_pixel = 32,
++ .red = { .length = 8, .offset = 16, .msb_right = 0 },
++ .green = { .length = 8, .offset = 8, .msb_right = 0 },
++ .blue = { .length = 8, .offset = 0, .msb_right = 0 },
++ .transp = { .length = 0, .offset = 0, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_ARGB32,
++ .bits_per_pixel = 32,
++ .red = { .length = 8, .offset = 16, .msb_right = 0 },
++ .green = { .length = 8, .offset = 8, .msb_right = 0 },
++ .blue = { .length = 8, .offset = 0, .msb_right = 0 },
++ .transp = { .length = 8, .offset = 24, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_RGBA32,
++ .bits_per_pixel = 32,
++ .red = { .length = 8, .offset = 24, .msb_right = 0 },
++ .green = { .length = 8, .offset = 16, .msb_right = 0 },
++ .blue = { .length = 8, .offset = 8, .msb_right = 0 },
++ .transp = { .length = 8, .offset = 0, .msb_right = 0 },
++ }, {
++ .dssmode = OMAP_DSS_COLOR_RGBX32,
++ .bits_per_pixel = 32,
++ .red = { .length = 8, .offset = 24, .msb_right = 0 },
++ .green = { .length = 8, .offset = 16, .msb_right = 0 },
++ .blue = { .length = 8, .offset = 8, .msb_right = 0 },
++ .transp = { .length = 0, .offset = 0, .msb_right = 0 },
++ },
++};
++
++static bool cmp_var_to_colormode(struct fb_var_screeninfo *var,
++ struct omapfb_colormode *color)
++{
++ bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2)
++ {
++ return f1->length == f2->length &&
++ f1->offset == f2->offset &&
++ f1->msb_right == f2->msb_right;
++ }
++
++ if (var->bits_per_pixel == 0 ||
++ var->red.length == 0 ||
++ var->blue.length == 0 ||
++ var->green.length == 0)
++ return 0;
++
++ return var->bits_per_pixel == color->bits_per_pixel &&
++ cmp_component(&var->red, &color->red) &&
++ cmp_component(&var->green, &color->green) &&
++ cmp_component(&var->blue, &color->blue) &&
++ cmp_component(&var->transp, &color->transp);
++}
++
++static void assign_colormode_to_var(struct fb_var_screeninfo *var,
++ struct omapfb_colormode *color)
++{
++ var->bits_per_pixel = color->bits_per_pixel;
++ var->nonstd = color->nonstd;
++ var->red = color->red;
++ var->green = color->green;
++ var->blue = color->blue;
++ var->transp = color->transp;
++}
++
++static enum omap_color_mode fb_mode_to_dss_mode(struct fb_var_screeninfo *var)
++{
++ enum omap_color_mode dssmode;
++ int i;
++
++ /* first match with nonstd field */
++ if (var->nonstd) {
++ for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
++ struct omapfb_colormode *mode = &omapfb_colormodes[i];
++ if (var->nonstd == mode->nonstd) {
++ assign_colormode_to_var(var, mode);
++ return mode->dssmode;
++ }
++ }
++
++ return -EINVAL;
++ }
++
++ /* then try exact match of bpp and colors */
++ for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
++ struct omapfb_colormode *mode = &omapfb_colormodes[i];
++ if (cmp_var_to_colormode(var, mode)) {
++ assign_colormode_to_var(var, mode);
++ return mode->dssmode;
++ }
++ }
++
++ /* match with bpp if user has not filled color fields
++ * properly */
++ switch (var->bits_per_pixel) {
++ case 1:
++ dssmode = OMAP_DSS_COLOR_CLUT1;
++ break;
++ case 2:
++ dssmode = OMAP_DSS_COLOR_CLUT2;
++ break;
++ case 4:
++ dssmode = OMAP_DSS_COLOR_CLUT4;
++ break;
++ case 8:
++ dssmode = OMAP_DSS_COLOR_CLUT8;
++ break;
++ case 12:
++ dssmode = OMAP_DSS_COLOR_RGB12U;
++ break;
++ case 16:
++ dssmode = OMAP_DSS_COLOR_RGB16;
++ break;
++ case 24:
++ dssmode = OMAP_DSS_COLOR_RGB24P;
++ break;
++ case 32:
++ dssmode = OMAP_DSS_COLOR_RGB24U;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
++ struct omapfb_colormode *mode = &omapfb_colormodes[i];
++ if (dssmode == mode->dssmode) {
++ assign_colormode_to_var(var, mode);
++ return mode->dssmode;
++ }
++ }
++
++ return -EINVAL;
++}
++
++void set_fb_fix(struct fb_info *fbi)
++{
++ struct fb_fix_screeninfo *fix = &fbi->fix;
++ struct fb_var_screeninfo *var = &fbi->var;
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_mem_region *rg = &ofbi->region;
++
++ DBG("set_fb_fix\n");
++
++ /* used by open/write in fbmem.c */
++ fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
++
++ /* used by mmap in fbmem.c */
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ fix->line_length =
++ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
++ else
++ fix->line_length =
++ (var->xres_virtual * var->bits_per_pixel) >> 3;
++ fix->smem_start = omapfb_get_region_paddr(ofbi);
++ fix->smem_len = rg->size;
++
++ fix->type = FB_TYPE_PACKED_PIXELS;
++
++ if (var->nonstd)
++ fix->visual = FB_VISUAL_PSEUDOCOLOR;
++ else {
++ switch (var->bits_per_pixel) {
++ case 32:
++ case 24:
++ case 16:
++ case 12:
++ fix->visual = FB_VISUAL_TRUECOLOR;
++ /* 12bpp is stored in 16 bits */
++ break;
++ case 1:
++ case 2:
++ case 4:
++ case 8:
++ fix->visual = FB_VISUAL_PSEUDOCOLOR;
++ break;
++ }
++ }
++
++ fix->accel = FB_ACCEL_NONE;
++
++ fix->xpanstep = 1;
++ fix->ypanstep = 1;
++
++ if (rg->size) {
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ omap_vrfb_setup(&rg->vrfb, rg->paddr,
++ var->xres_virtual, var->yres_virtual,
++ var->bits_per_pixel >> 3);
++ }
++}
++
++/* check new var and possibly modify it to be ok */
++int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omap_display *display = fb2display(fbi);
++ unsigned long max_frame_size;
++ unsigned long line_size;
++ int xres_min, yres_min;
++ int xres_max, yres_max;
++ enum omap_color_mode mode = 0;
++ int i;
++ int bytespp;
++
++ DBG("check_fb_var %d\n", ofbi->id);
++
++ if (ofbi->region.size == 0)
++ return 0;
++
++ mode = fb_mode_to_dss_mode(var);
++ if (mode < 0) {
++ DBG("cannot convert var to omap dss mode\n");
++ return -EINVAL;
++ }
++
++ for (i = 0; i < ofbi->num_overlays; ++i) {
++ if ((ofbi->overlays[i]->supported_modes & mode) == 0) {
++ DBG("invalid mode\n");
++ return -EINVAL;
++ }
++ }
++
++ if (var->rotate < 0 || var->rotate > 3)
++ return -EINVAL;
++
++ if (var->rotate != fbi->var.rotate) {
++ DBG("rotation changing\n");
++
++ ofbi->rotation = var->rotate;
++
++ if (abs(var->rotate - fbi->var.rotate) != 2) {
++ int tmp;
++ DBG("rotate changing 90/270 degrees. "
++ "swapping x/y res\n");
++
++ tmp = var->yres;
++ var->yres = var->xres;
++ var->xres = tmp;
++
++ tmp = var->yres_virtual;
++ var->yres_virtual = var->xres_virtual;
++ var->xres_virtual = tmp;
++ }
++ }
++
++ xres_min = OMAPFB_PLANE_XRES_MIN;
++ xres_max = 2048;
++ yres_min = OMAPFB_PLANE_YRES_MIN;
++ yres_max = 2048;
++
++ bytespp = var->bits_per_pixel >> 3;
++
++ /* XXX: some applications seem to set virtual res to 0. */
++ if (var->xres_virtual == 0)
++ var->xres_virtual = var->xres;
++
++ if (var->yres_virtual == 0)
++ var->yres_virtual = var->yres;
++
++ if (var->xres_virtual < xres_min || var->yres_virtual < yres_min)
++ return -EINVAL;
++
++ if (var->xres < xres_min)
++ var->xres = xres_min;
++ if (var->yres < yres_min)
++ var->yres = yres_min;
++ if (var->xres > xres_max)
++ var->xres = xres_max;
++ if (var->yres > yres_max)
++ var->yres = yres_max;
++
++ if (var->xres > var->xres_virtual)
++ var->xres = var->xres_virtual;
++ if (var->yres > var->yres_virtual)
++ var->yres = var->yres_virtual;
++
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ line_size = OMAP_VRFB_LINE_LEN * bytespp;
++ else
++ line_size = var->xres_virtual * bytespp;
++
++ max_frame_size = ofbi->region.size;
++
++ DBG("max frame size %lu, line size %lu\n", max_frame_size, line_size);
++
++ if (line_size * var->yres_virtual > max_frame_size) {
++ DBG("can't fit FB into memory, reducing y\n");
++ var->yres_virtual = max_frame_size / line_size;
++
++ if (var->yres_virtual < yres_min)
++ var->yres_virtual = yres_min;
++
++ if (var->yres > var->yres_virtual)
++ var->yres = var->yres_virtual;
++ }
++
++ if (line_size * var->yres_virtual > max_frame_size) {
++ DBG("can't fit FB into memory, reducing x\n");
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ return -EINVAL;
++
++ var->xres_virtual = max_frame_size / var->yres_virtual /
++ bytespp;
++
++ if (var->xres_virtual < xres_min)
++ var->xres_virtual = xres_min;
++
++ if (var->xres > var->xres_virtual)
++ var->xres = var->xres_virtual;
++
++ line_size = var->xres_virtual * bytespp;
++ }
++
++ if (line_size * var->yres_virtual > max_frame_size) {
++ DBG("cannot fit FB to memory\n");
++ return -EINVAL;
++ }
++
++ if (var->xres + var->xoffset > var->xres_virtual)
++ var->xoffset = var->xres_virtual - var->xres;
++ if (var->yres + var->yoffset > var->yres_virtual)
++ var->yoffset = var->yres_virtual - var->yres;
++
++ DBG("xres = %d, yres = %d, vxres = %d, vyres = %d\n",
++ var->xres, var->yres,
++ var->xres_virtual, var->yres_virtual);
++
++ var->height = -1;
++ var->width = -1;
++ var->grayscale = 0;
++
++ if (display && display->get_timings) {
++ struct omap_video_timings timings;
++ display->get_timings(display, &timings);
++
++ /* pixclock in ps, the rest in pixclock */
++ var->pixclock = timings.pixel_clock != 0 ?
++ KHZ2PICOS(timings.pixel_clock) :
++ 0;
++ var->left_margin = timings.hfp;
++ var->right_margin = timings.hbp;
++ var->upper_margin = timings.vfp;
++ var->lower_margin = timings.vbp;
++ var->hsync_len = timings.hsw;
++ var->vsync_len = timings.vsw;
++ } else {
++ var->pixclock = 0;
++ var->left_margin = 0;
++ var->right_margin = 0;
++ var->upper_margin = 0;
++ var->lower_margin = 0;
++ var->hsync_len = 0;
++ var->vsync_len = 0;
++ }
++
++ /* TODO: get these from panel->config */
++ var->vmode = FB_VMODE_NONINTERLACED;
++ var->sync = 0;
++
++ return 0;
++}
++
++/*
++ * ---------------------------------------------------------------------------
++ * fbdev framework callbacks
++ * ---------------------------------------------------------------------------
++ */
++static int omapfb_open(struct fb_info *fbi, int user)
++{
++ return 0;
++}
++
++static int omapfb_release(struct fb_info *fbi, int user)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++
++ DBG("Closing fb with plane index %d\n", ofbi->id);
++
++ omapfb_lock(fbdev);
++#if 1
++ if (display && display->get_update_mode && display->update) {
++ /* XXX this update should be removed, I think. But it's
++ * good for debugging */
++ if (display->get_update_mode(display) ==
++ OMAP_DSS_UPDATE_MANUAL) {
++ u16 w, h;
++
++ if (display->sync)
++ display->sync(display);
++
++ display->get_resolution(display, &w, &h);
++ display->update(display, 0, 0, w, h);
++ }
++ }
++#endif
++
++ if (display && display->sync)
++ display->sync(display);
++
++ omapfb_unlock(fbdev);
++
++ return 0;
++}
++
++/* setup overlay according to the fb */
++static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
++ u16 posx, u16 posy, u16 outw, u16 outh)
++{
++ int r = 0;
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct fb_var_screeninfo *var = &fbi->var;
++ struct fb_fix_screeninfo *fix = &fbi->fix;
++ enum omap_color_mode mode = 0;
++ int offset;
++ u32 data_start_p;
++ void __iomem *data_start_v;
++ struct omap_overlay_info info;
++ int xres, yres;
++ int screen_width;
++ int rot, mirror;
++
++ DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
++ posx, posy, outw, outh);
++
++ if (ofbi->rotation == FB_ROTATE_CW || ofbi->rotation == FB_ROTATE_CCW) {
++ xres = var->yres;
++ yres = var->xres;
++ } else {
++ xres = var->xres;
++ yres = var->yres;
++ }
++
++ offset = ((var->yoffset * var->xres_virtual +
++ var->xoffset) * var->bits_per_pixel) >> 3;
++
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ data_start_p = omapfb_get_region_rot_paddr(ofbi);
++ data_start_v = NULL;
++ } else {
++ data_start_p = omapfb_get_region_paddr(ofbi);
++ data_start_v = omapfb_get_region_vaddr(ofbi);
++ }
++
++ data_start_p += offset;
++ data_start_v += offset;
++
++ mode = fb_mode_to_dss_mode(var);
++
++ if (mode == -EINVAL) {
++ DBG("fb_mode_to_dss_mode failed");
++ r = -EINVAL;
++ goto err;
++ }
++
++ screen_width = fix->line_length / (var->bits_per_pixel >> 3);
++
++ ovl->get_overlay_info(ovl, &info);
++
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ rot = 0;
++ mirror = 0;
++ } else {
++ rot = ofbi->rotation;
++ mirror = ofbi->mirror;
++ }
++
++ info.paddr = data_start_p;
++ info.vaddr = data_start_v;
++ info.screen_width = screen_width;
++ info.width = xres;
++ info.height = yres;
++ info.color_mode = mode;
++ info.rotation = rot;
++ info.mirror = mirror;
++
++ info.pos_x = posx;
++ info.pos_y = posy;
++ info.out_width = outw;
++ info.out_height = outh;
++
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r) {
++ DBG("ovl->setup_overlay_info failed\n");
++ goto err;
++ }
++
++ return 0;
++
++err:
++ DBG("setup_overlay failed\n");
++ return r;
++}
++
++/* apply var to the overlay */
++int omapfb_apply_changes(struct fb_info *fbi, int init)
++{
++ int r = 0;
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct fb_var_screeninfo *var = &fbi->var;
++ struct omap_overlay *ovl;
++ u16 posx, posy;
++ u16 outw, outh;
++ int i;
++
++#ifdef DEBUG
++ if (omapfb_test_pattern)
++ fill_fb(fbi);
++#endif
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ ovl = ofbi->overlays[i];
++
++ DBG("apply_changes, fb %d, ovl %d\n", ofbi->id, ovl->id);
++
++ if (ofbi->region.size == 0) {
++ /* the fb is not available. disable the overlay */
++ omapfb_overlay_enable(ovl, 0);
++ if (!init && ovl->manager)
++ ovl->manager->apply(ovl->manager);
++ continue;
++ }
++
++ if (init || (ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
++ if (ofbi->rotation == FB_ROTATE_CW ||
++ ofbi->rotation == FB_ROTATE_CCW) {
++ outw = var->yres;
++ outh = var->xres;
++ } else {
++ outw = var->xres;
++ outh = var->yres;
++ }
++ } else {
++ outw = ovl->info.out_width;
++ outh = ovl->info.out_height;
++ }
++
++ if (init) {
++ posx = 0;
++ posy = 0;
++ } else {
++ posx = ovl->info.pos_x;
++ posy = ovl->info.pos_y;
++ }
++
++ r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh);
++ if (r)
++ goto err;
++
++ if (!init && ovl->manager)
++ ovl->manager->apply(ovl->manager);
++ }
++ return 0;
++err:
++ DBG("apply_changes failed\n");
++ return r;
++}
++
++/* checks var and eventually tweaks it to something supported,
++ * DO NOT MODIFY PAR */
++static int omapfb_check_var(struct fb_var_screeninfo *var, struct fb_info *fbi)
++{
++ int r;
++
++ DBG("check_var(%d)\n", FB2OFB(fbi)->id);
++
++ r = check_fb_var(fbi, var);
++
++ return r;
++}
++
++/* set the video mode according to info->var */
++static int omapfb_set_par(struct fb_info *fbi)
++{
++ int r;
++
++ DBG("set_par(%d)\n", FB2OFB(fbi)->id);
++
++ set_fb_fix(fbi);
++ r = omapfb_apply_changes(fbi, 0);
++
++ return r;
++}
++
++static int omapfb_pan_display(struct fb_var_screeninfo *var,
++ struct fb_info *fbi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ int r = 0;
++
++ DBG("pan_display(%d)\n", ofbi->id);
++
++ omapfb_lock(fbdev);
++
++ if (var->xoffset != fbi->var.xoffset ||
++ var->yoffset != fbi->var.yoffset) {
++ struct fb_var_screeninfo new_var;
++
++ new_var = fbi->var;
++ new_var.xoffset = var->xoffset;
++ new_var.yoffset = var->yoffset;
++
++ r = check_fb_var(fbi, &new_var);
++
++ if (r == 0) {
++ fbi->var = new_var;
++ set_fb_fix(fbi);
++ r = omapfb_apply_changes(fbi, 0);
++ }
++ }
++
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static void mmap_user_open(struct vm_area_struct *vma)
++{
++ struct omapfb_info *ofbi = (struct omapfb_info *)vma->vm_private_data;
++
++ atomic_inc(&ofbi->map_count);
++}
++
++static void mmap_user_close(struct vm_area_struct *vma)
++{
++ struct omapfb_info *ofbi = (struct omapfb_info *)vma->vm_private_data;
++
++ atomic_dec(&ofbi->map_count);
++}
++
++static struct vm_operations_struct mmap_user_ops = {
++ .open = mmap_user_open,
++ .close = mmap_user_close,
++};
++
++static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct fb_fix_screeninfo *fix = &fbi->fix;
++ unsigned long off;
++ unsigned long start;
++ u32 len;
++
++ if (vma->vm_end - vma->vm_start == 0)
++ return 0;
++ if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
++ return -EINVAL;
++ off = vma->vm_pgoff << PAGE_SHIFT;
++
++ start = omapfb_get_region_paddr(ofbi);
++ len = fix->smem_len;
++ if (off >= len)
++ return -EINVAL;
++ if ((vma->vm_end - vma->vm_start + off) > len)
++ return -EINVAL;
++
++ off += start;
++
++ DBG("user mmap region start %lx, len %d, off %lx\n", start, len, off);
++
++ vma->vm_pgoff = off >> PAGE_SHIFT;
++ vma->vm_flags |= VM_IO | VM_RESERVED;
++ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
++ vma->vm_ops = &mmap_user_ops;
++ vma->vm_private_data = ofbi;
++ if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
++ vma->vm_end - vma->vm_start, vma->vm_page_prot))
++ return -EAGAIN;
++ /* vm_ops.open won't be called for mmap itself. */
++ atomic_inc(&ofbi->map_count);
++ return 0;
++}
++
++/* Store a single color palette entry into a pseudo palette or the hardware
++ * palette if one is available. For now we support only 16bpp and thus store
++ * the entry only to the pseudo palette.
++ */
++static int _setcolreg(struct fb_info *fbi, u_int regno, u_int red, u_int green,
++ u_int blue, u_int transp, int update_hw_pal)
++{
++ /*struct omapfb_info *ofbi = FB2OFB(fbi);*/
++ /*struct omapfb2_device *fbdev = ofbi->fbdev;*/
++ struct fb_var_screeninfo *var = &fbi->var;
++ int r = 0;
++
++ enum omapfb_color_format mode = OMAPFB_COLOR_RGB24U; /* XXX */
++
++ /*switch (plane->color_mode) {*/
++ switch (mode) {
++ case OMAPFB_COLOR_YUV422:
++ case OMAPFB_COLOR_YUV420:
++ case OMAPFB_COLOR_YUY422:
++ r = -EINVAL;
++ break;
++ case OMAPFB_COLOR_CLUT_8BPP:
++ case OMAPFB_COLOR_CLUT_4BPP:
++ case OMAPFB_COLOR_CLUT_2BPP:
++ case OMAPFB_COLOR_CLUT_1BPP:
++ /*
++ if (fbdev->ctrl->setcolreg)
++ r = fbdev->ctrl->setcolreg(regno, red, green, blue,
++ transp, update_hw_pal);
++ */
++ /* Fallthrough */
++ r = -EINVAL;
++ break;
++ case OMAPFB_COLOR_RGB565:
++ case OMAPFB_COLOR_RGB444:
++ case OMAPFB_COLOR_RGB24P:
++ case OMAPFB_COLOR_RGB24U:
++ if (r != 0)
++ break;
++
++ if (regno < 0) {
++ r = -EINVAL;
++ break;
++ }
++
++ if (regno < 16) {
++ u16 pal;
++ pal = ((red >> (16 - var->red.length)) <<
++ var->red.offset) |
++ ((green >> (16 - var->green.length)) <<
++ var->green.offset) |
++ (blue >> (16 - var->blue.length));
++ ((u32 *)(fbi->pseudo_palette))[regno] = pal;
++ }
++ break;
++ default:
++ BUG();
++ }
++ return r;
++}
++
++static int omapfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
++ u_int transp, struct fb_info *info)
++{
++ DBG("setcolreg\n");
++
++ return _setcolreg(info, regno, red, green, blue, transp, 1);
++}
++
++static int omapfb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
++{
++ int count, index, r;
++ u16 *red, *green, *blue, *transp;
++ u16 trans = 0xffff;
++
++ DBG("setcmap\n");
++
++ red = cmap->red;
++ green = cmap->green;
++ blue = cmap->blue;
++ transp = cmap->transp;
++ index = cmap->start;
++
++ for (count = 0; count < cmap->len; count++) {
++ if (transp)
++ trans = *transp++;
++ r = _setcolreg(info, index++, *red++, *green++, *blue++, trans,
++ count == cmap->len - 1);
++ if (r != 0)
++ return r;
++ }
++
++ return 0;
++}
++
++static int omapfb_blank(int blank, struct fb_info *fbi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ int do_update = 0;
++ int r = 0;
++
++ omapfb_lock(fbdev);
++
++ switch (blank) {
++ case FB_BLANK_UNBLANK:
++ if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
++ goto exit;
++
++ if (display->resume)
++ r = display->resume(display);
++
++ if (r == 0 && display->get_update_mode &&
++ display->get_update_mode(display) ==
++ OMAP_DSS_UPDATE_MANUAL)
++ do_update = 1;
++
++ break;
++
++ case FB_BLANK_NORMAL:
++ /* FB_BLANK_NORMAL could be implemented.
++ * Needs DSS additions. */
++ case FB_BLANK_VSYNC_SUSPEND:
++ case FB_BLANK_HSYNC_SUSPEND:
++ case FB_BLANK_POWERDOWN:
++ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ goto exit;
++
++ if (display->suspend)
++ r = display->suspend(display);
++
++ break;
++
++ default:
++ r = -EINVAL;
++ }
++
++exit:
++ omapfb_unlock(fbdev);
++
++ if (r == 0 && do_update && display->update) {
++ u16 w, h;
++ display->get_resolution(display, &w, &h);
++
++ r = display->update(display, 0, 0, w, h);
++ }
++
++ return r;
++}
++
++#if 0
++/* XXX fb_read and fb_write are needed for VRFB */
++ssize_t omapfb_write(struct fb_info *info, const char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ DBG("omapfb_write %d, %lu\n", count, (unsigned long)*ppos);
++ // XXX needed for VRFB
++ return count;
++}
++#endif
++
++static struct fb_ops omapfb_ops = {
++ .owner = THIS_MODULE,
++ .fb_open = omapfb_open,
++ .fb_release = omapfb_release,
++ .fb_fillrect = cfb_fillrect,
++ .fb_copyarea = cfb_copyarea,
++ .fb_imageblit = cfb_imageblit,
++ .fb_blank = omapfb_blank,
++ .fb_ioctl = omapfb_ioctl,
++ .fb_check_var = omapfb_check_var,
++ .fb_set_par = omapfb_set_par,
++ .fb_pan_display = omapfb_pan_display,
++ .fb_mmap = omapfb_mmap,
++ .fb_setcolreg = omapfb_setcolreg,
++ .fb_setcmap = omapfb_setcmap,
++ //.fb_write = omapfb_write,
++};
++
++static void omapfb_free_fbmem(struct fb_info *fbi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omapfb2_mem_region *rg;
++
++ rg = &ofbi->region;
++
++ if (rg->paddr)
++ if (omap_vram_free(rg->paddr, rg->size))
++ dev_err(fbdev->dev, "VRAM FREE failed\n");
++
++ if (rg->vaddr)
++ iounmap(rg->vaddr);
++
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ /* unmap the 0 angle rotation */
++ if (rg->vrfb.vaddr[0]) {
++ iounmap(rg->vrfb.vaddr[0]);
++ omap_vrfb_release_ctx(&rg->vrfb);
++ }
++ }
++
++ rg->vaddr = NULL;
++ rg->paddr = 0;
++ rg->alloc = 0;
++ rg->size = 0;
++}
++
++static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev)
++{
++ int i;
++
++ DBG("free all fbmem\n");
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ struct fb_info *fbi = fbdev->fbs[i];
++ omapfb_free_fbmem(fbi);
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ }
++
++ return 0;
++}
++
++static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
++ unsigned long paddr)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omapfb2_mem_region *rg;
++ void __iomem *vaddr;
++ int r;
++ int clear = 0;
++
++ rg = &ofbi->region;
++ memset(rg, 0, sizeof(*rg));
++
++ size = PAGE_ALIGN(size);
++
++ if (!paddr) {
++ DBG("allocating %lu bytes for fb %d\n", size, ofbi->id);
++ r = omap_vram_alloc(OMAPFB_MEMTYPE_SDRAM, size, &paddr);
++ clear = 1;
++ } else {
++ DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr,
++ ofbi->id);
++ r = omap_vram_reserve(paddr, size);
++ }
++
++ if (r) {
++ dev_err(fbdev->dev, "failed to allocate framebuffer\n");
++ return -ENOMEM;
++ }
++
++ if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
++ vaddr = ioremap_wc(paddr, size);
++
++ if (!vaddr) {
++ dev_err(fbdev->dev, "failed to ioremap framebuffer\n");
++ omap_vram_free(paddr, size);
++ return -ENOMEM;
++ }
++
++ DBG("allocated VRAM paddr %lx, vaddr %p\n", paddr, vaddr);
++
++ if (clear)
++ memset_io(vaddr, 0, size);
++ } else {
++ void __iomem *va;
++
++ r = omap_vrfb_request_ctx(&rg->vrfb);
++ if (r) {
++ dev_err(fbdev->dev, "vrfb create ctx failed\n");
++ return r;
++ }
++
++ /* only ioremap the 0 angle view */
++ va = ioremap_wc(rg->vrfb.paddr[0], size);
++
++ if(!va) {
++ printk(KERN_ERR "vrfb: ioremap failed\n");
++ return -ENOMEM;
++ }
++
++ DBG("ioremapped vrfb area 0 to %p\n", va);
++
++ rg->vrfb.vaddr[0] = va;
++
++ vaddr = NULL;
++
++ if (clear)
++ memset_io(va, 0, size);
++ }
++
++ rg->paddr = paddr;
++ rg->vaddr = vaddr;
++ rg->size = size;
++ rg->alloc = 1;
++
++ return 0;
++}
++
++/* allocate fbmem using display resolution as reference */
++static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
++ unsigned long paddr)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omap_display *display;
++ int bytespp;
++
++ display = fb2display(fbi);
++
++ if (!display)
++ return 0;
++
++ switch (display->get_recommended_bpp(display)) {
++ case 16:
++ bytespp = 2;
++ break;
++ case 24:
++ bytespp = 4;
++ break;
++ default:
++ bytespp = 4;
++ break;
++ }
++
++ if (!size) {
++ u16 w, h;
++
++ display->get_resolution(display, &w, &h);
++
++ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ int oldw = w, oldh = h;
++
++ omap_vrfb_adjust_size(&w, &h, bytespp);
++
++ /* Because we change the resolution of the 0 degree view,
++ * we need to alloc max(w, h) for height */
++ h = max(w, h);
++ w = OMAP_VRFB_LINE_LEN;
++
++ DBG("adjusting fb mem size for VRFB, %dx%d -> %dx%d\n",
++ oldw, oldh, w, h);
++ }
++
++ size = w * h * bytespp;
++ }
++
++ return omapfb_alloc_fbmem(fbi, size, paddr);
++}
++
++static int omapfb_parse_vram_param(const char *param, int max_entries,
++ unsigned long *sizes, unsigned long *paddrs)
++{
++ int fbnum;
++ unsigned long size;
++ unsigned long paddr = 0;
++ char *p, *start;
++
++ start = (char *)param;
++
++ while (1) {
++ p = start;
++
++ fbnum = simple_strtoul(p, &p, 10);
++
++ if (p == param)
++ return -EINVAL;
++
++ if (*p != ':')
++ return -EINVAL;
++
++ if (fbnum >= max_entries)
++ return -EINVAL;
++
++ size = memparse(p + 1, &p);
++
++ if (!size)
++ return -EINVAL;
++
++ paddr = 0;
++
++ if (*p == '@') {
++ paddr = simple_strtoul(p + 1, &p, 16);
++
++ if (!paddr)
++ return -EINVAL;
++
++ }
++
++ paddrs[fbnum] = paddr;
++ sizes[fbnum] = size;
++
++ if (*p == 0)
++ break;
++
++ if (*p != ',')
++ return -EINVAL;
++
++ ++p;
++
++ start = p;
++ }
++
++ return 0;
++}
++
++static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev)
++{
++ int i, r;
++ unsigned long vram_sizes[10];
++ unsigned long vram_paddrs[10];
++
++ memset(&vram_sizes, 0, sizeof(vram_sizes));
++ memset(&vram_paddrs, 0, sizeof(vram_paddrs));
++
++ if (def_vram && omapfb_parse_vram_param(def_vram, 10,
++ vram_sizes, vram_paddrs)) {
++ dev_err(fbdev->dev, "failed to parse vram parameter\n");
++
++ memset(&vram_sizes, 0, sizeof(vram_sizes));
++ memset(&vram_paddrs, 0, sizeof(vram_paddrs));
++ }
++
++ if (fbdev->dev->platform_data) {
++ struct omapfb_platform_data *opd;
++ opd = fbdev->dev->platform_data;
++ for (i = 0; i < opd->mem_desc.region_cnt; ++i) {
++ if (!vram_sizes[i]) {
++ unsigned long size;
++ unsigned long paddr;
++
++ size = opd->mem_desc.region[i].size;
++ paddr = opd->mem_desc.region[i].paddr;
++
++ vram_sizes[i] = size;
++ vram_paddrs[i] = paddr;
++ }
++ }
++ }
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ /* allocate memory automatically only for fb0, or if
++ * excplicitly defined with vram or plat data option */
++ if (i == 0 || vram_sizes[i] != 0) {
++ r = omapfb_alloc_fbmem_display(fbdev->fbs[i],
++ vram_sizes[i], vram_paddrs[i]);
++
++ if (r)
++ return r;
++ }
++ }
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
++ struct omapfb2_mem_region *rg;
++ rg = &ofbi->region;
++
++ DBG("region%d phys %08x virt %p size=%lu\n",
++ i,
++ rg->paddr,
++ rg->vaddr,
++ rg->size);
++ }
++
++ return 0;
++}
++
++int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_display *display = fb2display(fbi);
++ struct omapfb2_mem_region *rg = &ofbi->region;
++ unsigned long old_size = rg->size;
++ unsigned long old_paddr = rg->paddr;
++ int old_type = rg->type;
++ int r;
++
++ if (type > OMAPFB_MEMTYPE_MAX)
++ return -EINVAL;
++
++ size = PAGE_ALIGN(size);
++
++ if (old_size == size && old_type == type)
++ return 0;
++
++ if (display && display->sync)
++ display->sync(display);
++
++ omapfb_free_fbmem(fbi);
++
++ if (size == 0) {
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ return 0;
++ }
++
++ r = omapfb_alloc_fbmem(fbi, size, 0);
++
++ if (r) {
++ if (old_size)
++ omapfb_alloc_fbmem(fbi, old_size, old_paddr);
++
++ if (rg->size == 0) {
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ }
++
++ return r;
++ }
++
++ if (old_size == size)
++ return 0;
++
++ if (old_size == 0) {
++ DBG("initializing fb %d\n", ofbi->id);
++ r = omapfb_fb_init(fbdev, fbi);
++ if (r) {
++ DBG("omapfb_fb_init failed\n");
++ goto err;
++ }
++ r = omapfb_apply_changes(fbi, 1);
++ if (r) {
++ DBG("omapfb_apply_changes failed\n");
++ goto err;
++ }
++ } else {
++ struct fb_var_screeninfo new_var;
++ memcpy(&new_var, &fbi->var, sizeof(new_var));
++ r = check_fb_var(fbi, &new_var);
++ if (r)
++ goto err;
++ memcpy(&fbi->var, &new_var, sizeof(fbi->var));
++ set_fb_fix(fbi);
++ }
++
++ return 0;
++err:
++ omapfb_free_fbmem(fbi);
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ return r;
++}
++
++/* initialize fb_info, var, fix to something sane based on the display */
++int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
++{
++ struct fb_var_screeninfo *var = &fbi->var;
++ struct fb_fix_screeninfo *fix = &fbi->fix;
++ struct omap_display *display = fb2display(fbi);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ int r = 0;
++
++ fbi->fbops = &omapfb_ops;
++ fbi->flags = FBINFO_FLAG_DEFAULT;
++ fbi->pseudo_palette = fbdev->pseudo_palette;
++
++ strncpy(fix->id, MODULE_NAME, sizeof(fix->id));
++
++ if (ofbi->region.size == 0) {
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ return 0;
++ }
++
++ var->nonstd = 0;
++
++ var->rotate = ofbi->rotation;
++
++ if (display) {
++ u16 w, h;
++ display->get_resolution(display, &w, &h);
++
++ if (ofbi->rotation == FB_ROTATE_CW ||
++ ofbi->rotation == FB_ROTATE_CCW) {
++ var->xres = h;
++ var->yres = w;
++ } else {
++ var->xres = w;
++ var->yres = h;
++ }
++
++ var->xres_virtual = var->xres;
++ var->yres_virtual = var->yres;
++
++ switch (display->get_recommended_bpp(display)) {
++ case 16:
++ var->bits_per_pixel = 16;
++ break;
++ case 24:
++ var->bits_per_pixel = 32;
++ break;
++ default:
++ dev_err(fbdev->dev, "illegal display bpp\n");
++ return -EINVAL;
++ }
++ } else {
++ /* if there's no display, let's just guess some basic values */
++ var->xres = 320;
++ var->yres = 240;
++ var->xres_virtual = var->xres;
++ var->yres_virtual = var->yres;
++ var->bits_per_pixel = 16;
++ }
++
++ r = check_fb_var(fbi, var);
++ if (r)
++ goto err;
++
++ set_fb_fix(fbi);
++err:
++ return r;
++}
++
++static void fbinfo_cleanup(struct omapfb2_device *fbdev, struct fb_info *fbi)
++{
++ fb_dealloc_cmap(&fbi->cmap);
++}
++
++
++static void omapfb_free_resources(struct omapfb2_device *fbdev)
++{
++ int i;
++
++ DBG("free_resources\n");
++
++ if (fbdev == NULL)
++ return;
++
++ for (i = 0; i < fbdev->num_fbs; i++)
++ unregister_framebuffer(fbdev->fbs[i]);
++
++ /* free the reserved fbmem */
++ omapfb_free_all_fbmem(fbdev);
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ fbinfo_cleanup(fbdev, fbdev->fbs[i]);
++ framebuffer_release(fbdev->fbs[i]);
++ }
++
++ for (i = 0; i < fbdev->num_displays; i++) {
++ if (fbdev->displays[i]->state != OMAP_DSS_DISPLAY_DISABLED)
++ fbdev->displays[i]->disable(fbdev->displays[i]);
++
++ omap_dss_put_display(fbdev->displays[i]);
++ }
++
++ dev_set_drvdata(fbdev->dev, NULL);
++ kfree(fbdev);
++}
++
++static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
++{
++ int r, i;
++
++ fbdev->num_fbs = 0;
++
++ DBG("create %d framebuffers\n", CONFIG_FB_OMAP2_NUM_FBS);
++
++ /* allocate fb_infos */
++ for (i = 0; i < CONFIG_FB_OMAP2_NUM_FBS; i++) {
++ struct fb_info *fbi;
++ struct omapfb_info *ofbi;
++
++ fbi = framebuffer_alloc(sizeof(struct omapfb_info),
++ fbdev->dev);
++
++ if (fbi == NULL) {
++ dev_err(fbdev->dev,
++ "unable to allocate memory for plane info\n");
++ return -ENOMEM;
++ }
++
++ fbdev->fbs[i] = fbi;
++
++ ofbi = FB2OFB(fbi);
++ ofbi->fbdev = fbdev;
++ ofbi->id = i;
++
++ /* assign these early, so that fb alloc can use them */
++ ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
++ OMAPFB_ROT_DMA;
++ ofbi->rotation = def_rotate;
++ ofbi->mirror = def_mirror;
++
++ fbdev->num_fbs++;
++ }
++
++ DBG("fb_infos allocated\n");
++
++ /* assign overlays for the fbs */
++ for (i = 0; i < min(fbdev->num_fbs, fbdev->num_overlays); i++) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
++
++ ofbi->overlays[0] = fbdev->overlays[i];
++ ofbi->num_overlays = 1;
++ }
++
++ /* allocate fb memories */
++ r = omapfb_allocate_all_fbs(fbdev);
++ if (r) {
++ dev_err(fbdev->dev, "failed to allocate fbmem\n");
++ return r;
++ }
++
++ DBG("fbmems allocated\n");
++
++ /* setup fb_infos */
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ r = omapfb_fb_init(fbdev, fbdev->fbs[i]);
++ if (r) {
++ dev_err(fbdev->dev, "failed to setup fb_info\n");
++ return r;
++ }
++ }
++
++ DBG("fb_infos initialized\n");
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ r = register_framebuffer(fbdev->fbs[i]);
++ if (r != 0) {
++ dev_err(fbdev->dev,
++ "registering framebuffer %d failed\n", i);
++ return r;
++ }
++ }
++
++ DBG("framebuffers registered\n");
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ r = omapfb_apply_changes(fbdev->fbs[i], 1);
++ if (r) {
++ dev_err(fbdev->dev, "failed to change mode\n");
++ return r;
++ }
++ }
++
++ DBG("create sysfs for fbs\n");
++ r = omapfb_create_sysfs(fbdev);
++ if (r) {
++ dev_err(fbdev->dev, "failed to create sysfs entries\n");
++ return r;
++ }
++
++ /* Enable fb0 */
++ if (fbdev->num_fbs > 0) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]);
++
++ if (ofbi->num_overlays > 0 ) {
++ struct omap_overlay *ovl = ofbi->overlays[0];
++
++ r = omapfb_overlay_enable(ovl, 1);
++
++ if (r) {
++ dev_err(fbdev->dev,
++ "failed to enable overlay\n");
++ return r;
++ }
++ }
++ }
++
++ DBG("create_framebuffers done\n");
++
++ return 0;
++}
++
++int omapfb_mode_to_timings(const char *mode_str,
++ struct omap_video_timings *timings, u8 *bpp)
++{
++ struct fb_info fbi;
++ struct fb_var_screeninfo var;
++ struct fb_ops fbops;
++ int r;
++
++#ifdef CONFIG_OMAP2_DSS_VENC
++ if (strcmp(mode_str, "pal") == 0) {
++ *timings = omap_dss_pal_timings;
++ *bpp = 0;
++ return 0;
++ } else if (strcmp(mode_str, "ntsc") == 0) {
++ *timings = omap_dss_ntsc_timings;
++ *bpp = 0;
++ return 0;
++ }
++#endif
++
++ /* this is quite a hack, but I wanted to use the modedb and for
++ * that we need fb_info and var, so we create dummy ones */
++
++ memset(&fbi, 0, sizeof(fbi));
++ memset(&var, 0, sizeof(var));
++ memset(&fbops, 0, sizeof(fbops));
++ fbi.fbops = &fbops;
++
++ r = fb_find_mode(&var, &fbi, mode_str, NULL, 0, NULL, 24);
++
++ if (r != 0) {
++ timings->pixel_clock = PICOS2KHZ(var.pixclock);
++ timings->hfp = var.left_margin;
++ timings->hbp = var.right_margin;
++ timings->vfp = var.upper_margin;
++ timings->vbp = var.lower_margin;
++ timings->hsw = var.hsync_len;
++ timings->vsw = var.vsync_len;
++ timings->x_res = var.xres;
++ timings->y_res = var.yres;
++
++ switch (var.bits_per_pixel) {
++ case 16:
++ *bpp = 16;
++ break;
++ case 24:
++ case 32:
++ default:
++ *bpp = 24;
++ break;
++ }
++
++ return 0;
++ } else {
++ return -EINVAL;
++ }
++}
++
++static int omapfb_set_def_mode(struct omap_display *display, char *mode_str)
++{
++ int r;
++ u8 bpp;
++ struct omap_video_timings timings;
++
++ r = omapfb_mode_to_timings(mode_str, &timings, &bpp);
++ if (r)
++ return r;
++
++ display->panel->recommended_bpp = bpp;
++
++ if (!display->check_timings || !display->set_timings)
++ return -EINVAL;
++
++ r = display->check_timings(display, &timings);
++ if (r)
++ return r;
++
++ display->set_timings(display, &timings);
++
++ return 0;
++}
++
++static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
++{
++ char *str, *options, *this_opt;
++ int r = 0;
++
++ str = kmalloc(strlen(def_mode) + 1, GFP_KERNEL);
++ strcpy(str, def_mode);
++ options = str;
++
++ while (!r && (this_opt = strsep(&options, ",")) != NULL) {
++ char *p, *display_str, *mode_str;
++ struct omap_display *display;
++ int i;
++
++ p = strchr(this_opt, ':');
++ if (!p) {
++ r = -EINVAL;
++ break;
++ }
++
++ *p = 0;
++ display_str = this_opt;
++ mode_str = p + 1;
++
++ display = NULL;
++ for (i = 0; i < fbdev->num_displays; ++i) {
++ if (strcmp(fbdev->displays[i]->name,
++ display_str) == 0) {
++ display = fbdev->displays[i];
++ break;
++ }
++ }
++
++ if (!display) {
++ r = -EINVAL;
++ break;
++ }
++
++ r = omapfb_set_def_mode(display, mode_str);
++ if (r)
++ break;
++ }
++
++ kfree(str);
++
++ return r;
++}
++
++static int omapfb_probe(struct platform_device *pdev)
++{
++ struct omapfb2_device *fbdev = NULL;
++ int r = 0;
++ int i, t;
++ struct omap_overlay *ovl;
++ struct omap_display *def_display;
++
++ DBG("omapfb_probe\n");
++
++ if (pdev->num_resources != 0) {
++ dev_err(&pdev->dev, "probed for an unknown device\n");
++ r = -ENODEV;
++ goto err0;
++ }
++
++ fbdev = kzalloc(sizeof(struct omapfb2_device), GFP_KERNEL);
++ if (fbdev == NULL) {
++ r = -ENOMEM;
++ goto err0;
++ }
++
++ mutex_init(&fbdev->mtx);
++
++ fbdev->dev = &pdev->dev;
++ platform_set_drvdata(pdev, fbdev);
++
++ fbdev->num_displays = 0;
++ t = omap_dss_get_num_displays();
++ for (i = 0; i < t; i++) {
++ struct omap_display *display;
++ display = omap_dss_get_display(i);
++ if (!display) {
++ dev_err(&pdev->dev, "can't get display %d\n", i);
++ r = -EINVAL;
++ goto cleanup;
++ }
++
++ fbdev->displays[fbdev->num_displays++] = display;
++ }
++
++ if (fbdev->num_displays == 0) {
++ dev_err(&pdev->dev, "no displays\n");
++ r = -EINVAL;
++ goto cleanup;
++ }
++
++ fbdev->num_overlays = omap_dss_get_num_overlays();
++ for (i = 0; i < fbdev->num_overlays; i++)
++ fbdev->overlays[i] = omap_dss_get_overlay(i);
++
++ fbdev->num_managers = omap_dss_get_num_overlay_managers();
++ for (i = 0; i < fbdev->num_managers; i++)
++ fbdev->managers[i] = omap_dss_get_overlay_manager(i);
++
++
++ /* gfx overlay should be the default one. find a display
++ * connected to that, and use it as default display */
++ ovl = omap_dss_get_overlay(0);
++ if (ovl->manager && ovl->manager->display) {
++ def_display = ovl->manager->display;
++ } else {
++ dev_err(&pdev->dev, "cannot find default display\n");
++ r = -EINVAL;
++ goto cleanup;
++ }
++
++ if (def_mode && strlen(def_mode) > 0) {
++ if (omapfb_parse_def_modes(fbdev))
++ dev_err(&pdev->dev, "cannot parse default modes\n");
++ }
++
++ r = omapfb_create_framebuffers(fbdev);
++ if (r)
++ goto cleanup;
++
++ for (i = 0; i < fbdev->num_managers; i++) {
++ struct omap_overlay_manager *mgr;
++ mgr = fbdev->managers[i];
++ r = mgr->apply(mgr);
++ if (r) {
++ dev_err(fbdev->dev, "failed to apply dispc config\n");
++ goto cleanup;
++ }
++ }
++
++ DBG("mgr->apply'ed\n");
++
++ r = def_display->enable(def_display);
++ if (r) {
++ dev_err(fbdev->dev, "Failed to enable display '%s'\n",
++ def_display->name);
++ goto cleanup;
++ }
++
++ /* set the update mode */
++ if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
++#ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_AUTO);
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 1);
++#else
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_MANUAL);
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 0);
++#endif
++ } else {
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_AUTO);
++ }
++
++ for (i = 0; i < fbdev->num_displays; i++) {
++ struct omap_display *display = fbdev->displays[i];
++ u16 w, h;
++
++ if (!display->get_update_mode || !display->update)
++ continue;
++
++ if (display->get_update_mode(display) ==
++ OMAP_DSS_UPDATE_MANUAL) {
++
++ display->get_resolution(display, &w, &h);
++ display->update(display, 0, 0, w, h);
++ }
++ }
++
++ DBG("display->updated\n");
++
++ return 0;
++
++cleanup:
++ omapfb_free_resources(fbdev);
++err0:
++ dev_err(&pdev->dev, "failed to setup omapfb\n");
++ return r;
++}
++
++static int omapfb_remove(struct platform_device *pdev)
++{
++ struct omapfb2_device *fbdev = platform_get_drvdata(pdev);
++
++ /* FIXME: wait till completion of pending events */
++
++ omapfb_remove_sysfs(fbdev);
++
++ omapfb_free_resources(fbdev);
++
++ return 0;
++}
++
++static struct platform_driver omapfb_driver = {
++ .probe = omapfb_probe,
++ .remove = omapfb_remove,
++ .driver = {
++ .name = "omapfb",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init omapfb_init(void)
++{
++ DBG("omapfb_init\n");
++
++ if (platform_driver_register(&omapfb_driver)) {
++ printk(KERN_ERR "failed to register omapfb driver\n");
++ return -ENODEV;
++ }
++
++ return 0;
++}
++
++static void __exit omapfb_exit(void)
++{
++ DBG("omapfb_exit\n");
++ platform_driver_unregister(&omapfb_driver);
++}
++
++module_param_named(mode, def_mode, charp, 0);
++module_param_named(vram, def_vram, charp, 0);
++module_param_named(rotate, def_rotate, int, 0);
++module_param_named(vrfb, def_vrfb, bool, 0);
++module_param_named(mirror, def_mirror, bool, 0);
++
++/* late_initcall to let panel/ctrl drivers loaded first.
++ * I guess better option would be a more dynamic approach,
++ * so that omapfb reacts to new panels when they are loaded */
++late_initcall(omapfb_init);
++/*module_init(omapfb_init);*/
++module_exit(omapfb_exit);
++
++MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
++MODULE_DESCRIPTION("OMAP2/3 Framebuffer");
++MODULE_LICENSE("GPL v2");
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+new file mode 100644
+index 0000000..2c88718
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -0,0 +1,371 @@
++/*
++ * linux/drivers/video/omap2/omapfb-sysfs.c
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/fb.h>
++#include <linux/sysfs.h>
++#include <linux/device.h>
++#include <linux/uaccess.h>
++#include <linux/platform_device.h>
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/omapfb.h>
++
++#include <mach/display.h>
++#include <mach/vrfb.h>
++
++#include "omapfb.h"
++
++static ssize_t show_rotate_type(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++
++ return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->rotation_type);
++}
++
++static ssize_t show_mirror(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++
++ return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->mirror);
++}
++
++static ssize_t store_mirror(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ bool mirror;
++ int r;
++ struct fb_var_screeninfo new_var;
++
++ mirror = simple_strtoul(buf, NULL, 0);
++
++ if (mirror != 0 && mirror != 1)
++ return -EINVAL;
++
++ omapfb_lock(fbdev);
++
++ ofbi->mirror = mirror;
++
++ memcpy(&new_var, &fbi->var, sizeof(new_var));
++ r = check_fb_var(fbi, &new_var);
++ if (r)
++ goto out;
++ memcpy(&fbi->var, &new_var, sizeof(fbi->var));
++
++ set_fb_fix(fbi);
++
++ r = omapfb_apply_changes(fbi, 0);
++ if (r)
++ goto out;
++
++ r = count;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static ssize_t show_overlays(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ ssize_t l = 0;
++ int t;
++
++ for (t = 0; t < ofbi->num_overlays; t++) {
++ struct omap_overlay *ovl = ofbi->overlays[t];
++ int ovlnum;
++
++ for (ovlnum = 0; ovlnum < fbdev->num_overlays; ++ovlnum)
++ if (ovl == fbdev->overlays[ovlnum])
++ break;
++
++ l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
++ t == 0 ? "" : ",", ovlnum);
++ }
++
++ l += snprintf(buf + l, PAGE_SIZE - l, "\n");
++
++ return l;
++}
++
++static struct omapfb_info *get_overlay_fb(struct omapfb2_device *fbdev,
++ struct omap_overlay *ovl)
++{
++ int i, t;
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
++
++ for (t = 0; t < ofbi->num_overlays; t++) {
++ if (ofbi->overlays[t] == ovl)
++ return ofbi;
++ }
++ }
++
++ return NULL;
++}
++
++static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ struct omap_overlay *ovls[OMAPFB_MAX_OVL_PER_FB];
++ struct omap_overlay *ovl;
++ int num_ovls, r, i;
++ int len;
++
++ num_ovls = 0;
++
++ len = strlen(buf);
++ if (buf[len - 1] == '\n')
++ len = len - 1;
++
++ omapfb_lock(fbdev);
++
++ if (len > 0) {
++ char *p = (char *)buf;
++ int ovlnum;
++
++ while (p < buf + len) {
++ int found;
++ if (num_ovls == OMAPFB_MAX_OVL_PER_FB) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ ovlnum = simple_strtoul(p, &p, 0);
++ if (ovlnum > fbdev->num_overlays) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ found = 0;
++ for (i = 0; i < num_ovls; ++i) {
++ if (ovls[i] == fbdev->overlays[ovlnum]) {
++ found = 1;
++ break;
++ }
++ }
++
++ if (!found)
++ ovls[num_ovls++] = fbdev->overlays[ovlnum];
++
++ p++;
++ }
++ }
++
++ for (i = 0; i < num_ovls; ++i) {
++ struct omapfb_info *ofbi2 = get_overlay_fb(fbdev, ovls[i]);
++ if (ofbi2 && ofbi2 != ofbi) {
++ dev_err(fbdev->dev, "overlay already in use\n");
++ r = -EINVAL;
++ goto out;
++ }
++ }
++
++ /* detach unused overlays */
++ for (i = 0; i < ofbi->num_overlays; ++i) {
++ int t, found;
++
++ ovl = ofbi->overlays[i];
++
++ found = 0;
++
++ for (t = 0; t < num_ovls; ++t) {
++ if (ovl == ovls[t]) {
++ found = 1;
++ break;
++ }
++ }
++
++ if (found)
++ continue;
++
++ DBG("detaching %d\n", ofbi->overlays[i]->id);
++
++ omapfb_overlay_enable(ovl, 0);
++
++ if (ovl->manager)
++ ovl->manager->apply(ovl->manager);
++
++ for (t = i + 1; t < ofbi->num_overlays; t++)
++ ofbi->overlays[t-1] = ofbi->overlays[t];
++
++ ofbi->num_overlays--;
++ i--;
++ }
++
++ for (i = 0; i < num_ovls; ++i) {
++ int t, found;
++
++ ovl = ovls[i];
++
++ found = 0;
++
++ for (t = 0; t < ofbi->num_overlays; ++t) {
++ if (ovl == ofbi->overlays[t]) {
++ found = 1;
++ break;
++ }
++ }
++
++ if (found)
++ continue;
++
++ ofbi->overlays[ofbi->num_overlays++] = ovl;
++
++ r = omapfb_apply_changes(fbi, 1);
++ if (r)
++ goto out;
++
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ goto out;
++ }
++ }
++
++ r = count;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static ssize_t show_size(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++
++ return snprintf(buf, PAGE_SIZE, "%lu\n", ofbi->region.size);
++}
++
++static ssize_t store_size(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ unsigned long size;
++ int r;
++ int i;
++
++ size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0));
++
++ omapfb_lock(fbdev);
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ofbi->overlays[i]->info.enabled) {
++ r = -EBUSY;
++ goto out;
++ }
++ }
++
++ if (size != ofbi->region.size) {
++ r = omapfb_realloc_fbmem(fbi, size, ofbi->region.type);
++ if (r) {
++ dev_err(dev, "realloc fbmem failed\n");
++ goto out;
++ }
++ }
++
++ r = count;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++static ssize_t show_phys(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++
++ return snprintf(buf, PAGE_SIZE, "%0x\n", ofbi->region.paddr);
++}
++
++static ssize_t show_virt(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++
++ return snprintf(buf, PAGE_SIZE, "%p\n", ofbi->region.vaddr);
++}
++
++static struct device_attribute omapfb_attrs[] = {
++ __ATTR(rotate_type, S_IRUGO, show_rotate_type, NULL),
++ __ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror),
++ __ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size),
++ __ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays),
++ __ATTR(phys_addr, S_IRUGO, show_phys, NULL),
++ __ATTR(virt_addr, S_IRUGO, show_virt, NULL),
++};
++
++int omapfb_create_sysfs(struct omapfb2_device *fbdev)
++{
++ int i;
++ int r;
++
++ DBG("create sysfs for fbs\n");
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ int t;
++ for (t = 0; t < ARRAY_SIZE(omapfb_attrs); t++) {
++ r = device_create_file(fbdev->fbs[i]->dev,
++ &omapfb_attrs[t]);
++
++ if (r) {
++ dev_err(fbdev->dev, "failed to create sysfs file\n");
++ return r;
++ }
++ }
++ }
++
++ return 0;
++}
++
++void omapfb_remove_sysfs(struct omapfb2_device *fbdev)
++{
++ int i, t;
++
++ DBG("remove sysfs for fbs\n");
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ for (t = 0; t < ARRAY_SIZE(omapfb_attrs); t++)
++ device_remove_file(fbdev->fbs[i]->dev,
++ &omapfb_attrs[t]);
++ }
++}
++
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+new file mode 100644
+index 0000000..65e9e6e
+--- /dev/null
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -0,0 +1,153 @@
++/*
++ * linux/drivers/video/omap2/omapfb.h
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
++ *
++ * Some code and ideas taken from drivers/video/omap/ driver
++ * by Imre Deak.
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef __DRIVERS_VIDEO_OMAP2_OMAPFB_H__
++#define __DRIVERS_VIDEO_OMAP2_OMAPFB_H__
++
++#ifdef CONFIG_FB_OMAP2_DEBUG_SUPPORT
++#define DEBUG
++#endif
++
++#ifdef DEBUG
++extern unsigned int omapfb_debug;
++#define DBG(format, ...) \
++ if (omapfb_debug) \
++ printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__)
++#else
++#define DBG(format, ...)
++#endif
++
++#define FB2OFB(fb_info) ((struct omapfb_info *)(fb_info->par))
++
++/* max number of overlays to which a framebuffer data can be direct */
++#define OMAPFB_MAX_OVL_PER_FB 3
++
++struct omapfb2_mem_region {
++ u32 paddr;
++ void __iomem *vaddr;
++ struct vrfb vrfb;
++ unsigned long size;
++ u8 type; /* OMAPFB_PLANE_MEM_* */
++ bool alloc; /* allocated by the driver */
++ bool map; /* kernel mapped by the driver */
++};
++
++enum omapfb_rotation_type {
++ OMAPFB_ROT_DMA = 0,
++ OMAPFB_ROT_VRFB = 1,
++};
++
++/* appended to fb_info */
++struct omapfb_info {
++ int id;
++ struct omapfb2_mem_region region;
++ atomic_t map_count;
++ int num_overlays;
++ struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
++ struct omapfb2_device *fbdev;
++ enum omapfb_rotation_type rotation_type;
++ u8 rotation;
++ bool mirror;
++};
++
++struct omapfb2_device {
++ struct device *dev;
++ struct mutex mtx;
++
++ u32 pseudo_palette[17];
++
++ int state;
++
++ unsigned num_fbs;
++ struct fb_info *fbs[10];
++
++ unsigned num_displays;
++ struct omap_display *displays[10];
++ unsigned num_overlays;
++ struct omap_overlay *overlays[10];
++ unsigned num_managers;
++ struct omap_overlay_manager *managers[10];
++};
++
++struct omapfb_colormode {
++ enum omap_color_mode dssmode;
++ u32 bits_per_pixel;
++ u32 nonstd;
++ struct fb_bitfield red;
++ struct fb_bitfield green;
++ struct fb_bitfield blue;
++ struct fb_bitfield transp;
++};
++
++u32 omapfb_get_region_paddr(struct omapfb_info *ofbi);
++void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi);
++
++void set_fb_fix(struct fb_info *fbi);
++int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var);
++int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type);
++int omapfb_apply_changes(struct fb_info *fbi, int init);
++int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi);
++
++int omapfb_create_sysfs(struct omapfb2_device *fbdev);
++void omapfb_remove_sysfs(struct omapfb2_device *fbdev);
++
++int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg);
++
++int omapfb_mode_to_timings(const char *mode_str,
++ struct omap_video_timings *timings, u8 *bpp);
++
++/* find the display connected to this fb, if any */
++static inline struct omap_display *fb2display(struct fb_info *fbi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ int i;
++
++ /* XXX: returns the display connected to first attached overlay */
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ofbi->overlays[i]->manager)
++ return ofbi->overlays[i]->manager->display;
++ }
++
++ return NULL;
++}
++
++static inline void omapfb_lock(struct omapfb2_device *fbdev)
++{
++ mutex_lock(&fbdev->mtx);
++}
++
++static inline void omapfb_unlock(struct omapfb2_device *fbdev)
++{
++ mutex_unlock(&fbdev->mtx);
++}
++
++static inline int omapfb_overlay_enable(struct omap_overlay *ovl,
++ int enable)
++{
++ struct omap_overlay_info info;
++
++ ovl->get_overlay_info(ovl, &info);
++ info.enabled = enable;
++ return ovl->set_overlay_info(ovl, &info);
++}
++
++#endif
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index b226bdf..96190b2 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -50,6 +50,8 @@
+ #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
+ #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
+ #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
++#define OMAPFB_WAITFORVSYNC OMAP_IO(57)
++#define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
+
+ #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+ #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+@@ -90,6 +92,13 @@ enum omapfb_color_format {
+ OMAPFB_COLOR_CLUT_1BPP,
+ OMAPFB_COLOR_RGB444,
+ OMAPFB_COLOR_YUY422,
++
++ OMAPFB_COLOR_ARGB16,
++ OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */
++ OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */
++ OMAPFB_COLOR_ARGB32,
++ OMAPFB_COLOR_RGBA32,
++ OMAPFB_COLOR_RGBX32,
+ };
+
+ struct omapfb_update_window {
+@@ -161,6 +170,15 @@ enum omapfb_update_mode {
+ OMAPFB_MANUAL_UPDATE
+ };
+
++struct omapfb_memory_read {
++ __u16 x;
++ __u16 y;
++ __u16 w;
++ __u16 h;
++ size_t buffer_size;
++ void __user *buffer;
++};
++
+ #ifdef __KERNEL__
+
+ #include <linux/completion.h>
+@@ -376,6 +394,8 @@ extern struct lcd_ctrl omap1_lcd_ctrl;
+ extern struct lcd_ctrl omap2_disp_ctrl;
+ #endif
+
++extern void omapfb_set_platform_data(struct omapfb_platform_data *data);
++
+ extern void omapfb_reserve_sdram(void);
+ extern void omapfb_register_panel(struct lcd_panel *panel);
+ extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0004-DSS2-Add-panel-drivers.patch b/recipes/linux/linux-omap-pm/dss2/0004-DSS2-Add-panel-drivers.patch
new file mode 100644
index 0000000000..47b52269aa
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0004-DSS2-Add-panel-drivers.patch
@@ -0,0 +1,396 @@
+From 7764c7b96f5c101584226238b799cb89bca80749 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 10:29:56 +0300
+Subject: [PATCH 004/146] DSS2: Add panel drivers
+
+- Generic panel
+- Samsung LTE430WQ-F0C LCD Panel
+- Sharp LS037V7DW01 LCD Panel
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/displays/Kconfig | 21 ++++
+ drivers/video/omap2/displays/Makefile | 3 +
+ drivers/video/omap2/displays/panel-generic.c | 96 +++++++++++++++++
+ .../omap2/displays/panel-samsung-lte430wq-f0c.c | 108 +++++++++++++++++++
+ .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 112 ++++++++++++++++++++
+ 5 files changed, 340 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/video/omap2/displays/Kconfig
+ create mode 100644 drivers/video/omap2/displays/Makefile
+ create mode 100644 drivers/video/omap2/displays/panel-generic.c
+ create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
+ create mode 100644 drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+
+diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
+new file mode 100644
+index 0000000..0419ec8
+--- /dev/null
++++ b/drivers/video/omap2/displays/Kconfig
+@@ -0,0 +1,21 @@
++menu "OMAP2/3 Display Device Drivers"
++ depends on OMAP2_DSS
++
++config PANEL_GENERIC
++ tristate "Generic Panel"
++ help
++ Generic panel driver.
++ Used for DVI output for Beagle and OMAP3 SDP.
++
++config PANEL_SAMSUNG_LTE430WQ_F0C
++ tristate "Samsung LTE430WQ-F0C LCD Panel"
++ depends on OMAP2_DSS
++ help
++ LCD Panel used on Overo Palo43
++
++config PANEL_SHARP_LS037V7DW01
++ tristate "Sharp LS037V7DW01 LCD Panel"
++ depends on OMAP2_DSS
++ help
++ LCD Panel used in TI's SDP3430 and EVM boards
++endmenu
+diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
+new file mode 100644
+index 0000000..a26bbd2
+--- /dev/null
++++ b/drivers/video/omap2/displays/Makefile
+@@ -0,0 +1,3 @@
++obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
++obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
++obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
+diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
+new file mode 100644
+index 0000000..8382acb
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-generic.c
+@@ -0,0 +1,96 @@
++/*
++ * Generic panel support
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++
++#include <mach/display.h>
++
++static int generic_panel_init(struct omap_display *display)
++{
++ return 0;
++}
++
++static int generic_panel_enable(struct omap_display *display)
++{
++ int r = 0;
++
++ if (display->hw_config.panel_enable)
++ r = display->hw_config.panel_enable(display);
++
++ return r;
++}
++
++static void generic_panel_disable(struct omap_display *display)
++{
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++}
++
++static int generic_panel_suspend(struct omap_display *display)
++{
++ generic_panel_disable(display);
++ return 0;
++}
++
++static int generic_panel_resume(struct omap_display *display)
++{
++ return generic_panel_enable(display);
++}
++
++static struct omap_panel generic_panel = {
++ .owner = THIS_MODULE,
++ .name = "panel-generic",
++ .init = generic_panel_init,
++ .enable = generic_panel_enable,
++ .disable = generic_panel_disable,
++ .suspend = generic_panel_suspend,
++ .resume = generic_panel_resume,
++
++ .timings = {
++ /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
++ .x_res = 640,
++ .y_res = 480,
++ .pixel_clock = 23500,
++ .hfp = 48,
++ .hsw = 32,
++ .hbp = 80,
++ .vfp = 3,
++ .vsw = 4,
++ .vbp = 7,
++ },
++
++ .config = OMAP_DSS_LCD_TFT,
++};
++
++
++static int __init generic_panel_drv_init(void)
++{
++ omap_dss_register_panel(&generic_panel);
++ return 0;
++}
++
++static void __exit generic_panel_drv_exit(void)
++{
++ omap_dss_unregister_panel(&generic_panel);
++}
++
++module_init(generic_panel_drv_init);
++module_exit(generic_panel_drv_exit);
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
+new file mode 100644
+index 0000000..e4bb781
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
+@@ -0,0 +1,108 @@
++/*
++ * LCD panel driver for Samsung LTE430WQ-F0C
++ *
++ * Author: Steve Sakoman <steve@sakoman.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++
++#include <mach/display.h>
++
++static int samsung_lte_panel_init(struct omap_display *display)
++{
++ return 0;
++}
++
++static void samsung_lte_panel_cleanup(struct omap_display *display)
++{
++}
++
++static int samsung_lte_panel_enable(struct omap_display *display)
++{
++ int r = 0;
++
++ /* wait couple of vsyncs until enabling the LCD */
++ msleep(50);
++
++ if (display->hw_config.panel_enable)
++ r = display->hw_config.panel_enable(display);
++
++ return r;
++}
++
++static void samsung_lte_panel_disable(struct omap_display *display)
++{
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++
++ /* wait at least 5 vsyncs after disabling the LCD */
++ msleep(100);
++}
++
++static int samsung_lte_panel_suspend(struct omap_display *display)
++{
++ samsung_lte_panel_disable(display);
++ return 0;
++}
++
++static int samsung_lte_panel_resume(struct omap_display *display)
++{
++ return samsung_lte_panel_enable(display);
++}
++
++static struct omap_panel samsung_lte_panel = {
++ .owner = THIS_MODULE,
++ .name = "samsung-lte430wq-f0c",
++ .init = samsung_lte_panel_init,
++ .cleanup = samsung_lte_panel_cleanup,
++ .enable = samsung_lte_panel_enable,
++ .disable = samsung_lte_panel_disable,
++ .suspend = samsung_lte_panel_suspend,
++ .resume = samsung_lte_panel_resume,
++
++ .timings = {
++ .x_res = 480,
++ .y_res = 272,
++
++ .pixel_clock = 9200,
++
++ .hsw = 41,
++ .hfp = 8,
++ .hbp = 45-41,
++
++ .vsw = 10,
++ .vfp = 4,
++ .vbp = 12-10,
++ },
++
++ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS,
++};
++
++
++static int __init samsung_lte_panel_drv_init(void)
++{
++ omap_dss_register_panel(&samsung_lte_panel);
++ return 0;
++}
++
++static void __exit samsung_lte_panel_drv_exit(void)
++{
++ omap_dss_unregister_panel(&samsung_lte_panel);
++}
++
++module_init(samsung_lte_panel_drv_init);
++module_exit(samsung_lte_panel_drv_exit);
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+new file mode 100644
+index 0000000..1f99150
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+@@ -0,0 +1,112 @@
++/*
++ * LCD panel driver for Sharp LS037V7DW01
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++
++#include <mach/display.h>
++
++static int sharp_ls_panel_init(struct omap_display *display)
++{
++ return 0;
++}
++
++static void sharp_ls_panel_cleanup(struct omap_display *display)
++{
++}
++
++static int sharp_ls_panel_enable(struct omap_display *display)
++{
++ int r = 0;
++
++ /* wait couple of vsyncs until enabling the LCD */
++ msleep(50);
++
++ if (display->hw_config.panel_enable)
++ r = display->hw_config.panel_enable(display);
++
++ return r;
++}
++
++static void sharp_ls_panel_disable(struct omap_display *display)
++{
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++
++ /* wait at least 5 vsyncs after disabling the LCD */
++
++ msleep(100);
++}
++
++static int sharp_ls_panel_suspend(struct omap_display *display)
++{
++ sharp_ls_panel_disable(display);
++ return 0;
++}
++
++static int sharp_ls_panel_resume(struct omap_display *display)
++{
++ return sharp_ls_panel_enable(display);
++}
++
++static struct omap_panel sharp_ls_panel = {
++ .owner = THIS_MODULE,
++ .name = "sharp-ls037v7dw01",
++ .init = sharp_ls_panel_init,
++ .cleanup = sharp_ls_panel_cleanup,
++ .enable = sharp_ls_panel_enable,
++ .disable = sharp_ls_panel_disable,
++ .suspend = sharp_ls_panel_suspend,
++ .resume = sharp_ls_panel_resume,
++
++ .timings = {
++ .x_res = 480,
++ .y_res = 640,
++
++ .pixel_clock = 19200,
++
++ .hsw = 2,
++ .hfp = 1,
++ .hbp = 28,
++
++ .vsw = 1,
++ .vfp = 1,
++ .vbp = 1,
++ },
++
++ .acb = 0x28,
++
++ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
++};
++
++
++static int __init sharp_ls_panel_drv_init(void)
++{
++ omap_dss_register_panel(&sharp_ls_panel);
++ return 0;
++}
++
++static void __exit sharp_ls_panel_drv_exit(void)
++{
++ omap_dss_unregister_panel(&sharp_ls_panel);
++}
++
++module_init(sharp_ls_panel_drv_init);
++module_exit(sharp_ls_panel_drv_exit);
++MODULE_LICENSE("GPL");
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0005-DSS2-HACK-Add-DSS2-support-for-N800.patch b/recipes/linux/linux-omap-pm/dss2/0005-DSS2-HACK-Add-DSS2-support-for-N800.patch
new file mode 100644
index 0000000000..5dd90a4f22
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0005-DSS2-HACK-Add-DSS2-support-for-N800.patch
@@ -0,0 +1,1079 @@
+From 0fb0c230f94ff7e513db42dae9765c0b86234de8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 10:31:57 +0300
+Subject: [PATCH 005/146] DSS2: HACK: Add DSS2 support for N800
+
+Works, but it an ugly quick hack.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/mach-omap2/board-n800.c | 216 +++++++++++---
+ drivers/video/omap2/displays/Kconfig | 10 +
+ drivers/video/omap2/displays/Makefile | 3 +
+ drivers/video/omap2/displays/ctrl-blizzard.c | 279 +++++++++++++++++
+ drivers/video/omap2/displays/panel-n800.c | 435 ++++++++++++++++++++++++++
+ 5 files changed, 905 insertions(+), 38 deletions(-)
+ create mode 100644 drivers/video/omap2/displays/ctrl-blizzard.c
+ create mode 100644 drivers/video/omap2/displays/panel-n800.c
+
+diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
+index e2907ac..3f1071b 100644
+--- a/arch/arm/mach-omap2/board-n800.c
++++ b/arch/arm/mach-omap2/board-n800.c
+@@ -38,6 +38,8 @@
+ #include <mach/blizzard.h>
+ #include <mach/onenand.h>
+ #include <mach/board-nokia.h>
++#include <mach/display.h>
++#include <mach/vram.h>
+
+ #include <../drivers/cbus/tahvo.h>
+ #include <../drivers/media/video/tcm825x.h>
+@@ -98,23 +100,176 @@ static struct omap_uart_config n800_uart_config __initdata = {
+
+ #include "../../../drivers/cbus/retu.h"
+
+-static struct omap_fbmem_config n800_fbmem0_config __initdata = {
+- .size = 752 * 1024,
++static struct omap_tmp105_config n800_tmp105_config __initdata = {
++ .tmp105_irq_pin = 125,
++ .set_power = n800_tmp105_set_power,
+ };
+
+-static struct omap_fbmem_config n800_fbmem1_config __initdata = {
+- .size = 752 * 1024,
+-};
+
+-static struct omap_fbmem_config n800_fbmem2_config __initdata = {
+- .size = 752 * 1024,
++
++
++/* DISPLAY */
++static struct {
++ struct clk *sys_ck;
++} blizzard;
++
++static int blizzard_get_clocks(void)
++{
++ blizzard.sys_ck = clk_get(0, "osc_ck");
++ if (IS_ERR(blizzard.sys_ck)) {
++ printk(KERN_ERR "can't get Blizzard clock\n");
++ return PTR_ERR(blizzard.sys_ck);
++ }
++ return 0;
++}
++
++static unsigned long blizzard_get_clock_rate(void)
++{
++ return clk_get_rate(blizzard.sys_ck);
++}
++
++static int n800_pn800_enable(struct omap_display *display)
++{
++ if (display->hw_config.panel_reset_gpio != -1) {
++ printk("enabling panel gpio\n");
++ gpio_direction_output(display->hw_config.panel_reset_gpio, 1);
++ }
++
++ return 0;
++}
++
++static void n800_pn800_disable(struct omap_display *display)
++{
++ if (display->hw_config.panel_reset_gpio != -1) {
++ printk("disabling panel gpio\n");
++ gpio_direction_output(display->hw_config.panel_reset_gpio, 0);
++ msleep(120);
++ }
++}
++
++static int n800_blizzard_enable(struct omap_display *display)
++{
++ printk("enabling bliz powers\n");
++
++ /* Vcore to 1.475V */
++ tahvo_set_clear_reg_bits(0x07, 0, 0xf);
++ msleep(10);
++
++ clk_enable(blizzard.sys_ck);
++
++ if (display->hw_config.ctrl_reset_gpio != -1)
++ gpio_direction_output(display->hw_config.ctrl_reset_gpio, 1);
++
++ printk("osc_ck %lu\n", blizzard_get_clock_rate());
++
++ return 0;
++}
++
++static void n800_blizzard_disable(struct omap_display *display)
++{
++ printk("disabling bliz powers\n");
++
++ if (display->hw_config.ctrl_reset_gpio != -1)
++ gpio_direction_output(display->hw_config.ctrl_reset_gpio, 0);
++
++ clk_disable(blizzard.sys_ck);
++
++ /* Vcore to 1.005V */
++ tahvo_set_clear_reg_bits(0x07, 0xf, 0);
++}
++
++static int n800_set_backlight_level(struct omap_display *display, int level)
++{
++ return 0;
++}
++
++static struct omap_dss_display_config n800_dsi_display_data = {
++ .type = OMAP_DISPLAY_TYPE_DBI,
++ .name = "lcd",
++ .ctrl_name = "ctrl-blizzard",
++ .panel_name = "panel-pn800",
++ .panel_reset_gpio = -1,
++ .ctrl_reset_gpio = N800_BLIZZARD_POWERDOWN_GPIO,
++ .panel_enable = n800_pn800_enable,
++ .panel_disable = n800_pn800_disable,
++ .ctrl_enable = n800_blizzard_enable,
++ .ctrl_disable = n800_blizzard_disable,
++ .set_backlight = n800_set_backlight_level,
++ .u.rfbi = {
++ .channel = 0,
++ /* 8 for cmd mode, 16 for pixel data. ctrl-blizzard handles switching */
++ .data_lines = 8,
++ },
++ .panel_data = 0, // XXX used for panel datalines
++};
++static struct omap_dss_board_info n800_dss_data = {
++ .num_displays = 1,
++ .displays = {
++ &n800_dsi_display_data,
++ },
+ };
+
+-static struct omap_tmp105_config n800_tmp105_config __initdata = {
+- .tmp105_irq_pin = 125,
+- .set_power = n800_tmp105_set_power,
++static struct platform_device n800_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &n800_dss_data,
++ },
+ };
+
++static void __init n800_display_init(void)
++{
++ int r;
++ const struct omap_lcd_config *conf;
++
++ conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
++ if (conf != NULL) {
++ n800_dsi_display_data.panel_reset_gpio = conf->nreset_gpio;
++ n800_dsi_display_data.panel_data =
++ (void*)(u32)conf->data_lines; // XXX
++ //printk("\n\nTULI %d\n\n", conf->data_lines);
++ } else {
++ printk("\n\nEI TULLU MIOTÄÄÄ\n\n");
++ }
++
++ blizzard_get_clocks();
++ clk_enable(blizzard.sys_ck); // XXX always enable
++
++ //omapfb_set_ctrl_platform_data(&n800_blizzard_data);
++ //
++ if (n800_dsi_display_data.ctrl_reset_gpio != -1) {
++ r = gpio_request(n800_dsi_display_data.ctrl_reset_gpio,
++ "Blizzard pd");
++ if (r < 0) {
++ n800_dsi_display_data.ctrl_reset_gpio = -1;
++ printk(KERN_ERR "Unable to get Blizzard GPIO\n");
++ } else {
++ gpio_direction_output(n800_dsi_display_data.ctrl_reset_gpio,
++ 1);
++ // XXX always enable
++ }
++ }
++
++ if (n800_dsi_display_data.panel_reset_gpio != -1) {
++ r = gpio_request(n800_dsi_display_data.panel_reset_gpio,
++ "panel reset");
++ if (r < 0) {
++ n800_dsi_display_data.panel_reset_gpio = -1;
++ printk(KERN_ERR "Unable to get pn800 GPIO\n");
++ } else {
++ gpio_direction_output(n800_dsi_display_data.panel_reset_gpio,
++ 1);
++ // XXX always enable
++ }
++ }
++}
++
++/* DISPLAY END */
++
++
++
++
++
+ static void mipid_shutdown(struct mipid_platform_data *pdata)
+ {
+ if (pdata->nreset_gpio != -1) {
+@@ -128,6 +283,7 @@ static struct mipid_platform_data n800_mipid_platform_data = {
+ .shutdown = mipid_shutdown,
+ };
+
++#if 0
+ static void __init mipid_dev_init(void)
+ {
+ const struct omap_lcd_config *conf;
+@@ -138,26 +294,9 @@ static void __init mipid_dev_init(void)
+ n800_mipid_platform_data.data_lines = conf->data_lines;
+ }
+ }
++#endif
+
+-static struct {
+- struct clk *sys_ck;
+-} blizzard;
+-
+-static int blizzard_get_clocks(void)
+-{
+- blizzard.sys_ck = clk_get(0, "osc_ck");
+- if (IS_ERR(blizzard.sys_ck)) {
+- printk(KERN_ERR "can't get Blizzard clock\n");
+- return PTR_ERR(blizzard.sys_ck);
+- }
+- return 0;
+-}
+-
+-static unsigned long blizzard_get_clock_rate(struct device *dev)
+-{
+- return clk_get_rate(blizzard.sys_ck);
+-}
+-
++#if 0
+ static void blizzard_enable_clocks(int enable)
+ {
+ if (enable)
+@@ -202,14 +341,12 @@ static void __init blizzard_dev_init(void)
+ gpio_direction_output(N800_BLIZZARD_POWERDOWN_GPIO, 1);
+
+ blizzard_get_clocks();
+- omapfb_set_ctrl_platform_data(&n800_blizzard_data);
++ //omapfb_set_ctrl_platform_data(&n800_blizzard_data);
+ }
++#endif
+
+ static struct omap_board_config_kernel n800_config[] __initdata = {
+ { OMAP_TAG_UART, &n800_uart_config },
+- { OMAP_TAG_FBMEM, &n800_fbmem0_config },
+- { OMAP_TAG_FBMEM, &n800_fbmem1_config },
+- { OMAP_TAG_FBMEM, &n800_fbmem2_config },
+ { OMAP_TAG_TMP105, &n800_tmp105_config },
+ };
+
+@@ -257,7 +394,7 @@ static struct omap2_mcspi_device_config cx3110x_mcspi_config = {
+
+ static struct spi_board_info n800_spi_board_info[] __initdata = {
+ {
+- .modalias = "lcd_mipid",
++ .modalias = "panel-n800",
+ .bus_num = 1,
+ .chip_select = 1,
+ .max_speed_hz = 4000000,
+@@ -281,7 +418,7 @@ static struct spi_board_info n800_spi_board_info[] __initdata = {
+
+ static struct spi_board_info n810_spi_board_info[] __initdata = {
+ {
+- .modalias = "lcd_mipid",
++ .modalias = "panel-n800",
+ .bus_num = 1,
+ .chip_select = 1,
+ .max_speed_hz = 4000000,
+@@ -390,6 +527,7 @@ static struct platform_device *n800_devices[] __initdata = {
+ #if defined(CONFIG_CBUS_RETU_HEADSET)
+ &retu_headset_device,
+ #endif
++ &n800_dss_device,
+ };
+
+ #ifdef CONFIG_MENELAUS
+@@ -554,9 +692,10 @@ void __init nokia_n800_common_init(void)
+ if (machine_is_nokia_n810())
+ i2c_register_board_info(2, n810_i2c_board_info_2,
+ ARRAY_SIZE(n810_i2c_board_info_2));
+-
+- mipid_dev_init();
+- blizzard_dev_init();
++
++ //mipid_dev_init();
++ //blizzard_dev_init();
++ n800_display_init();
+ board_onenand_init();
+ }
+
+@@ -575,6 +714,7 @@ void __init nokia_n800_map_io(void)
+ omap_board_config_size = ARRAY_SIZE(n800_config);
+
+ omap2_set_globals_242x();
++ omap2_set_sdram_vram(800 * 480 * 2 * 3, 0);
+ omap2_map_common_io();
+ }
+
+diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
+index 0419ec8..356ceb1 100644
+--- a/drivers/video/omap2/displays/Kconfig
++++ b/drivers/video/omap2/displays/Kconfig
+@@ -18,4 +18,14 @@ config PANEL_SHARP_LS037V7DW01
+ depends on OMAP2_DSS
+ help
+ LCD Panel used in TI's SDP3430 and EVM boards
++
++config PANEL_N800
++ tristate "Panel N8x0"
++ help
++ N8x0 LCD (hack)
++
++config CTRL_BLIZZARD
++ tristate "Blizzard Controller"
++ help
++ Blizzard Controller (hack)
+ endmenu
+diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
+index a26bbd2..1b74b7e 100644
+--- a/drivers/video/omap2/displays/Makefile
++++ b/drivers/video/omap2/displays/Makefile
+@@ -1,3 +1,6 @@
+ obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
+ obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
+ obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
++
++obj-$(CONFIG_CTRL_BLIZZARD) += ctrl-blizzard.o
++obj-$(CONFIG_PANEL_N800) += panel-n800.o
+diff --git a/drivers/video/omap2/displays/ctrl-blizzard.c b/drivers/video/omap2/displays/ctrl-blizzard.c
+new file mode 100644
+index 0000000..6698e4d
+--- /dev/null
++++ b/drivers/video/omap2/displays/ctrl-blizzard.c
+@@ -0,0 +1,279 @@
++
++//#define DEBUG
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/clk.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++
++#include <mach/display.h>
++#include <mach/dma.h>
++
++#ifdef DEBUG
++#define DBG(format, ...) printk(KERN_DEBUG "Blizzard: " format, ## __VA_ARGS__)
++#else
++#define DBG(format, ...)
++#endif
++
++#define BLIZZARD_REV_CODE 0x00
++#define BLIZZARD_CONFIG 0x02
++#define BLIZZARD_PLL_DIV 0x04
++#define BLIZZARD_PLL_LOCK_RANGE 0x06
++#define BLIZZARD_PLL_CLOCK_SYNTH_0 0x08
++#define BLIZZARD_PLL_CLOCK_SYNTH_1 0x0a
++#define BLIZZARD_PLL_MODE 0x0c
++#define BLIZZARD_CLK_SRC 0x0e
++#define BLIZZARD_MEM_BANK0_ACTIVATE 0x10
++#define BLIZZARD_MEM_BANK0_STATUS 0x14
++#define BLIZZARD_PANEL_CONFIGURATION 0x28
++#define BLIZZARD_HDISP 0x2a
++#define BLIZZARD_HNDP 0x2c
++#define BLIZZARD_VDISP0 0x2e
++#define BLIZZARD_VDISP1 0x30
++#define BLIZZARD_VNDP 0x32
++#define BLIZZARD_HSW 0x34
++#define BLIZZARD_VSW 0x38
++#define BLIZZARD_DISPLAY_MODE 0x68
++#define BLIZZARD_INPUT_WIN_X_START_0 0x6c
++#define BLIZZARD_DATA_SOURCE_SELECT 0x8e
++#define BLIZZARD_DISP_MEM_DATA_PORT 0x90
++#define BLIZZARD_DISP_MEM_READ_ADDR0 0x92
++#define BLIZZARD_POWER_SAVE 0xE6
++#define BLIZZARD_NDISP_CTRL_STATUS 0xE8
++
++/* Data source select */
++/* For S1D13745 */
++#define BLIZZARD_SRC_WRITE_LCD_BACKGROUND 0x00
++#define BLIZZARD_SRC_WRITE_LCD_DESTRUCTIVE 0x01
++#define BLIZZARD_SRC_WRITE_OVERLAY_ENABLE 0x04
++#define BLIZZARD_SRC_DISABLE_OVERLAY 0x05
++/* For S1D13744 */
++#define BLIZZARD_SRC_WRITE_LCD 0x00
++#define BLIZZARD_SRC_BLT_LCD 0x06
++
++#define BLIZZARD_COLOR_RGB565 0x01
++#define BLIZZARD_COLOR_YUV420 0x09
++
++#define BLIZZARD_VERSION_S1D13745 0x01 /* Hailstorm */
++#define BLIZZARD_VERSION_S1D13744 0x02 /* Blizzard */
++
++#define BLIZZARD_AUTO_UPDATE_TIME (HZ / 20)
++
++
++
++static struct {
++ int version;
++} blizzard;
++
++
++static inline void blizzard_cmd(u8 cmd)
++{
++ omap_rfbi_write_command(&cmd, 1);
++}
++
++static inline void blizzard_write(u8 cmd, const u8 *buf, int len)
++{
++ omap_rfbi_write_command(&cmd, 1);
++ omap_rfbi_write_data(buf, len);
++}
++
++static inline void blizzard_read(u8 cmd, u8 *buf, int len)
++{
++ omap_rfbi_write_command(&cmd, 1);
++ omap_rfbi_read_data(buf, len);
++}
++
++static u8 blizzard_read_reg(u8 cmd)
++{
++ u8 data;
++ blizzard_read(cmd, &data, 1);
++ return data;
++}
++
++static int blizzard_ctrl_init(struct omap_display *display)
++{
++ DBG("blizzard_ctrl_init\n");
++
++ return 0;
++}
++
++
++static int blizzard_ctrl_enable(struct omap_display *display)
++{
++ int r = 0;
++ u8 rev, conf;
++
++ DBG("blizzard_ctrl_enable\n");
++
++ if (display->hw_config.ctrl_enable) {
++ r = display->hw_config.ctrl_enable(display);
++ if (r)
++ return r;
++ }
++
++ msleep(100);
++
++ rev = blizzard_read_reg(BLIZZARD_CLK_SRC);
++ printk("CLK_SRC %x\n", rev);
++
++ rev = blizzard_read_reg(BLIZZARD_PLL_DIV);
++ printk("PLLDIV %x\n", rev);
++
++ rev = blizzard_read_reg(BLIZZARD_REV_CODE);
++ conf = blizzard_read_reg(BLIZZARD_CONFIG);
++
++ printk("rev %x, conf %x\n", rev, conf);
++
++ switch (rev & 0xfc) {
++ case 0x9c:
++ blizzard.version = BLIZZARD_VERSION_S1D13744;
++ pr_info("omapfb: s1d13744 LCD controller rev %d "
++ "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
++ break;
++ case 0xa4:
++ blizzard.version = BLIZZARD_VERSION_S1D13745;
++ pr_info("omapfb: s1d13745 LCD controller rev %d "
++ "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
++ break;
++ default:
++ printk("invalid s1d1374x revision %02x\n",
++ rev);
++ r = -ENODEV;
++ }
++
++ return r;
++}
++
++static void blizzard_ctrl_disable(struct omap_display *display)
++{
++ DBG("blizzard_ctrl_disable\n");
++
++ if (display->hw_config.ctrl_disable)
++ display->hw_config.ctrl_disable(display);
++}
++
++int rfbi_configure(int rfbi_module, int bpp, int lines);
++
++static void blizzard_ctrl_setup_update(struct omap_display *display,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ u8 tmp[18];
++ int x_end, y_end;
++
++ DBG("blizzard_ctrl_setup_update\n");
++
++ x_end = x + w - 1;
++ y_end = y + h - 1;
++
++ tmp[0] = x;
++ tmp[1] = x >> 8;
++ tmp[2] = y;
++ tmp[3] = y >> 8;
++ tmp[4] = x_end;
++ tmp[5] = x_end >> 8;
++ tmp[6] = y_end;
++ tmp[7] = y_end >> 8;
++
++ /* scaling? */
++ tmp[8] = x;
++ tmp[9] = x >> 8;
++ tmp[10] = y;
++ tmp[11] = y >> 8;
++ tmp[12] = x_end;
++ tmp[13] = x_end >> 8;
++ tmp[14] = y_end;
++ tmp[15] = y_end >> 8;
++
++ tmp[16] = BLIZZARD_COLOR_RGB565; //color_mode;
++
++ if (blizzard.version == BLIZZARD_VERSION_S1D13745)
++ tmp[17] = BLIZZARD_SRC_WRITE_LCD_BACKGROUND;
++ else
++ tmp[17] = blizzard.version == BLIZZARD_VERSION_S1D13744 ?
++ BLIZZARD_SRC_WRITE_LCD :
++ BLIZZARD_SRC_WRITE_LCD_DESTRUCTIVE;
++
++ rfbi_configure(display->hw_config.u.rfbi.channel,
++ 16,
++ 8);
++
++ blizzard_write(BLIZZARD_INPUT_WIN_X_START_0, tmp, 18);
++
++ rfbi_configure(display->hw_config.u.rfbi.channel,
++ 16,
++ 16);
++}
++
++static int blizzard_ctrl_enable_te(struct omap_display *display, bool enable)
++{
++ return 0;
++}
++
++static int blizzard_ctrl_rotate(struct omap_display *display, u8 rotate)
++{
++ return 0;
++}
++
++static int blizzard_ctrl_mirror(struct omap_display *display, bool enable)
++{
++ return 0;
++}
++
++static int blizzard_run_test(struct omap_display *display, int test_num)
++{
++ return 0;
++}
++
++static struct omap_ctrl blizzard_ctrl = {
++ .owner = THIS_MODULE,
++ .name = "ctrl-blizzard",
++ .init = blizzard_ctrl_init,
++ .enable = blizzard_ctrl_enable,
++ .disable = blizzard_ctrl_disable,
++ .setup_update = blizzard_ctrl_setup_update,
++ .enable_te = blizzard_ctrl_enable_te,
++ .set_rotate = blizzard_ctrl_rotate,
++ .set_mirror = blizzard_ctrl_mirror,
++ .run_test = blizzard_run_test,
++ .pixel_size = 16,
++
++ .timings = {
++ .cs_on_time = 0,
++
++ .we_on_time = 9000,
++ .we_off_time = 18000,
++ .we_cycle_time = 36000,
++
++ .re_on_time = 9000,
++ .re_off_time = 27000,
++ .re_cycle_time = 36000,
++
++ .access_time = 27000,
++ .cs_off_time = 36000,
++
++ .cs_pulse_width = 0,
++ },
++};
++
++
++static int __init blizzard_init(void)
++{
++ DBG("blizzard_init\n");
++ omap_dss_register_ctrl(&blizzard_ctrl);
++ return 0;
++}
++
++static void __exit blizzard_exit(void)
++{
++ DBG("blizzard_exit\n");
++
++ omap_dss_unregister_ctrl(&blizzard_ctrl);
++}
++
++module_init(blizzard_init);
++module_exit(blizzard_exit);
++
++MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
++MODULE_DESCRIPTION("Blizzard Driver");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/omap2/displays/panel-n800.c b/drivers/video/omap2/displays/panel-n800.c
+new file mode 100644
+index 0000000..91d3e37
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-n800.c
+@@ -0,0 +1,435 @@
++
++/*#define DEBUG*/
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/spi/spi.h>
++#include <linux/jiffies.h>
++#include <linux/sched.h>
++#include <linux/backlight.h>
++#include <linux/fb.h>
++
++#include <mach/display.h>
++#include <mach/dma.h>
++
++#define MIPID_CMD_READ_DISP_ID 0x04
++#define MIPID_CMD_READ_RED 0x06
++#define MIPID_CMD_READ_GREEN 0x07
++#define MIPID_CMD_READ_BLUE 0x08
++#define MIPID_CMD_READ_DISP_STATUS 0x09
++#define MIPID_CMD_RDDSDR 0x0F
++#define MIPID_CMD_SLEEP_IN 0x10
++#define MIPID_CMD_SLEEP_OUT 0x11
++#define MIPID_CMD_DISP_OFF 0x28
++#define MIPID_CMD_DISP_ON 0x29
++
++#define MIPID_VER_LPH8923 3
++#define MIPID_VER_LS041Y3 4
++
++#define MIPID_ESD_CHECK_PERIOD msecs_to_jiffies(5000)
++
++#ifdef DEBUG
++#define DBG(format, ...) printk(KERN_DEBUG "PN800: " format, ## __VA_ARGS__)
++#else
++#define DBG(format, ...)
++#endif
++
++struct pn800_device {
++ struct backlight_device *bl_dev;
++ int enabled;
++ int model;
++ int revision;
++ u8 display_id[3];
++ unsigned int saved_bklight_level;
++ unsigned long hw_guard_end; /* next value of jiffies
++ when we can issue the
++ next sleep in/out command */
++ unsigned long hw_guard_wait; /* max guard time in jiffies */
++
++ struct spi_device *spi;
++ struct mutex mutex;
++ struct omap_panel panel;
++ struct omap_display *display;
++};
++
++
++static void pn800_transfer(struct pn800_device *md, int cmd,
++ const u8 *wbuf, int wlen, u8 *rbuf, int rlen)
++{
++ struct spi_message m;
++ struct spi_transfer *x, xfer[4];
++ u16 w;
++ int r;
++
++ BUG_ON(md->spi == NULL);
++
++ spi_message_init(&m);
++
++ memset(xfer, 0, sizeof(xfer));
++ x = &xfer[0];
++
++ cmd &= 0xff;
++ x->tx_buf = &cmd;
++ x->bits_per_word = 9;
++ x->len = 2;
++ spi_message_add_tail(x, &m);
++
++ if (wlen) {
++ x++;
++ x->tx_buf = wbuf;
++ x->len = wlen;
++ x->bits_per_word = 9;
++ spi_message_add_tail(x, &m);
++ }
++
++ if (rlen) {
++ x++;
++ x->rx_buf = &w;
++ x->len = 1;
++ spi_message_add_tail(x, &m);
++
++ if (rlen > 1) {
++ /* Arrange for the extra clock before the first
++ * data bit.
++ */
++ x->bits_per_word = 9;
++ x->len = 2;
++
++ x++;
++ x->rx_buf = &rbuf[1];
++ x->len = rlen - 1;
++ spi_message_add_tail(x, &m);
++ }
++ }
++
++ r = spi_sync(md->spi, &m);
++ if (r < 0)
++ dev_dbg(&md->spi->dev, "spi_sync %d\n", r);
++
++ if (rlen)
++ rbuf[0] = w & 0xff;
++}
++
++static inline void pn800_cmd(struct pn800_device *md, int cmd)
++{
++ pn800_transfer(md, cmd, NULL, 0, NULL, 0);
++}
++
++static inline void pn800_write(struct pn800_device *md,
++ int reg, const u8 *buf, int len)
++{
++ pn800_transfer(md, reg, buf, len, NULL, 0);
++}
++
++static inline void pn800_read(struct pn800_device *md,
++ int reg, u8 *buf, int len)
++{
++ pn800_transfer(md, reg, NULL, 0, buf, len);
++}
++
++static void set_data_lines(struct pn800_device *md, int data_lines)
++{
++ u16 par;
++
++ switch (data_lines) {
++ case 16:
++ par = 0x150;
++ break;
++ case 18:
++ par = 0x160;
++ break;
++ case 24:
++ par = 0x170;
++ break;
++ }
++ pn800_write(md, 0x3a, (u8 *)&par, 2);
++}
++
++static void send_init_string(struct pn800_device *md)
++{
++ u16 initpar[] = { 0x0102, 0x0100, 0x0100 };
++ int data_lines;
++
++ pn800_write(md, 0xc2, (u8 *)initpar, sizeof(initpar));
++
++ data_lines = (int)md->display->hw_config.panel_data; // XXX
++
++ set_data_lines(md, data_lines);
++}
++
++static void hw_guard_start(struct pn800_device *md, int guard_msec)
++{
++ md->hw_guard_wait = msecs_to_jiffies(guard_msec);
++ md->hw_guard_end = jiffies + md->hw_guard_wait;
++}
++
++static void hw_guard_wait(struct pn800_device *md)
++{
++ unsigned long wait = md->hw_guard_end - jiffies;
++
++ if ((long)wait > 0 && wait <= md->hw_guard_wait) {
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ schedule_timeout(wait);
++ }
++}
++
++static void set_sleep_mode(struct pn800_device *md, int on)
++{
++ int cmd, sleep_time = 50;
++
++ if (on)
++ cmd = MIPID_CMD_SLEEP_IN;
++ else
++ cmd = MIPID_CMD_SLEEP_OUT;
++ hw_guard_wait(md);
++ pn800_cmd(md, cmd);
++ hw_guard_start(md, 120);
++ /*
++ * When we enable the panel, it seems we _have_ to sleep
++ * 120 ms before sending the init string. When disabling the
++ * panel we'll sleep for the duration of 2 frames, so that the
++ * controller can still provide the PCLK,HS,VS signals. */
++ if (!on)
++ sleep_time = 120;
++ msleep(sleep_time);
++}
++
++static void set_display_state(struct pn800_device *md, int enabled)
++{
++ int cmd = enabled ? MIPID_CMD_DISP_ON : MIPID_CMD_DISP_OFF;
++
++ pn800_cmd(md, cmd);
++}
++
++static int panel_enabled(struct pn800_device *md)
++{
++ u32 disp_status;
++ int enabled;
++
++ pn800_read(md, MIPID_CMD_READ_DISP_STATUS, (u8 *)&disp_status, 4);
++ disp_status = __be32_to_cpu(disp_status);
++ enabled = (disp_status & (1 << 17)) && (disp_status & (1 << 10));
++ dev_dbg(&md->spi->dev,
++ "LCD panel %s enabled by bootloader (status 0x%04x)\n",
++ enabled ? "" : "not ", disp_status);
++ DBG("status %#08x\n", disp_status);
++ return enabled;
++}
++
++static int panel_detect(struct pn800_device *md)
++{
++ pn800_read(md, MIPID_CMD_READ_DISP_ID, md->display_id, 3);
++ dev_dbg(&md->spi->dev, "MIPI display ID: %02x%02x%02x\n",
++ md->display_id[0], md->display_id[1], md->display_id[2]);
++
++ switch (md->display_id[0]) {
++ case 0x45:
++ md->model = MIPID_VER_LPH8923;
++ md->panel.name = "lph8923";
++ break;
++ case 0x83:
++ md->model = MIPID_VER_LS041Y3;
++ md->panel.name = "ls041y3";
++ //md->esd_check = ls041y3_esd_check;
++ break;
++ default:
++ md->panel.name = "unknown";
++ dev_err(&md->spi->dev, "invalid display ID\n");
++ return -ENODEV;
++ }
++
++ md->revision = md->display_id[1];
++ pr_info("omapfb: %s rev %02x LCD detected\n",
++ md->panel.name, md->revision);
++
++ return 0;
++}
++
++
++
++static int pn800_panel_enable(struct omap_display *display)
++{
++ int r;
++ struct pn800_device *md =
++ (struct pn800_device *)display->panel->priv;
++
++ DBG("pn800_panel_enable\n");
++
++ mutex_lock(&md->mutex);
++
++ if (display->hw_config.panel_enable)
++ display->hw_config.panel_enable(display);
++
++ msleep(50); // wait for power up
++
++ r = panel_detect(md);
++ if (r) {
++ mutex_unlock(&md->mutex);
++ return r;
++ }
++
++ md->enabled = panel_enabled(md);
++
++ if (md->enabled) {
++ DBG("panel already enabled\n");
++ ; /*pn800_esd_start_check(md);*/
++ } else {
++ ; /*md->saved_bklight_level = pn800_get_bklight_level(panel);*/
++ }
++
++
++ if (md->enabled) {
++ mutex_unlock(&md->mutex);
++ return 0;
++ }
++
++ set_sleep_mode(md, 0);
++ md->enabled = 1;
++ send_init_string(md);
++ set_display_state(md, 1);
++ //mipid_set_bklight_level(panel, md->saved_bklight_level);
++ //mipid_esd_start_check(md);
++
++ mutex_unlock(&md->mutex);
++ return 0;
++}
++
++static void pn800_panel_disable(struct omap_display *display)
++{
++ struct pn800_device *md =
++ (struct pn800_device *)display->panel->priv;
++
++ DBG("pn800_panel_disable\n");
++
++ mutex_lock(&md->mutex);
++
++ if (!md->enabled) {
++ mutex_unlock(&md->mutex);
++ return;
++ }
++ /*md->saved_bklight_level = pn800_get_bklight_level(panel);*/
++ /*pn800_set_bklight_level(panel, 0);*/
++
++ set_display_state(md, 0);
++ set_sleep_mode(md, 1);
++ md->enabled = 0;
++
++
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++
++ mutex_unlock(&md->mutex);
++}
++
++static int pn800_panel_init(struct omap_display *display)
++{
++ struct pn800_device *md =
++ (struct pn800_device *)display->panel->priv;
++
++ DBG("pn800_panel_init\n");
++
++ mutex_init(&md->mutex);
++ md->display = display;
++
++ return 0;
++}
++
++static int pn800_run_test(struct omap_display *display, int test_num)
++{
++ return 0;
++}
++
++static struct omap_panel pn800_panel = {
++ .owner = THIS_MODULE,
++ .name = "panel-pn800",
++ .init = pn800_panel_init,
++ /*.remove = pn800_cleanup,*/
++ .enable = pn800_panel_enable,
++ .disable = pn800_panel_disable,
++ //.set_mode = pn800_set_mode,
++ .run_test = pn800_run_test,
++
++ .timings = {
++ .x_res = 800,
++ .y_res = 480,
++
++ .pixel_clock = 21940,
++ .hsw = 50,
++ .hfp = 20,
++ .hbp = 15,
++
++ .vsw = 2,
++ .vfp = 1,
++ .vbp = 3,
++ },
++ .config = OMAP_DSS_LCD_TFT,
++};
++
++static int pn800_spi_probe(struct spi_device *spi)
++{
++ struct pn800_device *md;
++
++ DBG("pn800_spi_probe\n");
++
++ md = kzalloc(sizeof(*md), GFP_KERNEL);
++ if (md == NULL) {
++ dev_err(&spi->dev, "out of memory\n");
++ return -ENOMEM;
++ }
++
++ spi->mode = SPI_MODE_0;
++ md->spi = spi;
++ dev_set_drvdata(&spi->dev, md);
++ md->panel = pn800_panel;
++ pn800_panel.priv = md;
++
++ omap_dss_register_panel(&pn800_panel);
++
++ return 0;
++}
++
++static int pn800_spi_remove(struct spi_device *spi)
++{
++ struct pn800_device *md = dev_get_drvdata(&spi->dev);
++
++ DBG("pn800_spi_remove\n");
++
++ omap_dss_unregister_panel(&pn800_panel);
++
++ /*pn800_disable(&md->panel);*/
++ kfree(md);
++
++ return 0;
++}
++
++static struct spi_driver pn800_spi_driver = {
++ .driver = {
++ .name = "panel-n800",
++ .bus = &spi_bus_type,
++ .owner = THIS_MODULE,
++ },
++ .probe = pn800_spi_probe,
++ .remove = __devexit_p(pn800_spi_remove),
++};
++
++static int __init pn800_init(void)
++{
++ DBG("pn800_init\n");
++ return spi_register_driver(&pn800_spi_driver);
++}
++
++static void __exit pn800_exit(void)
++{
++ DBG("pn800_exit\n");
++ spi_unregister_driver(&pn800_spi_driver);
++}
++
++module_init(pn800_init);
++module_exit(pn800_exit);
++
++MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
++MODULE_DESCRIPTION("N800 LCD Driver");
++MODULE_LICENSE("GPL");
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0006-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch b/recipes/linux/linux-omap-pm/dss2/0006-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
new file mode 100644
index 0000000000..6073d22d20
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0006-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
@@ -0,0 +1,5703 @@
+From 9b34ebb747ba53f9c0c90c21764dbc1e1d967ad3 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 10:36:05 +0300
+Subject: [PATCH 006/146] DSS2: Add DSS2 support for SDP, Beagle, Overo, EVM
+
+Also custom dss_*_defconfigs as an example.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/configs/dss_omap3_beagle_defconfig | 1371 ++++++++++++++++++++
+ arch/arm/configs/dss_omap_3430sdp_defconfig | 1634 +++++++++++++++++++++++
+ arch/arm/configs/dss_overo_defconfig | 1862 +++++++++++++++++++++++++++
+ arch/arm/mach-omap2/board-3430sdp.c | 227 ++++-
+ arch/arm/mach-omap2/board-omap3beagle.c | 91 ++-
+ arch/arm/mach-omap2/board-omap3evm.c | 217 +++-
+ arch/arm/mach-omap2/board-overo.c | 98 ++-
+ 7 files changed, 5475 insertions(+), 25 deletions(-)
+ create mode 100644 arch/arm/configs/dss_omap3_beagle_defconfig
+ create mode 100644 arch/arm/configs/dss_omap_3430sdp_defconfig
+ create mode 100644 arch/arm/configs/dss_overo_defconfig
+
+diff --git a/arch/arm/configs/dss_omap3_beagle_defconfig b/arch/arm/configs/dss_omap3_beagle_defconfig
+new file mode 100644
+index 0000000..7143168
+--- /dev/null
++++ b/arch/arm/configs/dss_omap3_beagle_defconfig
+@@ -0,0 +1,1371 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.29-omap1
++# Thu Apr 2 11:24:09 2009
++#
++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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++
++#
++# General setup
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++CONFIG_LOCALVERSION=""
++CONFIG_LOCALVERSION_AUTO=y
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++CONFIG_BSD_PROCESS_ACCT=y
++# CONFIG_BSD_PROCESS_ACCT_V3 is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=14
++CONFIG_GROUP_SCHED=y
++CONFIG_FAIR_GROUP_SCHED=y
++# CONFIG_RT_GROUP_SCHED is not set
++CONFIG_USER_SCHED=y
++# CONFIG_CGROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++# CONFIG_NAMESPACES is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++CONFIG_EMBEDDED=y
++CONFIG_UID16=y
++# CONFIG_SYSCTL_SYSCALL is not set
++CONFIG_KALLSYMS=y
++# CONFIG_KALLSYMS_ALL is not set
++CONFIG_KALLSYMS_EXTRA_PASS=y
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_SLOB is not set
++# CONFIG_PROFILING is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_CLK=y
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++# CONFIG_MODULE_FORCE_UNLOAD is not set
++CONFIG_MODVERSIONS=y
++CONFIG_MODULE_SRCVERSION_ALL=y
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY 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"
++# CONFIG_FREEZER is not set
++
++#
++# 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_CLPS711X 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_DAVINCI is not set
++CONFIG_ARCH_OMAP=y
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# TI OMAP Implementations
++#
++CONFIG_ARCH_OMAP_OTG=y
++# CONFIG_ARCH_OMAP1 is not set
++# CONFIG_ARCH_OMAP2 is not set
++CONFIG_ARCH_OMAP3=y
++
++#
++# OMAP Feature Selections
++#
++# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
++# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
++# CONFIG_OMAP_SMARTREFLEX is not set
++# CONFIG_OMAP_RESET_CLOCKS is not set
++CONFIG_OMAP_BOOT_TAG=y
++CONFIG_OMAP_BOOT_REASON=y
++# CONFIG_OMAP_COMPONENT_VERSION is not set
++# CONFIG_OMAP_GPIO_SWITCH is not set
++# CONFIG_OMAP_MUX is not set
++# CONFIG_OMAP_MCBSP is not set
++# CONFIG_OMAP_MBOX_FWK is not set
++# CONFIG_OMAP_MPU_TIMER is not set
++CONFIG_OMAP_32K_TIMER=y
++CONFIG_OMAP_32K_TIMER_HZ=128
++CONFIG_OMAP_TICK_GPTIMER=12
++CONFIG_OMAP_DM_TIMER=y
++# CONFIG_OMAP_LL_DEBUG_UART1 is not set
++# CONFIG_OMAP_LL_DEBUG_UART2 is not set
++CONFIG_OMAP_LL_DEBUG_UART3=y
++CONFIG_ARCH_OMAP34XX=y
++CONFIG_ARCH_OMAP3430=y
++
++#
++# OMAP Board Type
++#
++# CONFIG_MACH_NOKIA_RX51 is not set
++# CONFIG_MACH_OMAP_LDP is not set
++# CONFIG_MACH_OMAP_3430SDP is not set
++# CONFIG_MACH_OMAP3EVM is not set
++CONFIG_MACH_OMAP3_BEAGLE=y
++# CONFIG_MACH_OVERO is not set
++# CONFIG_MACH_OMAP3_PANDORA is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_32v6K=y
++CONFIG_CPU_V7=y
++CONFIG_CPU_32v7=y
++CONFIG_CPU_ABRT_EV7=y
++CONFIG_CPU_PABRT_IFAR=y
++CONFIG_CPU_CACHE_V7=y
++CONFIG_CPU_CACHE_VIPT=y
++CONFIG_CPU_COPY_V6=y
++CONFIG_CPU_TLB_V7=y
++CONFIG_CPU_HAS_ASID=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_ARM_THUMBEE is not set
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_BPREDICT_DISABLE is not set
++CONFIG_HAS_TLS_REG=y
++# CONFIG_OUTER_CACHE is not set
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++# CONFIG_PREEMPT is not set
++CONFIG_HZ=128
++CONFIG_AEABI=y
++CONFIG_OABI_COMPAT=y
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++# CONFIG_LEDS is not set
++CONFIG_ALIGNMENT_TRAP=y
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.2.14:/tftpboot/rootfs ip=192.168.2.15 nolock,rsize=1024,wsize=1024 rw"
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_FREQ is not set
++# CONFIG_CPU_IDLE 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
++CONFIG_VFP=y
++CONFIG_VFPv3=y
++# CONFIG_NEON is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++CONFIG_BINFMT_MISC=y
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++# CONFIG_SUSPEND is not set
++# CONFIG_APM_EMULATION is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_COMPAT_NET_DEV_OPS=y
++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_XFRM_STATISTICS is not set
++CONFIG_NET_KEY=y
++# CONFIG_NET_KEY_MIGRATE 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=y
++# 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_LRO is not set
++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_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_NET_DSA 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
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++# CONFIG_AF_RXRPC is not set
++# CONFIG_PHONET is not set
++CONFIG_WIRELESS=y
++# CONFIG_CFG80211 is not set
++CONFIG_WIRELESS_OLD_REGULATORY=y
++# CONFIG_WIRELESS_EXT is not set
++# CONFIG_LIB80211 is not set
++# CONFIG_MAC80211 is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++# CONFIG_FW_LOADER is not set
++# CONFIG_DEBUG_DRIVER is not set
++# CONFIG_DEBUG_DEVRES is not set
++# 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_TESTS is not set
++# CONFIG_MTD_REDBOOT_PARTS is not set
++# CONFIG_MTD_CMDLINE_PARTS is not set
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS 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
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS 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_GPIO is not set
++CONFIG_MTD_NAND_OMAP2=y
++CONFIG_MTD_NAND_IDS=y
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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_RAM=y
++CONFIG_BLK_DEV_RAM_COUNT=16
++CONFIG_BLK_DEV_RAM_SIZE=16384
++# CONFIG_BLK_DEV_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MISC_DEVICES is not set
++CONFIG_HAVE_IDE=y
++# 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_SRP_ATTRS is not set
++CONFIG_SCSI_LOWLEVEL=y
++# CONFIG_ISCSI_TCP is not set
++# CONFIG_LIBFC is not set
++# CONFIG_SCSI_DEBUG is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++# 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_VETH is not set
++# CONFIG_NET_ETHERNET 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
++# CONFIG_IWLWIFI_LEDS is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++# CONFIG_WAN is not set
++# CONFIG_PPP is not set
++# CONFIG_SLIP 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 is not set
++# CONFIG_INPUT_JOYDEV is not set
++# CONFIG_INPUT_EVDEV is not set
++# 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_TABLET is not set
++# CONFIG_INPUT_TOUCHSCREEN is not set
++# 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_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++CONFIG_DEVKMEM=y
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_NR_UARTS=32
++CONFIG_SERIAL_8250_RUNTIME_UARTS=4
++CONFIG_SERIAL_8250_EXTENDED=y
++CONFIG_SERIAL_8250_MANY_PORTS=y
++CONFIG_SERIAL_8250_SHARE_IRQ=y
++CONFIG_SERIAL_8250_DETECT_IRQ=y
++CONFIG_SERIAL_8250_RSA=y
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++CONFIG_HW_RANDOM=y
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_HELPER_AUTO=y
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++CONFIG_I2C_OMAP=y
++# CONFIG_I2C_SIMTEC is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_PCA_PLATFORM is not set
++# CONFIG_I2C_STUB is not set
++
++#
++# Miscellaneous I2C Chip support
++#
++# CONFIG_DS1682 is not set
++# CONFIG_SENSORS_PCF8574 is not set
++# CONFIG_PCF8575 is not set
++# CONFIG_SENSORS_PCA9539 is not set
++# CONFIG_SENSORS_PCF8591 is not set
++# CONFIG_TWL4030_MADC is not set
++# CONFIG_TWL4030_POWEROFF 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
++# CONFIG_SPI is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++# CONFIG_DEBUG_GPIO is not set
++# CONFIG_GPIO_SYSFS is not set
++
++#
++# Memory mapped GPIO expanders:
++#
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++CONFIG_GPIO_TWL4030=y
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_W1 is not set
++# CONFIG_POWER_SUPPLY is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++# CONFIG_WATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_TPS65010 is not set
++CONFIG_TWL4030_CORE=y
++# CONFIG_TWL4030_POWER is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_PCF50633 is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++# CONFIG_VIDEO_DEV is not set
++# CONFIG_DVB_CORE is not set
++# CONFIG_VIDEO_MEDIA is not set
++
++#
++# Multimedia drivers
++#
++CONFIG_DAB=y
++
++#
++# Graphics support
++#
++# 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_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=m
++CONFIG_FB_CFB_COPYAREA=m
++CONFIG_FB_CFB_IMAGEBLIT=m
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# 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_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
++CONFIG_OMAP2_DSS=m
++CONFIG_OMAP2_DSS_VRAM_SIZE=12
++CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
++# CONFIG_OMAP2_DSS_RFBI is not set
++CONFIG_OMAP2_DSS_VENC=y
++# CONFIG_OMAP2_DSS_SDI is not set
++# CONFIG_OMAP2_DSS_DSI is not set
++# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
++CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
++
++#
++# OMAP2/3 Display Device Drivers
++#
++CONFIG_PANEL_GENERIC=m
++# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
++# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
++# CONFIG_PANEL_N800 is not set
++# CONFIG_CTRL_BLIZZARD is not set
++CONFIG_FB_OMAP2=m
++CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
++# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
++CONFIG_FB_OMAP2_NUM_FBS=3
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT is not set
++
++#
++# Console display driver support
++#
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_DUMMY_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE is not set
++# CONFIG_LOGO is not set
++# CONFIG_SOUND is not set
++# CONFIG_HID_SUPPORT is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++CONFIG_USB_ARCH_HAS_EHCI=y
++# CONFIG_USB is not set
++# CONFIG_USB_OTG_WHITELIST is not set
++# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_MUSB_HDRC=y
++CONFIG_USB_MUSB_SOC=y
++
++#
++# OMAP 343x high speed USB support
++#
++# CONFIG_USB_MUSB_HOST is not set
++CONFIG_USB_MUSB_PERIPHERAL=y
++# CONFIG_USB_MUSB_OTG is not set
++CONFIG_USB_GADGET_MUSB_HDRC=y
++# CONFIG_MUSB_PIO_ONLY is not set
++CONFIG_USB_INVENTRA_DMA=y
++# CONFIG_USB_TI_CPPI_DMA is not set
++# CONFIG_USB_MUSB_DEBUG is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++#
++CONFIG_USB_GADGET=y
++# CONFIG_USB_GADGET_DEBUG is not set
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
++# CONFIG_USB_GADGET_DEBUG_FS is not set
++CONFIG_USB_GADGET_VBUS_DRAW=2
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_AT91 is not set
++# CONFIG_USB_GADGET_ATMEL_USBA is not set
++# CONFIG_USB_GADGET_FSL_USB2 is not set
++# CONFIG_USB_GADGET_LH7A40X is not set
++# CONFIG_USB_GADGET_OMAP is not set
++# CONFIG_USB_GADGET_PXA25X is not set
++# CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C2410 is not set
++# CONFIG_USB_GADGET_IMX is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_AMD5536UDC is not set
++# CONFIG_USB_GADGET_FSL_QE is not set
++# CONFIG_USB_GADGET_CI13XXX is not set
++# CONFIG_USB_GADGET_NET2280 is not set
++# CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++CONFIG_USB_GADGET_DUALSPEED=y
++# CONFIG_USB_ZERO is not set
++CONFIG_USB_ETH=y
++CONFIG_USB_ETH_RNDIS=y
++# CONFIG_USB_GADGETFS is not set
++# CONFIG_USB_FILE_STORAGE is not set
++# CONFIG_USB_G_SERIAL is not set
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++
++#
++# OTG and related infrastructure
++#
++CONFIG_USB_OTG_UTILS=y
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_ISP1301_OMAP is not set
++CONFIG_TWL4030_USB=y
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++# CONFIG_MMC_UNSAFE_RESUME is not set
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_BOUNCE=y
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++CONFIG_MMC_OMAP_HS=y
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++# CONFIG_NEW_LEDS is not set
++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
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# 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
++CONFIG_RTC_DRV_TWL4030=y
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++
++#
++# SPI RTC drivers
++#
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_DMADEVICES is not set
++CONFIG_REGULATOR=y
++# CONFIG_REGULATOR_DEBUG is not set
++# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_BQ24022 is not set
++CONFIG_REGULATOR_TWL4030=y
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# CBUS support
++#
++# CONFIG_CBUS is not set
++
++#
++# 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 is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++CONFIG_FILE_LOCKING=y
++# CONFIG_XFS_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++CONFIG_DNOTIFY=y
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++CONFIG_QUOTA=y
++# CONFIG_QUOTA_NETLINK_INTERFACE is not set
++CONFIG_PRINT_QUOTA_WARNING=y
++CONFIG_QUOTA_TREE=y
++# CONFIG_QFMT_V1 is not set
++CONFIG_QFMT_V2=y
++CONFIG_QUOTACTL=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_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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_FS_WBUF_VERIFY is not set
++# CONFIG_JFFS2_SUMMARY is not set
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++CONFIG_NFS_V4=y
++CONFIG_ROOT_NFS=y
++# CONFIG_NFSD is not set
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++CONFIG_SUNRPC_GSS=y
++# CONFIG_SUNRPC_REGISTER_V4 is not set
++CONFIG_RPCSEC_GSS_KRB5=y
++# CONFIG_RPCSEC_GSS_SPKM3 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=y
++# CONFIG_ACORN_PARTITION is not set
++# CONFIG_OSF_PARTITION is not set
++# CONFIG_AMIGA_PARTITION is not set
++# CONFIG_ATARI_PARTITION is not set
++# CONFIG_MAC_PARTITION is not set
++CONFIG_MSDOS_PARTITION=y
++# CONFIG_BSD_DISKLABEL is not set
++# CONFIG_MINIX_SUBPARTITION is not set
++# CONFIG_SOLARIS_X86_PARTITION is not set
++# CONFIG_UNIXWARE_DISKLABEL is not set
++# CONFIG_LDM_PARTITION is not set
++# CONFIG_SGI_PARTITION is not set
++# CONFIG_ULTRIX_PARTITION is not set
++# CONFIG_SUN_PARTITION is not set
++# CONFIG_KARMA_PARTITION is not set
++# CONFIG_EFI_PARTITION is not set
++# CONFIG_SYSV68_PARTITION is not set
++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
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_WARN_DEPRECATED=y
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++CONFIG_MAGIC_SYSRQ=y
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++CONFIG_DEBUG_KERNEL=y
++# CONFIG_DEBUG_SHIRQ is not set
++CONFIG_DETECT_SOFTLOCKUP=y
++# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
++CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_SCHED_DEBUG=y
++# CONFIG_SCHEDSTATS is not set
++# CONFIG_TIMER_STATS is not set
++# CONFIG_DEBUG_OBJECTS 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=y
++# 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
++CONFIG_DEBUG_BUGVERBOSE=y
++CONFIG_DEBUG_INFO=y
++# CONFIG_DEBUG_VM is not set
++# CONFIG_DEBUG_WRITECOUNT is not set
++# CONFIG_DEBUG_MEMORY_INIT is not set
++# CONFIG_DEBUG_LIST is not set
++# CONFIG_DEBUG_SG is not set
++# CONFIG_DEBUG_NOTIFIERS is not set
++CONFIG_FRAME_POINTER=y
++# CONFIG_BOOT_PRINTK_DELAY is not set
++# CONFIG_RCU_TORTURE_TEST is not set
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_BACKTRACE_SELF_TEST is not set
++# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
++# CONFIG_FAULT_INJECTION is not set
++# CONFIG_LATENCYTOP is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++
++#
++# Tracers
++#
++# CONFIG_FUNCTION_TRACER is not set
++# CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_SCHED_TRACER is not set
++# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_BOOT_TRACER is not set
++# CONFIG_TRACE_BRANCH_PROFILING is not set
++# CONFIG_STACK_TRACER is not set
++# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_KGDB is not set
++CONFIG_DEBUG_USER=y
++CONFIG_DEBUG_ERRORS=y
++# CONFIG_DEBUG_STACK_USAGE is not set
++# CONFIG_DEBUG_LL is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++CONFIG_CRYPTO_ALGAPI=y
++CONFIG_CRYPTO_ALGAPI2=y
++CONFIG_CRYPTO_AEAD2=y
++CONFIG_CRYPTO_BLKCIPHER=y
++CONFIG_CRYPTO_BLKCIPHER2=y
++CONFIG_CRYPTO_HASH=y
++CONFIG_CRYPTO_HASH2=y
++CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_MANAGER=y
++CONFIG_CRYPTO_MANAGER2=y
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++CONFIG_CRYPTO_CBC=y
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++CONFIG_CRYPTO_ECB=m
++# CONFIG_CRYPTO_LRW is not set
++CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++
++#
++# Digest
++#
++CONFIG_CRYPTO_CRC32C=y
++# CONFIG_CRYPTO_MD4 is not set
++CONFIG_CRYPTO_MD5=y
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++CONFIG_CRYPTO_DES=y
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_HW=y
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=y
++# CONFIG_CRC16 is not set
++# CONFIG_CRC_T10DIF is not set
++# CONFIG_CRC_ITU_T is not set
++CONFIG_CRC32=y
++# CONFIG_CRC7 is not set
++CONFIG_LIBCRC32C=y
++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/arch/arm/configs/dss_omap_3430sdp_defconfig b/arch/arm/configs/dss_omap_3430sdp_defconfig
+new file mode 100644
+index 0000000..dc30dce
+--- /dev/null
++++ b/arch/arm/configs/dss_omap_3430sdp_defconfig
+@@ -0,0 +1,1634 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.29-omap1
++# Thu Apr 2 11:11:24 2009
++#
++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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++
++#
++# General setup
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++CONFIG_LOCALVERSION=""
++CONFIG_LOCALVERSION_AUTO=y
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++CONFIG_BSD_PROCESS_ACCT=y
++# CONFIG_BSD_PROCESS_ACCT_V3 is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=14
++CONFIG_GROUP_SCHED=y
++CONFIG_FAIR_GROUP_SCHED=y
++# CONFIG_RT_GROUP_SCHED is not set
++CONFIG_USER_SCHED=y
++# CONFIG_CGROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++# CONFIG_NAMESPACES is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++CONFIG_EMBEDDED=y
++CONFIG_UID16=y
++# CONFIG_SYSCTL_SYSCALL is not set
++CONFIG_KALLSYMS=y
++# CONFIG_KALLSYMS_ALL is not set
++CONFIG_KALLSYMS_EXTRA_PASS=y
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_SLOB is not set
++# CONFIG_PROFILING is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_CLK=y
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++# CONFIG_MODULE_FORCE_UNLOAD is not set
++CONFIG_MODVERSIONS=y
++CONFIG_MODULE_SRCVERSION_ALL=y
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY 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"
++CONFIG_FREEZER=y
++
++#
++# 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_CLPS711X 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_DAVINCI is not set
++CONFIG_ARCH_OMAP=y
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# TI OMAP Implementations
++#
++CONFIG_ARCH_OMAP_OTG=y
++# CONFIG_ARCH_OMAP1 is not set
++# CONFIG_ARCH_OMAP2 is not set
++CONFIG_ARCH_OMAP3=y
++
++#
++# OMAP Feature Selections
++#
++# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
++# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
++CONFIG_OMAP_SMARTREFLEX=y
++# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
++CONFIG_OMAP_RESET_CLOCKS=y
++CONFIG_OMAP_BOOT_TAG=y
++CONFIG_OMAP_BOOT_REASON=y
++# CONFIG_OMAP_COMPONENT_VERSION is not set
++# CONFIG_OMAP_GPIO_SWITCH is not set
++CONFIG_OMAP_MUX=y
++CONFIG_OMAP_MUX_DEBUG=y
++CONFIG_OMAP_MUX_WARNINGS=y
++# CONFIG_OMAP_MCBSP is not set
++# CONFIG_OMAP_MBOX_FWK is not set
++# CONFIG_OMAP_MPU_TIMER is not set
++CONFIG_OMAP_32K_TIMER=y
++CONFIG_OMAP_32K_TIMER_HZ=128
++CONFIG_OMAP_TICK_GPTIMER=1
++CONFIG_OMAP_DM_TIMER=y
++CONFIG_OMAP_LL_DEBUG_UART1=y
++# CONFIG_OMAP_LL_DEBUG_UART2 is not set
++# CONFIG_OMAP_LL_DEBUG_UART3 is not set
++CONFIG_OMAP_SERIAL_WAKE=y
++CONFIG_ARCH_OMAP34XX=y
++CONFIG_ARCH_OMAP3430=y
++
++#
++# OMAP Board Type
++#
++# CONFIG_MACH_NOKIA_RX51 is not set
++# CONFIG_MACH_OMAP_LDP is not set
++CONFIG_MACH_OMAP_3430SDP=y
++# CONFIG_MACH_OMAP3EVM is not set
++# CONFIG_MACH_OMAP3_BEAGLE is not set
++# CONFIG_MACH_OVERO is not set
++# CONFIG_MACH_OMAP3_PANDORA is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_32v6K=y
++CONFIG_CPU_V7=y
++CONFIG_CPU_32v7=y
++CONFIG_CPU_ABRT_EV7=y
++CONFIG_CPU_PABRT_IFAR=y
++CONFIG_CPU_CACHE_V7=y
++CONFIG_CPU_CACHE_VIPT=y
++CONFIG_CPU_COPY_V6=y
++CONFIG_CPU_TLB_V7=y
++CONFIG_CPU_HAS_ASID=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_ARM_THUMBEE is not set
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_BPREDICT_DISABLE is not set
++CONFIG_HAS_TLS_REG=y
++# CONFIG_OUTER_CACHE is not set
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++# CONFIG_PREEMPT is not set
++CONFIG_HZ=128
++CONFIG_AEABI=y
++CONFIG_OABI_COMPAT=y
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++# CONFIG_LEDS is not set
++CONFIG_ALIGNMENT_TRAP=y
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_FREQ is not set
++# CONFIG_CPU_IDLE 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
++CONFIG_VFP=y
++CONFIG_VFPv3=y
++# CONFIG_NEON is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++CONFIG_BINFMT_MISC=y
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++CONFIG_PM_SLEEP=y
++CONFIG_SUSPEND=y
++CONFIG_SUSPEND_FREEZER=y
++# CONFIG_APM_EMULATION is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_COMPAT_NET_DEV_OPS=y
++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_XFRM_STATISTICS is not set
++CONFIG_NET_KEY=y
++# CONFIG_NET_KEY_MIGRATE 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=y
++# 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_LRO is not set
++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_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_NET_DSA 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
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++# CONFIG_AF_RXRPC is not set
++# CONFIG_PHONET is not set
++CONFIG_WIRELESS=y
++# CONFIG_CFG80211 is not set
++CONFIG_WIRELESS_OLD_REGULATORY=y
++# CONFIG_WIRELESS_EXT is not set
++# CONFIG_LIB80211 is not set
++# CONFIG_MAC80211 is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++# CONFIG_FW_LOADER is not set
++# CONFIG_DEBUG_DRIVER is not set
++# CONFIG_DEBUG_DEVRES is not set
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++# CONFIG_MTD_DEBUG is not set
++CONFIG_MTD_CONCAT=y
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_TESTS is not set
++# CONFIG_MTD_REDBOOT_PARTS is not set
++CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS 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=y
++# CONFIG_MTD_CFI_AMDSTD is not set
++# 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
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++# CONFIG_MTD_PHYSMAP is not set
++# CONFIG_MTD_ARM_INTEGRATOR is not set
++CONFIG_MTD_OMAP_NOR=y
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_DATAFLASH is not set
++# CONFIG_MTD_M25P80 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
++CONFIG_MTD_NAND=y
++# CONFIG_MTD_NAND_VERIFY_WRITE is not set
++CONFIG_MTD_NAND_ECC_SMC=y
++# CONFIG_MTD_NAND_MUSEUM_IDS is not set
++# CONFIG_MTD_NAND_GPIO is not set
++CONFIG_MTD_NAND_OMAP2=y
++CONFIG_MTD_NAND_IDS=y
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ALAUDA is not set
++CONFIG_MTD_ONENAND=y
++CONFIG_MTD_ONENAND_VERIFY_WRITE=y
++# CONFIG_MTD_ONENAND_GENERIC is not set
++CONFIG_MTD_ONENAND_OMAP2=y
++# CONFIG_MTD_ONENAND_OTP is not set
++# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
++# CONFIG_MTD_ONENAND_SIM is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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=16384
++# CONFIG_BLK_DEV_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++CONFIG_MISC_DEVICES=y
++# CONFIG_ICS932S401 is not set
++# CONFIG_OMAP_STI is not set
++# CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_C2PORT is not set
++
++#
++# EEPROM support
++#
++# CONFIG_EEPROM_AT24 is not set
++# CONFIG_EEPROM_AT25 is not set
++# CONFIG_EEPROM_LEGACY is not set
++# CONFIG_EEPROM_93CX6 is not set
++CONFIG_HAVE_IDE=y
++# 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_SRP_ATTRS is not set
++CONFIG_SCSI_LOWLEVEL=y
++# CONFIG_ISCSI_TCP is not set
++# CONFIG_LIBFC is not set
++# CONFIG_SCSI_DEBUG is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++# 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_VETH is not set
++# CONFIG_PHYLIB is not set
++CONFIG_NET_ETHERNET=y
++CONFIG_MII=y
++# CONFIG_AX88796 is not set
++CONFIG_SMC91X=y
++# CONFIG_DM9000 is not set
++# CONFIG_ENC28J60 is not set
++# CONFIG_SMC911X is not set
++# CONFIG_SMSC911X is not set
++# CONFIG_DNET is not set
++# CONFIG_IBM_NEW_EMAC_ZMII is not set
++# CONFIG_IBM_NEW_EMAC_RGMII is not set
++# CONFIG_IBM_NEW_EMAC_TAH is not set
++# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
++# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
++# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
++# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
++# CONFIG_B44 is not set
++CONFIG_NETDEV_1000=y
++CONFIG_NETDEV_10000=y
++
++#
++# Wireless LAN
++#
++# CONFIG_WLAN_PRE80211 is not set
++# CONFIG_WLAN_80211 is not set
++# CONFIG_IWLWIFI_LEDS is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++
++#
++# 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 is not set
++# CONFIG_WAN is not set
++# CONFIG_PPP is not set
++# CONFIG_SLIP 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 is not set
++# CONFIG_INPUT_JOYDEV is not set
++CONFIG_INPUT_EVDEV=y
++# CONFIG_INPUT_EVBUG is not set
++
++#
++# Input Device Drivers
++#
++CONFIG_INPUT_KEYBOARD=y
++# CONFIG_KEYBOARD_ATKBD is not set
++# 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_TWL4030=y
++# CONFIG_KEYBOARD_GPIO is not set
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_INPUT_JOYSTICK is not set
++# CONFIG_INPUT_TABLET is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++CONFIG_TOUCHSCREEN_ADS7846=y
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
++# CONFIG_TOUCHSCREEN_TSC210X is not set
++# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
++# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
++# CONFIG_TOUCHSCREEN_TSC2007 is not set
++# 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_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++CONFIG_DEVKMEM=y
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_NR_UARTS=32
++CONFIG_SERIAL_8250_RUNTIME_UARTS=4
++CONFIG_SERIAL_8250_EXTENDED=y
++CONFIG_SERIAL_8250_MANY_PORTS=y
++CONFIG_SERIAL_8250_SHARE_IRQ=y
++CONFIG_SERIAL_8250_DETECT_IRQ=y
++CONFIG_SERIAL_8250_RSA=y
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++CONFIG_HW_RANDOM=y
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_HELPER_AUTO=y
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++CONFIG_I2C_OMAP=y
++# CONFIG_I2C_SIMTEC is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++# CONFIG_I2C_TINY_USB is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_PCA_PLATFORM is not set
++# CONFIG_I2C_STUB is not set
++
++#
++# Miscellaneous I2C Chip support
++#
++# CONFIG_DS1682 is not set
++# CONFIG_SENSORS_PCF8574 is not set
++# CONFIG_PCF8575 is not set
++# CONFIG_SENSORS_PCA9539 is not set
++# CONFIG_SENSORS_PCF8591 is not set
++# CONFIG_TWL4030_MADC is not set
++# CONFIG_TWL4030_POWEROFF 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
++CONFIG_SPI=y
++# CONFIG_SPI_DEBUG is not set
++CONFIG_SPI_MASTER=y
++
++#
++# SPI Master Controller Drivers
++#
++# CONFIG_SPI_BITBANG is not set
++# CONFIG_SPI_GPIO is not set
++CONFIG_SPI_OMAP24XX=y
++
++#
++# SPI Protocol Masters
++#
++# CONFIG_SPI_TSC210X is not set
++# CONFIG_SPI_TSC2301 is not set
++# CONFIG_SPI_SPIDEV is not set
++# CONFIG_SPI_TLE62X0 is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++# CONFIG_DEBUG_GPIO is not set
++# CONFIG_GPIO_SYSFS is not set
++
++#
++# Memory mapped GPIO expanders:
++#
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++CONFIG_GPIO_TWL4030=y
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_GPIO_MAX7301 is not set
++# CONFIG_GPIO_MCP23S08 is not set
++# CONFIG_W1 is not set
++# CONFIG_POWER_SUPPLY is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++CONFIG_WATCHDOG=y
++CONFIG_WATCHDOG_NOWAYOUT=y
++
++#
++# Watchdog Device Drivers
++#
++# CONFIG_SOFT_WATCHDOG is not set
++CONFIG_OMAP_WATCHDOG=y
++
++#
++# USB-based Watchdog Cards
++#
++# CONFIG_USBPCWATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_TPS65010 is not set
++CONFIG_TWL4030_CORE=y
++# CONFIG_TWL4030_POWER is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_PCF50633 is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++# CONFIG_VIDEO_DEV is not set
++# CONFIG_DVB_CORE is not set
++# CONFIG_VIDEO_MEDIA is not set
++
++#
++# Multimedia drivers
++#
++CONFIG_DAB=y
++# CONFIG_USB_DABUSB is not set
++
++#
++# Graphics support
++#
++# 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
++# CONFIG_FB_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=m
++CONFIG_FB_CFB_COPYAREA=m
++CONFIG_FB_CFB_IMAGEBLIT=m
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# 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_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_OMAP_LCD_VGA is not set
++# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
++CONFIG_OMAP2_DSS=m
++CONFIG_OMAP2_DSS_VRAM_SIZE=8
++CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
++# CONFIG_OMAP2_DSS_RFBI is not set
++CONFIG_OMAP2_DSS_VENC=y
++# CONFIG_OMAP2_DSS_SDI is not set
++# CONFIG_OMAP2_DSS_DSI is not set
++# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
++CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
++
++#
++# OMAP2/3 Display Device Drivers
++#
++CONFIG_PANEL_GENERIC=m
++# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
++CONFIG_PANEL_SHARP_LS037V7DW01=m
++# CONFIG_PANEL_N800 is not set
++# CONFIG_CTRL_BLIZZARD is not set
++CONFIG_FB_OMAP2=m
++CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
++# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
++CONFIG_FB_OMAP2_NUM_FBS=3
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT is not set
++
++#
++# Console display driver support
++#
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_DUMMY_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE is not set
++# CONFIG_LOGO is not set
++# CONFIG_SOUND is not set
++CONFIG_HID_SUPPORT=y
++CONFIG_HID=y
++# CONFIG_HID_DEBUG is not set
++# CONFIG_HIDRAW is not set
++
++#
++# USB Input Devices
++#
++CONFIG_USB_HID=y
++# CONFIG_HID_PID is not set
++# CONFIG_USB_HIDDEV is not set
++
++#
++# Special HID drivers
++#
++CONFIG_HID_COMPAT=y
++# CONFIG_HID_A4TECH is not set
++# CONFIG_HID_APPLE is not set
++# CONFIG_HID_BELKIN is not set
++# CONFIG_HID_CHERRY is not set
++# CONFIG_HID_CHICONY is not set
++# CONFIG_HID_CYPRESS is not set
++# CONFIG_HID_EZKEY is not set
++# CONFIG_HID_GYRATION is not set
++# CONFIG_HID_LOGITECH is not set
++# CONFIG_HID_MICROSOFT is not set
++# CONFIG_HID_MONTEREY is not set
++# CONFIG_HID_NTRIG is not set
++# CONFIG_HID_PANTHERLORD is not set
++# CONFIG_HID_PETALYNX is not set
++# CONFIG_HID_SAMSUNG is not set
++# CONFIG_HID_SONY is not set
++# CONFIG_HID_SUNPLUS is not set
++# CONFIG_GREENASIA_FF is not set
++# CONFIG_HID_TOPSEED is not set
++# CONFIG_THRUSTMASTER_FF is not set
++# CONFIG_ZEROPLUS_FF is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++CONFIG_USB_ARCH_HAS_EHCI=y
++CONFIG_USB=y
++CONFIG_USB_DEBUG=y
++CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
++
++#
++# Miscellaneous USB options
++#
++CONFIG_USB_DEVICEFS=y
++# CONFIG_USB_DEVICE_CLASS is not set
++# CONFIG_USB_DYNAMIC_MINORS is not set
++CONFIG_USB_SUSPEND=y
++CONFIG_USB_OTG=y
++# CONFIG_USB_OTG_WHITELIST is not set
++# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_MON=y
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++CONFIG_USB_EHCI_HCD=m
++CONFIG_OMAP_EHCI_PHY_MODE=y
++# CONFIG_OMAP_EHCI_TLL_MODE is not set
++# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
++# CONFIG_USB_EHCI_TT_NEWSCHED is not set
++# CONFIG_USB_OXU210HP_HCD is not set
++# CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_OHCI_HCD is not set
++# CONFIG_USB_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++CONFIG_USB_MUSB_HDRC=y
++CONFIG_USB_MUSB_SOC=y
++
++#
++# OMAP 343x high speed USB support
++#
++# CONFIG_USB_MUSB_HOST is not set
++# CONFIG_USB_MUSB_PERIPHERAL is not set
++CONFIG_USB_MUSB_OTG=y
++CONFIG_USB_GADGET_MUSB_HDRC=y
++CONFIG_USB_MUSB_HDRC_HCD=y
++# CONFIG_MUSB_PIO_ONLY is not set
++CONFIG_USB_INVENTRA_DMA=y
++# CONFIG_USB_TI_CPPI_DMA is not set
++# CONFIG_USB_MUSB_DEBUG is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++#
++
++#
++# see USB_STORAGE Help for more information
++#
++CONFIG_USB_STORAGE=y
++CONFIG_USB_STORAGE_DEBUG=y
++# CONFIG_USB_STORAGE_DATAFAB is not set
++# CONFIG_USB_STORAGE_FREECOM is not set
++# CONFIG_USB_STORAGE_ISD200 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_STORAGE_CYPRESS_ATACB is not set
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++# CONFIG_USB_MICROTEK is not set
++
++#
++# USB port drivers
++#
++# 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_SEVSEG 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_SISUSBVGA is not set
++# CONFIG_USB_LD is not set
++# CONFIG_USB_TRANCEVIBRATOR is not set
++# CONFIG_USB_IOWARRIOR is not set
++CONFIG_USB_TEST=y
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_VST is not set
++CONFIG_USB_GADGET=y
++CONFIG_USB_GADGET_DEBUG=y
++CONFIG_USB_GADGET_DEBUG_FILES=y
++# CONFIG_USB_GADGET_DEBUG_FS is not set
++CONFIG_USB_GADGET_VBUS_DRAW=2
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_AT91 is not set
++# CONFIG_USB_GADGET_ATMEL_USBA is not set
++# CONFIG_USB_GADGET_FSL_USB2 is not set
++# CONFIG_USB_GADGET_LH7A40X is not set
++# CONFIG_USB_GADGET_OMAP is not set
++# CONFIG_USB_GADGET_PXA25X is not set
++# CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C2410 is not set
++# CONFIG_USB_GADGET_IMX is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_AMD5536UDC is not set
++# CONFIG_USB_GADGET_FSL_QE is not set
++# CONFIG_USB_GADGET_CI13XXX is not set
++# CONFIG_USB_GADGET_NET2280 is not set
++# CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++CONFIG_USB_GADGET_DUALSPEED=y
++CONFIG_USB_ZERO=m
++# CONFIG_USB_ZERO_HNPTEST is not set
++# CONFIG_USB_ETH is not set
++# CONFIG_USB_GADGETFS is not set
++# CONFIG_USB_FILE_STORAGE is not set
++# CONFIG_USB_G_SERIAL is not set
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++
++#
++# OTG and related infrastructure
++#
++CONFIG_USB_OTG_UTILS=y
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_ISP1301_OMAP is not set
++CONFIG_TWL4030_USB=y
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++# CONFIG_MMC_UNSAFE_RESUME is not set
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_BOUNCE=y
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++CONFIG_MMC_OMAP_HS=m
++# CONFIG_MMC_SPI is not set
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++# CONFIG_NEW_LEDS is not set
++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
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# 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
++CONFIG_RTC_DRV_TWL4030=y
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++
++#
++# SPI RTC drivers
++#
++# CONFIG_RTC_DRV_M41T94 is not set
++# CONFIG_RTC_DRV_DS1305 is not set
++# CONFIG_RTC_DRV_DS1390 is not set
++# CONFIG_RTC_DRV_MAX6902 is not set
++# CONFIG_RTC_DRV_R9701 is not set
++# CONFIG_RTC_DRV_RS5C348 is not set
++# CONFIG_RTC_DRV_DS3234 is not set
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_DMADEVICES is not set
++CONFIG_REGULATOR=y
++# CONFIG_REGULATOR_DEBUG is not set
++# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_BQ24022 is not set
++CONFIG_REGULATOR_TWL4030=y
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# CBUS support
++#
++# CONFIG_CBUS is not set
++
++#
++# 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 is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++CONFIG_FILE_LOCKING=y
++# CONFIG_XFS_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++CONFIG_DNOTIFY=y
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++CONFIG_QUOTA=y
++# CONFIG_QUOTA_NETLINK_INTERFACE is not set
++CONFIG_PRINT_QUOTA_WARNING=y
++CONFIG_QUOTA_TREE=y
++# CONFIG_QFMT_V1 is not set
++CONFIG_QFMT_V2=y
++CONFIG_QUOTACTL=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_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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_FS_WBUF_VERIFY is not set
++# CONFIG_JFFS2_SUMMARY is not set
++# CONFIG_JFFS2_FS_XATTR is not set
++CONFIG_JFFS2_COMPRESSION_OPTIONS=y
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_JFFS2_CMODE_NONE is not set
++CONFIG_JFFS2_CMODE_PRIORITY=y
++# CONFIG_JFFS2_CMODE_SIZE is not set
++# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++CONFIG_NFS_V4=y
++CONFIG_ROOT_NFS=y
++# CONFIG_NFSD is not set
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++CONFIG_SUNRPC_GSS=y
++# CONFIG_SUNRPC_REGISTER_V4 is not set
++CONFIG_RPCSEC_GSS_KRB5=y
++# CONFIG_RPCSEC_GSS_SPKM3 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=y
++# CONFIG_ACORN_PARTITION is not set
++# CONFIG_OSF_PARTITION is not set
++# CONFIG_AMIGA_PARTITION is not set
++# CONFIG_ATARI_PARTITION is not set
++# CONFIG_MAC_PARTITION is not set
++CONFIG_MSDOS_PARTITION=y
++# CONFIG_BSD_DISKLABEL is not set
++# CONFIG_MINIX_SUBPARTITION is not set
++# CONFIG_SOLARIS_X86_PARTITION is not set
++# CONFIG_UNIXWARE_DISKLABEL is not set
++# CONFIG_LDM_PARTITION is not set
++# CONFIG_SGI_PARTITION is not set
++# CONFIG_ULTRIX_PARTITION is not set
++# CONFIG_SUN_PARTITION is not set
++# CONFIG_KARMA_PARTITION is not set
++# CONFIG_EFI_PARTITION is not set
++# CONFIG_SYSV68_PARTITION is not set
++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
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_WARN_DEPRECATED=y
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++CONFIG_MAGIC_SYSRQ=y
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++CONFIG_DEBUG_KERNEL=y
++# CONFIG_DEBUG_SHIRQ is not set
++CONFIG_DETECT_SOFTLOCKUP=y
++# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
++CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_SCHED_DEBUG=y
++# CONFIG_SCHEDSTATS is not set
++# CONFIG_TIMER_STATS is not set
++# CONFIG_DEBUG_OBJECTS 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=y
++# 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
++CONFIG_DEBUG_BUGVERBOSE=y
++CONFIG_DEBUG_INFO=y
++# CONFIG_DEBUG_VM is not set
++# CONFIG_DEBUG_WRITECOUNT is not set
++# CONFIG_DEBUG_MEMORY_INIT is not set
++# CONFIG_DEBUG_LIST is not set
++# CONFIG_DEBUG_SG is not set
++# CONFIG_DEBUG_NOTIFIERS is not set
++CONFIG_FRAME_POINTER=y
++# CONFIG_BOOT_PRINTK_DELAY is not set
++# CONFIG_RCU_TORTURE_TEST is not set
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_BACKTRACE_SELF_TEST is not set
++# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
++# CONFIG_FAULT_INJECTION is not set
++# CONFIG_LATENCYTOP is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++
++#
++# Tracers
++#
++# CONFIG_FUNCTION_TRACER is not set
++# CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_SCHED_TRACER is not set
++# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_BOOT_TRACER is not set
++# CONFIG_TRACE_BRANCH_PROFILING is not set
++# CONFIG_STACK_TRACER is not set
++# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_KGDB is not set
++CONFIG_DEBUG_USER=y
++CONFIG_DEBUG_ERRORS=y
++# CONFIG_DEBUG_STACK_USAGE is not set
++# CONFIG_DEBUG_LL is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++CONFIG_CRYPTO_ALGAPI=y
++CONFIG_CRYPTO_ALGAPI2=y
++CONFIG_CRYPTO_AEAD2=y
++CONFIG_CRYPTO_BLKCIPHER=y
++CONFIG_CRYPTO_BLKCIPHER2=y
++CONFIG_CRYPTO_HASH=y
++CONFIG_CRYPTO_HASH2=y
++CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_MANAGER=y
++CONFIG_CRYPTO_MANAGER2=y
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++CONFIG_CRYPTO_CBC=y
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++CONFIG_CRYPTO_ECB=m
++# CONFIG_CRYPTO_LRW is not set
++CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++
++#
++# Digest
++#
++CONFIG_CRYPTO_CRC32C=y
++# CONFIG_CRYPTO_MD4 is not set
++CONFIG_CRYPTO_MD5=y
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++CONFIG_CRYPTO_DES=y
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_HW=y
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=y
++# CONFIG_CRC16 is not set
++# CONFIG_CRC_T10DIF is not set
++# CONFIG_CRC_ITU_T is not set
++CONFIG_CRC32=y
++# CONFIG_CRC7 is not set
++CONFIG_LIBCRC32C=y
++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/arch/arm/configs/dss_overo_defconfig b/arch/arm/configs/dss_overo_defconfig
+new file mode 100644
+index 0000000..755a1b6
+--- /dev/null
++++ b/arch/arm/configs/dss_overo_defconfig
+@@ -0,0 +1,1862 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.29-omap1
++# Thu Apr 2 11:30:57 2009
++#
++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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_OPROFILE_ARMV7=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++
++#
++# General setup
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++CONFIG_LOCALVERSION=""
++CONFIG_LOCALVERSION_AUTO=y
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++CONFIG_BSD_PROCESS_ACCT=y
++# CONFIG_BSD_PROCESS_ACCT_V3 is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_CLASSIC_RCU=y
++# CONFIG_TREE_RCU is not set
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_PREEMPT_RCU_TRACE is not set
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
++CONFIG_LOG_BUF_SHIFT=14
++CONFIG_GROUP_SCHED=y
++CONFIG_FAIR_GROUP_SCHED=y
++# CONFIG_RT_GROUP_SCHED is not set
++CONFIG_USER_SCHED=y
++# CONFIG_CGROUP_SCHED is not set
++# CONFIG_CGROUPS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++# CONFIG_NAMESPACES is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++CONFIG_EMBEDDED=y
++CONFIG_UID16=y
++# CONFIG_SYSCTL_SYSCALL is not set
++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 is not set
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_SLUB_DEBUG=y
++# CONFIG_COMPAT_BRK is not set
++# CONFIG_SLAB is not set
++CONFIG_SLUB=y
++# CONFIG_SLOB is not set
++CONFIG_PROFILING=y
++CONFIG_TRACEPOINTS=y
++# CONFIG_MARKERS is not set
++CONFIG_OPROFILE=y
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_CLK=y
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++CONFIG_MODVERSIONS=y
++CONFIG_MODULE_SRCVERSION_ALL=y
++CONFIG_BLOCK=y
++CONFIG_LBD=y
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY 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"
++CONFIG_FREEZER=y
++
++#
++# 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_CLPS711X 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_KIRKWOOD is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_DAVINCI is not set
++CONFIG_ARCH_OMAP=y
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_W90X900 is not set
++
++#
++# TI OMAP Implementations
++#
++CONFIG_ARCH_OMAP_OTG=y
++# CONFIG_ARCH_OMAP1 is not set
++# CONFIG_ARCH_OMAP2 is not set
++CONFIG_ARCH_OMAP3=y
++
++#
++# OMAP Feature Selections
++#
++# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
++# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
++CONFIG_OMAP_SMARTREFLEX=y
++# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
++# CONFIG_OMAP_RESET_CLOCKS is not set
++CONFIG_OMAP_BOOT_TAG=y
++CONFIG_OMAP_BOOT_REASON=y
++# CONFIG_OMAP_COMPONENT_VERSION is not set
++# CONFIG_OMAP_GPIO_SWITCH is not set
++# CONFIG_OMAP_MUX is not set
++CONFIG_OMAP_MCBSP=y
++# CONFIG_OMAP_MBOX_FWK is not set
++# CONFIG_OMAP_MPU_TIMER is not set
++CONFIG_OMAP_32K_TIMER=y
++CONFIG_OMAP_32K_TIMER_HZ=128
++CONFIG_OMAP_TICK_GPTIMER=1
++CONFIG_OMAP_DM_TIMER=y
++# CONFIG_OMAP_LL_DEBUG_UART1 is not set
++# CONFIG_OMAP_LL_DEBUG_UART2 is not set
++CONFIG_OMAP_LL_DEBUG_UART3=y
++CONFIG_ARCH_OMAP34XX=y
++CONFIG_ARCH_OMAP3430=y
++
++#
++# OMAP Board Type
++#
++# CONFIG_MACH_NOKIA_RX51 is not set
++# CONFIG_MACH_OMAP_LDP is not set
++# CONFIG_MACH_OMAP_3430SDP is not set
++# CONFIG_MACH_OMAP3EVM is not set
++# CONFIG_MACH_OMAP3_BEAGLE is not set
++CONFIG_MACH_OVERO=y
++# CONFIG_MACH_OMAP3_PANDORA is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_32v6K=y
++CONFIG_CPU_V7=y
++CONFIG_CPU_32v7=y
++CONFIG_CPU_ABRT_EV7=y
++CONFIG_CPU_PABRT_IFAR=y
++CONFIG_CPU_CACHE_V7=y
++CONFIG_CPU_CACHE_VIPT=y
++CONFIG_CPU_COPY_V6=y
++CONFIG_CPU_TLB_V7=y
++CONFIG_CPU_HAS_ASID=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++CONFIG_ARM_THUMBEE=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_BPREDICT_DISABLE is not set
++CONFIG_HAS_TLS_REG=y
++# CONFIG_OUTER_CACHE is not set
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_TICK_ONESHOT=y
++CONFIG_NO_HZ=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++# CONFIG_PREEMPT is not set
++CONFIG_HZ=128
++CONFIG_AEABI=y
++# CONFIG_OABI_COMPAT is not set
++CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=4
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++CONFIG_UNEVICTABLE_LRU=y
++CONFIG_LEDS=y
++CONFIG_ALIGNMENT_TRAP=y
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.2.14:/tftpboot/rootfs ip=192.168.2.15 nolock,rsize=1024,wsize=1024 rw"
++# CONFIG_XIP_KERNEL is not set
++CONFIG_KEXEC=y
++CONFIG_ATAGS_PROC=y
++
++#
++# CPU Power Management
++#
++CONFIG_CPU_FREQ=y
++CONFIG_CPU_FREQ_TABLE=y
++# CONFIG_CPU_FREQ_DEBUG is not set
++CONFIG_CPU_FREQ_STAT=y
++CONFIG_CPU_FREQ_STAT_DETAILS=y
++CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
++# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
++CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
++# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
++CONFIG_CPU_FREQ_GOV_USERSPACE=y
++CONFIG_CPU_FREQ_GOV_ONDEMAND=y
++# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
++# CONFIG_CPU_IDLE is not set
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++CONFIG_VFP=y
++CONFIG_VFPv3=y
++CONFIG_NEON=y
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++CONFIG_HAVE_AOUT=y
++CONFIG_BINFMT_AOUT=m
++CONFIG_BINFMT_MISC=y
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++CONFIG_PM_SLEEP=y
++CONFIG_SUSPEND=y
++CONFIG_SUSPEND_FREEZER=y
++# CONFIG_APM_EMULATION is not set
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_COMPAT_NET_DEV_OPS=y
++CONFIG_PACKET=y
++CONFIG_PACKET_MMAP=y
++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_XFRM_STATISTICS is not set
++CONFIG_NET_KEY=y
++# CONFIG_NET_KEY_MIGRATE 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=y
++# 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=m
++CONFIG_INET_XFRM_MODE_TRANSPORT=y
++CONFIG_INET_XFRM_MODE_TUNNEL=y
++CONFIG_INET_XFRM_MODE_BEET=y
++# CONFIG_INET_LRO is not set
++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=m
++# CONFIG_IPV6_PRIVACY is not set
++# CONFIG_IPV6_ROUTER_PREF is not set
++# CONFIG_IPV6_OPTIMISTIC_DAD is not set
++# CONFIG_INET6_AH is not set
++# CONFIG_INET6_ESP is not set
++# CONFIG_INET6_IPCOMP is not set
++# CONFIG_IPV6_MIP6 is not set
++# CONFIG_INET6_XFRM_TUNNEL is not set
++# CONFIG_INET6_TUNNEL is not set
++CONFIG_INET6_XFRM_MODE_TRANSPORT=m
++CONFIG_INET6_XFRM_MODE_TUNNEL=m
++CONFIG_INET6_XFRM_MODE_BEET=m
++# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
++CONFIG_IPV6_SIT=m
++CONFIG_IPV6_NDISC_NODETYPE=y
++# CONFIG_IPV6_TUNNEL is not set
++# CONFIG_IPV6_MULTIPLE_TABLES is not set
++# CONFIG_IPV6_MROUTE 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_NET_DSA 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
++# CONFIG_NET_SCHED is not set
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++CONFIG_BT=y
++CONFIG_BT_L2CAP=y
++CONFIG_BT_SCO=y
++CONFIG_BT_RFCOMM=y
++CONFIG_BT_RFCOMM_TTY=y
++CONFIG_BT_BNEP=y
++CONFIG_BT_BNEP_MC_FILTER=y
++CONFIG_BT_BNEP_PROTO_FILTER=y
++CONFIG_BT_HIDP=y
++
++#
++# Bluetooth device drivers
++#
++# CONFIG_BT_HCIBTSDIO is not set
++CONFIG_BT_HCIUART=y
++CONFIG_BT_HCIUART_H4=y
++CONFIG_BT_HCIUART_BCSP=y
++# CONFIG_BT_HCIUART_LL is not set
++# CONFIG_BT_HCIBRF6150 is not set
++# CONFIG_BT_HCIH4P is not set
++# CONFIG_BT_HCIVHCI is not set
++# CONFIG_AF_RXRPC is not set
++# CONFIG_PHONET is not set
++CONFIG_WIRELESS=y
++CONFIG_CFG80211=y
++# CONFIG_CFG80211_REG_DEBUG is not set
++CONFIG_NL80211=y
++CONFIG_WIRELESS_OLD_REGULATORY=y
++CONFIG_WIRELESS_EXT=y
++CONFIG_WIRELESS_EXT_SYSFS=y
++CONFIG_LIB80211=y
++CONFIG_LIB80211_CRYPT_WEP=m
++CONFIG_LIB80211_CRYPT_CCMP=m
++CONFIG_LIB80211_CRYPT_TKIP=m
++# CONFIG_LIB80211_DEBUG is not set
++CONFIG_MAC80211=y
++
++#
++# Rate control algorithm selection
++#
++CONFIG_MAC80211_RC_PID=y
++CONFIG_MAC80211_RC_MINSTREL=y
++CONFIG_MAC80211_RC_DEFAULT_PID=y
++# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
++CONFIG_MAC80211_RC_DEFAULT="pid"
++# CONFIG_MAC80211_MESH is not set
++CONFIG_MAC80211_LEDS=y
++# CONFIG_MAC80211_DEBUGFS is not set
++# CONFIG_MAC80211_DEBUG_MENU is not set
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++CONFIG_FW_LOADER=y
++CONFIG_FIRMWARE_IN_KERNEL=y
++CONFIG_EXTRA_FIRMWARE=""
++# CONFIG_DEBUG_DRIVER is not set
++# CONFIG_DEBUG_DEVRES is not set
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++# CONFIG_MTD_DEBUG is not set
++CONFIG_MTD_CONCAT=y
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_TESTS is not set
++# CONFIG_MTD_REDBOOT_PARTS is not set
++# CONFIG_MTD_CMDLINE_PARTS is not set
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_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
++# CONFIG_MTD_OOPS 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
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_DATAFLASH is not set
++# CONFIG_MTD_M25P80 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
++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_GPIO is not set
++CONFIG_MTD_NAND_OMAP2=y
++CONFIG_MTD_NAND_IDS=y
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR 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=m
++# CONFIG_BLK_DEV_NBD is not set
++CONFIG_BLK_DEV_RAM=y
++CONFIG_BLK_DEV_RAM_COUNT=16
++CONFIG_BLK_DEV_RAM_SIZE=16384
++# CONFIG_BLK_DEV_XIP is not set
++CONFIG_CDROM_PKTCDVD=m
++CONFIG_CDROM_PKTCDVD_BUFFERS=8
++# CONFIG_CDROM_PKTCDVD_WCACHE is not set
++# CONFIG_ATA_OVER_ETH is not set
++CONFIG_MISC_DEVICES=y
++# CONFIG_ICS932S401 is not set
++# CONFIG_OMAP_STI is not set
++# CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_C2PORT is not set
++
++#
++# EEPROM support
++#
++# CONFIG_EEPROM_AT24 is not set
++# CONFIG_EEPROM_AT25 is not set
++# CONFIG_EEPROM_LEGACY is not set
++CONFIG_EEPROM_93CX6=m
++CONFIG_HAVE_IDE=y
++# CONFIG_IDE is not set
++
++#
++# SCSI device support
++#
++CONFIG_RAID_ATTRS=m
++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=m
++# CONFIG_CHR_DEV_SCH is not set
++
++#
++# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
++#
++CONFIG_SCSI_MULTI_LUN=y
++# 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_SRP_ATTRS is not set
++CONFIG_SCSI_LOWLEVEL=y
++# CONFIG_ISCSI_TCP is not set
++# CONFIG_LIBFC is not set
++# CONFIG_SCSI_DEBUG is not set
++# CONFIG_SCSI_DH is not set
++# CONFIG_ATA is not set
++CONFIG_MD=y
++CONFIG_BLK_DEV_MD=m
++CONFIG_MD_LINEAR=m
++CONFIG_MD_RAID0=m
++CONFIG_MD_RAID1=m
++CONFIG_MD_RAID10=m
++CONFIG_MD_RAID456=m
++CONFIG_MD_RAID5_RESHAPE=y
++CONFIG_MD_MULTIPATH=m
++CONFIG_MD_FAULTY=m
++CONFIG_BLK_DEV_DM=m
++# CONFIG_DM_DEBUG is not set
++CONFIG_DM_CRYPT=m
++CONFIG_DM_SNAPSHOT=m
++CONFIG_DM_MIRROR=m
++CONFIG_DM_ZERO=m
++CONFIG_DM_MULTIPATH=m
++CONFIG_DM_DELAY=m
++# CONFIG_DM_UEVENT is not set
++CONFIG_NETDEVICES=y
++CONFIG_DUMMY=m
++# CONFIG_BONDING is not set
++# CONFIG_MACVLAN is not set
++# CONFIG_EQUALIZER is not set
++CONFIG_TUN=m
++# CONFIG_VETH is not set
++# CONFIG_NET_ETHERNET 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=y
++CONFIG_LIBERTAS=y
++CONFIG_LIBERTAS_SDIO=y
++CONFIG_LIBERTAS_DEBUG=y
++# CONFIG_LIBERTAS_THINFIRM is not set
++# CONFIG_MAC80211_HWSIM is not set
++CONFIG_P54_COMMON=m
++# CONFIG_IWLWIFI_LEDS is not set
++CONFIG_HOSTAP=m
++CONFIG_HOSTAP_FIRMWARE=y
++CONFIG_HOSTAP_FIRMWARE_NVRAM=y
++# CONFIG_B43 is not set
++# CONFIG_B43LEGACY is not set
++# CONFIG_RT2X00 is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++# CONFIG_WAN is not set
++CONFIG_PPP=m
++# CONFIG_PPP_MULTILINK is not set
++# CONFIG_PPP_FILTER is not set
++CONFIG_PPP_ASYNC=m
++CONFIG_PPP_SYNC_TTY=m
++CONFIG_PPP_DEFLATE=m
++CONFIG_PPP_BSDCOMP=m
++CONFIG_PPP_MPPE=m
++CONFIG_PPPOE=m
++# CONFIG_PPPOL2TP is not set
++# CONFIG_SLIP is not set
++CONFIG_SLHC=m
++# 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_EVDEV=y
++# CONFIG_INPUT_EVBUG is not set
++
++#
++# Input Device Drivers
++#
++CONFIG_INPUT_KEYBOARD=y
++# CONFIG_KEYBOARD_ATKBD is not set
++# 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_TWL4030 is not set
++# CONFIG_KEYBOARD_LM8323 is not set
++# CONFIG_KEYBOARD_GPIO is not set
++CONFIG_INPUT_MOUSE=y
++CONFIG_MOUSE_PS2=y
++CONFIG_MOUSE_PS2_ALPS=y
++CONFIG_MOUSE_PS2_LOGIPS2PP=y
++CONFIG_MOUSE_PS2_SYNAPTICS=y
++CONFIG_MOUSE_PS2_TRACKPOINT=y
++# CONFIG_MOUSE_PS2_ELANTECH is not set
++# CONFIG_MOUSE_PS2_TOUCHKIT is not set
++# CONFIG_MOUSE_SERIAL is not set
++# CONFIG_MOUSE_APPLETOUCH is not set
++# CONFIG_MOUSE_BCM5974 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 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_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++CONFIG_VT_HW_CONSOLE_BINDING=y
++CONFIG_DEVKMEM=y
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_NR_UARTS=32
++CONFIG_SERIAL_8250_RUNTIME_UARTS=4
++CONFIG_SERIAL_8250_EXTENDED=y
++CONFIG_SERIAL_8250_MANY_PORTS=y
++CONFIG_SERIAL_8250_SHARE_IRQ=y
++CONFIG_SERIAL_8250_DETECT_IRQ=y
++CONFIG_SERIAL_8250_RSA=y
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++CONFIG_HW_RANDOM=y
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_HELPER_AUTO=y
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++CONFIG_I2C_OMAP=y
++# CONFIG_I2C_SIMTEC is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_PCA_PLATFORM is not set
++# CONFIG_I2C_STUB is not set
++
++#
++# Miscellaneous I2C Chip support
++#
++# CONFIG_DS1682 is not set
++# CONFIG_SENSORS_PCF8574 is not set
++# CONFIG_PCF8575 is not set
++# CONFIG_SENSORS_PCA9539 is not set
++# CONFIG_SENSORS_PCF8591 is not set
++CONFIG_TWL4030_MADC=m
++CONFIG_TWL4030_POWEROFF=y
++# CONFIG_SENSORS_MAX6875 is not set
++# CONFIG_SENSORS_TSL2550 is not set
++# CONFIG_SENSORS_TSL2563 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
++CONFIG_SPI=y
++# CONFIG_SPI_DEBUG is not set
++CONFIG_SPI_MASTER=y
++
++#
++# SPI Master Controller Drivers
++#
++# CONFIG_SPI_BITBANG is not set
++# CONFIG_SPI_GPIO is not set
++CONFIG_SPI_OMAP24XX=y
++
++#
++# SPI Protocol Masters
++#
++# CONFIG_SPI_TSC210X is not set
++# CONFIG_SPI_TSC2301 is not set
++# CONFIG_SPI_SPIDEV is not set
++# CONFIG_SPI_TLE62X0 is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++CONFIG_DEBUG_GPIO=y
++CONFIG_GPIO_SYSFS=y
++
++#
++# Memory mapped GPIO expanders:
++#
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++CONFIG_GPIO_TWL4030=y
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_GPIO_MAX7301 is not set
++# CONFIG_GPIO_MCP23S08 is not set
++# CONFIG_W1 is not set
++CONFIG_POWER_SUPPLY=m
++# CONFIG_POWER_SUPPLY_DEBUG is not set
++# CONFIG_PDA_POWER is not set
++# CONFIG_BATTERY_DS2760 is not set
++# CONFIG_TWL4030_BCI_BATTERY is not set
++# CONFIG_BATTERY_BQ27x00 is not set
++CONFIG_HWMON=y
++# CONFIG_HWMON_VID is not set
++# CONFIG_SENSORS_AD7414 is not set
++# CONFIG_SENSORS_AD7418 is not set
++# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
++# CONFIG_SENSORS_ADT7470 is not set
++# CONFIG_SENSORS_ADT7473 is not set
++# CONFIG_SENSORS_ADT7475 is not set
++# CONFIG_SENSORS_ATXP1 is not set
++# CONFIG_SENSORS_DS1621 is not set
++# CONFIG_SENSORS_F71805F is not set
++# CONFIG_SENSORS_F71882FG is not set
++# CONFIG_SENSORS_F75375S 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_LM70 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_LTC4245 is not set
++# CONFIG_SENSORS_MAX1111 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_ADS7828 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_W83L786NG is not set
++# CONFIG_SENSORS_W83627HF is not set
++# CONFIG_SENSORS_W83627EHF is not set
++# CONFIG_SENSORS_TSC210X is not set
++CONFIG_SENSORS_OMAP34XX=y
++# CONFIG_HWMON_DEBUG_CHIP is not set
++# CONFIG_THERMAL is not set
++# CONFIG_THERMAL_HWMON is not set
++CONFIG_WATCHDOG=y
++CONFIG_WATCHDOG_NOWAYOUT=y
++
++#
++# Watchdog Device Drivers
++#
++# CONFIG_SOFT_WATCHDOG is not set
++CONFIG_OMAP_WATCHDOG=y
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_CORE is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_TPS65010 is not set
++CONFIG_TWL4030_CORE=y
++# CONFIG_TWL4030_POWER is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_PCF50633 is not set
++
++#
++# Multimedia devices
++#
++
++#
++# Multimedia core support
++#
++CONFIG_VIDEO_DEV=m
++CONFIG_VIDEO_V4L2_COMMON=m
++CONFIG_VIDEO_ALLOW_V4L1=y
++CONFIG_VIDEO_V4L1_COMPAT=y
++CONFIG_DVB_CORE=m
++CONFIG_VIDEO_MEDIA=m
++
++#
++# Multimedia drivers
++#
++CONFIG_MEDIA_ATTACH=y
++CONFIG_MEDIA_TUNER=m
++# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
++CONFIG_MEDIA_TUNER_SIMPLE=m
++CONFIG_MEDIA_TUNER_TDA8290=m
++CONFIG_MEDIA_TUNER_TDA9887=m
++CONFIG_MEDIA_TUNER_TEA5761=m
++CONFIG_MEDIA_TUNER_TEA5767=m
++CONFIG_MEDIA_TUNER_MT20XX=m
++CONFIG_MEDIA_TUNER_XC2028=m
++CONFIG_MEDIA_TUNER_XC5000=m
++CONFIG_VIDEO_V4L2=m
++CONFIG_VIDEO_V4L1=m
++CONFIG_VIDEO_CAPTURE_DRIVERS=y
++# CONFIG_VIDEO_ADV_DEBUG is not set
++# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
++CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
++# CONFIG_VIDEO_VIVI is not set
++# CONFIG_VIDEO_CPIA is not set
++# CONFIG_VIDEO_SAA5246A is not set
++# CONFIG_VIDEO_SAA5249 is not set
++# CONFIG_SOC_CAMERA is not set
++CONFIG_RADIO_ADAPTERS=y
++# CONFIG_RADIO_TEA5764 is not set
++# CONFIG_DVB_DYNAMIC_MINORS is not set
++CONFIG_DVB_CAPTURE_DRIVERS=y
++# CONFIG_TTPCI_EEPROM is not set
++# CONFIG_DVB_B2C2_FLEXCOP is not set
++
++#
++# Supported DVB Frontends
++#
++
++#
++# Customise DVB Frontends
++#
++# CONFIG_DVB_FE_CUSTOMISE is not set
++
++#
++# Multistandard (satellite) frontends
++#
++# CONFIG_DVB_STB0899 is not set
++# CONFIG_DVB_STB6100 is not set
++
++#
++# DVB-S (satellite) frontends
++#
++CONFIG_DVB_CX24110=m
++CONFIG_DVB_CX24123=m
++CONFIG_DVB_MT312=m
++CONFIG_DVB_S5H1420=m
++# CONFIG_DVB_STV0288 is not set
++# CONFIG_DVB_STB6000 is not set
++CONFIG_DVB_STV0299=m
++CONFIG_DVB_TDA8083=m
++CONFIG_DVB_TDA10086=m
++# CONFIG_DVB_TDA8261 is not set
++CONFIG_DVB_VES1X93=m
++CONFIG_DVB_TUNER_ITD1000=m
++# CONFIG_DVB_TUNER_CX24113 is not set
++CONFIG_DVB_TDA826X=m
++CONFIG_DVB_TUA6100=m
++# CONFIG_DVB_CX24116 is not set
++# CONFIG_DVB_SI21XX is not set
++
++#
++# DVB-T (terrestrial) frontends
++#
++CONFIG_DVB_SP8870=m
++CONFIG_DVB_SP887X=m
++CONFIG_DVB_CX22700=m
++CONFIG_DVB_CX22702=m
++# CONFIG_DVB_DRX397XD is not set
++CONFIG_DVB_L64781=m
++CONFIG_DVB_TDA1004X=m
++CONFIG_DVB_NXT6000=m
++CONFIG_DVB_MT352=m
++CONFIG_DVB_ZL10353=m
++CONFIG_DVB_DIB3000MB=m
++CONFIG_DVB_DIB3000MC=m
++CONFIG_DVB_DIB7000M=m
++CONFIG_DVB_DIB7000P=m
++CONFIG_DVB_TDA10048=m
++
++#
++# DVB-C (cable) frontends
++#
++CONFIG_DVB_VES1820=m
++CONFIG_DVB_TDA10021=m
++CONFIG_DVB_TDA10023=m
++CONFIG_DVB_STV0297=m
++
++#
++# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
++#
++CONFIG_DVB_NXT200X=m
++# CONFIG_DVB_OR51211 is not set
++# CONFIG_DVB_OR51132 is not set
++CONFIG_DVB_BCM3510=m
++CONFIG_DVB_LGDT330X=m
++# CONFIG_DVB_LGDT3304 is not set
++CONFIG_DVB_S5H1409=m
++CONFIG_DVB_AU8522=m
++CONFIG_DVB_S5H1411=m
++
++#
++# ISDB-T (terrestrial) frontends
++#
++# CONFIG_DVB_S921 is not set
++
++#
++# Digital terrestrial only tuners/PLL
++#
++CONFIG_DVB_PLL=m
++CONFIG_DVB_TUNER_DIB0070=m
++
++#
++# SEC control devices for DVB-S
++#
++CONFIG_DVB_LNBP21=m
++# CONFIG_DVB_ISL6405 is not set
++CONFIG_DVB_ISL6421=m
++# CONFIG_DVB_LGS8GL5 is not set
++
++#
++# Tools to develop new frontends
++#
++# CONFIG_DVB_DUMMY_FE is not set
++# CONFIG_DVB_AF9013 is not set
++# CONFIG_DAB is not set
++
++#
++# Graphics support
++#
++# 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_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=m
++CONFIG_FB_CFB_COPYAREA=m
++CONFIG_FB_CFB_IMAGEBLIT=m
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# 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_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
++CONFIG_OMAP2_DSS=m
++CONFIG_OMAP2_DSS_VRAM_SIZE=12
++CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
++# CONFIG_OMAP2_DSS_RFBI is not set
++CONFIG_OMAP2_DSS_VENC=y
++# CONFIG_OMAP2_DSS_SDI is not set
++# CONFIG_OMAP2_DSS_DSI is not set
++# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
++CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
++
++#
++# OMAP2/3 Display Device Drivers
++#
++CONFIG_PANEL_GENERIC=m
++CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C=m
++# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
++# CONFIG_PANEL_N800 is not set
++# CONFIG_CTRL_BLIZZARD is not set
++CONFIG_FB_OMAP2=m
++CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
++# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
++CONFIG_FB_OMAP2_NUM_FBS=3
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++
++#
++# Display device support
++#
++CONFIG_DISPLAY_SUPPORT=y
++
++#
++# Display hardware drivers
++#
++
++#
++# Console display driver support
++#
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_DUMMY_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE is not set
++# CONFIG_LOGO is not set
++CONFIG_SOUND=y
++CONFIG_SOUND_OSS_CORE=y
++CONFIG_SND=y
++CONFIG_SND_TIMER=y
++CONFIG_SND_PCM=y
++CONFIG_SND_SEQUENCER=m
++# CONFIG_SND_SEQ_DUMMY is not set
++CONFIG_SND_OSSEMUL=y
++CONFIG_SND_MIXER_OSS=y
++CONFIG_SND_PCM_OSS=y
++CONFIG_SND_PCM_OSS_PLUGINS=y
++CONFIG_SND_SEQUENCER_OSS=y
++# CONFIG_SND_HRTIMER 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=y
++CONFIG_SND_DEBUG=y
++# CONFIG_SND_DEBUG_VERBOSE is not set
++# CONFIG_SND_PCM_XRUN_DEBUG is not set
++CONFIG_SND_DRIVERS=y
++# CONFIG_SND_DUMMY is not set
++# CONFIG_SND_VIRMIDI is not set
++# CONFIG_SND_MTPAV is not set
++# CONFIG_SND_SERIAL_U16550 is not set
++# CONFIG_SND_MPU401 is not set
++CONFIG_SND_ARM=y
++CONFIG_SND_SPI=y
++CONFIG_SND_SOC=y
++CONFIG_SND_OMAP_SOC=y
++CONFIG_SND_OMAP_SOC_MCBSP=y
++CONFIG_SND_OMAP_SOC_OVERO=y
++CONFIG_SND_SOC_I2C_AND_SPI=y
++# CONFIG_SND_SOC_ALL_CODECS is not set
++CONFIG_SND_SOC_TWL4030=y
++# CONFIG_SOUND_PRIME is not set
++CONFIG_HID_SUPPORT=y
++CONFIG_HID=y
++CONFIG_HID_DEBUG=y
++# CONFIG_HIDRAW is not set
++# CONFIG_HID_PID is not set
++
++#
++# Special HID drivers
++#
++CONFIG_HID_COMPAT=y
++# CONFIG_HID_APPLE is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++CONFIG_USB_ARCH_HAS_EHCI=y
++# CONFIG_USB is not set
++# CONFIG_USB_OTG_WHITELIST is not set
++# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_MUSB_HDRC=y
++CONFIG_USB_MUSB_SOC=y
++
++#
++# OMAP 343x high speed USB support
++#
++# CONFIG_USB_MUSB_HOST is not set
++CONFIG_USB_MUSB_PERIPHERAL=y
++# CONFIG_USB_MUSB_OTG is not set
++CONFIG_USB_GADGET_MUSB_HDRC=y
++# CONFIG_MUSB_PIO_ONLY is not set
++CONFIG_USB_INVENTRA_DMA=y
++# CONFIG_USB_TI_CPPI_DMA is not set
++# CONFIG_USB_MUSB_DEBUG is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++#
++CONFIG_USB_GADGET=y
++# CONFIG_USB_GADGET_DEBUG is not set
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
++# CONFIG_USB_GADGET_DEBUG_FS is not set
++CONFIG_USB_GADGET_VBUS_DRAW=2
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_AT91 is not set
++# CONFIG_USB_GADGET_ATMEL_USBA is not set
++# CONFIG_USB_GADGET_FSL_USB2 is not set
++# CONFIG_USB_GADGET_LH7A40X is not set
++# CONFIG_USB_GADGET_OMAP is not set
++# CONFIG_USB_GADGET_PXA25X is not set
++# CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C2410 is not set
++# CONFIG_USB_GADGET_IMX is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_AMD5536UDC is not set
++# CONFIG_USB_GADGET_FSL_QE is not set
++# CONFIG_USB_GADGET_CI13XXX is not set
++# CONFIG_USB_GADGET_NET2280 is not set
++# CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++CONFIG_USB_GADGET_DUALSPEED=y
++# CONFIG_USB_ZERO is not set
++CONFIG_USB_ETH=y
++CONFIG_USB_ETH_RNDIS=y
++# CONFIG_USB_GADGETFS is not set
++# CONFIG_USB_FILE_STORAGE is not set
++# CONFIG_USB_G_SERIAL is not set
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++
++#
++# OTG and related infrastructure
++#
++CONFIG_USB_OTG_UTILS=y
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_ISP1301_OMAP is not set
++CONFIG_TWL4030_USB=y
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++CONFIG_MMC_UNSAFE_RESUME=y
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_BOUNCE=y
++CONFIG_SDIO_UART=y
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++CONFIG_MMC_OMAP_HS=y
++# CONFIG_MMC_SPI is not set
++# CONFIG_MEMSTICK is not set
++# CONFIG_ACCESSIBILITY is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++# CONFIG_LEDS_OMAP_DEBUG is not set
++# CONFIG_LEDS_OMAP is not set
++# CONFIG_LEDS_OMAP_PWM is not set
++# CONFIG_LEDS_PCA9532 is not set
++CONFIG_LEDS_GPIO=y
++# CONFIG_LEDS_LP5521 is not set
++# CONFIG_LEDS_PCA955X is not set
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGERS=y
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++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
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# 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
++CONFIG_RTC_DRV_TWL4030=y
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++
++#
++# SPI RTC drivers
++#
++# CONFIG_RTC_DRV_M41T94 is not set
++# CONFIG_RTC_DRV_DS1305 is not set
++# CONFIG_RTC_DRV_DS1390 is not set
++# CONFIG_RTC_DRV_MAX6902 is not set
++# CONFIG_RTC_DRV_R9701 is not set
++# CONFIG_RTC_DRV_RS5C348 is not set
++# CONFIG_RTC_DRV_DS3234 is not set
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_DMADEVICES is not set
++CONFIG_REGULATOR=y
++# CONFIG_REGULATOR_DEBUG is not set
++# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_BQ24022 is not set
++CONFIG_REGULATOR_TWL4030=y
++# CONFIG_UIO is not set
++# CONFIG_STAGING is not set
++
++#
++# CBUS support
++#
++# CONFIG_CBUS is not set
++
++#
++# 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 is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++CONFIG_FS_POSIX_ACL=y
++CONFIG_FILE_LOCKING=y
++CONFIG_XFS_FS=m
++# CONFIG_XFS_QUOTA is not set
++# CONFIG_XFS_POSIX_ACL is not set
++# CONFIG_XFS_RT is not set
++# CONFIG_XFS_DEBUG is not set
++# CONFIG_GFS2_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++CONFIG_DNOTIFY=y
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++CONFIG_QUOTA=y
++# CONFIG_QUOTA_NETLINK_INTERFACE is not set
++CONFIG_PRINT_QUOTA_WARNING=y
++CONFIG_QUOTA_TREE=y
++# CONFIG_QFMT_V1 is not set
++CONFIG_QFMT_V2=y
++CONFIG_QUOTACTL=y
++# CONFIG_AUTOFS_FS is not set
++# CONFIG_AUTOFS4_FS is not set
++CONFIG_FUSE_FS=m
++
++#
++# CD-ROM/DVD Filesystems
++#
++CONFIG_ISO9660_FS=m
++CONFIG_JOLIET=y
++CONFIG_ZISOFS=y
++CONFIG_UDF_FS=m
++CONFIG_UDF_NLS=y
++
++#
++# 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_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# 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_FS_WBUF_VERIFY is not set
++CONFIG_JFFS2_SUMMARY=y
++CONFIG_JFFS2_FS_XATTR=y
++CONFIG_JFFS2_FS_POSIX_ACL=y
++CONFIG_JFFS2_FS_SECURITY=y
++CONFIG_JFFS2_COMPRESSION_OPTIONS=y
++CONFIG_JFFS2_ZLIB=y
++CONFIG_JFFS2_LZO=y
++CONFIG_JFFS2_RTIME=y
++CONFIG_JFFS2_RUBIN=y
++# CONFIG_JFFS2_CMODE_NONE is not set
++CONFIG_JFFS2_CMODE_PRIORITY=y
++# CONFIG_JFFS2_CMODE_SIZE is not set
++# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++CONFIG_NETWORK_FILESYSTEMS=y
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++CONFIG_NFS_V4=y
++CONFIG_ROOT_NFS=y
++# CONFIG_NFSD is not set
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_EXPORTFS=m
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++CONFIG_SUNRPC_GSS=y
++# CONFIG_SUNRPC_REGISTER_V4 is not set
++CONFIG_RPCSEC_GSS_KRB5=y
++# CONFIG_RPCSEC_GSS_SPKM3 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=y
++# CONFIG_ACORN_PARTITION is not set
++# CONFIG_OSF_PARTITION is not set
++# CONFIG_AMIGA_PARTITION is not set
++# CONFIG_ATARI_PARTITION is not set
++# CONFIG_MAC_PARTITION is not set
++CONFIG_MSDOS_PARTITION=y
++# CONFIG_BSD_DISKLABEL is not set
++# CONFIG_MINIX_SUBPARTITION is not set
++# CONFIG_SOLARIS_X86_PARTITION is not set
++# CONFIG_UNIXWARE_DISKLABEL is not set
++# CONFIG_LDM_PARTITION is not set
++# CONFIG_SGI_PARTITION is not set
++# CONFIG_ULTRIX_PARTITION is not set
++# CONFIG_SUN_PARTITION is not set
++# CONFIG_KARMA_PARTITION is not set
++# CONFIG_EFI_PARTITION is not set
++# CONFIG_SYSV68_PARTITION is not set
++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
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_WARN_DEPRECATED=y
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_FRAME_WARN=1024
++CONFIG_MAGIC_SYSRQ=y
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++CONFIG_DEBUG_KERNEL=y
++# CONFIG_DEBUG_SHIRQ is not set
++CONFIG_DETECT_SOFTLOCKUP=y
++# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
++CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_SCHED_DEBUG=y
++CONFIG_SCHEDSTATS=y
++CONFIG_TIMER_STATS=y
++# CONFIG_DEBUG_OBJECTS is not set
++# CONFIG_SLUB_DEBUG_ON is not set
++# CONFIG_SLUB_STATS 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=y
++# 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_STACKTRACE=y
++# CONFIG_DEBUG_KOBJECT is not set
++CONFIG_DEBUG_BUGVERBOSE=y
++# CONFIG_DEBUG_INFO is not set
++# CONFIG_DEBUG_VM is not set
++# CONFIG_DEBUG_WRITECOUNT is not set
++# CONFIG_DEBUG_MEMORY_INIT is not set
++# CONFIG_DEBUG_LIST is not set
++# CONFIG_DEBUG_SG is not set
++# CONFIG_DEBUG_NOTIFIERS is not set
++CONFIG_FRAME_POINTER=y
++# CONFIG_BOOT_PRINTK_DELAY is not set
++# CONFIG_RCU_TORTURE_TEST is not set
++# CONFIG_RCU_CPU_STALL_DETECTOR is not set
++# CONFIG_BACKTRACE_SELF_TEST is not set
++# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
++# CONFIG_FAULT_INJECTION is not set
++# CONFIG_LATENCYTOP is not set
++CONFIG_NOP_TRACER=y
++CONFIG_HAVE_FUNCTION_TRACER=y
++CONFIG_RING_BUFFER=y
++CONFIG_TRACING=y
++
++#
++# Tracers
++#
++# CONFIG_FUNCTION_TRACER is not set
++# CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_SCHED_TRACER is not set
++# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_BOOT_TRACER is not set
++# CONFIG_TRACE_BRANCH_PROFILING is not set
++# CONFIG_STACK_TRACER is not set
++# CONFIG_FTRACE_STARTUP_TEST is not set
++# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_KGDB is not set
++CONFIG_DEBUG_USER=y
++CONFIG_DEBUG_ERRORS=y
++# CONFIG_DEBUG_STACK_USAGE is not set
++# CONFIG_DEBUG_LL is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++# CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_XOR_BLOCKS=m
++CONFIG_ASYNC_CORE=m
++CONFIG_ASYNC_MEMCPY=m
++CONFIG_ASYNC_XOR=m
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++# CONFIG_CRYPTO_FIPS is not set
++CONFIG_CRYPTO_ALGAPI=y
++CONFIG_CRYPTO_ALGAPI2=y
++CONFIG_CRYPTO_AEAD2=y
++CONFIG_CRYPTO_BLKCIPHER=y
++CONFIG_CRYPTO_BLKCIPHER2=y
++CONFIG_CRYPTO_HASH=y
++CONFIG_CRYPTO_HASH2=y
++CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_MANAGER=y
++CONFIG_CRYPTO_MANAGER2=y
++CONFIG_CRYPTO_GF128MUL=m
++CONFIG_CRYPTO_NULL=m
++CONFIG_CRYPTO_CRYPTD=m
++# CONFIG_CRYPTO_AUTHENC is not set
++CONFIG_CRYPTO_TEST=m
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++CONFIG_CRYPTO_CBC=y
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++CONFIG_CRYPTO_ECB=y
++CONFIG_CRYPTO_LRW=m
++CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++CONFIG_CRYPTO_HMAC=m
++CONFIG_CRYPTO_XCBC=m
++
++#
++# Digest
++#
++CONFIG_CRYPTO_CRC32C=y
++CONFIG_CRYPTO_MD4=m
++CONFIG_CRYPTO_MD5=y
++CONFIG_CRYPTO_MICHAEL_MIC=y
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++CONFIG_CRYPTO_SHA1=m
++CONFIG_CRYPTO_SHA256=m
++CONFIG_CRYPTO_SHA512=m
++CONFIG_CRYPTO_TGR192=m
++CONFIG_CRYPTO_WP512=m
++
++#
++# Ciphers
++#
++CONFIG_CRYPTO_AES=y
++CONFIG_CRYPTO_ANUBIS=m
++CONFIG_CRYPTO_ARC4=y
++CONFIG_CRYPTO_BLOWFISH=m
++CONFIG_CRYPTO_CAMELLIA=m
++CONFIG_CRYPTO_CAST5=m
++CONFIG_CRYPTO_CAST6=m
++CONFIG_CRYPTO_DES=y
++CONFIG_CRYPTO_FCRYPT=m
++CONFIG_CRYPTO_KHAZAD=m
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++CONFIG_CRYPTO_SERPENT=m
++CONFIG_CRYPTO_TEA=m
++CONFIG_CRYPTO_TWOFISH=m
++CONFIG_CRYPTO_TWOFISH_COMMON=m
++
++#
++# Compression
++#
++CONFIG_CRYPTO_DEFLATE=m
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_HW=y
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=y
++CONFIG_CRC16=m
++CONFIG_CRC_T10DIF=y
++CONFIG_CRC_ITU_T=y
++CONFIG_CRC32=y
++CONFIG_CRC7=y
++CONFIG_LIBCRC32C=y
++CONFIG_ZLIB_INFLATE=y
++CONFIG_ZLIB_DEFLATE=y
++CONFIG_LZO_COMPRESS=y
++CONFIG_LZO_DECOMPRESS=y
++CONFIG_PLIST=y
++CONFIG_HAS_IOMEM=y
++CONFIG_HAS_IOPORT=y
++CONFIG_HAS_DMA=y
+diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
+index 21b4a52..2ee6cbb 100644
+--- a/arch/arm/mach-omap2/board-3430sdp.c
++++ b/arch/arm/mach-omap2/board-3430sdp.c
+@@ -36,6 +36,7 @@
+ #include <mach/common.h>
+ #include <mach/dma.h>
+ #include <mach/gpmc.h>
++#include <mach/display.h>
+
+ #include <mach/control.h>
+ #include <mach/keypad.h>
+@@ -148,6 +149,35 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
+ },
+ };
+
++
++#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
++#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
++#if 0
++#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 24
++#define SDP3430_LCD_PANEL_ENABLE_GPIO 28
++#else
++#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
++#define SDP3430_LCD_PANEL_ENABLE_GPIO 5
++#endif
++
++#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
++#define ENABLE_VAUX2_DEDICATED 0x09
++#define ENABLE_VAUX2_DEV_GRP 0x20
++#define ENABLE_VAUX3_DEDICATED 0x03
++#define ENABLE_VAUX3_DEV_GRP 0x20
++
++#define ENABLE_VPLL2_DEDICATED 0x05
++#define ENABLE_VPLL2_DEV_GRP 0xE0
++#define TWL4030_VPLL2_DEV_GRP 0x33
++#define TWL4030_VPLL2_DEDICATED 0x36
++
++#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v)
++
++static unsigned backlight_gpio;
++static unsigned enable_gpio;
++static int lcd_enabled;
++static int dvi_enabled;
++
+ static struct platform_device sdp3430_lcd_device = {
+ .name = "sdp2430_lcd",
+ .id = -1,
+@@ -163,8 +193,197 @@ static struct regulator_consumer_supply sdp3430_vdvi_supply = {
+ .dev = &sdp3430_lcd_device.dev,
+ };
+
++static void enable_vpll2(int enable)
++{
++ u8 ded_val, grp_val;
++
++ if (enable) {
++ ded_val = ENABLE_VPLL2_DEDICATED;
++ grp_val = ENABLE_VPLL2_DEV_GRP;
++ } else {
++ ded_val = 0;
++ grp_val = 0;
++ }
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ded_val, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ grp_val, TWL4030_VPLL2_DEV_GRP);
++}
++
++static int sdp3430_dsi_power_up(void)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0)
++ enable_vpll2(1);
++ return 0;
++}
++
++static void sdp3430_dsi_power_down(void)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0)
++ enable_vpll2(0);
++}
++
++static void __init sdp3430_display_init(void)
++{
++ int r;
++
++ enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO;
++ backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
++
++ r = gpio_request(enable_gpio, "LCD reset");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD reset GPIO\n");
++ goto err0;
++ }
++
++ r = gpio_request(backlight_gpio, "LCD Backlight");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD backlight GPIO\n");
++ goto err1;
++ }
++
++ gpio_direction_output(enable_gpio, 0);
++ gpio_direction_output(backlight_gpio, 0);
++
++ return;
++err1:
++ gpio_free(enable_gpio);
++err0:
++ return;
++}
++
++static int sdp3430_panel_enable_lcd(struct omap_display *display)
++{
++ u8 ded_val, ded_reg;
++ u8 grp_val, grp_reg;
++
++ if (dvi_enabled) {
++ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
++ return -EINVAL;
++ }
++
++ ded_reg = TWL4030_VAUX3_DEDICATED;
++ ded_val = ENABLE_VAUX3_DEDICATED;
++ grp_reg = TWL4030_VAUX3_DEV_GRP;
++ grp_val = ENABLE_VAUX3_DEV_GRP;
++
++ gpio_direction_output(enable_gpio, 1);
++ gpio_direction_output(backlight_gpio, 1);
++
++ if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg))
++ return -EIO;
++ if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg))
++ return -EIO;
++
++ sdp3430_dsi_power_up();
++
++ lcd_enabled = 1;
++
++ return 0;
++}
++
++static void sdp3430_panel_disable_lcd(struct omap_display *display)
++{
++ lcd_enabled = 0;
++
++ sdp3430_dsi_power_down();
++
++ gpio_direction_output(enable_gpio, 0);
++ gpio_direction_output(backlight_gpio, 0);
++}
++
++static struct omap_dss_display_config sdp3430_display_data = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "lcd",
++ .panel_name = "sharp-ls037v7dw01",
++ .u.dpi.data_lines = 16,
++ .panel_enable = sdp3430_panel_enable_lcd,
++ .panel_disable = sdp3430_panel_disable_lcd,
++};
++
++static int sdp3430_panel_enable_dvi(struct omap_display *display)
++{
++ if (lcd_enabled) {
++ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
++ return -EINVAL;
++ }
++
++ sdp3430_dsi_power_up();
++
++ dvi_enabled = 1;
++
++ return 0;
++}
++
++static void sdp3430_panel_disable_dvi(struct omap_display *display)
++{
++ sdp3430_dsi_power_down();
++
++ dvi_enabled = 0;
++}
++
++
++static struct omap_dss_display_config sdp3430_display_data_dvi = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .panel_name = "panel-generic",
++ .u.dpi.data_lines = 24,
++ .panel_enable = sdp3430_panel_enable_dvi,
++ .panel_disable = sdp3430_panel_disable_dvi,
++};
++
++static int sdp3430_panel_enable_tv(struct omap_display *display)
++{
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++
++ return 0;
++}
++
++static void sdp3430_panel_disable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_dss_display_config sdp3430_display_data_tv = {
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .name = "tv",
++ .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .panel_enable = sdp3430_panel_enable_tv,
++ .panel_disable = sdp3430_panel_disable_tv,
++};
++
++static struct omap_dss_board_info sdp3430_dss_data = {
++ .dsi_power_up = sdp3430_dsi_power_up,
++ .dsi_power_down = sdp3430_dsi_power_down,
++ .num_displays = 3,
++ .displays = {
++ &sdp3430_display_data,
++ &sdp3430_display_data_dvi,
++ &sdp3430_display_data_tv,
++ }
++};
++
++static struct platform_device sdp3430_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &sdp3430_dss_data,
++ },
++};
++
+ static struct platform_device *sdp3430_devices[] __initdata = {
+- &sdp3430_lcd_device,
++ &sdp3430_dss_device,
+ };
+
+ static void __init omap_3430sdp_init_irq(void)
+@@ -178,13 +397,8 @@ static struct omap_uart_config sdp3430_uart_config __initdata = {
+ .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
+ };
+
+-static struct omap_lcd_config sdp3430_lcd_config __initdata = {
+- .ctrl_name = "internal",
+-};
+-
+ static struct omap_board_config_kernel sdp3430_config[] __initdata = {
+ { OMAP_TAG_UART, &sdp3430_uart_config },
+- { OMAP_TAG_LCD, &sdp3430_lcd_config },
+ };
+
+ static int sdp3430_batt_table[] = {
+@@ -496,6 +710,7 @@ static void __init omap_3430sdp_init(void)
+ usb_musb_init();
+ board_smc91x_init();
+ usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
++ sdp3430_display_init();
+ }
+
+ static void __init omap_3430sdp_map_io(void)
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index b6a68d5..c2c76b0 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -30,6 +30,7 @@
+
+ #include <linux/regulator/machine.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/omapfb.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -44,6 +45,7 @@
+ #include <mach/mux.h>
+ #include <mach/usb.h>
+ #include <mach/timer-gp.h>
++#include <mach/display.h>
+
+ #include "mmc-twl4030.h"
+
+@@ -343,13 +345,94 @@ static struct platform_device keys_gpio = {
+ },
+ };
+
++/* DSS */
++
++static int beagle_enable_dvi(struct omap_display *display)
++{
++ if (display->hw_config.panel_reset_gpio != -1)
++ gpio_direction_output(display->hw_config.panel_reset_gpio, 1);
++
++ return 0;
++}
++
++static void beagle_disable_dvi(struct omap_display *display)
++{
++ if (display->hw_config.panel_reset_gpio != -1)
++ gpio_direction_output(display->hw_config.panel_reset_gpio, 0);
++}
++
++static struct omap_dss_display_config beagle_display_data_dvi = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .panel_name = "panel-generic",
++ .u.dpi.data_lines = 24,
++ .panel_reset_gpio = 170,
++ .panel_enable = beagle_enable_dvi,
++ .panel_disable = beagle_disable_dvi,
++};
++
++
++static int beagle_panel_enable_tv(struct omap_display *display)
++{
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++
++ return 0;
++}
++
++static void beagle_panel_disable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_dss_display_config beagle_display_data_tv = {
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .name = "tv",
++ .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .panel_enable = beagle_panel_enable_tv,
++ .panel_disable = beagle_panel_disable_tv,
++};
++
++static struct omap_dss_board_info beagle_dss_data = {
++ .num_displays = 2,
++ .displays = {
++ &beagle_display_data_dvi,
++ &beagle_display_data_tv,
++ }
++};
++
++static struct platform_device beagle_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &beagle_dss_data,
++ },
++};
++
++static void __init beagle_display_init(void)
++{
++ int r;
++
++ r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
++ if (r < 0)
++ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
++}
++
+ static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
+ { OMAP_TAG_UART, &omap3_beagle_uart_config },
+- { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
+ };
+
+ static struct platform_device *omap3_beagle_devices[] __initdata = {
+- &omap3_beagle_lcd_device,
++ &beagle_dss_device,
+ &leds_gpio,
+ &keys_gpio,
+ };
+@@ -402,13 +485,11 @@ static void __init omap3_beagle_init(void)
+ omap_serial_init();
+
+ omap_cfg_reg(J25_34XX_GPIO170);
+- gpio_request(170, "DVI_nPD");
+- /* REVISIT leave DVI powered down until it's needed ... */
+- gpio_direction_output(170, true);
+
+ usb_musb_init();
+ usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
+ omap3beagle_flash_init();
++ beagle_display_init();
+ }
+
+ static void __init omap3_beagle_map_io(void)
+diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
+index 595beac..dffb8b9 100644
+--- a/arch/arm/mach-omap2/board-omap3evm.c
++++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -37,6 +37,7 @@
+ #include <mach/common.h>
+ #include <mach/mcspi.h>
+ #include <mach/keypad.h>
++#include <mach/display.h>
+
+ #include "sdram-micron-mt46h32m32lf-6.h"
+ #include "mmc-twl4030.h"
+@@ -222,13 +223,215 @@ static int __init omap3_evm_i2c_init(void)
+ return 0;
+ }
+
+-static struct platform_device omap3_evm_lcd_device = {
+- .name = "omap3evm_lcd",
+- .id = -1,
++#define LCD_PANEL_LR 2
++#define LCD_PANEL_UD 3
++#define LCD_PANEL_INI 152
++#define LCD_PANEL_ENABLE_GPIO 153
++#define LCD_PANEL_QVGA 154
++#define LCD_PANEL_RESB 155
++
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++#define ENABLE_VPLL2_DEDICATED 0x05
++#define ENABLE_VPLL2_DEV_GRP 0xE0
++
++#define TWL4030_GPIODATA_IN3 0x03
++#define TWL4030_GPIODATA_DIR3 0x06
++#define TWL4030_VPLL2_DEV_GRP 0x33
++#define TWL4030_VPLL2_DEDICATED 0x36
++
++static int lcd_enabled;
++static int dvi_enabled;
++
++static void __init omap3_evm_display_init(void)
++{
++ int r;
++ r = gpio_request(LCD_PANEL_LR, "lcd_panel_lr");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_LR\n");
++ return;
++ }
++ r = gpio_request(LCD_PANEL_UD, "lcd_panel_ud");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_UD\n");
++ goto err_1;
++ }
++
++ r = gpio_request(LCD_PANEL_INI, "lcd_panel_ini");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_INI\n");
++ goto err_2;
++ }
++ r = gpio_request(LCD_PANEL_RESB, "lcd_panel_resb");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_RESB\n");
++ goto err_3;
++ }
++ r = gpio_request(LCD_PANEL_QVGA, "lcd_panel_qvga");
++ if (r) {
++ printk(KERN_ERR "failed to get LCD_PANEL_QVGA\n");
++ goto err_4;
++ }
++
++ gpio_direction_output(LCD_PANEL_LR, 0);
++ gpio_direction_output(LCD_PANEL_UD, 0);
++ gpio_direction_output(LCD_PANEL_INI, 0);
++ gpio_direction_output(LCD_PANEL_RESB, 0);
++ gpio_direction_output(LCD_PANEL_QVGA, 0);
++
++#define TWL_LED_LEDEN 0x00
++#define TWL_PWMA_PWMAON 0x00
++#define TWL_PWMA_PWMAOFF 0x01
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF);
++
++ gpio_direction_output(LCD_PANEL_RESB, 1);
++ gpio_direction_output(LCD_PANEL_INI, 1);
++ gpio_direction_output(LCD_PANEL_QVGA, 0);
++ gpio_direction_output(LCD_PANEL_LR, 1);
++ gpio_direction_output(LCD_PANEL_UD, 1);
++
++ return;
++
++err_4:
++ gpio_free(LCD_PANEL_RESB);
++err_3:
++ gpio_free(LCD_PANEL_INI);
++err_2:
++ gpio_free(LCD_PANEL_UD);
++err_1:
++ gpio_free(LCD_PANEL_LR);
++
++}
++
++static int omap3_evm_panel_enable_lcd(struct omap_display *display)
++{
++ if (dvi_enabled) {
++ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
++ return -EINVAL;
++ }
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
++ }
++ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
++ lcd_enabled = 1;
++ return 0;
++}
++
++static void omap3_evm_panel_disable_lcd(struct omap_display *display)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEV_GRP);
++ }
++ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
++ lcd_enabled = 0;
++}
++
++static struct omap_dss_display_config omap3_evm_display_data = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "lcd",
++ .panel_name = "sharp-ls037v7dw01",
++ .u.dpi.data_lines = 18,
++ .panel_enable = omap3_evm_panel_enable_lcd,
++ .panel_disable = omap3_evm_panel_disable_lcd,
+ };
+
+-static struct omap_lcd_config omap3_evm_lcd_config __initdata = {
+- .ctrl_name = "internal",
++static int omap3_evm_panel_enable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED, TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++ return 0;
++}
++
++static void omap3_evm_panel_disable_tv(struct omap_display *display)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_dss_display_config omap3_evm_display_data_tv = {
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .name = "tv",
++ .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .panel_enable = omap3_evm_panel_enable_tv,
++ .panel_disable = omap3_evm_panel_disable_tv,
++};
++
++
++static int omap3_evm_panel_enable_dvi(struct omap_display *display)
++{
++ if (lcd_enabled) {
++ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
++ return -EINVAL;
++ }
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
++ }
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
++ TWL4030_GPIODATA_IN3);
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
++ TWL4030_GPIODATA_DIR3);
++ dvi_enabled = 1;
++
++ return 0;
++}
++
++static void omap3_evm_panel_disable_dvi(struct omap_display *display)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0) {
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
++ TWL4030_VPLL2_DEV_GRP);
++ }
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
++ TWL4030_GPIODATA_IN3);
++ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
++ TWL4030_GPIODATA_DIR3);
++ dvi_enabled = 0;
++}
++
++
++static struct omap_dss_display_config omap3_evm_display_data_dvi = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .panel_name = "panel-generic",
++ .u.dpi.data_lines = 24,
++ .panel_enable = omap3_evm_panel_enable_dvi,
++ .panel_disable = omap3_evm_panel_disable_dvi,
++};
++
++static struct omap_dss_board_info omap3_evm_dss_data = {
++ .num_displays = 3,
++ .displays = {
++ &omap3_evm_display_data,
++ &omap3_evm_display_data_dvi,
++ &omap3_evm_display_data_tv,
++ }
++};
++static struct platform_device omap3_evm_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &omap3_evm_dss_data,
++ },
+ };
+
+ static void ads7846_dev_init(void)
+@@ -287,11 +490,10 @@ static void __init omap3_evm_init_irq(void)
+
+ static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
+ { OMAP_TAG_UART, &omap3_evm_uart_config },
+- { OMAP_TAG_LCD, &omap3_evm_lcd_config },
+ };
+
+ static struct platform_device *omap3_evm_devices[] __initdata = {
+- &omap3_evm_lcd_device,
++ &omap3_evm_dss_device,
+ &omap3evm_smc911x_device,
+ };
+
+@@ -310,6 +512,7 @@ static void __init omap3_evm_init(void)
+ usb_musb_init();
+ usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, true, true, 57, 61);
+ ads7846_dev_init();
++ omap3_evm_display_init();
+ }
+
+ static void __init omap3_evm_map_io(void)
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 501d020..7bcac03 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -40,6 +40,7 @@
+
+ #include <mach/board.h>
+ #include <mach/common.h>
++#include <mach/display.h>
+ #include <mach/gpio.h>
+ #include <mach/gpmc.h>
+ #include <mach/hardware.h>
+@@ -182,6 +183,9 @@ static inline void __init overo_init_smsc911x(void)
+ static inline void __init overo_init_smsc911x(void) { return; }
+ #endif
+
++static int lcd_enabled;
++static int dvi_enabled;
++
+ static struct mtd_partition overo_nand_partitions[] = {
+ {
+ .name = "xloader",
+@@ -365,22 +369,101 @@ static void __init overo_init_irq(void)
+ omap_gpio_init();
+ }
+
+-static struct platform_device overo_lcd_device = {
+- .name = "overo_lcd",
+- .id = -1,
++/* DSS */
++
++#define OVERO_GPIO_LCD_EN 144
++
++static void __init overo_display_init(void)
++{
++ int r;
++
++ r = gpio_request(OVERO_GPIO_LCD_EN, "display enable");
++ if (r)
++ printk("fail1\n");
++ r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1);
++ if (r)
++ printk("fail2\n");
++ gpio_export(OVERO_GPIO_LCD_EN, 0);
++}
++
++static int overo_panel_enable_dvi(struct omap_display *display)
++{
++ if (lcd_enabled) {
++ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
++ return -EINVAL;
++ }
++ dvi_enabled = 1;
++
++ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
++
++ return 0;
++}
++
++static void overo_panel_disable_dvi(struct omap_display *display)
++{
++ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
++
++ dvi_enabled = 0;
++}
++
++static struct omap_dss_display_config overo_display_data_dvi = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .panel_name = "panel-generic",
++ .u.dpi.data_lines = 24,
++ .panel_enable = overo_panel_enable_dvi,
++ .panel_disable = overo_panel_disable_dvi,
+ };
+
+-static struct omap_lcd_config overo_lcd_config __initdata = {
+- .ctrl_name = "internal",
++static int overo_panel_enable_lcd(struct omap_display *display)
++{
++ if (dvi_enabled) {
++ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
++ return -EINVAL;
++ }
++
++ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
++ lcd_enabled = 1;
++ return 0;
++}
++
++static void overo_panel_disable_lcd(struct omap_display *display)
++{
++ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
++ lcd_enabled = 0;
++}
++
++static struct omap_dss_display_config overo_display_data_lcd = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "lcd",
++ .panel_name = "samsung-lte430wq-f0c",
++ .u.dpi.data_lines = 24,
++ .panel_enable = overo_panel_enable_lcd,
++ .panel_disable = overo_panel_disable_lcd,
++ };
++
++static struct omap_dss_board_info overo_dss_data = {
++ .num_displays = 2,
++ .displays = {
++ &overo_display_data_dvi,
++ &overo_display_data_lcd,
++ }
++};
++
++static struct platform_device overo_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &overo_dss_data,
++ },
+ };
+
+ static struct omap_board_config_kernel overo_config[] __initdata = {
+ { OMAP_TAG_UART, &overo_uart_config },
+- { OMAP_TAG_LCD, &overo_lcd_config },
+ };
+
+ static struct platform_device *overo_devices[] __initdata = {
+- &overo_lcd_device,
++ &overo_dss_device,
+ };
+
+ static void __init overo_init(void)
+@@ -395,6 +478,7 @@ static void __init overo_init(void)
+ usb_ehci_init(EHCI_HCD_OMAP_MODE_PHY, false, true, 183, -EINVAL);
+ overo_ads7846_init();
+ overo_init_smsc911x();
++ overo_display_init();
+
+ if ((gpio_request(OVERO_GPIO_W2W_NRESET,
+ "OVERO_GPIO_W2W_NRESET") == 0) &&
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-function-to-display-object-to-get-the-back.patch b/recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-function-to-display-object-to-get-the-back.patch
new file mode 100644
index 0000000000..98537e0ebf
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0007-DSS2-Add-function-to-display-object-to-get-the-back.patch
@@ -0,0 +1,39 @@
+From 5d32a2ba9289a16d950db719330ee57dc9ffa60a Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 1 Apr 2009 14:36:39 +0200
+Subject: [PATCH 007/146] DSS2: Add function to display object to get the backlight level
+
+This is needed by an upcoming patch that changes the backlight
+initialization to use the backlight level set by the bootloader.
+
+Also add a field for the maximum backlight level.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 6288353..6b702c7 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -211,6 +211,8 @@ struct omap_dss_display_config {
+ int panel_reset_gpio;
+ int ctrl_reset_gpio;
+
++ int max_backlight_level;
++
+ const char *name; /* for debug */
+ const char *ctrl_name;
+ const char *panel_name;
+@@ -225,6 +227,7 @@ struct omap_dss_display_config {
+ void (*ctrl_disable)(struct omap_display *display);
+ int (*set_backlight)(struct omap_display *display,
+ int level);
++ int (*get_backlight)(struct omap_display *display);
+ };
+
+ struct device;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-acx565akm-panel.patch b/recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-acx565akm-panel.patch
new file mode 100644
index 0000000000..042a792029
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0008-DSS2-Add-acx565akm-panel.patch
@@ -0,0 +1,778 @@
+From 7591138400ae9112bb5f5d4f4b62b3a1adb69874 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Thu, 2 Apr 2009 11:47:13 +0300
+Subject: [PATCH 008/146] DSS2: Add acx565akm panel
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/displays/Kconfig | 8 +
+ drivers/video/omap2/displays/Makefile | 2 +
+ drivers/video/omap2/displays/panel-acx565akm.c | 712 ++++++++++++++++++++++++
+ drivers/video/omap2/displays/panel-acx565akm.h | 9 +
+ 4 files changed, 731 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/video/omap2/displays/panel-acx565akm.c
+ create mode 100644 drivers/video/omap2/displays/panel-acx565akm.h
+
+diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
+index 356ceb1..3feecee 100644
+--- a/drivers/video/omap2/displays/Kconfig
++++ b/drivers/video/omap2/displays/Kconfig
+@@ -28,4 +28,12 @@ config CTRL_BLIZZARD
+ tristate "Blizzard Controller"
+ help
+ Blizzard Controller (hack)
++
++config PANEL_ACX565AKM
++ tristate "ACX565AKM LCD Panel"
++ depends on OMAP2_DSS_SDI
++ select BACKLIGHT_CLASS_DEVICE
++ help
++ LCD Panel used in RX51
++
+ endmenu
+diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
+index 1b74b7e..9bafcb6 100644
+--- a/drivers/video/omap2/displays/Makefile
++++ b/drivers/video/omap2/displays/Makefile
+@@ -4,3 +4,5 @@ obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
+
+ obj-$(CONFIG_CTRL_BLIZZARD) += ctrl-blizzard.o
+ obj-$(CONFIG_PANEL_N800) += panel-n800.o
++
++obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
+diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
+new file mode 100644
+index 0000000..2679d6c
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-acx565akm.c
+@@ -0,0 +1,712 @@
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/clk.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/spi/spi.h>
++#include <linux/jiffies.h>
++#include <linux/sched.h>
++#include <linux/backlight.h>
++#include <linux/fb.h>
++
++#include <mach/display.h>
++#include <mach/dma.h>
++
++#include "panel-acx565akm.h"
++
++#define MIPID_CMD_READ_DISP_ID 0x04
++#define MIPID_CMD_READ_RED 0x06
++#define MIPID_CMD_READ_GREEN 0x07
++#define MIPID_CMD_READ_BLUE 0x08
++#define MIPID_CMD_READ_DISP_STATUS 0x09
++#define MIPID_CMD_RDDSDR 0x0F
++#define MIPID_CMD_SLEEP_IN 0x10
++#define MIPID_CMD_SLEEP_OUT 0x11
++#define MIPID_CMD_DISP_OFF 0x28
++#define MIPID_CMD_DISP_ON 0x29
++#define MIPID_CMD_WRITE_DISP_BRIGHTNESS 0x51
++#define MIPID_CMD_READ_DISP_BRIGHTNESS 0x52
++#define MIPID_CMD_WRITE_CTRL_DISP 0x53
++
++#define CTRL_DISP_BRIGHTNESS_CTRL_ON (1 << 5)
++#define CTRL_DISP_AMBIENT_LIGHT_CTRL_ON (1 << 4)
++#define CTRL_DISP_BACKLIGHT_ON (1 << 2)
++#define CTRL_DISP_AUTO_BRIGHTNESS_ON (1 << 1)
++
++#define MIPID_CMD_READ_CTRL_DISP 0x54
++#define MIPID_CMD_WRITE_CABC 0x55
++#define MIPID_CMD_READ_CABC 0x56
++
++#define MIPID_VER_LPH8923 3
++#define MIPID_VER_LS041Y3 4
++#define MIPID_VER_L4F00311 8
++#define MIPID_VER_ACX565AKM 9
++
++struct acx565akm_device {
++ struct backlight_device *bl_dev;
++ int enabled;
++ int model;
++ int revision;
++ u8 display_id[3];
++ int has_bc:1;
++ int has_cabc:1;
++ unsigned int saved_bklight_level;
++ unsigned long hw_guard_end; /* next value of jiffies
++ when we can issue the
++ next sleep in/out command */
++ unsigned long hw_guard_wait; /* max guard time in jiffies */
++
++ struct spi_device *spi;
++ struct mutex mutex;
++ struct omap_panel panel;
++ struct omap_display *display;
++};
++
++static int acx565akm_bl_update_status(struct backlight_device *dev);
++
++static void acx565akm_transfer(struct acx565akm_device *md, int cmd,
++ const u8 *wbuf, int wlen, u8 *rbuf, int rlen)
++{
++ struct spi_message m;
++ struct spi_transfer *x, xfer[5];
++ int r;
++
++ BUG_ON(md->spi == NULL);
++
++ spi_message_init(&m);
++
++ memset(xfer, 0, sizeof(xfer));
++ x = &xfer[0];
++
++ cmd &= 0xff;
++ x->tx_buf = &cmd;
++ x->bits_per_word = 9;
++ x->len = 2;
++
++ if (rlen > 1 && wlen == 0) {
++ /*
++ * Between the command and the response data there is a
++ * dummy clock cycle. Add an extra bit after the command
++ * word to account for this.
++ */
++ x->bits_per_word = 10;
++ cmd <<= 1;
++ }
++ spi_message_add_tail(x, &m);
++
++ if (wlen) {
++ x++;
++ x->tx_buf = wbuf;
++ x->len = wlen;
++ x->bits_per_word = 9;
++ spi_message_add_tail(x, &m);
++ }
++
++ if (rlen) {
++ x++;
++ x->rx_buf = rbuf;
++ x->len = rlen;
++ spi_message_add_tail(x, &m);
++ }
++
++ r = spi_sync(md->spi, &m);
++ if (r < 0)
++ dev_dbg(&md->spi->dev, "spi_sync %d\n", r);
++}
++
++static inline void acx565akm_cmd(struct acx565akm_device *md, int cmd)
++{
++ acx565akm_transfer(md, cmd, NULL, 0, NULL, 0);
++}
++
++static inline void acx565akm_write(struct acx565akm_device *md,
++ int reg, const u8 *buf, int len)
++{
++ acx565akm_transfer(md, reg, buf, len, NULL, 0);
++}
++
++static inline void acx565akm_read(struct acx565akm_device *md,
++ int reg, u8 *buf, int len)
++{
++ acx565akm_transfer(md, reg, NULL, 0, buf, len);
++}
++
++static void hw_guard_start(struct acx565akm_device *md, int guard_msec)
++{
++ md->hw_guard_wait = msecs_to_jiffies(guard_msec);
++ md->hw_guard_end = jiffies + md->hw_guard_wait;
++}
++
++static void hw_guard_wait(struct acx565akm_device *md)
++{
++ unsigned long wait = md->hw_guard_end - jiffies;
++
++ if ((long)wait > 0 && wait <= md->hw_guard_wait) {
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ schedule_timeout(wait);
++ }
++}
++
++static void set_sleep_mode(struct acx565akm_device *md, int on)
++{
++ int cmd, sleep_time = 50;
++
++ if (on)
++ cmd = MIPID_CMD_SLEEP_IN;
++ else
++ cmd = MIPID_CMD_SLEEP_OUT;
++ hw_guard_wait(md);
++ acx565akm_cmd(md, cmd);
++ hw_guard_start(md, 120);
++ /*
++ * When we enable the panel, it seems we _have_ to sleep
++ * 120 ms before sending the init string. When disabling the
++ * panel we'll sleep for the duration of 2 frames, so that the
++ * controller can still provide the PCLK,HS,VS signals. */
++ if (!on)
++ sleep_time = 120;
++ msleep(sleep_time);
++}
++
++static void set_display_state(struct acx565akm_device *md, int enabled)
++{
++ int cmd = enabled ? MIPID_CMD_DISP_ON : MIPID_CMD_DISP_OFF;
++
++ acx565akm_cmd(md, cmd);
++}
++
++static int panel_enabled(struct acx565akm_device *md)
++{
++ u32 disp_status;
++ int enabled;
++
++ acx565akm_read(md, MIPID_CMD_READ_DISP_STATUS, (u8 *)&disp_status, 4);
++ disp_status = __be32_to_cpu(disp_status);
++ enabled = (disp_status & (1 << 17)) && (disp_status & (1 << 10));
++ dev_dbg(&md->spi->dev,
++ "LCD panel %senabled by bootloader (status 0x%04x)\n",
++ enabled ? "" : "not ", disp_status);
++ return enabled;
++}
++
++static void enable_backlight_ctrl(struct acx565akm_device *md, int enable)
++{
++ u16 ctrl;
++
++ acx565akm_read(md, MIPID_CMD_READ_CTRL_DISP, (u8 *)&ctrl, 1);
++ if (enable) {
++ ctrl |= CTRL_DISP_BRIGHTNESS_CTRL_ON |
++ CTRL_DISP_BACKLIGHT_ON;
++ } else {
++ ctrl &= ~(CTRL_DISP_BRIGHTNESS_CTRL_ON |
++ CTRL_DISP_BACKLIGHT_ON);
++ }
++
++ ctrl |= 1 << 8;
++ acx565akm_write(md, MIPID_CMD_WRITE_CTRL_DISP, (u8 *)&ctrl, 2);
++}
++
++static void set_cabc_mode(struct acx565akm_device *md, int mode)
++{
++ u16 cabc_ctrl;
++
++ cabc_ctrl = 0;
++ acx565akm_read(md, MIPID_CMD_READ_CABC, (u8 *)&cabc_ctrl, 1);
++ cabc_ctrl &= ~3;
++ cabc_ctrl |= (1 << 8) | (mode & 3);
++ acx565akm_write(md, MIPID_CMD_WRITE_CABC, (u8 *)&cabc_ctrl, 2);
++}
++
++static int get_cabc_mode(struct acx565akm_device *md)
++{
++ u8 cabc_ctrl;
++
++ acx565akm_read(md, MIPID_CMD_READ_CABC, &cabc_ctrl, 1);
++ return cabc_ctrl & 3;
++}
++
++static int panel_detect(struct acx565akm_device *md)
++{
++ acx565akm_read(md, MIPID_CMD_READ_DISP_ID, md->display_id, 3);
++ dev_dbg(&md->spi->dev, "MIPI display ID: %02x%02x%02x\n",
++ md->display_id[0], md->display_id[1], md->display_id[2]);
++
++ switch (md->display_id[0]) {
++ case 0x10:
++ md->model = MIPID_VER_ACX565AKM;
++ md->panel.name = "acx565akm";
++ md->has_bc = 1;
++ md->has_cabc = 1;
++ break;
++ case 0x29:
++ md->model = MIPID_VER_L4F00311;
++ md->panel.name = "l4f00311";
++ break;
++ case 0x45:
++ md->model = MIPID_VER_LPH8923;
++ md->panel.name = "lph8923";
++ break;
++ case 0x83:
++ md->model = MIPID_VER_LS041Y3;
++ md->panel.name = "ls041y3";
++ break;
++ default:
++ md->panel.name = "unknown";
++ dev_err(&md->spi->dev, "invalid display ID\n");
++ return -ENODEV;
++ }
++
++ md->revision = md->display_id[1];
++
++ pr_info("omapfb: %s rev %02x LCD detected\n",
++ md->panel.name, md->revision);
++
++ return 0;
++}
++
++static int acx565akm_panel_enable(struct omap_display *display)
++{
++ struct acx565akm_device *md =
++ (struct acx565akm_device *)display->panel->priv;
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ mutex_lock(&md->mutex);
++
++ if (display->hw_config.panel_enable)
++ display->hw_config.panel_enable(display);
++
++ md->enabled = panel_enabled(md);
++
++ if (md->enabled) {
++ dev_dbg(&md->spi->dev, "panel already enabled\n");
++ mutex_unlock(&md->mutex);
++ return 0;
++ }
++
++ set_sleep_mode(md, 0);
++ md->enabled = 1;
++ set_display_state(md, 1);
++
++ mutex_unlock(&md->mutex);
++
++ return acx565akm_bl_update_status(md->bl_dev);
++}
++
++static void acx565akm_panel_disable(struct omap_display *display)
++{
++ struct acx565akm_device *md =
++ (struct acx565akm_device *)display->panel->priv;
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ mutex_lock(&md->mutex);
++
++ if (!md->enabled) {
++ mutex_unlock(&md->mutex);
++ return;
++ }
++ set_display_state(md, 0);
++ set_sleep_mode(md, 1);
++ md->enabled = 0;
++
++ if (display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++
++ mutex_unlock(&md->mutex);
++}
++
++#if 0
++static void acx565akm_set_mode(struct omap_display *display,
++ int x_res, int y_res, int bpp)
++{
++ struct acx565akm_device *md =
++ (struct acx565akm_device *)display->panel->priv;
++ u16 par;
++
++ switch (bpp) {
++ case 16:
++ par = 0x150;
++ break;
++ case 18:
++ par = 0x160;
++ break;
++ case 24:
++ par = 0x170;
++ break;
++ }
++
++ acx565akm_write(md, 0x3a, (u8 *)&par, 2);
++}
++#endif
++
++static int acx565akm_panel_suspend(struct omap_display *display)
++{
++ acx565akm_panel_disable(display);
++ return 0;
++}
++
++static int acx565akm_panel_resume(struct omap_display *display)
++{
++ return acx565akm_panel_enable(display);
++}
++
++static void acx565akm_set_brightness(struct acx565akm_device *md, int level)
++{
++ int bv;
++
++ bv = level | (1 << 8);
++ acx565akm_write(md, MIPID_CMD_WRITE_DISP_BRIGHTNESS, (u8 *)&bv, 2);
++
++ if (level)
++ enable_backlight_ctrl(md, 1);
++ else
++ enable_backlight_ctrl(md, 0);
++}
++
++static int acx565akm_get_actual_brightness(struct acx565akm_device *md)
++{
++ u8 bv;
++
++ acx565akm_read(md, MIPID_CMD_READ_DISP_BRIGHTNESS, &bv, 1);
++
++ return bv;
++}
++
++static int acx565akm_bl_update_status(struct backlight_device *dev)
++{
++ struct acx565akm_device *md = dev_get_drvdata(&dev->dev);
++ struct omap_display *display = md->display;
++ int r;
++ int level;
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ if (display->hw_config.set_backlight == NULL)
++ return -ENODEV;
++
++ mutex_lock(&md->mutex);
++
++ if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
++ dev->props.power == FB_BLANK_UNBLANK)
++ level = dev->props.brightness;
++ else
++ level = 0;
++
++ r = 0;
++ if (md->has_bc)
++ acx565akm_set_brightness(md, level);
++ else
++ if (display->hw_config.set_backlight != NULL)
++ r = display->hw_config.set_backlight(display, level);
++ else
++ r = -ENODEV;
++
++ mutex_unlock(&md->mutex);
++
++ return r;
++}
++
++static int acx565akm_bl_get_intensity(struct backlight_device *dev)
++{
++ struct acx565akm_device *md = dev_get_drvdata(&dev->dev);
++ struct omap_display *display = md->display;
++
++ dev_dbg(&dev->dev, "%s\n", __func__);
++
++ if (md->has_bc && display->hw_config.set_backlight == NULL)
++ return -ENODEV;
++
++ if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
++ dev->props.power == FB_BLANK_UNBLANK) {
++ if (md->has_bc)
++ return acx565akm_get_actual_brightness(md);
++ else
++ return dev->props.brightness;
++ }
++
++ return 0;
++}
++
++static struct backlight_ops acx565akm_bl_ops = {
++ .get_brightness = acx565akm_bl_get_intensity,
++ .update_status = acx565akm_bl_update_status,
++};
++
++static const char *cabc_modes[] = {
++ "off", /* used also always when CABC is not supported */
++ "ui",
++ "still-image",
++ "moving-image",
++};
++
++static ssize_t show_cabc_mode(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct acx565akm_device *md = dev_get_drvdata(dev);
++ const char *mode_str;
++ int mode;
++ int len;
++
++ if (!md->has_cabc)
++ mode = 0;
++ else
++ mode = get_cabc_mode(md);
++ mode_str = "unknown";
++ if (mode >= 0 && mode < ARRAY_SIZE(cabc_modes))
++ mode_str = cabc_modes[mode];
++ len = snprintf(buf, PAGE_SIZE, "%s\n", mode_str);
++
++ return len < PAGE_SIZE - 1 ? len : PAGE_SIZE - 1;
++}
++
++static ssize_t store_cabc_mode(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct acx565akm_device *md = dev_get_drvdata(dev);
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(cabc_modes); i++) {
++ const char *mode_str = cabc_modes[i];
++ int cmp_len = strlen(mode_str);
++
++ if (count > 0 && buf[count - 1] == '\n')
++ count--;
++ if (count != cmp_len)
++ continue;
++
++ if (strncmp(buf, mode_str, cmp_len) == 0)
++ break;
++ }
++
++ if (i == ARRAY_SIZE(cabc_modes))
++ return -EINVAL;
++
++ if (!md->has_cabc && i != 0)
++ return -EINVAL;
++
++ mutex_lock(&md->mutex);
++ set_cabc_mode(md, i);
++ mutex_unlock(&md->mutex);
++
++ return count;
++}
++
++static ssize_t show_cabc_available_modes(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct acx565akm_device *md = dev_get_drvdata(dev);
++ int len;
++ int i;
++
++ if (!md->has_cabc)
++ return snprintf(buf, PAGE_SIZE, "%s\n", cabc_modes[0]);
++
++ for (i = 0, len = 0;
++ len < PAGE_SIZE && i < ARRAY_SIZE(cabc_modes); i++)
++ len += snprintf(&buf[len], PAGE_SIZE - len, "%s%s%s",
++ i ? " " : "", cabc_modes[i],
++ i == ARRAY_SIZE(cabc_modes) - 1 ? "\n" : "");
++
++ return len < PAGE_SIZE ? len : PAGE_SIZE - 1;
++}
++
++static DEVICE_ATTR(cabc_mode, S_IRUGO | S_IWUSR,
++ show_cabc_mode, store_cabc_mode);
++static DEVICE_ATTR(cabc_available_modes, S_IRUGO,
++ show_cabc_available_modes, NULL);
++
++static struct attribute *bldev_attrs[] = {
++ &dev_attr_cabc_mode.attr,
++ &dev_attr_cabc_available_modes.attr,
++ NULL,
++};
++
++static struct attribute_group bldev_attr_group = {
++ .attrs = bldev_attrs,
++};
++
++static int acx565akm_panel_init(struct omap_display *display)
++{
++ struct omap_panel *panel = display->panel;
++ struct acx565akm_panel_data *panel_data = display->hw_config.panel_data;
++ struct acx565akm_device *md = (struct acx565akm_device *)panel->priv;
++
++ struct backlight_device *bldev;
++ int brightness;
++ int max_brightness;
++ int r;
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ if (!panel_data) {
++ dev_err(&md->spi->dev, "no panel data\n");
++ return -ENODEV;
++ }
++
++ mutex_init(&md->mutex);
++ md->display = display;
++
++ if (display->hw_config.panel_enable)
++ display->hw_config.panel_enable(display);
++
++ md->enabled = panel_enabled(md);
++
++ r = panel_detect(md);
++ if (r) {
++ if (!md->enabled && display->hw_config.panel_disable)
++ display->hw_config.panel_disable(display);
++ mutex_unlock(&md->mutex);
++ return r;
++ }
++
++ if (!panel_data->bc_connected) {
++ md->has_bc = 0;
++ md->has_cabc = 0;
++ }
++
++#if 0
++ acx565akm_set_mode(display, panel->timings.x_res, panel->timings.y_res,
++ panel->bpp);
++#endif
++
++ if (!md->enabled)
++ display->hw_config.panel_disable(display);
++
++ bldev = backlight_device_register("acx565akm", &md->spi->dev,
++ md, &acx565akm_bl_ops);
++ md->bl_dev = bldev;
++
++ if (md->has_cabc) {
++ r = sysfs_create_group(&bldev->dev.kobj, &bldev_attr_group);
++ if (r) {
++ dev_err(&bldev->dev, "failed to create sysfs files\n");
++ backlight_device_unregister(bldev);
++ return r;
++ }
++ }
++
++ bldev->props.fb_blank = FB_BLANK_UNBLANK;
++ bldev->props.power = FB_BLANK_UNBLANK;
++
++ if (md->has_bc)
++ max_brightness = 255;
++ else
++ max_brightness = display->hw_config.max_backlight_level;
++
++ if (md->has_bc)
++ brightness = acx565akm_get_actual_brightness(md);
++ else {
++ if (display->hw_config.get_backlight != NULL)
++ brightness = display->hw_config.get_backlight(display);
++ else
++ brightness = 0;
++ }
++
++ bldev->props.max_brightness = max_brightness;
++ bldev->props.brightness = brightness;
++ acx565akm_bl_update_status(bldev);
++
++ return 0;
++}
++
++static struct omap_panel acx565akm_panel = {
++ .name = "panel-acx565akm",
++ .init = acx565akm_panel_init,
++ .suspend = acx565akm_panel_suspend,
++ .resume = acx565akm_panel_resume,
++ .enable = acx565akm_panel_enable,
++ .disable = acx565akm_panel_disable,
++
++ .timings = {
++ .x_res = 800,
++ .y_res = 480,
++
++ .pixel_clock = 24000,
++
++ .hsw = 4,
++ .hfp = 16,
++ .hbp = 12,
++
++ .vsw = 3,
++ .vfp = 3,
++ .vbp = 3,
++ },
++
++ .config = OMAP_DSS_LCD_TFT,
++
++ .recommended_bpp = 16,
++
++ /*
++ * supported modes: 12bpp(444), 16bpp(565), 18bpp(666), 24bpp(888)
++ * resolutions.
++ */
++};
++
++static int acx565akm_spi_probe(struct spi_device *spi)
++{
++ struct acx565akm_device *md;
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ md = kzalloc(sizeof(*md), GFP_KERNEL);
++ if (md == NULL) {
++ dev_err(&spi->dev, "out of memory\n");
++ return -ENOMEM;
++ }
++
++ spi->mode = SPI_MODE_3;
++ md->spi = spi;
++ dev_set_drvdata(&spi->dev, md);
++ md->panel = acx565akm_panel;
++ acx565akm_panel.priv = md;
++
++ omap_dss_register_panel(&acx565akm_panel);
++
++ return 0;
++}
++
++static int acx565akm_spi_remove(struct spi_device *spi)
++{
++ struct acx565akm_device *md = dev_get_drvdata(&spi->dev);
++
++ dev_dbg(&md->spi->dev, "%s\n", __func__);
++
++ sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group);
++ backlight_device_unregister(md->bl_dev);
++ omap_dss_unregister_panel(&acx565akm_panel);
++
++ kfree(md);
++
++ return 0;
++}
++
++static struct spi_driver acx565akm_spi_driver = {
++ .driver = {
++ .name = "acx565akm",
++ .bus = &spi_bus_type,
++ .owner = THIS_MODULE,
++ },
++ .probe = acx565akm_spi_probe,
++ .remove = __devexit_p(acx565akm_spi_remove),
++};
++
++static int __init acx565akm_init(void)
++{
++ return spi_register_driver(&acx565akm_spi_driver);
++}
++
++static void __exit acx565akm_exit(void)
++{
++ spi_unregister_driver(&acx565akm_spi_driver);
++}
++
++module_init(acx565akm_init);
++module_exit(acx565akm_exit);
++
++MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
++MODULE_DESCRIPTION("acx565akm LCD Driver");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/omap2/displays/panel-acx565akm.h b/drivers/video/omap2/displays/panel-acx565akm.h
+new file mode 100644
+index 0000000..6d3727b
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-acx565akm.h
+@@ -0,0 +1,9 @@
++#ifndef __DRIVERS_VIDEO_OMAP2_DISPLAYS_PANEL_ACX565AKM_H
++#define __DRIVERS_VIDEO_OMAP2_DISPLAYS_PANEL_ACX565AKM_H
++
++struct acx565akm_panel_data {
++ unsigned bc_connected:1;
++};
++
++#endif
++
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0009-DSS2-Small-VRFB-context-allocation-bug-fixed.patch b/recipes/linux/linux-omap-pm/dss2/0009-DSS2-Small-VRFB-context-allocation-bug-fixed.patch
new file mode 100644
index 0000000000..916e57c27a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0009-DSS2-Small-VRFB-context-allocation-bug-fixed.patch
@@ -0,0 +1,28 @@
+From 8caea38adca77b8aa14721f07810d4802272bd05 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <hvaibhav@ti.com>
+Date: Tue, 31 Mar 2009 18:47:32 +0530
+Subject: [PATCH 009/146] DSS2: Small VRFB context allocation bug fixed
+
+This is minor bug while requesting and mapping memory for
+VRFB space.
+
+Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 852abe5..44febef 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1193,6 +1193,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+
+ if(!va) {
+ printk(KERN_ERR "vrfb: ioremap failed\n");
++ omap_vrfb_release_ctx(&rg->vrfb);
+ return -ENOMEM;
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0010-DSS2-Allocated-memory-for-Color-Look-up-table.patch b/recipes/linux/linux-omap-pm/dss2/0010-DSS2-Allocated-memory-for-Color-Look-up-table.patch
new file mode 100644
index 0000000000..8b2f21f561
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0010-DSS2-Allocated-memory-for-Color-Look-up-table.patch
@@ -0,0 +1,37 @@
+From 9a88005a530cd311fa0ffd0d07f7ae7a73dbf7d5 Mon Sep 17 00:00:00 2001
+From: Vaibhav Hiremath <hvaibhav@ti.com>
+Date: Tue, 31 Mar 2009 18:38:31 +0530
+Subject: [PATCH 010/146] DSS2: Allocated memory for Color Look-up-table
+
+We were not allocating memory for CMAP buffer and due to that
+G_CMAP was failing, since it does check for size of CMAP buffer.
+
+Called "fb_alloc_cmap" for llocating memory for CMAP.
+
+We are currently not supporting 1,2,4,8 bpp, so meaning less
+for us as of now. But for completeness this is required.
+
+Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 44febef..afe40a9 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1525,6 +1525,11 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ goto err;
+
+ set_fb_fix(fbi);
++
++ r = fb_alloc_cmap(&fbi->cmap, 256, 0);
++ if (r)
++ dev_err(fbdev->dev, "unable to allocate color map memory\n");
++
+ err:
+ return r;
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0011-DSS2-Fix-DMA-rotation.patch b/recipes/linux/linux-omap-pm/dss2/0011-DSS2-Fix-DMA-rotation.patch
new file mode 100644
index 0000000000..006c2346f7
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0011-DSS2-Fix-DMA-rotation.patch
@@ -0,0 +1,65 @@
+From 5563b1d969aa8227919e35c3d4ceb738b3bf7a39 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 13:47:11 +0300
+Subject: [PATCH 011/146] DSS2: Fix DMA rotation
+
+u16 was not a good type for offsets. First, they need to be signed,
+and second, 16 bits is not enough.
+---
+ drivers/video/omap2/dss/dispc.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index ffb5648..6cea545 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -778,7 +778,7 @@ static void _dispc_set_vid_size(enum omap_plane plane, int width, int height)
+ dispc_write_reg(vsi_reg[plane-1], val);
+ }
+
+-static void _dispc_set_pix_inc(enum omap_plane plane, u16 inc)
++static void _dispc_set_pix_inc(enum omap_plane plane, s32 inc)
+ {
+ const struct dispc_reg ri_reg[] = { DISPC_GFX_PIXEL_INC,
+ DISPC_VID_PIXEL_INC(0),
+@@ -787,7 +787,7 @@ static void _dispc_set_pix_inc(enum omap_plane plane, u16 inc)
+ dispc_write_reg(ri_reg[plane], inc);
+ }
+
+-static void _dispc_set_row_inc(enum omap_plane plane, u16 inc)
++static void _dispc_set_row_inc(enum omap_plane plane, s32 inc)
+ {
+ const struct dispc_reg ri_reg[] = { DISPC_GFX_ROW_INC,
+ DISPC_VID_ROW_INC(0),
+@@ -1123,7 +1123,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
+ }
+ }
+
+-static int pixinc(int pixels, u8 ps)
++static s32 pixinc(int pixels, u8 ps)
+ {
+ if (pixels == 1)
+ return 1;
+@@ -1140,7 +1140,7 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode, bool fieldmode,
+ unsigned *offset0, unsigned *offset1,
+- u16 *row_inc, u16 *pix_inc)
++ s32 *row_inc, s32 *pix_inc)
+ {
+ u8 ps;
+ u16 fbw, fbh;
+@@ -1298,8 +1298,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ bool fieldmode = 0;
+ int cconv = 0;
+ unsigned offset0, offset1;
+- u16 row_inc;
+- u16 pix_inc;
++ s32 row_inc;
++ s32 pix_inc;
+
+ if (plane == OMAP_DSS_GFX) {
+ if (width != out_width || height != out_height)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0012-DSS2-Verify-that-overlay-paddr-0.patch b/recipes/linux/linux-omap-pm/dss2/0012-DSS2-Verify-that-overlay-paddr-0.patch
new file mode 100644
index 0000000000..869a27b81e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0012-DSS2-Verify-that-overlay-paddr-0.patch
@@ -0,0 +1,41 @@
+From 24ae439174e570101d8d80fdc4b605de0040f88a Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 14:21:12 +0300
+Subject: [PATCH 012/146] DSS2: Verify that overlay paddr != 0
+
+---
+ drivers/video/omap2/dss/dispc.c | 3 +++
+ drivers/video/omap2/dss/overlay.c | 3 +++
+ 2 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 6cea545..2480a03 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1301,6 +1301,9 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ s32 row_inc;
+ s32 pix_inc;
+
++ if (paddr == 0)
++ return -EINVAL;
++
+ if (plane == OMAP_DSS_GFX) {
+ if (width != out_width || height != out_height)
+ return -EINVAL;
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 968edbe..9209acf 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -331,6 +331,9 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
+ int r;
+ struct omap_overlay_info old_info;
+
++ if (info->paddr == 0)
++ return -EINVAL;
++
+ old_info = ovl->info;
+ ovl->info = *info;
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0013-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch b/recipes/linux/linux-omap-pm/dss2/0013-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
new file mode 100644
index 0000000000..781af9c7eb
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0013-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
@@ -0,0 +1,51 @@
+From 22e54d90b60675e8584d92d92493e0579e69e589 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 16:48:41 +0300
+Subject: [PATCH 013/146] DSS2: Add function to get DSS logic clock rate
+
+---
+ drivers/video/omap2/dss/dispc.c | 15 +++++++++++++++
+ drivers/video/omap2/dss/dss.h | 1 +
+ 2 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 2480a03..1bc23f7 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1850,6 +1850,21 @@ unsigned long dispc_fclk_rate(void)
+ return r;
+ }
+
++unsigned long dispc_lclk_rate(void)
++{
++ int lcd;
++ unsigned long r;
++ u32 l;
++
++ l = dispc_read_reg(DISPC_DIVISOR);
++
++ lcd = FLD_GET(l, 23, 16);
++
++ r = dispc_fclk_rate();
++
++ return r / lcd;
++}
++
+ unsigned long dispc_pclk_rate(void)
+ {
+ int lcd, pcd;
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index bac5ece..0be42b6 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -294,6 +294,7 @@ bool dispc_trans_key_enabled(enum omap_channel ch);
+
+ void dispc_set_lcd_timings(struct omap_video_timings *timings);
+ unsigned long dispc_fclk_rate(void);
++unsigned long dispc_lclk_rate(void);
+ unsigned long dispc_pclk_rate(void);
+ void dispc_set_pol_freq(struct omap_panel *panel);
+ void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0014-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch b/recipes/linux/linux-omap-pm/dss2/0014-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
new file mode 100644
index 0000000000..090a9ea68c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0014-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
@@ -0,0 +1,68 @@
+From ea00b61dccecbcddadc0c69d18a220d563a56754 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 16:49:27 +0300
+Subject: [PATCH 014/146] DSS2: DSI: calculate VP_CLK_RATIO properly
+
+---
+ drivers/video/omap2/dss/dsi.c | 17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 4442931..aecb89d 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1104,7 +1104,10 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+ enable_clocks(1);
+ dsi_enable_pll_clock(1);
+
+- /* configure dispc fck and pixel clock to something sane */
++ /* XXX this should be calculated depending on the screen size,
++ * required framerate and DSI speed.
++ * For now 48MHz is enough for 864x480@60 with 360Mbps/lane
++ * with two lanes */
+ r = dispc_calc_clock_div(1, 48 * 1000 * 1000, &cinfo);
+ if (r)
+ goto err0;
+@@ -1119,7 +1122,7 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+ if (r)
+ goto err0;
+
+- /* PLL does not come out of reset without this... */
++ /* XXX PLL does not come out of reset without this... */
+ dispc_pck_free_enable(1);
+
+ if (wait_for_bit_change(DSI_PLL_STATUS, 0, 1) != 1) {
+@@ -1128,8 +1131,8 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+ goto err1;
+ }
+
+- /* ... but if left on, we get problems when planes do not
+- * fill the whole display. No idea about this XXX */
++ /* XXX ... but if left on, we get problems when planes do not
++ * fill the whole display. No idea about this */
+ dispc_pck_free_enable(0);
+
+ if (enable_hsclk && enable_hsdiv)
+@@ -2214,6 +2217,7 @@ static int dsi_proto_config(struct omap_display *display)
+ {
+ u32 r;
+ int buswidth = 0;
++ int div;
+
+ dsi_config_tx_fifo(DSI_FIFO_SIZE_128,
+ DSI_FIFO_SIZE_0,
+@@ -2254,8 +2258,9 @@ static int dsi_proto_config(struct omap_display *display)
+ r = FLD_MOD(r, 1, 1, 1); /* CS_RX_EN */
+ r = FLD_MOD(r, 1, 2, 2); /* ECC_RX_EN */
+ r = FLD_MOD(r, 1, 3, 3); /* TX_FIFO_ARBITRATION */
+- /* XXX what should the ratio be */
+- r = FLD_MOD(r, 0, 4, 4); /* VP_CLK_RATIO, VP_PCLK = VP_CLK/2 */
++
++ div = dispc_lclk_rate() / dispc_pclk_rate();
++ r = FLD_MOD(r, div == 2 ? 0 : 1, 4, 4); /* VP_CLK_RATIO */
+ r = FLD_MOD(r, buswidth, 7, 6); /* VP_DATA_BUS_WIDTH */
+ r = FLD_MOD(r, 0, 8, 8); /* VP_CLK_POL */
+ r = FLD_MOD(r, 2, 13, 12); /* LINE_BUFFER, 2 lines */
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-improve-packet-len-calculation.patch b/recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-improve-packet-len-calculation.patch
new file mode 100644
index 0000000000..9fc0f8cbcf
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0015-DSS2-DSI-improve-packet-len-calculation.patch
@@ -0,0 +1,58 @@
+From 539f93c4bc0119abf79d9a25955e863309ae6771 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 17:42:26 +0300
+Subject: [PATCH 015/146] DSS2: DSI: improve packet len calculation
+
+---
+ drivers/video/omap2/dss/dsi.c | 21 ++++++++++++++++-----
+ 1 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index aecb89d..66ac6ea 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2624,17 +2624,28 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+ int bytespp = 3;
++ int len;
+ int total_len;
+- int line_packet_len;
++ int packet_payload;
++ int packet_len;
+ u32 l;
+
+ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
+ DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
+ x, y, w, h);
+
+- /* TODO: one packet could be longer, I think? Max is the line buffer */
+- line_packet_len = w * bytespp + 1; /* 1 byte for DCS cmd */
+- total_len = line_packet_len * h;
++ len = w * h * bytespp;
++
++ /* XXX: one packet could be longer, I think? Line buffer is
++ * 1024 x 24bits, but we have to put DCS cmd there also.
++ * 1023 * 3 should work, but causes strange color effects. */
++ packet_payload = min(w, (u16)1020) * bytespp;
++
++ packet_len = packet_payload + 1; /* 1 byte for DCS cmd */
++ total_len = (len / packet_payload) * packet_len;
++
++ if (len % packet_payload)
++ total_len += (len % packet_payload) + 1;
+
+ display->ctrl->setup_update(display, x, y, w, h);
+
+@@ -2646,7 +2657,7 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+ l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
+ dsi_write_reg(DSI_VC_TE(1), l);
+
+- dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, line_packet_len, 0);
++ dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
+
+ if (dsi.use_te)
+ l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0016-DSS2-Disable-video-planes-on-sync-lost-error.patch b/recipes/linux/linux-omap-pm/dss2/0016-DSS2-Disable-video-planes-on-sync-lost-error.patch
new file mode 100644
index 0000000000..8d33f7f5ff
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0016-DSS2-Disable-video-planes-on-sync-lost-error.patch
@@ -0,0 +1,103 @@
+From adc4913d614b6b523dfe5ba115d2690043ab8ee9 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 3 Apr 2009 19:09:20 +0200
+Subject: [PATCH 016/146] DSS2: Disable video planes on sync lost error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When encountering the sync lost error disable the display and all video
+planes on the affected manager. Afterwards re-enable the display.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 50 +++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 50 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 1bc23f7..41734f3 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2518,29 +2518,79 @@ static void dispc_error_worker(struct work_struct *work)
+ }
+
+ if (errors & DISPC_IRQ_SYNC_LOST) {
++ struct omap_overlay_manager *manager = NULL;
++ bool enable = false;
++
+ DSSERR("SYNC_LOST, disabling LCD\n");
++
+ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
+ struct omap_overlay_manager *mgr;
+ mgr = omap_dss_get_overlay_manager(i);
+
+ if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
++ manager = mgr;
++ enable = mgr->display->state ==
++ OMAP_DSS_DISPLAY_ACTIVE;
+ mgr->display->disable(mgr->display);
+ break;
+ }
+ }
++
++ if (manager) {
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (ovl->id != 0 && ovl->manager == manager)
++ dispc_enable_plane(ovl->id, 0);
++ }
++
++ dispc_go(manager->id);
++ mdelay(50);
++ if (enable)
++ manager->display->enable(manager->display);
++ }
+ }
+
+ if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
++ struct omap_overlay_manager *manager = NULL;
++ bool enable = false;
++
+ DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
++
+ for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
+ struct omap_overlay_manager *mgr;
+ mgr = omap_dss_get_overlay_manager(i);
+
+ if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
++ manager = mgr;
++ enable = mgr->display->state ==
++ OMAP_DSS_DISPLAY_ACTIVE;
+ mgr->display->disable(mgr->display);
+ break;
+ }
+ }
++
++ if (manager) {
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ continue;
++
++ if (ovl->id != 0 && ovl->manager == manager)
++ dispc_enable_plane(ovl->id, 0);
++ }
++
++ dispc_go(manager->id);
++ mdelay(50);
++ if (enable)
++ manager->display->enable(manager->display);
++ }
+ }
+
+ if (errors & DISPC_IRQ_OCP_ERR) {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0017-DSS2-check-for-ovl-paddr-only-when-enabling.patch b/recipes/linux/linux-omap-pm/dss2/0017-DSS2-check-for-ovl-paddr-only-when-enabling.patch
new file mode 100644
index 0000000000..1e9e4f4b78
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0017-DSS2-check-for-ovl-paddr-only-when-enabling.patch
@@ -0,0 +1,40 @@
+From 79d7d58e0fe8b0fb2c7b68116be30f37d3389f2f Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 7 Apr 2009 10:01:58 +0300
+Subject: [PATCH 017/146] DSS2: check for ovl paddr only when enabling
+
+It seems Xvideo uses SETUP_PLANE ioctl even when
+the fb memory has not been allocated. Sigh.
+---
+ drivers/video/omap2/dss/overlay.c | 8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 9209acf..c047206 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -281,6 +281,11 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
+
+ info = &ovl->info;
+
++ if (info->paddr == 0) {
++ DSSDBG("check_overlay failed: paddr 0\n");
++ return -EINVAL;
++ }
++
+ display->get_resolution(display, &dw, &dh);
+
+ DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
+@@ -331,9 +336,6 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
+ int r;
+ struct omap_overlay_info old_info;
+
+- if (info->paddr == 0)
+- return -EINVAL;
+-
+ old_info = ovl->info;
+ ovl->info = *info;
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0018-DSS2-Check-fclk-limits-when-configuring-video-plane.patch b/recipes/linux/linux-omap-pm/dss2/0018-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
new file mode 100644
index 0000000000..8ae7666a7d
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0018-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
@@ -0,0 +1,183 @@
+From ca0485ad7fcd29a0190eccd6b58bcd22794d4a7d Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:04 +0200
+Subject: [PATCH 018/146] DSS2: Check fclk limits when configuring video planes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Check that the currect functional clock is fast enough to support
+the requested scaling ratios. Also check if 5-tap filtering can be
+used even though the downscaling ratio is less than 1:2 since the
+functional clock rate required for 5-tap filtering can be less than
+the requirement for 3-tap filtering, and 5-tap filtering should look
+better.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 104 ++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 97 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 41734f3..61861d8 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1026,11 +1026,11 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
+ static void _dispc_set_scaling(enum omap_plane plane,
+ u16 orig_width, u16 orig_height,
+ u16 out_width, u16 out_height,
+- bool ilace)
++ bool ilace, bool five_taps)
+ {
+ int fir_hinc;
+ int fir_vinc;
+- int hscaleup, vscaleup, five_taps;
++ int hscaleup, vscaleup;
+ int fieldmode = 0;
+ int accu0 = 0;
+ int accu1 = 0;
+@@ -1040,7 +1040,6 @@ static void _dispc_set_scaling(enum omap_plane plane,
+
+ hscaleup = orig_width <= out_width;
+ vscaleup = orig_height <= out_height;
+- five_taps = orig_height > out_height * 2;
+
+ _dispc_set_scale_coef(plane, hscaleup, vscaleup, five_taps);
+
+@@ -1283,6 +1282,73 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
+ }
+ }
+
++static unsigned long calc_fclk_five_taps(u16 width, u16 height,
++ u16 out_width, u16 out_height, enum omap_color_mode color_mode)
++{
++ u32 fclk = 0;
++ /* FIXME venc pclk? */
++ u64 tmp, pclk = dispc_pclk_rate();
++
++ if (height > out_height) {
++ /* FIXME get real display PPL */
++ unsigned int ppl = 800;
++
++ tmp = pclk * height * out_width;
++ do_div(tmp, 2 * out_height * ppl);
++ fclk = tmp;
++
++ if (height > 2 * out_height) {
++ tmp = pclk * (height - 2 * out_height) * out_width;
++ do_div(tmp, 2 * out_height * (ppl - out_width));
++ fclk = max(fclk, (u32) tmp);
++ }
++ }
++
++ if (width > out_width) {
++ tmp = pclk * width;
++ do_div(tmp, out_width);
++ fclk = max(fclk, (u32) tmp);
++
++ if (color_mode == OMAP_DSS_COLOR_RGB24U)
++ fclk <<= 1;
++ }
++
++ return fclk;
++}
++
++static unsigned long calc_fclk(u16 width, u16 height,
++ u16 out_width, u16 out_height,
++ enum omap_color_mode color_mode, bool five_taps)
++{
++ unsigned int hf, vf;
++
++ if (five_taps)
++ return calc_fclk_five_taps(width, height,
++ out_width, out_height, color_mode);
++
++ /*
++ * FIXME how to determine the 'A' factor
++ * for the no downscaling case ?
++ */
++
++ if (width > 3 * out_width)
++ hf = 4;
++ else if (width > 2 * out_width)
++ hf = 3;
++ else if (width > out_width)
++ hf = 2;
++ else
++ hf = 1;
++
++ if (height > out_height)
++ vf = 2;
++ else
++ vf = 1;
++
++ /* FIXME venc pclk? */
++ return dispc_pclk_rate() * vf * hf;
++}
++
+ static int _dispc_setup_plane(enum omap_plane plane,
+ enum omap_channel channel_out,
+ u32 paddr, u16 screen_width,
+@@ -1294,7 +1360,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ u8 rotation, int mirror)
+ {
+ const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
+- bool five_taps = height > out_height * 2;
++ bool five_taps = 0;
+ bool fieldmode = 0;
+ int cconv = 0;
+ unsigned offset0, offset1;
+@@ -1323,8 +1389,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ }
+ } else {
+ /* video plane */
+- if (width > (2048 >> five_taps))
+- return -EINVAL;
++
++ unsigned long fclk;
+
+ if (out_width < width / maxdownscale ||
+ out_width > width * 8)
+@@ -1356,6 +1422,30 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ default:
+ return -EINVAL;
+ }
++
++ /* Must use 5-tap filter? */
++ five_taps = height > out_height * 2;
++
++ /* Try to use 5-tap filter whenever possible. */
++ if (cpu_is_omap34xx() && !five_taps &&
++ height > out_height && width <= 1024) {
++ fclk = calc_fclk_five_taps(width, height,
++ out_width, out_height, color_mode);
++ if (fclk <= dispc_fclk_rate())
++ five_taps = true;
++ }
++
++ if (width > (2048 >> five_taps))
++ return -EINVAL;
++
++ fclk = calc_fclk(width, height, out_width, out_height,
++ color_mode, five_taps);
++
++ DSSDBG("required fclk rate = %lu Hz\n", fclk);
++ DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
++
++ if (fclk > dispc_fclk_rate())
++ return -EINVAL;
+ }
+
+ if (ilace && height >= out_height)
+@@ -1399,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ if (plane != OMAP_DSS_GFX) {
+ _dispc_set_scaling(plane, width, height,
+ out_width, out_height,
+- ilace);
++ ilace, five_taps);
+ _dispc_set_vid_size(plane, out_width, out_height);
+ _dispc_set_vid_color_conv(plane, cconv);
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-scaling-limits-against-proper-values.patch b/recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-scaling-limits-against-proper-values.patch
new file mode 100644
index 0000000000..47541f6c98
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0019-DSS2-Check-scaling-limits-against-proper-values.patch
@@ -0,0 +1,79 @@
+From 16b86930f796436e4f440626980a25df71b6a8ec Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:05 +0200
+Subject: [PATCH 019/146] DSS2: Check scaling limits against proper values
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Move the ilace and fieldmode related height adjustments to be performed
+before checking the scaling limits.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 31 ++++++++++++++++---------------
+ 1 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 61861d8..ae7be3d 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1366,10 +1366,25 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ unsigned offset0, offset1;
+ s32 row_inc;
+ s32 pix_inc;
++ u16 frame_height = height;
+
+ if (paddr == 0)
+ return -EINVAL;
+
++ if (ilace && height >= out_height)
++ fieldmode = 1;
++
++ if (ilace) {
++ if (fieldmode)
++ height /= 2;
++ pos_y /= 2;
++ out_height /= 2;
++
++ DSSDBG("adjusting for ilace: height %d, pos_y %d, "
++ "out_height %d\n",
++ height, pos_y, out_height);
++ }
++
+ if (plane == OMAP_DSS_GFX) {
+ if (width != out_width || height != out_height)
+ return -EINVAL;
+@@ -1448,28 +1463,14 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ return -EINVAL;
+ }
+
+- if (ilace && height >= out_height)
+- fieldmode = 1;
+-
+ calc_rotation_offset(rotation, mirror,
+- screen_width, width, height, color_mode,
++ screen_width, width, frame_height, color_mode,
+ fieldmode,
+ &offset0, &offset1, &row_inc, &pix_inc);
+
+ DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
+ offset0, offset1, row_inc, pix_inc);
+
+- if (ilace) {
+- if (fieldmode)
+- height /= 2;
+- pos_y /= 2;
+- out_height /= 2;
+-
+- DSSDBG("adjusting for ilace: height %d, pos_y %d, "
+- "out_height %d\n",
+- height, pos_y, out_height);
+- }
+-
+ _dispc_set_channel_out(plane, channel_out);
+ _dispc_set_color_mode(plane, color_mode);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0020-DSS2-Add-venc-register-dump.patch b/recipes/linux/linux-omap-pm/dss2/0020-DSS2-Add-venc-register-dump.patch
new file mode 100644
index 0000000000..bf63b3a058
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0020-DSS2-Add-venc-register-dump.patch
@@ -0,0 +1,96 @@
+From c36a2e49cae0ae5e1068e68dee23987df763ca0e Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:06 +0200
+Subject: [PATCH 020/146] DSS2: Add venc register dump
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Add a new file to debugfs to dump the VENC registers. The function
+prototype was already there but the implementation was missing.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/venc.c | 55 ++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 55 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index aceed9f..b655df4 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -30,6 +30,7 @@
+ #include <linux/completion.h>
+ #include <linux/delay.h>
+ #include <linux/string.h>
++#include <linux/seq_file.h>
+
+ #include <mach/display.h>
+ #include <mach/cpu.h>
+@@ -81,6 +82,7 @@
+ #define VENC_TVDETGP_INT_START_STOP_Y 0xB4
+ #define VENC_GEN_CTRL 0xB8
+ #define VENC_OUTPUT_CONTROL 0xC4
++#define VENC_OUTPUT_TEST 0xC8
+ #define VENC_DAC_B__DAC_C 0xC8
+
+ struct venc_config {
+@@ -598,3 +600,56 @@ void venc_init_display(struct omap_display *display)
+ display->set_timings = venc_set_timings;
+ display->check_timings = venc_check_timings;
+ }
++
++void venc_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))
++
++ venc_enable_clocks(1);
++
++ DUMPREG(VENC_F_CONTROL);
++ DUMPREG(VENC_VIDOUT_CTRL);
++ DUMPREG(VENC_SYNC_CTRL);
++ DUMPREG(VENC_LLEN);
++ DUMPREG(VENC_FLENS);
++ DUMPREG(VENC_HFLTR_CTRL);
++ DUMPREG(VENC_CC_CARR_WSS_CARR);
++ DUMPREG(VENC_C_PHASE);
++ DUMPREG(VENC_GAIN_U);
++ DUMPREG(VENC_GAIN_V);
++ DUMPREG(VENC_GAIN_Y);
++ DUMPREG(VENC_BLACK_LEVEL);
++ DUMPREG(VENC_BLANK_LEVEL);
++ DUMPREG(VENC_X_COLOR);
++ DUMPREG(VENC_M_CONTROL);
++ DUMPREG(VENC_BSTAMP_WSS_DATA);
++ DUMPREG(VENC_S_CARR);
++ DUMPREG(VENC_LINE21);
++ DUMPREG(VENC_LN_SEL);
++ DUMPREG(VENC_L21__WC_CTL);
++ DUMPREG(VENC_HTRIGGER_VTRIGGER);
++ DUMPREG(VENC_SAVID__EAVID);
++ DUMPREG(VENC_FLEN__FAL);
++ DUMPREG(VENC_LAL__PHASE_RESET);
++ DUMPREG(VENC_HS_INT_START_STOP_X);
++ DUMPREG(VENC_HS_EXT_START_STOP_X);
++ DUMPREG(VENC_VS_INT_START_X);
++ DUMPREG(VENC_VS_INT_STOP_X__VS_INT_START_Y);
++ DUMPREG(VENC_VS_INT_STOP_Y__VS_EXT_START_X);
++ DUMPREG(VENC_VS_EXT_STOP_X__VS_EXT_START_Y);
++ DUMPREG(VENC_VS_EXT_STOP_Y);
++ DUMPREG(VENC_AVID_START_STOP_X);
++ DUMPREG(VENC_AVID_START_STOP_Y);
++ DUMPREG(VENC_FID_INT_START_X__FID_INT_START_Y);
++ DUMPREG(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X);
++ DUMPREG(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y);
++ DUMPREG(VENC_TVDETGP_INT_START_STOP_X);
++ DUMPREG(VENC_TVDETGP_INT_START_STOP_Y);
++ DUMPREG(VENC_GEN_CTRL);
++ DUMPREG(VENC_OUTPUT_CONTROL);
++ DUMPREG(VENC_OUTPUT_TEST);
++
++ venc_enable_clocks(0);
++
++#undef DUMPREG
++}
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0021-DSS2-FB-remove-unused-var-warning.patch b/recipes/linux/linux-omap-pm/dss2/0021-DSS2-FB-remove-unused-var-warning.patch
new file mode 100644
index 0000000000..736c7e6e1e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0021-DSS2-FB-remove-unused-var-warning.patch
@@ -0,0 +1,27 @@
+From 4b1e929ef1d15f565d166fa19ffd501f547b8eb0 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Mon, 6 Apr 2009 22:26:04 +0200
+Subject: [PATCH 021/146] DSS2: FB: remove unused var warning
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index afe40a9..12ce0c3 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1246,7 +1246,9 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+ display->get_resolution(display, &w, &h);
+
+ if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++#ifdef DEBUG
+ int oldw = w, oldh = h;
++#endif
+
+ omap_vrfb_adjust_size(&w, &h, bytespp);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0022-DSS2-pass-the-default-FB-color-format-through-board.patch b/recipes/linux/linux-omap-pm/dss2/0022-DSS2-pass-the-default-FB-color-format-through-board.patch
new file mode 100644
index 0000000000..0dcff125de
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0022-DSS2-pass-the-default-FB-color-format-through-board.patch
@@ -0,0 +1,214 @@
+From 353b8aba981b1ebc892d84e4c40b1fd4201079db Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 8 Apr 2009 12:51:46 +0200
+Subject: [PATCH 022/146] DSS2: pass the default FB color format through board info
+
+Add a field to the FB memory region platform data, so that board
+init code can pass a default color format to the driver. Set this
+format as an initial setting for the given FB.
+
+This is needed for an upcoming patch that adds detection of the
+color format set by the bootloader.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 121 +++++++++++++++++++++++++++---
+ drivers/video/omap2/omapfb/omapfb.h | 2 +
+ include/linux/omapfb.h | 5 +
+ 3 files changed, 117 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 12ce0c3..67c67c2 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -370,6 +370,21 @@ static enum omap_color_mode fb_mode_to_dss_mode(struct fb_var_screeninfo *var)
+ return -EINVAL;
+ }
+
++static int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
++ struct fb_var_screeninfo *var)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
++ struct omapfb_colormode *mode = &omapfb_colormodes[i];
++ if (dssmode == mode->dssmode) {
++ assign_colormode_to_var(var, mode);
++ return 0;
++ }
++ }
++ return -ENOENT;
++}
++
+ void set_fb_fix(struct fb_info *fbi)
+ {
+ struct fb_fix_screeninfo *fix = &fbi->fix;
+@@ -1267,6 +1282,60 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+ return omapfb_alloc_fbmem(fbi, size, paddr);
+ }
+
++static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format format)
++{
++ enum omap_color_mode mode;
++
++ switch (format) {
++ case OMAPFB_COLOR_RGB565:
++ mode = OMAP_DSS_COLOR_RGB16;
++ break;
++ case OMAPFB_COLOR_YUV422:
++ mode = OMAP_DSS_COLOR_YUV2;
++ break;
++ case OMAPFB_COLOR_CLUT_8BPP:
++ mode = OMAP_DSS_COLOR_CLUT8;
++ break;
++ case OMAPFB_COLOR_CLUT_4BPP:
++ mode = OMAP_DSS_COLOR_CLUT4;
++ break;
++ case OMAPFB_COLOR_CLUT_2BPP:
++ mode = OMAP_DSS_COLOR_CLUT2;
++ break;
++ case OMAPFB_COLOR_CLUT_1BPP:
++ mode = OMAP_DSS_COLOR_CLUT1;
++ break;
++ case OMAPFB_COLOR_RGB444:
++ mode = OMAP_DSS_COLOR_RGB12U;
++ break;
++ case OMAPFB_COLOR_YUY422:
++ mode = OMAP_DSS_COLOR_UYVY;
++ break;
++ case OMAPFB_COLOR_ARGB16:
++ mode = OMAP_DSS_COLOR_ARGB16;
++ break;
++ case OMAPFB_COLOR_RGB24U:
++ mode = OMAP_DSS_COLOR_RGB24U;
++ break;
++ case OMAPFB_COLOR_RGB24P:
++ mode = OMAP_DSS_COLOR_RGB24P;
++ break;
++ case OMAPFB_COLOR_ARGB32:
++ mode = OMAP_DSS_COLOR_ARGB32;
++ break;
++ case OMAPFB_COLOR_RGBA32:
++ mode = OMAP_DSS_COLOR_RGBA32;
++ break;
++ case OMAPFB_COLOR_RGBX32:
++ mode = OMAP_DSS_COLOR_RGBX32;
++ break;
++ default:
++ mode = -EINVAL;
++ }
++
++ return mode;
++}
++
+ static int omapfb_parse_vram_param(const char *param, int max_entries,
+ unsigned long *sizes, unsigned long *paddrs)
+ {
+@@ -1483,9 +1552,36 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ }
+
+ var->nonstd = 0;
++ var->bits_per_pixel = 0;
+
+ var->rotate = ofbi->rotation;
+
++ /*
++ * Check if there is a default color format set in the board file,
++ * and use this format instead the default deducted from the
++ * display bpp.
++ */
++ if (fbdev->dev->platform_data) {
++ struct omapfb_platform_data *opd;
++ int id = ofbi->id;
++
++ opd = fbdev->dev->platform_data;
++ if (opd->mem_desc.region[id].format_used) {
++ enum omap_color_mode mode;
++ enum omapfb_color_format format;
++
++ format = opd->mem_desc.region[id].format;
++ mode = fb_format_to_dss_mode(format);
++ if (mode < 0) {
++ r = mode;
++ goto err;
++ }
++ r = dss_mode_to_fb_mode(mode, var);
++ if (r < 0)
++ goto err;
++ }
++ }
++
+ if (display) {
+ u16 w, h;
+ display->get_resolution(display, &w, &h);
+@@ -1502,16 +1598,18 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ var->xres_virtual = var->xres;
+ var->yres_virtual = var->yres;
+
+- switch (display->get_recommended_bpp(display)) {
+- case 16:
+- var->bits_per_pixel = 16;
+- break;
+- case 24:
+- var->bits_per_pixel = 32;
+- break;
+- default:
+- dev_err(fbdev->dev, "illegal display bpp\n");
+- return -EINVAL;
++ if (!var->bits_per_pixel) {
++ switch (display->get_recommended_bpp(display)) {
++ case 16:
++ var->bits_per_pixel = 16;
++ break;
++ case 24:
++ var->bits_per_pixel = 32;
++ break;
++ default:
++ dev_err(fbdev->dev, "illegal display bpp\n");
++ return -EINVAL;
++ }
+ }
+ } else {
+ /* if there's no display, let's just guess some basic values */
+@@ -1519,7 +1617,8 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ var->yres = 240;
+ var->xres_virtual = var->xres;
+ var->yres_virtual = var->yres;
+- var->bits_per_pixel = 16;
++ if (!var->bits_per_pixel)
++ var->bits_per_pixel = 16;
+ }
+
+ r = check_fb_var(fbi, var);
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index 65e9e6e..2607def 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -27,6 +27,8 @@
+ #define DEBUG
+ #endif
+
++#include <mach/display.h>
++
+ #ifdef DEBUG
+ extern unsigned int omapfb_debug;
+ #define DBG(format, ...) \
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 96190b2..7a34f22 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -298,6 +298,11 @@ struct omapfb_mem_region {
+ void __iomem *vaddr;
+ unsigned long size;
+ u8 type; /* OMAPFB_PLANE_MEM_* */
++ enum omapfb_color_format format;/* OMAPFB_COLOR_* */
++ unsigned format_used:1; /* Must be set when format is set.
++ * Needed b/c of the badly chosen 0
++ * base for OMAPFB_COLOR_* values
++ */
+ unsigned alloc:1; /* allocated by the driver */
+ unsigned map:1; /* kernel mapped by the driver */
+ };
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0023-DSS2-Beagle-Use-gpio_set_value.patch b/recipes/linux/linux-omap-pm/dss2/0023-DSS2-Beagle-Use-gpio_set_value.patch
new file mode 100644
index 0000000000..568c4fb00c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0023-DSS2-Beagle-Use-gpio_set_value.patch
@@ -0,0 +1,48 @@
+From c01ef38cc851f53008c0f1491f568b8554270441 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 9 Apr 2009 12:10:46 +0300
+Subject: [PATCH 023/146] DSS2: Beagle: Use gpio_set_value
+
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 10 +++++++---
+ 1 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index c2c76b0..4ab7396 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -350,7 +350,7 @@ static struct platform_device keys_gpio = {
+ static int beagle_enable_dvi(struct omap_display *display)
+ {
+ if (display->hw_config.panel_reset_gpio != -1)
+- gpio_direction_output(display->hw_config.panel_reset_gpio, 1);
++ gpio_set_value(display->hw_config.panel_reset_gpio, 1);
+
+ return 0;
+ }
+@@ -358,7 +358,7 @@ static int beagle_enable_dvi(struct omap_display *display)
+ static void beagle_disable_dvi(struct omap_display *display)
+ {
+ if (display->hw_config.panel_reset_gpio != -1)
+- gpio_direction_output(display->hw_config.panel_reset_gpio, 0);
++ gpio_set_value(display->hw_config.panel_reset_gpio, 0);
+ }
+
+ static struct omap_dss_display_config beagle_display_data_dvi = {
+@@ -423,8 +423,12 @@ static void __init beagle_display_init(void)
+ int r;
+
+ r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
+- if (r < 0)
++ if (r < 0) {
+ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
++ return;
++ }
++
++ gpio_direction_output(beagle_display_data_dvi.panel_reset_gpio, 0);
+ }
+
+ static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0024-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch b/recipes/linux/linux-omap-pm/dss2/0024-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
new file mode 100644
index 0000000000..2f7d475c49
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0024-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
@@ -0,0 +1,28 @@
+From 5ba7dbfd877bf8c345419b2985e5b26c2934d1d3 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Mon, 13 Apr 2009 18:50:24 +0530
+Subject: [PATCH 024/146] DSS2: VRFB: Macro for calculating base address of the VRFB context was faulty
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/vrfb.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 7e0f8fc..d68065f 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -16,8 +16,8 @@
+
+ #define SMS_ROT_VIRT_BASE(context, rot) \
+ (((context >= 4) ? 0xD0000000 : 0x70000000) \
+- | 0x4000000 * (context) \
+- | 0x1000000 * (rot))
++ + (0x4000000 * (context)) \
++ + (0x1000000 * (rot)))
+
+ #define OMAP_VRFB_SIZE (2048 * 2048 * 4)
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0025-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch b/recipes/linux/linux-omap-pm/dss2/0025-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch
new file mode 100644
index 0000000000..dde493b544
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0025-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch
@@ -0,0 +1,78 @@
+From 76650cba4f338e9a15f6cb4bab56580802632dd0 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 15 Apr 2009 14:06:54 +0300
+Subject: [PATCH 025/146] DSS2: DSI: sidlemode to noidle while sending frame
+
+DISPC interrupts are not wake-up capable. Smart-idle in DISPC_SIDLEMODE
+causes DSS interface to go to idle at the end of the frame, and the
+FRAMEDONE interrupt is then delayed until something wakes up the DSS
+interface.
+
+So we set SIDLEMODE to no-idle when we start sending the frame, and
+set it back to smart-idle after receiving FRAMEDONE.
+---
+ drivers/video/omap2/dss/dispc.c | 10 ++++++++++
+ drivers/video/omap2/dss/dsi.c | 4 ++++
+ drivers/video/omap2/dss/dss.h | 3 +++
+ 3 files changed, 17 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index ae7be3d..16c68b8 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2791,6 +2791,16 @@ static void _omap_dispc_initialize_irq(void)
+ omap_dispc_set_irqs();
+ }
+
++void dispc_enable_sidle(void)
++{
++ REG_FLD_MOD(DISPC_SYSCONFIG, 2, 4, 3); /* SIDLEMODE: smart idle */
++}
++
++void dispc_disable_sidle(void)
++{
++ REG_FLD_MOD(DISPC_SYSCONFIG, 1, 4, 3); /* SIDLEMODE: no idle */
++}
++
+ static void _omap_dispc_initial_config(void)
+ {
+ u32 l;
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 66ac6ea..50af925 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2665,6 +2665,8 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+ l = FLD_MOD(l, 1, 31, 31); /* TE_START */
+ dsi_write_reg(DSI_VC_TE(1), l);
+
++ dispc_disable_sidle();
++
+ dispc_enable_lcd_out(1);
+
+ if (dsi.use_te)
+@@ -2678,6 +2680,8 @@ static void framedone_callback(void *data, u32 mask)
+ return;
+ }
+
++ dispc_enable_sidle();
++
+ dsi.framedone_scheduled = 1;
+
+ /* We get FRAMEDONE when DISPC has finished sending pixels and turns
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 0be42b6..d0917a8 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -244,6 +244,9 @@ void dispc_fake_vsync_irq(void);
+ void dispc_save_context(void);
+ void dispc_restore_context(void);
+
++void dispc_enable_sidle(void);
++void dispc_disable_sidle(void);
++
+ void dispc_lcd_enable_signal_polarity(bool act_high);
+ void dispc_lcd_enable_signal(bool enable);
+ void dispc_pck_free_enable(bool enable);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0026-DSS2-VRFB-rotation-and-mirroring-implemented.patch b/recipes/linux/linux-omap-pm/dss2/0026-DSS2-VRFB-rotation-and-mirroring-implemented.patch
new file mode 100644
index 0000000000..52c2942fde
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0026-DSS2-VRFB-rotation-and-mirroring-implemented.patch
@@ -0,0 +1,324 @@
+From 684d15b8505257b465ec26e473882560383471b8 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Thu, 9 Apr 2009 12:09:44 +0530
+Subject: [PATCH 026/146] DSS2: VRFB rotation and mirroring implemented.
+
+DSS2 modified to accept the rotation_type input
+to get the dma or VRFB rotation.
+
+DSS2: VRFB: Changed to pass DSS mode to vrfb_setup instead of Bpp.
+
+VRFB size registers requires the width to be halved when the
+mode is YUV or UYVY. So modifed to pass the mode to omap_vrfb_setup
+function.
+
+Code added by Tim Yamin for few bug fixes
+
+Signed-off-by: Tim Yamin <plasm@roo.me.uk>
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 6 ++
+ arch/arm/plat-omap/include/mach/vrfb.h | 3 +-
+ arch/arm/plat-omap/vrfb.c | 36 +++++++++-
+ drivers/video/omap2/dss/dispc.c | 109 +++++++++++++++++++++++++++--
+ drivers/video/omap2/dss/dss.h | 1 +
+ drivers/video/omap2/dss/manager.c | 1 +
+ 6 files changed, 144 insertions(+), 12 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 6b702c7..b0a6272 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -341,6 +341,11 @@ enum omap_dss_overlay_managers {
+
+ struct omap_overlay_manager;
+
++enum omap_dss_rotation_type {
++ OMAP_DSS_ROT_DMA = 0,
++ OMAP_DSS_ROT_VRFB = 1,
++};
++
+ struct omap_overlay_info {
+ bool enabled;
+
+@@ -351,6 +356,7 @@ struct omap_overlay_info {
+ u16 height;
+ enum omap_color_mode color_mode;
+ u8 rotation;
++ enum omap_dss_rotation_type rotation_type;
+ bool mirror;
+
+ u16 pos_x;
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+index 2047862..12c7fab 100644
+--- a/arch/arm/plat-omap/include/mach/vrfb.h
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -24,6 +24,7 @@
+ #ifndef __VRFB_H
+ #define __VRFB_H
+
++#include <mach/display.h>
+ #define OMAP_VRFB_LINE_LEN 2048
+
+ struct vrfb
+@@ -42,6 +43,6 @@ extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
+ u8 bytespp);
+ extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ u16 width, u16 height,
+- u8 bytespp);
++ enum omap_color_mode color_mode);
+
+ #endif /* __VRFB_H */
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index d68065f..2f08f6d 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -5,7 +5,6 @@
+
+ #include <mach/io.h>
+ #include <mach/vrfb.h>
+-
+ /*#define DEBUG*/
+
+ #ifdef DEBUG
+@@ -50,19 +49,48 @@ EXPORT_SYMBOL(omap_vrfb_adjust_size);
+
+ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ u16 width, u16 height,
+- u8 bytespp)
++ enum omap_color_mode color_mode)
+ {
+ unsigned pixel_size_exp;
+ u16 vrfb_width;
+ u16 vrfb_height;
+ u8 ctx = vrfb->context;
++ u8 bytespp;
+
+ DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
+ width, height, bytespp);
+
+- if (bytespp == 4)
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_ARGB16:
++ bytespp = 2;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24P:
++ bytespp = 3;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ bytespp = 4;
++ break;
++
++ default:
++ BUG();
++ return;
++ }
++
++ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
++ color_mode == OMAP_DSS_COLOR_UYVY)
++ width >>= 1;
++
++ if (bytespp == 4) {
+ pixel_size_exp = 2;
+- else if (bytespp == 2)
++ } else if (bytespp == 2)
+ pixel_size_exp = 1;
+ else
+ BUG();
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 16c68b8..23a8155 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1106,7 +1106,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
+ case 0: vidrot = 0; break;
+ case 1: vidrot = 1; break;
+ case 2: vidrot = 2; break;
+- case 3: vidrot = 1; break;
++ case 3: vidrot = 3; break;
+ }
+ }
+
+@@ -1134,7 +1134,92 @@ static s32 pixinc(int pixels, u8 ps)
+ BUG();
+ }
+
+-static void calc_rotation_offset(u8 rotation, bool mirror,
++static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
++ u16 screen_width,
++ u16 width, u16 height,
++ enum omap_color_mode color_mode, bool fieldmode,
++ unsigned *offset0, unsigned *offset1,
++ s32 *row_inc, s32 *pix_inc)
++{
++ u8 ps;
++
++ switch (color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_ARGB16:
++ ps = 2;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24P:
++ ps = 3;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ ps = 4;
++ break;
++
++ default:
++ BUG();
++ return;
++ }
++
++ DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
++ width, height);
++ switch (rotation + mirror * 4) {
++ case 0:
++ case 2:
++ /*
++ * If the pixel format is YUV or UYVY divide the width
++ * of the image by 2 for 0 and 180 degree rotation.
++ */
++ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
++ color_mode == OMAP_DSS_COLOR_UYVY)
++ width = width >> 1;
++ case 1:
++ case 3:
++ *offset0 = 0;
++ if (fieldmode)
++ *offset1 = screen_width * ps;
++ else
++ *offset1 = 0;
++
++ *row_inc = pixinc(1 + (screen_width - width) +
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(1, ps);
++ break;
++
++ case 4:
++ case 6:
++ /* If the pixel format is YUV or UYVY divide the width
++ * of the image by 2 for 0 degree and 180 degree
++ */
++ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
++ color_mode == OMAP_DSS_COLOR_UYVY)
++ width = width >> 1;
++ case 5:
++ case 7:
++ *offset0 = 0;
++ if (fieldmode)
++ *offset1 = screen_width * ps;
++ else
++ *offset1 = 0;
++ *row_inc = pixinc(1 - (screen_width + width) -
++ (fieldmode ? screen_width : 0),
++ ps);
++ *pix_inc = pixinc(1, ps);
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ u16 screen_width,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode, bool fieldmode,
+@@ -1357,6 +1442,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ u16 out_width, u16 out_height,
+ enum omap_color_mode color_mode,
+ bool ilace,
++ enum omap_dss_rotation_type rotation_type,
+ u8 rotation, int mirror)
+ {
+ const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
+@@ -1463,10 +1549,16 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ return -EINVAL;
+ }
+
+- calc_rotation_offset(rotation, mirror,
+- screen_width, width, frame_height, color_mode,
+- fieldmode,
+- &offset0, &offset1, &row_inc, &pix_inc);
++ if (rotation_type == OMAP_DSS_ROT_DMA)
++ calc_dma_rotation_offset(rotation, mirror,
++ screen_width, width, frame_height, color_mode,
++ fieldmode,
++ &offset0, &offset1, &row_inc, &pix_inc);
++ else
++ calc_vrfb_rotation_offset(rotation, mirror,
++ screen_width, width, frame_height, color_mode,
++ fieldmode,
++ &offset0, &offset1, &row_inc, &pix_inc);
+
+ DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
+ offset0, offset1, row_inc, pix_inc);
+@@ -2889,6 +2981,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ u16 out_width, u16 out_height,
+ enum omap_color_mode color_mode,
+ bool ilace,
++ enum omap_dss_rotation_type rotation_type,
+ u8 rotation, bool mirror)
+ {
+ int r = 0;
+@@ -2909,6 +3002,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ width, height,
+ out_width, out_height,
+ color_mode, ilace,
++ rotation_type,
+ rotation, mirror);
+
+ enable_clocks(0);
+@@ -3122,7 +3216,8 @@ void dispc_setup_partial_planes(struct omap_display *display,
+ pw, ph,
+ pow, poh,
+ pi->color_mode, 0,
+- pi->rotation, // XXX rotation probably wrong
++ pi->rotation_type,
++ pi->rotation,
+ pi->mirror);
+
+ dispc_enable_plane(ovl->id, 1);
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index d0917a8..584dce6 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -272,6 +272,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ u16 out_width, u16 out_height,
+ enum omap_color_mode color_mode,
+ bool ilace,
++ enum omap_dss_rotation_type rotation_type,
+ u8 rotation, bool mirror);
+
+ void dispc_go(enum omap_channel channel);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index b0fee80..8ca0bbb 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -395,6 +395,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ outh,
+ ovl->info.color_mode,
+ ilace,
++ ovl->info.rotation_type,
+ ovl->info.rotation,
+ ovl->info.mirror);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0027-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch b/recipes/linux/linux-omap-pm/dss2/0027-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch
new file mode 100644
index 0000000000..e451fb1910
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0027-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch
@@ -0,0 +1,236 @@
+From c90771a625b91517a178008b83ca1925d8f8d1dd Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Thu, 9 Apr 2009 12:13:07 +0530
+Subject: [PATCH 027/146] DSS2: OMAPFB: Added support for the YUV VRFB rotation and mirroring.
+
+DSS2 now requires roatation_type to be specified by driver.
+Added support for that.
+DSS2 OMAPFB: Modified to pass the dss mode to omap_vrfb_setup function.
+
+VRFB size register requires the width to be halved when the
+mode is YUV or UYVY. So VRFB is modifed to pass the mode to omap_vrfb_setup
+function.
+
+Few changes done by Tim Yamin
+Signed-off-by: Tim Yamin <plasm@roo.me.uk>
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/vrfb.c | 4 +-
+ drivers/video/omap2/omapfb/omapfb-main.c | 59 ++++++++++++++----------------
+ drivers/video/omap2/omapfb/omapfb.h | 7 +---
+ 3 files changed, 30 insertions(+), 40 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 2f08f6d..2ae0d68 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -88,9 +88,9 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ color_mode == OMAP_DSS_COLOR_UYVY)
+ width >>= 1;
+
+- if (bytespp == 4) {
++ if (bytespp == 4)
+ pixel_size_exp = 2;
+- } else if (bytespp == 2)
++ else if (bytespp == 2)
+ pixel_size_exp = 1;
+ else
+ BUG();
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 67c67c2..57f5900 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -176,15 +176,9 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
+
+ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
+ {
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+- unsigned offset;
+- int rot;
+-
+- rot = ofbi->rotation;
+-
+- offset = omapfb_get_vrfb_offset(ofbi, rot);
+-
+- return ofbi->region.vrfb.paddr[rot] + offset;
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
++ return ofbi->region.vrfb.paddr[ofbi->rotation]
++ + omapfb_get_vrfb_offset(ofbi, ofbi->rotation);
+ } else {
+ return ofbi->region.paddr;
+ }
+@@ -192,7 +186,7 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
+
+ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
+ {
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ return ofbi->region.vrfb.paddr[0];
+ else
+ return ofbi->region.paddr;
+@@ -200,7 +194,7 @@ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
+
+ void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
+ {
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ return ofbi->region.vrfb.vaddr[0];
+ else
+ return ofbi->region.vaddr;
+@@ -398,7 +392,7 @@ void set_fb_fix(struct fb_info *fbi)
+ fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
+
+ /* used by mmap in fbmem.c */
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ fix->line_length =
+ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
+ else
+@@ -434,11 +428,14 @@ void set_fb_fix(struct fb_info *fbi)
+ fix->xpanstep = 1;
+ fix->ypanstep = 1;
+
+- if (rg->size) {
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+- omap_vrfb_setup(&rg->vrfb, rg->paddr,
+- var->xres_virtual, var->yres_virtual,
+- var->bits_per_pixel >> 3);
++ if (rg->size && ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
++ enum omap_color_mode mode = 0;
++ mode = fb_mode_to_dss_mode(var);
++
++ omap_vrfb_setup(&rg->vrfb, rg->paddr,
++ var->xres_virtual,
++ var->yres_virtual,
++ mode);
+ }
+ }
+
+@@ -527,7 +524,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
+ if (var->yres > var->yres_virtual)
+ var->yres = var->yres_virtual;
+
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ line_size = OMAP_VRFB_LINE_LEN * bytespp;
+ else
+ line_size = var->xres_virtual * bytespp;
+@@ -549,7 +546,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
+
+ if (line_size * var->yres_virtual > max_frame_size) {
+ DBG("can't fit FB into memory, reducing x\n");
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ return -EINVAL;
+
+ var->xres_virtual = max_frame_size / var->yres_virtual /
+@@ -672,7 +669,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ struct omap_overlay_info info;
+ int xres, yres;
+ int screen_width;
+- int rot, mirror;
++ int mirror;
+
+ DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
+ posx, posy, outw, outh);
+@@ -688,7 +685,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ offset = ((var->yoffset * var->xres_virtual +
+ var->xoffset) * var->bits_per_pixel) >> 3;
+
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ data_start_p = omapfb_get_region_rot_paddr(ofbi);
+ data_start_v = NULL;
+ } else {
+@@ -711,13 +708,10 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+
+ ovl->get_overlay_info(ovl, &info);
+
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+- rot = 0;
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+ mirror = 0;
+- } else {
+- rot = ofbi->rotation;
++ else
+ mirror = ofbi->mirror;
+- }
+
+ info.paddr = data_start_p;
+ info.vaddr = data_start_v;
+@@ -725,7 +719,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ info.width = xres;
+ info.height = yres;
+ info.color_mode = mode;
+- info.rotation = rot;
++ info.rotation_type = ofbi->rotation_type;
++ info.rotation = ofbi->rotation;
+ info.mirror = mirror;
+
+ info.pos_x = posx;
+@@ -1121,7 +1116,7 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
+ if (rg->vaddr)
+ iounmap(rg->vaddr);
+
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ /* unmap the 0 angle rotation */
+ if (rg->vrfb.vaddr[0]) {
+ iounmap(rg->vrfb.vaddr[0]);
+@@ -1181,7 +1176,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ return -ENOMEM;
+ }
+
+- if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
++ if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
+ vaddr = ioremap_wc(paddr, size);
+
+ if (!vaddr) {
+@@ -1260,7 +1255,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+
+ display->get_resolution(display, &w, &h);
+
+- if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ #ifdef DEBUG
+ int oldw = w, oldh = h;
+ #endif
+@@ -1701,8 +1696,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
+ ofbi->id = i;
+
+ /* assign these early, so that fb alloc can use them */
+- ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
+- OMAPFB_ROT_DMA;
++ ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
++ OMAP_DSS_ROT_DMA;
+ ofbi->rotation = def_rotate;
+ ofbi->mirror = def_mirror;
+
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index 2607def..43f6922 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -53,11 +53,6 @@ struct omapfb2_mem_region {
+ bool map; /* kernel mapped by the driver */
+ };
+
+-enum omapfb_rotation_type {
+- OMAPFB_ROT_DMA = 0,
+- OMAPFB_ROT_VRFB = 1,
+-};
+-
+ /* appended to fb_info */
+ struct omapfb_info {
+ int id;
+@@ -66,7 +61,7 @@ struct omapfb_info {
+ int num_overlays;
+ struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
+ struct omapfb2_device *fbdev;
+- enum omapfb_rotation_type rotation_type;
++ enum omap_dss_rotation_type rotation_type;
+ u8 rotation;
+ bool mirror;
+ };
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch b/recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch
new file mode 100644
index 0000000000..148fc661d8
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0028-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch
@@ -0,0 +1,61 @@
+From 2e22c28ba3d4dd6c07e0c51903c8827c9a199c5e Mon Sep 17 00:00:00 2001
+From: Tim Yamin <plasm@roo.me.uk>
+Date: Mon, 13 Apr 2009 13:57:42 -0700
+Subject: [PATCH 028/146] DSS2: OMAPFB: Set line_length correctly for YUV with VRFB.
+
+Signed-off-by: Tim Yamin <plasm@roo.me.uk>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 30 +++++++++++++++++++++++++-----
+ 1 files changed, 25 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 57f5900..cd63740 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -392,10 +392,19 @@ void set_fb_fix(struct fb_info *fbi)
+ fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
+
+ /* used by mmap in fbmem.c */
+- if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
+- fix->line_length =
+- (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
+- else
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
++ switch (var->nonstd) {
++ case OMAPFB_COLOR_YUV422:
++ case OMAPFB_COLOR_YUY422:
++ fix->line_length =
++ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 2;
++ break;
++ default:
++ fix->line_length =
++ (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
++ break;
++ }
++ } else
+ fix->line_length =
+ (var->xres_virtual * var->bits_per_pixel) >> 3;
+ fix->smem_start = omapfb_get_region_paddr(ofbi);
+@@ -704,7 +713,18 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ goto err;
+ }
+
+- screen_width = fix->line_length / (var->bits_per_pixel >> 3);
++ switch (var->nonstd) {
++ case OMAPFB_COLOR_YUV422:
++ case OMAPFB_COLOR_YUY422:
++ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
++ screen_width = fix->line_length
++ / (var->bits_per_pixel >> 2);
++ break;
++ }
++ default:
++ screen_width = fix->line_length / (var->bits_per_pixel >> 3);
++ break;
++ }
+
+ ovl->get_overlay_info(ovl, &info);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0029-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch b/recipes/linux/linux-omap-pm/dss2/0029-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch
new file mode 100644
index 0000000000..1f7e9d826e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0029-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch
@@ -0,0 +1,29 @@
+From d005d1318e9ac306432f562bd74c6efebd577981 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Wed, 15 Apr 2009 17:05:18 +0530
+Subject: [PATCH 029/146] DSS2: dispc_get_trans_key was returning wrong key type
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/dss/dispc.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 23a8155..076d3d4 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1826,9 +1826,9 @@ void dispc_get_trans_key(enum omap_channel ch,
+ enable_clocks(1);
+ if (type) {
+ if (ch == OMAP_DSS_CHANNEL_LCD)
+- *type = REG_GET(DISPC_CONFIG, 11, 11) >> 11;
++ *type = REG_GET(DISPC_CONFIG, 11, 11);
+ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
+- *type = REG_GET(DISPC_CONFIG, 13, 13) >> 13;
++ *type = REG_GET(DISPC_CONFIG, 13, 13);
+ else
+ BUG();
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0030-DSS2-do-bootmem-reserve-for-exclusive-access.patch b/recipes/linux/linux-omap-pm/dss2/0030-DSS2-do-bootmem-reserve-for-exclusive-access.patch
new file mode 100644
index 0000000000..0436458564
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0030-DSS2-do-bootmem-reserve-for-exclusive-access.patch
@@ -0,0 +1,33 @@
+From 18386ebea56159305014c898ffaf034b95bb7ac5 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 14 Apr 2009 14:50:11 +0200
+Subject: [PATCH 030/146] DSS2: do bootmem reserve for exclusive access
+
+BOOTMEM_DEFAULT would allow multiple reservations for the same location,
+we need to reserve the region for our exclusive use. Also check if the
+reserve succeeded.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/vram.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index f24a110..520f260 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -524,7 +524,10 @@ void __init omapfb_reserve_sdram(void)
+ return;
+ }
+
+- reserve_bootmem(paddr, size, BOOTMEM_DEFAULT);
++ if (reserve_bootmem(paddr, size, BOOTMEM_EXCLUSIVE) < 0) {
++ pr_err("FB: failed to reserve VRAM\n");
++ return;
++ }
+ } else {
+ if (size > sdram_size) {
+ printk(KERN_ERR "Illegal SDRAM size for VRAM\n");
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0031-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch b/recipes/linux/linux-omap-pm/dss2/0031-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch
new file mode 100644
index 0000000000..b9e030619a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0031-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch
@@ -0,0 +1,35 @@
+From fe2a2cf84ab84bab840c0d2b8c92d95f1d9d6d84 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Thu, 9 Apr 2009 15:04:44 +0200
+Subject: [PATCH 031/146] DSS2: Fix DISPC_VID_FIR value for omap34xx
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+The msbs of the DISPC_VID_FIR fields were incorrectly masked out on
+omap34xx and thus 4:1 downscale did not work correctly.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 076d3d4..b8a3329 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -994,7 +994,10 @@ static void _dispc_set_fir(enum omap_plane plane, int hinc, int vinc)
+
+ BUG_ON(plane == OMAP_DSS_GFX);
+
+- val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0);
++ if (cpu_is_omap24xx())
++ val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0);
++ else
++ val = FLD_VAL(vinc, 28, 16) | FLD_VAL(hinc, 12, 0);
+ dispc_write_reg(fir_reg[plane-1], val);
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0032-DSS2-Prefer-3-tap-filter.patch b/recipes/linux/linux-omap-pm/dss2/0032-DSS2-Prefer-3-tap-filter.patch
new file mode 100644
index 0000000000..20156fd00e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0032-DSS2-Prefer-3-tap-filter.patch
@@ -0,0 +1,82 @@
+From d6fb2501311709ce820c3fb62c50259374c39dc5 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Thu, 9 Apr 2009 15:04:43 +0200
+Subject: [PATCH 032/146] DSS2: Prefer 3-tap filter
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+The 5-tap filter seems rather unstable. With some scaling settings it
+works and with some it doesn't even though the functional clock remains
+within the TRM limits. So prefer the 3-tap filter unless the functional
+clock required for it is too high.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 27 ++++++++++++---------------
+ 1 files changed, 12 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index b8a3329..b631dd8 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1405,15 +1405,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
+ }
+
+ static unsigned long calc_fclk(u16 width, u16 height,
+- u16 out_width, u16 out_height,
+- enum omap_color_mode color_mode, bool five_taps)
++ u16 out_width, u16 out_height)
+ {
+ unsigned int hf, vf;
+
+- if (five_taps)
+- return calc_fclk_five_taps(width, height,
+- out_width, out_height, color_mode);
+-
+ /*
+ * FIXME how to determine the 'A' factor
+ * for the no downscaling case ?
+@@ -1494,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ } else {
+ /* video plane */
+
+- unsigned long fclk;
++ unsigned long fclk = 0;
+
+ if (out_width < width / maxdownscale ||
+ out_width > width * 8)
+@@ -1530,20 +1525,22 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ /* Must use 5-tap filter? */
+ five_taps = height > out_height * 2;
+
+- /* Try to use 5-tap filter whenever possible. */
+- if (cpu_is_omap34xx() && !five_taps &&
+- height > out_height && width <= 1024) {
+- fclk = calc_fclk_five_taps(width, height,
+- out_width, out_height, color_mode);
+- if (fclk <= dispc_fclk_rate())
++ if (!five_taps) {
++ fclk = calc_fclk(width, height,
++ out_width, out_height);
++
++ /* Try 5-tap filter if 3-tap fclk is too high */
++ if (cpu_is_omap34xx() && height > out_height &&
++ fclk > dispc_fclk_rate())
+ five_taps = true;
+ }
+
+ if (width > (2048 >> five_taps))
+ return -EINVAL;
+
+- fclk = calc_fclk(width, height, out_width, out_height,
+- color_mode, five_taps);
++ if (five_taps)
++ fclk = calc_fclk_five_taps(width, height,
++ out_width, out_height, color_mode);
+
+ DSSDBG("required fclk rate = %lu Hz\n", fclk);
+ DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0033-DSS2-VRAM-improve-omap_vram_add_region.patch b/recipes/linux/linux-omap-pm/dss2/0033-DSS2-VRAM-improve-omap_vram_add_region.patch
new file mode 100644
index 0000000000..458d4913a0
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0033-DSS2-VRAM-improve-omap_vram_add_region.patch
@@ -0,0 +1,135 @@
+From 76d1928e53bbb506ddccd1f48f31c672f281c127 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 16 Apr 2009 17:56:00 +0300
+Subject: [PATCH 033/146] DSS2: VRAM: improve omap_vram_add_region()
+
+Combine postponed and non-posponed versions of omap_vram_add_region.
+Make the func non-static, so it can be called from board files.
+---
+ arch/arm/plat-omap/include/mach/vram.h | 1 +
+ arch/arm/plat-omap/vram.c | 54 +++++++++++++------------------
+ 2 files changed, 24 insertions(+), 31 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index f176562..8639e08 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -24,6 +24,7 @@
+
+ #include <asm/types.h>
+
++extern int omap_vram_add_region(unsigned long paddr, size_t size);
+ extern int omap_vram_free(unsigned long paddr, size_t size);
+ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
+ extern int omap_vram_reserve(unsigned long paddr, size_t size);
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 520f260..8e9fe77 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -60,6 +60,7 @@
+ * time when we cannot yet allocate the region list */
+ #define MAX_POSTPONED_REGIONS 10
+
++static bool vram_initialized;
+ static int postponed_cnt __initdata;
+ static struct {
+ unsigned long paddr;
+@@ -145,39 +146,32 @@ static void omap_vram_free_allocation(struct vram_alloc *va)
+ kfree(va);
+ }
+
+-static __init int omap_vram_add_region_postponed(unsigned long paddr,
+- size_t size)
+-{
+- if (postponed_cnt == MAX_POSTPONED_REGIONS)
+- return -ENOMEM;
+-
+- postponed_regions[postponed_cnt].paddr = paddr;
+- postponed_regions[postponed_cnt].size = size;
+-
+- ++postponed_cnt;
+-
+- return 0;
+-}
+-
+-/* add/remove_region can be exported if there's need to add/remove regions
+- * runtime */
+-static int omap_vram_add_region(unsigned long paddr, size_t size)
++int omap_vram_add_region(unsigned long paddr, size_t size)
+ {
+ struct vram_region *rm;
+ unsigned pages;
+
+- DBG("adding region paddr %08lx size %d\n",
+- paddr, size);
++ if (vram_initialized) {
++ DBG("adding region paddr %08lx size %d\n",
++ paddr, size);
+
+- size &= PAGE_MASK;
+- pages = size >> PAGE_SHIFT;
++ size &= PAGE_MASK;
++ pages = size >> PAGE_SHIFT;
+
+- rm = omap_vram_create_region(paddr, pages);
+- if (rm == NULL)
+- return -ENOMEM;
++ rm = omap_vram_create_region(paddr, pages);
++ if (rm == NULL)
++ return -ENOMEM;
++
++ list_add(&rm->list, &region_list);
++ } else {
++ if (postponed_cnt == MAX_POSTPONED_REGIONS)
++ return -ENOMEM;
+
+- list_add(&rm->list, &region_list);
++ postponed_regions[postponed_cnt].paddr = paddr;
++ postponed_regions[postponed_cnt].size = size;
+
++ ++postponed_cnt;
++ }
+ return 0;
+ }
+
+@@ -438,6 +432,8 @@ static __init int omap_vram_init(void)
+ {
+ int i, r;
+
++ vram_initialized = 1;
++
+ for (i = 0; i < postponed_cnt; i++)
+ omap_vram_add_region(postponed_regions[i].paddr,
+ postponed_regions[i].size);
+@@ -472,10 +468,6 @@ static void __init omapfb_early_vram(char **p)
+ omapfb_def_sdram_vram_size = memparse(*p, p);
+ if (**p == ',')
+ omapfb_def_sdram_vram_start = simple_strtoul((*p) + 1, p, 16);
+-
+- printk("omapfb_early_vram, %d, 0x%x\n",
+- omapfb_def_sdram_vram_size,
+- omapfb_def_sdram_vram_start);
+ }
+ __early_param("vram=", omapfb_early_vram);
+
+@@ -538,7 +530,7 @@ void __init omapfb_reserve_sdram(void)
+ BUG_ON(paddr & ~PAGE_MASK);
+ }
+
+- omap_vram_add_region_postponed(paddr, size);
++ omap_vram_add_region(paddr, size);
+
+ pr_info("Reserving %u bytes SDRAM for VRAM\n", size);
+ }
+@@ -594,7 +586,7 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
+ reserved = pend_avail - paddr;
+ size_avail = pend_avail - reserved - pstart_avail;
+
+- omap_vram_add_region_postponed(paddr, size);
++ omap_vram_add_region(paddr, size);
+
+ if (reserved)
+ pr_info("Reserving %lu bytes SRAM for VRAM\n", reserved);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0034-DSS2-Added-the-function-pointer-for-getting-default.patch b/recipes/linux/linux-omap-pm/dss2/0034-DSS2-Added-the-function-pointer-for-getting-default.patch
new file mode 100644
index 0000000000..5242142ac1
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0034-DSS2-Added-the-function-pointer-for-getting-default.patch
@@ -0,0 +1,66 @@
+From 45d3e5f313f3c617100ef0b6a7f10771acfb76a8 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Thu, 16 Apr 2009 18:47:49 +0530
+Subject: [PATCH 034/146] DSS2: Added the function pointer for getting default color.
+
+V4L2 Framework has a CID for getting/setting default color.
+So added the function pointer for doing same.
+SYSFS based getting the default color will remain same
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 1 +
+ drivers/video/omap2/dss/manager.c | 11 +++++++----
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index b0a6272..073cdda 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -414,6 +414,7 @@ struct omap_overlay_manager {
+ int (*apply)(struct omap_overlay_manager *mgr);
+
+ void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
++ u32 (*get_default_color)(struct omap_overlay_manager *mgr);
+ void (*set_trans_key)(struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type type,
+ u32 trans_key);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 8ca0bbb..12cf7b0 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -98,10 +98,8 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const cha
+ static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- u32 default_color;
+-
+- default_color = dispc_get_default_color(mgr->id);
+- return snprintf(buf, PAGE_SIZE, "%d", default_color);
++ return snprintf(buf, PAGE_SIZE, "%d",
++ mgr->get_default_color(mgr));
+ }
+
+ static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
+@@ -470,6 +468,10 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
+ {
+ dispc_enable_trans_key(mgr->id, enable);
+ }
++static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
++{
++ return dispc_get_default_color(mgr->id);
++}
+
+ static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
+ {
+@@ -512,6 +514,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ mgr->set_default_color = &omap_dss_mgr_set_def_color,
+ mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
+ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
++ mgr->get_default_color = &omap_dss_mgr_get_default_color;
+ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
+
+ dss_overlay_setup_dispc_manager(mgr);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-support-for-setting-and-querying-alpha-b.patch b/recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-support-for-setting-and-querying-alpha-b.patch
new file mode 100644
index 0000000000..8ec00b8c0c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0035-DSS2-Added-support-for-setting-and-querying-alpha-b.patch
@@ -0,0 +1,118 @@
+From cccb6206195978ab8ff0b08958b44a0d88e8bc94 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Thu, 16 Apr 2009 19:00:11 +0530
+Subject: [PATCH 035/146] DSS2: Added support for setting and querying alpha blending.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 3 +++
+ drivers/video/omap2/dss/dispc.c | 26 ++++++++++++++++++++++++++
+ drivers/video/omap2/dss/dss.h | 2 ++
+ drivers/video/omap2/dss/manager.c | 14 ++++++++++++++
+ 4 files changed, 45 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 073cdda..e1f615a 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -415,11 +415,14 @@ struct omap_overlay_manager {
+
+ void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
+ u32 (*get_default_color)(struct omap_overlay_manager *mgr);
++ bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
+ void (*set_trans_key)(struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type type,
+ u32 trans_key);
+ void (*enable_trans_key)(struct omap_overlay_manager *mgr,
+ bool enable);
++ void (*enable_alpha_blending)(struct omap_overlay_manager *mgr,
++ bool enable);
+ };
+
+ enum omap_display_caps {
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index b631dd8..7e551c2 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1847,6 +1847,32 @@ void dispc_enable_trans_key(enum omap_channel ch, bool enable)
+ REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12);
+ enable_clocks(0);
+ }
++void dispc_enable_alpha_blending(enum omap_channel ch, bool enable)
++{
++ enable_clocks(1);
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
++ else /* OMAP_DSS_CHANNEL_DIGIT */
++ REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
++ enable_clocks(0);
++}
++bool dispc_alpha_blending_enabled(enum omap_channel ch)
++{
++ bool enabled;
++
++ enable_clocks(1);
++ if (ch == OMAP_DSS_CHANNEL_LCD)
++ enabled = REG_GET(DISPC_CONFIG, 18, 18);
++ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
++ enabled = REG_GET(DISPC_CONFIG, 18, 18);
++ else
++ BUG();
++ enable_clocks(0);
++
++ return enabled;
++
++}
++
+
+ bool dispc_trans_key_enabled(enum omap_channel ch)
+ {
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 584dce6..1d01ff6 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -294,7 +294,9 @@ void dispc_get_trans_key(enum omap_channel ch,
+ enum omap_dss_color_key_type *type,
+ u32 *trans_key);
+ void dispc_enable_trans_key(enum omap_channel ch, bool enable);
++void dispc_enable_alpha_blending(enum omap_channel ch, bool enable);
+ bool dispc_trans_key_enabled(enum omap_channel ch);
++bool dispc_alpha_blending_enabled(enum omap_channel ch);
+
+ void dispc_set_lcd_timings(struct omap_video_timings *timings);
+ unsigned long dispc_fclk_rate(void);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 12cf7b0..90acd28 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -468,6 +468,16 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
+ {
+ dispc_enable_trans_key(mgr->id, enable);
+ }
++static void omap_dss_mgr_enable_alpha_blending(struct omap_overlay_manager *mgr,
++ bool enable)
++{
++ dispc_enable_alpha_blending(mgr->id, enable);
++}
++static bool omap_dss_mgr_get_alpha_blending_status(
++ struct omap_overlay_manager *mgr)
++{
++ return dispc_alpha_blending_enabled(mgr->id);
++}
+ static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
+ {
+ return dispc_get_default_color(mgr->id);
+@@ -514,6 +524,10 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ mgr->set_default_color = &omap_dss_mgr_set_def_color,
+ mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
+ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
++ mgr->enable_alpha_blending =
++ &omap_dss_mgr_enable_alpha_blending;
++ mgr->get_alpha_blending_status =
++ omap_dss_mgr_get_alpha_blending_status;
+ mgr->get_default_color = &omap_dss_mgr_get_default_color;
+ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-querying-color-keying.patch b/recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-querying-color-keying.patch
new file mode 100644
index 0000000000..1afe7b42f9
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0036-DSS2-Added-support-for-querying-color-keying.patch
@@ -0,0 +1,150 @@
+From c6f6a968cb089237a092d4c1a294dbe79671bb3c Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 17 Apr 2009 09:42:36 +0530
+Subject: [PATCH 036/146] DSS2: Added support for querying color keying.
+
+V4L2 Framework has a ioctl for getting/setting color keying.
+So added the function manager pointers for doing same.
+
+Modifed the color keying sysfs entries to use manager
+function pointer. Earlier they were calling direcly
+dispc function to set/enable color keying.
+
+Some of color-keying function pointers in the overlay_manager
+structure re-named to be more specific.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 6 ++++-
+ drivers/video/omap2/dss/manager.c | 36 +++++++++++++++++++++--------
+ 2 files changed, 31 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index e1f615a..d0b4c83 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -416,7 +416,11 @@ struct omap_overlay_manager {
+ void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
+ u32 (*get_default_color)(struct omap_overlay_manager *mgr);
+ bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
+- void (*set_trans_key)(struct omap_overlay_manager *mgr,
++ bool (*get_trans_key_status)(struct omap_overlay_manager *mgr);
++ void (*get_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
++ enum omap_dss_color_key_type *type,
++ u32 *trans_key);
++ void (*set_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type type,
+ u32 trans_key);
+ void (*enable_trans_key)(struct omap_overlay_manager *mgr,
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 90acd28..e0501c4 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -124,7 +124,7 @@ static ssize_t manager_color_key_type_show(struct omap_overlay_manager *mgr,
+ {
+ enum omap_dss_color_key_type key_type;
+
+- dispc_get_trans_key(mgr->id, &key_type, NULL);
++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+ BUG_ON(key_type >= ARRAY_SIZE(color_key_type_str));
+
+ return snprintf(buf, PAGE_SIZE, "%s\n", color_key_type_str[key_type]);
+@@ -143,8 +143,8 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
+ }
+ if (key_type == ARRAY_SIZE(color_key_type_str))
+ return -EINVAL;
+- dispc_get_trans_key(mgr->id, NULL, &key_value);
+- dispc_set_trans_key(mgr->id, key_type, key_value);
++ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
++ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
+
+ return size;
+ }
+@@ -154,7 +154,7 @@ static ssize_t manager_color_key_value_show(struct omap_overlay_manager *mgr,
+ {
+ u32 key_value;
+
+- dispc_get_trans_key(mgr->id, NULL, &key_value);
++ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", key_value);
+ }
+@@ -167,8 +167,8 @@ static ssize_t manager_color_key_value_store(struct omap_overlay_manager *mgr,
+
+ if (sscanf(buf, "%d", &key_value) != 1)
+ return -EINVAL;
+- dispc_get_trans_key(mgr->id, &key_type, NULL);
+- dispc_set_trans_key(mgr->id, key_type, key_value);
++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
++ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
+
+ return size;
+ }
+@@ -177,7 +177,7 @@ static ssize_t manager_color_key_enabled_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+- dispc_trans_key_enabled(mgr->id));
++ mgr->get_trans_key_status(mgr));
+ }
+
+ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
+@@ -188,7 +188,7 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+
+- dispc_enable_trans_key(mgr->id, enable);
++ mgr->enable_trans_key(mgr, enable);
+
+ return size;
+ }
+@@ -456,12 +456,20 @@ static void omap_dss_mgr_set_def_color(struct omap_overlay_manager *mgr,
+ dispc_set_default_color(mgr->id, color);
+ }
+
+-static void omap_dss_mgr_set_trans_key(struct omap_overlay_manager *mgr,
++static void omap_dss_mgr_set_trans_key_type_and_value(
++ struct omap_overlay_manager *mgr,
+ enum omap_dss_color_key_type type,
+ u32 trans_key)
+ {
+ dispc_set_trans_key(mgr->id, type, trans_key);
+ }
++static void omap_dss_mgr_get_trans_key_type_and_value(
++ struct omap_overlay_manager *mgr,
++ enum omap_dss_color_key_type *type,
++ u32 *trans_key)
++{
++ dispc_get_trans_key(mgr->id, type, trans_key);
++}
+
+ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
+ bool enable)
+@@ -482,6 +490,10 @@ static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
+ {
+ return dispc_get_default_color(mgr->id);
+ }
++static bool omap_dss_mgr_get_trans_key_status(struct omap_overlay_manager *mgr)
++{
++ return dispc_trans_key_enabled(mgr->id);
++}
+
+ static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
+ {
+@@ -522,8 +534,12 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ mgr->unset_display = &omap_dss_unset_display,
+ mgr->apply = &omap_dss_mgr_apply,
+ mgr->set_default_color = &omap_dss_mgr_set_def_color,
+- mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
++ mgr->set_trans_key_type_and_value =
++ &omap_dss_mgr_set_trans_key_type_and_value,
++ mgr->get_trans_key_type_and_value =
++ &omap_dss_mgr_get_trans_key_type_and_value,
+ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
++ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status,
+ mgr->enable_alpha_blending =
+ &omap_dss_mgr_enable_alpha_blending;
+ mgr->get_alpha_blending_status =
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0037-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch b/recipes/linux/linux-omap-pm/dss2/0037-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch
new file mode 100644
index 0000000000..85b21b4e26
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0037-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch
@@ -0,0 +1,56 @@
+From a68284a6285a035a9572b6e0c5178751826db75f Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 17 Apr 2009 09:51:25 +0530
+Subject: [PATCH 037/146] DSS2:OMAPFB: Some color keying pointerd renamed in DSS2. Replicated in FB
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 7f18d2a..79d8916 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -288,7 +288,8 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
+ {
+ enum omap_dss_color_key_type kt;
+
+- if(!mgr->set_default_color || !mgr->set_trans_key ||
++ if (!mgr->set_default_color ||
++ !mgr->set_trans_key_type_and_value ||
+ !mgr->enable_trans_key)
+ return 0;
+
+@@ -310,7 +311,7 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
+ }
+
+ mgr->set_default_color(mgr, ck->background);
+- mgr->set_trans_key(mgr, kt, ck->trans_key);
++ mgr->set_trans_key_type_and_value(mgr, kt, ck->trans_key);
+ mgr->enable_trans_key(mgr, 1);
+
+ omapfb_color_keys[mgr->id] = *ck;
+@@ -341,7 +342,8 @@ static int omapfb_set_color_key(struct fb_info *fbi,
+ goto err;
+ }
+
+- if(!mgr->set_default_color || !mgr->set_trans_key ||
++ if (!mgr->set_default_color ||
++ !mgr->set_trans_key_type_and_value ||
+ !mgr->enable_trans_key) {
+ r = -ENODEV;
+ goto err;
+@@ -377,7 +379,8 @@ static int omapfb_get_color_key(struct fb_info *fbi,
+ goto err;
+ }
+
+- if(!mgr->set_default_color || !mgr->set_trans_key ||
++ if (!mgr->set_default_color ||
++ !mgr->set_trans_key_type_and_value ||
+ !mgr->enable_trans_key) {
+ r = -ENODEV;
+ goto err;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0038-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch b/recipes/linux/linux-omap-pm/dss2/0038-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch
new file mode 100644
index 0000000000..fa5c658ae1
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0038-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch
@@ -0,0 +1,59 @@
+From b10751409130b1260992ab2b96d4d50f9f375f7f Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 17 Apr 2009 13:58:21 +0530
+Subject: [PATCH 038/146] DSS2: Add sysfs entry to for the alpha blending support.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/dss/manager.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index e0501c4..7965a84 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -192,6 +192,22 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
+
+ return size;
+ }
++static ssize_t manager_alpha_blending_enabled_show(
++ struct omap_overlay_manager *mgr, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n",
++ mgr->get_alpha_blending_status(mgr));
++}
++static ssize_t manager_alpha_blending_enabled_store(
++ struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
++{
++ int enable;
++ if (sscanf(buf, "%d", &enable) != 1)
++ return -EINVAL;
++ mgr->enable_alpha_blending(mgr, enable);
++ return size;
++}
+
+
+ struct manager_attribute {
+@@ -215,6 +231,10 @@ static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR,
+ manager_color_key_value_show, manager_color_key_value_store);
+ static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR,
+ manager_color_key_enabled_show, manager_color_key_enabled_store);
++static MANAGER_ATTR(alpha_blending_enabled, S_IRUGO|S_IWUSR,
++ manager_alpha_blending_enabled_show,
++ manager_alpha_blending_enabled_store);
++
+
+ static struct attribute *manager_sysfs_attrs[] = {
+ &manager_attr_name.attr,
+@@ -223,6 +243,7 @@ static struct attribute *manager_sysfs_attrs[] = {
+ &manager_attr_color_key_type.attr,
+ &manager_attr_color_key_value.attr,
+ &manager_attr_color_key_enabled.attr,
++ &manager_attr_alpha_blending_enabled.attr,
+ NULL
+ };
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0039-DSS2-Provided-proper-exclusion-for-destination-colo.patch b/recipes/linux/linux-omap-pm/dss2/0039-DSS2-Provided-proper-exclusion-for-destination-colo.patch
new file mode 100644
index 0000000000..7193209c42
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0039-DSS2-Provided-proper-exclusion-for-destination-colo.patch
@@ -0,0 +1,97 @@
+From 3a26967466a00e8a0727ecf6b9b4a42b949867de Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 17 Apr 2009 14:24:46 +0530
+Subject: [PATCH 039/146] DSS2: Provided proper exclusion for destination color keying and alpha blending.
+
+OMAP does not support destination color key and alpha blending
+simultaneously. So this patch does not allow the user
+so set both at a time.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/dss/manager.c | 50 ++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 49 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 7965a84..108489c 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -137,12 +137,26 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
+ u32 key_value;
+
+ for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
+- key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
++ key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
+ if (sysfs_streq(buf, color_key_type_str[key_type]))
+ break;
+ }
+ if (key_type == ARRAY_SIZE(color_key_type_str))
+ return -EINVAL;
++ /* OMAP does not support destination color key and alpha blending
++ * simultaneously. So if alpha blending and color keying both are
++ * enabled then refrain from setting the color key type to
++ * gfx-destination
++ */
++ if (!key_type) {
++ bool color_key_enabled;
++ bool alpha_blending_enabled;
++ color_key_enabled = mgr->get_trans_key_status(mgr);
++ alpha_blending_enabled = mgr->get_alpha_blending_status(mgr);
++ if (color_key_enabled && alpha_blending_enabled)
++ return -EINVAL;
++ }
++
+ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
+
+@@ -188,6 +202,23 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+
++ /* OMAP does not support destination color keying and
++ * alpha blending simultaneously. so if alpha blending
++ * is enabled refrain from enabling destination color
++ * keying.
++ */
++ if (enable) {
++ bool enabled;
++ enabled = mgr->get_alpha_blending_status(mgr);
++ if (enabled) {
++ enum omap_dss_color_key_type key_type;
++ mgr->get_trans_key_type_and_value(mgr,
++ &key_type, NULL);
++ if (!key_type)
++ return -EINVAL;
++ }
++
++ }
+ mgr->enable_trans_key(mgr, enable);
+
+ return size;
+@@ -205,6 +236,23 @@ static ssize_t manager_alpha_blending_enabled_store(
+ int enable;
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
++ /* OMAP does not support destination color keying and
++ * alpha blending simultaneously. so if destination
++ * color keying is enabled refrain from enabling
++ * alpha blending
++ */
++ if (enable) {
++ bool enabled;
++ enabled = mgr->get_trans_key_status(mgr);
++ if (enabled) {
++ enum omap_dss_color_key_type key_type;
++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
++ if (!key_type)
++ return -EINVAL;
++
++ }
++
++ }
+ mgr->enable_alpha_blending(mgr, enable);
+ return size;
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0040-DSS2-Disable-vertical-offset-with-fieldmode.patch b/recipes/linux/linux-omap-pm/dss2/0040-DSS2-Disable-vertical-offset-with-fieldmode.patch
new file mode 100644
index 0000000000..e153c9c5a4
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0040-DSS2-Disable-vertical-offset-with-fieldmode.patch
@@ -0,0 +1,71 @@
+From a2649a29d782112aa5e853f71992314f631762e2 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 20 Apr 2009 16:26:18 +0200
+Subject: [PATCH 040/146] DSS2: Disable vertical offset with fieldmode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When using fieldmode each field is basically a separate picture so the
+vertical filter should start at phase 0 for both fields.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 23 +++++++++--------------
+ 1 files changed, 9 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 7e551c2..f15614b 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1029,12 +1029,12 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
+ static void _dispc_set_scaling(enum omap_plane plane,
+ u16 orig_width, u16 orig_height,
+ u16 out_width, u16 out_height,
+- bool ilace, bool five_taps)
++ bool ilace, bool five_taps,
++ bool fieldmode)
+ {
+ int fir_hinc;
+ int fir_vinc;
+ int hscaleup, vscaleup;
+- int fieldmode = 0;
+ int accu0 = 0;
+ int accu1 = 0;
+ u32 l;
+@@ -1072,17 +1072,12 @@ static void _dispc_set_scaling(enum omap_plane plane,
+
+ dispc_write_reg(dispc_reg_att[plane], l);
+
+- if (ilace) {
+- if (fieldmode) {
+- accu0 = fir_vinc / 2;
+- accu1 = 0;
+- } else {
+- accu0 = 0;
+- accu1 = fir_vinc / 2;
+- if (accu1 >= 1024/2) {
+- accu0 = 1024/2;
+- accu1 -= accu0;
+- }
++ if (ilace && !fieldmode) {
++ accu0 = 0;
++ accu1 = fir_vinc / 2;
++ if (accu1 >= 1024/2) {
++ accu0 = 1024/2;
++ accu1 -= accu0;
+ }
+ }
+
+@@ -1582,7 +1577,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ if (plane != OMAP_DSS_GFX) {
+ _dispc_set_scaling(plane, width, height,
+ out_width, out_height,
+- ilace, five_taps);
++ ilace, five_taps, fieldmode);
+ _dispc_set_vid_size(plane, out_width, out_height);
+ _dispc_set_vid_color_conv(plane, cconv);
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0041-DSS2-Don-t-enable-fieldmode-automatically.patch b/recipes/linux/linux-omap-pm/dss2/0041-DSS2-Don-t-enable-fieldmode-automatically.patch
new file mode 100644
index 0000000000..fe0e27ec4a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0041-DSS2-Don-t-enable-fieldmode-automatically.patch
@@ -0,0 +1,34 @@
+From 9e4341c229dd7e78a5612b8b9259f1dcf19a7f84 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 20 Apr 2009 16:26:19 +0200
+Subject: [PATCH 041/146] DSS2: Don't enable fieldmode automatically
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+The only case where enabling fieldmode automatically seems reasonable
+is when source and destination heights are equal. Some kind of user
+controllable knob should be added so the user could enable field mode
+when the source is interlaced.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index f15614b..1c036c1 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1450,7 +1450,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ if (paddr == 0)
+ return -EINVAL;
+
+- if (ilace && height >= out_height)
++ if (ilace && height == out_height)
+ fieldmode = 1;
+
+ if (ilace) {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0042-DSS2-Swap-field-0-and-field-1-registers.patch b/recipes/linux/linux-omap-pm/dss2/0042-DSS2-Swap-field-0-and-field-1-registers.patch
new file mode 100644
index 0000000000..d56a39a5a6
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0042-DSS2-Swap-field-0-and-field-1-registers.patch
@@ -0,0 +1,170 @@
+From 8f69b9dbb2783e69c2a30c73fe2b2b1dc5b1dd52 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 20 Apr 2009 16:26:20 +0200
+Subject: [PATCH 042/146] DSS2: Swap field 0 and field 1 registers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+The values for the registers which have alternate values for each field
+were reveresed to what the hardware expects. For the hardware field 0
+is the even field or the bottom field, field 1 is the odd field or the
+top field. So simply swap the register values.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 66 ++++++++++++++++++++++-----------------
+ 1 files changed, 37 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 1c036c1..9bab6cf 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1072,12 +1072,16 @@ static void _dispc_set_scaling(enum omap_plane plane,
+
+ dispc_write_reg(dispc_reg_att[plane], l);
+
++ /*
++ * field 0 = even field = bottom field
++ * field 1 = odd field = top field
++ */
+ if (ilace && !fieldmode) {
+- accu0 = 0;
+- accu1 = fir_vinc / 2;
+- if (accu1 >= 1024/2) {
+- accu0 = 1024/2;
+- accu1 -= accu0;
++ accu1 = 0;
++ accu0 = fir_vinc / 2;
++ if (accu0 >= 1024/2) {
++ accu1 = 1024/2;
++ accu0 -= accu1;
+ }
+ }
+
+@@ -1266,34 +1270,38 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ fbh = width;
+ }
+
++ /*
++ * field 0 = even field = bottom field
++ * field 1 = odd field = top field
++ */
+ switch (rotation + mirror * 4) {
+ case 0:
+- *offset0 = 0;
++ *offset1 = 0;
+ if (fieldmode)
+- *offset1 = screen_width * ps;
++ *offset0 = screen_width * ps;
+ else
+- *offset1 = 0;
++ *offset0 = 0;
+ *row_inc = pixinc(1 + (screen_width - fbw) +
+ (fieldmode ? screen_width : 0),
+ ps);
+ *pix_inc = pixinc(1, ps);
+ break;
+ case 1:
+- *offset0 = screen_width * (fbh - 1) * ps;
++ *offset1 = screen_width * (fbh - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 + ps;
++ *offset0 = *offset1 + ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * (fbh - 1) + 1 +
+ (fieldmode ? 1 : 0), ps);
+ *pix_inc = pixinc(-screen_width, ps);
+ break;
+ case 2:
+- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
++ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 - screen_width * ps;
++ *offset0 = *offset1 - screen_width * ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(-1 -
+ (screen_width - fbw) -
+ (fieldmode ? screen_width : 0),
+@@ -1301,11 +1309,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ *pix_inc = pixinc(-1, ps);
+ break;
+ case 3:
+- *offset0 = (fbw - 1) * ps;
++ *offset1 = (fbw - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 - ps;
++ *offset0 = *offset1 - ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(-screen_width * (fbh - 1) - 1 -
+ (fieldmode ? 1 : 0), ps);
+ *pix_inc = pixinc(screen_width, ps);
+@@ -1313,11 +1321,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+
+ /* mirroring */
+ case 0 + 4:
+- *offset0 = (fbw - 1) * ps;
++ *offset1 = (fbw - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 + screen_width * ps;
++ *offset0 = *offset1 + screen_width * ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * 2 - 1 +
+ (fieldmode ? screen_width : 0),
+ ps);
+@@ -1325,11 +1333,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+
+ case 1 + 4:
+- *offset0 = 0;
++ *offset1 = 0;
+ if (fieldmode)
+- *offset1 = *offset0 + screen_width * ps;
++ *offset0 = *offset1 + screen_width * ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(-screen_width * (fbh - 1) + 1 +
+ (fieldmode ? 1 : 0),
+ ps);
+@@ -1337,11 +1345,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+
+ case 2 + 4:
+- *offset0 = screen_width * (fbh - 1) * ps;
++ *offset1 = screen_width * (fbh - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 + screen_width * ps;
++ *offset0 = *offset1 + screen_width * ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(1 - screen_width * 2 -
+ (fieldmode ? screen_width : 0),
+ ps);
+@@ -1349,11 +1357,11 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+
+ case 3 + 4:
+- *offset0 = (screen_width * (fbh - 1) + fbw - 1) * ps;
++ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+ if (fieldmode)
+- *offset1 = *offset0 + screen_width * ps;
++ *offset0 = *offset1 + screen_width * ps;
+ else
+- *offset1 = *offset0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * (fbh - 1) - 1 -
+ (fieldmode ? 1 : 0),
+ ps);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0043-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch b/recipes/linux/linux-omap-pm/dss2/0043-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch
new file mode 100644
index 0000000000..1dd9176001
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0043-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch
@@ -0,0 +1,76 @@
+From 99cf62779ad75224b9b8ea6490733ac5557d1763 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Mon, 20 Apr 2009 14:55:33 +0200
+Subject: [PATCH 043/146] DSS2: add sysfs entry for seting the rotate type
+
+This can help in utilizing VRAM memory better. Since with VRFB rotation
+we waste a lot of physical memory due to the VRFB HW design, provide the
+possibility to turn it off and free the extra memory for the use by other
+planes for example.
+---
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 42 ++++++++++++++++++++++++++++-
+ 1 files changed, 41 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index 2c88718..4e3da42 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -43,6 +43,46 @@ static ssize_t show_rotate_type(struct device *dev,
+ return snprintf(buf, PAGE_SIZE, "%d\n", ofbi->rotation_type);
+ }
+
++static ssize_t store_rotate_type(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ enum omap_dss_rotation_type rot_type;
++ int r;
++
++ rot_type = simple_strtoul(buf, NULL, 0);
++
++ if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
++ return -EINVAL;
++
++ omapfb_lock(fbdev);
++
++ r = 0;
++ if (rot_type == ofbi->rotation_type)
++ goto out;
++
++ r = -EBUSY;
++ if (ofbi->region.size)
++ goto out;
++
++ ofbi->rotation_type = rot_type;
++
++ /*
++ * Since the VRAM for this FB is not allocated at the moment we don't need to
++ * do any further parameter checking at this point.
++ */
++
++ r = count;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
++
+ static ssize_t show_mirror(struct device *dev,
+ struct device_attribute *attr, char *buf)
+ {
+@@ -327,7 +367,7 @@ static ssize_t show_virt(struct device *dev,
+ }
+
+ static struct device_attribute omapfb_attrs[] = {
+- __ATTR(rotate_type, S_IRUGO, show_rotate_type, NULL),
++ __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, store_rotate_type),
+ __ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror),
+ __ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size),
+ __ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays),
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0044-DSS2-Fixed-line-endings-from-to.patch b/recipes/linux/linux-omap-pm/dss2/0044-DSS2-Fixed-line-endings-from-to.patch
new file mode 100644
index 0000000000..39baba371f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0044-DSS2-Fixed-line-endings-from-to.patch
@@ -0,0 +1,48 @@
+From d4e33a71922c6e2c13a70428a5d3118fb827fce7 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 21 Apr 2009 09:25:16 +0300
+Subject: [PATCH 044/146] DSS2: Fixed line endings from , to ;
+
+---
+ drivers/video/omap2/dss/manager.c | 18 +++++++++---------
+ 1 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 108489c..bf059e0 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -599,22 +599,22 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ break;
+ }
+
+- mgr->set_display = &omap_dss_set_display,
+- mgr->unset_display = &omap_dss_unset_display,
+- mgr->apply = &omap_dss_mgr_apply,
+- mgr->set_default_color = &omap_dss_mgr_set_def_color,
++ mgr->set_display = &omap_dss_set_display;
++ mgr->unset_display = &omap_dss_unset_display;
++ mgr->apply = &omap_dss_mgr_apply;
++ mgr->set_default_color = &omap_dss_mgr_set_def_color;
+ mgr->set_trans_key_type_and_value =
+- &omap_dss_mgr_set_trans_key_type_and_value,
++ &omap_dss_mgr_set_trans_key_type_and_value;
+ mgr->get_trans_key_type_and_value =
+- &omap_dss_mgr_get_trans_key_type_and_value,
+- mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
+- mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status,
++ &omap_dss_mgr_get_trans_key_type_and_value;
++ mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key;
++ mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status;
+ mgr->enable_alpha_blending =
+ &omap_dss_mgr_enable_alpha_blending;
+ mgr->get_alpha_blending_status =
+ omap_dss_mgr_get_alpha_blending_status;
+ mgr->get_default_color = &omap_dss_mgr_get_default_color;
+- mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,
++ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
+
+ dss_overlay_setup_dispc_manager(mgr);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0045-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch b/recipes/linux/linux-omap-pm/dss2/0045-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch
new file mode 100644
index 0000000000..298095d214
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0045-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch
@@ -0,0 +1,26 @@
+From 23ee17c38e6762ff59dda729ffae8d9bf483f9c5 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 21 Apr 2009 10:11:55 +0300
+Subject: [PATCH 045/146] DSS2: DSI: decrease sync timeout from 60s to 2s
+
+The framedone-problem should be ok now, so we shouldn't get long waits.
+---
+ drivers/video/omap2/dss/dsi.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 50af925..d59ad38 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -3216,7 +3216,7 @@ static void dsi_push_set_mirror(struct omap_display *display, int mirror)
+
+ static int dsi_wait_sync(struct omap_display *display)
+ {
+- long wait = msecs_to_jiffies(60000);
++ long wait = msecs_to_jiffies(2000);
+ struct completion compl;
+
+ DSSDBGF("");
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0046-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch b/recipes/linux/linux-omap-pm/dss2/0046-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
new file mode 100644
index 0000000000..50b4fea0f0
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0046-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
@@ -0,0 +1,44 @@
+From 18c8d0ed7236cca6a52a701001337131d7e066e7 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 21 Apr 2009 15:18:36 +0200
+Subject: [PATCH 046/146] DSS2: fix return value for rotate_type sysfs function
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 9 ++++-----
+ 1 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index 4e3da42..13028ae 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -64,9 +64,10 @@ static ssize_t store_rotate_type(struct device *dev,
+ if (rot_type == ofbi->rotation_type)
+ goto out;
+
+- r = -EBUSY;
+- if (ofbi->region.size)
++ if (ofbi->region.size) {
++ r = -EBUSY;
+ goto out;
++ }
+
+ ofbi->rotation_type = rot_type;
+
+@@ -74,12 +75,10 @@ static ssize_t store_rotate_type(struct device *dev,
+ * Since the VRAM for this FB is not allocated at the moment we don't need to
+ * do any further parameter checking at this point.
+ */
+-
+- r = count;
+ out:
+ omapfb_unlock(fbdev);
+
+- return r;
++ return r ? r : count;
+ }
+
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0047-DSS2-VRAM-clear-allocated-area-with-DMA.patch b/recipes/linux/linux-omap-pm/dss2/0047-DSS2-VRAM-clear-allocated-area-with-DMA.patch
new file mode 100644
index 0000000000..40748784c8
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0047-DSS2-VRAM-clear-allocated-area-with-DMA.patch
@@ -0,0 +1,101 @@
+From 1850c0c28d013be68d398cac330a0dcfbb7a1ed6 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 22 Apr 2009 10:25:20 +0300
+Subject: [PATCH 047/146] DSS2: VRAM: clear allocated area with DMA
+
+Use DMA constant fill feature to clear VRAM area when
+someone allocates it.
+---
+ arch/arm/plat-omap/vram.c | 57 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 57 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 8e9fe77..90276ac 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -31,11 +31,13 @@
+ #include <linux/seq_file.h>
+ #include <linux/bootmem.h>
+ #include <linux/omapfb.h>
++#include <linux/completion.h>
+
+ #include <asm/setup.h>
+
+ #include <mach/sram.h>
+ #include <mach/vram.h>
++#include <mach/dma.h>
+
+ #ifdef DEBUG
+ #define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__)
+@@ -276,6 +278,59 @@ int omap_vram_reserve(unsigned long paddr, size_t size)
+ }
+ EXPORT_SYMBOL(omap_vram_reserve);
+
++static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data)
++{
++ struct completion *compl = data;
++ complete(compl);
++}
++
++static int _omap_vram_clear(u32 paddr, unsigned pages)
++{
++ struct completion compl;
++ unsigned elem_count;
++ unsigned frame_count;
++ int r;
++ int lch;
++
++ init_completion(&compl);
++
++ r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA",
++ _omap_vram_dma_cb,
++ &compl, &lch);
++ if (r) {
++ pr_err("VRAM: request_dma failed for memory clear\n");
++ return -EBUSY;
++ }
++
++ elem_count = pages * PAGE_SIZE / 4;
++ frame_count = 1;
++
++ omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32,
++ elem_count, frame_count,
++ OMAP_DMA_SYNC_ELEMENT,
++ 0, 0);
++
++ omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC,
++ paddr, 0, 0);
++
++ omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000);
++
++ omap_start_dma(lch);
++
++ if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) {
++ omap_stop_dma(lch);
++ pr_err("VRAM: dma timeout while clearing memory\n");
++ r = -EIO;
++ goto err;
++ }
++
++ r = 0;
++err:
++ omap_free_dma(lch);
++
++ return r;
++}
++
+ static int _omap_vram_alloc(int mtype, unsigned pages, unsigned long *paddr)
+ {
+ struct vram_region *rm;
+@@ -313,6 +368,8 @@ found:
+
+ *paddr = start;
+
++ _omap_vram_clear(start, pages);
++
+ return 0;
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0048-DSS2-OMAPFB-remove-fb-clearing-code.patch b/recipes/linux/linux-omap-pm/dss2/0048-DSS2-OMAPFB-remove-fb-clearing-code.patch
new file mode 100644
index 0000000000..9348a075a3
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0048-DSS2-OMAPFB-remove-fb-clearing-code.patch
@@ -0,0 +1,53 @@
+From ca06a6b885058df4fc7f2033e2ea569789dc0883 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 22 Apr 2009 10:26:06 +0300
+Subject: [PATCH 048/146] DSS2: OMAPFB: remove fb clearing code
+
+VRAM manager does the clearing now when the area is allocated.
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index cd63740..76e7c6c 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1174,7 +1174,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ struct omapfb2_mem_region *rg;
+ void __iomem *vaddr;
+ int r;
+- int clear = 0;
+
+ rg = &ofbi->region;
+ memset(rg, 0, sizeof(*rg));
+@@ -1184,7 +1183,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ if (!paddr) {
+ DBG("allocating %lu bytes for fb %d\n", size, ofbi->id);
+ r = omap_vram_alloc(OMAPFB_MEMTYPE_SDRAM, size, &paddr);
+- clear = 1;
+ } else {
+ DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr,
+ ofbi->id);
+@@ -1206,9 +1204,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ }
+
+ DBG("allocated VRAM paddr %lx, vaddr %p\n", paddr, vaddr);
+-
+- if (clear)
+- memset_io(vaddr, 0, size);
+ } else {
+ void __iomem *va;
+
+@@ -1232,9 +1227,6 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ rg->vrfb.vaddr[0] = va;
+
+ vaddr = NULL;
+-
+- if (clear)
+- memset_io(va, 0, size);
+ }
+
+ rg->paddr = paddr;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-use-debugfs-not-procfs.patch b/recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-use-debugfs-not-procfs.patch
new file mode 100644
index 0000000000..6bf78ce442
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0049-DSS2-VRAM-use-debugfs-not-procfs.patch
@@ -0,0 +1,170 @@
+From e9199bfc627213a53ff149dc5334d3881c749cfa Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 22 Apr 2009 14:11:52 +0300
+Subject: [PATCH 049/146] DSS2: VRAM: use debugfs, not procfs
+
+---
+ arch/arm/plat-omap/vram.c | 103 +++++++++++++++------------------------------
+ 1 files changed, 34 insertions(+), 69 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 90276ac..e847579 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -27,11 +27,11 @@
+ #include <linux/mm.h>
+ #include <linux/list.h>
+ #include <linux/dma-mapping.h>
+-#include <linux/proc_fs.h>
+ #include <linux/seq_file.h>
+ #include <linux/bootmem.h>
+ #include <linux/omapfb.h>
+ #include <linux/completion.h>
++#include <linux/debugfs.h>
+
+ #include <asm/setup.h>
+
+@@ -398,88 +398,54 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr)
+ }
+ EXPORT_SYMBOL(omap_vram_alloc);
+
+-#ifdef CONFIG_PROC_FS
+-static void *r_next(struct seq_file *m, void *v, loff_t *pos)
+-{
+- struct list_head *l = v;
+-
+- (*pos)++;
+-
+- if (list_is_last(l, &region_list))
+- return NULL;
+-
+- return l->next;
+-}
+-
+-static void *r_start(struct seq_file *m, loff_t *pos)
+-{
+- loff_t p = *pos;
+- struct list_head *l = &region_list;
+-
+- mutex_lock(&region_mutex);
+-
+- do {
+- l = l->next;
+- if (l == &region_list)
+- return NULL;
+- } while (p--);
+-
+- return l;
+-}
+-
+-static void r_stop(struct seq_file *m, void *v)
+-{
+- mutex_unlock(&region_mutex);
+-}
+-
+-static int r_show(struct seq_file *m, void *v)
++#if defined(CONFIG_DEBUG_FS)
++static int vram_debug_show(struct seq_file *s, void *unused)
+ {
+ struct vram_region *vr;
+ struct vram_alloc *va;
+ unsigned size;
+
+- vr = list_entry(v, struct vram_region, list);
+-
+- size = vr->pages << PAGE_SHIFT;
+-
+- seq_printf(m, "%08lx-%08lx (%d bytes)\n",
+- vr->paddr, vr->paddr + size - 1,
+- size);
++ mutex_lock(&region_mutex);
+
+- list_for_each_entry(va, &vr->alloc_list, list) {
+- size = va->pages << PAGE_SHIFT;
+- seq_printf(m, " %08lx-%08lx (%d bytes)\n",
+- va->paddr, va->paddr + size - 1,
++ list_for_each_entry(vr, &region_list, list) {
++ size = vr->pages << PAGE_SHIFT;
++ seq_printf(s, "%08lx-%08lx (%d bytes)\n",
++ vr->paddr, vr->paddr + size - 1,
+ size);
+- }
+
++ list_for_each_entry(va, &vr->alloc_list, list) {
++ size = va->pages << PAGE_SHIFT;
++ seq_printf(s, " %08lx-%08lx (%d bytes)\n",
++ va->paddr, va->paddr + size - 1,
++ size);
++ }
++ }
+
++ mutex_unlock(&region_mutex);
+
+ return 0;
+ }
+
+-static const struct seq_operations resource_op = {
+- .start = r_start,
+- .next = r_next,
+- .stop = r_stop,
+- .show = r_show,
+-};
+-
+-static int vram_open(struct inode *inode, struct file *file)
++static int vram_debug_open(struct inode *inode, struct file *file)
+ {
+- return seq_open(file, &resource_op);
++ return single_open(file, vram_debug_show, inode->i_private);
+ }
+
+-static const struct file_operations proc_vram_operations = {
+- .open = vram_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
++static const struct file_operations vram_debug_fops = {
++ .open = vram_debug_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
+ };
+
+-static int __init omap_vram_create_proc(void)
++static int __init omap_vram_create_debugfs(void)
+ {
+- proc_create("omap-vram", 0, NULL, &proc_vram_operations);
++ struct dentry *d;
++
++ d = debugfs_create_file("vram", S_IRUGO, NULL,
++ NULL, &vram_debug_fops);
++ if (IS_ERR(d))
++ return PTR_ERR(d);
+
+ return 0;
+ }
+@@ -487,7 +453,7 @@ static int __init omap_vram_create_proc(void)
+
+ static __init int omap_vram_init(void)
+ {
+- int i, r;
++ int i;
+
+ vram_initialized = 1;
+
+@@ -495,10 +461,9 @@ static __init int omap_vram_init(void)
+ omap_vram_add_region(postponed_regions[i].paddr,
+ postponed_regions[i].size);
+
+-#ifdef CONFIG_PROC_FS
+- r = omap_vram_create_proc();
+- if (r)
+- return -ENOMEM;
++#ifdef CONFIG_DEBUG_FS
++ if (omap_vram_create_debugfs())
++ pr_err("VRAM: Failed to create debugfs file\n");
+ #endif
+
+ return 0;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0050-DSS2-VRAM-fix-section-mismatch-warning.patch b/recipes/linux/linux-omap-pm/dss2/0050-DSS2-VRAM-fix-section-mismatch-warning.patch
new file mode 100644
index 0000000000..43f5c8b811
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0050-DSS2-VRAM-fix-section-mismatch-warning.patch
@@ -0,0 +1,34 @@
+From 174cc52b0c4dd551ff80ba25568ed9a9d678ea79 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 22 Apr 2009 14:40:48 +0200
+Subject: [PATCH 050/146] DSS2: VRAM: fix section mismatch warning
+
+postponed_regions are accessed from the non __init
+omap_vram_add_region().
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/vram.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index e847579..b126a64 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -63,11 +63,11 @@
+ #define MAX_POSTPONED_REGIONS 10
+
+ static bool vram_initialized;
+-static int postponed_cnt __initdata;
++static int postponed_cnt;
+ static struct {
+ unsigned long paddr;
+ size_t size;
+-} postponed_regions[MAX_POSTPONED_REGIONS] __initdata;
++} postponed_regions[MAX_POSTPONED_REGIONS];
+
+ struct vram_alloc {
+ struct list_head list;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0051-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch b/recipes/linux/linux-omap-pm/dss2/0051-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch
new file mode 100644
index 0000000000..61dfbc1740
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0051-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch
@@ -0,0 +1,41 @@
+From 96cedf8bb26d2a50da506051da87ee24d8e3d7fc Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 23 Apr 2009 10:46:53 +0300
+Subject: [PATCH 051/146] DSS2: disable LCD & DIGIT before resetting DSS
+
+This seems to fix the synclost problem that we get, if the bootloader
+starts the DSS and the kernel resets it.
+---
+ drivers/video/omap2/dss/dss.c | 8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
+index adc1f34..aab9758 100644
+--- a/drivers/video/omap2/dss/dss.c
++++ b/drivers/video/omap2/dss/dss.c
+@@ -285,6 +285,11 @@ int dss_init(bool skip_init)
+ }
+
+ if (!skip_init) {
++ /* disable LCD and DIGIT output. This seems to fix the synclost
++ * problem that we get, if the bootloader starts the DSS and
++ * the kernel resets it */
++ omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
++
+ /* We need to wait here a bit, otherwise we sometimes start to
+ * get synclost errors, and after that only power cycle will
+ * restore DSS functionality. I have no idea why this happens.
+@@ -294,10 +299,7 @@ int dss_init(bool skip_init)
+ msleep(50);
+
+ _omap_dss_reset();
+-
+ }
+- else
+- printk("DSS SKIP RESET\n");
+
+ /* autoidle */
+ REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0052-DSS2-DSI-more-error-handling.patch b/recipes/linux/linux-omap-pm/dss2/0052-DSS2-DSI-more-error-handling.patch
new file mode 100644
index 0000000000..1b0035317a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0052-DSS2-DSI-more-error-handling.patch
@@ -0,0 +1,85 @@
+From bbf1f63b3b6fa18a33b70ad85729dad6bd280c16 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 27 Apr 2009 11:06:16 +0300
+Subject: [PATCH 052/146] DSS2: DSI: more error handling
+
+---
+ drivers/video/omap2/dss/dsi.c | 27 +++++++++++++++++++++++++++
+ 1 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index d59ad38..d8df353 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -289,6 +289,8 @@ static struct
+
+ bool autoupdate_setup;
+
++ u32 errors;
++ spinlock_t errors_lock;
+ #ifdef DEBUG
+ ktime_t perf_setup_time;
+ ktime_t perf_start_time;
+@@ -541,6 +543,9 @@ void dsi_irq_handler(void)
+ if (irqstatus & DSI_IRQ_ERROR_MASK) {
+ DSSERR("DSI error, irqstatus %x\n", irqstatus);
+ print_irq_status(irqstatus);
++ spin_lock(&dsi.errors_lock);
++ dsi.errors |= irqstatus & DSI_IRQ_ERROR_MASK;
++ spin_unlock(&dsi.errors_lock);
+ } else if (debug_irq) {
+ print_irq_status(irqstatus);
+ }
+@@ -616,6 +621,17 @@ static void _dsi_initialize_irq(void)
+ -1 & (~DSI_CIO_IRQ_ERRCONTROL2));
+ }
+
++static u32 dsi_get_errors(void)
++{
++ unsigned long flags;
++ u32 e;
++ spin_lock_irqsave(&dsi.errors_lock, flags);
++ e = dsi.errors;
++ dsi.errors = 0;
++ spin_unlock_irqrestore(&dsi.errors_lock, flags);
++ return e;
++}
++
+ static void dsi_vc_enable_bta_irq(int channel)
+ {
+ u32 l;
+@@ -1807,6 +1823,7 @@ static int dsi_vc_send_bta(int channel)
+ static int dsi_vc_send_bta_sync(int channel)
+ {
+ int r = 0;
++ u32 err;
+
+ init_completion(&dsi.bta_completion);
+
+@@ -1822,6 +1839,13 @@ static int dsi_vc_send_bta_sync(int channel)
+ r = -EIO;
+ goto err;
+ }
++
++ err = dsi_get_errors();
++ if (err) {
++ DSSERR("Error while sending BTA: %x\n", err);
++ r = -EIO;
++ goto err;
++ }
+ err:
+ dsi_vc_disable_bta_irq(channel);
+
+@@ -3720,6 +3744,9 @@ int dsi_init(void)
+ {
+ u32 rev;
+
++ spin_lock_init(&dsi.errors_lock);
++ dsi.errors = 0;
++
+ spin_lock_init(&dsi.cmd_lock);
+ dsi.cmd_fifo = kfifo_alloc(
+ DSI_CMD_FIFO_LEN * sizeof(struct dsi_cmd_item),
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0053-DSS2-Added-global-alpha-support.patch b/recipes/linux/linux-omap-pm/dss2/0053-DSS2-Added-global-alpha-support.patch
new file mode 100644
index 0000000000..0a5a213789
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0053-DSS2-Added-global-alpha-support.patch
@@ -0,0 +1,230 @@
+From 3aae3ce190cbdf64bcfe9768ef4d20cdd2ddbd6a Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 24 Apr 2009 15:29:06 +0530
+Subject: [PATCH 053/146] DSS2: Added global alpha support.
+
+global_alpha sysfs entry for video1 plane will always show 255 as
+it does not support global_alpha.
+Initliazied the global alpha field for all the overlays
+to 255 (fully opaque).
+Documentation also updated.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ Documentation/arm/OMAP/DSS | 1 +
+ arch/arm/plat-omap/include/mach/display.h | 1 +
+ drivers/video/omap2/dss/dispc.c | 25 ++++++++++++++++---
+ drivers/video/omap2/dss/dss.h | 3 +-
+ drivers/video/omap2/dss/manager.c | 3 +-
+ drivers/video/omap2/dss/overlay.c | 37 +++++++++++++++++++++++++++++
+ 6 files changed, 64 insertions(+), 6 deletions(-)
+
+diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
+index 9e902a2..249e1a3 100644
+--- a/Documentation/arm/OMAP/DSS
++++ b/Documentation/arm/OMAP/DSS
+@@ -133,6 +133,7 @@ name
+ output_size width,height
+ position x,y
+ screen_width width
++global_alpha global alpha 0-255 0=transparent 255=opaque
+
+ /sys/devices/platform/omapdss/manager? directory:
+ display Destination display
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index d0b4c83..45b16ca 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -363,6 +363,7 @@ struct omap_overlay_info {
+ u16 pos_y;
+ u16 out_width; /* if 0, out_width == width */
+ u16 out_height; /* if 0, out_height == height */
++ u8 global_alpha;
+ };
+
+ enum omap_overlay_caps {
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 9bab6cf..b6a39f5 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -778,6 +778,17 @@ static void _dispc_set_vid_size(enum omap_plane plane, int width, int height)
+ dispc_write_reg(vsi_reg[plane-1], val);
+ }
+
++static void _dispc_setup_global_alpha(enum omap_plane plane, u8 global_alpha)
++{
++
++ BUG_ON(plane == OMAP_DSS_VIDEO1);
++
++ if (plane == OMAP_DSS_GFX)
++ REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 7, 0);
++ else if (plane == OMAP_DSS_VIDEO2)
++ REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 23, 16);
++}
++
+ static void _dispc_set_pix_inc(enum omap_plane plane, s32 inc)
+ {
+ const struct dispc_reg ri_reg[] = { DISPC_GFX_PIXEL_INC,
+@@ -1444,7 +1455,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ enum omap_color_mode color_mode,
+ bool ilace,
+ enum omap_dss_rotation_type rotation_type,
+- u8 rotation, int mirror)
++ u8 rotation, int mirror,
++ u8 global_alpha)
+ {
+ const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
+ bool five_taps = 0;
+@@ -1592,6 +1604,9 @@ static int _dispc_setup_plane(enum omap_plane plane,
+
+ _dispc_set_rotation_attrs(plane, rotation, mirror, color_mode);
+
++ if (plane != OMAP_DSS_VIDEO1)
++ _dispc_setup_global_alpha(plane, global_alpha);
++
+ return 0;
+ }
+
+@@ -3011,7 +3026,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ enum omap_color_mode color_mode,
+ bool ilace,
+ enum omap_dss_rotation_type rotation_type,
+- u8 rotation, bool mirror)
++ u8 rotation, bool mirror, u8 global_alpha)
+ {
+ int r = 0;
+
+@@ -3032,7 +3047,8 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ out_width, out_height,
+ color_mode, ilace,
+ rotation_type,
+- rotation, mirror);
++ rotation, mirror,
++ global_alpha);
+
+ enable_clocks(0);
+
+@@ -3247,7 +3263,8 @@ void dispc_setup_partial_planes(struct omap_display *display,
+ pi->color_mode, 0,
+ pi->rotation_type,
+ pi->rotation,
+- pi->mirror);
++ pi->mirror,
++ pi->global_alpha);
+
+ dispc_enable_plane(ovl->id, 1);
+ }
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 1d01ff6..20cef0a 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -273,7 +273,8 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ enum omap_color_mode color_mode,
+ bool ilace,
+ enum omap_dss_rotation_type rotation_type,
+- u8 rotation, bool mirror);
++ u8 rotation, bool mirror,
++ u8 global_alpha);
+
+ void dispc_go(enum omap_channel channel);
+ void dispc_enable_lcd_out(bool enable);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index bf059e0..1e6cd8d 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -464,7 +464,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ ilace,
+ ovl->info.rotation_type,
+ ovl->info.rotation,
+- ovl->info.mirror);
++ ovl->info.mirror,
++ ovl->info.global_alpha);
+
+ if (r) {
+ DSSERR("dispc_setup_plane failed for ovl %d\n",
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index c047206..035a57a 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -194,6 +194,37 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
+ return size;
+ }
+
++static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n",
++ ovl->info.global_alpha);
++}
++
++static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
++ const char *buf, size_t size)
++{
++ int r;
++ struct omap_overlay_info info;
++
++ ovl->get_overlay_info(ovl, &info);
++
++ /* Video1 plane does not support global alpha
++ * to always make it 255 completely opaque
++ */
++ if (ovl->id == OMAP_DSS_VIDEO1)
++ info.global_alpha = 255;
++ else
++ info.global_alpha = simple_strtoul(buf, NULL, 10);
++
++ if ((r = ovl->set_overlay_info(ovl, &info)))
++ return r;
++
++ if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
++ return r;
++
++ return size;
++}
++
+ struct overlay_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct omap_overlay *, char *);
+@@ -215,6 +246,8 @@ static OVERLAY_ATTR(output_size, S_IRUGO|S_IWUSR,
+ overlay_output_size_show, overlay_output_size_store);
+ static OVERLAY_ATTR(enabled, S_IRUGO|S_IWUSR,
+ overlay_enabled_show, overlay_enabled_store);
++static OVERLAY_ATTR(global_alpha, S_IRUGO|S_IWUSR,
++ overlay_global_alpha_show, overlay_global_alpha_store);
+
+ static struct attribute *overlay_sysfs_attrs[] = {
+ &overlay_attr_name.attr,
+@@ -224,6 +257,7 @@ static struct attribute *overlay_sysfs_attrs[] = {
+ &overlay_attr_position.attr,
+ &overlay_attr_output_size.attr,
+ &overlay_attr_enabled.attr,
++ &overlay_attr_global_alpha.attr,
+ NULL
+ };
+
+@@ -444,6 +478,7 @@ void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
+ ovl->id = OMAP_DSS_GFX;
+ ovl->supported_modes = OMAP_DSS_COLOR_GFX_OMAP3;
+ ovl->caps = OMAP_DSS_OVL_CAP_DISPC;
++ ovl->info.global_alpha = 255;
+ break;
+ case 1:
+ ovl->name = "vid1";
+@@ -451,6 +486,7 @@ void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
+ ovl->supported_modes = OMAP_DSS_COLOR_VID_OMAP3;
+ ovl->caps = OMAP_DSS_OVL_CAP_SCALE |
+ OMAP_DSS_OVL_CAP_DISPC;
++ ovl->info.global_alpha = 255;
+ break;
+ case 2:
+ ovl->name = "vid2";
+@@ -458,6 +494,7 @@ void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
+ ovl->supported_modes = OMAP_DSS_COLOR_VID_OMAP3;
+ ovl->caps = OMAP_DSS_OVL_CAP_SCALE |
+ OMAP_DSS_OVL_CAP_DISPC;
++ ovl->info.global_alpha = 255;
+ break;
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0054-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch b/recipes/linux/linux-omap-pm/dss2/0054-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch
new file mode 100644
index 0000000000..6b28f17db5
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0054-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch
@@ -0,0 +1,35 @@
+From 08a8816f1b41c331073a3144dbb90b4fe9eeec05 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 24 Apr 2009 14:33:48 +0530
+Subject: [PATCH 054/146] DSS2: Rotation attrs for YUV need not to be reversed for 90 and 270
+
+DSS2 supports horizontal mirroing. so only 180 and 0 degree attributes needs
+to be reversed for mirroring.
+Slight corrupt image is seen with 90 ad 270 degree rotation with mirroring
+when the image height and widht is not 32-pixels aligned. To be specific
+resolution is 168X192.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/dss/dispc.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index b6a39f5..f79decb 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1110,9 +1110,9 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
+ if (mirroring) {
+ switch (rotation) {
+ case 0: vidrot = 2; break;
+- case 1: vidrot = 3; break;
++ case 1: vidrot = 1; break;
+ case 2: vidrot = 0; break;
+- case 3: vidrot = 1; break;
++ case 3: vidrot = 3; break;
+ }
+ } else {
+ switch (rotation) {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0055-DSS2-Documentation-update-for-new-sysfs-entries-in.patch b/recipes/linux/linux-omap-pm/dss2/0055-DSS2-Documentation-update-for-new-sysfs-entries-in.patch
new file mode 100644
index 0000000000..24033a2c76
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0055-DSS2-Documentation-update-for-new-sysfs-entries-in.patch
@@ -0,0 +1,32 @@
+From 188cf22d913a2fab84e77e95651a99e70a78ec20 Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Mon, 27 Apr 2009 13:15:07 +0530
+Subject: [PATCH 055/146] DSS2: Documentation update for new sysfs entries in omapdss/manager
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ Documentation/arm/OMAP/DSS | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
+index 249e1a3..751000b 100644
+--- a/Documentation/arm/OMAP/DSS
++++ b/Documentation/arm/OMAP/DSS
+@@ -136,8 +136,13 @@ screen_width width
+ global_alpha global alpha 0-255 0=transparent 255=opaque
+
+ /sys/devices/platform/omapdss/manager? directory:
+-display Destination display
++display Destination display
+ name
++alpha_blending_enabled 0=off 1=on
++color_key_enabled 0=off 1=on
++color_key_type gfx-destination video-source
++color_key_value 0 to 2^24
++default_color default background color RGB24 0 to 2^24
+
+ /sys/devices/platform/omapdss/display? directory:
+ ctrl_name Controller name
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0056-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch b/recipes/linux/linux-omap-pm/dss2/0056-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch
new file mode 100644
index 0000000000..a35e4d78eb
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0056-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch
@@ -0,0 +1,56 @@
+From eede63f63b5c8b932b938b9b65725918e8f42775 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 17 Apr 2009 18:34:33 +0200
+Subject: [PATCH 056/146] DSS2: Don't touch plane coordinates when changing fb->ovl mapping
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When attaching overlays to a framebuffer via the 'overlays' sysfs file
+do not touch the planes' coordinates. Without this change attaching
+VID2 to a framebuffer which already has VID1 attached would cause VID1
+to be reset to position 0,0 and scaled to 1:1 size. Also call
+omapfb_apply_changes() only once after all the overlays have been
+attached to avoid fiddling with all the overlays several times.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 13 ++++++-------
+ 1 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index 13028ae..702199d 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -183,6 +183,7 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+ struct omap_overlay *ovl;
+ int num_ovls, r, i;
+ int len;
++ bool added = false;
+
+ num_ovls = 0;
+
+@@ -284,15 +285,13 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+
+ ofbi->overlays[ofbi->num_overlays++] = ovl;
+
+- r = omapfb_apply_changes(fbi, 1);
++ added = true;
++ }
++
++ if (added) {
++ r = omapfb_apply_changes(fbi, 0);
+ if (r)
+ goto out;
+-
+- if (ovl->manager) {
+- r = ovl->manager->apply(ovl->manager);
+- if (r)
+- goto out;
+- }
+ }
+
+ r = count;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0057-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch b/recipes/linux/linux-omap-pm/dss2/0057-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch
new file mode 100644
index 0000000000..9699e07869
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0057-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch
@@ -0,0 +1,97 @@
+From c843753f9a84739e7e81f6da3e29c7d5bdf3abc1 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 29 Apr 2009 17:26:30 +0300
+Subject: [PATCH 057/146] DSS2: DSI: configure ENTER/EXIT_HS_MODE_LATENCY
+
+---
+ drivers/video/omap2/dss/dsi.c | 49 ++++++++++++++++++++++++++++++++--------
+ 1 files changed, 39 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index d8df353..5225ed6 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2309,15 +2309,26 @@ static int dsi_proto_config(struct omap_display *display)
+ return 0;
+ }
+
+-static void dsi_proto_timings(void)
+-{
+- int tlpx_half, tclk_zero, tclk_prepare, tclk_trail;
+- int tclk_pre, tclk_post;
+- int ddr_clk_pre, ddr_clk_post;
++static void dsi_proto_timings(struct omap_display *display)
++{
++ unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
++ unsigned tclk_pre, tclk_post;
++ unsigned ths_prepare, ths_prepare_ths_zero, ths_zero;
++ unsigned ths_trail, ths_exit;
++ unsigned ddr_clk_pre, ddr_clk_post;
++ unsigned enter_hs_mode_lat, exit_hs_mode_lat;
++ unsigned ths_eot;
+ u32 r;
+
++ r = dsi_read_reg(DSI_DSIPHY_CFG0);
++ ths_prepare = FLD_GET(r, 31, 24);
++ ths_prepare_ths_zero = FLD_GET(r, 23, 16);
++ ths_zero = ths_prepare_ths_zero - ths_prepare;
++ ths_trail = FLD_GET(r, 15, 8);
++ ths_exit = FLD_GET(r, 7, 0);
++
+ r = dsi_read_reg(DSI_DSIPHY_CFG1);
+- tlpx_half = FLD_GET(r, 22, 16);
++ tlpx = FLD_GET(r, 22, 16) * 2;
+ tclk_trail = FLD_GET(r, 15, 8);
+ tclk_zero = FLD_GET(r, 7, 0);
+
+@@ -2329,17 +2340,35 @@ static void dsi_proto_timings(void)
+ /* min 60ns + 52*UI */
+ tclk_post = ns2ddr(60) + 26;
+
+- ddr_clk_pre = (tclk_pre + tlpx_half*2 + tclk_zero + tclk_prepare) / 4;
+- ddr_clk_post = (tclk_post + tclk_trail) / 4;
++ ddr_clk_pre = DIV_ROUND_UP(tclk_pre + tlpx + tclk_zero + tclk_prepare,
++ 4);
++ ddr_clk_post = DIV_ROUND_UP(tclk_post + tclk_trail, 4);
+
+ r = dsi_read_reg(DSI_CLK_TIMING);
+ r = FLD_MOD(r, ddr_clk_pre, 15, 8);
+ r = FLD_MOD(r, ddr_clk_post, 7, 0);
+ dsi_write_reg(DSI_CLK_TIMING, r);
+
+- DSSDBG("ddr_clk_pre %d, ddr_clk_post %d\n",
++ DSSDBG("ddr_clk_pre %u, ddr_clk_post %u\n",
+ ddr_clk_pre,
+ ddr_clk_post);
++
++ /* ths_eot is 2 for 2 datalanes and 4 for 1 datalane */
++ if (display->hw_config.u.dsi.data1_lane != 0 &&
++ display->hw_config.u.dsi.data2_lane != 0)
++ ths_eot = 2;
++ else
++ ths_eot = 4;
++
++ enter_hs_mode_lat = DIV_ROUND_UP(tlpx + ths_prepare + ths_zero, 4) + 4;
++ exit_hs_mode_lat = DIV_ROUND_UP(ths_trail + ths_exit, 4) + 1 + ths_eot;
++
++ r = FLD_VAL(enter_hs_mode_lat, 31, 16) |
++ FLD_VAL(exit_hs_mode_lat, 15, 0);
++ dsi_write_reg(DSI_VM_TIMING7, r);
++
++ DSSDBG("enter_hs_mode_lat %u, exit_hs_mode_lat %u\n",
++ enter_hs_mode_lat, exit_hs_mode_lat);
+ }
+
+
+@@ -3340,7 +3369,7 @@ static int dsi_display_init_dsi(struct omap_display *display)
+
+ _dsi_print_reset_status();
+
+- dsi_proto_timings();
++ dsi_proto_timings(display);
+ dsi_set_lp_clk_divisor();
+
+ if (1)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0058-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch b/recipes/linux/linux-omap-pm/dss2/0058-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch
new file mode 100644
index 0000000000..c8b5f7fe83
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0058-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch
@@ -0,0 +1,34 @@
+From 7afd9adb31922a0b3b16c92df3f767f78f7cdc68 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 4 May 2009 16:18:30 +0200
+Subject: [PATCH 058/146] DSS2: Avoid div by zero when calculating required fclk
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When calculating the required fclk rate for five tap filtering if the
+display width and output width are equal div by zero could occur. The
+TRM doesn't actually specify how this case should be handled but for
+now just skip the calculation which would trigger the div by zero.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index f79decb..5fc9457 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1399,7 +1399,7 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
+ do_div(tmp, 2 * out_height * ppl);
+ fclk = tmp;
+
+- if (height > 2 * out_height) {
++ if (height > 2 * out_height && ppl != out_width) {
+ tmp = pclk * (height - 2 * out_height) * out_width;
+ do_div(tmp, 2 * out_height * (ppl - out_width));
+ fclk = max(fclk, (u32) tmp);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0059-DSS2-VRFB-save-restore-context.patch b/recipes/linux/linux-omap-pm/dss2/0059-DSS2-VRFB-save-restore-context.patch
new file mode 100644
index 0000000000..ce2a65777e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0059-DSS2-VRFB-save-restore-context.patch
@@ -0,0 +1,106 @@
+From 482644bbb2e168002d8a004d1553f5da994276c2 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 5 May 2009 09:05:12 +0300
+Subject: [PATCH 059/146] DSS2: VRFB: save / restore context
+
+The VRFB is part of the SMS and supplied by the core power domain; do
+the context saving while VRFB is configured and restore it along with
+the rest of the domain context.
+
+This patch only implements the restore functionality, but not the
+actual call to the restore. That belongs to PM functionality.
+---
+ arch/arm/plat-omap/include/mach/vrfb.h | 1 +
+ arch/arm/plat-omap/vrfb.c | 50 ++++++++++++++++++++++++++-----
+ 2 files changed, 43 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+index 12c7fab..ee6c062 100644
+--- a/arch/arm/plat-omap/include/mach/vrfb.h
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -44,5 +44,6 @@ extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
+ extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode);
++extern void omap_vrfb_restore_context(void);
+
+ #endif /* __VRFB_H */
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 2ae0d68..649803e 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -39,6 +39,33 @@
+ /* bitmap of reserved contexts */
+ static unsigned ctx_map;
+
++/*
++ * Access to this happens from client drivers or the PM core after wake-up.
++ * For the first case we require locking at the driver level, for the second
++ * we don't need locking, since no drivers will run until after the wake-up
++ * has finished.
++ */
++struct {
++ u32 physical_ba;
++ u32 control;
++ u32 size;
++} vrfb_hw_context[VRFB_NUM_CTXS];
++
++void omap_vrfb_restore_context(void)
++{
++ int i;
++
++ for (i = 0; i < VRFB_NUM_CTXS; i++) {
++ /* Restore only the active contexts */
++ if (!(ctx_map & (1 << i)))
++ continue;
++ omap_writel(vrfb_hw_context[i].control, SMS_ROT_CONTROL(i));
++ omap_writel(vrfb_hw_context[i].size, SMS_ROT_SIZE(i));
++ omap_writel(vrfb_hw_context[i].physical_ba,
++ SMS_ROT_PHYSICAL_BA(i));
++ }
++}
++
+ void omap_vrfb_adjust_size(u16 *width, u16 *height,
+ u8 bytespp)
+ {
+@@ -56,6 +83,8 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ u16 vrfb_height;
+ u8 ctx = vrfb->context;
+ u8 bytespp;
++ u32 size;
++ u32 control;
+
+ DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
+ width, height, bytespp);
+@@ -100,15 +129,20 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+
+ DBG("vrfb w %u, h %u\n", vrfb_width, vrfb_height);
+
++ size = vrfb_width << SMS_IMAGEWIDTH_OFFSET;
++ size |= vrfb_height << SMS_IMAGEHEIGHT_OFFSET;
++
++ control = pixel_size_exp << SMS_PS_OFFSET;
++ control |= VRFB_PAGE_WIDTH_EXP << SMS_PW_OFFSET;
++ control |= VRFB_PAGE_HEIGHT_EXP << SMS_PH_OFFSET;
++
++ vrfb_hw_context[ctx].physical_ba = paddr;
++ vrfb_hw_context[ctx].size = size;
++ vrfb_hw_context[ctx].control = control;
++
+ omap_writel(paddr, SMS_ROT_PHYSICAL_BA(ctx));
+- omap_writel((vrfb_width << SMS_IMAGEWIDTH_OFFSET) |
+- (vrfb_height << SMS_IMAGEHEIGHT_OFFSET),
+- SMS_ROT_SIZE(ctx));
+-
+- omap_writel(pixel_size_exp << SMS_PS_OFFSET |
+- VRFB_PAGE_WIDTH_EXP << SMS_PW_OFFSET |
+- VRFB_PAGE_HEIGHT_EXP << SMS_PH_OFFSET,
+- SMS_ROT_CONTROL(ctx));
++ omap_writel(size, SMS_ROT_SIZE(ctx));
++ omap_writel(control, SMS_ROT_CONTROL(ctx));
+
+ DBG("vrfb offset pixels %d, %d\n",
+ vrfb_width - width, vrfb_height - height);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0060-DSS2-VRAM-Fix-indentation.patch b/recipes/linux/linux-omap-pm/dss2/0060-DSS2-VRAM-Fix-indentation.patch
new file mode 100644
index 0000000000..c9eef730ea
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0060-DSS2-VRAM-Fix-indentation.patch
@@ -0,0 +1,65 @@
+From a12a2e16a3403ffd3c4def1bb53760f8b1538adf Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 6 May 2009 09:03:43 +0300
+Subject: [PATCH 060/146] DSS2: VRAM: Fix indentation
+
+---
+ arch/arm/plat-omap/vram.c | 26 +++++++++++++-------------
+ 1 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index b126a64..f3ce849 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -287,35 +287,35 @@ static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data)
+ static int _omap_vram_clear(u32 paddr, unsigned pages)
+ {
+ struct completion compl;
+- unsigned elem_count;
+- unsigned frame_count;
++ unsigned elem_count;
++ unsigned frame_count;
+ int r;
+ int lch;
+
+ init_completion(&compl);
+
+- r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA",
++ r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA",
+ _omap_vram_dma_cb,
+- &compl, &lch);
+- if (r) {
++ &compl, &lch);
++ if (r) {
+ pr_err("VRAM: request_dma failed for memory clear\n");
+ return -EBUSY;
+ }
+
+- elem_count = pages * PAGE_SIZE / 4;
+- frame_count = 1;
++ elem_count = pages * PAGE_SIZE / 4;
++ frame_count = 1;
+
+- omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32,
+- elem_count, frame_count,
+- OMAP_DMA_SYNC_ELEMENT,
+- 0, 0);
++ omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32,
++ elem_count, frame_count,
++ OMAP_DMA_SYNC_ELEMENT,
++ 0, 0);
+
+- omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC,
++ omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC,
+ paddr, 0, 0);
+
+ omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000);
+
+- omap_start_dma(lch);
++ omap_start_dma(lch);
+
+ if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) {
+ omap_stop_dma(lch);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0061-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch b/recipes/linux/linux-omap-pm/dss2/0061-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch
new file mode 100644
index 0000000000..8b3b962df3
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0061-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch
@@ -0,0 +1,82 @@
+From 0196f7d35fd6780c07646aefbb4f3985794518db Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 5 May 2009 19:00:19 +0200
+Subject: [PATCH 061/146] DSS2: fix the usage of get_last_off_on_transaction_id
+
+The function returns int not unsigned since it can fail. Handle the
+failing case as if the context had been lost. So now:
+
+1. No get_last_off_on_transaction_id func in platform data->
+ never restore the context
+2. Return val < 0 -> force the restore
+3. Return val >= 0 do the restore only if the counter has changed.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 2 +-
+ drivers/video/omap2/dss/core.c | 18 ++++++++++++------
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 45b16ca..31ebb96 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -234,7 +234,7 @@ struct device;
+
+ /* Board specific data */
+ struct omap_dss_board_info {
+- unsigned (*get_last_off_on_transaction_id)(struct device *dev);
++ int (*get_last_off_on_transaction_id)(struct device *dev);
+ int (*dsi_power_up)(void);
+ void (*dsi_power_down)(void);
+ int num_displays;
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index ae7cd06..6d11b04 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -38,7 +38,7 @@
+
+ static struct {
+ struct platform_device *pdev;
+- unsigned ctx_id;
++ int ctx_id;
+
+ struct clk *dss_ick;
+ struct clk *dss1_fck;
+@@ -63,22 +63,28 @@ module_param_named(debug, dss_debug, bool, 0644);
+ #endif
+
+ /* CONTEXT */
+-static unsigned dss_get_ctx_id(void)
++static int dss_get_ctx_id(void)
+ {
+ struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
++ int r;
+
+ if (!pdata->get_last_off_on_transaction_id)
+ return 0;
+-
+- return pdata->get_last_off_on_transaction_id(&core.pdev->dev);
++ r = pdata->get_last_off_on_transaction_id(&core.pdev->dev);
++ if (r < 0) {
++ dev_err(&core.pdev->dev,
++ "getting transaction ID failed, will force context restore\n");
++ r = -1;
++ }
++ return r;
+ }
+
+ int dss_need_ctx_restore(void)
+ {
+ int id = dss_get_ctx_id();
+
+- if (id != core.ctx_id) {
+- DSSDBG("ctx id %u -> id %u\n",
++ if (id < 0 || id != core.ctx_id) {
++ DSSDBG("ctx id %d -> id %d\n",
+ core.ctx_id, id);
+ core.ctx_id = id;
+ return 1;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0062-VRFB-fix-debug-messages.patch b/recipes/linux/linux-omap-pm/dss2/0062-VRFB-fix-debug-messages.patch
new file mode 100644
index 0000000000..989b8cfece
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0062-VRFB-fix-debug-messages.patch
@@ -0,0 +1,35 @@
+From ad6c07cb298391adfbbb286606cca98738675119 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 5 May 2009 11:16:14 +0200
+Subject: [PATCH 062/146] VRFB: fix debug messages
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/vrfb.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 649803e..289fc8a 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -87,7 +87,7 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ u32 control;
+
+ DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
+- width, height, bytespp);
++ width, height, color_mode);
+
+ switch (color_mode) {
+ case OMAP_DSS_COLOR_RGB16:
+@@ -127,7 +127,7 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+ vrfb_width = ALIGN(width * bytespp, VRFB_PAGE_WIDTH) / bytespp;
+ vrfb_height = ALIGN(height, VRFB_PAGE_HEIGHT);
+
+- DBG("vrfb w %u, h %u\n", vrfb_width, vrfb_height);
++ DBG("vrfb w %u, h %u bytespp %d\n", vrfb_width, vrfb_height, bytespp);
+
+ size = vrfb_width << SMS_IMAGEWIDTH_OFFSET;
+ size |= vrfb_height << SMS_IMAGEHEIGHT_OFFSET;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0063-VRFB-add-suspend-resume-functionality.patch b/recipes/linux/linux-omap-pm/dss2/0063-VRFB-add-suspend-resume-functionality.patch
new file mode 100644
index 0000000000..d2b9346a93
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0063-VRFB-add-suspend-resume-functionality.patch
@@ -0,0 +1,216 @@
+From c26aa6e5aab9d145b343a2a71243508378e59621 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 5 May 2009 11:16:13 +0200
+Subject: [PATCH 063/146] VRFB: add suspend/resume functionality
+
+At the moment the VRFB context is restored at each core power domain
+OFF->ON transition. This is not optimal since the VRFB might be unused
+temporarily for example when the screen is blanked. Add a suspend /
+resume function to mark these unused periods during which we'll avoid
+thea the context restore.
+
+Use atomic bitops for ctx_map for consistency.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vrfb.h | 2 +
+ arch/arm/plat-omap/vrfb.c | 75 ++++++++++++++++++++++++-----
+ drivers/video/omap2/omapfb/omapfb-main.c | 28 +++++++++++
+ 3 files changed, 92 insertions(+), 13 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+index ee6c062..9647d82 100644
+--- a/arch/arm/plat-omap/include/mach/vrfb.h
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -39,6 +39,8 @@ struct vrfb
+
+ extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
+ extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
++extern void omap_vrfb_suspend_ctx(struct vrfb *vrfb);
++extern void omap_vrfb_resume_ctx(struct vrfb *vrfb);
+ extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
+ u8 bytespp);
+ extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 289fc8a..29f04e2 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -1,7 +1,9 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/ioport.h>
++
+ #include <asm/io.h>
++#include <asm/bitops.h>
+
+ #include <mach/io.h>
+ #include <mach/vrfb.h>
+@@ -37,7 +39,9 @@
+
+ #define VRFB_NUM_CTXS 12
+ /* bitmap of reserved contexts */
+-static unsigned ctx_map;
++static unsigned long ctx_map;
++/* bitmap of contexts for which we have to keep the HW context valid */
++static unsigned long ctx_map_active;
+
+ /*
+ * Access to this happens from client drivers or the PM core after wake-up.
+@@ -51,18 +55,23 @@ struct {
+ u32 size;
+ } vrfb_hw_context[VRFB_NUM_CTXS];
+
++static void inline restore_hw_context(int ctx)
++{
++ omap_writel(vrfb_hw_context[ctx].control, SMS_ROT_CONTROL(ctx));
++ omap_writel(vrfb_hw_context[ctx].size, SMS_ROT_SIZE(ctx));
++ omap_writel(vrfb_hw_context[ctx].physical_ba, SMS_ROT_PHYSICAL_BA(ctx));
++}
++
+ void omap_vrfb_restore_context(void)
+ {
+ int i;
++ unsigned long map = ctx_map_active;
+
+- for (i = 0; i < VRFB_NUM_CTXS; i++) {
+- /* Restore only the active contexts */
+- if (!(ctx_map & (1 << i)))
+- continue;
+- omap_writel(vrfb_hw_context[i].control, SMS_ROT_CONTROL(i));
+- omap_writel(vrfb_hw_context[i].size, SMS_ROT_SIZE(i));
+- omap_writel(vrfb_hw_context[i].physical_ba,
+- SMS_ROT_PHYSICAL_BA(i));
++ for (i = ffs(map); i; i = ffs(map)) {
++ /* i=1..32 */
++ i--;
++ map &= ~(1 << i);
++ restore_hw_context(i);
+ }
+ }
+
+@@ -156,13 +165,20 @@ EXPORT_SYMBOL(omap_vrfb_setup);
+ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+ {
+ int rot;
++ int ctx = vrfb->context;
+
+- if (vrfb->context == 0xff)
++ if (ctx == 0xff)
+ return;
+
+- DBG("release ctx %d\n", vrfb->context);
++ DBG("release ctx %d\n", ctx);
+
+- ctx_map &= ~(1 << vrfb->context);
++ if (!(ctx_map & (1 << ctx))) {
++ BUG();
++ return;
++ }
++ WARN_ON(!(ctx_map_active & (1 << ctx)));
++ clear_bit(ctx, &ctx_map_active);
++ clear_bit(ctx, &ctx_map);
+
+ for (rot = 0; rot < 4; ++rot) {
+ if(vrfb->paddr[rot]) {
+@@ -194,7 +210,9 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+
+ DBG("found free ctx %d\n", ctx);
+
+- ctx_map |= 1 << ctx;
++ set_bit(ctx, &ctx_map);
++ WARN_ON(ctx_map_active & (1 << ctx));
++ set_bit(ctx, &ctx_map_active);
+
+ memset(vrfb, 0, sizeof(*vrfb));
+
+@@ -219,3 +237,34 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ }
+ EXPORT_SYMBOL(omap_vrfb_request_ctx);
+
++void omap_vrfb_suspend_ctx(struct vrfb *vrfb)
++{
++ DBG("suspend ctx %d\n", vrfb->context);
++ if (vrfb->context >= VRFB_NUM_CTXS ||
++ (!(1 << vrfb->context) & ctx_map_active)) {
++ BUG();
++ return;
++ }
++ clear_bit(vrfb->context, &ctx_map_active);
++}
++EXPORT_SYMBOL(omap_vrfb_suspend_ctx);
++
++void omap_vrfb_resume_ctx(struct vrfb *vrfb)
++{
++ DBG("resume ctx %d\n", vrfb->context);
++ if (vrfb->context >= VRFB_NUM_CTXS ||
++ ((1 << vrfb->context) & ctx_map_active)) {
++ BUG();
++ return;
++ }
++ /*
++ * omap_vrfb_restore_context is normally called by the core domain
++ * save / restore logic, but since this VRFB context was suspended
++ * those calls didn't actually restore the context and now we might
++ * have an invalid context. Do an explicit restore here.
++ */
++ restore_hw_context(vrfb->context);
++ set_bit(vrfb->context, &ctx_map_active);
++}
++EXPORT_SYMBOL(omap_vrfb_resume_ctx);
++
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 76e7c6c..4bb74b7 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1036,6 +1036,30 @@ static int omapfb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
+ return 0;
+ }
+
++static void omapfb_vrfb_suspend_all(struct omapfb2_device *fbdev)
++{
++ int i;
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
++
++ if (ofbi->region.vrfb.vaddr[0])
++ omap_vrfb_suspend_ctx(&ofbi->region.vrfb);
++ }
++}
++
++static void omapfb_vrfb_resume_all(struct omapfb2_device *fbdev)
++{
++ int i;
++
++ for (i = 0; i < fbdev->num_fbs; i++) {
++ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
++
++ if (ofbi->region.vrfb.vaddr[0])
++ omap_vrfb_resume_ctx(&ofbi->region.vrfb);
++ }
++}
++
+ static int omapfb_blank(int blank, struct fb_info *fbi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+@@ -1051,6 +1075,8 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
+ if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
+ goto exit;
+
++ omapfb_vrfb_resume_all(fbdev);
++
+ if (display->resume)
+ r = display->resume(display);
+
+@@ -1073,6 +1099,8 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
+ if (display->suspend)
+ r = display->suspend(display);
+
++ omapfb_vrfb_suspend_all(fbdev);
++
+ break;
+
+ default:
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0064-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch b/recipes/linux/linux-omap-pm/dss2/0064-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch
new file mode 100644
index 0000000000..02588ba453
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0064-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch
@@ -0,0 +1,92 @@
+From 2666676c1db8b6c50cd97e668c773e5b072de188 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 7 May 2009 14:32:55 +0300
+Subject: [PATCH 064/146] DSS2: DSI: tune the timings to be more relaxed
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dsi.c | 37 +++++++++++++++++++++----------------
+ 1 files changed, 21 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 5225ed6..67ecfcf 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1396,28 +1396,28 @@ static void dsi_complexio_timings(void)
+ /* 1 * DDR_CLK = 2 * UI */
+
+ /* min 40ns + 4*UI max 85ns + 6*UI */
+- ths_prepare = ns2ddr(59) + 2;
++ ths_prepare = ns2ddr(70) + 2;
+
+ /* min 145ns + 10*UI */
+- ths_prepare_ths_zero = ns2ddr(145) + 5;
++ ths_prepare_ths_zero = ns2ddr(175) + 2;
+
+ /* min max(8*UI, 60ns+4*UI) */
+- ths_trail = max((unsigned)4, ns2ddr(60) + 2);
++ ths_trail = ns2ddr(60) + 5;
+
+ /* min 100ns */
+- ths_exit = ns2ddr(100);
++ ths_exit = ns2ddr(145);
+
+ /* tlpx min 50n */
+ tlpx_half = ns2ddr(25);
+
+ /* min 60ns */
+- tclk_trail = ns2ddr(60);
++ tclk_trail = ns2ddr(60) + 2;
+
+ /* min 38ns, max 95ns */
+- tclk_prepare = ns2ddr(38);
++ tclk_prepare = ns2ddr(65);
+
+ /* min tclk-prepare + tclk-zero = 300ns */
+- tclk_zero = ns2ddr(300 - 38);
++ tclk_zero = ns2ddr(260);
+
+ DSSDBG("ths_prepare %u (%uns), ths_prepare_ths_zero %u (%uns)\n",
+ ths_prepare, ddr2ns(ths_prepare),
+@@ -2340,9 +2340,19 @@ static void dsi_proto_timings(struct omap_display *display)
+ /* min 60ns + 52*UI */
+ tclk_post = ns2ddr(60) + 26;
+
++ /* ths_eot is 2 for 2 datalanes and 4 for 1 datalane */
++ if (display->hw_config.u.dsi.data1_lane != 0 &&
++ display->hw_config.u.dsi.data2_lane != 0)
++ ths_eot = 2;
++ else
++ ths_eot = 4;
++
+ ddr_clk_pre = DIV_ROUND_UP(tclk_pre + tlpx + tclk_zero + tclk_prepare,
+ 4);
+- ddr_clk_post = DIV_ROUND_UP(tclk_post + tclk_trail, 4);
++ ddr_clk_post = DIV_ROUND_UP(tclk_post + tclk_trail, 4) + ths_eot;
++
++ BUG_ON(ddr_clk_pre == 0 || ddr_clk_pre > 255);
++ BUG_ON(ddr_clk_post == 0 || ddr_clk_post > 255);
+
+ r = dsi_read_reg(DSI_CLK_TIMING);
+ r = FLD_MOD(r, ddr_clk_pre, 15, 8);
+@@ -2353,14 +2363,9 @@ static void dsi_proto_timings(struct omap_display *display)
+ ddr_clk_pre,
+ ddr_clk_post);
+
+- /* ths_eot is 2 for 2 datalanes and 4 for 1 datalane */
+- if (display->hw_config.u.dsi.data1_lane != 0 &&
+- display->hw_config.u.dsi.data2_lane != 0)
+- ths_eot = 2;
+- else
+- ths_eot = 4;
+-
+- enter_hs_mode_lat = DIV_ROUND_UP(tlpx + ths_prepare + ths_zero, 4) + 4;
++ enter_hs_mode_lat = 1 + DIV_ROUND_UP(tlpx, 4) +
++ DIV_ROUND_UP(ths_prepare, 4) +
++ DIV_ROUND_UP(ths_zero + 3, 4);
+ exit_hs_mode_lat = DIV_ROUND_UP(ths_trail + ths_exit, 4) + 1 + ths_eot;
+
+ r = FLD_VAL(enter_hs_mode_lat, 31, 16) |
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0065-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch b/recipes/linux/linux-omap-pm/dss2/0065-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch
new file mode 100644
index 0000000000..915dad4def
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0065-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch
@@ -0,0 +1,29 @@
+From d60b50b5248b9badf996119c80136503b1d68ed7 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Mon, 11 May 2009 15:15:52 +0200
+Subject: [PATCH 065/146] DSS2: VRFB: don't WARN when releasing inactive ctx
+
+Releasing an inactive context is valid, it can happen when
+the application first blanks the screen then frees the
+framebuffer.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ arch/arm/plat-omap/vrfb.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 29f04e2..34395c2 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -176,7 +176,6 @@ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+ BUG();
+ return;
+ }
+- WARN_ON(!(ctx_map_active & (1 << ctx)));
+ clear_bit(ctx, &ctx_map_active);
+ clear_bit(ctx, &ctx_map);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0066-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch b/recipes/linux/linux-omap-pm/dss2/0066-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch
new file mode 100644
index 0000000000..3e3dd6e1af
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0066-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch
@@ -0,0 +1,65 @@
+From 949c60b7fa5c016478dd403fab96b7dd1c701fc7 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Tue, 12 May 2009 14:38:05 +0200
+Subject: [PATCH 066/146] DSS2: Swap field offset values w/ VRFB rotation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+The field 0 and field 1 offset values were still incorrect when VRFB
+rotation is used. Swap them to put the fields into proper order.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 5fc9457..b0e4960 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1182,6 +1182,11 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+
+ DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
+ width, height);
++
++ /*
++ * field 0 = even field = bottom field
++ * field 1 = odd field = top field
++ */
+ switch (rotation + mirror * 4) {
+ case 0:
+ case 2:
+@@ -1194,11 +1199,11 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ width = width >> 1;
+ case 1:
+ case 3:
+- *offset0 = 0;
++ *offset1 = 0;
+ if (fieldmode)
+- *offset1 = screen_width * ps;
++ *offset0 = screen_width * ps;
+ else
+- *offset1 = 0;
++ *offset0 = 0;
+
+ *row_inc = pixinc(1 + (screen_width - width) +
+ (fieldmode ? screen_width : 0),
+@@ -1216,11 +1221,11 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ width = width >> 1;
+ case 5:
+ case 7:
+- *offset0 = 0;
++ *offset1 = 0;
+ if (fieldmode)
+- *offset1 = screen_width * ps;
++ *offset0 = screen_width * ps;
+ else
+- *offset1 = 0;
++ *offset0 = 0;
+ *row_inc = pixinc(1 - (screen_width + width) -
+ (fieldmode ? screen_width : 0),
+ ps);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0067-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch b/recipes/linux/linux-omap-pm/dss2/0067-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch
new file mode 100644
index 0000000000..5b86244e1f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0067-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch
@@ -0,0 +1,125 @@
+From d82606b114e4bab4f425f0180741bd2b1cd8e04a Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Thu, 14 May 2009 15:04:17 +0530
+Subject: [PATCH 067/146] DSS2: OMAP3EVM: Added DSI powerup and powerdown functions
+
+Copied fom 3430sdp implementation.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/mach-omap2/board-omap3evm.c | 62 +++++++++++++++++++++-------------
+ 1 files changed, 38 insertions(+), 24 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
+index dffb8b9..6c9f11b 100644
+--- a/arch/arm/mach-omap2/board-omap3evm.c
++++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -243,6 +243,38 @@ static int __init omap3_evm_i2c_init(void)
+ static int lcd_enabled;
+ static int dvi_enabled;
+
++static void enable_vpll2(int enable)
++{
++ u8 ded_val, grp_val;
++
++ if (enable) {
++ ded_val = ENABLE_VPLL2_DEDICATED;
++ grp_val = ENABLE_VPLL2_DEV_GRP;
++ } else {
++ ded_val = 0;
++ grp_val = 0;
++ }
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ded_val, TWL4030_VPLL2_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ grp_val, TWL4030_VPLL2_DEV_GRP);
++}
++
++static int omap3evm_dsi_power_up(void)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0)
++ enable_vpll2(1);
++ return 0;
++}
++
++static void omap3evm_dsi_power_down(void)
++{
++ if (omap_rev() > OMAP3430_REV_ES1_0)
++ enable_vpll2(0);
++}
++
++
+ static void __init omap3_evm_display_init(void)
+ {
+ int r;
+@@ -312,12 +344,7 @@ static int omap3_evm_panel_enable_lcd(struct omap_display *display)
+ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+ return -EINVAL;
+ }
+- if (omap_rev() > OMAP3430_REV_ES1_0) {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
+- }
++ omap3evm_dsi_power_up();
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 0);
+ lcd_enabled = 1;
+ return 0;
+@@ -325,12 +352,7 @@ static int omap3_evm_panel_enable_lcd(struct omap_display *display)
+
+ static void omap3_evm_panel_disable_lcd(struct omap_display *display)
+ {
+- if (omap_rev() > OMAP3430_REV_ES1_0) {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
+- TWL4030_VPLL2_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
+- TWL4030_VPLL2_DEV_GRP);
+- }
++ omap3evm_dsi_power_down();
+ gpio_direction_output(LCD_PANEL_ENABLE_GPIO, 1);
+ lcd_enabled = 0;
+ }
+@@ -376,13 +398,8 @@ static int omap3_evm_panel_enable_dvi(struct omap_display *display)
+ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+ return -EINVAL;
+ }
+- if (omap_rev() > OMAP3430_REV_ES1_0) {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VPLL2_DEDICATED, TWL4030_VPLL2_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VPLL2_DEV_GRP, TWL4030_VPLL2_DEV_GRP);
+- }
+
++ omap3evm_dsi_power_up();
+ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
+ TWL4030_GPIODATA_IN3);
+ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80,
+@@ -394,13 +411,8 @@ static int omap3_evm_panel_enable_dvi(struct omap_display *display)
+
+ static void omap3_evm_panel_disable_dvi(struct omap_display *display)
+ {
+- if (omap_rev() > OMAP3430_REV_ES1_0) {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
+- TWL4030_VPLL2_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x0,
+- TWL4030_VPLL2_DEV_GRP);
+- }
+
++ omap3evm_dsi_power_down();
+ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
+ TWL4030_GPIODATA_IN3);
+ twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0x00,
+@@ -419,6 +431,8 @@ static struct omap_dss_display_config omap3_evm_display_data_dvi = {
+ };
+
+ static struct omap_dss_board_info omap3_evm_dss_data = {
++ .dsi_power_up = omap3evm_dsi_power_up,
++ .dsi_power_down = omap3evm_dsi_power_down,
+ .num_displays = 3,
+ .displays = {
+ &omap3_evm_display_data,
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0068-DSS2-DSI-Improve-perf-measurement-output.patch b/recipes/linux/linux-omap-pm/dss2/0068-DSS2-DSI-Improve-perf-measurement-output.patch
new file mode 100644
index 0000000000..f090aa8d51
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0068-DSS2-DSI-Improve-perf-measurement-output.patch
@@ -0,0 +1,127 @@
+From ba927a58cb0bc990839f4278e0fc71529cb4dc70 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 22 May 2009 12:59:41 +0300
+Subject: [PATCH 068/146] DSS2: DSI: Improve perf-measurement output
+
+---
+ drivers/video/omap2/dss/dsi.c | 67 +++++++++++++++++++++++++++++-----------
+ 1 files changed, 48 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 67ecfcf..057b057 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -294,6 +294,7 @@ static struct
+ #ifdef DEBUG
+ ktime_t perf_setup_time;
+ ktime_t perf_start_time;
++ ktime_t perf_start_time_auto;
+ int perf_measure_frames;
+
+ struct {
+@@ -360,13 +361,16 @@ static void perf_mark_start(void)
+ dsi.perf_start_time = ktime_get();
+ }
+
++static void perf_mark_start_auto(void)
++{
++ dsi.perf_start_time_auto = ktime_get();
++}
++
+ static void perf_show(const char *name)
+ {
+ ktime_t t, setup_time, trans_time;
+ u32 total_bytes;
+ u32 setup_us, trans_us, total_us;
+- const int numframes = 100;
+- static u32 s_trans_us, s_min_us = 0xffffffff, s_max_us;
+
+ if (!dsi_perf)
+ return;
+@@ -393,34 +397,57 @@ static void perf_show(const char *name)
+ dsi.update_region.bytespp;
+
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) {
++ static u32 s_total_trans_us, s_total_setup_us;
++ static u32 s_min_trans_us = 0xffffffff, s_min_setup_us;
++ static u32 s_max_trans_us, s_max_setup_us;
++ const int numframes = 100;
++ ktime_t total_time_auto;
++ u32 total_time_auto_us;
++
+ dsi.perf_measure_frames++;
+
+- if (trans_us < s_min_us)
+- s_min_us = trans_us;
++ if (setup_us < s_min_setup_us)
++ s_min_setup_us = setup_us;
++
++ if (setup_us > s_max_setup_us)
++ s_max_setup_us = setup_us;
+
+- if (trans_us > s_max_us)
+- s_max_us = trans_us;
++ s_total_setup_us += setup_us;
+
+- s_trans_us += trans_us;
++ if (trans_us < s_min_trans_us)
++ s_min_trans_us = trans_us;
++
++ if (trans_us > s_max_trans_us)
++ s_max_trans_us = trans_us;
++
++ s_total_trans_us += trans_us;
+
+ if (dsi.perf_measure_frames < numframes)
+ return;
+
+- DSSINFO("%s update: %d frames in %u us "
+- "(min/max/avg %u/%u/%u), %u fps\n",
+- name, numframes,
+- s_trans_us,
+- s_min_us,
+- s_max_us,
+- s_trans_us / numframes,
+- 1000*1000 / (s_trans_us / numframes));
++ total_time_auto = ktime_sub(t, dsi.perf_start_time_auto);
++ total_time_auto_us = (u32)ktime_to_us(total_time_auto);
++
++ printk("DSI(%s): %u fps, setup %u/%u/%u, trans %u/%u/%u\n",
++ name,
++ 1000 * 1000 * numframes / total_time_auto_us,
++ s_min_setup_us,
++ s_max_setup_us,
++ s_total_setup_us / numframes,
++ s_min_trans_us,
++ s_max_trans_us,
++ s_total_trans_us / numframes);
+
+ dsi.perf_measure_frames = 0;
+- s_trans_us = 0;
+- s_min_us = 0xffffffff;
+- s_max_us = 0;
++ s_total_setup_us = 0;
++ s_min_setup_us = 0xffffffff;
++ s_max_setup_us = 0;
++ s_total_trans_us = 0;
++ s_min_trans_us = 0xffffffff;
++ s_max_trans_us = 0;
++ perf_mark_start_auto();
+ } else {
+- DSSINFO("%s update %u us + %u us = %u us (%uHz), %u bytes, "
++ printk("DSI(%s): %u us + %u us = %u us (%uHz), %u bytes, "
+ "%u kbytes/sec\n",
+ name,
+ setup_us,
+@@ -2814,6 +2841,8 @@ static void dsi_start_auto_update(struct omap_display *display)
+ dsi.autoupdate_setup = 1;
+
+ dsi_push_autoupdate(display);
++
++ perf_mark_start_auto();
+ }
+
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch b/recipes/linux/linux-omap-pm/dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch
new file mode 100644
index 0000000000..e32f8ad04a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch
@@ -0,0 +1,110 @@
+From da9828702ab1cf29401f9a93f1e950505bfa2b76 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 22 May 2009 13:43:26 +0300
+Subject: [PATCH 069/146] DSS2: DSI: Add support for external TE signal
+
+I hope this can be removed when the DSI displays work properly.
+---
+ arch/arm/plat-omap/include/mach/display.h | 4 ++++
+ drivers/video/omap2/dss/dsi.c | 29 +++++++++++++++++++----------
+ 2 files changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 31ebb96..dccc660 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -201,6 +201,9 @@ struct omap_dss_display_config {
+ u8 data2_lane;
+ u8 data2_pol;
+ unsigned long ddr_clk_hz;
++
++ bool ext_te;
++ u8 ext_te_gpio;
+ } dsi;
+
+ struct {
+@@ -256,6 +259,7 @@ struct omap_ctrl {
+ u16 x, u16 y, u16 w, u16 h);
+
+ int (*enable_te)(struct omap_display *display, bool enable);
++ int (*wait_for_te)(struct omap_display *display);
+
+ u8 (*get_rotate)(struct omap_display *display);
+ int (*set_rotate)(struct omap_display *display, u8 rotate);
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 057b057..f39c890 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -274,7 +274,8 @@ static struct
+ enum omap_dss_update_mode user_update_mode;
+ enum omap_dss_update_mode target_update_mode;
+ enum omap_dss_update_mode update_mode;
+- int use_te;
++ bool use_te;
++ bool use_ext_te;
+ int framedone_scheduled; /* helps to catch strange framedone bugs */
+
+ unsigned long cache_req_pck;
+@@ -2734,6 +2735,9 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+
+ display->ctrl->setup_update(display, x, y, w, h);
+
++ if (dsi.use_ext_te && display->ctrl->wait_for_te)
++ display->ctrl->wait_for_te(display);
++
+ if (0)
+ dsi_vc_print_status(1);
+
+@@ -3001,19 +3005,24 @@ end:
+
+ static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
+ {
+- dsi.use_te = enable;
++ if (!display->hw_config.u.dsi.ext_te)
++ dsi.use_te = enable;
++ else
++ dsi.use_ext_te = enable;
+
+ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ display->ctrl->enable_te(display, enable);
+
+- if (enable) {
+- /* disable LP_RX_TO, so that we can receive TE.
+- * Time to wait for TE is longer than the timer allows */
+- REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
+- } else {
+- REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
++ if (!display->hw_config.u.dsi.ext_te) {
++ if (enable) {
++ /* disable LP_RX_TO, so that we can receive TE.
++ * Time to wait for TE is longer than the timer allows */
++ REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
++ } else {
++ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
++ }
+ }
+ }
+
+@@ -3508,7 +3517,7 @@ static int dsi_display_enable(struct omap_display *display)
+
+ display->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+- if (dsi.use_te)
++ if (dsi.use_te || dsi.use_ext_te)
+ dsi_push_set_te(display, 1);
+
+ dsi_push_set_update_mode(display, dsi.user_update_mode);
+@@ -3641,7 +3650,7 @@ static int dsi_display_enable_te(struct omap_display *display, bool enable)
+
+ static int dsi_display_get_te(struct omap_display *display)
+ {
+- return dsi.use_te;
++ return dsi.use_te | dsi.use_ext_te;
+ }
+
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0070-DSS2-DSI-Fix-LP-clock.patch b/recipes/linux/linux-omap-pm/dss2/0070-DSS2-DSI-Fix-LP-clock.patch
new file mode 100644
index 0000000000..a5267c816f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0070-DSS2-DSI-Fix-LP-clock.patch
@@ -0,0 +1,78 @@
+From 8f6e8ec77ffe7b13623046648cdeea33d836169c Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 22 May 2009 14:14:23 +0300
+Subject: [PATCH 070/146] DSS2: DSI: Fix LP clock
+
+Outgoing LP clock is actually DSI fclk / 2 / clk_divisor.
+
+Also don't use hardcoded LP clock frequency, but get it from
+the board file.
+---
+ arch/arm/plat-omap/include/mach/display.h | 1 +
+ drivers/video/omap2/dss/dsi.c | 18 +++++++++---------
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index dccc660..5ac1ae7 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -200,6 +200,7 @@ struct omap_dss_display_config {
+ u8 data1_pol;
+ u8 data2_lane;
+ u8 data2_pol;
++ unsigned long lp_clk_hz;
+ unsigned long ddr_clk_hz;
+
+ bool ext_te;
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index f39c890..c45140f 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -763,19 +763,19 @@ static unsigned long dsi_fclk_rate(void)
+ return r;
+ }
+
+-static int dsi_set_lp_clk_divisor(void)
++static int dsi_set_lp_clk_divisor(struct omap_display *display)
+ {
+- int n;
++ unsigned n;
+ unsigned long dsi_fclk;
+- unsigned long mhz;
+-
+- /* LP_CLK_DIVISOR, DSI fclk/n, should be 20MHz - 32kHz */
++ unsigned long lp_clk, lp_clk_req;
+
+ dsi_fclk = dsi_fclk_rate();
+
++ lp_clk_req = display->hw_config.u.dsi.lp_clk_hz;
++
+ for (n = 1; n < (1 << 13) - 1; ++n) {
+- mhz = dsi_fclk / n;
+- if (mhz <= 20*1000*1000)
++ lp_clk = dsi_fclk / 2 / n;
++ if (lp_clk <= lp_clk_req)
+ break;
+ }
+
+@@ -784,7 +784,7 @@ static int dsi_set_lp_clk_divisor(void)
+ return -EINVAL;
+ }
+
+- DSSDBG("LP_CLK_DIV %d, LP_CLK %ld\n", n, mhz);
++ DSSDBG("LP_CLK_DIV %u, LP_CLK %lu (req %lu)\n", n, lp_clk, lp_clk_req);
+
+ REG_FLD_MOD(DSI_CLK_CTRL, n, 12, 0); /* LP_CLK_DIVISOR */
+ if (dsi_fclk > 30*1000*1000)
+@@ -3413,7 +3413,7 @@ static int dsi_display_init_dsi(struct omap_display *display)
+ _dsi_print_reset_status();
+
+ dsi_proto_timings(display);
+- dsi_set_lp_clk_divisor();
++ dsi_set_lp_clk_divisor(display);
+
+ if (1)
+ _dsi_print_reset_status();
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0071-DSS2-Do-not-swap-xres-yres-or-change-rotation-in-ch.patch b/recipes/linux/linux-omap-pm/dss2/0071-DSS2-Do-not-swap-xres-yres-or-change-rotation-in-ch.patch
new file mode 100644
index 0000000000..fb5a8213d3
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0071-DSS2-Do-not-swap-xres-yres-or-change-rotation-in-ch.patch
@@ -0,0 +1,68 @@
+From cff6ff96f2b280924e7a2bb453bc8d6d9bbb67f0 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Thu, 14 May 2009 15:03:48 +0200
+Subject: [PATCH 071/146] DSS2: Do not swap xres/yres or change rotation in check_fb_var()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Do not to change the actual rotation setting in check_fb_var() and
+also remove the xres/yres swap from the same place. Applications must
+now specify var.xres and var.yres in framebuffer coordinates. Eg. if
+you have a 480x800 framebuffer and want it rotated cw/ccw to a 800x480
+display xres must be 480 and yres must be 800. So the application
+doesn't have to know if it's dealing with a 480x800 unrotated display
+or a 800x480 rotated display.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 26 ++++++--------------------
+ 1 files changed, 6 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 4bb74b7..0cdf36e 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -391,6 +391,12 @@ void set_fb_fix(struct fb_info *fbi)
+ /* used by open/write in fbmem.c */
+ fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
+
++ if (ofbi->rotation != var->rotate) {
++ DBG("changing rotation %d -> %d\n",
++ ofbi->rotation, var->rotate);
++ ofbi->rotation = var->rotate;
++ }
++
+ /* used by mmap in fbmem.c */
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+ switch (var->nonstd) {
+@@ -482,26 +488,6 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
+ if (var->rotate < 0 || var->rotate > 3)
+ return -EINVAL;
+
+- if (var->rotate != fbi->var.rotate) {
+- DBG("rotation changing\n");
+-
+- ofbi->rotation = var->rotate;
+-
+- if (abs(var->rotate - fbi->var.rotate) != 2) {
+- int tmp;
+- DBG("rotate changing 90/270 degrees. "
+- "swapping x/y res\n");
+-
+- tmp = var->yres;
+- var->yres = var->xres;
+- var->xres = tmp;
+-
+- tmp = var->yres_virtual;
+- var->yres_virtual = var->xres_virtual;
+- var->xres_virtual = tmp;
+- }
+- }
+-
+ xres_min = OMAPFB_PLANE_XRES_MIN;
+ xres_max = 2048;
+ yres_min = OMAPFB_PLANE_YRES_MIN;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0072-DSS2-Allow-independent-rotation-for-each-plane.patch b/recipes/linux/linux-omap-pm/dss2/0072-DSS2-Allow-independent-rotation-for-each-plane.patch
new file mode 100644
index 0000000000..4fccaa65d1
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0072-DSS2-Allow-independent-rotation-for-each-plane.patch
@@ -0,0 +1,277 @@
+From d2bb6e5832085247afc9a925ce2c4fc76a84db0e Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Thu, 14 May 2009 15:03:50 +0200
+Subject: [PATCH 072/146] DSS2: Allow independent rotation for each plane
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Allow overlays attached to the same framebuffer to have different
+rotation settings. A new sysfs file overlays_rotate can be used to
+configure the rotation settings for each overlay. The total rotation
+for a single overlay is now '(var.rotate + overlays_rotate) % 4'.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 42 ++++++++-----
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 91 ++++++++++++++++++++++++++++-
+ drivers/video/omap2/omapfb/omapfb.h | 2 +-
+ 3 files changed, 115 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 0cdf36e..c4bd081 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -174,11 +174,11 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
+ return offset;
+ }
+
+-static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
++static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi, int rot)
+ {
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+- return ofbi->region.vrfb.paddr[ofbi->rotation]
+- + omapfb_get_vrfb_offset(ofbi, ofbi->rotation);
++ return ofbi->region.vrfb.paddr[rot]
++ + omapfb_get_vrfb_offset(ofbi, rot);
+ } else {
+ return ofbi->region.paddr;
+ }
+@@ -391,11 +391,7 @@ void set_fb_fix(struct fb_info *fbi)
+ /* used by open/write in fbmem.c */
+ fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
+
+- if (ofbi->rotation != var->rotate) {
+- DBG("changing rotation %d -> %d\n",
+- ofbi->rotation, var->rotate);
+- ofbi->rotation = var->rotate;
+- }
++ DBG("changing rotation to %d\n", var->rotate);
+
+ /* used by mmap in fbmem.c */
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+@@ -665,11 +661,21 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ int xres, yres;
+ int screen_width;
+ int mirror;
++ int rotation = var->rotate;
++ int i;
++
++ for (i = 0; i < ofbi->num_overlays; i++) {
++ if (ovl != ofbi->overlays[i])
++ continue;
++
++ rotation = (rotation + ofbi->rotation[i]) % 4;
++ break;
++ }
+
+ DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
+ posx, posy, outw, outh);
+
+- if (ofbi->rotation == FB_ROTATE_CW || ofbi->rotation == FB_ROTATE_CCW) {
++ if (rotation == FB_ROTATE_CW || rotation == FB_ROTATE_CCW) {
+ xres = var->yres;
+ yres = var->xres;
+ } else {
+@@ -681,7 +687,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ var->xoffset) * var->bits_per_pixel) >> 3;
+
+ if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+- data_start_p = omapfb_get_region_rot_paddr(ofbi);
++ data_start_p = omapfb_get_region_rot_paddr(ofbi, rotation);
+ data_start_v = NULL;
+ } else {
+ data_start_p = omapfb_get_region_paddr(ofbi);
+@@ -726,7 +732,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
+ info.height = yres;
+ info.color_mode = mode;
+ info.rotation_type = ofbi->rotation_type;
+- info.rotation = ofbi->rotation;
++ info.rotation = rotation;
+ info.mirror = mirror;
+
+ info.pos_x = posx;
+@@ -777,8 +783,9 @@ int omapfb_apply_changes(struct fb_info *fbi, int init)
+ }
+
+ if (init || (ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
+- if (ofbi->rotation == FB_ROTATE_CW ||
+- ofbi->rotation == FB_ROTATE_CCW) {
++ int rotation = (var->rotate + ofbi->rotation[i]) % 4;
++ if (rotation == FB_ROTATE_CW ||
++ rotation == FB_ROTATE_CCW) {
+ outw = var->yres;
+ outh = var->xres;
+ } else {
+@@ -1575,7 +1582,7 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ var->nonstd = 0;
+ var->bits_per_pixel = 0;
+
+- var->rotate = ofbi->rotation;
++ var->rotate = def_rotate;
+
+ /*
+ * Check if there is a default color format set in the board file,
+@@ -1605,10 +1612,12 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+
+ if (display) {
+ u16 w, h;
++ int rotation = (var->rotate + ofbi->rotation[0]) % 4;
++
+ display->get_resolution(display, &w, &h);
+
+- if (ofbi->rotation == FB_ROTATE_CW ||
+- ofbi->rotation == FB_ROTATE_CCW) {
++ if (rotation == FB_ROTATE_CW ||
++ rotation == FB_ROTATE_CCW) {
+ var->xres = h;
+ var->yres = w;
+ } else {
+@@ -1724,7 +1733,6 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
+ /* assign these early, so that fb alloc can use them */
+ ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
+ OMAP_DSS_ROT_DMA;
+- ofbi->rotation = def_rotate;
+ ofbi->mirror = def_mirror;
+
+ fbdev->num_fbs++;
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index 702199d..dcec42b 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -259,8 +259,10 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+ if (ovl->manager)
+ ovl->manager->apply(ovl->manager);
+
+- for (t = i + 1; t < ofbi->num_overlays; t++)
++ for (t = i + 1; t < ofbi->num_overlays; t++) {
++ ofbi->rotation[t-1] = ofbi->rotation[t];
+ ofbi->overlays[t-1] = ofbi->overlays[t];
++ }
+
+ ofbi->num_overlays--;
+ i--;
+@@ -282,7 +284,7 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+
+ if (found)
+ continue;
+-
++ ofbi->rotation[ofbi->num_overlays] = 0;
+ ofbi->overlays[ofbi->num_overlays++] = ovl;
+
+ added = true;
+@@ -301,6 +303,90 @@ out:
+ return r;
+ }
+
++static ssize_t show_overlays_rotate(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ ssize_t l = 0;
++ int t;
++
++ for (t = 0; t < ofbi->num_overlays; t++) {
++ l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
++ t == 0 ? "" : ",", ofbi->rotation[t]);
++ }
++
++ l += snprintf(buf + l, PAGE_SIZE - l, "\n");
++
++ return l;
++}
++
++static ssize_t store_overlays_rotate(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct fb_info *fbi = dev_get_drvdata(dev);
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ struct omapfb2_device *fbdev = ofbi->fbdev;
++ int num_ovls = 0, r, i;
++ int len;
++ bool changed = false;
++ u8 rotation[OMAPFB_MAX_OVL_PER_FB];
++
++ len = strlen(buf);
++ if (buf[len - 1] == '\n')
++ len = len - 1;
++
++ omapfb_lock(fbdev);
++
++ if (len > 0) {
++ char *p = (char *)buf;
++
++ while (p < buf + len) {
++ int rot;
++
++ if (num_ovls == ofbi->num_overlays) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ rot = simple_strtoul(p, &p, 0);
++ if (rot < 0 || rot > 3) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ if (ofbi->rotation[num_ovls] != rot)
++ changed = true;
++
++ rotation[num_ovls++] = rot;
++
++ p++;
++ }
++ }
++
++ if (num_ovls != ofbi->num_overlays) {
++ r = -EINVAL;
++ goto out;
++ }
++
++ if (changed) {
++ for (i = 0; i < num_ovls; ++i)
++ ofbi->rotation[i] = rotation[i];
++
++ r = omapfb_apply_changes(fbi, 0);
++ if (r)
++ goto out;
++
++ /* FIXME error handling? */
++ }
++
++ r = count;
++out:
++ omapfb_unlock(fbdev);
++
++ return r;
++}
++
+ static ssize_t show_size(struct device *dev,
+ struct device_attribute *attr, char *buf)
+ {
+@@ -369,6 +455,7 @@ static struct device_attribute omapfb_attrs[] = {
+ __ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror),
+ __ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size),
+ __ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays),
++ __ATTR(overlays_rotate, S_IRUGO | S_IWUSR, show_overlays_rotate, store_overlays_rotate),
+ __ATTR(phys_addr, S_IRUGO, show_phys, NULL),
+ __ATTR(virt_addr, S_IRUGO, show_virt, NULL),
+ };
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index 43f6922..f40fcce 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -62,7 +62,7 @@ struct omapfb_info {
+ struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
+ struct omapfb2_device *fbdev;
+ enum omap_dss_rotation_type rotation_type;
+- u8 rotation;
++ u8 rotation[OMAPFB_MAX_OVL_PER_FB];
+ bool mirror;
+ };
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0073-DSS2-DISPC-fix-irq-handling-locking.patch b/recipes/linux/linux-omap-pm/dss2/0073-DSS2-DISPC-fix-irq-handling-locking.patch
new file mode 100644
index 0000000000..e68f6458a0
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0073-DSS2-DISPC-fix-irq-handling-locking.patch
@@ -0,0 +1,225 @@
+From a4df82191832d6b384da9b6a07328ac404db9393 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Sat, 23 May 2009 18:00:21 +0300
+Subject: [PATCH 073/146] DSS2: DISPC: fix irq handling locking
+
+---
+ drivers/video/omap2/dss/dispc.c | 74 +++++++++++++++++++++++---------------
+ 1 files changed, 45 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index b0e4960..b3685b2 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -154,23 +154,20 @@ static struct {
+
+ struct clk *dpll4_m4_ck;
+
+- spinlock_t irq_lock;
+-
+ unsigned long cache_req_pck;
+ unsigned long cache_prate;
+ struct dispc_clock_info cache_cinfo;
+
+- u32 irq_error_mask;
++ spinlock_t irq_lock;
++ u32 irq_error_mask;
+ struct omap_dispc_isr_data registered_isr[DISPC_MAX_NR_ISRS];
+-
+- spinlock_t error_lock;
+ u32 error_irqs;
+ struct work_struct error_work;
+
+ u32 ctx[DISPC_SZ_REGS / sizeof(u32)];
+ } dispc;
+
+-static void omap_dispc_set_irqs(void);
++static void _omap_dispc_set_irqs(void);
+
+ static inline void dispc_write_reg(const struct dispc_reg idx, u32 val)
+ {
+@@ -1691,10 +1688,13 @@ void dispc_enable_digit_out(bool enable)
+ }
+
+ if (enable) {
++ unsigned long flags;
+ /* When we enable digit output, we'll get an extra digit
+ * sync lost interrupt, that we need to ignore */
++ spin_lock_irqsave(&dispc.irq_lock, flags);
+ dispc.irq_error_mask &= ~DISPC_IRQ_SYNC_LOST_DIGIT;
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+ }
+
+ /* When we disable digit output, we need to wait until fields are done.
+@@ -1728,9 +1728,12 @@ void dispc_enable_digit_out(bool enable)
+ DSSERR("failed to unregister EVSYNC isr\n");
+
+ if (enable) {
++ unsigned long flags;
++ spin_lock_irqsave(&dispc.irq_lock, flags);
+ dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
+ dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT);
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+ }
+
+ enable_clocks(0);
+@@ -2508,14 +2511,14 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo)
+ return 0;
+ }
+
+-static void omap_dispc_set_irqs(void)
++/* dispc.irq_lock has to be locked by the caller */
++static void _omap_dispc_set_irqs(void)
+ {
+- unsigned long flags;
+- u32 mask = dispc.irq_error_mask;
++ u32 mask;
+ int i;
+ struct omap_dispc_isr_data *isr_data;
+
+- spin_lock_irqsave(&dispc.irq_lock, flags);
++ mask = dispc.irq_error_mask;
+
+ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
+ isr_data = &dispc.registered_isr[i];
+@@ -2528,9 +2531,8 @@ static void omap_dispc_set_irqs(void)
+
+ enable_clocks(1);
+ dispc_write_reg(DISPC_IRQENABLE, mask);
+- enable_clocks(0);
+
+- spin_unlock_irqrestore(&dispc.irq_lock, flags);
++ enable_clocks(0);
+ }
+
+ int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
+@@ -2571,11 +2573,14 @@ int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
+
+ break;
+ }
+-err:
++
++ _omap_dispc_set_irqs();
++
+ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+
+- if (ret == 0)
+- omap_dispc_set_irqs();
++ return 0;
++err:
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+
+ return ret;
+ }
+@@ -2606,10 +2611,10 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
+ break;
+ }
+
+- spin_unlock_irqrestore(&dispc.irq_lock, flags);
+-
+ if (ret == 0)
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
++
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+
+ return ret;
+ }
+@@ -2645,11 +2650,15 @@ static void print_irq_status(u32 status)
+ void dispc_irq_handler(void)
+ {
+ int i;
+- u32 irqstatus = dispc_read_reg(DISPC_IRQSTATUS);
++ u32 irqstatus;
+ u32 handledirqs = 0;
+ u32 unhandled_errors;
+ struct omap_dispc_isr_data *isr_data;
+
++ spin_lock(&dispc.irq_lock);
++
++ irqstatus = dispc_read_reg(DISPC_IRQSTATUS);
++
+ #ifdef DEBUG
+ if (dss_debug)
+ print_irq_status(irqstatus);
+@@ -2673,15 +2682,15 @@ void dispc_irq_handler(void)
+ unhandled_errors = irqstatus & ~handledirqs & dispc.irq_error_mask;
+
+ if (unhandled_errors) {
+- spin_lock(&dispc.error_lock);
+ dispc.error_irqs |= unhandled_errors;
+- spin_unlock(&dispc.error_lock);
+
+ dispc.irq_error_mask &= ~unhandled_errors;
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
+
+ schedule_work(&dispc.error_work);
+ }
++
++ spin_unlock(&dispc.irq_lock);
+ }
+
+ static void dispc_error_worker(struct work_struct *work)
+@@ -2690,10 +2699,10 @@ static void dispc_error_worker(struct work_struct *work)
+ u32 errors;
+ unsigned long flags;
+
+- spin_lock_irqsave(&dispc.error_lock, flags);
++ spin_lock_irqsave(&dispc.irq_lock, flags);
+ errors = dispc.error_irqs;
+ dispc.error_irqs = 0;
+- spin_unlock_irqrestore(&dispc.error_lock, flags);
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+
+ if (errors & DISPC_IRQ_GFX_FIFO_UNDERFLOW) {
+ DSSERR("GFX_FIFO_UNDERFLOW, disabling GFX\n");
+@@ -2836,8 +2845,10 @@ static void dispc_error_worker(struct work_struct *work)
+ }
+ }
+
++ spin_lock_irqsave(&dispc.irq_lock, flags);
+ dispc.irq_error_mask |= errors;
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+ }
+
+ int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
+@@ -2921,6 +2932,10 @@ void dispc_fake_vsync_irq(void)
+
+ static void _omap_dispc_initialize_irq(void)
+ {
++ unsigned long flags;
++
++ spin_lock_irqsave(&dispc.irq_lock, flags);
++
+ memset(dispc.registered_isr, 0, sizeof(dispc.registered_isr));
+
+ dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
+@@ -2929,7 +2944,9 @@ static void _omap_dispc_initialize_irq(void)
+ * so clear it */
+ dispc_write_reg(DISPC_IRQSTATUS, dispc_read_reg(DISPC_IRQSTATUS));
+
+- omap_dispc_set_irqs();
++ _omap_dispc_set_irqs();
++
++ spin_unlock_irqrestore(&dispc.irq_lock, flags);
+ }
+
+ void dispc_enable_sidle(void)
+@@ -2970,7 +2987,6 @@ int dispc_init(void)
+ u32 rev;
+
+ spin_lock_init(&dispc.irq_lock);
+- spin_lock_init(&dispc.error_lock);
+
+ INIT_WORK(&dispc.error_work, dispc_error_worker);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch b/recipes/linux/linux-omap-pm/dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch
new file mode 100644
index 0000000000..fed108627a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch
@@ -0,0 +1,39 @@
+From c6aecc828455ea996ae1804f166581b6d0040e84 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Sat, 23 May 2009 18:00:00 +0300
+Subject: [PATCH 074/146] DSS2: DISPC: clear irqstatus for newly enabled irqs
+
+This fixes the problem that when requesting a new irq
+we could get the isr called too early in case irqstatus
+already had that irq flag on.
+---
+ drivers/video/omap2/dss/dispc.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index b3685b2..2471cfe 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2515,6 +2515,7 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo)
+ static void _omap_dispc_set_irqs(void)
+ {
+ u32 mask;
++ u32 old_mask;
+ int i;
+ struct omap_dispc_isr_data *isr_data;
+
+@@ -2530,6 +2531,11 @@ static void _omap_dispc_set_irqs(void)
+ }
+
+ enable_clocks(1);
++
++ old_mask = dispc_read_reg(DISPC_IRQENABLE);
++ /* clear the irqstatus for newly enabled irqs */
++ dispc_write_reg(DISPC_IRQSTATUS, (mask ^ old_mask) & mask);
++
+ dispc_write_reg(DISPC_IRQENABLE, mask);
+
+ enable_clocks(0);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0075-DSS2-Add-WSS-support.patch b/recipes/linux/linux-omap-pm/dss2/0075-DSS2-Add-WSS-support.patch
new file mode 100644
index 0000000000..0f9c28a49f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0075-DSS2-Add-WSS-support.patch
@@ -0,0 +1,172 @@
+From 3b453993217ece5b38170727e8240869c12b89ea Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 22 May 2009 17:23:56 +0200
+Subject: [PATCH 075/146] DSS2: Add WSS support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Add support for setting the widescreen signalling (WSS) data via sysfs.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 3 ++
+ drivers/video/omap2/dss/display.c | 36 +++++++++++++++++++++++++++
+ drivers/video/omap2/dss/venc.c | 38 ++++++++++++++++++++++++++++-
+ 3 files changed, 76 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 5ac1ae7..2031dd5 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -514,6 +514,9 @@ struct omap_display {
+ u16 x, u16 y, u16 w, u16 h);
+
+ void (*configure_overlay)(struct omap_overlay *overlay);
++
++ int (*set_wss)(struct omap_display *display, u32 wss);
++ u32 (*get_wss)(struct omap_display *display);
+ };
+
+ int omap_dss_get_num_displays(void);
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 9aaf392..50ced29 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -239,6 +239,39 @@ struct display_attribute {
+ ssize_t (*store)(struct omap_display *, const char *, size_t);
+ };
+
++static ssize_t display_wss_show(struct omap_display *display, char *buf)
++{
++ unsigned int wss;
++
++ if (!display->get_wss)
++ return -ENOENT;
++
++ wss = display->get_wss(display);
++
++ return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss);
++}
++
++static ssize_t display_wss_store(struct omap_display *display,
++ const char *buf, size_t size)
++{
++ unsigned long wss;
++ int r;
++
++ if (!display->get_wss || !display->set_wss)
++ return -ENOENT;
++
++ if (strict_strtoul(buf, 0, &wss))
++ return -EINVAL;
++
++ if (wss > 0xfffff)
++ return -EINVAL;
++
++ if ((r = display->set_wss(display, wss)))
++ return r;
++
++ return size;
++}
++
+ #define DISPLAY_ATTR(_name, _mode, _show, _store) \
+ struct display_attribute display_attr_##_name = \
+ __ATTR(_name, _mode, _show, _store)
+@@ -258,6 +291,8 @@ static DISPLAY_ATTR(mirror, S_IRUGO|S_IWUSR,
+ display_mirror_show, display_mirror_store);
+ static DISPLAY_ATTR(panel_name, S_IRUGO, display_panel_name_show, NULL);
+ static DISPLAY_ATTR(ctrl_name, S_IRUGO, display_ctrl_name_show, NULL);
++static DISPLAY_ATTR(wss, S_IRUGO|S_IWUSR,
++ display_wss_show, display_wss_store);
+
+ static struct attribute *display_sysfs_attrs[] = {
+ &display_attr_name.attr,
+@@ -269,6 +304,7 @@ static struct attribute *display_sysfs_attrs[] = {
+ &display_attr_mirror.attr,
+ &display_attr_panel_name.attr,
+ &display_attr_ctrl_name.attr,
++ &display_attr_wss.attr,
+ NULL
+ };
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index b655df4..0cbba9f 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -289,6 +289,7 @@ EXPORT_SYMBOL(omap_dss_ntsc_timings);
+ static struct {
+ void __iomem *base;
+ struct mutex venc_lock;
++ u32 wss_data;
+ } venc;
+
+ static struct omap_panel venc_panel = {
+@@ -320,7 +321,7 @@ static void venc_write_config(const struct venc_config *config)
+ venc_write_reg(VENC_BLACK_LEVEL, config->black_level);
+ venc_write_reg(VENC_BLANK_LEVEL, config->blank_level);
+ venc_write_reg(VENC_M_CONTROL, config->m_control);
+- venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data);
++ venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | venc.wss_data);
+ venc_write_reg(VENC_S_CARR, config->s_carr);
+ venc_write_reg(VENC_L21__WC_CTL, config->l21__wc_ctl);
+ venc_write_reg(VENC_SAVID__EAVID, config->savid__eavid);
+@@ -482,6 +483,8 @@ static int venc_enable_display(struct omap_display *display)
+ goto err;
+ }
+
++ venc.wss_data = 0;
++
+ venc_power_on(display);
+
+ display->state = OMAP_DSS_DISPLAY_ACTIVE;
+@@ -589,6 +592,37 @@ static int venc_check_timings(struct omap_display *display,
+ return -EINVAL;
+ }
+
++static u32 venc_get_wss(struct omap_display *display)
++{
++ /* Invert due to VENC_L21_WC_CTL:INV=1 */
++ return (venc.wss_data >> 8) ^ 0xfffff;
++}
++
++static int venc_set_wss(struct omap_display *display,
++ u32 wss)
++{
++ const struct venc_config *config;
++
++ DSSDBG("venc_set_wss\n");
++
++ mutex_lock(&venc.venc_lock);
++
++ config = venc_timings_to_config(&display->panel->timings);
++
++ /* Invert due to VENC_L21_WC_CTL:INV=1 */
++ venc.wss_data = (wss ^ 0xfffff) << 8;
++
++ venc_enable_clocks(1);
++
++ venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | venc.wss_data);
++
++ venc_enable_clocks(0);
++
++ mutex_unlock(&venc.venc_lock);
++
++ return 0;
++}
++
+ void venc_init_display(struct omap_display *display)
+ {
+ display->panel = &venc_panel;
+@@ -599,6 +633,8 @@ void venc_init_display(struct omap_display *display)
+ display->get_timings = venc_get_timings;
+ display->set_timings = venc_set_timings;
+ display->check_timings = venc_check_timings;
++ display->get_wss = venc_get_wss;
++ display->set_wss = venc_set_wss;
+ }
+
+ void venc_dump_regs(struct seq_file *s)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0076-DSS2-Fix-PAL-NTSC-timings.patch b/recipes/linux/linux-omap-pm/dss2/0076-DSS2-Fix-PAL-NTSC-timings.patch
new file mode 100644
index 0000000000..28ae3ec5ac
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0076-DSS2-Fix-PAL-NTSC-timings.patch
@@ -0,0 +1,68 @@
+From f41bc6591494db0698b5f0f6bcf01ee6050c732f Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 22 May 2009 17:23:57 +0200
+Subject: [PATCH 076/146] DSS2: Fix PAL/NTSC timings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Fix the PAL/NTSC video timings. Only some of these values are actually
+specified for digital video, the rest were calculated based on the the
+analog timings. The analog timings differ from the digital timings
+anyway but these should be close to the truth. These values aren't
+actually needed by the VENC but it doesn't hurt to make them a bit more
+accurate.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/venc.c | 28 ++++++++++++++--------------
+ 1 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index 0cbba9f..02286b8 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -263,26 +263,26 @@ static const struct venc_config venc_config_pal_bdghi = {
+ const struct omap_video_timings omap_dss_pal_timings = {
+ .x_res = 720,
+ .y_res = 574,
+- .pixel_clock = 26181,
+- .hsw = 32,
+- .hfp = 80,
+- .hbp = 48,
+- .vsw = 7,
+- .vfp = 3,
+- .vbp = 6,
++ .pixel_clock = 13500,
++ .hsw = 64,
++ .hfp = 12,
++ .hbp = 68,
++ .vsw = 5,
++ .vfp = 5,
++ .vbp = 41,
+ };
+ EXPORT_SYMBOL(omap_dss_pal_timings);
+
+ const struct omap_video_timings omap_dss_ntsc_timings = {
+ .x_res = 720,
+ .y_res = 482,
+- .pixel_clock = 22153,
+- .hsw = 32,
+- .hfp = 80,
+- .hbp = 48,
+- .vsw = 10,
+- .vfp = 3,
+- .vbp = 6,
++ .pixel_clock = 13500,
++ .hsw = 64,
++ .hfp = 16,
++ .hbp = 58,
++ .vsw = 6,
++ .vfp = 6,
++ .vbp = 31,
+ };
+ EXPORT_SYMBOL(omap_dss_ntsc_timings);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0077-DSS2-Add-venc-debugfs-file.patch b/recipes/linux/linux-omap-pm/dss2/0077-DSS2-Add-venc-debugfs-file.patch
new file mode 100644
index 0000000000..713c72533e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0077-DSS2-Add-venc-debugfs-file.patch
@@ -0,0 +1,34 @@
+From d0d9b920dcf074ca854f11a9bb80d3a7fcf83b97 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 22 May 2009 17:23:58 +0200
+Subject: [PATCH 077/146] DSS2: Add venc debugfs file
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Actually make the venc register dump file visible in debugfs. Somehow
+this hunk got dropped when the venc debugfs file was originally added.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/core.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index 6d11b04..2a38507 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -396,6 +396,10 @@ static int dss_initialize_debugfs(void)
+ debugfs_create_file("dsi", S_IRUGO, dss_debugfs_dir,
+ &dsi_dump_regs, &dss_debug_fops);
+ #endif
++#ifdef CONFIG_OMAP2_DSS_VENC
++ debugfs_create_file("venc", S_IRUGO, dss_debugfs_dir,
++ &venc_dump_regs, &dss_debug_fops);
++#endif
+ return 0;
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0078-DSS2-Enable-replication-logic-feature.patch b/recipes/linux/linux-omap-pm/dss2/0078-DSS2-Enable-replication-logic-feature.patch
new file mode 100644
index 0000000000..ac502112fd
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0078-DSS2-Enable-replication-logic-feature.patch
@@ -0,0 +1,138 @@
+From 8d239b2c7f05acf2f732d292f5d7c5abc3c7ce1a Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 26 May 2009 10:49:24 +0300
+Subject: [PATCH 078/146] DSS2: Enable replication logic feature
+
+Replication logic will make colors a bit better on active matrix LCD
+when the fb is in 16bpp mode and the LCD interface is 18/24bpp.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 19 +++++++++++++++++++
+ drivers/video/omap2/dss/display.c | 34 ++++++++++++++++++++++++++++++++++
+ drivers/video/omap2/dss/dss.h | 3 +++
+ drivers/video/omap2/dss/manager.c | 5 +++++
+ 4 files changed, 61 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 2471cfe..e936c59 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -908,6 +908,20 @@ static void _dispc_set_vid_color_conv(enum omap_plane plane, bool enable)
+ dispc_write_reg(dispc_reg_att[plane], val);
+ }
+
++void dispc_enable_replication(enum omap_plane plane, bool enable)
++{
++ int bit;
++
++ if (plane == OMAP_DSS_GFX)
++ bit = 5;
++ else
++ bit = 10;
++
++ enable_clocks(1);
++ REG_FLD_MOD(dispc_reg_att[plane], enable, bit, bit);
++ enable_clocks(0);
++}
++
+ void dispc_set_lcd_size(u16 width, u16 height)
+ {
+ u32 val;
+@@ -3293,6 +3307,11 @@ void dispc_setup_partial_planes(struct omap_display *display,
+ pi->mirror,
+ pi->global_alpha);
+
++ if (dss_use_replication(display, ovl->info.color_mode))
++ dispc_enable_replication(ovl->id, true);
++ else
++ dispc_enable_replication(ovl->id, false);
++
+ dispc_enable_plane(ovl->id, 1);
+ }
+
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 50ced29..77a6dc4 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -411,6 +411,40 @@ static int default_get_recommended_bpp(struct omap_display *display)
+ }
+ }
+
++/* Checks if replication logic should be used. Only use for active matrix,
++ * when overlay is in RGB12U or RGB16 mode, and LCD interface is
++ * 18bpp or 24bpp */
++bool dss_use_replication(struct omap_display *display,
++ enum omap_color_mode mode)
++{
++ int bpp;
++
++ if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
++ return false;
++
++ if (display->type == OMAP_DISPLAY_TYPE_DPI &&
++ (display->panel->config & OMAP_DSS_LCD_TFT) == 0)
++ return false;
++
++ switch (display->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++ bpp = display->hw_config.u.dpi.data_lines;
++ break;
++ case OMAP_DISPLAY_TYPE_VENC:
++ case OMAP_DISPLAY_TYPE_SDI:
++ bpp = 24;
++ break;
++ case OMAP_DISPLAY_TYPE_DBI:
++ case OMAP_DISPLAY_TYPE_DSI:
++ bpp = display->ctrl->pixel_size;
++ break;
++ default:
++ BUG();
++ }
++
++ return bpp > 16;
++}
++
+ void dss_init_displays(struct platform_device *pdev)
+ {
+ struct omap_dss_board_info *pdata = pdev->dev.platform_data;
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 20cef0a..d51ffe4 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -173,6 +173,8 @@ void dss_uninit_displays(struct platform_device *pdev);
+ int dss_suspend_all_displays(void);
+ int dss_resume_all_displays(void);
+ struct omap_display *dss_get_display(int no);
++bool dss_use_replication(struct omap_display *display,
++ enum omap_color_mode mode);
+
+ /* manager */
+ int dss_init_overlay_managers(struct platform_device *pdev);
+@@ -280,6 +282,7 @@ void dispc_go(enum omap_channel channel);
+ void dispc_enable_lcd_out(bool enable);
+ void dispc_enable_digit_out(bool enable);
+ int dispc_enable_plane(enum omap_plane plane, bool enable);
++void dispc_enable_replication(enum omap_plane plane, bool enable);
+
+ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode);
+ void dispc_set_tft_data_lines(u8 data_lines);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 1e6cd8d..8d5d00f 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -474,6 +474,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ continue;
+ }
+
++ if (dss_use_replication(display, ovl->info.color_mode))
++ dispc_enable_replication(ovl->id, true);
++ else
++ dispc_enable_replication(ovl->id, false);
++
+ dispc_enable_plane(ovl->id, 1);
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0079-DSS2-support-for-querying-the-supported-overlay-col.patch b/recipes/linux/linux-omap-pm/dss2/0079-DSS2-support-for-querying-the-supported-overlay-col.patch
new file mode 100644
index 0000000000..3bc96874e6
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0079-DSS2-support-for-querying-the-supported-overlay-col.patch
@@ -0,0 +1,180 @@
+From 31204dee400ffa13900eedef77ec78234a0bbbf9 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 26 May 2009 16:42:16 +0200
+Subject: [PATCH 079/146] DSS2: support for querying the supported overlay color modes
+
+Adds an IOCTL through which an application can iterate through the
+color modes supported by an overlay. Instead of a simple mode ID
+this will give the parameters needed to setup the FB, as this is what
+the application will do anyway.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 62 +++++++++++++++++++++++++++++
+ drivers/video/omap2/omapfb/omapfb-main.c | 4 +-
+ drivers/video/omap2/omapfb/omapfb.h | 2 +
+ include/linux/omapfb.h | 15 ++++++-
+ 4 files changed, 80 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 79d8916..980e3db 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -434,6 +434,52 @@ static int omapfb_memory_read(struct fb_info *fbi,
+ return r;
+ }
+
++int omapfb_get_ovl_colormode(struct omapfb2_device *fbdev,
++ struct omapfb_ovl_colormode *mode)
++{
++ int ovl_idx = mode->overlay_idx;
++ int mode_idx = mode->mode_idx;
++ struct omap_overlay *ovl;
++ enum omap_color_mode supported_modes;
++ struct fb_var_screeninfo var;
++ int i;
++
++ if (ovl_idx >= fbdev->num_overlays)
++ return -ENODEV;
++ ovl = fbdev->overlays[ovl_idx];
++ supported_modes = ovl->supported_modes;
++
++ mode_idx = mode->mode_idx;
++
++ for (i = 0; i < sizeof(supported_modes) * 8; i++) {
++ if (!(supported_modes & (1 << i)))
++ continue;
++ /*
++ * It's possible that the FB doesn't support a mode
++ * that is supported by the overlay, so call the
++ * following here.
++ */
++ if (dss_mode_to_fb_mode(1 << i, &var) < 0)
++ continue;
++
++ mode_idx--;
++ if (mode_idx < 0)
++ break;
++ }
++
++ if (i == sizeof(supported_modes) * 8)
++ return -ENOENT;
++
++ mode->bits_per_pixel = var.bits_per_pixel;
++ mode->nonstd = var.nonstd;
++ mode->red = var.red;
++ mode->green = var.green;
++ mode->blue = var.blue;
++ mode->transp = var.transp;
++
++ return 0;
++}
++
+ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+@@ -447,6 +493,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ struct omapfb_caps caps;
+ struct omapfb_mem_info mem_info;
+ struct omapfb_color_key color_key;
++ struct omapfb_ovl_colormode ovl_colormode;
+ enum omapfb_update_mode update_mode;
+ int test_num;
+ struct omapfb_memory_read memory_read;
+@@ -554,6 +601,21 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ r = -EFAULT;
+ break;
+
++ case OMAPFB_GET_OVERLAY_COLORMODE:
++ DBG("ioctl GET_OVERLAY_COLORMODE\n");
++ if (copy_from_user(&p.ovl_colormode, (void __user *)arg,
++ sizeof(p.ovl_colormode))) {
++ r = -EFAULT;
++ break;
++ }
++ r = omapfb_get_ovl_colormode(fbdev, &p.ovl_colormode);
++ if (r < 0)
++ break;
++ if (copy_to_user((void __user *)arg, &p.ovl_colormode,
++ sizeof(p.ovl_colormode)))
++ r = -EFAULT;
++ break;
++
+ case OMAPFB_SET_UPDATE_MODE:
+ DBG("ioctl SET_UPDATE_MODE\n");
+ if (get_user(p.update_mode, (int __user *)arg))
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index c4bd081..c3690b8 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -364,8 +364,8 @@ static enum omap_color_mode fb_mode_to_dss_mode(struct fb_var_screeninfo *var)
+ return -EINVAL;
+ }
+
+-static int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
+- struct fb_var_screeninfo *var)
++int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
++ struct fb_var_screeninfo *var)
+ {
+ int i;
+
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index f40fcce..e750bc0 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -111,6 +111,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg);
+
+ int omapfb_mode_to_timings(const char *mode_str,
+ struct omap_video_timings *timings, u8 *bpp);
++int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
++ struct fb_var_screeninfo *var);
+
+ /* find the display connected to this fb, if any */
+ static inline struct omap_display *fb2display(struct fb_info *fbi)
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 7a34f22..fd522d3 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -24,6 +24,8 @@
+ #ifndef __OMAPFB_H
+ #define __OMAPFB_H
+
++#include <linux/fb.h>
++
+ #include <asm/ioctl.h>
+ #include <asm/types.h>
+
+@@ -52,6 +54,7 @@
+ #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
+ #define OMAPFB_WAITFORVSYNC OMAP_IO(57)
+ #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
++#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
+
+ #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+ #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+@@ -179,11 +182,21 @@ struct omapfb_memory_read {
+ void __user *buffer;
+ };
+
++struct omapfb_ovl_colormode {
++ __u8 overlay_idx;
++ __u8 mode_idx;
++ __u32 bits_per_pixel;
++ __u32 nonstd;
++ struct fb_bitfield red;
++ struct fb_bitfield green;
++ struct fb_bitfield blue;
++ struct fb_bitfield transp;
++};
++
+ #ifdef __KERNEL__
+
+ #include <linux/completion.h>
+ #include <linux/interrupt.h>
+-#include <linux/fb.h>
+ #include <linux/mutex.h>
+
+ #include <mach/board.h>
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0080-DSS2-fix-uninitialized-var-in-OMAPFB_GET_CAPS-IOCTL.patch b/recipes/linux/linux-omap-pm/dss2/0080-DSS2-fix-uninitialized-var-in-OMAPFB_GET_CAPS-IOCTL.patch
new file mode 100644
index 0000000000..4454bbae1f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0080-DSS2-fix-uninitialized-var-in-OMAPFB_GET_CAPS-IOCTL.patch
@@ -0,0 +1,26 @@
+From 5069f20f593bc6b0bdeb1913130be894a2a3d071 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Tue, 26 May 2009 16:53:46 +0200
+Subject: [PATCH 080/146] DSS2: fix uninitialized var in OMAPFB_GET_CAPS IOCTL
+
+Spotted-by: Ville Syrjala <ville.syrjala@nokia.com>
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 980e3db..123f5dc 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -595,6 +595,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ break;
+ }
+
++ memset(&p.caps, 0, sizeof(p.caps));
+ p.caps.ctrl = display->caps;
+
+ if (copy_to_user((void __user *)arg, &p.caps, sizeof(p.caps)))
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0081-DSS2-Reset-WSS-data-only-when-changing-TV-standard.patch b/recipes/linux/linux-omap-pm/dss2/0081-DSS2-Reset-WSS-data-only-when-changing-TV-standard.patch
new file mode 100644
index 0000000000..239465729e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0081-DSS2-Reset-WSS-data-only-when-changing-TV-standard.patch
@@ -0,0 +1,54 @@
+From 6a853312fa903f4369af3ea485c86753aca556fc Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Tue, 26 May 2009 16:14:49 +0200
+Subject: [PATCH 081/146] DSS2: Reset WSS data only when changing TV standard
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Do not reset the the WSS data every time the display is enabled. Only
+reset it when the TV standard changes since PAL and NTSC use different
+WSS data layouts.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/venc.c | 9 +++++++--
+ 1 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index 02286b8..b0f0795 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -406,6 +406,8 @@ int venc_init(void)
+
+ mutex_init(&venc.venc_lock);
+
++ venc.wss_data = 0;
++
+ venc_panel.timings = omap_dss_pal_timings;
+
+ venc.base = ioremap(VENC_BASE, SZ_1K);
+@@ -483,8 +485,6 @@ static int venc_enable_display(struct omap_display *display)
+ goto err;
+ }
+
+- venc.wss_data = 0;
+-
+ venc_power_on(display);
+
+ display->state = OMAP_DSS_DISPLAY_ACTIVE;
+@@ -570,6 +570,11 @@ static void venc_set_timings(struct omap_display *display,
+ struct omap_video_timings *timings)
+ {
+ DSSDBG("venc_set_timings\n");
++
++ /* Reset WSS data when the TV standard changes. */
++ if (memcmp(&display->panel->timings, timings, sizeof(*timings)))
++ venc.wss_data = 0;
++
+ display->panel->timings = *timings;
+ if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
+ /* turn the venc off and on to get new timings to use */
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch b/recipes/linux/linux-omap-pm/dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch
new file mode 100644
index 0000000000..6d211adc92
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch
@@ -0,0 +1,78 @@
+From d8745c631cfcbf6b91b7ffd1c228b1c27f6d1917 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 27 May 2009 12:00:20 +0300
+Subject: [PATCH 082/146] DSS2: DSI: implement timeout for DSI transfer
+
+Proper transfer shutdown is still missing.
+---
+ drivers/video/omap2/dss/dsi.c | 27 +++++++++++++++++++++++++++
+ 1 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index c45140f..38d3807 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -269,6 +269,7 @@ static struct
+
+ struct work_struct framedone_work;
+ struct work_struct process_work;
++ struct delayed_work framedone_timeout_work;
+ struct workqueue_struct *workqueue;
+
+ enum omap_dss_update_mode user_update_mode;
+@@ -2756,12 +2757,34 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+
+ dispc_disable_sidle();
+
++ queue_delayed_work(dsi.workqueue, &dsi.framedone_timeout_work,
++ msecs_to_jiffies(1000));
++
+ dispc_enable_lcd_out(1);
+
+ if (dsi.use_te)
+ dsi_vc_send_bta(1);
+ }
+
++static void framedone_timeout_callback(struct work_struct *work)
++{
++ DSSERR("framedone timeout\n");
++
++ dispc_enable_lcd_out(0);
++
++ /* XXX TODO: cancel the transfer properly */
++
++ /* XXX check that fifo is not full. otherwise we would sleep and never
++ * get to process_cmd_fifo below */
++ /* We check for target_update_mode, not update_mode. No reason to push
++ * new updates if we're turning auto update off */
++ if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_push_autoupdate(dsi.vc[1].display);
++
++ atomic_set(&dsi.cmd_pending, 0);
++ dsi_process_cmd_fifo(NULL);
++}
++
+ static void framedone_callback(void *data, u32 mask)
+ {
+ if (dsi.framedone_scheduled) {
+@@ -2769,6 +2792,8 @@ static void framedone_callback(void *data, u32 mask)
+ return;
+ }
+
++ cancel_delayed_work(&dsi.framedone_timeout_work);
++
+ dispc_enable_sidle();
+
+ dsi.framedone_scheduled = 1;
+@@ -3834,6 +3859,8 @@ int dsi_init(void)
+ dsi.workqueue = create_singlethread_workqueue("dsi");
+ INIT_WORK(&dsi.framedone_work, framedone_worker);
+ INIT_WORK(&dsi.process_work, dsi_process_cmd_fifo);
++ INIT_DELAYED_WORK(&dsi.framedone_timeout_work,
++ framedone_timeout_callback);
+
+ mutex_init(&dsi.lock);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0083-DSS2-DSI-reset-perf-frame-counter-when-starting-au.patch b/recipes/linux/linux-omap-pm/dss2/0083-DSS2-DSI-reset-perf-frame-counter-when-starting-au.patch
new file mode 100644
index 0000000000..e3838f0d51
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0083-DSS2-DSI-reset-perf-frame-counter-when-starting-au.patch
@@ -0,0 +1,32 @@
+From 26e96637277d8631372a14e82e43b4023b75eff7 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 27 May 2009 16:19:28 +0300
+Subject: [PATCH 083/146] DSS2: DSI: reset perf frame counter when starting autoupdate
+
+---
+ drivers/video/omap2/dss/dsi.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 38d3807..a845ea6 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -365,6 +365,7 @@ static void perf_mark_start(void)
+
+ static void perf_mark_start_auto(void)
+ {
++ dsi.perf_measure_frames = 0;
+ dsi.perf_start_time_auto = ktime_get();
+ }
+
+@@ -440,7 +441,6 @@ static void perf_show(const char *name)
+ s_max_trans_us,
+ s_total_trans_us / numframes);
+
+- dsi.perf_measure_frames = 0;
+ s_total_setup_us = 0;
+ s_min_setup_us = 0xffffffff;
+ s_max_setup_us = 0;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0084-DSS2-DSI-Implement-DSI-bus-lock.patch b/recipes/linux/linux-omap-pm/dss2/0084-DSS2-DSI-Implement-DSI-bus-lock.patch
new file mode 100644
index 0000000000..457fb19221
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0084-DSS2-DSI-Implement-DSI-bus-lock.patch
@@ -0,0 +1,265 @@
+From b666333651cbb1e60a84b6be8b9d45b3104ca804 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 27 May 2009 16:34:54 +0300
+Subject: [PATCH 084/146] DSS2: DSI: Implement DSI bus lock
+
+DSI bus lock protects the DSI bus. Normally dsi driver acquires the
+lock, but if display drivers have their own workqueues, or similar,
+they need to acquire the bus lock before sending data.
+---
+ arch/arm/plat-omap/include/mach/display.h | 2 +
+ drivers/video/omap2/dss/dsi.c | 61 +++++++++++++++++++++++++++++
+ 2 files changed, 63 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 2031dd5..d36f730 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -169,6 +169,8 @@ int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
+ int hs_pol_inv, int vs_pol_inv, int extif_div);
+
+ /* DSI */
++void dsi_bus_lock(void);
++void dsi_bus_unlock(void);
+ int dsi_vc_dcs_write(int channel, u8 *data, int len);
+ int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len);
+ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen);
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index a845ea6..a06fb75 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -262,6 +262,7 @@ static struct
+ } vc[4];
+
+ struct mutex lock;
++ struct mutex bus_lock;
+
+ unsigned pll_locked;
+
+@@ -339,6 +340,18 @@ void dsi_restore_context(void)
+ {
+ }
+
++void dsi_bus_lock(void)
++{
++ mutex_lock(&dsi.bus_lock);
++}
++EXPORT_SYMBOL(dsi_bus_lock);
++
++void dsi_bus_unlock(void)
++{
++ mutex_unlock(&dsi.bus_lock);
++}
++EXPORT_SYMBOL(dsi_bus_unlock);
++
+ static inline int wait_for_bit_change(const struct dsi_reg idx, int bitnum,
+ int value)
+ {
+@@ -1887,6 +1900,8 @@ static inline void dsi_vc_write_long_header(int channel, u8 data_type,
+ u32 val;
+ u8 data_id;
+
++ WARN_ON(!mutex_is_locked(&dsi.bus_lock));
++
+ /*data_id = data_type | channel << 6; */
+ data_id = data_type | dsi.vc[channel].dest_per << 6;
+
+@@ -1978,6 +1993,8 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc)
+ u32 r;
+ u8 data_id;
+
++ WARN_ON(!mutex_is_locked(&dsi.bus_lock));
++
+ if (dsi.debug_write)
+ DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n",
+ channel,
+@@ -2478,6 +2495,8 @@ static int dsi_update_screen_l4(struct omap_display *display,
+
+ DSSDBG("max_pixels_per_packet %d\n", max_pixels_per_packet);
+
++ dsi_bus_lock();
++
+ display->ctrl->setup_update(display, x, y, w, h);
+
+ pixels_left = w * h;
+@@ -2514,6 +2533,7 @@ static int dsi_update_screen_l4(struct omap_display *display,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
++ dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2526,6 +2546,7 @@ static int dsi_update_screen_l4(struct omap_display *display,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
++ dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2536,6 +2557,7 @@ static int dsi_update_screen_l4(struct omap_display *display,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
++ dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2568,6 +2590,8 @@ static int dsi_update_screen_l4(struct omap_display *display,
+
+ perf_show("L4");
+
++ dsi_bus_unlock();
++
+ return 0;
+ }
+
+@@ -2734,6 +2758,8 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+ if (len % packet_payload)
+ total_len += (len % packet_payload) + 1;
+
++ dsi_bus_lock();
++
+ display->ctrl->setup_update(display, x, y, w, h);
+
+ if (dsi.use_ext_te && display->ctrl->wait_for_te)
+@@ -2774,6 +2800,12 @@ static void framedone_timeout_callback(struct work_struct *work)
+
+ /* XXX TODO: cancel the transfer properly */
+
++ dsi_bus_unlock();
++
++ /* Schedule, so that other threads that want dsi-bus-lock can get it.
++ * Otherwise with autoupdate we may be holding it all the time */
++ schedule();
++
+ /* XXX check that fifo is not full. otherwise we would sleep and never
+ * get to process_cmd_fifo below */
+ /* We check for target_update_mode, not update_mode. No reason to push
+@@ -2852,6 +2884,12 @@ static void framedone_worker(struct work_struct *work)
+ #endif
+ dsi.framedone_scheduled = 0;
+
++ dsi_bus_unlock();
++
++ /* Schedule, so that other threads that want dsi-bus-lock can get it.
++ * Otherwise with autoupdate we may be holding it all the time */
++ schedule();
++
+ /* XXX check that fifo is not full. otherwise we would sleep and never
+ * get to process_cmd_fifo below */
+ /* We check for target_update_mode, not update_mode. No reason to push
+@@ -2970,6 +3008,9 @@ static void dsi_do_cmd_mem_read(struct omap_display *display,
+ struct dsi_cmd_mem_read *mem_read)
+ {
+ int r;
++
++ dsi_bus_lock();
++
+ r = display->ctrl->memory_read(display,
+ mem_read->buf,
+ mem_read->size,
+@@ -2978,6 +3019,8 @@ static void dsi_do_cmd_mem_read(struct omap_display *display,
+ mem_read->w,
+ mem_read->h);
+
++ dsi_bus_unlock();
++
+ *mem_read->ret_size = (size_t)r;
+ complete(mem_read->completion);
+ }
+@@ -2992,6 +3035,8 @@ static void dsi_do_cmd_test(struct omap_display *display,
+ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
++ dsi_bus_lock();
++
+ /* run test first in low speed mode */
+ dsi_vc_enable_hs(0, 0);
+
+@@ -3022,6 +3067,8 @@ static void dsi_do_cmd_test(struct omap_display *display,
+ end:
+ dsi_vc_enable_hs(0, 1);
+
++ dsi_bus_unlock();
++
+ *test->result = r;
+ complete(test->completion);
+
+@@ -3038,7 +3085,9 @@ static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
+ if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
++ dsi_bus_lock();
+ display->ctrl->enable_te(display, enable);
++ dsi_bus_unlock();
+
+ if (!display->hw_config.u.dsi.ext_te) {
+ if (enable) {
+@@ -3148,13 +3197,17 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+ break;
+
+ case DSI_CMD_SET_ROTATE:
++ dsi_bus_lock();
+ display->ctrl->set_rotate(display, p.u.rotate);
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
+ dsi.autoupdate_setup = 1;
++ dsi_bus_unlock();
+ break;
+
+ case DSI_CMD_SET_MIRROR:
++ dsi_bus_lock();
+ display->ctrl->set_mirror(display, p.u.mirror);
++ dsi_bus_unlock();
+ break;
+
+ default:
+@@ -3417,6 +3470,8 @@ static int dsi_display_init_dsi(struct omap_display *display)
+
+ _dsi_print_reset_status();
+
++ dsi_bus_lock();
++
+ r = dsi_pll_init(1, 0);
+ if (r)
+ goto err0;
+@@ -3468,6 +3523,8 @@ static int dsi_display_init_dsi(struct omap_display *display)
+ /* enable high-speed after initial config */
+ dsi_vc_enable_hs(0, 1);
+
++ dsi_bus_unlock();
++
+ return 0;
+ err4:
+ if (display->ctrl && display->ctrl->disable)
+@@ -3479,15 +3536,18 @@ err2:
+ err1:
+ dsi_pll_uninit();
+ err0:
++ dsi_bus_unlock();
+ return r;
+ }
+
+ static void dsi_display_uninit_dsi(struct omap_display *display)
+ {
++ dsi_bus_lock();
+ if (display->panel && display->panel->disable)
+ display->panel->disable(display);
+ if (display->ctrl && display->ctrl->disable)
+ display->ctrl->disable(display);
++ dsi_bus_unlock();
+
+ dsi_complexio_uninit();
+ dsi_pll_uninit();
+@@ -3863,6 +3923,7 @@ int dsi_init(void)
+ framedone_timeout_callback);
+
+ mutex_init(&dsi.lock);
++ mutex_init(&dsi.bus_lock);
+
+ dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
+ dsi.user_update_mode = OMAP_DSS_UPDATE_DISABLED;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0085-DSS2-OMAPFB-omapfb_get_ovl_colormode-to-static.patch b/recipes/linux/linux-omap-pm/dss2/0085-DSS2-OMAPFB-omapfb_get_ovl_colormode-to-static.patch
new file mode 100644
index 0000000000..da0c155c2b
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0085-DSS2-OMAPFB-omapfb_get_ovl_colormode-to-static.patch
@@ -0,0 +1,26 @@
+From 5e7b8aa4d0c904556af01085a82f50ad895a59d5 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 28 May 2009 15:26:08 +0300
+Subject: [PATCH 085/146] DSS2: OMAPFB: omapfb_get_ovl_colormode to static
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 123f5dc..57e6287 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -434,7 +434,7 @@ static int omapfb_memory_read(struct fb_info *fbi,
+ return r;
+ }
+
+-int omapfb_get_ovl_colormode(struct omapfb2_device *fbdev,
++static int omapfb_get_ovl_colormode(struct omapfb2_device *fbdev,
+ struct omapfb_ovl_colormode *mode)
+ {
+ int ovl_idx = mode->overlay_idx;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0086-DSS2-VRFB-make-vrfb_hw_context-static.patch b/recipes/linux/linux-omap-pm/dss2/0086-DSS2-VRFB-make-vrfb_hw_context-static.patch
new file mode 100644
index 0000000000..ed817f2e9a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0086-DSS2-VRFB-make-vrfb_hw_context-static.patch
@@ -0,0 +1,25 @@
+From 989ad2f5d7ce459332ecaca7e0c5ffa0e24218b9 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 1 Jun 2009 14:08:12 +0300
+Subject: [PATCH 086/146] DSS2: VRFB: make vrfb_hw_context static
+
+---
+ arch/arm/plat-omap/vrfb.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 34395c2..59ac66a 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -49,7 +49,7 @@ static unsigned long ctx_map_active;
+ * we don't need locking, since no drivers will run until after the wake-up
+ * has finished.
+ */
+-struct {
++static struct {
+ u32 physical_ba;
+ u32 control;
+ u32 size;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0087-DSS2-new-device-driver-model.patch b/recipes/linux/linux-omap-pm/dss2/0087-DSS2-new-device-driver-model.patch
new file mode 100644
index 0000000000..ecc51227f2
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0087-DSS2-new-device-driver-model.patch
@@ -0,0 +1,5336 @@
+From 63614d959a4558c552a9d9aec693018fb6eece63 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 1 Jun 2009 14:15:13 +0300
+Subject: [PATCH 087/146] DSS2: new device/driver model
+
+Use better model for handling DSS devices and drivers.
+
+Remove omap_display, omap_ctrl and omap_panel structs, and add
+omap_dss_device and omap_dss_driver. DSS devices are added to DSS bus.
+
+The commit changes almost every part of DSS2, even if actual
+functionality should be changed only in few parts.
+---
+ arch/arm/plat-omap/include/mach/display.h | 400 ++++++++----------
+ drivers/video/omap2/dss/core.c | 306 +++++++++++++-
+ drivers/video/omap2/dss/dispc.c | 36 +-
+ drivers/video/omap2/dss/display.c | 654 ++++++++++++-----------------
+ drivers/video/omap2/dss/dpi.c | 150 ++++---
+ drivers/video/omap2/dss/dsi.c | 584 ++++++++++++--------------
+ drivers/video/omap2/dss/dss.h | 44 ++-
+ drivers/video/omap2/dss/manager.c | 108 +++---
+ drivers/video/omap2/dss/overlay.c | 93 ++---
+ drivers/video/omap2/dss/rfbi.c | 104 +++---
+ drivers/video/omap2/dss/sdi.c | 115 +++---
+ drivers/video/omap2/dss/venc.c | 192 ++++++---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 12 +-
+ drivers/video/omap2/omapfb/omapfb-main.c | 49 +--
+ drivers/video/omap2/omapfb/omapfb.h | 6 +-
+ 15 files changed, 1526 insertions(+), 1327 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index d36f730..57bb8ff 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -22,6 +22,7 @@
+
+ #include <linux/list.h>
+ #include <linux/kobject.h>
++#include <linux/device.h>
+ #include <asm/atomic.h>
+
+ #define DISPC_IRQ_FRAMEDONE (1 << 0)
+@@ -42,6 +43,9 @@
+ #define DISPC_IRQ_SYNC_LOST_DIGIT (1 << 15)
+ #define DISPC_IRQ_WAKEUP (1 << 16)
+
++struct omap_dss_device;
++struct omap_overlay_manager;
++
+ enum omap_display_type {
+ OMAP_DISPLAY_TYPE_NONE = 0,
+ OMAP_DISPLAY_TYPE_DPI = 1 << 0,
+@@ -132,9 +136,41 @@ enum omap_dss_venc_type {
+ OMAP_DSS_VENC_TYPE_SVIDEO,
+ };
+
+-struct omap_display;
+-struct omap_panel;
+-struct omap_ctrl;
++enum omap_display_caps {
++ OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0,
++};
++
++enum omap_dss_update_mode {
++ OMAP_DSS_UPDATE_DISABLED = 0,
++ OMAP_DSS_UPDATE_AUTO,
++ OMAP_DSS_UPDATE_MANUAL,
++};
++
++enum omap_dss_display_state {
++ OMAP_DSS_DISPLAY_DISABLED = 0,
++ OMAP_DSS_DISPLAY_ACTIVE,
++ OMAP_DSS_DISPLAY_SUSPENDED,
++};
++
++/* XXX perhaps this should be removed */
++enum omap_dss_overlay_managers {
++ OMAP_DSS_OVL_MGR_LCD,
++ OMAP_DSS_OVL_MGR_TV,
++};
++
++enum omap_dss_rotation_type {
++ OMAP_DSS_ROT_DMA = 0,
++ OMAP_DSS_ROT_VRFB = 1,
++};
++
++enum omap_overlay_caps {
++ OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
++ OMAP_DSS_OVL_CAP_DISPC = 1 << 1,
++};
++
++enum omap_overlay_manager_caps {
++ OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0,
++};
+
+ /* RFBI */
+
+@@ -178,108 +214,13 @@ int dsi_vc_set_max_rx_packet_size(int channel, u16 len);
+ int dsi_vc_send_null(int channel);
+
+ /* Board specific data */
+-struct omap_dss_display_config {
+- enum omap_display_type type;
+-
+- union {
+- struct {
+- u8 data_lines;
+- } dpi;
+-
+- struct {
+- u8 channel;
+- u8 data_lines;
+- } rfbi;
+-
+- struct {
+- u8 datapairs;
+- } sdi;
+-
+- struct {
+- u8 clk_lane;
+- u8 clk_pol;
+- u8 data1_lane;
+- u8 data1_pol;
+- u8 data2_lane;
+- u8 data2_pol;
+- unsigned long lp_clk_hz;
+- unsigned long ddr_clk_hz;
+-
+- bool ext_te;
+- u8 ext_te_gpio;
+- } dsi;
+-
+- struct {
+- enum omap_dss_venc_type type;
+- } venc;
+- } u;
+-
+- int panel_reset_gpio;
+- int ctrl_reset_gpio;
+-
+- int max_backlight_level;
+-
+- const char *name; /* for debug */
+- const char *ctrl_name;
+- const char *panel_name;
+-
+- void *panel_data;
+- void *ctrl_data;
+-
+- /* platform specific enable/disable */
+- int (*panel_enable)(struct omap_display *display);
+- void (*panel_disable)(struct omap_display *display);
+- int (*ctrl_enable)(struct omap_display *display);
+- void (*ctrl_disable)(struct omap_display *display);
+- int (*set_backlight)(struct omap_display *display,
+- int level);
+- int (*get_backlight)(struct omap_display *display);
+-};
+-
+-struct device;
+-
+-/* Board specific data */
+-struct omap_dss_board_info {
++struct omap_dss_board_info {
+ int (*get_last_off_on_transaction_id)(struct device *dev);
++ int num_devices;
++ struct omap_dss_device **devices;
++ struct omap_dss_device *default_device;
+ int (*dsi_power_up)(void);
+ void (*dsi_power_down)(void);
+- int num_displays;
+- struct omap_dss_display_config *displays[];
+-};
+-
+-struct omap_ctrl {
+- struct module *owner;
+-
+- const char *name;
+-
+- int (*init)(struct omap_display *display);
+- void (*cleanup)(struct omap_display *display);
+- int (*enable)(struct omap_display *display);
+- void (*disable)(struct omap_display *display);
+- int (*suspend)(struct omap_display *display);
+- int (*resume)(struct omap_display *display);
+- void (*setup_update)(struct omap_display *display,
+- u16 x, u16 y, u16 w, u16 h);
+-
+- int (*enable_te)(struct omap_display *display, bool enable);
+- int (*wait_for_te)(struct omap_display *display);
+-
+- u8 (*get_rotate)(struct omap_display *display);
+- int (*set_rotate)(struct omap_display *display, u8 rotate);
+-
+- bool (*get_mirror)(struct omap_display *display);
+- int (*set_mirror)(struct omap_display *display, bool enable);
+-
+- int (*run_test)(struct omap_display *display, int test);
+- int (*memory_read)(struct omap_display *display,
+- void *buf, size_t size,
+- u16 x, u16 y, u16 w, u16 h);
+-
+- u8 pixel_size;
+-
+- struct rfbi_timings timings;
+-
+- void *priv;
+ };
+
+ struct omap_video_timings {
+@@ -301,7 +242,6 @@ struct omap_video_timings {
+ u16 vfp; /* Vertical front porch */
+ /* Unit: line clocks */
+ u16 vbp; /* Vertical back porch */
+-
+ };
+
+ #ifdef CONFIG_OMAP2_DSS_VENC
+@@ -313,46 +253,6 @@ const extern struct omap_video_timings omap_dss_pal_timings;
+ const extern struct omap_video_timings omap_dss_ntsc_timings;
+ #endif
+
+-struct omap_panel {
+- struct module *owner;
+-
+- const char *name;
+-
+- int (*init)(struct omap_display *display);
+- void (*cleanup)(struct omap_display *display);
+- int (*remove)(struct omap_display *display);
+- int (*enable)(struct omap_display *display);
+- void (*disable)(struct omap_display *display);
+- int (*suspend)(struct omap_display *display);
+- int (*resume)(struct omap_display *display);
+- int (*run_test)(struct omap_display *display, int test);
+-
+- struct omap_video_timings timings;
+-
+- int acbi; /* ac-bias pin transitions per interrupt */
+- /* Unit: line clocks */
+- int acb; /* ac-bias pin frequency */
+-
+- enum omap_panel_config config;
+-
+- u8 recommended_bpp;
+-
+- void *priv;
+-};
+-
+-/* XXX perhaps this should be removed */
+-enum omap_dss_overlay_managers {
+- OMAP_DSS_OVL_MGR_LCD,
+- OMAP_DSS_OVL_MGR_TV,
+-};
+-
+-struct omap_overlay_manager;
+-
+-enum omap_dss_rotation_type {
+- OMAP_DSS_ROT_DMA = 0,
+- OMAP_DSS_ROT_VRFB = 1,
+-};
+-
+ struct omap_overlay_info {
+ bool enabled;
+
+@@ -373,11 +273,6 @@ struct omap_overlay_info {
+ u8 global_alpha;
+ };
+
+-enum omap_overlay_caps {
+- OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
+- OMAP_DSS_OVL_CAP_DISPC = 1 << 1,
+-};
+-
+ struct omap_overlay {
+ struct kobject kobj;
+ struct list_head list;
+@@ -399,10 +294,6 @@ struct omap_overlay {
+ struct omap_overlay_info *info);
+ };
+
+-enum omap_overlay_manager_caps {
+- OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0,
+-};
+-
+ struct omap_overlay_manager {
+ struct kobject kobj;
+ struct list_head list;
+@@ -410,14 +301,14 @@ struct omap_overlay_manager {
+ const char *name;
+ int id;
+ enum omap_overlay_manager_caps caps;
+- struct omap_display *display;
++ struct omap_dss_device *device;
+ int num_overlays;
+ struct omap_overlay **overlays;
+ enum omap_display_type supported_displays;
+
+- int (*set_display)(struct omap_overlay_manager *mgr,
+- struct omap_display *display);
+- int (*unset_display)(struct omap_overlay_manager *mgr);
++ int (*set_device)(struct omap_overlay_manager *mgr,
++ struct omap_dss_device *dssdev);
++ int (*unset_device)(struct omap_overlay_manager *mgr);
+
+ int (*apply)(struct omap_overlay_manager *mgr);
+
+@@ -437,99 +328,183 @@ struct omap_overlay_manager {
+ bool enable);
+ };
+
+-enum omap_display_caps {
+- OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0,
+-};
++struct omap_dss_device {
++ struct device dev;
+
+-enum omap_dss_update_mode {
+- OMAP_DSS_UPDATE_DISABLED = 0,
+- OMAP_DSS_UPDATE_AUTO,
+- OMAP_DSS_UPDATE_MANUAL,
+-};
++ enum omap_display_type type;
+
+-enum omap_dss_display_state {
+- OMAP_DSS_DISPLAY_DISABLED = 0,
+- OMAP_DSS_DISPLAY_ACTIVE,
+- OMAP_DSS_DISPLAY_SUSPENDED,
+-};
++ union {
++ struct {
++ u8 data_lines;
++ } dpi;
+
+-struct omap_display {
+- struct kobject kobj;
+- struct list_head list;
++ struct {
++ u8 channel;
++ u8 data_lines;
++ } rfbi;
+
+- /*atomic_t ref_count;*/
+- int ref_count;
+- /* helper variable for driver suspend/resume */
+- int activate_after_resume;
++ struct {
++ u8 datapairs;
++ } sdi;
++
++ struct {
++ u8 clk_lane;
++ u8 clk_pol;
++ u8 data1_lane;
++ u8 data1_pol;
++ u8 data2_lane;
++ u8 data2_pol;
++ unsigned long lp_clk_hz;
++ unsigned long ddr_clk_hz;
++
++ bool ext_te;
++ u8 ext_te_gpio;
++ } dsi;
++
++ struct {
++ enum omap_dss_venc_type type;
++ } venc;
++ } phy;
++
++ struct {
++ struct omap_video_timings timings;
++
++ int acbi; /* ac-bias pin transitions per interrupt */
++ /* Unit: line clocks */
++ int acb; /* ac-bias pin frequency */
++
++ enum omap_panel_config config;
++
++ u8 recommended_bpp;
++
++ struct omap_dss_device *ctrl;
++ } panel;
++
++ struct {
++ u8 pixel_size;
++ struct rfbi_timings rfbi_timings;
++ struct omap_dss_device *panel;
++ } ctrl;
++
++ int reset_gpio;
++
++ int max_backlight_level;
+
+- enum omap_display_type type;
+ const char *name;
+
++ /* used to match device to driver */
++ const char *driver_name;
++
++ void *data;
++
++ struct omap_dss_driver *driver;
++
++ /* helper variable for driver suspend/resume */
++ bool activate_after_resume;
++
+ enum omap_display_caps caps;
+
+ struct omap_overlay_manager *manager;
+
+ enum omap_dss_display_state state;
+
+- struct omap_dss_display_config hw_config; /* board specific data */
+- struct omap_ctrl *ctrl; /* static common data */
+- struct omap_panel *panel; /* static common data */
+-
+- int (*enable)(struct omap_display *display);
+- void (*disable)(struct omap_display *display);
++ int (*enable)(struct omap_dss_device *dssdev);
++ void (*disable)(struct omap_dss_device *dssdev);
+
+- int (*suspend)(struct omap_display *display);
+- int (*resume)(struct omap_display *display);
++ int (*suspend)(struct omap_dss_device *dssdev);
++ int (*resume)(struct omap_dss_device *dssdev);
+
+- void (*get_resolution)(struct omap_display *display,
++ void (*get_resolution)(struct omap_dss_device *dssdev,
+ u16 *xres, u16 *yres);
+- int (*get_recommended_bpp)(struct omap_display *display);
++ int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
+
+- int (*check_timings)(struct omap_display *display,
++ int (*check_timings)(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+- void (*set_timings)(struct omap_display *display,
++ void (*set_timings)(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+- void (*get_timings)(struct omap_display *display,
++ void (*get_timings)(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+- int (*update)(struct omap_display *display,
++ int (*update)(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h);
+- int (*sync)(struct omap_display *display);
+- int (*wait_vsync)(struct omap_display *display);
++ int (*sync)(struct omap_dss_device *dssdev);
++ int (*wait_vsync)(struct omap_dss_device *dssdev);
+
+- int (*set_update_mode)(struct omap_display *display,
++ int (*set_update_mode)(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode);
+ enum omap_dss_update_mode (*get_update_mode)
+- (struct omap_display *display);
++ (struct omap_dss_device *dssdev);
+
+- int (*enable_te)(struct omap_display *display, bool enable);
+- int (*get_te)(struct omap_display *display);
++ int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
++ int (*get_te)(struct omap_dss_device *dssdev);
++ int (*wait_for_te)(struct omap_dss_device *dssdev);
+
+- u8 (*get_rotate)(struct omap_display *display);
+- int (*set_rotate)(struct omap_display *display, u8 rotate);
++ u8 (*get_rotate)(struct omap_dss_device *dssdev);
++ int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
+
+- bool (*get_mirror)(struct omap_display *display);
+- int (*set_mirror)(struct omap_display *display, bool enable);
++ bool (*get_mirror)(struct omap_dss_device *dssdev);
++ int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
+
+- int (*run_test)(struct omap_display *display, int test);
+- int (*memory_read)(struct omap_display *display,
++ int (*run_test)(struct omap_dss_device *dssdev, int test);
++ int (*memory_read)(struct omap_dss_device *dssdev,
+ void *buf, size_t size,
+ u16 x, u16 y, u16 w, u16 h);
+
+ void (*configure_overlay)(struct omap_overlay *overlay);
+
+- int (*set_wss)(struct omap_display *display, u32 wss);
+- u32 (*get_wss)(struct omap_display *display);
++ int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
++ u32 (*get_wss)(struct omap_dss_device *dssdev);
++
++ /* platform specific */
++ int (*platform_enable)(struct omap_dss_device *dssdev);
++ void (*platform_disable)(struct omap_dss_device *dssdev);
++ int (*set_backlight)(struct omap_dss_device *dssdev, int level);
++ int (*get_backlight)(struct omap_dss_device *dssdev);
+ };
+
+-int omap_dss_get_num_displays(void);
+-struct omap_display *omap_dss_get_display(int no);
+-void omap_dss_put_display(struct omap_display *display);
++struct omap_dss_driver {
++ struct device_driver driver;
++
++ int (*probe)(struct omap_dss_device *);
++ void (*remove)(struct omap_dss_device *);
+
+-void omap_dss_register_ctrl(struct omap_ctrl *ctrl);
+-void omap_dss_unregister_ctrl(struct omap_ctrl *ctrl);
++ int (*enable)(struct omap_dss_device *display);
++ void (*disable)(struct omap_dss_device *display);
++ int (*suspend)(struct omap_dss_device *display);
++ int (*resume)(struct omap_dss_device *display);
++ int (*run_test)(struct omap_dss_device *display, int test);
+
+-void omap_dss_register_panel(struct omap_panel *panel);
+-void omap_dss_unregister_panel(struct omap_panel *panel);
++ void (*setup_update)(struct omap_dss_device *dssdev,
++ u16 x, u16 y, u16 w, u16 h);
++
++ int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
++ int (*wait_for_te)(struct omap_dss_device *dssdev);
++
++ u8 (*get_rotate)(struct omap_dss_device *dssdev);
++ int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
++
++ bool (*get_mirror)(struct omap_dss_device *dssdev);
++ int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
++
++ int (*memory_read)(struct omap_dss_device *dssdev,
++ void *buf, size_t size,
++ u16 x, u16 y, u16 w, u16 h);
++};
++
++int omap_dss_register_driver(struct omap_dss_driver *);
++void omap_dss_unregister_driver(struct omap_dss_driver *);
++
++int omap_dss_register_device(struct omap_dss_device *);
++void omap_dss_unregister_device(struct omap_dss_device *);
++
++void omap_dss_get_device(struct omap_dss_device *dssdev);
++void omap_dss_put_device(struct omap_dss_device *dssdev);
++#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
++struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
++struct omap_dss_device *omap_dss_find_device(void *data,
++ int (*match)(struct omap_dss_device *dssdev, void *data));
++
++int omap_dss_start_device(struct omap_dss_device *dssdev);
++void omap_dss_stop_device(struct omap_dss_device *dssdev);
+
+ int omap_dss_get_num_overlay_managers(void);
+ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
+@@ -544,5 +519,4 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
+ int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
+ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
+ unsigned long timeout);
+-
+ #endif
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index 2a38507..c56c431 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -30,6 +30,7 @@
+ #include <linux/seq_file.h>
+ #include <linux/debugfs.h>
+ #include <linux/io.h>
++#include <linux/device.h>
+
+ #include <mach/display.h>
+ #include <mach/clock.h>
+@@ -437,11 +438,16 @@ void dss_dsi_power_down(void)
+ /* PLATFORM DEVICE */
+ static int omap_dss_probe(struct platform_device *pdev)
+ {
++ struct omap_dss_board_info *pdata = pdev->dev.platform_data;
+ int skip_init = 0;
+ int r;
++ int i;
+
+ core.pdev = pdev;
+
++ dss_init_overlay_managers(pdev);
++ dss_init_overlays(pdev);
++
+ r = dss_get_clocks();
+ if (r)
+ goto fail0;
+@@ -483,7 +489,7 @@ static int omap_dss_probe(struct platform_device *pdev)
+ goto fail0;
+ }
+ #ifdef CONFIG_OMAP2_DSS_VENC
+- r = venc_init();
++ r = venc_init(pdev);
+ if (r) {
+ DSSERR("Failed to initialize venc\n");
+ goto fail0;
+@@ -498,7 +504,7 @@ static int omap_dss_probe(struct platform_device *pdev)
+ }
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_DSI
+- r = dsi_init();
++ r = dsi_init(pdev);
+ if (r) {
+ DSSERR("Failed to initialize DSI\n");
+ goto fail0;
+@@ -512,9 +518,16 @@ static int omap_dss_probe(struct platform_device *pdev)
+ goto fail0;
+ #endif
+
+- dss_init_displays(pdev);
+- dss_init_overlay_managers(pdev);
+- dss_init_overlays(pdev, def_disp_name);
++ for (i = 0; i < pdata->num_devices; ++i) {
++ struct omap_dss_device *dssdev = pdata->devices[i];
++
++ r = omap_dss_register_device(dssdev);
++ if (r)
++ DSSERR("device reg failed %d\n", i);
++
++ if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
++ pdata->default_device = dssdev;
++ }
+
+ dss_clk_disable_all();
+
+@@ -527,12 +540,10 @@ fail0:
+
+ static int omap_dss_remove(struct platform_device *pdev)
+ {
++ struct omap_dss_board_info *pdata = pdev->dev.platform_data;
++ int i;
+ int c;
+
+- dss_uninit_overlays(pdev);
+- dss_uninit_overlay_managers(pdev);
+- dss_uninit_displays(pdev);
+-
+ #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
+ dss_uninitialize_debugfs();
+ #endif
+@@ -597,6 +608,12 @@ static int omap_dss_remove(struct platform_device *pdev)
+
+ dss_put_clocks();
+
++ dss_uninit_overlays(pdev);
++ dss_uninit_overlay_managers(pdev);
++
++ for (i = 0; i < pdata->num_devices; ++i)
++ omap_dss_unregister_device(pdata->devices[i]);
++
+ return 0;
+ }
+
+@@ -609,14 +626,14 @@ static int omap_dss_suspend(struct platform_device *pdev, pm_message_t state)
+ {
+ DSSDBG("suspend %d\n", state.event);
+
+- return dss_suspend_all_displays();
++ return dss_suspend_all_devices();
+ }
+
+ static int omap_dss_resume(struct platform_device *pdev)
+ {
+ DSSDBG("resume\n");
+
+- return dss_resume_all_displays();
++ return dss_resume_all_devices();
+ }
+
+ static struct platform_driver omap_dss_driver = {
+@@ -631,19 +648,282 @@ static struct platform_driver omap_dss_driver = {
+ },
+ };
+
++/* BUS */
++static int dss_bus_match(struct device *dev, struct device_driver *driver)
++{
++ struct omap_dss_device *dssdev = to_dss_device(dev);
++
++ DSSDBG("bus_match. dev %s/%s, drv %s\n",
++ dev_name(dev), dssdev->driver_name, driver->name);
++
++ return strcmp(dssdev->driver_name, driver->name) == 0;
++}
++
++static ssize_t device_name_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct omap_dss_device *dssdev = to_dss_device(dev);
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ dssdev->name ?
++ dssdev->name : "");
++}
++
++static struct device_attribute default_dev_attrs[] = {
++ __ATTR(name, S_IRUGO, device_name_show, NULL),
++ __ATTR_NULL,
++};
++
++static ssize_t driver_name_show(struct device_driver *drv, char *buf)
++{
++ struct omap_dss_driver *dssdrv = to_dss_driver(drv);
++ return snprintf(buf, PAGE_SIZE, "%s\n",
++ dssdrv->driver.name ?
++ dssdrv->driver.name : "");
++}
++static struct driver_attribute default_drv_attrs[] = {
++ __ATTR(name, S_IRUGO, driver_name_show, NULL),
++ __ATTR_NULL,
++};
++
++static struct bus_type dss_bus_type = {
++ .name = "omapdss",
++ .match = dss_bus_match,
++ .dev_attrs = default_dev_attrs,
++ .drv_attrs = default_drv_attrs,
++};
++
++static void dss_bus_release(struct device *dev)
++{
++ DSSDBG("bus_release\n");
++}
++
++static struct device dss_bus = {
++ .release = dss_bus_release,
++};
++
++struct bus_type *dss_get_bus(void)
++{
++ return &dss_bus_type;
++}
++
++/* DRIVER */
++static int dss_driver_probe(struct device *dev)
++{
++ int r;
++ struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver);
++ struct omap_dss_device *dssdev = to_dss_device(dev);
++ struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
++ bool force;
++
++ DSSDBG("driver_probe: dev %s/%s, drv %s\n",
++ dev_name(dev), dssdev->driver_name,
++ dssdrv->driver.name);
++
++ dss_init_device(core.pdev, dssdev);
++
++ /* skip this if the device is behind a ctrl */
++ if (!dssdev->panel.ctrl) {
++ force = pdata->default_device == dssdev;
++ dss_recheck_connections(dssdev, force);
++ }
++
++ r = dssdrv->probe(dssdev);
++
++ if (r) {
++ DSSERR("driver probe failed: %d\n", r);
++ return r;
++ }
++
++ DSSDBG("probe done for device %s\n", dev_name(dev));
++
++ dssdev->driver = dssdrv;
++
++ return 0;
++}
++
++static int dss_driver_remove(struct device *dev)
++{
++ struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver);
++ struct omap_dss_device *dssdev = to_dss_device(dev);
++
++ DSSDBG("driver_remove: dev %s/%s\n", dev_name(dev),
++ dssdev->driver_name);
++
++ dssdrv->remove(dssdev);
++
++ dss_uninit_device(core.pdev, dssdev);
++
++ dssdev->driver = NULL;
++
++ return 0;
++}
++
++int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
++{
++ dssdriver->driver.bus = &dss_bus_type;
++ dssdriver->driver.probe = dss_driver_probe;
++ dssdriver->driver.remove = dss_driver_remove;
++ return driver_register(&dssdriver->driver);
++}
++EXPORT_SYMBOL(omap_dss_register_driver);
++
++void omap_dss_unregister_driver(struct omap_dss_driver *dssdriver)
++{
++ driver_unregister(&dssdriver->driver);
++}
++EXPORT_SYMBOL(omap_dss_unregister_driver);
++
++/* DEVICE */
++static void reset_device(struct device *dev, int check)
++{
++ u8 *dev_p = (u8 *)dev;
++ u8 *dev_end = dev_p + sizeof(*dev);
++ void *saved_pdata;
++
++ saved_pdata = dev->platform_data;
++ if (check) {
++ /*
++ * Check if there is any other setting than platform_data
++ * in struct device; warn that these will be reset by our
++ * init.
++ */
++ dev->platform_data = NULL;
++ while (dev_p < dev_end) {
++ if (*dev_p) {
++ WARN("%s: struct device fields will be discarded\n",
++ __func__);
++ break;
++ }
++ dev_p++;
++ }
++ }
++ memset(dev, 0, sizeof(*dev));
++ dev->platform_data = saved_pdata;
++}
++
++
++static void omap_dss_dev_release(struct device *dev)
++{
++ reset_device(dev, 0);
++}
++
++int omap_dss_register_device(struct omap_dss_device *dssdev)
++{
++ static int dev_num;
++ static int panel_num;
++ int r;
++
++ WARN_ON(!dssdev->driver_name);
++
++ reset_device(&dssdev->dev, 1);
++ dssdev->dev.bus = &dss_bus_type;
++ dssdev->dev.parent = &dss_bus;
++ dssdev->dev.release = omap_dss_dev_release;
++ dev_set_name(&dssdev->dev, "display%d", dev_num++);
++ r = device_register(&dssdev->dev);
++ if (r)
++ return r;
++
++ if (dssdev->ctrl.panel) {
++ struct omap_dss_device *panel = dssdev->ctrl.panel;
++
++ panel->panel.ctrl = dssdev;
++
++ reset_device(&panel->dev, 1);
++ panel->dev.bus = &dss_bus_type;
++ panel->dev.parent = &dssdev->dev;
++ panel->dev.release = omap_dss_dev_release;
++ dev_set_name(&panel->dev, "panel%d", panel_num++);
++ r = device_register(&panel->dev);
++ if (r)
++ return r;
++ }
++
++ return 0;
++}
++
++void omap_dss_unregister_device(struct omap_dss_device *dssdev)
++{
++ device_unregister(&dssdev->dev);
++
++ if (dssdev->ctrl.panel) {
++ struct omap_dss_device *panel = dssdev->ctrl.panel;
++ device_unregister(&panel->dev);
++ }
++}
++
++/* BUS */
++static int omap_dss_bus_register(void)
++{
++ int r;
++
++ r = bus_register(&dss_bus_type);
++ if (r) {
++ DSSERR("bus register failed\n");
++ return r;
++ }
++
++ dev_set_name(&dss_bus, "omapdss");
++ r = device_register(&dss_bus);
++ if (r) {
++ DSSERR("bus driver register failed\n");
++ bus_unregister(&dss_bus_type);
++ return r;
++ }
++
++ return 0;
++}
++
++/* INIT */
++
++#ifdef CONFIG_OMAP2_DSS_MODULE
++static void omap_dss_bus_unregister(void)
++{
++ device_unregister(&dss_bus);
++
++ bus_unregister(&dss_bus_type);
++}
++
+ static int __init omap_dss_init(void)
+ {
+- return platform_driver_register(&omap_dss_driver);
++ int r;
++
++ r = omap_dss_bus_register();
++ if (r)
++ return r;
++
++ r = platform_driver_register(&omap_dss_driver);
++ if (r) {
++ omap_dss_bus_unregister();
++ return r;
++ }
++
++ return 0;
+ }
+
+ static void __exit omap_dss_exit(void)
+ {
+ platform_driver_unregister(&omap_dss_driver);
++
++ omap_dss_bus_unregister();
+ }
+
+-subsys_initcall(omap_dss_init);
++module_init(omap_dss_init);
+ module_exit(omap_dss_exit);
++#else
++static int __init omap_dss_init(void)
++{
++ return omap_dss_bus_register();
++}
++
++static int __init omap_dss_init2(void)
++{
++ return platform_driver_register(&omap_dss_driver);
++}
+
++core_initcall(omap_dss_init);
++device_initcall(omap_dss_init2);
++#endif
+
+ MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
+ MODULE_DESCRIPTION("OMAP2/3 Display Subsystem");
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index e936c59..52170f8 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2319,15 +2319,15 @@ static void _dispc_set_pol_freq(bool onoff, bool rf, bool ieo, bool ipc,
+ enable_clocks(0);
+ }
+
+-void dispc_set_pol_freq(struct omap_panel *panel)
++void dispc_set_pol_freq(enum omap_panel_config config, u8 acbi, u8 acb)
+ {
+- _dispc_set_pol_freq((panel->config & OMAP_DSS_LCD_ONOFF) != 0,
+- (panel->config & OMAP_DSS_LCD_RF) != 0,
+- (panel->config & OMAP_DSS_LCD_IEO) != 0,
+- (panel->config & OMAP_DSS_LCD_IPC) != 0,
+- (panel->config & OMAP_DSS_LCD_IHS) != 0,
+- (panel->config & OMAP_DSS_LCD_IVS) != 0,
+- panel->acbi, panel->acb);
++ _dispc_set_pol_freq((config & OMAP_DSS_LCD_ONOFF) != 0,
++ (config & OMAP_DSS_LCD_RF) != 0,
++ (config & OMAP_DSS_LCD_IEO) != 0,
++ (config & OMAP_DSS_LCD_IPC) != 0,
++ (config & OMAP_DSS_LCD_IHS) != 0,
++ (config & OMAP_DSS_LCD_IVS) != 0,
++ acbi, acb);
+ }
+
+ void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+@@ -2790,9 +2790,9 @@ static void dispc_error_worker(struct work_struct *work)
+
+ if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
+ manager = mgr;
+- enable = mgr->display->state ==
++ enable = mgr->device->state ==
+ OMAP_DSS_DISPLAY_ACTIVE;
+- mgr->display->disable(mgr->display);
++ mgr->device->disable(mgr->device);
+ break;
+ }
+ }
+@@ -2812,7 +2812,7 @@ static void dispc_error_worker(struct work_struct *work)
+ dispc_go(manager->id);
+ mdelay(50);
+ if (enable)
+- manager->display->enable(manager->display);
++ manager->device->enable(manager->device);
+ }
+ }
+
+@@ -2828,9 +2828,9 @@ static void dispc_error_worker(struct work_struct *work)
+
+ if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
+ manager = mgr;
+- enable = mgr->display->state ==
++ enable = mgr->device->state ==
+ OMAP_DSS_DISPLAY_ACTIVE;
+- mgr->display->disable(mgr->display);
++ mgr->device->disable(mgr->device);
+ break;
+ }
+ }
+@@ -2850,7 +2850,7 @@ static void dispc_error_worker(struct work_struct *work)
+ dispc_go(manager->id);
+ mdelay(50);
+ if (enable)
+- manager->display->enable(manager->display);
++ manager->device->enable(manager->device);
+ }
+ }
+
+@@ -2861,7 +2861,7 @@ static void dispc_error_worker(struct work_struct *work)
+ mgr = omap_dss_get_overlay_manager(i);
+
+ if (mgr->caps & OMAP_DSS_OVL_CAP_DISPC)
+- mgr->display->disable(mgr->display);
++ mgr->device->disable(mgr->device);
+ }
+ }
+
+@@ -3126,7 +3126,7 @@ static int dispc_is_overlay_scaled(struct omap_overlay_info *pi)
+ }
+
+ /* returns the area that needs updating */
+-void dispc_setup_partial_planes(struct omap_display *display,
++void dispc_setup_partial_planes(struct omap_dss_device *dssdev,
+ u16 *xi, u16 *yi, u16 *wi, u16 *hi)
+ {
+ struct omap_overlay_manager *mgr;
+@@ -3143,7 +3143,7 @@ void dispc_setup_partial_planes(struct omap_display *display,
+ *xi, *yi, *wi, *hi);
+
+
+- mgr = display->manager;
++ mgr = dssdev->manager;
+
+ if (!mgr) {
+ DSSDBG("no manager\n");
+@@ -3307,7 +3307,7 @@ void dispc_setup_partial_planes(struct omap_display *display,
+ pi->mirror,
+ pi->global_alpha);
+
+- if (dss_use_replication(display, ovl->info.color_mode))
++ if (dss_use_replication(dssdev, ovl->info.color_mode))
+ dispc_enable_replication(ovl->id, true);
+ else
+ dispc_enable_replication(ovl->id, false);
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 77a6dc4..2251bff 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -31,52 +31,54 @@
+ #include <mach/display.h>
+ #include "dss.h"
+
+-static int num_displays;
+ static LIST_HEAD(display_list);
+
+-static ssize_t display_name_show(struct omap_display *display, char *buf)
++static ssize_t display_enabled_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+- return snprintf(buf, PAGE_SIZE, "%s\n", display->name);
+-}
+-
+-static ssize_t display_enabled_show(struct omap_display *display, char *buf)
+-{
+- bool enabled = display->state != OMAP_DSS_DISPLAY_DISABLED;
++ struct omap_dss_device *dssdev = to_dss_device(dev);
++ bool enabled = dssdev->state != OMAP_DSS_DISPLAY_DISABLED;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", enabled);
+ }
+
+-static ssize_t display_enabled_store(struct omap_display *display,
++static ssize_t display_enabled_store(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ bool enabled, r;
+
+ enabled = simple_strtoul(buf, NULL, 10);
+
+- if (enabled != (display->state != OMAP_DSS_DISPLAY_DISABLED)) {
++ if (enabled != (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)) {
+ if (enabled) {
+- r = display->enable(display);
++ r = dssdev->enable(dssdev);
+ if (r)
+ return r;
+ } else {
+- display->disable(display);
++ dssdev->disable(dssdev);
+ }
+ }
+
+ return size;
+ }
+
+-static ssize_t display_upd_mode_show(struct omap_display *display, char *buf)
++static ssize_t display_upd_mode_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO;
+- if (display->get_update_mode)
+- mode = display->get_update_mode(display);
++ if (dssdev->get_update_mode)
++ mode = dssdev->get_update_mode(dssdev);
+ return snprintf(buf, PAGE_SIZE, "%d\n", mode);
+ }
+
+-static ssize_t display_upd_mode_store(struct omap_display *display,
++static ssize_t display_upd_mode_store(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ int val, r;
+ enum omap_dss_update_mode mode;
+
+@@ -92,43 +94,48 @@ static ssize_t display_upd_mode_store(struct omap_display *display,
+ return -EINVAL;
+ }
+
+- if ((r = display->set_update_mode(display, mode)))
++ if ((r = dssdev->set_update_mode(dssdev, mode)))
+ return r;
+
+ return size;
+ }
+
+-static ssize_t display_tear_show(struct omap_display *display, char *buf)
++static ssize_t display_tear_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+- display->get_te ? display->get_te(display) : 0);
++ dssdev->get_te ? dssdev->get_te(dssdev) : 0);
+ }
+
+-static ssize_t display_tear_store(struct omap_display *display,
+- const char *buf, size_t size)
++static ssize_t display_tear_store(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ unsigned long te;
+ int r;
+
+- if (!display->enable_te || !display->get_te)
++ if (!dssdev->enable_te || !dssdev->get_te)
+ return -ENOENT;
+
+ te = simple_strtoul(buf, NULL, 0);
+
+- if ((r = display->enable_te(display, te)))
++ if ((r = dssdev->enable_te(dssdev, te)))
+ return r;
+
+ return size;
+ }
+
+-static ssize_t display_timings_show(struct omap_display *display, char *buf)
++static ssize_t display_timings_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_video_timings t;
+
+- if (!display->get_timings)
++ if (!dssdev->get_timings)
+ return -ENOENT;
+
+- display->get_timings(display, &t);
++ dssdev->get_timings(dssdev, &t);
+
+ return snprintf(buf, PAGE_SIZE, "%u,%u/%u/%u/%u,%u/%u/%u/%u\n",
+ t.pixel_clock,
+@@ -136,13 +143,14 @@ static ssize_t display_timings_show(struct omap_display *display, char *buf)
+ t.y_res, t.vfp, t.vbp, t.vsw);
+ }
+
+-static ssize_t display_timings_store(struct omap_display *display,
+- const char *buf, size_t size)
++static ssize_t display_timings_store(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ struct omap_video_timings t;
+ int r, found;
+
+- if (!display->set_timings || !display->check_timings)
++ if (!dssdev->set_timings || !dssdev->check_timings)
+ return -ENOENT;
+
+ found = 0;
+@@ -161,103 +169,94 @@ static ssize_t display_timings_store(struct omap_display *display,
+ &t.y_res, &t.vfp, &t.vbp, &t.vsw) != 9)
+ return -EINVAL;
+
+- if ((r = display->check_timings(display, &t)))
++ if ((r = dssdev->check_timings(dssdev, &t)))
+ return r;
+
+- display->set_timings(display, &t);
++ dssdev->set_timings(dssdev, &t);
+
+ return size;
+ }
+
+-static ssize_t display_rotate_show(struct omap_display *display, char *buf)
++static ssize_t display_rotate_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ int rotate;
+- if (!display->get_rotate)
++ if (!dssdev->get_rotate)
+ return -ENOENT;
+- rotate = display->get_rotate(display);
++ rotate = dssdev->get_rotate(dssdev);
+ return snprintf(buf, PAGE_SIZE, "%u\n", rotate);
+ }
+
+-static ssize_t display_rotate_store(struct omap_display *display,
+- const char *buf, size_t size)
++static ssize_t display_rotate_store(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ unsigned long rot;
+ int r;
+
+- if (!display->set_rotate || !display->get_rotate)
++ if (!dssdev->set_rotate || !dssdev->get_rotate)
+ return -ENOENT;
+
+ rot = simple_strtoul(buf, NULL, 0);
+
+- if ((r = display->set_rotate(display, rot)))
++ if ((r = dssdev->set_rotate(dssdev, rot)))
+ return r;
+
+ return size;
+ }
+
+-static ssize_t display_mirror_show(struct omap_display *display, char *buf)
++static ssize_t display_mirror_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ int mirror;
+- if (!display->get_mirror)
++ if (!dssdev->get_mirror)
+ return -ENOENT;
+- mirror = display->get_mirror(display);
++ mirror = dssdev->get_mirror(dssdev);
+ return snprintf(buf, PAGE_SIZE, "%u\n", mirror);
+ }
+
+-static ssize_t display_mirror_store(struct omap_display *display,
+- const char *buf, size_t size)
++static ssize_t display_mirror_store(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ unsigned long mirror;
+ int r;
+
+- if (!display->set_mirror || !display->get_mirror)
++ if (!dssdev->set_mirror || !dssdev->get_mirror)
+ return -ENOENT;
+
+ mirror = simple_strtoul(buf, NULL, 0);
+
+- if ((r = display->set_mirror(display, mirror)))
++ if ((r = dssdev->set_mirror(dssdev, mirror)))
+ return r;
+
+ return size;
+ }
+
+-static ssize_t display_panel_name_show(struct omap_display *display, char *buf)
+-{
+- return snprintf(buf, PAGE_SIZE, "%s\n",
+- display->panel ? display->panel->name : "");
+-}
+-
+-static ssize_t display_ctrl_name_show(struct omap_display *display, char *buf)
+-{
+- return snprintf(buf, PAGE_SIZE, "%s\n",
+- display->ctrl ? display->ctrl->name : "");
+-}
+-
+-struct display_attribute {
+- struct attribute attr;
+- ssize_t (*show)(struct omap_display *, char *);
+- ssize_t (*store)(struct omap_display *, const char *, size_t);
+-};
+-
+-static ssize_t display_wss_show(struct omap_display *display, char *buf)
++static ssize_t display_wss_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ unsigned int wss;
+
+- if (!display->get_wss)
++ if (!dssdev->get_wss)
+ return -ENOENT;
+
+- wss = display->get_wss(display);
++ wss = dssdev->get_wss(dssdev);
+
+ return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss);
+ }
+
+-static ssize_t display_wss_store(struct omap_display *display,
+- const char *buf, size_t size)
++static ssize_t display_wss_store(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t size)
+ {
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+ unsigned long wss;
+ int r;
+
+- if (!display->get_wss || !display->set_wss)
++ if (!dssdev->get_wss || !dssdev->set_wss)
+ return -ENOENT;
+
+ if (strict_strtoul(buf, 0, &wss))
+@@ -266,92 +265,43 @@ static ssize_t display_wss_store(struct omap_display *display,
+ if (wss > 0xfffff)
+ return -EINVAL;
+
+- if ((r = display->set_wss(display, wss)))
++ if ((r = dssdev->set_wss(dssdev, wss)))
+ return r;
+
+ return size;
+ }
+
+-#define DISPLAY_ATTR(_name, _mode, _show, _store) \
+- struct display_attribute display_attr_##_name = \
+- __ATTR(_name, _mode, _show, _store)
+-
+-static DISPLAY_ATTR(name, S_IRUGO, display_name_show, NULL);
+-static DISPLAY_ATTR(enabled, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
+ display_enabled_show, display_enabled_store);
+-static DISPLAY_ATTR(update_mode, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR,
+ display_upd_mode_show, display_upd_mode_store);
+-static DISPLAY_ATTR(tear_elim, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(tear_elim, S_IRUGO|S_IWUSR,
+ display_tear_show, display_tear_store);
+-static DISPLAY_ATTR(timings, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(timings, S_IRUGO|S_IWUSR,
+ display_timings_show, display_timings_store);
+-static DISPLAY_ATTR(rotate, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(rotate, S_IRUGO|S_IWUSR,
+ display_rotate_show, display_rotate_store);
+-static DISPLAY_ATTR(mirror, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(mirror, S_IRUGO|S_IWUSR,
+ display_mirror_show, display_mirror_store);
+-static DISPLAY_ATTR(panel_name, S_IRUGO, display_panel_name_show, NULL);
+-static DISPLAY_ATTR(ctrl_name, S_IRUGO, display_ctrl_name_show, NULL);
+-static DISPLAY_ATTR(wss, S_IRUGO|S_IWUSR,
++static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
+ display_wss_show, display_wss_store);
+
+-static struct attribute *display_sysfs_attrs[] = {
+- &display_attr_name.attr,
+- &display_attr_enabled.attr,
+- &display_attr_update_mode.attr,
+- &display_attr_tear_elim.attr,
+- &display_attr_timings.attr,
+- &display_attr_rotate.attr,
+- &display_attr_mirror.attr,
+- &display_attr_panel_name.attr,
+- &display_attr_ctrl_name.attr,
+- &display_attr_wss.attr,
++static struct device_attribute *display_sysfs_attrs[] = {
++ &dev_attr_enabled,
++ &dev_attr_update_mode,
++ &dev_attr_tear_elim,
++ &dev_attr_timings,
++ &dev_attr_rotate,
++ &dev_attr_mirror,
++ &dev_attr_wss,
+ NULL
+ };
+
+-static ssize_t display_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
+-{
+- struct omap_display *display;
+- struct display_attribute *display_attr;
+-
+- display = container_of(kobj, struct omap_display, kobj);
+- display_attr = container_of(attr, struct display_attribute, attr);
+-
+- if (!display_attr->show)
+- return -ENOENT;
+-
+- return display_attr->show(display, buf);
+-}
+-
+-static ssize_t display_attr_store(struct kobject *kobj, struct attribute *attr,
+- const char *buf, size_t size)
+-{
+- struct omap_display *display;
+- struct display_attribute *display_attr;
+-
+- display = container_of(kobj, struct omap_display, kobj);
+- display_attr = container_of(attr, struct display_attribute, attr);
+-
+- if (!display_attr->store)
+- return -ENOENT;
+-
+- return display_attr->store(display, buf, size);
+-}
+-
+-static struct sysfs_ops display_sysfs_ops = {
+- .show = display_attr_show,
+- .store = display_attr_store,
+-};
+-
+-static struct kobj_type display_ktype = {
+- .sysfs_ops = &display_sysfs_ops,
+- .default_attrs = display_sysfs_attrs,
+-};
+-
+-static void default_get_resolution(struct omap_display *display,
++static void default_get_resolution(struct omap_dss_device *dssdev,
+ u16 *xres, u16 *yres)
+ {
+- *xres = display->panel->timings.x_res;
+- *yres = display->panel->timings.y_res;
++ *xres = dssdev->panel.timings.x_res;
++ *yres = dssdev->panel.timings.y_res;
+ }
+
+ static void default_configure_overlay(struct omap_overlay *ovl)
+@@ -371,12 +321,12 @@ static void default_configure_overlay(struct omap_overlay *ovl)
+ dispc_setup_plane_fifo(plane, low, high);
+ }
+
+-static int default_wait_vsync(struct omap_display *display)
++static int default_wait_vsync(struct omap_dss_device *dssdev)
+ {
+ unsigned long timeout = msecs_to_jiffies(500);
+ u32 irq;
+
+- if (display->type == OMAP_DISPLAY_TYPE_VENC)
++ if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
+ irq = DISPC_IRQ_EVSYNC_ODD;
+ else
+ irq = DISPC_IRQ_VSYNC;
+@@ -384,21 +334,21 @@ static int default_wait_vsync(struct omap_display *display)
+ return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
+ }
+
+-static int default_get_recommended_bpp(struct omap_display *display)
++static int default_get_recommended_bpp(struct omap_dss_device *dssdev)
+ {
+- if (display->panel->recommended_bpp)
+- return display->panel->recommended_bpp;
++ if (dssdev->panel.recommended_bpp)
++ return dssdev->panel.recommended_bpp;
+
+- switch (display->type) {
++ switch (dssdev->type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+- if (display->hw_config.u.dpi.data_lines == 24)
++ if (dssdev->phy.dpi.data_lines == 24)
+ return 24;
+ else
+ return 16;
+
+ case OMAP_DISPLAY_TYPE_DBI:
+ case OMAP_DISPLAY_TYPE_DSI:
+- if (display->ctrl->pixel_size == 24)
++ if (dssdev->ctrl.pixel_size == 24)
+ return 24;
+ else
+ return 16;
+@@ -414,7 +364,7 @@ static int default_get_recommended_bpp(struct omap_display *display)
+ /* Checks if replication logic should be used. Only use for active matrix,
+ * when overlay is in RGB12U or RGB16 mode, and LCD interface is
+ * 18bpp or 24bpp */
+-bool dss_use_replication(struct omap_display *display,
++bool dss_use_replication(struct omap_dss_device *dssdev,
+ enum omap_color_mode mode)
+ {
+ int bpp;
+@@ -422,13 +372,13 @@ bool dss_use_replication(struct omap_display *display,
+ if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
+ return false;
+
+- if (display->type == OMAP_DISPLAY_TYPE_DPI &&
+- (display->panel->config & OMAP_DSS_LCD_TFT) == 0)
++ if (dssdev->type == OMAP_DISPLAY_TYPE_DPI &&
++ (dssdev->panel.config & OMAP_DSS_LCD_TFT) == 0)
+ return false;
+
+- switch (display->type) {
++ switch (dssdev->type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+- bpp = display->hw_config.u.dpi.data_lines;
++ bpp = dssdev->phy.dpi.data_lines;
+ break;
+ case OMAP_DISPLAY_TYPE_VENC:
+ case OMAP_DISPLAY_TYPE_SDI:
+@@ -436,7 +386,7 @@ bool dss_use_replication(struct omap_display *display,
+ break;
+ case OMAP_DISPLAY_TYPE_DBI:
+ case OMAP_DISPLAY_TYPE_DSI:
+- bpp = display->ctrl->pixel_size;
++ bpp = dssdev->ctrl.pixel_size;
+ break;
+ default:
+ BUG();
+@@ -445,319 +395,259 @@ bool dss_use_replication(struct omap_display *display,
+ return bpp > 16;
+ }
+
+-void dss_init_displays(struct platform_device *pdev)
++void dss_init_device(struct platform_device *pdev,
++ struct omap_dss_device *dssdev)
+ {
+- struct omap_dss_board_info *pdata = pdev->dev.platform_data;
+- int i, r;
+-
+- INIT_LIST_HEAD(&display_list);
+-
+- num_displays = 0;
+-
+- for (i = 0; i < pdata->num_displays; ++i) {
+- struct omap_display *display;
++ struct device_attribute *attr;
++ int i;
++ int r;
+
+- switch (pdata->displays[i]->type) {
+- case OMAP_DISPLAY_TYPE_DPI:
++ switch (dssdev->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
+ #ifdef CONFIG_OMAP2_DSS_RFBI
+- case OMAP_DISPLAY_TYPE_DBI:
++ case OMAP_DISPLAY_TYPE_DBI:
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_SDI
+- case OMAP_DISPLAY_TYPE_SDI:
++ case OMAP_DISPLAY_TYPE_SDI:
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_DSI
+- case OMAP_DISPLAY_TYPE_DSI:
++ case OMAP_DISPLAY_TYPE_DSI:
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_VENC
+- case OMAP_DISPLAY_TYPE_VENC:
++ case OMAP_DISPLAY_TYPE_VENC:
+ #endif
+- break;
+- default:
+- DSSERR("Support for display '%s' not compiled in.\n",
+- pdata->displays[i]->name);
+- continue;
+- }
+-
+- display = kzalloc(sizeof(*display), GFP_KERNEL);
+-
+- /*atomic_set(&display->ref_count, 0);*/
+- display->ref_count = 0;
+-
+- display->hw_config = *pdata->displays[i];
+- display->type = pdata->displays[i]->type;
+- display->name = pdata->displays[i]->name;
++ break;
++ default:
++ DSSERR("Support for display '%s' not compiled in.\n",
++ dssdev->name);
++ return;
++ }
+
+- display->get_resolution = default_get_resolution;
+- display->get_recommended_bpp = default_get_recommended_bpp;
+- display->configure_overlay = default_configure_overlay;
+- display->wait_vsync = default_wait_vsync;
++ dssdev->get_resolution = default_get_resolution;
++ dssdev->get_recommended_bpp = default_get_recommended_bpp;
++ dssdev->configure_overlay = default_configure_overlay;
++ dssdev->wait_vsync = default_wait_vsync;
+
+- switch (display->type) {
+- case OMAP_DISPLAY_TYPE_DPI:
+- dpi_init_display(display);
+- break;
++ switch (dssdev->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++ dpi_init_display(dssdev);
++ break;
+ #ifdef CONFIG_OMAP2_DSS_RFBI
+- case OMAP_DISPLAY_TYPE_DBI:
+- rfbi_init_display(display);
+- break;
++ case OMAP_DISPLAY_TYPE_DBI:
++ rfbi_init_display(dssdev);
++ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_VENC
+- case OMAP_DISPLAY_TYPE_VENC:
+- venc_init_display(display);
+- break;
++ case OMAP_DISPLAY_TYPE_VENC:
++ venc_init_display(dssdev);
++ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_SDI
+- case OMAP_DISPLAY_TYPE_SDI:
+- sdi_init_display(display);
+- break;
++ case OMAP_DISPLAY_TYPE_SDI:
++ sdi_init_display(dssdev);
++ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_DSI
+- case OMAP_DISPLAY_TYPE_DSI:
+- dsi_init_display(display);
+- break;
++ case OMAP_DISPLAY_TYPE_DSI:
++ dsi_init_display(dssdev);
++ break;
+ #endif
+- default:
+- BUG();
+- }
+-
+- r = kobject_init_and_add(&display->kobj, &display_ktype,
+- &pdev->dev.kobj, "display%d", num_displays);
++ default:
++ BUG();
++ }
+
+- if (r) {
++ /* create device sysfs files */
++ i = 0;
++ while ((attr = display_sysfs_attrs[i++]) != NULL) {
++ r = device_create_file(&dssdev->dev, attr);
++ if (r)
+ DSSERR("failed to create sysfs file\n");
+- continue;
+- }
+-
+- num_displays++;
+-
+- list_add_tail(&display->list, &display_list);
+ }
++
++ /* create display? sysfs links */
++ r = sysfs_create_link(&pdev->dev.kobj, &dssdev->dev.kobj,
++ dev_name(&dssdev->dev));
++ if (r)
++ DSSERR("failed to create sysfs display link\n");
+ }
+
+-void dss_uninit_displays(struct platform_device *pdev)
++void dss_uninit_device(struct platform_device *pdev,
++ struct omap_dss_device *dssdev)
+ {
+- struct omap_display *display;
+-
+- while (!list_empty(&display_list)) {
+- display = list_first_entry(&display_list,
+- struct omap_display, list);
+- list_del(&display->list);
+- kobject_del(&display->kobj);
+- kobject_put(&display->kobj);
+- kfree(display);
+- }
++ struct device_attribute *attr;
++ int i = 0;
++
++ sysfs_remove_link(&pdev->dev.kobj, dev_name(&dssdev->dev));
++
++ while ((attr = display_sysfs_attrs[i++]) != NULL)
++ device_remove_file(&dssdev->dev, attr);
+
+- num_displays = 0;
++ if (dssdev->manager)
++ dssdev->manager->unset_device(dssdev->manager);
+ }
+
+-int dss_suspend_all_displays(void)
++static int dss_suspend_device(struct device *dev, void *data)
+ {
+ int r;
+- struct omap_display *display;
+-
+- list_for_each_entry(display, &display_list, list) {
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE) {
+- display->activate_after_resume = 0;
+- continue;
+- }
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+
+- if (!display->suspend) {
+- DSSERR("display '%s' doesn't implement suspend\n",
+- display->name);
+- r = -ENOSYS;
+- goto err;
+- }
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
++ dssdev->activate_after_resume = false;
++ return 0;
++ }
+
+- r = display->suspend(display);
++ if (!dssdev->suspend) {
++ DSSERR("display '%s' doesn't implement suspend\n",
++ dssdev->name);
++ return -ENOSYS;
++ }
+
+- if (r)
+- goto err;
++ r = dssdev->suspend(dssdev);
++ if (r)
++ return r;
+
+- display->activate_after_resume = 1;
+- }
++ dssdev->activate_after_resume = true;
+
+ return 0;
+-err:
+- /* resume all displays that were suspended */
+- dss_resume_all_displays();
+- return r;
+ }
+
+-int dss_resume_all_displays(void)
++int dss_suspend_all_devices(void)
+ {
+ int r;
+- struct omap_display *display;
+-
+- list_for_each_entry(display, &display_list, list) {
+- if (display->activate_after_resume && display->resume) {
+- r = display->resume(display);
+- if (r)
+- return r;
+- }
++ struct bus_type *bus = dss_get_bus();
+
+- display->activate_after_resume = 0;
++ r = bus_for_each_dev(bus, NULL, NULL, dss_suspend_device);
++ if (r) {
++ /* resume all displays that were suspended */
++ dss_resume_all_devices();
++ return r;
+ }
+
+ return 0;
+ }
+
+-int omap_dss_get_num_displays(void)
+-{
+- return num_displays;
+-}
+-EXPORT_SYMBOL(omap_dss_get_num_displays);
+-
+-struct omap_display *dss_get_display(int no)
++static int dss_resume_device(struct device *dev, void *data)
+ {
+- int i = 0;
+- struct omap_display *display;
++ int r;
++ struct omap_dss_device *dssdev = to_dss_device(dev);
+
+- list_for_each_entry(display, &display_list, list) {
+- if (i++ == no)
+- return display;
++ if (dssdev->activate_after_resume && dssdev->resume) {
++ r = dssdev->resume(dssdev);
++ if (r)
++ return r;
+ }
+
+- return NULL;
++ dssdev->activate_after_resume = false;
++
++ return 0;
+ }
+
+-struct omap_display *omap_dss_get_display(int no)
++int dss_resume_all_devices(void)
+ {
+- struct omap_display *display;
++ struct bus_type *bus = dss_get_bus();
+
+- display = dss_get_display(no);
++ return bus_for_each_dev(bus, NULL, NULL, dss_resume_device);
++}
+
+- if (!display)
+- return NULL;
+
+- switch (display->type) {
+- case OMAP_DISPLAY_TYPE_VENC:
+- break;
++void omap_dss_get_device(struct omap_dss_device *dssdev)
++{
++ get_device(&dssdev->dev);
++}
++EXPORT_SYMBOL(omap_dss_get_device);
+
+- case OMAP_DISPLAY_TYPE_DPI:
+- case OMAP_DISPLAY_TYPE_SDI:
+- if (display->panel == NULL)
+- return NULL;
+- break;
++void omap_dss_put_device(struct omap_dss_device *dssdev)
++{
++ put_device(&dssdev->dev);
++}
++EXPORT_SYMBOL(omap_dss_put_device);
+
+- case OMAP_DISPLAY_TYPE_DBI:
+- case OMAP_DISPLAY_TYPE_DSI:
+- if (display->panel == NULL || display->ctrl == NULL)
+- return NULL;
+- break;
++/* ref count of the found device is incremented. ref count
++ * of from-device is decremented. */
++struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)
++{
++ struct device *dev;
++ struct device *dev_start = NULL;
++ struct omap_dss_device *dssdev = NULL;
+
+- default:
+- return NULL;
++ int match(struct device *dev, void *data)
++ {
++ /* skip panels connected to controllers */
++ if (to_dss_device(dev)->panel.ctrl)
++ return 0;
++
++ return 1;
+ }
+
+- if (display->ctrl) {
+- if (!try_module_get(display->ctrl->owner))
+- goto err0;
++ if (from)
++ dev_start = &from->dev;
++ dev = bus_find_device(dss_get_bus(), dev_start, NULL, match);
++ if (dev)
++ dssdev = to_dss_device(dev);
++ if (from)
++ put_device(&from->dev);
+
+- if (display->ctrl->init)
+- if (display->ctrl->init(display) != 0)
+- goto err1;
+- }
++ return dssdev;
++}
++EXPORT_SYMBOL(omap_dss_get_next_device);
+
+- if (display->panel) {
+- if (!try_module_get(display->panel->owner))
+- goto err2;
++struct omap_dss_device *omap_dss_find_device(void *data,
++ int (*match)(struct omap_dss_device *dssdev, void *data))
++{
++ struct omap_dss_device *dssdev = NULL;
+
+- if (display->panel->init)
+- if (display->panel->init(display) != 0)
+- goto err3;
++ while ((dssdev = omap_dss_get_next_device(dssdev)) != NULL)
++ {
++ if (match(dssdev, data))
++ return dssdev;
+ }
+
+- display->ref_count++;
+- /*
+- if (atomic_cmpxchg(&display->ref_count, 0, 1) != 0)
+- return 0;
+-*/
+-
+- return display;
+-err3:
+- if (display->panel)
+- module_put(display->panel->owner);
+-err2:
+- if (display->ctrl && display->ctrl->cleanup)
+- display->ctrl->cleanup(display);
+-err1:
+- if (display->ctrl)
+- module_put(display->ctrl->owner);
+-err0:
+ return NULL;
+ }
+-EXPORT_SYMBOL(omap_dss_get_display);
++EXPORT_SYMBOL(omap_dss_find_device);
+
+-void omap_dss_put_display(struct omap_display *display)
++int omap_dss_start_device(struct omap_dss_device *dssdev)
+ {
+- if (--display->ref_count > 0)
+- return;
+-/*
+- if (atomic_cmpxchg(&display->ref_count, 1, 0) != 1)
+- return;
+-*/
+- if (display->ctrl) {
+- if (display->ctrl->cleanup)
+- display->ctrl->cleanup(display);
+- module_put(display->ctrl->owner);
+- }
++ int r;
+
+- if (display->panel) {
+- if (display->panel->cleanup)
+- display->panel->cleanup(display);
+- module_put(display->panel->owner);
++ if (!dssdev->driver) {
++ DSSDBG("no driver\n");
++ r = -ENODEV;
++ goto err0;
+ }
+-}
+-EXPORT_SYMBOL(omap_dss_put_display);
+-
+-void omap_dss_register_ctrl(struct omap_ctrl *ctrl)
+-{
+- struct omap_display *display;
+
+- list_for_each_entry(display, &display_list, list) {
+- if (display->hw_config.ctrl_name &&
+- strcmp(display->hw_config.ctrl_name, ctrl->name) == 0) {
+- display->ctrl = ctrl;
+- DSSDBG("ctrl '%s' registered\n", ctrl->name);
+- }
++ if (dssdev->ctrl.panel && !dssdev->ctrl.panel->driver) {
++ DSSDBG("no panel driver\n");
++ r = -ENODEV;
++ goto err0;
+ }
+-}
+-EXPORT_SYMBOL(omap_dss_register_ctrl);
+
+-void omap_dss_register_panel(struct omap_panel *panel)
+-{
+- struct omap_display *display;
++ if(!try_module_get(dssdev->dev.driver->owner)) {
++ r = -ENODEV;
++ goto err0;
++ }
+
+- list_for_each_entry(display, &display_list, list) {
+- if (display->hw_config.panel_name &&
+- strcmp(display->hw_config.panel_name, panel->name) == 0) {
+- display->panel = panel;
+- DSSDBG("panel '%s' registered\n", panel->name);
++ if (dssdev->ctrl.panel) {
++ if(!try_module_get(dssdev->ctrl.panel->dev.driver->owner)) {
++ r = -ENODEV;
++ goto err1;
+ }
+ }
+-}
+-EXPORT_SYMBOL(omap_dss_register_panel);
+
+-void omap_dss_unregister_ctrl(struct omap_ctrl *ctrl)
+-{
+- struct omap_display *display;
+-
+- list_for_each_entry(display, &display_list, list) {
+- if (display->hw_config.ctrl_name &&
+- strcmp(display->hw_config.ctrl_name, ctrl->name) == 0)
+- display->ctrl = NULL;
+- }
++ return 0;
++err1:
++ module_put(dssdev->dev.driver->owner);
++err0:
++ return r;
+ }
+-EXPORT_SYMBOL(omap_dss_unregister_ctrl);
++EXPORT_SYMBOL(omap_dss_start_device);
+
+-void omap_dss_unregister_panel(struct omap_panel *panel)
++void omap_dss_stop_device(struct omap_dss_device *dssdev)
+ {
+- struct omap_display *display;
++ if (dssdev->ctrl.panel)
++ module_put(dssdev->ctrl.panel->dev.driver->owner);
+
+- list_for_each_entry(display, &display_list, list) {
+- if (display->hw_config.panel_name &&
+- strcmp(display->hw_config.panel_name, panel->name) == 0)
+- display->panel = NULL;
+- }
++ module_put(dssdev->dev.driver->owner);
+ }
+-EXPORT_SYMBOL(omap_dss_unregister_panel);
++EXPORT_SYMBOL(omap_dss_stop_device);
++
+diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
+index 71fffca..f5867cf 100644
+--- a/drivers/video/omap2/dss/dpi.c
++++ b/drivers/video/omap2/dss/dpi.c
+@@ -20,6 +20,8 @@
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#define DSS_SUBSYS_NAME "DPI"
++
+ #include <linux/kernel.h>
+ #include <linux/clk.h>
+ #include <linux/delay.h>
+@@ -83,9 +85,9 @@ static int dpi_set_dispc_clk(bool is_tft, unsigned long pck_req,
+ }
+ #endif
+
+-static int dpi_set_mode(struct omap_display *display)
++static int dpi_set_mode(struct omap_dss_device *dssdev)
+ {
+- struct omap_panel *panel = display->panel;
++ struct omap_video_timings *t = &dssdev->panel.timings;
+ int lck_div, pck_div;
+ unsigned long fck;
+ unsigned long pck;
+@@ -94,15 +96,16 @@ static int dpi_set_mode(struct omap_display *display)
+
+ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- dispc_set_pol_freq(panel);
++ dispc_set_pol_freq(dssdev->panel.config, dssdev->panel.acbi,
++ dssdev->panel.acb);
+
+- is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++ is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
+
+ #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+- r = dpi_set_dsi_clk(is_tft, panel->timings.pixel_clock * 1000,
++ r = dpi_set_dsi_clk(is_tft, t->pixel_clock * 1000,
+ &fck, &lck_div, &pck_div);
+ #else
+- r = dpi_set_dispc_clk(is_tft, panel->timings.pixel_clock * 1000,
++ r = dpi_set_dispc_clk(is_tft, t->pixel_clock * 1000,
+ &fck, &lck_div, &pck_div);
+ #endif
+ if (r)
+@@ -110,97 +113,106 @@ static int dpi_set_mode(struct omap_display *display)
+
+ pck = fck / lck_div / pck_div / 1000;
+
+- if (pck != panel->timings.pixel_clock) {
++ if (pck != t->pixel_clock) {
+ DSSWARN("Could not find exact pixel clock. "
+ "Requested %d kHz, got %lu kHz\n",
+- panel->timings.pixel_clock, pck);
++ t->pixel_clock, pck);
+
+- panel->timings.pixel_clock = pck;
++ t->pixel_clock = pck;
+ }
+
+- dispc_set_lcd_timings(&panel->timings);
++ dispc_set_lcd_timings(t);
+
+ err0:
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+ return r;
+ }
+
+-static int dpi_basic_init(struct omap_display *display)
++static int dpi_basic_init(struct omap_dss_device *dssdev)
+ {
+ bool is_tft;
+
+- is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++ is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
+
+ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
+ dispc_set_lcd_display_type(is_tft ? OMAP_DSS_LCD_DISPLAY_TFT :
+ OMAP_DSS_LCD_DISPLAY_STN);
+- dispc_set_tft_data_lines(display->hw_config.u.dpi.data_lines);
++ dispc_set_tft_data_lines(dssdev->phy.dpi.data_lines);
+
+ return 0;
+ }
+
+-static int dpi_display_enable(struct omap_display *display)
++static int dpi_display_enable(struct omap_dss_device *dssdev)
+ {
+- struct omap_panel *panel = display->panel;
+ int r;
+
+- if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ r = omap_dss_start_device(dssdev);
++ if (r) {
++ DSSERR("failed to start device\n");
++ goto err0;
++ }
++
++ if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
+ DSSERR("display already enabled\n");
+- return -EINVAL;
++ r = -EINVAL;
++ goto err1;
+ }
+
+ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- r = dpi_basic_init(display);
++ r = dpi_basic_init(dssdev);
+ if (r)
+- goto err0;
++ goto err2;
+
+ #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+ dss_clk_enable(DSS_CLK_FCK2);
+ r = dsi_pll_init(0, 1);
+ if (r)
+- goto err1;
++ goto err3;
+ #endif
+- r = dpi_set_mode(display);
++ r = dpi_set_mode(dssdev);
+ if (r)
+- goto err2;
++ goto err4;
+
+ mdelay(2);
+
+ dispc_enable_lcd_out(1);
+
+- r = panel->enable(display);
++ r = dssdev->driver->enable(dssdev);
+ if (r)
+- goto err3;
++ goto err5;
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+
+-err3:
++err5:
+ dispc_enable_lcd_out(0);
+-err2:
++err4:
+ #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+ dsi_pll_uninit();
+-err1:
++err3:
+ dss_clk_disable(DSS_CLK_FCK2);
+ #endif
+-err0:
++err2:
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++err1:
++ omap_dss_stop_device(dssdev);
++err0:
+ return r;
+ }
+
+-static int dpi_display_resume(struct omap_display *display);
++static int dpi_display_resume(struct omap_dss_device *dssdev);
+
+-static void dpi_display_disable(struct omap_display *display)
++static void dpi_display_disable(struct omap_dss_device *dssdev)
+ {
+- if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED)
+ return;
+
+- if (display->state == OMAP_DSS_DISPLAY_SUSPENDED)
+- dpi_display_resume(display);
++ if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ dpi_display_resume(dssdev);
+
+- display->panel->disable(display);
++ dssdev->driver->disable(dssdev);
+
+ dispc_enable_lcd_out(0);
+
+@@ -212,31 +224,33 @@ static void dpi_display_disable(struct omap_display *display)
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
++ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
++
++ omap_dss_stop_device(dssdev);
+ }
+
+-static int dpi_display_suspend(struct omap_display *display)
++static int dpi_display_suspend(struct omap_dss_device *dssdev)
+ {
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EINVAL;
+
+ DSSDBG("dpi_display_suspend\n");
+
+- if (display->panel->suspend)
+- display->panel->suspend(display);
++ if (dssdev->driver->suspend)
++ dssdev->driver->suspend(dssdev);
+
+ dispc_enable_lcd_out(0);
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+ return 0;
+ }
+
+-static int dpi_display_resume(struct omap_display *display)
++static int dpi_display_resume(struct omap_dss_device *dssdev)
+ {
+- if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
++ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
+ return -EINVAL;
+
+ DSSDBG("dpi_display_resume\n");
+@@ -245,26 +259,26 @@ static int dpi_display_resume(struct omap_display *display)
+
+ dispc_enable_lcd_out(1);
+
+- if (display->panel->resume)
+- display->panel->resume(display);
++ if (dssdev->driver->resume)
++ dssdev->driver->resume(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+ }
+
+-static void dpi_set_timings(struct omap_display *display,
++static void dpi_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+ DSSDBG("dpi_set_timings\n");
+- display->panel->timings = *timings;
+- if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
+- dpi_set_mode(display);
++ dssdev->panel.timings = *timings;
++ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
++ dpi_set_mode(dssdev);
+ dispc_go(OMAP_DSS_CHANNEL_LCD);
+ }
+ }
+
+-static int dpi_check_timings(struct omap_display *display,
++static int dpi_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+ bool is_tft;
+@@ -300,7 +314,7 @@ static int dpi_check_timings(struct omap_display *display,
+ if (timings->pixel_clock == 0)
+ return -EINVAL;
+
+- is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0;
++ is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
+
+ #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+ {
+@@ -337,13 +351,13 @@ static int dpi_check_timings(struct omap_display *display,
+ return 0;
+ }
+
+-static void dpi_get_timings(struct omap_display *display,
++static void dpi_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+- *timings = display->panel->timings;
++ *timings = dssdev->panel.timings;
+ }
+
+-static int dpi_display_set_update_mode(struct omap_display *display,
++static int dpi_display_set_update_mode(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode mode)
+ {
+ if (mode == OMAP_DSS_UPDATE_MANUAL)
+@@ -361,25 +375,25 @@ static int dpi_display_set_update_mode(struct omap_display *display,
+ }
+
+ static enum omap_dss_update_mode dpi_display_get_update_mode(
+- struct omap_display *display)
++ struct omap_dss_device *dssdev)
+ {
+ return dpi.update_enabled ? OMAP_DSS_UPDATE_AUTO :
+ OMAP_DSS_UPDATE_DISABLED;
+ }
+
+-void dpi_init_display(struct omap_display *display)
++void dpi_init_display(struct omap_dss_device *dssdev)
+ {
+- DSSDBG("DPI init_display\n");
+-
+- display->enable = dpi_display_enable;
+- display->disable = dpi_display_disable;
+- display->suspend = dpi_display_suspend;
+- display->resume = dpi_display_resume;
+- display->set_timings = dpi_set_timings;
+- display->check_timings = dpi_check_timings;
+- display->get_timings = dpi_get_timings;
+- display->set_update_mode = dpi_display_set_update_mode;
+- display->get_update_mode = dpi_display_get_update_mode;
++ DSSDBG("init_display\n");
++
++ dssdev->enable = dpi_display_enable;
++ dssdev->disable = dpi_display_disable;
++ dssdev->suspend = dpi_display_suspend;
++ dssdev->resume = dpi_display_resume;
++ dssdev->set_timings = dpi_set_timings;
++ dssdev->check_timings = dpi_check_timings;
++ dssdev->get_timings = dpi_get_timings;
++ dssdev->set_update_mode = dpi_display_set_update_mode;
++ dssdev->get_update_mode = dpi_display_get_update_mode;
+ }
+
+ int dpi_init(void)
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index a06fb75..fb2f7f0 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -30,6 +30,7 @@
+ #include <linux/mutex.h>
+ #include <linux/seq_file.h>
+ #include <linux/kfifo.h>
++#include <linux/platform_device.h>
+
+ #include <mach/board.h>
+ #include <mach/display.h>
+@@ -230,7 +231,7 @@ enum dsi_cmd {
+ };
+
+ struct dsi_cmd_item {
+- struct omap_display *display;
++ struct omap_dss_device *dssdev;
+
+ enum dsi_cmd cmd;
+
+@@ -256,7 +257,7 @@ static struct
+ unsigned long ddr_clk; /* Hz */
+
+ struct {
+- struct omap_display *display;
++ struct omap_dss_device *dssdev;
+ enum fifo_size fifo_size;
+ int dest_per; /* destination peripheral 0-3 */
+ } vc[4];
+@@ -317,9 +318,9 @@ module_param_named(dsi_perf, dsi_perf, bool, 0644);
+ #endif
+
+ static void dsi_process_cmd_fifo(struct work_struct *work);
+-static void dsi_push_update(struct omap_display *display,
++static void dsi_push_update(struct omap_dss_device *dssdev,
+ int x, int y, int w, int h);
+-static void dsi_push_autoupdate(struct omap_display *display);
++static void dsi_push_autoupdate(struct omap_dss_device *dssdev);
+
+ static inline void dsi_write_reg(const struct dsi_reg idx, u32 val)
+ {
+@@ -777,7 +778,7 @@ static unsigned long dsi_fclk_rate(void)
+ return r;
+ }
+
+-static int dsi_set_lp_clk_divisor(struct omap_display *display)
++static int dsi_set_lp_clk_divisor(struct omap_dss_device *dssdev)
+ {
+ unsigned n;
+ unsigned long dsi_fclk;
+@@ -785,7 +786,7 @@ static int dsi_set_lp_clk_divisor(struct omap_display *display)
+
+ dsi_fclk = dsi_fclk_rate();
+
+- lp_clk_req = display->hw_config.u.dsi.lp_clk_hz;
++ lp_clk_req = dssdev->phy.dsi.lp_clk_hz;
+
+ for (n = 1; n < (1 << 13) - 1; ++n) {
+ lp_clk = dsi_fclk / 2 / n;
+@@ -1376,16 +1377,16 @@ static int dsi_complexio_power(enum dsi_complexio_power_state state)
+ return 0;
+ }
+
+-static void dsi_complexio_config(struct omap_display *display)
++static void dsi_complexio_config(struct omap_dss_device *dssdev)
+ {
+ u32 r;
+
+- int clk_lane = display->hw_config.u.dsi.clk_lane;
+- int data1_lane = display->hw_config.u.dsi.data1_lane;
+- int data2_lane = display->hw_config.u.dsi.data2_lane;
+- int clk_pol = display->hw_config.u.dsi.clk_pol;
+- int data1_pol = display->hw_config.u.dsi.data1_pol;
+- int data2_pol = display->hw_config.u.dsi.data2_pol;
++ int clk_lane = dssdev->phy.dsi.clk_lane;
++ int data1_lane = dssdev->phy.dsi.data1_lane;
++ int data2_lane = dssdev->phy.dsi.data2_lane;
++ int clk_pol = dssdev->phy.dsi.clk_pol;
++ int data1_pol = dssdev->phy.dsi.data1_pol;
++ int data2_pol = dssdev->phy.dsi.data2_pol;
+
+ r = dsi_read_reg(DSI_COMPLEXIO_CFG1);
+ r = FLD_MOD(r, clk_lane, 2, 0);
+@@ -1497,7 +1498,7 @@ static void dsi_complexio_timings(void)
+ }
+
+
+-static int dsi_complexio_init(struct omap_display *display)
++static int dsi_complexio_init(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+@@ -1517,7 +1518,7 @@ static int dsi_complexio_init(struct omap_display *display)
+ goto err;
+ }
+
+- dsi_complexio_config(display);
++ dsi_complexio_config(dssdev);
+
+ r = dsi_complexio_power(DSI_COMPLEXIO_POWER_ON);
+
+@@ -2283,7 +2284,7 @@ static int dsi_set_hs_tx_timeout(int ns, int x4, int x16)
+
+ return 0;
+ }
+-static int dsi_proto_config(struct omap_display *display)
++static int dsi_proto_config(struct omap_dss_device *dssdev)
+ {
+ u32 r;
+ int buswidth = 0;
+@@ -2310,7 +2311,7 @@ static int dsi_proto_config(struct omap_display *display)
+ /* 10000ns * 4 */
+ dsi_set_hs_tx_timeout(10000, 1, 0);
+
+- switch (display->ctrl->pixel_size) {
++ switch (dssdev->ctrl.pixel_size) {
+ case 16:
+ buswidth = 0;
+ break;
+@@ -2355,7 +2356,7 @@ static int dsi_proto_config(struct omap_display *display)
+ return 0;
+ }
+
+-static void dsi_proto_timings(struct omap_display *display)
++static void dsi_proto_timings(struct omap_dss_device *dssdev)
+ {
+ unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
+ unsigned tclk_pre, tclk_post;
+@@ -2387,8 +2388,8 @@ static void dsi_proto_timings(struct omap_display *display)
+ tclk_post = ns2ddr(60) + 26;
+
+ /* ths_eot is 2 for 2 datalanes and 4 for 1 datalane */
+- if (display->hw_config.u.dsi.data1_lane != 0 &&
+- display->hw_config.u.dsi.data2_lane != 0)
++ if (dssdev->phy.dsi.data1_lane != 0 &&
++ dssdev->phy.dsi.data2_lane != 0)
+ ths_eot = 2;
+ else
+ ths_eot = 4;
+@@ -2412,6 +2413,7 @@ static void dsi_proto_timings(struct omap_display *display)
+ enter_hs_mode_lat = 1 + DIV_ROUND_UP(tlpx, 4) +
+ DIV_ROUND_UP(ths_prepare, 4) +
+ DIV_ROUND_UP(ths_zero + 3, 4);
++
+ exit_hs_mode_lat = DIV_ROUND_UP(ths_trail + ths_exit, 4) + 1 + ths_eot;
+
+ r = FLD_VAL(enter_hs_mode_lat, 31, 16) |
+@@ -2441,7 +2443,7 @@ static void dsi_proto_timings(struct omap_display *display)
+ DSI_FLUSH(ch); \
+ } while (0)
+
+-static int dsi_update_screen_l4(struct omap_display *display,
++static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ int x, int y, int w, int h)
+ {
+ /* Note: supports only 24bit colors in 32bit container */
+@@ -2464,12 +2466,12 @@ static int dsi_update_screen_l4(struct omap_display *display,
+ DSSDBG("dsi_update_screen_l4 (%d,%d %dx%d)\n",
+ x, y, w, h);
+
+- ovl = display->manager->overlays[0];
++ ovl = dssdev->manager->overlays[0];
+
+ if (ovl->info.color_mode != OMAP_DSS_COLOR_RGB24U)
+ return -EINVAL;
+
+- if (display->ctrl->pixel_size != 24)
++ if (dssdev->ctrl.pixel_size != 24)
+ return -EINVAL;
+
+ scr_width = ovl->info.screen_width;
+@@ -2497,7 +2499,7 @@ static int dsi_update_screen_l4(struct omap_display *display,
+
+ dsi_bus_lock();
+
+- display->ctrl->setup_update(display, x, y, w, h);
++ dssdev->driver->setup_update(dssdev, x, y, w, h);
+
+ pixels_left = w * h;
+
+@@ -2595,101 +2597,7 @@ static int dsi_update_screen_l4(struct omap_display *display,
+ return 0;
+ }
+
+-#if 0
+-static void dsi_clear_screen_l4(struct omap_display *display,
+- int x, int y, int w, int h)
+-{
+- int first = 1;
+- int fifo_stalls = 0;
+- int max_dsi_packet_size;
+- int max_data_per_packet;
+- int max_pixels_per_packet;
+- int pixels_left;
+- int bytespp = 3;
+- int pixnum;
+-
+- debug_irq = 0;
+-
+- DSSDBG("dsi_clear_screen_l4 (%d,%d %dx%d)\n",
+- x, y, w, h);
+-
+- if (display->ctrl->bpp != 24)
+- return -EINVAL;
+-
+- /* We need header(4) + DCSCMD(1) + pixels(numpix*bytespp)
+- * bytes in fifo */
+-
+- /* When using CPU, max long packet size is TX buffer size */
+- max_dsi_packet_size = dsi.vc[0].fifo_size * 32 * 4;
+-
+- max_data_per_packet = max_dsi_packet_size - 4 - 1;
+-
+- max_pixels_per_packet = max_data_per_packet / bytespp;
+-
+- enable_clocks(1);
+-
+- display->ctrl->setup_update(display, x, y, w, h);
+-
+- pixels_left = w * h;
+-
+- dsi.update_region.x = x;
+- dsi.update_region.y = y;
+- dsi.update_region.w = w;
+- dsi.update_region.h = h;
+- dsi.update_region.bytespp = bytespp;
+-
+- start_measuring();
+-
+- pixnum = 0;
+-
+- while (pixels_left > 0) {
+- /* 0x2c = write_memory_start */
+- /* 0x3c = write_memory_continue */
+- u8 dcs_cmd = first ? 0x2c : 0x3c;
+- int pixels;
+- DSI_DECL_VARS;
+- first = 0;
+-
+- /* TX_FIFO_NOT_EMPTY */
+- while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) {
+- fifo_stalls++;
+- if (fifo_stalls > 0xfffff) {
+- DSSERR("fifo stalls overflow\n");
+- dsi_if_enable(0);
+- enable_clocks(0);
+- return;
+- }
+- }
+-
+- pixels = min(max_pixels_per_packet, pixels_left);
+-
+- pixels_left -= pixels;
+-
+- dsi_vc_write_long_header(0, DSI_DT_DCS_LONG_WRITE,
+- 1 + pixels * bytespp, 0);
+-
+- DSI_PUSH(0, dcs_cmd);
+-
+- while (pixels-- > 0) {
+- u32 pix;
+-
+- pix = 0x000000;
+-
+- DSI_PUSH(0, (pix >> 16) & 0xff);
+- DSI_PUSH(0, (pix >> 8) & 0xff);
+- DSI_PUSH(0, (pix >> 0) & 0xff);
+- }
+-
+- DSI_FLUSH(0);
+- }
+-
+- enable_clocks(0);
+-
+- end_measuring("L4 CLEAR");
+-}
+-#endif
+-
+-static void dsi_setup_update_dispc(struct omap_display *display,
++static void dsi_setup_update_dispc(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+ DSSDBG("dsi_setup_update_dispc(%d,%d %dx%d)\n",
+@@ -2703,16 +2611,16 @@ static void dsi_setup_update_dispc(struct omap_display *display,
+ dsi.update_region.bytespp = 3; // XXX
+ #endif
+
+- dispc_setup_partial_planes(display, &x, &y, &w, &h);
++ dispc_setup_partial_planes(dssdev, &x, &y, &w, &h);
+
+ dispc_set_lcd_size(w, h);
+ }
+
+-static void dsi_setup_autoupdate_dispc(struct omap_display *display)
++static void dsi_setup_autoupdate_dispc(struct omap_dss_device *dssdev)
+ {
+ u16 w, h;
+
+- display->get_resolution(display, &w, &h);
++ dssdev->get_resolution(dssdev, &w, &h);
+
+ #ifdef DEBUG
+ dsi.update_region.x = 0;
+@@ -2724,14 +2632,14 @@ static void dsi_setup_autoupdate_dispc(struct omap_display *display)
+
+ /* the overlay settings may not have been applied, if we were in manual
+ * mode earlier, so do it here */
+- display->manager->apply(display->manager);
++ dssdev->manager->apply(dssdev->manager);
+
+ dispc_set_lcd_size(w, h);
+
+ dsi.autoupdate_setup = 0;
+ }
+
+-static void dsi_update_screen_dispc(struct omap_display *display,
++static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+ int bytespp = 3;
+@@ -2760,10 +2668,10 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+
+ dsi_bus_lock();
+
+- display->ctrl->setup_update(display, x, y, w, h);
++ dssdev->driver->setup_update(dssdev, x, y, w, h);
+
+- if (dsi.use_ext_te && display->ctrl->wait_for_te)
+- display->ctrl->wait_for_te(display);
++ if (dsi.use_ext_te && dssdev->wait_for_te)
++ dssdev->wait_for_te(dssdev);
+
+ if (0)
+ dsi_vc_print_status(1);
+@@ -2811,7 +2719,7 @@ static void framedone_timeout_callback(struct work_struct *work)
+ /* We check for target_update_mode, not update_mode. No reason to push
+ * new updates if we're turning auto update off */
+ if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_push_autoupdate(dsi.vc[1].display);
++ dsi_push_autoupdate(dsi.vc[1].dssdev);
+
+ atomic_set(&dsi.cmd_pending, 0);
+ dsi_process_cmd_fifo(NULL);
+@@ -2895,19 +2803,19 @@ static void framedone_worker(struct work_struct *work)
+ /* We check for target_update_mode, not update_mode. No reason to push
+ * new updates if we're turning auto update off */
+ if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_push_autoupdate(dsi.vc[1].display);
++ dsi_push_autoupdate(dsi.vc[1].dssdev);
+
+ atomic_set(&dsi.cmd_pending, 0);
+ dsi_process_cmd_fifo(NULL);
+ }
+
+-static void dsi_start_auto_update(struct omap_display *display)
++static void dsi_start_auto_update(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("starting auto update\n");
+
+ dsi.autoupdate_setup = 1;
+
+- dsi_push_autoupdate(display);
++ dsi_push_autoupdate(dssdev);
+
+ perf_mark_start_auto();
+ }
+@@ -2936,7 +2844,7 @@ static void dsi_signal_fifo_waiters(void)
+ }
+
+ /* returns 1 for async op, and 0 for sync op */
+-static int dsi_do_update(struct omap_display *display,
++static int dsi_do_update(struct omap_dss_device *dssdev,
+ struct dsi_cmd_update *upd)
+ {
+ int r;
+@@ -2946,10 +2854,10 @@ static int dsi_do_update(struct omap_display *display,
+ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
+ return 0;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+- display->get_resolution(display, &dw, &dh);
++ dssdev->get_resolution(dssdev, &dw, &dh);
+ if (x > dw || y > dh)
+ return 0;
+
+@@ -2963,12 +2871,12 @@ static int dsi_do_update(struct omap_display *display,
+
+ perf_mark_setup();
+
+- if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+- dsi_setup_update_dispc(display, x, y, w, h);
+- dsi_update_screen_dispc(display, x, y, w, h);
++ if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ dsi_setup_update_dispc(dssdev, x, y, w, h);
++ dsi_update_screen_dispc(dssdev, x, y, w, h);
+ return 1;
+ } else {
+- r = dsi_update_screen_l4(display, x, y, w, h);
++ r = dsi_update_screen_l4(dssdev, x, y, w, h);
+ if (r)
+ DSSERR("L4 update failed\n");
+ return 0;
+@@ -2976,7 +2884,7 @@ static int dsi_do_update(struct omap_display *display,
+ }
+
+ /* returns 1 for async op, and 0 for sync op */
+-static int dsi_do_autoupdate(struct omap_display *display)
++static int dsi_do_autoupdate(struct omap_dss_device *dssdev)
+ {
+ int r;
+ u16 w, h;
+@@ -2984,34 +2892,34 @@ static int dsi_do_autoupdate(struct omap_display *display)
+ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
+ return 0;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+- display->get_resolution(display, &w, &h);
++ dssdev->get_resolution(dssdev, &w, &h);
+
+ perf_mark_setup();
+
+- if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+ if (dsi.autoupdate_setup)
+- dsi_setup_autoupdate_dispc(display);
+- dsi_update_screen_dispc(display, 0, 0, w, h);
++ dsi_setup_autoupdate_dispc(dssdev);
++ dsi_update_screen_dispc(dssdev, 0, 0, w, h);
+ return 1;
+ } else {
+- r = dsi_update_screen_l4(display, 0, 0, w, h);
++ r = dsi_update_screen_l4(dssdev, 0, 0, w, h);
+ if (r)
+ DSSERR("L4 update failed\n");
+ return 0;
+ }
+ }
+
+-static void dsi_do_cmd_mem_read(struct omap_display *display,
++static void dsi_do_cmd_mem_read(struct omap_dss_device *dssdev,
+ struct dsi_cmd_mem_read *mem_read)
+ {
+ int r;
+
+ dsi_bus_lock();
+
+- r = display->ctrl->memory_read(display,
++ r = dssdev->driver->memory_read(dssdev,
+ mem_read->buf,
+ mem_read->size,
+ mem_read->x,
+@@ -3025,14 +2933,14 @@ static void dsi_do_cmd_mem_read(struct omap_display *display,
+ complete(mem_read->completion);
+ }
+
+-static void dsi_do_cmd_test(struct omap_display *display,
++static void dsi_do_cmd_test(struct omap_dss_device *dssdev,
+ struct dsi_cmd_test *test)
+ {
+ int r = 0;
+
+ DSSDBGF("");
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ dsi_bus_lock();
+@@ -3040,14 +2948,8 @@ static void dsi_do_cmd_test(struct omap_display *display,
+ /* run test first in low speed mode */
+ dsi_vc_enable_hs(0, 0);
+
+- if (display->ctrl->run_test) {
+- r = display->ctrl->run_test(display, test->test_num);
+- if (r)
+- goto end;
+- }
+-
+- if (display->panel->run_test) {
+- r = display->panel->run_test(display, test->test_num);
++ if (dssdev->driver->run_test) {
++ r = dssdev->driver->run_test(dssdev, test->test_num);
+ if (r)
+ goto end;
+ }
+@@ -3055,15 +2957,12 @@ static void dsi_do_cmd_test(struct omap_display *display,
+ /* then in high speed */
+ dsi_vc_enable_hs(0, 1);
+
+- if (display->ctrl->run_test) {
+- r = display->ctrl->run_test(display, test->test_num);
++ if (dssdev->driver->run_test) {
++ r = dssdev->driver->run_test(dssdev, test->test_num);
+ if (r)
+ goto end;
+ }
+
+- if (display->panel->run_test)
+- r = display->panel->run_test(display, test->test_num);
+-
+ end:
+ dsi_vc_enable_hs(0, 1);
+
+@@ -3075,21 +2974,21 @@ end:
+ DSSDBG("test end\n");
+ }
+
+-static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
++static void dsi_do_cmd_set_te(struct omap_dss_device *dssdev, bool enable)
+ {
+- if (!display->hw_config.u.dsi.ext_te)
++ if (!dssdev->phy.dsi.ext_te)
+ dsi.use_te = enable;
+ else
+ dsi.use_ext_te = enable;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ dsi_bus_lock();
+- display->ctrl->enable_te(display, enable);
++ dssdev->driver->enable_te(dssdev, enable);
+ dsi_bus_unlock();
+
+- if (!display->hw_config.u.dsi.ext_te) {
++ if (!dssdev->phy.dsi.ext_te) {
+ if (enable) {
+ /* disable LP_RX_TO, so that we can receive TE.
+ * Time to wait for TE is longer than the timer allows */
+@@ -3100,16 +2999,16 @@ static void dsi_do_cmd_set_te(struct omap_display *display, bool enable)
+ }
+ }
+
+-static void dsi_do_cmd_set_update_mode(struct omap_display *display,
++static void dsi_do_cmd_set_update_mode(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode mode)
+ {
+ dsi.update_mode = mode;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ if (mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_start_auto_update(display);
++ dsi_start_auto_update(dssdev);
+ }
+
+ static void dsi_process_cmd_fifo(struct work_struct *work)
+@@ -3117,7 +3016,7 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+ int len;
+ struct dsi_cmd_item p;
+ unsigned long flags;
+- struct omap_display *display;
++ struct omap_dss_device *dssdev;
+ int exit = 0;
+
+ if (dsi.debug_process)
+@@ -3146,14 +3045,14 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+
+ BUG_ON(len != sizeof(p));
+
+- display = p.display;
++ dssdev = p.dssdev;
+
+ if (dsi.debug_process)
+ DSSDBG("processing cmd %d\n", p.cmd);
+
+ switch (p.cmd) {
+ case DSI_CMD_UPDATE:
+- if (dsi_do_update(display, &p.u.r)) {
++ if (dsi_do_update(dssdev, &p.u.r)) {
+ if (dsi.debug_process)
+ DSSDBG("async update\n");
+ exit = 1;
+@@ -3164,7 +3063,7 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+ break;
+
+ case DSI_CMD_AUTOUPDATE:
+- if (dsi_do_autoupdate(display)) {
++ if (dsi_do_autoupdate(dssdev)) {
+ if (dsi.debug_process)
+ DSSDBG("async autoupdate\n");
+ exit = 1;
+@@ -3181,24 +3080,24 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+ break;
+
+ case DSI_CMD_MEM_READ:
+- dsi_do_cmd_mem_read(display, &p.u.mem_read);
++ dsi_do_cmd_mem_read(dssdev, &p.u.mem_read);
+ break;
+
+ case DSI_CMD_TEST:
+- dsi_do_cmd_test(display, &p.u.test);
++ dsi_do_cmd_test(dssdev, &p.u.test);
+ break;
+
+ case DSI_CMD_SET_TE:
+- dsi_do_cmd_set_te(display, p.u.te);
++ dsi_do_cmd_set_te(dssdev, p.u.te);
+ break;
+
+ case DSI_CMD_SET_UPDATE_MODE:
+- dsi_do_cmd_set_update_mode(display, p.u.update_mode);
++ dsi_do_cmd_set_update_mode(dssdev, p.u.update_mode);
+ break;
+
+ case DSI_CMD_SET_ROTATE:
+ dsi_bus_lock();
+- display->ctrl->set_rotate(display, p.u.rotate);
++ dssdev->driver->set_rotate(dssdev, p.u.rotate);
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
+ dsi.autoupdate_setup = 1;
+ dsi_bus_unlock();
+@@ -3206,7 +3105,7 @@ static void dsi_process_cmd_fifo(struct work_struct *work)
+
+ case DSI_CMD_SET_MIRROR:
+ dsi_bus_lock();
+- display->ctrl->set_mirror(display, p.u.mirror);
++ dssdev->driver->set_mirror(dssdev, p.u.mirror);
+ dsi_bus_unlock();
+ break;
+
+@@ -3263,12 +3162,12 @@ static void dsi_push_cmd(struct dsi_cmd_item *p)
+ queue_work(dsi.workqueue, &dsi.process_work);
+ }
+
+-static void dsi_push_update(struct omap_display *display,
++static void dsi_push_update(struct omap_dss_device *dssdev,
+ int x, int y, int w, int h)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_UPDATE;
+
+ p.u.r.x = x;
+@@ -3281,22 +3180,22 @@ static void dsi_push_update(struct omap_display *display,
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_autoupdate(struct omap_display *display)
++static void dsi_push_autoupdate(struct omap_dss_device *dssdev)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_AUTOUPDATE;
+
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_sync(struct omap_display *display,
++static void dsi_push_sync(struct omap_dss_device *dssdev,
+ struct completion *sync_comp)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_SYNC;
+ p.u.sync = sync_comp;
+
+@@ -3305,12 +3204,12 @@ static void dsi_push_sync(struct omap_display *display,
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_mem_read(struct omap_display *display,
++static void dsi_push_mem_read(struct omap_dss_device *dssdev,
+ struct dsi_cmd_mem_read *mem_read)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_MEM_READ;
+ p.u.mem_read = *mem_read;
+
+@@ -3319,12 +3218,12 @@ static void dsi_push_mem_read(struct omap_display *display,
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_test(struct omap_display *display, int test_num,
++static void dsi_push_test(struct omap_dss_device *dssdev, int test_num,
+ int *result, struct completion *completion)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_TEST;
+ p.u.test.test_num = test_num;
+ p.u.test.result = result;
+@@ -3335,11 +3234,11 @@ static void dsi_push_test(struct omap_display *display, int test_num,
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_set_te(struct omap_display *display, bool enable)
++static void dsi_push_set_te(struct omap_dss_device *dssdev, bool enable)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_SET_TE;
+ p.u.te = enable;
+
+@@ -3348,12 +3247,12 @@ static void dsi_push_set_te(struct omap_display *display, bool enable)
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_set_update_mode(struct omap_display *display,
++static void dsi_push_set_update_mode(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode mode)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_SET_UPDATE_MODE;
+ p.u.update_mode = mode;
+
+@@ -3362,11 +3261,11 @@ static void dsi_push_set_update_mode(struct omap_display *display,
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_set_rotate(struct omap_display *display, int rotate)
++static void dsi_push_set_rotate(struct omap_dss_device *dssdev, int rotate)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_SET_ROTATE;
+ p.u.rotate = rotate;
+
+@@ -3375,11 +3274,11 @@ static void dsi_push_set_rotate(struct omap_display *display, int rotate)
+ dsi_push_cmd(&p);
+ }
+
+-static void dsi_push_set_mirror(struct omap_display *display, int mirror)
++static void dsi_push_set_mirror(struct omap_dss_device *dssdev, int mirror)
+ {
+ struct dsi_cmd_item p;
+
+- p.display = display;
++ p.dssdev = dssdev;
+ p.cmd = DSI_CMD_SET_MIRROR;
+ p.u.mirror = mirror;
+
+@@ -3388,7 +3287,7 @@ static void dsi_push_set_mirror(struct omap_display *display, int mirror)
+ dsi_push_cmd(&p);
+ }
+
+-static int dsi_wait_sync(struct omap_display *display)
++static int dsi_wait_sync(struct omap_dss_device *dssdev)
+ {
+ long wait = msecs_to_jiffies(2000);
+ struct completion compl;
+@@ -3396,7 +3295,7 @@ static int dsi_wait_sync(struct omap_display *display)
+ DSSDBGF("");
+
+ init_completion(&compl);
+- dsi_push_sync(display, &compl);
++ dsi_push_sync(dssdev, &compl);
+
+ DSSDBG("Waiting for SYNC to happen...\n");
+ wait = wait_for_completion_timeout(&compl, wait);
+@@ -3423,7 +3322,7 @@ static int dsi_wait_sync(struct omap_display *display)
+
+ /* Display funcs */
+
+-static int dsi_display_init_dispc(struct omap_display *display)
++static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
+ {
+ int r;
+
+@@ -3439,7 +3338,7 @@ static int dsi_display_init_dispc(struct omap_display *display)
+ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_DSI);
+ dispc_enable_fifohandcheck(1);
+
+- dispc_set_tft_data_lines(display->ctrl->pixel_size);
++ dispc_set_tft_data_lines(dssdev->ctrl.pixel_size);
+
+ {
+ struct omap_video_timings timings = {
+@@ -3457,13 +3356,13 @@ static int dsi_display_init_dispc(struct omap_display *display)
+ return 0;
+ }
+
+-static void dsi_display_uninit_dispc(struct omap_display *display)
++static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev)
+ {
+ omap_dispc_unregister_isr(framedone_callback, NULL,
+ DISPC_IRQ_FRAMEDONE);
+ }
+
+-static int dsi_display_init_dsi(struct omap_display *display)
++static int dsi_display_init_dsi(struct omap_dss_device *dssdev)
+ {
+ struct dsi_clock_info cinfo;
+ int r;
+@@ -3476,7 +3375,7 @@ static int dsi_display_init_dsi(struct omap_display *display)
+ if (r)
+ goto err0;
+
+- r = dsi_pll_calc_ddrfreq(display->hw_config.u.dsi.ddr_clk_hz, &cinfo);
++ r = dsi_pll_calc_ddrfreq(dssdev->phy.dsi.ddr_clk_hz, &cinfo);
+ if (r)
+ goto err1;
+
+@@ -3486,19 +3385,19 @@ static int dsi_display_init_dsi(struct omap_display *display)
+
+ DSSDBG("PLL OK\n");
+
+- r = dsi_complexio_init(display);
++ r = dsi_complexio_init(dssdev);
+ if (r)
+ goto err1;
+
+ _dsi_print_reset_status();
+
+- dsi_proto_timings(display);
+- dsi_set_lp_clk_divisor(display);
++ dsi_proto_timings(dssdev);
++ dsi_set_lp_clk_divisor(dssdev);
+
+ if (1)
+ _dsi_print_reset_status();
+
+- r = dsi_proto_config(display);
++ r = dsi_proto_config(dssdev);
+ if (r)
+ goto err2;
+
+@@ -3508,27 +3407,18 @@ static int dsi_display_init_dsi(struct omap_display *display)
+ dsi_if_enable(1);
+ dsi_force_tx_stop_mode_io();
+
+- if (display->ctrl && display->ctrl->enable) {
+- r = display->ctrl->enable(display);
++ if (dssdev->driver->enable) {
++ r = dssdev->driver->enable(dssdev);
+ if (r)
+ goto err3;
+ }
+
+- if (display->panel && display->panel->enable) {
+- r = display->panel->enable(display);
+- if (r)
+- goto err4;
+- }
+-
+ /* enable high-speed after initial config */
+ dsi_vc_enable_hs(0, 1);
+
+ dsi_bus_unlock();
+
+ return 0;
+-err4:
+- if (display->ctrl && display->ctrl->disable)
+- display->ctrl->disable(display);
+ err3:
+ dsi_if_enable(0);
+ err2:
+@@ -3540,13 +3430,11 @@ err0:
+ return r;
+ }
+
+-static void dsi_display_uninit_dsi(struct omap_display *display)
++static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev)
+ {
+ dsi_bus_lock();
+- if (display->panel && display->panel->disable)
+- display->panel->disable(display);
+- if (display->ctrl && display->ctrl->disable)
+- display->ctrl->disable(display);
++ if (dssdev->driver->disable)
++ dssdev->driver->disable(dssdev);
+ dsi_bus_unlock();
+
+ dsi_complexio_uninit();
+@@ -3569,7 +3457,7 @@ static int dsi_core_init(void)
+ return 0;
+ }
+
+-static int dsi_display_enable(struct omap_display *display)
++static int dsi_display_enable(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+@@ -3577,101 +3465,177 @@ static int dsi_display_enable(struct omap_display *display)
+
+ mutex_lock(&dsi.lock);
+
+- if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
+- DSSERR("display already enabled\n");
+- r = -EINVAL;
++ r = omap_dss_start_device(dssdev);
++ if (r) {
++ DSSERR("failed to start device\n");
+ goto err0;
+ }
+
++ if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
++ DSSERR("dssdev already enabled\n");
++ r = -EINVAL;
++ goto err1;
++ }
++
+ enable_clocks(1);
+ dsi_enable_pll_clock(1);
+
+ r = _dsi_reset();
+ if (r)
+- return r;
++ goto err2;
+
+ dsi_core_init();
+
+- r = dsi_display_init_dispc(display);
++ r = dsi_display_init_dispc(dssdev);
+ if (r)
+- goto err1;
++ goto err2;
+
+- r = dsi_display_init_dsi(display);
++ r = dsi_display_init_dsi(dssdev);
+ if (r)
+- goto err2;
++ goto err3;
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ if (dsi.use_te || dsi.use_ext_te)
+- dsi_push_set_te(display, 1);
++ dsi_push_set_te(dssdev, 1);
+
+- dsi_push_set_update_mode(display, dsi.user_update_mode);
++ dsi_push_set_update_mode(dssdev, dsi.user_update_mode);
+ dsi.target_update_mode = dsi.user_update_mode;
+
+ mutex_unlock(&dsi.lock);
+
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+
++err3:
++ dsi_display_uninit_dispc(dssdev);
+ err2:
+- dsi_display_uninit_dispc(display);
+-err1:
+ enable_clocks(0);
+ dsi_enable_pll_clock(0);
++err1:
++ omap_dss_stop_device(dssdev);
+ err0:
+ mutex_unlock(&dsi.lock);
+ DSSDBG("dsi_display_enable FAILED\n");
+ return r;
+ }
+
+-static void dsi_display_disable(struct omap_display *display)
++static void dsi_display_disable(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("dsi_display_disable\n");
+
+ mutex_lock(&dsi.lock);
+
+- if (display->state == OMAP_DSS_DISPLAY_DISABLED ||
+- display->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
++ dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
+ goto end;
+
+ if (dsi.target_update_mode != OMAP_DSS_UPDATE_DISABLED) {
+- dsi_push_set_update_mode(display, OMAP_DSS_UPDATE_DISABLED);
++ dsi_push_set_update_mode(dssdev, OMAP_DSS_UPDATE_DISABLED);
+ dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
+ }
+
+- dsi_wait_sync(display);
++ dsi_wait_sync(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
++ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+
+- dsi_display_uninit_dispc(display);
++ dsi_display_uninit_dispc(dssdev);
+
+- dsi_display_uninit_dsi(display);
++ dsi_display_uninit_dsi(dssdev);
+
+ enable_clocks(0);
+ dsi_enable_pll_clock(0);
++
++ omap_dss_stop_device(dssdev);
+ end:
+ mutex_unlock(&dsi.lock);
+ }
+
+-static int dsi_display_suspend(struct omap_display *display)
++static int dsi_display_suspend(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("dsi_display_suspend\n");
+
+- dsi_display_disable(display);
++ mutex_lock(&dsi.lock);
++
++ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
++ dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ goto end;
+
+- display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++ if (dsi.target_update_mode != OMAP_DSS_UPDATE_DISABLED) {
++ dsi_push_set_update_mode(dssdev, OMAP_DSS_UPDATE_DISABLED);
++ dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
++ }
++
++ dsi_wait_sync(dssdev);
++
++ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
++
++ dsi_display_uninit_dispc(dssdev);
++
++ dsi_display_uninit_dsi(dssdev);
++
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++end:
++ mutex_unlock(&dsi.lock);
+
+ return 0;
+ }
+
+-static int dsi_display_resume(struct omap_display *display)
++static int dsi_display_resume(struct omap_dss_device *dssdev)
+ {
++ int r;
++
+ DSSDBG("dsi_display_resume\n");
+
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
+- return dsi_display_enable(display);
++ mutex_lock(&dsi.lock);
++
++ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
++ DSSERR("dssdev not suspended\n");
++ r = -EINVAL;
++ goto err0;
++ }
++
++ enable_clocks(1);
++ dsi_enable_pll_clock(1);
++
++ r = _dsi_reset();
++ if (r)
++ goto err1;
++
++ dsi_core_init();
++
++ r = dsi_display_init_dispc(dssdev);
++ if (r)
++ goto err1;
++
++ r = dsi_display_init_dsi(dssdev);
++ if (r)
++ goto err2;
++
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
++
++ if (dsi.use_te || dsi.use_ext_te)
++ dsi_push_set_te(dssdev, 1);
++
++ dsi_push_set_update_mode(dssdev, dsi.user_update_mode);
++ dsi.target_update_mode = dsi.user_update_mode;
++
++ mutex_unlock(&dsi.lock);
++
++ return dsi_wait_sync(dssdev);
++
++err2:
++ dsi_display_uninit_dispc(dssdev);
++err1:
++ enable_clocks(0);
++ dsi_enable_pll_clock(0);
++err0:
++ mutex_unlock(&dsi.lock);
++ DSSDBG("dsi_display_resume FAILED\n");
++ return r;
+ }
+
+-static int dsi_display_update(struct omap_display *display,
++static int dsi_display_update(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+ DSSDBG("dsi_display_update(%d,%d %dx%d)\n", x, y, w, h);
+@@ -3682,7 +3646,7 @@ static int dsi_display_update(struct omap_display *display,
+ mutex_lock(&dsi.lock);
+
+ if (dsi.target_update_mode == OMAP_DSS_UPDATE_MANUAL)
+- dsi_push_update(display, x, y, w, h);
++ dsi_push_update(dssdev, x, y, w, h);
+ /* XXX else return error? */
+
+ mutex_unlock(&dsi.lock);
+@@ -3690,13 +3654,13 @@ static int dsi_display_update(struct omap_display *display,
+ return 0;
+ }
+
+-static int dsi_display_sync(struct omap_display *display)
++static int dsi_display_sync(struct omap_dss_device *dssdev)
+ {
+ DSSDBGF("");
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+ }
+
+-static int dsi_display_set_update_mode(struct omap_display *display,
++static int dsi_display_set_update_mode(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode mode)
+ {
+ DSSDBGF("%d", mode);
+@@ -3704,7 +3668,7 @@ static int dsi_display_set_update_mode(struct omap_display *display,
+ mutex_lock(&dsi.lock);
+
+ if (dsi.target_update_mode != mode) {
+- dsi_push_set_update_mode(display, mode);
++ dsi_push_set_update_mode(dssdev, mode);
+
+ dsi.target_update_mode = mode;
+ dsi.user_update_mode = mode;
+@@ -3712,88 +3676,88 @@ static int dsi_display_set_update_mode(struct omap_display *display,
+
+ mutex_unlock(&dsi.lock);
+
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+ }
+
+ static enum omap_dss_update_mode dsi_display_get_update_mode(
+- struct omap_display *display)
++ struct omap_dss_device *dssdev)
+ {
+ return dsi.update_mode;
+ }
+
+-static int dsi_display_enable_te(struct omap_display *display, bool enable)
++static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ {
+ DSSDBGF("%d", enable);
+
+- if (!display->ctrl->enable_te)
++ if (!dssdev->driver->enable_te)
+ return -ENOENT;
+
+- dsi_push_set_te(display, enable);
++ dsi_push_set_te(dssdev, enable);
+
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+ }
+
+-static int dsi_display_get_te(struct omap_display *display)
++static int dsi_display_get_te(struct omap_dss_device *dssdev)
+ {
+ return dsi.use_te | dsi.use_ext_te;
+ }
+
+
+
+-static int dsi_display_set_rotate(struct omap_display *display, u8 rotate)
++static int dsi_display_set_rotate(struct omap_dss_device *dssdev, u8 rotate)
+ {
+ DSSDBGF("%d", rotate);
+
+- if (!display->ctrl->set_rotate || !display->ctrl->get_rotate)
++ if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
+ return -EINVAL;
+
+- dsi_push_set_rotate(display, rotate);
++ dsi_push_set_rotate(dssdev, rotate);
+
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+ }
+
+-static u8 dsi_display_get_rotate(struct omap_display *display)
++static u8 dsi_display_get_rotate(struct omap_dss_device *dssdev)
+ {
+- if (!display->ctrl->set_rotate || !display->ctrl->get_rotate)
++ if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
+ return 0;
+
+- return display->ctrl->get_rotate(display);
++ return dssdev->driver->get_rotate(dssdev);
+ }
+
+-static int dsi_display_set_mirror(struct omap_display *display, bool mirror)
++static int dsi_display_set_mirror(struct omap_dss_device *dssdev, bool mirror)
+ {
+ DSSDBGF("%d", mirror);
+
+- if (!display->ctrl->set_mirror || !display->ctrl->get_mirror)
++ if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
+ return -EINVAL;
+
+- dsi_push_set_mirror(display, mirror);
++ dsi_push_set_mirror(dssdev, mirror);
+
+- return dsi_wait_sync(display);
++ return dsi_wait_sync(dssdev);
+ }
+
+-static bool dsi_display_get_mirror(struct omap_display *display)
++static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
+ {
+- if (!display->ctrl->set_mirror || !display->ctrl->get_mirror)
++ if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
+ return 0;
+
+- return display->ctrl->get_mirror(display);
++ return dssdev->driver->get_mirror(dssdev);
+ }
+
+-static int dsi_display_run_test(struct omap_display *display, int test_num)
++static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num)
+ {
+ long wait = msecs_to_jiffies(60000);
+ struct completion compl;
+ int result;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EIO;
+
+ DSSDBGF("%d", test_num);
+
+ init_completion(&compl);
+
+- dsi_push_test(display, test_num, &result, &compl);
++ dsi_push_test(dssdev, test_num, &result, &compl);
+
+ DSSDBG("Waiting for SYNC to happen...\n");
+ wait = wait_for_completion_timeout(&compl, wait);
+@@ -3807,7 +3771,7 @@ static int dsi_display_run_test(struct omap_display *display, int test_num)
+ return result;
+ }
+
+-static int dsi_display_memory_read(struct omap_display *display,
++static int dsi_display_memory_read(struct omap_dss_device *dssdev,
+ void *buf, size_t size,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+@@ -3818,10 +3782,10 @@ static int dsi_display_memory_read(struct omap_display *display,
+
+ DSSDBGF("");
+
+- if (!display->ctrl->memory_read)
++ if (!dssdev->driver->memory_read)
+ return -EINVAL;
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EIO;
+
+ init_completion(&compl);
+@@ -3835,7 +3799,7 @@ static int dsi_display_memory_read(struct omap_display *display,
+ mem_read.ret_size = &ret_size;
+ mem_read.completion = &compl;
+
+- dsi_push_mem_read(display, &mem_read);
++ dsi_push_mem_read(dssdev, &mem_read);
+
+ DSSDBG("Waiting for SYNC to happen...\n");
+ wait = wait_for_completion_timeout(&compl, wait);
+@@ -3865,39 +3829,39 @@ static void dsi_configure_overlay(struct omap_overlay *ovl)
+ dispc_setup_plane_fifo(plane, low, high);
+ }
+
+-void dsi_init_display(struct omap_display *display)
++void dsi_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("DSI init\n");
+
+- display->enable = dsi_display_enable;
+- display->disable = dsi_display_disable;
+- display->suspend = dsi_display_suspend;
+- display->resume = dsi_display_resume;
+- display->update = dsi_display_update;
+- display->sync = dsi_display_sync;
+- display->set_update_mode = dsi_display_set_update_mode;
+- display->get_update_mode = dsi_display_get_update_mode;
+- display->enable_te = dsi_display_enable_te;
+- display->get_te = dsi_display_get_te;
++ dssdev->enable = dsi_display_enable;
++ dssdev->disable = dsi_display_disable;
++ dssdev->suspend = dsi_display_suspend;
++ dssdev->resume = dsi_display_resume;
++ dssdev->update = dsi_display_update;
++ dssdev->sync = dsi_display_sync;
++ dssdev->set_update_mode = dsi_display_set_update_mode;
++ dssdev->get_update_mode = dsi_display_get_update_mode;
++ dssdev->enable_te = dsi_display_enable_te;
++ dssdev->get_te = dsi_display_get_te;
+
+- display->get_rotate = dsi_display_get_rotate;
+- display->set_rotate = dsi_display_set_rotate;
++ dssdev->get_rotate = dsi_display_get_rotate;
++ dssdev->set_rotate = dsi_display_set_rotate;
+
+- display->get_mirror = dsi_display_get_mirror;
+- display->set_mirror = dsi_display_set_mirror;
++ dssdev->get_mirror = dsi_display_get_mirror;
++ dssdev->set_mirror = dsi_display_set_mirror;
+
+- display->run_test = dsi_display_run_test;
+- display->memory_read = dsi_display_memory_read;
++ dssdev->run_test = dsi_display_run_test;
++ dssdev->memory_read = dsi_display_memory_read;
+
+- display->configure_overlay = dsi_configure_overlay;
++ dssdev->configure_overlay = dsi_configure_overlay;
+
+- display->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++ dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
+
+- dsi.vc[0].display = display;
+- dsi.vc[1].display = display;
++ dsi.vc[0].dssdev = dssdev;
++ dsi.vc[1].dssdev = dssdev;
+ }
+
+-int dsi_init(void)
++int dsi_init(struct platform_device *pdev)
+ {
+ u32 rev;
+
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index d51ffe4..6180968 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -163,17 +163,22 @@ void dss_clk_disable(enum dss_clock clks);
+ unsigned long dss_clk_get_rate(enum dss_clock clk);
+ int dss_need_ctx_restore(void);
+ void dss_dump_clocks(struct seq_file *s);
+-
++struct bus_type *dss_get_bus(void);
+ int dss_dsi_power_up(void);
+ void dss_dsi_power_down(void);
+
++#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
++#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
++
+ /* display */
+-void dss_init_displays(struct platform_device *pdev);
+-void dss_uninit_displays(struct platform_device *pdev);
+-int dss_suspend_all_displays(void);
+-int dss_resume_all_displays(void);
+-struct omap_display *dss_get_display(int no);
+-bool dss_use_replication(struct omap_display *display,
++int dss_suspend_all_devices(void);
++int dss_resume_all_devices(void);
++
++void dss_init_device(struct platform_device *pdev,
++ struct omap_dss_device *dssdev);
++void dss_uninit_device(struct platform_device *pdev,
++ struct omap_dss_device *dssdev);
++bool dss_use_replication(struct omap_dss_device *dssdev,
+ enum omap_color_mode mode);
+
+ /* manager */
+@@ -181,10 +186,11 @@ int dss_init_overlay_managers(struct platform_device *pdev);
+ void dss_uninit_overlay_managers(struct platform_device *pdev);
+
+ /* overlay */
+-void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name);
++void dss_init_overlays(struct platform_device *pdev);
+ void dss_uninit_overlays(struct platform_device *pdev);
+-int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display);
++int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev);
+ void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
++void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
+
+ /* DSS */
+ int dss_init(bool skip_init);
+@@ -208,10 +214,10 @@ void dss_set_dac_pwrdn_bgz(bool enable);
+ /* SDI */
+ int sdi_init(bool skip_init);
+ void sdi_exit(void);
+-void sdi_init_display(struct omap_display *display);
++void sdi_init_display(struct omap_dss_device *display);
+
+ /* DSI */
+-int dsi_init(void);
++int dsi_init(struct platform_device *pdev);
+ void dsi_exit(void);
+
+ void dsi_dump_clocks(struct seq_file *s);
+@@ -220,7 +226,7 @@ void dsi_dump_regs(struct seq_file *s);
+ void dsi_save_context(void);
+ void dsi_restore_context(void);
+
+-void dsi_init_display(struct omap_display *display);
++void dsi_init_display(struct omap_dss_device *display);
+ void dsi_irq_handler(void);
+ unsigned long dsi_get_dsi1_pll_rate(void);
+ unsigned long dsi_get_dsi2_pll_rate(void);
+@@ -233,7 +239,7 @@ void dsi_pll_uninit(void);
+ /* DPI */
+ int dpi_init(void);
+ void dpi_exit(void);
+-void dpi_init_display(struct omap_display *display);
++void dpi_init_display(struct omap_dss_device *dssdev);
+
+ /* DISPC */
+ int dispc_init(void);
+@@ -306,7 +312,7 @@ void dispc_set_lcd_timings(struct omap_video_timings *timings);
+ unsigned long dispc_fclk_rate(void);
+ unsigned long dispc_lclk_rate(void);
+ unsigned long dispc_pclk_rate(void);
+-void dispc_set_pol_freq(struct omap_panel *panel);
++void dispc_set_pol_freq(enum omap_panel_config config, u8 acbi, u8 acb);
+ void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+ u16 *lck_div, u16 *pck_div);
+ int dispc_calc_clock_div(bool is_tft, unsigned long req_pck,
+@@ -315,16 +321,16 @@ int dispc_set_clock_div(struct dispc_clock_info *cinfo);
+ int dispc_get_clock_div(struct dispc_clock_info *cinfo);
+ void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div);
+
+-void dispc_setup_partial_planes(struct omap_display *display,
++void dispc_setup_partial_planes(struct omap_dss_device *dssdev,
+ u16 *x, u16 *y, u16 *w, u16 *h);
+-void dispc_draw_partial_planes(struct omap_display *display);
++void dispc_draw_partial_planes(struct omap_dss_device *dssdev);
+
+
+ /* VENC */
+-int venc_init(void);
++int venc_init(struct platform_device *pdev);
+ void venc_exit(void);
+ void venc_dump_regs(struct seq_file *s);
+-void venc_init_display(struct omap_display *display);
++void venc_init_display(struct omap_dss_device *display);
+
+ /* RFBI */
+ int rfbi_init(void);
+@@ -337,6 +343,6 @@ void rfbi_transfer_area(u16 width, u16 height,
+ void (callback)(void *data), void *data);
+ void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t);
+ unsigned long rfbi_get_max_tx_rate(void);
+-void rfbi_init_display(struct omap_display *display);
++void rfbi_init_display(struct omap_dss_device *display);
+
+ #endif
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 8d5d00f..c68b9af 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -41,58 +41,68 @@ static ssize_t manager_name_show(struct omap_overlay_manager *mgr, char *buf)
+ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
+ {
+ return snprintf(buf, PAGE_SIZE, "%s\n",
+- mgr->display ? mgr->display->name : "<none>");
++ mgr->device ? mgr->device->name : "<none>");
+ }
+
+ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const char *buf, size_t size)
+ {
+- int r, i;
+- int len = size;
+- struct omap_display *display = NULL;
++ int r = 0;
++ size_t len = size;
++ struct omap_dss_device *dssdev = NULL;
++
++ int match(struct omap_dss_device *dssdev, void *data)
++ {
++ const char *str = data;
++ return strcmp(dssdev->name, str) == 0;
++ }
+
+ if (buf[size-1] == '\n')
+ --len;
+
+ if (len > 0) {
+- for (i = 0; i < omap_dss_get_num_displays(); ++i) {
+- display = dss_get_display(i);
++ char name[64];
++ int n;
+
+- if (strncmp(buf, display->name, len) == 0)
+- break;
++ n = min(len, sizeof(name) - 1);
++ strncpy(name, buf, n);
++ name[n - 1] = 0;
+
+- display = NULL;
+- }
++ dssdev = omap_dss_find_device(name, match);
+ }
+
+- if (len > 0 && display == NULL)
++ if (len > 0 && dssdev == NULL)
+ return -EINVAL;
+
+- if (display)
+- DSSDBG("display %s found\n", display->name);
++ if (dssdev)
++ DSSDBG("display %s found\n", dssdev->name);
+
+- if (mgr->display) {
+- r = mgr->unset_display(mgr);
++ if (mgr->device) {
++ r = mgr->unset_device(mgr);
+ if (r) {
+ DSSERR("failed to unset display\n");
+- return r;
++ goto put_device;
+ }
+ }
+
+- if (display) {
+- r = mgr->set_display(mgr, display);
++ if (dssdev) {
++ r = mgr->set_device(mgr, dssdev);
+ if (r) {
+ DSSERR("failed to set manager\n");
+- return r;
++ goto put_device;
+ }
+
+ r = mgr->apply(mgr);
+ if (r) {
+ DSSERR("failed to apply dispc config\n");
+- return r;
++ goto put_device;
+ }
+ }
+
+- return size;
++put_device:
++ if (dssdev)
++ omap_dss_put_device(dssdev);
++
++ return r ? r : size;
+ }
+
+ static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
+@@ -334,21 +344,21 @@ static struct kobj_type manager_ktype = {
+ .default_attrs = manager_sysfs_attrs,
+ };
+
+-static int omap_dss_set_display(struct omap_overlay_manager *mgr,
+- struct omap_display *display)
++static int omap_dss_set_device(struct omap_overlay_manager *mgr,
++ struct omap_dss_device *dssdev)
+ {
+ int i;
+ int r;
+
+- if (display->manager) {
++ if (dssdev->manager) {
+ DSSERR("display '%s' already has a manager '%s'\n",
+- display->name, display->manager->name);
++ dssdev->name, dssdev->manager->name);
+ return -EINVAL;
+ }
+
+- if ((mgr->supported_displays & display->type) == 0) {
++ if ((mgr->supported_displays & dssdev->type) == 0) {
+ DSSERR("display '%s' does not support manager '%s'\n",
+- display->name, mgr->name);
++ dssdev->name, mgr->name);
+ return -EINVAL;
+ }
+
+@@ -358,26 +368,26 @@ static int omap_dss_set_display(struct omap_overlay_manager *mgr,
+ if (ovl->manager != mgr || !ovl->info.enabled)
+ continue;
+
+- r = dss_check_overlay(ovl, display);
++ r = dss_check_overlay(ovl, dssdev);
+ if (r)
+ return r;
+ }
+
+- display->manager = mgr;
+- mgr->display = display;
++ dssdev->manager = mgr;
++ mgr->device = dssdev;
+
+ return 0;
+ }
+
+-static int omap_dss_unset_display(struct omap_overlay_manager *mgr)
++static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
+ {
+- if (!mgr->display) {
++ if (!mgr->device) {
+ DSSERR("failed to unset display, display not set.\n");
+ return -EINVAL;
+ }
+
+- mgr->display->manager = NULL;
+- mgr->display = NULL;
++ mgr->device->manager = NULL;
++ mgr->device = NULL;
+
+ return 0;
+ }
+@@ -385,7 +395,7 @@ static int omap_dss_unset_display(struct omap_overlay_manager *mgr)
+
+ static int overlay_enabled(struct omap_overlay *ovl)
+ {
+- return ovl->info.enabled && ovl->manager && ovl->manager->display;
++ return ovl->info.enabled && ovl->manager && ovl->manager->device;
+ }
+
+ /* We apply settings to both managers here so that we can use optimizations
+@@ -396,7 +406,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ int i;
+ int ret = 0;
+ enum omap_dss_update_mode mode;
+- struct omap_display *display;
++ struct omap_dss_device *dssdev;
+ struct omap_overlay *ovl;
+ bool ilace = 0;
+ int outw, outh;
+@@ -419,9 +429,9 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ continue;
+ }
+
+- display = ovl->manager->display;
++ dssdev = ovl->manager->device;
+
+- if (dss_check_overlay(ovl, display)) {
++ if (dss_check_overlay(ovl, dssdev)) {
+ dispc_enable_plane(ovl->id, 0);
+ continue;
+ }
+@@ -431,14 +441,14 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ /* On a manual update display, in manual update mode, update()
+ * handles configuring planes */
+ mode = OMAP_DSS_UPDATE_AUTO;
+- if (display->get_update_mode)
+- mode = display->get_update_mode(mgr->display);
++ if (dssdev->get_update_mode)
++ mode = dssdev->get_update_mode(dssdev);
+
+- if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
++ if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
+ mode != OMAP_DSS_UPDATE_AUTO)
+ continue;
+
+- if (display->type == OMAP_DISPLAY_TYPE_VENC)
++ if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
+ ilace = 1;
+
+ if (ovl->info.out_width == 0)
+@@ -474,7 +484,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ continue;
+ }
+
+- if (dss_use_replication(display, ovl->info.color_mode))
++ if (dss_use_replication(dssdev, ovl->info.color_mode))
+ dispc_enable_replication(ovl->id, true);
+ else
+ dispc_enable_replication(ovl->id, false);
+@@ -498,7 +508,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ continue;
+ }
+
+- ovl->manager->display->configure_overlay(ovl);
++ ovl->manager->device->configure_overlay(ovl);
+ }
+
+ /* Issue GO for managers */
+@@ -506,15 +516,15 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ if (!(mgr->caps & OMAP_DSS_OVL_MGR_CAP_DISPC))
+ continue;
+
+- display = mgr->display;
++ dssdev = mgr->device;
+
+- if (!display)
++ if (!dssdev)
+ continue;
+
+ /* We don't need GO with manual update display. LCD iface will
+ * always be turned off after frame, and new settings will
+ * be taken in to use at next update */
+- if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
++ if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
+ continue;
+
+ dispc_go(mgr->id);
+@@ -605,8 +615,8 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ break;
+ }
+
+- mgr->set_display = &omap_dss_set_display;
+- mgr->unset_display = &omap_dss_unset_display;
++ mgr->set_device = &omap_dss_set_device;
++ mgr->unset_device = &omap_dss_unset_device;
+ mgr->apply = &omap_dss_mgr_apply;
+ mgr->set_default_color = &omap_dss_mgr_set_def_color;
+ mgr->set_trans_key_type_and_value =
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 035a57a..3704727 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -301,13 +301,13 @@ static struct kobj_type overlay_ktype = {
+ };
+
+ /* Check if overlay parameters are compatible with display */
+-int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
++int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
+ {
+ struct omap_overlay_info *info;
+ u16 outw, outh;
+ u16 dw, dh;
+
+- if (!display)
++ if (!dssdev)
+ return 0;
+
+ if (!ovl->info.enabled)
+@@ -320,7 +320,7 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
+ return -EINVAL;
+ }
+
+- display->get_resolution(display, &dw, &dh);
++ dssdev->get_resolution(dssdev, &dw, &dh);
+
+ DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
+ ovl->id,
+@@ -374,7 +374,7 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
+ ovl->info = *info;
+
+ if (ovl->manager) {
+- r = dss_check_overlay(ovl, ovl->manager->display);
++ r = dss_check_overlay(ovl, ovl->manager->device);
+ if (r) {
+ ovl->info = old_info;
+ return r;
+@@ -400,7 +400,7 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
+ ovl->name, ovl->manager->name);
+ }
+
+- r = dss_check_overlay(ovl, mgr->display);
++ r = dss_check_overlay(ovl, mgr->device);
+ if (r)
+ return r;
+
+@@ -455,12 +455,9 @@ void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr)
+ mgr->overlays = dispc_overlays;
+ }
+
+-void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
++void dss_init_overlays(struct platform_device *pdev)
+ {
+ int i, r;
+- struct omap_overlay_manager *lcd_mgr;
+- struct omap_overlay_manager *tv_mgr;
+- struct omap_overlay_manager *def_mgr = NULL;
+
+ INIT_LIST_HEAD(&overlay_list);
+
+@@ -515,71 +512,49 @@ void dss_init_overlays(struct platform_device *pdev, const char *def_disp_name)
+
+ dispc_overlays[i] = ovl;
+ }
++}
++
++/* connect overlays to the new device, if not already connected. if force
++ * selected, connect always. */
++void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
++{
++ int i;
++ struct omap_overlay_manager *lcd_mgr;
++ struct omap_overlay_manager *tv_mgr;
++ struct omap_overlay_manager *mgr = NULL;
+
+ lcd_mgr = omap_dss_get_overlay_manager(OMAP_DSS_OVL_MGR_LCD);
+ tv_mgr = omap_dss_get_overlay_manager(OMAP_DSS_OVL_MGR_TV);
+
+- if (def_disp_name) {
+- for (i = 0; i < omap_dss_get_num_displays() ; i++) {
+- struct omap_display *display = dss_get_display(i);
+-
+- if (strcmp(display->name, def_disp_name) == 0) {
+- if (display->type != OMAP_DISPLAY_TYPE_VENC) {
+- lcd_mgr->set_display(lcd_mgr, display);
+- def_mgr = lcd_mgr;
+- } else {
+- lcd_mgr->set_display(tv_mgr, display);
+- def_mgr = tv_mgr;
+- }
+-
+- break;
+- }
+- }
+-
+- if (!def_mgr)
+- DSSWARN("default display %s not found\n",
+- def_disp_name);
+- }
+-
+- if (def_mgr != lcd_mgr) {
+- /* connect lcd manager to first non-VENC display found */
+- for (i = 0; i < omap_dss_get_num_displays(); i++) {
+- struct omap_display *display = dss_get_display(i);
+- if (display->type != OMAP_DISPLAY_TYPE_VENC) {
+- lcd_mgr->set_display(lcd_mgr, display);
+-
+- if (!def_mgr)
+- def_mgr = lcd_mgr;
+-
+- break;
+- }
++ if (dssdev->type != OMAP_DISPLAY_TYPE_VENC) {
++ if (!lcd_mgr->device || force) {
++ if (lcd_mgr->device)
++ lcd_mgr->unset_device(lcd_mgr);
++ lcd_mgr->set_device(lcd_mgr, dssdev);
++ mgr = lcd_mgr;
+ }
+ }
+
+- if (def_mgr != tv_mgr) {
+- /* connect tv manager to first VENC display found */
+- for (i = 0; i < omap_dss_get_num_displays(); i++) {
+- struct omap_display *display = dss_get_display(i);
+- if (display->type == OMAP_DISPLAY_TYPE_VENC) {
+- tv_mgr->set_display(tv_mgr, display);
+-
+- if (!def_mgr)
+- def_mgr = tv_mgr;
+-
+- break;
+- }
++ if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) {
++ if (!tv_mgr->device || force) {
++ if (tv_mgr->device)
++ tv_mgr->unset_device(tv_mgr);
++ tv_mgr->set_device(tv_mgr, dssdev);
++ mgr = tv_mgr;
+ }
+ }
+
+- /* connect all dispc overlays to def_mgr */
+- if (def_mgr) {
++ if (mgr) {
+ for (i = 0; i < 3; i++) {
+ struct omap_overlay *ovl;
+ ovl = omap_dss_get_overlay(i);
+- omap_dss_set_manager(ovl, def_mgr);
++ if (!ovl->manager || force) {
++ if (ovl->manager)
++ omap_dss_unset_manager(ovl);
++ omap_dss_set_manager(ovl, mgr);
++ }
+ }
+ }
+-
+ #ifdef L4_EXAMPLE
+ /* setup L4 overlay as an example */
+ {
+diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
+index 3e9ae1e..e3cf799 100644
+--- a/drivers/video/omap2/dss/rfbi.c
++++ b/drivers/video/omap2/dss/rfbi.c
+@@ -119,7 +119,7 @@ static struct {
+ void (*framedone_callback)(void *data);
+ void *framedone_callback_data;
+
+- struct omap_display *display[2];
++ struct omap_dss_device *dssdev[2];
+
+ struct kfifo *cmd_fifo;
+ spinlock_t cmd_lock;
+@@ -938,12 +938,12 @@ int rfbi_configure(int rfbi_module, int bpp, int lines)
+ }
+ EXPORT_SYMBOL(rfbi_configure);
+
+-static int rfbi_find_display(struct omap_display *disp)
++static int rfbi_find_display(struct omap_dss_device *dssdev)
+ {
+- if (disp == rfbi.display[0])
++ if (dssdev == rfbi.dssdev[0])
+ return 0;
+
+- if (disp == rfbi.display[1])
++ if (dssdev == rfbi.dssdev[1])
+ return 1;
+
+ BUG();
+@@ -961,7 +961,7 @@ static void signal_fifo_waiters(void)
+ }
+
+ /* returns 1 for async op, and 0 for sync op */
+-static int do_update(struct omap_display *display, struct update_region *upd)
++static int do_update(struct omap_dss_device *dssdev, struct update_region *upd)
+ {
+ u16 x = upd->x;
+ u16 y = upd->y;
+@@ -970,18 +970,18 @@ static int do_update(struct omap_display *display, struct update_region *upd)
+
+ perf_mark_setup();
+
+- if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+- /*display->ctrl->enable_te(display, 1); */
+- dispc_setup_partial_planes(display, &x, &y, &w, &h);
++ if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ /*dssdev->driver->enable_te(dssdev, 1); */
++ dispc_setup_partial_planes(dssdev, &x, &y, &w, &h);
+ }
+
+ #ifdef MEASURE_PERF
+ rfbi.perf_bytes = w * h * 2; /* XXX always 16bit */
+ #endif
+
+- display->ctrl->setup_update(display, x, y, w, h);
++ dssdev->driver->setup_update(dssdev, x, y, w, h);
+
+- if (display->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+ rfbi_transfer_area(w, h, NULL, NULL);
+ return 1;
+ } else {
+@@ -989,7 +989,7 @@ static int do_update(struct omap_display *display, struct update_region *upd)
+ void __iomem *addr;
+ int scr_width;
+
+- ovl = display->manager->overlays[0];
++ ovl = dssdev->manager->overlays[0];
+ scr_width = ovl->info.screen_width;
+ addr = ovl->info.vaddr;
+
+@@ -1005,7 +1005,7 @@ static void process_cmd_fifo(void)
+ {
+ int len;
+ struct update_param p;
+- struct omap_display *display;
++ struct omap_dss_device *dssdev;
+ unsigned long flags;
+
+ if (atomic_inc_return(&rfbi.cmd_pending) != 1)
+@@ -1030,10 +1030,10 @@ static void process_cmd_fifo(void)
+ BUG_ON(len != sizeof(struct update_param));
+ BUG_ON(p.rfbi_module > 1);
+
+- display = rfbi.display[p.rfbi_module];
++ dssdev = rfbi.dssdev[p.rfbi_module];
+
+ if (p.cmd == RFBI_CMD_UPDATE) {
+- if (do_update(display, &p.par.r))
++ if (do_update(dssdev, &p.par.r))
+ break; /* async op */
+ } else if (p.cmd == RFBI_CMD_SYNC) {
+ DSSDBG("Signaling SYNC done!\n");
+@@ -1203,7 +1203,7 @@ void rfbi_exit(void)
+ }
+
+ /* struct omap_display support */
+-static int rfbi_display_update(struct omap_display *display,
++static int rfbi_display_update(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+ int rfbi_module;
+@@ -1211,19 +1211,19 @@ static int rfbi_display_update(struct omap_display *display,
+ if (w == 0 || h == 0)
+ return 0;
+
+- rfbi_module = rfbi_find_display(display);
++ rfbi_module = rfbi_find_display(dssdev);
+
+ rfbi_push_update(rfbi_module, x, y, w, h);
+
+ return 0;
+ }
+
+-static int rfbi_display_sync(struct omap_display *display)
++static int rfbi_display_sync(struct omap_dss_device *dssdev)
+ {
+ struct completion sync_comp;
+ int rfbi_module;
+
+- rfbi_module = rfbi_find_display(display);
++ rfbi_module = rfbi_find_display(dssdev);
+
+ init_completion(&sync_comp);
+ rfbi_push_sync(rfbi_module, &sync_comp);
+@@ -1233,72 +1233,76 @@ static int rfbi_display_sync(struct omap_display *display)
+ return 0;
+ }
+
+-static int rfbi_display_enable_te(struct omap_display *display, bool enable)
++static int rfbi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ {
+- display->ctrl->enable_te(display, enable);
++ dssdev->driver->enable_te(dssdev, enable);
+ return 0;
+ }
+
+-static int rfbi_display_enable(struct omap_display *display)
++static int rfbi_display_enable(struct omap_dss_device *dssdev)
+ {
+ int r;
+
+- BUG_ON(display->panel == NULL || display->ctrl == NULL);
++ r = omap_dss_start_device(dssdev);
++ if (r) {
++ DSSERR("failed to start device\n");
++ goto err0;
++ }
+
+ r = omap_dispc_register_isr(framedone_callback, NULL,
+ DISPC_IRQ_FRAMEDONE);
+ if (r) {
+ DSSERR("can't get FRAMEDONE irq\n");
+- return r;
++ goto err1;
+ }
+
+ dispc_set_lcd_display_type(OMAP_DSS_LCD_DISPLAY_TFT);
+
+ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_RFBI);
+
+- dispc_set_tft_data_lines(display->ctrl->pixel_size);
++ dispc_set_tft_data_lines(dssdev->ctrl.pixel_size);
+
+- rfbi_configure(display->hw_config.u.rfbi.channel,
+- display->ctrl->pixel_size,
+- display->hw_config.u.rfbi.data_lines);
++ rfbi_configure(dssdev->phy.rfbi.channel,
++ dssdev->ctrl.pixel_size,
++ dssdev->phy.rfbi.data_lines);
+
+- rfbi_set_timings(display->hw_config.u.rfbi.channel,
+- &display->ctrl->timings);
++ rfbi_set_timings(dssdev->phy.rfbi.channel,
++ &dssdev->ctrl.rfbi_timings);
+
+
+- if (display->ctrl && display->ctrl->enable) {
+- r = display->ctrl->enable(display);
++ if (dssdev->driver->enable) {
++ r = dssdev->driver->enable(dssdev);
+ if (r)
+- goto err;
+- }
+-
+- if (display->panel && display->panel->enable) {
+- r = display->panel->enable(display);
+- if (r)
+- goto err;
++ goto err2;
+ }
+
+ return 0;
+-err:
+- return -ENODEV;
++err2:
++ omap_dispc_unregister_isr(framedone_callback, NULL,
++ DISPC_IRQ_FRAMEDONE);
++err1:
++ omap_dss_stop_device(dssdev);
++err0:
++ return r;
+ }
+
+-static void rfbi_display_disable(struct omap_display *display)
++static void rfbi_display_disable(struct omap_dss_device *dssdev)
+ {
+- display->ctrl->disable(display);
++ dssdev->driver->disable(dssdev);
+ omap_dispc_unregister_isr(framedone_callback, NULL,
+ DISPC_IRQ_FRAMEDONE);
++ omap_dss_stop_device(dssdev);
+ }
+
+-void rfbi_init_display(struct omap_display *display)
++void rfbi_init_display(struct omap_dss_device *dssdev)
+ {
+- display->enable = rfbi_display_enable;
+- display->disable = rfbi_display_disable;
+- display->update = rfbi_display_update;
+- display->sync = rfbi_display_sync;
+- display->enable_te = rfbi_display_enable_te;
++ dssdev->enable = rfbi_display_enable;
++ dssdev->disable = rfbi_display_disable;
++ dssdev->update = rfbi_display_update;
++ dssdev->sync = rfbi_display_sync;
++ dssdev->enable_te = rfbi_display_enable_te;
+
+- rfbi.display[display->hw_config.u.rfbi.channel] = display;
++ rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev;
+
+- display->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++ dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
+ }
+diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
+index fbff2b2..393fcd5 100644
+--- a/drivers/video/omap2/dss/sdi.c
++++ b/drivers/video/omap2/dss/sdi.c
+@@ -43,18 +43,25 @@ static void sdi_basic_init(void)
+ dispc_lcd_enable_signal_polarity(1);
+ }
+
+-static int sdi_display_enable(struct omap_display *display)
++static int sdi_display_enable(struct omap_dss_device *dssdev)
+ {
++ struct omap_video_timings *t = &dssdev->panel.timings;
+ struct dispc_clock_info cinfo;
+ u16 lck_div, pck_div;
+ unsigned long fck;
+- struct omap_panel *panel = display->panel;
+ unsigned long pck;
+ int r;
+
+- if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
+- DSSERR("display already enabled\n");
+- return -EINVAL;
++ r = omap_dss_start_device(dssdev);
++ if (r) {
++ DSSERR("failed to start device\n");
++ goto err0;
++ }
++
++ if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
++ DSSERR("dssdev already enabled\n");
++ r = -EINVAL;
++ goto err1;
+ }
+
+ /* In case of skip_init sdi_init has already enabled the clocks */
+@@ -64,18 +71,19 @@ static int sdi_display_enable(struct omap_display *display)
+ sdi_basic_init();
+
+ /* 15.5.9.1.2 */
+- panel->config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
++ dssdev->panel.config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
+
+- dispc_set_pol_freq(panel);
++ dispc_set_pol_freq(dssdev->panel.config, dssdev->panel.acbi,
++ dssdev->panel.acb);
+
+ if (!sdi.skip_init)
+- r = dispc_calc_clock_div(1, panel->timings.pixel_clock * 1000,
++ r = dispc_calc_clock_div(1, t->pixel_clock * 1000,
+ &cinfo);
+ else
+ r = dispc_get_clock_div(&cinfo);
+
+ if (r)
+- goto err0;
++ goto err2;
+
+ fck = cinfo.fck;
+ lck_div = cinfo.lck_div;
+@@ -83,57 +91,62 @@ static int sdi_display_enable(struct omap_display *display)
+
+ pck = fck / lck_div / pck_div / 1000;
+
+- if (pck != panel->timings.pixel_clock) {
++ if (pck != t->pixel_clock) {
+ DSSWARN("Could not find exact pixel clock. Requested %d kHz, "
+ "got %lu kHz\n",
+- panel->timings.pixel_clock, pck);
++ t->pixel_clock, pck);
+
+- panel->timings.pixel_clock = pck;
++ t->pixel_clock = pck;
+ }
+
+
+- dispc_set_lcd_timings(&panel->timings);
++ dispc_set_lcd_timings(t);
+
+ r = dispc_set_clock_div(&cinfo);
+ if (r)
+- goto err1;
++ goto err2;
+
+ if (!sdi.skip_init) {
+- dss_sdi_init(display->hw_config.u.sdi.datapairs);
++ dss_sdi_init(dssdev->phy.sdi.datapairs);
+ dss_sdi_enable();
+ mdelay(2);
+ }
+
+ dispc_enable_lcd_out(1);
+
+- r = panel->enable(display);
+- if (r)
+- goto err2;
++ if (dssdev->driver->enable) {
++ r = dssdev->driver->enable(dssdev);
++ if (r)
++ goto err3;
++ }
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ sdi.skip_init = 0;
+
+ return 0;
+-err2:
++err3:
+ dispc_enable_lcd_out(0);
++err2:
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+ err1:
++ omap_dss_stop_device(dssdev);
+ err0:
+- dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+ return r;
+ }
+
+-static int sdi_display_resume(struct omap_display *display);
++static int sdi_display_resume(struct omap_dss_device *dssdev);
+
+-static void sdi_display_disable(struct omap_display *display)
++static void sdi_display_disable(struct omap_dss_device *dssdev)
+ {
+- if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED)
+ return;
+
+- if (display->state == OMAP_DSS_DISPLAY_SUSPENDED)
+- sdi_display_resume(display);
++ if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
++ sdi_display_resume(dssdev);
+
+- display->panel->disable(display);
++ if (dssdev->driver->disable)
++ dssdev->driver->disable(dssdev);
+
+ dispc_enable_lcd_out(0);
+
+@@ -141,16 +154,18 @@ static void sdi_display_disable(struct omap_display *display)
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
++ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
++
++ omap_dss_stop_device(dssdev);
+ }
+
+-static int sdi_display_suspend(struct omap_display *display)
++static int sdi_display_suspend(struct omap_dss_device *dssdev)
+ {
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE)
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EINVAL;
+
+- if (display->panel->suspend)
+- display->panel->suspend(display);
++ if (dssdev->driver->suspend)
++ dssdev->driver->suspend(dssdev);
+
+ dispc_enable_lcd_out(0);
+
+@@ -158,14 +173,14 @@ static int sdi_display_suspend(struct omap_display *display)
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+ return 0;
+ }
+
+-static int sdi_display_resume(struct omap_display *display)
++static int sdi_display_resume(struct omap_dss_device *dssdev)
+ {
+- if (display->state != OMAP_DSS_DISPLAY_SUSPENDED)
++ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
+ return -EINVAL;
+
+ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+@@ -175,15 +190,15 @@ static int sdi_display_resume(struct omap_display *display)
+
+ dispc_enable_lcd_out(1);
+
+- if (display->panel->resume)
+- display->panel->resume(display);
++ if (dssdev->driver->resume)
++ dssdev->driver->resume(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+ }
+
+-static int sdi_display_set_update_mode(struct omap_display *display,
++static int sdi_display_set_update_mode(struct omap_dss_device *dssdev,
+ enum omap_dss_update_mode mode)
+ {
+ if (mode == OMAP_DSS_UPDATE_MANUAL)
+@@ -201,29 +216,29 @@ static int sdi_display_set_update_mode(struct omap_display *display,
+ }
+
+ static enum omap_dss_update_mode sdi_display_get_update_mode(
+- struct omap_display *display)
++ struct omap_dss_device *dssdev)
+ {
+ return sdi.update_enabled ? OMAP_DSS_UPDATE_AUTO :
+ OMAP_DSS_UPDATE_DISABLED;
+ }
+
+-static void sdi_get_timings(struct omap_display *display,
++static void sdi_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+- *timings = display->panel->timings;
++ *timings = dssdev->panel.timings;
+ }
+
+-void sdi_init_display(struct omap_display *display)
++void sdi_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("SDI init\n");
+
+- display->enable = sdi_display_enable;
+- display->disable = sdi_display_disable;
+- display->suspend = sdi_display_suspend;
+- display->resume = sdi_display_resume;
+- display->set_update_mode = sdi_display_set_update_mode;
+- display->get_update_mode = sdi_display_get_update_mode;
+- display->get_timings = sdi_get_timings;
++ dssdev->enable = sdi_display_enable;
++ dssdev->disable = sdi_display_disable;
++ dssdev->suspend = sdi_display_suspend;
++ dssdev->resume = sdi_display_resume;
++ dssdev->set_update_mode = sdi_display_set_update_mode;
++ dssdev->get_update_mode = sdi_display_get_update_mode;
++ dssdev->get_timings = sdi_get_timings;
+ }
+
+ int sdi_init(bool skip_init)
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index b0f0795..a83d170 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -31,6 +31,7 @@
+ #include <linux/delay.h>
+ #include <linux/string.h>
+ #include <linux/seq_file.h>
++#include <linux/platform_device.h>
+
+ #include <mach/display.h>
+ #include <mach/cpu.h>
+@@ -292,10 +293,6 @@ static struct {
+ u32 wss_data;
+ } venc;
+
+-static struct omap_panel venc_panel = {
+- .name = "tv-out",
+-};
+-
+ static inline void venc_write_reg(int idx, u32 val)
+ {
+ __raw_writel(val, venc.base + idx);
+@@ -400,7 +397,76 @@ static const struct venc_config *venc_timings_to_config(
+ BUG();
+ }
+
+-int venc_init(void)
++
++
++
++
++/* driver */
++static int venc_panel_probe(struct omap_dss_device *dssdev)
++{
++ //dssdev->name = "tv-out";
++ dssdev->panel.timings = omap_dss_pal_timings;
++
++ return 0;
++}
++
++static void venc_panel_remove(struct omap_dss_device *dssdev)
++{
++}
++
++static int venc_panel_enable(struct omap_dss_device *dssdev)
++{
++ int r = 0;
++
++ /* wait couple of vsyncs until enabling the LCD */
++ msleep(50);
++
++ if (dssdev->platform_enable)
++ r = dssdev->platform_enable(dssdev);
++
++ return r;
++}
++
++static void venc_panel_disable(struct omap_dss_device *dssdev)
++{
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
++
++ /* wait at least 5 vsyncs after disabling the LCD */
++
++ msleep(100);
++}
++
++static int venc_panel_suspend(struct omap_dss_device *dssdev)
++{
++ venc_panel_disable(dssdev);
++ return 0;
++}
++
++static int venc_panel_resume(struct omap_dss_device *dssdev)
++{
++ return venc_panel_enable(dssdev);
++}
++
++static struct omap_dss_driver venc_driver = {
++ .probe = venc_panel_probe,
++ .remove = venc_panel_remove,
++
++ .enable = venc_panel_enable,
++ .disable = venc_panel_disable,
++ .suspend = venc_panel_suspend,
++ .resume = venc_panel_resume,
++
++ .driver = {
++ .name = "venc",
++ .owner = THIS_MODULE,
++ },
++};
++/* driver end */
++
++
++
++int venc_init(struct platform_device *pdev)
+ {
+ u8 rev_id;
+
+@@ -408,8 +474,6 @@ int venc_init(void)
+
+ venc.wss_data = 0;
+
+- venc_panel.timings = omap_dss_pal_timings;
+-
+ venc.base = ioremap(VENC_BASE, SZ_1K);
+ if (!venc.base) {
+ DSSERR("can't ioremap VENC\n");
+@@ -423,25 +487,29 @@ int venc_init(void)
+
+ venc_enable_clocks(0);
+
+- return 0;
++ return omap_dss_register_driver(&venc_driver);
++
++ //return 0;
+ }
+
+ void venc_exit(void)
+ {
++ omap_dss_unregister_driver(&venc_driver);
++
+ iounmap(venc.base);
+ }
+
+-static void venc_power_on(struct omap_display *display)
++static void venc_power_on(struct omap_dss_device *dssdev)
+ {
+ venc_enable_clocks(1);
+
+ venc_reset();
+- venc_write_config(venc_timings_to_config(&display->panel->timings));
++ venc_write_config(venc_timings_to_config(&dssdev->panel.timings));
+
+- dss_set_venc_output(display->hw_config.u.venc.type);
++ dss_set_venc_output(dssdev->phy.venc.type);
+ dss_set_dac_pwrdn_bgz(1);
+
+- if (display->hw_config.u.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) {
++ if (dssdev->phy.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) {
+ if (cpu_is_omap24xx())
+ venc_write_reg(VENC_OUTPUT_CONTROL, 0x2);
+ else
+@@ -450,29 +518,29 @@ static void venc_power_on(struct omap_display *display)
+ venc_write_reg(VENC_OUTPUT_CONTROL, 0xd);
+ }
+
+- dispc_set_digit_size(display->panel->timings.x_res,
+- display->panel->timings.y_res/2);
++ dispc_set_digit_size(dssdev->panel.timings.x_res,
++ dssdev->panel.timings.y_res/2);
+
+- if (display->hw_config.panel_enable)
+- display->hw_config.panel_enable(display);
++ if (dssdev->platform_enable)
++ dssdev->platform_enable(dssdev);
+
+ dispc_enable_digit_out(1);
+ }
+
+-static void venc_power_off(struct omap_display *display)
++static void venc_power_off(struct omap_dss_device *dssdev)
+ {
+ venc_write_reg(VENC_OUTPUT_CONTROL, 0);
+ dss_set_dac_pwrdn_bgz(0);
+
+ dispc_enable_digit_out(0);
+
+- if (display->hw_config.panel_disable)
+- display->hw_config.panel_disable(display);
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
+
+ venc_enable_clocks(0);
+ }
+
+-static int venc_enable_display(struct omap_display *display)
++static int venc_enable_display(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+@@ -480,43 +548,45 @@ static int venc_enable_display(struct omap_display *display)
+
+ mutex_lock(&venc.venc_lock);
+
+- if (display->state != OMAP_DSS_DISPLAY_DISABLED) {
++ if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
+ r = -EINVAL;
+ goto err;
+ }
+
+- venc_power_on(display);
++ venc_power_on(dssdev);
++
++ venc.wss_data = 0;
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ err:
+ mutex_unlock(&venc.venc_lock);
+
+ return r;
+ }
+
+-static void venc_disable_display(struct omap_display *display)
++static void venc_disable_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("venc_disable_display\n");
+
+ mutex_lock(&venc.venc_lock);
+
+- if (display->state == OMAP_DSS_DISPLAY_DISABLED)
++ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED)
+ goto end;
+
+- if (display->state == OMAP_DSS_DISPLAY_SUSPENDED) {
++ if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) {
+ /* suspended is the same as disabled with venc */
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
++ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+ goto end;
+ }
+
+- venc_power_off(display);
++ venc_power_off(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_DISABLED;
++ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+ end:
+ mutex_unlock(&venc.venc_lock);
+ }
+
+-static int venc_display_suspend(struct omap_display *display)
++static int venc_display_suspend(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+@@ -524,21 +594,21 @@ static int venc_display_suspend(struct omap_display *display)
+
+ mutex_lock(&venc.venc_lock);
+
+- if (display->state != OMAP_DSS_DISPLAY_ACTIVE) {
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
+ r = -EINVAL;
+ goto err;
+ }
+
+- venc_power_off(display);
++ venc_power_off(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_SUSPENDED;
++ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+ err:
+ mutex_unlock(&venc.venc_lock);
+
+ return r;
+ }
+
+-static int venc_display_resume(struct omap_display *display)
++static int venc_display_resume(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+@@ -546,44 +616,44 @@ static int venc_display_resume(struct omap_display *display)
+
+ mutex_lock(&venc.venc_lock);
+
+- if (display->state != OMAP_DSS_DISPLAY_SUSPENDED) {
++ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
+ r = -EINVAL;
+ goto err;
+ }
+
+- venc_power_on(display);
++ venc_power_on(dssdev);
+
+- display->state = OMAP_DSS_DISPLAY_ACTIVE;
++ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ err:
+ mutex_unlock(&venc.venc_lock);
+
+ return r;
+ }
+
+-static void venc_get_timings(struct omap_display *display,
++static void venc_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+- *timings = venc_panel.timings;
++ *timings = dssdev->panel.timings;
+ }
+
+-static void venc_set_timings(struct omap_display *display,
++static void venc_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+ DSSDBG("venc_set_timings\n");
+
+ /* Reset WSS data when the TV standard changes. */
+- if (memcmp(&display->panel->timings, timings, sizeof(*timings)))
++ if (memcmp(&dssdev->panel.timings, timings, sizeof(*timings)))
+ venc.wss_data = 0;
+
+- display->panel->timings = *timings;
+- if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
++ dssdev->panel.timings = *timings;
++ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
+ /* turn the venc off and on to get new timings to use */
+- venc_disable_display(display);
+- venc_enable_display(display);
++ venc_disable_display(dssdev);
++ venc_enable_display(dssdev);
+ }
+ }
+
+-static int venc_check_timings(struct omap_display *display,
++static int venc_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+ {
+ DSSDBG("venc_check_timings\n");
+@@ -597,14 +667,13 @@ static int venc_check_timings(struct omap_display *display,
+ return -EINVAL;
+ }
+
+-static u32 venc_get_wss(struct omap_display *display)
++static u32 venc_get_wss(struct omap_dss_device *dssdev)
+ {
+ /* Invert due to VENC_L21_WC_CTL:INV=1 */
+ return (venc.wss_data >> 8) ^ 0xfffff;
+ }
+
+-static int venc_set_wss(struct omap_display *display,
+- u32 wss)
++static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
+ {
+ const struct venc_config *config;
+
+@@ -612,7 +681,7 @@ static int venc_set_wss(struct omap_display *display,
+
+ mutex_lock(&venc.venc_lock);
+
+- config = venc_timings_to_config(&display->panel->timings);
++ config = venc_timings_to_config(&dssdev->panel.timings);
+
+ /* Invert due to VENC_L21_WC_CTL:INV=1 */
+ venc.wss_data = (wss ^ 0xfffff) << 8;
+@@ -628,18 +697,19 @@ static int venc_set_wss(struct omap_display *display,
+ return 0;
+ }
+
+-void venc_init_display(struct omap_display *display)
++void venc_init_display(struct omap_dss_device *dssdev)
+ {
+- display->panel = &venc_panel;
+- display->enable = venc_enable_display;
+- display->disable = venc_disable_display;
+- display->suspend = venc_display_suspend;
+- display->resume = venc_display_resume;
+- display->get_timings = venc_get_timings;
+- display->set_timings = venc_set_timings;
+- display->check_timings = venc_check_timings;
+- display->get_wss = venc_get_wss;
+- display->set_wss = venc_set_wss;
++ DSSDBG("init_display\n");
++
++ dssdev->enable = venc_enable_display;
++ dssdev->disable = venc_disable_display;
++ dssdev->suspend = venc_display_suspend;
++ dssdev->resume = venc_display_resume;
++ dssdev->get_timings = venc_get_timings;
++ dssdev->set_timings = venc_set_timings;
++ dssdev->check_timings = venc_check_timings;
++ dssdev->get_wss = venc_get_wss;
++ dssdev->set_wss = venc_set_wss;
+ }
+
+ void venc_dump_regs(struct seq_file *s)
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 57e6287..0ca57db 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -37,7 +37,7 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ struct omap_overlay *ovl;
+ struct omap_overlay_info info;
+ int r = 0;
+@@ -191,7 +191,7 @@ static int omapfb_update_window(struct fb_info *fbi,
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ u16 dw, dh;
+
+ if (!display)
+@@ -217,7 +217,7 @@ static int omapfb_set_update_mode(struct fb_info *fbi,
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ enum omap_dss_update_mode um;
+ int r;
+
+@@ -253,7 +253,7 @@ static int omapfb_get_update_mode(struct fb_info *fbi,
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ enum omap_dss_update_mode m;
+
+ if (!display || !display->get_update_mode)
+@@ -396,7 +396,7 @@ err:
+ static int omapfb_memory_read(struct fb_info *fbi,
+ struct omapfb_memory_read *mr)
+ {
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+ void *buf;
+@@ -484,7 +484,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+
+ union {
+ struct omapfb_update_window_old uwnd_o;
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index c3690b8..df5ede3 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -454,7 +454,7 @@ void set_fb_fix(struct fb_info *fbi)
+ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ unsigned long max_frame_size;
+ unsigned long line_size;
+ int xres_min, yres_min;
+@@ -615,7 +615,7 @@ static int omapfb_release(struct fb_info *fbi, int user)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+
+ DBG("Closing fb with plane index %d\n", ofbi->id);
+
+@@ -1057,7 +1057,7 @@ static int omapfb_blank(int blank, struct fb_info *fbi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ int do_update = 0;
+ int r = 0;
+
+@@ -1263,7 +1263,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+ unsigned long paddr)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omap_display *display;
++ struct omap_dss_device *display;
+ int bytespp;
+
+ display = fb2display(fbi);
+@@ -1307,6 +1307,9 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+ size = w * h * bytespp;
+ }
+
++ if (!size)
++ return 0;
++
+ return omapfb_alloc_fbmem(fbi, size, paddr);
+ }
+
+@@ -1485,7 +1488,7 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ struct omapfb2_mem_region *rg = &ofbi->region;
+ unsigned long old_size = rg->size;
+ unsigned long old_paddr = rg->paddr;
+@@ -1563,7 +1566,7 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ {
+ struct fb_var_screeninfo *var = &fbi->var;
+ struct fb_fix_screeninfo *fix = &fbi->fix;
+- struct omap_display *display = fb2display(fbi);
++ struct omap_dss_device *display = fb2display(fbi);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ int r = 0;
+
+@@ -1695,7 +1698,7 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
+ if (fbdev->displays[i]->state != OMAP_DSS_DISPLAY_DISABLED)
+ fbdev->displays[i]->disable(fbdev->displays[i]);
+
+- omap_dss_put_display(fbdev->displays[i]);
++ omap_dss_put_device(fbdev->displays[i]);
+ }
+
+ dev_set_drvdata(fbdev->dev, NULL);
+@@ -1874,7 +1877,7 @@ int omapfb_mode_to_timings(const char *mode_str,
+ }
+ }
+
+-static int omapfb_set_def_mode(struct omap_display *display, char *mode_str)
++static int omapfb_set_def_mode(struct omap_dss_device *display, char *mode_str)
+ {
+ int r;
+ u8 bpp;
+@@ -1884,7 +1887,7 @@ static int omapfb_set_def_mode(struct omap_display *display, char *mode_str)
+ if (r)
+ return r;
+
+- display->panel->recommended_bpp = bpp;
++ display->panel.recommended_bpp = bpp;
+
+ if (!display->check_timings || !display->set_timings)
+ return -EINVAL;
+@@ -1909,7 +1912,7 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
+
+ while (!r && (this_opt = strsep(&options, ",")) != NULL) {
+ char *p, *display_str, *mode_str;
+- struct omap_display *display;
++ struct omap_dss_device *display;
+ int i;
+
+ p = strchr(this_opt, ':');
+@@ -1950,9 +1953,10 @@ static int omapfb_probe(struct platform_device *pdev)
+ {
+ struct omapfb2_device *fbdev = NULL;
+ int r = 0;
+- int i, t;
++ int i;
+ struct omap_overlay *ovl;
+- struct omap_display *def_display;
++ struct omap_dss_device *def_display;
++ struct omap_dss_device *dssdev;
+
+ DBG("omapfb_probe\n");
+
+@@ -1974,17 +1978,10 @@ static int omapfb_probe(struct platform_device *pdev)
+ platform_set_drvdata(pdev, fbdev);
+
+ fbdev->num_displays = 0;
+- t = omap_dss_get_num_displays();
+- for (i = 0; i < t; i++) {
+- struct omap_display *display;
+- display = omap_dss_get_display(i);
+- if (!display) {
+- dev_err(&pdev->dev, "can't get display %d\n", i);
+- r = -EINVAL;
+- goto cleanup;
+- }
+-
+- fbdev->displays[fbdev->num_displays++] = display;
++ dssdev = NULL;
++ for_each_dss_dev(dssdev) {
++ omap_dss_get_device(dssdev);
++ fbdev->displays[fbdev->num_displays++] = dssdev;
+ }
+
+ if (fbdev->num_displays == 0) {
+@@ -2005,8 +2002,8 @@ static int omapfb_probe(struct platform_device *pdev)
+ /* gfx overlay should be the default one. find a display
+ * connected to that, and use it as default display */
+ ovl = omap_dss_get_overlay(0);
+- if (ovl->manager && ovl->manager->display) {
+- def_display = ovl->manager->display;
++ if (ovl->manager && ovl->manager->device) {
++ def_display = ovl->manager->device;
+ } else {
+ dev_err(&pdev->dev, "cannot find default display\n");
+ r = -EINVAL;
+@@ -2063,7 +2060,7 @@ static int omapfb_probe(struct platform_device *pdev)
+ }
+
+ for (i = 0; i < fbdev->num_displays; i++) {
+- struct omap_display *display = fbdev->displays[i];
++ struct omap_dss_device *display = fbdev->displays[i];
+ u16 w, h;
+
+ if (!display->get_update_mode || !display->update)
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index e750bc0..6ca8ba6 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -78,7 +78,7 @@ struct omapfb2_device {
+ struct fb_info *fbs[10];
+
+ unsigned num_displays;
+- struct omap_display *displays[10];
++ struct omap_dss_device *displays[10];
+ unsigned num_overlays;
+ struct omap_overlay *overlays[10];
+ unsigned num_managers;
+@@ -115,7 +115,7 @@ int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
+ struct fb_var_screeninfo *var);
+
+ /* find the display connected to this fb, if any */
+-static inline struct omap_display *fb2display(struct fb_info *fbi)
++static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ int i;
+@@ -123,7 +123,7 @@ static inline struct omap_display *fb2display(struct fb_info *fbi)
+ /* XXX: returns the display connected to first attached overlay */
+ for (i = 0; i < ofbi->num_overlays; i++) {
+ if (ofbi->overlays[i]->manager)
+- return ofbi->overlays[i]->manager->display;
++ return ofbi->overlays[i]->manager->device;
+ }
+
+ return NULL;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0088-DSS2-Board-file-changes-for-new-device-model.patch b/recipes/linux/linux-omap-pm/dss2/0088-DSS2-Board-file-changes-for-new-device-model.patch
new file mode 100644
index 0000000000..fbab306f97
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0088-DSS2-Board-file-changes-for-new-device-model.patch
@@ -0,0 +1,496 @@
+From 026ceab45d93841cabd7a0fc734a919171543c46 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 28 May 2009 13:27:43 +0300
+Subject: [PATCH 088/146] DSS2: Board file changes for new device model
+
+Changes to Beagle, SDP, Overo board files
+---
+ arch/arm/mach-omap2/board-3430sdp.c | 102 ++++++++--------
+ arch/arm/mach-omap2/board-omap3beagle.c | 195 ++++++++++++++++---------------
+ arch/arm/mach-omap2/board-overo.c | 43 ++++---
+ 3 files changed, 173 insertions(+), 167 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
+index 2ee6cbb..ec0c358 100644
+--- a/arch/arm/mach-omap2/board-3430sdp.c
++++ b/arch/arm/mach-omap2/board-3430sdp.c
+@@ -178,21 +178,6 @@ static unsigned enable_gpio;
+ static int lcd_enabled;
+ static int dvi_enabled;
+
+-static struct platform_device sdp3430_lcd_device = {
+- .name = "sdp2430_lcd",
+- .id = -1,
+-};
+-
+-static struct regulator_consumer_supply sdp3430_vdac_supply = {
+- .supply = "vdac",
+- .dev = &sdp3430_lcd_device.dev,
+-};
+-
+-static struct regulator_consumer_supply sdp3430_vdvi_supply = {
+- .supply = "vdvi",
+- .dev = &sdp3430_lcd_device.dev,
+-};
+-
+ static void enable_vpll2(int enable)
+ {
+ u8 ded_val, grp_val;
+@@ -253,7 +238,7 @@ err0:
+ return;
+ }
+
+-static int sdp3430_panel_enable_lcd(struct omap_display *display)
++static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
+ {
+ u8 ded_val, ded_reg;
+ u8 grp_val, grp_reg;
+@@ -283,7 +268,7 @@ static int sdp3430_panel_enable_lcd(struct omap_display *display)
+ return 0;
+ }
+
+-static void sdp3430_panel_disable_lcd(struct omap_display *display)
++static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
+ {
+ lcd_enabled = 0;
+
+@@ -293,16 +278,7 @@ static void sdp3430_panel_disable_lcd(struct omap_display *display)
+ gpio_direction_output(backlight_gpio, 0);
+ }
+
+-static struct omap_dss_display_config sdp3430_display_data = {
+- .type = OMAP_DISPLAY_TYPE_DPI,
+- .name = "lcd",
+- .panel_name = "sharp-ls037v7dw01",
+- .u.dpi.data_lines = 16,
+- .panel_enable = sdp3430_panel_enable_lcd,
+- .panel_disable = sdp3430_panel_disable_lcd,
+-};
+-
+-static int sdp3430_panel_enable_dvi(struct omap_display *display)
++static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
+ {
+ if (lcd_enabled) {
+ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+@@ -316,24 +292,14 @@ static int sdp3430_panel_enable_dvi(struct omap_display *display)
+ return 0;
+ }
+
+-static void sdp3430_panel_disable_dvi(struct omap_display *display)
++static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
+ {
+ sdp3430_dsi_power_down();
+
+ dvi_enabled = 0;
+ }
+
+-
+-static struct omap_dss_display_config sdp3430_display_data_dvi = {
+- .type = OMAP_DISPLAY_TYPE_DPI,
+- .name = "dvi",
+- .panel_name = "panel-generic",
+- .u.dpi.data_lines = 24,
+- .panel_enable = sdp3430_panel_enable_dvi,
+- .panel_disable = sdp3430_panel_disable_dvi,
+-};
+-
+-static int sdp3430_panel_enable_tv(struct omap_display *display)
++static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
+ {
+ #define ENABLE_VDAC_DEDICATED 0x03
+ #define ENABLE_VDAC_DEV_GRP 0x20
+@@ -347,7 +313,7 @@ static int sdp3430_panel_enable_tv(struct omap_display *display)
+ return 0;
+ }
+
+-static void sdp3430_panel_disable_tv(struct omap_display *display)
++static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
+ {
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEDICATED);
+@@ -355,23 +321,47 @@ static void sdp3430_panel_disable_tv(struct omap_display *display)
+ TWL4030_VDAC_DEV_GRP);
+ }
+
+-static struct omap_dss_display_config sdp3430_display_data_tv = {
+- .type = OMAP_DISPLAY_TYPE_VENC,
++
++static struct omap_dss_device sdp3430_lcd_device = {
++ .name = "lcd",
++ .driver_name = "sharp_ls_panel",
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .phy.dpi.data_lines = 16,
++ .platform_enable = sdp3430_panel_enable_lcd,
++ .platform_disable = sdp3430_panel_disable_lcd,
++};
++
++static struct omap_dss_device sdp3430_dvi_device = {
++ .name = "dvi",
++ .driver_name = "generic_panel",
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .phy.dpi.data_lines = 24,
++ .platform_enable = sdp3430_panel_enable_dvi,
++ .platform_disable = sdp3430_panel_disable_dvi,
++};
++
++static struct omap_dss_device sdp3430_tv_device = {
+ .name = "tv",
+- .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+- .panel_enable = sdp3430_panel_enable_tv,
+- .panel_disable = sdp3430_panel_disable_tv,
++ .driver_name = "venc",
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .platform_enable = sdp3430_panel_enable_tv,
++ .platform_disable = sdp3430_panel_disable_tv,
++};
++
++
++static struct omap_dss_device *sdp3430_dss_devices[] = {
++ &sdp3430_lcd_device,
++ &sdp3430_dvi_device,
++ &sdp3430_tv_device,
+ };
+
+ static struct omap_dss_board_info sdp3430_dss_data = {
++ .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
++ .devices = sdp3430_dss_devices,
++ .default_device = &sdp3430_lcd_device,
+ .dsi_power_up = sdp3430_dsi_power_up,
+ .dsi_power_down = sdp3430_dsi_power_down,
+- .num_displays = 3,
+- .displays = {
+- &sdp3430_display_data,
+- &sdp3430_display_data_dvi,
+- &sdp3430_display_data_tv,
+- }
+ };
+
+ static struct platform_device sdp3430_dss_device = {
+@@ -382,6 +372,16 @@ static struct platform_device sdp3430_dss_device = {
+ },
+ };
+
++static struct regulator_consumer_supply sdp3430_vdac_supply = {
++ .supply = "vdac",
++ .dev = &sdp3430_dss_device.dev,
++};
++
++static struct regulator_consumer_supply sdp3430_vdvi_supply = {
++ .supply = "vdvi",
++ .dev = &sdp3430_dss_device.dev,
++};
++
+ static struct platform_device *sdp3430_devices[] __initdata = {
+ &sdp3430_dss_device,
+ };
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 4ab7396..67e1d5c 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -108,6 +108,105 @@ static struct platform_device omap3beagle_nand_device = {
+ .resource = &omap3beagle_nand_resource,
+ };
+
++/* DSS */
++
++static int beagle_enable_dvi(struct omap_dss_device *dssdev)
++{
++ if (dssdev->reset_gpio != -1)
++ gpio_set_value(dssdev->reset_gpio, 1);
++
++ return 0;
++}
++
++static void beagle_disable_dvi(struct omap_dss_device *dssdev)
++{
++ if (dssdev->reset_gpio != -1)
++ gpio_set_value(dssdev->reset_gpio, 0);
++}
++
++static struct omap_dss_device beagle_dvi_device = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .driver_name = "generic_panel",
++ .phy.dpi.data_lines = 24,
++ .reset_gpio = 170,
++ .platform_enable = beagle_enable_dvi,
++ .platform_disable = beagle_disable_dvi,
++};
++
++static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
++{
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++
++ return 0;
++}
++
++static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
++{
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_dss_device beagle_tv_device = {
++ .name = "tv",
++ .driver_name = "venc",
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .platform_enable = beagle_panel_enable_tv,
++ .platform_disable = beagle_panel_disable_tv,
++};
++
++static struct omap_dss_device *beagle_dss_devices[] = {
++ &beagle_dvi_device,
++ &beagle_tv_device,
++};
++
++static struct omap_dss_board_info beagle_dss_data = {
++ .num_devices = ARRAY_SIZE(beagle_dss_devices),
++ .devices = beagle_dss_devices,
++ .default_device = &beagle_dvi_device,
++};
++
++static struct platform_device beagle_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &beagle_dss_data,
++ },
++};
++
++static struct regulator_consumer_supply beagle_vdac_supply = {
++ .supply = "vdac",
++ .dev = &beagle_dss_device.dev,
++};
++
++static struct regulator_consumer_supply beagle_vdvi_supply = {
++ .supply = "vdvi",
++ .dev = &beagle_dss_device.dev,
++};
++
++static void __init beagle_display_init(void)
++{
++ int r;
++
++ r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
++ if (r < 0) {
++ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
++ return;
++ }
++
++ gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
++}
++
+ #include "sdram-micron-mt46h32m32lf-6.h"
+
+ static struct omap_uart_config omap3_beagle_uart_config __initdata = {
+@@ -182,16 +281,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
+ .setup = beagle_twl_gpio_setup,
+ };
+
+-static struct regulator_consumer_supply beagle_vdac_supply = {
+- .supply = "vdac",
+- .dev = &omap3_beagle_lcd_device.dev,
+-};
+-
+-static struct regulator_consumer_supply beagle_vdvi_supply = {
+- .supply = "vdvi",
+- .dev = &omap3_beagle_lcd_device.dev,
+-};
+-
+ /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
+ static struct regulator_init_data beagle_vmmc1 = {
+ .constraints = {
+@@ -345,92 +434,6 @@ static struct platform_device keys_gpio = {
+ },
+ };
+
+-/* DSS */
+-
+-static int beagle_enable_dvi(struct omap_display *display)
+-{
+- if (display->hw_config.panel_reset_gpio != -1)
+- gpio_set_value(display->hw_config.panel_reset_gpio, 1);
+-
+- return 0;
+-}
+-
+-static void beagle_disable_dvi(struct omap_display *display)
+-{
+- if (display->hw_config.panel_reset_gpio != -1)
+- gpio_set_value(display->hw_config.panel_reset_gpio, 0);
+-}
+-
+-static struct omap_dss_display_config beagle_display_data_dvi = {
+- .type = OMAP_DISPLAY_TYPE_DPI,
+- .name = "dvi",
+- .panel_name = "panel-generic",
+- .u.dpi.data_lines = 24,
+- .panel_reset_gpio = 170,
+- .panel_enable = beagle_enable_dvi,
+- .panel_disable = beagle_disable_dvi,
+-};
+-
+-
+-static int beagle_panel_enable_tv(struct omap_display *display)
+-{
+-#define ENABLE_VDAC_DEDICATED 0x03
+-#define ENABLE_VDAC_DEV_GRP 0x20
+-
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEDICATED,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+-
+- return 0;
+-}
+-
+-static void beagle_panel_disable_tv(struct omap_display *display)
+-{
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEV_GRP);
+-}
+-
+-static struct omap_dss_display_config beagle_display_data_tv = {
+- .type = OMAP_DISPLAY_TYPE_VENC,
+- .name = "tv",
+- .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+- .panel_enable = beagle_panel_enable_tv,
+- .panel_disable = beagle_panel_disable_tv,
+-};
+-
+-static struct omap_dss_board_info beagle_dss_data = {
+- .num_displays = 2,
+- .displays = {
+- &beagle_display_data_dvi,
+- &beagle_display_data_tv,
+- }
+-};
+-
+-static struct platform_device beagle_dss_device = {
+- .name = "omapdss",
+- .id = -1,
+- .dev = {
+- .platform_data = &beagle_dss_data,
+- },
+-};
+-
+-static void __init beagle_display_init(void)
+-{
+- int r;
+-
+- r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
+- if (r < 0) {
+- printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+- return;
+- }
+-
+- gpio_direction_output(beagle_display_data_dvi.panel_reset_gpio, 0);
+-}
+-
+ static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
+ { OMAP_TAG_UART, &omap3_beagle_uart_config },
+ };
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 7bcac03..39f95f5 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -386,7 +386,7 @@ static void __init overo_display_init(void)
+ gpio_export(OVERO_GPIO_LCD_EN, 0);
+ }
+
+-static int overo_panel_enable_dvi(struct omap_display *display)
++static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
+ {
+ if (lcd_enabled) {
+ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+@@ -399,23 +399,23 @@ static int overo_panel_enable_dvi(struct omap_display *display)
+ return 0;
+ }
+
+-static void overo_panel_disable_dvi(struct omap_display *display)
++static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
+ {
+ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+
+ dvi_enabled = 0;
+ }
+
+-static struct omap_dss_display_config overo_display_data_dvi = {
++static struct omap_dss_device overo_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+- .panel_name = "panel-generic",
+- .u.dpi.data_lines = 24,
+- .panel_enable = overo_panel_enable_dvi,
+- .panel_disable = overo_panel_disable_dvi,
++ .driver_name = "panel_generic",
++ .phy.dpi.data_lines = 24,
++ .platform_enable = overo_panel_enable_dvi,
++ .platform_disable = overo_panel_disable_dvi,
+ };
+
+-static int overo_panel_enable_lcd(struct omap_display *display)
++static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
+ {
+ if (dvi_enabled) {
+ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+@@ -427,27 +427,30 @@ static int overo_panel_enable_lcd(struct omap_display *display)
+ return 0;
+ }
+
+-static void overo_panel_disable_lcd(struct omap_display *display)
++static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
+ {
+ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+ lcd_enabled = 0;
+ }
+
+-static struct omap_dss_display_config overo_display_data_lcd = {
++static struct omap_dss_device overo_lcd_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "lcd",
+- .panel_name = "samsung-lte430wq-f0c",
+- .u.dpi.data_lines = 24,
+- .panel_enable = overo_panel_enable_lcd,
+- .panel_disable = overo_panel_disable_lcd,
+- };
++ .driver_name = "samsung-lte430wq-f0c",
++ .phy.dpi.data_lines = 24,
++ .platform_enable = overo_panel_enable_lcd,
++ .platform_disable = overo_panel_disable_lcd,
++};
++
++static struct omap_dss_device *overo_dss_devices[] = {
++ &overo_dvi_device,
++ &overo_lcd_device,
++};
+
+ static struct omap_dss_board_info overo_dss_data = {
+- .num_displays = 2,
+- .displays = {
+- &overo_display_data_dvi,
+- &overo_display_data_lcd,
+- }
++ .num_devices = ARRAY_SIZE(overo_dss_devices),
++ .devices = overo_dss_devices,
++ .default_device = &overo_dvi_device,
+ };
+
+ static struct platform_device overo_dss_device = {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0089-DSS2-Panel-driver-changes-for-new-device-model.patch b/recipes/linux/linux-omap-pm/dss2/0089-DSS2-Panel-driver-changes-for-new-device-model.patch
new file mode 100644
index 0000000000..97098e1554
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0089-DSS2-Panel-driver-changes-for-new-device-model.patch
@@ -0,0 +1,400 @@
+From 449ff8409e92f76f71baf538867f600a832f92e3 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 28 May 2009 13:29:55 +0300
+Subject: [PATCH 089/146] DSS2: Panel driver changes for new device model
+
+Changes to generic, samsung and sharp panel drivers
+---
+ drivers/video/omap2/displays/panel-generic.c | 72 ++++++++++--------
+ .../omap2/displays/panel-samsung-lte430wq-f0c.c | 77 ++++++++++---------
+ .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 79 ++++++++++----------
+ 3 files changed, 122 insertions(+), 106 deletions(-)
+
+diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c
+index 8382acb..738147e 100644
+--- a/drivers/video/omap2/displays/panel-generic.c
++++ b/drivers/video/omap2/displays/panel-generic.c
+@@ -22,73 +22,81 @@
+
+ #include <mach/display.h>
+
+-static int generic_panel_init(struct omap_display *display)
++static struct omap_video_timings generic_panel_timings = {
++ /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
++ .x_res = 640,
++ .y_res = 480,
++ .pixel_clock = 23500,
++ .hfp = 48,
++ .hsw = 32,
++ .hbp = 80,
++ .vfp = 3,
++ .vsw = 4,
++ .vbp = 7,
++};
++
++static int generic_panel_probe(struct omap_dss_device *dssdev)
+ {
++ dssdev->panel.config = OMAP_DSS_LCD_TFT;
++ dssdev->panel.timings = generic_panel_timings;
++
+ return 0;
+ }
+
+-static int generic_panel_enable(struct omap_display *display)
++static void generic_panel_remove(struct omap_dss_device *dssdev)
++{
++}
++
++static int generic_panel_enable(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+- if (display->hw_config.panel_enable)
+- r = display->hw_config.panel_enable(display);
++ if (dssdev->platform_enable)
++ r = dssdev->platform_enable(dssdev);
+
+ return r;
+ }
+
+-static void generic_panel_disable(struct omap_display *display)
++static void generic_panel_disable(struct omap_dss_device *dssdev)
+ {
+- if (display->hw_config.panel_disable)
+- display->hw_config.panel_disable(display);
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
+ }
+
+-static int generic_panel_suspend(struct omap_display *display)
++static int generic_panel_suspend(struct omap_dss_device *dssdev)
+ {
+- generic_panel_disable(display);
++ generic_panel_disable(dssdev);
+ return 0;
+ }
+
+-static int generic_panel_resume(struct omap_display *display)
++static int generic_panel_resume(struct omap_dss_device *dssdev)
+ {
+- return generic_panel_enable(display);
++ return generic_panel_enable(dssdev);
+ }
+
+-static struct omap_panel generic_panel = {
+- .owner = THIS_MODULE,
+- .name = "panel-generic",
+- .init = generic_panel_init,
++static struct omap_dss_driver generic_driver = {
++ .probe = generic_panel_probe,
++ .remove = generic_panel_remove,
++
+ .enable = generic_panel_enable,
+ .disable = generic_panel_disable,
+ .suspend = generic_panel_suspend,
+ .resume = generic_panel_resume,
+
+- .timings = {
+- /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
+- .x_res = 640,
+- .y_res = 480,
+- .pixel_clock = 23500,
+- .hfp = 48,
+- .hsw = 32,
+- .hbp = 80,
+- .vfp = 3,
+- .vsw = 4,
+- .vbp = 7,
++ .driver = {
++ .name = "generic_panel",
++ .owner = THIS_MODULE,
+ },
+-
+- .config = OMAP_DSS_LCD_TFT,
+ };
+
+-
+ static int __init generic_panel_drv_init(void)
+ {
+- omap_dss_register_panel(&generic_panel);
+- return 0;
++ return omap_dss_register_driver(&generic_driver);
+ }
+
+ static void __exit generic_panel_drv_exit(void)
+ {
+- omap_dss_unregister_panel(&generic_panel);
++ omap_dss_unregister_driver(&generic_driver);
+ }
+
+ module_init(generic_panel_drv_init);
+diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
+index e4bb781..eafe581 100644
+--- a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
++++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
+@@ -21,86 +21,91 @@
+
+ #include <mach/display.h>
+
+-static int samsung_lte_panel_init(struct omap_display *display)
++static struct omap_video_timings samsung_lte_timings = {
++ .x_res = 480,
++ .y_res = 272,
++
++ .pixel_clock = 9200,
++
++ .hsw = 41,
++ .hfp = 8,
++ .hbp = 45-41,
++
++ .vsw = 10,
++ .vfp = 4,
++ .vbp = 12-10,
++};
++
++static int samsung_lte_panel_probe(struct omap_dss_device *dssdev)
+ {
++ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
++ OMAP_DSS_LCD_IHS;
++ dssdev->panel.timings = samsung_lte_timings;
++
+ return 0;
+ }
+
+-static void samsung_lte_panel_cleanup(struct omap_display *display)
++static void samsung_lte_panel_remove(struct omap_dss_device *dssdev)
+ {
+ }
+
+-static int samsung_lte_panel_enable(struct omap_display *display)
++static int samsung_lte_panel_enable(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+- if (display->hw_config.panel_enable)
+- r = display->hw_config.panel_enable(display);
++ if (dssdev->platform_enable)
++ r = dssdev->platform_enable(dssdev);
+
+ return r;
+ }
+
+-static void samsung_lte_panel_disable(struct omap_display *display)
++static void samsung_lte_panel_disable(struct omap_dss_device *dssdev)
+ {
+- if (display->hw_config.panel_disable)
+- display->hw_config.panel_disable(display);
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
++
+ msleep(100);
+ }
+
+-static int samsung_lte_panel_suspend(struct omap_display *display)
++static int samsung_lte_panel_suspend(struct omap_dss_device *dssdev)
+ {
+- samsung_lte_panel_disable(display);
++ samsung_lte_panel_disable(dssdev);
+ return 0;
+ }
+
+-static int samsung_lte_panel_resume(struct omap_display *display)
++static int samsung_lte_panel_resume(struct omap_dss_device *dssdev)
+ {
+- return samsung_lte_panel_enable(display);
++ return samsung_lte_panel_enable(dssdev);
+ }
+
+-static struct omap_panel samsung_lte_panel = {
+- .owner = THIS_MODULE,
+- .name = "samsung-lte430wq-f0c",
+- .init = samsung_lte_panel_init,
+- .cleanup = samsung_lte_panel_cleanup,
++static struct omap_dss_driver samsung_lte_driver = {
++ .probe = samsung_lte_panel_probe,
++ .remove = samsung_lte_panel_remove,
++
+ .enable = samsung_lte_panel_enable,
+ .disable = samsung_lte_panel_disable,
+ .suspend = samsung_lte_panel_suspend,
+ .resume = samsung_lte_panel_resume,
+
+- .timings = {
+- .x_res = 480,
+- .y_res = 272,
+-
+- .pixel_clock = 9200,
+-
+- .hsw = 41,
+- .hfp = 8,
+- .hbp = 45-41,
+-
+- .vsw = 10,
+- .vfp = 4,
+- .vbp = 12-10,
++ .driver = {
++ .name = "samsung_lte_panel",
++ .owner = THIS_MODULE,
+ },
+-
+- .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS,
+ };
+
+-
+ static int __init samsung_lte_panel_drv_init(void)
+ {
+- omap_dss_register_panel(&samsung_lte_panel);
+- return 0;
++ return omap_dss_register_driver(&samsung_lte_driver);
+ }
+
+ static void __exit samsung_lte_panel_drv_exit(void)
+ {
+- omap_dss_unregister_panel(&samsung_lte_panel);
++ omap_dss_unregister_driver(&samsung_lte_driver);
+ }
+
+ module_init(samsung_lte_panel_drv_init);
+diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+index 1f99150..6b93ea5 100644
+--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
++++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+@@ -22,89 +22,92 @@
+
+ #include <mach/display.h>
+
+-static int sharp_ls_panel_init(struct omap_display *display)
++static struct omap_video_timings sharp_ls_timings = {
++ .x_res = 480,
++ .y_res = 640,
++
++ .pixel_clock = 19200,
++
++ .hsw = 2,
++ .hfp = 1,
++ .hbp = 28,
++
++ .vsw = 1,
++ .vfp = 1,
++ .vbp = 1,
++};
++
++static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
+ {
++ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
++ OMAP_DSS_LCD_IHS;
++ dssdev->panel.acb = 0x28;
++ dssdev->panel.timings = sharp_ls_timings;
++
+ return 0;
+ }
+
+-static void sharp_ls_panel_cleanup(struct omap_display *display)
++static void sharp_ls_panel_remove(struct omap_dss_device *dssdev)
+ {
+ }
+
+-static int sharp_ls_panel_enable(struct omap_display *display)
++static int sharp_ls_panel_enable(struct omap_dss_device *dssdev)
+ {
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+- if (display->hw_config.panel_enable)
+- r = display->hw_config.panel_enable(display);
++ if (dssdev->platform_enable)
++ r = dssdev->platform_enable(dssdev);
+
+ return r;
+ }
+
+-static void sharp_ls_panel_disable(struct omap_display *display)
++static void sharp_ls_panel_disable(struct omap_dss_device *dssdev)
+ {
+- if (display->hw_config.panel_disable)
+- display->hw_config.panel_disable(display);
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
+
+ msleep(100);
+ }
+
+-static int sharp_ls_panel_suspend(struct omap_display *display)
++static int sharp_ls_panel_suspend(struct omap_dss_device *dssdev)
+ {
+- sharp_ls_panel_disable(display);
++ sharp_ls_panel_disable(dssdev);
+ return 0;
+ }
+
+-static int sharp_ls_panel_resume(struct omap_display *display)
++static int sharp_ls_panel_resume(struct omap_dss_device *dssdev)
+ {
+- return sharp_ls_panel_enable(display);
++ return sharp_ls_panel_enable(dssdev);
+ }
+
+-static struct omap_panel sharp_ls_panel = {
+- .owner = THIS_MODULE,
+- .name = "sharp-ls037v7dw01",
+- .init = sharp_ls_panel_init,
+- .cleanup = sharp_ls_panel_cleanup,
++static struct omap_dss_driver sharp_ls_driver = {
++ .probe = sharp_ls_panel_probe,
++ .remove = sharp_ls_panel_remove,
++
+ .enable = sharp_ls_panel_enable,
+ .disable = sharp_ls_panel_disable,
+ .suspend = sharp_ls_panel_suspend,
+ .resume = sharp_ls_panel_resume,
+
+- .timings = {
+- .x_res = 480,
+- .y_res = 640,
+-
+- .pixel_clock = 19200,
+-
+- .hsw = 2,
+- .hfp = 1,
+- .hbp = 28,
+-
+- .vsw = 1,
+- .vfp = 1,
+- .vbp = 1,
++ .driver = {
++ .name = "sharp_ls_panel",
++ .owner = THIS_MODULE,
+ },
+-
+- .acb = 0x28,
+-
+- .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
+ };
+
+-
+ static int __init sharp_ls_panel_drv_init(void)
+ {
+- omap_dss_register_panel(&sharp_ls_panel);
+- return 0;
++ return omap_dss_register_driver(&sharp_ls_driver);
+ }
+
+ static void __exit sharp_ls_panel_drv_exit(void)
+ {
+- omap_dss_unregister_panel(&sharp_ls_panel);
++ omap_dss_unregister_driver(&sharp_ls_driver);
+ }
+
+ module_init(sharp_ls_panel_drv_init);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0090-DSS2-VENC-venc-uses-regulator-framework.patch b/recipes/linux/linux-omap-pm/dss2/0090-DSS2-VENC-venc-uses-regulator-framework.patch
new file mode 100644
index 0000000000..91870fe489
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0090-DSS2-VENC-venc-uses-regulator-framework.patch
@@ -0,0 +1,74 @@
+From 5c06f74553d932aee9cba73ca2620a16f1bb610e Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 28 May 2009 17:01:35 +0300
+Subject: [PATCH 090/146] DSS2: VENC: venc uses regulator framework
+
+Venc needs vdda_dac regulator
+---
+ drivers/video/omap2/dss/venc.c | 15 +++++++++++++++
+ 1 files changed, 15 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index a83d170..d06dc38 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -32,6 +32,7 @@
+ #include <linux/string.h>
+ #include <linux/seq_file.h>
+ #include <linux/platform_device.h>
++#include <linux/regulator/consumer.h>
+
+ #include <mach/display.h>
+ #include <mach/cpu.h>
+@@ -291,6 +292,7 @@ static struct {
+ void __iomem *base;
+ struct mutex venc_lock;
+ u32 wss_data;
++ struct regulator *vdda_dac_reg;
+ } venc;
+
+ static inline void venc_write_reg(int idx, u32 val)
+@@ -480,6 +482,13 @@ int venc_init(struct platform_device *pdev)
+ return -ENOMEM;
+ }
+
++ venc.vdda_dac_reg = regulator_get(&pdev->dev, "vdda_dac");
++ if (IS_ERR(venc.vdda_dac_reg)) {
++ iounmap(venc.base);
++ DSSERR("can't get VDDA_DAC regulator\n");
++ return PTR_ERR(venc.vdda_dac_reg);
++ }
++
+ venc_enable_clocks(1);
+
+ rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
+@@ -496,6 +505,8 @@ void venc_exit(void)
+ {
+ omap_dss_unregister_driver(&venc_driver);
+
++ regulator_put(venc.vdda_dac_reg);
++
+ iounmap(venc.base);
+ }
+
+@@ -521,6 +532,8 @@ static void venc_power_on(struct omap_dss_device *dssdev)
+ dispc_set_digit_size(dssdev->panel.timings.x_res,
+ dssdev->panel.timings.y_res/2);
+
++ regulator_enable(venc.vdda_dac_reg);
++
+ if (dssdev->platform_enable)
+ dssdev->platform_enable(dssdev);
+
+@@ -537,6 +550,8 @@ static void venc_power_off(struct omap_dss_device *dssdev)
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
++ regulator_disable(venc.vdda_dac_reg);
++
+ venc_enable_clocks(0);
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0091-DSS2-DSI-Use-regulator-framework.patch b/recipes/linux/linux-omap-pm/dss2/0091-DSS2-DSI-Use-regulator-framework.patch
new file mode 100644
index 0000000000..a9dbe70560
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0091-DSS2-DSI-Use-regulator-framework.patch
@@ -0,0 +1,134 @@
+From d643b84bbc463075017b5ec61406455ad8e55374 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 28 May 2009 17:19:48 +0300
+Subject: [PATCH 091/146] DSS2: DSI: Use regulator framework
+
+DSI needs vdds_dsi regulator
+---
+ arch/arm/plat-omap/include/mach/display.h | 2 --
+ drivers/video/omap2/dss/core.c | 24 ------------------------
+ drivers/video/omap2/dss/dsi.c | 18 +++++++++++++++---
+ 3 files changed, 15 insertions(+), 29 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 57bb8ff..94585ba 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -219,8 +219,6 @@ struct omap_dss_board_info {
+ int num_devices;
+ struct omap_dss_device **devices;
+ struct omap_dss_device *default_device;
+- int (*dsi_power_up)(void);
+- void (*dsi_power_down)(void);
+ };
+
+ struct omap_video_timings {
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index c56c431..212b774 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -411,30 +411,6 @@ static void dss_uninitialize_debugfs(void)
+ }
+ #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
+
+-
+-/* DSI powers */
+-int dss_dsi_power_up(void)
+-{
+- struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
+-
+- if (!pdata->dsi_power_up)
+- return 0; /* presume power is always on then */
+-
+- return pdata->dsi_power_up();
+-}
+-
+-void dss_dsi_power_down(void)
+-{
+- struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
+-
+- if (!pdata->dsi_power_down)
+- return;
+-
+- pdata->dsi_power_down();
+-}
+-
+-
+-
+ /* PLATFORM DEVICE */
+ static int omap_dss_probe(struct platform_device *pdev)
+ {
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index fb2f7f0..9c8488e 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -31,6 +31,7 @@
+ #include <linux/seq_file.h>
+ #include <linux/kfifo.h>
+ #include <linux/platform_device.h>
++#include <linux/regulator/consumer.h>
+
+ #include <mach/board.h>
+ #include <mach/display.h>
+@@ -256,6 +257,8 @@ static struct
+ unsigned long dsiphy; /* Hz */
+ unsigned long ddr_clk; /* Hz */
+
++ struct regulator *vdds_dsi_reg;
++
+ struct {
+ struct omap_dss_device *dssdev;
+ enum fifo_size fifo_size;
+@@ -1177,7 +1180,7 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+ goto err0;
+ }
+
+- r = dss_dsi_power_up();
++ r = regulator_enable(dsi.vdds_dsi_reg);
+ if (r)
+ goto err0;
+
+@@ -1212,7 +1215,7 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+
+ return 0;
+ err1:
+- dss_dsi_power_down();
++ regulator_disable(dsi.vdds_dsi_reg);
+ err0:
+ enable_clocks(0);
+ dsi_enable_pll_clock(0);
+@@ -1226,7 +1229,7 @@ void dsi_pll_uninit(void)
+
+ dsi.pll_locked = 0;
+ dsi_pll_power(DSI_PLL_POWER_OFF);
+- dss_dsi_power_down();
++ regulator_disable(dsi.vdds_dsi_reg);
+ DSSDBG("PLL uninit done\n");
+ }
+
+@@ -3898,6 +3901,13 @@ int dsi_init(struct platform_device *pdev)
+ return -ENOMEM;
+ }
+
++ dsi.vdds_dsi_reg = regulator_get(&pdev->dev, "vdds_dsi");
++ if (IS_ERR(dsi.vdds_dsi_reg)) {
++ iounmap(dsi.base);
++ DSSERR("can't get VDDS_DSI regulator\n");
++ return PTR_ERR(dsi.vdds_dsi_reg);
++ }
++
+ enable_clocks(1);
+
+ rev = dsi_read_reg(DSI_REVISION);
+@@ -3914,6 +3924,8 @@ void dsi_exit(void)
+ flush_workqueue(dsi.workqueue);
+ destroy_workqueue(dsi.workqueue);
+
++ regulator_put(dsi.vdds_dsi_reg);
++
+ iounmap(dsi.base);
+
+ kfifo_free(dsi.cmd_fifo);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0092-DSS2-SDP-regulators-for-VDAC-DSI.patch b/recipes/linux/linux-omap-pm/dss2/0092-DSS2-SDP-regulators-for-VDAC-DSI.patch
new file mode 100644
index 0000000000..76e0710032
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0092-DSS2-SDP-regulators-for-VDAC-DSI.patch
@@ -0,0 +1,225 @@
+From 5243c9ebcadbb074a381769fab9dff266c9d6a84 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 29 May 2009 12:07:07 +0300
+Subject: [PATCH 092/146] DSS2: SDP: regulators for VDAC, DSI
+
+---
+ arch/arm/mach-omap2/board-3430sdp.c | 114 +++++-----------------------------
+ 1 files changed, 17 insertions(+), 97 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
+index ec0c358..ef8cf4f 100644
+--- a/arch/arm/mach-omap2/board-3430sdp.c
++++ b/arch/arm/mach-omap2/board-3430sdp.c
+@@ -150,65 +150,14 @@ static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
+ };
+
+
+-#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
+-#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
+-#if 0
+-#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 24
+-#define SDP3430_LCD_PANEL_ENABLE_GPIO 28
+-#else
+ #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
+ #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
+-#endif
+-
+-#define PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
+-#define ENABLE_VAUX2_DEDICATED 0x09
+-#define ENABLE_VAUX2_DEV_GRP 0x20
+-#define ENABLE_VAUX3_DEDICATED 0x03
+-#define ENABLE_VAUX3_DEV_GRP 0x20
+-
+-#define ENABLE_VPLL2_DEDICATED 0x05
+-#define ENABLE_VPLL2_DEV_GRP 0xE0
+-#define TWL4030_VPLL2_DEV_GRP 0x33
+-#define TWL4030_VPLL2_DEDICATED 0x36
+-
+-#define t2_out(c, r, v) twl4030_i2c_write_u8(c, r, v)
+
+ static unsigned backlight_gpio;
+ static unsigned enable_gpio;
+ static int lcd_enabled;
+ static int dvi_enabled;
+
+-static void enable_vpll2(int enable)
+-{
+- u8 ded_val, grp_val;
+-
+- if (enable) {
+- ded_val = ENABLE_VPLL2_DEDICATED;
+- grp_val = ENABLE_VPLL2_DEV_GRP;
+- } else {
+- ded_val = 0;
+- grp_val = 0;
+- }
+-
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ded_val, TWL4030_VPLL2_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- grp_val, TWL4030_VPLL2_DEV_GRP);
+-}
+-
+-static int sdp3430_dsi_power_up(void)
+-{
+- if (omap_rev() > OMAP3430_REV_ES1_0)
+- enable_vpll2(1);
+- return 0;
+-}
+-
+-static void sdp3430_dsi_power_down(void)
+-{
+- if (omap_rev() > OMAP3430_REV_ES1_0)
+- enable_vpll2(0);
+-}
+-
+ static void __init sdp3430_display_init(void)
+ {
+ int r;
+@@ -240,29 +189,14 @@ err0:
+
+ static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
+ {
+- u8 ded_val, ded_reg;
+- u8 grp_val, grp_reg;
+-
+ if (dvi_enabled) {
+ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+ return -EINVAL;
+ }
+
+- ded_reg = TWL4030_VAUX3_DEDICATED;
+- ded_val = ENABLE_VAUX3_DEDICATED;
+- grp_reg = TWL4030_VAUX3_DEV_GRP;
+- grp_val = ENABLE_VAUX3_DEV_GRP;
+-
+ gpio_direction_output(enable_gpio, 1);
+ gpio_direction_output(backlight_gpio, 1);
+
+- if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg))
+- return -EIO;
+- if (0 != t2_out(PM_RECEIVER, grp_val, grp_reg))
+- return -EIO;
+-
+- sdp3430_dsi_power_up();
+-
+ lcd_enabled = 1;
+
+ return 0;
+@@ -272,8 +206,6 @@ static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
+ {
+ lcd_enabled = 0;
+
+- sdp3430_dsi_power_down();
+-
+ gpio_direction_output(enable_gpio, 0);
+ gpio_direction_output(backlight_gpio, 0);
+ }
+@@ -285,8 +217,6 @@ static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
+ return -EINVAL;
+ }
+
+- sdp3430_dsi_power_up();
+-
+ dvi_enabled = 1;
+
+ return 0;
+@@ -294,31 +224,16 @@ static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
+
+ static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
+ {
+- sdp3430_dsi_power_down();
+-
+ dvi_enabled = 0;
+ }
+
+ static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
+ {
+-#define ENABLE_VDAC_DEDICATED 0x03
+-#define ENABLE_VDAC_DEV_GRP 0x20
+-
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEDICATED,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+-
+ return 0;
+ }
+
+ static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
+ {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEV_GRP);
+ }
+
+
+@@ -360,8 +275,6 @@ static struct omap_dss_board_info sdp3430_dss_data = {
+ .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
+ .devices = sdp3430_dss_devices,
+ .default_device = &sdp3430_lcd_device,
+- .dsi_power_up = sdp3430_dsi_power_up,
+- .dsi_power_down = sdp3430_dsi_power_down,
+ };
+
+ static struct platform_device sdp3430_dss_device = {
+@@ -372,13 +285,8 @@ static struct platform_device sdp3430_dss_device = {
+ },
+ };
+
+-static struct regulator_consumer_supply sdp3430_vdac_supply = {
+- .supply = "vdac",
+- .dev = &sdp3430_dss_device.dev,
+-};
+-
+-static struct regulator_consumer_supply sdp3430_vdvi_supply = {
+- .supply = "vdvi",
++static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
++ .supply = "vdda_dac",
+ .dev = &sdp3430_dss_device.dev,
+ };
+
+@@ -605,22 +513,34 @@ static struct regulator_init_data sdp3430_vdac = {
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+- .consumer_supplies = &sdp3430_vdac_supply,
++ .consumer_supplies = &sdp3430_vdda_dac_supply,
+ };
+
+ /* VPLL2 for digital video outputs */
++static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
++ {
++ .supply = "vdvi",
++ .dev = &sdp3430_lcd_device.dev,
++ },
++ {
++ .supply = "vdds_dsi",
++ .dev = &sdp3430_dss_device.dev,
++ }
++};
++
+ static struct regulator_init_data sdp3430_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
++ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+- .num_consumer_supplies = 1,
+- .consumer_supplies = &sdp3430_vdvi_supply,
++ .num_consumer_supplies = ARRAY_SIZE(sdp3430_vpll2_supplies),
++ .consumer_supplies = sdp3430_vpll2_supplies,
+ };
+
+ static struct twl4030_platform_data sdp3430_twldata = {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0093-DSS2-Sharp-panel-use-regulator-fw.patch b/recipes/linux/linux-omap-pm/dss2/0093-DSS2-Sharp-panel-use-regulator-fw.patch
new file mode 100644
index 0000000000..933a22dc36
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0093-DSS2-Sharp-panel-use-regulator-fw.patch
@@ -0,0 +1,100 @@
+From feaf5b69b627c85e3ea40accf50ab5771125cf00 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 29 May 2009 12:07:27 +0300
+Subject: [PATCH 093/146] DSS2: Sharp panel: use regulator fw
+
+---
+ .../video/omap2/displays/panel-sharp-ls037v7dw01.c | 38 ++++++++++++++++++++
+ 1 files changed, 38 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+index 6b93ea5..cb8ce34 100644
+--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
++++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+@@ -19,9 +19,20 @@
+
+ #include <linux/module.h>
+ #include <linux/delay.h>
++#include <linux/device.h>
++#include <linux/regulator/consumer.h>
++#include <linux/err.h>
+
+ #include <mach/display.h>
+
++struct sharp_data {
++ /* XXX This regulator should actually be in SDP board file, not here,
++ * as it doesn't actually power the LCD, but something else that
++ * affects the output to LCD (I think. Somebody clarify). It doesn't do
++ * harm here, as SDP is the only board using this currently */
++ struct regulator *vdvi_reg;
++};
++
+ static struct omap_video_timings sharp_ls_timings = {
+ .x_res = 480,
+ .y_res = 640,
+@@ -39,25 +50,48 @@ static struct omap_video_timings sharp_ls_timings = {
+
+ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
+ {
++ struct sharp_data *sd;
++
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.acb = 0x28;
+ dssdev->panel.timings = sharp_ls_timings;
+
++ sd = kzalloc(sizeof(*sd), GFP_KERNEL);
++ if (!sd)
++ return -ENOMEM;
++
++ dev_set_drvdata(&dssdev->dev, sd);
++
++ sd->vdvi_reg = regulator_get(&dssdev->dev, "vdvi");
++ if (IS_ERR(sd->vdvi_reg)) {
++ kfree(sd);
++ printk("failed to get VDVI regulator\n");
++ return PTR_ERR(sd->vdvi_reg);
++ }
++
+ return 0;
+ }
+
+ static void sharp_ls_panel_remove(struct omap_dss_device *dssdev)
+ {
++ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
++
++ regulator_put(sd->vdvi_reg);
++
++ kfree(sd);
+ }
+
+ static int sharp_ls_panel_enable(struct omap_dss_device *dssdev)
+ {
++ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
++ regulator_enable(sd->vdvi_reg);
++
+ if (dssdev->platform_enable)
+ r = dssdev->platform_enable(dssdev);
+
+@@ -66,9 +100,13 @@ static int sharp_ls_panel_enable(struct omap_dss_device *dssdev)
+
+ static void sharp_ls_panel_disable(struct omap_dss_device *dssdev)
+ {
++ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
++
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
++ regulator_disable(sd->vdvi_reg);
++
+ /* wait at least 5 vsyncs after disabling the LCD */
+
+ msleep(100);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0094-DSS2-Beagle-regulators-for-VDAC-DSI.patch b/recipes/linux/linux-omap-pm/dss2/0094-DSS2-Beagle-regulators-for-VDAC-DSI.patch
new file mode 100644
index 0000000000..e57a433e3a
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0094-DSS2-Beagle-regulators-for-VDAC-DSI.patch
@@ -0,0 +1,52 @@
+From bf864e242e238f99124d63be457d2783d28894c9 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 29 May 2009 13:52:50 +0300
+Subject: [PATCH 094/146] DSS2: Beagle: regulators for VDAC, DSI
+
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 67e1d5c..977bbbe 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -184,13 +184,13 @@ static struct platform_device beagle_dss_device = {
+ },
+ };
+
+-static struct regulator_consumer_supply beagle_vdac_supply = {
+- .supply = "vdac",
++static struct regulator_consumer_supply beagle_vdda_dac_supply = {
++ .supply = "vdda_dac",
+ .dev = &beagle_dss_device.dev,
+ };
+
+-static struct regulator_consumer_supply beagle_vdvi_supply = {
+- .supply = "vdvi",
++static struct regulator_consumer_supply beagle_vdds_dsi_supply = {
++ .supply = "vdds_dsi",
+ .dev = &beagle_dss_device.dev,
+ };
+
+@@ -322,7 +322,7 @@ static struct regulator_init_data beagle_vdac = {
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+- .consumer_supplies = &beagle_vdac_supply,
++ .consumer_supplies = &beagle_vdda_dac_supply,
+ };
+
+ /* VPLL2 for digital video outputs */
+@@ -337,7 +337,7 @@ static struct regulator_init_data beagle_vpll2 = {
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+- .consumer_supplies = &beagle_vdvi_supply,
++ .consumer_supplies = &beagle_vdds_dsi_supply,
+ };
+
+ static struct twl4030_platform_data beagle_twldata = {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0095-DSS2-Fix-checkpatch-complaints.patch b/recipes/linux/linux-omap-pm/dss2/0095-DSS2-Fix-checkpatch-complaints.patch
new file mode 100644
index 0000000000..3c5959d4f5
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0095-DSS2-Fix-checkpatch-complaints.patch
@@ -0,0 +1,740 @@
+From 978ac67a1c8f75579548ee692312fb69986e6cb0 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 1 Jun 2009 18:02:00 +0300
+Subject: [PATCH 095/146] DSS2: Fix checkpatch complaints
+
+---
+ arch/arm/plat-omap/vrfb.c | 9 ++---
+ drivers/video/omap2/dss/core.c | 9 +++--
+ drivers/video/omap2/dss/dispc.c | 35 +++++++++++++-----
+ drivers/video/omap2/dss/display.c | 39 +++++++++++---------
+ drivers/video/omap2/dss/dsi.c | 32 ++++++++++------
+ drivers/video/omap2/dss/manager.c | 12 ++++---
+ drivers/video/omap2/dss/overlay.c | 56 ++++++++++++++++++++---------
+ drivers/video/omap2/dss/venc.c | 9 ++---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 5 ++-
+ drivers/video/omap2/omapfb/omapfb-main.c | 35 +++++++++---------
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 17 +++++----
+ 11 files changed, 158 insertions(+), 100 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 59ac66a..0c7d943 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -1,9 +1,8 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/ioport.h>
+-
+-#include <asm/io.h>
+-#include <asm/bitops.h>
++#include <linux/io.h>
++#include <linux/bitops.h>
+
+ #include <mach/io.h>
+ #include <mach/vrfb.h>
+@@ -55,7 +54,7 @@ static struct {
+ u32 size;
+ } vrfb_hw_context[VRFB_NUM_CTXS];
+
+-static void inline restore_hw_context(int ctx)
++static inline void restore_hw_context(int ctx)
+ {
+ omap_writel(vrfb_hw_context[ctx].control, SMS_ROT_CONTROL(ctx));
+ omap_writel(vrfb_hw_context[ctx].size, SMS_ROT_SIZE(ctx));
+@@ -180,7 +179,7 @@ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+ clear_bit(ctx, &ctx_map);
+
+ for (rot = 0; rot < 4; ++rot) {
+- if(vrfb->paddr[rot]) {
++ if (vrfb->paddr[rot]) {
+ release_mem_region(vrfb->paddr[rot], OMAP_VRFB_SIZE);
+ vrfb->paddr[rot] = 0;
+ }
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index 212b774..3f544dc 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -73,8 +73,8 @@ static int dss_get_ctx_id(void)
+ return 0;
+ r = pdata->get_last_off_on_transaction_id(&core.pdev->dev);
+ if (r < 0) {
+- dev_err(&core.pdev->dev,
+- "getting transaction ID failed, will force context restore\n");
++ dev_err(&core.pdev->dev, "getting transaction ID failed, "
++ "will force context restore\n");
+ r = -1;
+ }
+ return r;
+@@ -157,7 +157,7 @@ static int dss_get_clocks(void)
+ char *omap2_name;
+ char *omap3_name;
+ } clocks[5] = {
+- { &core.dss_ick, "dss_ick", "dss_ick" }, /* L3 & L4 ick */
++ { &core.dss_ick, "dss_ick", "dss_ick" }, /* L3 & L4 ick */
+ { &core.dss1_fck, "dss1_fck", "dss1_alwon_fck" },
+ { &core.dss2_fck, "dss2_fck", "dss2_alwon_fck" },
+ { &core.dss_54m_fck, "dss_54m_fck", "dss_tv_fck" },
+@@ -766,7 +766,8 @@ static void reset_device(struct device *dev, int check)
+ dev->platform_data = NULL;
+ while (dev_p < dev_end) {
+ if (*dev_p) {
+- WARN("%s: struct device fields will be discarded\n",
++ WARN("%s: struct device fields will be "
++ "discarded\n",
+ __func__);
+ break;
+ }
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 52170f8..229c4b1 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1120,17 +1120,33 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
+
+ if (mirroring) {
+ switch (rotation) {
+- case 0: vidrot = 2; break;
+- case 1: vidrot = 1; break;
+- case 2: vidrot = 0; break;
+- case 3: vidrot = 3; break;
++ case 0:
++ vidrot = 2;
++ break;
++ case 1:
++ vidrot = 1;
++ break;
++ case 2:
++ vidrot = 0;
++ break;
++ case 3:
++ vidrot = 3;
++ break;
+ }
+ } else {
+ switch (rotation) {
+- case 0: vidrot = 0; break;
+- case 1: vidrot = 1; break;
+- case 2: vidrot = 2; break;
+- case 3: vidrot = 3; break;
++ case 0:
++ vidrot = 0;
++ break;
++ case 1:
++ vidrot = 1;
++ break;
++ case 2:
++ vidrot = 2;
++ break;
++ case 3:
++ vidrot = 3;
++ break;
+ }
+ }
+
+@@ -1923,7 +1939,8 @@ bool dispc_trans_key_enabled(enum omap_channel ch)
+ enabled = REG_GET(DISPC_CONFIG, 10, 10);
+ else if (ch == OMAP_DSS_CHANNEL_DIGIT)
+ enabled = REG_GET(DISPC_CONFIG, 12, 12);
+- else BUG();
++ else
++ BUG();
+ enable_clocks(0);
+
+ return enabled;
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 2251bff..20fb1ca 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -85,16 +85,17 @@ static ssize_t display_upd_mode_store(struct device *dev,
+ val = simple_strtoul(buf, NULL, 10);
+
+ switch (val) {
+- case OMAP_DSS_UPDATE_DISABLED:
+- case OMAP_DSS_UPDATE_AUTO:
+- case OMAP_DSS_UPDATE_MANUAL:
+- mode = (enum omap_dss_update_mode)val;
+- break;
+- default:
+- return -EINVAL;
++ case OMAP_DSS_UPDATE_DISABLED:
++ case OMAP_DSS_UPDATE_AUTO:
++ case OMAP_DSS_UPDATE_MANUAL:
++ mode = (enum omap_dss_update_mode)val;
++ break;
++ default:
++ return -EINVAL;
+ }
+
+- if ((r = dssdev->set_update_mode(dssdev, mode)))
++ r = dssdev->set_update_mode(dssdev, mode);
++ if (r)
+ return r;
+
+ return size;
+@@ -120,7 +121,8 @@ static ssize_t display_tear_store(struct device *dev,
+
+ te = simple_strtoul(buf, NULL, 0);
+
+- if ((r = dssdev->enable_te(dssdev, te)))
++ r = dssdev->enable_te(dssdev, te);
++ if (r)
+ return r;
+
+ return size;
+@@ -169,7 +171,8 @@ static ssize_t display_timings_store(struct device *dev,
+ &t.y_res, &t.vfp, &t.vbp, &t.vsw) != 9)
+ return -EINVAL;
+
+- if ((r = dssdev->check_timings(dssdev, &t)))
++ r = dssdev->check_timings(dssdev, &t);
++ if (r)
+ return r;
+
+ dssdev->set_timings(dssdev, &t);
+@@ -200,7 +203,8 @@ static ssize_t display_rotate_store(struct device *dev,
+
+ rot = simple_strtoul(buf, NULL, 0);
+
+- if ((r = dssdev->set_rotate(dssdev, rot)))
++ r = dssdev->set_rotate(dssdev, rot);
++ if (r)
+ return r;
+
+ return size;
+@@ -229,7 +233,8 @@ static ssize_t display_mirror_store(struct device *dev,
+
+ mirror = simple_strtoul(buf, NULL, 0);
+
+- if ((r = dssdev->set_mirror(dssdev, mirror)))
++ r = dssdev->set_mirror(dssdev, mirror);
++ if (r)
+ return r;
+
+ return size;
+@@ -265,7 +270,8 @@ static ssize_t display_wss_store(struct device *dev,
+ if (wss > 0xfffff)
+ return -EINVAL;
+
+- if ((r = dssdev->set_wss(dssdev, wss)))
++ r = dssdev->set_wss(dssdev, wss);
++ if (r)
+ return r;
+
+ return size;
+@@ -596,8 +602,7 @@ struct omap_dss_device *omap_dss_find_device(void *data,
+ {
+ struct omap_dss_device *dssdev = NULL;
+
+- while ((dssdev = omap_dss_get_next_device(dssdev)) != NULL)
+- {
++ while ((dssdev = omap_dss_get_next_device(dssdev)) != NULL) {
+ if (match(dssdev, data))
+ return dssdev;
+ }
+@@ -622,13 +627,13 @@ int omap_dss_start_device(struct omap_dss_device *dssdev)
+ goto err0;
+ }
+
+- if(!try_module_get(dssdev->dev.driver->owner)) {
++ if (!try_module_get(dssdev->dev.driver->owner)) {
+ r = -ENODEV;
+ goto err0;
+ }
+
+ if (dssdev->ctrl.panel) {
+- if(!try_module_get(dssdev->ctrl.panel->dev.driver->owner)) {
++ if (!try_module_get(dssdev->ctrl.panel->dev.driver->owner)) {
+ r = -ENODEV;
+ goto err1;
+ }
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 9c8488e..9181a45 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -448,7 +448,8 @@ static void perf_show(const char *name)
+ total_time_auto = ktime_sub(t, dsi.perf_start_time_auto);
+ total_time_auto_us = (u32)ktime_to_us(total_time_auto);
+
+- printk("DSI(%s): %u fps, setup %u/%u/%u, trans %u/%u/%u\n",
++ printk(KERN_INFO "DSI(%s): %u fps, setup %u/%u/%u, "
++ "trans %u/%u/%u\n",
+ name,
+ 1000 * 1000 * numframes / total_time_auto_us,
+ s_min_setup_us,
+@@ -466,8 +467,8 @@ static void perf_show(const char *name)
+ s_max_trans_us = 0;
+ perf_mark_start_auto();
+ } else {
+- printk("DSI(%s): %u us + %u us = %u us (%uHz), %u bytes, "
+- "%u kbytes/sec\n",
++ printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), "
++ "%u bytes, %u kbytes/sec\n",
+ name,
+ setup_us,
+ trans_us,
+@@ -844,9 +845,12 @@ int dsi_pll_calc_pck(bool is_tft, unsigned long req_pck,
+ struct dsi_clock_info cur, best;
+ int min_fck_per_pck;
+ int match = 0;
++ unsigned long dss_clk_fck2;
++
++ dss_clk_fck2 = dss_clk_get_rate(DSS_CLK_FCK2);
+
+ if (req_pck == dsi.cache_req_pck &&
+- dsi.cache_cinfo.clkin == dss_clk_get_rate(DSS_CLK_FCK2)) {
++ dsi.cache_cinfo.clkin == dss_clk_fck2) {
+ DSSDBG("DSI clock info found from cache\n");
+ *cinfo = dsi.cache_cinfo;
+ return 0;
+@@ -868,7 +872,7 @@ retry:
+ memset(&best, 0, sizeof(best));
+
+ memset(&cur, 0, sizeof(cur));
+- cur.clkin = dss_clk_get_rate(DSS_CLK_FCK2);
++ cur.clkin = dss_clk_fck2;
+ cur.use_dss2_fck = 1;
+ cur.highfreq = 0;
+
+@@ -973,11 +977,14 @@ static int dsi_pll_calc_ddrfreq(unsigned long clk_freq,
+ struct dsi_clock_info cur, best;
+ const bool use_dss2_fck = 1;
+ unsigned long datafreq;
++ unsigned long dss_clk_fck2;
+
+ DSSDBG("dsi_pll_calc_ddrfreq\n");
+
++ dss_clk_fck2 = dss_clk_get_rate(DSS_CLK_FCK2);
++
+ if (clk_freq == dsi.cache_clk_freq &&
+- dsi.cache_cinfo.clkin == dss_clk_get_rate(DSS_CLK_FCK2)) {
++ dsi.cache_cinfo.clkin == dss_clk_fck2) {
+ DSSDBG("DSI clock info found from cache\n");
+ *cinfo = dsi.cache_cinfo;
+ return 0;
+@@ -990,7 +997,7 @@ static int dsi_pll_calc_ddrfreq(unsigned long clk_freq,
+ memset(&cur, 0, sizeof(cur));
+ cur.use_dss2_fck = use_dss2_fck;
+ if (use_dss2_fck) {
+- cur.clkin = dss_clk_get_rate(DSS_CLK_FCK2);
++ cur.clkin = dss_clk_fck2;
+ cur.highfreq = 0;
+ } else {
+ cur.clkin = dispc_pclk_rate();
+@@ -2081,7 +2088,8 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen)
+ if (r)
+ return r;
+
+- if (REG_GET(DSI_VC_CTRL(channel), 20, 20) == 0) { /* RX_FIFO_NOT_EMPTY */
++ /* RX_FIFO_NOT_EMPTY */
++ if (REG_GET(DSI_VC_CTRL(channel), 20, 20) == 0) {
+ DSSERR("RX fifo empty when trying to read.\n");
+ return -EIO;
+ }
+@@ -2611,7 +2619,7 @@ static void dsi_setup_update_dispc(struct omap_dss_device *dssdev,
+ dsi.update_region.y = y;
+ dsi.update_region.w = w;
+ dsi.update_region.h = h;
+- dsi.update_region.bytespp = 3; // XXX
++ dsi.update_region.bytespp = 3; /* XXX */
+ #endif
+
+ dispc_setup_partial_planes(dssdev, &x, &y, &w, &h);
+@@ -2630,7 +2638,7 @@ static void dsi_setup_autoupdate_dispc(struct omap_dss_device *dssdev)
+ dsi.update_region.y = 0;
+ dsi.update_region.w = w;
+ dsi.update_region.h = h;
+- dsi.update_region.bytespp = 3; // XXX
++ dsi.update_region.bytespp = 3; /* XXX */
+ #endif
+
+ /* the overlay settings may not have been applied, if we were in manual
+@@ -2993,8 +3001,8 @@ static void dsi_do_cmd_set_te(struct omap_dss_device *dssdev, bool enable)
+
+ if (!dssdev->phy.dsi.ext_te) {
+ if (enable) {
+- /* disable LP_RX_TO, so that we can receive TE.
+- * Time to wait for TE is longer than the timer allows */
++ /* disable LP_RX_TO, so that we can receive TE. Time
++ * to wait for TE is longer than the timer allows */
+ REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
+ } else {
+ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index c68b9af..e183fcc 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -44,7 +44,8 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
+ mgr->device ? mgr->device->name : "<none>");
+ }
+
+-static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const char *buf, size_t size)
++static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
++ const char *buf, size_t size)
+ {
+ int r = 0;
+ size_t len = size;
+@@ -288,7 +289,8 @@ static MANAGER_ATTR(color_key_type, S_IRUGO|S_IWUSR,
+ static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR,
+ manager_color_key_value_show, manager_color_key_value_store);
+ static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR,
+- manager_color_key_enabled_show, manager_color_key_enabled_store);
++ manager_color_key_enabled_show,
++ manager_color_key_enabled_store);
+ static MANAGER_ATTR(alpha_blending_enabled, S_IRUGO|S_IWUSR,
+ manager_alpha_blending_enabled_show,
+ manager_alpha_blending_enabled_store);
+@@ -305,7 +307,8 @@ static struct attribute *manager_sysfs_attrs[] = {
+ NULL
+ };
+
+-static ssize_t manager_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
++static ssize_t manager_attr_show(struct kobject *kobj, struct attribute *attr,
++ char *buf)
+ {
+ struct omap_overlay_manager *manager;
+ struct manager_attribute *manager_attr;
+@@ -504,9 +507,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+ continue;
+
+- if (!overlay_enabled(ovl)) {
++ if (!overlay_enabled(ovl))
+ continue;
+- }
+
+ ovl->manager->device->configure_overlay(ovl);
+ }
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 3704727..31385f3 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -47,7 +47,8 @@ static ssize_t overlay_manager_show(struct omap_overlay *ovl, char *buf)
+ ovl->manager ? ovl->manager->name : "<none>");
+ }
+
+-static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf, size_t size)
++static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
++ size_t size)
+ {
+ int i, r;
+ struct omap_overlay_manager *mgr = NULL;
+@@ -92,8 +93,11 @@ static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
+ }
+ }
+
+- if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
+- return r;
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ return r;
++ }
+
+ return size;
+ }
+@@ -131,11 +135,15 @@ static ssize_t overlay_position_store(struct omap_overlay *ovl,
+
+ info.pos_y = simple_strtoul(last, &last, 10);
+
+- if ((r = ovl->set_overlay_info(ovl, &info)))
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r)
+ return r;
+
+- if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
+- return r;
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ return r;
++ }
+
+ return size;
+ }
+@@ -162,11 +170,15 @@ static ssize_t overlay_output_size_store(struct omap_overlay *ovl,
+
+ info.out_height = simple_strtoul(last, &last, 10);
+
+- if ((r = ovl->set_overlay_info(ovl, &info)))
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r)
+ return r;
+
+- if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
+- return r;
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ return r;
++ }
+
+ return size;
+ }
+@@ -176,7 +188,8 @@ static ssize_t overlay_enabled_show(struct omap_overlay *ovl, char *buf)
+ return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.enabled);
+ }
+
+-static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf, size_t size)
++static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
++ size_t size)
+ {
+ int r;
+ struct omap_overlay_info info;
+@@ -185,11 +198,15 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
+
+ info.enabled = simple_strtoul(buf, NULL, 10);
+
+- if ((r = ovl->set_overlay_info(ovl, &info)))
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r)
+ return r;
+
+- if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
+- return r;
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ return r;
++ }
+
+ return size;
+ }
+@@ -216,11 +233,15 @@ static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
+ else
+ info.global_alpha = simple_strtoul(buf, NULL, 10);
+
+- if ((r = ovl->set_overlay_info(ovl, &info)))
++ r = ovl->set_overlay_info(ovl, &info);
++ if (r)
+ return r;
+
+- if (ovl->manager && (r = ovl->manager->apply(ovl->manager)))
+- return r;
++ if (ovl->manager) {
++ r = ovl->manager->apply(ovl->manager);
++ if (r)
++ return r;
++ }
+
+ return size;
+ }
+@@ -261,7 +282,8 @@ static struct attribute *overlay_sysfs_attrs[] = {
+ NULL
+ };
+
+-static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
++static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr,
++ char *buf)
+ {
+ struct omap_overlay *overlay;
+ struct overlay_attribute *overlay_attr;
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index d06dc38..740c8c0 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -320,7 +320,8 @@ static void venc_write_config(const struct venc_config *config)
+ venc_write_reg(VENC_BLACK_LEVEL, config->black_level);
+ venc_write_reg(VENC_BLANK_LEVEL, config->blank_level);
+ venc_write_reg(VENC_M_CONTROL, config->m_control);
+- venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | venc.wss_data);
++ venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
++ venc.wss_data);
+ venc_write_reg(VENC_S_CARR, config->s_carr);
+ venc_write_reg(VENC_L21__WC_CTL, config->l21__wc_ctl);
+ venc_write_reg(VENC_SAVID__EAVID, config->savid__eavid);
+@@ -406,7 +407,6 @@ static const struct venc_config *venc_timings_to_config(
+ /* driver */
+ static int venc_panel_probe(struct omap_dss_device *dssdev)
+ {
+- //dssdev->name = "tv-out";
+ dssdev->panel.timings = omap_dss_pal_timings;
+
+ return 0;
+@@ -497,8 +497,6 @@ int venc_init(struct platform_device *pdev)
+ venc_enable_clocks(0);
+
+ return omap_dss_register_driver(&venc_driver);
+-
+- //return 0;
+ }
+
+ void venc_exit(void)
+@@ -703,7 +701,8 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
+
+ venc_enable_clocks(1);
+
+- venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | venc.wss_data);
++ venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
++ venc.wss_data);
+
+ venc_enable_clocks(0);
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 0ca57db..806b4e7 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -299,7 +299,7 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
+ return 0;
+ }
+
+- switch(ck->key_type) {
++ switch (ck->key_type) {
+ case OMAPFB_COLOR_KEY_GFX_DST:
+ kt = OMAP_DSS_COLOR_KEY_GFX_DST;
+ break;
+@@ -646,7 +646,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+
+ case OMAPFB_GET_COLOR_KEY:
+ DBG("ioctl GET_COLOR_KEY\n");
+- if ((r = omapfb_get_color_key(fbi, &p.color_key)) < 0)
++ r = omapfb_get_color_key(fbi, &p.color_key);
++ if (r)
+ break;
+ if (copy_to_user((void __user *)arg, &p.color_key,
+ sizeof(p.color_key)))
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index df5ede3..4e93bd6 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1119,7 +1119,7 @@ ssize_t omapfb_write(struct fb_info *info, const char __user *buf,
+ size_t count, loff_t *ppos)
+ {
+ DBG("omapfb_write %d, %lu\n", count, (unsigned long)*ppos);
+- // XXX needed for VRFB
++ /* XXX needed for VRFB */
+ return count;
+ }
+ #endif
+@@ -1139,7 +1139,7 @@ static struct fb_ops omapfb_ops = {
+ .fb_mmap = omapfb_mmap,
+ .fb_setcolreg = omapfb_setcolreg,
+ .fb_setcmap = omapfb_setcmap,
+- //.fb_write = omapfb_write,
++ /*.fb_write = omapfb_write,*/
+ };
+
+ static void omapfb_free_fbmem(struct fb_info *fbi)
+@@ -1237,7 +1237,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+ /* only ioremap the 0 angle view */
+ va = ioremap_wc(rg->vrfb.paddr[0], size);
+
+- if(!va) {
++ if (!va) {
+ printk(KERN_ERR "vrfb: ioremap failed\n");
+ omap_vrfb_release_ctx(&rg->vrfb);
+ return -ENOMEM;
+@@ -1295,8 +1295,8 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+
+ omap_vrfb_adjust_size(&w, &h, bytespp);
+
+- /* Because we change the resolution of the 0 degree view,
+- * we need to alloc max(w, h) for height */
++ /* Because we change the resolution of the 0 degree
++ * view, we need to alloc max(w, h) for height */
+ h = max(w, h);
+ w = OMAP_VRFB_LINE_LEN;
+
+@@ -1313,11 +1313,11 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+ return omapfb_alloc_fbmem(fbi, size, paddr);
+ }
+
+-static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format format)
++static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format fmt)
+ {
+ enum omap_color_mode mode;
+
+- switch (format) {
++ switch (fmt) {
+ case OMAPFB_COLOR_RGB565:
+ mode = OMAP_DSS_COLOR_RGB16;
+ break;
+@@ -1633,15 +1633,16 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+
+ if (!var->bits_per_pixel) {
+ switch (display->get_recommended_bpp(display)) {
+- case 16:
+- var->bits_per_pixel = 16;
+- break;
+- case 24:
+- var->bits_per_pixel = 32;
+- break;
+- default:
+- dev_err(fbdev->dev, "illegal display bpp\n");
+- return -EINVAL;
++ case 16:
++ var->bits_per_pixel = 16;
++ break;
++ case 24:
++ var->bits_per_pixel = 32;
++ break;
++ default:
++ dev_err(fbdev->dev, "illegal display "
++ "bpp\n");
++ return -EINVAL;
+ }
+ }
+ } else {
+@@ -1801,7 +1802,7 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
+ if (fbdev->num_fbs > 0) {
+ struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]);
+
+- if (ofbi->num_overlays > 0 ) {
++ if (ofbi->num_overlays > 0) {
+ struct omap_overlay *ovl = ofbi->overlays[0];
+
+ r = omapfb_overlay_enable(ovl, 1);
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index dcec42b..a00f61a 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -72,8 +72,8 @@ static ssize_t store_rotate_type(struct device *dev,
+ ofbi->rotation_type = rot_type;
+
+ /*
+- * Since the VRAM for this FB is not allocated at the moment we don't need to
+- * do any further parameter checking at this point.
++ * Since the VRAM for this FB is not allocated at the moment we don't
++ * need to do any further parameter checking at this point.
+ */
+ out:
+ omapfb_unlock(fbdev);
+@@ -321,8 +321,8 @@ static ssize_t show_overlays_rotate(struct device *dev,
+ return l;
+ }
+
+-static ssize_t store_overlays_rotate(struct device *dev, struct device_attribute *attr,
+- const char *buf, size_t count)
++static ssize_t store_overlays_rotate(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
+ {
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+@@ -451,11 +451,13 @@ static ssize_t show_virt(struct device *dev,
+ }
+
+ static struct device_attribute omapfb_attrs[] = {
+- __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, store_rotate_type),
++ __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type,
++ store_rotate_type),
+ __ATTR(mirror, S_IRUGO | S_IWUSR, show_mirror, store_mirror),
+ __ATTR(size, S_IRUGO | S_IWUSR, show_size, store_size),
+ __ATTR(overlays, S_IRUGO | S_IWUSR, show_overlays, store_overlays),
+- __ATTR(overlays_rotate, S_IRUGO | S_IWUSR, show_overlays_rotate, store_overlays_rotate),
++ __ATTR(overlays_rotate, S_IRUGO | S_IWUSR, show_overlays_rotate,
++ store_overlays_rotate),
+ __ATTR(phys_addr, S_IRUGO, show_phys, NULL),
+ __ATTR(virt_addr, S_IRUGO, show_virt, NULL),
+ };
+@@ -473,7 +475,8 @@ int omapfb_create_sysfs(struct omapfb2_device *fbdev)
+ &omapfb_attrs[t]);
+
+ if (r) {
+- dev_err(fbdev->dev, "failed to create sysfs file\n");
++ dev_err(fbdev->dev, "failed to create sysfs "
++ "file\n");
+ return r;
+ }
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch b/recipes/linux/linux-omap-pm/dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch
new file mode 100644
index 0000000000..c81d79e7ca
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch
@@ -0,0 +1,278 @@
+From 1ccb690cf0a478e3bbbf9bf1ee0f03a33918b87e Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 1 Jun 2009 20:17:40 +0300
+Subject: [PATCH 096/146] DSS2: Overo: add vdac/dsi regulators, fix panel names
+
+---
+ arch/arm/mach-omap2/board-overo.c | 224 ++++++++++++++++++++++---------------
+ 1 files changed, 132 insertions(+), 92 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 39f95f5..07868f9 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -183,9 +183,110 @@ static inline void __init overo_init_smsc911x(void)
+ static inline void __init overo_init_smsc911x(void) { return; }
+ #endif
+
++/* DSS */
+ static int lcd_enabled;
+ static int dvi_enabled;
+
++#define OVERO_GPIO_LCD_EN 144
++
++static void __init overo_display_init(void)
++{
++ int r;
++
++ r = gpio_request(OVERO_GPIO_LCD_EN, "display enable");
++ if (r)
++ printk("fail1\n");
++ r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1);
++ if (r)
++ printk("fail2\n");
++ gpio_export(OVERO_GPIO_LCD_EN, 0);
++}
++
++static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
++{
++ if (lcd_enabled) {
++ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
++ return -EINVAL;
++ }
++ dvi_enabled = 1;
++
++ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
++
++ return 0;
++}
++
++static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
++{
++ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
++
++ dvi_enabled = 0;
++}
++
++static struct omap_dss_device overo_dvi_device = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .driver_name = "generic_panel",
++ .phy.dpi.data_lines = 24,
++ .platform_enable = overo_panel_enable_dvi,
++ .platform_disable = overo_panel_disable_dvi,
++};
++
++static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
++{
++ if (dvi_enabled) {
++ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
++ return -EINVAL;
++ }
++
++ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
++ lcd_enabled = 1;
++ return 0;
++}
++
++static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
++{
++ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
++ lcd_enabled = 0;
++}
++
++static struct omap_dss_device overo_lcd_device = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "lcd",
++ .driver_name = "samsung_lte_panel",
++ .phy.dpi.data_lines = 24,
++ .platform_enable = overo_panel_enable_lcd,
++ .platform_disable = overo_panel_disable_lcd,
++};
++
++static struct omap_dss_device *overo_dss_devices[] = {
++ &overo_dvi_device,
++ &overo_lcd_device,
++};
++
++static struct omap_dss_board_info overo_dss_data = {
++ .num_devices = ARRAY_SIZE(overo_dss_devices),
++ .devices = overo_dss_devices,
++ .default_device = &overo_dvi_device,
++};
++
++static struct platform_device overo_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &overo_dss_data,
++ },
++};
++
++static struct regulator_consumer_supply overo_vdda_dac_supply = {
++ .supply = "vdda_dac",
++ .dev = &overo_dss_device.dev,
++};
++
++static struct regulator_consumer_supply overo_vdds_dsi_supply = {
++ .supply = "vdds_dsi",
++ .dev = &overo_dss_device.dev,
++};
++
+ static struct mtd_partition overo_nand_partitions[] = {
+ {
+ .name = "xloader",
+@@ -235,7 +336,6 @@ static struct platform_device overo_nand_device = {
+ .resource = &overo_nand_resource,
+ };
+
+-
+ static void __init overo_flash_init(void)
+ {
+ u8 cs = 0;
+@@ -334,6 +434,35 @@ static struct regulator_init_data overo_vmmc1 = {
+ .consumer_supplies = &overo_vmmc1_supply,
+ };
+
++/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
++static struct regulator_init_data overo_vdac = {
++ .constraints = {
++ .min_uV = 1800000,
++ .max_uV = 1800000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &overo_vdda_dac_supply,
++};
++
++/* VPLL2 for digital video outputs */
++static struct regulator_init_data overo_vpll2 = {
++ .constraints = {
++ .name = "VDVI",
++ .min_uV = 1800000,
++ .max_uV = 1800000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &overo_vdds_dsi_supply,
++};
++
+ /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
+
+ static struct twl4030_platform_data overo_twldata = {
+@@ -342,6 +471,8 @@ static struct twl4030_platform_data overo_twldata = {
+ .gpio = &overo_gpio_data,
+ .usb = &overo_usb_data,
+ .vmmc1 = &overo_vmmc1,
++ .vdac = &overo_vdac,
++ .vpll2 = &overo_vpll2,
+ };
+
+ static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
+@@ -369,97 +500,6 @@ static void __init overo_init_irq(void)
+ omap_gpio_init();
+ }
+
+-/* DSS */
+-
+-#define OVERO_GPIO_LCD_EN 144
+-
+-static void __init overo_display_init(void)
+-{
+- int r;
+-
+- r = gpio_request(OVERO_GPIO_LCD_EN, "display enable");
+- if (r)
+- printk("fail1\n");
+- r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1);
+- if (r)
+- printk("fail2\n");
+- gpio_export(OVERO_GPIO_LCD_EN, 0);
+-}
+-
+-static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
+-{
+- if (lcd_enabled) {
+- printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+- return -EINVAL;
+- }
+- dvi_enabled = 1;
+-
+- gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+-
+- return 0;
+-}
+-
+-static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
+-{
+- gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+-
+- dvi_enabled = 0;
+-}
+-
+-static struct omap_dss_device overo_dvi_device = {
+- .type = OMAP_DISPLAY_TYPE_DPI,
+- .name = "dvi",
+- .driver_name = "panel_generic",
+- .phy.dpi.data_lines = 24,
+- .platform_enable = overo_panel_enable_dvi,
+- .platform_disable = overo_panel_disable_dvi,
+-};
+-
+-static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
+-{
+- if (dvi_enabled) {
+- printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+- return -EINVAL;
+- }
+-
+- gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+- lcd_enabled = 1;
+- return 0;
+-}
+-
+-static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
+-{
+- gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+- lcd_enabled = 0;
+-}
+-
+-static struct omap_dss_device overo_lcd_device = {
+- .type = OMAP_DISPLAY_TYPE_DPI,
+- .name = "lcd",
+- .driver_name = "samsung-lte430wq-f0c",
+- .phy.dpi.data_lines = 24,
+- .platform_enable = overo_panel_enable_lcd,
+- .platform_disable = overo_panel_disable_lcd,
+-};
+-
+-static struct omap_dss_device *overo_dss_devices[] = {
+- &overo_dvi_device,
+- &overo_lcd_device,
+-};
+-
+-static struct omap_dss_board_info overo_dss_data = {
+- .num_devices = ARRAY_SIZE(overo_dss_devices),
+- .devices = overo_dss_devices,
+- .default_device = &overo_dvi_device,
+-};
+-
+-static struct platform_device overo_dss_device = {
+- .name = "omapdss",
+- .id = -1,
+- .dev = {
+- .platform_data = &overo_dss_data,
+- },
+-};
+
+ static struct omap_board_config_kernel overo_config[] __initdata = {
+ { OMAP_TAG_UART, &overo_uart_config },
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0097-DSS2-implement-overlay_manager_info.patch b/recipes/linux/linux-omap-pm/dss2/0097-DSS2-implement-overlay_manager_info.patch
new file mode 100644
index 0000000000..34dca0cc0c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0097-DSS2-implement-overlay_manager_info.patch
@@ -0,0 +1,649 @@
+From aaa65c193e129dda3518e1e088ad8b3af68165d0 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 2 Jun 2009 16:51:49 +0300
+Subject: [PATCH 097/146] DSS2: implement overlay_manager_info
+
+Store manager config in similar as overlay config. Config
+is applied with mgr->apply(). Also change transparency color key
+variable names from color_key to trans_key.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ Documentation/arm/OMAP/DSS | 10 +-
+ arch/arm/plat-omap/include/mach/display.h | 31 ++--
+ drivers/video/omap2/dss/dispc.c | 4 +-
+ drivers/video/omap2/dss/dss.h | 4 +-
+ drivers/video/omap2/dss/manager.c | 278 ++++++++++++++---------------
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 49 +++---
+ 6 files changed, 186 insertions(+), 190 deletions(-)
+
+diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
+index 751000b..958686a 100644
+--- a/Documentation/arm/OMAP/DSS
++++ b/Documentation/arm/OMAP/DSS
+@@ -138,11 +138,11 @@ global_alpha global alpha 0-255 0=transparent 255=opaque
+ /sys/devices/platform/omapdss/manager? directory:
+ display Destination display
+ name
+-alpha_blending_enabled 0=off 1=on
+-color_key_enabled 0=off 1=on
+-color_key_type gfx-destination video-source
+-color_key_value 0 to 2^24
+-default_color default background color RGB24 0 to 2^24
++alpha_blending_enabled 0=off, 1=on
++trans_key_enabled 0=off, 1=on
++trans_key_type gfx-destination, video-source
++trans_key_value transparency color key (RGB24)
++default_color default background color (RGB24)
+
+ /sys/devices/platform/omapdss/display? directory:
+ ctrl_name Controller name
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 94585ba..4ccbe4c 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -110,7 +110,7 @@ enum omap_dss_load_mode {
+ OMAP_DSS_LOAD_CLUT_ONCE_FRAME = 3,
+ };
+
+-enum omap_dss_color_key_type {
++enum omap_dss_trans_key_type {
+ OMAP_DSS_COLOR_KEY_GFX_DST = 0,
+ OMAP_DSS_COLOR_KEY_VID_SRC = 1,
+ };
+@@ -292,6 +292,16 @@ struct omap_overlay {
+ struct omap_overlay_info *info);
+ };
+
++struct omap_overlay_manager_info {
++ u32 default_color;
++
++ enum omap_dss_trans_key_type trans_key_type;
++ u32 trans_key;
++ bool trans_enabled;
++
++ bool alpha_enabled;
++};
++
+ struct omap_overlay_manager {
+ struct kobject kobj;
+ struct list_head list;
+@@ -299,6 +309,7 @@ struct omap_overlay_manager {
+ const char *name;
+ int id;
+ enum omap_overlay_manager_caps caps;
++ struct omap_overlay_manager_info info;
+ struct omap_dss_device *device;
+ int num_overlays;
+ struct omap_overlay **overlays;
+@@ -310,20 +321,10 @@ struct omap_overlay_manager {
+
+ int (*apply)(struct omap_overlay_manager *mgr);
+
+- void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
+- u32 (*get_default_color)(struct omap_overlay_manager *mgr);
+- bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
+- bool (*get_trans_key_status)(struct omap_overlay_manager *mgr);
+- void (*get_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
+- enum omap_dss_color_key_type *type,
+- u32 *trans_key);
+- void (*set_trans_key_type_and_value)(struct omap_overlay_manager *mgr,
+- enum omap_dss_color_key_type type,
+- u32 trans_key);
+- void (*enable_trans_key)(struct omap_overlay_manager *mgr,
+- bool enable);
+- void (*enable_alpha_blending)(struct omap_overlay_manager *mgr,
+- bool enable);
++ int (*set_manager_info)(struct omap_overlay_manager *mgr,
++ struct omap_overlay_manager_info *info);
++ void (*get_manager_info)(struct omap_overlay_manager *mgr,
++ struct omap_overlay_manager_info *info);
+ };
+
+ struct omap_dss_device {
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 229c4b1..5ef9a32 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1856,7 +1856,7 @@ u32 dispc_get_default_color(enum omap_channel channel)
+ }
+
+ void dispc_set_trans_key(enum omap_channel ch,
+- enum omap_dss_color_key_type type,
++ enum omap_dss_trans_key_type type,
+ u32 trans_key)
+ {
+ const struct dispc_reg tr_reg[] = {
+@@ -1873,7 +1873,7 @@ void dispc_set_trans_key(enum omap_channel ch,
+ }
+
+ void dispc_get_trans_key(enum omap_channel ch,
+- enum omap_dss_color_key_type *type,
++ enum omap_dss_trans_key_type *type,
+ u32 *trans_key)
+ {
+ const struct dispc_reg tr_reg[] = {
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 6180968..9a3aea1 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -298,10 +298,10 @@ void dispc_set_loadmode(enum omap_dss_load_mode mode);
+ void dispc_set_default_color(enum omap_channel channel, u32 color);
+ u32 dispc_get_default_color(enum omap_channel channel);
+ void dispc_set_trans_key(enum omap_channel ch,
+- enum omap_dss_color_key_type type,
++ enum omap_dss_trans_key_type type,
+ u32 trans_key);
+ void dispc_get_trans_key(enum omap_channel ch,
+- enum omap_dss_color_key_type *type,
++ enum omap_dss_trans_key_type *type,
+ u32 *trans_key);
+ void dispc_enable_trans_key(enum omap_channel ch, bool enable);
+ void dispc_enable_alpha_blending(enum omap_channel ch, bool enable);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index e183fcc..6afc1cb 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -109,166 +109,175 @@ put_device:
+ static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- return snprintf(buf, PAGE_SIZE, "%d",
+- mgr->get_default_color(mgr));
++ return snprintf(buf, PAGE_SIZE, "%d", mgr->info.default_color);
+ }
+
+ static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+ {
+- u32 default_color;
++ struct omap_overlay_manager_info info;
++ u32 color;
++ int r;
+
+- if (sscanf(buf, "%d", &default_color) != 1)
++ if (sscanf(buf, "%d", &color) != 1)
+ return -EINVAL;
+- dispc_set_default_color(mgr->id, default_color);
++
++ mgr->get_manager_info(mgr, &info);
++
++ info.default_color = color;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++ if (r)
++ return r;
+
+ return size;
+ }
+
+-static const char *color_key_type_str[] = {
++static const char *trans_key_type_str[] = {
+ "gfx-destination",
+ "video-source",
+ };
+
+-static ssize_t manager_color_key_type_show(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_type_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- enum omap_dss_color_key_type key_type;
++ enum omap_dss_trans_key_type key_type;
+
+- mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+- BUG_ON(key_type >= ARRAY_SIZE(color_key_type_str));
++ key_type = mgr->info.trans_key_type;
++ BUG_ON(key_type >= ARRAY_SIZE(trans_key_type_str));
+
+- return snprintf(buf, PAGE_SIZE, "%s\n", color_key_type_str[key_type]);
++ return snprintf(buf, PAGE_SIZE, "%s\n", trans_key_type_str[key_type]);
+ }
+
+-static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_type_store(struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+ {
+- enum omap_dss_color_key_type key_type;
+- u32 key_value;
++ enum omap_dss_trans_key_type key_type;
++ struct omap_overlay_manager_info info;
++ int r;
+
+ for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
+- key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
+- if (sysfs_streq(buf, color_key_type_str[key_type]))
++ key_type < ARRAY_SIZE(trans_key_type_str); key_type++) {
++ if (sysfs_streq(buf, trans_key_type_str[key_type]))
+ break;
+ }
+- if (key_type == ARRAY_SIZE(color_key_type_str))
++
++ if (key_type == ARRAY_SIZE(trans_key_type_str))
+ return -EINVAL;
+- /* OMAP does not support destination color key and alpha blending
+- * simultaneously. So if alpha blending and color keying both are
+- * enabled then refrain from setting the color key type to
+- * gfx-destination
+- */
+- if (!key_type) {
+- bool color_key_enabled;
+- bool alpha_blending_enabled;
+- color_key_enabled = mgr->get_trans_key_status(mgr);
+- alpha_blending_enabled = mgr->get_alpha_blending_status(mgr);
+- if (color_key_enabled && alpha_blending_enabled)
+- return -EINVAL;
+- }
+
+- mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+- mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
++ mgr->get_manager_info(mgr, &info);
++
++ info.trans_key_type = key_type;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++ if (r)
++ return r;
+
+ return size;
+ }
+
+-static ssize_t manager_color_key_value_show(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_value_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- u32 key_value;
+-
+- mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+-
+- return snprintf(buf, PAGE_SIZE, "%d\n", key_value);
++ return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.trans_key);
+ }
+
+-static ssize_t manager_color_key_value_store(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_value_store(struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+ {
+- enum omap_dss_color_key_type key_type;
++ struct omap_overlay_manager_info info;
+ u32 key_value;
++ int r;
+
+ if (sscanf(buf, "%d", &key_value) != 1)
+ return -EINVAL;
+- mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+- mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
++
++ mgr->get_manager_info(mgr, &info);
++
++ info.trans_key = key_value;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++ if (r)
++ return r;
+
+ return size;
+ }
+
+-static ssize_t manager_color_key_enabled_show(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_enabled_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- return snprintf(buf, PAGE_SIZE, "%d\n",
+- mgr->get_trans_key_status(mgr));
++ return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.trans_enabled);
+ }
+
+-static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
++static ssize_t manager_trans_key_enabled_store(struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+ {
++ struct omap_overlay_manager_info info;
+ int enable;
++ int r;
+
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+
+- /* OMAP does not support destination color keying and
+- * alpha blending simultaneously. so if alpha blending
+- * is enabled refrain from enabling destination color
+- * keying.
+- */
+- if (enable) {
+- bool enabled;
+- enabled = mgr->get_alpha_blending_status(mgr);
+- if (enabled) {
+- enum omap_dss_color_key_type key_type;
+- mgr->get_trans_key_type_and_value(mgr,
+- &key_type, NULL);
+- if (!key_type)
+- return -EINVAL;
+- }
++ mgr->get_manager_info(mgr, &info);
+
+- }
+- mgr->enable_trans_key(mgr, enable);
++ info.trans_enabled = enable ? true : false;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++ if (r)
++ return r;
+
+ return size;
+ }
++
+ static ssize_t manager_alpha_blending_enabled_show(
+ struct omap_overlay_manager *mgr, char *buf)
+ {
+- return snprintf(buf, PAGE_SIZE, "%d\n",
+- mgr->get_alpha_blending_status(mgr));
++ return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.alpha_enabled);
+ }
++
+ static ssize_t manager_alpha_blending_enabled_store(
+ struct omap_overlay_manager *mgr,
+ const char *buf, size_t size)
+ {
++ struct omap_overlay_manager_info info;
+ int enable;
++ int r;
++
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+- /* OMAP does not support destination color keying and
+- * alpha blending simultaneously. so if destination
+- * color keying is enabled refrain from enabling
+- * alpha blending
+- */
+- if (enable) {
+- bool enabled;
+- enabled = mgr->get_trans_key_status(mgr);
+- if (enabled) {
+- enum omap_dss_color_key_type key_type;
+- mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
+- if (!key_type)
+- return -EINVAL;
+
+- }
++ mgr->get_manager_info(mgr, &info);
++
++ info.alpha_enabled = enable ? true : false;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++ if (r)
++ return r;
+
+- }
+- mgr->enable_alpha_blending(mgr, enable);
+ return size;
+ }
+
+-
+ struct manager_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct omap_overlay_manager *, char *);
+@@ -284,13 +293,13 @@ static MANAGER_ATTR(display, S_IRUGO|S_IWUSR,
+ manager_display_show, manager_display_store);
+ static MANAGER_ATTR(default_color, S_IRUGO|S_IWUSR,
+ manager_default_color_show, manager_default_color_store);
+-static MANAGER_ATTR(color_key_type, S_IRUGO|S_IWUSR,
+- manager_color_key_type_show, manager_color_key_type_store);
+-static MANAGER_ATTR(color_key_value, S_IRUGO|S_IWUSR,
+- manager_color_key_value_show, manager_color_key_value_store);
+-static MANAGER_ATTR(color_key_enabled, S_IRUGO|S_IWUSR,
+- manager_color_key_enabled_show,
+- manager_color_key_enabled_store);
++static MANAGER_ATTR(trans_key_type, S_IRUGO|S_IWUSR,
++ manager_trans_key_type_show, manager_trans_key_type_store);
++static MANAGER_ATTR(trans_key_value, S_IRUGO|S_IWUSR,
++ manager_trans_key_value_show, manager_trans_key_value_store);
++static MANAGER_ATTR(trans_key_enabled, S_IRUGO|S_IWUSR,
++ manager_trans_key_enabled_show,
++ manager_trans_key_enabled_store);
+ static MANAGER_ATTR(alpha_blending_enabled, S_IRUGO|S_IWUSR,
+ manager_alpha_blending_enabled_show,
+ manager_alpha_blending_enabled_store);
+@@ -300,9 +309,9 @@ static struct attribute *manager_sysfs_attrs[] = {
+ &manager_attr_name.attr,
+ &manager_attr_display.attr,
+ &manager_attr_default_color.attr,
+- &manager_attr_color_key_type.attr,
+- &manager_attr_color_key_value.attr,
+- &manager_attr_color_key_enabled.attr,
++ &manager_attr_trans_key_type.attr,
++ &manager_attr_trans_key_value.attr,
++ &manager_attr_trans_key_enabled.attr,
+ &manager_attr_alpha_blending_enabled.attr,
+ NULL
+ };
+@@ -513,7 +522,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ ovl->manager->device->configure_overlay(ovl);
+ }
+
+- /* Issue GO for managers */
++ /* Configure managers, and issue GO */
+ list_for_each_entry(mgr, &manager_list, list) {
+ if (!(mgr->caps & OMAP_DSS_OVL_MGR_CAP_DISPC))
+ continue;
+@@ -523,6 +532,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ if (!dssdev)
+ continue;
+
++ dispc_set_trans_key(mgr->id, mgr->info.trans_key_type,
++ mgr->info.trans_key);
++ dispc_enable_trans_key(mgr->id, mgr->info.trans_enabled);
++ dispc_enable_alpha_blending(mgr->id, mgr->info.alpha_enabled);
++
+ /* We don't need GO with manual update display. LCD iface will
+ * always be turned off after frame, and new settings will
+ * be taken in to use at next update */
+@@ -537,49 +551,40 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ return ret;
+ }
+
+-static void omap_dss_mgr_set_def_color(struct omap_overlay_manager *mgr,
+- u32 color)
++static int dss_check_manager(struct omap_overlay_manager *mgr)
+ {
+- dispc_set_default_color(mgr->id, color);
+-}
++ /* OMAP does not support destination color keying and alpha blending
++ * simultaneously. */
+
+-static void omap_dss_mgr_set_trans_key_type_and_value(
+- struct omap_overlay_manager *mgr,
+- enum omap_dss_color_key_type type,
+- u32 trans_key)
+-{
+- dispc_set_trans_key(mgr->id, type, trans_key);
+-}
+-static void omap_dss_mgr_get_trans_key_type_and_value(
+- struct omap_overlay_manager *mgr,
+- enum omap_dss_color_key_type *type,
+- u32 *trans_key)
+-{
+- dispc_get_trans_key(mgr->id, type, trans_key);
+-}
++ if (mgr->info.alpha_enabled && mgr->info.trans_enabled &&
++ mgr->info.trans_key_type == OMAP_DSS_COLOR_KEY_GFX_DST)
++ return -EINVAL;
+
+-static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
+- bool enable)
+-{
+- dispc_enable_trans_key(mgr->id, enable);
+-}
+-static void omap_dss_mgr_enable_alpha_blending(struct omap_overlay_manager *mgr,
+- bool enable)
+-{
+- dispc_enable_alpha_blending(mgr->id, enable);
+-}
+-static bool omap_dss_mgr_get_alpha_blending_status(
+- struct omap_overlay_manager *mgr)
+-{
+- return dispc_alpha_blending_enabled(mgr->id);
++ return 0;
+ }
+-static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
++
++static int omap_dss_mgr_set_info(struct omap_overlay_manager *mgr,
++ struct omap_overlay_manager_info *info)
+ {
+- return dispc_get_default_color(mgr->id);
++ int r;
++ struct omap_overlay_manager_info old_info;
++
++ old_info = mgr->info;
++ mgr->info = *info;
++
++ r = dss_check_manager(mgr);
++ if (r) {
++ mgr->info = old_info;
++ return r;
++ }
++
++ return 0;
+ }
+-static bool omap_dss_mgr_get_trans_key_status(struct omap_overlay_manager *mgr)
++
++static void omap_dss_mgr_get_info(struct omap_overlay_manager *mgr,
++ struct omap_overlay_manager_info *info)
+ {
+- return dispc_trans_key_enabled(mgr->id);
++ *info = mgr->info;
+ }
+
+ static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
+@@ -620,18 +625,9 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ mgr->set_device = &omap_dss_set_device;
+ mgr->unset_device = &omap_dss_unset_device;
+ mgr->apply = &omap_dss_mgr_apply;
+- mgr->set_default_color = &omap_dss_mgr_set_def_color;
+- mgr->set_trans_key_type_and_value =
+- &omap_dss_mgr_set_trans_key_type_and_value;
+- mgr->get_trans_key_type_and_value =
+- &omap_dss_mgr_get_trans_key_type_and_value;
+- mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key;
+- mgr->get_trans_key_status = &omap_dss_mgr_get_trans_key_status;
+- mgr->enable_alpha_blending =
+- &omap_dss_mgr_enable_alpha_blending;
+- mgr->get_alpha_blending_status =
+- omap_dss_mgr_get_alpha_blending_status;
+- mgr->get_default_color = &omap_dss_mgr_get_default_color;
++ mgr->set_manager_info = &omap_dss_mgr_set_info;
++ mgr->get_manager_info = &omap_dss_mgr_get_info;
++
+ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
+
+ dss_overlay_setup_dispc_manager(mgr);
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 806b4e7..c513fe0 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -286,17 +286,23 @@ static struct omapfb_color_key omapfb_color_keys[2];
+ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
+ struct omapfb_color_key *ck)
+ {
+- enum omap_dss_color_key_type kt;
++ struct omap_overlay_manager_info info;
++ enum omap_dss_trans_key_type kt;
++ int r;
+
+- if (!mgr->set_default_color ||
+- !mgr->set_trans_key_type_and_value ||
+- !mgr->enable_trans_key)
+- return 0;
++ mgr->get_manager_info(mgr, &info);
+
+ if (ck->key_type == OMAPFB_COLOR_KEY_DISABLED) {
+- mgr->enable_trans_key(mgr, 0);
++ info.trans_enabled = false;
+ omapfb_color_keys[mgr->id] = *ck;
+- return 0;
++
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++
++ return r;
+ }
+
+ switch (ck->key_type) {
+@@ -310,13 +316,20 @@ static int _omapfb_set_color_key(struct omap_overlay_manager *mgr,
+ return -EINVAL;
+ }
+
+- mgr->set_default_color(mgr, ck->background);
+- mgr->set_trans_key_type_and_value(mgr, kt, ck->trans_key);
+- mgr->enable_trans_key(mgr, 1);
++ info.default_color = ck->background;
++ info.trans_key = ck->trans_key;
++ info.trans_key_type = kt;
++ info.trans_enabled = true;
+
+ omapfb_color_keys[mgr->id] = *ck;
+
+- return 0;
++ r = mgr->set_manager_info(mgr, &info);
++ if (r)
++ return r;
++
++ r = mgr->apply(mgr);
++
++ return r;
+ }
+
+ static int omapfb_set_color_key(struct fb_info *fbi,
+@@ -342,13 +355,6 @@ static int omapfb_set_color_key(struct fb_info *fbi,
+ goto err;
+ }
+
+- if (!mgr->set_default_color ||
+- !mgr->set_trans_key_type_and_value ||
+- !mgr->enable_trans_key) {
+- r = -ENODEV;
+- goto err;
+- }
+-
+ r = _omapfb_set_color_key(mgr, ck);
+ err:
+ omapfb_unlock(fbdev);
+@@ -379,13 +385,6 @@ static int omapfb_get_color_key(struct fb_info *fbi,
+ goto err;
+ }
+
+- if (!mgr->set_default_color ||
+- !mgr->set_trans_key_type_and_value ||
+- !mgr->enable_trans_key) {
+- r = -ENODEV;
+- goto err;
+- }
+-
+ *ck = omapfb_color_keys[mgr->id];
+ err:
+ omapfb_unlock(fbdev);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0098-DSS2-use-sysfs_streq-to-compare-display-names.patch b/recipes/linux/linux-omap-pm/dss2/0098-DSS2-use-sysfs_streq-to-compare-display-names.patch
new file mode 100644
index 0000000000..79b3704c1d
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0098-DSS2-use-sysfs_streq-to-compare-display-names.patch
@@ -0,0 +1,43 @@
+From 10b82544210f731f5c02e7bfc277f8ecb57c9263 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 2 Jun 2009 17:11:24 +0300
+Subject: [PATCH 098/146] DSS2: use sysfs_streq() to compare display names
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/manager.c | 14 +++-----------
+ 1 files changed, 3 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 6afc1cb..798867c 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -54,22 +54,14 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
+ int match(struct omap_dss_device *dssdev, void *data)
+ {
+ const char *str = data;
+- return strcmp(dssdev->name, str) == 0;
++ return sysfs_streq(dssdev->name, str);
+ }
+
+ if (buf[size-1] == '\n')
+ --len;
+
+- if (len > 0) {
+- char name[64];
+- int n;
+-
+- n = min(len, sizeof(name) - 1);
+- strncpy(name, buf, n);
+- name[n - 1] = 0;
+-
+- dssdev = omap_dss_find_device(name, match);
+- }
++ if (len > 0)
++ dssdev = omap_dss_find_device((void *)buf, match);
+
+ if (len > 0 && dssdev == NULL)
+ return -EINVAL;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0099-DSS2-Implement-function-to-verify-lcd-timings.patch b/recipes/linux/linux-omap-pm/dss2/0099-DSS2-Implement-function-to-verify-lcd-timings.patch
new file mode 100644
index 0000000000..0ba203f5ee
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0099-DSS2-Implement-function-to-verify-lcd-timings.patch
@@ -0,0 +1,144 @@
+From 875cf440d5450f5d91b2ef1ba6f051f93e77b8eb Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 3 Jun 2009 10:45:54 +0300
+Subject: [PATCH 099/146] DSS2: Implement function to verify lcd timings
+
+---
+ drivers/video/omap2/dss/dispc.c | 52 +++++++++++++++++++++++++++------------
+ drivers/video/omap2/dss/dpi.c | 25 +-----------------
+ drivers/video/omap2/dss/dss.h | 1 +
+ 3 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 5ef9a32..762a0f1 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2015,34 +2015,49 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode)
+ enable_clocks(0);
+ }
+
++static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
++ int vsw, int vfp, int vbp)
++{
++ if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
++ if (hsw < 1 || hsw > 64 ||
++ hfp < 1 || hfp > 256 ||
++ hbp < 1 || hbp > 256 ||
++ vsw < 1 || vsw > 64 ||
++ vfp < 0 || vfp > 255 ||
++ vbp < 0 || vbp > 255)
++ return false;
++ } else {
++ if (hsw < 1 || hsw > 256 ||
++ hfp < 1 || hfp > 4096 ||
++ hbp < 1 || hbp > 4096 ||
++ vsw < 1 || vsw > 256 ||
++ vfp < 0 || vfp > 4095 ||
++ vbp < 0 || vbp > 4095)
++ return false;
++ }
++
++ return true;
++}
++
++bool dispc_lcd_timings_ok(struct omap_video_timings *timings)
++{
++ return _dispc_lcd_timings_ok(timings->hsw, timings->hfp,
++ timings->hbp, timings->vsw,
++ timings->vfp, timings->vbp);
++}
++
+ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp,
+ int vsw, int vfp, int vbp)
+ {
+ u32 timing_h, timing_v;
+
+ if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
+- BUG_ON(hsw < 1 || hsw > 64);
+- BUG_ON(hfp < 1 || hfp > 256);
+- BUG_ON(hbp < 1 || hbp > 256);
+-
+- BUG_ON(vsw < 1 || vsw > 64);
+- BUG_ON(vfp < 0 || vfp > 255);
+- BUG_ON(vbp < 0 || vbp > 255);
+-
+ timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
+ FLD_VAL(hbp-1, 27, 20);
+
+ timing_v = FLD_VAL(vsw-1, 5, 0) | FLD_VAL(vfp, 15, 8) |
+ FLD_VAL(vbp, 27, 20);
+ } else {
+- BUG_ON(hsw < 1 || hsw > 256);
+- BUG_ON(hfp < 1 || hfp > 4096);
+- BUG_ON(hbp < 1 || hbp > 4096);
+-
+- BUG_ON(vsw < 1 || vsw > 256);
+- BUG_ON(vfp < 0 || vfp > 4095);
+- BUG_ON(vbp < 0 || vbp > 4095);
+-
+ timing_h = FLD_VAL(hsw-1, 7, 0) | FLD_VAL(hfp-1, 19, 8) |
+ FLD_VAL(hbp-1, 31, 20);
+
+@@ -2062,6 +2077,11 @@ void dispc_set_lcd_timings(struct omap_video_timings *timings)
+ unsigned xtot, ytot;
+ unsigned long ht, vt;
+
++ if (!_dispc_lcd_timings_ok(timings->hsw, timings->hfp,
++ timings->hbp, timings->vsw,
++ timings->vfp, timings->vbp))
++ BUG();
++
+ _dispc_set_lcd_timings(timings->hsw, timings->hfp, timings->hbp,
+ timings->vsw, timings->vfp, timings->vbp);
+
+diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
+index f5867cf..d244e54 100644
+--- a/drivers/video/omap2/dss/dpi.c
++++ b/drivers/video/omap2/dss/dpi.c
+@@ -287,29 +287,8 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
+ unsigned long fck;
+ unsigned long pck;
+
+- if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
+- if (timings->hsw < 1 || timings->hsw > 64 ||
+- timings->hfp < 1 || timings->hfp > 256 ||
+- timings->hbp < 1 || timings->hbp > 256) {
+- return -EINVAL;
+- }
+-
+- if (timings->vsw < 1 || timings->vsw > 64 ||
+- timings->vfp > 255 || timings->vbp > 255) {
+- return -EINVAL;
+- }
+- } else {
+- if (timings->hsw < 1 || timings->hsw > 256 ||
+- timings->hfp < 1 || timings->hfp > 4096 ||
+- timings->hbp < 1 || timings->hbp > 4096) {
+- return -EINVAL;
+- }
+-
+- if (timings->vsw < 1 || timings->vsw > 64 ||
+- timings->vfp > 4095 || timings->vbp > 4095) {
+- return -EINVAL;
+- }
+- }
++ if (!dispc_lcd_timings_ok(timings))
++ return -EINVAL;
+
+ if (timings->pixel_clock == 0)
+ return -EINVAL;
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 9a3aea1..370c54b 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -308,6 +308,7 @@ void dispc_enable_alpha_blending(enum omap_channel ch, bool enable);
+ bool dispc_trans_key_enabled(enum omap_channel ch);
+ bool dispc_alpha_blending_enabled(enum omap_channel ch);
+
++bool dispc_lcd_timings_ok(struct omap_video_timings *timings);
+ void dispc_set_lcd_timings(struct omap_video_timings *timings);
+ unsigned long dispc_fclk_rate(void);
+ unsigned long dispc_lclk_rate(void);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0100-DSS2-Remove-non-existing-dsi-power-funcs-from-dss.h.patch b/recipes/linux/linux-omap-pm/dss2/0100-DSS2-Remove-non-existing-dsi-power-funcs-from-dss.h.patch
new file mode 100644
index 0000000000..b3266cf635
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0100-DSS2-Remove-non-existing-dsi-power-funcs-from-dss.h.patch
@@ -0,0 +1,25 @@
+From 193e9e6c7206d21b9cd3eff752432fd2ce4da38c Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 3 Jun 2009 10:51:49 +0300
+Subject: [PATCH 100/146] DSS2: Remove non-existing dsi power funcs from dss.h
+
+---
+ drivers/video/omap2/dss/dss.h | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 370c54b..6608f90 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -164,8 +164,6 @@ unsigned long dss_clk_get_rate(enum dss_clock clk);
+ int dss_need_ctx_restore(void);
+ void dss_dump_clocks(struct seq_file *s);
+ struct bus_type *dss_get_bus(void);
+-int dss_dsi_power_up(void);
+-void dss_dsi_power_down(void);
+
+ #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
+ #define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0101-DSS2-move-to_dss_driver-and-to_dss_device-to-pu.patch b/recipes/linux/linux-omap-pm/dss2/0101-DSS2-move-to_dss_driver-and-to_dss_device-to-pu.patch
new file mode 100644
index 0000000000..b9597efae1
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0101-DSS2-move-to_dss_driver-and-to_dss_device-to-pu.patch
@@ -0,0 +1,40 @@
+From 76be132d45253ddca015c1bb8653a7ed9f7c684a Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 4 Jun 2009 10:58:13 +0300
+Subject: [PATCH 101/146] DSS2: move to_dss_driver() and to_dss_device() to public header
+
+---
+ arch/arm/plat-omap/include/mach/display.h | 4 ++++
+ drivers/video/omap2/dss/dss.h | 3 ---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 4ccbe4c..3d8ed69 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -518,4 +518,8 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
+ int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
+ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
+ unsigned long timeout);
++
++#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
++#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
++
+ #endif
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 6608f90..1e40830 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -165,9 +165,6 @@ int dss_need_ctx_restore(void);
+ void dss_dump_clocks(struct seq_file *s);
+ struct bus_type *dss_get_bus(void);
+
+-#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
+-#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
+-
+ /* display */
+ int dss_suspend_all_devices(void);
+ int dss_resume_all_devices(void);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0102-DSS2-CLK-change-omapfb-omapdss-in-clock-framewo.patch b/recipes/linux/linux-omap-pm/dss2/0102-DSS2-CLK-change-omapfb-omapdss-in-clock-framewo.patch
new file mode 100644
index 0000000000..d63fb58800
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0102-DSS2-CLK-change-omapfb-omapdss-in-clock-framewo.patch
@@ -0,0 +1,53 @@
+From 93859ac92c1f76585c6130e651d79ff14bc10c29 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 4 Jun 2009 15:06:22 +0300
+Subject: [PATCH 102/146] DSS2: CLK: change omapfb -> omapdss in clock framework
+
+---
+ arch/arm/mach-omap2/clock24xx.c | 8 ++++----
+ arch/arm/mach-omap2/clock34xx.c | 10 +++++-----
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
+index 44de027..402a3d4 100644
+--- a/arch/arm/mach-omap2/clock24xx.c
++++ b/arch/arm/mach-omap2/clock24xx.c
+@@ -103,10 +103,10 @@ static struct omap_clk omap24xx_clks[] = {
+ CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
+ CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
+ /* DSS domain clocks */
+- CLK("omapfb", "ick", &dss_ick, CK_243X | CK_242X),
+- CLK("omapfb", "dss1_fck", &dss1_fck, CK_243X | CK_242X),
+- CLK("omapfb", "dss2_fck", &dss2_fck, CK_243X | CK_242X),
+- CLK("omapfb", "tv_fck", &dss_54m_fck, CK_243X | CK_242X),
++ CLK("omapdss", "ick", &dss_ick, CK_243X | CK_242X),
++ CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X | CK_242X),
++ CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X | CK_242X),
++ CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X | CK_242X),
+ /* L3 domain clocks */
+ CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X | CK_242X),
+ CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X | CK_242X),
+diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
+index 045da92..dd7bba2 100644
+--- a/arch/arm/mach-omap2/clock34xx.c
++++ b/arch/arm/mach-omap2/clock34xx.c
+@@ -200,11 +200,11 @@ static struct omap_clk omap34xx_clks[] = {
+ CLK("omap_rng", "ick", &rng_ick, CK_343X),
+ CLK(NULL, "sha11_ick", &sha11_ick, CK_343X),
+ CLK(NULL, "des1_ick", &des1_ick, CK_343X),
+- CLK("omapfb", "dss1_fck", &dss1_alwon_fck, CK_343X),
+- CLK("omapfb", "tv_fck", &dss_tv_fck, CK_343X),
+- CLK("omapfb", "video_fck", &dss_96m_fck, CK_343X),
+- CLK("omapfb", "dss2_fck", &dss2_alwon_fck, CK_343X),
+- CLK("omapfb", "ick", &dss_ick, CK_343X),
++ CLK("omapdss", "dss1_fck", &dss1_alwon_fck, CK_343X),
++ CLK("omapdss", "tv_fck", &dss_tv_fck, CK_343X),
++ CLK("omapdss", "video_fck", &dss_96m_fck, CK_343X),
++ CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_343X),
++ CLK("omapdss", "ick", &dss_ick, CK_343X),
+ CLK(NULL, "cam_mclk", &cam_mclk, CK_343X),
+ CLK(NULL, "cam_ick", &cam_ick, CK_343X),
+ CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X),
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0103-DSS2-Use-clkdev.patch b/recipes/linux/linux-omap-pm/dss2/0103-DSS2-Use-clkdev.patch
new file mode 100644
index 0000000000..294380594b
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0103-DSS2-Use-clkdev.patch
@@ -0,0 +1,122 @@
+From a41c88224dc74dc2feebe16e579fc5df28ad85a4 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 4 Jun 2009 15:07:14 +0300
+Subject: [PATCH 103/146] DSS2: Use clkdev
+
+---
+ drivers/video/omap2/dss/core.c | 85 ++++++++++++++++++++++------------------
+ 1 files changed, 47 insertions(+), 38 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
+index 3f544dc..e8d430c 100644
+--- a/drivers/video/omap2/dss/core.c
++++ b/drivers/video/omap2/dss/core.c
+@@ -150,58 +150,67 @@ void dss_dump_clocks(struct seq_file *s)
+ }
+ }
+
+-static int dss_get_clocks(void)
++static int dss_get_clock(struct clk **clock, const char *clk_name)
+ {
+- const struct {
+- struct clk **clock;
+- char *omap2_name;
+- char *omap3_name;
+- } clocks[5] = {
+- { &core.dss_ick, "dss_ick", "dss_ick" }, /* L3 & L4 ick */
+- { &core.dss1_fck, "dss1_fck", "dss1_alwon_fck" },
+- { &core.dss2_fck, "dss2_fck", "dss2_alwon_fck" },
+- { &core.dss_54m_fck, "dss_54m_fck", "dss_tv_fck" },
+- { &core.dss_96m_fck, NULL, "dss_96m_fck" },
+- };
++ struct clk *clk;
+
+- int r = 0;
+- int i;
+- const int num_clocks = 5;
++ clk = clk_get(&core.pdev->dev, clk_name);
+
+- for (i = 0; i < num_clocks; i++)
+- *clocks[i].clock = NULL;
++ if (IS_ERR(clk)) {
++ DSSERR("can't get clock %s", clk_name);
++ return PTR_ERR(clk);
++ }
+
+- for (i = 0; i < num_clocks; i++) {
+- struct clk *clk;
+- const char *clk_name;
++ *clock = clk;
+
+- clk_name = cpu_is_omap34xx() ? clocks[i].omap3_name
+- : clocks[i].omap2_name;
++ DSSDBG("clk %s, rate %ld\n", clk_name, clk_get_rate(clk));
+
+- if (!clk_name)
+- continue;
++ return 0;
++}
+
+- clk = clk_get(NULL, clk_name);
++static int dss_get_clocks(void)
++{
++ int r;
+
+- if (IS_ERR(clk)) {
+- DSSERR("can't get clock %s", clk_name);
+- r = PTR_ERR(clk);
+- goto err;
+- }
++ core.dss_ick = NULL;
++ core.dss1_fck = NULL;
++ core.dss2_fck = NULL;
++ core.dss_54m_fck = NULL;
++ core.dss_96m_fck = NULL;
+
+- DSSDBG("clk %s, rate %ld\n",
+- clk_name, clk_get_rate(clk));
++ r = dss_get_clock(&core.dss_ick, "ick");
++ if (r)
++ goto err;
+
+- *clocks[i].clock = clk;
+- }
++ r = dss_get_clock(&core.dss1_fck, "dss1_fck");
++ if (r)
++ goto err;
++
++ r = dss_get_clock(&core.dss2_fck, "dss2_fck");
++ if (r)
++ goto err;
++
++ r = dss_get_clock(&core.dss_54m_fck, "tv_fck");
++ if (r)
++ goto err;
++
++ r = dss_get_clock(&core.dss_96m_fck, "video_fck");
++ if (r)
++ goto err;
+
+ return 0;
+
+ err:
+- for (i = 0; i < num_clocks; i++) {
+- if (!IS_ERR(*clocks[i].clock))
+- clk_put(*clocks[i].clock);
+- }
++ if (core.dss_ick)
++ clk_put(core.dss_ick);
++ if (core.dss1_fck)
++ clk_put(core.dss1_fck);
++ if (core.dss2_fck)
++ clk_put(core.dss2_fck);
++ if (core.dss_54m_fck)
++ clk_put(core.dss_54m_fck);
++ if (core.dss_96m_fck)
++ clk_put(core.dss_96m_fck);
+
+ return r;
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0104-DSS2-Fix-documentation.patch b/recipes/linux/linux-omap-pm/dss2/0104-DSS2-Fix-documentation.patch
new file mode 100644
index 0000000000..479c850127
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0104-DSS2-Fix-documentation.patch
@@ -0,0 +1,38 @@
+From 9b9a9009fbb2d13adf0db67a2c27d27e7d624258 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 5 Jun 2009 11:21:13 +0300
+Subject: [PATCH 104/146] DSS2: Fix documentation
+
+---
+ Documentation/arm/OMAP/DSS | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
+index 958686a..0af0e9e 100644
+--- a/Documentation/arm/OMAP/DSS
++++ b/Documentation/arm/OMAP/DSS
+@@ -195,8 +195,8 @@ FB2 --- VID2 -/ TV ----- TV
+ Example: Switch from LCD to DVI
+ ----------------------
+
+-w=`cat $dvi/horizontal | cut -d "," -f 1`
+-h=`cat $dvi/vertical | cut -d "," -f 1`
++w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
++h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
+
+ echo "0" > $lcd/enabled
+ echo "" > $mgr0/display
+@@ -214,8 +214,8 @@ FB2 --- VID2 -/ TV ----- TV
+ Example: Clone GFX overlay to LCD and TV
+ -------------------------------
+
+-w=`cat $tv/horizontal | cut -d "," -f 1`
+-h=`cat $tv/vertical | cut -d "," -f 1`
++w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
++h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
+
+ echo "0" > $ovl0/enabled
+ echo "0" > $ovl1/enabled
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0105-DSS2-OMAPFB-first-set-TE-then-update-mode.patch b/recipes/linux/linux-omap-pm/dss2/0105-DSS2-OMAPFB-first-set-TE-then-update-mode.patch
new file mode 100644
index 0000000000..40831a0428
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0105-DSS2-OMAPFB-first-set-TE-then-update-mode.patch
@@ -0,0 +1,38 @@
+From f2fecd510357dbfb1f7a235ba9a74f1241b5224f Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 9 Jun 2009 11:50:55 +0300
+Subject: [PATCH 105/146] DSS2: OMAPFB: first set TE, then update mode
+
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 4e93bd6..1fe770c 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -2042,17 +2042,17 @@ static int omapfb_probe(struct platform_device *pdev)
+ /* set the update mode */
+ if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
+ #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 1);
+ if (def_display->set_update_mode)
+ def_display->set_update_mode(def_display,
+ OMAP_DSS_UPDATE_AUTO);
+- if (def_display->enable_te)
+- def_display->enable_te(def_display, 1);
+ #else
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 0);
+ if (def_display->set_update_mode)
+ def_display->set_update_mode(def_display,
+ OMAP_DSS_UPDATE_MANUAL);
+- if (def_display->enable_te)
+- def_display->enable_te(def_display, 0);
+ #endif
+ } else {
+ if (def_display->set_update_mode)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0106-DSS2-OMAPFB-Disable-forced-display-update-on-fb-cl.patch b/recipes/linux/linux-omap-pm/dss2/0106-DSS2-OMAPFB-Disable-forced-display-update-on-fb-cl.patch
new file mode 100644
index 0000000000..bf7febce2c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0106-DSS2-OMAPFB-Disable-forced-display-update-on-fb-cl.patch
@@ -0,0 +1,48 @@
+From fc26a92aecdb3ea3f72196f4e17bbd55589a75a8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 10 Jun 2009 14:14:35 +0300
+Subject: [PATCH 106/146] DSS2: OMAPFB: Disable forced display update on fb close
+
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 1fe770c..b4ac9ec 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -613,6 +613,7 @@ static int omapfb_open(struct fb_info *fbi, int user)
+
+ static int omapfb_release(struct fb_info *fbi, int user)
+ {
++#if 0
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ struct omapfb2_device *fbdev = ofbi->fbdev;
+ struct omap_dss_device *display = fb2display(fbi);
+@@ -620,7 +621,7 @@ static int omapfb_release(struct fb_info *fbi, int user)
+ DBG("Closing fb with plane index %d\n", ofbi->id);
+
+ omapfb_lock(fbdev);
+-#if 1
++
+ if (display && display->get_update_mode && display->update) {
+ /* XXX this update should be removed, I think. But it's
+ * good for debugging */
+@@ -635,13 +636,12 @@ static int omapfb_release(struct fb_info *fbi, int user)
+ display->update(display, 0, 0, w, h);
+ }
+ }
+-#endif
+
+ if (display && display->sync)
+ display->sync(display);
+
+ omapfb_unlock(fbdev);
+-
++#endif
+ return 0;
+ }
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0107-DSS2-DSI-use-INIT_COMPLETION-not-init_completion.patch b/recipes/linux/linux-omap-pm/dss2/0107-DSS2-DSI-use-INIT_COMPLETION-not-init_completion.patch
new file mode 100644
index 0000000000..d0449bcaba
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0107-DSS2-DSI-use-INIT_COMPLETION-not-init_completion.patch
@@ -0,0 +1,25 @@
+From f33fa27066daa62b038fea897159756f78d5faf8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 11 Jun 2009 09:11:10 +0300
+Subject: [PATCH 107/146] DSS2: DSI: use INIT_COMPLETION, not init_completion
+
+---
+ drivers/video/omap2/dss/dsi.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 9181a45..b0294b8 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1878,7 +1878,7 @@ static int dsi_vc_send_bta_sync(int channel)
+ int r = 0;
+ u32 err;
+
+- init_completion(&dsi.bta_completion);
++ INIT_COMPLETION(dsi.bta_completion);
+
+ dsi_vc_enable_bta_irq(channel);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0108-DSS2-DSI-Rewrite-of-the-DSI-update-and-cmd-queue.patch b/recipes/linux/linux-omap-pm/dss2/0108-DSS2-DSI-Rewrite-of-the-DSI-update-and-cmd-queue.patch
new file mode 100644
index 0000000000..e872bfdda9
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0108-DSS2-DSI-Rewrite-of-the-DSI-update-and-cmd-queue.patch
@@ -0,0 +1,1860 @@
+From 218fd1516751829b239e4c64f71291d291c6bc2c Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 11 Jun 2009 09:11:45 +0300
+Subject: [PATCH 108/146] DSS2: DSI: Rewrite of the DSI update and cmd queue
+
+---
+ drivers/video/omap2/dss/dsi.c | 1157 +++++++++++--------------------------
+ drivers/video/omap2/dss/dss.h | 3 +
+ drivers/video/omap2/dss/manager.c | 45 ++-
+ drivers/video/omap2/dss/overlay.c | 65 ++-
+ 4 files changed, 419 insertions(+), 851 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index b0294b8..f98da6f 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -26,12 +26,12 @@
+ #include <linux/err.h>
+ #include <linux/interrupt.h>
+ #include <linux/delay.h>
+-#include <linux/workqueue.h>
+ #include <linux/mutex.h>
+ #include <linux/seq_file.h>
+-#include <linux/kfifo.h>
+ #include <linux/platform_device.h>
+ #include <linux/regulator/consumer.h>
++#include <linux/kthread.h>
++#include <linux/wait.h>
+
+ #include <mach/board.h>
+ #include <mach/display.h>
+@@ -192,60 +192,10 @@ enum fifo_size {
+ DSI_FIFO_SIZE_128 = 4,
+ };
+
+-#define DSI_CMD_FIFO_LEN 16
+-
+-struct dsi_cmd_update {
+- int bytespp;
+- u16 x;
+- u16 y;
+- u16 w;
+- u16 h;
+-};
+-
+-struct dsi_cmd_mem_read {
+- void *buf;
+- size_t size;
+- u16 x;
+- u16 y;
+- u16 w;
+- u16 h;
+- size_t *ret_size;
+- struct completion *completion;
+-};
+-
+-struct dsi_cmd_test {
+- int test_num;
+- int *result;
+- struct completion *completion;
+-};
+-
+-enum dsi_cmd {
+- DSI_CMD_UPDATE,
+- DSI_CMD_AUTOUPDATE,
+- DSI_CMD_SYNC,
+- DSI_CMD_MEM_READ,
+- DSI_CMD_TEST,
+- DSI_CMD_SET_TE,
+- DSI_CMD_SET_UPDATE_MODE,
+- DSI_CMD_SET_ROTATE,
+- DSI_CMD_SET_MIRROR,
+-};
+-
+-struct dsi_cmd_item {
+- struct omap_dss_device *dssdev;
+-
+- enum dsi_cmd cmd;
+-
+- union {
+- struct dsi_cmd_update r;
+- struct completion *sync;
+- struct dsi_cmd_mem_read mem_read;
+- struct dsi_cmd_test test;
+- int te;
+- enum omap_dss_update_mode update_mode;
+- int rotate;
+- int mirror;
+- } u;
++struct dsi_update_region {
++ bool dirty;
++ u16 x, y, w, h;
++ struct omap_dss_device *device;
+ };
+
+ static struct
+@@ -272,30 +222,24 @@ static struct
+
+ struct completion bta_completion;
+
+- struct work_struct framedone_work;
+- struct work_struct process_work;
+- struct delayed_work framedone_timeout_work;
+- struct workqueue_struct *workqueue;
++ struct task_struct *thread;
++ wait_queue_head_t waitqueue;
++
++ spinlock_t update_lock;
++ bool framedone_received;
++ struct dsi_update_region update_region;
++ struct dsi_update_region active_update_region;
++ struct completion update_completion;
+
+ enum omap_dss_update_mode user_update_mode;
+- enum omap_dss_update_mode target_update_mode;
+ enum omap_dss_update_mode update_mode;
+- bool use_te;
++ bool te_enabled;
+ bool use_ext_te;
+- int framedone_scheduled; /* helps to catch strange framedone bugs */
+
+ unsigned long cache_req_pck;
+ unsigned long cache_clk_freq;
+ struct dsi_clock_info cache_cinfo;
+
+- struct kfifo *cmd_fifo;
+- spinlock_t cmd_lock;
+- struct completion cmd_done;
+- atomic_t cmd_fifo_full;
+- atomic_t cmd_pending;
+-
+- bool autoupdate_setup;
+-
+ u32 errors;
+ spinlock_t errors_lock;
+ #ifdef DEBUG
+@@ -303,14 +247,7 @@ static struct
+ ktime_t perf_start_time;
+ ktime_t perf_start_time_auto;
+ int perf_measure_frames;
+-
+- struct {
+- int x, y, w, h;
+- int bytespp;
+- } update_region;
+-
+ #endif
+- int debug_process;
+ int debug_read;
+ int debug_write;
+ } dsi;
+@@ -320,11 +257,6 @@ static unsigned int dsi_perf;
+ module_param_named(dsi_perf, dsi_perf, bool, 0644);
+ #endif
+
+-static void dsi_process_cmd_fifo(struct work_struct *work);
+-static void dsi_push_update(struct omap_dss_device *dssdev,
+- int x, int y, int w, int h);
+-static void dsi_push_autoupdate(struct omap_dss_device *dssdev);
+-
+ static inline void dsi_write_reg(const struct dsi_reg idx, u32 val)
+ {
+ __raw_writel(val, dsi.base + idx.idx);
+@@ -370,23 +302,23 @@ static inline int wait_for_bit_change(const struct dsi_reg idx, int bitnum,
+ }
+
+ #ifdef DEBUG
+-static void perf_mark_setup(void)
++static void dsi_perf_mark_setup(void)
+ {
+ dsi.perf_setup_time = ktime_get();
+ }
+
+-static void perf_mark_start(void)
++static void dsi_perf_mark_start(void)
+ {
+ dsi.perf_start_time = ktime_get();
+ }
+
+-static void perf_mark_start_auto(void)
++static void dsi_perf_mark_start_auto(void)
+ {
+ dsi.perf_measure_frames = 0;
+ dsi.perf_start_time_auto = ktime_get();
+ }
+
+-static void perf_show(const char *name)
++static void dsi_perf_show(const char *name)
+ {
+ ktime_t t, setup_time, trans_time;
+ u32 total_bytes;
+@@ -412,9 +344,9 @@ static void perf_show(const char *name)
+
+ total_us = setup_us + trans_us;
+
+- total_bytes = dsi.update_region.w *
+- dsi.update_region.h *
+- dsi.update_region.bytespp;
++ total_bytes = dsi.active_update_region.w *
++ dsi.active_update_region.h *
++ dsi.active_update_region.device->ctrl.pixel_size / 8;
+
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) {
+ static u32 s_total_trans_us, s_total_setup_us;
+@@ -465,7 +397,7 @@ static void perf_show(const char *name)
+ s_total_trans_us = 0;
+ s_min_trans_us = 0xffffffff;
+ s_max_trans_us = 0;
+- perf_mark_start_auto();
++ dsi_perf_mark_start_auto();
+ } else {
+ printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), "
+ "%u bytes, %u kbytes/sec\n",
+@@ -479,9 +411,10 @@ static void perf_show(const char *name)
+ }
+ }
+ #else
+-#define perf_mark_setup()
+-#define perf_mark_start()
+-#define perf_show(x)
++#define dsi_perf_mark_setup()
++#define dsi_perf_mark_start()
++#define dsi_perf_mark_start_auto()
++#define dsi_perf_show(x)
+ #endif
+
+ static void print_irq_status(u32 status)
+@@ -2464,7 +2397,7 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ int max_data_per_packet;
+ int max_pixels_per_packet;
+ int pixels_left;
+- int bytespp = 3;
++ int bytespp = dssdev->ctrl.pixel_size / 8;
+ int scr_width;
+ u32 __iomem *data;
+ int start_offset;
+@@ -2508,26 +2441,12 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+
+ DSSDBG("max_pixels_per_packet %d\n", max_pixels_per_packet);
+
+- dsi_bus_lock();
+-
+- dssdev->driver->setup_update(dssdev, x, y, w, h);
+-
+ pixels_left = w * h;
+
+ DSSDBG("total pixels %d\n", pixels_left);
+
+ data += start_offset;
+
+-#ifdef DEBUG
+- dsi.update_region.x = x;
+- dsi.update_region.y = y;
+- dsi.update_region.w = w;
+- dsi.update_region.h = h;
+- dsi.update_region.bytespp = bytespp;
+-#endif
+-
+- perf_mark_start();
+-
+ while (pixels_left > 0) {
+ /* 0x2c = write_memory_start */
+ /* 0x3c = write_memory_continue */
+@@ -2546,7 +2465,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
+- dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2559,7 +2477,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
+- dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2570,7 +2487,6 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ DSSERR("fifo stalls overflow, pixels left %d\n",
+ pixels_left);
+ dsi_if_enable(0);
+- dsi_bus_unlock();
+ return -EIO;
+ }
+ }
+@@ -2601,64 +2517,21 @@ static int dsi_update_screen_l4(struct omap_dss_device *dssdev,
+ DSI_FLUSH(0);
+ }
+
+- perf_show("L4");
+-
+- dsi_bus_unlock();
+-
+ return 0;
+ }
+
+-static void dsi_setup_update_dispc(struct omap_dss_device *dssdev,
+- u16 x, u16 y, u16 w, u16 h)
+-{
+- DSSDBG("dsi_setup_update_dispc(%d,%d %dx%d)\n",
+- x, y, w, h);
+-
+-#ifdef DEBUG
+- dsi.update_region.x = x;
+- dsi.update_region.y = y;
+- dsi.update_region.w = w;
+- dsi.update_region.h = h;
+- dsi.update_region.bytespp = 3; /* XXX */
+-#endif
+-
+- dispc_setup_partial_planes(dssdev, &x, &y, &w, &h);
+-
+- dispc_set_lcd_size(w, h);
+-}
+-
+-static void dsi_setup_autoupdate_dispc(struct omap_dss_device *dssdev)
+-{
+- u16 w, h;
+-
+- dssdev->get_resolution(dssdev, &w, &h);
+-
+-#ifdef DEBUG
+- dsi.update_region.x = 0;
+- dsi.update_region.y = 0;
+- dsi.update_region.w = w;
+- dsi.update_region.h = h;
+- dsi.update_region.bytespp = 3; /* XXX */
+-#endif
+-
+- /* the overlay settings may not have been applied, if we were in manual
+- * mode earlier, so do it here */
+- dssdev->manager->apply(dssdev->manager);
+-
+- dispc_set_lcd_size(w, h);
+-
+- dsi.autoupdate_setup = 0;
+-}
+-
+ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+- int bytespp = 3;
++ int bytespp = dssdev->ctrl.pixel_size / 8;
+ int len;
+ int total_len;
+ int packet_payload;
+ int packet_len;
+ u32 l;
++ bool use_te_trigger;
++
++ use_te_trigger = dsi.te_enabled && !dsi.use_ext_te;
+
+ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
+ DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
+@@ -2677,24 +2550,15 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+ if (len % packet_payload)
+ total_len += (len % packet_payload) + 1;
+
+- dsi_bus_lock();
+-
+- dssdev->driver->setup_update(dssdev, x, y, w, h);
+-
+- if (dsi.use_ext_te && dssdev->wait_for_te)
+- dssdev->wait_for_te(dssdev);
+-
+ if (0)
+ dsi_vc_print_status(1);
+
+- perf_mark_start();
+-
+ l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
+ dsi_write_reg(DSI_VC_TE(1), l);
+
+ dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
+
+- if (dsi.use_te)
++ if (use_te_trigger)
+ l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
+ else
+ l = FLD_MOD(l, 1, 31, 31); /* TE_START */
+@@ -2702,62 +2566,81 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+
+ dispc_disable_sidle();
+
+- queue_delayed_work(dsi.workqueue, &dsi.framedone_timeout_work,
+- msecs_to_jiffies(1000));
+-
+ dispc_enable_lcd_out(1);
+
+- if (dsi.use_te)
++ if (use_te_trigger)
+ dsi_vc_send_bta(1);
+ }
+
+-static void framedone_timeout_callback(struct work_struct *work)
++static void dsi_framedone_irq_callback(void *data, u32 mask)
+ {
+- DSSERR("framedone timeout\n");
+-
+- dispc_enable_lcd_out(0);
++ dispc_enable_sidle();
+
+- /* XXX TODO: cancel the transfer properly */
++ dsi.framedone_received = true;
++ wake_up(&dsi.waitqueue);
++}
+
+- dsi_bus_unlock();
++static void dsi_set_update_region(struct omap_dss_device *dssdev,
++ u16 x, u16 y, u16 w, u16 h)
++{
++ spin_lock(&dsi.update_lock);
++ if (dsi.update_region.dirty) {
++ dsi.update_region.x = min(x, dsi.update_region.x);
++ dsi.update_region.y = min(y, dsi.update_region.y);
++ dsi.update_region.w = max(w, dsi.update_region.w);
++ dsi.update_region.h = max(h, dsi.update_region.h);
++ } else {
++ dsi.update_region.x = x;
++ dsi.update_region.y = y;
++ dsi.update_region.w = w;
++ dsi.update_region.h = h;
++ }
+
+- /* Schedule, so that other threads that want dsi-bus-lock can get it.
+- * Otherwise with autoupdate we may be holding it all the time */
+- schedule();
++ dsi.update_region.device = dssdev;
++ dsi.update_region.dirty = true;
+
+- /* XXX check that fifo is not full. otherwise we would sleep and never
+- * get to process_cmd_fifo below */
+- /* We check for target_update_mode, not update_mode. No reason to push
+- * new updates if we're turning auto update off */
+- if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_push_autoupdate(dsi.vc[1].dssdev);
++ spin_unlock(&dsi.update_lock);
+
+- atomic_set(&dsi.cmd_pending, 0);
+- dsi_process_cmd_fifo(NULL);
+ }
+
+-static void framedone_callback(void *data, u32 mask)
++static void dsi_start_auto_update(struct omap_dss_device *dssdev)
+ {
+- if (dsi.framedone_scheduled) {
+- DSSERR("Framedone already scheduled. Bogus FRAMEDONE IRQ?\n");
+- return;
+- }
++ u16 w, h;
++
++ DSSDBG("starting auto update\n");
+
+- cancel_delayed_work(&dsi.framedone_timeout_work);
++ /* In automatic mode the overlay settings are applied like on DPI/SDI.
++ * The overlay settings may not have been applied, if we were in manual
++ * mode earlier, so do it here */
++ dssdev->manager->apply(dssdev->manager);
+
+- dispc_enable_sidle();
++ dssdev->get_resolution(dssdev, &w, &h);
+
+- dsi.framedone_scheduled = 1;
++ dsi_set_update_region(dssdev, 0, 0, w, h);
+
+- /* We get FRAMEDONE when DISPC has finished sending pixels and turns
+- * itself off. However, DSI still has the pixels in its buffers, and
+- * is sending the data. Thus we have to wait until we can do a new
+- * transfer or turn the clocks off. We do that in a separate work
+- * func. */
+- queue_work(dsi.workqueue, &dsi.framedone_work);
++ dsi_perf_mark_start_auto();
++
++ wake_up(&dsi.waitqueue);
+ }
+
+-static void framedone_worker(struct work_struct *work)
++static int dsi_set_te(struct omap_dss_device *dssdev, bool enable)
++{
++ dssdev->driver->enable_te(dssdev, enable);
++
++ if (!dsi.use_ext_te) {
++ if (enable) {
++ /* disable LP_RX_TO, so that we can receive TE. Time
++ * to wait for TE is longer than the timer allows */
++ REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
++ } else {
++ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
++ }
++ }
++
++ return 0;
++}
++
++static void dsi_handle_framedone(void)
+ {
+ u32 l;
+ unsigned long tmo;
+@@ -2765,17 +2648,21 @@ static void framedone_worker(struct work_struct *work)
+
+ l = REG_GET(DSI_VC_TE(1), 23, 0); /* TE_SIZE */
+
+- /* There shouldn't be much stuff in DSI buffers, if any, so we'll
+- * just busyloop */
++ /* We get FRAMEDONE when DISPC has finished sending pixels and turns
++ * itself off. However, DSI still has the pixels in its buffers, and is
++ * sending the data. Thus we have to wait until we can do a new
++ * transfer or turn the clocks off. There shouldn't be much stuff in
++ * DSI buffers, if any, so we'll just busyloop */
+ if (l > 0) {
+ tmo = jiffies + msecs_to_jiffies(50);
+ while (REG_GET(DSI_VC_TE(1), 23, 0) > 0) { /* TE_SIZE */
+ i++;
+ if (time_after(jiffies, tmo)) {
+- DSSERR("timeout waiting TE_SIZE to zero\n");
++ DSSERR("timeout waiting TE_SIZE to zero: %u\n",
++ REG_GET(DSI_VC_TE(1), 23, 0));
+ break;
+ }
+- cpu_relax();
++ schedule();
+ }
+ }
+
+@@ -2785,8 +2672,6 @@ static void framedone_worker(struct work_struct *work)
+ if (REG_GET(DSI_VC_TE(1), 31, 31))
+ DSSERR("TE_START not zero\n");
+
+- perf_show("DISPC");
+-
+ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
+ DSSDBG("FRAMEDONE\n");
+
+@@ -2801,543 +2686,145 @@ static void framedone_worker(struct work_struct *work)
+ #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
+ dispc_fake_vsync_irq();
+ #endif
+- dsi.framedone_scheduled = 0;
+-
+- dsi_bus_unlock();
+-
+- /* Schedule, so that other threads that want dsi-bus-lock can get it.
+- * Otherwise with autoupdate we may be holding it all the time */
+- schedule();
+-
+- /* XXX check that fifo is not full. otherwise we would sleep and never
+- * get to process_cmd_fifo below */
+- /* We check for target_update_mode, not update_mode. No reason to push
+- * new updates if we're turning auto update off */
+- if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_push_autoupdate(dsi.vc[1].dssdev);
+-
+- atomic_set(&dsi.cmd_pending, 0);
+- dsi_process_cmd_fifo(NULL);
+ }
+
+-static void dsi_start_auto_update(struct omap_dss_device *dssdev)
+-{
+- DSSDBG("starting auto update\n");
+-
+- dsi.autoupdate_setup = 1;
+-
+- dsi_push_autoupdate(dssdev);
+-
+- perf_mark_start_auto();
+-}
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-/* FIFO functions */
+-
+-static void dsi_signal_fifo_waiters(void)
++static int dsi_update_thread(void *data)
+ {
+- if (atomic_read(&dsi.cmd_fifo_full) > 0) {
+- DSSDBG("SIGNALING: Fifo not full for waiter!\n");
+- complete(&dsi.cmd_done);
+- atomic_dec(&dsi.cmd_fifo_full);
+- }
+-}
++ unsigned long timeout;
++ struct omap_dss_device *device;
++ u16 x, y, w, h;
+
+-/* returns 1 for async op, and 0 for sync op */
+-static int dsi_do_update(struct omap_dss_device *dssdev,
+- struct dsi_cmd_update *upd)
+-{
+- int r;
+- u16 x = upd->x, y = upd->y, w = upd->w, h = upd->h;
+- u16 dw, dh;
+-
+- if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
+- return 0;
+-
+- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+- return 0;
+-
+- dssdev->get_resolution(dssdev, &dw, &dh);
+- if (x > dw || y > dh)
+- return 0;
+-
+- if (x + w > dw)
+- w = dw - x;
+-
+- if (y + h > dh)
+- h = dh - y;
+-
+- DSSDBGF("%d,%d %dx%d", x, y, w, h);
+-
+- perf_mark_setup();
+-
+- if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+- dsi_setup_update_dispc(dssdev, x, y, w, h);
+- dsi_update_screen_dispc(dssdev, x, y, w, h);
+- return 1;
+- } else {
+- r = dsi_update_screen_l4(dssdev, x, y, w, h);
+- if (r)
+- DSSERR("L4 update failed\n");
+- return 0;
+- }
+-}
+-
+-/* returns 1 for async op, and 0 for sync op */
+-static int dsi_do_autoupdate(struct omap_dss_device *dssdev)
+-{
+- int r;
+- u16 w, h;
+-
+- if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED)
+- return 0;
+-
+- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+- return 0;
+-
+- dssdev->get_resolution(dssdev, &w, &h);
+-
+- perf_mark_setup();
+-
+- if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+- if (dsi.autoupdate_setup)
+- dsi_setup_autoupdate_dispc(dssdev);
+- dsi_update_screen_dispc(dssdev, 0, 0, w, h);
+- return 1;
+- } else {
+- r = dsi_update_screen_l4(dssdev, 0, 0, w, h);
+- if (r)
+- DSSERR("L4 update failed\n");
+- return 0;
+- }
+-}
+-
+-static void dsi_do_cmd_mem_read(struct omap_dss_device *dssdev,
+- struct dsi_cmd_mem_read *mem_read)
+-{
+- int r;
+-
+- dsi_bus_lock();
+-
+- r = dssdev->driver->memory_read(dssdev,
+- mem_read->buf,
+- mem_read->size,
+- mem_read->x,
+- mem_read->y,
+- mem_read->w,
+- mem_read->h);
+-
+- dsi_bus_unlock();
+-
+- *mem_read->ret_size = (size_t)r;
+- complete(mem_read->completion);
+-}
+-
+-static void dsi_do_cmd_test(struct omap_dss_device *dssdev,
+- struct dsi_cmd_test *test)
+-{
+- int r = 0;
+-
+- DSSDBGF("");
+-
+- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+- return;
+-
+- dsi_bus_lock();
+-
+- /* run test first in low speed mode */
+- dsi_vc_enable_hs(0, 0);
+-
+- if (dssdev->driver->run_test) {
+- r = dssdev->driver->run_test(dssdev, test->test_num);
+- if (r)
+- goto end;
+- }
+-
+- /* then in high speed */
+- dsi_vc_enable_hs(0, 1);
+-
+- if (dssdev->driver->run_test) {
+- r = dssdev->driver->run_test(dssdev, test->test_num);
+- if (r)
+- goto end;
+- }
+-
+-end:
+- dsi_vc_enable_hs(0, 1);
+-
+- dsi_bus_unlock();
+-
+- *test->result = r;
+- complete(test->completion);
+-
+- DSSDBG("test end\n");
+-}
+-
+-static void dsi_do_cmd_set_te(struct omap_dss_device *dssdev, bool enable)
+-{
+- if (!dssdev->phy.dsi.ext_te)
+- dsi.use_te = enable;
+- else
+- dsi.use_ext_te = enable;
+-
+- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+- return;
+-
+- dsi_bus_lock();
+- dssdev->driver->enable_te(dssdev, enable);
+- dsi_bus_unlock();
+-
+- if (!dssdev->phy.dsi.ext_te) {
+- if (enable) {
+- /* disable LP_RX_TO, so that we can receive TE. Time
+- * to wait for TE is longer than the timer allows */
+- REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
+- } else {
+- REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
+- }
+- }
+-}
+-
+-static void dsi_do_cmd_set_update_mode(struct omap_dss_device *dssdev,
+- enum omap_dss_update_mode mode)
+-{
+- dsi.update_mode = mode;
+-
+- if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+- return;
+-
+- if (mode == OMAP_DSS_UPDATE_AUTO)
+- dsi_start_auto_update(dssdev);
+-}
+-
+-static void dsi_process_cmd_fifo(struct work_struct *work)
+-{
+- int len;
+- struct dsi_cmd_item p;
+- unsigned long flags;
+- struct omap_dss_device *dssdev;
+- int exit = 0;
+-
+- if (dsi.debug_process)
+- DSSDBGF("");
+-
+- if (atomic_cmpxchg(&dsi.cmd_pending, 0, 1) == 1) {
+- if (dsi.debug_process)
+- DSSDBG("cmd pending, skip process\n");
+- return;
+- }
+-
+- while (!exit) {
+- spin_lock_irqsave(dsi.cmd_fifo->lock, flags);
+-
+- len = __kfifo_get(dsi.cmd_fifo, (unsigned char *)&p,
+- sizeof(p));
+- if (len == 0) {
+- if (dsi.debug_process)
+- DSSDBG("nothing more in fifo, atomic clear\n");
+- atomic_set(&dsi.cmd_pending, 0);
+- spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
+- break;
+- }
+-
+- spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
+-
+- BUG_ON(len != sizeof(p));
+-
+- dssdev = p.dssdev;
+-
+- if (dsi.debug_process)
+- DSSDBG("processing cmd %d\n", p.cmd);
+-
+- switch (p.cmd) {
+- case DSI_CMD_UPDATE:
+- if (dsi_do_update(dssdev, &p.u.r)) {
+- if (dsi.debug_process)
+- DSSDBG("async update\n");
+- exit = 1;
+- } else {
+- if (dsi.debug_process)
+- DSSDBG("sync update\n");
+- }
+- break;
+-
+- case DSI_CMD_AUTOUPDATE:
+- if (dsi_do_autoupdate(dssdev)) {
+- if (dsi.debug_process)
+- DSSDBG("async autoupdate\n");
+- exit = 1;
+- } else {
+- if (dsi.debug_process)
+- DSSDBG("sync autoupdate\n");
+- }
+- break;
+-
+- case DSI_CMD_SYNC:
+- if (dsi.debug_process)
+- DSSDBG("Signaling SYNC done!\n");
+- complete(p.u.sync);
+- break;
+-
+- case DSI_CMD_MEM_READ:
+- dsi_do_cmd_mem_read(dssdev, &p.u.mem_read);
+- break;
++ while (1) {
++ bool sched;
+
+- case DSI_CMD_TEST:
+- dsi_do_cmd_test(dssdev, &p.u.test);
+- break;
++ wait_event_interruptible(dsi.waitqueue,
++ dsi.update_mode == OMAP_DSS_UPDATE_AUTO ||
++ (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL &&
++ dsi.update_region.dirty == true) ||
++ kthread_should_stop());
+
+- case DSI_CMD_SET_TE:
+- dsi_do_cmd_set_te(dssdev, p.u.te);
++ if (kthread_should_stop())
+ break;
+
+- case DSI_CMD_SET_UPDATE_MODE:
+- dsi_do_cmd_set_update_mode(dssdev, p.u.update_mode);
+- break;
+-
+- case DSI_CMD_SET_ROTATE:
+- dsi_bus_lock();
+- dssdev->driver->set_rotate(dssdev, p.u.rotate);
+- if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
+- dsi.autoupdate_setup = 1;
+- dsi_bus_unlock();
+- break;
++ dsi_bus_lock();
+
+- case DSI_CMD_SET_MIRROR:
+- dsi_bus_lock();
+- dssdev->driver->set_mirror(dssdev, p.u.mirror);
++ if (dsi.update_mode == OMAP_DSS_UPDATE_DISABLED ||
++ kthread_should_stop()) {
+ dsi_bus_unlock();
+ break;
+-
+- default:
+- BUG();
+ }
+- }
+-
+- if (dsi.debug_process)
+- DSSDBG("exit dsi_process_cmd_fifo\n");
+-
+- dsi_signal_fifo_waiters();
+-}
+-
+-static void dsi_push_cmd(struct dsi_cmd_item *p)
+-{
+- int ret;
+
+- if (dsi.debug_process)
+- DSSDBGF("");
++ dsi_perf_mark_setup();
+
+- while (1) {
+- unsigned long flags;
+- unsigned avail, used;
+-
+- spin_lock_irqsave(dsi.cmd_fifo->lock, flags);
+- used = __kfifo_len(dsi.cmd_fifo) / sizeof(struct dsi_cmd_item);
+- avail = DSI_CMD_FIFO_LEN - used;
+-
+- if (dsi.debug_process)
+- DSSDBG("%u/%u items left in fifo\n", avail, used);
+-
+- if (avail == 0) {
+- if (dsi.debug_process)
+- DSSDBG("cmd fifo full, waiting...\n");
+- spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
+- atomic_inc(&dsi.cmd_fifo_full);
+- wait_for_completion(&dsi.cmd_done);
+- if (dsi.debug_process)
+- DSSDBG("cmd fifo not full, woke up\n");
+- continue;
++ if (dsi.update_region.dirty) {
++ spin_lock(&dsi.update_lock);
++ dsi.active_update_region = dsi.update_region;
++ dsi.update_region.dirty = false;
++ spin_unlock(&dsi.update_lock);
+ }
+
+- ret = __kfifo_put(dsi.cmd_fifo, (unsigned char *)p,
+- sizeof(*p));
+-
+- spin_unlock_irqrestore(dsi.cmd_fifo->lock, flags);
+-
+- BUG_ON(ret != sizeof(*p));
+-
+- break;
+- }
+-
+- queue_work(dsi.workqueue, &dsi.process_work);
+-}
+-
+-static void dsi_push_update(struct omap_dss_device *dssdev,
+- int x, int y, int w, int h)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_UPDATE;
+-
+- p.u.r.x = x;
+- p.u.r.y = y;
+- p.u.r.w = w;
+- p.u.r.h = h;
+-
+- DSSDBG("pushing UPDATE %d,%d %dx%d\n", x, y, w, h);
+-
+- dsi_push_cmd(&p);
+-}
+-
+-static void dsi_push_autoupdate(struct omap_dss_device *dssdev)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_AUTOUPDATE;
+-
+- dsi_push_cmd(&p);
+-}
+-
+-static void dsi_push_sync(struct omap_dss_device *dssdev,
+- struct completion *sync_comp)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_SYNC;
+- p.u.sync = sync_comp;
+-
+- DSSDBG("pushing SYNC\n");
+-
+- dsi_push_cmd(&p);
+-}
+-
+-static void dsi_push_mem_read(struct omap_dss_device *dssdev,
+- struct dsi_cmd_mem_read *mem_read)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_MEM_READ;
+- p.u.mem_read = *mem_read;
++ device = dsi.active_update_region.device;
++ x = dsi.active_update_region.x;
++ y = dsi.active_update_region.y;
++ w = dsi.active_update_region.w;
++ h = dsi.active_update_region.h;
+
+- DSSDBG("pushing MEM_READ\n");
+-
+- dsi_push_cmd(&p);
+-}
+-
+-static void dsi_push_test(struct omap_dss_device *dssdev, int test_num,
+- int *result, struct completion *completion)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_TEST;
+- p.u.test.test_num = test_num;
+- p.u.test.result = result;
+- p.u.test.completion = completion;
+-
+- DSSDBG("pushing TEST\n");
+-
+- dsi_push_cmd(&p);
+-}
++ if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+
+-static void dsi_push_set_te(struct omap_dss_device *dssdev, bool enable)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_SET_TE;
+- p.u.te = enable;
+-
+- DSSDBG("pushing SET_TE\n");
+-
+- dsi_push_cmd(&p);
+-}
+-
+-static void dsi_push_set_update_mode(struct omap_dss_device *dssdev,
+- enum omap_dss_update_mode mode)
+-{
+- struct dsi_cmd_item p;
+-
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_SET_UPDATE_MODE;
+- p.u.update_mode = mode;
+-
+- DSSDBG("pushing SET_UPDATE_MODE\n");
+-
+- dsi_push_cmd(&p);
+-}
++ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL) {
++ dispc_setup_partial_planes(device,
++ &x, &y, &w, &h);
++#if 1
++ /* XXX there seems to be a bug in this driver
++ * or OMAP hardware. Some updates with certain
++ * widths and x coordinates fail. These widths
++ * are always odd, so "fix" it here for now */
++ if (w & 1) {
++ u16 dw, dh;
++ device->get_resolution(device, &dw, &dh);
++ if (x + w == dw)
++ x &= ~1;
++ ++w;
++
++ dispc_setup_partial_planes(device,
++ &x, &y, &w, &h);
++ }
++#endif
++ }
+
+-static void dsi_push_set_rotate(struct omap_dss_device *dssdev, int rotate)
+-{
+- struct dsi_cmd_item p;
++ dispc_set_lcd_size(w, h);
++ }
+
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_SET_ROTATE;
+- p.u.rotate = rotate;
++ /* XXX We don't need to send the update area coords to the
++ * panel every time. But for some reason TE doesn't work if we
++ * don't send at least a BTA here... */
++#if 0
++ if (dsi.active_update_region.dirty) {
++ dsi.active_update_region.dirty = false;
++ device->driver->setup_update(device, x, y, w, h);
++ }
++#else
++ device->driver->setup_update(device, x, y, w, h);
++#endif
+
+- DSSDBG("pushing SET_ROTATE\n");
++ if (dsi.te_enabled && dsi.use_ext_te && device->wait_for_te)
++ device->wait_for_te(device);
+
+- dsi_push_cmd(&p);
+-}
++ dsi_perf_mark_start();
+
+-static void dsi_push_set_mirror(struct omap_dss_device *dssdev, int mirror)
+-{
+- struct dsi_cmd_item p;
++ if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ dsi_update_screen_dispc(device, x, y, w, h);
+
+- p.dssdev = dssdev;
+- p.cmd = DSI_CMD_SET_MIRROR;
+- p.u.mirror = mirror;
++ /* wait for framedone */
++ timeout = msecs_to_jiffies(500);
++ timeout = wait_event_timeout(dsi.waitqueue,
++ dsi.framedone_received == true,
++ timeout);
+
+- DSSDBG("pushing SET_MIRROR\n");
++ dsi.framedone_received = false;
+
+- dsi_push_cmd(&p);
+-}
++ if (timeout == 0) {
++ DSSERR("framedone timeout\n");
++ DSSERR("failed update %d,%d %dx%d\n",
++ x, y, w, h);
+
+-static int dsi_wait_sync(struct omap_dss_device *dssdev)
+-{
+- long wait = msecs_to_jiffies(2000);
+- struct completion compl;
++ dispc_enable_sidle();
++ dispc_enable_lcd_out(0);
++ } else {
++ dsi_handle_framedone();
++ dsi_perf_show("DISPC");
++ }
++ } else {
++ dsi_update_screen_l4(device, x, y, w, h);
++ dsi_perf_show("L4");
++ }
+
+- DSSDBGF("");
++ sched = atomic_read(&dsi.bus_lock.count) < 0;
+
+- init_completion(&compl);
+- dsi_push_sync(dssdev, &compl);
++ complete_all(&dsi.update_completion);
+
+- DSSDBG("Waiting for SYNC to happen...\n");
+- wait = wait_for_completion_timeout(&compl, wait);
+- DSSDBG("Released from SYNC\n");
++ dsi_bus_unlock();
+
+- if (wait == 0) {
+- DSSERR("timeout waiting sync\n");
+- return -ETIME;
++ /* XXX We need to give others chance to get the bus lock. Is
++ * there a better way for this? */
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO && sched)
++ schedule_timeout_interruptible(1);
+ }
+
++ DSSDBG("update thread exiting\n");
++
+ return 0;
+ }
+
+
+
+-
+-
+-
+-
+-
+-
+-
+-
+-
+ /* Display funcs */
+
+ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
+ {
+ int r;
+
+- r = omap_dispc_register_isr(framedone_callback, NULL,
++ r = omap_dispc_register_isr(dsi_framedone_irq_callback, NULL,
+ DISPC_IRQ_FRAMEDONE);
+ if (r) {
+ DSSERR("can't get FRAMEDONE irq\n");
+@@ -3369,7 +2856,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
+
+ static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev)
+ {
+- omap_dispc_unregister_isr(framedone_callback, NULL,
++ omap_dispc_unregister_isr(dsi_framedone_irq_callback, NULL,
+ DISPC_IRQ_FRAMEDONE);
+ }
+
+@@ -3380,8 +2867,6 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev)
+
+ _dsi_print_reset_status();
+
+- dsi_bus_lock();
+-
+ r = dsi_pll_init(1, 0);
+ if (r)
+ goto err0;
+@@ -3427,8 +2912,6 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev)
+ /* enable high-speed after initial config */
+ dsi_vc_enable_hs(0, 1);
+
+- dsi_bus_unlock();
+-
+ return 0;
+ err3:
+ dsi_if_enable(0);
+@@ -3437,16 +2920,13 @@ err2:
+ err1:
+ dsi_pll_uninit();
+ err0:
+- dsi_bus_unlock();
+ return r;
+ }
+
+ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev)
+ {
+- dsi_bus_lock();
+ if (dssdev->driver->disable)
+ dssdev->driver->disable(dssdev);
+- dsi_bus_unlock();
+
+ dsi_complexio_uninit();
+ dsi_pll_uninit();
+@@ -3475,6 +2955,7 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
+ DSSDBG("dsi_display_enable\n");
+
+ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
+
+ r = omap_dss_start_device(dssdev);
+ if (r) {
+@@ -3507,15 +2988,17 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+- if (dsi.use_te || dsi.use_ext_te)
+- dsi_push_set_te(dssdev, 1);
++ dsi.use_ext_te = dssdev->phy.dsi.ext_te;
++ dsi_set_te(dssdev, dsi.te_enabled);
+
+- dsi_push_set_update_mode(dssdev, dsi.user_update_mode);
+- dsi.target_update_mode = dsi.user_update_mode;
++ dsi.update_mode = dsi.user_update_mode;
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_start_auto_update(dssdev);
+
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+
+- return dsi_wait_sync(dssdev);
++ return 0;
+
+ err3:
+ dsi_display_uninit_dispc(dssdev);
+@@ -3525,6 +3008,7 @@ err2:
+ err1:
+ omap_dss_stop_device(dssdev);
+ err0:
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+ DSSDBG("dsi_display_enable FAILED\n");
+ return r;
+@@ -3535,18 +3019,13 @@ static void dsi_display_disable(struct omap_dss_device *dssdev)
+ DSSDBG("dsi_display_disable\n");
+
+ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
+
+ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
+ dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
+ goto end;
+
+- if (dsi.target_update_mode != OMAP_DSS_UPDATE_DISABLED) {
+- dsi_push_set_update_mode(dssdev, OMAP_DSS_UPDATE_DISABLED);
+- dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
+- }
+-
+- dsi_wait_sync(dssdev);
+-
++ dsi.update_mode = OMAP_DSS_UPDATE_DISABLED;
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+
+ dsi_display_uninit_dispc(dssdev);
+@@ -3558,6 +3037,7 @@ static void dsi_display_disable(struct omap_dss_device *dssdev)
+
+ omap_dss_stop_device(dssdev);
+ end:
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+ }
+
+@@ -3566,18 +3046,13 @@ static int dsi_display_suspend(struct omap_dss_device *dssdev)
+ DSSDBG("dsi_display_suspend\n");
+
+ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
+
+ if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
+ dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
+ goto end;
+
+- if (dsi.target_update_mode != OMAP_DSS_UPDATE_DISABLED) {
+- dsi_push_set_update_mode(dssdev, OMAP_DSS_UPDATE_DISABLED);
+- dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
+- }
+-
+- dsi_wait_sync(dssdev);
+-
++ dsi.update_mode = OMAP_DSS_UPDATE_DISABLED;
+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+ dsi_display_uninit_dispc(dssdev);
+@@ -3587,6 +3062,7 @@ static int dsi_display_suspend(struct omap_dss_device *dssdev)
+ enable_clocks(0);
+ dsi_enable_pll_clock(0);
+ end:
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+
+ return 0;
+@@ -3599,6 +3075,7 @@ static int dsi_display_resume(struct omap_dss_device *dssdev)
+ DSSDBG("dsi_display_resume\n");
+
+ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
+
+ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
+ DSSERR("dssdev not suspended\n");
+@@ -3625,15 +3102,16 @@ static int dsi_display_resume(struct omap_dss_device *dssdev)
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+- if (dsi.use_te || dsi.use_ext_te)
+- dsi_push_set_te(dssdev, 1);
++ dsi_set_te(dssdev, dsi.te_enabled);
+
+- dsi_push_set_update_mode(dssdev, dsi.user_update_mode);
+- dsi.target_update_mode = dsi.user_update_mode;
++ dsi.update_mode = dsi.user_update_mode;
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_start_auto_update(dssdev);
+
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+
+- return dsi_wait_sync(dssdev);
++ return 0;
+
+ err2:
+ dsi_display_uninit_dispc(dssdev);
+@@ -3641,6 +3119,7 @@ err1:
+ enable_clocks(0);
+ dsi_enable_pll_clock(0);
+ err0:
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+ DSSDBG("dsi_display_resume FAILED\n");
+ return r;
+@@ -3649,26 +3128,68 @@ err0:
+ static int dsi_display_update(struct omap_dss_device *dssdev,
+ u16 x, u16 y, u16 w, u16 h)
+ {
++ int r = 0;
++ u16 dw, dh;
++
+ DSSDBG("dsi_display_update(%d,%d %dx%d)\n", x, y, w, h);
+
++ mutex_lock(&dsi.lock);
++
++ if (dsi.update_mode != OMAP_DSS_UPDATE_MANUAL)
++ goto end;
++
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
++ goto end;
++
++ dssdev->get_resolution(dssdev, &dw, &dh);
++
++ if (x > dw || y > dh)
++ goto end;
++
++ if (x + w > dw)
++ w = dw - x;
++
++ if (y + h > dh)
++ h = dh - y;
++
+ if (w == 0 || h == 0)
+- return 0;
++ goto end;
+
+- mutex_lock(&dsi.lock);
++ dsi_set_update_region(dssdev, x, y, w, h);
+
+- if (dsi.target_update_mode == OMAP_DSS_UPDATE_MANUAL)
+- dsi_push_update(dssdev, x, y, w, h);
+- /* XXX else return error? */
++ wake_up(&dsi.waitqueue);
+
++end:
+ mutex_unlock(&dsi.lock);
+
+- return 0;
++ return r;
+ }
+
+ static int dsi_display_sync(struct omap_dss_device *dssdev)
+ {
+- DSSDBGF("");
+- return dsi_wait_sync(dssdev);
++ bool wait;
++
++ DSSDBG("dsi_display_sync()\n");
++
++ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
++
++ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL &&
++ dsi.update_region.dirty) {
++ INIT_COMPLETION(dsi.update_completion);
++ wait = true;
++ } else {
++ wait = false;
++ }
++
++ dsi_bus_unlock();
++ mutex_unlock(&dsi.lock);
++
++ if (wait)
++ wait_for_completion_interruptible(&dsi.update_completion);
++
++ DSSDBG("dsi_display_sync() done\n");
++ return 0;
+ }
+
+ static int dsi_display_set_update_mode(struct omap_dss_device *dssdev,
+@@ -3677,17 +3198,21 @@ static int dsi_display_set_update_mode(struct omap_dss_device *dssdev,
+ DSSDBGF("%d", mode);
+
+ mutex_lock(&dsi.lock);
++ dsi_bus_lock();
+
+- if (dsi.target_update_mode != mode) {
+- dsi_push_set_update_mode(dssdev, mode);
+-
+- dsi.target_update_mode = mode;
++ if (dsi.update_mode != mode) {
+ dsi.user_update_mode = mode;
++ dsi.update_mode = mode;
++
++ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE &&
++ mode == OMAP_DSS_UPDATE_AUTO)
++ dsi_start_auto_update(dssdev);
+ }
+
++ dsi_bus_unlock();
+ mutex_unlock(&dsi.lock);
+
+- return dsi_wait_sync(dssdev);
++ return 0;
+ }
+
+ static enum omap_dss_update_mode dsi_display_get_update_mode(
+@@ -3696,6 +3221,7 @@ static enum omap_dss_update_mode dsi_display_get_update_mode(
+ return dsi.update_mode;
+ }
+
++
+ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ {
+ DSSDBGF("%d", enable);
+@@ -3703,28 +3229,45 @@ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ if (!dssdev->driver->enable_te)
+ return -ENOENT;
+
+- dsi_push_set_te(dssdev, enable);
++ dsi_bus_lock();
++
++ dsi.te_enabled = enable;
++
++ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
++ goto end;
+
+- return dsi_wait_sync(dssdev);
++ dsi_set_te(dssdev, enable);
++end:
++ dsi_bus_unlock();
++
++ return 0;
+ }
+
+ static int dsi_display_get_te(struct omap_dss_device *dssdev)
+ {
+- return dsi.use_te | dsi.use_ext_te;
++ return dsi.te_enabled;
+ }
+
+-
+-
+ static int dsi_display_set_rotate(struct omap_dss_device *dssdev, u8 rotate)
+ {
++
+ DSSDBGF("%d", rotate);
+
+ if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
+ return -EINVAL;
+
+- dsi_push_set_rotate(dssdev, rotate);
++ dsi_bus_lock();
++ dssdev->driver->set_rotate(dssdev, rotate);
++ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) {
++ u16 w, h;
++ /* the display dimensions may have changed, so set a new
++ * update region */
++ dssdev->get_resolution(dssdev, &w, &h);
++ dsi_set_update_region(dssdev, 0, 0, w, h);
++ }
++ dsi_bus_unlock();
+
+- return dsi_wait_sync(dssdev);
++ return 0;
+ }
+
+ static u8 dsi_display_get_rotate(struct omap_dss_device *dssdev)
+@@ -3742,9 +3285,11 @@ static int dsi_display_set_mirror(struct omap_dss_device *dssdev, bool mirror)
+ if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
+ return -EINVAL;
+
+- dsi_push_set_mirror(dssdev, mirror);
++ dsi_bus_lock();
++ dssdev->driver->set_mirror(dssdev, mirror);
++ dsi_bus_unlock();
+
+- return dsi_wait_sync(dssdev);
++ return 0;
+ }
+
+ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
+@@ -3757,39 +3302,46 @@ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
+
+ static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num)
+ {
+- long wait = msecs_to_jiffies(60000);
+- struct completion compl;
+- int result;
++ int r;
+
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EIO;
+
+ DSSDBGF("%d", test_num);
+
+- init_completion(&compl);
++ dsi_bus_lock();
+
+- dsi_push_test(dssdev, test_num, &result, &compl);
++ /* run test first in low speed mode */
++ dsi_vc_enable_hs(0, 0);
+
+- DSSDBG("Waiting for SYNC to happen...\n");
+- wait = wait_for_completion_timeout(&compl, wait);
+- DSSDBG("Released from SYNC\n");
++ if (dssdev->driver->run_test) {
++ r = dssdev->driver->run_test(dssdev, test_num);
++ if (r)
++ goto end;
++ }
+
+- if (wait == 0) {
+- DSSERR("timeout waiting test sync\n");
+- return -ETIME;
++ /* then in high speed */
++ dsi_vc_enable_hs(0, 1);
++
++ if (dssdev->driver->run_test) {
++ r = dssdev->driver->run_test(dssdev, test_num);
++ if (r)
++ goto end;
+ }
+
+- return result;
++end:
++ dsi_vc_enable_hs(0, 1);
++
++ dsi_bus_unlock();
++
++ return r;
+ }
+
+ static int dsi_display_memory_read(struct omap_dss_device *dssdev,
+ void *buf, size_t size,
+ u16 x, u16 y, u16 w, u16 h)
+ {
+- long wait = msecs_to_jiffies(60000);
+- struct completion compl;
+- struct dsi_cmd_mem_read mem_read;
+- size_t ret_size;
++ int r;
+
+ DSSDBGF("");
+
+@@ -3799,29 +3351,14 @@ static int dsi_display_memory_read(struct omap_dss_device *dssdev,
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return -EIO;
+
+- init_completion(&compl);
+-
+- mem_read.x = x;
+- mem_read.y = y;
+- mem_read.w = w;
+- mem_read.h = h;
+- mem_read.buf = buf;
+- mem_read.size = size;
+- mem_read.ret_size = &ret_size;
+- mem_read.completion = &compl;
+-
+- dsi_push_mem_read(dssdev, &mem_read);
++ dsi_bus_lock();
+
+- DSSDBG("Waiting for SYNC to happen...\n");
+- wait = wait_for_completion_timeout(&compl, wait);
+- DSSDBG("Released from SYNC\n");
++ r = dssdev->driver->memory_read(dssdev, buf, size,
++ x, y, w, h);
+
+- if (wait == 0) {
+- DSSERR("timeout waiting mem read sync\n");
+- return -ETIME;
+- }
++ dsi_bus_unlock();
+
+- return ret_size;
++ return r;
+ }
+
+ static void dsi_configure_overlay(struct omap_overlay *ovl)
+@@ -3879,28 +3416,23 @@ int dsi_init(struct platform_device *pdev)
+ spin_lock_init(&dsi.errors_lock);
+ dsi.errors = 0;
+
+- spin_lock_init(&dsi.cmd_lock);
+- dsi.cmd_fifo = kfifo_alloc(
+- DSI_CMD_FIFO_LEN * sizeof(struct dsi_cmd_item),
+- GFP_KERNEL,
+- &dsi.cmd_lock);
+-
+- init_completion(&dsi.cmd_done);
+- atomic_set(&dsi.cmd_fifo_full, 0);
+- atomic_set(&dsi.cmd_pending, 0);
++ /* XXX fail properly */
+
+ init_completion(&dsi.bta_completion);
++ init_completion(&dsi.update_completion);
+
+- dsi.workqueue = create_singlethread_workqueue("dsi");
+- INIT_WORK(&dsi.framedone_work, framedone_worker);
+- INIT_WORK(&dsi.process_work, dsi_process_cmd_fifo);
+- INIT_DELAYED_WORK(&dsi.framedone_timeout_work,
+- framedone_timeout_callback);
++ dsi.thread = kthread_create(dsi_update_thread, NULL, "dsi");
++ if (IS_ERR(dsi.thread)) {
++ DSSERR("cannot create kthread\n");
++ return PTR_ERR(dsi.thread);
++ }
++ init_waitqueue_head(&dsi.waitqueue);
++ spin_lock_init(&dsi.update_lock);
+
+ mutex_init(&dsi.lock);
+ mutex_init(&dsi.bus_lock);
+
+- dsi.target_update_mode = OMAP_DSS_UPDATE_DISABLED;
++ dsi.update_mode = OMAP_DSS_UPDATE_DISABLED;
+ dsi.user_update_mode = OMAP_DSS_UPDATE_DISABLED;
+
+ dsi.base = ioremap(DSI_BASE, DSI_SZ_REGS);
+@@ -3924,20 +3456,19 @@ int dsi_init(struct platform_device *pdev)
+
+ enable_clocks(0);
+
++ wake_up_process(dsi.thread);
++
+ return 0;
+ }
+
+ void dsi_exit(void)
+ {
+- flush_workqueue(dsi.workqueue);
+- destroy_workqueue(dsi.workqueue);
++ kthread_stop(dsi.thread);
+
+ regulator_put(dsi.vdds_dsi_reg);
+
+ iounmap(dsi.base);
+
+- kfifo_free(dsi.cmd_fifo);
+-
+ DSSDBG("omap_dsi_exit\n");
+ }
+
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 1e40830..36f401b 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -185,6 +185,9 @@ void dss_init_overlays(struct platform_device *pdev);
+ void dss_uninit_overlays(struct platform_device *pdev);
+ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev);
+ void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
++#ifdef L4_EXAMPLE
++void dss_overlay_setup_l4_manager(struct omap_overlay_manager *mgr);
++#endif
+ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
+
+ /* DSS */
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 798867c..eeca3f9 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -635,6 +635,42 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ }
+ }
+
++#ifdef L4_EXAMPLE
++ {
++ int omap_dss_mgr_apply_l4(struct omap_overlay_manager *mgr)
++ {
++ DSSDBG("omap_dss_mgr_apply_l4(%s)\n", mgr->name);
++
++ return 0;
++ }
++
++ struct omap_overlay_manager *mgr;
++ mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
++
++ BUG_ON(mgr == NULL);
++
++ mgr->name = "l4";
++ mgr->supported_displays =
++ OMAP_DISPLAY_TYPE_DBI | OMAP_DISPLAY_TYPE_DSI;
++
++ mgr->set_device = &omap_dss_set_device;
++ mgr->unset_device = &omap_dss_unset_device;
++ mgr->apply = &omap_dss_mgr_apply_l4;
++ mgr->set_manager_info = &omap_dss_mgr_set_info;
++ mgr->get_manager_info = &omap_dss_mgr_get_info;
++
++ dss_overlay_setup_l4_manager(mgr);
++
++ omap_dss_add_overlay_manager(mgr);
++
++ r = kobject_init_and_add(&mgr->kobj, &manager_ktype,
++ &pdev->dev.kobj, "managerl4");
++
++ if (r)
++ DSSERR("failed to create sysfs file\n");
++ }
++#endif
++
+ return 0;
+ }
+
+@@ -674,12 +710,3 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num)
+ }
+ EXPORT_SYMBOL(omap_dss_get_overlay_manager);
+
+-#ifdef L4_EXAMPLE
+-static int ovl_mgr_apply_l4(struct omap_overlay_manager *mgr)
+-{
+- DSSDBG("omap_dss_mgr_apply_l4(%s)\n", mgr->name);
+-
+- return 0;
+-}
+-#endif
+-
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 31385f3..9f883aa 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -477,6 +477,15 @@ void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr)
+ mgr->overlays = dispc_overlays;
+ }
+
++#ifdef L4_EXAMPLE
++static struct omap_overlay *l4_overlays[1];
++void dss_overlay_setup_l4_manager(struct omap_overlay_manager *mgr)
++{
++ mgr->num_overlays = 1;
++ mgr->overlays = l4_overlays;
++}
++#endif
++
+ void dss_init_overlays(struct platform_device *pdev)
+ {
+ int i, r;
+@@ -534,6 +543,33 @@ void dss_init_overlays(struct platform_device *pdev)
+
+ dispc_overlays[i] = ovl;
+ }
++
++#ifdef L4_EXAMPLE
++ {
++ struct omap_overlay *ovl;
++ ovl = kzalloc(sizeof(*ovl), GFP_KERNEL);
++
++ BUG_ON(ovl == NULL);
++
++ ovl->name = "l4";
++ ovl->supported_modes = OMAP_DSS_COLOR_RGB24U;
++
++ ovl->set_manager = &omap_dss_set_manager;
++ ovl->unset_manager = &omap_dss_unset_manager;
++ ovl->set_overlay_info = &dss_ovl_set_overlay_info;
++ ovl->get_overlay_info = &dss_ovl_get_overlay_info;
++
++ omap_dss_add_overlay(ovl);
++
++ r = kobject_init_and_add(&ovl->kobj, &overlay_ktype,
++ &pdev->dev.kobj, "overlayl4");
++
++ if (r)
++ DSSERR("failed to create sysfs file\n");
++
++ l4_overlays[0] = ovl;
++ }
++#endif
+ }
+
+ /* connect overlays to the new device, if not already connected. if force
+@@ -577,35 +613,6 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
+ }
+ }
+ }
+-#ifdef L4_EXAMPLE
+- /* setup L4 overlay as an example */
+- {
+- static struct omap_overlay ovl = {
+- .name = "l4-ovl",
+- .supported_modes = OMAP_DSS_COLOR_RGB24U,
+- .set_manager = &omap_dss_set_manager,
+- .unset_manager = &omap_dss_unset_manager,
+- .setup_input = &omap_dss_setup_overlay_input,
+- .setup_output = &omap_dss_setup_overlay_output,
+- .enable = &omap_dss_enable_overlay,
+- };
+-
+- static struct omap_overlay_manager mgr = {
+- .name = "l4",
+- .num_overlays = 1,
+- .overlays = &ovl,
+- .set_display = &omap_dss_set_display,
+- .unset_display = &omap_dss_unset_display,
+- .apply = &ovl_mgr_apply_l4,
+- .supported_displays =
+- OMAP_DISPLAY_TYPE_DBI | OMAP_DISPLAY_TYPE_DSI,
+- };
+-
+- omap_dss_add_overlay(&ovl);
+- omap_dss_add_overlay_manager(&mgr);
+- omap_dss_set_manager(&ovl, &mgr);
+- }
+-#endif
+ }
+
+ void dss_uninit_overlays(struct platform_device *pdev)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0109-DSS2-let-init_display-return-an-error-code.patch b/recipes/linux/linux-omap-pm/dss2/0109-DSS2-let-init_display-return-an-error-code.patch
new file mode 100644
index 0000000000..5c24815c3f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0109-DSS2-let-init_display-return-an-error-code.patch
@@ -0,0 +1,235 @@
+From 858535f0afbc6d9fa345480408644d4a00584909 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 11:10:14 +0300
+Subject: [PATCH 109/146] DSS2: let init_display return an error code
+
+This is needed by an upcoming patch, in which sdi->init_display can
+fail.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+
+Conflicts:
+
+ drivers/video/omap2/dss/display.c
+ drivers/video/omap2/dss/dpi.c
+ drivers/video/omap2/dss/dsi.c
+ drivers/video/omap2/dss/dss.h
+ drivers/video/omap2/dss/rfbi.c
+ drivers/video/omap2/dss/sdi.c
+ drivers/video/omap2/dss/venc.c
+---
+ drivers/video/omap2/dss/display.c | 15 ++++++++++-----
+ drivers/video/omap2/dss/dpi.c | 4 +++-
+ drivers/video/omap2/dss/dsi.c | 4 +++-
+ drivers/video/omap2/dss/dss.h | 10 +++++-----
+ drivers/video/omap2/dss/rfbi.c | 4 +++-
+ drivers/video/omap2/dss/sdi.c | 4 +++-
+ drivers/video/omap2/dss/venc.c | 4 +++-
+ 7 files changed, 30 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 20fb1ca..1242c39 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -436,32 +436,37 @@ void dss_init_device(struct platform_device *pdev,
+
+ switch (dssdev->type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+- dpi_init_display(dssdev);
++ r = dpi_init_display(dssdev);
+ break;
+ #ifdef CONFIG_OMAP2_DSS_RFBI
+ case OMAP_DISPLAY_TYPE_DBI:
+- rfbi_init_display(dssdev);
++ r = rfbi_init_display(dssdev);
+ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_VENC
+ case OMAP_DISPLAY_TYPE_VENC:
+- venc_init_display(dssdev);
++ r = venc_init_display(dssdev);
+ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_SDI
+ case OMAP_DISPLAY_TYPE_SDI:
+- sdi_init_display(dssdev);
++ r = sdi_init_display(dssdev);
+ break;
+ #endif
+ #ifdef CONFIG_OMAP2_DSS_DSI
+ case OMAP_DISPLAY_TYPE_DSI:
+- dsi_init_display(dssdev);
++ r = dsi_init_display(dssdev);
+ break;
+ #endif
+ default:
+ BUG();
+ }
+
++ if (r) {
++ DSSERR("failed to init display %s\n", dssdev->name);
++ return;
++ }
++
+ /* create device sysfs files */
+ i = 0;
+ while ((attr = display_sysfs_attrs[i++]) != NULL) {
+diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
+index d244e54..b6543c8 100644
+--- a/drivers/video/omap2/dss/dpi.c
++++ b/drivers/video/omap2/dss/dpi.c
+@@ -360,7 +360,7 @@ static enum omap_dss_update_mode dpi_display_get_update_mode(
+ OMAP_DSS_UPDATE_DISABLED;
+ }
+
+-void dpi_init_display(struct omap_dss_device *dssdev)
++int dpi_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("init_display\n");
+
+@@ -373,6 +373,8 @@ void dpi_init_display(struct omap_dss_device *dssdev)
+ dssdev->get_timings = dpi_get_timings;
+ dssdev->set_update_mode = dpi_display_set_update_mode;
+ dssdev->get_update_mode = dpi_display_get_update_mode;
++
++ return 0;
+ }
+
+ int dpi_init(void)
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index f98da6f..ffac77b 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -3377,7 +3377,7 @@ static void dsi_configure_overlay(struct omap_overlay *ovl)
+ dispc_setup_plane_fifo(plane, low, high);
+ }
+
+-void dsi_init_display(struct omap_dss_device *dssdev)
++int dsi_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("DSI init\n");
+
+@@ -3407,6 +3407,8 @@ void dsi_init_display(struct omap_dss_device *dssdev)
+
+ dsi.vc[0].dssdev = dssdev;
+ dsi.vc[1].dssdev = dssdev;
++
++ return 0;
+ }
+
+ int dsi_init(struct platform_device *pdev)
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 36f401b..53f0f3d 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -212,7 +212,7 @@ void dss_set_dac_pwrdn_bgz(bool enable);
+ /* SDI */
+ int sdi_init(bool skip_init);
+ void sdi_exit(void);
+-void sdi_init_display(struct omap_dss_device *display);
++int sdi_init_display(struct omap_dss_device *display);
+
+ /* DSI */
+ int dsi_init(struct platform_device *pdev);
+@@ -224,7 +224,7 @@ void dsi_dump_regs(struct seq_file *s);
+ void dsi_save_context(void);
+ void dsi_restore_context(void);
+
+-void dsi_init_display(struct omap_dss_device *display);
++int dsi_init_display(struct omap_dss_device *display);
+ void dsi_irq_handler(void);
+ unsigned long dsi_get_dsi1_pll_rate(void);
+ unsigned long dsi_get_dsi2_pll_rate(void);
+@@ -237,7 +237,7 @@ void dsi_pll_uninit(void);
+ /* DPI */
+ int dpi_init(void);
+ void dpi_exit(void);
+-void dpi_init_display(struct omap_dss_device *dssdev);
++int dpi_init_display(struct omap_dss_device *dssdev);
+
+ /* DISPC */
+ int dispc_init(void);
+@@ -329,7 +329,7 @@ void dispc_draw_partial_planes(struct omap_dss_device *dssdev);
+ int venc_init(struct platform_device *pdev);
+ void venc_exit(void);
+ void venc_dump_regs(struct seq_file *s);
+-void venc_init_display(struct omap_dss_device *display);
++int venc_init_display(struct omap_dss_device *display);
+
+ /* RFBI */
+ int rfbi_init(void);
+@@ -342,6 +342,6 @@ void rfbi_transfer_area(u16 width, u16 height,
+ void (callback)(void *data), void *data);
+ void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t);
+ unsigned long rfbi_get_max_tx_rate(void);
+-void rfbi_init_display(struct omap_dss_device *display);
++int rfbi_init_display(struct omap_dss_device *display);
+
+ #endif
+diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
+index e3cf799..96602ae 100644
+--- a/drivers/video/omap2/dss/rfbi.c
++++ b/drivers/video/omap2/dss/rfbi.c
+@@ -1294,7 +1294,7 @@ static void rfbi_display_disable(struct omap_dss_device *dssdev)
+ omap_dss_stop_device(dssdev);
+ }
+
+-void rfbi_init_display(struct omap_dss_device *dssdev)
++int rfbi_init_display(struct omap_dss_device *dssdev)
+ {
+ dssdev->enable = rfbi_display_enable;
+ dssdev->disable = rfbi_display_disable;
+@@ -1305,4 +1305,6 @@ void rfbi_init_display(struct omap_dss_device *dssdev)
+ rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev;
+
+ dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++
++ return 0;
+ }
+diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
+index 393fcd5..86b9a56 100644
+--- a/drivers/video/omap2/dss/sdi.c
++++ b/drivers/video/omap2/dss/sdi.c
+@@ -228,7 +228,7 @@ static void sdi_get_timings(struct omap_dss_device *dssdev,
+ *timings = dssdev->panel.timings;
+ }
+
+-void sdi_init_display(struct omap_dss_device *dssdev)
++int sdi_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("SDI init\n");
+
+@@ -239,6 +239,8 @@ void sdi_init_display(struct omap_dss_device *dssdev)
+ dssdev->set_update_mode = sdi_display_set_update_mode;
+ dssdev->get_update_mode = sdi_display_get_update_mode;
+ dssdev->get_timings = sdi_get_timings;
++
++ return 0;
+ }
+
+ int sdi_init(bool skip_init)
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index 740c8c0..d8a83b2 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -711,7 +711,7 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
+ return 0;
+ }
+
+-void venc_init_display(struct omap_dss_device *dssdev)
++int venc_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("init_display\n");
+
+@@ -724,6 +724,8 @@ void venc_init_display(struct omap_dss_device *dssdev)
+ dssdev->check_timings = venc_check_timings;
+ dssdev->get_wss = venc_get_wss;
+ dssdev->set_wss = venc_set_wss;
++
++ return 0;
+ }
+
+ void venc_dump_regs(struct seq_file *s)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0110-DSS2-isolate-the-SDI-pads-when-SDI-is-disabled.patch b/recipes/linux/linux-omap-pm/dss2/0110-DSS2-isolate-the-SDI-pads-when-SDI-is-disabled.patch
new file mode 100644
index 0000000000..5a45e433a0
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0110-DSS2-isolate-the-SDI-pads-when-SDI-is-disabled.patch
@@ -0,0 +1,209 @@
+From 964c2a99d0b9db59bc716022c7f9f6da580f44d6 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 11:17:15 +0300
+Subject: [PATCH 110/146] DSS2: isolate the SDI pads when SDI is disabled
+
+When SDI is disabled there is still ~1.6mA drain through the VSDI_CSI
+regulator. This seems to be internal to the SDI module, since even
+disconnecting the LCD panel doesn't get rid of the drain. Also
+disabling/resetting the SDI or the DSS module doesn't help. The only
+solution is to configure the SDI pads to safe mode with pull up
+resistors enabled on them when SDI gets disabled.
+
+Bootloader / platform code is still responsible for setting up the
+muxing, so in the driver check if all required pads are in SDI mode
+or all of them are in non-configured state.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+
+Conflicts:
+
+ arch/arm/plat-omap/include/mach/display.h
+---
+ arch/arm/plat-omap/include/mach/display.h | 2 +
+ drivers/video/omap2/dss/sdi.c | 110 ++++++++++++++++++++++++++++-
+ 2 files changed, 111 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 3d8ed69..0695497 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -344,6 +344,8 @@ struct omap_dss_device {
+
+ struct {
+ u8 datapairs;
++ unsigned pad_off_pe : 1; /* pull pads if disabled */
++ unsigned pad_off_pu : 1; /* pull up */
+ } sdi;
+
+ struct {
+diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
+index 86b9a56..c484e0c 100644
+--- a/drivers/video/omap2/dss/sdi.c
++++ b/drivers/video/omap2/dss/sdi.c
+@@ -23,17 +23,120 @@
+ #include <linux/clk.h>
+ #include <linux/delay.h>
+ #include <linux/err.h>
++#include <linux/io.h>
+
+ #include <mach/board.h>
+ #include <mach/display.h>
+ #include "dss.h"
+
++#define CONTROL_PADCONF_BASE 0x48002000
++
++#define OMAP_SDI_PAD_DIS(pe,pu) ((7 << 0) | /* MODE 7 = safe */ \
++ (((pe) ? 1 : 0) << 3) | /* PULL_ENA */ \
++ (((pu) ? 1 : 0) << 4) | /* PULL_UP */ \
++ (1 << 8)) /* INPUT_EN */
++
++#define OMAP_SDI_PAD_EN (1 << 0) /* MODE 1 = SDI_xx */
++
++#define OMAP_SDI_PAD_MASK OMAP_SDI_PAD_DIS(1, 1)
+
+ static struct {
+ bool skip_init;
+ bool update_enabled;
+ } sdi;
+
++/* CONTROL_PADCONF_DSS_DATAXX */
++const u16 sdi_pads[] =
++{
++ 0x0f0, /* 10[ 7..0]:SDI_DAT1N */
++ 0x0f2, /* 10[15..0]:SDI_DAT1P */
++ 0x0f4, /* 12[ 7..0]:SDI_DAT2N */
++ 0x0f6, /* 12[15..0]:SDI_DAT2P */
++ 0x0f8, /* 14[ 7..0]:SDI_DAT3N */
++ 0x0fa, /* 14[15..0]:SDI_DAT3P */
++ 0x108, /* 22[ 7..0]:SDI_CLKN */
++ 0x10a, /* 22[15..0]:SDI_CLKP */
++};
++
++/*
++ * Check if bootloader / platform code has configured the SDI pads properly.
++ * This means it either configured all required pads for SDI mode, or that it
++ * left all the required pads unconfigured.
++ */
++static int sdi_pad_init(struct omap_dss_device *dssdev)
++{
++ unsigned req_map;
++ bool configured = false;
++ bool unconfigured = false;
++ int data_pairs;
++ int i;
++
++ data_pairs = dssdev->phy.sdi.datapairs;
++ req_map = (1 << (data_pairs * 2)) - 1; /* data lanes */
++ req_map |= 3 << 6; /* clk lane */
++ for (i = 0; i < ARRAY_SIZE(sdi_pads); i++) {
++ u32 reg;
++ u32 val;
++
++ if (!((1 << i) & req_map))
++ /* Ignore unneded pads. */
++ continue;
++ reg = CONTROL_PADCONF_BASE + sdi_pads[i];
++ val = omap_readw(reg);
++ switch (val & 0x07) { /* pad mode */
++ case 1:
++ if (unconfigured)
++ break;
++ /* Is the pull configuration ok for SDI mode? */
++ if ((val & OMAP_SDI_PAD_MASK) != OMAP_SDI_PAD_EN)
++ break;
++ configured = true;
++ break;
++ case 0:
++ case 7:
++ if (configured)
++ break;
++ unconfigured = true;
++ break;
++ default:
++ break;
++ }
++ }
++ if (i != ARRAY_SIZE(sdi_pads)) {
++ DSSERR("SDI: invalid pad configuration\n");
++ return -1;
++ }
++
++ return 0;
++}
++
++static void sdi_pad_config(struct omap_dss_device *dssdev, bool enable)
++{
++ int data_pairs;
++ bool pad_off_pe, pad_off_pu;
++ unsigned req_map;
++ int i;
++
++ data_pairs = dssdev->phy.sdi.datapairs;
++ pad_off_pe = dssdev->phy.sdi.pad_off_pe;
++ pad_off_pu = dssdev->phy.sdi.pad_off_pu;
++ req_map = (1 << (data_pairs * 2)) - 1; /* data lanes */
++ req_map |= 3 << 6; /* clk lane */
++ for (i = 0; i < ARRAY_SIZE(sdi_pads); i++) {
++ u32 reg;
++ u16 val;
++
++ if (!((1 << i) & req_map))
++ continue;
++ if (enable)
++ val = OMAP_SDI_PAD_EN;
++ else
++ val = OMAP_SDI_PAD_DIS(pad_off_pe, pad_off_pu);
++ reg = CONTROL_PADCONF_BASE + sdi_pads[i];
++ omap_writew(val, reg);
++ }
++}
++
+ static void sdi_basic_init(void)
+ {
+ dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
+@@ -64,6 +167,8 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
+ goto err1;
+ }
+
++ sdi_pad_config(dssdev, 1);
++
+ /* In case of skip_init sdi_init has already enabled the clocks */
+ if (!sdi.skip_init)
+ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+@@ -153,6 +258,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)
+ dss_sdi_disable();
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ sdi_pad_config(dssdev, 0);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+
+@@ -172,6 +278,7 @@ static int sdi_display_suspend(struct omap_dss_device *dssdev)
+ dss_sdi_disable();
+
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ sdi_pad_config(dssdev, 0);
+
+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+
+@@ -183,6 +290,7 @@ static int sdi_display_resume(struct omap_dss_device *dssdev)
+ if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
+ return -EINVAL;
+
++ sdi_pad_config(dssdev, 1);
+ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+ dss_sdi_enable();
+@@ -240,7 +348,7 @@ int sdi_init_display(struct omap_dss_device *dssdev)
+ dssdev->get_update_mode = sdi_display_get_update_mode;
+ dssdev->get_timings = sdi_get_timings;
+
+- return 0;
++ return sdi_pad_init(dssdev);
+ }
+
+ int sdi_init(bool skip_init)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0111-DSS2-Fix-bottom-field-initial-starting-line.patch b/recipes/linux/linux-omap-pm/dss2/0111-DSS2-Fix-bottom-field-initial-starting-line.patch
new file mode 100644
index 0000000000..a7970dca21
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0111-DSS2-Fix-bottom-field-initial-starting-line.patch
@@ -0,0 +1,210 @@
+From 740a3556ebdb8b046b91287a48a6c0fd84fdc1b2 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 1 Jun 2009 17:06:26 +0200
+Subject: [PATCH 111/146] DSS2: Fix bottom field initial starting line
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When downscaling the bottom field offset may be several source lines.
+Unfortunately the registers for the initial accumulator value will only
+hold the fractional part of of that offset so the integer part must be
+added to the bottom field base address. The TV-out quality is
+significantly improved as a result. Additionally this fixes the bottom
+field offset with DMA rotation and mirroring enabled as it was
+previously miscalculated.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 69 +++++++++++++++++++++++++-------------
+ 1 files changed, 45 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 762a0f1..2463bab 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1100,7 +1100,7 @@ static void _dispc_set_scaling(enum omap_plane plane,
+ */
+ if (ilace && !fieldmode) {
+ accu1 = 0;
+- accu0 = fir_vinc / 2;
++ accu0 = (fir_vinc / 2) & 0x3ff;
+ if (accu0 >= 1024/2) {
+ accu1 = 1024/2;
+ accu0 -= accu1;
+@@ -1178,6 +1178,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ u16 screen_width,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode, bool fieldmode,
++ unsigned int field_offset,
+ unsigned *offset0, unsigned *offset1,
+ s32 *row_inc, s32 *pix_inc)
+ {
+@@ -1227,8 +1228,8 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ case 1:
+ case 3:
+ *offset1 = 0;
+- if (fieldmode)
+- *offset0 = screen_width * ps;
++ if (field_offset)
++ *offset0 = field_offset * screen_width * ps;
+ else
+ *offset0 = 0;
+
+@@ -1249,8 +1250,8 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+ case 5:
+ case 7:
+ *offset1 = 0;
+- if (fieldmode)
+- *offset0 = screen_width * ps;
++ if (field_offset)
++ *offset0 = field_offset * screen_width * ps;
+ else
+ *offset0 = 0;
+ *row_inc = pixinc(1 - (screen_width + width) -
+@@ -1268,6 +1269,7 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ u16 screen_width,
+ u16 width, u16 height,
+ enum omap_color_mode color_mode, bool fieldmode,
++ unsigned int field_offset,
+ unsigned *offset0, unsigned *offset1,
+ s32 *row_inc, s32 *pix_inc)
+ {
+@@ -1320,10 +1322,10 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ switch (rotation + mirror * 4) {
+ case 0:
+ *offset1 = 0;
+- if (fieldmode)
+- *offset0 = screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 + field_offset * screen_width * ps;
+ else
+- *offset0 = 0;
++ *offset0 = *offset1;
+ *row_inc = pixinc(1 + (screen_width - fbw) +
+ (fieldmode ? screen_width : 0),
+ ps);
+@@ -1331,8 +1333,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+ case 1:
+ *offset1 = screen_width * (fbh - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 + ps;
++ if (field_offset)
++ *offset0 = *offset1 + field_offset * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * (fbh - 1) + 1 +
+@@ -1341,8 +1343,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+ case 2:
+ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 - screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 - field_offset * screen_width * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(-1 -
+@@ -1353,8 +1355,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ break;
+ case 3:
+ *offset1 = (fbw - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 - ps;
++ if (field_offset)
++ *offset0 = *offset1 - field_offset * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(-screen_width * (fbh - 1) - 1 -
+@@ -1365,8 +1367,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+ /* mirroring */
+ case 0 + 4:
+ *offset1 = (fbw - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 + screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 + field_offset * screen_width * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * 2 - 1 +
+@@ -1377,8 +1379,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+
+ case 1 + 4:
+ *offset1 = 0;
+- if (fieldmode)
+- *offset0 = *offset1 + screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 + field_offset * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(-screen_width * (fbh - 1) + 1 +
+@@ -1389,8 +1391,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+
+ case 2 + 4:
+ *offset1 = screen_width * (fbh - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 + screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 - field_offset * screen_width * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(1 - screen_width * 2 -
+@@ -1401,8 +1403,8 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
+
+ case 3 + 4:
+ *offset1 = (screen_width * (fbh - 1) + fbw - 1) * ps;
+- if (fieldmode)
+- *offset0 = *offset1 + screen_width * ps;
++ if (field_offset)
++ *offset0 = *offset1 - field_offset * ps;
+ else
+ *offset0 = *offset1;
+ *row_inc = pixinc(screen_width * (fbh - 1) - 1 -
+@@ -1498,6 +1500,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ s32 row_inc;
+ s32 pix_inc;
+ u16 frame_height = height;
++ unsigned int field_offset = 0;
+
+ if (paddr == 0)
+ return -EINVAL;
+@@ -1596,15 +1599,33 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ return -EINVAL;
+ }
+
++ if (ilace && !fieldmode) {
++ /*
++ * when downscaling the bottom field may have to start several
++ * source lines below the top field. Unfortunately ACCUI
++ * registers will only hold the fractional part of the offset
++ * so the integer part must be added to the base address of the
++ * bottom field.
++ */
++ if (!height || height == out_height)
++ field_offset = 0;
++ else
++ field_offset = height / out_height / 2;
++ }
++
++ /* Fields are independent but interleaved in memory. */
++ if (fieldmode)
++ field_offset = 1;
++
+ if (rotation_type == OMAP_DSS_ROT_DMA)
+ calc_dma_rotation_offset(rotation, mirror,
+ screen_width, width, frame_height, color_mode,
+- fieldmode,
++ fieldmode, field_offset,
+ &offset0, &offset1, &row_inc, &pix_inc);
+ else
+ calc_vrfb_rotation_offset(rotation, mirror,
+ screen_width, width, frame_height, color_mode,
+- fieldmode,
++ fieldmode, field_offset,
+ &offset0, &offset1, &row_inc, &pix_inc);
+
+ DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0112-DSS2-Correctly-determine-if-an-interlaced-display-i.patch b/recipes/linux/linux-omap-pm/dss2/0112-DSS2-Correctly-determine-if-an-interlaced-display-i.patch
new file mode 100644
index 0000000000..0a3a1be555
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0112-DSS2-Correctly-determine-if-an-interlaced-display-i.patch
@@ -0,0 +1,50 @@
+From a9a5c0bd138aaf83b4eeff0b2923abdb255be55c Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 11:22:24 +0300
+Subject: [PATCH 112/146] DSS2: Correctly determine if an interlaced display is used
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When applying the settings to all the overlays ilace is initialzed to 0
+in the beginning and then changed to 1 when the first overlay directed
+to an interlaced display is found. If there are more overlays after that
+one which are not directed to an interlaced display the code would still
+pass ilace=1 to the the dispc code which would halve the output height of
+the overlay. Fix the problem by correctly setting ilace for each overlay.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+
+Conflicts:
+
+ drivers/video/omap2/dss/manager.c
+---
+ drivers/video/omap2/dss/manager.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index eeca3f9..f6df4d6 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -412,7 +412,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ enum omap_dss_update_mode mode;
+ struct omap_dss_device *dssdev;
+ struct omap_overlay *ovl;
+- bool ilace = 0;
++ bool ilace;
+ int outw, outh;
+ int r;
+ int num_planes_enabled = 0;
+@@ -452,8 +452,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
+ mode != OMAP_DSS_UPDATE_AUTO)
+ continue;
+
+- if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
+- ilace = 1;
++ ilace = dssdev->type == OMAP_DISPLAY_TYPE_VENC;
+
+ if (ovl->info.out_width == 0)
+ outw = ovl->info.width;
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0113-DSS2-Fix-omapfb-framebuffer-name.patch b/recipes/linux/linux-omap-pm/dss2/0113-DSS2-Fix-omapfb-framebuffer-name.patch
new file mode 100644
index 0000000000..020e065a76
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0113-DSS2-Fix-omapfb-framebuffer-name.patch
@@ -0,0 +1,115 @@
+From e9115293f6b4c7f737a5eeba34c2769dfd030e5d Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 11:25:19 +0300
+Subject: [PATCH 113/146] DSS2: Fix omapfb framebuffer name
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+After clearing the fix and var screeninfos fix.id should be reset to
+the proper value. Move the relevant memset() and strncpy() calls into
+a helper function which does the right thing.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+
+Conflicts:
+
+ drivers/video/omap2/omapfb/omapfb-main.c
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 30 +++++++++++++++---------------
+ 1 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index b4ac9ec..dc9c06c 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1171,6 +1171,13 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
+ rg->size = 0;
+ }
+
++static void clear_fb_info(struct fb_info *fbi)
++{
++ memset(&fbi->var, 0, sizeof(fbi->var));
++ memset(&fbi->fix, 0, sizeof(fbi->fix));
++ strlcpy(fbi->fix.id, MODULE_NAME, sizeof(fbi->fix.id));
++}
++
+ static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev)
+ {
+ int i;
+@@ -1180,8 +1187,7 @@ static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev)
+ for (i = 0; i < fbdev->num_fbs; i++) {
+ struct fb_info *fbi = fbdev->fbs[i];
+ omapfb_free_fbmem(fbi);
+- memset(&fbi->fix, 0, sizeof(fbi->fix));
+- memset(&fbi->var, 0, sizeof(fbi->var));
++ clear_fb_info(fbi);
+ }
+
+ return 0;
+@@ -1509,8 +1515,7 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
+ omapfb_free_fbmem(fbi);
+
+ if (size == 0) {
+- memset(&fbi->fix, 0, sizeof(fbi->fix));
+- memset(&fbi->var, 0, sizeof(fbi->var));
++ clear_fb_info(fbi);
+ return 0;
+ }
+
+@@ -1520,10 +1525,8 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
+ if (old_size)
+ omapfb_alloc_fbmem(fbi, old_size, old_paddr);
+
+- if (rg->size == 0) {
+- memset(&fbi->fix, 0, sizeof(fbi->fix));
+- memset(&fbi->var, 0, sizeof(fbi->var));
+- }
++ if (rg->size == 0)
++ clear_fb_info(fbi);
+
+ return r;
+ }
+@@ -1556,8 +1559,7 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
+ return 0;
+ err:
+ omapfb_free_fbmem(fbi);
+- memset(&fbi->fix, 0, sizeof(fbi->fix));
+- memset(&fbi->var, 0, sizeof(fbi->var));
++ clear_fb_info(fbi);
+ return r;
+ }
+
+@@ -1565,7 +1567,6 @@ err:
+ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ {
+ struct fb_var_screeninfo *var = &fbi->var;
+- struct fb_fix_screeninfo *fix = &fbi->fix;
+ struct omap_dss_device *display = fb2display(fbi);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+ int r = 0;
+@@ -1574,11 +1575,8 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+ fbi->flags = FBINFO_FLAG_DEFAULT;
+ fbi->pseudo_palette = fbdev->pseudo_palette;
+
+- strncpy(fix->id, MODULE_NAME, sizeof(fix->id));
+-
+ if (ofbi->region.size == 0) {
+- memset(&fbi->fix, 0, sizeof(fbi->fix));
+- memset(&fbi->var, 0, sizeof(fbi->var));
++ clear_fb_info(fbi);
+ return 0;
+ }
+
+@@ -1728,6 +1726,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
+ return -ENOMEM;
+ }
+
++ clear_fb_info(fbi);
++
+ fbdev->fbs[i] = fbi;
+
+ ofbi = FB2OFB(fbi);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0114-DSS2-Overo-update-defconfig-to-lighter-one.patch b/recipes/linux/linux-omap-pm/dss2/0114-DSS2-Overo-update-defconfig-to-lighter-one.patch
new file mode 100644
index 0000000000..dcd293c407
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0114-DSS2-Overo-update-defconfig-to-lighter-one.patch
@@ -0,0 +1,1217 @@
+From acd5985012f2e205a2613d29487ba347a99c5393 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 21:57:15 +0300
+Subject: [PATCH 114/146] DSS2: Overo: update defconfig to lighter one
+
+---
+ arch/arm/configs/dss_overo_defconfig | 598 ++++++++++------------------------
+ 1 files changed, 174 insertions(+), 424 deletions(-)
+
+diff --git a/arch/arm/configs/dss_overo_defconfig b/arch/arm/configs/dss_overo_defconfig
+index 755a1b6..38a452c 100644
+--- a/arch/arm/configs/dss_overo_defconfig
++++ b/arch/arm/configs/dss_overo_defconfig
+@@ -1,7 +1,7 @@
+ #
+ # Automatically generated make config: don't edit
+-# Linux kernel version: 2.6.29-omap1
+-# Thu Apr 2 11:30:57 2009
++# Linux kernel version: 2.6.31-rc1-omap1
++# Thu Jul 2 17:24:24 2009
+ #
+ CONFIG_ARM=y
+ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+@@ -9,7 +9,6 @@ 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_HAVE_LATENCYTOP_SUPPORT=y
+@@ -18,23 +17,23 @@ 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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+ CONFIG_OPROFILE_ARMV7=y
+ CONFIG_VECTORS_BASE=0xffff0000
+ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++CONFIG_CONSTRUCTORS=y
+
+ #
+ # General setup
+ #
+ CONFIG_EXPERIMENTAL=y
+ CONFIG_BROKEN_ON_SMP=y
++CONFIG_LOCK_KERNEL=y
+ CONFIG_INIT_ENV_ARG_LIMIT=32
+ CONFIG_LOCALVERSION=""
+-CONFIG_LOCALVERSION_AUTO=y
++# CONFIG_LOCALVERSION_AUTO is not set
+ CONFIG_SWAP=y
+ CONFIG_SYSVIPC=y
+ CONFIG_SYSVIPC_SYSCTL=y
+@@ -67,6 +66,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
+ # CONFIG_NAMESPACES is not set
+ CONFIG_BLK_DEV_INITRD=y
+ CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++# CONFIG_RD_BZIP2 is not set
++# CONFIG_RD_LZMA is not set
+ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+ CONFIG_SYSCTL=y
+ CONFIG_ANON_INODES=y
+@@ -88,21 +90,32 @@ CONFIG_TIMERFD=y
+ CONFIG_EVENTFD=y
+ CONFIG_SHMEM=y
+ CONFIG_AIO=y
++
++#
++# Performance Counters
++#
+ CONFIG_VM_EVENT_COUNTERS=y
+ CONFIG_SLUB_DEBUG=y
++# CONFIG_STRIP_ASM_SYMS is not set
+ # CONFIG_COMPAT_BRK is not set
+ # CONFIG_SLAB is not set
+ CONFIG_SLUB=y
+ # CONFIG_SLOB is not set
+ CONFIG_PROFILING=y
+ CONFIG_TRACEPOINTS=y
+-# CONFIG_MARKERS is not set
++CONFIG_MARKERS=y
+ CONFIG_OPROFILE=y
+ CONFIG_HAVE_OPROFILE=y
+ # CONFIG_KPROBES is not set
+ CONFIG_HAVE_KPROBES=y
+ CONFIG_HAVE_KRETPROBES=y
+ CONFIG_HAVE_CLK=y
++
++#
++# GCOV-based kernel profiling
++#
++# CONFIG_GCOV_KERNEL is not set
++# CONFIG_SLOW_WORK is not set
+ CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+ CONFIG_SLABINFO=y
+ CONFIG_RT_MUTEXES=y
+@@ -114,8 +127,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
+ CONFIG_MODVERSIONS=y
+ CONFIG_MODULE_SRCVERSION_ALL=y
+ CONFIG_BLOCK=y
+-CONFIG_LBD=y
+-# CONFIG_BLK_DEV_IO_TRACE is not set
++CONFIG_LBDAF=y
+ # CONFIG_BLK_DEV_BSG is not set
+ # CONFIG_BLK_DEV_INTEGRITY is not set
+
+@@ -142,12 +154,14 @@ CONFIG_FREEZER=y
+ # CONFIG_ARCH_VERSATILE is not set
+ # CONFIG_ARCH_AT91 is not set
+ # CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_GEMINI is not set
+ # CONFIG_ARCH_EBSA110 is not set
+ # CONFIG_ARCH_EP93XX is not set
+ # CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_STMP3XXX 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
+@@ -156,24 +170,25 @@ CONFIG_FREEZER=y
+ # CONFIG_ARCH_IXP4XX is not set
+ # CONFIG_ARCH_L7200 is not set
+ # CONFIG_ARCH_KIRKWOOD is not set
+-# CONFIG_ARCH_KS8695 is not set
+-# CONFIG_ARCH_NS9XXX is not set
+ # CONFIG_ARCH_LOKI is not set
+ # CONFIG_ARCH_MV78XX0 is not set
+-# CONFIG_ARCH_MXC is not set
+ # CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_W90X900 is not set
+ # CONFIG_ARCH_PNX4008 is not set
+ # CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MSM is not set
+ # CONFIG_ARCH_RPC is not set
+ # CONFIG_ARCH_SA1100 is not set
+ # CONFIG_ARCH_S3C2410 is not set
+ # CONFIG_ARCH_S3C64XX is not set
+ # CONFIG_ARCH_SHARK is not set
+ # CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_U300 is not set
+ # CONFIG_ARCH_DAVINCI is not set
+ CONFIG_ARCH_OMAP=y
+-# CONFIG_ARCH_MSM is not set
+-# CONFIG_ARCH_W90X900 is not set
+
+ #
+ # TI OMAP Implementations
+@@ -182,26 +197,20 @@ CONFIG_ARCH_OMAP_OTG=y
+ # CONFIG_ARCH_OMAP1 is not set
+ # CONFIG_ARCH_OMAP2 is not set
+ CONFIG_ARCH_OMAP3=y
++# CONFIG_ARCH_OMAP4 is not set
+
+ #
+ # OMAP Feature Selections
+ #
+ # CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+ # CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+-CONFIG_OMAP_SMARTREFLEX=y
+-# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+ # CONFIG_OMAP_RESET_CLOCKS is not set
+-CONFIG_OMAP_BOOT_TAG=y
+-CONFIG_OMAP_BOOT_REASON=y
+-# CONFIG_OMAP_COMPONENT_VERSION is not set
+-# CONFIG_OMAP_GPIO_SWITCH is not set
+ # CONFIG_OMAP_MUX is not set
+ CONFIG_OMAP_MCBSP=y
+ # CONFIG_OMAP_MBOX_FWK is not set
+ # CONFIG_OMAP_MPU_TIMER is not set
+ CONFIG_OMAP_32K_TIMER=y
+ CONFIG_OMAP_32K_TIMER_HZ=128
+-CONFIG_OMAP_TICK_GPTIMER=1
+ CONFIG_OMAP_DM_TIMER=y
+ # CONFIG_OMAP_LL_DEBUG_UART1 is not set
+ # CONFIG_OMAP_LL_DEBUG_UART2 is not set
+@@ -219,6 +228,7 @@ CONFIG_ARCH_OMAP3430=y
+ # CONFIG_MACH_OMAP3_BEAGLE is not set
+ CONFIG_MACH_OVERO=y
+ # CONFIG_MACH_OMAP3_PANDORA is not set
++# CONFIG_MACH_OMAP_ZOOM2 is not set
+
+ #
+ # Processor Type
+@@ -246,7 +256,10 @@ CONFIG_ARM_THUMBEE=y
+ # CONFIG_CPU_DCACHE_DISABLE is not set
+ # CONFIG_CPU_BPREDICT_DISABLE is not set
+ CONFIG_HAS_TLS_REG=y
+-# CONFIG_OUTER_CACHE is not set
++# CONFIG_ARM_ERRATA_430973 is not set
++# CONFIG_ARM_ERRATA_458693 is not set
++# CONFIG_ARM_ERRATA_460075 is not set
++CONFIG_COMMON_CLKDEV=y
+
+ #
+ # Bus support
+@@ -266,13 +279,13 @@ CONFIG_VMSPLIT_3G=y
+ # CONFIG_VMSPLIT_2G is not set
+ # CONFIG_VMSPLIT_1G is not set
+ CONFIG_PAGE_OFFSET=0xC0000000
+-# CONFIG_PREEMPT is not set
++CONFIG_PREEMPT=y
+ CONFIG_HZ=128
+ CONFIG_AEABI=y
+ # CONFIG_OABI_COMPAT is not set
+-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+ # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+ # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM is not set
+ CONFIG_SELECT_MEMORY_MODEL=y
+ CONFIG_FLATMEM_MANUAL=y
+ # CONFIG_DISCONTIGMEM_MANUAL is not set
+@@ -284,9 +297,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
+ # CONFIG_PHYS_ADDR_T_64BIT is not set
+ CONFIG_ZONE_DMA_FLAG=0
+ CONFIG_VIRT_TO_BUS=y
+-CONFIG_UNEVICTABLE_LRU=y
++CONFIG_HAVE_MLOCK=y
++CONFIG_HAVE_MLOCKED_PAGE_BIT=y
++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+ CONFIG_LEDS=y
+ CONFIG_ALIGNMENT_TRAP=y
++# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+ #
+ # Boot options
+@@ -352,7 +368,6 @@ CONFIG_NET=y
+ #
+ # Networking options
+ #
+-CONFIG_COMPAT_NET_DEV_OPS=y
+ CONFIG_PACKET=y
+ CONFIG_PACKET_MMAP=y
+ CONFIG_UNIX=y
+@@ -379,10 +394,10 @@ CONFIG_IP_PNP_RARP=y
+ # CONFIG_INET_ESP is not set
+ # CONFIG_INET_IPCOMP is not set
+ # CONFIG_INET_XFRM_TUNNEL is not set
+-CONFIG_INET_TUNNEL=m
+-CONFIG_INET_XFRM_MODE_TRANSPORT=y
+-CONFIG_INET_XFRM_MODE_TUNNEL=y
+-CONFIG_INET_XFRM_MODE_BEET=y
++# CONFIG_INET_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
+ # CONFIG_INET_LRO is not set
+ CONFIG_INET_DIAG=y
+ CONFIG_INET_TCP_DIAG=y
+@@ -390,25 +405,7 @@ CONFIG_INET_TCP_DIAG=y
+ CONFIG_TCP_CONG_CUBIC=y
+ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # CONFIG_TCP_MD5SIG is not set
+-CONFIG_IPV6=m
+-# CONFIG_IPV6_PRIVACY is not set
+-# CONFIG_IPV6_ROUTER_PREF is not set
+-# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+-# CONFIG_INET6_AH is not set
+-# CONFIG_INET6_ESP is not set
+-# CONFIG_INET6_IPCOMP is not set
+-# CONFIG_IPV6_MIP6 is not set
+-# CONFIG_INET6_XFRM_TUNNEL is not set
+-# CONFIG_INET6_TUNNEL is not set
+-CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+-CONFIG_INET6_XFRM_MODE_TUNNEL=m
+-CONFIG_INET6_XFRM_MODE_BEET=m
+-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+-CONFIG_IPV6_SIT=m
+-CONFIG_IPV6_NDISC_NODETYPE=y
+-# CONFIG_IPV6_TUNNEL is not set
+-# CONFIG_IPV6_MULTIPLE_TABLES is not set
+-# CONFIG_IPV6_MROUTE is not set
++# CONFIG_IPV6 is not set
+ # CONFIG_NETWORK_SECMARK is not set
+ # CONFIG_NETFILTER is not set
+ # CONFIG_IP_DCCP is not set
+@@ -426,6 +423,8 @@ CONFIG_IPV6_NDISC_NODETYPE=y
+ # CONFIG_LAPB is not set
+ # CONFIG_ECONET is not set
+ # CONFIG_WAN_ROUTER is not set
++# CONFIG_PHONET is not set
++# CONFIG_IEEE802154 is not set
+ # CONFIG_NET_SCHED is not set
+ # CONFIG_DCB is not set
+
+@@ -433,58 +432,13 @@ CONFIG_IPV6_NDISC_NODETYPE=y
+ # Network testing
+ #
+ # CONFIG_NET_PKTGEN is not set
++# CONFIG_NET_DROP_MONITOR is not set
+ # CONFIG_HAMRADIO is not set
+ # CONFIG_CAN is not set
+ # CONFIG_IRDA is not set
+-CONFIG_BT=y
+-CONFIG_BT_L2CAP=y
+-CONFIG_BT_SCO=y
+-CONFIG_BT_RFCOMM=y
+-CONFIG_BT_RFCOMM_TTY=y
+-CONFIG_BT_BNEP=y
+-CONFIG_BT_BNEP_MC_FILTER=y
+-CONFIG_BT_BNEP_PROTO_FILTER=y
+-CONFIG_BT_HIDP=y
+-
+-#
+-# Bluetooth device drivers
+-#
+-# CONFIG_BT_HCIBTSDIO is not set
+-CONFIG_BT_HCIUART=y
+-CONFIG_BT_HCIUART_H4=y
+-CONFIG_BT_HCIUART_BCSP=y
+-# CONFIG_BT_HCIUART_LL is not set
+-# CONFIG_BT_HCIBRF6150 is not set
+-# CONFIG_BT_HCIH4P is not set
+-# CONFIG_BT_HCIVHCI is not set
++# CONFIG_BT is not set
+ # CONFIG_AF_RXRPC is not set
+-# CONFIG_PHONET is not set
+-CONFIG_WIRELESS=y
+-CONFIG_CFG80211=y
+-# CONFIG_CFG80211_REG_DEBUG is not set
+-CONFIG_NL80211=y
+-CONFIG_WIRELESS_OLD_REGULATORY=y
+-CONFIG_WIRELESS_EXT=y
+-CONFIG_WIRELESS_EXT_SYSFS=y
+-CONFIG_LIB80211=y
+-CONFIG_LIB80211_CRYPT_WEP=m
+-CONFIG_LIB80211_CRYPT_CCMP=m
+-CONFIG_LIB80211_CRYPT_TKIP=m
+-# CONFIG_LIB80211_DEBUG is not set
+-CONFIG_MAC80211=y
+-
+-#
+-# Rate control algorithm selection
+-#
+-CONFIG_MAC80211_RC_PID=y
+-CONFIG_MAC80211_RC_MINSTREL=y
+-CONFIG_MAC80211_RC_DEFAULT_PID=y
+-# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+-CONFIG_MAC80211_RC_DEFAULT="pid"
+-# CONFIG_MAC80211_MESH is not set
+-CONFIG_MAC80211_LEDS=y
+-# CONFIG_MAC80211_DEBUGFS is not set
+-# CONFIG_MAC80211_DEBUG_MENU is not set
++# CONFIG_WIRELESS is not set
+ # CONFIG_WIMAX is not set
+ # CONFIG_RFKILL is not set
+ # CONFIG_NET_9P is not set
+@@ -595,20 +549,20 @@ CONFIG_MTD_NAND_IDS=y
+ CONFIG_BLK_DEV=y
+ # CONFIG_BLK_DEV_COW_COMMON is not set
+ CONFIG_BLK_DEV_LOOP=y
+-CONFIG_BLK_DEV_CRYPTOLOOP=m
++# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+ # CONFIG_BLK_DEV_NBD is not set
+ CONFIG_BLK_DEV_RAM=y
+ CONFIG_BLK_DEV_RAM_COUNT=16
+ CONFIG_BLK_DEV_RAM_SIZE=16384
+ # CONFIG_BLK_DEV_XIP is not set
+-CONFIG_CDROM_PKTCDVD=m
+-CONFIG_CDROM_PKTCDVD_BUFFERS=8
+-# CONFIG_CDROM_PKTCDVD_WCACHE is not set
++# CONFIG_CDROM_PKTCDVD is not set
+ # CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MG_DISK is not set
+ CONFIG_MISC_DEVICES=y
+ # CONFIG_ICS932S401 is not set
+ # CONFIG_OMAP_STI is not set
+ # CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_ISL29003 is not set
+ # CONFIG_C2PORT is not set
+
+ #
+@@ -617,6 +571,7 @@ CONFIG_MISC_DEVICES=y
+ # CONFIG_EEPROM_AT24 is not set
+ # CONFIG_EEPROM_AT25 is not set
+ # CONFIG_EEPROM_LEGACY is not set
++# CONFIG_EEPROM_MAX6875 is not set
+ CONFIG_EEPROM_93CX6=m
+ CONFIG_HAVE_IDE=y
+ # CONFIG_IDE is not set
+@@ -624,7 +579,7 @@ CONFIG_HAVE_IDE=y
+ #
+ # SCSI device support
+ #
+-CONFIG_RAID_ATTRS=m
++# CONFIG_RAID_ATTRS is not set
+ CONFIG_SCSI=y
+ CONFIG_SCSI_DMA=y
+ # CONFIG_SCSI_TGT is not set
+@@ -638,12 +593,8 @@ 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=m
++# 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=y
+ # CONFIG_SCSI_CONSTANTS is not set
+ # CONFIG_SCSI_LOGGING is not set
+@@ -661,34 +612,18 @@ CONFIG_SCSI_WAIT_SCAN=m
+ CONFIG_SCSI_LOWLEVEL=y
+ # CONFIG_ISCSI_TCP is not set
+ # CONFIG_LIBFC is not set
++# CONFIG_LIBFCOE is not set
+ # CONFIG_SCSI_DEBUG is not set
+ # CONFIG_SCSI_DH is not set
++# CONFIG_SCSI_OSD_INITIATOR is not set
+ # CONFIG_ATA is not set
+-CONFIG_MD=y
+-CONFIG_BLK_DEV_MD=m
+-CONFIG_MD_LINEAR=m
+-CONFIG_MD_RAID0=m
+-CONFIG_MD_RAID1=m
+-CONFIG_MD_RAID10=m
+-CONFIG_MD_RAID456=m
+-CONFIG_MD_RAID5_RESHAPE=y
+-CONFIG_MD_MULTIPATH=m
+-CONFIG_MD_FAULTY=m
+-CONFIG_BLK_DEV_DM=m
+-# CONFIG_DM_DEBUG is not set
+-CONFIG_DM_CRYPT=m
+-CONFIG_DM_SNAPSHOT=m
+-CONFIG_DM_MIRROR=m
+-CONFIG_DM_ZERO=m
+-CONFIG_DM_MULTIPATH=m
+-CONFIG_DM_DELAY=m
+-# CONFIG_DM_UEVENT is not set
++# CONFIG_MD is not set
+ CONFIG_NETDEVICES=y
+-CONFIG_DUMMY=m
++# CONFIG_DUMMY is not set
+ # CONFIG_BONDING is not set
+ # CONFIG_MACVLAN is not set
+ # CONFIG_EQUALIZER is not set
+-CONFIG_TUN=m
++# CONFIG_TUN is not set
+ # CONFIG_VETH is not set
+ # CONFIG_NET_ETHERNET is not set
+ # CONFIG_NETDEV_1000 is not set
+@@ -698,37 +633,14 @@ CONFIG_TUN=m
+ # Wireless LAN
+ #
+ # CONFIG_WLAN_PRE80211 is not set
+-CONFIG_WLAN_80211=y
+-CONFIG_LIBERTAS=y
+-CONFIG_LIBERTAS_SDIO=y
+-CONFIG_LIBERTAS_DEBUG=y
+-# CONFIG_LIBERTAS_THINFIRM is not set
+-# CONFIG_MAC80211_HWSIM is not set
+-CONFIG_P54_COMMON=m
+-# CONFIG_IWLWIFI_LEDS is not set
+-CONFIG_HOSTAP=m
+-CONFIG_HOSTAP_FIRMWARE=y
+-CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+-# CONFIG_B43 is not set
+-# CONFIG_B43LEGACY is not set
+-# CONFIG_RT2X00 is not set
++# CONFIG_WLAN_80211 is not set
+
+ #
+ # Enable WiMAX (Networking options) to see the WiMAX drivers
+ #
+ # CONFIG_WAN is not set
+-CONFIG_PPP=m
+-# CONFIG_PPP_MULTILINK is not set
+-# CONFIG_PPP_FILTER is not set
+-CONFIG_PPP_ASYNC=m
+-CONFIG_PPP_SYNC_TTY=m
+-CONFIG_PPP_DEFLATE=m
+-CONFIG_PPP_BSDCOMP=m
+-CONFIG_PPP_MPPE=m
+-CONFIG_PPPOE=m
+-# CONFIG_PPPOL2TP is not set
++# CONFIG_PPP is not set
+ # CONFIG_SLIP is not set
+-CONFIG_SLHC=m
+ # CONFIG_NETCONSOLE is not set
+ # CONFIG_NETPOLL is not set
+ # CONFIG_NET_POLL_CONTROLLER is not set
+@@ -762,7 +674,6 @@ CONFIG_INPUT_KEYBOARD=y
+ # CONFIG_KEYBOARD_XTKBD is not set
+ # CONFIG_KEYBOARD_NEWTON is not set
+ # CONFIG_KEYBOARD_STOWAWAY is not set
+-# CONFIG_KEYBOARD_TWL4030 is not set
+ # CONFIG_KEYBOARD_LM8323 is not set
+ # CONFIG_KEYBOARD_GPIO is not set
+ CONFIG_INPUT_MOUSE=y
+@@ -778,6 +689,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y
+ # CONFIG_MOUSE_BCM5974 is not set
+ # CONFIG_MOUSE_VSXXXAA is not set
+ # CONFIG_MOUSE_GPIO is not set
++# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+ # CONFIG_INPUT_JOYSTICK is not set
+ # CONFIG_INPUT_TABLET is not set
+ # CONFIG_INPUT_TOUCHSCREEN is not set
+@@ -819,6 +731,7 @@ CONFIG_SERIAL_8250_RSA=y
+ #
+ # Non-8250 serial port support
+ #
++# CONFIG_SERIAL_MAX3100 is not set
+ CONFIG_SERIAL_CORE=y
+ CONFIG_SERIAL_CORE_CONSOLE=y
+ CONFIG_UNIX98_PTYS=y
+@@ -826,6 +739,7 @@ CONFIG_UNIX98_PTYS=y
+ # CONFIG_LEGACY_PTYS is not set
+ # CONFIG_IPMI_HANDLER is not set
+ CONFIG_HW_RANDOM=y
++# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+ # CONFIG_R3964 is not set
+ # CONFIG_RAW_DRIVER is not set
+ # CONFIG_TCG_TPM is not set
+@@ -841,6 +755,7 @@ CONFIG_I2C_HELPER_AUTO=y
+ #
+ # I2C system bus drivers (mostly embedded / system-on-chip)
+ #
++# CONFIG_I2C_DESIGNWARE is not set
+ # CONFIG_I2C_GPIO is not set
+ # CONFIG_I2C_OCORES is not set
+ CONFIG_I2C_OMAP=y
+@@ -865,12 +780,7 @@ CONFIG_I2C_OMAP=y
+ # CONFIG_SENSORS_PCF8574 is not set
+ # CONFIG_PCF8575 is not set
+ # CONFIG_SENSORS_PCA9539 is not set
+-# CONFIG_SENSORS_PCF8591 is not set
+-CONFIG_TWL4030_MADC=m
+-CONFIG_TWL4030_POWEROFF=y
+-# CONFIG_SENSORS_MAX6875 is not set
+ # CONFIG_SENSORS_TSL2550 is not set
+-# CONFIG_SENSORS_TSL2563 is not set
+ # CONFIG_I2C_DEBUG_CORE is not set
+ # CONFIG_I2C_DEBUG_ALGO is not set
+ # CONFIG_I2C_DEBUG_BUS is not set
+@@ -889,8 +799,6 @@ CONFIG_SPI_OMAP24XX=y
+ #
+ # SPI Protocol Masters
+ #
+-# CONFIG_SPI_TSC210X is not set
+-# CONFIG_SPI_TSC2301 is not set
+ # CONFIG_SPI_SPIDEV is not set
+ # CONFIG_SPI_TLE62X0 is not set
+ CONFIG_ARCH_REQUIRE_GPIOLIB=y
+@@ -920,12 +828,7 @@ CONFIG_GPIO_TWL4030=y
+ # CONFIG_GPIO_MAX7301 is not set
+ # CONFIG_GPIO_MCP23S08 is not set
+ # CONFIG_W1 is not set
+-CONFIG_POWER_SUPPLY=m
+-# CONFIG_POWER_SUPPLY_DEBUG is not set
+-# CONFIG_PDA_POWER is not set
+-# CONFIG_BATTERY_DS2760 is not set
+-# CONFIG_TWL4030_BCI_BATTERY is not set
+-# CONFIG_BATTERY_BQ27x00 is not set
++# CONFIG_POWER_SUPPLY is not set
+ CONFIG_HWMON=y
+ # CONFIG_HWMON_VID is not set
+ # CONFIG_SENSORS_AD7414 is not set
+@@ -946,6 +849,7 @@ CONFIG_HWMON=y
+ # CONFIG_SENSORS_F71805F is not set
+ # CONFIG_SENSORS_F71882FG is not set
+ # CONFIG_SENSORS_F75375S is not set
++# CONFIG_SENSORS_G760A is not set
+ # CONFIG_SENSORS_GL518SM is not set
+ # CONFIG_SENSORS_GL520SM is not set
+ # CONFIG_SENSORS_IT87 is not set
+@@ -961,18 +865,23 @@ CONFIG_HWMON=y
+ # CONFIG_SENSORS_LM90 is not set
+ # CONFIG_SENSORS_LM92 is not set
+ # CONFIG_SENSORS_LM93 is not set
++# CONFIG_SENSORS_LTC4215 is not set
+ # CONFIG_SENSORS_LTC4245 is not set
++# CONFIG_SENSORS_LM95241 is not set
+ # CONFIG_SENSORS_MAX1111 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_PCF8591 is not set
++# CONFIG_SENSORS_SHT15 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_ADS7828 is not set
+ # CONFIG_SENSORS_THMC50 is not set
++# CONFIG_SENSORS_TMP401 is not set
+ # CONFIG_SENSORS_VT1211 is not set
+ # CONFIG_SENSORS_W83781D is not set
+ # CONFIG_SENSORS_W83791D is not set
+@@ -982,6 +891,7 @@ CONFIG_HWMON=y
+ # CONFIG_SENSORS_W83L786NG is not set
+ # CONFIG_SENSORS_W83627HF is not set
+ # CONFIG_SENSORS_W83627EHF is not set
++# CONFIG_SENSORS_LIS3_SPI is not set
+ # CONFIG_SENSORS_TSC210X is not set
+ CONFIG_SENSORS_OMAP34XX=y
+ # CONFIG_HWMON_DEBUG_CHIP is not set
+@@ -995,6 +905,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
+ #
+ # CONFIG_SOFT_WATCHDOG is not set
+ CONFIG_OMAP_WATCHDOG=y
++# CONFIG_TWL4030_WATCHDOG is not set
+ CONFIG_SSB_POSSIBLE=y
+
+ #
+@@ -1012,7 +923,6 @@ CONFIG_SSB_POSSIBLE=y
+ # CONFIG_HTC_PASIC3 is not set
+ # CONFIG_TPS65010 is not set
+ CONFIG_TWL4030_CORE=y
+-# CONFIG_TWL4030_POWER is not set
+ # CONFIG_MFD_TMIO is not set
+ # CONFIG_MFD_T7L66XB is not set
+ # CONFIG_MFD_TC6387XB is not set
+@@ -1021,154 +931,9 @@ CONFIG_TWL4030_CORE=y
+ # CONFIG_MFD_WM8400 is not set
+ # CONFIG_MFD_WM8350_I2C is not set
+ # CONFIG_MFD_PCF50633 is not set
+-
+-#
+-# Multimedia devices
+-#
+-
+-#
+-# Multimedia core support
+-#
+-CONFIG_VIDEO_DEV=m
+-CONFIG_VIDEO_V4L2_COMMON=m
+-CONFIG_VIDEO_ALLOW_V4L1=y
+-CONFIG_VIDEO_V4L1_COMPAT=y
+-CONFIG_DVB_CORE=m
+-CONFIG_VIDEO_MEDIA=m
+-
+-#
+-# Multimedia drivers
+-#
+-CONFIG_MEDIA_ATTACH=y
+-CONFIG_MEDIA_TUNER=m
+-# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+-CONFIG_MEDIA_TUNER_SIMPLE=m
+-CONFIG_MEDIA_TUNER_TDA8290=m
+-CONFIG_MEDIA_TUNER_TDA9887=m
+-CONFIG_MEDIA_TUNER_TEA5761=m
+-CONFIG_MEDIA_TUNER_TEA5767=m
+-CONFIG_MEDIA_TUNER_MT20XX=m
+-CONFIG_MEDIA_TUNER_XC2028=m
+-CONFIG_MEDIA_TUNER_XC5000=m
+-CONFIG_VIDEO_V4L2=m
+-CONFIG_VIDEO_V4L1=m
+-CONFIG_VIDEO_CAPTURE_DRIVERS=y
+-# CONFIG_VIDEO_ADV_DEBUG is not set
+-# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+-CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+-# CONFIG_VIDEO_VIVI is not set
+-# CONFIG_VIDEO_CPIA is not set
+-# CONFIG_VIDEO_SAA5246A is not set
+-# CONFIG_VIDEO_SAA5249 is not set
+-# CONFIG_SOC_CAMERA is not set
+-CONFIG_RADIO_ADAPTERS=y
+-# CONFIG_RADIO_TEA5764 is not set
+-# CONFIG_DVB_DYNAMIC_MINORS is not set
+-CONFIG_DVB_CAPTURE_DRIVERS=y
+-# CONFIG_TTPCI_EEPROM is not set
+-# CONFIG_DVB_B2C2_FLEXCOP is not set
+-
+-#
+-# Supported DVB Frontends
+-#
+-
+-#
+-# Customise DVB Frontends
+-#
+-# CONFIG_DVB_FE_CUSTOMISE is not set
+-
+-#
+-# Multistandard (satellite) frontends
+-#
+-# CONFIG_DVB_STB0899 is not set
+-# CONFIG_DVB_STB6100 is not set
+-
+-#
+-# DVB-S (satellite) frontends
+-#
+-CONFIG_DVB_CX24110=m
+-CONFIG_DVB_CX24123=m
+-CONFIG_DVB_MT312=m
+-CONFIG_DVB_S5H1420=m
+-# CONFIG_DVB_STV0288 is not set
+-# CONFIG_DVB_STB6000 is not set
+-CONFIG_DVB_STV0299=m
+-CONFIG_DVB_TDA8083=m
+-CONFIG_DVB_TDA10086=m
+-# CONFIG_DVB_TDA8261 is not set
+-CONFIG_DVB_VES1X93=m
+-CONFIG_DVB_TUNER_ITD1000=m
+-# CONFIG_DVB_TUNER_CX24113 is not set
+-CONFIG_DVB_TDA826X=m
+-CONFIG_DVB_TUA6100=m
+-# CONFIG_DVB_CX24116 is not set
+-# CONFIG_DVB_SI21XX is not set
+-
+-#
+-# DVB-T (terrestrial) frontends
+-#
+-CONFIG_DVB_SP8870=m
+-CONFIG_DVB_SP887X=m
+-CONFIG_DVB_CX22700=m
+-CONFIG_DVB_CX22702=m
+-# CONFIG_DVB_DRX397XD is not set
+-CONFIG_DVB_L64781=m
+-CONFIG_DVB_TDA1004X=m
+-CONFIG_DVB_NXT6000=m
+-CONFIG_DVB_MT352=m
+-CONFIG_DVB_ZL10353=m
+-CONFIG_DVB_DIB3000MB=m
+-CONFIG_DVB_DIB3000MC=m
+-CONFIG_DVB_DIB7000M=m
+-CONFIG_DVB_DIB7000P=m
+-CONFIG_DVB_TDA10048=m
+-
+-#
+-# DVB-C (cable) frontends
+-#
+-CONFIG_DVB_VES1820=m
+-CONFIG_DVB_TDA10021=m
+-CONFIG_DVB_TDA10023=m
+-CONFIG_DVB_STV0297=m
+-
+-#
+-# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+-#
+-CONFIG_DVB_NXT200X=m
+-# CONFIG_DVB_OR51211 is not set
+-# CONFIG_DVB_OR51132 is not set
+-CONFIG_DVB_BCM3510=m
+-CONFIG_DVB_LGDT330X=m
+-# CONFIG_DVB_LGDT3304 is not set
+-CONFIG_DVB_S5H1409=m
+-CONFIG_DVB_AU8522=m
+-CONFIG_DVB_S5H1411=m
+-
+-#
+-# ISDB-T (terrestrial) frontends
+-#
+-# CONFIG_DVB_S921 is not set
+-
+-#
+-# Digital terrestrial only tuners/PLL
+-#
+-CONFIG_DVB_PLL=m
+-CONFIG_DVB_TUNER_DIB0070=m
+-
+-#
+-# SEC control devices for DVB-S
+-#
+-CONFIG_DVB_LNBP21=m
+-# CONFIG_DVB_ISL6405 is not set
+-CONFIG_DVB_ISL6421=m
+-# CONFIG_DVB_LGS8GL5 is not set
+-
+-#
+-# Tools to develop new frontends
+-#
+-# CONFIG_DVB_DUMMY_FE is not set
+-# CONFIG_DVB_AF9013 is not set
+-# CONFIG_DAB is not set
++# CONFIG_AB3100_CORE is not set
++# CONFIG_EZX_PCAP is not set
++# CONFIG_MEDIA_SUPPORT is not set
+
+ #
+ # Graphics support
+@@ -1201,6 +966,7 @@ CONFIG_FB_CFB_IMAGEBLIT=m
+ # CONFIG_FB_VIRTUAL is not set
+ # CONFIG_FB_METRONOME is not set
+ # CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
+ # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+ CONFIG_OMAP2_DSS=m
+ CONFIG_OMAP2_DSS_VRAM_SIZE=12
+@@ -1242,53 +1008,8 @@ CONFIG_DISPLAY_SUPPORT=y
+ CONFIG_DUMMY_CONSOLE=y
+ # CONFIG_FRAMEBUFFER_CONSOLE is not set
+ # CONFIG_LOGO is not set
+-CONFIG_SOUND=y
+-CONFIG_SOUND_OSS_CORE=y
+-CONFIG_SND=y
+-CONFIG_SND_TIMER=y
+-CONFIG_SND_PCM=y
+-CONFIG_SND_SEQUENCER=m
+-# CONFIG_SND_SEQ_DUMMY is not set
+-CONFIG_SND_OSSEMUL=y
+-CONFIG_SND_MIXER_OSS=y
+-CONFIG_SND_PCM_OSS=y
+-CONFIG_SND_PCM_OSS_PLUGINS=y
+-CONFIG_SND_SEQUENCER_OSS=y
+-# CONFIG_SND_HRTIMER 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=y
+-CONFIG_SND_DEBUG=y
+-# CONFIG_SND_DEBUG_VERBOSE is not set
+-# CONFIG_SND_PCM_XRUN_DEBUG is not set
+-CONFIG_SND_DRIVERS=y
+-# CONFIG_SND_DUMMY is not set
+-# CONFIG_SND_VIRMIDI is not set
+-# CONFIG_SND_MTPAV is not set
+-# CONFIG_SND_SERIAL_U16550 is not set
+-# CONFIG_SND_MPU401 is not set
+-CONFIG_SND_ARM=y
+-CONFIG_SND_SPI=y
+-CONFIG_SND_SOC=y
+-CONFIG_SND_OMAP_SOC=y
+-CONFIG_SND_OMAP_SOC_MCBSP=y
+-CONFIG_SND_OMAP_SOC_OVERO=y
+-CONFIG_SND_SOC_I2C_AND_SPI=y
+-# CONFIG_SND_SOC_ALL_CODECS is not set
+-CONFIG_SND_SOC_TWL4030=y
+-# CONFIG_SOUND_PRIME is not set
+-CONFIG_HID_SUPPORT=y
+-CONFIG_HID=y
+-CONFIG_HID_DEBUG=y
+-# CONFIG_HIDRAW is not set
+-# CONFIG_HID_PID is not set
+-
+-#
+-# Special HID drivers
+-#
+-CONFIG_HID_COMPAT=y
+-# CONFIG_HID_APPLE is not set
++# CONFIG_SOUND is not set
++# CONFIG_HID_SUPPORT is not set
+ CONFIG_USB_SUPPORT=y
+ CONFIG_USB_ARCH_HAS_HCD=y
+ CONFIG_USB_ARCH_HAS_OHCI=y
+@@ -1312,7 +1033,7 @@ CONFIG_USB_INVENTRA_DMA=y
+ # CONFIG_USB_MUSB_DEBUG is not set
+
+ #
+-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+ #
+ CONFIG_USB_GADGET=y
+ # CONFIG_USB_GADGET_DEBUG is not set
+@@ -1327,6 +1048,7 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_OMAP is not set
+ # CONFIG_USB_GADGET_PXA25X is not set
+ # CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C_HSOTG is not set
+ # CONFIG_USB_GADGET_S3C2410 is not set
+ # CONFIG_USB_GADGET_IMX is not set
+ # CONFIG_USB_GADGET_M66592 is not set
+@@ -1335,9 +1057,11 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_CI13XXX is not set
+ # CONFIG_USB_GADGET_NET2280 is not set
+ # CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_LANGWELL is not set
+ # CONFIG_USB_GADGET_DUMMY_HCD is not set
+ CONFIG_USB_GADGET_DUALSPEED=y
+ # CONFIG_USB_ZERO is not set
++# CONFIG_USB_AUDIO is not set
+ CONFIG_USB_ETH=y
+ CONFIG_USB_ETH_RNDIS=y
+ # CONFIG_USB_GADGETFS is not set
+@@ -1354,6 +1078,7 @@ CONFIG_USB_OTG_UTILS=y
+ # CONFIG_USB_GPIO_VBUS is not set
+ # CONFIG_ISP1301_OMAP is not set
+ CONFIG_TWL4030_USB=y
++# CONFIG_NOP_USB_XCEIV is not set
+ CONFIG_MMC=y
+ # CONFIG_MMC_DEBUG is not set
+ CONFIG_MMC_UNSAFE_RESUME=y
+@@ -1385,8 +1110,11 @@ CONFIG_LEDS_CLASS=y
+ # CONFIG_LEDS_OMAP_PWM is not set
+ # CONFIG_LEDS_PCA9532 is not set
+ CONFIG_LEDS_GPIO=y
++CONFIG_LEDS_GPIO_PLATFORM=y
+ # CONFIG_LEDS_LP5521 is not set
+ # CONFIG_LEDS_PCA955X is not set
++# CONFIG_LEDS_DAC124S085 is not set
++# CONFIG_LEDS_BD2802 is not set
+
+ #
+ # LED Triggers
+@@ -1395,7 +1123,12 @@ CONFIG_LEDS_TRIGGERS=y
+ CONFIG_LEDS_TRIGGER_TIMER=y
+ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+ # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_GPIO is not set
+ # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++
++#
++# iptables trigger is under Netfilter config (LED target)
++#
+ CONFIG_RTC_LIB=y
+ CONFIG_RTC_CLASS=y
+ CONFIG_RTC_HCTOSYS=y
+@@ -1428,6 +1161,7 @@ CONFIG_RTC_DRV_TWL4030=y
+ # CONFIG_RTC_DRV_S35390A is not set
+ # CONFIG_RTC_DRV_FM3130 is not set
+ # CONFIG_RTC_DRV_RX8581 is not set
++# CONFIG_RTC_DRV_RX8025 is not set
+
+ #
+ # SPI RTC drivers
+@@ -1459,12 +1193,16 @@ CONFIG_RTC_DRV_TWL4030=y
+ # on-CPU RTC drivers
+ #
+ # CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
+ CONFIG_REGULATOR=y
+ # CONFIG_REGULATOR_DEBUG is not set
+ # CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+ # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+ # CONFIG_REGULATOR_BQ24022 is not set
++# CONFIG_REGULATOR_MAX1586 is not set
+ CONFIG_REGULATOR_TWL4030=y
++# CONFIG_REGULATOR_LP3971 is not set
+ # CONFIG_UIO is not set
+ # CONFIG_STAGING is not set
+
+@@ -1480,6 +1218,7 @@ CONFIG_EXT2_FS=y
+ # CONFIG_EXT2_FS_XATTR is not set
+ # CONFIG_EXT2_FS_XIP is not set
+ CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+ # CONFIG_EXT3_FS_XATTR is not set
+ # CONFIG_EXT4_FS is not set
+ CONFIG_JBD=y
+@@ -1487,15 +1226,12 @@ CONFIG_JBD=y
+ # CONFIG_REISERFS_FS is not set
+ # CONFIG_JFS_FS is not set
+ CONFIG_FS_POSIX_ACL=y
+-CONFIG_FILE_LOCKING=y
+-CONFIG_XFS_FS=m
+-# CONFIG_XFS_QUOTA is not set
+-# CONFIG_XFS_POSIX_ACL is not set
+-# CONFIG_XFS_RT is not set
+-# CONFIG_XFS_DEBUG is not set
++# CONFIG_XFS_FS is not set
+ # CONFIG_GFS2_FS is not set
+ # CONFIG_OCFS2_FS is not set
+ # CONFIG_BTRFS_FS is not set
++CONFIG_FILE_LOCKING=y
++CONFIG_FSNOTIFY=y
+ CONFIG_DNOTIFY=y
+ CONFIG_INOTIFY=y
+ CONFIG_INOTIFY_USER=y
+@@ -1508,16 +1244,18 @@ CONFIG_QFMT_V2=y
+ CONFIG_QUOTACTL=y
+ # CONFIG_AUTOFS_FS is not set
+ # CONFIG_AUTOFS4_FS is not set
+-CONFIG_FUSE_FS=m
++# CONFIG_FUSE_FS is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE is not set
+
+ #
+ # CD-ROM/DVD Filesystems
+ #
+-CONFIG_ISO9660_FS=m
+-CONFIG_JOLIET=y
+-CONFIG_ZISOFS=y
+-CONFIG_UDF_FS=m
+-CONFIG_UDF_NLS=y
++# CONFIG_ISO9660_FS is not set
++# CONFIG_UDF_FS is not set
+
+ #
+ # DOS/FAT/NT Filesystems
+@@ -1575,20 +1313,20 @@ CONFIG_JFFS2_CMODE_PRIORITY=y
+ # CONFIG_ROMFS_FS is not set
+ # CONFIG_SYSV_FS is not set
+ # CONFIG_UFS_FS is not set
++# CONFIG_NILFS2_FS is not set
+ CONFIG_NETWORK_FILESYSTEMS=y
+ CONFIG_NFS_FS=y
+ CONFIG_NFS_V3=y
+ # CONFIG_NFS_V3_ACL is not set
+ CONFIG_NFS_V4=y
++# CONFIG_NFS_V4_1 is not set
+ CONFIG_ROOT_NFS=y
+ # CONFIG_NFSD is not set
+ CONFIG_LOCKD=y
+ CONFIG_LOCKD_V4=y
+-CONFIG_EXPORTFS=m
+ CONFIG_NFS_COMMON=y
+ CONFIG_SUNRPC=y
+ CONFIG_SUNRPC_GSS=y
+-# CONFIG_SUNRPC_REGISTER_V4 is not set
+ CONFIG_RPCSEC_GSS_KRB5=y
+ # CONFIG_RPCSEC_GSS_SPKM3 is not set
+ # CONFIG_SMB_FS is not set
+@@ -1676,12 +1414,17 @@ CONFIG_DEBUG_KERNEL=y
+ CONFIG_DETECT_SOFTLOCKUP=y
+ # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_DETECT_HUNG_TASK=y
++# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
++CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+ CONFIG_SCHED_DEBUG=y
+ CONFIG_SCHEDSTATS=y
+ CONFIG_TIMER_STATS=y
+ # CONFIG_DEBUG_OBJECTS is not set
+ # CONFIG_SLUB_DEBUG_ON is not set
+ # CONFIG_SLUB_STATS is not set
++# CONFIG_DEBUG_KMEMLEAK is not set
++CONFIG_DEBUG_PREEMPT=y
+ # CONFIG_DEBUG_RT_MUTEXES is not set
+ # CONFIG_RT_MUTEX_TESTER is not set
+ # CONFIG_DEBUG_SPINLOCK is not set
+@@ -1701,7 +1444,6 @@ CONFIG_DEBUG_BUGVERBOSE=y
+ # CONFIG_DEBUG_LIST is not set
+ # CONFIG_DEBUG_SG is not set
+ # CONFIG_DEBUG_NOTIFIERS is not set
+-CONFIG_FRAME_POINTER=y
+ # CONFIG_BOOT_PRINTK_DELAY is not set
+ # CONFIG_RCU_TORTURE_TEST is not set
+ # CONFIG_RCU_CPU_STALL_DETECTOR is not set
+@@ -1709,26 +1451,34 @@ CONFIG_FRAME_POINTER=y
+ # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+ # CONFIG_FAULT_INJECTION is not set
+ # CONFIG_LATENCYTOP is not set
++# CONFIG_PAGE_POISONING is not set
+ CONFIG_NOP_TRACER=y
+ CONFIG_HAVE_FUNCTION_TRACER=y
+ CONFIG_RING_BUFFER=y
++CONFIG_EVENT_TRACING=y
++CONFIG_CONTEXT_SWITCH_TRACER=y
+ CONFIG_TRACING=y
+-
+-#
+-# Tracers
+-#
++CONFIG_TRACING_SUPPORT=y
++CONFIG_FTRACE=y
+ # CONFIG_FUNCTION_TRACER is not set
+ # CONFIG_IRQSOFF_TRACER is not set
++# CONFIG_PREEMPT_TRACER is not set
+ # CONFIG_SCHED_TRACER is not set
+-# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+ # CONFIG_BOOT_TRACER is not set
+-# CONFIG_TRACE_BRANCH_PROFILING is not set
++CONFIG_BRANCH_PROFILE_NONE=y
++# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
++# CONFIG_PROFILE_ALL_BRANCHES is not set
+ # CONFIG_STACK_TRACER is not set
+-# CONFIG_FTRACE_STARTUP_TEST is not set
+-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_KMEMTRACE is not set
++# CONFIG_WORKQUEUE_TRACER is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_RING_BUFFER_BENCHMARK is not set
++# CONFIG_DYNAMIC_DEBUG is not set
+ # CONFIG_SAMPLES is not set
+ CONFIG_HAVE_ARCH_KGDB=y
+ # CONFIG_KGDB is not set
++CONFIG_ARM_UNWIND=y
+ CONFIG_DEBUG_USER=y
+ CONFIG_DEBUG_ERRORS=y
+ # CONFIG_DEBUG_STACK_USAGE is not set
+@@ -1741,10 +1491,6 @@ CONFIG_DEBUG_ERRORS=y
+ # CONFIG_SECURITY is not set
+ # CONFIG_SECURITYFS is not set
+ # CONFIG_SECURITY_FILE_CAPABILITIES is not set
+-CONFIG_XOR_BLOCKS=m
+-CONFIG_ASYNC_CORE=m
+-CONFIG_ASYNC_MEMCPY=m
+-CONFIG_ASYNC_XOR=m
+ CONFIG_CRYPTO=y
+
+ #
+@@ -1759,13 +1505,15 @@ CONFIG_CRYPTO_BLKCIPHER2=y
+ CONFIG_CRYPTO_HASH=y
+ CONFIG_CRYPTO_HASH2=y
+ CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_PCOMP=y
+ CONFIG_CRYPTO_MANAGER=y
+ CONFIG_CRYPTO_MANAGER2=y
+-CONFIG_CRYPTO_GF128MUL=m
+-CONFIG_CRYPTO_NULL=m
+-CONFIG_CRYPTO_CRYPTD=m
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++CONFIG_CRYPTO_WORKQUEUE=y
++# CONFIG_CRYPTO_CRYPTD is not set
+ # CONFIG_CRYPTO_AUTHENC is not set
+-CONFIG_CRYPTO_TEST=m
++# CONFIG_CRYPTO_TEST is not set
+
+ #
+ # Authenticated Encryption with Associated Data
+@@ -1780,65 +1528,66 @@ CONFIG_CRYPTO_TEST=m
+ CONFIG_CRYPTO_CBC=y
+ # CONFIG_CRYPTO_CTR is not set
+ # CONFIG_CRYPTO_CTS is not set
+-CONFIG_CRYPTO_ECB=y
+-CONFIG_CRYPTO_LRW=m
+-CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
+ # CONFIG_CRYPTO_XTS is not set
+
+ #
+ # Hash modes
+ #
+-CONFIG_CRYPTO_HMAC=m
+-CONFIG_CRYPTO_XCBC=m
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
+
+ #
+ # Digest
+ #
+ CONFIG_CRYPTO_CRC32C=y
+-CONFIG_CRYPTO_MD4=m
++# CONFIG_CRYPTO_MD4 is not set
+ CONFIG_CRYPTO_MD5=y
+-CONFIG_CRYPTO_MICHAEL_MIC=y
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
+ # CONFIG_CRYPTO_RMD128 is not set
+ # CONFIG_CRYPTO_RMD160 is not set
+ # CONFIG_CRYPTO_RMD256 is not set
+ # CONFIG_CRYPTO_RMD320 is not set
+-CONFIG_CRYPTO_SHA1=m
+-CONFIG_CRYPTO_SHA256=m
+-CONFIG_CRYPTO_SHA512=m
+-CONFIG_CRYPTO_TGR192=m
+-CONFIG_CRYPTO_WP512=m
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
+
+ #
+ # Ciphers
+ #
+-CONFIG_CRYPTO_AES=y
+-CONFIG_CRYPTO_ANUBIS=m
+-CONFIG_CRYPTO_ARC4=y
+-CONFIG_CRYPTO_BLOWFISH=m
+-CONFIG_CRYPTO_CAMELLIA=m
+-CONFIG_CRYPTO_CAST5=m
+-CONFIG_CRYPTO_CAST6=m
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
+ CONFIG_CRYPTO_DES=y
+-CONFIG_CRYPTO_FCRYPT=m
+-CONFIG_CRYPTO_KHAZAD=m
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
+ # CONFIG_CRYPTO_SALSA20 is not set
+ # CONFIG_CRYPTO_SEED is not set
+-CONFIG_CRYPTO_SERPENT=m
+-CONFIG_CRYPTO_TEA=m
+-CONFIG_CRYPTO_TWOFISH=m
+-CONFIG_CRYPTO_TWOFISH_COMMON=m
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
+
+ #
+ # Compression
+ #
+-CONFIG_CRYPTO_DEFLATE=m
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_ZLIB is not set
+ # CONFIG_CRYPTO_LZO is not set
+
+ #
+ # Random Number Generation
+ #
+ # CONFIG_CRYPTO_ANSI_CPRNG is not set
+-CONFIG_CRYPTO_HW=y
++# CONFIG_CRYPTO_HW is not set
++CONFIG_BINARY_PRINTF=y
+
+ #
+ # Library routines
+@@ -1856,7 +1605,8 @@ CONFIG_ZLIB_INFLATE=y
+ CONFIG_ZLIB_DEFLATE=y
+ CONFIG_LZO_COMPRESS=y
+ CONFIG_LZO_DECOMPRESS=y
+-CONFIG_PLIST=y
++CONFIG_DECOMPRESS_GZIP=y
+ CONFIG_HAS_IOMEM=y
+ CONFIG_HAS_IOPORT=y
+ CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0115-DSS2-SDI-make-sdi_pads-static.patch b/recipes/linux/linux-omap-pm/dss2/0115-DSS2-SDI-make-sdi_pads-static.patch
new file mode 100644
index 0000000000..59681c08ba
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0115-DSS2-SDI-make-sdi_pads-static.patch
@@ -0,0 +1,26 @@
+From 81a652bad3261a822821fd49d3bc21a165a8d26f Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 16:17:44 +0300
+Subject: [PATCH 115/146] DSS2: SDI: make sdi_pads static
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/sdi.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
+index c484e0c..ef07c7c 100644
+--- a/drivers/video/omap2/dss/sdi.c
++++ b/drivers/video/omap2/dss/sdi.c
+@@ -46,7 +46,7 @@ static struct {
+ } sdi;
+
+ /* CONTROL_PADCONF_DSS_DATAXX */
+-const u16 sdi_pads[] =
++static const u16 sdi_pads[] =
+ {
+ 0x0f0, /* 10[ 7..0]:SDI_DAT1N */
+ 0x0f2, /* 10[15..0]:SDI_DAT1P */
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0116-DSS2-Fix-default_color-sysfs-output.patch b/recipes/linux/linux-omap-pm/dss2/0116-DSS2-Fix-default_color-sysfs-output.patch
new file mode 100644
index 0000000000..97506adbf6
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0116-DSS2-Fix-default_color-sysfs-output.patch
@@ -0,0 +1,26 @@
+From 501537af71157a95e5947a5827514014909a6608 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 15 Jun 2009 15:13:25 +0300
+Subject: [PATCH 116/146] DSS2: Fix default_color sysfs output
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/manager.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index f6df4d6..0b0c51e 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -101,7 +101,7 @@ put_device:
+ static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
+ char *buf)
+ {
+- return snprintf(buf, PAGE_SIZE, "%d", mgr->info.default_color);
++ return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.default_color);
+ }
+
+ static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0117-DSS2-Locking-for-VRFB.patch b/recipes/linux/linux-omap-pm/dss2/0117-DSS2-Locking-for-VRFB.patch
new file mode 100644
index 0000000000..7902d2225c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0117-DSS2-Locking-for-VRFB.patch
@@ -0,0 +1,125 @@
+From 4044386e8f32ea442478809d945f50c5a3a66f88 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 16 Jun 2009 15:18:30 +0300
+Subject: [PATCH 117/146] DSS2: Locking for VRFB
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/vrfb.c | 25 ++++++++++++++++++++++---
+ 1 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 0c7d943..7cd7c61 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -3,6 +3,7 @@
+ #include <linux/ioport.h>
+ #include <linux/io.h>
+ #include <linux/bitops.h>
++#include <linux/mutex.h>
+
+ #include <mach/io.h>
+ #include <mach/vrfb.h>
+@@ -42,6 +43,8 @@ static unsigned long ctx_map;
+ /* bitmap of contexts for which we have to keep the HW context valid */
+ static unsigned long ctx_map_active;
+
++static DEFINE_MUTEX(ctx_lock);
++
+ /*
+ * Access to this happens from client drivers or the PM core after wake-up.
+ * For the first case we require locking at the driver level, for the second
+@@ -171,6 +174,8 @@ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+
+ DBG("release ctx %d\n", ctx);
+
++ mutex_lock(&ctx_lock);
++
+ if (!(ctx_map & (1 << ctx))) {
+ BUG();
+ return;
+@@ -186,6 +191,8 @@ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+ }
+
+ vrfb->context = 0xff;
++
++ mutex_unlock(&ctx_lock);
+ }
+ EXPORT_SYMBOL(omap_vrfb_release_ctx);
+
+@@ -194,16 +201,20 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ int rot;
+ u32 paddr;
+ u8 ctx;
++ int r;
+
+ DBG("request ctx\n");
+
++ mutex_lock(&ctx_lock);
++
+ for (ctx = 0; ctx < VRFB_NUM_CTXS; ++ctx)
+ if ((ctx_map & (1 << ctx)) == 0)
+ break;
+
+ if (ctx == VRFB_NUM_CTXS) {
+ printk(KERN_ERR "vrfb: no free contexts\n");
+- return -EBUSY;
++ r = -EBUSY;
++ goto out;
+ }
+
+ DBG("found free ctx %d\n", ctx);
+@@ -223,7 +234,8 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ "area for ctx %d, rotation %d\n",
+ ctx, rot * 90);
+ omap_vrfb_release_ctx(vrfb);
+- return -ENOMEM;
++ r = -ENOMEM;
++ goto out;
+ }
+
+ vrfb->paddr[rot] = paddr;
+@@ -231,25 +243,31 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ DBG("VRFB %d/%d: %lx\n", ctx, rot*90, vrfb->paddr[rot]);
+ }
+
+- return 0;
++ r = 0;
++out:
++ mutex_unlock(&ctx_lock);
++ return r;
+ }
+ EXPORT_SYMBOL(omap_vrfb_request_ctx);
+
+ void omap_vrfb_suspend_ctx(struct vrfb *vrfb)
+ {
+ DBG("suspend ctx %d\n", vrfb->context);
++ mutex_lock(&ctx_lock);
+ if (vrfb->context >= VRFB_NUM_CTXS ||
+ (!(1 << vrfb->context) & ctx_map_active)) {
+ BUG();
+ return;
+ }
+ clear_bit(vrfb->context, &ctx_map_active);
++ mutex_unlock(&ctx_lock);
+ }
+ EXPORT_SYMBOL(omap_vrfb_suspend_ctx);
+
+ void omap_vrfb_resume_ctx(struct vrfb *vrfb)
+ {
+ DBG("resume ctx %d\n", vrfb->context);
++ mutex_lock(&ctx_lock);
+ if (vrfb->context >= VRFB_NUM_CTXS ||
+ ((1 << vrfb->context) & ctx_map_active)) {
+ BUG();
+@@ -263,6 +281,7 @@ void omap_vrfb_resume_ctx(struct vrfb *vrfb)
+ */
+ restore_hw_context(vrfb->context);
+ set_bit(vrfb->context, &ctx_map_active);
++ mutex_unlock(&ctx_lock);
+ }
+ EXPORT_SYMBOL(omap_vrfb_resume_ctx);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0118-DSS2-DISPC-fix-locking-issue-with-irq-handling.patch b/recipes/linux/linux-omap-pm/dss2/0118-DSS2-DISPC-fix-locking-issue-with-irq-handling.patch
new file mode 100644
index 0000000000..c01ece605b
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0118-DSS2-DISPC-fix-locking-issue-with-irq-handling.patch
@@ -0,0 +1,54 @@
+From 32720bafdbb70ab9f534d93b75a954c891bed8cc Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Sat, 13 Jun 2009 13:38:54 +0300
+Subject: [PATCH 118/146] DSS2: DISPC: fix locking issue with irq handling
+
+Fix the problem that an irq handler couldn't unregister
+itself
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c | 12 +++++++++++-
+ 1 files changed, 11 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 2463bab..4e1da6b 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2732,6 +2732,7 @@ void dispc_irq_handler(void)
+ u32 handledirqs = 0;
+ u32 unhandled_errors;
+ struct omap_dispc_isr_data *isr_data;
++ struct omap_dispc_isr_data registered_isr[DISPC_MAX_NR_ISRS];
+
+ spin_lock(&dispc.irq_lock);
+
+@@ -2745,8 +2746,15 @@ void dispc_irq_handler(void)
+ * off */
+ dispc_write_reg(DISPC_IRQSTATUS, irqstatus);
+
++ /* make a copy and unlock, so that isrs can unregister
++ * themselves */
++ memcpy(registered_isr, dispc.registered_isr,
++ sizeof(registered_isr));
++
++ spin_unlock(&dispc.irq_lock);
++
+ for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
+- isr_data = &dispc.registered_isr[i];
++ isr_data = &registered_isr[i];
+
+ if (!isr_data->isr)
+ continue;
+@@ -2757,6 +2765,8 @@ void dispc_irq_handler(void)
+ }
+ }
+
++ spin_lock(&dispc.irq_lock);
++
+ unhandled_errors = irqstatus & ~handledirqs & dispc.irq_error_mask;
+
+ if (unhandled_errors) {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0119-DSS2-OMAPFB-remove-unneeded-locks.patch b/recipes/linux/linux-omap-pm/dss2/0119-DSS2-OMAPFB-remove-unneeded-locks.patch
new file mode 100644
index 0000000000..2b0ba2da78
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0119-DSS2-OMAPFB-remove-unneeded-locks.patch
@@ -0,0 +1,391 @@
+From 995d5a236d8b1f7fe24da9dcacb1e89c214afdba Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 16 Jun 2009 14:33:07 +0300
+Subject: [PATCH 119/146] DSS2: OMAPFB: remove unneeded locks
+
+omapfb_lock() locks the whole omapfb device, meaning all framebuffers.
+Usually it is enough to lock only the framebuffer that is being
+manipulated, and for IOCTLs the fb framework does this already.
+
+Thus, we can remove many omapfb_lock()s totally, and change some
+to lock_fb_info().
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 47 ++--------------------------
+ drivers/video/omap2/omapfb/omapfb-main.c | 5 ---
+ drivers/video/omap2/omapfb/omapfb-sysfs.c | 32 ++++++++++++-------
+ 3 files changed, 24 insertions(+), 60 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index c513fe0..91308c2 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -44,8 +44,6 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
+
+ DBG("omapfb_setup_plane\n");
+
+- omapfb_lock(fbdev);
+-
+ if (ofbi->num_overlays != 1) {
+ r = -EINVAL;
+ goto out;
+@@ -94,7 +92,6 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
+ }
+
+ out:
+- omapfb_unlock(fbdev);
+ if (r)
+ dev_err(fbdev->dev, "setup_plane failed\n");
+ return r;
+@@ -103,9 +100,6 @@ out:
+ static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+-
+- omapfb_lock(fbdev);
+
+ if (ofbi->num_overlays != 1) {
+ memset(pi, 0, sizeof(*pi));
+@@ -125,8 +119,6 @@ static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
+ pi->out_height = ovli->out_height;
+ }
+
+- omapfb_unlock(fbdev);
+-
+ return 0;
+ }
+
+@@ -145,43 +137,32 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
+
+ rg = &ofbi->region;
+
+- omapfb_lock(fbdev);
+-
+ for (i = 0; i < ofbi->num_overlays; i++) {
+- if (ofbi->overlays[i]->info.enabled) {
+- r = -EBUSY;
+- goto out;
+- }
++ if (ofbi->overlays[i]->info.enabled)
++ return -EBUSY;
+ }
+
+ if (rg->size != size || rg->type != mi->type) {
+ r = omapfb_realloc_fbmem(fbi, size, mi->type);
+ if (r) {
+ dev_err(fbdev->dev, "realloc fbmem failed\n");
+- goto out;
++ return r;
+ }
+ }
+
+- r = 0;
+-out:
+- omapfb_unlock(fbdev);
+-
+- return r;
++ return 0;
+ }
+
+ static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ struct omapfb2_mem_region *rg;
+
+ rg = &ofbi->region;
+ memset(mi, 0, sizeof(*mi));
+
+- omapfb_lock(fbdev);
+ mi->size = rg->size;
+ mi->type = rg->type;
+- omapfb_unlock(fbdev);
+
+ return 0;
+ }
+@@ -189,8 +170,6 @@ static int omapfb_query_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
+ static int omapfb_update_window(struct fb_info *fbi,
+ u32 x, u32 y, u32 w, u32 h)
+ {
+- struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ struct omap_dss_device *display = fb2display(fbi);
+ u16 dw, dh;
+
+@@ -205,9 +184,7 @@ static int omapfb_update_window(struct fb_info *fbi,
+ if (x + w > dw || y + h > dh)
+ return -EINVAL;
+
+- omapfb_lock(fbdev);
+ display->update(display, x, y, w, h);
+- omapfb_unlock(fbdev);
+
+ return 0;
+ }
+@@ -215,8 +192,6 @@ static int omapfb_update_window(struct fb_info *fbi,
+ static int omapfb_set_update_mode(struct fb_info *fbi,
+ enum omapfb_update_mode mode)
+ {
+- struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ struct omap_dss_device *display = fb2display(fbi);
+ enum omap_dss_update_mode um;
+ int r;
+@@ -241,9 +216,7 @@ static int omapfb_set_update_mode(struct fb_info *fbi,
+ return -EINVAL;
+ }
+
+- omapfb_lock(fbdev);
+ r = display->set_update_mode(display, um);
+- omapfb_unlock(fbdev);
+
+ return r;
+ }
+@@ -251,17 +224,13 @@ static int omapfb_set_update_mode(struct fb_info *fbi,
+ static int omapfb_get_update_mode(struct fb_info *fbi,
+ enum omapfb_update_mode *mode)
+ {
+- struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ struct omap_dss_device *display = fb2display(fbi);
+ enum omap_dss_update_mode m;
+
+ if (!display || !display->get_update_mode)
+ return -EINVAL;
+
+- omapfb_lock(fbdev);
+ m = display->get_update_mode(display);
+- omapfb_unlock(fbdev);
+
+ switch (m) {
+ case OMAP_DSS_UPDATE_DISABLED:
+@@ -396,8 +365,6 @@ static int omapfb_memory_read(struct fb_info *fbi,
+ struct omapfb_memory_read *mr)
+ {
+ struct omap_dss_device *display = fb2display(fbi);
+- struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ void *buf;
+ int r;
+
+@@ -416,8 +383,6 @@ static int omapfb_memory_read(struct fb_info *fbi,
+ return -ENOMEM;
+ }
+
+- omapfb_lock(fbdev);
+-
+ r = display->memory_read(display, buf, mr->buffer_size,
+ mr->x, mr->y, mr->w, mr->h);
+
+@@ -428,8 +393,6 @@ static int omapfb_memory_read(struct fb_info *fbi,
+
+ vfree(buf);
+
+- omapfb_unlock(fbdev);
+-
+ return r;
+ }
+
+@@ -509,9 +472,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ break;
+ }
+
+- omapfb_lock(fbdev);
+ r = display->sync(display);
+- omapfb_unlock(fbdev);
+ break;
+
+ case OMAPFB_UPDATE_WINDOW_OLD:
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index dc9c06c..1473581 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -848,13 +848,10 @@ static int omapfb_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *fbi)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ int r = 0;
+
+ DBG("pan_display(%d)\n", ofbi->id);
+
+- omapfb_lock(fbdev);
+-
+ if (var->xoffset != fbi->var.xoffset ||
+ var->yoffset != fbi->var.yoffset) {
+ struct fb_var_screeninfo new_var;
+@@ -872,8 +869,6 @@ static int omapfb_pan_display(struct fb_var_screeninfo *var,
+ }
+ }
+
+- omapfb_unlock(fbdev);
+-
+ return r;
+ }
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+index a00f61a..ef30e0e 100644
+--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
++++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
+@@ -49,7 +49,6 @@ static ssize_t store_rotate_type(struct device *dev,
+ {
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ enum omap_dss_rotation_type rot_type;
+ int r;
+
+@@ -58,7 +57,7 @@ static ssize_t store_rotate_type(struct device *dev,
+ if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
+ return -EINVAL;
+
+- omapfb_lock(fbdev);
++ lock_fb_info(fbi);
+
+ r = 0;
+ if (rot_type == ofbi->rotation_type)
+@@ -76,7 +75,7 @@ static ssize_t store_rotate_type(struct device *dev,
+ * need to do any further parameter checking at this point.
+ */
+ out:
+- omapfb_unlock(fbdev);
++ unlock_fb_info(fbi);
+
+ return r ? r : count;
+ }
+@@ -97,7 +96,6 @@ static ssize_t store_mirror(struct device *dev,
+ {
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ bool mirror;
+ int r;
+ struct fb_var_screeninfo new_var;
+@@ -107,7 +105,7 @@ static ssize_t store_mirror(struct device *dev,
+ if (mirror != 0 && mirror != 1)
+ return -EINVAL;
+
+- omapfb_lock(fbdev);
++ lock_fb_info(fbi);
+
+ ofbi->mirror = mirror;
+
+@@ -125,7 +123,7 @@ static ssize_t store_mirror(struct device *dev,
+
+ r = count;
+ out:
+- omapfb_unlock(fbdev);
++ unlock_fb_info(fbi);
+
+ return r;
+ }
+@@ -139,6 +137,9 @@ static ssize_t show_overlays(struct device *dev,
+ ssize_t l = 0;
+ int t;
+
++ omapfb_lock(fbdev);
++ lock_fb_info(fbi);
++
+ for (t = 0; t < ofbi->num_overlays; t++) {
+ struct omap_overlay *ovl = ofbi->overlays[t];
+ int ovlnum;
+@@ -153,6 +154,9 @@ static ssize_t show_overlays(struct device *dev,
+
+ l += snprintf(buf + l, PAGE_SIZE - l, "\n");
+
++ unlock_fb_info(fbi);
++ omapfb_unlock(fbdev);
++
+ return l;
+ }
+
+@@ -192,6 +196,7 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+ len = len - 1;
+
+ omapfb_lock(fbdev);
++ lock_fb_info(fbi);
+
+ if (len > 0) {
+ char *p = (char *)buf;
+@@ -298,6 +303,7 @@ static ssize_t store_overlays(struct device *dev, struct device_attribute *attr,
+
+ r = count;
+ out:
++ unlock_fb_info(fbi);
+ omapfb_unlock(fbdev);
+
+ return r;
+@@ -311,6 +317,8 @@ static ssize_t show_overlays_rotate(struct device *dev,
+ ssize_t l = 0;
+ int t;
+
++ lock_fb_info(fbi);
++
+ for (t = 0; t < ofbi->num_overlays; t++) {
+ l += snprintf(buf + l, PAGE_SIZE - l, "%s%d",
+ t == 0 ? "" : ",", ofbi->rotation[t]);
+@@ -318,6 +326,8 @@ static ssize_t show_overlays_rotate(struct device *dev,
+
+ l += snprintf(buf + l, PAGE_SIZE - l, "\n");
+
++ unlock_fb_info(fbi);
++
+ return l;
+ }
+
+@@ -326,7 +336,6 @@ static ssize_t store_overlays_rotate(struct device *dev,
+ {
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ int num_ovls = 0, r, i;
+ int len;
+ bool changed = false;
+@@ -336,7 +345,7 @@ static ssize_t store_overlays_rotate(struct device *dev,
+ if (buf[len - 1] == '\n')
+ len = len - 1;
+
+- omapfb_lock(fbdev);
++ lock_fb_info(fbi);
+
+ if (len > 0) {
+ char *p = (char *)buf;
+@@ -382,7 +391,7 @@ static ssize_t store_overlays_rotate(struct device *dev,
+
+ r = count;
+ out:
+- omapfb_unlock(fbdev);
++ unlock_fb_info(fbi);
+
+ return r;
+ }
+@@ -401,14 +410,13 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
+ {
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+- struct omapfb2_device *fbdev = ofbi->fbdev;
+ unsigned long size;
+ int r;
+ int i;
+
+ size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0));
+
+- omapfb_lock(fbdev);
++ lock_fb_info(fbi);
+
+ for (i = 0; i < ofbi->num_overlays; i++) {
+ if (ofbi->overlays[i]->info.enabled) {
+@@ -427,7 +435,7 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
+
+ r = count;
+ out:
+- omapfb_unlock(fbdev);
++ unlock_fb_info(fbi);
+
+ return r;
+ }
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0120-DSS2-DISPC-configuration-management.patch b/recipes/linux/linux-omap-pm/dss2/0120-DSS2-DISPC-configuration-management.patch
new file mode 100644
index 0000000000..ef94abfd0c
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0120-DSS2-DISPC-configuration-management.patch
@@ -0,0 +1,2006 @@
+From 43e7fcaa40dd3726bda3317b8419d4be4e73dbfb Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 12 Jun 2009 10:55:49 +0300
+Subject: [PATCH 120/146] DSS2: DISPC configuration management
+
+This commit implements caching and synchronization of DISPC shadow
+registers.
+
+I had to disable fifomerging, enabling it needs more thought and
+work.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 30 +-
+ drivers/video/omap2/dss/dispc.c | 307 ++--------
+ drivers/video/omap2/dss/display.c | 21 +-
+ drivers/video/omap2/dss/dsi.c | 41 +-
+ drivers/video/omap2/dss/dss.h | 19 +-
+ drivers/video/omap2/dss/manager.c | 933 ++++++++++++++++++++++++++---
+ drivers/video/omap2/dss/overlay.c | 64 ++-
+ drivers/video/omap2/dss/rfbi.c | 2 +-
+ drivers/video/omap2/dss/venc.c | 10 +
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 26 +
+ include/linux/omapfb.h | 1 +
+ 11 files changed, 1047 insertions(+), 407 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 0695497..be07c35 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -275,13 +275,19 @@ struct omap_overlay {
+ struct kobject kobj;
+ struct list_head list;
+
++ /* static fields */
+ const char *name;
+ int id;
+- struct omap_overlay_manager *manager;
+ enum omap_color_mode supported_modes;
+- struct omap_overlay_info info;
+ enum omap_overlay_caps caps;
+
++ /* dynamic fields */
++ struct omap_overlay_manager *manager;
++ struct omap_overlay_info info;
++
++ /* if true, info has been changed, but not applied() yet */
++ bool info_dirty;
++
+ int (*set_manager)(struct omap_overlay *ovl,
+ struct omap_overlay_manager *mgr);
+ int (*unset_manager)(struct omap_overlay *ovl);
+@@ -290,6 +296,8 @@ struct omap_overlay {
+ struct omap_overlay_info *info);
+ void (*get_overlay_info)(struct omap_overlay *ovl,
+ struct omap_overlay_info *info);
++
++ int (*wait_for_go)(struct omap_overlay *ovl);
+ };
+
+ struct omap_overlay_manager_info {
+@@ -306,25 +314,33 @@ struct omap_overlay_manager {
+ struct kobject kobj;
+ struct list_head list;
+
++ /* static fields */
+ const char *name;
+ int id;
+ enum omap_overlay_manager_caps caps;
+- struct omap_overlay_manager_info info;
+- struct omap_dss_device *device;
+ int num_overlays;
+ struct omap_overlay **overlays;
+ enum omap_display_type supported_displays;
+
++ /* dynamic fields */
++ struct omap_dss_device *device;
++ struct omap_overlay_manager_info info;
++
++ bool device_changed;
++ /* if true, info has been changed but not applied() yet */
++ bool info_dirty;
++
+ int (*set_device)(struct omap_overlay_manager *mgr,
+ struct omap_dss_device *dssdev);
+ int (*unset_device)(struct omap_overlay_manager *mgr);
+
+- int (*apply)(struct omap_overlay_manager *mgr);
+-
+ int (*set_manager_info)(struct omap_overlay_manager *mgr,
+ struct omap_overlay_manager_info *info);
+ void (*get_manager_info)(struct omap_overlay_manager *mgr,
+ struct omap_overlay_manager_info *info);
++
++ int (*apply)(struct omap_overlay_manager *mgr);
++ int (*wait_for_go)(struct omap_overlay_manager *mgr);
+ };
+
+ struct omap_dss_device {
+@@ -450,8 +466,6 @@ struct omap_dss_device {
+ void *buf, size_t size,
+ u16 x, u16 y, u16 w, u16 h);
+
+- void (*configure_overlay)(struct omap_overlay *overlay);
+-
+ int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
+ u32 (*get_wss)(struct omap_dss_device *dssdev);
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 4e1da6b..d061d75 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -158,6 +158,8 @@ static struct {
+ unsigned long cache_prate;
+ struct dispc_clock_info cache_cinfo;
+
++ u32 fifo_size[3];
++
+ spinlock_t irq_lock;
+ u32 irq_error_mask;
+ struct omap_dispc_isr_data registered_isr[DISPC_MAX_NR_ISRS];
+@@ -479,10 +481,21 @@ static inline void enable_clocks(bool enable)
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+ }
+
++bool dispc_go_busy(enum omap_channel channel)
++{
++ int bit;
++
++ if (channel == OMAP_DSS_CHANNEL_LCD)
++ bit = 5; /* GOLCD */
++ else
++ bit = 6; /* GODIGIT */
++
++ return REG_GET(DISPC_CONTROL, bit, bit) == 1;
++}
++
+ void dispc_go(enum omap_channel channel)
+ {
+ int bit;
+- unsigned long tmo;
+
+ enable_clocks(1);
+
+@@ -500,13 +513,9 @@ void dispc_go(enum omap_channel channel)
+ else
+ bit = 6; /* GODIGIT */
+
+- tmo = jiffies + msecs_to_jiffies(200);
+- while (REG_GET(DISPC_CONTROL, bit, bit) == 1) {
+- if (time_after(jiffies, tmo)) {
+- DSSERR("timeout waiting GO flag\n");
+- goto end;
+- }
+- cpu_relax();
++ if (REG_GET(DISPC_CONTROL, bit, bit) == 1) {
++ DSSERR("GO bit not down for channel %d\n", channel);
++ goto end;
+ }
+
+ DSSDBG("GO %s\n", channel == OMAP_DSS_CHANNEL_LCD ? "LCD" : "DIGIT");
+@@ -942,31 +951,33 @@ void dispc_set_digit_size(u16 width, u16 height)
+ enable_clocks(0);
+ }
+
+-u32 dispc_get_plane_fifo_size(enum omap_plane plane)
++static void dispc_read_plane_fifo_sizes(void)
+ {
+ const struct dispc_reg fsz_reg[] = { DISPC_GFX_FIFO_SIZE_STATUS,
+ DISPC_VID_FIFO_SIZE_STATUS(0),
+ DISPC_VID_FIFO_SIZE_STATUS(1) };
+ u32 size;
++ int plane;
+
+ enable_clocks(1);
+
+- if (cpu_is_omap24xx())
+- size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 8, 0);
+- else if (cpu_is_omap34xx())
+- size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 10, 0);
+- else
+- BUG();
++ for (plane = 0; plane < ARRAY_SIZE(dispc.fifo_size); ++plane) {
++ if (cpu_is_omap24xx())
++ size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 8, 0);
++ else if (cpu_is_omap34xx())
++ size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 10, 0);
++ else
++ BUG();
+
+- if (cpu_is_omap34xx()) {
+- /* FIFOMERGE */
+- if (REG_GET(DISPC_CONFIG, 14, 14))
+- size *= 3;
++ dispc.fifo_size[plane] = size;
+ }
+
+ enable_clocks(0);
++}
+
+- return size;
++u32 dispc_get_plane_fifo_size(enum omap_plane plane)
++{
++ return dispc.fifo_size[plane];
+ }
+
+ void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high)
+@@ -974,16 +985,10 @@ void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high)
+ const struct dispc_reg ftrs_reg[] = { DISPC_GFX_FIFO_THRESHOLD,
+ DISPC_VID_FIFO_THRESHOLD(0),
+ DISPC_VID_FIFO_THRESHOLD(1) };
+- u32 size;
+-
+ enable_clocks(1);
+
+- size = dispc_get_plane_fifo_size(plane);
+-
+- BUG_ON(low > size || high > size);
+-
+- DSSDBG("fifo(%d) size %d, low/high old %u/%u, new %u/%u\n",
+- plane, size,
++ DSSDBG("fifo(%d) low/high old %u/%u, new %u/%u\n",
++ plane,
+ REG_GET(ftrs_reg[plane], 11, 0),
+ REG_GET(ftrs_reg[plane], 27, 16),
+ low, high);
+@@ -1480,8 +1485,14 @@ static unsigned long calc_fclk(u16 width, u16 height,
+ return dispc_pclk_rate() * vf * hf;
+ }
+
++void dispc_set_channel_out(enum omap_plane plane, enum omap_channel channel_out)
++{
++ enable_clocks(1);
++ _dispc_set_channel_out(plane, channel_out);
++ enable_clocks(0);
++}
++
+ static int _dispc_setup_plane(enum omap_plane plane,
+- enum omap_channel channel_out,
+ u32 paddr, u16 screen_width,
+ u16 pos_x, u16 pos_y,
+ u16 width, u16 height,
+@@ -1631,7 +1642,6 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
+ offset0, offset1, row_inc, pix_inc);
+
+- _dispc_set_channel_out(plane, channel_out);
+ _dispc_set_color_mode(plane, color_mode);
+
+ _dispc_set_plane_ba0(plane, paddr + offset0);
+@@ -3068,6 +3078,8 @@ static void _omap_dispc_initial_config(void)
+ _dispc_setup_color_conv_coef();
+
+ dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);
++
++ dispc_read_plane_fifo_sizes();
+ }
+
+ int dispc_init(void)
+@@ -3127,7 +3139,7 @@ int dispc_enable_plane(enum omap_plane plane, bool enable)
+ return 0;
+ }
+
+-int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
++int dispc_setup_plane(enum omap_plane plane,
+ u32 paddr, u16 screen_width,
+ u16 pos_x, u16 pos_y,
+ u16 width, u16 height,
+@@ -3139,9 +3151,9 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ {
+ int r = 0;
+
+- DSSDBG("dispc_setup_plane %d, ch %d, pa %x, sw %d, %d,%d, %dx%d -> "
++ DSSDBG("dispc_setup_plane %d, pa %x, sw %d, %d,%d, %dx%d -> "
+ "%dx%d, ilace %d, cmode %x, rot %d, mir %d\n",
+- plane, channel_out, paddr, screen_width, pos_x, pos_y,
++ plane, paddr, screen_width, pos_x, pos_y,
+ width, height,
+ out_width, out_height,
+ ilace, color_mode,
+@@ -3149,7 +3161,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+
+ enable_clocks(1);
+
+- r = _dispc_setup_plane(plane, channel_out,
++ r = _dispc_setup_plane(plane,
+ paddr, screen_width,
+ pos_x, pos_y,
+ width, height,
+@@ -3163,230 +3175,3 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+
+ return r;
+ }
+-
+-static int dispc_is_intersecting(int x1, int y1, int w1, int h1,
+- int x2, int y2, int w2, int h2)
+-{
+- if (x1 >= (x2+w2))
+- return 0;
+-
+- if ((x1+w1) <= x2)
+- return 0;
+-
+- if (y1 >= (y2+h2))
+- return 0;
+-
+- if ((y1+h1) <= y2)
+- return 0;
+-
+- return 1;
+-}
+-
+-static int dispc_is_overlay_scaled(struct omap_overlay_info *pi)
+-{
+- if (pi->width != pi->out_width)
+- return 1;
+-
+- if (pi->height != pi->out_height)
+- return 1;
+-
+- return 0;
+-}
+-
+-/* returns the area that needs updating */
+-void dispc_setup_partial_planes(struct omap_dss_device *dssdev,
+- u16 *xi, u16 *yi, u16 *wi, u16 *hi)
+-{
+- struct omap_overlay_manager *mgr;
+- int i;
+-
+- int x, y, w, h;
+-
+- x = *xi;
+- y = *yi;
+- w = *wi;
+- h = *hi;
+-
+- DSSDBG("dispc_setup_partial_planes %d,%d %dx%d\n",
+- *xi, *yi, *wi, *hi);
+-
+-
+- mgr = dssdev->manager;
+-
+- if (!mgr) {
+- DSSDBG("no manager\n");
+- return;
+- }
+-
+- for (i = 0; i < mgr->num_overlays; i++) {
+- struct omap_overlay *ovl;
+- struct omap_overlay_info *pi;
+- ovl = mgr->overlays[i];
+-
+- if (ovl->manager != mgr)
+- continue;
+-
+- if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0)
+- continue;
+-
+- pi = &ovl->info;
+-
+- if (!pi->enabled)
+- continue;
+- /*
+- * If the plane is intersecting and scaled, we
+- * enlarge the update region to accomodate the
+- * whole area
+- */
+-
+- if (dispc_is_intersecting(x, y, w, h,
+- pi->pos_x, pi->pos_y,
+- pi->out_width, pi->out_height)) {
+- if (dispc_is_overlay_scaled(pi)) {
+-
+- int x1, y1, x2, y2;
+-
+- if (x > pi->pos_x)
+- x1 = pi->pos_x;
+- else
+- x1 = x;
+-
+- if (y > pi->pos_y)
+- y1 = pi->pos_y;
+- else
+- y1 = y;
+-
+- if ((x + w) < (pi->pos_x + pi->out_width))
+- x2 = pi->pos_x + pi->out_width;
+- else
+- x2 = x + w;
+-
+- if ((y + h) < (pi->pos_y + pi->out_height))
+- y2 = pi->pos_y + pi->out_height;
+- else
+- y2 = y + h;
+-
+- x = x1;
+- y = y1;
+- w = x2 - x1;
+- h = y2 - y1;
+-
+- DSSDBG("Update area after enlarge due to "
+- "scaling %d, %d %dx%d\n",
+- x, y, w, h);
+- }
+- }
+- }
+-
+- for (i = 0; i < mgr->num_overlays; i++) {
+- struct omap_overlay *ovl = mgr->overlays[i];
+- struct omap_overlay_info *pi = &ovl->info;
+-
+- int px = pi->pos_x;
+- int py = pi->pos_y;
+- int pw = pi->width;
+- int ph = pi->height;
+- int pow = pi->out_width;
+- int poh = pi->out_height;
+- u32 pa = pi->paddr;
+- int psw = pi->screen_width;
+- int bpp;
+-
+- if (ovl->manager != mgr)
+- continue;
+-
+- /*
+- * If plane is not enabled or the update region
+- * does not intersect with the plane in question,
+- * we really disable the plane from hardware
+- */
+-
+- if (!pi->enabled ||
+- !dispc_is_intersecting(x, y, w, h,
+- px, py, pow, poh)) {
+- dispc_enable_plane(ovl->id, 0);
+- continue;
+- }
+-
+- switch (pi->color_mode) {
+- case OMAP_DSS_COLOR_RGB16:
+- case OMAP_DSS_COLOR_ARGB16:
+- case OMAP_DSS_COLOR_YUV2:
+- case OMAP_DSS_COLOR_UYVY:
+- bpp = 16;
+- break;
+-
+- case OMAP_DSS_COLOR_RGB24P:
+- bpp = 24;
+- break;
+-
+- case OMAP_DSS_COLOR_RGB24U:
+- case OMAP_DSS_COLOR_ARGB32:
+- case OMAP_DSS_COLOR_RGBA32:
+- case OMAP_DSS_COLOR_RGBX32:
+- bpp = 32;
+- break;
+-
+- default:
+- BUG();
+- return;
+- }
+-
+- if (x > pi->pos_x) {
+- px = 0;
+- pw -= (x - pi->pos_x);
+- pa += (x - pi->pos_x) * bpp / 8;
+- } else {
+- px = pi->pos_x - x;
+- }
+-
+- if (y > pi->pos_y) {
+- py = 0;
+- ph -= (y - pi->pos_y);
+- pa += (y - pi->pos_y) * psw * bpp / 8;
+- } else {
+- py = pi->pos_y - y;
+- }
+-
+- if (w < (px+pw))
+- pw -= (px+pw) - (w);
+-
+- if (h < (py+ph))
+- ph -= (py+ph) - (h);
+-
+- /* Can't scale the GFX plane */
+- if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0 ||
+- dispc_is_overlay_scaled(pi) == 0) {
+- pow = pw;
+- poh = ph;
+- }
+-
+- DSSDBG("calc plane %d, %x, sw %d, %d,%d, %dx%d -> %dx%d\n",
+- ovl->id, pa, psw, px, py, pw, ph, pow, poh);
+-
+- dispc_setup_plane(ovl->id, mgr->id,
+- pa, psw,
+- px, py,
+- pw, ph,
+- pow, poh,
+- pi->color_mode, 0,
+- pi->rotation_type,
+- pi->rotation,
+- pi->mirror,
+- pi->global_alpha);
+-
+- if (dss_use_replication(dssdev, ovl->info.color_mode))
+- dispc_enable_replication(ovl->id, true);
+- else
+- dispc_enable_replication(ovl->id, false);
+-
+- dispc_enable_plane(ovl->id, 1);
+- }
+-
+- *xi = x;
+- *yi = y;
+- *wi = w;
+- *hi = h;
+-
+-}
+-
+diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
+index 1242c39..6b5d0cf 100644
+--- a/drivers/video/omap2/dss/display.c
++++ b/drivers/video/omap2/dss/display.c
+@@ -310,21 +310,17 @@ static void default_get_resolution(struct omap_dss_device *dssdev,
+ *yres = dssdev->panel.timings.y_res;
+ }
+
+-static void default_configure_overlay(struct omap_overlay *ovl)
++void default_get_overlay_fifo_thresholds(enum omap_plane plane,
++ u32 fifo_size, enum omap_burst_size *burst_size,
++ u32 *fifo_low, u32 *fifo_high)
+ {
+- unsigned low, high, size;
+- enum omap_burst_size burst;
+- enum omap_plane plane = ovl->id;
++ unsigned burst_size_bytes;
+
+- burst = OMAP_DSS_BURST_16x32;
+- size = 16 * 32 / 8;
++ *burst_size = OMAP_DSS_BURST_16x32;
++ burst_size_bytes = 16 * 32 / 8;
+
+- dispc_set_burst_size(plane, burst);
+-
+- high = dispc_get_plane_fifo_size(plane) - 1;
+- low = dispc_get_plane_fifo_size(plane) - size;
+-
+- dispc_setup_plane_fifo(plane, low, high);
++ *fifo_high = fifo_size - 1;
++ *fifo_low = fifo_size - burst_size_bytes;
+ }
+
+ static int default_wait_vsync(struct omap_dss_device *dssdev)
+@@ -431,7 +427,6 @@ void dss_init_device(struct platform_device *pdev,
+
+ dssdev->get_resolution = default_get_resolution;
+ dssdev->get_recommended_bpp = default_get_recommended_bpp;
+- dssdev->configure_overlay = default_configure_overlay;
+ dssdev->wait_vsync = default_wait_vsync;
+
+ switch (dssdev->type) {
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index ffac77b..875be0c 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2566,7 +2566,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+
+ dispc_disable_sidle();
+
+- dispc_enable_lcd_out(1);
++ dss_start_update(dssdev);
+
+ if (use_te_trigger)
+ dsi_vc_send_bta(1);
+@@ -2606,12 +2606,19 @@ static void dsi_set_update_region(struct omap_dss_device *dssdev,
+ static void dsi_start_auto_update(struct omap_dss_device *dssdev)
+ {
+ u16 w, h;
++ int i;
+
+ DSSDBG("starting auto update\n");
+
+ /* In automatic mode the overlay settings are applied like on DPI/SDI.
+- * The overlay settings may not have been applied, if we were in manual
+- * mode earlier, so do it here */
++ * Mark the overlays dirty, so that we get the overlays configured, as
++ * manual mode has left them in bad shape after config partia planes */
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_overlay *ovl;
++ ovl = omap_dss_get_overlay(i);
++ if (ovl->manager == dssdev->manager)
++ ovl->info_dirty = true;
++ }
+ dssdev->manager->apply(dssdev->manager);
+
+ dssdev->get_resolution(dssdev, &w, &h);
+@@ -2732,7 +2739,7 @@ static int dsi_update_thread(void *data)
+ if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+
+ if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL) {
+- dispc_setup_partial_planes(device,
++ dss_setup_partial_planes(device,
+ &x, &y, &w, &h);
+ #if 1
+ /* XXX there seems to be a bug in this driver
+@@ -2741,12 +2748,13 @@ static int dsi_update_thread(void *data)
+ * are always odd, so "fix" it here for now */
+ if (w & 1) {
+ u16 dw, dh;
+- device->get_resolution(device, &dw, &dh);
++ device->get_resolution(device,
++ &dw, &dh);
+ if (x + w == dw)
+ x &= ~1;
+ ++w;
+
+- dispc_setup_partial_planes(device,
++ dss_setup_partial_planes(device,
+ &x, &y, &w, &h);
+ }
+ #endif
+@@ -3361,20 +3369,17 @@ static int dsi_display_memory_read(struct omap_dss_device *dssdev,
+ return r;
+ }
+
+-static void dsi_configure_overlay(struct omap_overlay *ovl)
++void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
++ u32 fifo_size, enum omap_burst_size *burst_size,
++ u32 *fifo_low, u32 *fifo_high)
+ {
+- unsigned low, high, size;
+- enum omap_burst_size burst;
+- enum omap_plane plane = ovl->id;
++ unsigned burst_size_bytes;
+
+- burst = OMAP_DSS_BURST_16x32;
+- size = 16 * 32 / 8;
++ *burst_size = OMAP_DSS_BURST_16x32;
++ burst_size_bytes = 16 * 32 / 8;
+
+- dispc_set_burst_size(plane, burst);
+-
+- high = dispc_get_plane_fifo_size(plane) - size;
+- low = 0;
+- dispc_setup_plane_fifo(plane, low, high);
++ *fifo_high = fifo_size - burst_size_bytes;
++ *fifo_low = 0;
+ }
+
+ int dsi_init_display(struct omap_dss_device *dssdev)
+@@ -3401,8 +3406,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
+ dssdev->run_test = dsi_display_run_test;
+ dssdev->memory_read = dsi_display_memory_read;
+
+- dssdev->configure_overlay = dsi_configure_overlay;
+-
+ dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
+
+ dsi.vc[0].dssdev = dssdev;
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index 53f0f3d..50f7f5f 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -175,10 +175,17 @@ void dss_uninit_device(struct platform_device *pdev,
+ struct omap_dss_device *dssdev);
+ bool dss_use_replication(struct omap_dss_device *dssdev,
+ enum omap_color_mode mode);
++void default_get_overlay_fifo_thresholds(enum omap_plane plane,
++ u32 fifo_size, enum omap_burst_size *burst_size,
++ u32 *fifo_low, u32 *fifo_high);
+
+ /* manager */
+ int dss_init_overlay_managers(struct platform_device *pdev);
+ void dss_uninit_overlay_managers(struct platform_device *pdev);
++int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl);
++void dss_setup_partial_planes(struct omap_dss_device *dssdev,
++ u16 *x, u16 *y, u16 *w, u16 *h);
++void dss_start_update(struct omap_dss_device *dssdev);
+
+ /* overlay */
+ void dss_init_overlays(struct platform_device *pdev);
+@@ -233,6 +240,9 @@ int dsi_pll_calc_pck(bool is_tft, unsigned long req_pck,
+ int dsi_pll_program(struct dsi_clock_info *cinfo);
+ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv);
+ void dsi_pll_uninit(void);
++void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
++ u32 fifo_size, enum omap_burst_size *burst_size,
++ u32 *fifo_low, u32 *fifo_high);
+
+ /* DPI */
+ int dpi_init(void);
+@@ -270,8 +280,10 @@ void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
+ void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
+ void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
+ void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
++void dispc_set_channel_out(enum omap_plane plane,
++ enum omap_channel channel_out);
+
+-int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
++int dispc_setup_plane(enum omap_plane plane,
+ u32 paddr, u16 screen_width,
+ u16 pos_x, u16 pos_y,
+ u16 width, u16 height,
+@@ -282,6 +294,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
+ u8 rotation, bool mirror,
+ u8 global_alpha);
+
++bool dispc_go_busy(enum omap_channel channel);
+ void dispc_go(enum omap_channel channel);
+ void dispc_enable_lcd_out(bool enable);
+ void dispc_enable_digit_out(bool enable);
+@@ -320,10 +333,6 @@ int dispc_set_clock_div(struct dispc_clock_info *cinfo);
+ int dispc_get_clock_div(struct dispc_clock_info *cinfo);
+ void dispc_set_lcd_divisor(u16 lck_div, u16 pck_div);
+
+-void dispc_setup_partial_planes(struct omap_dss_device *dssdev,
+- u16 *x, u16 *y, u16 *w, u16 *h);
+-void dispc_draw_partial_planes(struct omap_dss_device *dssdev);
+-
+
+ /* VENC */
+ int venc_init(struct platform_device *pdev);
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 0b0c51e..7b8e556 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -25,8 +25,11 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/jiffies.h>
+
+ #include <mach/display.h>
++#include <mach/cpu.h>
+
+ #include "dss.h"
+
+@@ -348,6 +351,106 @@ static struct kobj_type manager_ktype = {
+ .default_attrs = manager_sysfs_attrs,
+ };
+
++/*
++ * We have 4 levels of cache for the dispc settings. First two are in SW and
++ * the latter two in HW.
++ *
++ * +--------------------+
++ * |overlay/manager_info|
++ * +--------------------+
++ * v
++ * apply()
++ * v
++ * +--------------------+
++ * | dss_cache |
++ * +--------------------+
++ * v
++ * configure()
++ * v
++ * +--------------------+
++ * | shadow registers |
++ * +--------------------+
++ * v
++ * VFP or lcd/digit_enable
++ * v
++ * +--------------------+
++ * | registers |
++ * +--------------------+
++ */
++
++struct overlay_cache_data {
++ /* If true, cache changed, but not written to shadow registers. Set
++ * in apply(), cleared when registers written. */
++ bool dirty;
++ /* If true, shadow registers contain changed values not yet in real
++ * registers. Set when writing to shadow registers, cleared at
++ * VSYNC/EVSYNC */
++ bool shadow_dirty;
++
++ bool enabled;
++
++ u32 paddr;
++ void __iomem *vaddr;
++ u16 screen_width;
++ u16 width;
++ u16 height;
++ enum omap_color_mode color_mode;
++ u8 rotation;
++ enum omap_dss_rotation_type rotation_type;
++ bool mirror;
++
++ u16 pos_x;
++ u16 pos_y;
++ u16 out_width; /* if 0, out_width == width */
++ u16 out_height; /* if 0, out_height == height */
++ u8 global_alpha;
++
++ enum omap_channel channel;
++ bool replication;
++ bool ilace;
++
++ enum omap_burst_size burst_size;
++ u32 fifo_low;
++ u32 fifo_high;
++
++ bool manual_update;
++};
++
++struct manager_cache_data {
++ /* If true, cache changed, but not written to shadow registers. Set
++ * in apply(), cleared when registers written. */
++ bool dirty;
++ /* If true, shadow registers contain changed values not yet in real
++ * registers. Set when writing to shadow registers, cleared at
++ * VSYNC/EVSYNC */
++ bool shadow_dirty;
++
++ u32 default_color;
++
++ enum omap_dss_trans_key_type trans_key_type;
++ u32 trans_key;
++ bool trans_enabled;
++
++ bool alpha_enabled;
++
++ bool manual_upd_display;
++ bool manual_update;
++ bool do_manual_update;
++
++ /* manual update region */
++ u16 x, y, w, h;
++};
++
++static struct {
++ spinlock_t lock;
++ struct overlay_cache_data overlay_cache[3];
++ struct manager_cache_data manager_cache[2];
++
++ bool irq_enabled;
++} dss_cache;
++
++
++
+ static int omap_dss_set_device(struct omap_overlay_manager *mgr,
+ struct omap_dss_device *dssdev)
+ {
+@@ -379,6 +482,7 @@ static int omap_dss_set_device(struct omap_overlay_manager *mgr,
+
+ dssdev->manager = mgr;
+ mgr->device = dssdev;
++ mgr->device_changed = true;
+
+ return 0;
+ }
+@@ -392,154 +496,814 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
+
+ mgr->device->manager = NULL;
+ mgr->device = NULL;
++ mgr->device_changed = true;
+
+ return 0;
+ }
+
++static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
++{
++ unsigned long timeout = msecs_to_jiffies(500);
++ struct manager_cache_data *mc;
++ enum omap_channel channel;
++ u32 irq;
++ int r;
++ int i;
++
++ if (!mgr->device)
++ return 0;
++
++ if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) {
++ irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
++ channel = OMAP_DSS_CHANNEL_DIGIT;
++ } else {
++ if (mgr->device->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
++ enum omap_dss_update_mode mode;
++ mode = mgr->device->get_update_mode(mgr->device);
++ if (mode != OMAP_DSS_UPDATE_AUTO)
++ return 0;
++
++ irq = DISPC_IRQ_FRAMEDONE;
++ } else {
++ irq = DISPC_IRQ_VSYNC;
++ }
++ channel = OMAP_DSS_CHANNEL_LCD;
++ }
++
++ mc = &dss_cache.manager_cache[mgr->id];
++ i = 0;
++ while (1) {
++ unsigned long flags;
++ bool shadow_dirty, dirty;
++
++ spin_lock_irqsave(&dss_cache.lock, flags);
++ dirty = mc->dirty;
++ shadow_dirty = mc->shadow_dirty;
++ spin_unlock_irqrestore(&dss_cache.lock, flags);
++
++ if (!dirty && !shadow_dirty) {
++ r = 0;
++ break;
++ }
++
++ /* 4 iterations is the worst case:
++ * 1 - initial iteration, dirty = true (between VFP and VSYNC)
++ * 2 - first VSYNC, dirty = true
++ * 3 - dirty = false, shadow_dirty = true
++ * 4 - shadow_dirty = false */
++ if (i++ == 3) {
++ DSSERR("mgr(%d)->wait_for_go() not finishing\n",
++ mgr->id);
++ r = 0;
++ break;
++ }
++
++ r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
++ if (r == -ERESTARTSYS)
++ break;
++
++ if (r) {
++ DSSERR("mgr(%d)->wait_for_go() timeout\n", mgr->id);
++ break;
++ }
++ }
++
++ return r;
++}
++
++int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
++{
++ unsigned long timeout = msecs_to_jiffies(500);
++ enum omap_channel channel;
++ struct overlay_cache_data *oc;
++ struct omap_dss_device *dssdev;
++ u32 irq;
++ int r;
++ int i;
++
++ if (!ovl->manager || !ovl->manager->device)
++ return 0;
++
++ dssdev = ovl->manager->device;
++
++ if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) {
++ irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
++ channel = OMAP_DSS_CHANNEL_DIGIT;
++ } else {
++ if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
++ enum omap_dss_update_mode mode;
++ mode = dssdev->get_update_mode(dssdev);
++ if (mode != OMAP_DSS_UPDATE_AUTO)
++ return 0;
++
++ irq = DISPC_IRQ_FRAMEDONE;
++ } else {
++ irq = DISPC_IRQ_VSYNC;
++ }
++ channel = OMAP_DSS_CHANNEL_LCD;
++ }
++
++ oc = &dss_cache.overlay_cache[ovl->id];
++ i = 0;
++ while (1) {
++ unsigned long flags;
++ bool shadow_dirty, dirty;
++
++ spin_lock_irqsave(&dss_cache.lock, flags);
++ dirty = oc->dirty;
++ shadow_dirty = oc->shadow_dirty;
++ spin_unlock_irqrestore(&dss_cache.lock, flags);
++
++ if (!dirty && !shadow_dirty) {
++ r = 0;
++ break;
++ }
++
++ /* 4 iterations is the worst case:
++ * 1 - initial iteration, dirty = true (between VFP and VSYNC)
++ * 2 - first VSYNC, dirty = true
++ * 3 - dirty = false, shadow_dirty = true
++ * 4 - shadow_dirty = false */
++ if (i++ == 3) {
++ DSSERR("ovl(%d)->wait_for_go() not finishing\n",
++ ovl->id);
++ r = 0;
++ break;
++ }
++
++ r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
++ if (r == -ERESTARTSYS)
++ break;
++
++ if (r) {
++ DSSERR("ovl(%d)->wait_for_go() timeout\n", ovl->id);
++ break;
++ }
++ }
++
++ return r;
++}
+
+ static int overlay_enabled(struct omap_overlay *ovl)
+ {
+ return ovl->info.enabled && ovl->manager && ovl->manager->device;
+ }
+
+-/* We apply settings to both managers here so that we can use optimizations
+- * like fifomerge. Shadow registers can be changed first and the non-shadowed
+- * should be changed last, at the same time with GO */
+-static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
++/* Is rect1 a subset of rect2? */
++static bool rectangle_subset(int x1, int y1, int w1, int h1,
++ int x2, int y2, int w2, int h2)
+ {
++ if (x1 < x2 || y1 < y2)
++ return false;
++
++ if (x1 + w1 > x2 + w2)
++ return false;
++
++ if (y1 + h1 > y2 + h2)
++ return false;
++
++ return true;
++}
++
++/* Do rect1 and rect2 overlap? */
++static bool rectangle_intersects(int x1, int y1, int w1, int h1,
++ int x2, int y2, int w2, int h2)
++{
++ if (x1 >= x2 + w2)
++ return false;
++
++ if (x2 >= x1 + w1)
++ return false;
++
++ if (y1 >= y2 + h2)
++ return false;
++
++ if (y2 >= y1 + h1)
++ return false;
++
++ return true;
++}
++
++static bool dispc_is_overlay_scaled(struct overlay_cache_data *oc)
++{
++ if (oc->out_width != 0 && oc->width != oc->out_width)
++ return true;
++
++ if (oc->out_height != 0 && oc->height != oc->out_height)
++ return true;
++
++ return false;
++}
++
++static int configure_overlay(enum omap_plane plane)
++{
++ struct overlay_cache_data *c;
++ struct manager_cache_data *mc;
++ u16 outw, outh;
++ u16 x, y, w, h;
++ u32 paddr;
++ int r;
++
++ DSSDBGF("%d", plane);
++
++ c = &dss_cache.overlay_cache[plane];
++
++ if (!c->enabled) {
++ dispc_enable_plane(plane, 0);
++ return 0;
++ }
++
++ mc = &dss_cache.manager_cache[c->channel];
++
++ x = c->pos_x;
++ y = c->pos_y;
++ w = c->width;
++ h = c->height;
++ outw = c->out_width == 0 ? c->width : c->out_width;
++ outh = c->out_height == 0 ? c->height : c->out_height;
++ paddr = c->paddr;
++
++ if (c->manual_update && mc->do_manual_update) {
++ unsigned bpp;
++ /* If the overlay is outside the update region, disable it */
++ if (!rectangle_intersects(mc->x, mc->y, mc->w, mc->h,
++ x, y, outw, outh)) {
++ dispc_enable_plane(plane, 0);
++ return 0;
++ }
++
++ switch (c->color_mode) {
++ case OMAP_DSS_COLOR_RGB16:
++ case OMAP_DSS_COLOR_ARGB16:
++ case OMAP_DSS_COLOR_YUV2:
++ case OMAP_DSS_COLOR_UYVY:
++ bpp = 16;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24P:
++ bpp = 24;
++ break;
++
++ case OMAP_DSS_COLOR_RGB24U:
++ case OMAP_DSS_COLOR_ARGB32:
++ case OMAP_DSS_COLOR_RGBA32:
++ case OMAP_DSS_COLOR_RGBX32:
++ bpp = 32;
++ break;
++
++ default:
++ BUG();
++ }
++
++ if (mc->x > c->pos_x) {
++ x = 0;
++ w -= (mc->x - c->pos_x);
++ paddr += (mc->x - c->pos_x) * bpp / 8;
++ } else {
++ x = c->pos_x - mc->x;
++ }
++
++ if (mc->y > c->pos_y) {
++ y = 0;
++ h -= (mc->y - c->pos_y);
++ paddr += (mc->y - c->pos_y) * c->screen_width * bpp / 8;
++ } else {
++ y = c->pos_y - mc->y;
++ }
++
++ if (mc->w < (x+w))
++ w -= (x+w) - (mc->w);
++
++ if (mc->h < (y+h))
++ h -= (y+h) - (mc->h);
++
++ if (!dispc_is_overlay_scaled(c)) {
++ outw = w;
++ outh = h;
++ }
++ }
++
++ r = dispc_setup_plane(plane,
++ paddr,
++ c->screen_width,
++ x, y,
++ w, h,
++ outw, outh,
++ c->color_mode,
++ c->ilace,
++ c->rotation_type,
++ c->rotation,
++ c->mirror,
++ c->global_alpha);
++
++ if (r) {
++ /* this shouldn't happen */
++ DSSERR("dispc_setup_plane failed for ovl %d\n", plane);
++ dispc_enable_plane(plane, 0);
++ return r;
++ }
++
++ dispc_enable_replication(plane, c->replication);
++
++ dispc_set_burst_size(plane, c->burst_size);
++ dispc_setup_plane_fifo(plane, c->fifo_low, c->fifo_high);
++
++ dispc_enable_plane(plane, 1);
++
++ return 0;
++}
++
++static void configure_manager(enum omap_channel channel)
++{
++ struct manager_cache_data *c;
++
++ DSSDBGF("%d", channel);
++
++ c = &dss_cache.manager_cache[channel];
++
++ dispc_set_trans_key(channel, c->trans_key_type, c->trans_key);
++ dispc_enable_trans_key(channel, c->trans_enabled);
++ dispc_enable_alpha_blending(channel, c->alpha_enabled);
++}
++
++/* configure_dispc() tries to write values from cache to shadow registers.
++ * It writes only to those managers/overlays that are not busy.
++ * returns 0 if everything could be written to shadow registers.
++ * returns 1 if not everything could be written to shadow registers. */
++static int configure_dispc(void)
++{
++ struct overlay_cache_data *oc;
++ struct manager_cache_data *mc;
++ const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache);
++ const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache);
+ int i;
+- int ret = 0;
+- enum omap_dss_update_mode mode;
+- struct omap_dss_device *dssdev;
+- struct omap_overlay *ovl;
+- bool ilace;
+- int outw, outh;
+ int r;
+- int num_planes_enabled = 0;
++ bool mgr_busy[2];
++ bool mgr_go[2];
++ bool busy;
+
+- DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
++ r = 0;
++ busy = false;
+
+- dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ mgr_busy[0] = dispc_go_busy(0);
++ mgr_busy[1] = dispc_go_busy(1);
++ mgr_go[0] = false;
++ mgr_go[1] = false;
+
+- /* Configure normal overlay parameters and disable unused overlays */
+- for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+- ovl = omap_dss_get_overlay(i);
++ /* Commit overlay settings */
++ for (i = 0; i < num_ovls; ++i) {
++ oc = &dss_cache.overlay_cache[i];
++ mc = &dss_cache.manager_cache[oc->channel];
+
+- if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++ if (!oc->dirty)
+ continue;
+
+- if (!overlay_enabled(ovl)) {
+- dispc_enable_plane(ovl->id, 0);
++ if (oc->manual_update && !mc->do_manual_update)
++ continue;
++
++ if (mgr_busy[oc->channel]) {
++ busy = true;
+ continue;
+ }
+
+- dssdev = ovl->manager->device;
++ r = configure_overlay(i);
++ if (r)
++ DSSERR("configure_overlay %d failed\n", i);
+
+- if (dss_check_overlay(ovl, dssdev)) {
+- dispc_enable_plane(ovl->id, 0);
++ oc->dirty = false;
++ oc->shadow_dirty = true;
++ mgr_go[oc->channel] = true;
++ }
++
++ /* Commit manager settings */
++ for (i = 0; i < num_mgrs; ++i) {
++ mc = &dss_cache.manager_cache[i];
++
++ if (!mc->dirty)
++ continue;
++
++ if (mc->manual_update && !mc->do_manual_update)
++ continue;
++
++ if (mgr_busy[i]) {
++ busy = true;
+ continue;
+ }
+
+- ++num_planes_enabled;
++ configure_manager(i);
++ mc->dirty = false;
++ mc->shadow_dirty = true;
++ mgr_go[i] = true;
++ }
+
+- /* On a manual update display, in manual update mode, update()
+- * handles configuring planes */
+- mode = OMAP_DSS_UPDATE_AUTO;
+- if (dssdev->get_update_mode)
+- mode = dssdev->get_update_mode(dssdev);
++ /* set GO */
++ for (i = 0; i < num_mgrs; ++i) {
++ mc = &dss_cache.manager_cache[i];
+
+- if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
+- mode != OMAP_DSS_UPDATE_AUTO)
++ if (!mgr_go[i])
+ continue;
+
+- ilace = dssdev->type == OMAP_DISPLAY_TYPE_VENC;
++ /* We don't need GO with manual update display. LCD iface will
++ * always be turned off after frame, and new settings will be
++ * taken in to use at next update */
++ if (!mc->manual_upd_display)
++ dispc_go(i);
++ }
++
++ if (busy)
++ r = 1;
++ else
++ r = 0;
++
++ return r;
++}
+
+- if (ovl->info.out_width == 0)
+- outw = ovl->info.width;
++/* Configure dispc for partial update. Return possibly modified update
++ * area */
++void dss_setup_partial_planes(struct omap_dss_device *dssdev,
++ u16 *xi, u16 *yi, u16 *wi, u16 *hi)
++{
++ struct overlay_cache_data *oc;
++ struct manager_cache_data *mc;
++ const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache);
++ struct omap_overlay_manager *mgr;
++ int i;
++ u16 x, y, w, h;
++ unsigned long flags;
++
++ x = *xi;
++ y = *yi;
++ w = *wi;
++ h = *hi;
++
++ DSSDBG("dispc_setup_partial_planes %d,%d %dx%d\n",
++ *xi, *yi, *wi, *hi);
++
++ mgr = dssdev->manager;
++
++ if (!mgr) {
++ DSSDBG("no manager\n");
++ return;
++ }
++
++ spin_lock_irqsave(&dss_cache.lock, flags);
++
++ /* We need to show the whole overlay if it is scaled. So look for
++ * those, and make the update area larger if found.
++ * Also mark the overlay cache dirty */
++ for (i = 0; i < num_ovls; ++i) {
++ unsigned x1, y1, x2, y2;
++ unsigned outw, outh;
++
++ oc = &dss_cache.overlay_cache[i];
++
++ if (oc->channel != mgr->id)
++ continue;
++
++ oc->dirty = true;
++
++ if (!oc->enabled)
++ continue;
++
++ if (!dispc_is_overlay_scaled(oc))
++ continue;
++
++ outw = oc->out_width == 0 ? oc->width : oc->out_width;
++ outh = oc->out_height == 0 ? oc->height : oc->out_height;
++
++ /* is the overlay outside the update region? */
++ if (!rectangle_intersects(x, y, w, h,
++ oc->pos_x, oc->pos_y,
++ outw, outh))
++ continue;
++
++ /* if the overlay totally inside the update region? */
++ if (rectangle_subset(oc->pos_x, oc->pos_y, outw, outh,
++ x, y, w, h))
++ continue;
++
++ if (x > oc->pos_x)
++ x1 = oc->pos_x;
+ else
+- outw = ovl->info.out_width;
++ x1 = x;
+
+- if (ovl->info.out_height == 0)
+- outh = ovl->info.height;
++ if (y > oc->pos_y)
++ y1 = oc->pos_y;
+ else
+- outh = ovl->info.out_height;
+-
+- r = dispc_setup_plane(ovl->id, ovl->manager->id,
+- ovl->info.paddr,
+- ovl->info.screen_width,
+- ovl->info.pos_x,
+- ovl->info.pos_y,
+- ovl->info.width,
+- ovl->info.height,
+- outw,
+- outh,
+- ovl->info.color_mode,
+- ilace,
+- ovl->info.rotation_type,
+- ovl->info.rotation,
+- ovl->info.mirror,
+- ovl->info.global_alpha);
++ y1 = y;
+
+- if (r) {
+- DSSERR("dispc_setup_plane failed for ovl %d\n",
+- ovl->id);
+- dispc_enable_plane(ovl->id, 0);
+- continue;
+- }
++ if ((x + w) < (oc->pos_x + outw))
++ x2 = oc->pos_x + outw;
++ else
++ x2 = x + w;
+
+- if (dss_use_replication(dssdev, ovl->info.color_mode))
+- dispc_enable_replication(ovl->id, true);
++ if ((y + h) < (oc->pos_y + outh))
++ y2 = oc->pos_y + outh;
+ else
+- dispc_enable_replication(ovl->id, false);
++ y2 = y + h;
++
++ x = x1;
++ y = y1;
++ w = x2 - x1;
++ h = y2 - y1;
++
++ DSSDBG("changing upd area due to ovl(%d) scaling %d,%d %dx%d\n",
++ i, x, y, w, h);
++ }
++
++ mc = &dss_cache.manager_cache[mgr->id];
++ mc->do_manual_update = true;
++ mc->x = x;
++ mc->y = y;
++ mc->w = w;
++ mc->h = h;
++
++ configure_dispc();
++
++ mc->do_manual_update = false;
++
++ spin_unlock_irqrestore(&dss_cache.lock, flags);
++
++ *xi = x;
++ *yi = y;
++ *wi = w;
++ *hi = h;
++}
++
++void dss_start_update(struct omap_dss_device *dssdev)
++{
++ struct manager_cache_data *mc;
++ struct overlay_cache_data *oc;
++ const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache);
++ const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache);
++ struct omap_overlay_manager *mgr;
++ int i;
++
++ mgr = dssdev->manager;
++
++ for (i = 0; i < num_ovls; ++i) {
++ oc = &dss_cache.overlay_cache[i];
++ if (oc->channel != mgr->id)
++ continue;
++
++ oc->shadow_dirty = false;
++ }
++
++ for (i = 0; i < num_mgrs; ++i) {
++ mc = &dss_cache.manager_cache[i];
++ if (mgr->id != i)
++ continue;
++
++ mc->shadow_dirty = false;
++ }
++
++ dispc_enable_lcd_out(1);
++}
++
++static void dss_apply_irq_handler(void *data, u32 mask)
++{
++ struct manager_cache_data *mc;
++ struct overlay_cache_data *oc;
++ const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache);
++ const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache);
++ int i, r;
++ bool mgr_busy[2];
++
++ mgr_busy[0] = dispc_go_busy(0);
++ mgr_busy[1] = dispc_go_busy(1);
++
++ spin_lock(&dss_cache.lock);
++
++ for (i = 0; i < num_ovls; ++i) {
++ oc = &dss_cache.overlay_cache[i];
++ if (!mgr_busy[oc->channel])
++ oc->shadow_dirty = false;
++ }
++
++ for (i = 0; i < num_mgrs; ++i) {
++ mc = &dss_cache.manager_cache[i];
++ if (!mgr_busy[i])
++ mc->shadow_dirty = false;
++ }
++
++ r = configure_dispc();
++ if (r == 1)
++ goto end;
++
++ /* re-read busy flags */
++ mgr_busy[0] = dispc_go_busy(0);
++ mgr_busy[1] = dispc_go_busy(1);
+
+- dispc_enable_plane(ovl->id, 1);
++ /* keep running as long as there are busy managers, so that
++ * we can collect overlay-applied information */
++ for (i = 0; i < num_mgrs; ++i) {
++ if (mgr_busy[i])
++ goto end;
+ }
+
+- /* Enable fifo merge if possible */
+- dispc_enable_fifomerge(num_planes_enabled == 1);
++ omap_dispc_unregister_isr(dss_apply_irq_handler, NULL,
++ DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_ODD |
++ DISPC_IRQ_EVSYNC_EVEN);
++ dss_cache.irq_enabled = false;
++
++end:
++ spin_unlock(&dss_cache.lock);
++}
++
++static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
++{
++ struct overlay_cache_data *oc;
++ struct manager_cache_data *mc;
++ int i;
++ struct omap_overlay *ovl;
++ int num_planes_enabled = 0;
++ bool use_fifomerge;
++ unsigned long flags;
++ int r;
+
+- /* Go through overlays again. This time we configure fifos. We have to
+- * do this after enabling/disabling fifomerge so that we have correct
+- * knowledge of fifo sizes */
++ DSSDBG("omap_dss_mgr_apply(%s)\n", mgr->name);
++
++ spin_lock_irqsave(&dss_cache.lock, flags);
++
++ /* Configure overlays */
+ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_dss_device *dssdev;
++
+ ovl = omap_dss_get_overlay(i);
+
+ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+ continue;
+
+- if (!overlay_enabled(ovl))
++ oc = &dss_cache.overlay_cache[ovl->id];
++
++ if (!overlay_enabled(ovl)) {
++ if (oc->enabled) {
++ oc->enabled = false;
++ oc->dirty = true;
++ }
++ continue;
++ }
++
++ if (!ovl->info_dirty) {
++ if (oc->enabled)
++ ++num_planes_enabled;
++ continue;
++ }
++
++ dssdev = ovl->manager->device;
++
++ if (dss_check_overlay(ovl, dssdev)) {
++ if (oc->enabled) {
++ oc->enabled = false;
++ oc->dirty = true;
++ }
+ continue;
++ }
++
++ ovl->info_dirty = false;
++ oc->dirty = true;
++
++ oc->paddr = ovl->info.paddr;
++ oc->vaddr = ovl->info.vaddr;
++ oc->screen_width = ovl->info.screen_width;
++ oc->width = ovl->info.width;
++ oc->height = ovl->info.height;
++ oc->color_mode = ovl->info.color_mode;
++ oc->rotation = ovl->info.rotation;
++ oc->rotation_type = ovl->info.rotation_type;
++ oc->mirror = ovl->info.mirror;
++ oc->pos_x = ovl->info.pos_x;
++ oc->pos_y = ovl->info.pos_y;
++ oc->out_width = ovl->info.out_width;
++ oc->out_height = ovl->info.out_height;
++ oc->global_alpha = ovl->info.global_alpha;
+
+- ovl->manager->device->configure_overlay(ovl);
++ oc->replication =
++ dss_use_replication(dssdev, ovl->info.color_mode);
++
++ oc->ilace = dssdev->type == OMAP_DISPLAY_TYPE_VENC;
++
++ oc->channel = ovl->manager->id;
++
++ oc->enabled = true;
++
++ oc->manual_update =
++ dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
++ dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO;
++
++ ++num_planes_enabled;
+ }
+
+- /* Configure managers, and issue GO */
++ /* Configure managers */
+ list_for_each_entry(mgr, &manager_list, list) {
++ struct omap_dss_device *dssdev;
++
+ if (!(mgr->caps & OMAP_DSS_OVL_MGR_CAP_DISPC))
+ continue;
+
++ mc = &dss_cache.manager_cache[mgr->id];
++
++ if (mgr->device_changed) {
++ mgr->device_changed = false;
++ mgr->info_dirty = true;
++ }
++
++ if (!mgr->info_dirty)
++ continue;
++
++ if (!mgr->device)
++ continue;
++
+ dssdev = mgr->device;
+
+- if (!dssdev)
++ mgr->info_dirty = false;
++ mc->dirty = true;
++
++ mc->default_color = mgr->info.default_color;
++ mc->trans_key_type = mgr->info.trans_key_type;
++ mc->trans_key = mgr->info.trans_key;
++ mc->trans_enabled = mgr->info.trans_enabled;
++ mc->alpha_enabled = mgr->info.alpha_enabled;
++
++ mc->manual_upd_display =
++ dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
++
++ mc->manual_update =
++ dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
++ dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO;
++ }
++
++ /* XXX TODO: Try to get fifomerge working. The problem is that it
++ * affects both managers, not individually but at the same time. This
++ * means the change has to be well synchronized. I guess the proper way
++ * is to have a two step process for fifo merge:
++ * fifomerge enable:
++ * 1. disable other planes, leaving one plane enabled
++ * 2. wait until the planes are disabled on HW
++ * 3. config merged fifo thresholds, enable fifomerge
++ * fifomerge disable:
++ * 1. config unmerged fifo thresholds, disable fifomerge
++ * 2. wait until fifo changes are in HW
++ * 3. enable planes
++ */
++ use_fifomerge = false;
++
++ /* Configure overlay fifos */
++ for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++ struct omap_dss_device *dssdev;
++ u32 size;
++
++ ovl = omap_dss_get_overlay(i);
++
++ if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+ continue;
+
+- dispc_set_trans_key(mgr->id, mgr->info.trans_key_type,
+- mgr->info.trans_key);
+- dispc_enable_trans_key(mgr->id, mgr->info.trans_enabled);
+- dispc_enable_alpha_blending(mgr->id, mgr->info.alpha_enabled);
++ oc = &dss_cache.overlay_cache[ovl->id];
+
+- /* We don't need GO with manual update display. LCD iface will
+- * always be turned off after frame, and new settings will
+- * be taken in to use at next update */
+- if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
++ if (!oc->enabled)
+ continue;
+
+- dispc_go(mgr->id);
++ dssdev = ovl->manager->device;
++
++ size = dispc_get_plane_fifo_size(ovl->id);
++ if (use_fifomerge)
++ size *= 3;
++
++ switch (dssdev->type) {
++ case OMAP_DISPLAY_TYPE_DPI:
++ case OMAP_DISPLAY_TYPE_DBI:
++ case OMAP_DISPLAY_TYPE_SDI:
++ case OMAP_DISPLAY_TYPE_VENC:
++ default_get_overlay_fifo_thresholds(ovl->id, size,
++ &oc->burst_size, &oc->fifo_low,
++ &oc->fifo_high);
++ break;
++#ifdef CONFIG_OMAP2_DSS_DSI
++ case OMAP_DISPLAY_TYPE_DSI:
++ dsi_get_overlay_fifo_thresholds(ovl->id, size,
++ &oc->burst_size, &oc->fifo_low,
++ &oc->fifo_high);
++ break;
++#endif
++ default:
++ BUG();
++ }
+ }
+
++ r = 0;
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ if (!dss_cache.irq_enabled) {
++ r = omap_dispc_register_isr(dss_apply_irq_handler, NULL,
++ DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_ODD |
++ DISPC_IRQ_EVSYNC_EVEN);
++ dss_cache.irq_enabled = true;
++ }
++ configure_dispc();
+ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
+
+- return ret;
++ spin_unlock_irqrestore(&dss_cache.lock, flags);
++
++ return r;
+ }
+
+ static int dss_check_manager(struct omap_overlay_manager *mgr)
+@@ -569,6 +1333,8 @@ static int omap_dss_mgr_set_info(struct omap_overlay_manager *mgr,
+ return r;
+ }
+
++ mgr->info_dirty = true;
++
+ return 0;
+ }
+
+@@ -588,6 +1354,8 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ {
+ int i, r;
+
++ spin_lock_init(&dss_cache.lock);
++
+ INIT_LIST_HEAD(&manager_list);
+
+ num_managers = 0;
+@@ -618,6 +1386,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
+ mgr->apply = &omap_dss_mgr_apply;
+ mgr->set_manager_info = &omap_dss_mgr_set_info;
+ mgr->get_manager_info = &omap_dss_mgr_get_info;
++ mgr->wait_for_go = &dss_mgr_wait_for_go;
+
+ mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
+
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 9f883aa..3652106 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -52,6 +52,7 @@ static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
+ {
+ int i, r;
+ struct omap_overlay_manager *mgr = NULL;
++ struct omap_overlay_manager *old_mgr;
+ int len = size;
+
+ if (buf[size-1] == '\n')
+@@ -74,27 +75,32 @@ static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
+ if (mgr)
+ DSSDBG("manager %s found\n", mgr->name);
+
+- if (mgr != ovl->manager) {
+- /* detach old manager */
+- if (ovl->manager) {
+- r = ovl->unset_manager(ovl);
+- if (r) {
+- DSSERR("detach failed\n");
+- return r;
+- }
+- }
++ if (mgr == ovl->manager)
++ return size;
+
+- if (mgr) {
+- r = ovl->set_manager(ovl, mgr);
+- if (r) {
+- DSSERR("Failed to attach overlay\n");
+- return r;
+- }
++ old_mgr = ovl->manager;
++
++ /* detach old manager */
++ if (old_mgr) {
++ r = ovl->unset_manager(ovl);
++ if (r) {
++ DSSERR("detach failed\n");
++ return r;
+ }
++
++ r = old_mgr->apply(old_mgr);
++ if (r)
++ return r;
+ }
+
+- if (ovl->manager) {
+- r = ovl->manager->apply(ovl->manager);
++ if (mgr) {
++ r = ovl->set_manager(ovl, mgr);
++ if (r) {
++ DSSERR("Failed to attach overlay\n");
++ return r;
++ }
++
++ r = mgr->apply(mgr);
+ if (r)
+ return r;
+ }
+@@ -403,6 +409,8 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
+ }
+ }
+
++ ovl->info_dirty = true;
++
+ return 0;
+ }
+
+@@ -412,22 +420,40 @@ static void dss_ovl_get_overlay_info(struct omap_overlay *ovl,
+ *info = ovl->info;
+ }
+
++static int dss_ovl_wait_for_go(struct omap_overlay *ovl)
++{
++ return dss_mgr_wait_for_go_ovl(ovl);
++}
++
+ static int omap_dss_set_manager(struct omap_overlay *ovl,
+ struct omap_overlay_manager *mgr)
+ {
+ int r;
+
++ if (!mgr)
++ return -EINVAL;
++
+ if (ovl->manager) {
+ DSSERR("overlay '%s' already has a manager '%s'\n",
+ ovl->name, ovl->manager->name);
++ return -EINVAL;
+ }
+
+- r = dss_check_overlay(ovl, mgr->device);
++ r = ovl->wait_for_go(ovl);
+ if (r)
+ return r;
+
++ if (ovl->info.enabled) {
++ DSSERR("overlay has to be disabled to change the manager\n");
++ return -EINVAL;
++ }
++
+ ovl->manager = mgr;
+
++ dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
++ dispc_set_channel_out(ovl->id, mgr->id);
++ dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
++
+ return 0;
+ }
+
+@@ -439,6 +465,7 @@ static int omap_dss_unset_manager(struct omap_overlay *ovl)
+ }
+
+ ovl->manager = NULL;
++ /* XXX disable overlay? */
+
+ return 0;
+ }
+@@ -530,6 +557,7 @@ void dss_init_overlays(struct platform_device *pdev)
+ ovl->unset_manager = &omap_dss_unset_manager;
+ ovl->set_overlay_info = &dss_ovl_set_overlay_info;
+ ovl->get_overlay_info = &dss_ovl_get_overlay_info;
++ ovl->wait_for_go = &dss_ovl_wait_for_go;
+
+ omap_dss_add_overlay(ovl);
+
+diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
+index 96602ae..9dd2349 100644
+--- a/drivers/video/omap2/dss/rfbi.c
++++ b/drivers/video/omap2/dss/rfbi.c
+@@ -972,7 +972,7 @@ static int do_update(struct omap_dss_device *dssdev, struct update_region *upd)
+
+ if (dssdev->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
+ /*dssdev->driver->enable_te(dssdev, 1); */
+- dispc_setup_partial_planes(dssdev, &x, &y, &w, &h);
++ dss_setup_partial_planes(dssdev, &x, &y, &w, &h);
+ }
+
+ #ifdef MEASURE_PERF
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index d8a83b2..a9a5a8c 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -711,6 +711,15 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
+ return 0;
+ }
+
++static enum omap_dss_update_mode venc_display_get_update_mode(
++ struct omap_dss_device *dssdev)
++{
++ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
++ return OMAP_DSS_UPDATE_AUTO;
++ else
++ return OMAP_DSS_UPDATE_DISABLED;
++}
++
+ int venc_init_display(struct omap_dss_device *dssdev)
+ {
+ DSSDBG("init_display\n");
+@@ -724,6 +733,7 @@ int venc_init_display(struct omap_dss_device *dssdev)
+ dssdev->check_timings = venc_check_timings;
+ dssdev->get_wss = venc_get_wss;
+ dssdev->set_wss = venc_set_wss;
++ dssdev->get_update_mode = venc_display_get_update_mode;
+
+ return 0;
+ }
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 91308c2..257f7cb 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -442,6 +442,22 @@ static int omapfb_get_ovl_colormode(struct omapfb2_device *fbdev,
+ return 0;
+ }
+
++static int omapfb_wait_for_go(struct fb_info *fbi)
++{
++ struct omapfb_info *ofbi = FB2OFB(fbi);
++ int r = 0;
++ int i;
++
++ for (i = 0; i < ofbi->num_overlays; ++i) {
++ struct omap_overlay *ovl = ofbi->overlays[i];
++ r = ovl->wait_for_go(ovl);
++ if (r)
++ break;
++ }
++
++ return r;
++}
++
+ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ {
+ struct omapfb_info *ofbi = FB2OFB(fbi);
+@@ -624,6 +640,16 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ r = display->wait_vsync(display);
+ break;
+
++ case OMAPFB_WAITFORGO:
++ DBG("ioctl WAITFORGO\n");
++ if (!display) {
++ r = -EINVAL;
++ break;
++ }
++
++ r = omapfb_wait_for_go(fbi);
++ break;
++
+ /* LCD and CTRL tests do the same thing for backward
+ * compatibility */
+ case OMAPFB_LCD_TEST:
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index fd522d3..5014d2e 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -55,6 +55,7 @@
+ #define OMAPFB_WAITFORVSYNC OMAP_IO(57)
+ #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
+ #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
++#define OMAPFB_WAITFORGO OMAP_IO(60)
+
+ #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+ #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0121-DSS2-VRFB-clean-up-BUG-calls.patch b/recipes/linux/linux-omap-pm/dss2/0121-DSS2-VRFB-clean-up-BUG-calls.patch
new file mode 100644
index 0000000000..fe988632be
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0121-DSS2-VRFB-clean-up-BUG-calls.patch
@@ -0,0 +1,70 @@
+From 1011922e3dd0c5f0f375fef28caa7222f68d4601 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 16 Jun 2009 17:14:03 +0300
+Subject: [PATCH 121/146] DSS2: VRFB: clean up BUG() calls
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/vrfb.c | 25 ++++++++++---------------
+ 1 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 7cd7c61..201640a 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -121,7 +121,6 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+
+ default:
+ BUG();
+- return;
+ }
+
+ if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+@@ -176,10 +175,8 @@ void omap_vrfb_release_ctx(struct vrfb *vrfb)
+
+ mutex_lock(&ctx_lock);
+
+- if (!(ctx_map & (1 << ctx))) {
+- BUG();
+- return;
+- }
++ BUG_ON(!(ctx_map & (1 << ctx)));
++
+ clear_bit(ctx, &ctx_map_active);
+ clear_bit(ctx, &ctx_map);
+
+@@ -254,11 +251,10 @@ void omap_vrfb_suspend_ctx(struct vrfb *vrfb)
+ {
+ DBG("suspend ctx %d\n", vrfb->context);
+ mutex_lock(&ctx_lock);
+- if (vrfb->context >= VRFB_NUM_CTXS ||
+- (!(1 << vrfb->context) & ctx_map_active)) {
+- BUG();
+- return;
+- }
++
++ BUG_ON(vrfb->context >= VRFB_NUM_CTXS);
++ BUG_ON(!((1 << vrfb->context) & ctx_map_active));
++
+ clear_bit(vrfb->context, &ctx_map_active);
+ mutex_unlock(&ctx_lock);
+ }
+@@ -268,11 +264,10 @@ void omap_vrfb_resume_ctx(struct vrfb *vrfb)
+ {
+ DBG("resume ctx %d\n", vrfb->context);
+ mutex_lock(&ctx_lock);
+- if (vrfb->context >= VRFB_NUM_CTXS ||
+- ((1 << vrfb->context) & ctx_map_active)) {
+- BUG();
+- return;
+- }
++
++ BUG_ON(vrfb->context >= VRFB_NUM_CTXS);
++ BUG_ON((1 << vrfb->context) & ctx_map_active);
++
+ /*
+ * omap_vrfb_restore_context is normally called by the core domain
+ * save / restore logic, but since this VRFB context was suspended
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0122-DSS2-OMAPFB-don-t-fail-even-if-default-display-doe.patch b/recipes/linux/linux-omap-pm/dss2/0122-DSS2-OMAPFB-don-t-fail-even-if-default-display-doe.patch
new file mode 100644
index 0000000000..1438deac19
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0122-DSS2-OMAPFB-don-t-fail-even-if-default-display-doe.patch
@@ -0,0 +1,139 @@
+From 9abe23c8bc711a0883dfe8fd73371e35f48dddf0 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 23 Jun 2009 11:55:52 +0300
+Subject: [PATCH 122/146] DSS2: OMAPFB: don't fail even if default display doesn't start
+
+This will allow secondary displays to be used even if the
+main display is out of order.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c | 91 ++++++++++++------------------
+ 1 files changed, 37 insertions(+), 54 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 1473581..b806dc9 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1994,21 +1994,9 @@ static int omapfb_probe(struct platform_device *pdev)
+ for (i = 0; i < fbdev->num_managers; i++)
+ fbdev->managers[i] = omap_dss_get_overlay_manager(i);
+
+-
+- /* gfx overlay should be the default one. find a display
+- * connected to that, and use it as default display */
+- ovl = omap_dss_get_overlay(0);
+- if (ovl->manager && ovl->manager->device) {
+- def_display = ovl->manager->device;
+- } else {
+- dev_err(&pdev->dev, "cannot find default display\n");
+- r = -EINVAL;
+- goto cleanup;
+- }
+-
+ if (def_mode && strlen(def_mode) > 0) {
+ if (omapfb_parse_def_modes(fbdev))
+- dev_err(&pdev->dev, "cannot parse default modes\n");
++ dev_warn(&pdev->dev, "cannot parse default modes\n");
+ }
+
+ r = omapfb_create_framebuffers(fbdev);
+@@ -2019,59 +2007,54 @@ static int omapfb_probe(struct platform_device *pdev)
+ struct omap_overlay_manager *mgr;
+ mgr = fbdev->managers[i];
+ r = mgr->apply(mgr);
+- if (r) {
+- dev_err(fbdev->dev, "failed to apply dispc config\n");
+- goto cleanup;
+- }
++ if (r)
++ dev_warn(fbdev->dev, "failed to apply dispc config\n");
+ }
+
+ DBG("mgr->apply'ed\n");
+
+- r = def_display->enable(def_display);
+- if (r) {
+- dev_err(fbdev->dev, "Failed to enable display '%s'\n",
+- def_display->name);
+- goto cleanup;
+- }
+-
+- /* set the update mode */
+- if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
+-#ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
+- if (def_display->enable_te)
+- def_display->enable_te(def_display, 1);
+- if (def_display->set_update_mode)
+- def_display->set_update_mode(def_display,
+- OMAP_DSS_UPDATE_AUTO);
+-#else
+- if (def_display->enable_te)
+- def_display->enable_te(def_display, 0);
+- if (def_display->set_update_mode)
+- def_display->set_update_mode(def_display,
+- OMAP_DSS_UPDATE_MANUAL);
+-#endif
++ /* gfx overlay should be the default one. find a display
++ * connected to that, and use it as default display */
++ ovl = omap_dss_get_overlay(0);
++ if (ovl->manager && ovl->manager->device) {
++ def_display = ovl->manager->device;
+ } else {
+- if (def_display->set_update_mode)
+- def_display->set_update_mode(def_display,
+- OMAP_DSS_UPDATE_AUTO);
++ dev_warn(&pdev->dev, "cannot find default display\n");
++ def_display = NULL;
+ }
+
+- for (i = 0; i < fbdev->num_displays; i++) {
+- struct omap_dss_device *display = fbdev->displays[i];
++ if (def_display) {
+ u16 w, h;
++ r = def_display->enable(def_display);
++ if (r)
++ dev_warn(fbdev->dev, "Failed to enable display '%s'\n",
++ def_display->name);
+
+- if (!display->get_update_mode || !display->update)
+- continue;
+-
+- if (display->get_update_mode(display) ==
+- OMAP_DSS_UPDATE_MANUAL) {
+-
+- display->get_resolution(display, &w, &h);
+- display->update(display, 0, 0, w, h);
++ /* set the update mode */
++ if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
++#ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 1);
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_AUTO);
++#else /* MANUAL_UPDATE */
++ if (def_display->enable_te)
++ def_display->enable_te(def_display, 0);
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_MANUAL);
++
++ def_display->get_resolution(def_display, &w, &h);
++ def_display->update(def_display, 0, 0, w, h);
++#endif
++ } else {
++ if (def_display->set_update_mode)
++ def_display->set_update_mode(def_display,
++ OMAP_DSS_UPDATE_AUTO);
+ }
+ }
+
+- DBG("display->updated\n");
+-
+ return 0;
+
+ cleanup:
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0123-DSS2-DSI-Fix-external-TE-wait.patch b/recipes/linux/linux-omap-pm/dss2/0123-DSS2-DSI-Fix-external-TE-wait.patch
new file mode 100644
index 0000000000..1860c63160
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0123-DSS2-DSI-Fix-external-TE-wait.patch
@@ -0,0 +1,41 @@
+From 063a0c3e0e45a9de3d12811885463565655cbfde Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 26 Jun 2009 11:53:21 +0300
+Subject: [PATCH 123/146] DSS2: DSI: Fix external TE wait
+
+---
+ arch/arm/plat-omap/include/mach/display.h | 1 -
+ drivers/video/omap2/dss/dsi.c | 5 +++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index be07c35..92603eb 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -453,7 +453,6 @@ struct omap_dss_device {
+
+ int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
+ int (*get_te)(struct omap_dss_device *dssdev);
+- int (*wait_for_te)(struct omap_dss_device *dssdev);
+
+ u8 (*get_rotate)(struct omap_dss_device *dssdev);
+ int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 875be0c..f3553f8 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2775,8 +2775,9 @@ static int dsi_update_thread(void *data)
+ device->driver->setup_update(device, x, y, w, h);
+ #endif
+
+- if (dsi.te_enabled && dsi.use_ext_te && device->wait_for_te)
+- device->wait_for_te(device);
++ if (dsi.te_enabled && dsi.use_ext_te &&
++ device->driver->wait_for_te)
++ device->driver->wait_for_te(device);
+
+ dsi_perf_mark_start();
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0124-DSS2-DSI-Increase-framedone-timeout-to-1s.patch b/recipes/linux/linux-omap-pm/dss2/0124-DSS2-DSI-Increase-framedone-timeout-to-1s.patch
new file mode 100644
index 0000000000..99e76dfc9e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0124-DSS2-DSI-Increase-framedone-timeout-to-1s.patch
@@ -0,0 +1,28 @@
+From 57da7b3252f9cbcf8ba536a6bde7a92937b5d7c8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 26 Jun 2009 14:50:47 +0300
+Subject: [PATCH 124/146] DSS2: DSI: Increase framedone timeout to 1s
+
+It seems that with heavy CPU load it may take more time
+until the work thread wakes up. I was unable to increase
+the priority so that the thread would wake up earlier.
+---
+ drivers/video/omap2/dss/dsi.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index f3553f8..97a67e5 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2785,7 +2785,7 @@ static int dsi_update_thread(void *data)
+ dsi_update_screen_dispc(device, x, y, w, h);
+
+ /* wait for framedone */
+- timeout = msecs_to_jiffies(500);
++ timeout = msecs_to_jiffies(1000);
+ timeout = wait_event_timeout(dsi.waitqueue,
+ dsi.framedone_received == true,
+ timeout);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0125-DSS2-VRAM-Add-function-to-get-free-vram-info.patch b/recipes/linux/linux-omap-pm/dss2/0125-DSS2-VRAM-Add-function-to-get-free-vram-info.patch
new file mode 100644
index 0000000000..d3d62ce7a2
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0125-DSS2-VRAM-Add-function-to-get-free-vram-info.patch
@@ -0,0 +1,76 @@
+From 0d16c11a3df3e09cb8ba20883174f600ac3611b5 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 24 Jun 2009 14:55:54 +0300
+Subject: [PATCH 125/146] DSS2: VRAM: Add function to get free vram info
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vram.h | 2 +
+ arch/arm/plat-omap/vram.c | 38 ++++++++++++++++++++++++++++++++
+ 2 files changed, 40 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index 8639e08..494ddde 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -28,6 +28,8 @@ extern int omap_vram_add_region(unsigned long paddr, size_t size);
+ extern int omap_vram_free(unsigned long paddr, size_t size);
+ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
+ extern int omap_vram_reserve(unsigned long paddr, size_t size);
++extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
++ unsigned long *largest_free_block);
+ extern void omap2_set_sdram_vram(u32 size, u32 start);
+ extern void omap2_set_sram_vram(u32 size, u32 start);
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index f3ce849..d4a8110 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -398,6 +398,44 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr)
+ }
+ EXPORT_SYMBOL(omap_vram_alloc);
+
++void omap_vram_get_info(unsigned long *vram,
++ unsigned long *free_vram,
++ unsigned long *largest_free_block)
++{
++ struct vram_region *vr;
++ struct vram_alloc *va;
++
++ *vram = 0;
++ *free_vram = 0;
++ *largest_free_block = 0;
++
++ mutex_lock(&region_mutex);
++
++ list_for_each_entry(vr, &region_list, list) {
++ unsigned free;
++ unsigned long pa;
++
++ pa = vr->paddr;
++ *vram += vr->pages << PAGE_SHIFT;
++
++ list_for_each_entry(va, &vr->alloc_list, list) {
++ free = va->paddr - pa;
++ *free_vram += free;
++ if (free > *largest_free_block)
++ *largest_free_block = free;
++ pa = va->paddr + (va->pages << PAGE_SHIFT);
++ }
++
++ free = vr->paddr + (vr->pages << PAGE_SHIFT) - pa;
++ *free_vram += free;
++ if (free > *largest_free_block)
++ *largest_free_block = free;
++ }
++
++ mutex_unlock(&region_mutex);
++}
++EXPORT_SYMBOL(omap_vram_get_info);
++
+ #if defined(CONFIG_DEBUG_FS)
+ static int vram_debug_show(struct seq_file *s, void *unused)
+ {
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch b/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
new file mode 100644
index 0000000000..287a82cb81
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
@@ -0,0 +1,86 @@
+From fbc4a50eafe5d5023ef1c0a32d362c2166946164 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 24 Jun 2009 14:56:29 +0300
+Subject: [PATCH 126/146] DSS2: OMAPFB: implement OMAPFB_GET_VRAM_INFO ioctl
+
+This ioctl can be used to guess how big buffers it is possible to
+reserve.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 18 ++++++++++++++++++
+ include/linux/omapfb.h | 8 ++++++++
+ 2 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 257f7cb..70fb64e 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -30,6 +30,7 @@
+
+ #include <mach/display.h>
+ #include <mach/vrfb.h>
++#include <mach/vram.h>
+
+ #include "omapfb.h"
+
+@@ -475,6 +476,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ enum omapfb_update_mode update_mode;
+ int test_num;
+ struct omapfb_memory_read memory_read;
++ struct omapfb_vram_info vram_info;
+ } p;
+
+ int r = 0;
+@@ -695,6 +697,22 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+
+ break;
+
++ case OMAPFB_GET_VRAM_INFO: {
++ unsigned long vram, free, largest;
++
++ DBG("ioctl GET_VRAM_INFO\n");
++
++ omap_vram_get_info(&vram, &free, &largest);
++ p.vram_info.total = vram;
++ p.vram_info.free = free;
++ p.vram_info.largest_free_block = largest;
++
++ if (copy_to_user((void __user *)arg, &p.vram_info,
++ sizeof(p.vram_info)))
++ r = -EFAULT;
++ break;
++ }
++
+ default:
+ dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd);
+ r = -EINVAL;
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 5014d2e..0df0df9 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -56,6 +56,7 @@
+ #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
+ #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
+ #define OMAPFB_WAITFORGO OMAP_IO(60)
++#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
+
+ #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+ #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+@@ -194,6 +195,13 @@ struct omapfb_ovl_colormode {
+ struct fb_bitfield transp;
+ };
+
++struct omapfb_vram_info {
++ __u32 total;
++ __u32 free;
++ __u32 largest_free_block;
++ __u32 reserved[5];
++};
++
+ #ifdef __KERNEL__
+
+ #include <linux/completion.h>
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0127-DSS2-DSI-increase-dsi-thread-priority.patch b/recipes/linux/linux-omap-pm/dss2/0127-DSS2-DSI-increase-dsi-thread-priority.patch
new file mode 100644
index 0000000000..213b846c85
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0127-DSS2-DSI-increase-dsi-thread-priority.patch
@@ -0,0 +1,37 @@
+From e847a1241c2707453701d5b680fafbb2ce2ae1d8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 26 Jun 2009 15:22:37 +0300
+Subject: [PATCH 127/146] DSS2: DSI: increase dsi thread priority
+
+This should help keep the framerates up even if there's
+lots of CPU load.
+---
+ drivers/video/omap2/dss/dsi.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 97a67e5..d2c5b94 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -3418,6 +3418,9 @@ int dsi_init_display(struct omap_dss_device *dssdev)
+ int dsi_init(struct platform_device *pdev)
+ {
+ u32 rev;
++ struct sched_param param = {
++ .sched_priority = MAX_USER_RT_PRIO-1
++ };
+
+ spin_lock_init(&dsi.errors_lock);
+ dsi.errors = 0;
+@@ -3432,6 +3435,8 @@ int dsi_init(struct platform_device *pdev)
+ DSSERR("cannot create kthread\n");
+ return PTR_ERR(dsi.thread);
+ }
++ sched_setscheduler(dsi.thread, SCHED_FIFO, &param);
++
+ init_waitqueue_head(&dsi.waitqueue);
+ spin_lock_init(&dsi.update_lock);
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0128-DSS2-DSI-check-bus_lock-in-send_bta.patch b/recipes/linux/linux-omap-pm/dss2/0128-DSS2-DSI-check-bus_lock-in-send_bta.patch
new file mode 100644
index 0000000000..c12c712dbf
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0128-DSS2-DSI-check-bus_lock-in-send_bta.patch
@@ -0,0 +1,28 @@
+From 57cf924ba722d0ef7f48b4a0f8a44a0ddeefc470 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 26 Jun 2009 17:14:25 +0300
+Subject: [PATCH 128/146] DSS2: DSI: check bus_lock in send_bta()
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dsi.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index d2c5b94..3b15684 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1786,7 +1786,9 @@ static int dsi_vc_send_bta(int channel)
+ {
+ unsigned long tmo;
+
+- /*DSSDBG("dsi_vc_send_bta_sync %d\n", channel); */
++ DSSDBG("dsi_vc_send_bta %d\n", channel);
++
++ WARN_ON(!mutex_is_locked(&dsi.bus_lock));
+
+ if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) { /* RX_FIFO_NOT_EMPTY */
+ DSSERR("rx fifo not empty when sending BTA, dumping data:\n");
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0129-DSS2-DSI-export-dsi_vc_send_bta_sync.patch b/recipes/linux/linux-omap-pm/dss2/0129-DSS2-DSI-export-dsi_vc_send_bta_sync.patch
new file mode 100644
index 0000000000..8e72043652
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0129-DSS2-DSI-export-dsi_vc_send_bta_sync.patch
@@ -0,0 +1,47 @@
+From b3624e06210fe8f8306f4794a0e1059f25a7e74d Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Mon, 29 Jun 2009 14:38:58 +0300
+Subject: [PATCH 129/146] DSS2: DSI: export dsi_vc_send_bta_sync()
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 1 +
+ drivers/video/omap2/dss/dsi.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 92603eb..6df28dc 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -212,6 +212,7 @@ int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len);
+ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen);
+ int dsi_vc_set_max_rx_packet_size(int channel, u16 len);
+ int dsi_vc_send_null(int channel);
++int dsi_vc_send_bta_sync(int channel);
+
+ /* Board specific data */
+ struct omap_dss_board_info {
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 3b15684..1e18fdf 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1808,7 +1808,7 @@ static int dsi_vc_send_bta(int channel)
+ return 0;
+ }
+
+-static int dsi_vc_send_bta_sync(int channel)
++int dsi_vc_send_bta_sync(int channel)
+ {
+ int r = 0;
+ u32 err;
+@@ -1839,6 +1839,7 @@ err:
+
+ return r;
+ }
++EXPORT_SYMBOL(dsi_vc_send_bta_sync);
+
+ static inline void dsi_vc_write_long_header(int channel, u8 data_type,
+ u16 len, u8 ecc)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0130-DSS2-DSI-clear-BTA-irq-before-enabling-it.patch b/recipes/linux/linux-omap-pm/dss2/0130-DSS2-DSI-clear-BTA-irq-before-enabling-it.patch
new file mode 100644
index 0000000000..5d0c557150
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0130-DSS2-DSI-clear-BTA-irq-before-enabling-it.patch
@@ -0,0 +1,26 @@
+From 852518e23aafed505a8432a3105d8045bf51a3f2 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 30 Jun 2009 11:39:30 +0300
+Subject: [PATCH 130/146] DSS2: DSI: clear BTA irq before enabling it
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dsi.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 1e18fdf..45df3f7 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -616,6 +616,8 @@ static void dsi_vc_enable_bta_irq(int channel)
+ {
+ u32 l;
+
++ dsi_write_reg(DSI_VC_IRQSTATUS(channel), DSI_VC_IRQ_BTA);
++
+ l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
+ l |= DSI_VC_IRQ_BTA;
+ dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0131-DSS2-DSI-check-dsi_set_te-return-value.patch b/recipes/linux/linux-omap-pm/dss2/0131-DSS2-DSI-check-dsi_set_te-return-value.patch
new file mode 100644
index 0000000000..b462d59310
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0131-DSS2-DSI-check-dsi_set_te-return-value.patch
@@ -0,0 +1,62 @@
+From b46425082619fb329b56f7628ee5c196d7301bd3 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 30 Jun 2009 11:43:56 +0300
+Subject: [PATCH 131/146] DSS2: DSI: check dsi_set_te() return value
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dsi.c | 14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 45df3f7..03cf2d6 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -3003,7 +3003,9 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ dsi.use_ext_te = dssdev->phy.dsi.ext_te;
+- dsi_set_te(dssdev, dsi.te_enabled);
++ r = dsi_set_te(dssdev, dsi.te_enabled);
++ if (r)
++ goto err3;
+
+ dsi.update_mode = dsi.user_update_mode;
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
+@@ -3116,7 +3118,9 @@ static int dsi_display_resume(struct omap_dss_device *dssdev)
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+- dsi_set_te(dssdev, dsi.te_enabled);
++ r = dsi_set_te(dssdev, dsi.te_enabled);
++ if (r)
++ goto err2;
+
+ dsi.update_mode = dsi.user_update_mode;
+ if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO)
+@@ -3238,6 +3242,8 @@ static enum omap_dss_update_mode dsi_display_get_update_mode(
+
+ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ {
++ int r = 0;
++
+ DSSDBGF("%d", enable);
+
+ if (!dssdev->driver->enable_te)
+@@ -3250,11 +3256,11 @@ static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ goto end;
+
+- dsi_set_te(dssdev, enable);
++ r = dsi_set_te(dssdev, enable);
+ end:
+ dsi_bus_unlock();
+
+- return 0;
++ return r;
+ }
+
+ static int dsi_display_get_te(struct omap_dss_device *dssdev)
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0132-DSS2-DSI-use-only-1-VC.-Fixes-to-TE.patch b/recipes/linux/linux-omap-pm/dss2/0132-DSS2-DSI-use-only-1-VC.-Fixes-to-TE.patch
new file mode 100644
index 0000000000..c01c2520ec
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0132-DSS2-DSI-use-only-1-VC.-Fixes-to-TE.patch
@@ -0,0 +1,406 @@
+From 29cb3408c094bacd42d8bb17cbafb6f1c57f6cc8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 30 Jun 2009 11:47:38 +0300
+Subject: [PATCH 132/146] DSS2: DSI: use only 1 VC. Fixes to TE.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/dss/dsi.c | 197 +++++++++++++++++++++++++---------------
+ 1 files changed, 123 insertions(+), 74 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 03cf2d6..becaf64 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -192,6 +192,11 @@ enum fifo_size {
+ DSI_FIFO_SIZE_128 = 4,
+ };
+
++enum dsi_vc_mode {
++ DSI_VC_MODE_L4 = 0,
++ DSI_VC_MODE_VP,
++};
++
+ struct dsi_update_region {
+ bool dirty;
+ u16 x, y, w, h;
+@@ -210,6 +215,7 @@ static struct
+ struct regulator *vdds_dsi_reg;
+
+ struct {
++ enum dsi_vc_mode mode;
+ struct omap_dss_device *dssdev;
+ enum fifo_size fifo_size;
+ int dest_per; /* destination peripheral 0-3 */
+@@ -1629,14 +1635,36 @@ static void dsi_vc_print_status(int channel)
+ DSSDBG("EMPTINESS %d\n", (r >> (8 * channel)) & 0xff);
+ }
+
+-static void dsi_vc_config(int channel)
++static int dsi_vc_enable(int channel, bool enable)
++{
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO)
++ DSSDBG("dsi_vc_enable channel %d, enable %d\n",
++ channel, enable);
++
++ enable = enable ? 1 : 0;
++
++ REG_FLD_MOD(DSI_VC_CTRL(channel), enable, 0, 0);
++
++ if (wait_for_bit_change(DSI_VC_CTRL(channel), 0, enable) != enable) {
++ DSSERR("Failed to set dsi_vc_enable to %d\n", enable);
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static void dsi_vc_initial_config(int channel)
+ {
+ u32 r;
+
+- DSSDBG("dsi_vc_config %d\n", channel);
++ DSSDBGF("%d", channel);
+
+ r = dsi_read_reg(DSI_VC_CTRL(channel));
+
++ if (FLD_GET(r, 15, 15)) /* VC_BUSY */
++ DSSERR("VC(%d) busy when trying to configure it!\n",
++ channel);
++
+ r = FLD_MOD(r, 0, 1, 1); /* SOURCE, 0 = L4 */
+ r = FLD_MOD(r, 0, 2, 2); /* BTA_SHORT_EN */
+ r = FLD_MOD(r, 0, 3, 3); /* BTA_LONG_EN */
+@@ -1649,47 +1677,51 @@ static void dsi_vc_config(int channel)
+ r = FLD_MOD(r, 4, 23, 21); /* DMA_TX_REQ_NB = no dma */
+
+ dsi_write_reg(DSI_VC_CTRL(channel), r);
++
++ dsi.vc[channel].mode = DSI_VC_MODE_L4;
+ }
+
+-static void dsi_vc_config_vp(int channel)
++static void dsi_vc_config_l4(int channel)
+ {
+- u32 r;
++ if (dsi.vc[channel].mode == DSI_VC_MODE_L4)
++ return;
+
+- DSSDBG("dsi_vc_config_vp\n");
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO)
++ DSSDBGF("%d", channel);
+
+- r = dsi_read_reg(DSI_VC_CTRL(channel));
++ dsi_vc_enable(channel, 0);
+
+- r = FLD_MOD(r, 1, 1, 1); /* SOURCE, 1 = video port */
+- r = FLD_MOD(r, 0, 2, 2); /* BTA_SHORT_EN */
+- r = FLD_MOD(r, 0, 3, 3); /* BTA_LONG_EN */
+- r = FLD_MOD(r, 0, 4, 4); /* MODE, 0 = command */
+- r = FLD_MOD(r, 1, 7, 7); /* CS_TX_EN */
+- r = FLD_MOD(r, 1, 8, 8); /* ECC_TX_EN */
+- r = FLD_MOD(r, 1, 9, 9); /* MODE_SPEED, high speed on/off */
++ if(REG_GET(DSI_VC_CTRL(channel), 15, 15)) /* VC_BUSY */
++ DSSERR("vc(%d) busy when trying to config for L4\n", channel);
+
+- r = FLD_MOD(r, 4, 29, 27); /* DMA_RX_REQ_NB = no dma */
+- r = FLD_MOD(r, 4, 23, 21); /* DMA_TX_REQ_NB = no dma */
++ REG_FLD_MOD(DSI_VC_CTRL(channel), 0, 1, 1); /* SOURCE, 0 = L4 */
+
+- dsi_write_reg(DSI_VC_CTRL(channel), r);
+-}
++ dsi_vc_enable(channel, 1);
+
++ dsi.vc[channel].mode = DSI_VC_MODE_L4;
++}
+
+-static int dsi_vc_enable(int channel, bool enable)
++static void dsi_vc_config_vp(int channel)
+ {
+- DSSDBG("dsi_vc_enable channel %d, enable %d\n", channel, enable);
++ if (dsi.vc[channel].mode == DSI_VC_MODE_VP)
++ return;
+
+- enable = enable ? 1 : 0;
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO)
++ DSSDBGF("%d", channel);
+
+- REG_FLD_MOD(DSI_VC_CTRL(channel), enable, 0, 0);
++ dsi_vc_enable(channel, 0);
+
+- if (wait_for_bit_change(DSI_VC_CTRL(channel), 0, enable) != enable) {
+- DSSERR("Failed to set dsi_vc_enable to %d\n", enable);
+- return -EIO;
+- }
++ if(REG_GET(DSI_VC_CTRL(channel), 15, 15)) /* VC_BUSY */
++ DSSERR("vc(%d) busy when trying to config for VP\n", channel);
+
+- return 0;
++ REG_FLD_MOD(DSI_VC_CTRL(channel), 1, 1, 1); /* SOURCE, 1 = video port */
++
++ dsi_vc_enable(channel, 1);
++
++ dsi.vc[channel].mode = DSI_VC_MODE_VP;
+ }
+
++
+ static void dsi_vc_enable_hs(int channel, bool enable)
+ {
+ DSSDBG("dsi_vc_enable_hs(%d, %d)\n", channel, enable);
+@@ -1788,7 +1820,9 @@ static int dsi_vc_send_bta(int channel)
+ {
+ unsigned long tmo;
+
+- DSSDBG("dsi_vc_send_bta %d\n", channel);
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO &&
++ (dsi.debug_write || dsi.debug_read))
++ DSSDBG("dsi_vc_send_bta %d\n", channel);
+
+ WARN_ON(!mutex_is_locked(&dsi.bus_lock));
+
+@@ -1976,6 +2010,12 @@ int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len)
+
+ BUG_ON(len == 0);
+
++ if (REG_GET(DSI_VC_CTRL(channel), 1, 1) != 0) {
++ DSSERR("vc(%d) not in L4 mode when trying to write\n",
++ channel);
++ return -EIO;
++ }
++
+ if (len == 1) {
+ r = dsi_vc_send_short(channel, DSI_DT_DCS_SHORT_WRITE_0,
+ data[0], 0);
+@@ -2000,9 +2040,6 @@ int dsi_vc_dcs_write(int channel, u8 *data, int len)
+ if (r)
+ return r;
+
+- /* Some devices need time to process the msg in low power mode.
+- This also makes the write synchronous, and checks that
+- the peripheral is still alive */
+ r = dsi_vc_send_bta_sync(channel);
+
+ return r;
+@@ -2016,7 +2053,7 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen)
+ int r;
+
+ if (dsi.debug_read)
+- DSSDBG("dsi_vc_dcs_read\n");
++ DSSDBG("dsi_vc_dcs_read(ch%d, dcs_cmd %u)\n", channel, dcs_cmd);
+
+ r = dsi_vc_send_short(channel, DSI_DT_DCS_READ, dcs_cmd, 0);
+ if (r)
+@@ -2291,10 +2328,7 @@ static int dsi_proto_config(struct omap_dss_device *dssdev)
+
+ dsi_write_reg(DSI_CTRL, r);
+
+- /* we configure vc0 for L4 communication, and
+- * vc1 for dispc */
+- dsi_vc_config(0);
+- dsi_vc_config_vp(1);
++ dsi_vc_initial_config(0);
+
+ /* set all vc targets to peripheral 0 */
+ dsi.vc[0].dest_per = 0;
+@@ -2535,10 +2569,11 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+ int packet_len;
+ u32 l;
+ bool use_te_trigger;
++ const int channel = 0;
+
+ use_te_trigger = dsi.te_enabled && !dsi.use_ext_te;
+
+- if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO)
+ DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
+ x, y, w, h);
+
+@@ -2559,22 +2594,27 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
+ dsi_vc_print_status(1);
+
+ l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
+- dsi_write_reg(DSI_VC_TE(1), l);
++ dsi_write_reg(DSI_VC_TE(channel), l);
+
+- dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
++ dsi_vc_write_long_header(channel, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
+
+ if (use_te_trigger)
+ l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
+ else
+ l = FLD_MOD(l, 1, 31, 31); /* TE_START */
+- dsi_write_reg(DSI_VC_TE(1), l);
++ dsi_write_reg(DSI_VC_TE(channel), l);
+
+ dispc_disable_sidle();
+
+ dss_start_update(dssdev);
+
+- if (use_te_trigger)
+- dsi_vc_send_bta(1);
++ if (use_te_trigger) {
++ /* disable LP_RX_TO, so that we can receive TE. Time to wait
++ * for TE is longer than the timer allows */
++ REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
++
++ dsi_vc_send_bta(channel);
++ }
+ }
+
+ static void dsi_framedone_irq_callback(void *data, u32 mask)
+@@ -2637,19 +2677,12 @@ static void dsi_start_auto_update(struct omap_dss_device *dssdev)
+
+ static int dsi_set_te(struct omap_dss_device *dssdev, bool enable)
+ {
+- dssdev->driver->enable_te(dssdev, enable);
+-
+- if (!dsi.use_ext_te) {
+- if (enable) {
+- /* disable LP_RX_TO, so that we can receive TE. Time
+- * to wait for TE is longer than the timer allows */
+- REG_FLD_MOD(DSI_TIMING2, 0, 15, 15); /* LP_RX_TO */
+- } else {
+- REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
+- }
+- }
+-
+- return 0;
++ int r;
++ r = dssdev->driver->enable_te(dssdev, enable);
++ /* XXX for some reason, DSI TE breaks if we don't wait here.
++ * Panel bug? Needs more studying */
++ msleep(100);
++ return r;
+ }
+
+ static void dsi_handle_framedone(void)
+@@ -2657,8 +2690,14 @@ static void dsi_handle_framedone(void)
+ u32 l;
+ unsigned long tmo;
+ int i = 0;
++ int r;
++ const int channel = 0;
++ u32 te_size;
++ bool use_te_trigger;
++
++ use_te_trigger = dsi.te_enabled && !dsi.use_ext_te;
+
+- l = REG_GET(DSI_VC_TE(1), 23, 0); /* TE_SIZE */
++ l = REG_GET(DSI_VC_TE(channel), 23, 0); /* TE_SIZE */
+
+ /* We get FRAMEDONE when DISPC has finished sending pixels and turns
+ * itself off. However, DSI still has the pixels in its buffers, and is
+@@ -2667,24 +2706,26 @@ static void dsi_handle_framedone(void)
+ * DSI buffers, if any, so we'll just busyloop */
+ if (l > 0) {
+ tmo = jiffies + msecs_to_jiffies(50);
+- while (REG_GET(DSI_VC_TE(1), 23, 0) > 0) { /* TE_SIZE */
++ te_size = REG_GET(DSI_VC_TE(channel), 23, 0); /* TE_SIZE */
++ while (te_size > 0) {
+ i++;
+ if (time_after(jiffies, tmo)) {
+ DSSERR("timeout waiting TE_SIZE to zero: %u\n",
+- REG_GET(DSI_VC_TE(1), 23, 0));
++ te_size);
+ break;
+ }
+ schedule();
++ te_size = REG_GET(DSI_VC_TE(channel), 23, 0); /* TE_SIZE */
+ }
+ }
+
+- if (REG_GET(DSI_VC_TE(1), 30, 30))
++ if (REG_GET(DSI_VC_TE(channel), 30, 30))
+ DSSERR("TE_EN not zero\n");
+
+- if (REG_GET(DSI_VC_TE(1), 31, 31))
++ if (REG_GET(DSI_VC_TE(channel), 31, 31))
+ DSSERR("TE_START not zero\n");
+
+- if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
++ if (dsi.update_mode != OMAP_DSS_UPDATE_AUTO)
+ DSSDBG("FRAMEDONE\n");
+
+ #if 0
+@@ -2698,6 +2739,16 @@ static void dsi_handle_framedone(void)
+ #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC
+ dispc_fake_vsync_irq();
+ #endif
++ if (use_te_trigger) {
++ /* enable LP_RX_TO again after the TE */
++ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
++
++ /* send BTA after the frame, because we need to BTA after
++ * every trasmission for the TE to work */
++ r = dsi_vc_send_bta_sync(channel);
++ if (r)
++ DSSERR("BTA after framedone failed\n");
++ }
+ }
+
+ static int dsi_update_thread(void *data)
+@@ -2768,25 +2819,24 @@ static int dsi_update_thread(void *data)
+ dispc_set_lcd_size(w, h);
+ }
+
+- /* XXX We don't need to send the update area coords to the
+- * panel every time. But for some reason TE doesn't work if we
+- * don't send at least a BTA here... */
+-#if 0
+ if (dsi.active_update_region.dirty) {
+ dsi.active_update_region.dirty = false;
++ /* XXX TODO we don't need to send the coords, if they
++ * are the same that are already programmed to the
++ * panel. That should speed up manual update a bit */
+ device->driver->setup_update(device, x, y, w, h);
+ }
+-#else
+- device->driver->setup_update(device, x, y, w, h);
+-#endif
+-
+- if (dsi.te_enabled && dsi.use_ext_te &&
+- device->driver->wait_for_te)
+- device->driver->wait_for_te(device);
+
+ dsi_perf_mark_start();
+
+ if (device->manager->caps & OMAP_DSS_OVL_MGR_CAP_DISPC) {
++ dsi_vc_config_vp(0);
++
++ if (dsi.te_enabled && dsi.use_ext_te)
++ device->driver->wait_for_te(device);
++
++ dsi.framedone_received = false;
++
+ dsi_update_screen_dispc(device, x, y, w, h);
+
+ /* wait for framedone */
+@@ -2795,8 +2845,6 @@ static int dsi_update_thread(void *data)
+ dsi.framedone_received == true,
+ timeout);
+
+- dsi.framedone_received = false;
+-
+ if (timeout == 0) {
+ DSSERR("framedone timeout\n");
+ DSSERR("failed update %d,%d %dx%d\n",
+@@ -2808,6 +2856,8 @@ static int dsi_update_thread(void *data)
+ dsi_handle_framedone();
+ dsi_perf_show("DISPC");
+ }
++
++ dsi_vc_config_l4(0);
+ } else {
+ dsi_update_screen_l4(device, x, y, w, h);
+ dsi_perf_show("L4");
+@@ -2913,7 +2963,6 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev)
+
+ /* enable interface */
+ dsi_vc_enable(0, 1);
+- dsi_vc_enable(1, 1);
+ dsi_if_enable(1);
+ dsi_force_tx_stop_mode_io();
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0133-DSS2-VRAM-Remove-unused-defines.patch b/recipes/linux/linux-omap-pm/dss2/0133-DSS2-VRAM-Remove-unused-defines.patch
new file mode 100644
index 0000000000..8815149684
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0133-DSS2-VRAM-Remove-unused-defines.patch
@@ -0,0 +1,41 @@
+From bc4dd8997279f25e115e27781a8b9f90315cb3ef Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 1 Jul 2009 12:34:05 +0300
+Subject: [PATCH 133/146] DSS2: VRAM: Remove unused defines
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/vram.c | 11 ++---------
+ 1 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index d4a8110..940c25d 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -1,7 +1,7 @@
+ /*
+- * linux/arch/arm/plat-omap/vram.c
++ * arch/arm/plat-omap/vram.c
+ *
+- * Copyright (C) 2008 Nokia Corporation
++ * Copyright (C) 2009 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+ * Some code and ideas taken from drivers/video/omap/ driver
+@@ -49,13 +49,6 @@
+ /* Maximum size, in reality this is smaller if SRAM is partially locked. */
+ #define OMAP2_SRAM_SIZE 0xa0000 /* 640k */
+
+-#define REG_MAP_SIZE(_page_cnt) \
+- ((_page_cnt + (sizeof(unsigned long) * 8) - 1) / 8)
+-#define REG_MAP_PTR(_rg, _page_nr) \
+- (((_rg)->map) + (_page_nr) / (sizeof(unsigned long) * 8))
+-#define REG_MAP_MASK(_page_nr) \
+- (1 << ((_page_nr) & (sizeof(unsigned long) * 8 - 1)))
+-
+ #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
+
+ /* postponed regions are used to temporarily store region information at boot
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0134-DSS2-VENC-Add-invert_polarity-flag.patch b/recipes/linux/linux-omap-pm/dss2/0134-DSS2-VENC-Add-invert_polarity-flag.patch
new file mode 100644
index 0000000000..57d5c65f94
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0134-DSS2-VENC-Add-invert_polarity-flag.patch
@@ -0,0 +1,65 @@
+From 324ac5a3f4ea601d1854eadff1388a4310ce660e Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 1 Jul 2009 13:43:55 +0300
+Subject: [PATCH 134/146] DSS2: VENC: Add invert_polarity flag
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/display.h | 1 +
+ drivers/video/omap2/dss/venc.c | 21 +++++++++++++--------
+ 2 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
+index 6df28dc..9477ccb 100644
+--- a/arch/arm/plat-omap/include/mach/display.h
++++ b/arch/arm/plat-omap/include/mach/display.h
+@@ -381,6 +381,7 @@ struct omap_dss_device {
+
+ struct {
+ enum omap_dss_venc_type type;
++ bool invert_polarity;
+ } venc;
+ } phy;
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index a9a5a8c..091ecc4 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -510,6 +510,8 @@ void venc_exit(void)
+
+ static void venc_power_on(struct omap_dss_device *dssdev)
+ {
++ u32 l;
++
+ venc_enable_clocks(1);
+
+ venc_reset();
+@@ -518,14 +520,17 @@ static void venc_power_on(struct omap_dss_device *dssdev)
+ dss_set_venc_output(dssdev->phy.venc.type);
+ dss_set_dac_pwrdn_bgz(1);
+
+- if (dssdev->phy.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) {
+- if (cpu_is_omap24xx())
+- venc_write_reg(VENC_OUTPUT_CONTROL, 0x2);
+- else
+- venc_write_reg(VENC_OUTPUT_CONTROL, 0xa);
+- } else { /* S-Video */
+- venc_write_reg(VENC_OUTPUT_CONTROL, 0xd);
+- }
++ l = 0;
++
++ if (dssdev->phy.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE)
++ l |= 1 << 1;
++ else /* S-Video */
++ l |= (1 << 0) | (1 << 2);
++
++ if (dssdev->phy.venc.invert_polarity == false)
++ l |= 1 << 3;
++
++ venc_write_reg(VENC_OUTPUT_CONTROL, l);
+
+ dispc_set_digit_size(dssdev->panel.timings.x_res,
+ dssdev->panel.timings.y_res/2);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0135-DSS2-VRAM-Add-defines-for-VRAM-types.patch b/recipes/linux/linux-omap-pm/dss2/0135-DSS2-VRAM-Add-defines-for-VRAM-types.patch
new file mode 100644
index 0000000000..a139847f4f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0135-DSS2-VRAM-Add-defines-for-VRAM-types.patch
@@ -0,0 +1,89 @@
+From 9a472e2308e253e64652ff35954c05525abfb10a Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 1 Jul 2009 14:42:52 +0300
+Subject: [PATCH 135/146] DSS2: VRAM: Add defines for VRAM types
+
+Also clean up includes a bit.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vram.h | 4 ++++
+ arch/arm/plat-omap/vram.c | 11 +++++------
+ drivers/video/omap2/omapfb/omapfb-main.c | 2 +-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index 494ddde..66b788e 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -24,6 +24,10 @@
+
+ #include <asm/types.h>
+
++#define OMAP_VRAM_MEMTYPE_SDRAM 0
++#define OMAP_VRAM_MEMTYPE_SRAM 1
++#define OMAP_VRAM_MEMTYPE_MAX 1
++
+ extern int omap_vram_add_region(unsigned long paddr, size_t size);
+ extern int omap_vram_free(unsigned long paddr, size_t size);
+ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 940c25d..2954764 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -22,16 +22,15 @@
+
+ /*#define DEBUG*/
+
+-#include <linux/vmalloc.h>
+ #include <linux/kernel.h>
+ #include <linux/mm.h>
+ #include <linux/list.h>
+-#include <linux/dma-mapping.h>
+ #include <linux/seq_file.h>
+ #include <linux/bootmem.h>
+-#include <linux/omapfb.h>
+ #include <linux/completion.h>
+ #include <linux/debugfs.h>
++#include <linux/jiffies.h>
++#include <linux/module.h>
+
+ #include <asm/setup.h>
+
+@@ -82,9 +81,9 @@ static inline int region_mem_type(unsigned long paddr)
+ {
+ if (paddr >= OMAP2_SRAM_START &&
+ paddr < OMAP2_SRAM_START + OMAP2_SRAM_SIZE)
+- return OMAPFB_MEMTYPE_SRAM;
++ return OMAP_VRAM_MEMTYPE_SRAM;
+ else
+- return OMAPFB_MEMTYPE_SDRAM;
++ return OMAP_VRAM_MEMTYPE_SDRAM;
+ }
+
+ static struct vram_region *omap_vram_create_region(unsigned long paddr,
+@@ -374,7 +373,7 @@ int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr)
+ unsigned pages;
+ int r;
+
+- BUG_ON(mtype > OMAPFB_MEMTYPE_MAX || !size);
++ BUG_ON(mtype > OMAP_VRAM_MEMTYPE_MAX || !size);
+
+ DBG("alloc mem type %d size %d\n", mtype, size);
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index b806dc9..45f087f 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1204,7 +1204,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
+
+ if (!paddr) {
+ DBG("allocating %lu bytes for fb %d\n", size, ofbi->id);
+- r = omap_vram_alloc(OMAPFB_MEMTYPE_SDRAM, size, &paddr);
++ r = omap_vram_alloc(OMAP_VRAM_MEMTYPE_SDRAM, size, &paddr);
+ } else {
+ DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr,
+ ofbi->id);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0136-DSS2-VRAM-separate-VRAM-setup-from-the-old-fb-vram.patch b/recipes/linux/linux-omap-pm/dss2/0136-DSS2-VRAM-separate-VRAM-setup-from-the-old-fb-vram.patch
new file mode 100644
index 0000000000..d9a87d12bf
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0136-DSS2-VRAM-separate-VRAM-setup-from-the-old-fb-vram.patch
@@ -0,0 +1,311 @@
+From 623b67b81b32b758915a58816bc75e092aa33bb8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:05:08 +0300
+Subject: [PATCH 136/146] DSS2: VRAM: separate VRAM setup from the old fb vram setup
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/mach-omap2/io.c | 2 +
+ arch/arm/plat-omap/fb.c | 11 +++++-
+ arch/arm/plat-omap/include/mach/vram.h | 6 +++
+ arch/arm/plat-omap/sram.c | 15 +++++---
+ arch/arm/plat-omap/vram.c | 60 ++++++++++++++++----------------
+ include/linux/omapfb.h | 5 +++
+ 6 files changed, 62 insertions(+), 37 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
+index 5c91f36..221c60f 100644
+--- a/arch/arm/mach-omap2/io.c
++++ b/arch/arm/mach-omap2/io.c
+@@ -32,6 +32,7 @@
+ #include <mach/sram.h>
+ #include <mach/sdrc.h>
+ #include <mach/gpmc.h>
++#include <mach/vram.h>
+
+ #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */
+ #include "clock.h"
+@@ -240,6 +241,7 @@ void __init omap2_map_common_io(void)
+ omap2_check_revision();
+ omap_sram_init();
+ omapfb_reserve_sdram();
++ omap_vram_reserve_sdram();
+ }
+
+ /*
+diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
+index 1dc3415..70fbeae 100644
+--- a/arch/arm/plat-omap/fb.c
++++ b/arch/arm/plat-omap/fb.c
+@@ -355,6 +355,16 @@ static inline int omap_init_fb(void)
+
+ arch_initcall(omap_init_fb);
+
++void omapfb_reserve_sdram(void) {}
++unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
++ unsigned long sram_vstart,
++ unsigned long sram_size,
++ unsigned long start_avail,
++ unsigned long size_avail)
++{
++ return 0;
++}
++
+ #else
+
+ void omapfb_reserve_sdram(void) {}
+@@ -367,5 +377,4 @@ unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+ return 0;
+ }
+
+-
+ #endif
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index 66b788e..8d26b05 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -37,4 +37,10 @@ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
+ extern void omap2_set_sdram_vram(u32 size, u32 start);
+ extern void omap2_set_sram_vram(u32 size, u32 start);
+
++extern void omap_vram_reserve_sdram(void);
++extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
++ unsigned long sram_vstart,
++ unsigned long sram_size,
++ unsigned long pstart_avail,
++ unsigned long size_avail);
+ #endif
+diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
+index 4ea7380..26797e7 100644
+--- a/arch/arm/plat-omap/sram.c
++++ b/arch/arm/plat-omap/sram.c
+@@ -19,6 +19,7 @@
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/io.h>
++#include <linux/omapfb.h>
+
+ #include <asm/tlb.h>
+ #include <asm/cacheflush.h>
+@@ -28,6 +29,7 @@
+ #include <mach/sram.h>
+ #include <mach/board.h>
+ #include <mach/cpu.h>
++#include <mach/vram.h>
+
+ #include <mach/control.h>
+
+@@ -76,12 +78,6 @@ static unsigned long omap_sram_base;
+ static unsigned long omap_sram_size;
+ static unsigned long omap_sram_ceil;
+
+-extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
+- unsigned long sram_vstart,
+- unsigned long sram_size,
+- unsigned long pstart_avail,
+- unsigned long size_avail);
+-
+ /*
+ * Depending on the target RAMFS firewall setup, the public usable amount of
+ * SRAM varies. The default accessible size for all device types is 2k. A GP
+@@ -185,6 +181,13 @@ void __init omap_detect_sram(void)
+ omap_sram_start + SRAM_BOOTLOADER_SZ,
+ omap_sram_size - SRAM_BOOTLOADER_SZ);
+ omap_sram_size -= reserved;
++
++ reserved = omap_vram_reserve_sram(omap_sram_start, omap_sram_base,
++ omap_sram_size,
++ omap_sram_start + SRAM_BOOTLOADER_SZ,
++ omap_sram_size - SRAM_BOOTLOADER_SZ);
++ omap_sram_size -= reserved;
++
+ omap_sram_ceil = omap_sram_base + omap_sram_size;
+ }
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 2954764..6c4bc18 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -39,7 +39,7 @@
+ #include <mach/dma.h>
+
+ #ifdef DEBUG
+-#define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__)
++#define DBG(format, ...) pr_debug("VRAM: " format, ## __VA_ARGS__)
+ #else
+ #define DBG(format, ...)
+ #endif
+@@ -239,7 +239,7 @@ static int _omap_vram_reserve(unsigned long paddr, unsigned pages)
+ if (!(start <= paddr && end >= paddr + size - 1))
+ continue;
+ found:
+- DBG("FOUND area start %lx, end %lx\n", start, end);
++ DBG("found area start %lx, end %lx\n", start, end);
+
+ if (omap_vram_create_allocation(rm, paddr, pages) == NULL)
+ return -ENOMEM;
+@@ -352,7 +352,7 @@ found:
+ if (end - start < pages << PAGE_SHIFT)
+ continue;
+
+- DBG("FOUND %lx, end %lx\n", start, end);
++ DBG("found %lx, end %lx\n", start, end);
+
+ alloc = omap_vram_create_allocation(rm, start, pages);
+ if (alloc == NULL)
+@@ -504,30 +504,30 @@ arch_initcall(omap_vram_init);
+ /* boottime vram alloc stuff */
+
+ /* set from board file */
+-static u32 omapfb_sram_vram_start __initdata;
+-static u32 omapfb_sram_vram_size __initdata;
++static u32 omap_vram_sram_start __initdata;
++static u32 omap_vram_sram_size __initdata;
+
+ /* set from board file */
+-static u32 omapfb_sdram_vram_start __initdata;
+-static u32 omapfb_sdram_vram_size __initdata;
++static u32 omap_vram_sdram_start __initdata;
++static u32 omap_vram_sdram_size __initdata;
+
+ /* set from kernel cmdline */
+-static u32 omapfb_def_sdram_vram_size __initdata;
+-static u32 omapfb_def_sdram_vram_start __initdata;
++static u32 omap_vram_def_sdram_size __initdata;
++static u32 omap_vram_def_sdram_start __initdata;
+
+-static void __init omapfb_early_vram(char **p)
++static void __init omap_vram_early_vram(char **p)
+ {
+- omapfb_def_sdram_vram_size = memparse(*p, p);
++ omap_vram_def_sdram_size = memparse(*p, p);
+ if (**p == ',')
+- omapfb_def_sdram_vram_start = simple_strtoul((*p) + 1, p, 16);
++ omap_vram_def_sdram_start = simple_strtoul((*p) + 1, p, 16);
+ }
+-__early_param("vram=", omapfb_early_vram);
++__early_param("vram=", omap_vram_early_vram);
+
+ /*
+ * Called from map_io. We need to call to this early enough so that we
+ * can reserve the fixed SDRAM regions before VM could get hold of them.
+ */
+-void __init omapfb_reserve_sdram(void)
++void __init omap_vram_reserve_sdram(void)
+ {
+ struct bootmem_data *bdata;
+ unsigned long sdram_start, sdram_size;
+@@ -535,14 +535,14 @@ void __init omapfb_reserve_sdram(void)
+ u32 size = 0;
+
+ /* cmdline arg overrides the board file definition */
+- if (omapfb_def_sdram_vram_size) {
+- size = omapfb_def_sdram_vram_size;
+- paddr = omapfb_def_sdram_vram_start;
++ if (omap_vram_def_sdram_size) {
++ size = omap_vram_def_sdram_size;
++ paddr = omap_vram_def_sdram_start;
+ }
+
+ if (!size) {
+- size = omapfb_sdram_vram_size;
+- paddr = omapfb_sdram_vram_start;
++ size = omap_vram_sdram_size;
++ paddr = omap_vram_sdram_start;
+ }
+
+ #ifdef CONFIG_OMAP2_DSS_VRAM_SIZE
+@@ -564,7 +564,7 @@ void __init omapfb_reserve_sdram(void)
+ if (paddr) {
+ if ((paddr & ~PAGE_MASK) || paddr < sdram_start ||
+ paddr + size > sdram_start + sdram_size) {
+- printk(KERN_ERR "Illegal SDRAM region for VRAM\n");
++ pr_err("Illegal SDRAM region for VRAM\n");
+ return;
+ }
+
+@@ -574,7 +574,7 @@ void __init omapfb_reserve_sdram(void)
+ }
+ } else {
+ if (size > sdram_size) {
+- printk(KERN_ERR "Illegal SDRAM size for VRAM\n");
++ pr_err("Illegal SDRAM size for VRAM\n");
+ return;
+ }
+
+@@ -597,7 +597,7 @@ void __init omapfb_reserve_sdram(void)
+ * this point, since the driver built as a module would have problem with
+ * freeing / reallocating the regions.
+ */
+-unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
++unsigned long __init omap_vram_reserve_sram(unsigned long sram_pstart,
+ unsigned long sram_vstart,
+ unsigned long sram_size,
+ unsigned long pstart_avail,
+@@ -608,8 +608,8 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
+ u32 paddr;
+ u32 size;
+
+- paddr = omapfb_sram_vram_start;
+- size = omapfb_sram_vram_size;
++ paddr = omap_vram_sram_start;
++ size = omap_vram_sram_size;
+
+ if (!size)
+ return 0;
+@@ -620,7 +620,7 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
+ if (!paddr) {
+ /* Dynamic allocation */
+ if ((size_avail & PAGE_MASK) < size) {
+- printk(KERN_ERR "Not enough SRAM for VRAM\n");
++ pr_err("Not enough SRAM for VRAM\n");
+ return 0;
+ }
+ size_avail = (size_avail - size) & PAGE_MASK;
+@@ -629,7 +629,7 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
+
+ if (paddr < sram_pstart ||
+ paddr + size > sram_pstart + sram_size) {
+- printk(KERN_ERR "Illegal SRAM region for VRAM\n");
++ pr_err("Illegal SRAM region for VRAM\n");
+ return 0;
+ }
+
+@@ -648,14 +648,14 @@ unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart,
+
+ void __init omap2_set_sdram_vram(u32 size, u32 start)
+ {
+- omapfb_sdram_vram_start = start;
+- omapfb_sdram_vram_size = size;
++ omap_vram_sdram_start = start;
++ omap_vram_sdram_size = size;
+ }
+
+ void __init omap2_set_sram_vram(u32 size, u32 start)
+ {
+- omapfb_sram_vram_start = start;
+- omapfb_sram_vram_size = size;
++ omap_vram_sram_start = start;
++ omap_vram_sram_size = size;
+ }
+
+ #endif
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 0df0df9..67dc375 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -424,6 +424,11 @@ extern struct lcd_ctrl omap2_disp_ctrl;
+ extern void omapfb_set_platform_data(struct omapfb_platform_data *data);
+
+ extern void omapfb_reserve_sdram(void);
++extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
++ unsigned long sram_vstart,
++ unsigned long sram_size,
++ unsigned long pstart_avail,
++ unsigned long size_avail);
+ extern void omapfb_register_panel(struct lcd_panel *panel);
+ extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
+ extern void omapfb_notify_clients(struct omapfb_device *fbdev,
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0137-DSS2-VRFB-Update-license-information.patch b/recipes/linux/linux-omap-pm/dss2/0137-DSS2-VRFB-Update-license-information.patch
new file mode 100644
index 0000000000..e447b07bb0
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0137-DSS2-VRFB-Update-license-information.patch
@@ -0,0 +1,77 @@
+From 87bf295895fd2ee8a9019ddfcbef37cd98d28e20 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:18:43 +0300
+Subject: [PATCH 137/146] DSS2: VRFB: Update license information
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vrfb.h | 15 ++++++---------
+ arch/arm/plat-omap/vrfb.c | 20 ++++++++++++++++++++
+ 2 files changed, 26 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+index 9647d82..1a53c0e 100644
+--- a/arch/arm/plat-omap/include/mach/vrfb.h
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -1,15 +1,12 @@
+ /*
+- * File: arch/arm/plat-omap/include/mach/vrfb.h
+- *
+- * VRFB
++ * VRFB Rotation Engine
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+- * 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 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+@@ -21,8 +18,8 @@
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+-#ifndef __VRFB_H
+-#define __VRFB_H
++#ifndef __OMAP_VRFB_H__
++#define __OMAP_VRFB_H__
+
+ #include <mach/display.h>
+ #define OMAP_VRFB_LINE_LEN 2048
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 201640a..24ea412 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -1,3 +1,23 @@
++/*
++ * VRFB Rotation Engine
++ *
++ * Copyright (C) 2009 Nokia Corporation
++ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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.
++ *
++ * 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 <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/ioport.h>
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0138-DSS2-VRAM-Update-license-information.patch b/recipes/linux/linux-omap-pm/dss2/0138-DSS2-VRAM-Update-license-information.patch
new file mode 100644
index 0000000000..cc83693ac3
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0138-DSS2-VRAM-Update-license-information.patch
@@ -0,0 +1,86 @@
+From 35ef20ad839dafe564b19561fd779af256460152 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:19:20 +0300
+Subject: [PATCH 138/146] DSS2: VRAM: Update license information
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vram.h | 13 ++++++-------
+ arch/arm/plat-omap/vram.c | 24 +++++++++++-------------
+ 2 files changed, 17 insertions(+), 20 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index 8d26b05..f6bb9fb 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -1,13 +1,12 @@
+ /*
+- * File: arch/arm/plat-omap/include/mach/vram.h
++ * VRAM manager for OMAP
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+- * 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 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+@@ -19,8 +18,8 @@
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+-#ifndef __OMAPVRAM_H
+-#define __OMAPVRAM_H
++#ifndef __OMAP_VRAM_H__
++#define __OMAP_VRAM_H__
+
+ #include <asm/types.h>
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 6c4bc18..0fd5b13 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -1,23 +1,21 @@
+ /*
+- * arch/arm/plat-omap/vram.c
++ * VRAM manager for OMAP
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+- * Some code and ideas taken from drivers/video/omap/ driver
+- * by Imre Deak.
++ * 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.
+ *
+- * 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.
++ * 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.
+ *
+- * 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, see <http://www.gnu.org/licenses/>.
++ * 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.
+ */
+
+ /*#define DEBUG*/
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0139-DSS2-VRFB-use-pr_-instead-of-printk.patch b/recipes/linux/linux-omap-pm/dss2/0139-DSS2-VRFB-use-pr_-instead-of-printk.patch
new file mode 100644
index 0000000000..abaf1f73f2
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0139-DSS2-VRFB-use-pr_-instead-of-printk.patch
@@ -0,0 +1,43 @@
+From c9a738cd1c5afda7f7c5a92cce23caa90d901c41 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:21:27 +0300
+Subject: [PATCH 139/146] DSS2: VRFB: use pr_* instead of printk
+
+---
+ arch/arm/plat-omap/vrfb.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 24ea412..f526ee1 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -30,7 +30,7 @@
+ /*#define DEBUG*/
+
+ #ifdef DEBUG
+-#define DBG(format, ...) printk(KERN_DEBUG "VRFB: " format, ## __VA_ARGS__)
++#define DBG(format, ...) pr_debug("VRFB: " format, ## __VA_ARGS__)
+ #else
+ #define DBG(format, ...)
+ #endif
+@@ -229,7 +229,7 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ break;
+
+ if (ctx == VRFB_NUM_CTXS) {
+- printk(KERN_ERR "vrfb: no free contexts\n");
++ pr_err("vrfb: no free contexts\n");
+ r = -EBUSY;
+ goto out;
+ }
+@@ -247,7 +247,7 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
+ for (rot = 0; rot < 4; ++rot) {
+ paddr = SMS_ROT_VIRT_BASE(ctx, rot);
+ if (!request_mem_region(paddr, OMAP_VRFB_SIZE, "vrfb")) {
+- printk(KERN_ERR "vrfb: failed to reserve VRFB "
++ pr_err("vrfb: failed to reserve VRFB "
+ "area for ctx %d, rotation %d\n",
+ ctx, rot * 90);
+ omap_vrfb_release_ctx(vrfb);
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0140-DSS2-VRAM-Change-CONFIG_OMAP2_DSS_VRAM_SIZE-name.patch b/recipes/linux/linux-omap-pm/dss2/0140-DSS2-VRAM-Change-CONFIG_OMAP2_DSS_VRAM_SIZE-name.patch
new file mode 100644
index 0000000000..ea57a9514f
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0140-DSS2-VRAM-Change-CONFIG_OMAP2_DSS_VRAM_SIZE-name.patch
@@ -0,0 +1,49 @@
+From 7f7e699c5481a69428c4c01b291f14a8eec5c52c Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:27:13 +0300
+Subject: [PATCH 140/146] DSS2: VRAM: Change CONFIG_OMAP2_DSS_VRAM_SIZE name
+
+Changed to CONFIG_OMAP2_VRAM_SIZE
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/vram.c | 4 ++--
+ drivers/video/omap2/dss/Kconfig | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 0fd5b13..89ae1cf 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -543,9 +543,9 @@ void __init omap_vram_reserve_sdram(void)
+ paddr = omap_vram_sdram_start;
+ }
+
+-#ifdef CONFIG_OMAP2_DSS_VRAM_SIZE
++#ifdef CONFIG_OMAP2_VRAM_SIZE
+ if (!size) {
+- size = CONFIG_OMAP2_DSS_VRAM_SIZE * 1024 * 1024;
++ size = CONFIG_OMAP2_VRAM_SIZE * 1024 * 1024;
+ paddr = 0;
+ }
+ #endif
+diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
+index f2ce068..71d8dec 100644
+--- a/drivers/video/omap2/dss/Kconfig
++++ b/drivers/video/omap2/dss/Kconfig
+@@ -6,10 +6,10 @@ menuconfig OMAP2_DSS
+
+ if OMAP2_DSS
+
+-config OMAP2_DSS_VRAM_SIZE
++config OMAP2_VRAM_SIZE
+ int "VRAM size (MB)"
+ range 0 32
+- default 4
++ default 0
+ help
+ The amount of SDRAM to reserve at boot time for video RAM use.
+ This VRAM will be used by omapfb and other drivers that need
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0141-DSS2-VRAM-add-CONFIG_OMAP2_VRAM-flag.patch b/recipes/linux/linux-omap-pm/dss2/0141-DSS2-VRAM-add-CONFIG_OMAP2_VRAM-flag.patch
new file mode 100644
index 0000000000..562ad7a1e2
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0141-DSS2-VRAM-add-CONFIG_OMAP2_VRAM-flag.patch
@@ -0,0 +1,141 @@
+From 6f66d2245dc6359f7de98796f5d999a308f74179 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:49:07 +0300
+Subject: [PATCH 141/146] DSS2: VRAM: add CONFIG_OMAP2_VRAM flag
+
+CONFIG_OMAP2_VRAM controls wheter VRAM manager is compiled in or not.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/Kconfig | 3 +++
+ arch/arm/plat-omap/Makefile | 3 ++-
+ arch/arm/plat-omap/include/mach/vram.h | 22 ++++++++++++++++++++--
+ arch/arm/plat-omap/vram.c | 9 ++-------
+ drivers/video/omap2/omapfb/Kconfig | 1 +
+ 5 files changed, 28 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
+index efe85d0..ca06037 100644
+--- a/arch/arm/plat-omap/Kconfig
++++ b/arch/arm/plat-omap/Kconfig
+@@ -183,6 +183,9 @@ config OMAP_SERIAL_WAKE
+ to data on the serial RX line. This allows you to wake the
+ system from serial console.
+
++config OMAP2_VRAM
++ bool
++
+ endmenu
+
+ endif
+diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
+index cfc0967..3232edc 100644
+--- a/arch/arm/plat-omap/Makefile
++++ b/arch/arm/plat-omap/Makefile
+@@ -4,7 +4,7 @@
+
+ # Common support
+ obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
+- usb.o fb.o vram.o vrfb.o io.o
++ usb.o fb.o vrfb.o io.o
+ obj-m :=
+ obj-n :=
+ obj- :=
+@@ -25,3 +25,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)
+ # OMAP mailbox framework
+ obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
+
++obj-$(CONFIG_OMAP2_VRAM) += vram.o
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index f6bb9fb..4f2c2e6 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -21,6 +21,7 @@
+ #ifndef __OMAP_VRAM_H__
+ #define __OMAP_VRAM_H__
+
++#include <linux/autoconf.h>
+ #include <asm/types.h>
+
+ #define OMAP_VRAM_MEMTYPE_SDRAM 0
+@@ -33,8 +34,10 @@ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
+ extern int omap_vram_reserve(unsigned long paddr, size_t size);
+ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
+ unsigned long *largest_free_block);
+-extern void omap2_set_sdram_vram(u32 size, u32 start);
+-extern void omap2_set_sram_vram(u32 size, u32 start);
++
++#ifdef CONFIG_OMAP2_VRAM
++extern void omap_vram_set_sdram_vram(u32 size, u32 start);
++extern void omap_vram_set_sram_vram(u32 size, u32 start);
+
+ extern void omap_vram_reserve_sdram(void);
+ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
+@@ -42,4 +45,19 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
+ unsigned long sram_size,
+ unsigned long pstart_avail,
+ unsigned long size_avail);
++#else
++static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
++static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
++
++static inline void omap_vram_reserve_sdram(void) { }
++static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
++ unsigned long sram_vstart,
++ unsigned long sram_size,
++ unsigned long pstart_avail,
++ unsigned long size_avail)
++{
++ return 0;
++}
++#endif
++
+ #endif
+diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
+index 89ae1cf..634ce23 100644
+--- a/arch/arm/plat-omap/vram.c
++++ b/arch/arm/plat-omap/vram.c
+@@ -46,8 +46,6 @@
+ /* Maximum size, in reality this is smaller if SRAM is partially locked. */
+ #define OMAP2_SRAM_SIZE 0xa0000 /* 640k */
+
+-#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
+-
+ /* postponed regions are used to temporarily store region information at boot
+ * time when we cannot yet allocate the region list */
+ #define MAX_POSTPONED_REGIONS 10
+@@ -644,17 +642,14 @@ unsigned long __init omap_vram_reserve_sram(unsigned long sram_pstart,
+ return reserved;
+ }
+
+-void __init omap2_set_sdram_vram(u32 size, u32 start)
++void __init omap_vram_set_sdram_vram(u32 size, u32 start)
+ {
+ omap_vram_sdram_start = start;
+ omap_vram_sdram_size = size;
+ }
+
+-void __init omap2_set_sram_vram(u32 size, u32 start)
++void __init omap_vram_set_sram_vram(u32 size, u32 start)
+ {
+ omap_vram_sram_start = start;
+ omap_vram_sram_size = size;
+ }
+-
+-#endif
+-
+diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig
+index 4f66033..220c58b 100644
+--- a/drivers/video/omap2/omapfb/Kconfig
++++ b/drivers/video/omap2/omapfb/Kconfig
+@@ -2,6 +2,7 @@ menuconfig FB_OMAP2
+ tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
+ depends on FB && OMAP2_DSS
+
++ select OMAP2_VRAM
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0142-DSS2-VRFB-Add-CONFIG_OMAP2_VRFB-flag.patch b/recipes/linux/linux-omap-pm/dss2/0142-DSS2-VRFB-Add-CONFIG_OMAP2_VRFB-flag.patch
new file mode 100644
index 0000000000..fdf96915b5
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0142-DSS2-VRFB-Add-CONFIG_OMAP2_VRFB-flag.patch
@@ -0,0 +1,61 @@
+From 861c91bae473d89d11bf38036dd68ee7cd33f9c4 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 11:53:26 +0300
+Subject: [PATCH 142/146] DSS2: VRFB: Add CONFIG_OMAP2_VRFB flag
+
+CONFIG_OMAP2_VRFB controls if VRFB is compiled in or not.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/Kconfig | 3 +++
+ arch/arm/plat-omap/Makefile | 3 ++-
+ drivers/video/omap2/omapfb/Kconfig | 1 +
+ 3 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
+index ca06037..2d6ae55 100644
+--- a/arch/arm/plat-omap/Kconfig
++++ b/arch/arm/plat-omap/Kconfig
+@@ -186,6 +186,9 @@ config OMAP_SERIAL_WAKE
+ config OMAP2_VRAM
+ bool
+
++config OMAP2_VRFB
++ bool
++
+ endmenu
+
+ endif
+diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
+index 3232edc..462edf3 100644
+--- a/arch/arm/plat-omap/Makefile
++++ b/arch/arm/plat-omap/Makefile
+@@ -4,7 +4,7 @@
+
+ # Common support
+ obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
+- usb.o fb.o vrfb.o io.o
++ usb.o fb.o io.o
+ obj-m :=
+ obj-n :=
+ obj- :=
+@@ -26,3 +26,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)
+ obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
+
+ obj-$(CONFIG_OMAP2_VRAM) += vram.o
++obj-$(CONFIG_OMAP2_VRFB) += vrfb.o
+diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig
+index 220c58b..bb694cc 100644
+--- a/drivers/video/omap2/omapfb/Kconfig
++++ b/drivers/video/omap2/omapfb/Kconfig
+@@ -3,6 +3,7 @@ menuconfig FB_OMAP2
+ depends on FB && OMAP2_DSS
+
+ select OMAP2_VRAM
++ select OMAP2_VRFB
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0143-DSS2-VRFB-VRAM-fix-checkpatch-warnings.patch b/recipes/linux/linux-omap-pm/dss2/0143-DSS2-VRFB-VRAM-fix-checkpatch-warnings.patch
new file mode 100644
index 0000000000..f9951f3403
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0143-DSS2-VRFB-VRAM-fix-checkpatch-warnings.patch
@@ -0,0 +1,41 @@
+From 3ef64847bf3139f00aa254f1c5dda46b5c13470d Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 15:14:57 +0300
+Subject: [PATCH 143/146] DSS2: VRFB/VRAM: fix checkpatch warnings
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ arch/arm/plat-omap/include/mach/vram.h | 2 +-
+ arch/arm/plat-omap/include/mach/vrfb.h | 3 +--
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
+index 4f2c2e6..fe72f81 100644
+--- a/arch/arm/plat-omap/include/mach/vram.h
++++ b/arch/arm/plat-omap/include/mach/vram.h
+@@ -22,7 +22,7 @@
+ #define __OMAP_VRAM_H__
+
+ #include <linux/autoconf.h>
+-#include <asm/types.h>
++#include <linux/types.h>
+
+ #define OMAP_VRAM_MEMTYPE_SDRAM 0
+ #define OMAP_VRAM_MEMTYPE_SRAM 1
+diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
+index 1a53c0e..dee929c 100644
+--- a/arch/arm/plat-omap/include/mach/vrfb.h
++++ b/arch/arm/plat-omap/include/mach/vrfb.h
+@@ -24,8 +24,7 @@
+ #include <mach/display.h>
+ #define OMAP_VRFB_LINE_LEN 2048
+
+-struct vrfb
+-{
++struct vrfb {
+ u8 context;
+ void __iomem *vaddr[4];
+ unsigned long paddr[4];
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0144-DSS2-fixes-to-dss_omap_3430sdp_defconfig-to-make-it.patch b/recipes/linux/linux-omap-pm/dss2/0144-DSS2-fixes-to-dss_omap_3430sdp_defconfig-to-make-it.patch
new file mode 100644
index 0000000000..908133d04e
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0144-DSS2-fixes-to-dss_omap_3430sdp_defconfig-to-make-it.patch
@@ -0,0 +1,1675 @@
+From 7d29cea64fc73b3f7f4524d4ce27ef721ed8b717 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 16:12:26 +0300
+Subject: [PATCH 144/146] DSS2: fixes to dss_omap_3430sdp_defconfig to make it boot
+
+---
+ arch/arm/configs/dss_omap_3430sdp_defconfig | 866 ++++++++++++++++++---------
+ 1 files changed, 598 insertions(+), 268 deletions(-)
+
+diff --git a/arch/arm/configs/dss_omap_3430sdp_defconfig b/arch/arm/configs/dss_omap_3430sdp_defconfig
+index dc30dce..cf44088 100644
+--- a/arch/arm/configs/dss_omap_3430sdp_defconfig
++++ b/arch/arm/configs/dss_omap_3430sdp_defconfig
+@@ -1,7 +1,7 @@
+ #
+ # Automatically generated make config: don't edit
+-# Linux kernel version: 2.6.29-omap1
+-# Thu Apr 2 11:11:24 2009
++# Linux kernel version: 2.6.31-rc1-omap1
++# Thu Jul 2 17:25:15 2009
+ #
+ CONFIG_ARM=y
+ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+@@ -9,7 +9,6 @@ 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_HAVE_LATENCYTOP_SUPPORT=y
+@@ -18,13 +17,13 @@ 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_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_OPROFILE_ARMV7=y
+ CONFIG_VECTORS_BASE=0xffff0000
+ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++CONFIG_CONSTRUCTORS=y
+
+ #
+ # General setup
+@@ -33,7 +32,7 @@ CONFIG_EXPERIMENTAL=y
+ CONFIG_BROKEN_ON_SMP=y
+ CONFIG_INIT_ENV_ARG_LIMIT=32
+ CONFIG_LOCALVERSION=""
+-CONFIG_LOCALVERSION_AUTO=y
++# CONFIG_LOCALVERSION_AUTO is not set
+ CONFIG_SWAP=y
+ CONFIG_SYSVIPC=y
+ CONFIG_SYSVIPC_SYSCTL=y
+@@ -51,7 +50,8 @@ CONFIG_CLASSIC_RCU=y
+ # CONFIG_PREEMPT_RCU is not set
+ # CONFIG_TREE_RCU_TRACE is not set
+ # CONFIG_PREEMPT_RCU_TRACE is not set
+-# CONFIG_IKCONFIG is not set
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
+ CONFIG_LOG_BUF_SHIFT=14
+ CONFIG_GROUP_SCHED=y
+ CONFIG_FAIR_GROUP_SCHED=y
+@@ -65,6 +65,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
+ # CONFIG_NAMESPACES is not set
+ CONFIG_BLK_DEV_INITRD=y
+ CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++# CONFIG_RD_BZIP2 is not set
++# CONFIG_RD_LZMA is not set
+ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+ CONFIG_SYSCTL=y
+ CONFIG_ANON_INODES=y
+@@ -73,11 +76,11 @@ CONFIG_UID16=y
+ # CONFIG_SYSCTL_SYSCALL is not set
+ CONFIG_KALLSYMS=y
+ # CONFIG_KALLSYMS_ALL is not set
+-CONFIG_KALLSYMS_EXTRA_PASS=y
++# CONFIG_KALLSYMS_EXTRA_PASS is not set
+ CONFIG_HOTPLUG=y
+ CONFIG_PRINTK=y
+ CONFIG_BUG=y
+-CONFIG_ELF_CORE=y
++# CONFIG_ELF_CORE is not set
+ CONFIG_BASE_FULL=y
+ CONFIG_FUTEX=y
+ CONFIG_EPOLL=y
+@@ -86,17 +89,32 @@ CONFIG_TIMERFD=y
+ CONFIG_EVENTFD=y
+ CONFIG_SHMEM=y
+ CONFIG_AIO=y
++
++#
++# Performance Counters
++#
+ CONFIG_VM_EVENT_COUNTERS=y
+-CONFIG_COMPAT_BRK=y
+-CONFIG_SLAB=y
+-# CONFIG_SLUB is not set
++CONFIG_SLUB_DEBUG=y
++# CONFIG_STRIP_ASM_SYMS is not set
++# CONFIG_COMPAT_BRK is not set
++# CONFIG_SLAB is not set
++CONFIG_SLUB=y
+ # CONFIG_SLOB is not set
+-# CONFIG_PROFILING is not set
++CONFIG_PROFILING=y
++CONFIG_TRACEPOINTS=y
++CONFIG_MARKERS=y
++CONFIG_OPROFILE=y
+ CONFIG_HAVE_OPROFILE=y
+ # CONFIG_KPROBES is not set
+ CONFIG_HAVE_KPROBES=y
+ CONFIG_HAVE_KRETPROBES=y
+ CONFIG_HAVE_CLK=y
++
++#
++# GCOV-based kernel profiling
++#
++# CONFIG_GCOV_KERNEL is not set
++# CONFIG_SLOW_WORK is not set
+ CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+ CONFIG_SLABINFO=y
+ CONFIG_RT_MUTEXES=y
+@@ -104,12 +122,11 @@ CONFIG_BASE_SMALL=0
+ CONFIG_MODULES=y
+ # CONFIG_MODULE_FORCE_LOAD is not set
+ CONFIG_MODULE_UNLOAD=y
+-# CONFIG_MODULE_FORCE_UNLOAD is not set
++CONFIG_MODULE_FORCE_UNLOAD=y
+ CONFIG_MODVERSIONS=y
+ CONFIG_MODULE_SRCVERSION_ALL=y
+ CONFIG_BLOCK=y
+-# CONFIG_LBD is not set
+-# CONFIG_BLK_DEV_IO_TRACE is not set
++CONFIG_LBDAF=y
+ # CONFIG_BLK_DEV_BSG is not set
+ # CONFIG_BLK_DEV_INTEGRITY is not set
+
+@@ -120,11 +137,11 @@ CONFIG_IOSCHED_NOOP=y
+ CONFIG_IOSCHED_AS=y
+ CONFIG_IOSCHED_DEADLINE=y
+ CONFIG_IOSCHED_CFQ=y
+-CONFIG_DEFAULT_AS=y
++# CONFIG_DEFAULT_AS is not set
+ # CONFIG_DEFAULT_DEADLINE is not set
+-# CONFIG_DEFAULT_CFQ is not set
++CONFIG_DEFAULT_CFQ=y
+ # CONFIG_DEFAULT_NOOP is not set
+-CONFIG_DEFAULT_IOSCHED="anticipatory"
++CONFIG_DEFAULT_IOSCHED="cfq"
+ CONFIG_FREEZER=y
+
+ #
+@@ -136,12 +153,14 @@ CONFIG_FREEZER=y
+ # CONFIG_ARCH_VERSATILE is not set
+ # CONFIG_ARCH_AT91 is not set
+ # CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_GEMINI is not set
+ # CONFIG_ARCH_EBSA110 is not set
+ # CONFIG_ARCH_EP93XX is not set
+ # CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_STMP3XXX 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
+@@ -150,24 +169,25 @@ CONFIG_FREEZER=y
+ # CONFIG_ARCH_IXP4XX is not set
+ # CONFIG_ARCH_L7200 is not set
+ # CONFIG_ARCH_KIRKWOOD is not set
+-# CONFIG_ARCH_KS8695 is not set
+-# CONFIG_ARCH_NS9XXX is not set
+ # CONFIG_ARCH_LOKI is not set
+ # CONFIG_ARCH_MV78XX0 is not set
+-# CONFIG_ARCH_MXC is not set
+ # CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_W90X900 is not set
+ # CONFIG_ARCH_PNX4008 is not set
+ # CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MSM is not set
+ # CONFIG_ARCH_RPC is not set
+ # CONFIG_ARCH_SA1100 is not set
+ # CONFIG_ARCH_S3C2410 is not set
+ # CONFIG_ARCH_S3C64XX is not set
+ # CONFIG_ARCH_SHARK is not set
+ # CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_U300 is not set
+ # CONFIG_ARCH_DAVINCI is not set
+ CONFIG_ARCH_OMAP=y
+-# CONFIG_ARCH_MSM is not set
+-# CONFIG_ARCH_W90X900 is not set
+
+ #
+ # TI OMAP Implementations
+@@ -176,33 +196,28 @@ CONFIG_ARCH_OMAP_OTG=y
+ # CONFIG_ARCH_OMAP1 is not set
+ # CONFIG_ARCH_OMAP2 is not set
+ CONFIG_ARCH_OMAP3=y
++# CONFIG_ARCH_OMAP4 is not set
+
+ #
+ # OMAP Feature Selections
+ #
+ # CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+ # CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+-CONFIG_OMAP_SMARTREFLEX=y
+-# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
+-CONFIG_OMAP_RESET_CLOCKS=y
+-CONFIG_OMAP_BOOT_TAG=y
+-CONFIG_OMAP_BOOT_REASON=y
+-# CONFIG_OMAP_COMPONENT_VERSION is not set
+-# CONFIG_OMAP_GPIO_SWITCH is not set
++# CONFIG_OMAP_RESET_CLOCKS is not set
+ CONFIG_OMAP_MUX=y
+ CONFIG_OMAP_MUX_DEBUG=y
+ CONFIG_OMAP_MUX_WARNINGS=y
+-# CONFIG_OMAP_MCBSP is not set
++CONFIG_OMAP_MCBSP=y
+ # CONFIG_OMAP_MBOX_FWK is not set
+ # CONFIG_OMAP_MPU_TIMER is not set
+ CONFIG_OMAP_32K_TIMER=y
+ CONFIG_OMAP_32K_TIMER_HZ=128
+-CONFIG_OMAP_TICK_GPTIMER=1
+ CONFIG_OMAP_DM_TIMER=y
+ CONFIG_OMAP_LL_DEBUG_UART1=y
+ # CONFIG_OMAP_LL_DEBUG_UART2 is not set
+ # CONFIG_OMAP_LL_DEBUG_UART3 is not set
+-CONFIG_OMAP_SERIAL_WAKE=y
++CONFIG_OMAP2_VRAM=y
++CONFIG_OMAP2_VRFB=y
+ CONFIG_ARCH_OMAP34XX=y
+ CONFIG_ARCH_OMAP3430=y
+
+@@ -210,12 +225,13 @@ CONFIG_ARCH_OMAP3430=y
+ # OMAP Board Type
+ #
+ # CONFIG_MACH_NOKIA_RX51 is not set
+-# CONFIG_MACH_OMAP_LDP is not set
++CONFIG_MACH_OMAP_LDP=y
+ CONFIG_MACH_OMAP_3430SDP=y
+ # CONFIG_MACH_OMAP3EVM is not set
+-# CONFIG_MACH_OMAP3_BEAGLE is not set
+-# CONFIG_MACH_OVERO is not set
+-# CONFIG_MACH_OMAP3_PANDORA is not set
++CONFIG_MACH_OMAP3_BEAGLE=y
++CONFIG_MACH_OVERO=y
++CONFIG_MACH_OMAP3_PANDORA=y
++# CONFIG_MACH_OMAP_ZOOM2 is not set
+
+ #
+ # Processor Type
+@@ -238,12 +254,15 @@ CONFIG_CPU_CP15_MMU=y
+ # Processor Features
+ #
+ CONFIG_ARM_THUMB=y
+-# CONFIG_ARM_THUMBEE is not set
++CONFIG_ARM_THUMBEE=y
+ # CONFIG_CPU_ICACHE_DISABLE is not set
+ # CONFIG_CPU_DCACHE_DISABLE is not set
+ # CONFIG_CPU_BPREDICT_DISABLE is not set
+ CONFIG_HAS_TLS_REG=y
+-# CONFIG_OUTER_CACHE is not set
++# CONFIG_ARM_ERRATA_430973 is not set
++# CONFIG_ARM_ERRATA_458693 is not set
++# CONFIG_ARM_ERRATA_460075 is not set
++CONFIG_COMMON_CLKDEV=y
+
+ #
+ # Bus support
+@@ -266,10 +285,10 @@ CONFIG_PAGE_OFFSET=0xC0000000
+ # CONFIG_PREEMPT is not set
+ CONFIG_HZ=128
+ CONFIG_AEABI=y
+-CONFIG_OABI_COMPAT=y
+-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
++# CONFIG_OABI_COMPAT is not set
+ # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+ # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM is not set
+ CONFIG_SELECT_MEMORY_MODEL=y
+ CONFIG_FLATMEM_MANUAL=y
+ # CONFIG_DISCONTIGMEM_MANUAL is not set
+@@ -281,23 +300,41 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
+ # CONFIG_PHYS_ADDR_T_64BIT is not set
+ CONFIG_ZONE_DMA_FLAG=0
+ CONFIG_VIRT_TO_BUS=y
+-CONFIG_UNEVICTABLE_LRU=y
+-# CONFIG_LEDS is not set
++CONFIG_HAVE_MLOCK=y
++CONFIG_HAVE_MLOCKED_PAGE_BIT=y
++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
++CONFIG_LEDS=y
+ CONFIG_ALIGNMENT_TRAP=y
++# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+ #
+ # Boot options
+ #
+ CONFIG_ZBOOT_ROM_TEXT=0x0
+ CONFIG_ZBOOT_ROM_BSS=0x0
+-CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
++CONFIG_CMDLINE="console=ttyS2,115200 root=/dev/mmcblk0p3 rootwait debug"
+ # CONFIG_XIP_KERNEL is not set
+-# CONFIG_KEXEC is not set
++CONFIG_KEXEC=y
++CONFIG_ATAGS_PROC=y
+
+ #
+ # CPU Power Management
+ #
+-# CONFIG_CPU_FREQ is not set
++CONFIG_CPU_FREQ=y
++CONFIG_CPU_FREQ_TABLE=y
++# CONFIG_CPU_FREQ_DEBUG is not set
++CONFIG_CPU_FREQ_STAT=y
++CONFIG_CPU_FREQ_STAT_DETAILS=y
++CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
++# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
++# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
++CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
++# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
++CONFIG_CPU_FREQ_GOV_USERSPACE=y
++CONFIG_CPU_FREQ_GOV_ONDEMAND=y
++# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+ # CONFIG_CPU_IDLE is not set
+
+ #
+@@ -307,20 +344,16 @@ CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.16
+ #
+ # At least one emulation must be selected
+ #
+-CONFIG_FPE_NWFPE=y
+-# CONFIG_FPE_NWFPE_XP is not set
+-# CONFIG_FPE_FASTFPE is not set
+ CONFIG_VFP=y
+ CONFIG_VFPv3=y
+-# CONFIG_NEON is not set
++CONFIG_NEON=y
+
+ #
+ # Userspace binary formats
+ #
+ CONFIG_BINFMT_ELF=y
+-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+ CONFIG_HAVE_AOUT=y
+-# CONFIG_BINFMT_AOUT is not set
++CONFIG_BINFMT_AOUT=m
+ CONFIG_BINFMT_MISC=y
+
+ #
+@@ -338,9 +371,8 @@ CONFIG_NET=y
+ #
+ # Networking options
+ #
+-CONFIG_COMPAT_NET_DEV_OPS=y
+ CONFIG_PACKET=y
+-# CONFIG_PACKET_MMAP is not set
++CONFIG_PACKET_MMAP=y
+ CONFIG_UNIX=y
+ CONFIG_XFRM=y
+ # CONFIG_XFRM_USER is not set
+@@ -365,7 +397,7 @@ CONFIG_IP_PNP_RARP=y
+ # 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_TUNNEL=m
+ CONFIG_INET_XFRM_MODE_TRANSPORT=y
+ CONFIG_INET_XFRM_MODE_TUNNEL=y
+ CONFIG_INET_XFRM_MODE_BEET=y
+@@ -376,7 +408,25 @@ CONFIG_INET_TCP_DIAG=y
+ CONFIG_TCP_CONG_CUBIC=y
+ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # CONFIG_TCP_MD5SIG is not set
+-# CONFIG_IPV6 is not set
++CONFIG_IPV6=m
++# CONFIG_IPV6_PRIVACY is not set
++# CONFIG_IPV6_ROUTER_PREF is not set
++# CONFIG_IPV6_OPTIMISTIC_DAD is not set
++# CONFIG_INET6_AH is not set
++# CONFIG_INET6_ESP is not set
++# CONFIG_INET6_IPCOMP is not set
++# CONFIG_IPV6_MIP6 is not set
++# CONFIG_INET6_XFRM_TUNNEL is not set
++# CONFIG_INET6_TUNNEL is not set
++CONFIG_INET6_XFRM_MODE_TRANSPORT=m
++CONFIG_INET6_XFRM_MODE_TUNNEL=m
++CONFIG_INET6_XFRM_MODE_BEET=m
++# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
++CONFIG_IPV6_SIT=m
++CONFIG_IPV6_NDISC_NODETYPE=y
++# CONFIG_IPV6_TUNNEL is not set
++# CONFIG_IPV6_MULTIPLE_TABLES is not set
++# CONFIG_IPV6_MROUTE is not set
+ # CONFIG_NETWORK_SECMARK is not set
+ # CONFIG_NETFILTER is not set
+ # CONFIG_IP_DCCP is not set
+@@ -394,6 +444,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # CONFIG_LAPB is not set
+ # CONFIG_ECONET is not set
+ # CONFIG_WAN_ROUTER is not set
++# CONFIG_PHONET is not set
++# CONFIG_IEEE802154 is not set
+ # CONFIG_NET_SCHED is not set
+ # CONFIG_DCB is not set
+
+@@ -401,18 +453,62 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # Network testing
+ #
+ # CONFIG_NET_PKTGEN is not set
++# CONFIG_NET_DROP_MONITOR is not set
+ # CONFIG_HAMRADIO is not set
+ # CONFIG_CAN is not set
+ # CONFIG_IRDA is not set
+-# CONFIG_BT is not set
++CONFIG_BT=y
++CONFIG_BT_L2CAP=y
++CONFIG_BT_SCO=y
++CONFIG_BT_RFCOMM=y
++CONFIG_BT_RFCOMM_TTY=y
++CONFIG_BT_BNEP=y
++CONFIG_BT_BNEP_MC_FILTER=y
++CONFIG_BT_BNEP_PROTO_FILTER=y
++CONFIG_BT_HIDP=y
++
++#
++# Bluetooth device drivers
++#
++# CONFIG_BT_HCIBTUSB is not set
++# CONFIG_BT_HCIBTSDIO is not set
++CONFIG_BT_HCIUART=y
++CONFIG_BT_HCIUART_H4=y
++CONFIG_BT_HCIUART_BCSP=y
++# CONFIG_BT_HCIUART_LL is not set
++CONFIG_BT_HCIBCM203X=y
++CONFIG_BT_HCIBPA10X=y
++# CONFIG_BT_HCIBFUSB is not set
++# CONFIG_BT_HCIVHCI is not set
+ # CONFIG_AF_RXRPC is not set
+-# CONFIG_PHONET is not set
+ CONFIG_WIRELESS=y
+-# CONFIG_CFG80211 is not set
++CONFIG_CFG80211=y
++# CONFIG_CFG80211_REG_DEBUG is not set
++# CONFIG_CFG80211_DEBUGFS is not set
+ CONFIG_WIRELESS_OLD_REGULATORY=y
+-# CONFIG_WIRELESS_EXT is not set
+-# CONFIG_LIB80211 is not set
+-# CONFIG_MAC80211 is not set
++CONFIG_WIRELESS_EXT=y
++CONFIG_WIRELESS_EXT_SYSFS=y
++CONFIG_LIB80211=y
++CONFIG_LIB80211_CRYPT_WEP=m
++CONFIG_LIB80211_CRYPT_CCMP=m
++CONFIG_LIB80211_CRYPT_TKIP=m
++# CONFIG_LIB80211_DEBUG is not set
++CONFIG_MAC80211=y
++CONFIG_MAC80211_DEFAULT_PS=y
++CONFIG_MAC80211_DEFAULT_PS_VALUE=1
++
++#
++# Rate control algorithm selection
++#
++CONFIG_MAC80211_RC_PID=y
++# CONFIG_MAC80211_RC_MINSTREL is not set
++CONFIG_MAC80211_RC_DEFAULT_PID=y
++# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
++CONFIG_MAC80211_RC_DEFAULT="pid"
++# CONFIG_MAC80211_MESH is not set
++CONFIG_MAC80211_LEDS=y
++# CONFIG_MAC80211_DEBUGFS is not set
++# CONFIG_MAC80211_DEBUG_MENU is not set
+ # CONFIG_WIMAX is not set
+ # CONFIG_RFKILL is not set
+ # CONFIG_NET_9P is not set
+@@ -427,7 +523,9 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_STANDALONE=y
+ CONFIG_PREVENT_FIRMWARE_BUILD=y
+-# CONFIG_FW_LOADER is not set
++CONFIG_FW_LOADER=y
++CONFIG_FIRMWARE_IN_KERNEL=y
++CONFIG_EXTRA_FIRMWARE=""
+ # CONFIG_DEBUG_DRIVER is not set
+ # CONFIG_DEBUG_DEVRES is not set
+ # CONFIG_SYS_HYPERVISOR is not set
+@@ -438,7 +536,7 @@ CONFIG_MTD_CONCAT=y
+ CONFIG_MTD_PARTITIONS=y
+ # CONFIG_MTD_TESTS is not set
+ # CONFIG_MTD_REDBOOT_PARTS is not set
+-CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_CMDLINE_PARTS is not set
+ # CONFIG_MTD_AFS_PARTS is not set
+ # CONFIG_MTD_AR7_PARTS is not set
+
+@@ -458,10 +556,8 @@ CONFIG_MTD_BLOCK=y
+ #
+ # RAM/ROM/Flash chip drivers
+ #
+-CONFIG_MTD_CFI=y
++# CONFIG_MTD_CFI is not set
+ # 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
+@@ -472,10 +568,6 @@ 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=y
+-# CONFIG_MTD_CFI_AMDSTD is not set
+-# 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
+@@ -484,9 +576,6 @@ CONFIG_MTD_CFI_UTIL=y
+ # Mapping drivers for chip access
+ #
+ # CONFIG_MTD_COMPLEX_MAPPINGS is not set
+-# CONFIG_MTD_PHYSMAP is not set
+-# CONFIG_MTD_ARM_INTEGRATOR is not set
+-CONFIG_MTD_OMAP_NOR=y
+ # CONFIG_MTD_PLATRAM is not set
+
+ #
+@@ -507,22 +596,16 @@ CONFIG_MTD_OMAP_NOR=y
+ # CONFIG_MTD_DOC2001PLUS is not set
+ CONFIG_MTD_NAND=y
+ # CONFIG_MTD_NAND_VERIFY_WRITE is not set
+-CONFIG_MTD_NAND_ECC_SMC=y
++# CONFIG_MTD_NAND_ECC_SMC is not set
+ # CONFIG_MTD_NAND_MUSEUM_IDS is not set
+ # CONFIG_MTD_NAND_GPIO is not set
+-CONFIG_MTD_NAND_OMAP2=y
++# CONFIG_MTD_NAND_OMAP2 is not set
+ CONFIG_MTD_NAND_IDS=y
+ # CONFIG_MTD_NAND_DISKONCHIP is not set
+ # CONFIG_MTD_NAND_NANDSIM is not set
+ # CONFIG_MTD_NAND_PLATFORM is not set
+ # CONFIG_MTD_ALAUDA is not set
+-CONFIG_MTD_ONENAND=y
+-CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+-# CONFIG_MTD_ONENAND_GENERIC is not set
+-CONFIG_MTD_ONENAND_OMAP2=y
+-# CONFIG_MTD_ONENAND_OTP is not set
+-# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
+-# CONFIG_MTD_ONENAND_SIM is not set
++# CONFIG_MTD_ONENAND is not set
+
+ #
+ # LPDDR flash memory drivers
+@@ -537,19 +620,23 @@ CONFIG_MTD_ONENAND_OMAP2=y
+ 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_CRYPTOLOOP=m
+ # 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=16384
+ # CONFIG_BLK_DEV_XIP is not set
+-# CONFIG_CDROM_PKTCDVD is not set
++CONFIG_CDROM_PKTCDVD=m
++CONFIG_CDROM_PKTCDVD_BUFFERS=8
++# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+ # CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MG_DISK is not set
+ CONFIG_MISC_DEVICES=y
+ # CONFIG_ICS932S401 is not set
+ # CONFIG_OMAP_STI is not set
+ # CONFIG_ENCLOSURE_SERVICES is not set
++# CONFIG_ISL29003 is not set
+ # CONFIG_C2PORT is not set
+
+ #
+@@ -558,14 +645,15 @@ CONFIG_MISC_DEVICES=y
+ # CONFIG_EEPROM_AT24 is not set
+ # CONFIG_EEPROM_AT25 is not set
+ # CONFIG_EEPROM_LEGACY is not set
+-# CONFIG_EEPROM_93CX6 is not set
++# CONFIG_EEPROM_MAX6875 is not set
++CONFIG_EEPROM_93CX6=m
+ CONFIG_HAVE_IDE=y
+ # CONFIG_IDE is not set
+
+ #
+ # SCSI device support
+ #
+-# CONFIG_RAID_ATTRS is not set
++CONFIG_RAID_ATTRS=m
+ CONFIG_SCSI=y
+ CONFIG_SCSI_DMA=y
+ # CONFIG_SCSI_TGT is not set
+@@ -579,13 +667,9 @@ 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_SG=m
+ # 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_MULTI_LUN=y
+ # CONFIG_SCSI_CONSTANTS is not set
+ # CONFIG_SCSI_LOGGING is not set
+ # CONFIG_SCSI_SCAN_ASYNC is not set
+@@ -602,26 +686,69 @@ CONFIG_SCSI_WAIT_SCAN=m
+ CONFIG_SCSI_LOWLEVEL=y
+ # CONFIG_ISCSI_TCP is not set
+ # CONFIG_LIBFC is not set
++# CONFIG_LIBFCOE is not set
+ # CONFIG_SCSI_DEBUG is not set
+ # CONFIG_SCSI_DH is not set
++# CONFIG_SCSI_OSD_INITIATOR is not set
+ # CONFIG_ATA is not set
+-# CONFIG_MD is not set
++CONFIG_MD=y
++CONFIG_BLK_DEV_MD=m
++CONFIG_MD_LINEAR=m
++CONFIG_MD_RAID0=m
++CONFIG_MD_RAID1=m
++CONFIG_MD_RAID10=m
++CONFIG_MD_RAID456=m
++CONFIG_MD_RAID6_PQ=m
++CONFIG_MD_MULTIPATH=m
++CONFIG_MD_FAULTY=m
++CONFIG_BLK_DEV_DM=m
++# CONFIG_DM_DEBUG is not set
++CONFIG_DM_CRYPT=m
++CONFIG_DM_SNAPSHOT=m
++CONFIG_DM_MIRROR=m
++# CONFIG_DM_LOG_USERSPACE is not set
++CONFIG_DM_ZERO=m
++CONFIG_DM_MULTIPATH=m
++# CONFIG_DM_MULTIPATH_QL is not set
++# CONFIG_DM_MULTIPATH_ST is not set
++CONFIG_DM_DELAY=m
++# CONFIG_DM_UEVENT is not set
+ CONFIG_NETDEVICES=y
+-# CONFIG_DUMMY is not set
++CONFIG_DUMMY=m
+ # CONFIG_BONDING is not set
+ # CONFIG_MACVLAN is not set
+ # CONFIG_EQUALIZER is not set
+-# CONFIG_TUN is not set
++CONFIG_TUN=m
+ # CONFIG_VETH is not set
+-# CONFIG_PHYLIB is not set
++CONFIG_PHYLIB=y
++
++#
++# MII PHY device drivers
++#
++# CONFIG_MARVELL_PHY is not set
++# CONFIG_DAVICOM_PHY is not set
++# CONFIG_QSEMI_PHY is not set
++# CONFIG_LXT_PHY is not set
++# CONFIG_CICADA_PHY is not set
++# CONFIG_VITESSE_PHY is not set
++CONFIG_SMSC_PHY=y
++# CONFIG_BROADCOM_PHY is not set
++# CONFIG_ICPLUS_PHY is not set
++# CONFIG_REALTEK_PHY is not set
++# CONFIG_NATIONAL_PHY is not set
++# CONFIG_STE10XP is not set
++# CONFIG_LSI_ET1011C_PHY is not set
++# CONFIG_FIXED_PHY is not set
++# CONFIG_MDIO_BITBANG is not set
+ CONFIG_NET_ETHERNET=y
+ CONFIG_MII=y
+ # CONFIG_AX88796 is not set
+ CONFIG_SMC91X=y
+ # CONFIG_DM9000 is not set
+ # CONFIG_ENC28J60 is not set
+-# CONFIG_SMC911X is not set
+-# CONFIG_SMSC911X is not set
++# CONFIG_ETHOC is not set
++CONFIG_SMC911X=m
++CONFIG_SMSC911X=m
+ # CONFIG_DNET is not set
+ # CONFIG_IBM_NEW_EMAC_ZMII is not set
+ # CONFIG_IBM_NEW_EMAC_RGMII is not set
+@@ -631,15 +758,41 @@ CONFIG_SMC91X=y
+ # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+ # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+ # CONFIG_B44 is not set
+-CONFIG_NETDEV_1000=y
+-CONFIG_NETDEV_10000=y
++# CONFIG_KS8842 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
+-# CONFIG_IWLWIFI_LEDS is not set
++CONFIG_WLAN_80211=y
++CONFIG_LIBERTAS=y
++CONFIG_LIBERTAS_USB=y
++CONFIG_LIBERTAS_SDIO=y
++# CONFIG_LIBERTAS_SPI is not set
++CONFIG_LIBERTAS_DEBUG=y
++# CONFIG_LIBERTAS_THINFIRM is not set
++# CONFIG_AT76C50X_USB is not set
++CONFIG_USB_ZD1201=m
++# CONFIG_USB_NET_RNDIS_WLAN is not set
++CONFIG_RTL8187=m
++CONFIG_RTL8187_LEDS=y
++# CONFIG_MAC80211_HWSIM is not set
++CONFIG_P54_COMMON=m
++CONFIG_P54_USB=m
++# CONFIG_P54_SPI is not set
++CONFIG_P54_LEDS=y
++# CONFIG_AR9170_USB is not set
++CONFIG_HOSTAP=m
++CONFIG_HOSTAP_FIRMWARE=y
++CONFIG_HOSTAP_FIRMWARE_NVRAM=y
++# CONFIG_B43 is not set
++# CONFIG_B43LEGACY is not set
++# CONFIG_ZD1211RW is not set
++# CONFIG_RT2X00 is not set
++# CONFIG_WL12XX is not set
++# CONFIG_IWM is not set
+
+ #
+ # Enable WiMAX (Networking options) to see the WiMAX drivers
+@@ -648,14 +801,43 @@ CONFIG_NETDEV_10000=y
+ #
+ # 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 is not set
++CONFIG_USB_CATC=m
++CONFIG_USB_KAWETH=m
++CONFIG_USB_PEGASUS=m
++CONFIG_USB_RTL8150=m
++CONFIG_USB_USBNET=y
++CONFIG_USB_NET_AX8817X=y
++CONFIG_USB_NET_CDCETHER=y
++# CONFIG_USB_NET_CDC_EEM is not set
++CONFIG_USB_NET_DM9601=m
++# CONFIG_USB_NET_SMSC95XX 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=m
++CONFIG_USB_NET_CDC_SUBSET=m
++CONFIG_USB_ALI_M5632=y
++CONFIG_USB_AN2720=y
++CONFIG_USB_BELKIN=y
++CONFIG_USB_ARMLINUX=y
++CONFIG_USB_EPSON2888=y
++CONFIG_USB_KC2190=y
++CONFIG_USB_NET_ZAURUS=m
++# CONFIG_USB_NET_INT51X1 is not set
+ # CONFIG_WAN is not set
+-# CONFIG_PPP is not set
++CONFIG_PPP=m
++# CONFIG_PPP_MULTILINK is not set
++# CONFIG_PPP_FILTER is not set
++CONFIG_PPP_ASYNC=m
++CONFIG_PPP_SYNC_TTY=m
++CONFIG_PPP_DEFLATE=m
++CONFIG_PPP_BSDCOMP=m
++CONFIG_PPP_MPPE=m
++CONFIG_PPPOE=m
++# CONFIG_PPPOL2TP is not set
+ # CONFIG_SLIP is not set
++CONFIG_SLHC=m
+ # CONFIG_NETCONSOLE is not set
+ # CONFIG_NETPOLL is not set
+ # CONFIG_NET_POLL_CONTROLLER is not set
+@@ -671,7 +853,10 @@ CONFIG_INPUT=y
+ #
+ # Userland interfaces
+ #
+-# CONFIG_INPUT_MOUSEDEV is not set
++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_EVDEV=y
+ # CONFIG_INPUT_EVBUG is not set
+@@ -686,34 +871,34 @@ CONFIG_INPUT_KEYBOARD=y
+ # CONFIG_KEYBOARD_XTKBD is not set
+ # CONFIG_KEYBOARD_NEWTON is not set
+ # CONFIG_KEYBOARD_STOWAWAY is not set
+-CONFIG_KEYBOARD_TWL4030=y
++# CONFIG_KEYBOARD_LM8323 is not set
+ # CONFIG_KEYBOARD_GPIO is not set
+-# CONFIG_INPUT_MOUSE is not set
++CONFIG_INPUT_MOUSE=y
++CONFIG_MOUSE_PS2=y
++CONFIG_MOUSE_PS2_ALPS=y
++CONFIG_MOUSE_PS2_LOGIPS2PP=y
++CONFIG_MOUSE_PS2_SYNAPTICS=y
++CONFIG_MOUSE_PS2_TRACKPOINT=y
++# CONFIG_MOUSE_PS2_ELANTECH is not set
++# CONFIG_MOUSE_PS2_TOUCHKIT is not set
++# CONFIG_MOUSE_SERIAL is not set
++# CONFIG_MOUSE_APPLETOUCH is not set
++# CONFIG_MOUSE_BCM5974 is not set
++# CONFIG_MOUSE_VSXXXAA is not set
++# CONFIG_MOUSE_GPIO is not set
++# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+ # CONFIG_INPUT_JOYSTICK is not set
+ # CONFIG_INPUT_TABLET is not set
+-CONFIG_INPUT_TOUCHSCREEN=y
+-CONFIG_TOUCHSCREEN_ADS7846=y
+-# CONFIG_TOUCHSCREEN_FUJITSU is not set
+-# CONFIG_TOUCHSCREEN_GUNZE is not set
+-# CONFIG_TOUCHSCREEN_ELO is not set
+-# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+-# CONFIG_TOUCHSCREEN_MTOUCH is not set
+-# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
+-# CONFIG_TOUCHSCREEN_TSC210X is not set
+-# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+-# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+-# CONFIG_TOUCHSCREEN_TSC2007 is not set
++# CONFIG_INPUT_TOUCHSCREEN is not set
+ # CONFIG_INPUT_MISC is not set
+
+ #
+ # Hardware I/O ports
+ #
+-# CONFIG_SERIO is not set
++CONFIG_SERIO=y
++CONFIG_SERIO_SERPORT=y
++CONFIG_SERIO_LIBPS2=y
++# CONFIG_SERIO_RAW is not set
+ # CONFIG_GAMEPORT is not set
+
+ #
+@@ -723,7 +908,7 @@ CONFIG_VT=y
+ CONFIG_CONSOLE_TRANSLATIONS=y
+ CONFIG_VT_CONSOLE=y
+ CONFIG_HW_CONSOLE=y
+-# CONFIG_VT_HW_CONSOLE_BINDING is not set
++CONFIG_VT_HW_CONSOLE_BINDING=y
+ CONFIG_DEVKMEM=y
+ # CONFIG_SERIAL_NONSTANDARD is not set
+
+@@ -743,6 +928,7 @@ CONFIG_SERIAL_8250_RSA=y
+ #
+ # Non-8250 serial port support
+ #
++# CONFIG_SERIAL_MAX3100 is not set
+ CONFIG_SERIAL_CORE=y
+ CONFIG_SERIAL_CORE_CONSOLE=y
+ CONFIG_UNIX98_PTYS=y
+@@ -750,6 +936,7 @@ CONFIG_UNIX98_PTYS=y
+ # CONFIG_LEGACY_PTYS is not set
+ # CONFIG_IPMI_HANDLER is not set
+ CONFIG_HW_RANDOM=y
++# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+ # CONFIG_R3964 is not set
+ # CONFIG_RAW_DRIVER is not set
+ # CONFIG_TCG_TPM is not set
+@@ -765,6 +952,7 @@ CONFIG_I2C_HELPER_AUTO=y
+ #
+ # I2C system bus drivers (mostly embedded / system-on-chip)
+ #
++# CONFIG_I2C_DESIGNWARE is not set
+ # CONFIG_I2C_GPIO is not set
+ # CONFIG_I2C_OCORES is not set
+ CONFIG_I2C_OMAP=y
+@@ -790,10 +978,6 @@ CONFIG_I2C_OMAP=y
+ # CONFIG_SENSORS_PCF8574 is not set
+ # CONFIG_PCF8575 is not set
+ # CONFIG_SENSORS_PCA9539 is not set
+-# CONFIG_SENSORS_PCF8591 is not set
+-# CONFIG_TWL4030_MADC is not set
+-# CONFIG_TWL4030_POWEROFF 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
+@@ -813,14 +997,12 @@ CONFIG_SPI_OMAP24XX=y
+ #
+ # SPI Protocol Masters
+ #
+-# CONFIG_SPI_TSC210X is not set
+-# CONFIG_SPI_TSC2301 is not set
+ # CONFIG_SPI_SPIDEV is not set
+ # CONFIG_SPI_TLE62X0 is not set
+ CONFIG_ARCH_REQUIRE_GPIOLIB=y
+ CONFIG_GPIOLIB=y
+-# CONFIG_DEBUG_GPIO is not set
+-# CONFIG_GPIO_SYSFS is not set
++CONFIG_DEBUG_GPIO=y
++CONFIG_GPIO_SYSFS=y
+
+ #
+ # Memory mapped GPIO expanders:
+@@ -844,8 +1026,78 @@ CONFIG_GPIO_TWL4030=y
+ # CONFIG_GPIO_MAX7301 is not set
+ # CONFIG_GPIO_MCP23S08 is not set
+ # CONFIG_W1 is not set
+-# CONFIG_POWER_SUPPLY is not set
+-# CONFIG_HWMON is not set
++CONFIG_POWER_SUPPLY=m
++# CONFIG_POWER_SUPPLY_DEBUG is not set
++# CONFIG_PDA_POWER is not set
++# CONFIG_BATTERY_DS2760 is not set
++# CONFIG_BATTERY_BQ27x00 is not set
++# CONFIG_BATTERY_MAX17040 is not set
++CONFIG_HWMON=y
++# CONFIG_HWMON_VID is not set
++# CONFIG_SENSORS_AD7414 is not set
++# CONFIG_SENSORS_AD7418 is not set
++# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
++# CONFIG_SENSORS_ADT7470 is not set
++# CONFIG_SENSORS_ADT7473 is not set
++# CONFIG_SENSORS_ADT7475 is not set
++# CONFIG_SENSORS_ATXP1 is not set
++# CONFIG_SENSORS_DS1621 is not set
++# CONFIG_SENSORS_F71805F is not set
++# CONFIG_SENSORS_F71882FG is not set
++# CONFIG_SENSORS_F75375S is not set
++# CONFIG_SENSORS_G760A 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_LM70 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_LTC4215 is not set
++# CONFIG_SENSORS_LTC4245 is not set
++# CONFIG_SENSORS_LM95241 is not set
++# CONFIG_SENSORS_MAX1111 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_PCF8591 is not set
++# CONFIG_SENSORS_SHT15 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_ADS7828 is not set
++# CONFIG_SENSORS_THMC50 is not set
++# CONFIG_SENSORS_TMP401 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_W83L786NG is not set
++# CONFIG_SENSORS_W83627HF is not set
++# CONFIG_SENSORS_W83627EHF is not set
++# CONFIG_SENSORS_LIS3_SPI is not set
++# CONFIG_SENSORS_TSC210X is not set
++# CONFIG_SENSORS_OMAP34XX is not set
++# CONFIG_HWMON_DEBUG_CHIP is not set
+ # CONFIG_THERMAL is not set
+ # CONFIG_THERMAL_HWMON is not set
+ CONFIG_WATCHDOG=y
+@@ -855,7 +1107,8 @@ CONFIG_WATCHDOG_NOWAYOUT=y
+ # Watchdog Device Drivers
+ #
+ # CONFIG_SOFT_WATCHDOG is not set
+-CONFIG_OMAP_WATCHDOG=y
++# CONFIG_OMAP_WATCHDOG is not set
++# CONFIG_TWL4030_WATCHDOG is not set
+
+ #
+ # USB-based Watchdog Cards
+@@ -878,7 +1131,6 @@ CONFIG_SSB_POSSIBLE=y
+ # CONFIG_HTC_PASIC3 is not set
+ # CONFIG_TPS65010 is not set
+ CONFIG_TWL4030_CORE=y
+-# CONFIG_TWL4030_POWER is not set
+ # CONFIG_MFD_TMIO is not set
+ # CONFIG_MFD_T7L66XB is not set
+ # CONFIG_MFD_TC6387XB is not set
+@@ -887,29 +1139,15 @@ CONFIG_TWL4030_CORE=y
+ # CONFIG_MFD_WM8400 is not set
+ # CONFIG_MFD_WM8350_I2C is not set
+ # CONFIG_MFD_PCF50633 is not set
+-
+-#
+-# Multimedia devices
+-#
+-
+-#
+-# Multimedia core support
+-#
+-# CONFIG_VIDEO_DEV is not set
+-# CONFIG_DVB_CORE is not set
+-# CONFIG_VIDEO_MEDIA is not set
+-
+-#
+-# Multimedia drivers
+-#
+-CONFIG_DAB=y
+-# CONFIG_USB_DABUSB is not set
++# CONFIG_AB3100_CORE is not set
++# CONFIG_EZX_PCAP is not set
++# CONFIG_MEDIA_SUPPORT is not set
+
+ #
+ # Graphics support
+ #
+ # CONFIG_VGASTATE is not set
+-CONFIG_VIDEO_OUTPUT_CONTROL=m
++# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+ CONFIG_FB=y
+ # CONFIG_FIRMWARE_EDID is not set
+ # CONFIG_FB_DDC is not set
+@@ -936,10 +1174,11 @@ CONFIG_FB_CFB_IMAGEBLIT=m
+ # CONFIG_FB_VIRTUAL is not set
+ # CONFIG_FB_METRONOME is not set
+ # CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
+ # CONFIG_FB_OMAP_LCD_VGA is not set
+ # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+ CONFIG_OMAP2_DSS=m
+-CONFIG_OMAP2_DSS_VRAM_SIZE=8
++CONFIG_OMAP2_VRAM_SIZE=8
+ CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+ # CONFIG_OMAP2_DSS_RFBI is not set
+ CONFIG_OMAP2_DSS_VENC=y
+@@ -965,7 +1204,11 @@ CONFIG_FB_OMAP2_NUM_FBS=3
+ #
+ # Display device support
+ #
+-# CONFIG_DISPLAY_SUPPORT is not set
++CONFIG_DISPLAY_SUPPORT=y
++
++#
++# Display hardware drivers
++#
+
+ #
+ # Console display driver support
+@@ -977,7 +1220,7 @@ CONFIG_DUMMY_CONSOLE=y
+ # CONFIG_SOUND is not set
+ CONFIG_HID_SUPPORT=y
+ CONFIG_HID=y
+-# CONFIG_HID_DEBUG is not set
++CONFIG_HID_DEBUG=y
+ # CONFIG_HIDRAW is not set
+
+ #
+@@ -990,28 +1233,35 @@ CONFIG_USB_HID=y
+ #
+ # Special HID drivers
+ #
+-CONFIG_HID_COMPAT=y
+-# CONFIG_HID_A4TECH is not set
+-# CONFIG_HID_APPLE is not set
+-# CONFIG_HID_BELKIN is not set
+-# CONFIG_HID_CHERRY is not set
+-# CONFIG_HID_CHICONY is not set
+-# CONFIG_HID_CYPRESS is not set
+-# CONFIG_HID_EZKEY is not set
+-# CONFIG_HID_GYRATION is not set
+-# CONFIG_HID_LOGITECH is not set
+-# CONFIG_HID_MICROSOFT is not set
+-# CONFIG_HID_MONTEREY is not set
++CONFIG_HID_A4TECH=y
++CONFIG_HID_APPLE=y
++CONFIG_HID_BELKIN=y
++CONFIG_HID_CHERRY=y
++CONFIG_HID_CHICONY=y
++CONFIG_HID_CYPRESS=y
++# CONFIG_HID_DRAGONRISE is not set
++CONFIG_HID_EZKEY=y
++# CONFIG_HID_KYE is not set
++CONFIG_HID_GYRATION=y
++# CONFIG_HID_KENSINGTON is not set
++CONFIG_HID_LOGITECH=y
++# CONFIG_LOGITECH_FF is not set
++# CONFIG_LOGIRUMBLEPAD2_FF is not set
++CONFIG_HID_MICROSOFT=y
++CONFIG_HID_MONTEREY=y
+ # CONFIG_HID_NTRIG is not set
+-# CONFIG_HID_PANTHERLORD is not set
+-# CONFIG_HID_PETALYNX is not set
+-# CONFIG_HID_SAMSUNG is not set
+-# CONFIG_HID_SONY is not set
+-# CONFIG_HID_SUNPLUS is not set
+-# CONFIG_GREENASIA_FF is not set
++CONFIG_HID_PANTHERLORD=y
++# CONFIG_PANTHERLORD_FF is not set
++CONFIG_HID_PETALYNX=y
++CONFIG_HID_SAMSUNG=y
++CONFIG_HID_SONY=y
++CONFIG_HID_SUNPLUS=y
++# CONFIG_HID_GREENASIA is not set
++# CONFIG_HID_SMARTJOYPLUS is not set
+ # CONFIG_HID_TOPSEED is not set
+-# CONFIG_THRUSTMASTER_FF is not set
+-# CONFIG_ZEROPLUS_FF is not set
++# CONFIG_HID_THRUSTMASTER is not set
++# CONFIG_HID_WACOM is not set
++# CONFIG_HID_ZEROPLUS is not set
+ CONFIG_USB_SUPPORT=y
+ CONFIG_USB_ARCH_HAS_HCD=y
+ CONFIG_USB_ARCH_HAS_OHCI=y
+@@ -1024,8 +1274,8 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+ # Miscellaneous USB options
+ #
+ CONFIG_USB_DEVICEFS=y
+-# CONFIG_USB_DEVICE_CLASS is not set
+-# CONFIG_USB_DYNAMIC_MINORS is not set
++CONFIG_USB_DEVICE_CLASS=y
++CONFIG_USB_DYNAMIC_MINORS=y
+ CONFIG_USB_SUSPEND=y
+ CONFIG_USB_OTG=y
+ # CONFIG_USB_OTG_WHITELIST is not set
+@@ -1038,13 +1288,10 @@ CONFIG_USB_MON=y
+ # USB Host Controller Drivers
+ #
+ # CONFIG_USB_C67X00_HCD is not set
+-CONFIG_USB_EHCI_HCD=m
+-CONFIG_OMAP_EHCI_PHY_MODE=y
+-# CONFIG_OMAP_EHCI_TLL_MODE is not set
+-# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+-# CONFIG_USB_EHCI_TT_NEWSCHED is not set
++# CONFIG_USB_EHCI_HCD is not set
+ # CONFIG_USB_OXU210HP_HCD is not set
+ # CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_ISP1760_HCD is not set
+ # CONFIG_USB_OHCI_HCD is not set
+ # CONFIG_USB_SL811_HCD is not set
+ # CONFIG_USB_R8A66597_HCD is not set
+@@ -1060,28 +1307,26 @@ CONFIG_USB_MUSB_SOC=y
+ CONFIG_USB_MUSB_OTG=y
+ CONFIG_USB_GADGET_MUSB_HDRC=y
+ CONFIG_USB_MUSB_HDRC_HCD=y
+-# CONFIG_MUSB_PIO_ONLY is not set
+-CONFIG_USB_INVENTRA_DMA=y
+-# CONFIG_USB_TI_CPPI_DMA is not set
++CONFIG_MUSB_PIO_ONLY=y
+ # CONFIG_USB_MUSB_DEBUG is not set
+
+ #
+ # USB Device Class drivers
+ #
+ # CONFIG_USB_ACM is not set
+-# CONFIG_USB_PRINTER is not set
+-# CONFIG_USB_WDM is not set
++CONFIG_USB_PRINTER=y
++CONFIG_USB_WDM=y
+ # CONFIG_USB_TMC is not set
+
+ #
+-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+ #
+
+ #
+-# see USB_STORAGE Help for more information
++# also be needed; see USB_STORAGE Help for more info
+ #
+ CONFIG_USB_STORAGE=y
+-CONFIG_USB_STORAGE_DEBUG=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_ISD200 is not set
+@@ -1120,7 +1365,6 @@ CONFIG_USB_STORAGE_DEBUG=y
+ # 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
+@@ -1128,12 +1372,12 @@ CONFIG_USB_STORAGE_DEBUG=y
+ # CONFIG_USB_LD is not set
+ # CONFIG_USB_TRANCEVIBRATOR is not set
+ # CONFIG_USB_IOWARRIOR is not set
+-CONFIG_USB_TEST=y
++# CONFIG_USB_TEST is not set
+ # CONFIG_USB_ISIGHTFW is not set
+ # CONFIG_USB_VST is not set
+ CONFIG_USB_GADGET=y
+-CONFIG_USB_GADGET_DEBUG=y
+-CONFIG_USB_GADGET_DEBUG_FILES=y
++# CONFIG_USB_GADGET_DEBUG is not set
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
+ # CONFIG_USB_GADGET_DEBUG_FS is not set
+ CONFIG_USB_GADGET_VBUS_DRAW=2
+ CONFIG_USB_GADGET_SELECTED=y
+@@ -1144,6 +1388,7 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_OMAP is not set
+ # CONFIG_USB_GADGET_PXA25X is not set
+ # CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C_HSOTG is not set
+ # CONFIG_USB_GADGET_S3C2410 is not set
+ # CONFIG_USB_GADGET_IMX is not set
+ # CONFIG_USB_GADGET_M66592 is not set
+@@ -1152,11 +1397,13 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_CI13XXX is not set
+ # CONFIG_USB_GADGET_NET2280 is not set
+ # CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_LANGWELL is not set
+ # CONFIG_USB_GADGET_DUMMY_HCD is not set
+ CONFIG_USB_GADGET_DUALSPEED=y
+-CONFIG_USB_ZERO=m
+-# CONFIG_USB_ZERO_HNPTEST is not set
+-# CONFIG_USB_ETH is not set
++# CONFIG_USB_ZERO is not set
++# CONFIG_USB_AUDIO is not set
++CONFIG_USB_ETH=m
++CONFIG_USB_ETH_RNDIS=y
+ # CONFIG_USB_GADGETFS is not set
+ # CONFIG_USB_FILE_STORAGE is not set
+ # CONFIG_USB_G_SERIAL is not set
+@@ -1171,27 +1418,57 @@ CONFIG_USB_OTG_UTILS=y
+ # CONFIG_USB_GPIO_VBUS is not set
+ # CONFIG_ISP1301_OMAP is not set
+ CONFIG_TWL4030_USB=y
++# CONFIG_NOP_USB_XCEIV is not set
+ CONFIG_MMC=y
+ # CONFIG_MMC_DEBUG is not set
+-# CONFIG_MMC_UNSAFE_RESUME is not set
++CONFIG_MMC_UNSAFE_RESUME=y
+
+ #
+ # MMC/SD/SDIO Card Drivers
+ #
+ CONFIG_MMC_BLOCK=y
+ CONFIG_MMC_BLOCK_BOUNCE=y
+-# CONFIG_SDIO_UART is not set
++CONFIG_SDIO_UART=y
+ # CONFIG_MMC_TEST is not set
+
+ #
+ # MMC/SD/SDIO Host Controller Drivers
+ #
+ # CONFIG_MMC_SDHCI is not set
+-CONFIG_MMC_OMAP_HS=m
++CONFIG_MMC_OMAP_HS=y
+ # CONFIG_MMC_SPI is not set
+ # CONFIG_MEMSTICK is not set
+ # CONFIG_ACCESSIBILITY is not set
+-# CONFIG_NEW_LEDS is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++# CONFIG_LEDS_OMAP_DEBUG is not set
++# CONFIG_LEDS_OMAP is not set
++# CONFIG_LEDS_OMAP_PWM is not set
++# CONFIG_LEDS_PCA9532 is not set
++CONFIG_LEDS_GPIO=y
++CONFIG_LEDS_GPIO_PLATFORM=y
++# CONFIG_LEDS_LP5521 is not set
++# CONFIG_LEDS_PCA955X is not set
++# CONFIG_LEDS_DAC124S085 is not set
++# CONFIG_LEDS_BD2802 is not set
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGERS=y
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_GPIO is not set
++# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++
++#
++# iptables trigger is under Netfilter config (LED target)
++#
+ CONFIG_RTC_LIB=y
+ CONFIG_RTC_CLASS=y
+ CONFIG_RTC_HCTOSYS=y
+@@ -1224,6 +1501,7 @@ CONFIG_RTC_DRV_TWL4030=y
+ # CONFIG_RTC_DRV_S35390A is not set
+ # CONFIG_RTC_DRV_FM3130 is not set
+ # CONFIG_RTC_DRV_RX8581 is not set
++# CONFIG_RTC_DRV_RX8025 is not set
+
+ #
+ # SPI RTC drivers
+@@ -1255,12 +1533,16 @@ CONFIG_RTC_DRV_TWL4030=y
+ # on-CPU RTC drivers
+ #
+ # CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
+ CONFIG_REGULATOR=y
+ # CONFIG_REGULATOR_DEBUG is not set
+ # CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+ # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+ # CONFIG_REGULATOR_BQ24022 is not set
++# CONFIG_REGULATOR_MAX1586 is not set
+ CONFIG_REGULATOR_TWL4030=y
++# CONFIG_REGULATOR_LP3971 is not set
+ # CONFIG_UIO is not set
+ # CONFIG_STAGING is not set
+
+@@ -1276,17 +1558,24 @@ CONFIG_EXT2_FS=y
+ # CONFIG_EXT2_FS_XATTR is not set
+ # CONFIG_EXT2_FS_XIP is not set
+ CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+ # CONFIG_EXT3_FS_XATTR is not set
+ # CONFIG_EXT4_FS is not set
+ CONFIG_JBD=y
+ # CONFIG_JBD_DEBUG is not set
+ # CONFIG_REISERFS_FS is not set
+ # CONFIG_JFS_FS is not set
+-# CONFIG_FS_POSIX_ACL is not set
+-CONFIG_FILE_LOCKING=y
+-# CONFIG_XFS_FS is not set
++CONFIG_FS_POSIX_ACL=y
++CONFIG_XFS_FS=m
++# CONFIG_XFS_QUOTA is not set
++# CONFIG_XFS_POSIX_ACL is not set
++# CONFIG_XFS_RT is not set
++# CONFIG_XFS_DEBUG is not set
++# CONFIG_GFS2_FS is not set
+ # CONFIG_OCFS2_FS is not set
+ # CONFIG_BTRFS_FS is not set
++CONFIG_FILE_LOCKING=y
++CONFIG_FSNOTIFY=y
+ CONFIG_DNOTIFY=y
+ CONFIG_INOTIFY=y
+ CONFIG_INOTIFY_USER=y
+@@ -1299,13 +1588,22 @@ CONFIG_QFMT_V2=y
+ CONFIG_QUOTACTL=y
+ # CONFIG_AUTOFS_FS is not set
+ # CONFIG_AUTOFS4_FS is not set
+-# CONFIG_FUSE_FS is not set
++CONFIG_FUSE_FS=m
++# CONFIG_CUSE is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE is not set
+
+ #
+ # CD-ROM/DVD Filesystems
+ #
+-# CONFIG_ISO9660_FS is not set
+-# CONFIG_UDF_FS is not set
++CONFIG_ISO9660_FS=m
++CONFIG_JOLIET=y
++CONFIG_ZISOFS=y
++CONFIG_UDF_FS=m
++CONFIG_UDF_NLS=y
+
+ #
+ # DOS/FAT/NT Filesystems
+@@ -1340,13 +1638,15 @@ CONFIG_JFFS2_FS=y
+ CONFIG_JFFS2_FS_DEBUG=0
+ CONFIG_JFFS2_FS_WRITEBUFFER=y
+ # CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+-# CONFIG_JFFS2_SUMMARY is not set
+-# CONFIG_JFFS2_FS_XATTR is not set
++CONFIG_JFFS2_SUMMARY=y
++CONFIG_JFFS2_FS_XATTR=y
++CONFIG_JFFS2_FS_POSIX_ACL=y
++CONFIG_JFFS2_FS_SECURITY=y
+ CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+ CONFIG_JFFS2_ZLIB=y
+-# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_LZO=y
+ CONFIG_JFFS2_RTIME=y
+-# CONFIG_JFFS2_RUBIN is not set
++CONFIG_JFFS2_RUBIN=y
+ # CONFIG_JFFS2_CMODE_NONE is not set
+ CONFIG_JFFS2_CMODE_PRIORITY=y
+ # CONFIG_JFFS2_CMODE_SIZE is not set
+@@ -1361,19 +1661,21 @@ CONFIG_JFFS2_CMODE_PRIORITY=y
+ # CONFIG_ROMFS_FS is not set
+ # CONFIG_SYSV_FS is not set
+ # CONFIG_UFS_FS is not set
++# CONFIG_NILFS2_FS is not set
+ CONFIG_NETWORK_FILESYSTEMS=y
+ CONFIG_NFS_FS=y
+ CONFIG_NFS_V3=y
+ # CONFIG_NFS_V3_ACL is not set
+ CONFIG_NFS_V4=y
++# CONFIG_NFS_V4_1 is not set
+ CONFIG_ROOT_NFS=y
+ # CONFIG_NFSD is not set
+ CONFIG_LOCKD=y
+ CONFIG_LOCKD_V4=y
++CONFIG_EXPORTFS=m
+ CONFIG_NFS_COMMON=y
+ CONFIG_SUNRPC=y
+ CONFIG_SUNRPC_GSS=y
+-# CONFIG_SUNRPC_REGISTER_V4 is not set
+ CONFIG_RPCSEC_GSS_KRB5=y
+ # CONFIG_RPCSEC_GSS_SPKM3 is not set
+ # CONFIG_SMB_FS is not set
+@@ -1461,11 +1763,16 @@ CONFIG_DEBUG_KERNEL=y
+ CONFIG_DETECT_SOFTLOCKUP=y
+ # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_DETECT_HUNG_TASK=y
++# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
++CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+ CONFIG_SCHED_DEBUG=y
+-# CONFIG_SCHEDSTATS is not set
+-# CONFIG_TIMER_STATS is not set
++CONFIG_SCHEDSTATS=y
++CONFIG_TIMER_STATS=y
+ # CONFIG_DEBUG_OBJECTS is not set
+-# CONFIG_DEBUG_SLAB is not set
++# CONFIG_SLUB_DEBUG_ON is not set
++# CONFIG_SLUB_STATS is not set
++# CONFIG_DEBUG_KMEMLEAK is not set
+ # CONFIG_DEBUG_RT_MUTEXES is not set
+ # CONFIG_RT_MUTEX_TESTER is not set
+ # CONFIG_DEBUG_SPINLOCK is not set
+@@ -1475,16 +1782,16 @@ CONFIG_DEBUG_MUTEXES=y
+ # CONFIG_LOCK_STAT is not set
+ # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+ # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
++CONFIG_STACKTRACE=y
+ # CONFIG_DEBUG_KOBJECT is not set
+ CONFIG_DEBUG_BUGVERBOSE=y
+-CONFIG_DEBUG_INFO=y
++# CONFIG_DEBUG_INFO is not set
+ # CONFIG_DEBUG_VM is not set
+ # CONFIG_DEBUG_WRITECOUNT is not set
+ # CONFIG_DEBUG_MEMORY_INIT is not set
+ # CONFIG_DEBUG_LIST is not set
+ # CONFIG_DEBUG_SG is not set
+ # CONFIG_DEBUG_NOTIFIERS is not set
+-CONFIG_FRAME_POINTER=y
+ # CONFIG_BOOT_PRINTK_DELAY is not set
+ # CONFIG_RCU_TORTURE_TEST is not set
+ # CONFIG_RCU_CPU_STALL_DETECTOR is not set
+@@ -1492,22 +1799,33 @@ CONFIG_FRAME_POINTER=y
+ # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+ # CONFIG_FAULT_INJECTION is not set
+ # CONFIG_LATENCYTOP is not set
++# CONFIG_PAGE_POISONING is not set
++CONFIG_NOP_TRACER=y
+ CONFIG_HAVE_FUNCTION_TRACER=y
+-
+-#
+-# Tracers
+-#
++CONFIG_RING_BUFFER=y
++CONFIG_EVENT_TRACING=y
++CONFIG_CONTEXT_SWITCH_TRACER=y
++CONFIG_TRACING=y
++CONFIG_TRACING_SUPPORT=y
++CONFIG_FTRACE=y
+ # CONFIG_FUNCTION_TRACER is not set
+ # CONFIG_IRQSOFF_TRACER is not set
+ # CONFIG_SCHED_TRACER is not set
+-# CONFIG_CONTEXT_SWITCH_TRACER is not set
++# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+ # CONFIG_BOOT_TRACER is not set
+-# CONFIG_TRACE_BRANCH_PROFILING is not set
++CONFIG_BRANCH_PROFILE_NONE=y
++# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
++# CONFIG_PROFILE_ALL_BRANCHES is not set
+ # CONFIG_STACK_TRACER is not set
+-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++# CONFIG_KMEMTRACE is not set
++# CONFIG_WORKQUEUE_TRACER is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_RING_BUFFER_BENCHMARK is not set
++# CONFIG_DYNAMIC_DEBUG is not set
+ # CONFIG_SAMPLES is not set
+ CONFIG_HAVE_ARCH_KGDB=y
+ # CONFIG_KGDB is not set
++CONFIG_ARM_UNWIND=y
+ CONFIG_DEBUG_USER=y
+ CONFIG_DEBUG_ERRORS=y
+ # CONFIG_DEBUG_STACK_USAGE is not set
+@@ -1520,6 +1838,10 @@ CONFIG_DEBUG_ERRORS=y
+ # CONFIG_SECURITY is not set
+ # CONFIG_SECURITYFS is not set
+ # CONFIG_SECURITY_FILE_CAPABILITIES is not set
++CONFIG_XOR_BLOCKS=m
++CONFIG_ASYNC_CORE=m
++CONFIG_ASYNC_MEMCPY=m
++CONFIG_ASYNC_XOR=m
+ CONFIG_CRYPTO=y
+
+ #
+@@ -1534,13 +1856,15 @@ CONFIG_CRYPTO_BLKCIPHER2=y
+ CONFIG_CRYPTO_HASH=y
+ CONFIG_CRYPTO_HASH2=y
+ CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_PCOMP=y
+ CONFIG_CRYPTO_MANAGER=y
+ CONFIG_CRYPTO_MANAGER2=y
+-# CONFIG_CRYPTO_GF128MUL is not set
+-# CONFIG_CRYPTO_NULL is not set
+-# CONFIG_CRYPTO_CRYPTD is not set
++CONFIG_CRYPTO_GF128MUL=m
++CONFIG_CRYPTO_NULL=m
++CONFIG_CRYPTO_WORKQUEUE=y
++CONFIG_CRYPTO_CRYPTD=m
+ # CONFIG_CRYPTO_AUTHENC is not set
+-# CONFIG_CRYPTO_TEST is not set
++CONFIG_CRYPTO_TEST=m
+
+ #
+ # Authenticated Encryption with Associated Data
+@@ -1555,57 +1879,59 @@ CONFIG_CRYPTO_MANAGER2=y
+ CONFIG_CRYPTO_CBC=y
+ # CONFIG_CRYPTO_CTR is not set
+ # CONFIG_CRYPTO_CTS is not set
+-CONFIG_CRYPTO_ECB=m
+-# CONFIG_CRYPTO_LRW is not set
++CONFIG_CRYPTO_ECB=y
++CONFIG_CRYPTO_LRW=m
+ CONFIG_CRYPTO_PCBC=m
+ # CONFIG_CRYPTO_XTS is not set
+
+ #
+ # Hash modes
+ #
+-# CONFIG_CRYPTO_HMAC is not set
+-# CONFIG_CRYPTO_XCBC is not set
++CONFIG_CRYPTO_HMAC=m
++CONFIG_CRYPTO_XCBC=m
+
+ #
+ # Digest
+ #
+ CONFIG_CRYPTO_CRC32C=y
+-# CONFIG_CRYPTO_MD4 is not set
++CONFIG_CRYPTO_MD4=m
+ CONFIG_CRYPTO_MD5=y
+-# CONFIG_CRYPTO_MICHAEL_MIC is not set
++CONFIG_CRYPTO_MICHAEL_MIC=y
+ # CONFIG_CRYPTO_RMD128 is not set
+ # CONFIG_CRYPTO_RMD160 is not set
+ # CONFIG_CRYPTO_RMD256 is not set
+ # CONFIG_CRYPTO_RMD320 is not set
+-# CONFIG_CRYPTO_SHA1 is not set
+-# CONFIG_CRYPTO_SHA256 is not set
+-# CONFIG_CRYPTO_SHA512 is not set
+-# CONFIG_CRYPTO_TGR192 is not set
+-# CONFIG_CRYPTO_WP512 is not set
++CONFIG_CRYPTO_SHA1=m
++CONFIG_CRYPTO_SHA256=m
++CONFIG_CRYPTO_SHA512=m
++CONFIG_CRYPTO_TGR192=m
++CONFIG_CRYPTO_WP512=m
+
+ #
+ # Ciphers
+ #
+-# CONFIG_CRYPTO_AES is not set
+-# CONFIG_CRYPTO_ANUBIS is not set
+-# CONFIG_CRYPTO_ARC4 is not set
+-# CONFIG_CRYPTO_BLOWFISH is not set
+-# CONFIG_CRYPTO_CAMELLIA is not set
+-# CONFIG_CRYPTO_CAST5 is not set
+-# CONFIG_CRYPTO_CAST6 is not set
++CONFIG_CRYPTO_AES=y
++CONFIG_CRYPTO_ANUBIS=m
++CONFIG_CRYPTO_ARC4=y
++CONFIG_CRYPTO_BLOWFISH=m
++CONFIG_CRYPTO_CAMELLIA=m
++CONFIG_CRYPTO_CAST5=m
++CONFIG_CRYPTO_CAST6=m
+ CONFIG_CRYPTO_DES=y
+-# CONFIG_CRYPTO_FCRYPT is not set
+-# CONFIG_CRYPTO_KHAZAD is not set
++CONFIG_CRYPTO_FCRYPT=m
++CONFIG_CRYPTO_KHAZAD=m
+ # CONFIG_CRYPTO_SALSA20 is not set
+ # CONFIG_CRYPTO_SEED is not set
+-# CONFIG_CRYPTO_SERPENT is not set
+-# CONFIG_CRYPTO_TEA is not set
+-# CONFIG_CRYPTO_TWOFISH is not set
++CONFIG_CRYPTO_SERPENT=m
++CONFIG_CRYPTO_TEA=m
++CONFIG_CRYPTO_TWOFISH=m
++CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+ #
+ # Compression
+ #
+-# CONFIG_CRYPTO_DEFLATE is not set
++CONFIG_CRYPTO_DEFLATE=m
++# CONFIG_CRYPTO_ZLIB is not set
+ # CONFIG_CRYPTO_LZO is not set
+
+ #
+@@ -1613,6 +1939,7 @@ CONFIG_CRYPTO_DES=y
+ #
+ # CONFIG_CRYPTO_ANSI_CPRNG is not set
+ CONFIG_CRYPTO_HW=y
++CONFIG_BINARY_PRINTF=y
+
+ #
+ # Library routines
+@@ -1620,15 +1947,18 @@ CONFIG_CRYPTO_HW=y
+ CONFIG_BITREVERSE=y
+ CONFIG_GENERIC_FIND_LAST_BIT=y
+ CONFIG_CRC_CCITT=y
+-# CONFIG_CRC16 is not set
+-# CONFIG_CRC_T10DIF is not set
+-# CONFIG_CRC_ITU_T is not set
++CONFIG_CRC16=m
++CONFIG_CRC_T10DIF=y
++CONFIG_CRC_ITU_T=y
+ CONFIG_CRC32=y
+-# CONFIG_CRC7 is not set
++CONFIG_CRC7=y
+ CONFIG_LIBCRC32C=y
+ CONFIG_ZLIB_INFLATE=y
+ CONFIG_ZLIB_DEFLATE=y
+-CONFIG_PLIST=y
++CONFIG_LZO_COMPRESS=y
++CONFIG_LZO_DECOMPRESS=y
++CONFIG_DECOMPRESS_GZIP=y
+ CONFIG_HAS_IOMEM=y
+ CONFIG_HAS_IOPORT=y
+ CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0145-DSS2-BEAGLE-get-DSS2-working-again-on-beagle.patch b/recipes/linux/linux-omap-pm/dss2/0145-DSS2-BEAGLE-get-DSS2-working-again-on-beagle.patch
new file mode 100644
index 0000000000..dee24393c5
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0145-DSS2-BEAGLE-get-DSS2-working-again-on-beagle.patch
@@ -0,0 +1,724 @@
+From 9389c500be4538327d33d656b73f0830cbb24d8d Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Jul 2009 17:03:35 +0300
+Subject: [PATCH 145/146] DSS2: BEAGLE: get DSS2 working again on beagle
+
+---
+ arch/arm/configs/dss_omap3_beagle_defconfig | 185 +++++++++++++++------------
+ arch/arm/mach-omap2/board-omap3beagle.c | 30 +---
+ 2 files changed, 111 insertions(+), 104 deletions(-)
+
+diff --git a/arch/arm/configs/dss_omap3_beagle_defconfig b/arch/arm/configs/dss_omap3_beagle_defconfig
+index 7143168..2d6a70f 100644
+--- a/arch/arm/configs/dss_omap3_beagle_defconfig
++++ b/arch/arm/configs/dss_omap3_beagle_defconfig
+@@ -1,7 +1,7 @@
+ #
+ # Automatically generated make config: don't edit
+-# Linux kernel version: 2.6.29-omap1
+-# Thu Apr 2 11:24:09 2009
++# Linux kernel version: 2.6.31-rc1-omap1
++# Thu Jul 2 17:25:47 2009
+ #
+ CONFIG_ARM=y
+ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+@@ -9,7 +9,6 @@ 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_HAVE_LATENCYTOP_SUPPORT=y
+@@ -18,13 +17,12 @@ 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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+ CONFIG_VECTORS_BASE=0xffff0000
+ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++CONFIG_CONSTRUCTORS=y
+
+ #
+ # General setup
+@@ -33,7 +31,7 @@ CONFIG_EXPERIMENTAL=y
+ CONFIG_BROKEN_ON_SMP=y
+ CONFIG_INIT_ENV_ARG_LIMIT=32
+ CONFIG_LOCALVERSION=""
+-CONFIG_LOCALVERSION_AUTO=y
++# CONFIG_LOCALVERSION_AUTO is not set
+ CONFIG_SWAP=y
+ CONFIG_SYSVIPC=y
+ CONFIG_SYSVIPC_SYSCTL=y
+@@ -65,6 +63,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
+ # CONFIG_NAMESPACES is not set
+ CONFIG_BLK_DEV_INITRD=y
+ CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++# CONFIG_RD_BZIP2 is not set
++# CONFIG_RD_LZMA is not set
+ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+ CONFIG_SYSCTL=y
+ CONFIG_ANON_INODES=y
+@@ -86,17 +87,29 @@ CONFIG_TIMERFD=y
+ CONFIG_EVENTFD=y
+ CONFIG_SHMEM=y
+ CONFIG_AIO=y
++
++#
++# Performance Counters
++#
+ CONFIG_VM_EVENT_COUNTERS=y
++# CONFIG_STRIP_ASM_SYMS is not set
+ CONFIG_COMPAT_BRK=y
+ CONFIG_SLAB=y
+ # CONFIG_SLUB is not set
+ # CONFIG_SLOB is not set
+ # CONFIG_PROFILING is not set
++# CONFIG_MARKERS is not set
+ CONFIG_HAVE_OPROFILE=y
+ # CONFIG_KPROBES is not set
+ CONFIG_HAVE_KPROBES=y
+ CONFIG_HAVE_KRETPROBES=y
+ CONFIG_HAVE_CLK=y
++
++#
++# GCOV-based kernel profiling
++#
++# CONFIG_GCOV_KERNEL is not set
++# CONFIG_SLOW_WORK is not set
+ CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+ CONFIG_SLABINFO=y
+ CONFIG_RT_MUTEXES=y
+@@ -108,8 +121,7 @@ CONFIG_MODULE_UNLOAD=y
+ CONFIG_MODVERSIONS=y
+ CONFIG_MODULE_SRCVERSION_ALL=y
+ CONFIG_BLOCK=y
+-# CONFIG_LBD is not set
+-# CONFIG_BLK_DEV_IO_TRACE is not set
++CONFIG_LBDAF=y
+ # CONFIG_BLK_DEV_BSG is not set
+ # CONFIG_BLK_DEV_INTEGRITY is not set
+
+@@ -136,12 +148,14 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
+ # CONFIG_ARCH_VERSATILE is not set
+ # CONFIG_ARCH_AT91 is not set
+ # CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_GEMINI is not set
+ # CONFIG_ARCH_EBSA110 is not set
+ # CONFIG_ARCH_EP93XX is not set
+ # CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_STMP3XXX 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
+@@ -150,24 +164,25 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
+ # CONFIG_ARCH_IXP4XX is not set
+ # CONFIG_ARCH_L7200 is not set
+ # CONFIG_ARCH_KIRKWOOD is not set
+-# CONFIG_ARCH_KS8695 is not set
+-# CONFIG_ARCH_NS9XXX is not set
+ # CONFIG_ARCH_LOKI is not set
+ # CONFIG_ARCH_MV78XX0 is not set
+-# CONFIG_ARCH_MXC is not set
+ # CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_W90X900 is not set
+ # CONFIG_ARCH_PNX4008 is not set
+ # CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MSM is not set
+ # CONFIG_ARCH_RPC is not set
+ # CONFIG_ARCH_SA1100 is not set
+ # CONFIG_ARCH_S3C2410 is not set
+ # CONFIG_ARCH_S3C64XX is not set
+ # CONFIG_ARCH_SHARK is not set
+ # CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_U300 is not set
+ # CONFIG_ARCH_DAVINCI is not set
+ CONFIG_ARCH_OMAP=y
+-# CONFIG_ARCH_MSM is not set
+-# CONFIG_ARCH_W90X900 is not set
+
+ #
+ # TI OMAP Implementations
+@@ -176,29 +191,26 @@ CONFIG_ARCH_OMAP_OTG=y
+ # CONFIG_ARCH_OMAP1 is not set
+ # CONFIG_ARCH_OMAP2 is not set
+ CONFIG_ARCH_OMAP3=y
++# CONFIG_ARCH_OMAP4 is not set
+
+ #
+ # OMAP Feature Selections
+ #
+ # CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+ # CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+-# CONFIG_OMAP_SMARTREFLEX is not set
+ # CONFIG_OMAP_RESET_CLOCKS is not set
+-CONFIG_OMAP_BOOT_TAG=y
+-CONFIG_OMAP_BOOT_REASON=y
+-# CONFIG_OMAP_COMPONENT_VERSION is not set
+-# CONFIG_OMAP_GPIO_SWITCH is not set
+ # CONFIG_OMAP_MUX is not set
+ # CONFIG_OMAP_MCBSP is not set
+ # CONFIG_OMAP_MBOX_FWK is not set
+ # CONFIG_OMAP_MPU_TIMER is not set
+ CONFIG_OMAP_32K_TIMER=y
+ CONFIG_OMAP_32K_TIMER_HZ=128
+-CONFIG_OMAP_TICK_GPTIMER=12
+ CONFIG_OMAP_DM_TIMER=y
+ # CONFIG_OMAP_LL_DEBUG_UART1 is not set
+ # CONFIG_OMAP_LL_DEBUG_UART2 is not set
+ CONFIG_OMAP_LL_DEBUG_UART3=y
++CONFIG_OMAP2_VRAM=y
++CONFIG_OMAP2_VRFB=y
+ CONFIG_ARCH_OMAP34XX=y
+ CONFIG_ARCH_OMAP3430=y
+
+@@ -212,6 +224,7 @@ CONFIG_ARCH_OMAP3430=y
+ CONFIG_MACH_OMAP3_BEAGLE=y
+ # CONFIG_MACH_OVERO is not set
+ # CONFIG_MACH_OMAP3_PANDORA is not set
++# CONFIG_MACH_OMAP_ZOOM2 is not set
+
+ #
+ # Processor Type
+@@ -239,7 +252,10 @@ CONFIG_ARM_THUMB=y
+ # CONFIG_CPU_DCACHE_DISABLE is not set
+ # CONFIG_CPU_BPREDICT_DISABLE is not set
+ CONFIG_HAS_TLS_REG=y
+-# CONFIG_OUTER_CACHE is not set
++# CONFIG_ARM_ERRATA_430973 is not set
++# CONFIG_ARM_ERRATA_458693 is not set
++# CONFIG_ARM_ERRATA_460075 is not set
++CONFIG_COMMON_CLKDEV=y
+
+ #
+ # Bus support
+@@ -263,9 +279,9 @@ CONFIG_PAGE_OFFSET=0xC0000000
+ CONFIG_HZ=128
+ CONFIG_AEABI=y
+ CONFIG_OABI_COMPAT=y
+-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+ # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+ # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM is not set
+ CONFIG_SELECT_MEMORY_MODEL=y
+ CONFIG_FLATMEM_MANUAL=y
+ # CONFIG_DISCONTIGMEM_MANUAL is not set
+@@ -277,16 +293,19 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
+ # CONFIG_PHYS_ADDR_T_64BIT is not set
+ CONFIG_ZONE_DMA_FLAG=0
+ CONFIG_VIRT_TO_BUS=y
+-CONFIG_UNEVICTABLE_LRU=y
++CONFIG_HAVE_MLOCK=y
++CONFIG_HAVE_MLOCKED_PAGE_BIT=y
++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+ # CONFIG_LEDS is not set
+ CONFIG_ALIGNMENT_TRAP=y
++# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+ #
+ # Boot options
+ #
+ CONFIG_ZBOOT_ROM_TEXT=0x0
+ CONFIG_ZBOOT_ROM_BSS=0x0
+-CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.2.14:/tftpboot/rootfs ip=192.168.2.15 nolock,rsize=1024,wsize=1024 rw"
++CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.2.14:/tftpboot/rootfs ip=192.168.2.15 nolock,rsize=1024,wsize=1024 rw console=ttyS2,115200n8"
+ # CONFIG_XIP_KERNEL is not set
+ # CONFIG_KEXEC is not set
+
+@@ -322,17 +341,13 @@ CONFIG_BINFMT_MISC=y
+ #
+ # Power management options
+ #
+-CONFIG_PM=y
+-# CONFIG_PM_DEBUG is not set
+-# CONFIG_SUSPEND is not set
+-# CONFIG_APM_EMULATION is not set
++# CONFIG_PM is not set
+ CONFIG_ARCH_SUSPEND_POSSIBLE=y
+ CONFIG_NET=y
+
+ #
+ # Networking options
+ #
+-CONFIG_COMPAT_NET_DEV_OPS=y
+ CONFIG_PACKET=y
+ # CONFIG_PACKET_MMAP is not set
+ CONFIG_UNIX=y
+@@ -388,6 +403,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # CONFIG_LAPB is not set
+ # CONFIG_ECONET is not set
+ # CONFIG_WAN_ROUTER is not set
++# CONFIG_PHONET is not set
++# CONFIG_IEEE802154 is not set
+ # CONFIG_NET_SCHED is not set
+ # CONFIG_DCB is not set
+
+@@ -400,13 +417,16 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+ # CONFIG_IRDA is not set
+ # CONFIG_BT is not set
+ # CONFIG_AF_RXRPC is not set
+-# CONFIG_PHONET is not set
+ CONFIG_WIRELESS=y
+ # CONFIG_CFG80211 is not set
+-CONFIG_WIRELESS_OLD_REGULATORY=y
++# CONFIG_WIRELESS_OLD_REGULATORY is not set
+ # CONFIG_WIRELESS_EXT is not set
+ # CONFIG_LIB80211 is not set
+-# CONFIG_MAC80211 is not set
++
++#
++# CFG80211 needs to be enabled for MAC80211
++#
++CONFIG_MAC80211_DEFAULT_PS_VALUE=0
+ # CONFIG_WIMAX is not set
+ # CONFIG_RFKILL is not set
+ # CONFIG_NET_9P is not set
+@@ -493,7 +513,7 @@ CONFIG_MTD_NAND=y
+ # CONFIG_MTD_NAND_ECC_SMC is not set
+ # CONFIG_MTD_NAND_MUSEUM_IDS is not set
+ # CONFIG_MTD_NAND_GPIO is not set
+-CONFIG_MTD_NAND_OMAP2=y
++# CONFIG_MTD_NAND_OMAP2 is not set
+ CONFIG_MTD_NAND_IDS=y
+ # CONFIG_MTD_NAND_DISKONCHIP is not set
+ # CONFIG_MTD_NAND_NANDSIM is not set
+@@ -521,6 +541,7 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
+ # CONFIG_BLK_DEV_XIP is not set
+ # CONFIG_CDROM_PKTCDVD is not set
+ # CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MG_DISK is not set
+ # CONFIG_MISC_DEVICES is not set
+ CONFIG_HAVE_IDE=y
+ # CONFIG_IDE is not set
+@@ -544,10 +565,6 @@ CONFIG_BLK_DEV_SD=y
+ # 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
+@@ -565,8 +582,10 @@ CONFIG_SCSI_WAIT_SCAN=m
+ CONFIG_SCSI_LOWLEVEL=y
+ # CONFIG_ISCSI_TCP is not set
+ # CONFIG_LIBFC is not set
++# CONFIG_LIBFCOE is not set
+ # CONFIG_SCSI_DEBUG is not set
+ # CONFIG_SCSI_DH is not set
++# CONFIG_SCSI_OSD_INITIATOR is not set
+ # CONFIG_ATA is not set
+ # CONFIG_MD is not set
+ CONFIG_NETDEVICES=y
+@@ -585,7 +604,6 @@ CONFIG_NETDEVICES=y
+ #
+ # CONFIG_WLAN_PRE80211 is not set
+ # CONFIG_WLAN_80211 is not set
+-# CONFIG_IWLWIFI_LEDS is not set
+
+ #
+ # Enable WiMAX (Networking options) to see the WiMAX drivers
+@@ -663,6 +681,7 @@ CONFIG_UNIX98_PTYS=y
+ # CONFIG_LEGACY_PTYS is not set
+ # CONFIG_IPMI_HANDLER is not set
+ CONFIG_HW_RANDOM=y
++# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+ # CONFIG_R3964 is not set
+ # CONFIG_RAW_DRIVER is not set
+ # CONFIG_TCG_TPM is not set
+@@ -678,6 +697,7 @@ CONFIG_I2C_HELPER_AUTO=y
+ #
+ # I2C system bus drivers (mostly embedded / system-on-chip)
+ #
++# CONFIG_I2C_DESIGNWARE is not set
+ # CONFIG_I2C_GPIO is not set
+ # CONFIG_I2C_OCORES is not set
+ CONFIG_I2C_OMAP=y
+@@ -702,10 +722,6 @@ CONFIG_I2C_OMAP=y
+ # CONFIG_SENSORS_PCF8574 is not set
+ # CONFIG_PCF8575 is not set
+ # CONFIG_SENSORS_PCA9539 is not set
+-# CONFIG_SENSORS_PCF8591 is not set
+-# CONFIG_TWL4030_MADC is not set
+-# CONFIG_TWL4030_POWEROFF 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
+@@ -727,7 +743,7 @@ CONFIG_GPIOLIB=y
+ # CONFIG_GPIO_MAX732X is not set
+ # CONFIG_GPIO_PCA953X is not set
+ # CONFIG_GPIO_PCF857X is not set
+-CONFIG_GPIO_TWL4030=y
++# CONFIG_GPIO_TWL4030 is not set
+
+ #
+ # PCI GPIO expanders:
+@@ -759,7 +775,6 @@ CONFIG_SSB_POSSIBLE=y
+ # CONFIG_HTC_PASIC3 is not set
+ # CONFIG_TPS65010 is not set
+ CONFIG_TWL4030_CORE=y
+-# CONFIG_TWL4030_POWER is not set
+ # CONFIG_MFD_TMIO is not set
+ # CONFIG_MFD_T7L66XB is not set
+ # CONFIG_MFD_TC6387XB is not set
+@@ -768,22 +783,8 @@ CONFIG_TWL4030_CORE=y
+ # CONFIG_MFD_WM8400 is not set
+ # CONFIG_MFD_WM8350_I2C is not set
+ # CONFIG_MFD_PCF50633 is not set
+-
+-#
+-# Multimedia devices
+-#
+-
+-#
+-# Multimedia core support
+-#
+-# CONFIG_VIDEO_DEV is not set
+-# CONFIG_DVB_CORE is not set
+-# CONFIG_VIDEO_MEDIA is not set
+-
+-#
+-# Multimedia drivers
+-#
+-CONFIG_DAB=y
++# CONFIG_AB3100_CORE is not set
++# CONFIG_MEDIA_SUPPORT is not set
+
+ #
+ # Graphics support
+@@ -816,9 +817,10 @@ CONFIG_FB_CFB_IMAGEBLIT=m
+ # CONFIG_FB_VIRTUAL is not set
+ # CONFIG_FB_METRONOME is not set
+ # CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
+ # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+ CONFIG_OMAP2_DSS=m
+-CONFIG_OMAP2_DSS_VRAM_SIZE=12
++CONFIG_OMAP2_VRAM_SIZE=8
+ CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+ # CONFIG_OMAP2_DSS_RFBI is not set
+ CONFIG_OMAP2_DSS_VENC=y
+@@ -860,8 +862,8 @@ CONFIG_USB_ARCH_HAS_HCD=y
+ CONFIG_USB_ARCH_HAS_OHCI=y
+ CONFIG_USB_ARCH_HAS_EHCI=y
+ # CONFIG_USB is not set
+-# CONFIG_USB_OTG_WHITELIST is not set
+-# CONFIG_USB_OTG_BLACKLIST_HUB is not set
++CONFIG_USB_OTG_WHITELIST=y
++CONFIG_USB_OTG_BLACKLIST_HUB=y
+ CONFIG_USB_MUSB_HDRC=y
+ CONFIG_USB_MUSB_SOC=y
+
+@@ -878,7 +880,7 @@ CONFIG_USB_INVENTRA_DMA=y
+ # CONFIG_USB_MUSB_DEBUG is not set
+
+ #
+-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+ #
+ CONFIG_USB_GADGET=y
+ # CONFIG_USB_GADGET_DEBUG is not set
+@@ -893,6 +895,7 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_OMAP is not set
+ # CONFIG_USB_GADGET_PXA25X is not set
+ # CONFIG_USB_GADGET_PXA27X is not set
++# CONFIG_USB_GADGET_S3C_HSOTG is not set
+ # CONFIG_USB_GADGET_S3C2410 is not set
+ # CONFIG_USB_GADGET_IMX is not set
+ # CONFIG_USB_GADGET_M66592 is not set
+@@ -901,9 +904,11 @@ CONFIG_USB_GADGET_SELECTED=y
+ # CONFIG_USB_GADGET_CI13XXX is not set
+ # CONFIG_USB_GADGET_NET2280 is not set
+ # CONFIG_USB_GADGET_GOKU is not set
++# CONFIG_USB_GADGET_LANGWELL is not set
+ # CONFIG_USB_GADGET_DUMMY_HCD is not set
+ CONFIG_USB_GADGET_DUALSPEED=y
+ # CONFIG_USB_ZERO is not set
++# CONFIG_USB_AUDIO is not set
+ CONFIG_USB_ETH=y
+ CONFIG_USB_ETH_RNDIS=y
+ # CONFIG_USB_GADGETFS is not set
+@@ -920,6 +925,7 @@ CONFIG_USB_OTG_UTILS=y
+ # CONFIG_USB_GPIO_VBUS is not set
+ # CONFIG_ISP1301_OMAP is not set
+ CONFIG_TWL4030_USB=y
++# CONFIG_NOP_USB_XCEIV is not set
+ CONFIG_MMC=y
+ # CONFIG_MMC_DEBUG is not set
+ # CONFIG_MMC_UNSAFE_RESUME is not set
+@@ -936,7 +942,7 @@ CONFIG_MMC_BLOCK_BOUNCE=y
+ # MMC/SD/SDIO Host Controller Drivers
+ #
+ # CONFIG_MMC_SDHCI is not set
+-CONFIG_MMC_OMAP_HS=y
++# CONFIG_MMC_OMAP_HS is not set
+ # CONFIG_MEMSTICK is not set
+ # CONFIG_ACCESSIBILITY is not set
+ # CONFIG_NEW_LEDS is not set
+@@ -968,10 +974,11 @@ CONFIG_RTC_INTF_DEV=y
+ # CONFIG_RTC_DRV_PCF8563 is not set
+ # CONFIG_RTC_DRV_PCF8583 is not set
+ # CONFIG_RTC_DRV_M41T80 is not set
+-CONFIG_RTC_DRV_TWL4030=y
++# CONFIG_RTC_DRV_TWL4030 is not set
+ # CONFIG_RTC_DRV_S35390A is not set
+ # CONFIG_RTC_DRV_FM3130 is not set
+ # CONFIG_RTC_DRV_RX8581 is not set
++# CONFIG_RTC_DRV_RX8025 is not set
+
+ #
+ # SPI RTC drivers
+@@ -996,12 +1003,16 @@ CONFIG_RTC_DRV_TWL4030=y
+ # on-CPU RTC drivers
+ #
+ # CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
+ CONFIG_REGULATOR=y
+ # CONFIG_REGULATOR_DEBUG is not set
+ # CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+ # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+ # CONFIG_REGULATOR_BQ24022 is not set
++# CONFIG_REGULATOR_MAX1586 is not set
+ CONFIG_REGULATOR_TWL4030=y
++# CONFIG_REGULATOR_LP3971 is not set
+ # CONFIG_UIO is not set
+ # CONFIG_STAGING is not set
+
+@@ -1017,6 +1028,7 @@ CONFIG_EXT2_FS=y
+ # CONFIG_EXT2_FS_XATTR is not set
+ # CONFIG_EXT2_FS_XIP is not set
+ CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+ # CONFIG_EXT3_FS_XATTR is not set
+ # CONFIG_EXT4_FS is not set
+ CONFIG_JBD=y
+@@ -1024,10 +1036,12 @@ CONFIG_JBD=y
+ # CONFIG_REISERFS_FS is not set
+ # CONFIG_JFS_FS is not set
+ # CONFIG_FS_POSIX_ACL is not set
+-CONFIG_FILE_LOCKING=y
+ # CONFIG_XFS_FS is not set
++# CONFIG_GFS2_FS is not set
+ # CONFIG_OCFS2_FS is not set
+ # CONFIG_BTRFS_FS is not set
++CONFIG_FILE_LOCKING=y
++CONFIG_FSNOTIFY=y
+ CONFIG_DNOTIFY=y
+ CONFIG_INOTIFY=y
+ CONFIG_INOTIFY_USER=y
+@@ -1043,6 +1057,11 @@ CONFIG_QUOTACTL=y
+ # CONFIG_FUSE_FS is not set
+
+ #
++# Caches
++#
++# CONFIG_FSCACHE is not set
++
++#
+ # CD-ROM/DVD Filesystems
+ #
+ # CONFIG_ISO9660_FS is not set
+@@ -1098,11 +1117,13 @@ CONFIG_JFFS2_RTIME=y
+ # CONFIG_ROMFS_FS is not set
+ # CONFIG_SYSV_FS is not set
+ # CONFIG_UFS_FS is not set
++# CONFIG_NILFS2_FS is not set
+ CONFIG_NETWORK_FILESYSTEMS=y
+ CONFIG_NFS_FS=y
+ CONFIG_NFS_V3=y
+ # CONFIG_NFS_V3_ACL is not set
+ CONFIG_NFS_V4=y
++# CONFIG_NFS_V4_1 is not set
+ CONFIG_ROOT_NFS=y
+ # CONFIG_NFSD is not set
+ CONFIG_LOCKD=y
+@@ -1110,7 +1131,6 @@ CONFIG_LOCKD_V4=y
+ CONFIG_NFS_COMMON=y
+ CONFIG_SUNRPC=y
+ CONFIG_SUNRPC_GSS=y
+-# CONFIG_SUNRPC_REGISTER_V4 is not set
+ CONFIG_RPCSEC_GSS_KRB5=y
+ # CONFIG_RPCSEC_GSS_SPKM3 is not set
+ # CONFIG_SMB_FS is not set
+@@ -1198,11 +1218,15 @@ CONFIG_DEBUG_KERNEL=y
+ CONFIG_DETECT_SOFTLOCKUP=y
+ # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
++CONFIG_DETECT_HUNG_TASK=y
++# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
++CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+ CONFIG_SCHED_DEBUG=y
+ # CONFIG_SCHEDSTATS is not set
+ # CONFIG_TIMER_STATS is not set
+ # CONFIG_DEBUG_OBJECTS is not set
+ # CONFIG_DEBUG_SLAB is not set
++# CONFIG_DEBUG_KMEMLEAK is not set
+ # CONFIG_DEBUG_RT_MUTEXES is not set
+ # CONFIG_RT_MUTEX_TESTER is not set
+ # CONFIG_DEBUG_SPINLOCK is not set
+@@ -1221,7 +1245,6 @@ CONFIG_DEBUG_INFO=y
+ # CONFIG_DEBUG_LIST is not set
+ # CONFIG_DEBUG_SG is not set
+ # CONFIG_DEBUG_NOTIFIERS is not set
+-CONFIG_FRAME_POINTER=y
+ # CONFIG_BOOT_PRINTK_DELAY is not set
+ # CONFIG_RCU_TORTURE_TEST is not set
+ # CONFIG_RCU_CPU_STALL_DETECTOR is not set
+@@ -1229,22 +1252,15 @@ CONFIG_FRAME_POINTER=y
+ # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+ # CONFIG_FAULT_INJECTION is not set
+ # CONFIG_LATENCYTOP is not set
++# CONFIG_PAGE_POISONING is not set
+ CONFIG_HAVE_FUNCTION_TRACER=y
+-
+-#
+-# Tracers
+-#
+-# CONFIG_FUNCTION_TRACER is not set
+-# CONFIG_IRQSOFF_TRACER is not set
+-# CONFIG_SCHED_TRACER is not set
+-# CONFIG_CONTEXT_SWITCH_TRACER is not set
+-# CONFIG_BOOT_TRACER is not set
+-# CONFIG_TRACE_BRANCH_PROFILING is not set
+-# CONFIG_STACK_TRACER is not set
+-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
++CONFIG_TRACING_SUPPORT=y
++# CONFIG_FTRACE is not set
++# CONFIG_DYNAMIC_DEBUG is not set
+ # CONFIG_SAMPLES is not set
+ CONFIG_HAVE_ARCH_KGDB=y
+ # CONFIG_KGDB is not set
++CONFIG_ARM_UNWIND=y
+ CONFIG_DEBUG_USER=y
+ CONFIG_DEBUG_ERRORS=y
+ # CONFIG_DEBUG_STACK_USAGE is not set
+@@ -1271,10 +1287,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
+ CONFIG_CRYPTO_HASH=y
+ CONFIG_CRYPTO_HASH2=y
+ CONFIG_CRYPTO_RNG2=y
++CONFIG_CRYPTO_PCOMP=y
+ CONFIG_CRYPTO_MANAGER=y
+ CONFIG_CRYPTO_MANAGER2=y
+ # CONFIG_CRYPTO_GF128MUL is not set
+ # CONFIG_CRYPTO_NULL is not set
++CONFIG_CRYPTO_WORKQUEUE=y
+ # CONFIG_CRYPTO_CRYPTD is not set
+ # CONFIG_CRYPTO_AUTHENC is not set
+ # CONFIG_CRYPTO_TEST is not set
+@@ -1343,6 +1361,7 @@ CONFIG_CRYPTO_DES=y
+ # Compression
+ #
+ # CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_ZLIB is not set
+ # CONFIG_CRYPTO_LZO is not set
+
+ #
+@@ -1350,6 +1369,7 @@ CONFIG_CRYPTO_DES=y
+ #
+ # CONFIG_CRYPTO_ANSI_CPRNG is not set
+ CONFIG_CRYPTO_HW=y
++# CONFIG_BINARY_PRINTF is not set
+
+ #
+ # Library routines
+@@ -1365,7 +1385,8 @@ CONFIG_CRC32=y
+ CONFIG_LIBCRC32C=y
+ CONFIG_ZLIB_INFLATE=y
+ CONFIG_ZLIB_DEFLATE=y
+-CONFIG_PLIST=y
++CONFIG_DECOMPRESS_GZIP=y
+ CONFIG_HAS_IOMEM=y
+ CONFIG_HAS_IOPORT=y
+ CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 977bbbe..25aa7b6 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -136,24 +136,11 @@ static struct omap_dss_device beagle_dvi_device = {
+
+ static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+ {
+-#define ENABLE_VDAC_DEDICATED 0x03
+-#define ENABLE_VDAC_DEV_GRP 0x20
+-
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEDICATED,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+- ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+-
+ return 0;
+ }
+
+ static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+ {
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEDICATED);
+- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+- TWL4030_VDAC_DEV_GRP);
+ }
+
+ static struct omap_dss_device beagle_tv_device = {
+@@ -222,15 +209,6 @@ static struct twl4030_hsmmc_info mmc[] = {
+ {} /* Terminator */
+ };
+
+-static struct platform_device omap3_beagle_lcd_device = {
+- .name = "omap3beagle_lcd",
+- .id = -1,
+-};
+-
+-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
+- .ctrl_name = "internal",
+-};
+-
+ static struct regulator_consumer_supply beagle_vmmc1_supply = {
+ .supply = "vmmc",
+ };
+@@ -316,6 +294,7 @@ static struct regulator_init_data beagle_vdac = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
++ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+@@ -340,11 +319,18 @@ static struct regulator_init_data beagle_vpll2 = {
+ .consumer_supplies = &beagle_vdds_dsi_supply,
+ };
+
++static struct twl4030_usb_data beagle_usb_data = {
++ .usb_mode = T2_USB_MODE_ULPI,
++};
++
+ static struct twl4030_platform_data beagle_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+
+ /* platform_data for children goes here */
++ .usb = &beagle_usb_data,
++
++ /* platform_data for children goes here */
+ .gpio = &beagle_gpio_data,
+ .vmmc1 = &beagle_vmmc1,
+ .vsim = &beagle_vsim,
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/dss2/0146-DSS2-change-include-asm-.-to-linux-.-in-oma.patch b/recipes/linux/linux-omap-pm/dss2/0146-DSS2-change-include-asm-.-to-linux-.-in-oma.patch
new file mode 100644
index 0000000000..7867385443
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0146-DSS2-change-include-asm-.-to-linux-.-in-oma.patch
@@ -0,0 +1,29 @@
+From 7ae220f46384b34e72b8c3b0c2075a674a3f74fe Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 3 Jul 2009 08:53:11 +0300
+Subject: [PATCH 146/146] DSS2: change include <asm/...> to <linux/...> in omapfb.h
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ include/linux/omapfb.h | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 67dc375..0290584 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -25,9 +25,8 @@
+ #define __OMAPFB_H
+
+ #include <linux/fb.h>
+-
+-#include <asm/ioctl.h>
+-#include <asm/types.h>
++#include <linux/ioctl.h>
++#include <linux/types.h>
+
+ /* IOCTL commands. */
+
+--
+1.6.2.4
+
diff --git a/recipes/linux/linux-omap-pm/fix-mtd.diff b/recipes/linux/linux-omap-pm/fix-mtd.diff
new file mode 100644
index 0000000000..76fe001fcd
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/fix-mtd.diff
@@ -0,0 +1,51 @@
+From patchwork Sat Jun 27 05:37:06 2009
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [MTD,NAND] : fix omap2.c compile failure and warning
+Date: Fri, 26 Jun 2009 19:37:06 -0000
+From: Singh, Vimal <vimalsingh@ti.com>
+X-Patchwork-Id: 29225
+
+> The 'status' you return in the case that you _have_ gone through the
+> loop is still wrong though, isn't it?
+Yes, I have corrected that in below patch. Its my bad, I did not fix it
+previously.
+
+Signed-off-by: Vimal Singh <vimalsingh at ti.com>
+Signed-off-by: Ming Lei <tom.leiming at gmail.com>
+
+---
+
+
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
+index 0cd76f8..3b6e6ad 100644
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -11,6 +11,8 @@
+ #include <linux/platform_device.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/delay.h>
++#include <linux/jiffies.h>
++#include <linux/sched.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nand.h>
+ #include <linux/mtd/partitions.h>
+@@ -541,7 +543,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip
+ struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
+ mtd);
+ unsigned long timeo = jiffies;
+- int status, state = this->state;
++ int status = NAND_STATUS_FAIL, state = this->state;
+
+ if (state == FL_ERASING)
+ timeo += (HZ * 400) / 1000;
+@@ -558,6 +560,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip
+ status = __raw_readb(this->IO_ADDR_R);
+- if (!(status & 0x40))
++ if (status & NAND_STATUS_READY)
+ break;
++ cond_resched();
+ }
+ return status;
+ }
diff --git a/recipes/linux/linux-omap-pm/fix-musb-oops.diff b/recipes/linux/linux-omap-pm/fix-musb-oops.diff
new file mode 100644
index 0000000000..788e7be5a8
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/fix-musb-oops.diff
@@ -0,0 +1,60 @@
+From patchwork Mon Jun 29 09:06:48 2009
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2] usb: musb: Warn and check for OTG transceiver misconfiguration
+Date: Mon, 29 Jun 2009 09:06:48 -0000
+From: Roger Quadros <ext-roger.quadros@nokia.com>
+X-Patchwork-Id: 32914
+
+Warn if OTG is selected in Kconfig but not initialized by platform code.
+Add checks to prevent NULL pointer exception in case the
+OTG transceiver has not been initialized. i.e. musb->xceiv == NULL
+
+Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
+Tested-by: Paul Walmsley <paul@pwsan.com>
+
+---
+drivers/usb/musb/musb_core.c | 7 ++++++-
+ drivers/usb/musb/omap2430.c | 3 ++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
+index 554a414..d0cfc22 100644
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -1861,7 +1861,8 @@ static void musb_free(struct musb *musb)
+ }
+
+ #ifdef CONFIG_USB_MUSB_OTG
+- put_device(musb->xceiv->dev);
++ if (musb->xceiv)
++ put_device(musb->xceiv->dev);
+ #endif
+
+ #ifdef CONFIG_USB_MUSB_HDRC_HCD
+@@ -1958,6 +1959,10 @@ bad_config:
+ musb->isr = generic_interrupt;
+ status = musb_platform_init(musb);
+
++#ifdef CONFIG_USB_MUSB_OTG
++ if (!musb->xceiv)
++ WARN(1, "MUSB: OTG transceiver not set up correctly\n");
++#endif
+ if (status < 0)
+ goto fail;
+ if (!musb->isr) {
+diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
+index 3487520..8987d60 100644
+--- a/drivers/usb/musb/omap2430.c
++++ b/drivers/usb/musb/omap2430.c
+@@ -271,7 +271,8 @@ int musb_platform_suspend(struct musb *musb)
+ l |= ENABLEWAKEUP; /* enable wakeup */
+ omap_writel(l, OTG_SYSCONFIG);
+
+- otg_set_suspend(musb->xceiv, 1);
++ if (musb->xceiv)
++ otg_set_suspend(musb->xceiv, 1);
+
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 0);
diff --git a/recipes/linux/linux-omap-pm_git.bb b/recipes/linux/linux-omap-pm_git.bb
index 0e42594168..574e0a3ca6 100644
--- a/recipes/linux/linux-omap-pm_git.bb
+++ b/recipes/linux/linux-omap-pm_git.bb
@@ -3,15 +3,17 @@ require linux.inc
DESCRIPTION = "Linux kernel for OMAP processors"
KERNEL_IMAGETYPE = "uImage"
-COMPATIBLE_MACHINE = "omap5912osk|omap1710h3|omap2430sdp|omap2420h4|beagleboard|omap3evm|omap3-pandora|overo"
+COMPATIBLE_MACHINE = "beagleboard"
DEFAULT_PREFERENCE = "-1"
-SRCREV = "cbfc461bd5c4d0aff8501dd82db18146a22f49cf"
+SRCREV = "7c5cb7862d32cb344be7831d466535d5255e35ac"
-PV = "2.6.29-pm1+gitr${SRCREV}"
+PV = "2.6.30+2.6.31rc1-pm1+gitr${SRCREV}"
-SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git;protocol=git;branch=pm-2.6.29 \
+FILESPATHPKG_prepend = "linux-omap-pm-2.6.31:"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git;protocol=git;branch=pm \
file://defconfig"
SRC_URI_append = " \
@@ -19,86 +21,159 @@ SRC_URI_append = " \
file://no-cortex-deadlock.patch;patch=1 \
file://read_die_ids.patch;patch=1 \
file://fix-install.patch;patch=1 \
- file://0124-leds-gpio-broken-with-current-git.patch;patch=1 \
+ file://fix-musb-oops.diff;patch=1 \
+ file://fix-mtd.diff;patch=1 \
file://ehci.patch;patch=1 \
- file://dss2/0001-Revert-gro-Fix-legacy-path-napi_complete-crash.patch;patch=1 \
- file://dss2/0002-OMAPFB-move-omapfb.h-to-include-linux.patch;patch=1 \
- file://dss2/0003-DSS2-OMAP2-3-Display-Subsystem-driver.patch;patch=1 \
- file://dss2/0004-DSS2-OMAP-framebuffer-driver.patch;patch=1 \
- file://dss2/0005-DSS2-Add-panel-drivers.patch;patch=1 \
- file://dss2/0006-DSS2-HACK-Add-DSS2-support-for-N800.patch;patch=1 \
- file://dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch;patch=1 \
- file://dss2/0008-DSS2-Add-function-to-display-object-to-get-the-back.patch;patch=1 \
- file://dss2/0009-DSS2-Add-acx565akm-panel.patch;patch=1 \
- file://dss2/0010-DSS2-Small-VRFB-context-allocation-bug-fixed.patch;patch=1 \
- file://dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch;patch=1 \
- file://dss2/0012-DSS2-Fix-DMA-rotation.patch;patch=1 \
- file://dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch;patch=1 \
- file://dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch;patch=1 \
- file://dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch;patch=1 \
- file://dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch;patch=1 \
- file://dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch;patch=1 \
- file://dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch;patch=1 \
- file://dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch;patch=1 \
- file://dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch;patch=1 \
- file://dss2/0021-DSS2-Add-venc-register-dump.patch;patch=1 \
- file://dss2/0022-DSS2-FB-remove-unused-var-warning.patch;patch=1 \
- file://dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch;patch=1 \
- file://dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch;patch=1 \
- file://dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch;patch=1 \
- file://dss2/0026-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch;patch=1 \
- file://dss2/0027-DSS2-VRFB-rotation-and-mirroring-implemented.patch;patch=1 \
- file://dss2/0028-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch;patch=1 \
- file://dss2/0029-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch;patch=1 \
- file://dss2/0030-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch;patch=1 \
- file://dss2/0031-DSS2-do-bootmem-reserve-for-exclusive-access.patch;patch=1 \
- file://dss2/0032-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch;patch=1 \
- file://dss2/0033-DSS2-Prefer-3-tap-filter.patch;patch=1 \
- file://dss2/0034-DSS2-VRAM-improve-omap_vram_add_region.patch;patch=1 \
- file://dss2/0035-DSS2-Added-the-function-pointer-for-getting-default.patch;patch=1 \
- file://dss2/0036-DSS2-Added-support-for-setting-and-querying-alpha-b.patch;patch=1 \
- file://dss2/0037-DSS2-Added-support-for-querying-color-keying.patch;patch=1 \
- file://dss2/0038-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch;patch=1 \
- file://dss2/0039-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch;patch=1 \
- file://dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch;patch=1 \
- file://dss2/0041-DSS2-Disable-vertical-offset-with-fieldmode.patch;patch=1 \
- file://dss2/0042-DSS2-Don-t-enable-fieldmode-automatically.patch;patch=1 \
- file://dss2/0043-DSS2-Swap-field-0-and-field-1-registers.patch;patch=1 \
- file://dss2/0044-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch;patch=1 \
- file://dss2/0045-DSS2-Fixed-line-endings-from-to.patch;patch=1 \
- file://dss2/0046-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch;patch=1 \
- file://dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch;patch=1 \
- file://dss2/0048-OMAP2-3-DMA-implement-trans-copy-and-const-fill.patch;patch=1 \
- file://dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch;patch=1 \
- file://dss2/0050-DSS2-OMAPFB-remove-fb-clearing-code.patch;patch=1 \
- file://dss2/0051-DSS2-VRAM-use-debugfs-not-procfs.patch;patch=1 \
- file://dss2/0052-DSS2-VRAM-fix-section-mismatch-warning.patch;patch=1 \
- file://dss2/0053-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch;patch=1 \
- file://dss2/0054-DSS2-DSI-more-error-handling.patch;patch=1 \
- file://dss2/0055-DSS2-Added-global-alpha-support.patch;patch=1 \
- file://dss2/0056-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch;patch=1 \
- file://dss2/0057-DSS2-Documentation-update-for-new-sysfs-entries-in.patch;patch=1 \
- file://dss2/0058-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch;patch=1 \
- file://dss2/0059-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch;patch=1 \
- file://dss2/0060-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch;patch=1 \
- file://dss2/0061-DSS2-VRFB-save-restore-context.patch;patch=1 \
- file://dss2/0062-DSS2-VRAM-Fix-indentation.patch;patch=1 \
- file://dss2/0063-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch;patch=1 \
- file://dss2/0064-VRFB-fix-debug-messages.patch;patch=1 \
- file://dss2/0065-VRFB-add-suspend-resume-functionality.patch;patch=1 \
- file://dss2/0066-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch;patch=1 \
- file://dss2/0067-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch;patch=1 \
- file://dss2/0068-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch;patch=1 \
- file://dss2/0069-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch;patch=1 \
- file://dss2/0070-DSS2-fix-irq1.diff;patch=1 \
- file://dss2/0071-DSS2-fix-irq2.diff;patch=1 \
- file://dss2/merge-fixups.diff;patch=1 \
- file://overo-cpufreq.diff;patch=1 \
- file://register-all-OPPs.diff;patch=1 \
+ file://dss2/0001-OMAPFB-move-omapfb.h-to-include-linux.patch;patch=1 \
+ file://dss2/0002-DSS2-OMAP2-3-Display-Subsystem-driver.patch;patch=1 \
+ file://dss2/0003-DSS2-OMAP-framebuffer-driver.patch;patch=1 \
+ file://dss2/0004-DSS2-Add-panel-drivers.patch;patch=1 \
+ file://dss2/0005-DSS2-HACK-Add-DSS2-support-for-N800.patch;patch=1 \
+ file://dss2/0006-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch;patch=1 \
+ file://dss2/0007-DSS2-Add-function-to-display-object-to-get-the-back.patch;patch=1 \
+ file://dss2/0008-DSS2-Add-acx565akm-panel.patch;patch=1 \
+ file://dss2/0009-DSS2-Small-VRFB-context-allocation-bug-fixed.patch;patch=1 \
+ file://dss2/0010-DSS2-Allocated-memory-for-Color-Look-up-table.patch;patch=1 \
+ file://dss2/0011-DSS2-Fix-DMA-rotation.patch;patch=1 \
+ file://dss2/0012-DSS2-Verify-that-overlay-paddr-0.patch;patch=1 \
+ file://dss2/0013-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch;patch=1 \
+ file://dss2/0014-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch;patch=1 \
+ file://dss2/0015-DSS2-DSI-improve-packet-len-calculation.patch;patch=1 \
+ file://dss2/0016-DSS2-Disable-video-planes-on-sync-lost-error.patch;patch=1 \
+ file://dss2/0017-DSS2-check-for-ovl-paddr-only-when-enabling.patch;patch=1 \
+ file://dss2/0018-DSS2-Check-fclk-limits-when-configuring-video-plane.patch;patch=1 \
+ file://dss2/0019-DSS2-Check-scaling-limits-against-proper-values.patch;patch=1 \
+ file://dss2/0020-DSS2-Add-venc-register-dump.patch;patch=1 \
+ file://dss2/0021-DSS2-FB-remove-unused-var-warning.patch;patch=1 \
+ file://dss2/0022-DSS2-pass-the-default-FB-color-format-through-board.patch;patch=1 \
+ file://dss2/0023-DSS2-Beagle-Use-gpio_set_value.patch;patch=1 \
+ file://dss2/0024-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch;patch=1 \
+ file://dss2/0025-DSS2-DSI-sidlemode-to-noidle-while-sending-frame.patch;patch=1 \
+ file://dss2/0026-DSS2-VRFB-rotation-and-mirroring-implemented.patch;patch=1 \
+ file://dss2/0027-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch;patch=1 \
+ file://dss2/0028-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch;patch=1 \
+ file://dss2/0029-DSS2-dispc_get_trans_key-was-returning-wrong-key-ty.patch;patch=1 \
+ file://dss2/0030-DSS2-do-bootmem-reserve-for-exclusive-access.patch;patch=1 \
+ file://dss2/0031-DSS2-Fix-DISPC_VID_FIR-value-for-omap34xx.patch;patch=1 \
+ file://dss2/0032-DSS2-Prefer-3-tap-filter.patch;patch=1 \
+ file://dss2/0033-DSS2-VRAM-improve-omap_vram_add_region.patch;patch=1 \
+ file://dss2/0034-DSS2-Added-the-function-pointer-for-getting-default.patch;patch=1 \
+ file://dss2/0035-DSS2-Added-support-for-setting-and-querying-alpha-b.patch;patch=1 \
+ file://dss2/0036-DSS2-Added-support-for-querying-color-keying.patch;patch=1 \
+ file://dss2/0037-DSS2-OMAPFB-Some-color-keying-pointerd-renamed-in-D.patch;patch=1 \
+ file://dss2/0038-DSS2-Add-sysfs-entry-to-for-the-alpha-blending-supp.patch;patch=1 \
+ file://dss2/0039-DSS2-Provided-proper-exclusion-for-destination-colo.patch;patch=1 \
+ file://dss2/0040-DSS2-Disable-vertical-offset-with-fieldmode.patch;patch=1 \
+ file://dss2/0041-DSS2-Don-t-enable-fieldmode-automatically.patch;patch=1 \
+ file://dss2/0042-DSS2-Swap-field-0-and-field-1-registers.patch;patch=1 \
+ file://dss2/0043-DSS2-add-sysfs-entry-for-seting-the-rotate-type.patch;patch=1 \
+ file://dss2/0044-DSS2-Fixed-line-endings-from-to.patch;patch=1 \
+ file://dss2/0045-DSS2-DSI-decrease-sync-timeout-from-60s-to-2s.patch;patch=1 \
+ file://dss2/0046-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch;patch=1 \
+ file://dss2/0047-DSS2-VRAM-clear-allocated-area-with-DMA.patch;patch=1 \
+ file://dss2/0048-DSS2-OMAPFB-remove-fb-clearing-code.patch;patch=1 \
+ file://dss2/0049-DSS2-VRAM-use-debugfs-not-procfs.patch;patch=1 \
+ file://dss2/0050-DSS2-VRAM-fix-section-mismatch-warning.patch;patch=1 \
+ file://dss2/0051-DSS2-disable-LCD-DIGIT-before-resetting-DSS.patch;patch=1 \
+ file://dss2/0052-DSS2-DSI-more-error-handling.patch;patch=1 \
+ file://dss2/0053-DSS2-Added-global-alpha-support.patch;patch=1 \
+ file://dss2/0054-DSS2-Rotation-attrs-for-YUV-need-not-to-be-reversed.patch;patch=1 \
+ file://dss2/0055-DSS2-Documentation-update-for-new-sysfs-entries-in.patch;patch=1 \
+ file://dss2/0056-DSS2-Don-t-touch-plane-coordinates-when-changing-fb.patch;patch=1 \
+ file://dss2/0057-DSS2-DSI-configure-ENTER-EXIT_HS_MODE_LATENCY.patch;patch=1 \
+ file://dss2/0058-DSS2-Avoid-div-by-zero-when-calculating-required-fc.patch;patch=1 \
+ file://dss2/0059-DSS2-VRFB-save-restore-context.patch;patch=1 \
+ file://dss2/0060-DSS2-VRAM-Fix-indentation.patch;patch=1 \
+ file://dss2/0061-DSS2-fix-the-usage-of-get_last_off_on_transaction_i.patch;patch=1 \
+ file://dss2/0062-VRFB-fix-debug-messages.patch;patch=1 \
+ file://dss2/0063-VRFB-add-suspend-resume-functionality.patch;patch=1 \
+ file://dss2/0064-DSS2-DSI-tune-the-timings-to-be-more-relaxed.patch;patch=1 \
+ file://dss2/0065-DSS2-VRFB-don-t-WARN-when-releasing-inactive-ctx.patch;patch=1 \
+ file://dss2/0066-DSS2-Swap-field-offset-values-w-VRFB-rotation.patch;patch=1 \
+ file://dss2/0067-DSS2-OMAP3EVM-Added-DSI-powerup-and-powerdown-func.patch;patch=1 \
+ file://dss2/0068-DSS2-DSI-Improve-perf-measurement-output.patch;patch=1 \
+ file://dss2/0069-DSS2-DSI-Add-support-for-external-TE-signal.patch;patch=1 \
+ file://dss2/0070-DSS2-DSI-Fix-LP-clock.patch;patch=1 \
+ file://dss2/0071-DSS2-Do-not-swap-xres-yres-or-change-rotation-in-ch.patch;patch=1 \
+ file://dss2/0072-DSS2-Allow-independent-rotation-for-each-plane.patch;patch=1 \
+ file://dss2/0073-DSS2-DISPC-fix-irq-handling-locking.patch;patch=1 \
+ file://dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch;patch=1 \
+ file://dss2/0075-DSS2-Add-WSS-support.patch;patch=1 \
+ file://dss2/0076-DSS2-Fix-PAL-NTSC-timings.patch;patch=1 \
+ file://dss2/0077-DSS2-Add-venc-debugfs-file.patch;patch=1 \
+ file://dss2/0078-DSS2-Enable-replication-logic-feature.patch;patch=1 \
+ file://dss2/0079-DSS2-support-for-querying-the-supported-overlay-col.patch;patch=1 \
+ file://dss2/0080-DSS2-fix-uninitialized-var-in-OMAPFB_GET_CAPS-IOCTL.patch;patch=1 \
+ file://dss2/0081-DSS2-Reset-WSS-data-only-when-changing-TV-standard.patch;patch=1 \
+ file://dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch;patch=1 \
+ file://dss2/0083-DSS2-DSI-reset-perf-frame-counter-when-starting-au.patch;patch=1 \
+ file://dss2/0084-DSS2-DSI-Implement-DSI-bus-lock.patch;patch=1 \
+ file://dss2/0085-DSS2-OMAPFB-omapfb_get_ovl_colormode-to-static.patch;patch=1 \
+ file://dss2/0086-DSS2-VRFB-make-vrfb_hw_context-static.patch;patch=1 \
+ file://dss2/0087-DSS2-new-device-driver-model.patch;patch=1 \
+ file://dss2/0088-DSS2-Board-file-changes-for-new-device-model.patch;patch=1 \
+ file://dss2/0089-DSS2-Panel-driver-changes-for-new-device-model.patch;patch=1 \
+ file://dss2/0090-DSS2-VENC-venc-uses-regulator-framework.patch;patch=1 \
+ file://dss2/0091-DSS2-DSI-Use-regulator-framework.patch;patch=1 \
+ file://dss2/0092-DSS2-SDP-regulators-for-VDAC-DSI.patch;patch=1 \
+ file://dss2/0093-DSS2-Sharp-panel-use-regulator-fw.patch;patch=1 \
+ file://dss2/0094-DSS2-Beagle-regulators-for-VDAC-DSI.patch;patch=1 \
+ file://dss2/0095-DSS2-Fix-checkpatch-complaints.patch;patch=1 \
+ file://dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch;patch=1 \
+ file://dss2/0097-DSS2-implement-overlay_manager_info.patch;patch=1 \
+ file://dss2/0098-DSS2-use-sysfs_streq-to-compare-display-names.patch;patch=1 \
+ file://dss2/0099-DSS2-Implement-function-to-verify-lcd-timings.patch;patch=1 \
+ file://dss2/0100-DSS2-Remove-non-existing-dsi-power-funcs-from-dss.h.patch;patch=1 \
+ file://dss2/0101-DSS2-move-to_dss_driver-and-to_dss_device-to-pu.patch;patch=1 \
+ file://dss2/0102-DSS2-CLK-change-omapfb-omapdss-in-clock-framewo.patch;patch=1 \
+ file://dss2/0103-DSS2-Use-clkdev.patch;patch=1 \
+ file://dss2/0104-DSS2-Fix-documentation.patch;patch=1 \
+ file://dss2/0105-DSS2-OMAPFB-first-set-TE-then-update-mode.patch;patch=1 \
+ file://dss2/0106-DSS2-OMAPFB-Disable-forced-display-update-on-fb-cl.patch;patch=1 \
+ file://dss2/0107-DSS2-DSI-use-INIT_COMPLETION-not-init_completion.patch;patch=1 \
+ file://dss2/0108-DSS2-DSI-Rewrite-of-the-DSI-update-and-cmd-queue.patch;patch=1 \
+ file://dss2/0109-DSS2-let-init_display-return-an-error-code.patch;patch=1 \
+ file://dss2/0110-DSS2-isolate-the-SDI-pads-when-SDI-is-disabled.patch;patch=1 \
+ file://dss2/0111-DSS2-Fix-bottom-field-initial-starting-line.patch;patch=1 \
+ file://dss2/0112-DSS2-Correctly-determine-if-an-interlaced-display-i.patch;patch=1 \
+ file://dss2/0113-DSS2-Fix-omapfb-framebuffer-name.patch;patch=1 \
+ file://dss2/0114-DSS2-Overo-update-defconfig-to-lighter-one.patch;patch=1 \
+ file://dss2/0115-DSS2-SDI-make-sdi_pads-static.patch;patch=1 \
+ file://dss2/0116-DSS2-Fix-default_color-sysfs-output.patch;patch=1 \
+ file://dss2/0117-DSS2-Locking-for-VRFB.patch;patch=1 \
+ file://dss2/0118-DSS2-DISPC-fix-locking-issue-with-irq-handling.patch;patch=1 \
+ file://dss2/0119-DSS2-OMAPFB-remove-unneeded-locks.patch;patch=1 \
+ file://dss2/0120-DSS2-DISPC-configuration-management.patch;patch=1 \
+ file://dss2/0121-DSS2-VRFB-clean-up-BUG-calls.patch;patch=1 \
+ file://dss2/0122-DSS2-OMAPFB-don-t-fail-even-if-default-display-doe.patch;patch=1 \
+ file://dss2/0123-DSS2-DSI-Fix-external-TE-wait.patch;patch=1 \
+ file://dss2/0124-DSS2-DSI-Increase-framedone-timeout-to-1s.patch;patch=1 \
+ file://dss2/0125-DSS2-VRAM-Add-function-to-get-free-vram-info.patch;patch=1 \
+ file://dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch;patch=1 \
+ file://dss2/0127-DSS2-DSI-increase-dsi-thread-priority.patch;patch=1 \
+ file://dss2/0128-DSS2-DSI-check-bus_lock-in-send_bta.patch;patch=1 \
+ file://dss2/0129-DSS2-DSI-export-dsi_vc_send_bta_sync.patch;patch=1 \
+ file://dss2/0130-DSS2-DSI-clear-BTA-irq-before-enabling-it.patch;patch=1 \
+ file://dss2/0131-DSS2-DSI-check-dsi_set_te-return-value.patch;patch=1 \
+ file://dss2/0132-DSS2-DSI-use-only-1-VC.-Fixes-to-TE.patch;patch=1 \
+ file://dss2/0133-DSS2-VRAM-Remove-unused-defines.patch;patch=1 \
+ file://dss2/0134-DSS2-VENC-Add-invert_polarity-flag.patch;patch=1 \
+ file://dss2/0135-DSS2-VRAM-Add-defines-for-VRAM-types.patch;patch=1 \
+ file://dss2/0136-DSS2-VRAM-separate-VRAM-setup-from-the-old-fb-vram.patch;patch=1 \
+ file://dss2/0137-DSS2-VRFB-Update-license-information.patch;patch=1 \
+ file://dss2/0138-DSS2-VRAM-Update-license-information.patch;patch=1 \
+ file://dss2/0139-DSS2-VRFB-use-pr_-instead-of-printk.patch;patch=1 \
+ file://dss2/0140-DSS2-VRAM-Change-CONFIG_OMAP2_DSS_VRAM_SIZE-name.patch;patch=1 \
+ file://dss2/0141-DSS2-VRAM-add-CONFIG_OMAP2_VRAM-flag.patch;patch=1 \
+ file://dss2/0142-DSS2-VRFB-Add-CONFIG_OMAP2_VRFB-flag.patch;patch=1 \
+ file://dss2/0143-DSS2-VRFB-VRAM-fix-checkpatch-warnings.patch;patch=1 \
+ file://dss2/0144-DSS2-fixes-to-dss_omap_3430sdp_defconfig-to-make-it.patch;patch=1 \
+ file://dss2/0145-DSS2-BEAGLE-get-DSS2-working-again-on-beagle.patch;patch=1 \
+ file://dss2/0146-DSS2-change-include-asm-.-to-linux-.-in-oma.patch;patch=1 \
"
-
SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
+ file://beagle-writable-uboot.diff;patch=1 \
"
SRC_URI_append_omap3evm = " \
@@ -110,4 +185,3 @@ S = "${WORKDIR}/git"
module_autoload_ohci-hcd_omap5912osk = "ohci-hcd"
-
diff --git a/recipes/linux/linux-omap-psp-2.6.29/fix-section-mismatch.diff b/recipes/linux/linux-omap-psp-2.6.29/fix-section-mismatch.diff
new file mode 100644
index 0000000000..c7a74b7f2e
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.29/fix-section-mismatch.diff
@@ -0,0 +1,11 @@
+--- /tmp/board-omap3evm.c 2009-07-23 15:25:30.000000000 +0200
++++ git/arch/arm/mach-omap2/board-omap3evm.c 2009-07-23 15:28:47.000000000 +0200
+@@ -186,7 +186,7 @@
+ .irq_line = 1,
+ };
+
+-static struct twl4030_platform_data omap3evm_twldata = {
++static struct twl4030_platform_data __initdata omap3evm_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+
diff --git a/recipes/linux/linux-omap-psp-2.6.29/fix-twl-merge-damage.diff b/recipes/linux/linux-omap-psp-2.6.29/fix-twl-merge-damage.diff
new file mode 100644
index 0000000000..7ca627d67d
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.29/fix-twl-merge-damage.diff
@@ -0,0 +1,19 @@
+--- /tmp/twl4030-regulator.c 2009-07-23 14:27:33.000000000 +0200
++++ git/drivers/regulator/twl4030-regulator.c 2009-07-23 14:27:51.000000000 +0200
+@@ -107,16 +107,6 @@
+ return (state & P1_GRP) != 0;
+ }
+
+-static int twl4030reg_is_enabled(struct regulator_dev *rdev)
+-{
+- int state = twl4030reg_grp(rdev);
+-
+- if (state < 0)
+- return state;
+-
+- return (state & P1_GRP) != 0;
+-}
+-
+ static int twl4030reg_enable(struct regulator_dev *rdev)
+ {
+ struct twlreg_info *info = rdev_get_drvdata(rdev);
diff --git a/recipes/linux/linux-omap-psp-2.6.29/no-3517-hack.diff b/recipes/linux/linux-omap-psp-2.6.29/no-3517-hack.diff
new file mode 100644
index 0000000000..06b62e581a
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.29/no-3517-hack.diff
@@ -0,0 +1,16 @@
+--- /tmp/usb-musb.c 2009-07-23 21:42:51.000000000 +0200
++++ git/arch/arm/mach-omap2/usb-musb.c 2009-07-23 21:46:46.000000000 +0200
+@@ -152,12 +152,10 @@
+ if (cpu_is_omap243x()) {
+ musb_resources[0].start = OMAP243X_HS_BASE;
+ musb_plat.clock = "usbhs_ick";
+- } else if (1 /*TODO: cpu_is_omap3517()*/) {
+- musb_resources[0].start = OMAP3517_HSUSB_OTG_BASE;
++ } else if (0 /*TODO: cpu_is_omap3517()*/) {
+ musb_plat.clock = "usbotg_vbusp_ck";
+ musb_resources[1].start = INT_OMAP3517_HSUSB_OTG;
+ /* set mux config for DRVVBUS */
+- omap_cfg_reg(E25_3517_USB0_DRVVBUS);
+ /* OMAP3517 can provide max of 500mA */
+ musb_plat.power = 250;
+ } else {
diff --git a/recipes/linux/linux-omap-psp-2.6.29/omap3evm/defconfig b/recipes/linux/linux-omap-psp-2.6.29/omap3evm/defconfig
new file mode 100644
index 0000000000..4b8a52f43d
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.29/omap3evm/defconfig
@@ -0,0 +1,2297 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Thu Jul 23 15:15:16 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_OPROFILE_ARMV7=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=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+CONFIG_BLK_DEV_IO_TRACE=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_BLK_DEV_INTEGRITY=y
+
+#
+# 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+# CONFIG_OMAP_SMARTREFLEX is not set
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+CONFIG_OMAP_MBOX_FWK=m
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=12
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_LL_DEBUG_UART1=y
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+CONFIG_ARCH_OMAP35XX=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+CONFIG_MACH_OMAP3EVM=y
+CONFIG_MACH_OMAP3517EVM=y
+
+#
+# OMAP3 EVM Power Modules
+#
+CONFIG_OMAP3EVM_TWL4030=y
+# CONFIG_OMAP3EVM_TPS65023 is not set
+# CONFIG_OMAP3EVM_TPS65073 is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_HAS_TLS_REG=y
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+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_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE 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=y
+# 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=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+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=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE 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_NET_DSA 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTUSB is not set
+CONFIG_BT_HCIBTSDIO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBPA10X=y
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=m
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=y
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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 is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ALAUDA is not set
+CONFIG_MTD_ONENAND=y
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+# CONFIG_MTD_ONENAND_GENERIC is not set
+CONFIG_MTD_ONENAND_OMAP2=y
+# CONFIG_MTD_ONENAND_OTP is not set
+# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
+# CONFIG_MTD_ONENAND_SIM is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR 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=m
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+CONFIG_EEPROM_93CX6=m
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+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=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+CONFIG_DAVICOM_PHY=y
+CONFIG_QSEMI_PHY=y
+CONFIG_LXT_PHY=y
+CONFIG_CICADA_PHY=y
+CONFIG_VITESSE_PHY=y
+CONFIG_SMSC_PHY=y
+CONFIG_BROADCOM_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+CONFIG_REALTEK_PHY=y
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BITBANG=y
+# CONFIG_MDIO_GPIO is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_TI_DAVINCI_EMAC is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 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=y
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_USB_ZD1201=m
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_RTL8187 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_ZD1211RW is not set
+# CONFIG_RT2X00 is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_SMSC95XX 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=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# 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_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=m
+# 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_TWL4030=y
+CONFIG_KEYBOARD_GPIO=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 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=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO 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_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWEROFF=y
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_TSL2563 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
+CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_TWL4030_BCI_BATTERY is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S 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_LM70 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_LTC4245 is not set
+# CONFIG_SENSORS_MAX1111 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_ADS7828 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_TSC210X is not set
+CONFIG_SENSORS_OMAP34XX=y
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_POWER=y
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_DMA_SG=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_CX25840=m
+CONFIG_VIDEO_CX2341X=m
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_VIDEO_AU0828 is not set
+CONFIG_VIDEO_OMAP3=y
+# CONFIG_VIDEO_OMAP_VIDEOOUT is not set
+CONFIG_NTSC_M=y
+# CONFIG_PAL_BDGHI is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+# CONFIG_USB_GSPCA is not set
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_USBVISION=m
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_QUICKCAM_MESSENGER=m
+# CONFIG_USB_ET61X251 is not set
+CONFIG_VIDEO_OVCAMCHIP=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+# CONFIG_USB_ZC0301 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_ZR364XX=m
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+# CONFIG_DVB_DYNAMIC_MINORS is not set
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+# CONFIG_DVB_USB_DW2102 is not set
+# CONFIG_DVB_USB_CINERGY_T2 is not set
+# CONFIG_DVB_USB_ANYSEE is not set
+# CONFIG_DVB_USB_DTV5100 is not set
+# CONFIG_DVB_USB_AF9015 is not set
+# CONFIG_DVB_SIANO_SMS1XXX is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_FLEXCOP is not set
+
+#
+# Supported DVB Frontends
+#
+
+#
+# Customise DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+# CONFIG_DVB_STB0899 is not set
+# CONFIG_DVB_STB6100 is not set
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_S5H1420=m
+# CONFIG_DVB_STV0288 is not set
+# CONFIG_DVB_STB6000 is not set
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+# CONFIG_DVB_TDA8261 is not set
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+# CONFIG_DVB_TUNER_CX24113 is not set
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+# CONFIG_DVB_CX24116 is not set
+# CONFIG_DVB_SI21XX is not set
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+# CONFIG_DVB_DRX397XD is not set
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+# CONFIG_DVB_OR51211 is not set
+# CONFIG_DVB_OR51132 is not set
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+# CONFIG_DVB_LGDT3304 is not set
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+# CONFIG_DVB_S921 is not set
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+# CONFIG_DVB_ISL6405 is not set
+CONFIG_DVB_ISL6421=m
+# CONFIG_DVB_LGS8GL5 is not set
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+# CONFIG_DVB_AF9013 is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+# CONFIG_PANEL_SHARP_LQ043T1DG01 is not set
+# CONFIG_PANEL_N800 is not set
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=3
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_LTV350QV=y
+CONFIG_LCD_ILI9320=y
+# CONFIG_LCD_TDO24M is not set
+CONFIG_LCD_VGG2432A4=y
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# 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=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_HRTIMER 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=y
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_OMAP3517EVM=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TLV320AIC3X=y
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_NTRIG is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_HOST=y
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+# CONFIG_USB_MUSB_OTG is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+CONFIG_USB_MUSB_HDRC_HCD=y
+CONFIG_MUSB_PIO_ONLY=y
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD 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_ISD200 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_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+# CONFIG_USB_SERIAL_OPTICON is not set
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+# CONFIG_USB_BERRY_CHARGE is not set
+CONFIG_USB_LED=m
+# 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_FILE_STORAGE_TEST=y
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
+CONFIG_USB_G_PRINTER=m
+CONFIG_USB_CDC_COMPOSITE=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_OMAP_DEBUG is not set
+# CONFIG_LEDS_OMAP is not set
+# CONFIG_LEDS_OMAP_PWM is not set
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+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
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
+CONFIG_REGULATOR_BQ24022=y
+CONFIG_REGULATOR_TWL4030=y
+# CONFIG_UIO is not set
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_MEILHAUS is not set
+# CONFIG_USB_IP_COMMON is not set
+# CONFIG_W35UND is not set
+# CONFIG_PRISM2_USB is not set
+# CONFIG_ECHO is not set
+# CONFIG_USB_ATMEL is not set
+# CONFIG_AGNX is not set
+# CONFIG_OTUS is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_INPUT_MIMIO is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_ANDROID_BINDER_IPC is not set
+# CONFIG_ANDROID_LOGGER is not set
+# CONFIG_ANDROID_RAM_CONSOLE is not set
+# CONFIG_ANDROID_TIMED_GPIO is not set
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# 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=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+CONFIG_HFSPLUS_FS=m
+# 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_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_CRAMFS=m
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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=m
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACER_MAX_TRACE=y
+CONFIG_RING_BUFFER=y
+CONFIG_TRACING=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+CONFIG_PREEMPT_TRACER=y
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=m
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/linux/linux-omap-psp_2.6.29.bb b/recipes/linux/linux-omap-psp_2.6.29.bb
new file mode 100644
index 0000000000..56e3e62fb3
--- /dev/null
+++ b/recipes/linux/linux-omap-psp_2.6.29.bb
@@ -0,0 +1,34 @@
+require linux.inc
+
+DESCRIPTION = "Linux kernel for OMAP processors"
+KERNEL_IMAGETYPE = "uImage"
+
+COMPATIBLE_MACHINE = "omap3evm"
+
+SRCREV = "9abb6eb717acbca192ab251a056e3a66b2b47884"
+
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
+PR_append = "+gitr${SRCREV}"
+
+SRC_URI = "git://arago-project.org/git/people/sriram/ti-psp-omap.git;protocol=git;branch=int_030000_build3 \
+ file://defconfig"
+
+S = "${WORKDIR}/git"
+
+SRC_URI_append = " \
+ file://fix-twl-merge-damage.diff;patch=1 \
+ file://fix-section-mismatch.diff;patch=1 \
+ file:///no-3517-hack.diff;patch=1 \
+"
+
+do_install_append() {
+ install -d ${D}/boot
+ install -m 0644 Documentation/arm/OMAP/DSS ${D}/boot/
+}
+
+PACKAGES =+ "omap-dss-doc"
+FILES_omap-dss-doc = "/boot/DSS"
+
+module_autoload_ohci-hcd_omap5912osk = "ohci-hcd"
+
+
diff --git a/recipes/linux/linux-omap_2.6.29.bb b/recipes/linux/linux-omap_2.6.29.bb
index 67a4803893..40546d3d90 100644
--- a/recipes/linux/linux-omap_2.6.29.bb
+++ b/recipes/linux/linux-omap_2.6.29.bb
@@ -8,6 +8,7 @@ COMPATIBLE_MACHINE = "omap5912osk|omap1710h3|omap2430sdp|omap2420h4|beagleboard|
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_overo = "1"
DEFAULT_PREFERENCE_beagleboard = "1"
+DEFAULT_PREFERENCE_omap3evm = "1"
SRCREV = "58cf2f1425abfd3a449f9fe985e48be2d2555022"
@@ -151,17 +152,22 @@ SRC_URI_append = " \
file://isp/omap3camera/0007-omap3isp-Add-CSI2-interface-support.patch;patch=1 \
file://isp/omap3camera/0008-omap3isp-Add-ISP-tables.patch;patch=1 \
file://isp/omap3camera/0009-omap34xxcam-Add-camera-driver.patch;patch=1 \
-# file://isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch;patch=1 \
-# file://isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch;patch=1 \
-# file://isp/standalone/0002-Resizer-bug-fixes-on-top-of-1.0.2-release.patch;patch=1 \
+ file://isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch;patch=1 \
+ file://isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch;patch=1 \
+ file://isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch;patch=1 \
file://0124-leds-gpio-broken-with-current-git.patch;patch=1 \
file://modedb-hd720.patch;patch=1 \
file://0001-implement-TIF_RESTORE_SIGMASK-support-and-enable-the.patch;patch=1 \
+ file://vfp/02-vfp-ptrace.patch;patch=1 \
+ file://vfp/03-vfp-corruption.patch;patch=1 \
+ file://vfp/04-vfp-threads.patch;patch=1 \
+ file://vfp/05-vfp-signal-handlers.patch;patch=1 \
"
SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
file://beagle-asoc.patch;patch=1 \
+ file://tincantools-puppy.diff;patch=1 \
"
SRC_URI_append_omap3evm = " \
@@ -172,6 +178,14 @@ SRC_URI_append_omap3evm = " \
S = "${WORKDIR}/git"
+do_install_append() {
+ install -d ${D}/boot
+ install -m 0644 Documentation/arm/OMAP/DSS ${D}/boot || true
+}
+
+PACKAGES =+ "omap-dss-doc"
+FILES_omap-dss-doc = "/boot/DSS"
+
module_autoload_ohci-hcd_omap5912osk = "ohci-hcd"
diff --git a/recipes/linux/linux-omap_git.bb b/recipes/linux/linux-omap_git.bb
index ddc511e415..c5f56fc873 100644
--- a/recipes/linux/linux-omap_git.bb
+++ b/recipes/linux/linux-omap_git.bb
@@ -3,40 +3,26 @@ require linux.inc
DESCRIPTION = "Linux kernel for OMAP processors"
KERNEL_IMAGETYPE = "uImage"
-COMPATIBLE_MACHINE = "omap5912osk|omap1710h3|omap2430sdp|omap2420h4|beagleboard|omap3evm|omap3-pandora|overo"
+COMPATIBLE_MACHINE = "omap5912osk|omap1710h3|omap2430sdp|omap2420h4|beagleboard|omap3evm|omap3-pandora|overo|omapzoom"
-# This is missing the EHCI patch for beagle
DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_omapzoom2 = "1"
+SRCREV = "7c5cb7862d32cb344be7831d466535d5255e35ac"
-SRCREV = "90e758af52ba803cba233fabee81176d99589f09"
+FILESPATHPKG_prepend = "linux-omap-2.6.31:"
-#PV = "2.6.29+2.6.30-rc1+${PR}+gitr${SRCREV}"
-PV = "2.6.29-${PR}+gitr${SRCREV}"
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
+PV = "2.6.30+2.6.31-rc1+gitr${SRCREV}"
PR = "r0"
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git;protocol=git \
file://defconfig"
SRC_URI_append = " \
- file://no-empty-flash-warnings.patch;patch=1 \
- file://no-cortex-deadlock.patch;patch=1 \
- file://read_die_ids.patch;patch=1 \
- file://fix-install.patch;patch=1 \
- file://DSS2.diff;patch=1 \
-"
-
-
-SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
- "
-
-SRC_URI_append_omap3evm = " \
- file://evm-mcspi-ts.diff;patch=1 \
"
S = "${WORKDIR}/git"
-
module_autoload_ohci-hcd_omap5912osk = "ohci-hcd"
-
diff --git a/recipes/linux/linux-omapandroid/omapzoom2/defconfig b/recipes/linux/linux-omapandroid/omapzoom2/defconfig
new file mode 100644
index 0000000000..a37a4d0035
--- /dev/null
+++ b/recipes/linux/linux-omapandroid/omapzoom2/defconfig
@@ -0,0 +1,1854 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-omap1
+# Mon Jul 13 22:20:30 2009
+#
+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_HAVE_LATENCYTOP_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_GENERIC_HARDIRQS_NO__DO_IRQ=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=""
+# 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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_PANIC_TIMEOUT=0
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ASHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+# CONFIG_FREEZER is not set
+
+#
+# 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_CLPS711X 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_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_W90X900 is not set
+
+#
+# TI OMAP Implementations
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# OMAP Feature Selections
+#
+# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
+# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
+# CONFIG_OMAP_SMARTREFLEX is not set
+# CONFIG_OMAP_RESET_CLOCKS is not set
+CONFIG_OMAP_BOOT_TAG=y
+CONFIG_OMAP_BOOT_REASON=y
+# CONFIG_OMAP_COMPONENT_VERSION is not set
+# CONFIG_OMAP_GPIO_SWITCH is not set
+CONFIG_OMAP_MUX=y
+CONFIG_OMAP_MUX_DEBUG=y
+CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_MCBSP=y
+# CONFIG_OMAP_MBOX_FWK is not set
+CONFIG_OMAP_IOMMU=y
+# CONFIG_OMAP_MPU_TIMER is not set
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_TICK_GPTIMER=1
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_LL_DEBUG_UART1 is not set
+# CONFIG_OMAP_LL_DEBUG_UART2 is not set
+# CONFIG_OMAP_LL_DEBUG_UART3 is not set
+CONFIG_OMAP_LL_DEBUG_UART_EXT=y
+CONFIG_OMAP_SERIAL_WAKE=y
+# CONFIG_OMAP_PM_NONE is not set
+CONFIG_OMAP_PM_NOOP=y
+# CONFIG_OMAP_PM_SRF is not set
+CONFIG_ARCH_OMAP34XX=y
+CONFIG_ARCH_OMAP3430=y
+
+#
+# OMAP Board Type
+#
+# CONFIG_MACH_NOKIA_RX51 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+CONFIG_MACH_OMAP_ZOOM2=y
+CONFIG_WIFI_CONTROL_FUNC=y
+# CONFIG_TIWLAN_SDIO is not set
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3_BEAGLE is not set
+# CONFIG_MACH_OVERO is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_HAS_TLS_REG is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=" debug "
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SUSPEND is not set
+CONFIG_HAS_WAKELOCK=y
+CONFIG_HAS_EARLYSUSPEND=y
+CONFIG_WAKELOCK=y
+CONFIG_WAKELOCK_STAT=y
+CONFIG_USER_WAKELOCK=y
+CONFIG_EARLYSUSPEND=y
+# CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL is not set
+# CONFIG_CONSOLE_EARLYSUSPEND is not set
+CONFIG_FB_EARLYSUSPEND=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# 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=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE 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_LRO is not set
+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_ANDROID_PARANOID_NETWORK=y
+# 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_NET_DSA 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+# CONFIG_BT_BNEP_MC_FILTER is not set
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+CONFIG_BT_HIDP=y
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTUSB is not set
+# CONFIG_BT_HCIBTSDIO is not set
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+CONFIG_BT_HCIUART_LL=y
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIBRF6150 is not set
+# CONFIG_BT_HCIH4P is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+# CONFIG_LIB80211 is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_WIMAX is not set
+CONFIG_RFKILL=y
+CONFIG_RFKILL_PM=y
+# CONFIG_RFKILL_INPUT is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_OMAP_NOR=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 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
+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_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_OMAP_HWECC=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+CONFIG_ANDROID_PMEM=y
+# CONFIG_ICS932S401 is not set
+# CONFIG_OMAP_STI is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_KERNEL_DEBUGGER_CORE is not set
+# CONFIG_UID_STAT is not set
+CONFIG_WL127X_RFKILL=y
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_HAVE_IDE=y
+# 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_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# 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_VETH 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 is not set
+# CONFIG_ENC28J60 is not set
+CONFIG_SMC911X=y
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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 is not set
+# CONFIG_USB_HSO is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP 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 is not set
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT_KEYRESET is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# 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_OMAP is not set
+CONFIG_KEYBOARD_TWL4030=y
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE 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_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI=y
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_TSC2005 is not set
+# CONFIG_TOUCHSCREEN_TSC210X is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+# 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_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVMEM=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_OMAP is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_DCC_TTY is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+CONFIG_TWL4030_MADC=y
+# CONFIG_TWL4030_POWEROFF is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_PCA963X 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
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+CONFIG_SPI_OMAP24XX=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_TSC210X is not set
+# CONFIG_SPI_TSC2301 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+CONFIG_GPIO_TWL4030=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+CONFIG_W1=y
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2490 is not set
+# CONFIG_W1_MASTER_DS2482 is not set
+# CONFIG_W1_MASTER_DS1WM is not set
+# CONFIG_W1_MASTER_GPIO is not set
+CONFIG_HDQ_MASTER_OMAP=y
+
+#
+# 1-wire Slaves
+#
+# CONFIG_W1_SLAVE_THERM is not set
+# CONFIG_W1_SLAVE_SMEM is not set
+# CONFIG_W1_SLAVE_DS2431 is not set
+# CONFIG_W1_SLAVE_DS2433 is not set
+# CONFIG_W1_SLAVE_DS2760 is not set
+CONFIG_W1_SLAVE_BQ27000=y
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+CONFIG_TWL4030_BCI_BATTERY=y
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+CONFIG_TWL4030_CORE=y
+# CONFIG_TWL4030_POWER is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=y
+
+#
+# Multimedia drivers
+#
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=y
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=y
+CONFIG_MEDIA_TUNER_TDA8290=y
+CONFIG_MEDIA_TUNER_TDA9887=y
+CONFIG_MEDIA_TUNER_TEA5761=y
+CONFIG_MEDIA_TUNER_TEA5767=y
+CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER_XC2028=y
+CONFIG_MEDIA_TUNER_XC5000=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_DMA_SG=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TDA9875 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+# CONFIG_VIDEO_MSP3400 is not set
+# CONFIG_VIDEO_CS5345 is not set
+# CONFIG_VIDEO_CS53L32A is not set
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+# CONFIG_VIDEO_WM8775 is not set
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# Video decoders
+#
+# CONFIG_VIDEO_BT819 is not set
+# CONFIG_VIDEO_BT856 is not set
+# CONFIG_VIDEO_BT866 is not set
+# CONFIG_VIDEO_KS0127 is not set
+# CONFIG_VIDEO_OV7670 is not set
+# CONFIG_VIDEO_TCM825X is not set
+CONFIG_VIDEO_IMX046=y
+CONFIG_VIDEO_LV8093=y
+# CONFIG_VIDEO_SAA7110 is not set
+# CONFIG_VIDEO_SAA7111 is not set
+# CONFIG_VIDEO_SAA7114 is not set
+# CONFIG_VIDEO_SAA711X is not set
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_SAA7191 is not set
+# CONFIG_VIDEO_TVP514X is not set
+# CONFIG_VIDEO_TVP5150 is not set
+# CONFIG_VIDEO_VPX3220 is not set
+
+#
+# Video and audio decoders
+#
+# CONFIG_VIDEO_CX25840 is not set
+
+#
+# MPEG video encoders
+#
+# CONFIG_VIDEO_CX2341X is not set
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+# CONFIG_VIDEO_SAA7185 is not set
+# CONFIG_VIDEO_ADV7170 is not set
+# CONFIG_VIDEO_ADV7175 is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+CONFIG_VIDEO_OMAP3=y
+CONFIG_VIDEO_OMAP3_V4L2=y
+CONFIG_VIDEO_OMAP_VIDEOLIB=y
+CONFIG_VIDEO_OMAP_VIDEOOUT=y
+CONFIG_NTSC_M=y
+# CONFIG_PAL_BDGHI is not set
+# CONFIG_SOC_CAMERA is not set
+# CONFIG_V4L_USB_DRIVERS is not set
+# CONFIG_RADIO_ADAPTERS is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_UVESA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_FB_OMAP_LCD_WVGA=y
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_DSS_VRAM_SIZE=4
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+# CONFIG_OMAP2_DSS_DSI is not set
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+
+#
+# OMAP2/3 Display Device Drivers
+#
+# CONFIG_PANEL_GENERIC is not set
+# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
+# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
+# CONFIG_PANEL_N800 is not set
+CONFIG_PANEL_ZOOM2=y
+# CONFIG_CTRL_BLIZZARD is not set
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+# CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE is not set
+CONFIG_FB_OMAP2_NUM_FBS=1
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+CONFIG_LCD_PLATFORM=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT 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
+CONFIG_SOUND=y
+# CONFIG_SOUND_OSS_CORE is not set
+CONFIG_SND=y
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_HRTIMER 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
+CONFIG_SND_DRIVERS=y
+# 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
+CONFIG_SND_ARM=y
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_CAIAQ is not set
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MICROSOFT is not set
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SONY is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+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
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# 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_SEVSEG 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
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_ETH is not set
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_ANDROID=y
+# CONFIG_USB_CDC_COMPOSITE is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_TWL4030_USB=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+# CONFIG_MMC_EMBEDDED_SDIO is not set
+# CONFIG_MMC_PARANOID_SD_INIT is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_MMC_BLOCK_PARANOID_RESUME=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_OMAP_HS=y
+# CONFIG_OMAP_HS_MMC2 is not set
+# CONFIG_OMAP_HS_MMC3 is not set
+# CONFIG_MMC_SPI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_SWITCH=y
+# CONFIG_SWITCH_GPIO is not set
+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
+CONFIG_RTC_INTF_ALARM=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# 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
+CONFIG_RTC_DRV_TWL4030=y
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+CONFIG_REGULATOR_TWL4030=y
+# CONFIG_UIO is not set
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_MEILHAUS is not set
+# CONFIG_USB_IP_COMMON is not set
+# CONFIG_ECHO is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_INPUT_MIMIO is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_ANDROID_BINDER_IPC is not set
+# CONFIG_ANDROID_LOGGER is not set
+# CONFIG_ANDROID_RAM_CONSOLE is not set
+# CONFIG_ANDROID_TIMED_OUTPUT is not set
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
+
+#
+# CBUS support
+#
+# CONFIG_CBUS is not set
+# CONFIG_MPU_BRIDGE is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=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_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_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
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+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
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+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_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# 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
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/recipes/linux/linux-omapandroid_2.6.29.bb b/recipes/linux/linux-omapandroid_2.6.29.bb
new file mode 100644
index 0000000000..40444250dc
--- /dev/null
+++ b/recipes/linux/linux-omapandroid_2.6.29.bb
@@ -0,0 +1,24 @@
+require linux.inc
+
+DESCRIPTION = "Linux kernel for OMAP processors"
+KERNEL_IMAGETYPE = "uImage"
+
+COMPATIBLE_MACHINE = "omapzoom2"
+
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_omapzoom2 = "1"
+
+SRCREV = "1e5ddc5d409f25652fe99064f22c0aa75bc9b7b3"
+
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
+PV = "2.6.29"
+PR_append = "+gitr${SRCREV}"
+
+SRC_URI = "git://android.git.kernel.org/kernel/omap;branch=android-omap-2.6.29;protocol=git \
+ file://defconfig"
+
+SRC_URI_append = " \
+"
+
+S = "${WORKDIR}/git"
+
diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
index 42fb56a22b..3dbb1ecb40 100644
--- a/recipes/linux/linux.inc
+++ b/recipes/linux/linux.inc
@@ -21,7 +21,7 @@ CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfs
# Set the verbosity of kernel messages during runtime
# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
-CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug",d)}'
+CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug", d)}'
CMDLINE_append = " ${CMDLINE_DEBUG} "
# Support for binary device tree generation
@@ -29,6 +29,7 @@ CMDLINE_append = " ${CMDLINE_DEBUG} "
FILES_kernel-devicetree = "/boot/devicetree*"
KERNEL_DEVICETREE_boc01 = "${WORKDIR}/boc01.dts"
+KERNEL_DEVICETREE_calamari = "arch/${ARCH}/boot/dts/mpc8536ds.dts"
KERNEL_DEVICETREE_canyonlands = "arch/${ARCH}/boot/dts/canyonlands.dts"
KERNEL_DEVICETREE_kilauea = "arch/${ARCH}/boot/dts/kilauea.dts"
KERNEL_DEVICETREE_lsppchd = "arch/${ARCH}/boot/dts/kuroboxHD.dts"
@@ -157,22 +158,6 @@ do_configure_append() {
fi
}
-do_compile_append() {
- if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
- if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
- ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
- uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
- rm -f linux.bin
- else
- ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
- rm -f linux.bin.gz
- gzip -9 linux.bin
- uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage
- rm -f linux.bin.gz
- fi
- fi
-}
-
do_devicetree_image() {
if test -n "${KERNEL_DEVICETREE}" ; then
dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
diff --git a/recipes/linux/linux/mx31ads/defconfig b/recipes/linux/linux/mx31ads/defconfig
new file mode 100644
index 0000000000..5740eb8481
--- /dev/null
+++ b/recipes/linux/linux/mx31ads/defconfig
@@ -0,0 +1,1202 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.31-rc4
+# Sat Jul 25 17:10:11 2009
+#
+CONFIG_ARM=y
+CONFIG_HAVE_PWM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_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_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+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_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=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_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+
+#
+# Performance Counters
+#
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_SLOW_WORK is not set
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY 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"
+CONFIG_FREEZER=y
+
+#
+# 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_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+CONFIG_ARCH_MXC=y
+# CONFIG_ARCH_STMP3XXX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X 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_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Freescale MXC Implementations
+#
+# CONFIG_ARCH_MX1 is not set
+# CONFIG_ARCH_MX2 is not set
+CONFIG_ARCH_MX3=y
+CONFIG_ARCH_MX31=y
+
+#
+# MX3 platforms:
+#
+CONFIG_MACH_MX31ADS=y
+CONFIG_MACH_MX31ADS_WM1133_EV1=y
+# CONFIG_MACH_PCM037 is not set
+# CONFIG_MACH_MX31LITE is not set
+# CONFIG_MACH_MX31_3DS is not set
+# CONFIG_MACH_MX31MOBOARD is not set
+# CONFIG_MACH_MX31LILLY is not set
+# CONFIG_MACH_QONG is not set
+# CONFIG_MACH_PCM043 is not set
+# CONFIG_MACH_ARMADILLO5X0 is not set
+# CONFIG_MACH_MX35_3DS is not set
+CONFIG_MXC_IRQ_PRIOR=y
+CONFIG_MXC_PWM=y
+CONFIG_ARCH_HAS_RNGA=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_V6=y
+# CONFIG_CPU_32v6K is not set
+CONFIG_CPU_32v6=y
+CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_V6=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_OUTER_CACHE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_ARM_ERRATA_411920=y
+CONFIG_COMMON_CLKDEV=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM 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_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MLOCKED_PAGE_BIT=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw ip=off"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_IDLE 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
+CONFIG_VFP=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# 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 is not set
+# 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 is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# 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_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_NET_DSA 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
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# 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_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_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
+# CONFIG_MTD_OOPS 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 is not set
+# 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
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
+# CONFIG_MTD_ARM_INTEGRATOR 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 is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+# CONFIG_BLK_DEV is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# 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_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_CS89x0=y
+CONFIG_CS89x0_NONISA_IRQ=y
+# CONFIG_KS8842 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
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP 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 is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_IMX=y
+CONFIG_SERIAL_IMX_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_IMX=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 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
+# CONFIG_SPI is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+CONFIG_W1=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2482 is not set
+CONFIG_W1_MASTER_MXC=y
+# CONFIG_W1_MASTER_DS1WM is not set
+# CONFIG_W1_MASTER_GPIO is not set
+
+#
+# 1-wire Slaves
+#
+CONFIG_W1_SLAVE_THERM=y
+# CONFIG_W1_SLAVE_SMEM is not set
+# CONFIG_W1_SLAVE_DS2431 is not set
+# CONFIG_W1_SLAVE_DS2433 is not set
+# CONFIG_W1_SLAVE_DS2760 is not set
+# CONFIG_W1_SLAVE_BQ27000 is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+CONFIG_WM8350_POWER=y
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 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_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_G760A 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_LTC4215 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_LM95241 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_PCF8591 is not set
+# CONFIG_SENSORS_SHT15 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_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_TMP401 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_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_WM8350_WATCHDOG=y
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+CONFIG_MFD_WM8350=y
+CONFIG_MFD_WM8350_CONFIG_MODE_0=y
+CONFIG_MFD_WM8352_CONFIG_MODE_0=y
+CONFIG_MFD_WM8350_I2C=y
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_AB3100_CORE is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# 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_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# 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_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_FB_MX3=y
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_SEQUENCER=y
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_SEQUENCER_OSS is not set
+# CONFIG_SND_HRTIMER 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
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+CONFIG_SND_ARM=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+# CONFIG_SOUND_PRIME is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+CONFIG_MMC_MXC=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_MX3_IPU=y
+CONFIG_MX3_IPU_IRQS=4
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+# CONFIG_NET_DMA is not set
+# CONFIG_ASYNC_TX_DMA is not set
+# CONFIG_DMATEST is not set
+# CONFIG_AUXDISPLAY is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+CONFIG_REGULATOR_WM8350=y
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# 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_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 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
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# 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_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF 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_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
diff --git a/recipes/linux/linux_2.6.25.bb b/recipes/linux/linux_2.6.25.bb
index b529b756cf..5834dbc617 100644
--- a/recipes/linux/linux_2.6.25.bb
+++ b/recipes/linux/linux_2.6.25.bb
@@ -5,6 +5,7 @@ PR = "r6"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_mpc8313e-rdb = "1"
+DEFAULT_PREFERENCE_mpc8315e-rdb = "1"
DEFAULT_PREFERENCE_kilauea = "1"
DEFAULT_PREFERENCE_sequoia = "1"
DEFAULT_PREFERENCE_cm-x270 = "-1"
diff --git a/recipes/linux/linux_2.6.28.bb b/recipes/linux/linux_2.6.28.bb
index 415f81a1cb..37a8646306 100644
--- a/recipes/linux/linux_2.6.28.bb
+++ b/recipes/linux/linux_2.6.28.bb
@@ -1,6 +1,6 @@
require linux.inc
-PR = "r10"
+PR = "r11"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
diff --git a/recipes/linux/linux_2.6.29+2.6.30-rc4.bb b/recipes/linux/linux_2.6.29+2.6.30-rc4.bb
index 3c79c45a64..0217587661 100644
--- a/recipes/linux/linux_2.6.29+2.6.30-rc4.bb
+++ b/recipes/linux/linux_2.6.29+2.6.30-rc4.bb
@@ -3,7 +3,7 @@ require linux.inc
KERNEL_RELEASE = "2.6.30-rc4"
OLD_KERNEL_RELEASE = "2.6.29"
PV = "${OLD_KERNEL_RELEASE}+${KERNEL_RELEASE}"
-PR = "r1"
+PR = "r5"
S = "${WORKDIR}/linux-${OLD_KERNEL_RELEASE}"
@@ -18,10 +18,11 @@ DEFAULT_PREFERENCE_poodle = "-1"
DEFAULT_PREFERENCE_spitz = "-1"
DEFAULT_PREFERENCE_tosa = "-1"
DEFAULT_PREFERENCE_afeb9260 = "1"
+DEFAULT_PREFERENCE_tx25 = "1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${OLD_KERNEL_RELEASE}.tar.bz2 \
- ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/patch-${KERNEL_RELEASE}.bz2;patch=1 \
+ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/v2.6.30/patch-${KERNEL_RELEASE}.bz2;patch=1 \
file://defconfig"
SRC_URI_append_afeb9260 = " \
@@ -30,3 +31,6 @@ SRC_URI_append_afeb9260 = " \
file://0004-AFEB9260-ASoC-driver.patch;patch=1 \
"
+SRC_URI_append_tx25 = " file://linux-2.6.30-rc4-git.patch;patch=1 \
+ file://linux-2.6.30-rc4-karo3.diff;patch=1 \
+ file://stk5-baseboard_c_vesa640.patch;patch=1"
diff --git a/recipes/linux/linux_2.6.29.bb b/recipes/linux/linux_2.6.29.bb
index dfed6f2a65..275baf97ea 100644
--- a/recipes/linux/linux_2.6.29.bb
+++ b/recipes/linux/linux_2.6.29.bb
@@ -1,6 +1,6 @@
require linux.inc
-PR = "r5"
+PR = "r8"
S = "${WORKDIR}/linux-2.6.29"
@@ -16,13 +16,13 @@ DEFAULT_PREFERENCE_ep93xx = "1"
DEFAULT_PREFERENCE_cm-x270 = "1"
DEFAULT_PREFERENCE_at2440evb = "1"
DEFAULT_PREFERENCE_tqm8540 = "1"
+DEFAULT_PREFERENCE_stamp9g20evb = "1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.29.tar.bz2 \
file://defconfig"
SRC_URI_append_boc01 = "\
file://boc01.dts \
- file://001-090114-sqn11x0-usb-hack.patch;patch=1 \
file://004-081205-usb.patch;patch=1 \
file://005-090226-isl12024.patch;patch=1 \
file://007-081217-lm73.patch;patch=1 \
@@ -67,5 +67,9 @@ SRC_URI_append_cm-x270 = "\
file://0003-cm-x2xx.c-add-support-for-sharp-VGA-display-panel.patch;patch=1 \
"
+SRC_URI_append_stamp9g20evb = " \
+ file://stamp9g20.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),0x230000(root),-(config);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd4 rootfstype=jffs2"
diff --git a/recipes/linux/linux_2.6.30.bb b/recipes/linux/linux_2.6.30.bb
index 900b3d95f1..c7f0bde791 100644
--- a/recipes/linux/linux_2.6.30.bb
+++ b/recipes/linux/linux_2.6.30.bb
@@ -1,18 +1,23 @@
require linux.inc
-PR = "r0"
+PR = "r1"
S = "${WORKDIR}/linux-${PV}"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_mpc8315e-rdb = "1"
-DEFAULT_PREFERENCE_tx25 = "1"
+DEFAULT_PREFERENCE_calamari = "1"
DEFAULT_PREFERENCE_mx27ads = "1"
+# machine boots with it, works but was not tested too much
+DEFAULT_PREFERENCE_at91sam9263ek = "-1"
+
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
+ http://maxim.org.za/AT91RM9200/2.6/2.6.30-at91.patch.gz;patch=1 \
file://defconfig"
SRC_URI_append_mpc8315e-rdb = " file://mpc8315erdb-add-msi-to-dts.patch;patch=1"
-SRC_URI_append_tx25 = " file://linux-2.6.30-rc4-karo.diff;patch=1"
+SRC_URI_append_at91sam9263ek = " file://hrw-linux-2.6.30-exp.patch;patch=1 "
+
diff --git a/recipes/linux/mx31ads-kernel_2.6.19rc6.bb b/recipes/linux/mx31ads-kernel_2.6.19rc6.bb
deleted file mode 100644
index 90463936d8..0000000000
--- a/recipes/linux/mx31ads-kernel_2.6.19rc6.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SECTION = "kernel"
-DESCRIPTION = "Linux kernel for the MX31ADS"
-LICENSE = "GPL"
-PR = "r3"
-
-PV = "2.6.18+2.6.19-rc6"
-
-SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2 \
- ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/patch-2.6.19-rc6.bz2;patch=1 \
- http://opensource.wolfsonmicro.com/~lg/linux-2.6-mx31/mx31ads-2.6.19rc6-lg1.patch.bz2;patch=1 \
- file://imx31ads_defconfig"
-
-S = "${WORKDIR}/linux-2.6.18"
-
-COMPATIBLE_HOST = 'arm.*-linux'
-COMPATIBLE_MACHINE = "mx31ads"
-
-inherit kernel
-
-ARCH = "arm"
-RPROVIDES_kernel-image += "hostap-modules"
-
-#CMDLINE_ROOT = "root=/dev/mtdblock4 rootfstype=jffs2 mem=32M@0x00000000"
-#CMDLINE = "${CMDLINE_ROOT} ${CMDLINE_CONSOLE}"
-
-do_configure_prepend() {
- install -m 0644 ${WORKDIR}/imx31ads_defconfig ${S}/defconfig
-
- 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
-
- sed -e '/CONFIG_AEABI/d' \
- -e '/CONFIG_OABI_COMPAT=/d' \
- '${S}/defconfig' >>'${S}/.config'
-
-
-# echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config
-
- yes '' | oe_runmake oldconfig
-
-}
-
-KERNEL_RELEASE = "2.6.19-rc6"
diff --git a/recipes/lirc/lirc-modules_0.8.5.bb b/recipes/lirc/lirc-modules_0.8.5.bb
new file mode 100644
index 0000000000..e07777503f
--- /dev/null
+++ b/recipes/lirc/lirc-modules_0.8.5.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls. This package contains the lirc kernel modules."
+SECTION = "base"
+PRIORITY = "optional"
+HOMEPAGE = "http://www.lirc.org"
+LICENSE = "GPL"
+DEPENDS = "virtual/kernel fakeroot-native setserial"
+
+SRCDATE=${@bb.data.getVar('PV', d, 1)[9:]}
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lirc/lirc-${PV}.tar.gz"
+S = "${WORKDIR}/lirc-${PV}"
+
+
+inherit autotools module
+
+require lirc-config.inc
+
+MAKE_TARGETS = "KERNEL_PATH=${STAGING_KERNEL_DIR} MAKE='make V=1' -C drivers"
+
+fakeroot do_install() {
+ oe_runmake -C drivers DESTDIR="${D}" moduledir="/lib/modules/${KERNEL_VERSION}/lirc" install
+ rm -rf ${D}/dev
+}
+
+# this is for distributions that don't use udev
+pkg_postinst_append() {
+if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
+}
+
+FILES_${PN} = "/lib/modules"
diff --git a/recipes/lirc/lirc_0.8.5.bb b/recipes/lirc/lirc_0.8.5.bb
new file mode 100644
index 0000000000..34a40ff9ef
--- /dev/null
+++ b/recipes/lirc/lirc_0.8.5.bb
@@ -0,0 +1,67 @@
+DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls."
+DESCRIPTION_append_lirc = " This package contains the lirc daemon, libraries and tools."
+DESCRIPTION_append_lirc-x = " This package contains lirc tools for X11."
+DESCRIPTION_append_lirc-exec = " This package contains a daemon that runs programs on IR signals."
+DESCRIPTION_append_lirc-remotes = " This package contains some config files for remotes."
+DESCRIPTION_append_lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2."
+SECTION = "console/network"
+PRIORITY = "optional"
+HOMEPAGE = "http://www.lirc.org"
+LICENSE = "GPL"
+DEPENDS = "virtual/kernel virtual/libx11 libxau libsm libice"
+DEPENDS_nslu2 = "virtual/kernel lirc-modules"
+RDEPENDS = "lirc-modules"
+RDEPENDS_lirc-x = "lirc"
+RDEPENDS_lirc-exec = "lirc"
+RDEPENDS_lirc-nslu2example = "lirc lirc-exec"
+RRECOMMENDS_lirc = "lirc-exec"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lirc/lirc-${PV}.tar.gz \
+ file://lircd.init file://lircmd.init file://lircexec.init"
+SRC_URI_append_nslu2 = " file://lircd.conf_nslu2 file://lircrc_nslu2"
+
+S = "${WORKDIR}/lirc-${PV}"
+
+inherit autotools module-base update-rc.d
+
+INITSCRIPT_PACKAGES = "lirc lirc-exec"
+INITSCRIPT_NAME = "lircd"
+INITSCRIPT_PARAMS = "defaults 20"
+INITSCRIPT_NAME_lirc-exec = "lircexec"
+INITSCRIPT_PARAMS_lirc-exec = "defaults 21"
+
+require lirc-config.inc
+
+EXTRA_OEMAKE = 'SUBDIRS="daemons tools"'
+
+do_stage() {
+ oe_libinstall -so -C tools liblirc_client ${STAGING_LIBDIR}
+ install -d ${STAGING_INCDIR}/lirc/
+ install -m 0644 tools/lirc_client.h ${STAGING_INCDIR}/lirc/
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install ${WORKDIR}/lircd.init ${D}${sysconfdir}/init.d/lircd
+ install ${WORKDIR}/lircexec.init ${D}${sysconfdir}/init.d/lircexec
+ install -d ${D}${datadir}/lirc/
+ cp -pPR ${S}/remotes ${D}${datadir}/lirc/
+ rm -rf ${D}/dev
+}
+
+do_install_append_nslu2() {
+ install -d ${D}${sysconfdir}
+ install ${WORKDIR}/lircd.conf_nslu2 ${D}${sysconfdir}/lircd.conf
+ install ${WORKDIR}/lircrc_nslu2 ${D}${sysconfdir}/lircrc
+}
+
+PACKAGES =+ "lirc-x lirc-exec lirc-remotes"
+PACKAGES_prepend_nslu2 = "lirc-nslu2example "
+
+FILES_${PN}-dbg += "${bindir}/.debug ${sbindir}/.debug"
+FILES_${PN} = "${bindir} ${sbindir} ${libdir} ${sysconfdir}/init.d"
+FILES_lirc-x = "${bindir}/irxevent ${bindir}/xmode2"
+FILES_lirc-exec = "${bindir}/irexec ${sysconfdir}/init.d/lircexec"
+FILES_lirc-remotes = "${datadir}/lirc/remotes"
+FILES_lirc-nslu2example = "${sysconfdir}/lircd.conf ${sysconfdir}/lircrc"
+CONFFILES_lirc-nslu2example = "${FILES_lirc-nslu2example}"
diff --git a/recipes/live555/live555_20090602.bb b/recipes/live555/live555_20090602.bb
new file mode 100644
index 0000000000..c6438bce6e
--- /dev/null
+++ b/recipes/live555/live555_20090602.bb
@@ -0,0 +1,54 @@
+# live555 OE build file
+# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+DESCRIPTION = "LIVE555 Streaming Media libraries"
+HOMEPAGE = "http://live.com/"
+LICENSE = "LGPL"
+SECTION = "devel"
+
+PR = "r1"
+
+SRC_URI = "http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz \
+ file://config.linux-cross"
+
+S = "${WORKDIR}/live"
+
+do_configure() {
+ cp ${WORKDIR}/config.linux-cross .
+ ./genMakefiles linux-cross
+}
+
+do_compile() {
+ make
+}
+
+do_install() {
+ install -d ${D}${includedir}/BasicUsageEnvironment
+ install -d ${D}${includedir}/groupsock
+ install -d ${D}${includedir}/liveMedia
+ install -d ${D}${includedir}/UsageEnvironment
+ install -d ${D}${libdir}
+ cp -a ${S}/BasicUsageEnvironment/include/*.hh ${D}${includedir}/BasicUsageEnvironment/
+ cp -a ${S}/groupsock/include/*.h ${D}${includedir}/groupsock/
+ cp -a ${S}/groupsock/include/*.hh ${D}${includedir}/groupsock/
+ cp -a ${S}/liveMedia/include/*.hh ${D}${includedir}/liveMedia/
+ cp -a ${S}/UsageEnvironment/include/*.hh ${D}${includedir}/UsageEnvironment/
+ cp ${S}/*/*.a ${D}${libdir}
+}
+
+do_stage () {
+ install -d ${STAGING_INCDIR}/
+ install -d ${STAGING_LIBDIR}/
+
+ # Find all the headers
+ for i in $(find . -name "*.hh") $(find . -name "*.h") ; do
+ install ${i} ${STAGING_INCDIR}/
+ done
+
+ # Find the libs *.a
+ for i in $(find . -name "*.a") ; do
+ install ${i} ${STAGING_LIBDIR}
+ done
+}
+
diff --git a/recipes/loudmouth/loudmouth_1.4.3.bb b/recipes/loudmouth/loudmouth_1.4.3.bb
new file mode 100644
index 0000000000..d8f519b611
--- /dev/null
+++ b/recipes/loudmouth/loudmouth_1.4.3.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "Loudmouth is a lightweight and easy-to-use C library for programming with the Jabber protocol."
+HOMEPAGE = "http://www.loudmouth-project.org/"
+LICENSE = "LGPL"
+DEPENDS = "glib-2.0 gnutls check"
+
+SRC_URI = "http://ftp.imendio.com/pub/imendio/${PN}/src/${PN}-${PV}.tar.gz"
+
+inherit autotools pkgconfig
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/lowpan-tools/lowpan-tools_git.bb b/recipes/lowpan-tools/lowpan-tools_git.bb
index 307984498e..78b6fa2792 100644
--- a/recipes/lowpan-tools/lowpan-tools_git.bb
+++ b/recipes/lowpan-tools/lowpan-tools_git.bb
@@ -1,16 +1,17 @@
DESCRIPTION = "LoWPAN utilities (IEEE802.15.4)"
LICENSE = "GPL"
-SRCREV = "28639544fa2496ae6f82ef300ffc9e6543c4bcd0"
+SRCREV = "b30f459c9ef500b73043d105597f382ec4f53f1b"
SRC_URI = "git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee;protocol=git"
DEPENDS = "libnl bison-native flex-native"
-PR = "r7"
+PR = "r8"
S = "${WORKDIR}/git"
PACKAGES += "${PN}-tests-dbg"
PACKAGES += "${PN}-tests"
FILES_${PN} = "${sbindir}/iz ${sbindir}/izconfig \
${bindir}/izchat ${bindir}/izlisten ${sbindir}/izcoordinator \
- ${sbindir}/izattach"
+ ${sbindir}/izattach ${libdir}/ip/link_wpan.so"
+FILES_${PN}-dbg += "${libdir}/ip/.debug/link_wpan.so"
FILES_${PN}-tests = "${libexecdir}/lowpan-tools ${libdir}/python*/site-packages"
FILES_${PN}-tests-dbg = "${libexecdir}/lowpan-tools/.debug"
diff --git a/recipes/matchbox-terminal/matchbox-terminal_svn.bb b/recipes/matchbox-terminal/matchbox-terminal_svn.bb
new file mode 100644
index 0000000000..4d2ddc2eb9
--- /dev/null
+++ b/recipes/matchbox-terminal/matchbox-terminal_svn.bb
@@ -0,0 +1,11 @@
+DESCRIPTION = "Matchbox Terminal"
+LICENSE = "GPL"
+DEPENDS = "gtk+ vte"
+SECTION = "x11/utils"
+PV = "0.0+svnr${SRCREV}"
+
+SRC_URI = "svn://svn.o-hand.com/repos/matchbox/trunk;module=${PN};proto=http"
+
+S = "${WORKDIR}/${PN}"
+
+inherit autotools pkgconfig
diff --git a/recipes/mesa/mesa-dri_7.4.bb b/recipes/mesa/mesa-dri_7.4.bb
new file mode 100644
index 0000000000..296a254841
--- /dev/null
+++ b/recipes/mesa/mesa-dri_7.4.bb
@@ -0,0 +1,28 @@
+include mesa-common.inc
+
+PROTO_DEPS = "xf86driproto glproto dri2proto expat"
+LIB_DEPS = "libdrm virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
+
+DEPENDS = "${PROTO_DEPS} ${LIB_DEPS}"
+
+PE = "1"
+PR = "r6"
+
+# most of our targets do not have DRI so will use mesa-xlib
+DEFAULT_PREFERENCE = "-1"
+
+# ASUS EeePC 901 has DRI support so use mesa-dri by default
+DEFAULT_PREFERENCE_eee901 = "1"
+
+PACKAGES =+ "${PN}-xprogs"
+
+FILES_${PN} += "${libdir}/dri/*.so"
+FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
+FILES_${PN}-xprogs = "${bindir}/glxdemo ${bindir}/glxgears ${bindir}/glxheads ${bindir}/glxinfo"
+
+EXTRA_OECONF += "--with-driver=dri --with-dri-drivers=swrast,${MACHINE_DRI_MODULES}"
+
+do_install_append () {
+ install -d ${D}/usr/bin
+ install -m 0755 ${S}/progs/xdemos/{glxdemo,glxgears,glxheads,glxinfo} ${D}/usr/bin/
+}
diff --git a/recipes/mesa/mesa_7.4.bb b/recipes/mesa/mesa_7.4.bb
new file mode 100644
index 0000000000..43cde679a1
--- /dev/null
+++ b/recipes/mesa/mesa_7.4.bb
@@ -0,0 +1,2 @@
+# This is a dummy package so OE can use the poky mesa files
+require mesa-dri_${PV}.bb
diff --git a/recipes/meta/meta-toolchain-qte.bb b/recipes/meta/meta-toolchain-qte.bb
index 49ed35ee0f..70c4087211 100644
--- a/recipes/meta/meta-toolchain-qte.bb
+++ b/recipes/meta/meta-toolchain-qte.bb
@@ -1,11 +1,12 @@
# Qt Embedded toolchain
-
-require meta-toolchain.bb
-
+PR = "r1"
TOOLCHAIN_HOST_TASK = "task-qte-toolchain-host"
TOOLCHAIN_TARGET_TASK = "task-qte-toolchain-target"
+require meta-toolchain.bb
SDK_SUFFIX = "toolchain-qte"
+
+
QT_DIR_NAME = "qtopia"
do_populate_sdk_append() {
diff --git a/recipes/mono/mono-2.4.2.3/0001-remove-docs-dir-from-build.patch b/recipes/mono/mono-2.4.2.3/0001-remove-docs-dir-from-build.patch
new file mode 100644
index 0000000000..4e276e3f0c
--- /dev/null
+++ b/recipes/mono/mono-2.4.2.3/0001-remove-docs-dir-from-build.patch
@@ -0,0 +1,30 @@
+From 2ca04d7b2af1f1d690d918da047b03de768f1a8b Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@bec-systems.com>
+Date: Fri, 31 Jul 2009 17:48:47 -0400
+Subject: [PATCH] remove docs dir from build
+
+---
+ Makefile.am | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 083bb82..386ed91 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,11 +1,11 @@
+ AUTOMAKE_OPTIONS = foreign
+ ACLOCAL_AMFLAGS = -I .
+
+-SUBDIRS = po $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support data runtime scripts man samples web msvc docs
++SUBDIRS = po $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support data runtime scripts man samples web msvc
+
+ # Keep in sync with SUBDIRS
+ ## 'tools' is not normally built
+-DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc docs
++DIST_SUBDIRS = po libgc $(eglib_dir) mono ikvm-native support data runtime scripts man samples web tools msvc
+
+ EXTRA_DIST= nls.m4 po.m4 progtest.m4 mono-uninstalled.pc.in build-mingw32.sh LICENSE mkinstalldirs
+
+--
+1.6.0.4
+
diff --git a/recipes/mono/mono-2.4.2.3/configure.patch b/recipes/mono/mono-2.4.2.3/configure.patch
new file mode 100644
index 0000000000..7ca874ab07
--- /dev/null
+++ b/recipes/mono/mono-2.4.2.3/configure.patch
@@ -0,0 +1,44 @@
+Index: mono-2.4.2.1/configure.in
+===================================================================
+--- mono-2.4.2.1.orig/configure.in 2008-11-13 18:22:29.000000000 -0500
++++ mono-2.4.2.1/configure.in 2008-12-10 16:03:11.000000000 -0500
+@@ -1155,6 +1155,8 @@
+ ], [
+ AC_MSG_RESULT(no)
+ with_tls=pthread
++ ], [
++ AC_MSG_RESULT(yes)
+ ])
+ fi
+
+@@ -1257,6 +1259,9 @@
+ ], [
+ with_sigaltstack=no
+ AC_MSG_RESULT(no)
++ ], [
++ AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
+ ])
+ fi
+
+@@ -1746,6 +1751,7 @@
+
+ jit_wanted=false
+ interp_wanted=false
++echo "CLIFF: checking host = $host"
+ case "$host" in
+ # mips-sgi-irix5.* | mips-sgi-irix6.*)
+ # TARGET=MIPS;
+@@ -1882,10 +1888,12 @@
+ jit_wanted=true
+ ;;
+ arm*-linux*)
++ echo "CLIFF: found arm linux"
+ TARGET=ARM;
+ arch_target=arm;
+ ACCESS_UNALIGNED="no"
+ JIT_SUPPORTED=yes
++ CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1"
+ jit_wanted=true
+ ;;
+ s390-*-linux*)
diff --git a/recipes/mono/mono-2.4.2.3/mini-arm.patch b/recipes/mono/mono-2.4.2.3/mini-arm.patch
new file mode 100644
index 0000000000..d517a5a276
--- /dev/null
+++ b/recipes/mono/mono-2.4.2.3/mini-arm.patch
@@ -0,0 +1,11 @@
+--- mono-2.4.2.1/mono/mini/mini-arm.h 2009-06-23 09:41:00.000000000 -0600
++++ mono-2.4.2.1/mono/mini/mini-arm.h 2009-06-23 09:40:27.000000000 -0600
+@@ -9,7 +9,7 @@
+ #endif
+
+ #ifdef ARM_FPU_VFP
+-#error "VFP support is not complete, try mono SVN for that."
++//#error "VFP support is not complete, try mono SVN for that."
+ #endif
+
+ #if defined(__ARM_EABI__)
diff --git a/recipes/mono/mono-mcs-intermediate_2.4.2.3.bb b/recipes/mono/mono-mcs-intermediate_2.4.2.3.bb
new file mode 100644
index 0000000000..258f812602
--- /dev/null
+++ b/recipes/mono/mono-mcs-intermediate_2.4.2.3.bb
@@ -0,0 +1,17 @@
+# This is a straw-man recipe for step 1 in the two-step build of
+# mono. Because it's impossible to build the mcs directory
+# in cross-compile mode, this recipe will do a native build,
+# then tar the resulting install tree for usage by the mono
+# package in step 2.
+# See http://www.mono-project.com/Mono:ARM
+
+require mono_2.4.2.3.inc
+require mono-mcs-intermediate.inc
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI += ""
+
+PR = "${INC_PR}.1"
+
+
diff --git a/recipes/mono/mono-native_2.4.2.3.bb b/recipes/mono/mono-native_2.4.2.3.bb
new file mode 100644
index 0000000000..44ac053e99
--- /dev/null
+++ b/recipes/mono/mono-native_2.4.2.3.bb
@@ -0,0 +1,20 @@
+require mono_2.4.2.3.inc
+DEPENDS = "glib-2.0-native perl-native"
+
+PR = "${INC_PR}.1"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI += ""
+
+inherit native
+
+do_fix_libtool_name() {
+ # inherit native will make that all native tools that are being
+ # built are prefixed with something like "i686-linux-",
+ # including libtool. Fix up some hardcoded libtool names:
+ for i in "${S}"/runtime/*-wrapper.in; do
+ sed -e "s/libtool/${BUILD_SYS}-libtool/" -i "${i}"
+ done
+}
+addtask fix_libtool_name after do_patch before do_configure
diff --git a/recipes/mono/mono_2.4.2.3.bb b/recipes/mono/mono_2.4.2.3.bb
new file mode 100644
index 0000000000..e1f1968cdb
--- /dev/null
+++ b/recipes/mono/mono_2.4.2.3.bb
@@ -0,0 +1,85 @@
+require mono_2.4.2.3.inc
+
+DEPENDS = "mono-native mono-mcs-intermediate glib-2.0 perl-native"
+
+DEFAULT_PREFERENCE = "-1"
+
+PR = "${INC_PR}.1"
+
+# mono makes use of non-thumb-compatible inline asm.
+ARM_INSTRUCTION_SET = "arm"
+
+SRC_URI += "file://configure.patch;patch=1\
+ file://mini-arm.patch;patch=1\
+ file://0001-remove-docs-dir-from-build.patch;patch=1"
+
+# Per http://www.mono-project.com/Mono:ARM
+EXTRA_OECONF += " --disable-mcs-build "
+# Instead, get the mcs tree from a different build (see mono-mcs-intermediate)
+
+do_install_prepend() {
+ install -d ${D}
+ pushd ${D}
+ tar -xzf ${STAGING_DATADIR_NATIVE}/mono-mcs/mono-mcs-${PV}.tar.gz
+ popd
+}
+
+do_install_append() {
+ # mono-mcs-intermediate builds and installs jay (a Yacc for Java and C#),
+ # however, jay is not being cross-compiled and thus only
+ # available for the buildhost architecture, so remove it
+ # entirely
+ pushd ${D}
+ rm -rf ./usr/share/man/man1/jay.1 ./usr/share/jay \
+ ./usr/share/jay/README.jay \
+ ./usr/bin/jay
+ popd
+
+ # Not packaged with the default rules and apparently
+ # not used for anything
+ rm -rf ${D}${datadir}/mono-1.0/mono/cil/cil-opcodes.xml
+}
+
+inherit mono
+
+# Import file definitions from Debian
+require mono_2.x-files.inc
+
+# Add some packages
+PACKAGES_append = "mono-doc mono mono-runtime"
+
+#FILES_mono-doc_append = " /usr/share/libgc-mono/ "
+
+FILES_mono = ""
+ALLOW_EMPTY_mono = "1"
+RDEPENDS_mono = "mono-common mono-jit"
+
+FILES_mono-runtime = ""
+ALLOW_EMPTY_mono-runtime = "1"
+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 \
+ /usr/lib/libMonoPosixHelper.la /usr/lib/libMonoSupportW.la"
+FILES_libmono-dbg =+ " /usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \
+ /usr/lib/.debug/libMonoPosixHelper.so /usr/lib/.debug/libMonoSupportW.so"
+
+# 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/recipes/mono/mono_2.4.2.3.inc b/recipes/mono/mono_2.4.2.3.inc
new file mode 100644
index 0000000000..21e596090c
--- /dev/null
+++ b/recipes/mono/mono_2.4.2.3.inc
@@ -0,0 +1,21 @@
+DESCRIPTION = "Mono Programming Language"
+SECTION = "devel/mono"
+LICENSE = "GPL LGPL X11"
+
+SRC_URI = "http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2"
+
+INC_PR = "r3"
+
+S = "${WORKDIR}/mono-2.4.2.3"
+
+do_fix_dolt_libtool() {
+ # look for libtool prefixed with HOST_SYS
+ sed -e "s/slash\}libtool/slash\}${HOST_SYS}-libtool/" -i acinclude.m4
+ echo No acinclude!
+}
+
+inherit autotools
+EXTRA_OECONF_arm = "--without-tls"
+EXTRA_OECONF_mipsel = "--without-tls"
+
+addtask fix_dolt_libtool after do_patch before do_configure
diff --git a/recipes/mono/mono_svn.bb b/recipes/mono/mono_svn.bb
index a5ba966796..311d2a38dd 100644
--- a/recipes/mono/mono_svn.bb
+++ b/recipes/mono/mono_svn.bb
@@ -5,7 +5,7 @@ DEPENDS = "mono-native mono-mcs-intermediate glib-2.0 perl-native"
PR = "r0"
DEFAULT_PREFERENCE = "-1"
-SRC_URI += "file://configure-svnr87352.patch;patch=1"
+SRC_URI += ""
# Per http://www.mono-project.com/Mono:ARM
EXTRA_OECONF += " --disable-mcs-build "
@@ -37,7 +37,7 @@ do_install_append() {
inherit mono
# Import file definitions from Debian
-require mono_1.2.5.1-files.inc
+require mono_2.x-files.inc
# Add some packages
PACKAGES_append = " mono-doc mono mono-runtime"
diff --git a/recipes/mplayer/mplayer_svn.bb b/recipes/mplayer/mplayer_svn.bb
index 3042a3ced0..d26302e65b 100644
--- a/recipes/mplayer/mplayer_svn.bb
+++ b/recipes/mplayer/mplayer_svn.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Open Source multimedia player."
SECTION = "multimedia"
PRIORITY = "optional"
HOMEPAGE = "http://www.mplayerhq.hu/"
-DEPENDS = "libdvdread libtheora virtual/libsdl ffmpeg xsp zlib libpng jpeg liba52 freetype fontconfig alsa-lib lzo ncurses lame libxv virtual/libx11 virtual/kernel \
+DEPENDS = "live555 libdvdread libtheora virtual/libsdl ffmpeg xsp zlib libpng jpeg liba52 freetype fontconfig alsa-lib lzo ncurses lame libxv virtual/libx11 virtual/kernel \
${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'libmad liba52 lame', d)}"
RDEPENDS = "mplayer-common"
@@ -37,7 +37,7 @@ RCONFLICTS_${PN} = "mplayer-atty"
RREPLACES_${PN} = "mplayer-atty"
PV = "0.0+1.0rc2+svnr${SRCREV}"
-PR = "r10"
+PR = "r12"
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_armv7a = "1"
@@ -76,7 +76,7 @@ EXTRA_OECONF = " \
--enable-rtc \
--enable-network \
--disable-smb \
- --disable-live \
+ --enable-live \
--disable-dvdnav \
--enable-dvdread \
--disable-dvdread-internal \
@@ -169,7 +169,8 @@ EXTRA_OECONF = " \
--disable-win32waveout \
--enable-select \
\
- "
+ --extra-libs=' -lBasicUsageEnvironment -lUsageEnvironment -lgroupsock -lliveMedia -lstdc++' \
+"
EXTRA_OECONF_append_arm = " --disable-decoder=vorbis_decoder \
--disable-encoder=vorbis_encoder"
@@ -215,7 +216,6 @@ do_configure() {
cat ${WORKDIR}/configh >> ${S}/config.h
cat ${WORKDIR}/configmak ${OPTSMAK} >> ${S}/config.mak
-
}
do_compile () {
diff --git a/recipes/musicpd/mpd_0.15.bb b/recipes/musicpd/mpd_0.15.bb
new file mode 100644
index 0000000000..8a8573fab9
--- /dev/null
+++ b/recipes/musicpd/mpd_0.15.bb
@@ -0,0 +1,45 @@
+DESCRIPTION = "Music Player Daemon (mpd)"
+HOMEPAGE = "http://www.musicpd.org"
+SECTION = "console/multimedia"
+LICENSE = "GPLv2"
+DEPENDS = "libvorbis libogg libao zlib libmikmod flac audiofile virtual/libiconv faad2 pulseaudio \
+ ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'libmad libid3tag lame', d)}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/musicpd/mpd-${PV}.tar.bz2 \
+ file://mpd/mpd.conf \
+ file://mpd/mpd.init"
+
+inherit autotools update-rc.d
+INITSCRIPT_NAME = "mpd"
+
+# Setting --enable-mpd-{mad,id3tag} causes local caches of the libraries to
+# be built, instead we use the OE built versions which should be installed
+# in staging - remove the --with and replace with --enable to use the local
+# versions.
+
+EXTRA_OECONF = "\
+ --enable-ogg \
+ --with-id3tag-libraries=${STAGING_LIBDIR} \
+ --with-id3tag-includes=${STAGING_INCDIR} \
+ --with-mad-libraries=${STAGING_LIBDIR} \
+ --with-mad-includes=${STAGING_INCDIR} \
+ --with-faad-libraries=${STAGING_LIBDIR} \
+ --with-faad-includes=${STAGING_INCDIR} \
+ --disable-curl \
+ --disable-ffmpeg \
+ --disable-jack \
+ --enable-pulse \
+ --enable-mod \
+ --disable-oggflac \
+ --with-lame-includes=${STAGING_INCDIR}"
+
+do_compile_prepend() {
+ find -name Makefile | xargs sed -i 's~-I/usr/include~-I${STAGING_INCDIR}~g'
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/mpd/mpd.init ${D}${sysconfdir}/init.d/mpd
+ install -m 644 ${WORKDIR}/mpd/mpd.conf ${D}${sysconfdir}/mpd.conf
+}
+
diff --git a/recipes/mythtv/mythtv_0.21.bb b/recipes/mythtv/mythtv_0.21.bb
index 3594afb45a..89b9b11e18 100644
--- a/recipes/mythtv/mythtv_0.21.bb
+++ b/recipes/mythtv/mythtv_0.21.bb
@@ -5,7 +5,7 @@ inherit qmake qt3x11
PR = "${SRCREV}+r5"
REALPV = "0.21"
-SRCREV = "19479"
+SRCREV = "20763"
SRC_URI = "svn://svn.mythtv.org/svn/branches/release-0-21-fixes;module=mythtv;proto=http"
SRC_URI += " \
diff --git a/recipes/mythtv/mythtv_svn.bb b/recipes/mythtv/mythtv_svn.bb
index 83ce8252fa..5fbbc4e354 100644
--- a/recipes/mythtv/mythtv_svn.bb
+++ b/recipes/mythtv/mythtv_svn.bb
@@ -5,20 +5,17 @@ inherit qmake2 qt4x11
DEFAULT_PREFERENCE = "-1"
PV = "0.21+0.22rc+svnr${SRCREV}"
-PR = "r2"
+PR = "r0"
REALPV = "0.22"
-SRCREV = "17892"
+SRCREV = "20947"
SRC_URI = "svn://svn.mythtv.org/svn/trunk;module=mythtv;proto=http"
-SRC_URI += "file://configure.patch;patch=1 \
- "
-
S = "${WORKDIR}/mythtv"
QMAKE_PROFILES = "mythtv.pro"
-mythlibs = "mythdb mythavutil mythavcodec mythavformat myth mythtv mythui mythfreemheg mythupnp mythlivemedia"
+mythlibs = "mythdb mythavutil mythavcodec mythavformat mythswscale mythhdhomerun myth mythtv mythui mythfreemheg mythupnp mythlivemedia"
PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data"
FILES_${PN}-dbg += "${libdir}/mythtv/filters/.debug"
@@ -47,48 +44,37 @@ python __anonymous () {
bb.data.setVar("PACKAGES", packages, d)
}
-EXTRA_OECONF_armv5te = " --enable-armv5te "
-EXTRA_OECONF_armv6 = " --enable-armv6 "
-EXTRA_OECONF_armv7a = " --enable-armv6"
-
-#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
-MY_ARCH := "${PACKAGE_ARCH}"
-PACKAGE_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', 'iwmmxt', '${MY_ARCH}',d)}"
-
-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_MYTHTVCONF_armv7a = "--cpu=cortex-a8"
+EXTRA_MYTHTVCONF ?= ""
+
+EXTRA_OECONF = " \
+ --cross-prefix=${TARGET_PREFIX} \
+ --sysroot=${STAGING_DIR_HOST} \
+ --prefix=${prefix} \
+ \
+ --arch=${TARGET_ARCH} \
+ --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+ --extra-cxxflags="${TARGET_CXXFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+ --extra-ldflags="${TARGET_LDFLAGS}" \
+ ${EXTRA_MYTHTVCONF} \
+"
do_configure_prepend() {
# it's not autotools anyway, so we call ./configure directly
find . -name "Makefile"|xargs rm -f
- ./configure --prefix=/usr \
- --mandir=/usr/man \
- --cpu=${MYTHTV_ARCH} \
- --arch=${MYTHTV_ARCH} \
+ ./configure --qmake=qmake2 \
--disable-altivec \
- --disable-opengl-video \
- --disable-strip \
+ --disable-opengl \
+ --disable-stripping \
+ --disable-xvmc \
--enable-v4l \
--enable-audio-oss \
- --enable-proc-opt \
--enable-dvb \
--enable-libmp3lame \
- --cross-compile \
--dvb-path=${STAGING_INCDIR} \
- --with-bindings= \
+ --without-bindings=perl,python \
${EXTRA_OECONF}
-
- sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new
- mv settings.pro.new settings.pro
- for pro in ${S}/*/*pro ${S}/*/*/*pro ${S}/*/*/*/*pro ; do
- sed -i -e s:opengl::g $pro
- done
- sed -i /.SUBDIR/d ${S}/bindings/*pro
}
python populate_packages_prepend () {
diff --git a/recipes/nandlogical/files/mtd-abi.h b/recipes/nandlogical/files/mtd-abi.h
new file mode 100644
index 0000000000..86defe175f
--- /dev/null
+++ b/recipes/nandlogical/files/mtd-abi.h
@@ -0,0 +1,152 @@
+/*
+ * $Id: mtd-abi.h,v 1.13 2005/11/07 11:14:56 gleixner Exp $
+ *
+ * Portions of MTD ABI definition which are shared by kernel and user space
+ */
+
+#ifndef __MTD_ABI_H__
+#define __MTD_ABI_H__
+
+struct erase_info_user {
+ uint32_t start;
+ uint32_t length;
+};
+
+struct mtd_oob_buf {
+ uint32_t start;
+ uint32_t length;
+ unsigned char *ptr;
+};
+
+#define MTD_ABSENT 0
+#define MTD_RAM 1
+#define MTD_ROM 2
+#define MTD_NORFLASH 3
+#define MTD_NANDFLASH 4
+#define MTD_DATAFLASH 6
+#define MTD_UBIVOLUME 7
+
+#define MTD_WRITEABLE 0x400 /* Device is writeable */
+#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
+#define MTD_NO_ERASE 0x1000 /* No erase necessary */
+#define MTD_STUPID_LOCK 0x2000 /* Always locked after reset */
+
+// Some common devices / combinations of capabilities
+#define MTD_CAP_ROM 0
+#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
+#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
+#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
+
+/* ECC byte placement */
+#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
+#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
+#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
+#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read)
+#define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default
+
+/* OTP mode selection */
+#define MTD_OTP_OFF 0
+#define MTD_OTP_FACTORY 1
+#define MTD_OTP_USER 2
+
+struct mtd_info_user {
+ uint8_t type;
+ uint32_t flags;
+ uint32_t size; // Total size of the MTD
+ uint32_t erasesize;
+ uint32_t writesize;
+ uint32_t oobsize; // Amount of OOB data per block (e.g. 16)
+ /* The below two fields are obsolete and broken, do not use them
+ * (TODO: remove at some point) */
+ uint32_t ecctype;
+ uint32_t eccsize;
+};
+
+struct region_info_user {
+ uint32_t offset; /* At which this region starts,
+ * from the beginning of the MTD */
+ uint32_t erasesize; /* For this region */
+ uint32_t numblocks; /* Number of blocks in this region */
+ uint32_t regionindex;
+};
+
+struct otp_info {
+ uint32_t start;
+ uint32_t length;
+ uint32_t locked;
+};
+
+#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
+#define MEMERASE _IOW('M', 2, struct erase_info_user)
+#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
+#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
+#define MEMLOCK _IOW('M', 5, struct erase_info_user)
+#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
+#define MEMGETREGIONCOUNT _IOR('M', 7, int)
+#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
+#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
+#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
+#define MEMGETBADBLOCK _IOW('M', 11, loff_t)
+#define MEMSETBADBLOCK _IOW('M', 12, loff_t)
+#define OTPSELECT _IOR('M', 13, int)
+#define OTPGETREGIONCOUNT _IOW('M', 14, int)
+#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
+#define OTPLOCK _IOR('M', 16, struct otp_info)
+#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
+#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
+#define MTDFILEMODE _IO('M', 19)
+
+/*
+ * Obsolete legacy interface. Keep it in order not to break userspace
+ * interfaces
+ */
+struct nand_oobinfo {
+ uint32_t useecc;
+ uint32_t eccbytes;
+ uint32_t oobfree[8][2];
+ uint32_t eccpos[32];
+};
+
+struct nand_oobfree {
+ uint32_t offset;
+ uint32_t length;
+};
+
+#define MTD_MAX_OOBFREE_ENTRIES 8
+/*
+ * ECC layout control structure. Exported to userspace for
+ * diagnosis and to allow creation of raw images
+ */
+struct nand_ecclayout {
+ uint32_t eccbytes;
+ uint32_t eccpos[64];
+ uint32_t oobavail;
+ struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
+};
+
+/**
+ * struct mtd_ecc_stats - error correction stats
+ *
+ * @corrected: number of corrected bits
+ * @failed: number of uncorrectable errors
+ * @badblocks: number of bad blocks in this partition
+ * @bbtblocks: number of blocks reserved for bad block tables
+ */
+struct mtd_ecc_stats {
+ uint32_t corrected;
+ uint32_t failed;
+ uint32_t badblocks;
+ uint32_t bbtblocks;
+};
+
+/*
+ * Read/write file modes for access to MTD
+ */
+enum mtd_file_modes {
+ MTD_MODE_NORMAL = MTD_OTP_OFF,
+ MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
+ MTD_MODE_OTP_USER = MTD_OTP_USER,
+ MTD_MODE_RAW,
+};
+
+#endif /* __MTD_ABI_H__ */
diff --git a/recipes/nandlogical/files/mtd-user.h b/recipes/nandlogical/files/mtd-user.h
new file mode 100644
index 0000000000..713f34d3e6
--- /dev/null
+++ b/recipes/nandlogical/files/mtd-user.h
@@ -0,0 +1,21 @@
+/*
+ * $Id: mtd-user.h,v 1.2 2004/05/05 14:44:57 dwmw2 Exp $
+ *
+ * MTD ABI header for use by user space only.
+ */
+
+#ifndef __MTD_USER_H__
+#define __MTD_USER_H__
+
+#include <stdint.h>
+
+/* This file is blessed for inclusion by userspace */
+#include <mtd/mtd-abi.h>
+
+typedef struct mtd_info_user mtd_info_t;
+typedef struct erase_info_user erase_info_t;
+typedef struct region_info_user region_info_t;
+typedef struct nand_oobinfo nand_oobinfo_t;
+typedef struct nand_ecclayout nand_ecclayout_t;
+
+#endif /* __MTD_USER_H__ */
diff --git a/recipes/nandlogical/nandlogical-klibc-static_1.0.0.bb b/recipes/nandlogical/nandlogical-klibc-static_1.0.0.bb
new file mode 100644
index 0000000000..8c3ca9da79
--- /dev/null
+++ b/recipes/nandlogical/nandlogical-klibc-static_1.0.0.bb
@@ -0,0 +1,23 @@
+require nandlogical_${PV}.bb
+
+SRC_URI_append = " file://nandlogical.c \
+ file://mtd-user.h \
+ file://mtd-abi.h \
+ "
+DEPENDS += "klibc"
+
+export CC = ${TARGET_PREFIX}klcc
+
+# standard oe cflags don't work with klcc
+export CFLAGS = ""
+export CPPFLAGS = ""
+export LDFLAGS = ""
+
+do_configure_prepend() {
+ sed -i 's:<mtd/mtd-user.h>:"mtd-user.h":g' '${S}/nandlogical.c'
+ sed -i 's:<mtd/mtd-abi.h>:"mtd-abi.h":g' '${S}/mtd-user.h'
+}
+
+do_compile() {
+ ${CC} nandlogical.c -o nandlogical ${CFLAGS} ${LDFLAGS} -static
+}
diff --git a/recipes/net-tools/net-tools_1.60.bb b/recipes/net-tools/net-tools_1.60.bb
index 2ef5d1967e..eae6b56377 100644
--- a/recipes/net-tools/net-tools_1.60.bb
+++ b/recipes/net-tools/net-tools_1.60.bb
@@ -1,6 +1,6 @@
SUMMARY="Basic networking tools"
LICENSE="GPL"
-PR = "r2"
+PR = "r3"
#
# NOTE:
@@ -61,6 +61,7 @@ SRC_URI = "http://download.berlios.de/${PN}/${PN}-${PV}.tar.bz2;md5sum=888774acc
file://net-tools-1.60-selinux.patch;patch=1 \
file://net-tools-1.60-netstat_stop_trim.patch;patch=1 "
+TOPDIR[unexport] = "1"
# Copy config and source over to the source directory
do_configure() {
diff --git a/recipes/nilfs-utils/nilfs-utils_2.0.12.bb b/recipes/nilfs-utils/nilfs-utils_2.0.13.bb
index 37b3762113..e45e028d4d 100644
--- a/recipes/nilfs-utils/nilfs-utils_2.0.12.bb
+++ b/recipes/nilfs-utils/nilfs-utils_2.0.13.bb
@@ -10,7 +10,7 @@ RRECOMMENDS_${PN} = "nilfs-utils-mkfs nilfs-utils-stats"
PR = "r0"
-SRC_URI ="http://www.nilfs.org/download/nilfs-utils-2.0.12.tar.bz2 \
+SRC_URI ="http://www.nilfs.org/download/nilfs-utils-${PV}.tar.bz2 \
file://no-ldconfig-during-install.patch;patch=1"
S = "${WORKDIR}/nilfs-utils-${PV}"
diff --git a/recipes/ntfs-3g/ntfs-3g_2009.1.1.bb b/recipes/ntfs-3g/ntfs-3g_2009.4.4.bb
index 7d73b79ac9..8c8f08d71a 100644
--- a/recipes/ntfs-3g/ntfs-3g_2009.1.1.bb
+++ b/recipes/ntfs-3g/ntfs-3g_2009.4.4.bb
@@ -3,7 +3,6 @@ HOMEPAGE = "http://www.ntfs-3g.org/"
LICENSE = "GPLv2"
DEPENDS = "fuse"
RDEPENDS = "fuse"
-PR = "r0"
SRC_URI = http://www.ntfs-3g.org/ntfs-3g-${PV}.tgz
diff --git a/recipes/ntp/files/ntp-4.2.4_p6-nano.patch b/recipes/ntp/files/ntp-4.2.4_p6-nano.patch
new file mode 100644
index 0000000000..cb1e2f7341
--- /dev/null
+++ b/recipes/ntp/files/ntp-4.2.4_p6-nano.patch
@@ -0,0 +1,17 @@
+--- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400
++++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400
+@@ -14,6 +14,14 @@
+ # include <sys/timex.h>
+ #endif
+
++#if defined(ADJ_NANO) && !defined(MOD_NANO)
++#define MOD_NANO ADJ_NANO
++#endif
++
++#if defined(ADJ_TAI) && !defined(MOD_TAI)
++#define MOD_TAI ADJ_TAI
++#endif
++
+ #ifndef NTP_SYSCALLS_LIBC
+ #ifdef NTP_SYSCALLS_STD
+ # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
diff --git a/recipes/ntp/ntp_4.2.2p3.bb b/recipes/ntp/ntp_4.2.2p3.bb
index 22d2e1bff6..e53594c259 100644
--- a/recipes/ntp/ntp_4.2.2p3.bb
+++ b/recipes/ntp/ntp_4.2.2p3.bb
@@ -1,10 +1,11 @@
require ntp.inc
-PR = "r1"
+PR = "r2"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://ipv6only-workaround.patch;patch=1 \
file://tickadj.c.patch;patch=1 \
+ file://ntp-4.2.4_p6-nano.patch;patch=1 \
file://ntpd \
file://ntp.conf \
file://ntpdate"
diff --git a/recipes/nut/nut_2.2.1.bb b/recipes/nut/nut_2.2.1.bb
index db3367435d..2e35bd2210 100644
--- a/recipes/nut/nut_2.2.1.bb
+++ b/recipes/nut/nut_2.2.1.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Network UPS Tools"
LICENSE = "GPL"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
PR = "r1"
inherit autotools
diff --git a/recipes/obexftp/obexftp_0.22.bb b/recipes/obexftp/obexftp_0.22.bb
index 89e10a72af..b9c6ad33e8 100644
--- a/recipes/obexftp/obexftp_0.22.bb
+++ b/recipes/obexftp/obexftp_0.22.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "OBEX Ftp Client based on openobex."
SECTION = "console/network"
HOMEPAGE = "http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp"
LICENSE = "GPL"
-DEPENDS = "openobex bluez-libs libusb virtual/libiconv"
+DEPENDS = "openobex bluez-libs virtual/libusb0 virtual/libiconv"
PR = "r0"
SRC_URI = "${SOURCEFORGE_MIRROR}/openobex/obexftp-${PV}.tar.bz2 \
diff --git a/recipes/obexftp/obexftp_0.23.bb b/recipes/obexftp/obexftp_0.23.bb
index 037fbbfa67..c37be4bf62 100644
--- a/recipes/obexftp/obexftp_0.23.bb
+++ b/recipes/obexftp/obexftp_0.23.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "OBEX Ftp Client based on openobex."
SECTION = "console/network"
HOMEPAGE = "http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp"
LICENSE = "GPL"
-DEPENDS = "openobex bluez-libs libusb-compat virtual/libiconv"
+DEPENDS = "openobex bluez-libs virtual/libusb0 virtual/libiconv"
SRC_URI = "${SOURCEFORGE_MIRROR}/openobex/obexftp-${PV}.tar.bz2 \
"
diff --git a/recipes/openbmap/openbmap-logger_0.4.0.bb b/recipes/openbmap/openbmap-logger_0.4.0.bb
new file mode 100644
index 0000000000..a7648f1989
--- /dev/null
+++ b/recipes/openbmap/openbmap-logger_0.4.0.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "openBmap logger and uploader of GPS/GSM data"
+SECTION = "x11/utils"
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/myposition/openbmap-logger-${PV}.tar.gz"
+
+inherit distutils
+
+RDEPENDS = "python python-dbus python-pygobject python-pygtk libglade \
+ python-subprocess python-netclient python-math python-core python-io frameworkd"
+
+FILES_${PN} += "${datadir}"
diff --git a/recipes/openbsc/openbsc_git.bb b/recipes/openbsc/openbsc_git.bb
new file mode 100644
index 0000000000..f2fa2099ac
--- /dev/null
+++ b/recipes/openbsc/openbsc_git.bb
@@ -0,0 +1,12 @@
+DESCRITOPN = "OpenBSC a Free Software GSM BaseStationController"
+DEPENDS = "libdbi"
+HOMEPAGE = "http://openbsc.gnumonks.org"
+
+RDEPENDS = "libdbd-sqlite3"
+
+SRC_URI = "git://bs11-abis.gnumonks.org/openbsc.git;protocol=git"
+PV = "0.0.1.0+gitr${SRCREV}"
+
+S = "${WORKDIR}/git/openbsc"
+
+inherit autotools
diff --git a/recipes/openldap/openldap-2.4.17/openldap-m4-pthread.patch b/recipes/openldap/openldap-2.4.17/openldap-m4-pthread.patch
new file mode 100644
index 0000000000..b669b7254d
--- /dev/null
+++ b/recipes/openldap/openldap-2.4.17/openldap-m4-pthread.patch
@@ -0,0 +1,20 @@
+--- openldap-2.3.11/build/openldap.m4.orig 2005-11-11 00:11:18.604322590 -0800
++++ openldap-2.3.11/build/openldap.m4 2005-11-11 00:26:21.621145856 -0800
+@@ -788,7 +788,7 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
+ ]])
+
+ AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
+-AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
++[AC_LANG_SOURCE([[OL_PTHREAD_TEST_INCLUDES
+
+ int main(argc, argv)
+ int argc;
+@@ -796,7 +796,7 @@ int main(argc, argv)
+ {
+ OL_PTHREAD_TEST_FUNCTION
+ }
+-]))
++]])])
+ dnl --------------------------------------------------------------------
+ AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
+ if test "$ol_link_threads" = no ; then
diff --git a/recipes/openldap/openldap_2.3.11.bb b/recipes/openldap/openldap_2.3.11.bb
index fb980cb946..9315f5b3d1 100644
--- a/recipes/openldap/openldap_2.3.11.bb
+++ b/recipes/openldap/openldap_2.3.11.bb
@@ -11,7 +11,7 @@ PRIORITY = "optional"
LICENSE = "OpenLDAP"
SECTION = "libs"
-PR = "r4"
+PR = "r5"
LDAP_VER = "${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}"
@@ -217,6 +217,8 @@ PACKAGES += "${PN}-overlay-proxycache"
EXTRA_OECONF += "${OPENLDAP_OPTIONS}"
DEPENDS += "${OPENLDAP_DEPENDS}"
+CPPFLAGS_append = " -D_GNU_SOURCE"
+
do_configure() {
gnu-configize
oe_runconf
diff --git a/recipes/openldap/openldap_2.4.17.bb b/recipes/openldap/openldap_2.4.17.bb
new file mode 100644
index 0000000000..2ca40eacb9
--- /dev/null
+++ b/recipes/openldap/openldap_2.4.17.bb
@@ -0,0 +1,290 @@
+# OpenLDAP, a license free (see http://www.OpenLDAP.org/license.html)
+#
+DESCRIPTION = "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol."
+HOMEPAGE = "http://www.OpenLDAP.org/license.html"
+PRIORITY = "optional"
+# The OpenLDAP Public License - see the HOMEPAGE - defines
+# the license. www.openldap.org claims this is Open Source
+# (see http://www.openldap.org), the license appears to be
+# basically BSD. opensource.org does not record this license
+# at present (so it is apparently not OSI certified).
+LICENSE = "OpenLDAP"
+SECTION = "libs"
+
+LDAP_VER = "${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}"
+
+SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz"
+SRC_URI += "file://openldap-m4-pthread.patch;patch=1"
+SRC_URI += "file://initscript"
+# The build tries to run a host executable, this fails. The patch
+# causes the executable and its data to be installed instead of
+# the output - ucgendat must be run after the ipkg install!
+#SRC_URI += "file://ucgendat.patch;patch=1"
+# The original top.mk used INSTALL, not INSTALL_STRIP_PROGRAM when
+# installing .so and executables, this fails in cross compilation
+# environments
+SRC_URI += "file://install-strip.patch;patch=1"
+
+inherit autotools
+
+# OPTIONS
+# The following two variables can be set in a distro or local.conf
+# to switch features on. Each feature foo defines OPENLDAP_OPTION_foo
+# and OPENLDAP_DEPENDS_foo in this file - to include feature foo add
+# the two variables into the setting of the options below (please use
+# += because that means this can be done in *both* distro.conf and
+# local.conf!
+OPENLDAP_OPTIONS ?= ""
+OPENLDAP_DEPENDS ?= ""
+
+# CV SETTINGS
+# Required to work round AC_FUNC_MEMCMP which gets the wrong answer
+# when cross compiling (should be in site?)
+EXTRA_OECONF += "ac_cv_func_memcmp_working=yes"
+
+# CONFIG DEFINITIONS
+# The following is necessary because it cannot be determined for a
+# cross compile automagically. Select should yield fine on all OE
+# systems...
+EXTRA_OECONF += "--with-yielding-select=yes"
+# Shared libraries are nice...
+EXTRA_OECONF += "--enable-dynamic"
+#
+# Disable TLS to remove the need for openssl/libcrypto
+OPENLDAP_OPTION_tls ?= "--with-tls"
+# set the following to "openssl" to build tls support
+OPENLDAP_DEPENDS_tls ?= "gnutls"
+EXTRA_OECONF += "${OPENLDAP_OPTION_tls}"
+DEPENDS += "${OPENLDAP_DEPENDS_tls}"
+#
+# Disable Cyrus SASL, which may or may not be working at present...
+OPENLDAP_OPTION_sasl ?= "--without-cyrus-sasl"
+# set the following to "cyrus-sasl" to build SASL support
+OPENLDAP_DEPENDS_sasl ?= ""
+EXTRA_OECONF += "${OPENLDAP_OPTION_sasl}"
+DEPENDS += "${OPENLDAP_DEPENDS_sasl}"
+
+# SLAPD options
+#
+# UNIX crypt(3) passwd support:
+EXTRA_OECONF += "--enable-crypt"
+#
+# Enable dynamic module loading. If this is *disabled* the
+# dependency on libtool is removed (to disable set the following
+# to variables to "" in a .conf file).
+OPENLDAP_OPTION_modules += "lt_cv_dlopen_self=yes --enable-modules"
+OPENLDAP_DEPENDS_modules += "libtool"
+EXTRA_OECONF += " ${OPENLDAP_OPTION_modules}"
+DEPENDS += "${OPENLDAP_DEPENDS_modules}"
+
+# SLAPD BACKEND
+#
+# The backend must be set by the configuration. This controls the
+# required database, the default database, bdb, is turned off but
+# can be turned back on again and it *is* below! The monitor backend
+# is also disabled. If you try to change the backends but fail to
+# enable a single one the build will fail in an obvious way.
+#
+EXTRA_OECONF += "--disable-bdb --disable-hdb --disable-monitor"
+#
+# Backends="bdb dnssrv hdb ldap ldbm meta monitor null passwd perl shell sql"
+#
+# Note that multiple backends can be built. The ldbm backend requires a
+# build-time choice of database API. The bdb backend forces this to be
+# DB4. To use the gdbm (or other) API the Berkely database module must
+# be removed from the build.
+md = "${libexecdir}/openldap"
+#
+#--enable-bdb enable Berkeley DB backend no|yes|mod yes
+# The Berkely DB is the standard choice. This version of OpenLDAP requires
+# the version 4 implementation or better.
+# To disable this set all three of the following variables to <empty> in
+# a .conf file (this will allow ldbm to be build with gdbm).
+#OPENLDAP_OPTION_bdb ?= "--enable-bdb=mod"
+OPENLDAP_DEPENDS_bdb ?= "db"
+OPENLDAP_PACKAGE_bdb ?= "${PN}-backend-bdb"
+FILES_${PN}-backend-bdb = "${md}/back_bdb.so ${md}/back_bdb.la ${md}/back_bdb-*.so.*"
+EXTRA_OECONF += "${OPENLDAP_OPTION_bdb}"
+DEPENDS += "${OPENLDAP_DEPENDS_bdb}"
+PACKAGES += "${OPENLDAP_PACKAGE_bdb}"
+#
+#--enable-dnssrv enable dnssrv backend no|yes|mod no
+# This has no dependencies.
+FILES_${PN}-backend-dnssrv = "${md}/back_dnssrv.so ${md}/back_dnssrv.la ${md}/back_dnssrv-*.so.*"
+EXTRA_OECONF += "--enable-dnssrv=mod"
+PACKAGES += "${PN}-backend-dnssrv"
+#
+#--enable-hdb enable Hierarchical DB backend no|yes|mod no
+# This forces ldbm to use Berkeley too, remove to use gdbm
+#OPENLDAP_OPTION_hdb ?= "--enable-hdb=mod"
+OPENLDAP_DEPENDS_hdb ?= "db"
+OPENLDAP_PACKAGE_hdb ?= "${PN}-backend-hdb"
+FILES_${PN}-backend-hdb = "${md}/back_hdb.so ${md}/back_hdb.la ${md}/back_hdb-*.so.*"
+EXTRA_OECONF += "${OPENLDAP_OPTION_hdb}"
+DEPENDS += "${OPENLDAP_DEPENDS_hdb}"
+PACKAGES += "${OPENLDAP_PACKAGE_hdb}"
+#
+#--enable-ldap enable ldap backend no|yes|mod no
+# This has no dependencies
+EXTRA_OECONF += "--enable-ldap=mod"
+FILES_${PN}-backend-ldap = "${md}/back_ldap.so ${md}/back_ldap.la ${md}/back_ldap-*.so.*"
+PACKAGES += "${PN}-backend-ldap"
+#
+#--enable-ldbm enable ldbm backend no|yes|mod no
+# ldbm requires further specification of the underlying database API, because
+# bdb is enabled above this must be set to berkeley, however the config
+# defaults this correctly so --with-ldbm-api is *not* set. The build will
+# fail if bdb is removed (above) but not database is built to provide the
+# support for ldbm (because the 'DEPENDS_ldbm' is empty below.)
+#
+# So to use gdbm set:
+OPENLDAP_OPTION_ldbm = "--enable-ldbm=mod --with-ldbm-api=gdbm"
+OPENLDAP_DEPENDS_ldbm = gdbm
+# And clear the bdb and hdb settings.
+OPENLDAP_OPTION_ldbm ?= "--enable-ldbm=mod"
+OPENLDAP_DEPENDS_ldbm ?= ""
+OPENLDAP_PACKAGES_ldbm ?= "${PN}-backend-ldbm"
+FILES_${PN}-backend-ldbm = "${md}/back_ldbm.so ${md}/back_ldbm.la ${md}/back_ldbm-*.so.*"
+EXTRA_OECONF += "${OPENLDAP_OPTION_ldbm}"
+DEPENDS += "${OPENLDAP_DEPENDS_ldbm}"
+PACKAGES += "${PN}-backend-ldbm"
+#
+#--enable-meta enable metadirectory backend no|yes|mod no
+# No dependencies
+EXTRA_OECONF += "--enable-meta=mod"
+FILES_${PN}-backend-meta = "${md}/back_meta.so ${md}/back_meta.la ${md}/back_meta-*.so.*"
+PACKAGES += "${PN}-backend-meta"
+#
+#--enable-monitor enable monitor backend no|yes|mod yes
+EXTRA_OECONF += "--enable-monitor=mod"
+FILES_${PN}-backend-monitor = "${md}/back_monitor.so ${md}/back_monitor.la ${md}/back_monitor-*.so.*"
+PACKAGES += "${PN}-backend-monitor"
+#
+#--enable-null enable null backend no|yes|mod no
+EXTRA_OECONF += "--enable-null=mod"
+FILES_${PN}-backend-null = "${md}/back_null.so ${md}/back_null.la ${md}/back_null-*.so.*"
+PACKAGES += "${PN}-backend-null"
+#
+#--enable-passwd enable passwd backend no|yes|mod no
+EXTRA_OECONF += " --enable-passwd=mod"
+FILES_${PN}-backend-passwd = "${md}/back_passwd.so ${md}/back_passwd.la ${md}/back_passwd-*.so.*"
+PACKAGES += "${PN}-backend-passwd"
+#
+#--enable-perl enable perl backend no|yes|mod no
+# This requires a loadable perl dynamic library, if enabled without
+# doing something appropriate (building perl?) the build will pick
+# up the build machine perl - not good.
+OPENLDAP_OPTION_perl ?= "--enable-perl=mod"
+OPENLDAP_DEPENDS_perl ?= "perl"
+OPENLDAP_PACKAGES_perl ?= "${PN}-backend-perl"
+FILES_${PN}-backend-perl = "${md}/back_perl.so ${md}/back_perl.la ${md}/back_perl-*.so.*"
+#EXTRA_OECONF += "${OPENLDAP_OPTION_perl}"
+#DEPENDS += "${OPENLDAP_DEPENDS_perl}"
+#PACKAGES += "${PN}-backend-perl"
+#
+#--enable-shell enable shell backend no|yes|mod no
+EXTRA_OECONF += "--enable-shell=mod"
+FILES_${PN}-backend-shell = "${md}/back_shell.so ${md}/back_shell.la ${md}/back_shell-*.so.*"
+PACKAGES += "${PN}-backend-shell"
+#
+#--enable-sql enable sql backend no|yes|mod no
+# sql requires some sql backend which provides sql.h, sqlite* provides
+# sqlite.h (which may be compatible but hasn't been tried.)
+OPENLDAP_OPTION_sql ?= "--enable-sql=mod"
+OPENLDAP_DEPENDS_sql ?= "sql"
+OPENLDAP_PACKAGES_sql ?= "${PN}-backend-sql"
+FILES_${PN}-backend-sql = "${md}/back_sql.so ${md}/back_sql.la ${md}/back_sql-*.so.*"
+#EXTRA_OECONF += "${OPENLDAP_OPTION_sql}"
+#DEPENDS += "${OPENLDAP_DEPENDS_sql}"
+#PACKAGES += "${PN}-backend-sql"
+#
+#--enable-dyngroup Dynamic Group overlay no|yes|mod no
+# This is a demo, Proxy Cache defines init_module which conflicts with the
+# same symbol in dyngroup
+#EXTRA_OECONF += "--enable-dyngroup=mod"
+#FILES_${PN}-overlay-dyngroup = "${md}/back_dyngroup.so ${md}/back_dyngroup.la ${md}/back_dyngroup-*.so.*"
+#PACKAGES += "${PN}-overlay-dyngroup"
+#
+#--enable-proxycache Proxy Cache overlay no|yes|mod no
+EXTRA_OECONF += "--enable-proxycache=mod"
+FILES_${PN}-overlay-proxycache = "${md}/pcache.so ${md}/pcache.la ${md}/pcache-*.so.*"
+PACKAGES += "${PN}-overlay-proxycache"
+#
+# LOCAL OPTION OVERRIDES
+# The distro/lcoal options must be added in *last*
+EXTRA_OECONF += "${OPENLDAP_OPTIONS}"
+DEPENDS += "${OPENLDAP_DEPENDS}"
+
+CPPFLAGS_append = " -D_GNU_SOURCE"
+
+do_configure() {
+ gnu-configize
+ oe_runconf
+}
+
+#FIXME: this is a hack, at present an openldap build will pick up the header
+# files from staging rather than the local ones (bad -I order), so remove
+# the headers (from openldap-old.x) before compiling...
+do_compile_prepend() {
+ ( cd ${STAGING_INCDIR}
+ rm -f ldap.h ldap_*.h
+ )
+ ( cd ${STAGING_LIBDIR}
+ rm -f libldap* liblber*
+ )
+}
+
+do_stage() {
+ echo "staging libldap-${LDAP_VER}" >&2
+ #
+ autotools_stage_includes
+ # Install the -${LDAP_VER} versions, but link foo.so to foo-x.y.so ONLY
+ # if they do not exist!
+ oe_libinstall -so -C libraries/libldap/.libs libldap-${LDAP_VER} ${STAGING_LIBDIR}
+ test -e ${STAGING_LIBDIR}/libldap.so ||
+ ln -s $(basename ${STAGING_LIBDIR}/libldap-${LDAP_VER}.so.*.*.*) ${STAGING_LIBDIR}/libldap.so
+ oe_libinstall -so -C libraries/libldap_r/.libs libldap_r-${LDAP_VER} ${STAGING_LIBDIR}
+ test -e ${STAGING_LIBDIR}/libldap_r.so ||
+ ln -s $(basename ${STAGING_LIBDIR}/libldap_r-${LDAP_VER}.so.*.*.*) ${STAGING_LIBDIR}/libldap_r.so
+ oe_libinstall -so -C libraries/liblber/.libs liblber-${LDAP_VER} ${STAGING_LIBDIR}
+ test -e ${STAGING_LIBDIR}/liblber.so ||
+ ln -s $(basename ${STAGING_LIBDIR}/liblber-${LDAP_VER}.so.*.*.*) ${STAGING_LIBDIR}/liblber.so
+}
+
+LEAD_SONAME = "libldap-${LDAP_VER}.so.*"
+
+# The executables go in a separate package. This allows the
+# installation of the libraries with no daemon support.
+# Each module also has its own package - see above.
+PACKAGES += "${PN}-slapd ${PN}-slurpd ${PN}-bin"
+
+# Package contents - shift most standard contents to -bin
+FILES_${PN} = "${libdir}/lib*.so.* ${sysconfdir}/openldap/ldap.* ${localstatedir}/openldap-data"
+FILES_${PN}-slapd = "${sysconfdir}/init.d ${libexecdir}/slapd ${sbindir} ${localstatedir}/run \
+ ${sysconfdir}/openldap/slapd.* ${sysconfdir}/openldap/schema \
+ ${sysconfdir}/openldap/DB_CONFIG.example"
+FILES_${PN}-slurpd = "${libexecdir}/slurpd ${localstatedir}/openldap-slurp ${localstatedir}/run"
+FILES_${PN}-bin = "${bindir}"
+FILES_${PN}-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libexecdir}/openldap/*.a"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ cat ${WORKDIR}/initscript > ${D}${sysconfdir}/init.d/openldap
+ chmod 755 ${D}${sysconfdir}/init.d/openldap
+ # This is duplicated in /etc/openldap and is for slapd
+ rm -f ${D}${localstatedir}/openldap-data/DB_CONFIG.example
+}
+
+pkg_postinst_${PN}-slapd () {
+ if test -n "${D}"; then
+ D="-r $D"
+ fi
+ update-rc.d $D openldap defaults
+}
+
+pkg_prerm_${PN}-slapd () {
+ if test -n "${D}"; then
+ D="-r $D"
+ fi
+ update-rc.d $D openldap remove
+}
diff --git a/recipes/openmax/libomxil-bellagio_0.9.1.bb b/recipes/openmax/libomxil-bellagio_0.9.1.bb
new file mode 100644
index 0000000000..2934da7d87
--- /dev/null
+++ b/recipes/openmax/libomxil-bellagio_0.9.1.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "OpenMAX Integration Layer (IL) is a standard API to access Multimedia Components on mobile platforms. It has been defined by the Khronos group."
+LICENSE = "LGPLv2"
+DEPENDS = "alsa-lib ffmpeg \
+ ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'libmad', d)}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/omxil/${PN}-${PV}.tar.gz"
+
+inherit autotools_stage
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+FILES_${PN} += "${libdir}/bellagio/*.so ${libdir}/bellagio/*.la"
+FILES_${PN}-dev += "${libdir}/bellagio/*.a"
+FILES_${PN}-dbg += "${libdir}/bellagio/.debug"
+
diff --git a/recipes/openobex/openobex_1.2.bb b/recipes/openobex/openobex_1.2.bb
index 41648ca412..9ddb7a3af1 100644
--- a/recipes/openobex/openobex_1.2.bb
+++ b/recipes/openobex/openobex_1.2.bb
@@ -3,7 +3,7 @@ Object Exchange (OBEX) protocol."
HOMEPAGE = "http://openobex.triq.net"
SECTION = "libs"
PROVIDES = "openobex-apps"
-DEPENDS = "libusb bluez-libs"
+DEPENDS = "virtual/libusb0 bluez-libs"
LICENSE = "GPL"
PR = "r5"
diff --git a/recipes/openobex/openobex_1.3.bb b/recipes/openobex/openobex_1.3.bb
index 65e98e4ab1..f1c31246b6 100644
--- a/recipes/openobex/openobex_1.3.bb
+++ b/recipes/openobex/openobex_1.3.bb
@@ -3,7 +3,7 @@ Object Exchange (OBEX) protocol."
HOMEPAGE = "http://openobex.triq.net"
SECTION = "libs"
PROVIDES = "openobex-apps"
-DEPENDS = "libusb bluez-libs"
+DEPENDS = "virtual/libusb0 bluez-libs"
LICENSE = "GPL"
PR = "r0"
diff --git a/recipes/openobex/openobex_1.5.bb b/recipes/openobex/openobex_1.5.bb
index e692d4c0a4..61c3708da1 100644
--- a/recipes/openobex/openobex_1.5.bb
+++ b/recipes/openobex/openobex_1.5.bb
@@ -3,7 +3,7 @@ Object Exchange (OBEX) protocol."
HOMEPAGE = "http://openobex.triq.net"
SECTION = "libs"
PROVIDES = "openobex-apps"
-DEPENDS = "libusb-compat bluez-libs"
+DEPENDS = "virtual/libusb0 bluez-libs"
LICENSE = "GPL"
PR = "r1"
diff --git a/recipes/opie-taskbar/opie-taskbar.inc b/recipes/opie-taskbar/opie-taskbar.inc
index 4f43e550b9..3d8ca17b7f 100644
--- a/recipes/opie-taskbar/opie-taskbar.inc
+++ b/recipes/opie-taskbar/opie-taskbar.inc
@@ -17,7 +17,6 @@ inherit opie
do_configure_prepend() {
ln -s ${WORKDIR}/calibrate ${S}/calibrate
ln -s ${WORKDIR}/mediummount ${S}/mediummount
- install -m 0644 ${WORKDIR}/server.pro ${S}/server.pro
}
do_stage() {
diff --git a/recipes/opie-taskbar/opie-taskbar/server-pro-1.2.4.patch b/recipes/opie-taskbar/opie-taskbar/server-pro-1.2.4.patch
new file mode 100644
index 0000000000..ca7e4f50bc
--- /dev/null
+++ b/recipes/opie-taskbar/opie-taskbar/server-pro-1.2.4.patch
@@ -0,0 +1,67 @@
+--- launcher/server.pro 2009-07-17 21:10:14.000000000 +0100
++++ launcher/server.pro 2009-07-17 21:16:43.000000000 +0100
+@@ -2,7 +2,7 @@
+
+ CONFIG += qt warn_on
+
+-DESTDIR = $$(OPIEDIR)/bin
++DESTDIR =
+
+ HEADERS += server.h \
+ qrr.h \
+@@ -20,7 +20,7 @@
+ shutdownimpl.h \
+ launcher.h \
+ launcherview.h \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.h \
++ calibrate/calibrate.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+@@ -31,7 +31,7 @@
+ serverapp.h \
+ qprocess.h \
+ screensaver.h \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \
++ mediummount/mediumwidget.h \
+ mediadlg.h
+
+ SOURCES += server.cpp \
+@@ -50,7 +50,7 @@
+ shutdownimpl.cpp \
+ launcher.cpp \
+ launcherview.cpp \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.cpp \
++ calibrate/calibrate.cpp \
+ transferserver.cpp \
+ packageslave.cpp \
+ irserver.cpp \
+@@ -63,20 +63,20 @@
+ qprocess.cpp \
+ qprocess_unix.cpp \
+ screensaver.cpp \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.cc \
++ mediummount/mediumwidget.cc \
+ mediadlg.cpp
+
+
+-INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate
+-DEPENDPATH += $(OPIEDIR)/core/apps/calibrate
++INCLUDEPATH += calibrate
++DEPENDPATH += calibrate
+
+-INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync
+-DEPENDPATH += $(OPIEDIR)/rsync
++INCLUDEPATH += $(OPIEDIR)/include rsync
++DEPENDPATH += rsync
+
+-INCLUDEPATH += $(OPIEDIR)/noncore/settings/mediummount
+-DEPENDPATH += $(OPIEDIR)/noncore/settings/mediummount
++INCLUDEPATH += mediummount
++DEPENDPATH += mediummount
+
+-LIBS += -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
++LIBS = -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
+ TARGET = qpe
+
+ ## not ready for use yet
diff --git a/recipes/opie-taskbar/opie-taskbar/server-pro-cvs.patch b/recipes/opie-taskbar/opie-taskbar/server-pro-cvs.patch
new file mode 100644
index 0000000000..72d6ce55eb
--- /dev/null
+++ b/recipes/opie-taskbar/opie-taskbar/server-pro-cvs.patch
@@ -0,0 +1,68 @@
+--- launcher/server.pro 2009-07-13 23:55:07.000000000 +0100
++++ launcher/server.pro 2009-07-17 00:03:40.000000000 +0100
+@@ -2,7 +2,7 @@
+
+ CONFIG += qt warn_on
+
+-DESTDIR = $$(OPIEDIR)/bin
++DESTDIR =
+
+ HEADERS += server.h \
+ qrr.h \
+@@ -20,7 +20,7 @@
+ shutdownimpl.h \
+ launcher.h \
+ launcherview.h \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.h \
++ calibrate/calibrate.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+@@ -31,7 +31,7 @@
+ serverapp.h \
+ qprocess.h \
+ screensaver.h \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \
++ mediummount/mediumwidget.h \
+ mediadlg.h \
+ virtualfs.h
+
+@@ -51,7 +51,7 @@
+ shutdownimpl.cpp \
+ launcher.cpp \
+ launcherview.cpp \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.cpp \
++ calibrate/calibrate.cpp \
+ transferserver.cpp \
+ packageslave.cpp \
+ irserver.cpp \
+@@ -64,21 +64,21 @@
+ qprocess.cpp \
+ qprocess_unix.cpp \
+ screensaver.cpp \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.cc \
++ mediummount/mediumwidget.cc \
+ mediadlg.cpp \
+ virtualfs.cpp
+
+
+-INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate
+-DEPENDPATH += $(OPIEDIR)/core/apps/calibrate
++INCLUDEPATH += calibrate
++DEPENDPATH += calibrate
+
+-INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync
+-DEPENDPATH += $(OPIEDIR)/rsync
++INCLUDEPATH += $(OPIEDIR)/include rsync
++DEPENDPATH += rsync
+
+-INCLUDEPATH += $(OPIEDIR)/noncore/settings/mediummount
+-DEPENDPATH += $(OPIEDIR)/noncore/settings/mediummount
++INCLUDEPATH += mediummount
++DEPENDPATH += mediummount
+
+-LIBS += -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
++LIBS = -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
+ TARGET = qpe
+
+ ## not ready for use yet
diff --git a/recipes/opie-taskbar/opie-taskbar/server-pro-old.patch b/recipes/opie-taskbar/opie-taskbar/server-pro-old.patch
new file mode 100644
index 0000000000..18aaeafa00
--- /dev/null
+++ b/recipes/opie-taskbar/opie-taskbar/server-pro-old.patch
@@ -0,0 +1,76 @@
+--- launcher/server.pro 2009-07-17 21:17:31.000000000 +0100
++++ launcher/server.pro 2009-07-17 21:16:43.000000000 +0100
+@@ -2,10 +2,10 @@
+
+ CONFIG += qt warn_on
+
+-DESTDIR = $$(OPIEDIR)/bin
++DESTDIR =
+
+ HEADERS += server.h \
+- qrr.h \
++ qrr.h \
+ serverinterface.h \
+ launchertab.h \
+ documentlist.h \
+@@ -20,7 +20,7 @@
+ shutdownimpl.h \
+ launcher.h \
+ launcherview.h \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.h \
++ calibrate/calibrate.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+@@ -31,11 +31,11 @@
+ serverapp.h \
+ qprocess.h \
+ screensaver.h \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \
++ mediummount/mediumwidget.h \
+ mediadlg.h
+
+ SOURCES += server.cpp \
+- qrr.cpp \
++ qrr.cpp \
+ serverinterface.cpp \
+ launchertab.cpp \
+ documentlist.cpp \
+@@ -50,7 +50,7 @@
+ shutdownimpl.cpp \
+ launcher.cpp \
+ launcherview.cpp \
+- $$(OPIEDIR)/core/apps/calibrate/calibrate.cpp \
++ calibrate/calibrate.cpp \
+ transferserver.cpp \
+ packageslave.cpp \
+ irserver.cpp \
+@@ -63,20 +63,20 @@
+ qprocess.cpp \
+ qprocess_unix.cpp \
+ screensaver.cpp \
+- $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.cc \
++ mediummount/mediumwidget.cc \
+ mediadlg.cpp
+
+
+-INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate
+-DEPENDPATH += $(OPIEDIR)/core/apps/calibrate
++INCLUDEPATH += calibrate
++DEPENDPATH += calibrate
+
+-INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync
+-DEPENDPATH += $(OPIEDIR)/rsync
++INCLUDEPATH += $(OPIEDIR)/include rsync
++DEPENDPATH += rsync
+
+-INCLUDEPATH += $(OPIEDIR)/noncore/settings/mediummount
+-DEPENDPATH += $(OPIEDIR)/noncore/settings/mediummount
++INCLUDEPATH += mediummount
++DEPENDPATH += mediummount
+
+-LIBS += -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
++LIBS = -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
+ TARGET = qpe
+
+ ## not ready for use yet
diff --git a/recipes/opie-taskbar/opie-taskbar/server.pro b/recipes/opie-taskbar/opie-taskbar/server.pro
deleted file mode 100644
index 2dee9a973a..0000000000
--- a/recipes/opie-taskbar/opie-taskbar/server.pro
+++ /dev/null
@@ -1,84 +0,0 @@
-TEMPLATE = app
-
-CONFIG += qt warn_on
-
-DESTDIR =
-
-HEADERS += server.h \
- qrr.h \
- serverinterface.h \
- launchertab.h \
- documentlist.h \
- appicons.h \
- taskbar.h \
- runningappbar.h \
- applauncher.h \
- stabmon.h \
- inputmethods.h \
- systray.h \
- wait.h \
- shutdownimpl.h \
- launcher.h \
- launcherview.h \
- calibrate/calibrate.h \
- startmenu.h \
- transferserver.h \
- qcopbridge.h \
- packageslave.h \
- irserver.h \
- firstuse.h \
- syncdialog.h \
- serverapp.h \
- qprocess.h \
- screensaver.h \
- mediummount/mediumwidget.h \
- mediadlg.h
-
-SOURCES += server.cpp \
- qrr.cpp \
- serverinterface.cpp \
- launchertab.cpp \
- documentlist.cpp \
- appicons.cpp \
- taskbar.cpp \
- runningappbar.cpp \
- applauncher.cpp \
- stabmon.cpp \
- inputmethods.cpp \
- systray.cpp \
- wait.cpp \
- shutdownimpl.cpp \
- launcher.cpp \
- launcherview.cpp \
- calibrate/calibrate.cpp \
- transferserver.cpp \
- packageslave.cpp \
- irserver.cpp \
- qcopbridge.cpp \
- startmenu.cpp \
- main.cpp \
- firstuse.cpp \
- syncdialog.cpp \
- serverapp.cpp \
- qprocess.cpp \
- qprocess_unix.cpp \
- screensaver.cpp \
- mediummount/mediumwidget.cc \
- mediadlg.cpp
-
-
-INCLUDEPATH += calibrate
-DEPENDPATH += calibrate
-
-INCLUDEPATH += $(OPIEDIR)/include rsync
-DEPENDPATH += rsync
-
-INCLUDEPATH += mediummount
-DEPENDPATH += mediummount
-
-
-TARGET = qpe
-
-LIBS = -lqpe -lopiecore2 -lopieui2 -lopiesecurity2 -lqrsync
-
-include ( $(OPIEDIR)/include.pro )
diff --git a/recipes/opie-taskbar/opie-taskbar_1.2.2.bb b/recipes/opie-taskbar/opie-taskbar_1.2.2.bb
index 497bff0953..ad2952f3e2 100644
--- a/recipes/opie-taskbar/opie-taskbar_1.2.2.bb
+++ b/recipes/opie-taskbar/opie-taskbar_1.2.2.bb
@@ -1,5 +1,5 @@
require ${PN}.inc
-PR = "r7"
+PR = "r8"
SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
${HANDHELDS_CVS};tag=${TAG};module=opie/noncore/settings/mediummount \
@@ -9,5 +9,5 @@ SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
${HANDHELDS_CVS};tag=${TAG};module=opie/root \
${HANDHELDS_CVS};tag=${TAG};module=opie/etc \
file://nomax.patch;patch=1;pnum=3 \
- file://server.pro \
+ file://server-pro-old.patch;patch=1 \
"
diff --git a/recipes/opie-taskbar/opie-taskbar_1.2.3.bb b/recipes/opie-taskbar/opie-taskbar_1.2.3.bb
index c22e3bed5f..360e3f4c62 100644
--- a/recipes/opie-taskbar/opie-taskbar_1.2.3.bb
+++ b/recipes/opie-taskbar/opie-taskbar_1.2.3.bb
@@ -1,5 +1,5 @@
require ${PN}.inc
-PR = "r0"
+PR = "r1"
SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
${HANDHELDS_CVS};tag=${TAG};module=opie/noncore/settings/mediummount \
@@ -12,6 +12,6 @@ SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
file://no-builtin-qss-startup.patch;patch=1 \
file://kbdlocks-runtime.patch;patch=1 \
file://restart-from-bindir.patch;patch=1 \
- file://server.pro \
+ file://server-pro-old.patch;patch=1 \
file://firstuse-path.patch;patch=1 \
"
diff --git a/recipes/opie-taskbar/opie-taskbar_1.2.4.bb b/recipes/opie-taskbar/opie-taskbar_1.2.4.bb
index c22e3bed5f..aa6db3ca36 100644
--- a/recipes/opie-taskbar/opie-taskbar_1.2.4.bb
+++ b/recipes/opie-taskbar/opie-taskbar_1.2.4.bb
@@ -1,5 +1,5 @@
require ${PN}.inc
-PR = "r0"
+PR = "r1"
SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
${HANDHELDS_CVS};tag=${TAG};module=opie/noncore/settings/mediummount \
@@ -12,6 +12,6 @@ SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/core/apps/calibrate \
file://no-builtin-qss-startup.patch;patch=1 \
file://kbdlocks-runtime.patch;patch=1 \
file://restart-from-bindir.patch;patch=1 \
- file://server.pro \
+ file://server-pro-1.2.4.patch;patch=1 \
file://firstuse-path.patch;patch=1 \
"
diff --git a/recipes/opie-taskbar/opie-taskbar_cvs.bb b/recipes/opie-taskbar/opie-taskbar_cvs.bb
index e84e35d820..3422bbe180 100644
--- a/recipes/opie-taskbar/opie-taskbar_cvs.bb
+++ b/recipes/opie-taskbar/opie-taskbar_cvs.bb
@@ -1,6 +1,6 @@
require ${PN}.inc
PV = "${OPIE_CVS_PV}"
-PR = "r16"
+PR = "r18"
SRC_URI = "${HANDHELDS_CVS};module=opie/core/apps/calibrate \
${HANDHELDS_CVS};module=opie/noncore/settings/mediummount \
@@ -13,6 +13,7 @@ SRC_URI = "${HANDHELDS_CVS};module=opie/core/apps/calibrate \
file://no-builtin-qss-startup.patch;patch=1 \
file://kbdlocks-runtime.patch;patch=1 \
file://restart-from-bindir.patch;patch=1 \
- file://server.pro \
+ file://server-pro-cvs.patch;patch=1 \
file://firstuse-path.patch;patch=1 \
"
+
diff --git a/recipes/opkg/files/opkg-libdir.patch b/recipes/opkg/files/opkg-libdir.patch
new file mode 100644
index 0000000000..1d48b9a6bf
--- /dev/null
+++ b/recipes/opkg/files/opkg-libdir.patch
@@ -0,0 +1,11 @@
+--- trunk/utils/update-alternatives.orig 2009-06-23 15:33:56.000000000 -0300
++++ trunk/utils/update-alternatives 2009-06-23 15:34:10.000000000 -0300
+@@ -21,7 +21,7 @@
+ set -e
+
+ # admin dir
+-ad="$OPKG_OFFLINE_ROOT/usr/lib/opkg/alternatives"
++ad="$OPKG_OFFLINE_ROOT/${libdir}/opkg/alternatives"
+
+ usage() {
+ echo "update-alternatives: $*
diff --git a/recipes/opkg/opkg-native_svn.bb b/recipes/opkg/opkg-native_svn.bb
index 82c74e0b86..acd681cb35 100644
--- a/recipes/opkg/opkg-native_svn.bb
+++ b/recipes/opkg/opkg-native_svn.bb
@@ -3,6 +3,8 @@ require opkg.inc
DEPENDS = "curl-native"
PR = "r3"
+SRC_URI += "file://opkg-libdir.patch;patch=1"
+
target_libdir := "${libdir}"
inherit native
diff --git a/recipes/owfs/owfs_2.7p21.bb b/recipes/owfs/owfs_2.7p21.bb
index b195054737..44fc878d7b 100644
--- a/recipes/owfs/owfs_2.7p21.bb
+++ b/recipes/owfs/owfs_2.7p21.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.owfs.org/"
SECTION = "console/network"
PRIORITY = "optional"
LICENSE = "GPLv2"
-DEPENDS += "fuse libusb"
+DEPENDS += "fuse virtual/libusb0"
SRC_URI = "${SOURCEFORGE_MIRROR}/owfs/owfs-${PV}.tar.gz \
file://owhttpd \
diff --git a/recipes/pango/pango-1.24.2/no-tests.patch b/recipes/pango/pango-1.24.4/no-tests.patch
index dafcb20c3b..dafcb20c3b 100644
--- a/recipes/pango/pango-1.24.2/no-tests.patch
+++ b/recipes/pango/pango-1.24.4/no-tests.patch
diff --git a/recipes/pango/pango_1.24.2.bb b/recipes/pango/pango_1.24.4.bb
index ce81d89263..ce81d89263 100644
--- a/recipes/pango/pango_1.24.2.bb
+++ b/recipes/pango/pango_1.24.4.bb
diff --git a/recipes/pciutils/pciutils_3.1.2.bb b/recipes/pciutils/pciutils_3.1.2.bb
index d7458a1c7a..ae7317ebbf 100644
--- a/recipes/pciutils/pciutils_3.1.2.bb
+++ b/recipes/pciutils/pciutils_3.1.2.bb
@@ -12,7 +12,7 @@ SRC_URI_append_nylon = "file://gcc-3-compatibility.patch;patch=1 "
PARALLEL_MAKE = ""
-PR ="r2"
+PR ="r3"
EXTRA_OEMAKE += "'STRIP = '"
export SHARED=yes
@@ -21,18 +21,20 @@ do_configure () {
(cd lib && ./configure ${datadir} ${PV} ${TARGET_OS} 2.4.21 ${TARGET_ARCH})
}
-export PREFIX = "${D}${prefix}"
-export SBINDIR = "${D}${sbindir}"
-export SHAREDIR = "${D}${datadir}"
-export MANDIR = "${D}${mandir}"
+export DESTDIR = "${D}"
+export PREFIX = "${prefix}"
+export SBINDIR = "${sbindir}"
+export SHAREDIR = "${datadir}"
+export MANDIR = "${mandir}"
+export IDSDIR = "${datadir}"
do_install () {
oe_runmake install
}
do_install_append () {
- install -d ${D}/${prefix}/share
- install -m 6440 ${WORKDIR}/${PN}-${PV}/pci.ids ${D}/${prefix}/share
+ install -d ${D}/${datadir}
+ install -m 6440 ${WORKDIR}/${PN}-${PV}/pci.ids.gz ${D}/${datadir}
# The makefile does not install the development files:
# libpci.so pci.h header.h config.h types.h
@@ -57,4 +59,4 @@ do_stage () {
PACKAGES =+ "pciutils-ids"
-FILES_pciutils-ids="${prefix}/share/pci.ids"
+FILES_pciutils-ids="${datadir}/pci.ids.gz"
diff --git a/recipes/perl/perl-native_5.8.8.bb b/recipes/perl/perl-native_5.8.8.bb
index 57e9e1c394..bde7638137 100644
--- a/recipes/perl/perl-native_5.8.8.bb
+++ b/recipes/perl/perl-native_5.8.8.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.perl.org/"
SECTION = "libs"
LICENSE = "Artistic|GPL"
DEPENDS = "virtual/db-native gdbm-native"
-PR = "r13"
+PR = "r14"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/perl-${PV}"
@@ -43,6 +43,7 @@ do_configure () {
-Dusethreads \
-Duseithreads \
-Duselargefiles \
+ -Dnoextensions=ODBM_File \
-Ud_dosuid \
-Ui_db \
-Ui_ndbm \
diff --git a/recipes/php/php-5.3.0/acinclude-xml2-config.patch b/recipes/php/php-5.3.0/acinclude-xml2-config.patch
new file mode 100644
index 0000000000..bf519d2934
--- /dev/null
+++ b/recipes/php/php-5.3.0/acinclude-xml2-config.patch
@@ -0,0 +1,18 @@
+--- /orig-acinclude.m4 2007-02-20 15:03:25.000000000 +0200
++++ /acinclude.m4 2007-02-20 15:03:24.000000000 +0200
+@@ -2359,12 +2359,9 @@
+ AC_DEFUN([PHP_SETUP_LIBXML], [
+ AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
+ [
+- for i in $PHP_LIBXML_DIR /usr/local /usr; do
+- if test -x "$i/bin/xml2-config"; then
+- ac_cv_php_xml2_config_path="$i/bin/xml2-config"
+- break
+- fi
+- done
++
++ ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config"
++
+ ])
+
+ if test -x "$ac_cv_php_xml2_config_path"; then
diff --git a/recipes/php/php-5.3.0/pear-makefile.patch b/recipes/php/php-5.3.0/pear-makefile.patch
new file mode 100644
index 0000000000..26de98a48f
--- /dev/null
+++ b/recipes/php/php-5.3.0/pear-makefile.patch
@@ -0,0 +1,11 @@
+--- /pear/orig-Makefile.frag 2007-03-16 12:18:33.000000000 +0200
++++ /pear/Makefile.frag 2007-03-16 12:35:48.000000000 +0200
+@@ -6,7 +6,7 @@
+ PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -dopen_basedir= -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0
+
+ install-pear-installer: $(SAPI_CLI_PATH)
+- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)"
++ @$(PHP_NATIVE_DIR)/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)"
+
+ install-pear:
+ @echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/"
diff --git a/recipes/php/php-native_5.3.0.bb b/recipes/php/php-native_5.3.0.bb
new file mode 100644
index 0000000000..ac1c51fa3f
--- /dev/null
+++ b/recipes/php/php-native_5.3.0.bb
@@ -0,0 +1,3 @@
+require php-native.inc
+
+PR = "r3"
diff --git a/recipes/pidgin/pidgin/purple-OE-branding.patch b/recipes/pidgin/pidgin/purple-OE-branding.patch
deleted file mode 100644
index 99c61375ce..0000000000
--- a/recipes/pidgin/pidgin/purple-OE-branding.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- /tmp/irc.h 2007-08-04 20:27:10.000000000 +0200
-+++ pidgin-2.1.0/libpurple/protocols/irc/irc.h 2007-08-04 20:28:15.318400000 +0200
-@@ -35,9 +35,9 @@
- #define IRC_DEFAULT_SSL_PORT 994
-
- #define IRC_DEFAULT_CHARSET "UTF-8"
--#define IRC_DEFAULT_ALIAS "purple"
-+#define IRC_DEFAULT_ALIAS "OE-user"
-
--#define IRC_DEFAULT_QUIT "Leaving."
-+#define IRC_DEFAULT_QUIT "Powered by OE: www.openembedded.org"
-
- #define IRC_INITIAL_BUFSIZE 1024
-
diff --git a/recipes/pidgin/pidgin_2.5.3.bb b/recipes/pidgin/pidgin_2.5.8.bb
index 17d0270456..17d0270456 100644
--- a/recipes/pidgin/pidgin_2.5.3.bb
+++ b/recipes/pidgin/pidgin_2.5.8.bb
diff --git a/recipes/pmount/pmount-0.9.18/gettext.patch b/recipes/pmount/pmount-0.9.18/gettext.patch
index dbac93f6ba..a784e32440 100644
--- a/recipes/pmount/pmount-0.9.18/gettext.patch
+++ b/recipes/pmount/pmount-0.9.18/gettext.patch
@@ -1,7 +1,7 @@
-Index: pmount-0.9.17/src/pmount-hal.c
+Index: pmount-0.9.18/src/pmount-hal.c
===================================================================
---- pmount-0.9.17.orig/src/pmount-hal.c 2007-07-01 13:58:49.000000000 +0200
-+++ pmount-0.9.17/src/pmount-hal.c 2008-10-08 23:39:20.970178412 +0200
+--- pmount-0.9.18.orig/src/pmount-hal.c 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/pmount-hal.c 2009-07-12 17:16:00.719122863 +0200
@@ -16,7 +16,6 @@
#include <dirent.h>
#include <sys/stat.h>
@@ -10,54 +10,77 @@ Index: pmount-0.9.17/src/pmount-hal.c
#include <libhal-storage.h>
#include "policy.h"
-@@ -26,7 +25,12 @@
- #include "realpath.h"
+@@ -25,9 +24,6 @@
- /* gettext abbreviation */
-+#ifdef ENABLE_NLS
-+#include <libintl.h>
- #define _(String) gettext(String)
-+#else
-+#define _(String) (String)
-+#endif
+ #include "realpath.h"
+-/* gettext abbreviation */
+-#define _(String) gettext(String)
+-
void help() {
puts( _(
-@@ -196,10 +200,12 @@
- char *dmask = NULL;
- char *iocharset = NULL;
+ "pmount-hal - execute pmount with additional information from hal\n\n"
+@@ -198,8 +194,8 @@
-+#ifdef ENABLE_NLS
/* initialize locale */
setlocale( LC_ALL, "" );
- bindtextdomain( "pmount", NULL );
- textdomain( "pmount" );
-+#endif
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
if( argc < 2 ) {
help();
-Index: pmount-0.9.17/src/utils.h
+Index: pmount-0.9.18/src/utils.h
===================================================================
---- pmount-0.9.17.orig/src/utils.h 2007-07-07 09:05:06.000000000 +0200
-+++ pmount-0.9.17/src/utils.h 2008-10-08 23:19:09.515475595 +0200
-@@ -12,7 +12,12 @@
+--- pmount-0.9.18.orig/src/utils.h 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/utils.h 2009-07-12 17:23:01.384780369 +0200
+@@ -12,8 +12,31 @@
#define __utils_h
/* gettext abbreviation */
+#ifdef ENABLE_NLS
++
+#include <libintl.h>
++
#define _(String) gettext(String)
+
++#ifdef gettext_noop
++#define N_(String) gettext_noop(String)
+#else
-+#define _(String) (String)
++#define N_(String) (String)
+#endif
-
++
++#else /* NLS is disabled */
++
++#define _(String) (String)
++#define N_(String) (String)
++#define textdomain(String) (String)
++#define gettext(String) (String)
++#define dgettext(Domain,String) (String)
++#define dcgettext(Domain,String,Type) (String)
++#define bindtextdomain(Domain,Directory) (Domain)
++#define bind_textdomain_codeset(Domain,Codeset) (Codeset)
++
++#endif /* ENABLE_NLS */
++
/* global flag whether to print debug messages (false by default) */
extern int enable_debug;
-Index: pmount-0.9.17/configure.ac
+
+Index: pmount-0.9.18/configure.ac
===================================================================
---- pmount-0.9.17.orig/configure.ac 2007-12-14 20:27:23.000000000 +0100
-+++ pmount-0.9.17/configure.ac 2008-10-08 23:19:09.598820915 +0200
-@@ -77,10 +77,7 @@
+--- pmount-0.9.18.orig/configure.ac 2008-10-18 21:02:18.000000000 +0200
++++ pmount-0.9.18/configure.ac 2009-07-12 17:16:00.719122863 +0200
+@@ -5,8 +5,6 @@
+ AC_CONFIG_SRCDIR(src)
+ AM_INIT_AUTOMAKE(pmount, 0.9.18)
+
+-AC_PROG_INTLTOOL([0.21])
+-
+ AM_MAINTAINER_MODE
+ AC_ISC_POSIX
+ AC_HEADER_STDC
+@@ -77,10 +75,13 @@
fi
AM_CONDITIONAL(PMOUNT_HAL, test -n "$BUILD_HAL")
@@ -65,69 +88,110 @@ Index: pmount-0.9.17/configure.ac
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
++
++IT_PROG_INTLTOOL([0.21])
++GETTEXT_PACKAGE=$PACKAGE
++AC_SUBST([GETTEXT_PACKAGE])
++AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
+AM_GNU_GETTEXT([external])
++AM_GNU_GETTEXT_VERSION([0.17])
AC_OUTPUT([
Makefile
-Index: pmount-0.9.17/src/pmount.c
+Index: pmount-0.9.18/src/pmount.c
===================================================================
---- pmount-0.9.17.orig/src/pmount.c 2008-10-08 23:36:44.452037557 +0200
-+++ pmount-0.9.17/src/pmount.c 2008-10-08 23:37:38.778816969 +0200
-@@ -21,9 +21,12 @@
+--- pmount-0.9.18.orig/src/pmount.c 2008-10-18 20:49:54.000000000 +0200
++++ pmount-0.9.18/src/pmount.c 2009-07-12 17:16:00.722456315 +0200
+@@ -21,7 +21,6 @@
#include <errno.h>
#include <locale.h>
#include <langinfo.h>
-#include <libintl.h>
#include <sys/stat.h>
-+#ifdef ENABLE_NLS
-+#include <libintl.h>
-+#endif
-+
#include "fs.h"
- #include "policy.h"
- #include "utils.h"
-@@ -619,10 +622,12 @@
- { NULL, 0, NULL, 0}
- };
+@@ -652,8 +651,8 @@
-+#ifdef ENABLE_NLS
/* initialize locale */
setlocale( LC_ALL, "" );
- bindtextdomain( "pmount", NULL );
- textdomain( "pmount" );
-+#endif
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
/* If pmount is run without a single argument, print out the list
of removable devices. Does not require root privileges, just read access
-Index: pmount-0.9.17/src/pumount.c
+Index: pmount-0.9.18/src/pumount.c
===================================================================
---- pmount-0.9.17.orig/src/pumount.c 2008-10-08 23:38:21.122028300 +0200
-+++ pmount-0.9.17/src/pumount.c 2008-10-08 23:38:47.972023678 +0200
-@@ -16,9 +16,12 @@
+--- pmount-0.9.18.orig/src/pumount.c 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/pumount.c 2009-07-12 17:16:00.722456315 +0200
+@@ -16,9 +16,9 @@
#include <sys/wait.h>
#include <limits.h>
#include <getopt.h>
-#include <libintl.h>
#include <locale.h>
-+#ifdef ENABLE_NLS
-+#include <libintl.h>
-+#endif
+
#include "policy.h"
#include "utils.h"
#include "luks.h"
-@@ -172,10 +175,12 @@
- { NULL, 0, NULL, 0}
- };
+@@ -174,8 +174,8 @@
-+#ifdef ENABLE_NLS
/* initialize locale */
setlocale( LC_ALL, "" );
- bindtextdomain( "pmount", NULL );
- textdomain( "pmount" );
-+#endif
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
/* are we root? */
if( geteuid() ) {
+Index: pmount-0.9.18/src/luks.c
+===================================================================
+--- pmount-0.9.18.orig/src/luks.c 2009-07-12 17:17:45.278704656 +0200
++++ pmount-0.9.18/src/luks.c 2009-07-12 17:17:49.627119155 +0200
+@@ -14,7 +14,6 @@
+ #include <stdio.h>
+ #include <limits.h>
+ #include <sys/stat.h>
+-#include <libintl.h>
+
+ enum decrypt_status
+ luks_decrypt( const char* device, char* decrypted, int decrypted_size,
+Index: pmount-0.9.18/src/policy.c
+===================================================================
+--- pmount-0.9.18.orig/src/policy.c 2009-07-12 17:17:55.502449663 +0200
++++ pmount-0.9.18/src/policy.c 2009-07-12 17:18:03.200672861 +0200
+@@ -18,7 +18,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <dirent.h>
+-#include <libintl.h>
+ #include <sys/stat.h>
+ #include <sysfs/libsysfs.h>
+ #include <regex.h>
+Index: pmount-0.9.18/src/realpath.c
+===================================================================
+--- pmount-0.9.18.orig/src/realpath.c 2009-07-12 17:18:27.354526224 +0200
++++ pmount-0.9.18/src/realpath.c 2009-07-12 17:18:32.256256916 +0200
+@@ -31,7 +31,6 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include "realpath.h"
+-#include <libintl.h>
+ #include "utils.h"
+
+ #define MAX_READLINKS 32
+Index: pmount-0.9.18/src/utils.c
+===================================================================
+--- pmount-0.9.18.orig/src/utils.c 2009-07-12 17:18:09.718277410 +0200
++++ pmount-0.9.18/src/utils.c 2009-07-12 17:18:13.935179014 +0200
+@@ -21,7 +21,6 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <libintl.h>
+
+ /* File name used to tag directories created by pmount */
+ #define CREATED_DIR_STAMP ".created_by_pmount"
diff --git a/recipes/pmount/pmount-0.9.19/gettext.patch b/recipes/pmount/pmount-0.9.19/gettext.patch
new file mode 100644
index 0000000000..a784e32440
--- /dev/null
+++ b/recipes/pmount/pmount-0.9.19/gettext.patch
@@ -0,0 +1,197 @@
+Index: pmount-0.9.18/src/pmount-hal.c
+===================================================================
+--- pmount-0.9.18.orig/src/pmount-hal.c 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/pmount-hal.c 2009-07-12 17:16:00.719122863 +0200
+@@ -16,7 +16,6 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <locale.h>
+-#include <libintl.h>
+ #include <libhal-storage.h>
+
+ #include "policy.h"
+@@ -25,9 +24,6 @@
+
+ #include "realpath.h"
+
+-/* gettext abbreviation */
+-#define _(String) gettext(String)
+-
+ void help() {
+ puts( _(
+ "pmount-hal - execute pmount with additional information from hal\n\n"
+@@ -198,8 +194,8 @@
+
+ /* initialize locale */
+ setlocale( LC_ALL, "" );
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
+
+ if( argc < 2 ) {
+ help();
+Index: pmount-0.9.18/src/utils.h
+===================================================================
+--- pmount-0.9.18.orig/src/utils.h 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/utils.h 2009-07-12 17:23:01.384780369 +0200
+@@ -12,8 +12,31 @@
+ #define __utils_h
+
+ /* gettext abbreviation */
++#ifdef ENABLE_NLS
++
++#include <libintl.h>
++
+ #define _(String) gettext(String)
+
++#ifdef gettext_noop
++#define N_(String) gettext_noop(String)
++#else
++#define N_(String) (String)
++#endif
++
++#else /* NLS is disabled */
++
++#define _(String) (String)
++#define N_(String) (String)
++#define textdomain(String) (String)
++#define gettext(String) (String)
++#define dgettext(Domain,String) (String)
++#define dcgettext(Domain,String,Type) (String)
++#define bindtextdomain(Domain,Directory) (Domain)
++#define bind_textdomain_codeset(Domain,Codeset) (Codeset)
++
++#endif /* ENABLE_NLS */
++
+ /* global flag whether to print debug messages (false by default) */
+ extern int enable_debug;
+
+Index: pmount-0.9.18/configure.ac
+===================================================================
+--- pmount-0.9.18.orig/configure.ac 2008-10-18 21:02:18.000000000 +0200
++++ pmount-0.9.18/configure.ac 2009-07-12 17:16:00.719122863 +0200
+@@ -5,8 +5,6 @@
+ AC_CONFIG_SRCDIR(src)
+ AM_INIT_AUTOMAKE(pmount, 0.9.18)
+
+-AC_PROG_INTLTOOL([0.21])
+-
+ AM_MAINTAINER_MODE
+ AC_ISC_POSIX
+ AC_HEADER_STDC
+@@ -77,10 +75,13 @@
+ fi
+ AM_CONDITIONAL(PMOUNT_HAL, test -n "$BUILD_HAL")
+
+-GETTEXT_PACKAGE="pmount"
+-AC_SUBST(GETTEXT_PACKAGE)
+-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
+-AM_GLIB_GNU_GETTEXT
++
++IT_PROG_INTLTOOL([0.21])
++GETTEXT_PACKAGE=$PACKAGE
++AC_SUBST([GETTEXT_PACKAGE])
++AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
++AM_GNU_GETTEXT([external])
++AM_GNU_GETTEXT_VERSION([0.17])
+
+ AC_OUTPUT([
+ Makefile
+Index: pmount-0.9.18/src/pmount.c
+===================================================================
+--- pmount-0.9.18.orig/src/pmount.c 2008-10-18 20:49:54.000000000 +0200
++++ pmount-0.9.18/src/pmount.c 2009-07-12 17:16:00.722456315 +0200
+@@ -21,7 +21,6 @@
+ #include <errno.h>
+ #include <locale.h>
+ #include <langinfo.h>
+-#include <libintl.h>
+ #include <sys/stat.h>
+
+ #include "fs.h"
+@@ -652,8 +651,8 @@
+
+ /* initialize locale */
+ setlocale( LC_ALL, "" );
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
+
+ /* If pmount is run without a single argument, print out the list
+ of removable devices. Does not require root privileges, just read access
+Index: pmount-0.9.18/src/pumount.c
+===================================================================
+--- pmount-0.9.18.orig/src/pumount.c 2008-10-09 23:19:46.000000000 +0200
++++ pmount-0.9.18/src/pumount.c 2009-07-12 17:16:00.722456315 +0200
+@@ -16,9 +16,9 @@
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <getopt.h>
+-#include <libintl.h>
+ #include <locale.h>
+
++
+ #include "policy.h"
+ #include "utils.h"
+ #include "luks.h"
+@@ -174,8 +174,8 @@
+
+ /* initialize locale */
+ setlocale( LC_ALL, "" );
+- bindtextdomain( "pmount", NULL );
+- textdomain( "pmount" );
++ bindtextdomain(PACKAGE, NULL );
++ textdomain(PACKAGE);
+
+ /* are we root? */
+ if( geteuid() ) {
+Index: pmount-0.9.18/src/luks.c
+===================================================================
+--- pmount-0.9.18.orig/src/luks.c 2009-07-12 17:17:45.278704656 +0200
++++ pmount-0.9.18/src/luks.c 2009-07-12 17:17:49.627119155 +0200
+@@ -14,7 +14,6 @@
+ #include <stdio.h>
+ #include <limits.h>
+ #include <sys/stat.h>
+-#include <libintl.h>
+
+ enum decrypt_status
+ luks_decrypt( const char* device, char* decrypted, int decrypted_size,
+Index: pmount-0.9.18/src/policy.c
+===================================================================
+--- pmount-0.9.18.orig/src/policy.c 2009-07-12 17:17:55.502449663 +0200
++++ pmount-0.9.18/src/policy.c 2009-07-12 17:18:03.200672861 +0200
+@@ -18,7 +18,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <dirent.h>
+-#include <libintl.h>
+ #include <sys/stat.h>
+ #include <sysfs/libsysfs.h>
+ #include <regex.h>
+Index: pmount-0.9.18/src/realpath.c
+===================================================================
+--- pmount-0.9.18.orig/src/realpath.c 2009-07-12 17:18:27.354526224 +0200
++++ pmount-0.9.18/src/realpath.c 2009-07-12 17:18:32.256256916 +0200
+@@ -31,7 +31,6 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include "realpath.h"
+-#include <libintl.h>
+ #include "utils.h"
+
+ #define MAX_READLINKS 32
+Index: pmount-0.9.18/src/utils.c
+===================================================================
+--- pmount-0.9.18.orig/src/utils.c 2009-07-12 17:18:09.718277410 +0200
++++ pmount-0.9.18/src/utils.c 2009-07-12 17:18:13.935179014 +0200
+@@ -21,7 +21,6 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <libintl.h>
+
+ /* File name used to tag directories created by pmount */
+ #define CREATED_DIR_STAMP ".created_by_pmount"
diff --git a/recipes/pmount/pmount-0.9.19/install.patch b/recipes/pmount/pmount-0.9.19/install.patch
new file mode 100644
index 0000000000..b02942a591
--- /dev/null
+++ b/recipes/pmount/pmount-0.9.19/install.patch
@@ -0,0 +1,15 @@
+Index: pmount-0.9.17/src/Makefile.am
+===================================================================
+--- pmount-0.9.17.orig/src/Makefile.am 2008-10-09 01:22:41.668067209 +0200
++++ pmount-0.9.17/src/Makefile.am 2008-10-09 01:23:22.144725902 +0200
+@@ -36,8 +36,8 @@
+
+ install-data-hook:
+ test -z $(INSTALL_DIR) || mkdir -p -- $(INSTALL_DIR)
+- $(INSTALL_DATA) -o root -g root -m 4755 -D $(INSTALL_SRC)/pmount $(INSTALL_DIR)/pmount
+- $(INSTALL_DATA) -o root -g root -m 4755 -D $(INSTALL_SRC)/pumount $(INSTALL_DIR)/pumount
++ $(INSTALL_DATA) -m 4755 -D $(INSTALL_SRC)/pmount $(INSTALL_DIR)/pmount
++ $(INSTALL_DATA) -m 4755 -D $(INSTALL_SRC)/pumount $(INSTALL_DIR)/pumount
+
+ uninstall-hook:
+ rm -f $(INSTALL_DIR)/pmount
diff --git a/recipes/pmount/pmount_0.9.18.bb b/recipes/pmount/pmount_0.9.18.bb
index 26770b33a9..71a823e698 100644
--- a/recipes/pmount/pmount_0.9.18.bb
+++ b/recipes/pmount/pmount_0.9.18.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Policy based mounter that gives the ability to mount removable devices as a user"
HOMEPAGE = "http://pmount.alioth.debian.org/"
LICENSE = "GPLv2"
-PR = "r0"
+PR = "r1"
DEPENDS = "hal e2fsprogs-libs sysfsutils"
RDEPENDS_${PN}-hal = "${PN}"
diff --git a/recipes/pmount/pmount_0.9.19.bb b/recipes/pmount/pmount_0.9.19.bb
new file mode 100644
index 0000000000..2bab217a29
--- /dev/null
+++ b/recipes/pmount/pmount_0.9.19.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "Policy based mounter that gives the ability to mount removable devices as a user"
+HOMEPAGE = "http://pmount.alioth.debian.org/"
+LICENSE = "GPLv2"
+PR = "r0"
+
+DEPENDS = "hal e2fsprogs-libs"
+RDEPENDS_${PN}-hal = "${PN}"
+RRECOMMENDS_${PN}-hal = "hal"
+
+SRC_URI = "https://alioth.debian.org/frs/download.php/2867/pmount-0.9.19.tar.gz \
+ file://gettext.patch;patch=1 \
+ file://install.patch;patch=1 \
+ "
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--enable-hal"
+
+PACKAGES =+ "${PN}-hal"
+
+FILES_${PN}-hal = "${bindir}/pmount-hal"
+
diff --git a/recipes/pointercal/files/omapzoom2/pointercal b/recipes/pointercal/files/omapzoom2/pointercal
new file mode 100644
index 0000000000..45ee4c1f76
--- /dev/null
+++ b/recipes/pointercal/files/omapzoom2/pointercal
Binary files differ
diff --git a/recipes/pointercal/pointercal_0.0.bb b/recipes/pointercal/pointercal_0.0.bb
index d292b893ed..2850c2d54c 100644
--- a/recipes/pointercal/pointercal_0.0.bb
+++ b/recipes/pointercal/pointercal_0.0.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Touchscreen calibration data"
SECTION = "base"
-PR = "r14"
+PR = "r15"
SRC_URI = "file://pointercal"
S = "${WORKDIR}"
diff --git a/recipes/policykit/policykit/PolicyKit.conf b/recipes/policykit/policykit/PolicyKit.conf
new file mode 100644
index 0000000000..ed502ac328
--- /dev/null
+++ b/recipes/policykit/policykit/PolicyKit.conf
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
+
+<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
+"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">
+
+<!-- See the manual page PolicyKit.conf(5) for file format -->
+
+<config version="0.1">
+ <match user="root">
+ <return result="yes"/>
+ </match>
+ <define_admin_auth group="admin"/>
+</config>
diff --git a/recipes/policykit/policykit_0.9.bb b/recipes/policykit/policykit_0.9.bb
index 28cbb11a9e..2a31701fc3 100644
--- a/recipes/policykit/policykit_0.9.bb
+++ b/recipes/policykit/policykit_0.9.bb
@@ -1,9 +1,11 @@
HOMEPAGE = "http://www.packagekit.org/"
DEPENDS = "libpam expat dbus-glib"
-PR = "r4"
+PR = "r5"
-SRC_URI = "http://hal.freedesktop.org/releases/PolicyKit-${PV}.tar.gz"
+SRC_URI = "http://hal.freedesktop.org/releases/PolicyKit-${PV}.tar.gz \
+ file://PolicyKit.conf \
+ "
EXTRA_OECONF = "--with-authfw=pam --with-os-type=moblin --disable-man-pages --disable-gtk-doc"
@@ -11,6 +13,10 @@ S = "${WORKDIR}/PolicyKit-${PV}"
inherit autotools pkgconfig
+do_install_append () {
+ install -m 0644 ${WORKDIR}/PolicyKit.conf ${D}${sysconfdir}/PolicyKit/PolicyKit.conf
+}
+
do_stage() {
autotools_stage_all
}
diff --git a/recipes/powertop/powertop_1.11.bb b/recipes/powertop/powertop_1.11.bb
index 2f2a3a4255..01148cb9fd 100644
--- a/recipes/powertop/powertop_1.11.bb
+++ b/recipes/powertop/powertop_1.11.bb
@@ -13,6 +13,7 @@ CFLAGS += "${LDFLAGS}"
CFLAGS_append_beagleboard = " -DOMAP3"
CFLAGS_append_overo = " -DOMAP3"
CFLAGS_append_omap3evm = " -DOMAP3"
+CFLAGS_append_omapzoom2 = " -DOMAP3"
do_configure() {
diff --git a/recipes/powervr-drivers/libgles-omap3-3.00.00.09/rc.pvr b/recipes/powervr-drivers/libgles-omap3-3.00.00.09/rc.pvr
new file mode 100755
index 0000000000..69c9f81c1c
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3-3.00.00.09/rc.pvr
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+if [ "$1" = "" ]; then
+ echo PVR-INIT: Please use start, stop, or restart.
+ exit 1
+fi
+
+if [ "$1" = "stop" -o "$1" = "restart" ]; then
+ echo Stopping PVR
+ #rmmod bc_example
+ rmmod omaplfb 2>/dev/null
+ rmmod pvrsrvkm 2>/dev/null
+fi
+
+if [ "$1" = "stop" ]; then
+ exit 0
+fi
+
+echo Starting PVR
+insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
+#modprobe bc_example
+modprobe omaplfb
+
+pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
+
+if [ -e /dev/pvrsrvkm ] ; then
+ rm -f /dev/pvrsrvkm
+fi
+
+mknod /dev/pvrsrvkm c $pvr_maj 0
+chmod 666 /dev/pvrsrvkm
+
+touch /etc/powervr-esrev
+
+SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
+ES_REVISION="$(cat /proc/cpuinfo | grep "CPU revision" | awk -F: '{print $2}')"
+
+if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
+ echo -n "Starting SGX fixup for"
+ if [ "${ES_REVISION}" = " 3" ] ; then
+ echo " ES3.x"
+ cp -a /usr/lib/ES3.0/* /usr/lib
+ cp -a /usr/bin/ES3.0/* /usr/bin
+ else
+ echo "ES 2.x"
+ cp -a /usr/lib/ES2.0/* /usr/lib
+ cp -a /usr/bin/ES2.0/* /usr/bin
+ fi
+
+ echo "${ES_REVISION}" > /etc/powervr-esrev
+fi
+
+/usr/bin/pvrsrvinit
+
diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc
index 6813b71aab..f681ebb91f 100644
--- a/recipes/powervr-drivers/libgles-omap3.inc
+++ b/recipes/powervr-drivers/libgles-omap3.inc
@@ -66,15 +66,7 @@ inherit update-rc.d
INITSCRIPT_NAME = "pvr-init"
INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
-do_accept_license() {
- export HOME="${WORKDIR}"
- echo "Y
-q
-Y
-${S}" | ${WORKDIR}/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin --mode console
-}
-
-addtask accept_license after do_unpack before do_configure
+require ../dvsdk/ti-dspbios.inc
do_compile() {
for sofile in $(find ${S} -name "lib*Open*.so") $(find ${S} -name "lib*srv*.so") $(find ${S} -name "lib*gl*.so") $(find ${S} -name "libpvr*.so") $(find ${S} -name "lib*GL*.so"); do
@@ -96,7 +88,7 @@ do_install () {
cp -pP ${BINLOCATION}/gles1test1 ${D}${bindir}/
cp -pP ${BINLOCATION}/gles1_texture_stream ${D}${bindir}/
cp -pP ${BINLOCATION}/gles2test1 ${D}${bindir}/
- cp -pP ${BINLOCATION}/pvrsrvinit ${D}${bindir}/
+ cp -pP ${BINLOCATION}/p[dv]* ${D}${bindir}/
cp -pP ${BINLOCATION}/xgles1test1 ${D}${bindir}/
cp -pP ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true
@@ -106,6 +98,8 @@ do_install () {
cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/
cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/
cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/
+ cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${D}${includedir}/
+ cp -pPr ${S}/include/*.h ${D}${includedir} || true
install -d ${D}${sysconfdir}/init.d/
cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
@@ -134,6 +128,8 @@ do_stage () {
cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${STAGING_INCDIR}/
cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES/
cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES2/
+ cp -pPr ${S}/include/*.h ${STAGING_INCDIR} || true
+ cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${STAGING_INCDIR}/
}
pkg_postinst() {
diff --git a/recipes/powervr-drivers/libgles-omap3_3.00.00.08.bb b/recipes/powervr-drivers/libgles-omap3_3.00.00.08.bb
index a5c0d99143..2256c5b032 100644
--- a/recipes/powervr-drivers/libgles-omap3_3.00.00.08.bb
+++ b/recipes/powervr-drivers/libgles-omap3_3.00.00.08.bb
@@ -4,6 +4,7 @@ DEFAULT_PREFERENCE = "1"
SGXPV = "3_00_00_08"
IMGPV = "1.3.13.1607"
+BINFILE := "OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin"
# Quality control is really poor on these SDKs, so hack around the latest madness:
FILES_${PN} += "${libdir}/*.so"
diff --git a/recipes/powervr-drivers/libgles-omap3_3.00.00.09.bb b/recipes/powervr-drivers/libgles-omap3_3.00.00.09.bb
new file mode 100644
index 0000000000..2918deed25
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3_3.00.00.09.bb
@@ -0,0 +1,28 @@
+require libgles-omap3.inc
+
+DEFAULT_PREFERENCE = "-1"
+
+PR = "r1"
+
+SGXPV = "3_00_00_09"
+IMGPV = "1.3.13.1832"
+BINFILE := "OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin"
+
+# The ES2.x and ES3.x CPUs have different SGX hardware, so we need to install 2 sets of userspace
+do_install_append() {
+ install -d ${D}${libdir}/ES3.0
+ install -d ${D}${libdir}/ES2.0
+ install -d ${D}${bindir}/ES3.0
+ install -d ${D}${bindir}/ES2.0
+
+ cp ${S}/gfx_rel_es2.x/lib* ${D}${libdir}/ES2.0/
+ cp ${S}/gfx_rel_es2.x/p[dv]* ${D}${bindir}/ES2.0/
+
+ cp ${D}${libdir}/lib*${IMGPV} ${D}${libdir}/ES3.0/
+ cp ${D}${bindir}/p[dv]* ${D}${bindir}/ES3.0
+}
+
+# Quality control is really poor on these SDKs, so hack around the latest madness:
+FILES_${PN} += "${libdir}/*.so"
+FILES_${PN}-dev = "${includedir}"
+
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/0002-Compile-fixes-for-DSS2.patch b/recipes/powervr-drivers/omap3-sgx-modules/0002-Compile-fixes-for-DSS2.patch
new file mode 100644
index 0000000000..c319ac57a9
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/0002-Compile-fixes-for-DSS2.patch
@@ -0,0 +1,11 @@
+--- a/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
++++ b/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
+@@ -171,7 +171,7 @@
+ #if !defined (CONFIG_OMAP2_DSS)
+ omap_dispc_free_irq(DISPC_IRQ_VSYNC, OMAPLFBVSyncISR, psSwapChain);
+ #else
+- omap_dispc_unregister_isr(OMAPLFBVSyncISR);
++ omap_dispc_unregister_isr(OMAPLFBVSyncISR, psSwapChain, DISPC_IRQ_VSYNC);
+ #endif
+ return PVRSRV_OK;
+ }
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/build_es3.x_sgx.patch b/recipes/powervr-drivers/omap3-sgx-modules/build_es3.x_sgx.patch
new file mode 100644
index 0000000000..93df6b3da5
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/build_es3.x_sgx.patch
@@ -0,0 +1,11 @@
+--- /tmp/Makefile 2009-05-04 01:14:25.000000000 +0530
++++ omap3-sgx-modules-1.3.13.1607/Makefile 2009-05-04 01:14:36.000000000 +0530
+@@ -10,7 +10,7 @@ export BUILD = debug
+ export KBUILD_EXTRA_SYMBOLS = `pwd`/services4/srvkm/env/linux/kbuild/Module.symvers
+
+ SGXCORE = 530
+-CORE = -DSGX530 -DSUPPORT_SGX530 -DSGX_CORE_REV=103
++CORE = -DSGX530 -DSUPPORT_SGX530 -DSGX_CORE_REV=121
+
+ SUPPORT_SGX = 1
+ SUPPORT_HW_RECOVERY = 1
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/omap3-sgx-modules-1.3.13.1607.tar.bz2 b/recipes/powervr-drivers/omap3-sgx-modules/omap3-sgx-modules-1.3.13.1607.tar.bz2
new file mode 100644
index 0000000000..5c2fd6a0ab
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/omap3-sgx-modules-1.3.13.1607.tar.bz2
Binary files differ
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/rotation-dss2.patch b/recipes/powervr-drivers/omap3-sgx-modules/rotation-dss2.patch
new file mode 100644
index 0000000000..ea4a6a10c6
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/rotation-dss2.patch
@@ -0,0 +1,21 @@
+--- a/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c 2009-01-22 17:08:25.000000000 +0530
++++ b/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c 2009-04-25 16:43:22.000000000 +0530
+@@ -1014,8 +1014,16 @@
+ psPVRFBInfo->sSysAddr.uiAddr = psLINFBInfo->fix.smem_start;
+ psPVRFBInfo->sCPUVAddr = psLINFBInfo->screen_base;
+
+- psPVRFBInfo->ui32Width = psLINFBInfo->var.xres;
+- psPVRFBInfo->ui32Height = psLINFBInfo->var.yres;
++ if ((psLINFBInfo->var.rotate == FB_ROTATE_CW)
++ || (psLINFBInfo->var.rotate == FB_ROTATE_CCW) ) {
++
++ psPVRFBInfo->ui32Width = psLINFBInfo->var.yres;
++ psPVRFBInfo->ui32Height = psLINFBInfo->var.xres;
++
++ } else {
++ psPVRFBInfo->ui32Width = psLINFBInfo->var.xres;
++ psPVRFBInfo->ui32Height = psLINFBInfo->var.yres;
++ }
+ psPVRFBInfo->ui32ByteStride = psLINFBInfo->fix.line_length;
+ psPVRFBInfo->ui32FBSize = FBSize;
+ psPVRFBInfo->ui32BufferSize = psPVRFBInfo->ui32Height * psPVRFBInfo->ui32ByteStride;
diff --git a/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1607.bb b/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1607.bb
new file mode 100644
index 0000000000..8e4d2a25bd
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1607.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Kernel drivers for the PowerVR SGX chipset found in the omap3 SoCs"
+LICENSE = "GPLv2"
+
+inherit module
+
+SRC_URI = "file://omap3-sgx-modules-${PV}.tar.bz2 \
+ file://0002-Compile-fixes-for-DSS2.patch;patch=1 \
+ file://rotation-dss2.patch;patch=1 \
+ file://build_es3.x_sgx.patch;patch=1 \
+"
+
+PVRBUILD = "release"
+
+MAKE_TARGETS = " BUILD=${PVRBUILD}"
+
+do_install() {
+ mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+ cp ${S}/pvrsrvkm.ko ${S}/services4/3rdparty/dc_omap3430_linux/omaplfb.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+}
diff --git a/recipes/psplash/files/ronetix-pm9263/psplash-default b/recipes/psplash/files/ronetix-pm9263/psplash-default
new file mode 100644
index 0000000000..c57d040be8
--- /dev/null
+++ b/recipes/psplash/files/ronetix-pm9263/psplash-default
@@ -0,0 +1,2 @@
+# Parameters to pass to psplash
+PARAMS="--angle 90"
diff --git a/recipes/pulseaudio/pulseaudio-0.9.15/fixbluezbuild.patch b/recipes/pulseaudio/pulseaudio-0.9.15/fixbluezbuild.patch
new file mode 100644
index 0000000000..d817a62b4d
--- /dev/null
+++ b/recipes/pulseaudio/pulseaudio-0.9.15/fixbluezbuild.patch
@@ -0,0 +1,13 @@
+Index: pulseaudio-0.9.15/src/Makefile.am
+===================================================================
+--- pulseaudio-0.9.15.orig/src/Makefile.am 2009-07-07 22:04:21.313945421 +0200
++++ pulseaudio-0.9.15/src/Makefile.am 2009-07-07 22:04:32.503184920 +0200
+@@ -1534,7 +1534,7 @@
+
+ libbluetooth_ipc_la_SOURCES = modules/bluetooth/ipc.c modules/bluetooth/ipc.h
+ libbluetooth_ipc_la_LDFLAGS = -avoid-version
+-libbluetooth_ipc_la_LIBADD = $(AM_LIBADD)libpulsecore-@PA_MAJORMINORMICRO@.la libpulsecommon-@PA_MAJORMINORMICRO@.la libpulse.la
++libbluetooth_ipc_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINORMICRO@.la libpulsecommon-@PA_MAJORMINORMICRO@.la libpulse.la
+ libbluetooth_ipc_la_CFLAGS = $(AM_CFLAGS)
+ BLUETOOTH_IPC_FILES = $(subst modules/bluetooth/,,$(libbluetooth_ipc_la_SOURCES)) rtp.h
+
diff --git a/recipes/pulseaudio/pulseaudio-0.9.15/gettext.patch b/recipes/pulseaudio/pulseaudio-0.9.15/gettext.patch
new file mode 100644
index 0000000000..8727b9819b
--- /dev/null
+++ b/recipes/pulseaudio/pulseaudio-0.9.15/gettext.patch
@@ -0,0 +1,140 @@
+Index: pulseaudio-0.9.15/configure.ac
+===================================================================
+--- pulseaudio-0.9.15.orig/configure.ac 2009-07-11 20:20:45.430959569 +0200
++++ pulseaudio-0.9.15/configure.ac 2009-07-11 20:22:47.488992720 +0200
+@@ -460,15 +460,15 @@
+ # Check for open64 to know if the current system does have open64() and similar functions
+ AC_CHECK_FUNCS([open64])
+
+-#### [lib]iconv ####
++#### localization support ####
+
+ AM_ICONV
+-
+-IT_PROG_INTLTOOL([0.35.0])
+-GETTEXT_PACKAGE=pulseaudio
++IT_PROG_INTLTOOL([0.37.0])
++GETTEXT_PACKAGE=$PACKAGE
+ AC_SUBST([GETTEXT_PACKAGE])
+ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
+-AM_GLIB_GNU_GETTEXT
++AM_GNU_GETTEXT([external])
++AM_GNU_GETTEXT_VERSION([0.17])
+
+ pulselocaledir='${prefix}/${DATADIRNAME}/locale'
+ AC_SUBST(pulselocaledir)
+Index: pulseaudio-0.9.15/src/pulse/i18n.h
+===================================================================
+--- pulseaudio-0.9.15.orig/src/pulse/i18n.h 2009-07-11 20:20:45.437631408 +0200
++++ pulseaudio-0.9.15/src/pulse/i18n.h 2009-07-11 20:20:50.116383023 +0200
+@@ -28,15 +28,13 @@
+
+ PA_C_DECL_BEGIN
+
+-#if !defined(GETTEXT_PACKAGE)
+-#error "Something is very wrong here, config.h needs to be included first"
+-#endif
++
+
+ #ifdef ENABLE_NLS
+
+ #include <libintl.h>
+
+-#define _(String) dgettext(GETTEXT_PACKAGE, String)
++#define _(String) dgettext(PACKAGE, String)
+ #ifdef gettext_noop
+ #define N_(String) gettext_noop(String)
+ #else
+Index: pulseaudio-0.9.15/src/pulse/i18n.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/pulse/i18n.c 2009-07-11 20:20:45.444294874 +0200
++++ pulseaudio-0.9.15/src/pulse/i18n.c 2009-07-11 20:20:50.116383023 +0200
+@@ -31,8 +31,8 @@
+
+ PA_ONCE_BEGIN {
+
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+- bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
++ bind_textdomain_codeset(PACKAGE, "UTF-8");
+
+ } PA_ONCE_END;
+ }
+Index: pulseaudio-0.9.15/src/utils/pacat.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/pacat.c 2009-07-11 20:20:45.450959436 +0200
++++ pulseaudio-0.9.15/src/utils/pacat.c 2009-07-11 20:20:50.116383023 +0200
+@@ -588,7 +588,7 @@
+ };
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ if (!(bn = strrchr(argv[0], '/')))
+ bn = argv[0];
+Index: pulseaudio-0.9.15/src/utils/pacmd.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/pacmd.c 2009-07-11 20:20:45.457628031 +0200
++++ pulseaudio-0.9.15/src/utils/pacmd.c 2009-07-11 20:20:50.116383023 +0200
+@@ -53,7 +53,7 @@
+ pa_bool_t ibuf_eof, obuf_eof, ibuf_closed, obuf_closed;
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ if (pa_pid_file_check_running(&pid, "pulseaudio") < 0) {
+ pa_log("No PulseAudio daemon running, or not running as session daemon.");
+Index: pulseaudio-0.9.15/src/utils/pactl.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/pactl.c 2009-07-11 20:20:45.464297385 +0200
++++ pulseaudio-0.9.15/src/utils/pactl.c 2009-07-11 20:20:50.116383023 +0200
+@@ -808,7 +808,7 @@
+ };
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ if (!(bn = strrchr(argv[0], '/')))
+ bn = argv[0];
+Index: pulseaudio-0.9.15/src/utils/paplay.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/paplay.c 2009-07-11 20:20:45.470968508 +0200
++++ pulseaudio-0.9.15/src/utils/paplay.c 2009-07-11 20:20:50.116383023 +0200
+@@ -236,7 +236,7 @@
+ };
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ if (!(bn = strrchr(argv[0], '/')))
+ bn = argv[0];
+Index: pulseaudio-0.9.15/src/utils/pasuspender.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/pasuspender.c 2009-07-11 20:20:45.477632683 +0200
++++ pulseaudio-0.9.15/src/utils/pasuspender.c 2009-07-11 20:20:50.116383023 +0200
+@@ -233,7 +233,7 @@
+ };
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ if (!(bn = strrchr(argv[0], '/')))
+ bn = argv[0];
+Index: pulseaudio-0.9.15/src/utils/pax11publish.c
+===================================================================
+--- pulseaudio-0.9.15.orig/src/utils/pax11publish.c 2009-07-11 20:20:45.487631479 +0200
++++ pulseaudio-0.9.15/src/utils/pax11publish.c 2009-07-11 20:20:50.116383023 +0200
+@@ -50,7 +50,7 @@
+ enum { DUMP, EXPORT, IMPORT, REMOVE } mode = DUMP;
+
+ setlocale(LC_ALL, "");
+- bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
++ bindtextdomain(PACKAGE, PULSE_LOCALEDIR);
+
+ while ((c = getopt(argc, argv, "deiD:S:O:I:c:hr")) != -1) {
+ switch (c) {
diff --git a/recipes/pulseaudio/pulseaudio-0.9.15/tls_m4.patch b/recipes/pulseaudio/pulseaudio-0.9.15/tls_m4.patch
new file mode 100644
index 0000000000..7b333e3df9
--- /dev/null
+++ b/recipes/pulseaudio/pulseaudio-0.9.15/tls_m4.patch
@@ -0,0 +1,30 @@
+Index: pulseaudio-0.9.15/m4/tls.m4
+===================================================================
+--- pulseaudio-0.9.15.orig/m4/tls.m4 2008-08-19 23:25:02.000000000 +0200
++++ pulseaudio-0.9.15/m4/tls.m4 2009-07-10 09:55:25.266365511 +0200
+@@ -1,12 +1,19 @@
+ AC_DEFUN([CC_CHECK_TLS], [
+ AC_CACHE_CHECK([whether $CC knows __thread for Thread-Local Storage],
+ cc_cv_tls___thread,
+- [AC_COMPILE_IFELSE(
+- AC_LANG_PROGRAM(
+- [[static __thread int a = 6;]],
+- [[a = 5;]]),
+- [cc_cv_tls___thread=yes],
+- [cc_cv_tls___thread=no])
++ [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
++ [chktls_save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
++ chktls_save_CFLAGS="$CFLAGS"
++ CFLAGS="-fPIC $CFLAGS"
++ dnl If -shared works, test if TLS works in a shared library.
++ AC_LINK_IFELSE([int f() { return 0; }],
++ AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
++ [cc_cv_tls___thread=yes],
++ [cc_cv_tls___thread=no]),
++ [cc_cv_tls___thread=yes])
++ CFLAGS="$chktls_save_CFLAGS"
++ LDFLAGS="$chktls_save_LDFLAGS"], [cc_cv_tls___thread=no])
+ ])
+
+ AS_IF([test "x$cc_cv_tls___thread" = "xyes"],
diff --git a/recipes/pulseaudio/pulseaudio_0.9.15.bb b/recipes/pulseaudio/pulseaudio_0.9.15.bb
index 4b16b474d2..639e449ccb 100644
--- a/recipes/pulseaudio/pulseaudio_0.9.15.bb
+++ b/recipes/pulseaudio/pulseaudio_0.9.15.bb
@@ -1,7 +1,9 @@
require pulseaudio.inc
DEPENDS += "gdbm speex"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.4"
+
+inherit gettext
SRC_URI += "\
file://buildfix.patch;patch=1 \
@@ -9,6 +11,9 @@ SRC_URI += "\
file://periodfix.patch;patch=1 \
file://fallback.patch;patch=1 \
file://autoconf_version.patch;patch=1 \
+ file://gettext.patch;patch=1 \
+ file://fixbluezbuild.patch;patch=1 \
+ file://tls_m4.patch;patch=1 \
"
do_compile_prepend() {
diff --git a/recipes/python/python-cjson_1.0.5.bb b/recipes/python/python-cjson_1.0.5.bb
new file mode 100644
index 0000000000..4f7e1e1fdf
--- /dev/null
+++ b/recipes/python/python-cjson_1.0.5.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "Fast JSON encoder/decoder for Python"
+SECTION = "devel/python"
+LICENSE = "LGPL"
+PR = "0"
+
+SRC_URI = "http://pypi.python.org/packages/source/p/python-cjson/python-cjson-${PV}.tar.gz"
+
+inherit distutils
diff --git a/recipes/python/python-elementtree_1.2.7-20070827-preview.bb b/recipes/python/python-elementtree_1.2.7-20070827-preview.bb
deleted file mode 100644
index f1e4c8b322..0000000000
--- a/recipes/python/python-elementtree_1.2.7-20070827-preview.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-DESCRIPTION = "Lightweight Python components for handling XML"
-SECTION = "devel/python"
-LICENSE = "Python"
-HOMEPAGE = "http://effbot.org/zone/element-index.htm"
-PR = "r0"
-
-inherit distutils
-
-SRC_URI = "http://effbot.org/media/downloads/elementtree-${PV}.zip"
-S = "${WORKDIR}/elementtree-${PV}"
-
-FILES_${PN} += "${datadir}"
-
-
diff --git a/recipes/python/python-pygtksourceview_2.6.0.bb b/recipes/python/python-pygtksourceview_2.6.0.bb
new file mode 100644
index 0000000000..c91e52ac4c
--- /dev/null
+++ b/recipes/python/python-pygtksourceview_2.6.0.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "Python gtksourceview Bindings"
+SECTION = "devel/python"
+HOMEPAGE = "http://projects.gnome.org/gtksourceview/pygtksourceview.html"
+PRIORITY = "optional"
+DEPENDS = "gtksourceview2 python-pygtk"
+SRCNAME = "pygtksourceview"
+LICENSE = "LGPL"
+PR = "r0"
+
+MAJ_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}"
+SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/pygtksourceview/${MAJ_VER}/${SRCNAME}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit autotools pkgconfig distutils-base
+
+EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../"
+
diff --git a/recipes/python/python-pyusb_0.4.1.bb b/recipes/python/python-pyusb_0.4.1.bb
index 9ed3955c2e..5f70182e46 100644
--- a/recipes/python/python-pyusb_0.4.1.bb
+++ b/recipes/python/python-pyusb_0.4.1.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "libusb Python Bindings"
SECTION = "devel/python"
PRIORITY = "optional"
LICENSE = "BSD"
-DEPENDS = "libusb"
+DEPENDS = "virtual/libusb0"
SRCNAME = "pyusb"
PR = "r1"
diff --git a/recipes/qt4/files/fix-config-tests.patch b/recipes/qt4/files/fix-config-tests.patch
new file mode 100644
index 0000000000..1e5101d8ad
--- /dev/null
+++ b/recipes/qt4/files/fix-config-tests.patch
@@ -0,0 +1,34 @@
+Fix invocation in case of "ccache some-compiler-gcc". As the command "ccache some-compiler-gcc" will not exist but "ccache" will.
+
+both visibility and relocs were affected.
+
+Index: qt-x11-opensource-src-4.5.2/config.tests/unix/bsymbolic_functions.test
+===================================================================
+--- qt-x11-opensource-src-4.5.2.orig/config.tests/unix/bsymbolic_functions.test 2009-08-01 08:01:11.000000000 +0200
++++ qt-x11-opensource-src-4.5.2/config.tests/unix/bsymbolic_functions.test 2009-08-01 08:01:16.000000000 +0200
+@@ -8,7 +8,7 @@
+ int main() { return 0; }
+ EOF
+
+-"$COMPILER" -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
++$COMPILER -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
+ rm -f bsymbolic_functions.c libtest.so
+
+ # done
+Index: qt-x11-opensource-src-4.5.2/config.tests/unix/fvisibility.test
+===================================================================
+--- qt-x11-opensource-src-4.5.2.orig/config.tests/unix/fvisibility.test 2009-06-20 06:57:50.000000000 +0200
++++ qt-x11-opensource-src-4.5.2/config.tests/unix/fvisibility.test 2009-08-01 07:59:05.000000000 +0200
+@@ -15,9 +15,9 @@
+ EOF
+
+ if [ "$VERBOSE" = "yes" ] ; then
+- "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes
++ $COMPILER -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes
+ else
+- "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
++ $COMPILER -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
+ fi
+ rm -f fvisibility.c fvisibility.o
+ }
+
diff --git a/recipes/qt4/qt4-embedded-4.5.1/0003-no-tools.patch b/recipes/qt4/qt4-embedded-4.5.2/0003-no-tools.patch
index 3829ffcdc5..3829ffcdc5 100644
--- a/recipes/qt4/qt4-embedded-4.5.1/0003-no-tools.patch
+++ b/recipes/qt4/qt4-embedded-4.5.2/0003-no-tools.patch
diff --git a/recipes/qt4/qt4-embedded-4.5.1/0006-freetype-host-includes.patch b/recipes/qt4/qt4-embedded-4.5.2/0006-freetype-host-includes.patch
index 987c425138..987c425138 100644
--- a/recipes/qt4/qt4-embedded-4.5.1/0006-freetype-host-includes.patch
+++ b/recipes/qt4/qt4-embedded-4.5.2/0006-freetype-host-includes.patch
diff --git a/recipes/qt4/qt4-embedded-4.5.1/0007-openssl-host-includes.patch b/recipes/qt4/qt4-embedded-4.5.2/0007-openssl-host-includes.patch
index 3409cc0bf2..3409cc0bf2 100644
--- a/recipes/qt4/qt4-embedded-4.5.1/0007-openssl-host-includes.patch
+++ b/recipes/qt4/qt4-embedded-4.5.2/0007-openssl-host-includes.patch
diff --git a/recipes/qt4/qt4-embedded-4.5.1/0008-qt-lib-infix.patch b/recipes/qt4/qt4-embedded-4.5.2/0008-qt-lib-infix.patch
index 3efaff37d3..3efaff37d3 100644
--- a/recipes/qt4/qt4-embedded-4.5.1/0008-qt-lib-infix.patch
+++ b/recipes/qt4/qt4-embedded-4.5.2/0008-qt-lib-infix.patch
diff --git a/recipes/qt4/qt4-embedded-4.5.1/0010-no-simpledecoration-example.patch b/recipes/qt4/qt4-embedded-4.5.2/0010-no-simpledecoration-example.patch
index 070b4ac9c1..070b4ac9c1 100644
--- a/recipes/qt4/qt4-embedded-4.5.1/0010-no-simpledecoration-example.patch
+++ b/recipes/qt4/qt4-embedded-4.5.2/0010-no-simpledecoration-example.patch
diff --git a/recipes/qt4/qt4-embedded-gles-4.5.2/sgx-hack.patch b/recipes/qt4/qt4-embedded-gles-4.5.2/sgx-hack.patch
new file mode 100644
index 0000000000..c3bf39f0e5
--- /dev/null
+++ b/recipes/qt4/qt4-embedded-gles-4.5.2/sgx-hack.patch
@@ -0,0 +1,18 @@
+--- /tmp/qglscreen_qws.h 2009-07-09 09:39:40.000000000 +0200
++++ qt-embedded-linux-opensource-src-4.5.2/src/opengl/qglscreen_qws.h 2009-07-09 09:40:11.000000000 +0200
+@@ -60,7 +60,6 @@
+ #else
+ #include <GLES/egl.h>
+ #endif
+-#if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
+ #undef EGLNativeWindowType
+ #undef EGLNativePixmapType
+ #undef EGLNativeDisplayType
+@@ -68,7 +67,6 @@
+ typedef NativePixmapType EGLNativePixmapType;
+ typedef NativeDisplayType EGLNativeDisplayType;
+ #define QEGL_NATIVE_TYPES_DEFINED 1
+-#endif
+
+ QT_BEGIN_HEADER
+
diff --git a/recipes/qt4/qt4-embedded-gles_4.5.2.bb.disabled b/recipes/qt4/qt4-embedded-gles_4.5.2.bb.disabled
new file mode 100644
index 0000000000..5aa07c2ebb
--- /dev/null
+++ b/recipes/qt4/qt4-embedded-gles_4.5.2.bb.disabled
@@ -0,0 +1,27 @@
+# recipe to build GLES gfxdriver
+
+FILESPATHPKG =. "qt4-embedded-${PV}:qt4-embedded:"
+
+QT_CONFIG_FLAGS += "-D QT_QWS_CLIENTBLIT -depths 16,24,32 -opengl es1 -plugin-gfx-powervr"
+
+require qt4-embedded_${PV}.bb
+
+LICENSE = "LGPLv2.1 GPLv3"
+
+DEPENDS += "virtual/egl"
+SRC_URI += "file://sgx-hack.patch;patch=1"
+
+export EXTRA_QMAKE_MUNGE = " glmunge "
+
+glmunge() {
+ sed -e /QMAKE_INCDIR_OPENGL/d -e /QMAKE_LIBDIR_OPENGL/d -e /QMAKE_LIBS_OPENGL/d -e /QMAKE_LIBS_OPENGL_QT/d -i mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+
+ echo "QMAKE_INCDIR_OPENGL = ${STAGING_INCDIR}/GLES/" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+ echo "QMAKE_LIBDIR_OPENGL = ${STAGING_LIBDIR}" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+ echo "QMAKE_LIBS_OPENGL = -lEGL -lGLES_CM -lIMGegl -lsrv_um" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+ echo "QMAKE_LIBS_OPENGL_QT = -lEGL -lGLES_CM -lIMGegl -lsrv_um" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+ sed -i -e s:MBX_SYNC:HW_SYNC:g ${S}/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
+}
+
+
+
diff --git a/recipes/qt4/qt4-embedded.inc b/recipes/qt4/qt4-embedded.inc
index 26b4116f40..962233efb1 100644
--- a/recipes/qt4/qt4-embedded.inc
+++ b/recipes/qt4/qt4-embedded.inc
@@ -4,7 +4,7 @@ LICENSE = "GPL QPL"
PRIORITY = "optional"
HOMEPAGE = "http://www.trolltech.com"
DEPENDS += "directfb tslib"
-INC_PR = "r11"
+INC_PR = "r14"
QT_BASE_NAME = "qt4-embedded"
QT_BASE_LIB = "libqt-embedded"
@@ -20,6 +20,7 @@ SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-embedded-linux-opensource-src-${
file://0007-openssl-host-includes.patch;patch=1 \
file://0008-qt-lib-infix.patch;patch=1 \
file://0009-support-2bpp.patch;patch=1 \
+ file://fix-config-tests.patch;patch=1 \
file://g++.conf \
file://linux.conf \
"
diff --git a/recipes/qt4/qt4-embedded_4.4.3.bb b/recipes/qt4/qt4-embedded_4.4.3.bb
index f5358a069e..fce2e657ee 100644
--- a/recipes/qt4/qt4-embedded_4.4.3.bb
+++ b/recipes/qt4/qt4-embedded_4.4.3.bb
@@ -1,3 +1,3 @@
-include qt4-embedded.inc
+require qt4-embedded.inc
PR = "${INC_PR}.1"
diff --git a/recipes/qt4/qt4-embedded_4.5.1.bb b/recipes/qt4/qt4-embedded_4.5.2.bb
index dff754c68c..d94bc4862d 100644
--- a/recipes/qt4/qt4-embedded_4.5.1.bb
+++ b/recipes/qt4/qt4-embedded_4.5.2.bb
@@ -1,6 +1,6 @@
-include qt4-embedded.inc
+require qt4-embedded.inc
PR = "${INC_PR}.1"
-LICENSE += "LGPL"
+LICENSE = "LGPLv2.1 GPLv3"
SRC_URI += "file://0010-no-simpledecoration-example.patch;patch=1"
diff --git a/recipes/qt4/qt4-tools-native_4.5.1.bb b/recipes/qt4/qt4-tools-native_4.5.2.bb
index d1962bf98f..8eed0034db 100644
--- a/recipes/qt4/qt4-tools-native_4.5.1.bb
+++ b/recipes/qt4/qt4-tools-native_4.5.2.bb
@@ -1,4 +1,5 @@
require qt4-tools-native.inc
+LICENSE = "LGPLv2.1 GPLv3"
PR = "${INC_PR}.1"
TOBUILD := "src/tools/bootstrap ${TOBUILD}"
diff --git a/recipes/qt4/qt4-tools-sdk_4.5.1.bb b/recipes/qt4/qt4-tools-sdk_4.5.2.bb
index db919fd6df..fafb7710c9 100644
--- a/recipes/qt4/qt4-tools-sdk_4.5.1.bb
+++ b/recipes/qt4/qt4-tools-sdk_4.5.2.bb
@@ -3,7 +3,7 @@ DEPENDS = "zlib-native dbus-native"
SECTION = "libs"
HOMEPAGE = "http://www.trolltech.com"
PRIORITY = "optional"
-LICENSE = "GPL"
+LICENSE = "LGPLv2.1 GPLv3"
inherit sdk
diff --git a/recipes/qt4/qt4-x11-free-gles/sgx-hack.patch b/recipes/qt4/qt4-x11-free-gles/sgx-hack.patch
new file mode 100644
index 0000000000..77f0e2a2fd
--- /dev/null
+++ b/recipes/qt4/qt4-x11-free-gles/sgx-hack.patch
@@ -0,0 +1,20 @@
+--- /tmp/qegl_p.h 2009-07-09 08:42:12.000000000 +0200
++++ qt-x11-opensource-src-4.5.2/src/opengl/qegl_p.h 2009-07-09 08:42:30.000000000 +0200
+@@ -65,7 +65,7 @@
+ #else
+ #include <GLES/egl.h>
+ #endif
+-#if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
++//#if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
+ #undef EGLNativeWindowType
+ #undef EGLNativePixmapType
+ #undef EGLNativeDisplayType
+@@ -73,7 +73,7 @@
+ typedef NativePixmapType EGLNativePixmapType;
+ typedef NativeDisplayType EGLNativeDisplayType;
+ #define QEGL_NATIVE_TYPES_DEFINED 1
+-#endif
++//#endif
+ QT_END_INCLUDE_NAMESPACE
+
+ class QX11Info;
diff --git a/recipes/qt4/qt4-x11-free-gles_4.5.2.bb b/recipes/qt4/qt4-x11-free-gles_4.5.2.bb
new file mode 100644
index 0000000000..944378d0dd
--- /dev/null
+++ b/recipes/qt4/qt4-x11-free-gles_4.5.2.bb
@@ -0,0 +1,27 @@
+# recipe to build GLES gfxdriver
+
+FILESPATHPKG =. "qt4-x11-free-${PV}:qt4-x11-free:"
+
+QT_GLFLAGS = "-opengl es2"
+
+QT_BASE_NAME = "qt4-gles"
+QT_BASE_LIB = "libqt-gles"
+
+require qt4-x11-free_${PV}.bb
+PR = "${INC_PR}.3"
+
+DEPENDS += "virtual/egl"
+#SRC_URI += "file://sgx-hack.patch;patch=1"
+
+export EXTRA_QMAKE_MUNGE = " glmunge "
+
+glmunge() {
+sed -e /QMAKE_INCDIR_OPENGL/d -e /QMAKE_LIBDIR_OPENGL/d -e /QMAKE_LIBS_OPENGL/d -e /QMAKE_LIBS_OPENGL_QT/d -i mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_INCDIR_OPENGL = ${STAGING_INCDIR}/GLES/" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBDIR_OPENGL = ${STAGING_LIBDIR}" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBS_OPENGL = -lEGL -lGLES_CM -lGLESv2 -lIMGegl -lsrv_um" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBS_OPENGL_QT = -lEGL -lGLES_CM -lGLESv2 -lIMGegl -lsrv_um" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+}
+
+
+
diff --git a/recipes/qt4/qt4-x11-free-gles_git.bb.disabled b/recipes/qt4/qt4-x11-free-gles_git.bb.disabled
new file mode 100644
index 0000000000..22db2dfa8d
--- /dev/null
+++ b/recipes/qt4/qt4-x11-free-gles_git.bb.disabled
@@ -0,0 +1,40 @@
+# recipe to build GLES gfxdriver
+
+FILESPATHPKG =. "qt4-x11-free-${PV}:qt4-x11-free:"
+
+QT_GLFLAGS = "-opengl es1 -openvg"
+
+require qt4-x11-free.inc
+LICENSE = "LGPLv2.1 GPLv3"
+PR = "${INC_PR}.0+gitr${SRCREV}"
+
+DEPENDS += "virtual/egl"
+
+SRCREV = "9ec431c"
+SRC_URI = "git://git.gitorious.org/qt/qt.git;protocol=http \
+ file://0001-cross-compile.patch;patch=1 \
+ file://0002-fix-resinit-declaration.patch;patch=1 \
+ file://0003-no-tools.patch;patch=1 \
+ file://0004-no-qmake.patch;patch=1 \
+ file://0006-freetype-host-includes.patch;patch=1 \
+ file://0007-openssl-host-includes.patch;patch=1 \
+ file://0008-qt-lib-infix.patch;patch=1 \
+ file://g++.conf \
+ file://linux.conf \
+ "
+#SRC_URI += "file://sgx-hack.patch;patch=1"
+
+S = "${WORKDIR}/git"
+
+export EXTRA_QMAKE_MUNGE = " glmunge "
+
+glmunge() {
+sed -e /QMAKE_INCDIR_OPENGL/d -e /QMAKE_LIBDIR_OPENGL/d -e /QMAKE_LIBS_OPENGL/d -e /QMAKE_LIBS_OPENGL_QT/d -i mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_INCDIR_OPENGL = ${STAGING_INCDIR}/GLES/" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBDIR_OPENGL = ${STAGING_LIBDIR}" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBS_OPENGL = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lOpenVG" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+echo "QMAKE_LIBS_OPENGL_QT = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lOpenVG" >> mkspecs/${OE_QMAKE_PLATFORM}/qmake.conf
+}
+
+
+
diff --git a/recipes/qt4/qt4-x11-free.inc b/recipes/qt4/qt4-x11-free.inc
index 23fa33f118..6ca20561cd 100644
--- a/recipes/qt4/qt4-x11-free.inc
+++ b/recipes/qt4/qt4-x11-free.inc
@@ -6,7 +6,7 @@ LICENSE = "GPL QPL"
DEPENDS += "virtual/libx11 fontconfig xft libxext libxrender libxrandr libxcursor"
PROVIDES = "qt4x11"
-INC_PR = "r10"
+INC_PR = "r12"
SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-${PV}.tar.gz \
file://0001-cross-compile.patch;patch=1 \
@@ -16,13 +16,14 @@ SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-${PV}.tar.gz
file://0006-freetype-host-includes.patch;patch=1 \
file://0007-openssl-host-includes.patch;patch=1 \
file://0008-qt-lib-infix.patch;patch=1 \
+ file://fix-config-tests.patch;patch=1 \
file://g++.conf \
file://linux.conf \
"
S = "${WORKDIR}/qt-x11-opensource-src-${PV}"
-
-QT_CONFIG_FLAGS += "-no-xinerama -no-xkb -no-opengl"
+QT_GLFLAGS ?= "-no-opengl"
+QT_CONFIG_FLAGS += "-no-xinerama -no-xkb ${QT_GLFLAGS}"
QT_BASE_NAME = "qt4"
QT_BASE_LIB = "libqt"
QT_DIR_NAME = "qt4"
diff --git a/recipes/qt4/qt4-x11-free_4.4.3.bb b/recipes/qt4/qt4-x11-free_4.4.3.bb
index a3538c9199..4a52083cbd 100644
--- a/recipes/qt4/qt4-x11-free_4.4.3.bb
+++ b/recipes/qt4/qt4-x11-free_4.4.3.bb
@@ -1,3 +1,3 @@
-include qt4-x11-free.inc
+require qt4-x11-free.inc
PR = "${INC_PR}.1"
QT_CONFIG_FLAGS += "-no-tablet"
diff --git a/recipes/qt4/qt4-x11-free_4.5.1.bb b/recipes/qt4/qt4-x11-free_4.5.1.bb
deleted file mode 100644
index 1cc637a548..0000000000
--- a/recipes/qt4/qt4-x11-free_4.5.1.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-include qt4-x11-free.inc
-LICENSE += "LGPL"
-PR = "${INC_PR}.1"
-
diff --git a/recipes/qt4/qt4-x11-free_4.5.2.bb b/recipes/qt4/qt4-x11-free_4.5.2.bb
new file mode 100644
index 0000000000..0289f211b4
--- /dev/null
+++ b/recipes/qt4/qt4-x11-free_4.5.2.bb
@@ -0,0 +1,4 @@
+require qt4-x11-free.inc
+LICENSE = "LGPLv2.1 GPLv3"
+PR = "${INC_PR}.2"
+
diff --git a/recipes/qt4/qt4.inc b/recipes/qt4/qt4.inc
index f5da6527f0..50dd1d8760 100644
--- a/recipes/qt4/qt4.inc
+++ b/recipes/qt4/qt4.inc
@@ -1,6 +1,6 @@
inherit qmake_base
-DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 gstreamer gst-plugins-base"
+DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 gstreamer gst-plugins-base mysql postgresql sqlite sqlite3"
require qt4_arch.inc
QT_ARCH := "${@qt_arch(d)}"
@@ -9,7 +9,7 @@ QT_ENDIAN = "${@qt_endian(d)}"
QT_CONFIG_FLAGS += "-release -no-cups -no-accessibility -reduce-relocations \
-shared -no-nas-sound -no-sm -no-nis \
-qt-gif -system-libjpeg -system-libpng -system-zlib \
- -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 \
+ -no-sql-ibase -plugin-sql-mysql -no-sql-odbc -plugin-sql-psql -plugin-sql-sqlite -plugin-sql-sqlite2 \
-no-pch -qdbus -stl -glib -phonon -webkit"
EXTRA_OEMAKE = "-e"
@@ -24,6 +24,9 @@ export QT_CONF_PATH="${WORKDIR}/qt.conf"
# Library packages
QT_LIB_NAMES = "Qt3Support QtAssistantClient QtCLucene QtCore QtDBus QtDesigner QtDesignerComponents QtGui QtHelp QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtUiTools QtWebKit QtXml phonon"
+
+QT_EXTRA_LIBS = "pvrQWSWSEGL"
+
python __anonymous () {
import bb
@@ -48,6 +51,20 @@ python __anonymous () {
for name in bb.data.getVar("OTHER_PACKAGES", d, 1).split():
dbg_packages.append("%s-dbg" % name)
+ for name in bb.data.getVar("QT_EXTRA_LIBS", d, 1).split():
+ pkg = "${QT_BASE_LIB}" + name.lower().replace("qt", "") + "4"
+ bb.data.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s.so.*" % locals(), d)
+ bb.data.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s.prl
+ ${libdir}/lib%(name)s.a
+ ${libdir}/lib%(name)s.la
+ ${libdir}/lib%(name)s.so
+ ${includedir}/${QT_DIR_NAME}/%(incname)s
+ ${libdir}/pkgconfig/%(name)s.pc""" % locals(), d)
+ bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so.*" % locals(), d)
+ lib_packages.append(pkg)
+ dev_packages.append("%s-dev" % pkg)
+ dbg_packages.append("%s-dbg" % pkg)
+
bb.data.setVar("LIB_PACKAGES", " ".join(lib_packages), d)
bb.data.setVar("DEV_PACKAGES", " ".join(dev_packages), d)
bb.data.setVar("DBG_PACKAGES", " ".join(dbg_packages), d)
@@ -85,11 +102,11 @@ FILES_${QT_BASE_NAME}-common-dbg = "${bindir}/.debug/qtconfig"
FILES_${QT_BASE_NAME}-dbus = "${bindir}/qdbus ${bindir}/qdbusxml2cpp ${bindir}/qdbuscpp2xml ${bindir}/qdbusviewer"
FILES_${QT_BASE_NAME}-dbus-dbg = "${bindir}/.debug/qdbus ${bindir}/.debug/qdbusxml2cpp ${bindir}/.debug/qdbuscpp2xml ${bindir}/.debug/qdbusviewer"
FILES_${QT_BASE_NAME}-demos = "${bindir}/qtdemo ${bindir}/${QT_DIR_NAME}/demos/*"
-FILES_${QT_BASE_NAME}-demos-dbg = "${bindir}/.debug/qtdemo ${bindir}/${QT_DIR_NAME}/demos/.debug/*"
+FILES_${QT_BASE_NAME}-demos-dbg = "${bindir}/.debug/qtdemo ${bindir}/${QT_DIR_NAME}/demos/.debug/* ${bindir}/${QT_DIR_NAME}/demos/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/*/.debug"
FILES_${QT_BASE_NAME}-designer = "${bindir}/*designer*"
FILES_${QT_BASE_NAME}-designer-dbg = "${bindir}/.debug/*designer*"
FILES_${QT_BASE_NAME}-examples = "${bindir}/${QT_DIR_NAME}/examples/*"
-FILES_${QT_BASE_NAME}-examples-dbg = "${bindir}/${QT_DIR_NAME}/examples/.debug/*"
+FILES_${QT_BASE_NAME}-examples-dbg = "${bindir}/${QT_DIR_NAME}/examples/.debug ${bindir}/${QT_DIR_NAME}/examples/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/*/.debug"
FILES_${QT_BASE_NAME}-fonts = "${libdir}/fonts"
FILES_${QT_BASE_NAME}-linguist = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts"
FILES_${QT_BASE_NAME}-linguist-dbg = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts"
@@ -105,12 +122,19 @@ FILES_${QT_BASE_NAME}-mkspecs = "${datadir}/${QT_DIR_NAME}/mkspecs/
do_configure() {
unset QMAKESPEC
unset QTDIR
- ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
- ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
+
+ if [ ! -e bin/qmake ]; then
+ ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
+ fi
+
+ if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then
+ ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
+ fi
+
cp -f ${WORKDIR}/g++.conf ${WORKDIR}/linux.conf mkspecs/common/
echo "[Paths]" > $QT_CONF_PATH
- echo "Prefix=${prefix}" >> $QT_CONF_PATH
+ echo "Prefix=${prefix}/" >> $QT_CONF_PATH
echo "Documentation=${docdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
echo "Headers=${includedir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
echo "Libraries=${libdir}" >> $QT_CONF_PATH
@@ -122,8 +146,10 @@ do_configure() {
echo "Examples=${bindir}/${QT_DIR_NAME}/examples" >> $QT_CONF_PATH
echo "Demos=${bindir}/${QT_DIR_NAME}/demos" >> $QT_CONF_PATH
+ ${EXTRA_QMAKE_MUNGE}|| true
+
(echo o; echo yes) | ./configure -v \
- -prefix ${prefix} \
+ -prefix ${prefix}/ \
-bindir ${bindir} \
-libdir ${libdir} \
-datadir ${datadir}/${QT_DIR_NAME} \
@@ -140,7 +166,9 @@ do_configure() {
-crossarch ${QT_ARCH} \
${QT_CONFIG_FLAGS} -fast \
-L${STAGING_LIBDIR} -I${STAGING_INCDIR} \
- -I${STAGING_INCDIR}/freetype2
+ -I${STAGING_INCDIR}/freetype2 \
+ -I${STAGING_INCDIR}/mysql \
+ -I${STAGING_INCDIR}/postgresql
}
do_compile() {
@@ -193,6 +221,7 @@ python populate_packages_prepend() {
qtopia_split('decorations', 'decoration', '^libqdecoration(.*)\.so$')
qtopia_split('designer', 'designer', '^lib(.*)\.so$')
qtopia_split('gfxdrivers', 'gfxdriver', '^libq(.*)\.so$')
+ qtopia_split('graphicssystems','graphicssystems', '^libq(.*)\.so$')
qtopia_split('mousedrivers', 'mousedriver', '^libq(.*)mousedriver\.so$')
qtopia_split('iconengines', 'iconengine', '^libq(.*)\.so$')
qtopia_split('imageformats', 'imageformat', '^libq(.*)\.so$')
@@ -205,13 +234,10 @@ python populate_packages_prepend() {
do_install() {
oe_runmake install INSTALL_ROOT=${D}
-
+
# These are host binaries, we should only use them in staging
rm -rf ${D}/${bindir}/qmake
- # XXX, FIXME, TODO: package the demos and examples properly
- rm -rf ${D}/${bindir}/${QT_DIR_NAME}
-
# fix pkgconfig, libtool and prl files
sed -i -e s#-L${S}/lib##g \
-e s#-L${STAGING_LIBDIR}##g \
diff --git a/recipes/rdesktop/rdesktop-1.6.0/audio-2008.patch b/recipes/rdesktop/rdesktop-1.6.0/audio-2008.patch
new file mode 100644
index 0000000000..57052a78a4
--- /dev/null
+++ b/recipes/rdesktop/rdesktop-1.6.0/audio-2008.patch
@@ -0,0 +1,22 @@
+--- a/rdpdr.c (revisão 1505)
++++ b/rdpdr.c (cópia de trabalho)
+@@ -841,14 +841,11 @@
+ RD_BOOL
+ rdpdr_init()
+ {
+- if (g_num_devices > 0)
+- {
+- rdpdr_channel =
+- channel_register("rdpdr",
+- CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_COMPRESS_RDP,
+- rdpdr_process);
+- }
+-
++ rdpdr_channel =
++ channel_register("rdpdr",
++ CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_COMPRESS_RDP,
++ rdpdr_process);
++
+ return (rdpdr_channel != NULL);
+ }
+
diff --git a/recipes/rdesktop/rdesktop-1.6.0/rdesktop-addin.patch b/recipes/rdesktop/rdesktop-1.6.0/rdesktop-addin.patch
new file mode 100644
index 0000000000..ffd942a6bd
--- /dev/null
+++ b/recipes/rdesktop/rdesktop-1.6.0/rdesktop-addin.patch
@@ -0,0 +1,534 @@
+diff -ur rdesktop-1.6.0-orig/channels.c rdesktop-1.6.0/channels.c
+--- rdesktop-1.6.0-orig/channels.c 2007-01-08 07:47:05.000000000 +0300
++++ rdesktop-1.6.0/channels.c 2008-12-05 18:58:00.000000000 +0300
+@@ -19,6 +19,9 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <unistd.h>
+ #include "rdesktop.h"
+
+ #define MAX_CHANNELS 6
+@@ -44,7 +47,7 @@
+ */
+
+ VCHANNEL *
+-channel_register(char *name, uint32 flags, void (*callback) (STREAM))
++channel_register(char *name, uint32 flags, void (*callback) (STREAM,char*))
+ {
+ VCHANNEL *channel;
+
+@@ -159,7 +162,7 @@
+ if ((flags & CHANNEL_FLAG_FIRST) && (flags & CHANNEL_FLAG_LAST))
+ {
+ /* single fragment - pass straight up */
+- channel->process(s);
++ channel->process(s, channel->name);
+ }
+ else
+ {
+@@ -183,7 +186,109 @@
+ {
+ in->end = in->p;
+ in->p = in->data;
+- channel->process(in);
++ channel->process(in, channel->name);
+ }
+ }
+ }
++
++/* Generic callback for delivering data to third party add-ins */
++void addin_callback(STREAM s, char *name)
++{
++ pid_t pid;
++ int pipe_read;
++ int pipe_write;
++ uint32 blocksize;
++
++ blocksize = s->end - s->p;
++
++ lookup_addin(name, &pid, &pipe_read, &pipe_write);
++ if (pid > 0) {
++ /* Prepend the block with the block size so the
++ add-in can identify blocks */
++ write(pipe_write, &blocksize, sizeof(uint32));
++ write(pipe_write, s->p, blocksize);
++ }
++}
++
++void addin_add_fds(int *n, fd_set *rfds, fd_set *wfds, struct timeval *tv)
++{
++ extern ADDIN_DATA addin_data[];
++ extern int addin_count;
++ int i;
++
++ for (i = 0; i < addin_count; i++) {
++ /* Take in account only live addins. */
++ if (addin_data[i].pid > 0) {
++ int addin_fd = addin_data[i].pipe_read;
++
++ FD_SET(addin_fd, rfds);
++ if (*n < addin_fd)
++ *n = addin_fd;
++ }
++ }
++}
++
++/* Process outgoing addin data */
++void addin_check_fds(fd_set *rfds, fd_set *wfds)
++{
++ extern ADDIN_DATA addin_data[];
++ extern int addin_count;
++ int i;
++ unsigned int block_len;
++ ssize_t bytes_read;
++ STREAM s;
++
++ for (i = 0; i < addin_count; i++) {
++ int addin_fd = addin_data[i].pipe_read;
++
++ if (!FD_ISSET(addin_fd, rfds)) {
++ continue;
++ }
++
++ bytes_read = read(addin_fd, &block_len, sizeof(block_len));
++ if (bytes_read <= 0) {
++ addin_check_terminated(&addin_data[i]);
++ continue;
++ }
++
++ if (block_len > 0xffff) {
++ warning("received too much data (%d) from addin %s\n",
++ block_len, addin_data[i].name);
++ addin_check_terminated(&addin_data[i]);
++ continue;
++ }
++
++ if (block_len > addin_data[i].buf_len) {
++ addin_data[i].buf = (unsigned char *)xrealloc(
++ addin_data[i].buf,
++ block_len);
++ addin_data[i].buf_len = block_len;
++ }
++
++ bytes_read = read(addin_fd, addin_data[i].buf, block_len);
++ if (bytes_read > 0) {
++ s = channel_init(addin_data[i].vchannel, bytes_read);
++ memcpy(s->p, addin_data[i].buf, bytes_read);
++ s->p += bytes_read;
++ s->end = s->p;
++
++ channel_send(s, addin_data[i].vchannel);
++ }
++ }
++}
++
++void addin_check_terminated(ADDIN_DATA *addin)
++{
++ int status = 0;
++
++ pid_t result = waitpid(addin->pid, &status, WNOHANG);
++ if (result <= 0)
++ return;
++
++ if (WIFEXITED(status) || WIFSIGNALED(status)) {
++ warning("Addin %s is suddenly terminated\n", addin->name);
++ /* Mark this addin as terminated to exclude
++ it from processing. */
++ addin->pid = 0;
++ }
++}
+diff -ur rdesktop-1.6.0-orig/cliprdr.c rdesktop-1.6.0/cliprdr.c
+--- rdesktop-1.6.0-orig/cliprdr.c 2007-01-08 07:47:05.000000000 +0300
++++ rdesktop-1.6.0/cliprdr.c 2008-12-05 18:42:40.000000000 +0300
+@@ -111,7 +111,7 @@
+ }
+
+ static void
+-cliprdr_process(STREAM s)
++cliprdr_process(STREAM s, char *name)
+ {
+ uint16 type, status;
+ uint32 length, format;
+Only in rdesktop-1.6.0/doc: .svn
+Only in rdesktop-1.6.0/keymaps: .svn
+diff -ur rdesktop-1.6.0-orig/lspci.c rdesktop-1.6.0/lspci.c
+--- rdesktop-1.6.0-orig/lspci.c 2007-01-08 07:47:05.000000000 +0300
++++ rdesktop-1.6.0/lspci.c 2008-12-05 18:42:40.000000000 +0300
+@@ -128,7 +128,7 @@
+
+ /* Process new data from the virtual channel */
+ static void
+-lspci_process(STREAM s)
++lspci_process(STREAM s, char *name)
+ {
+ unsigned int pkglen;
+ static char *rest = NULL;
+diff -ur rdesktop-1.6.0-orig/proto.h rdesktop-1.6.0/proto.h
+--- rdesktop-1.6.0-orig/proto.h 2008-04-02 15:13:22.000000000 +0400
++++ rdesktop-1.6.0/proto.h 2008-12-05 18:58:00.000000000 +0300
+@@ -45,7 +45,7 @@
+ RD_HCURSOR cache_get_cursor(uint16 cache_idx);
+ void cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor);
+ /* channels.c */
+-VCHANNEL *channel_register(char *name, uint32 flags, void (*callback) (STREAM));
++VCHANNEL *channel_register(char *name, uint32 flags, void (*callback) (STREAM,char *));
+ STREAM channel_init(VCHANNEL * channel, uint32 length);
+ void channel_send(STREAM s, VCHANNEL * channel);
+ void channel_process(STREAM s, uint16 mcs_channel);
+@@ -314,6 +314,21 @@
+ void scard_lock(int lock);
+ void scard_unlock(int lock);
+
++/* External addins */
++void init_external_addin(char * addin_name, char * addin_path, char * args, ADDIN_DATA * addin_data);
++
++/* Generic callback for delivering data to third party add-ins */
++void addin_callback(STREAM s, char *name);
++
++/* Find an external add-in registration by virtual channel name */
++void lookup_addin(char *name, pid_t * pid, int * pipe_read, int * pipe_write);
++
++void addin_add_fds(int *n, fd_set *rfds, fd_set *wfds, struct timeval *tv);
++
++void addin_check_fds(fd_set *rfds, fd_set *wfds);
++
++void addin_check_terminated(ADDIN_DATA *addin);
++
+ /* *INDENT-OFF* */
+ #ifdef __cplusplus
+ }
+diff -ur rdesktop-1.6.0-orig/rdesktop.c rdesktop-1.6.0/rdesktop.c
+--- rdesktop-1.6.0-orig/rdesktop.c 2008-04-05 09:22:26.000000000 +0400
++++ rdesktop-1.6.0/rdesktop.c 2008-12-05 18:58:00.000000000 +0300
+@@ -28,6 +28,7 @@
+ #include <sys/times.h> /* times */
+ #include <ctype.h> /* toupper */
+ #include <errno.h>
++#include <signal.h> /* kill */
+ #include "rdesktop.h"
+
+ #ifdef HAVE_LOCALE_H
+@@ -115,6 +116,9 @@
+ extern uint32 g_num_devices;
+ extern char *g_rdpdr_clientname;
+
++ADDIN_DATA addin_data[MAX_ADDINS];
++int addin_count = 0;
++
+ #ifdef RDP2VNC
+ extern int rfb_port;
+ extern int defer_time;
+@@ -208,6 +212,9 @@
+ fprintf(stderr,
+ " \"AKS\" -> Device vendor name \n");
+ #endif
++ fprintf(stderr,
++ " '-r addin:<channelname>:</path/to/executable>[:arg1[:arg2:]...]': enable third\n");
++ fprintf(stderr, " party virtual channel add-in.\n");
+ fprintf(stderr, " -0: attach to console\n");
+ fprintf(stderr, " -4: use RDP version 4\n");
+ fprintf(stderr, " -5: use RDP version 5 (default)\n");
+@@ -417,6 +424,8 @@
+ struct passwd *pw;
+ uint32 flags, ext_disc_reason = 0;
+ char *p;
++ char *addin_name;
++ char *addin_path;
+ int c;
+ char *locale = NULL;
+ int username_option = 0;
+@@ -672,8 +681,58 @@
+ break;
+
+ case 'r':
++ if (str_startswith(optarg, "addin"))
++ {
++ if (addin_count >= MAX_ADDINS)
++ {
++ error("Add-ins data table full, increase MAX_ADDINS\n");
++ return 1;
++ }
++
++ optarg += 5;
+
+- if (str_startswith(optarg, "sound"))
++ if (*optarg == ':')
++ {
++ addin_name = optarg + 1;
++ if (*addin_name != '\0')
++ {
++ addin_path = next_arg(addin_name, ':');
++ }
++ else
++ {
++ addin_path = 0;
++ }
++ if (addin_path != 0)
++ {
++ p = next_arg(addin_path, ':');
++ }
++ if (*addin_name != '\0' && addin_path != 0 && *addin_path != '\0')
++ {
++ init_external_addin(addin_name, addin_path,
++ p, &addin_data[addin_count]);
++ if (addin_data[addin_count].pid != 0)
++ {
++ addin_count++;
++ }
++ else
++ {
++ error("Failed to initialise add-in [%s]\n", addin_name);
++ return 1;
++ }
++ }
++ else
++ {
++ usage(argv[0]);
++ return(1);
++ }
++ }
++ else
++ {
++ usage(argv[0]);
++ return(1);
++ }
++ }
++ else if (str_startswith(optarg, "sound"))
+ {
+ optarg += 5;
+
+@@ -982,6 +1041,17 @@
+ cache_save_state();
+ ui_deinit();
+
++ /* Send a SIGUSR1 to all addins to close and sleep for a couple of secs
++ to give them a chance to stop */
++ for (c = 0; c < addin_count; c++)
++ {
++ if (addin_data[c].pid != 0)
++ {
++ kill(addin_data[c].pid,SIGUSR1);
++ sleep(2);
++ }
++ }
++
+ if (ext_disc_reason >= 2)
+ print_disconnect_reason(ext_disc_reason);
+
+@@ -1625,3 +1695,105 @@
+ return False;
+ return True;
+ }
++
++/* Initialise external addin */
++void init_external_addin(char * addin_name, char * addin_path, char * args, ADDIN_DATA * addin_data)
++{
++ char *p;
++ char *current_arg;
++ char * argv[256];
++ char argv_buffer[256][256];
++ int i;
++ int readpipe[2],writepipe[2];
++ pid_t child;
++
++ /* Initialise addin structure */
++ memset(addin_data, 0, sizeof(ADDIN_DATA));
++ /* Go through the list of args, adding each to argv */
++ argv[0] = addin_path;
++ i = 1;
++ p=current_arg=args;
++ while (current_arg != 0 && current_arg[0] != '\0')
++ {
++ p=next_arg(p, ':');;
++ if (p != 0 && *p != '\0')
++ *(p - 1) = '\0';
++ strcpy(argv_buffer[i], current_arg);
++ argv[i]=argv_buffer[i];
++ i++;
++ current_arg=p;
++ }
++ argv[i] = NULL;
++
++
++ /* Create pipes */
++ if (pipe(readpipe) < 0 || pipe(writepipe) < 0)
++ {
++ perror("pipes for addin");
++ return;
++ }
++
++ /* Fork process */
++ if ((child = fork()) < 0)
++ {
++ perror("fork for addin");
++ return;
++ }
++
++ /* Child */
++ if (child == 0)
++ {
++ /* Set stdin and stdout of child to relevant pipe ends */
++ dup2(writepipe[0],0);
++ dup2(readpipe[1],1);
++
++ /* Close all fds as they are not needed now */
++ close(readpipe[0]);
++ close(readpipe[1]);
++ close(writepipe[0]);
++ close(writepipe[1]);
++ execvp((char *)argv[0], (char **)argv);
++ perror("Error executing child");
++ _exit(128);
++ }
++ else
++ {
++ strcpy(addin_data->name, addin_name);
++ /* Close child end fd's */
++ close(readpipe[1]);
++ close(writepipe[0]);
++ addin_data->pipe_read=readpipe[0];
++ addin_data->pipe_write=writepipe[1];
++ addin_data->vchannel=channel_register(addin_name,
++ CHANNEL_OPTION_INITIALIZED |
++ CHANNEL_OPTION_ENCRYPT_RDP |
++ CHANNEL_OPTION_COMPRESS_RDP,
++ addin_callback);
++ if (!addin_data->vchannel)
++ {
++ perror("Channel register failed");
++ return;
++ }
++ else
++ addin_data->pid=child;
++
++ }
++
++}
++
++/* Find an external add-in registration by virtual channel name */
++void lookup_addin(char *name, pid_t * pid, int * pipe_read, int * pipe_write)
++{
++ int i;
++
++ *pid = 0;
++
++ for (i = 0; i < addin_count; i++) {
++ if (!strcmp(name,addin_data[i].name)) {
++ *pid=addin_data[i].pid;
++ *pipe_read=addin_data[i].pipe_read;
++ *pipe_write=addin_data[i].pipe_write;
++ break;
++ }
++ }
++}
+diff -ur rdesktop-1.6.0-orig/rdesktop.h rdesktop-1.6.0/rdesktop.h
+--- rdesktop-1.6.0-orig/rdesktop.h 2008-04-05 08:54:10.000000000 +0400
++++ rdesktop-1.6.0/rdesktop.h 2008-12-05 18:42:40.000000000 +0300
+@@ -41,6 +41,8 @@
+
+ #define VERSION "1.6.0"
+
++#define MAX_ADDINS 20
++
+ #ifdef WITH_DEBUG
+ #define DEBUG(args) printf args;
+ #else
+diff -ur rdesktop-1.6.0-orig/rdpdr.c rdesktop-1.6.0/rdpdr.c
+--- rdesktop-1.6.0-orig/rdpdr.c 2008-02-14 14:37:17.000000000 +0300
++++ rdesktop-1.6.0/rdpdr.c 2008-12-05 18:42:40.000000000 +0300
+@@ -781,7 +781,7 @@
+ }
+
+ static void
+-rdpdr_process(STREAM s)
++rdpdr_process(STREAM s, char *name)
+ {
+ uint32 handle;
+ uint8 *magic;
+diff -ur rdesktop-1.6.0-orig/rdpsnd.c rdesktop-1.6.0/rdpsnd.c
+--- rdesktop-1.6.0-orig/rdpsnd.c 2008-02-14 14:37:17.000000000 +0300
++++ rdesktop-1.6.0/rdpsnd.c 2008-12-05 18:42:40.000000000 +0300
+@@ -544,7 +544,7 @@
+ }
+
+ static void
+-rdpsnd_process(STREAM s)
++rdpsnd_process(STREAM s, char *name)
+ {
+ uint16 len;
+
+@@ -611,7 +611,7 @@
+ }
+
+ static void
+-rdpsnddbg_process(STREAM s)
++rdpsnddbg_process(STREAM s, char *name)
+ {
+ unsigned int pkglen;
+ static char *rest = NULL;
+diff -ur rdesktop-1.6.0-orig/seamless.c rdesktop-1.6.0/seamless.c
+--- rdesktop-1.6.0-orig/seamless.c 2008-04-02 15:13:22.000000000 +0400
++++ rdesktop-1.6.0/seamless.c 2008-12-05 18:42:40.000000000 +0300
+@@ -370,7 +370,7 @@
+
+
+ static void
+-seamless_process(STREAM s)
++seamless_process(STREAM s, char *name)
+ {
+ unsigned int pkglen;
+ static char *rest = NULL;
+Only in rdesktop-1.6.0: .svn
+diff -ur rdesktop-1.6.0-orig/types.h rdesktop-1.6.0/types.h
+--- rdesktop-1.6.0-orig/types.h 2007-01-08 07:47:06.000000000 +0300
++++ rdesktop-1.6.0/types.h 2008-12-05 18:42:40.000000000 +0300
+@@ -125,7 +125,7 @@
+ char name[8];
+ uint32 flags;
+ struct stream in;
+- void (*process) (STREAM);
++ void (*process) (STREAM,char *);
+ }
+ VCHANNEL;
+
+@@ -265,4 +265,15 @@
+ }
+ FILEINFO;
+
++typedef struct _ADDIN_DATA
++{
++ char name[255];
++ unsigned char *buf;
++ unsigned int buf_len;
++ pid_t pid;
++ int pipe_read;
++ int pipe_write;
++ VCHANNEL *vchannel;
++} ADDIN_DATA;
++
+ typedef RD_BOOL(*str_handle_lines_t) (const char *line, void *data);
+diff -ur rdesktop-1.6.0-orig/xwin.c rdesktop-1.6.0/xwin.c
+--- rdesktop-1.6.0-orig/xwin.c 2008-05-11 10:14:38.000000000 +0400
++++ rdesktop-1.6.0/xwin.c 2008-12-05 18:42:40.000000000 +0300
+@@ -2620,6 +2620,9 @@
+ rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);
+ seamless_select_timeout(&tv);
+
++ /* add addins handles */
++ addin_add_fds(&n, &rfds, &wfds, &tv);
++
+ n++;
+
+ switch (select(n, &rfds, &wfds, NULL, &tv))
+@@ -2642,6 +2645,8 @@
+ rdpsnd_check_fds(&rfds, &wfds);
+ #endif
+
++ addin_check_fds(&rfds, &wfds);
++
+ rdpdr_check_fds(&rfds, &wfds, (RD_BOOL) False);
+
+ if (FD_ISSET(rdp_socket, &rfds))
diff --git a/recipes/rdesktop/rdesktop.inc b/recipes/rdesktop/rdesktop.inc
index 4c832cae3f..8f2d587b53 100644
--- a/recipes/rdesktop/rdesktop.inc
+++ b/recipes/rdesktop/rdesktop.inc
@@ -4,4 +4,6 @@ DEPENDS = "virtual/libx11 openssl"
SECTION = "x11/network"
LICENSE = "GPL"
+INC_PR = "r2"
+
SRC_URI = "${SOURCEFORGE_MIRROR}/rdesktop/rdesktop-${PV}.tar.gz"
diff --git a/recipes/rdesktop/rdesktop_1.3.1.bb b/recipes/rdesktop/rdesktop_1.3.1.bb
index d50a0c1e8c..ffb36d22a5 100644
--- a/recipes/rdesktop/rdesktop_1.3.1.bb
+++ b/recipes/rdesktop/rdesktop_1.3.1.bb
@@ -1,5 +1,7 @@
require rdesktop.inc
+PR = "${INC_PR}.1"
+
SRC_URI +="file://configure.patch;patch=1"
# Note - rdesktop 1.3.1 doesn't use autotools - don't make the same
diff --git a/recipes/rdesktop/rdesktop_1.4.1.bb b/recipes/rdesktop/rdesktop_1.4.1.bb
index 8682c8ee98..99200c6f10 100644
--- a/recipes/rdesktop/rdesktop_1.4.1.bb
+++ b/recipes/rdesktop/rdesktop_1.4.1.bb
@@ -1,6 +1,6 @@
require rdesktop.inc
-PR = "r1"
+PR = "${INC_PR}.1"
SRC_URI += "file://strip.patch;patch=1"
diff --git a/recipes/rdesktop/rdesktop_1.5.0.bb b/recipes/rdesktop/rdesktop_1.5.0.bb
index d652dfe633..c492afa0b2 100644
--- a/recipes/rdesktop/rdesktop_1.5.0.bb
+++ b/recipes/rdesktop/rdesktop_1.5.0.bb
@@ -1,6 +1,6 @@
require rdesktop.inc
-PR = "r0"
+PR = "${INC_PR}.1"
inherit autotools
diff --git a/recipes/rdesktop/rdesktop_1.6.0.bb b/recipes/rdesktop/rdesktop_1.6.0.bb
index d652dfe633..0f39e784cf 100644
--- a/recipes/rdesktop/rdesktop_1.6.0.bb
+++ b/recipes/rdesktop/rdesktop_1.6.0.bb
@@ -1,6 +1,11 @@
require rdesktop.inc
-PR = "r0"
+PR = "${INC_PR}.2"
+
+SRC_URI += " file://audio-2008.patch;patch=1"
+SRC_URI_append_ossystems = " file://rdesktop-addin.patch;patch=1"
+
+SRC_URI += " file://audio-2008.patch;patch=1"
inherit autotools
diff --git a/recipes/rdesktop/rdesktop_cvs.bb b/recipes/rdesktop/rdesktop_cvs.bb
index 0b76ee7535..496b6defa8 100644
--- a/recipes/rdesktop/rdesktop_cvs.bb
+++ b/recipes/rdesktop/rdesktop_cvs.bb
@@ -1,7 +1,7 @@
require rdesktop.inc
PV = "1.6.0+cvs${SRCDATE}"
-PR = "r0"
+PR = "${INC_PR}.1"
DEFAULT_PREFERENCE = "-1"
SRC_URI = "cvs://anonymous@rdesktop.cvs.sourceforge.net/cvsroot/rdesktop;module=rdesktop"
S = "${WORKDIR}/rdesktop"
@@ -9,4 +9,3 @@ S = "${WORKDIR}/rdesktop"
inherit autotools
EXTRA_OECONF = "--with-openssl=${STAGING_LIBDIR}/.. "
-
diff --git a/recipes/rsstail/rsstail_1.5.bb b/recipes/rsstail/rsstail_1.5.bb
new file mode 100644
index 0000000000..02a2d999a6
--- /dev/null
+++ b/recipes/rsstail/rsstail_1.5.bb
@@ -0,0 +1,19 @@
+HOMEPAGE = "http://www.vanheusden.com/rsstail/"
+DESCRIPTION = "RSSTail is a tail-like RSS reader: it monitors an RSS feed and if it detects a new entry it will emit only that new entry."
+LICENSE = "GPLv2"
+
+DEPENDS = "libmrss"
+
+PR = "r0"
+
+inherit autotools
+
+SRC_URI = "http://www.vanheusden.com/rsstail/rsstail-${PV}.tgz"
+
+do_install_prepend() {
+ install -d ${D}${bindir} ${D}${mandir}/man1
+}
+
+do_stage() {
+ :
+}
diff --git a/recipes/samsung-soc-utils/s3c2410-boot-usb-native_svn.bb b/recipes/samsung-soc-utils/s3c2410-boot-usb-native_svn.bb
index 675d07c910..d839bb81e7 100644
--- a/recipes/samsung-soc-utils/s3c2410-boot-usb-native_svn.bb
+++ b/recipes/samsung-soc-utils/s3c2410-boot-usb-native_svn.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Boots a S3C2410 device with a user supplied kernel zImage"
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
SECTION = "devel"
AUTHOR = "Harald Welte <laforge@openmoko.org>"
LICENSE = "GPL"
diff --git a/recipes/sane/sane-backends_1.0.19.bb b/recipes/sane/sane-backends_1.0.19.bb
index 95ce49ede0..935541f25a 100644
--- a/recipes/sane/sane-backends_1.0.19.bb
+++ b/recipes/sane/sane-backends_1.0.19.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Scanner drivers for SANE"
-DEPENDS = "hal gphoto2 jpeg libusb"
+DEPENDS = "hal gphoto2 jpeg virtual/libusb0"
LICENSE = "LGPL"
SRC_URI = "http://alioth.debian.org/frs/download.php/2318/sane-backends-${PV}.tar.gz \
diff --git a/recipes/schroedinger/schroedinger_1.0.5.bb b/recipes/schroedinger/schroedinger_1.0.5.bb
index 66d24c1d97..476c2965e6 100644
--- a/recipes/schroedinger/schroedinger_1.0.5.bb
+++ b/recipes/schroedinger/schroedinger_1.0.5.bb
@@ -1,8 +1,12 @@
require schroedinger.inc
-PR = "r2"
+PR = "r3"
inherit autotools_stage
AUTOTOOLS_STAGE_PKGCONFIG = "1"
+PACKAGES =+ "gst-plugin-schroedinger-dbg gst-plugin-schroedinger-dev gst-plugin-schroedinger"
+FILES_gst-plugin-schroedinger = "${libdir}/gstreamer-0.10/*.so"
+FILES_gst-plugin-schroedinger-dbg = "${libdir}/gstreamer-0.10/.debug"
+FILES_gst-plugin-schroedinger-dev = "${libdir}/gstreamer-0.10/*.*a"
diff --git a/recipes/sdr/hamlib_1.2.9.bb b/recipes/sdr/hamlib_1.2.9.bb
index 8815c622e6..b959cee3a0 100644
--- a/recipes/sdr/hamlib_1.2.9.bb
+++ b/recipes/sdr/hamlib_1.2.9.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "The Ham Radio Control Libraries, Hamlib for short, is a development effort to provide a consistent interface for programmers wanting to incorporate radio control in their programs"
LICENSE = "GPLv2"
-DEPENDS = "swig-native perl python libusb-compat tcl gnuradio"
+DEPENDS = "swig-native perl python virtual/libusb0 tcl gnuradio"
SRC_URI = "${SOURCEFORGE_MIRROR}/hamlib/hamlib-${PV}.tar.gz"
diff --git a/recipes/skype/skype-static_2.0.0.72.bb b/recipes/skype/skype-static_2.0.0.72.bb
new file mode 100644
index 0000000000..4bf4de3da7
--- /dev/null
+++ b/recipes/skype/skype-static_2.0.0.72.bb
@@ -0,0 +1,4 @@
+include skype_${PV}.bb
+
+SRC_URI = "http://download.skype.com/linux/skype_static-2.0.0.72.tar.bz2"
+S="${WORKDIR}/skype_static-${PV}"
diff --git a/recipes/skype/skype_2.0.0.72.bb b/recipes/skype/skype_2.0.0.72.bb
new file mode 100644
index 0000000000..f545571877
--- /dev/null
+++ b/recipes/skype/skype_2.0.0.72.bb
@@ -0,0 +1,20 @@
+DEPENDS = "virtual/libx11 qt4-x11-free glibc-gconv-utf-16"
+HOMEPAGE="www.skype.com"
+SRC_URI = "http://download.skype.com/linux/skype-2.0.0.72.tar.bz2"
+
+S="${WORKDIR}/${PN}-${PV}"
+
+do_install() {
+ install -d ${D}/usr/bin
+ cp skype ${D}/usr/bin/
+
+ install -d ${D}/usr/share/skype
+ cp -r sounds lang avatars ${D}/usr/share/skype
+
+ install -d ${D}/usr/share/pixmaps
+ cp -r icons/SkypeBlue_48x48.png ${D}/usr/share/pixmaps/skype.png
+}
+
+FILES_${PN} += "${datadir}/skype"
+
+COMPATIBLE_HOST = "i.86.*-linux"
diff --git a/recipes/sqlite/sqlite3.inc b/recipes/sqlite/sqlite3.inc
index 93a536e8b6..ae20ff5ead 100644
--- a/recipes/sqlite/sqlite3.inc
+++ b/recipes/sqlite/sqlite3.inc
@@ -9,7 +9,7 @@ SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \
S = "${WORKDIR}/sqlite-${PV}"
-inherit autotools pkgconfig
+inherit autotools_stage pkgconfig
EXTRA_OECONF = "--disable-tcl --enable-shared \
--enable-threadsafe"
@@ -26,15 +26,6 @@ do_compile_prepend() {
install -m 0644 sqlite3.h ${STAGING_INCDIR}
}
-do_stage() {
- oe_libinstall -so libsqlite3 ${STAGING_LIBDIR}
- install -m 0644 sqlite3.h ${STAGING_INCDIR}
-}
-
-#do_install() {
-# oe_runmake install DESTDIR=${D} prefix=${prefix} exec_prefix=${exec_prefix}
-#}
-
PACKAGES = "libsqlite libsqlite-dev libsqlite-doc sqlite3 sqlite3-dbg"
FILES_sqlite3 = "${bindir}/*"
FILES_libsqlite = "${libdir}/*.so.*"
diff --git a/recipes/sugar/etoys_4.0.2212.bb b/recipes/sugar/etoys_4.0.2212.bb
new file mode 100644
index 0000000000..b66dd22f9d
--- /dev/null
+++ b/recipes/sugar/etoys_4.0.2212.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "Sugar etoys"
+LICENSE = "GPLv2"
+
+PR = "r0"
+
+DEPENDS = "sugar"
+RDEPENDS = "sugar shared-mime-info"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/etoys/etoys-${PV}.tar.gz \
+ file://etoys.diff;patch=1"
+
+inherit autotools distutils-base
+
+do_configure_prepend() {
+ mkdir -p ${S}/m4
+}
+
+PACKAGES_ARCH = "all"
+FILES_${PN} += "${datadir}/${PN} \
+ ${datadir}/xsessions \
+ ${datadir}/dbus-1 \
+ ${datadir}/sugar/activities \
+ ${sysconfdir} "
+
diff --git a/recipes/sugar/sugar-artwork_0.84.1.bb b/recipes/sugar/sugar-artwork_0.84.1.bb
new file mode 100644
index 0000000000..c96cf7a38e
--- /dev/null
+++ b/recipes/sugar/sugar-artwork_0.84.1.bb
@@ -0,0 +1,28 @@
+DESCRIPTION = "Sugar artwork"
+LICENSE = "GPLv2"
+
+PR = "r0"
+
+DEPENDS = "sugar icon-slicer-native"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-artwork/${PN}-${PV}.tar.bz2 "
+
+inherit autotools distutils-base
+
+do_configure_prepend() {
+ mkdir -p ${S}/m4
+}
+
+FILES_${PN} += "${datadir}/${PN} \
+ ${datadir}/icons \
+ ${datadir}/themes \
+ ${sysconfdir} "
+
+FILES_${PN}-dbg += "${libdir}/gtk-2.0/2.*/engines/.debug"
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/sugar/sugar-base_0.83.2.bb b/recipes/sugar/sugar-base_0.83.2.bb
index 468ff3b0dc..cb4c0555f3 100644
--- a/recipes/sugar/sugar-base_0.83.2.bb
+++ b/recipes/sugar/sugar-base_0.83.2.bb
@@ -1,6 +1,8 @@
DESCRIPTION = "Sugar base system"
LICENSE = "LGPLv2"
+PR = "r1"
+
DEPENDS = "python-pygtk sugar-toolkit"
RDEPENDS = "librsvg-gtk \
ohm-plugin-x11 ohm \
@@ -27,9 +29,9 @@ RDEPENDS = "librsvg-gtk \
python-doctest \
ssh-keygen"
-SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-base/${PN}-${PV}.tar.bz2"
+inherit gnome distutils-base
-inherit autotools distutils-base
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-base/${PN}-${PV}.tar.bz2"
SRC_URI += "file://acinclude.m4"
diff --git a/recipes/sugar/sugar-base_0.84.1.bb b/recipes/sugar/sugar-base_0.84.1.bb
new file mode 100644
index 0000000000..e95a43e3a9
--- /dev/null
+++ b/recipes/sugar/sugar-base_0.84.1.bb
@@ -0,0 +1,53 @@
+DESCRIPTION = "Sugar base system"
+LICENSE = "LGPLv2"
+
+DEPENDS = "python-pygtk sugar-toolkit"
+RDEPENDS = "librsvg-gtk \
+ ohm-plugin-x11 ohm \
+ hippo-canvas \
+ python-datetime \
+ python-netclient \
+ python-pygtk \
+ sugar-toolkit \
+ python-logging \
+ python-dbus \
+ python-subprocess \
+ telepathy-gabble telepathy-salut telepathy-python \
+ sugar-presence-service \
+ python-crypt \
+ python-numpy \
+ python-compression \
+ python-gst \
+ python-simplejson \
+ python-misc \
+ python-xmlrpc \
+ python-compiler \
+ python-pydoc \
+ python-mmap \
+ python-doctest \
+ ssh-keygen"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-base/${PN}-${PV}.tar.bz2"
+
+inherit autotools distutils-base
+
+SRC_URI += "file://acinclude.m4"
+
+EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../"
+
+do_configure_prepend() {
+ install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+FILES_${PN} += "${datadir}/${PN} \
+ ${datadir}/dbus-1 \
+ ${sysconfdir} "
+
+FILES_${PN}-dbg += "${libdir}/python*/site-packages/sugar/.debug"
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/sugar/sugar-datastore_0.84.0.bb b/recipes/sugar/sugar-datastore_0.84.0.bb
new file mode 100644
index 0000000000..dde2748974
--- /dev/null
+++ b/recipes/sugar/sugar-datastore_0.84.0.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Sugar datastore"
+LICENSE = "GPLv2"
+
+PR = "r0"
+
+DEPENDS = "sugar-toolkit python-xappy "
+RDEPENDS = "sugar-toolkit sugar-base python-xappy python-cjson"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-datastore/${PN}-${PV}.tar.bz2"
+
+inherit autotools
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
+
+FILES_${PN} += "${datadir}/dbus-1"
+
diff --git a/recipes/sugar/sugar-presence-service_0.84.0.bb b/recipes/sugar/sugar-presence-service_0.84.0.bb
new file mode 100644
index 0000000000..78676d477a
--- /dev/null
+++ b/recipes/sugar/sugar-presence-service_0.84.0.bb
@@ -0,0 +1,31 @@
+DESCRIPTION = "Sugar presence service"
+LICENSE = "GPLv2"
+
+PR = "r0"
+
+DEPENDS = "sugar-toolkit"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-presence-service/${PN}-${PV}.tar.bz2"
+
+inherit autotools distutils-base mime
+
+do_configure_prepend() {
+ mkdir -p ${S}/m4
+}
+
+FILES_${PN} += "${datadir}/${PN} \
+ ${datadir}/mime/packages \
+ ${datadir}/xsessions \
+ ${datadir}/dbus-1 \
+ ${sysconfdir} \
+ ${libdir}/python*/site-packages/"
+
+FILES_${PN}-dbg += "${libdir}/python*/site-packages/*/.debug"
+
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/sugar/sugar-toolkit_0.84.4.bb b/recipes/sugar/sugar-toolkit_0.84.4.bb
new file mode 100644
index 0000000000..864582d7e5
--- /dev/null
+++ b/recipes/sugar/sugar-toolkit_0.84.4.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "Sugar toolkit"
+LICENSE = "LGPLv2"
+DEPENDS = "python-pygtk libxml-parser-perl-native libxml2 gtk+ alsa-lib"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar-toolkit/sugar-toolkit-${PV}.tar.bz2"
+
+inherit autotools distutils-base
+
+SRC_URI += "file://acinclude.m4"
+
+EXTRA_OECONF += "--with-python-includes=${STAGING_INCDIR}/../"
+
+do_configure_prepend() {
+ install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/sugar/sugar_0.84.6.bb b/recipes/sugar/sugar_0.84.6.bb
new file mode 100644
index 0000000000..2ed38cde3d
--- /dev/null
+++ b/recipes/sugar/sugar_0.84.6.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "Sugar base system"
+LICENSE = "GPLv2"
+
+DEPENDS = "sugar-toolkit libxml2 gtk+"
+RDEPENDS = "sugar-toolkit sugar-base sugar-datastore sugar-artwork gnome-python gnome-python-desktop python-cjson python-pygtksourceview"
+
+SRC_URI = "http://download.sugarlabs.org/sources/sucrose/glucose/sugar/${PN}-${PV}.tar.bz2"
+
+inherit autotools distutils-base mime
+
+do_configure_prepend() {
+ mkdir -p ${S}/m4
+}
+
+FILES_${PN} += "${datadir}/${PN} \
+ ${datadir}/mime/packages \
+ ${datadir}/xsessions \
+ ${datadir}/dbus-1 \
+ ${sysconfdir} "
+
+AUTOTOOLS_STAGE_PKGCONFIG = "1"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/taglib/taglib_1.5.bb b/recipes/taglib/taglib_1.5.bb
index f67660faf1..507b8ce159 100644
--- a/recipes/taglib/taglib_1.5.bb
+++ b/recipes/taglib/taglib_1.5.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "TagLib is a library for reading and editing the meta-data of seve
SECTION = "libs/multimedia"
HOMEPAGE = "http://developer.kde.org/~wheeler/taglib.html"
LICENSE = "LGPL"
-PR = "r0"
+PR = "r1"
SRC_URI = "http://developer.kde.org/~wheeler/files/src/taglib-${PV}.tar.gz \
file://add_missing_exports_fix.diff;patch=1 \
@@ -16,7 +16,7 @@ inherit cmake pkgconfig binconfig
do_stage() {
install -d ${STAGING_INCDIR}/${PN}
- install -m 0644 ${D}/usr/include/${PN}/*.h ${STAGING_INCDIR}/${PN}
+ install -m 0644 ${D}/${includedir}/${PN}/*.h ${STAGING_INCDIR}/${PN}
oe_libinstall -C ${PN} -so libtag ${STAGING_LIBDIR}
}
diff --git a/recipes/tangogps/tangogps.inc b/recipes/tangogps/tangogps.inc
index 90789377d1..677000fb45 100644
--- a/recipes/tangogps/tangogps.inc
+++ b/recipes/tangogps/tangogps.inc
@@ -4,7 +4,7 @@ HOMEPAGE = "http://tangogps.org/"
SECTION = "x11/applications"
LICENSE = "GPLv2"
PRIORITY = "optional"
-DEPENDS = "curl gtk+ gconf sqlite3"
+DEPENDS = "curl gtk+ gconf sqlite3 libexif"
SRC_URI = "http://www.tangogps.org/downloads/tangogps-${PV}.tar.gz"
S = "${WORKDIR}/tangogps-${PV}"
diff --git a/recipes/tasks/task-beagleboard-demo.bb b/recipes/tasks/task-beagleboard-demo.bb
index 0f24dc9a23..95b42ae34b 100644
--- a/recipes/tasks/task-beagleboard-demo.bb
+++ b/recipes/tasks/task-beagleboard-demo.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Task for Beagleboard-demo-image"
-PR = "r10"
+PR = "r12"
inherit task
@@ -15,10 +15,10 @@ RDEPENDS_${PN} = "\
angstrom-zeroconf-audio \
angstrom-led-config \
gpe-scap \
- mime-support e-wm ${ECONFIG} exhibit \
+ mime-support e-wm ${ECONFIG} \
xterm xmms \
firefox midori \
- swfdec-mozilla \
+ gnash gnash-browser-plugin \
hicolor-icon-theme gnome-icon-theme \
jaaa nmap iperf gnuplot \
abiword \
diff --git a/recipes/tasks/task-sugar-sucrose.bb b/recipes/tasks/task-sugar-sucrose.bb
new file mode 100644
index 0000000000..d4812d9295
--- /dev/null
+++ b/recipes/tasks/task-sugar-sucrose.bb
@@ -0,0 +1,10 @@
+DESCRIPTION = "Task for complete sugar environment with core activities"
+
+PR = "r0"
+
+inherit task
+
+RDEPENDS_${PN} = "\
+ sugar \
+# sugar-fructose \
+"
diff --git a/recipes/tinylogin/tinylogin_1.4.bb b/recipes/tinylogin/tinylogin_1.4.bb
index 54708b2d4b..23ee694b1c 100644
--- a/recipes/tinylogin/tinylogin_1.4.bb
+++ b/recipes/tinylogin/tinylogin_1.4.bb
@@ -7,7 +7,8 @@ SECTION = "base"
LICENSE = "GPL"
PR = "r6"
-SRC_URI = "http://tinylogin.busybox.net/downloads/tinylogin-${PV}.tar.bz2 \
+#SRC_URI = "http://tinylogin.busybox.net/downloads/tinylogin-${PV}.tar.bz2 \
+SRC_URI = "http://limpens.net/trac/at91-kit-trac/export/4/trunk/sources/tinylogin-${PV}.tar.bz2 \
file://cvs-20040608.patch;patch=1;pnum=1 \
file://add-system.patch;patch=1;pnum=1 \
file://adduser-empty_pwd.patch;patch=1 \
diff --git a/recipes/transmission/transmission_1.73.bb b/recipes/transmission/transmission_1.73.bb
new file mode 100644
index 0000000000..135bf55b06
--- /dev/null
+++ b/recipes/transmission/transmission_1.73.bb
@@ -0,0 +1,34 @@
+DESCRIPTION = "Transmission is a BitTorrent client w/ a built-in Ajax-Powered Webif GUI."
+SECTION = "network"
+HOMEPAGE = "www.transmissionbt.com/"
+DEPENDS = "gtk+ gnutls openssl gettext libtool intltool-native curl glib-2.0-native"
+LICENSE = "GPLv2"
+PR = "r0"
+SRC_URI = "http://mirrors.m0k.org/transmission/files/transmission-${PV}.tar.bz2 \
+ file://init"
+
+INITSCRIPT_NAME = "transmission"
+INITSCRIPT_PARAMS = "defaults 60 "
+
+inherit autotools update-rc.d
+
+do_install_append() {
+ install -d -p ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/transmission
+}
+
+FILES_${PN} += "${datadir}/icons"
+
+# No need for online check, since update-rc.d will prepend it to here
+pkg_postinst_${PN}() {
+grep -q transmission ${sysconfdir}/group || addgroup transmission
+grep -q transmission ${sysconfdir}/passwd || adduser -h /home/transmission -S -D -G transmission -s ${base_bindir}/false transmission
+mkdir -p /home/transmission/.config
+chown transmission:transmission /home/transmission/.config
+}
+
+pkg_postrm_${PN}() {
+delgroup transmission
+deluser transmission
+}
+
diff --git a/recipes/tslib/tslib/tslib-nopressure.patch b/recipes/tslib/tslib/tslib-nopressure.patch
new file mode 100644
index 0000000000..1b19b43c52
--- /dev/null
+++ b/recipes/tslib/tslib/tslib-nopressure.patch
@@ -0,0 +1,30 @@
+diff -ur tslib-1.0/plugins/input-raw.c tslib/plugins/input-raw.c
+--- tslib-1.0/plugins/input-raw.c 2006-08-24 23:02:54.000000000 +0200
++++ tslib/plugins/input-raw.c 2009-07-21 00:54:29.000000000 +0200
+@@ -95,7 +95,11 @@
+ case EV_KEY:
+ switch (ev.code) {
+ case BTN_TOUCH:
+- if (ev.value == 0) {
++ if (ev.value) {
++ samp->x = i->current_x;
++ samp->y = i->current_y;
++ samp->pressure = i->current_p = 1;
++ } else {
+ /* pen up */
+ samp->x = 0;
+ samp->y = 0;
+@@ -198,7 +202,11 @@
+ } else if (ev.type == EV_KEY) {
+ switch (ev.code) {
+ case BTN_TOUCH:
+- if (ev.value == 0) {
++ if (ev.value) {
++ samp->x = i->current_x;
++ samp->y = i->current_y;
++ samp->pressure = i->current_p = 1;
++ } else {
+ /* pen up */
+ samp->x = 0;
+ samp->y = 0;
+
diff --git a/recipes/tslib/tslib_1.0.bb b/recipes/tslib/tslib_1.0.bb
index c22256f4d2..1929ee0557 100644
--- a/recipes/tslib/tslib_1.0.bb
+++ b/recipes/tslib/tslib_1.0.bb
@@ -1,5 +1,6 @@
SRC_URI = "http://download.berlios.de/tslib/${BP}.tar.bz2 \
- file://fix_version.patch;patch=1"
-PR = "${INC_PR}.1"
+ file://fix_version.patch;patch=1 \
+ file://tslib-nopressure.patch;patch=1"
+PR = "${INC_PR}.2"
include tslib.inc
diff --git a/recipes/u-boot/u-boot-git/new-pinmux.patch b/recipes/u-boot/u-boot-git/new-pinmux.patch
new file mode 100644
index 0000000000..63963db097
--- /dev/null
+++ b/recipes/u-boot/u-boot-git/new-pinmux.patch
@@ -0,0 +1,71 @@
+From: Steve Sakoman <sakoman@tera.(none)>
+Date: Thu, 16 Apr 2009 05:08:11 +0000 (-0700)
+Subject: beagle: first cut at pinmux to support tincan zippy
+X-Git-Url: http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=commitdiff_plain;h=22223c0fe848871a6c2ecfcdd292c7d6d38b1d1d
+
+beagle: first cut at pinmux to support tincan zippy
+---
+
+diff --git a/board/omap3/beagle/beagle.h b/board/omap3/beagle/beagle.h
+index fe18223..e3f0da0 100644
+--- a/board/omap3/beagle/beagle.h
++++ b/board/omap3/beagle/beagle.h
+@@ -203,16 +203,16 @@ const omap3_sysinfo sysinfo = {
+ MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\
+ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\
+ /*Wireless LAN */\
+- MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\
+- MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\
+- MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\
+- MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\
+- MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\
+- MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\
+- MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\
+- MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\
+- MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\
+- MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\
++ MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*MMC2_CLK*/\
++ MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*MMC2_CMD*/\
++ MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*MMC2_DAT0*/\
++ MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*MMC2_DAT1*/\
++ MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M0)) /*MMC2_DAT2*/\
++ MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M0)) /*MMC2_DAT3*/\
++ MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT0*/\
++ MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT1*/\
++ MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M1)) /*MMC2_DIR_CMD*/\
++ MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M1)) /*MMC2_CLKIN*/\
+ /*Bluetooth*/\
+ MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\
+ MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\
+@@ -231,13 +231,13 @@ const omap3_sysinfo sysinfo = {
+ MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
+ MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
+ MUX_VAL(CP(MCBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\
+- MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\
+- MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\
+- MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\
+- MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\
++ MUX_VAL(CP(MCBSP1_CLKR), (IEN | PTU | EN | M1)) /*MCSPI4_CLK*/\
++ MUX_VAL(CP(MCBSP1_FSR), (IEN | PTU | EN | M4)) /*GPIO_157*/\
++ MUX_VAL(CP(MCBSP1_DX), (IEN | PTD | EN | M1)) /*MCSPI4_SIMO*/\
++ MUX_VAL(CP(MCBSP1_DR), (IEN | PTD | DIS | M1)) /*MCSPI4_SOMI*/\
+ MUX_VAL(CP(MCBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\
+- MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\
+- MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\
++ MUX_VAL(CP(MCBSP1_FSX), (IEN | PTD | EN | M1)) /*MCSPI4_CS0*/\
++ MUX_VAL(CP(MCBSP1_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_162*/\
+ /*Serial Interface*/\
+ MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_RCTX*/\
+ MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\
+@@ -257,8 +257,8 @@ const omap3_sysinfo sysinfo = {
+ MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
+ MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\
+ MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\
+- MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\
+- MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\
++ MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M0)) /*I2C2_SCL*/\
++ MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M0)) /*I2C2_SDA*/\
+ MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\
+ MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\
+ MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\
+
diff --git a/recipes/u-boot/u-boot_git.bb b/recipes/u-boot/u-boot_git.bb
index 8936cfbbc7..c646813278 100644
--- a/recipes/u-boot/u-boot_git.bb
+++ b/recipes/u-boot/u-boot_git.bb
@@ -1,5 +1,5 @@
require u-boot.inc
-PR ="r26"
+PR ="r27"
FILESPATHPKG =. "u-boot-git:"
@@ -16,6 +16,7 @@ SRC_URI_append_afeb9260-180 = " file://AFEB9260-network-fix.patch;patch=1"
SRC_URI_beagleboard = "git://gitorious.org/u-boot-omap3/mainline.git;branch=omap3-dev;protocol=git \
file://fw-env.patch;patch=1 \
file://dss2.patch;patch=1 \
+ file://new-pinmux.patch;patch=1 \
"
SRCREV_beagleboard = "d363f9cb0918a1b6b92e2e20d01543d0c4f53274"
PV_beagleboard = "2009.05+${PR}+gitr${SRCREV}"
@@ -28,6 +29,9 @@ SRC_URI_omapzoom = "git://www.sakoman.net/git/u-boot-omap3.git;branch=omap3-dev;
SRCREV_omapzoom = "d691b424f1f5bf7eea3a4131dfc578d272e8f335"
PV_omapzoom = "2009.01+${PR}+gitr${SRCREV}"
+SRCREV_omapzoom2 = "3672cd5c3b53d219d33345eebad4e25ad5bf6d52"
+PV_omapzoom2 = "2009.05+${PR}+gitr${SRCREV}"
+
SRC_URI_overo = "git://gitorious.org/u-boot-omap3/mainline.git;branch=omap3-dev;protocol=git \
file://fw-env.patch;patch=1 \
file://dss2.patch;patch=1 \
diff --git a/recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine b/recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine
new file mode 100644
index 0000000000..6cd19e851e
--- /dev/null
+++ b/recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine
@@ -0,0 +1,72 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30.1
+# Wed Jul 1 17:04:32 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+CONFIG_GENERIC_386=y
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+# UCLIBC_HAS_FENV is not set
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS="/bla"
+HAVE_DOT_CONFIG=y
diff --git a/recipes/uclibc/uclibc-svn/arm-linuxthreads.patch b/recipes/uclibc/uclibc-git/arm-linuxthreads.patch
index e222668a66..e222668a66 100644
--- a/recipes/uclibc/uclibc-svn/arm-linuxthreads.patch
+++ b/recipes/uclibc/uclibc-git/arm-linuxthreads.patch
diff --git a/recipes/uclibc/uclibc-svn/arm/uClibc.config b/recipes/uclibc/uclibc-git/arm/uClibc.config
index 34b0f2137e..34b0f2137e 100644
--- a/recipes/uclibc/uclibc-svn/arm/uClibc.config
+++ b/recipes/uclibc/uclibc-git/arm/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/arm_fix_alignment.patch b/recipes/uclibc/uclibc-git/arm_fix_alignment.patch
index 982afe9a6e..982afe9a6e 100644
--- a/recipes/uclibc/uclibc-svn/arm_fix_alignment.patch
+++ b/recipes/uclibc/uclibc-git/arm_fix_alignment.patch
diff --git a/recipes/uclibc/uclibc-svn/armeb/uClibc.config b/recipes/uclibc/uclibc-git/armeb/uClibc.config
index 5f9fe16afb..5f9fe16afb 100644
--- a/recipes/uclibc/uclibc-svn/armeb/uClibc.config
+++ b/recipes/uclibc/uclibc-git/armeb/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/dht-walnut/uClibc.config b/recipes/uclibc/uclibc-git/dht-walnut/uClibc.config
index 6e606f6be3..6e606f6be3 100644
--- a/recipes/uclibc/uclibc-svn/dht-walnut/uClibc.config
+++ b/recipes/uclibc/uclibc-git/dht-walnut/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/efika/uClibc.config b/recipes/uclibc/uclibc-git/efika/uClibc.config
index 23b221d662..23b221d662 100644
--- a/recipes/uclibc/uclibc-svn/efika/uClibc.config
+++ b/recipes/uclibc/uclibc-git/efika/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/errno_values.h.patch b/recipes/uclibc/uclibc-git/errno_values.h.patch
index a1e39c181b..a1e39c181b 100644
--- a/recipes/uclibc/uclibc-svn/errno_values.h.patch
+++ b/recipes/uclibc/uclibc-git/errno_values.h.patch
diff --git a/recipes/uclibc/uclibc-svn/error_print_progname.patch b/recipes/uclibc/uclibc-git/error_print_progname.patch
index 6c10ec6b3c..6c10ec6b3c 100644
--- a/recipes/uclibc/uclibc-svn/error_print_progname.patch
+++ b/recipes/uclibc/uclibc-git/error_print_progname.patch
diff --git a/recipes/uclibc/uclibc-svn/i386/uClibc.config b/recipes/uclibc/uclibc-git/i386/uClibc.config
index bc6e72debf..bc6e72debf 100644
--- a/recipes/uclibc/uclibc-svn/i386/uClibc.config
+++ b/recipes/uclibc/uclibc-git/i386/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/i486/uClibc.config b/recipes/uclibc/uclibc-git/i486/uClibc.config
index 896d65ab20..896d65ab20 100644
--- a/recipes/uclibc/uclibc-svn/i486/uClibc.config
+++ b/recipes/uclibc/uclibc-git/i486/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/i586/uClibc.config b/recipes/uclibc/uclibc-git/i586/uClibc.config
index d1bf538902..d1bf538902 100644
--- a/recipes/uclibc/uclibc-svn/i586/uClibc.config
+++ b/recipes/uclibc/uclibc-git/i586/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/i686/uClibc.config b/recipes/uclibc/uclibc-git/i686/uClibc.config
index bc6e72debf..bc6e72debf 100644
--- a/recipes/uclibc/uclibc-svn/i686/uClibc.config
+++ b/recipes/uclibc/uclibc-git/i686/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/ixp4xx/uClibc.distro b/recipes/uclibc/uclibc-git/ixp4xx/uClibc.distro
index 7d54119f39..7d54119f39 100644
--- a/recipes/uclibc/uclibc-svn/ixp4xx/uClibc.distro
+++ b/recipes/uclibc/uclibc-git/ixp4xx/uClibc.distro
diff --git a/recipes/uclibc/uclibc-svn/ixp4xx/uClibc.machine b/recipes/uclibc/uclibc-git/ixp4xx/uClibc.machine
index 77e53bc1a8..77e53bc1a8 100644
--- a/recipes/uclibc/uclibc-svn/ixp4xx/uClibc.machine
+++ b/recipes/uclibc/uclibc-git/ixp4xx/uClibc.machine
diff --git a/recipes/uclibc/uclibc-svn/ldso_hash.patch b/recipes/uclibc/uclibc-git/ldso_hash.patch
index 974f564396..974f564396 100644
--- a/recipes/uclibc/uclibc-svn/ldso_hash.patch
+++ b/recipes/uclibc/uclibc-git/ldso_hash.patch
diff --git a/recipes/uclibc/uclibc-svn/linuxthreads-changes.patch b/recipes/uclibc/uclibc-git/linuxthreads-changes.patch
index f6f32cdd29..f6f32cdd29 100644
--- a/recipes/uclibc/uclibc-svn/linuxthreads-changes.patch
+++ b/recipes/uclibc/uclibc-git/linuxthreads-changes.patch
diff --git a/recipes/uclibc/uclibc-svn/magicbox/uClibc.config b/recipes/uclibc/uclibc-git/magicbox/uClibc.config
index 6542d49fd0..6542d49fd0 100644
--- a/recipes/uclibc/uclibc-svn/magicbox/uClibc.config
+++ b/recipes/uclibc/uclibc-git/magicbox/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/mipsel/uClibc.config b/recipes/uclibc/uclibc-git/mipsel/uClibc.config
index 4389c9b8c2..4389c9b8c2 100644
--- a/recipes/uclibc/uclibc-svn/mipsel/uClibc.config
+++ b/recipes/uclibc/uclibc-git/mipsel/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/powerpc/uClibc.config b/recipes/uclibc/uclibc-git/powerpc/uClibc.config
index 8a12c10961..8a12c10961 100644
--- a/recipes/uclibc/uclibc-svn/powerpc/uClibc.config
+++ b/recipes/uclibc/uclibc-git/powerpc/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/sh3/uClibc.config b/recipes/uclibc/uclibc-git/sh3/uClibc.config
index 1e2710715f..1e2710715f 100644
--- a/recipes/uclibc/uclibc-svn/sh3/uClibc.config
+++ b/recipes/uclibc/uclibc-git/sh3/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/sh4/uClibc.config b/recipes/uclibc/uclibc-git/sh4/uClibc.config
index 0b9a3c48b2..0b9a3c48b2 100644
--- a/recipes/uclibc/uclibc-svn/sh4/uClibc.config
+++ b/recipes/uclibc/uclibc-git/sh4/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/thumb-asm-swi.patch b/recipes/uclibc/uclibc-git/thumb-asm-swi.patch
index d09e40b7a3..d09e40b7a3 100644
--- a/recipes/uclibc/uclibc-svn/thumb-asm-swi.patch
+++ b/recipes/uclibc/uclibc-git/thumb-asm-swi.patch
diff --git a/recipes/uclibc/uclibc-svn/thumb-defined-arm-or-thumb.patch b/recipes/uclibc/uclibc-git/thumb-defined-arm-or-thumb.patch
index 6b73301bf7..6b73301bf7 100644
--- a/recipes/uclibc/uclibc-svn/thumb-defined-arm-or-thumb.patch
+++ b/recipes/uclibc/uclibc-git/thumb-defined-arm-or-thumb.patch
diff --git a/recipes/uclibc/uclibc-svn/thumb-mov-pc-bx.patch b/recipes/uclibc/uclibc-git/thumb-mov-pc-bx.patch
index 3d493514f8..3d493514f8 100644
--- a/recipes/uclibc/uclibc-svn/thumb-mov-pc-bx.patch
+++ b/recipes/uclibc/uclibc-git/thumb-mov-pc-bx.patch
diff --git a/recipes/webkit/webkit-gtk/acinclude.m4 b/recipes/uclibc/uclibc-git/uClibc.config
index e69de29bb2..e69de29bb2 100644
--- a/recipes/webkit/webkit-gtk/acinclude.m4
+++ b/recipes/uclibc/uclibc-git/uClibc.config
diff --git a/recipes/uclibc/uclibc-svn/uClibc.distro b/recipes/uclibc/uclibc-git/uClibc.distro
index 2f5e073ec1..2f5e073ec1 100644
--- a/recipes/uclibc/uclibc-svn/uClibc.distro
+++ b/recipes/uclibc/uclibc-git/uClibc.distro
diff --git a/recipes/uclibc/uclibc-svn/uclibc_enable_log2_test.patch b/recipes/uclibc/uclibc-git/uclibc_enable_log2_test.patch
index f8f3a7d1aa..f8f3a7d1aa 100644
--- a/recipes/uclibc/uclibc-svn/uclibc_enable_log2_test.patch
+++ b/recipes/uclibc/uclibc-git/uclibc_enable_log2_test.patch
diff --git a/recipes/uclibc/uclibc-svn/uclibc_mathc99.patch b/recipes/uclibc/uclibc-git/uclibc_mathc99.patch
index 6fbb11af6b..6fbb11af6b 100644
--- a/recipes/uclibc/uclibc-svn/uclibc_mathc99.patch
+++ b/recipes/uclibc/uclibc-git/uclibc_mathc99.patch
diff --git a/recipes/uclibc/uclibc-initial_svn.bb b/recipes/uclibc/uclibc-initial_git.bb
index e742fd55fd..38b85ef36f 100644
--- a/recipes/uclibc/uclibc-initial_svn.bb
+++ b/recipes/uclibc/uclibc-initial_git.bb
@@ -1,5 +1,5 @@
SECTION = "base"
-require uclibc_svn.bb
+require uclibc_git.bb
DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial"
PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
diff --git a/recipes/uclibc/uclibc.inc b/recipes/uclibc/uclibc.inc
index 55cff83b7e..3c723664d3 100644
--- a/recipes/uclibc/uclibc.inc
+++ b/recipes/uclibc/uclibc.inc
@@ -69,8 +69,9 @@ UCLIBC_LOCALE_URI = "http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE}"
UCLIBC_LOCALE_URI_arm = "http://wiki.openembedded.net/dl/uclibc-locale/${UCLIBC_LOCALE_FILE}"
SRC_URI = "${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \
- file://uClibc.config"
-
+ file://uClibc.config \
+ http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
+ "
UCLIBC_STAGE_PREFIX = "${STAGING_DIR_HOST}${layout_prefix}"
# do_stage barfs on a CC with whitepspace, therefore put the 'HOST_CC_ARCH' in
diff --git a/recipes/uclibc/uclibc_0.9.26.bb b/recipes/uclibc/uclibc_0.9.26.bb
index add217efb0..71fb7eb753 100644
--- a/recipes/uclibc/uclibc_0.9.26.bb
+++ b/recipes/uclibc/uclibc_0.9.26.bb
@@ -2,8 +2,9 @@ PR = "r12"
require uclibc.inc
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
- file://26headers.patch;patch=1 \
- file://nokernelheadercheck.patch;patch=1 \
- file://dyn-ldconfig.patch;patch=1"
+SRC_URI += "file://26headers.patch;patch=1 \
+ file://nokernelheadercheck.patch;patch=1 \
+ file://dyn-ldconfig.patch;patch=1 \
+ "
+
S = "${WORKDIR}/uClibc-${PV}"
diff --git a/recipes/uclibc/uclibc_0.9.27.bb b/recipes/uclibc/uclibc_0.9.27.bb
index 56575da4ac..7a9976d1d8 100644
--- a/recipes/uclibc/uclibc_0.9.27.bb
+++ b/recipes/uclibc/uclibc_0.9.27.bb
@@ -11,8 +11,7 @@ require uclibc.inc
PATCH_ipc_h ?= ""
PATCH_ipc_h_ixp4xx = "file://kernel-key-t-ipc.h.patch;patch=1"
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
- file://dyn-ldconfig.patch;patch=1 \
+SRC_URI += "file://dyn-ldconfig.patch;patch=1 \
file://nokernelheadercheck.patch;patch=1"
SRC_URI += " file://armeb-kernel-stat.h.patch;patch=1"
SRC_URI += "${PATCH_ipc_h}"
diff --git a/recipes/uclibc/uclibc_0.9.28.bb b/recipes/uclibc/uclibc_0.9.28.bb
index adf7a7400a..8ad4343313 100644
--- a/recipes/uclibc/uclibc_0.9.28.bb
+++ b/recipes/uclibc/uclibc_0.9.28.bb
@@ -9,8 +9,6 @@ require uclibc.inc
KERNEL_SOURCE = "${STAGING_DIR_HOST}/${exec_prefix}"
PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2"
-
S = "${WORKDIR}/uClibc-${PV}"
#*** PATCHES ***
diff --git a/recipes/uclibc/uclibc_0.9.29.bb b/recipes/uclibc/uclibc_0.9.29.bb
index f6bc68902d..de98a637c9 100644
--- a/recipes/uclibc/uclibc_0.9.29.bb
+++ b/recipes/uclibc/uclibc_0.9.29.bb
@@ -39,6 +39,4 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
#however: we can't depend on virtual/kernel when nptl hits due to depends deadlocking ....
KERNEL_SOURCE = "${STAGING_DIR_HOST}/${exec_prefix}"
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2"
-
S = "${WORKDIR}/uClibc-${UCLIBC_BASE}"
diff --git a/recipes/uclibc/uclibc_0.9.30.1.bb b/recipes/uclibc/uclibc_0.9.30.1.bb
index dbdcbb6740..39d7f52504 100644
--- a/recipes/uclibc/uclibc_0.9.30.1.bb
+++ b/recipes/uclibc/uclibc_0.9.30.1.bb
@@ -8,7 +8,6 @@
#
UCLIBC_BASE ?= "0.9.30.1"
PR = "r3"
-DEFAULT_PREFERENCE = "1"
require uclibc.inc
@@ -28,6 +27,4 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
#however: we can't depend on virtual/kernel when nptl hits due to depends deadlocking ....
KERNEL_SOURCE = "${STAGING_DIR_HOST}/${exec_prefix}"
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2"
-
S = "${WORKDIR}/uClibc-${UCLIBC_BASE}"
diff --git a/recipes/uclibc/uclibc_0.9.30.bb b/recipes/uclibc/uclibc_0.9.30.bb
index 317edf03a9..4d58b8904e 100644
--- a/recipes/uclibc/uclibc_0.9.30.bb
+++ b/recipes/uclibc/uclibc_0.9.30.bb
@@ -8,7 +8,6 @@
#
UCLIBC_BASE ?= "0.9.30"
PR = "r7"
-DEFAULT_PREFERENCE = "1"
require uclibc.inc
@@ -29,6 +28,4 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
#however: we can't depend on virtual/kernel when nptl hits due to depends deadlocking ....
KERNEL_SOURCE = "${STAGING_DIR_HOST}/${exec_prefix}"
-SRC_URI += "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2"
-
S = "${WORKDIR}/uClibc-${UCLIBC_BASE}"
diff --git a/recipes/uclibc/uclibc_svn.bb b/recipes/uclibc/uclibc_git.bb
index d3f09737c8..0660341786 100644
--- a/recipes/uclibc/uclibc_svn.bb
+++ b/recipes/uclibc/uclibc_git.bb
@@ -7,9 +7,9 @@
# on whether the base patches apply to the selected (SRCDATE) svn release.
#
UCLIBC_BASE ?= "0.9.30"
-PV = "${UCLIBC_BASE}+svnr${SRCREV}"
+SRCREV="b1913a876059949e6c309bafade55e9425ef33fb"
+PV = "${UCLIBC_BASE}+gitr${SRCREV}"
PR = "r1"
-#DEFAULT_PREFERENCE = "2"
#DEFAULT_PREFERENCE is 0 (empty), releases have a preference of 1 so take
# precedence.
@@ -19,13 +19,15 @@ PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
#recent versions uclibc require real kernel headers
PACKAGE_ARCH = "${MACHINE_ARCH}"
-FILESPATHPKG =. "uclibc-svn:uclibc-${UCLIBC_BASE}:"
+FILESPATHPKG =. "uclibc-git:uclibc-${UCLIBC_BASE}:"
#as stated above, uclibc needs real kernel-headers
#however: we can't depend on virtual/kernel when nptl hits due to depends deadlocking ....
KERNEL_SOURCE = "${CROSS_DIR}/${TARGET_SYS}"
-SRC_URI += "svn://uclibc.org/trunk;module=uClibc \
+SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
+ ${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \
+ file://uClibc.config \
file://uClibc.machine \
file://uClibc.distro \
file://uclibc-arm-ftruncate64.patch;patch=1 \
@@ -33,4 +35,4 @@ SRC_URI += "svn://uclibc.org/trunk;module=uClibc \
file://uclibc_ldso_use_O0.patch;patch=1 \
file://ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch;patch=1 \
"
-S = "${WORKDIR}/uClibc"
+S = "${WORKDIR}/git"
diff --git a/recipes/uclibc/uclibc_nptl.bb b/recipes/uclibc/uclibc_nptl.bb
index ba46a50933..aae486ae91 100644
--- a/recipes/uclibc/uclibc_nptl.bb
+++ b/recipes/uclibc/uclibc_nptl.bb
@@ -7,7 +7,8 @@
# on whether the base patches apply to the selected (SRCDATE) svn release.
#
UCLIBC_BASE ?= "0.9.30"
-PV = "${UCLIBC_BASE}+svnr${SRCREV}"
+SRCREV="10373d3ca64c1ec9c519933454a94b459b8fb4e7"
+PV = "${UCLIBC_BASE}+gitr${SRCREV}"
PR = "r1"
#DEFAULT_PREFERENCE = "2"
#DEFAULT_PREFERENCE is 0 (empty), releases have a preference of 1 so take
@@ -25,12 +26,14 @@ FILESPATHPKG =. "uclibc-nptl:uclibc-${UCLIBC_BASE}:"
#however: we can't depend on virtual/kernel when nptl hits due to depends deadlocking ....
KERNEL_SOURCE = "${CROSS_DIR}/${TARGET_SYS}"
-SRC_URI += "svn://uclibc.org/branches/;module=uClibc-nptl;rev=${SRCREV} \
- file://uClibc.machine \
- file://uClibc.distro \
- file://uclibc-arm-ftruncate64.patch;patch=1 \
- file://uclibc_ldso_use_O0.patch;patch=1 \
- file://ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch;patch=1 \
- "
+SRC_URI = "git://uclibc.org/uClibc.git;protocol=git;branch=nptl \
+ ${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \
+ file://uClibc.config \
+ file://uClibc.machine \
+ file://uClibc.distro \
+ file://uclibc-arm-ftruncate64.patch;patch=1 \
+ file://uclibc_ldso_use_O0.patch;patch=1 \
+ file://ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch;patch=1 \
+ "
-S = "${WORKDIR}/uClibc-nptl"
+S = "${WORKDIR}/git"
diff --git a/recipes/udev/udev_118.bb b/recipes/udev/udev_118.bb
index 7fcd4c546c..b7043496af 100644
--- a/recipes/udev/udev_118.bb
+++ b/recipes/udev/udev_118.bb
@@ -14,6 +14,7 @@ SRC_URI = "\
file://udevtrigger_add_devname_filtering.patch;patch=1 \
file://mount.blacklist \
"
+TARGET_CC_ARCH += "${LDFLAGS}"
require udev.inc
diff --git a/recipes/unzip/unzip_552.bb b/recipes/unzip/unzip_552.bb
index d8809196d8..16b63de2dd 100644
--- a/recipes/unzip/unzip_552.bb
+++ b/recipes/unzip/unzip_552.bb
@@ -2,8 +2,7 @@ DESCRIPTION = "A (de)compression library for the ZIP format"
SECTION = "console/utils"
LICENSE = "Info-ZIP"
PR = "r1"
-
-SRC_URI = "http://ftp.info-zip.org/pub/infozip/src/unzip${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/infozip/UnZip%205.x%20and%20earlier/5.52/unzip${PV}.tar.gz"
S = "${WORKDIR}/unzip-5.52"
export LD = "${CC} ${LDFLAGS}"
diff --git a/recipes/usbpath/usbpath-native_svn.bb b/recipes/usbpath/usbpath-native_svn.bb
index 3b5ef7bdcd..866e8777f2 100644
--- a/recipes/usbpath/usbpath-native_svn.bb
+++ b/recipes/usbpath/usbpath-native_svn.bb
@@ -1,6 +1,6 @@
require usbpath_svn.bb
inherit native
-DEPENDS = "libusb-native"
+DEPENDS = "virtual/libusb0-native"
do_stage () {
autotools_stage_all
diff --git a/recipes/usbpath/usbpath_svn.bb b/recipes/usbpath/usbpath_svn.bb
index 01ef343497..d21d320a7d 100644
--- a/recipes/usbpath/usbpath_svn.bb
+++ b/recipes/usbpath/usbpath_svn.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Convert the physical locations of a USB device to/from its number
AUTHOR = "Werner Almesberger <werner@openmoko.org>"
SECTION = "console/utils"
LICENSE = "GPL"
-DEPENDS = "libusb-compat"
+DEPENDS = "virtual/libusb0"
PV = "0.0+svnr${SRCREV}"
diff --git a/recipes/usbutils/usbutils_0.70.bb b/recipes/usbutils/usbutils_0.70.bb
index 891d66f381..7ec23278fa 100644
--- a/recipes/usbutils/usbutils_0.70.bb
+++ b/recipes/usbutils/usbutils_0.70.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Host side USB console utilities."
SECTION = "base"
-DEPENDS += "libusb-compat"
+DEPENDS += "virtual/libusb0"
LICENSE = "GPL"
PRIORITY = "optional"
DEFAULT_PREFERENCE = "1"
diff --git a/recipes/usbutils/usbutils_0.73.bb b/recipes/usbutils/usbutils_0.73.bb
index 3ec4ade107..ebbc306007 100644
--- a/recipes/usbutils/usbutils_0.73.bb
+++ b/recipes/usbutils/usbutils_0.73.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Host side USB console utilities."
SECTION = "base"
-DEPENDS += "libusb-compat"
+DEPENDS += "virtual/libusb0"
LICENSE = "GPL"
PRIORITY = "optional"
DEFAULT_PREFERENCE = "1"
diff --git a/recipes/usbutils/usbutils_0.82.bb b/recipes/usbutils/usbutils_0.82.bb
index c921a4a75e..436331dd5a 100644
--- a/recipes/usbutils/usbutils_0.82.bb
+++ b/recipes/usbutils/usbutils_0.82.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Host side USB console utilities."
SECTION = "base"
-DEPENDS += "libusb-compat"
+DEPENDS += "virtual/libusb0"
LICENSE = "GPL"
PRIORITY = "optional"
diff --git a/recipes/usbutils/usbutils_cvs.bb b/recipes/usbutils/usbutils_cvs.bb
index 5de33bbca3..9ef25c4984 100644
--- a/recipes/usbutils/usbutils_cvs.bb
+++ b/recipes/usbutils/usbutils_cvs.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Host side USB console utilities."
SECTION = "base"
-DEPENDS += "libusb-compat"
+DEPENDS += "virtual/libusb0"
LICENSE = "GPL"
PRIORITY = "optional"
PV = "0.71+cvs${SRCDATE}"
diff --git a/recipes/usrp/usrp_0.12.bb b/recipes/usrp/usrp_0.12.bb
index 55ca84857a..6302080368 100644
--- a/recipes/usrp/usrp_0.12.bb
+++ b/recipes/usrp/usrp_0.12.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Support software for the Universal Software Radio Peripheral (USR
LICENSE = "GPL"
HOMEPAGE = "http://comsec.com/wiki?UniversalSoftwareRadioPeripheral"
SECTION = "devel"
-DEPENDS = "swig-native sdcc-native libusb-compat python boost"
+DEPENDS = "swig-native sdcc-native virtual/libusb0 python boost"
RDEPENDS = "python-core"
PR = "r1"
diff --git a/recipes/util-linux-ng/files/uclibc-compile.patch b/recipes/util-linux-ng/files/uclibc-compile.patch
new file mode 100644
index 0000000000..def2336047
--- /dev/null
+++ b/recipes/util-linux-ng/files/uclibc-compile.patch
@@ -0,0 +1,25 @@
+Index: util-linux-ng-2.15/libs/blkid/src/blkidP.h
+===================================================================
+--- util-linux-ng-2.15.orig/libs/blkid/src/blkidP.h 2009-07-01 23:09:57.000000000 +0200
++++ util-linux-ng-2.15/libs/blkid/src/blkidP.h 2009-07-01 23:10:09.000000000 +0200
+@@ -18,6 +18,7 @@
+
+ #include <sys/types.h>
+ #include <stdio.h>
++#include <stdarg.h>
+
+ #include "bitops.h" /* $(top_srcdir)/include/ */
+ #include "blkid.h"
+Index: util-linux-ng-2.15/misc-utils/cal.c
+===================================================================
+--- util-linux-ng-2.15.orig/misc-utils/cal.c 2009-07-01 23:16:54.000000000 +0200
++++ util-linux-ng-2.15/misc-utils/cal.c 2009-07-01 23:17:08.000000000 +0200
+@@ -291,7 +291,7 @@
+ * the locale database, which can be overridden with the
+ * -s (Sunday) or -m (Monday) options.
+ */
+-#ifdef HAVE_LANGINFO_H
++#if defined(HAVE_LANGINFO_H) && !defined(__UCLIBC__)
+ /*
+ * You need to use 2 locale variables to get the first day of the week.
+ * This is needed to support first_weekday=2 and first_workday=1 for
diff --git a/recipes/util-linux-ng/util-linux-ng-2.16/tls.patch b/recipes/util-linux-ng/util-linux-ng-2.16/tls.patch
new file mode 100644
index 0000000000..bdb29cae1f
--- /dev/null
+++ b/recipes/util-linux-ng/util-linux-ng-2.16/tls.patch
@@ -0,0 +1,70 @@
+Index: util-linux-ng-2.16/m4/tls.m4
+===================================================================
+--- util-linux-ng-2.16.orig/m4/tls.m4 2009-07-04 01:20:03.000000000 +0200
++++ util-linux-ng-2.16/m4/tls.m4 2009-07-30 01:57:30.151697033 +0200
+@@ -18,31 +18,26 @@
+ # version as well.
+ #
+ AC_DEFUN([AX_TLS], [
+- AC_MSG_CHECKING(for thread local storage (TLS) class)
+- AC_CACHE_VAL(ac_cv_tls, [
+- ax_tls_keywords="__thread __declspec(thread) none"
+- for ax_tls_keyword in $ax_tls_keywords; do
+- case $ax_tls_keyword in
+- none) ac_cv_tls=none ; break ;;
+- *)
+- AC_TRY_COMPILE(
+- [#include <stdlib.h>
+- static void
+- foo(void) {
+- static ] $ax_tls_keyword [ int bar;
+- exit(1);
+- }],
+- [],
+- [ac_cv_tls=$ax_tls_keyword ; break],
+- ac_cv_tls=none
+- )
+- esac
+- done
+-])
++ AC_CACHE_CHECK([for thread local storage (TLS) class],
++ ac_cv_tls,
++ [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
++ [chktls_save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
++ chktls_save_CFLAGS="$CFLAGS"
++ CFLAGS="-fPIC $CFLAGS"
++ dnl If -shared works, test if TLS works in a shared library.
++ AC_LINK_IFELSE([int f() { return 0; }],
++ AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
++ [ac_cv_tls=yes],
++ [ac_cv_tls=no]),
++ [ac_cv_tls=yes])
++ CFLAGS="$chktls_save_CFLAGS"
++ LDFLAGS="$chktls_save_LDFLAGS"], [ac_cv_tls=no])
++ ])
+
+- if test "$ac_cv_tls" != "none"; then
+- dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+- AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+- fi
+- AC_MSG_RESULT($ac_cv_tls)
++ AS_IF([test "x$ac_cv_tls" = "xyes"],
++ [AC_DEFINE([TLS], 1,
++ [Define this if the compiler supports __thread for Thread-Local Storage])
++ $1],
++ [$2])
+ ])
+Index: util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c
+===================================================================
+--- util-linux-ng-2.16.orig/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:31:48.518159459 +0200
++++ util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:32:04.867871183 +0200
+@@ -99,7 +99,7 @@
+ #endif
+
+ #ifdef TLS
+-#define THREAD_LOCAL static TLS
++#define THREAD_LOCAL static __thread
+ #else
+ #define THREAD_LOCAL static
+ #endif
diff --git a/recipes/util-linux-ng/util-linux-ng-2.16/uclibc-compile.patch b/recipes/util-linux-ng/util-linux-ng-2.16/uclibc-compile.patch
new file mode 100644
index 0000000000..b2e8a8b95a
--- /dev/null
+++ b/recipes/util-linux-ng/util-linux-ng-2.16/uclibc-compile.patch
@@ -0,0 +1,13 @@
+Index: util-linux-ng-2.16/misc-utils/cal.c
+===================================================================
+--- util-linux-ng-2.16.orig/misc-utils/cal.c 2009-07-03 16:20:01.000000000 -0700
++++ util-linux-ng-2.16/misc-utils/cal.c 2009-07-18 23:21:37.000000000 -0700
+@@ -407,7 +407,7 @@
+ strcpy(day_headings,"");
+ strcpy(j_day_headings,"");
+
+-#ifdef HAVE_LANGINFO_H
++#ifdef HAVE_LANGINFO_H && !defined(__UCLIBC__)
+ # define weekday(wd) nl_langinfo(ABDAY_1+wd)
+ #else
+ # define weekday(wd) _time_info->abbrev_wkday[wd]
diff --git a/recipes/util-linux-ng/util-linux-ng.inc b/recipes/util-linux-ng/util-linux-ng.inc
index 59d2f0818b..837ff70330 100644
--- a/recipes/util-linux-ng/util-linux-ng.inc
+++ b/recipes/util-linux-ng/util-linux-ng.inc
@@ -1,14 +1,14 @@
DESCRIPTION = "Util-linux-ng is a suite of essential utilities for any Linux system."
SECTION = "base"
LICENSE = "GPL"
-DEPENDS = "udev zlib ncurses virtual/libintl e2fsprogs-libs"
+DEPENDS = "udev zlib ncurses virtual/libintl"
inherit autotools_stage
AUTOTOOLS_STAGE_PKGCONFIG = "1"
DEFAULT_PREFERENCE = "-1"
-INC_PR = "r6"
+INC_PR = "r7"
# allows for a release candidate
RC ?= ""
diff --git a/recipes/util-linux-ng/util-linux-ng_2.15.bb b/recipes/util-linux-ng/util-linux-ng_2.15.bb
index 1e36dd3ffc..0c2416fd16 100644
--- a/recipes/util-linux-ng/util-linux-ng_2.15.bb
+++ b/recipes/util-linux-ng/util-linux-ng_2.15.bb
@@ -4,6 +4,7 @@ PR = "${INC_PR}"
SRC_URI += "file://fix-make-c.patch;patch=1 \
file://optional-uuid.patch;patch=1 \
+ file://uclibc-compile.patch;patch=1 \
"
LDFLAGS_append = " -luuid"
diff --git a/recipes/util-linux-ng/util-linux-ng_2.16.bb b/recipes/util-linux-ng/util-linux-ng_2.16.bb
new file mode 100644
index 0000000000..c22219a816
--- /dev/null
+++ b/recipes/util-linux-ng/util-linux-ng_2.16.bb
@@ -0,0 +1,20 @@
+require util-linux-ng.inc
+
+PR = "${INC_PR}.2"
+
+SRC_URI += "file://uclibc-compile.patch;patch=1 \
+ file://tls.patch;patch=1 \
+ "
+
+EXTRA_OECONF += " --enable-libuuid --enable-libblkid \
+ --disable-fsck"
+LDFLAGS_append_libc-uclibc = " -lintl"
+PACKAGES_DYNAMIC += "libuuid*"
+
+do_configure_prepend_chinook-compat () {
+
+ for i in lt~obsolete.m4 ltsugar.m4 libtool.m4 ltoptions.m4 ltversion.m4
+ do
+ rm ${S}/m4/${i}
+ done
+}
diff --git a/recipes/webkit/webkit-gtk/GNUmakefile.am b/recipes/webkit/webkit-gtk/GNUmakefile.am
index c87ee49c14..c80d6493fa 100644
--- a/recipes/webkit/webkit-gtk/GNUmakefile.am
+++ b/recipes/webkit/webkit-gtk/GNUmakefile.am
@@ -84,6 +84,7 @@ corekit_cflags += \
-fno-strict-aliasing \
$(COVERAGE_CFLAGS) \
$(ENCHANT_CFLAGS) \
+ $(GAIL_CFLAGS) \
$(GEOCLUE_CFLAGS) \
$(GLIB_CFLAGS) \
$(GNOMEKEYRING_CFLAGS) \
@@ -243,6 +244,7 @@ libwebkit_1_0_la_LIBADD = \
$(COVERAGE_LDFLAGS) \
$(ENCHANT_LIBS) \
$(FREETYPE_LIBS) \
+ $(GAIL_LIBS) \
$(GEOCLUE_LIBS) \
$(GLIB_LIBS) \
$(GNOMEKEYRING_LIBS) \
@@ -524,11 +526,14 @@ webkit_tests_ldflags = \
-no-fast-install
TEST_PROGS += Programs/unittests/testhttpbackend \
+ Programs/unittests/testloading \
+ Programs/unittests/testnetworkrequest \
Programs/unittests/testwebframe \
Programs/unittests/testwebbackforwardlist \
Programs/unittests/testwebhistoryitem \
Programs/unittests/testdownload \
- Programs/unittests/testatk
+ Programs/unittests/testatk \
+ Programs/unittests/testwebsettings
# Add additional tests here
Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
@@ -536,6 +541,16 @@ Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
+Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
+Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
+
+Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
+Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
+
Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
@@ -561,6 +576,11 @@ Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
+Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
+Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
+
# Autogenerated sources
BUILT_SOURCES := \
$(javascriptcore_built_sources) \
diff --git a/recipes/webkit/webkit-gtk/WebKit.pri b/recipes/webkit/webkit-gtk/WebKit.pri
index a869906288..73288abc0f 100644
--- a/recipes/webkit/webkit-gtk/WebKit.pri
+++ b/recipes/webkit/webkit-gtk/WebKit.pri
@@ -2,21 +2,37 @@
isEmpty(OUTPUT_DIR) {
- CONFIG(release):OUTPUT_DIR=$$PWD/WebKitBuild/Release
- CONFIG(debug):OUTPUT_DIR=$$PWD/WebKitBuild/Debug
+ CONFIG(debug, debug|release) {
+ OUTPUT_DIR=$$PWD/WebKitBuild/Debug
+ } else { # Release
+ OUTPUT_DIR=$$PWD/WebKitBuild/Release
+ }
}
DEFINES += BUILDING_QT__=1
building-libs {
win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
} else {
- QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
- LIBS += -lQtWebKit
+ CONFIG(QTDIR_build) {
+ QT += webkit
+ } else {
+ QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
+ mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
+ LIBS += -framework QtWebKit
+ QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
+ } else {
+ win32-*|wince* {
+ LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
+ } else {
+ LIBS += -lQtWebKit
+ }
+ }
+ }
DEPENDPATH += $$PWD/WebKit/qt/Api
}
DEFINES += USE_SYSTEM_MALLOC
-CONFIG(release) {
+CONFIG(release, debug|release) {
DEFINES += NDEBUG
}
@@ -34,6 +50,8 @@ INCLUDEPATH += $$PWD/WebKit/qt/Api
defineTest(addExtraCompiler) {
CONFIG(QTDIR_build) {
outputRule = $$eval($${1}.output)
+ outVariable = $$eval($${1}.variable_out)
+ !isEqual(outVariable,GENERATED_SOURCES):return(true)
input = $$eval($${1}.input)
input = $$eval($$input)
diff --git a/recipes/webkit/webkit-gtk/WebKit.pro b/recipes/webkit/webkit-gtk/WebKit.pro
index 035f73aa3f..bb2ae976b7 100644
--- a/recipes/webkit/webkit-gtk/WebKit.pro
+++ b/recipes/webkit/webkit-gtk/WebKit.pro
@@ -2,11 +2,12 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += \
- JavaScriptCore \
WebCore \
- JavaScriptCore/kjs/jsc.pro \
+ JavaScriptCore/jsc.pro \
WebKit/qt/QtLauncher \
WebKit/qt/tests
-!win32-*: SUBDIRS += WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
+!win32:!symbian: SUBDIRS += WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro \
+ WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
+include(WebKit/qt/docs/docs.pri)
diff --git a/recipes/webkit/webkit-gtk/configure.ac b/recipes/webkit/webkit-gtk/configure.ac
index 19ce1eb553..4793e68b24 100644
--- a/recipes/webkit/webkit-gtk/configure.ac
+++ b/recipes/webkit/webkit-gtk/configure.ac
@@ -2,7 +2,14 @@ AC_PREREQ(2.59)
m4_define([webkit_major_version], [1])
m4_define([webkit_minor_version], [1])
-m4_define([webkit_micro_version], [8])
+m4_define([webkit_micro_version], [11])
+
+# This is the version we'll be using as part of our User-Agent string
+# e.g., AppleWebKit/$(webkit_user_agent_version) ...
+#
+# Sourced from WebCore/Configurations/Version.xcconfig
+m4_define([webkit_user_agent_major_version], [531])
+m4_define([webkit_user_agent_minor_version], [2])
AC_INIT([WebKit],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
@@ -16,15 +23,19 @@ AC_CANONICAL_HOST
WEBKIT_MAJOR_VERSION=webkit_major_version
WEBKIT_MINOR_VERSION=webkit_minor_version
WEBKIT_MICRO_VERSION=webkit_micro_version
+WEBKIT_USER_AGENT_MAJOR_VERSION=webkit_user_agent_major_version
+WEBKIT_USER_AGENT_MINOR_VERSION=webkit_user_agent_minor_version
AC_SUBST(WEBKIT_MAJOR_VERSION)
AC_SUBST(WEBKIT_MINOR_VERSION)
AC_SUBST(WEBKIT_MICRO_VERSION)
+AC_SUBST(WEBKIT_USER_AGENT_MAJOR_VERSION)
+AC_SUBST(WEBKIT_USER_AGENT_MINOR_VERSION)
AC_CONFIG_SRCDIR([WebCore/config.h])
dnl # Libtool library version, not to confuse with API version
dnl # see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html#Libtool-versioning
-LIBWEBKITGTK_VERSION=8:0:6
+LIBWEBKITGTK_VERSION=10:0:8
AC_SUBST([LIBWEBKITGTK_VERSION])
AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar])
@@ -176,6 +187,7 @@ if test "$with_hildon" = "yes"; then
fi
# minimum base dependencies
+LIBSOUP_REQUIRED_VERSION=2.27.4
CAIRO_REQUIRED_VERSION=1.2
FONTCONFIG_REQUIRED_VERSION=2.4
FREETYPE2_REQUIRED_VERSION=9.0
@@ -186,12 +198,12 @@ PANGO_REQUIRED_VERSION=1.0
GTK_REQUIRED_VERSION=2.10
# optional modules
-LIBSOUP_REQUIRED_VERSION=2.25.91
LIBXSLT_REQUIRED_VERSION=1.1.7
SQLITE_REQUIRED_VERSION=3.0
GSTREAMER_REQUIRED_VERSION=0.10
GNOME_KEYRING_REQUIRED_VERSION=2.26.0
ENCHANT_REQUIRED_VERSION=0.22
+GAIL_REQUIRED_VERSION=1.8
# Available modules
#
@@ -220,6 +232,10 @@ PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION)
AC_SUBST(ENCHANT_CFLAGS)
AC_SUBST(ENCHANT_LIBS)
+PKG_CHECK_MODULES(GAIL, gail >= $GAIL_REQUIRED_VERSION)
+AC_SUBST(GAIL_CFLAGS)
+AC_SUBST(GAIL_LIBS)
+
# check for target-specific dependencies
if test "$with_target" = "directfb"; then
PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
@@ -293,8 +309,8 @@ AC_MSG_RESULT([$enable_3D_transforms])
AC_MSG_CHECKING([whether to enable HTML5 Channel Messaging support])
AC_ARG_ENABLE(channel_messaging,
AC_HELP_STRING([--enable-channel-messaging],
- [enable HTML5 channel messaging support [default=no]]),
- [],[enable_channel_messaging="no"])
+ [enable HTML5 channel messaging support [default=yes]]),
+ [],[enable_channel_messaging="yes"])
AC_MSG_RESULT([$enable_channel_messaging])
# check whether to enable JavaScript debugger/profiler support
@@ -393,13 +409,21 @@ AC_ARG_ENABLE(wml,
[],[enable_wml="no"])
AC_MSG_RESULT([$enable_wml])
+# check whether to enable SharedWorkers support
+AC_MSG_CHECKING([whether to enable SharedWorkers support])
+AC_ARG_ENABLE(shared_workers,
+ AC_HELP_STRING([--enable-shared-workers],
+ [enable support for SharedWorkers [default=no]]),
+ [],[enable_shared_workers="no"])
+AC_MSG_RESULT([$enable_shared_workers])
+
# check whether to enable Web Workers support
AC_MSG_CHECKING([whether to enable Web Workers support])
-AC_ARG_ENABLE(web_workers,
- AC_HELP_STRING([--enable-web-workers],
+AC_ARG_ENABLE(workers,
+ AC_HELP_STRING([--enable-workers],
[enable support for Web Workers [default=yes]]),
- [],[enable_web_workers="yes"])
-AC_MSG_RESULT([$enable_web_workers])
+ [],[enable_workers="yes"])
+AC_MSG_RESULT([$enable_workers])
# turn off svg features if --disable-svg is requested
if test "$enable_svg" = "no"; then
@@ -407,7 +431,7 @@ if test "$enable_svg" = "no"; then
enable_svg_fonts=no
enable_svg_foreign_object=no
enable_svg_as_image=no
- enable_svg_use_element=no
+ enable_svg_use=no
fi
# check whether to enable support for SVG animation
@@ -452,18 +476,18 @@ AC_MSG_RESULT([$enable_svg_as_image])
# check whether to enable SVG USE element support
AC_MSG_CHECKING([whether to enable support for SVG use element])
-AC_ARG_ENABLE(svg_use_element,
- AC_HELP_STRING([--enable-svg-use-element],
+AC_ARG_ENABLE(svg_use,
+ AC_HELP_STRING([--enable-svg-use],
[enable SVG use element support (experimental) [default=yes]]),
- [],[enable_svg_use_element="yes"])
-AC_MSG_RESULT([$enable_svg_use_element])
+ [],[enable_svg_use="yes"])
+AC_MSG_RESULT([$enable_svg_use])
# check for SVG features, enabling SVG if necessary
if test "$enable_svg_animation" = "yes" || \
test "$enable_svg_fonts" = "yes" || \
test "$enable_svg_foreign_object" = "yes" || \
test "$enable_svg_as_image" = "yes" || \
- test "$enable_svg_use_element" = "yes"; then
+ test "$enable_svg_use" = "yes"; then
svg_flags=yes
if test "$enable_svg" = "no"; then
AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
@@ -494,10 +518,6 @@ AC_ARG_ENABLE([jit],
[],[enable_jit="yes"])
if test "$enable_jit" = "yes"; then
case "$host_cpu" in
- arm)
- AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
- AC_DEFINE([ENABLE_JIT_OPTIMIZE_METHOD_CALLS], [1], [Define to enable optimizing method calls])
- ;;
i*86|x86_64)
AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
@@ -674,11 +694,12 @@ AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
-AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
+AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use" = "yes"])
AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
-AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_web_workers" = "yes"])
+AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
+AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
@@ -717,14 +738,15 @@ Features:
HTML5 client-side database storage support : $enable_database
HTML5 video element support : $enable_video
Icon database support : $enable_icon_database
+ SharedWorkers support : $enable_shared_workers
SVG support : $enable_svg
SVG animation support : $enable_svg_animation
SVG fonts support : $enable_svg_fonts
SVG foreign object support : $enable_svg_foreign_object
SVG as image support : $enable_svg_as_image
- SVG use element support : $enable_svg_use_element
+ SVG use element support : $enable_svg_use
WML support : $enable_wml
- Web Workers support : $enable_web_workers
+ Web Workers support : $enable_workers
XPATH support : $enable_xpath
XSLT support : $enable_xslt
GTK+ configuration:
diff --git a/recipes/webkit/webkit-gtk/symbols.filter b/recipes/webkit/webkit-gtk/symbols.filter
deleted file mode 100644
index f5af6bac90..0000000000
--- a/recipes/webkit/webkit-gtk/symbols.filter
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-local:
-_ZSt*;
-_ZNSt*;
-};
diff --git a/recipes/webkit/webkit-gtk/unicode-fixes.diff b/recipes/webkit/webkit-gtk/unicode-fixes.diff
deleted file mode 100644
index 03dbc0f3d1..0000000000
--- a/recipes/webkit/webkit-gtk/unicode-fixes.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-Index: wtf/unicode/glib/UnicodeMacrosFromICU.h
-===================================================================
---- a/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h (revision 44458)
-+++ b/JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h (working copy)
-@@ -41,6 +41,17 @@
- #define U16_IS_SURROGATE(c) U_IS_SURROGATE(c)
- #define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
-
-+#define U16_PREV(s, start, i, c) { \
-+ (c)=(s)[--(i)]; \
-+ if(U16_IS_TRAIL(c)) { \
-+ uint16_t __c2; \
-+ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
-+ --(i); \
-+ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \
-+ } \
-+ } \
-+}
-+
- #define U16_NEXT(s, i, length, c) { \
- (c)=(s)[(i)++]; \
- if(U16_IS_LEAD(c)) { \
diff --git a/recipes/webkit/webkit-gtk/update-webkit.sh b/recipes/webkit/webkit-gtk/update-webkit.sh
index e4cc3ebefa..723c45a4fb 100644
--- a/recipes/webkit/webkit-gtk/update-webkit.sh
+++ b/recipes/webkit/webkit-gtk/update-webkit.sh
@@ -3,6 +3,6 @@
export rev=$1
-for i in acinclude.m4 autogen.sh configure.ac GNUmakefile.am Makefile Makefile.shared ; do
+for i in autogen.sh configure.ac GNUmakefile.am Makefile Makefile.shared ; do
wget "http://trac.webkit.org/browser/trunk/$i?rev=$rev&format=raw" -O $i
done
diff --git a/recipes/webkit/webkit-gtk_svn.bb b/recipes/webkit/webkit-gtk_svn.bb
index f36671c494..fcf7ccfa97 100644
--- a/recipes/webkit/webkit-gtk_svn.bb
+++ b/recipes/webkit/webkit-gtk_svn.bb
@@ -3,7 +3,7 @@ DEPENDS = "enchant gtk-doc-native gtk-doc gnome-keyring libsoup-2.4 curl icu lib
SRCREV_FORMAT = "webcore-rwebkit"
-PV = "1.1.7+svnr${SRCREV}"
+PV = "1.1.11+svnr${SRCREV}"
SRC_URI = "\
svn://svn.webkit.org/repository/webkit/trunk/;module=JavaScriptCore;proto=http \
@@ -17,10 +17,8 @@ SRC_URI = "\
file://Makefile.shared \
file://autogen.sh \
file://configure.ac \
- file://symbols.filter \
file://GNUmakefile.am \
file://gtk-doc.make \
- file://unicode-fixes.diff;patch=1;maxrev=44459 \
"
S = "${WORKDIR}/"
@@ -57,7 +55,7 @@ do_compile_prepend() {
${BUILD_CXX} dftables.cpp -o dftables -I. -I../wtf
fi
cp dftables ${S}/WebKitBuilds/Debug/JavaScriptCore/pcre/tmp/
- cp dftables ${S}/Programs/
+ cp dftables ${S}/Programs/
cd ${S}
}
diff --git a/recipes/xapian/xapian-core-native_1.0.13.bb b/recipes/xapian/xapian-core-native_1.0.13.bb
new file mode 100644
index 0000000000..584ec6d203
--- /dev/null
+++ b/recipes/xapian/xapian-core-native_1.0.13.bb
@@ -0,0 +1,6 @@
+require xapian-core_${PV}.bb
+
+inherit native
+
+S = "${WORKDIR}/xapian-core-${PV}"
+
diff --git a/recipes/xapian/xapian-core_1.0.13.bb b/recipes/xapian/xapian-core_1.0.13.bb
new file mode 100644
index 0000000000..5987b09491
--- /dev/null
+++ b/recipes/xapian/xapian-core_1.0.13.bb
@@ -0,0 +1,16 @@
+DESCRPITION = "Open Source Search Engine Library"
+HOMEPAGE = "http://xapian.org"
+SECTION = "devel/libs"
+PRIORITY = "optional"
+LICENSE = "GPL"
+DEPENDS = "zlib"
+PR = "r0"
+
+SRC_URI = "http://www.oligarchy.co.uk/xapian/${PV}/xapian-core-${PV}.tar.gz"
+
+inherit autotools pkgconfig
+
+do_stage () {
+ autotools_stage_all
+}
+
diff --git a/recipes/xmms/xmms_1.2.10.bb b/recipes/xmms/xmms_1.2.10.bb
index 0f81e87518..86421d89c4 100644
--- a/recipes/xmms/xmms_1.2.10.bb
+++ b/recipes/xmms/xmms_1.2.10.bb
@@ -10,7 +10,7 @@ SRC_URI = "http://www.xmms.org/files/1.2.x/xmms-${PV}.tar.bz2 \
file://xmms-config-dequote.patch;patch=1 \
file://acinclude.m4 \
file://xmms.sh"
-PR = "r4"
+PR = "r5"
RRECOMMENDS_${PN} = "xmms-plugin-output-oss xmms-plugin-output-alsa \
xmms-mad xmms-tremor"
@@ -36,9 +36,14 @@ do_configure_prepend() {
do_install_append() {
install -m 0755 ${WORKDIR}/xmms.sh ${D}${bindir}
install -d ${D}${datadir}/applications
- install xmms/xmms.desktop ${D}${datadir}/applications
- sed -i "s/Exec=xmms/Exec=xmms.sh/" ${D}${datadir}/applications/xmms.desktop
+
+ install xmms/xmms.desktop ${D}${datadir}/applications
+ sed -i "s/Exec=xmms/Exec=xmms.sh/" ${D}${datadir}/applications/xmms.desktop
+ sed -i "s/comment/Comment/" ${D}${datadir}/applications/xmms.desktop
+ sed -i "s/Encoding=Legacy-Mixed/StartupNotify=true/" ${D}${datadir}/applications/xmms.desktop
+ sed -i "s/Terminal=0/Terminal=false/" ${D}${datadir}/applications/xmms.desktop
sed -i "s/Type=Application/Type=Application\nCategories=AudioVideo;/" ${D}${datadir}/applications/xmms.desktop
+
install -d ${D}${datadir}/pixmaps
install xmms/xmms_mini.xpm ${D}${datadir}/pixmaps
}
diff --git a/recipes/xorg-driver/xf86-input-elographics_1.2.3.bb b/recipes/xorg-driver/xf86-input-elographics_1.2.3.bb
new file mode 100644
index 0000000000..cb49a58d4c
--- /dev/null
+++ b/recipes/xorg-driver/xf86-input-elographics_1.2.3.bb
@@ -0,0 +1,4 @@
+require xorg-driver-input.inc
+
+DESCRIPTION = "X.Org X server -- ELOGraphics input driver"
+PE = "2"
diff --git a/recipes/xorg-driver/xf86-video-intel_2.6.3.bb b/recipes/xorg-driver/xf86-video-intel_2.6.3.bb
new file mode 100644
index 0000000000..eed1fcb600
--- /dev/null
+++ b/recipes/xorg-driver/xf86-video-intel_2.6.3.bb
@@ -0,0 +1,5 @@
+require xorg-driver-video.inc
+
+DESCRIPTION = "X.Org X server -- Intel i8xx, i9xx display driver"
+DEPENDS += " virtual/libx11 libxvmc drm xf86driproto"
+PE = "1"
diff --git a/recipes/xorg-driver/xf86-video-sis_0.10.1.bb b/recipes/xorg-driver/xf86-video-sis_0.10.1.bb
new file mode 100644
index 0000000000..dc083b3e88
--- /dev/null
+++ b/recipes/xorg-driver/xf86-video-sis_0.10.1.bb
@@ -0,0 +1,11 @@
+require xorg-driver-video.inc
+
+DESCRIPTION = "X.Org X server -- SiS display driver"
+DEPENDS += " xineramaproto xf86miscproto xf86dgaproto drm xf86driproto"
+PE = "1"
+
+EXTRA_OECONF += " \
+ ac_cv_file__usr_include_xorg_dri_h=yes \
+ ac_cv_file__usr_include_xorg_sarea_h=yes \
+ ac_cv_file__usr_include_xorg_dristruct_h=yes \
+"
diff --git a/recipes/xorg-driver/xf86-video-vesa_2.2.0.bb b/recipes/xorg-driver/xf86-video-vesa_2.2.0.bb
new file mode 100644
index 0000000000..bd2f7cf7c1
--- /dev/null
+++ b/recipes/xorg-driver/xf86-video-vesa_2.2.0.bb
@@ -0,0 +1,9 @@
+require xorg-driver-video.inc
+PE = "1"
+
+SRC_URI += "file://fix-includepath.patch;patch=1 \
+ file://fix-configure-includes.patch;patch=1"
+
+#DESCRIPTION = ""
+
+#DEPENDS += " "
diff --git a/recipes/xorg-lib/libx11-trim/makekeys-update.patch b/recipes/xorg-lib/libx11-trim/makekeys-update.patch
new file mode 100644
index 0000000000..323dbbbbbd
--- /dev/null
+++ b/recipes/xorg-lib/libx11-trim/makekeys-update.patch
@@ -0,0 +1,87 @@
+From f8613deafdc7c6f3be49c3448e011426bcfdf78e Mon Sep 17 00:00:00 2001
+From: Holger Hans Peter Freyther <zecke@selfish.org>
+Date: Tue, 28 Jul 2009 03:20:20 +0200
+Subject: [PATCH] makekeys.c: Replace with the latest version to fix a segfault
+
+Fix a crash..
+---
+ src/util/makekeys.c | 28 +++++++++++++++++-----------
+ 1 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/src/util/makekeys.c b/src/util/makekeys.c
+index 214ea5c..3fe8a96 100644
+--- a/src/util/makekeys.c
++++ b/src/util/makekeys.c
+@@ -36,13 +36,10 @@ from The Open Group.
+ #include <X11/keysymdef.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
+-char *malloc();
+-#endif /* macII */
+
+ typedef unsigned long Signature;
+
+-#define KTNUM 3000
++#define KTNUM 4000
+
+ static struct info {
+ char *name;
+@@ -52,11 +49,11 @@ static struct info {
+ #define MIN_REHASH 15
+ #define MATCHES 10
+
+-char tab[KTNUM];
+-unsigned short offsets[KTNUM];
+-unsigned short indexes[KTNUM];
+-KeySym values[KTNUM];
+-char buf[1024];
++static char tab[KTNUM];
++static unsigned short offsets[KTNUM];
++static unsigned short indexes[KTNUM];
++static KeySym values[KTNUM];
++static char buf[1024];
+
+ int
+ main(int argc, char *argv[])
+@@ -103,12 +100,11 @@ main(int argc, char *argv[])
+ key);
+ continue;
+ }
+- name = malloc((unsigned)strlen(key)+1);
++ name = strdup(key);
+ if (!name) {
+ fprintf(stderr, "makekeys: out of memory!\n");
+ exit(1);
+ }
+- (void)strcpy(name, key);
+ info[ksnum].name = name;
+ ksnum++;
+ if (ksnum == KTNUM) {
+@@ -157,6 +153,11 @@ next1: ;
+ }
+
+ z = best_z;
++ if (z == 0) {
++ fprintf(stderr, "makekeys: failed to find small enough hash!\n"
++ "Try increasing KTNUM in makekeys.c\n");
++ exit(1);
++ }
+ printf("#ifdef NEEDKTABLE\n");
+ printf("const unsigned char _XkeyTable[] = {\n");
+ printf("0,\n");
+@@ -237,6 +238,11 @@ next2: ;
+ }
+
+ z = best_z;
++ if (z == 0) {
++ fprintf(stderr, "makekeys: failed to find small enough hash!\n"
++ "Try increasing KTNUM in makekeys.c\n");
++ exit(1);
++ }
+ for (i = z; --i >= 0;)
+ offsets[i] = 0;
+ for (i = 0; i < ksnum; i++) {
+--
+1.6.3.3
+
diff --git a/recipes/xorg-lib/libx11-trim_1.1.5.bb b/recipes/xorg-lib/libx11-trim_1.1.5.bb
index e99b2a07b0..9d08d25d81 100644
--- a/recipes/xorg-lib/libx11-trim_1.1.5.bb
+++ b/recipes/xorg-lib/libx11-trim_1.1.5.bb
@@ -14,7 +14,8 @@ PR = "r1"
XORG_PN = "libX11"
LEAD_SONAME = "libX11.so"
-SRC_URI += "file://include_fix.patch;patch=1"
+SRC_URI += "file://include_fix.patch;patch=1 \
+ file://makekeys-update.patch;patch=1"
EXTRA_OECONF += "--with-keysymdef=${STAGING_INCDIR}/X11/keysymdef.h"
#EXTRA_OECONF += "--disable-xlocale --disable-xcms --with-xcb"
diff --git a/recipes/xorg-lib/libxext_1.0.5.bb b/recipes/xorg-lib/libxext_1.0.5.bb
index 3e8aa50f7c..dea4b68862 100644
--- a/recipes/xorg-lib/libxext_1.0.5.bb
+++ b/recipes/xorg-lib/libxext_1.0.5.bb
@@ -1,7 +1,7 @@
require xorg-lib-common.inc
DESCRIPTION = "X11 miscellaneous extension library"
-DEPENDS += "xproto virtual/libx11 xextproto libxau"
+DEPENDS += "xproto virtual/libx11 xextproto libxau xdmcp"
PROVIDES = "xext"
PE = "1"
diff --git a/recipes/xorg-lib/pixman_git.bb b/recipes/xorg-lib/pixman_git.bb
index 6c05c0ca53..2ba06af67e 100644
--- a/recipes/xorg-lib/pixman_git.bb
+++ b/recipes/xorg-lib/pixman_git.bb
@@ -3,22 +3,26 @@ PRIORITY = "optional"
DESCRIPTION = "Low-level pixel manipulation library."
LICENSE = "X11"
-PV = "0.15.8"
+PV = "0.15.16"
PR = "r1"
PR_append = "+gitr${SRCREV}"
-SRCREV = "3c570a815afb282df01f41acad385ff0e3e33899"
+SRCREV = "f9660ce29ed072c6cbaec711c5d18b9f0ba113ae"
DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_angstrom = "1"
SRC_URI = "git://anongit.freedesktop.org/pixman;protocol=git \
-file://0041-Fix-filler-bug.patch;patch=1 \
-file://0042-Really-fix-filler-bug.patch;patch=1 \
"
S = "${WORKDIR}/git"
inherit autotools_stage
+NEON = " --disable-arm-neon "
+NEON_armv7a = ""
+
+EXTRA_OECONF = "${NEON}"
+
AUTOTOOLS_STAGE_PKGCONFIG = "1"
diff --git a/recipes/xorg-xserver/xserver-kdrive-1300_1.3.0.0.bb b/recipes/xorg-xserver/xserver-kdrive-1300_1.3.0.0.bb
index 36ea30955d..73aba4c0fc 100644
--- a/recipes/xorg-xserver/xserver-kdrive-1300_1.3.0.0.bb
+++ b/recipes/xorg-xserver/xserver-kdrive-1300_1.3.0.0.bb
@@ -5,6 +5,16 @@ FILESPATH = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/xserver-kdrive-1.3.
PKGN = xserver-kdrive-1300
require xserver-kdrive_1.3.0.0.bb
+PR_append = ".1"
+
+RPROVIDES_${PKGN}-fbdev_angstrom += "xserver-kdrive-fbdev"
+RREPLACES_${PKGN}-fbdev_angstrom += "xserver-kdrive-fbdev"
+RCONFLICTS_${PKGN}-fbdev_angstrom += "xserver-kdrive-fbdev"
+
+RREPLACES_${PN}_angstrom += xserver-kdrive
+RREPLACES_${PN}-dev_angstrom += xserver-kdrive-dev
+RREPLACES_${PN}-doc_angstrom += xserver-kdrive-doc
+
RPROVIDES_${PN} += xserver-kdrive
RPROVIDES_${PN}-dev += xserver-kdrive-dev
RPROVIDES_${PN}-doc += xserver-kdrive-doc
diff --git a/recipes/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf b/recipes/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf
new file mode 100644
index 0000000000..983bb0823a
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf
@@ -0,0 +1,29 @@
+Section "Module"
+ Load "extmod"
+ Load "dbe"
+ Load "glx"
+ Load "freetype"
+ Load "type1"
+ Load "record"
+ Load "dri"
+EndSection
+
+Section "Monitor"
+ Identifier "Builtin Default Monitor"
+EndSection
+
+Section "Device"
+ Identifier "Builtin Default fbdev Device 0"
+ Driver "omapfb"
+EndSection
+
+Section "Screen"
+ Identifier "Builtin Default fbdev Screen 0"
+ Device "Builtin Default fbdev Device 0"
+ Monitor "Builtin Default Monitor"
+EndSection
+
+Section "ServerLayout"
+ Identifier "Builtin Default Layout"
+ Screen "Builtin Default fbdev Screen 0"
+EndSection
diff --git a/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb b/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
index 67fc683090..d288091ea1 100644
--- a/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
+++ b/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Machine specific xorg.conf files"
-PR = "r5"
+PR = "r7"
SRC_URI = "file://xorg.conf"
@@ -9,4 +9,4 @@ do_install() {
}
CONFFILES_${PN} += "${sysconfdir}/X11/xorg.conf"
-
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/recipes/xorg-xserver/xserver-xorg/dolt-fix.patch b/recipes/xorg-xserver/xserver-xorg/dolt-fix.patch
new file mode 100644
index 0000000000..9e15f42e84
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-xorg/dolt-fix.patch
@@ -0,0 +1,22 @@
+Index: xorg-server-1.6.1/acinclude.m4
+===================================================================
+--- xorg-server-1.6.1.orig/acinclude.m4 2009-04-14 21:14:56.000000000 +0400
++++ xorg-server-1.6.1/acinclude.m4 2009-07-15 12:38:33.796848843 +0400
+@@ -147,7 +147,7 @@
+ cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
+ #!$DOLT_BASH
+ __DOLTLIBTOOL__EOF__
+- cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
++ cat <<'__DOLTLIBTOOL__EOF__' | sed -e "s/@host_alias@/$host_alias/g" >>doltlibtool
+ top_builddir_slash="${0%%doltlibtool}"
+ : ${top_builddir_slash:=./}
+ args=()
+@@ -163,7 +163,7 @@
+ if $modeok && $tagok ; then
+ . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
+ else
+- exec ${top_builddir_slash}libtool "$[]@"
++ exec ${top_builddir_slash}@host_alias@-libtool "$[]@"
+ fi
+ __DOLTLIBTOOL__EOF__
+
diff --git a/recipes/xorg-xserver/xserver-xorg_1.6.1.bb b/recipes/xorg-xserver/xserver-xorg_1.6.1.bb
index a177b19e6a..d8379eb396 100644
--- a/recipes/xorg-xserver/xserver-xorg_1.6.1.bb
+++ b/recipes/xorg-xserver/xserver-xorg_1.6.1.bb
@@ -6,7 +6,8 @@ RDEPENDS += "hal"
PE = "2"
PR = "r1"
-SRC_URI += "file://sysroot_fix.patch;patch=1"
+SRC_URI += "file://sysroot_fix.patch;patch=1 \
+ file://dolt-fix.patch;patch=1"
MESA_VER = "7.2"
diff --git a/recipes/xserver-common/files/ts-handling-cleanup.diff b/recipes/xserver-common/files/ts-handling-cleanup.diff
new file mode 100644
index 0000000000..ab6ab075ba
--- /dev/null
+++ b/recipes/xserver-common/files/ts-handling-cleanup.diff
@@ -0,0 +1,66 @@
+--- /tmp/Xserver 2009-07-21 12:53:26.000000000 +0200
++++ xserver-common-1.25/X11/Xserver 2009-07-21 12:53:41.000000000 +0200
+@@ -53,13 +53,13 @@
+ ARGS="-br -pn $INPUT_EXTRA_ARGS"
+
+ # use ucb 1x00 touchscreen if present
+-if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
++if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ] && [ "$XSERVER" != "Xorg" ] ; then
+ ARGS="$ARGS -mouse /dev/touchscreen/ucb1x00"
+ fi
+
+ # kdrive 1.4 onwards needs -mouse args
+ # Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
+-if [ -e "$TSLIB_TSDEVICE" ] ; then
++if [ -e "$TSLIB_TSDEVICE" ] && [ "$XSERVER" != "Xorg" ] ; then
+ ARGS="$ARGS -mouse tslib"
+ else
+ if [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ] ; then
+@@ -97,7 +97,7 @@
+ "Generic OMAP1510/1610/1710")
+ ARGS="$ARGS -dpi 220 -mouse /dev/input/event0" ;;
+ "TI-OSK")
+- ARGS="$ARGS -dpi 100 -mouse tslib" ;;
++ ARGS="$ARGS -dpi 100 " ;;
+ "Cellon C8000 Board")
+ ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE},10,1" ;;
+ "HTC Universal")
+@@ -105,13 +105,13 @@
+ "HTC Tornado")
+ ARGS="$ARGS -dpi 100 -hide-cursor" ;;
+ "Atmel AT91SAM9261-EK" | "Atmel AT91SAM9263-EK")
+- ARGS="$ARGS -mouse tslib -dpi 100 -rgba bgr -screen 240x320" ;;
++ ARGS="$ARGS -dpi 100 -rgba bgr -screen 240x320" ;;
+ "Generic OMAP1510/1610/1710" | "Nokia N770")
+- ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} -mouse tslib" ;;
++ ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} " ;;
+ "Nokia N800")
+- ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} -mouse tslib" ;;
++ ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} " ;;
+ "Nokia RX-44")
+- ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} -mouse tslib" ;;
++ ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} " ;;
+ "GTA01" )
+ ARGS="$ARGS -dpi 285"
+ if [ "$XSERVER" != "Xorg" ] ; then
+@@ -132,16 +132,16 @@
+ fi
+ ;;
+ "Boundary Devices Neon board")
+- ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} -mouse tslib"
++ ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} "
+ ;;
+ "Hoeft&Wessel HW90350")
+- ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} -mouse tslib"
++ ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} "
+ ;;
+ "Hoeft&Wessel HW90250")
+- ARGS="$ARGS -dpi 100 -screen 240x320@90 -mouse tslib"
++ ARGS="$ARGS -dpi 100 -screen 240x320@90 "
+ ;;
+ "MINI2440")
+- ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} -mouse tslib"
++ ARGS="$ARGS -dpi 100 -screen ${SCREEN_SIZE} "
+ ;;
+ # This is a fallback for PCs
+ "")
diff --git a/recipes/xserver-common/files/xtscal-fix.patch b/recipes/xserver-common/files/xtscal-fix.patch
new file mode 100644
index 0000000000..eca9276be0
--- /dev/null
+++ b/recipes/xserver-common/files/xtscal-fix.patch
@@ -0,0 +1,16 @@
+--- xserver-common-1.22/run-calibrate.sh-orig 2007-07-12 11:21:28.000000000 -0700
++++ xserver-common-1.22/run-calibrate.sh 2009-02-18 06:42:00.000000000 -0800
+@@ -1,12 +1,8 @@
+ #! /bin/sh
+
+-if [ -x /usr/bin/xtscal ]; then
+- exec /usr/bin/xtscal
+-else
++if [ -e /dev/input/touchscreen0 ]; then
+ if [ -x /usr/bin/ts_calibrate ]; then
+ exec /usr/bin/ts_calibrate
+ fi
+ fi
+
+-exec xtscal
+-
diff --git a/recipes/xserver-common/xserver-common-1.30/0018-zaurus-fixed-machine-names.patch b/recipes/xserver-common/xserver-common-1.30/0018-zaurus-fixed-machine-names.patch
new file mode 100644
index 0000000000..d6d6aa80f1
--- /dev/null
+++ b/recipes/xserver-common/xserver-common-1.30/0018-zaurus-fixed-machine-names.patch
@@ -0,0 +1,35 @@
+From a287e6414a765926fc7b169617bc1174370bc183 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Date: Mon, 20 Jul 2009 18:57:56 +0200
+Subject: [PATCH 18/22] zaurus: fixed machine names
+
+
+Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+---
+ X11/Xinit.d/11zaurus | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/X11/Xinit.d/11zaurus b/X11/Xinit.d/11zaurus
+index 02090be..54ea6f5 100644
+--- a/X11/Xinit.d/11zaurus
++++ b/X11/Xinit.d/11zaurus
+@@ -13,14 +13,14 @@ fi
+ $CHCK -e
+ if [ $? = 12 ]; then
+ case `machine_id` in
+- *Spitz | *Akita | *Borzoi)
++ *spitz | *akita | *borzoi)
+ DIRECTION="normal" ;;
+ *)
+ DIRECTION="right" ;;
+ esac
+ else
+ case `machine_id` in
+- *Spitz | *Akita | *Borzoi)
++ *spitz | *akita | *borzoi)
+ # Xfbdev needs to settle
+ sleep 2
+ DIRECTION="right" ;;
+--
+1.6.3.3
+
diff --git a/recipes/xserver-common/xserver-common-1.30/0019-keymap-fixed-machine-names.patch b/recipes/xserver-common/xserver-common-1.30/0019-keymap-fixed-machine-names.patch
new file mode 100644
index 0000000000..9a4e561518
--- /dev/null
+++ b/recipes/xserver-common/xserver-common-1.30/0019-keymap-fixed-machine-names.patch
@@ -0,0 +1,59 @@
+From e564699c60d69148e19150dc9d2105734b1df7e1 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Date: Mon, 20 Jul 2009 18:58:54 +0200
+Subject: [PATCH 19/22] keymap: fixed machine names
+
+
+Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+---
+ X11/Xinit.d/12keymap | 18 +++++++++---------
+ 1 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/X11/Xinit.d/12keymap b/X11/Xinit.d/12keymap
+index 0a909d0..cfa9750 100644
+--- a/X11/Xinit.d/12keymap
++++ b/X11/Xinit.d/12keymap
+@@ -1,31 +1,31 @@
+ #!/bin/sh
+
+-MACHINE=`awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo`
++. /etc/init.d/functions
+
+ # since kdrive 1.4 there is no default keymap in server
+ xmodmap - </etc/X11/xmodmap/default.xmodmap
+
+-case $MACHINE in
+- "SHARP Shepherd" | "SHARP Husky" | "SHARP Corgi")
++case `machine_id` in
++ "sharp shepherd" | "sharp husky" | "sharp corgi")
+ xmodmap - < /etc/X11/xmodmap/shepherd.xmodmap
+ ;;
+- "SHARP Akita" | "SHARP Borzoi" | "SHARP Spitz")
++ "sharp akita" | "sharp borzoi" | "sharp spitz")
+ xmodmap - < /etc/X11/xmodmap/slcXXXX.xmodmap
+ ;;
+- "SHARP Poodle")
++ "sharp poodle")
+ xmodmap - < /etc/X11/xmodmap/poodle.xmodmap
+ ;;
+- "Sharp-Collie")
++ "sharp-collie")
+ xmodmap - < /etc/X11/xmodmap/collie.xmodmap
+ ;;
+- "HP iPAQ h6300")
++ "hp ipaq h6300")
+ xmodmap - < /etc/X11/xmodmap/h6300.xmodmap
+ ;;
+- "TI-OSK")
++ "ti-osk")
+ xmodmap - < /etc/X11/xmodmap/omap5912osk.xmodmap
+ ;;
+ # All the rest of keyboardless PDA machines use common buttonmap
+- "Simpad" | "HP iPAQ"* | "Asus MyPal"*)
++ "simpad" | "hp ipaq"* | "asus mypal"*)
+ xmodmap - < /etc/X11/xmodmap/keyboardless.xmodmap
+ ;;
+ esac
+--
+1.6.3.3
+
diff --git a/recipes/xserver-common/xserver-common-1.30/0020-keymap-fixed-machine-names-again.patch b/recipes/xserver-common/xserver-common-1.30/0020-keymap-fixed-machine-names-again.patch
new file mode 100644
index 0000000000..f14f5ae3b2
--- /dev/null
+++ b/recipes/xserver-common/xserver-common-1.30/0020-keymap-fixed-machine-names-again.patch
@@ -0,0 +1,50 @@
+From f216da13941685575786e617c2cc072edd5b210c Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Date: Mon, 20 Jul 2009 19:01:08 +0200
+Subject: [PATCH 20/22] keymap: fixed machine names again
+
+
+Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+---
+ X11/Xinit.d/12keymap | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/X11/Xinit.d/12keymap b/X11/Xinit.d/12keymap
+index cfa9750..7eac296 100644
+--- a/X11/Xinit.d/12keymap
++++ b/X11/Xinit.d/12keymap
+@@ -6,26 +6,26 @@
+ xmodmap - </etc/X11/xmodmap/default.xmodmap
+
+ case `machine_id` in
+- "sharp shepherd" | "sharp husky" | "sharp corgi")
++ "sharp_shepherd" | "sharp_husky" | "sharp_corgi")
+ xmodmap - < /etc/X11/xmodmap/shepherd.xmodmap
+ ;;
+- "sharp akita" | "sharp borzoi" | "sharp spitz")
++ "sharp_akita" | "sharp_borzoi" | "sharp_spitz")
+ xmodmap - < /etc/X11/xmodmap/slcXXXX.xmodmap
+ ;;
+- "sharp poodle")
++ "sharp_poodle")
+ xmodmap - < /etc/X11/xmodmap/poodle.xmodmap
+ ;;
+ "sharp-collie")
+ xmodmap - < /etc/X11/xmodmap/collie.xmodmap
+ ;;
+- "hp ipaq h6300")
++ "hp_ipaq_h6300")
+ xmodmap - < /etc/X11/xmodmap/h6300.xmodmap
+ ;;
+ "ti-osk")
+ xmodmap - < /etc/X11/xmodmap/omap5912osk.xmodmap
+ ;;
+ # All the rest of keyboardless PDA machines use common buttonmap
+- "simpad" | "hp ipaq"* | "asus mypal"*)
++ "simpad" | "hp_ipaq"* | "asus_mypal"*)
+ xmodmap - < /etc/X11/xmodmap/keyboardless.xmodmap
+ ;;
+ esac
+--
+1.6.3.3
+
diff --git a/recipes/xserver-common/xserver-common-1.30/0021-xserver-introduced-MOUSE-variable-for-mouse-argument.patch b/recipes/xserver-common/xserver-common-1.30/0021-xserver-introduced-MOUSE-variable-for-mouse-argument.patch
new file mode 100644
index 0000000000..4d9bfa21e8
--- /dev/null
+++ b/recipes/xserver-common/xserver-common-1.30/0021-xserver-introduced-MOUSE-variable-for-mouse-argument.patch
@@ -0,0 +1,63 @@
+From 3ada7e341334766f6be27164dbb43a3715faf580 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Date: Tue, 21 Jul 2009 13:36:17 +0200
+Subject: [PATCH 21/22] xserver: introduced MOUSE variable for "-mouse" argument
+
+MOUSE is not passed in ARGS if Xorg server is used as it is KDrive only.
+
+Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+---
+ X11/Xserver | 13 +++++++++----
+ 1 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/X11/Xserver b/X11/Xserver
+index 25ce816..e7e88d9 100755
+--- a/X11/Xserver
++++ b/X11/Xserver
+@@ -46,19 +46,20 @@ export XSERVER_DEFAULT_ORIENTATION=normal
+
+ ARGS="-br -pn $INPUT_EXTRA_ARGS"
+ DPI="100"
++MOUSE=""
+
+ # use ucb 1x00 touchscreen if present
+ if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
+- ARGS="$ARGS -mouse /dev/touchscreen/ucb1x00"
++ MOUSE="-mouse /dev/touchscreen/ucb1x00"
+ fi
+
+ # kdrive 1.4 onwards needs -mouse args
+ # Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
+ if [ -e "$TSLIB_TSDEVICE" ] ; then
+- ARGS="$ARGS -mouse tslib"
++ MOUSE="-mouse tslib"
+ else
+ if [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ] ; then
+- ARGS="$ARGS -mouse mouse"
++ MOUSE="-mouse mouse"
+ fi
+ fi
+
+@@ -103,7 +104,7 @@ else
+ ARGS="$ARGS -rgba rgb"
+ DPI="100" ;;
+ "generic_omap1510/1610/1710")
+- ARGS="$ARGS -mouse /dev/input/event0"
++ MOUSE="-mouse /dev/input/event0"
+ DPI="220" ;;
+ "ti-osk")
+ DPI="100" ;;
+@@ -183,6 +184,10 @@ else
+ esac
+ fi
+
++if [ "$XSERVER" != "Xorg" ] ; then
++ ARGS="$ARGS $MOUSE"
++fi
++
+ echo "tslib: $TSLIB_TSDEVICE"
+ echo "exec $XSERVER $ARGS -dpi $DPI $*"
+ exec $XSERVER $ARGS -dpi $DPI $*
+--
+1.6.3.3
+
diff --git a/recipes/xserver-common/xserver-common-1.30/0022-xserver-fix-syntax-error.patch b/recipes/xserver-common/xserver-common-1.30/0022-xserver-fix-syntax-error.patch
new file mode 100644
index 0000000000..e96fabf064
--- /dev/null
+++ b/recipes/xserver-common/xserver-common-1.30/0022-xserver-fix-syntax-error.patch
@@ -0,0 +1,27 @@
+From 00cbc2b27c7df84d7837760e05ac13b686e6bfa9 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Date: Thu, 23 Jul 2009 12:04:12 +0200
+Subject: [PATCH 22/22] xserver: fix syntax error
+
+
+Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+---
+ X11/Xserver | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/X11/Xserver b/X11/Xserver
+index e7e88d9..3d93a0a 100755
+--- a/X11/Xserver
++++ b/X11/Xserver
+@@ -63,7 +63,7 @@ else
+ fi
+ fi
+
+-if [ -e /etc/default/xserver ]
++if [ -e /etc/default/xserver ] ; then
+ . /etc/default/xserver
+ else
+ # start off server in conventional location.
+--
+1.6.3.3
+
diff --git a/recipes/xserver-common/xserver-common_1.25.bb b/recipes/xserver-common/xserver-common_1.25.bb
index 9db0c2a8d2..b55e0e5ce1 100644
--- a/recipes/xserver-common/xserver-common_1.25.bb
+++ b/recipes/xserver-common/xserver-common_1.25.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Common X11 scripts and support files"
LICENSE = "GPL"
SECTION = "x11"
RDEPENDS_${PN} = "xmodmap xrandr xdpyinfo"
-PR = "r1"
+PR = "r3"
PACKAGE_ARCH = "all"
@@ -12,8 +12,12 @@ inherit gpe
SRC_URI_append = " file://setDPI.sh \
file://89xdgautostart.sh \
file://avoid-rotated-server.patch;patch=1 \
+ file://ts-handling-cleanup.diff;patch=1 \
"
+SRC_URI_append_angstrom = " file://xtscal-fix.patch;patch=1 "
+RDEPENDS_append_angstrom = " tslib-calibrate "
+
do_install_append() {
install -m 0755 "${WORKDIR}/setDPI.sh" "${D}/etc/X11/Xinit.d/50setdpi"
install -m 0755 "${WORKDIR}/89xdgautostart.sh" "${D}/etc/X11/Xsession.d/89xdgautostart"
diff --git a/recipes/xserver-common/xserver-common_1.30.bb b/recipes/xserver-common/xserver-common_1.30.bb
new file mode 100644
index 0000000000..3f3e7f889f
--- /dev/null
+++ b/recipes/xserver-common/xserver-common_1.30.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "Common X11 scripts and support files"
+LICENSE = "GPL"
+SECTION = "x11"
+RDEPENDS_${PN} = "xmodmap xrandr xdpyinfo"
+PR = "r2"
+
+PACKAGE_ARCH = "all"
+DEFAULT_PREFERENCE = "-1"
+
+# we are using a gpe-style Makefile
+inherit gpe
+
+SRC_URI_append = " file://setDPI.sh \
+ file://89xdgautostart.sh \
+file://0018-zaurus-fixed-machine-names.patch;patch=1 \
+file://0019-keymap-fixed-machine-names.patch;patch=1 \
+file://0020-keymap-fixed-machine-names-again.patch;patch=1 \
+file://0021-xserver-introduced-MOUSE-variable-for-mouse-argument.patch;patch=1 \
+file://0022-xserver-fix-syntax-error.patch;patch=1 \
+"
+
+do_install_append() {
+ install -m 0755 "${WORKDIR}/setDPI.sh" "${D}/etc/X11/Xinit.d/50setdpi"
+ install -m 0755 "${WORKDIR}/89xdgautostart.sh" "${D}/etc/X11/Xsession.d/89xdgautostart"
+ sed -i 's:^BINDIR=.*$:BINDIR=${bindir}:' ${D}/etc/X11/Xserver
+}
diff --git a/recipes/zaurusd/files/avoid-rotated-server.patch b/recipes/zaurusd/files/avoid-rotated-server.patch
index 0ee601222e..8d724017dc 100644
--- a/recipes/zaurusd/files/avoid-rotated-server.patch
+++ b/recipes/zaurusd/files/avoid-rotated-server.patch
@@ -16,12 +16,9 @@ Index: zaurusd/config/mach-config/mach-borzoi-vars.in
===================================================================
--- zaurusd.orig/config/mach-config/mach-borzoi-vars.in 2009-03-07 11:04:43.000000000 +0000
+++ zaurusd/config/mach-config/mach-borzoi-vars.in 2009-06-22 20:51:00.000000000 +0000
-@@ -5,6 +5,9 @@
- SWITCH_EVENT_DEVICE=/dev/input/event0
-
+@@ -7,4 +7,7 @@
TSKEYS_CONF=@appconfdir@/tskeys/zaurus-cxx00.conf
--TSKEYS_DEVICE=/dev/input/event1
-+TSKEYS_DEVICE=/dev/input/touchscreen0
+ TSKEYS_DEVICE=/dev/input/event1
-ALSA_MIXER_INIT=@appconfdir@/alsa/cxx00-default.state
\ No newline at end of file